Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update cocos2d to 3.3beta0 #38

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion Classes/AppDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ bool AppDelegate::applicationDidFinishLaunching() {
height = 640;
width = height*(960.0/640.0);

glview = GLView::createWithRect("TankMultiplayer", Rect(0, 0, 960, 640));
glview = GLViewImpl::createWithRect("TankMultiplayer", Rect(0, 0, 960, 640));

director->setOpenGLView(glview);
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/GameScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ void GameScene::showBloodLossNum(Hero* hero, int num)
turnTTFConfig.fontFilePath = "britanic bold.ttf";
bloodLossLabel = Label::createWithTTF(turnTTFConfig, Value(num).asString(), TextHAlignment::CENTER, 400);
bloodLossLabel->setAnchorPoint(Point::ANCHOR_MIDDLE);
bloodLossLabel->setSpacing(-5);
//bloodLossLabel->setSpacing(-5);
bloodLossLabel->enableOutline(Color4B::BLACK);
bloodLossLabel->setOpacity(50);
bloodLossLabel->setScale(-10.01f);
Expand Down
4 changes: 2 additions & 2 deletions Classes/GameUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ bool PlayBackIndictaor::init(){
_turnInfoLabel = Label::createWithTTF(turnTTFConfig, "PLAYBACK ENEMY‘S TURN", TextHAlignment::CENTER, 500);
_turnInfoLabel->setAnchorPoint(Point::ANCHOR_MIDDLE_LEFT);
_turnInfoLabel->setPosition(-310, 105);
_turnInfoLabel->setSpacing(-5);
//_turnInfoLabel->setSpacing(-5);
_turnInfoLabel->enableOutline(Color4B::BLACK);
addChild(_turnInfoLabel);

Expand All @@ -274,7 +274,7 @@ bool PlayBackIndictaor::init(){
_timeLabel = Label::createWithTTF(timeTTFConfig, "0'13:200", TextHAlignment::CENTER, 150);
_timeLabel->setAnchorPoint(Point::ANCHOR_MIDDLE_RIGHT);
_timeLabel->setPosition(350, 105);
_timeLabel->setSpacing(-5);
//_timeLabel->setSpacing(-5);
_timeLabel->enableOutline(Color4B::BLACK);
addChild(_timeLabel);

Expand Down
6 changes: 3 additions & 3 deletions Classes/Helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void DepthOn::onDraw()
glEnable(GL_DEPTH_TEST);
}

void DepthOn::visit(Renderer *renderer, const kmMat4& parentTransform, bool parentTransformUpdated)
void DepthOn::visit(Renderer *renderer, const cocos2d::Mat4& parentTransform, uint32_t parentFlags)
{
_customCommand.init(_globalZOrder);
_customCommand.func = CC_CALLBACK_0(DepthOn::onDraw, this);
Expand All @@ -58,14 +58,14 @@ void DepthOff::onDraw()
glDisable(GL_DEPTH_TEST);
}

void DepthOff::visit(Renderer *renderer, const kmMat4& parentTransform, bool parentTransformUpdated)
void DepthOff::visit(Renderer *renderer, const cocos2d::Mat4& parentTransform, uint32_t parentFlags)
{
_customCommand.init(_globalZOrder);
_customCommand.func = CC_CALLBACK_0(DepthOff::onDraw, this);
cocos2d::Director::getInstance()->getRenderer()->addCommand(&_customCommand);
}

void CollisionCheckNode::visit(Renderer *renderer, const kmMat4& parentTransform, bool parentTransformUpdated)
void CollisionCheckNode::visit(Renderer *renderer, const cocos2d::Mat4& parentTransform, uint32_t parentFlags)
{
_customCommand.init(_globalZOrder);
_customCommand.func = CC_CALLBACK_0(CollisionCheckNode::checkCollision, this);
Expand Down
6 changes: 3 additions & 3 deletions Classes/Helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DepthOn : public cocos2d::Node
{
public:
void onDraw();
virtual void visit(cocos2d::Renderer *renderer, const kmMat4& parentTransform, bool parentTransformUpdated);
virtual void visit(cocos2d::Renderer *renderer, const cocos2d::Mat4& parentTransform, uint32_t parentFlags);
CREATE_FUNC(DepthOn);
protected:
cocos2d::CustomCommand _customCommand;
Expand All @@ -36,7 +36,7 @@ class DepthOff : public cocos2d::Node
{
public:
void onDraw();
virtual void visit(cocos2d::Renderer *renderer, const kmMat4& parentTransform, bool parentTransformUpdated);
virtual void visit(cocos2d::Renderer *renderer, const cocos2d::Mat4& parentTransform, uint32_t parentFlags);
CREATE_FUNC(DepthOff);
protected:
cocos2d::CustomCommand _customCommand;
Expand All @@ -46,7 +46,7 @@ class CollisionCheckNode : public cocos2d::Node
{
public:
void checkCollision();
virtual void visit(cocos2d::Renderer *renderer, const kmMat4& parentTransform, bool parentTransformUpdated);
virtual void visit(cocos2d::Renderer *renderer, const cocos2d::Mat4& parentTransform, uint32_t parentFlags);
CollisionCheckNode* create(cocos2d::ParallaxNode* game, cocos2d::Layer* player, cocos2d::Layer* bullet, cocos2d::RenderTexture* terrain);
CC_SYNTHESIZE(cocos2d::RenderTexture*, _level, Level);
CC_SYNTHESIZE(cocos2d::Layer*, _bullets, BulletLayer);
Expand Down
4 changes: 2 additions & 2 deletions Classes/Hero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ bool Hero::init(Side side, Body body, Wagon wagon, bool isfacetoright, std::stri
ttfConfig.fontFilePath = "arial.ttf";
_nameLabel = Label::createWithTTF(ttfConfig, name.c_str(), TextHAlignment::CENTER, 200);
_nameLabel->setPositionY(-50);
_nameLabel->setSpacing(-5);
//_nameLabel->setSpacing(-5);
_nameLabel->setAnchorPoint(Point::ANCHOR_MIDDLE);
_nameLabel->enableOutline(Color4B::BLACK);
if(_heroConfig.side == Myself){
Expand All @@ -171,7 +171,7 @@ bool Hero::init(Side side, Body body, Wagon wagon, bool isfacetoright, std::stri
angleTTFConfig.fontFilePath = "arial.ttf";
_angleLabel = Label::createWithTTF(angleTTFConfig, "0", TextHAlignment::CENTER, 30);
_angleLabel->setPosition(75, -30);
_angleLabel->setSpacing(-5);
//_angleLabel->setSpacing(-5);
_angleLabel->enableOutline(Color4B::BLACK);
_angleLabel->setAnchorPoint(Point::ANCHOR_MIDDLE);
this->addChild(_angleLabel,2);
Expand Down
6 changes: 3 additions & 3 deletions Classes/MaskSprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ bool MaskSprite::initShader()
return true;
}

void MaskSprite::draw(cocos2d::Renderer *renderer, const kmMat4 &transform, bool transformUpdated)
void MaskSprite::draw(cocos2d::Renderer *renderer, const cocos2d::Mat4 &transform, uint32_t flags)
{
_customCommand.init(_globalZOrder);
_customCommand.func = CC_CALLBACK_0(MaskSprite::onDraw, this, transform, transformUpdated);
_customCommand.func = CC_CALLBACK_0(MaskSprite::onDraw, this, transform, flags);
cocos2d::Director::getInstance()->getRenderer()->addCommand(&_customCommand);
}

void MaskSprite::onDraw(const kmMat4 &transform, bool transformUpdated)
void MaskSprite::onDraw(const cocos2d::Mat4 &transform, uint32_t flags)
{
auto shader = getShaderProgram();
shader->use();
Expand Down
4 changes: 2 additions & 2 deletions Classes/MaskSprite.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class MaskSprite : public cocos2d::Sprite
protected:
cocos2d::Texture2D * _content;

virtual void draw(cocos2d::Renderer* renderer, const kmMat4 &transform, bool transformUpdated);
void onDraw(const kmMat4 &transform, bool transformUpdated);
virtual void draw(cocos2d::Renderer* renderer, const cocos2d::Mat4 &transform, uint32_t flags);
void onDraw(const cocos2d::Mat4 &transform, uint32_t flags);
virtual void buildCustomUniforms();
virtual void setCustomUniforms();

Expand Down
4 changes: 2 additions & 2 deletions Classes/PopWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ bool PopWindow::init()
_contentLabel = Label::createWithTTF(turnTTFConfig, "Connecting...", TextHAlignment::CENTER, 400);
_contentLabel->setAnchorPoint(Point::ANCHOR_MIDDLE_RIGHT);
_contentLabel->setPosition(_bk->getContentSize().width/2+20,_bk->getContentSize().height/2);
_contentLabel->setSpacing(-5);
//_contentLabel->setSpacing(-5);
_contentLabel->enableOutline(Color4B::BLACK);
_bk->addChild(_contentLabel);

Expand Down Expand Up @@ -85,7 +85,7 @@ bool PopWindow::init()
_btn_label = Label::createWithTTF(t_turnTTFConfig, "OK", TextHAlignment::CENTER, 400);
_btn_label->setAnchorPoint(Point::ANCHOR_MIDDLE);
_btn_label->setPosition(btn_menuitem->getContentSize().width/2, btn_menuitem->getContentSize().height/2);
_btn_label->setSpacing(-5);
//_btn_label->setSpacing(-5);
_btn_label->enableOutline(Color4B::BLACK);
btn_menuitem->addChild(_btn_label);

Expand Down
8 changes: 4 additions & 4 deletions Classes/WagonSelect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ void WagonSelect::createUI()
horseyTTFConfig.fontFilePath = "fonts/britanic bold.ttf";
auto horseyLabel = Label::createWithTTF(horseyTTFConfig, "HORSEY", TextHAlignment::CENTER, 20);
horseyLabel->setPosition(120,g_visibleRect.visibleHeight/2-110);
horseyLabel->setSpacing(-5);
//horseyLabel->setSpacing(-5);
horseyLabel->setAnchorPoint(Point::ANCHOR_MIDDLE);
horseyLabel->enableOutline(Color4B::BLACK);
_wagon_bk->addChild(horseyLabel,2);
Expand All @@ -245,7 +245,7 @@ void WagonSelect::createUI()
tankTTFConfig.fontFilePath = "fonts/britanic bold.ttf";
auto tankLabel = Label::createWithTTF(horseyTTFConfig, "TANK", TextHAlignment::CENTER, 20);
tankLabel->setPosition(310,g_visibleRect.visibleHeight/2-110);
tankLabel->setSpacing(-5);
//tankLabel->setSpacing(-5);
tankLabel->setAnchorPoint(Point::ANCHOR_MIDDLE);
tankLabel->enableOutline(Color4B::BLACK);
_wagon_bk->addChild(tankLabel,2);
Expand All @@ -256,7 +256,7 @@ void WagonSelect::createUI()
rockTTFConfig.fontFilePath = "fonts/britanic bold.ttf";
auto rockLabel = Label::createWithTTF(horseyTTFConfig, "ROCK", TextHAlignment::CENTER, 20);
rockLabel->setPosition(500,g_visibleRect.visibleHeight/2-110);
rockLabel->setSpacing(-5);
//rockLabel->setSpacing(-5);
rockLabel->setAnchorPoint(Point::ANCHOR_MIDDLE);
rockLabel->enableOutline(Color4B::BLACK);
_wagon_bk->addChild(rockLabel,2);
Expand All @@ -267,7 +267,7 @@ void WagonSelect::createUI()
mechTTFConfig.fontFilePath = "fonts/britanic bold.ttf";
auto mechLabel = Label::createWithTTF(horseyTTFConfig, "MECH", TextHAlignment::CENTER, 20);
mechLabel->setPosition(690,g_visibleRect.visibleHeight/2-110);
mechLabel->setSpacing(-5);
//mechLabel->setSpacing(-5);
mechLabel->setAnchorPoint(Point::ANCHOR_MIDDLE);
mechLabel->enableOutline(Color4B::BLACK);
_wagon_bk->addChild(mechLabel,2);
Expand Down
Loading