From 04465622b783a2d2ab6ce26766325cf1b8b0a0f8 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 5 Jul 2013 16:49:22 +0800 Subject: [PATCH] issue #2129:remove prefix of types in ccTypes.h --- .../project.pbxproj.REMOVED.git-id | 2 +- cocos2dx/actions/CCActionGrid.cpp | 12 +- cocos2dx/actions/CCActionGrid.h | 12 +- cocos2dx/actions/CCActionGrid3D.cpp | 18 +- cocos2dx/actions/CCActionInterval.cpp | 8 +- cocos2dx/actions/CCActionInterval.h | 4 +- cocos2dx/actions/CCActionPageTurn3D.cpp | 2 +- cocos2dx/actions/CCActionTiledGrid.cpp | 26 +- cocos2dx/base_nodes/CCAtlasNode.cpp | 14 +- cocos2dx/base_nodes/CCAtlasNode.h | 8 +- cocos2dx/base_nodes/CCNode.cpp | 16 +- cocos2dx/base_nodes/CCNode.h | 12 +- cocos2dx/ccTypes.cpp | 48 ++ cocos2dx/ccTypes.h | 14 + cocos2dx/draw_nodes/CCDrawNode.cpp | 242 +++++----- cocos2dx/draw_nodes/CCDrawNode.h | 14 +- cocos2dx/draw_nodes/CCDrawingPrimitives.cpp | 42 +- cocos2dx/draw_nodes/CCDrawingPrimitives.h | 4 +- cocos2dx/effects/CCGrid.cpp | 68 +-- cocos2dx/effects/CCGrid.h | 12 +- cocos2dx/include/CCProtocols.h | 20 +- cocos2dx/include/ccTypes.h | 412 +++++++++--------- cocos2dx/label_nodes/CCLabelAtlas.cpp | 4 +- cocos2dx/label_nodes/CCLabelBMFont.cpp | 16 +- cocos2dx/label_nodes/CCLabelBMFont.h | 12 +- cocos2dx/label_nodes/CCLabelTTF.cpp | 24 +- cocos2dx/label_nodes/CCLabelTTF.h | 22 +- .../CCLayer.cpp | 60 +-- .../layers_scenes_transitions_nodes/CCLayer.h | 38 +- .../CCTransition.cpp | 14 +- .../CCTransition.h | 8 +- cocos2dx/menu_nodes/CCMenuItem.cpp | 8 +- cocos2dx/menu_nodes/CCMenuItem.h | 6 +- cocos2dx/misc_nodes/CCClippingNode.cpp | 4 +- cocos2dx/misc_nodes/CCMotionStreak.cpp | 32 +- cocos2dx/misc_nodes/CCMotionStreak.h | 20 +- cocos2dx/misc_nodes/CCProgressTimer.cpp | 34 +- cocos2dx/misc_nodes/CCProgressTimer.h | 6 +- cocos2dx/misc_nodes/CCRenderTexture.cpp | 8 +- cocos2dx/misc_nodes/CCRenderTexture.h | 8 +- .../particle_nodes/CCParticleBatchNode.cpp | 6 +- cocos2dx/particle_nodes/CCParticleBatchNode.h | 6 +- cocos2dx/particle_nodes/CCParticleSystem.cpp | 24 +- cocos2dx/particle_nodes/CCParticleSystem.h | 14 +- .../particle_nodes/CCParticleSystemQuad.cpp | 34 +- .../particle_nodes/CCParticleSystemQuad.h | 2 +- cocos2dx/platform/mac/CCImage.mm | 2 +- cocos2dx/sprite_nodes/CCSprite.cpp | 40 +- cocos2dx/sprite_nodes/CCSprite.h | 14 +- cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp | 14 +- cocos2dx/sprite_nodes/CCSpriteBatchNode.h | 6 +- cocos2dx/support/CCVertex.cpp | 14 +- cocos2dx/support/CCVertex.h | 2 +- cocos2dx/text_input_node/CCTextFieldTTF.cpp | 6 +- cocos2dx/text_input_node/CCTextFieldTTF.h | 6 +- cocos2dx/textures/CCTexture2D.cpp | 6 +- cocos2dx/textures/CCTexture2D.h | 2 +- cocos2dx/textures/CCTextureAtlas.cpp | 40 +- cocos2dx/textures/CCTextureAtlas.h | 8 +- .../tilemap_parallax_nodes/CCTileMapAtlas.cpp | 26 +- .../tilemap_parallax_nodes/CCTileMapAtlas.h | 6 +- extensions/CCArmature/CCArmature.h | 6 +- extensions/CCArmature/CCBone.cpp | 4 +- extensions/CCArmature/CCBone.h | 2 +- extensions/CCArmature/datas/CCDatas.h | 4 +- .../CCArmature/display/CCShaderNode.cpp | 12 +- extensions/CCArmature/display/CCShaderNode.h | 4 +- extensions/CCArmature/display/CCSkin.cpp | 10 +- .../external_tool/CCTexture2DMutable.cpp | 8 +- .../external_tool/CCTexture2DMutable.h | 8 +- .../CCArmature/physics/CCColliderDetector.cpp | 4 +- .../CCArmature/utils/CCDataReaderHelper.cpp | 4 +- extensions/CCBReader/CCBAnimationManager.cpp | 6 +- extensions/CCBReader/CCBReader.cpp | 4 +- extensions/CCBReader/CCBValue.cpp | 8 +- extensions/CCBReader/CCBValue.h | 10 +- .../CCBReader/CCControlButtonLoader.cpp | 2 +- extensions/CCBReader/CCControlButtonLoader.h | 2 +- extensions/CCBReader/CCLabelBMFontLoader.cpp | 4 +- extensions/CCBReader/CCLabelBMFontLoader.h | 4 +- extensions/CCBReader/CCLabelTTFLoader.cpp | 4 +- extensions/CCBReader/CCLabelTTFLoader.h | 4 +- extensions/CCBReader/CCLayerColorLoader.cpp | 4 +- extensions/CCBReader/CCLayerColorLoader.h | 4 +- .../CCBReader/CCLayerGradientLoader.cpp | 4 +- extensions/CCBReader/CCLayerGradientLoader.h | 4 +- extensions/CCBReader/CCNodeLoader.cpp | 26 +- extensions/CCBReader/CCNodeLoader.h | 12 +- .../CCBReader/CCParticleSystemQuadLoader.cpp | 4 +- .../CCBReader/CCParticleSystemQuadLoader.h | 4 +- extensions/CCBReader/CCScale9SpriteLoader.cpp | 4 +- extensions/CCBReader/CCScale9SpriteLoader.h | 4 +- extensions/CCBReader/CCSpriteLoader.cpp | 4 +- extensions/CCBReader/CCSpriteLoader.h | 4 +- .../CCControlExtension/CCControlButton.cpp | 16 +- .../GUI/CCControlExtension/CCControlButton.h | 10 +- .../CCControlColourPicker.cpp | 6 +- .../CCControlColourPicker.h | 2 +- .../CCControlPotentiometer.cpp | 4 +- .../CCControlSaturationBrightnessPicker.cpp | 2 +- .../CCControlExtension/CCControlSlider.cpp | 4 +- .../CCControlExtension/CCControlStepper.cpp | 24 +- .../CCControlExtension/CCControlSwitch.cpp | 12 +- .../GUI/CCControlExtension/CCControlUtils.h | 6 +- .../GUI/CCControlExtension/CCScale9Sprite.cpp | 8 +- .../GUI/CCControlExtension/CCScale9Sprite.h | 6 +- extensions/GUI/CCEditBox/CCEditBox.cpp | 8 +- extensions/GUI/CCEditBox/CCEditBox.h | 8 +- extensions/GUI/CCEditBox/CCEditBoxImpl.h | 4 +- .../GUI/CCEditBox/CCEditBoxImplAndroid.cpp | 8 +- .../GUI/CCEditBox/CCEditBoxImplAndroid.h | 8 +- extensions/GUI/CCEditBox/CCEditBoxImplIOS.h | 4 +- extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm | 8 +- extensions/GUI/CCEditBox/CCEditBoxImplMac.h | 4 +- extensions/GUI/CCEditBox/CCEditBoxImplMac.mm | 4 +- .../GUI/CCEditBox/CCEditBoxImplTizen.cpp | 8 +- extensions/GUI/CCEditBox/CCEditBoxImplTizen.h | 8 +- extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp | 8 +- extensions/GUI/CCEditBox/CCEditBoxImplWin.h | 8 +- .../physics_nodes/CCPhysicsDebugNode.cpp | 14 +- extensions/spine/CCSkeleton.cpp | 10 +- extensions/spine/CCSkeleton.h | 2 +- extensions/spine/spine-cocos2dx.cpp | 2 +- extensions/spine/spine-cocos2dx.h | 2 +- .../Box2D/Collision/Shapes/b2ChainShape.cpp | 12 +- .../Box2D/Collision/Shapes/b2EdgeShape.cpp | 10 +- external/Box2D/Collision/Shapes/b2EdgeShape.h | 12 +- external/Box2D/Collision/b2CollideEdge.cpp | 18 +- external/Box2D/Dynamics/b2Fixture.cpp | 6 +- external/Box2D/Dynamics/b2World.cpp | 2 +- external/chipmunk/src/cpBBTree.c | 16 +- .../Cpp/SimpleGame/Classes/GameOverScene.cpp | 4 +- .../SimpleGame/Classes/HelloWorldScene.cpp | 2 +- .../ActionsProgressTest.cpp | 2 +- .../Classes/ActionsTest/ActionsTest.cpp | 14 +- .../TestCpp/Classes/Box2DTest/Box2dTest.cpp | 2 +- .../Classes/Box2DTestBed/Tests/DumpShell.h | 24 +- .../Classes/Box2DTestBed/Tests/EdgeTest.h | 20 +- .../Cpp/TestCpp/Classes/BugsTest/Bug-1159.cpp | 6 +- .../Classes/BugsTest/Bug-458/Bug-458.cpp | 4 +- .../Bug-458/QuestionContainerSprite.cpp | 6 +- .../Cpp/TestCpp/Classes/BugsTest/Bug-624.cpp | 4 +- .../Cpp/TestCpp/Classes/BugsTest/Bug-914.cpp | 2 +- .../ClickAndMoveTest/ClickAndMoveTest.cpp | 2 +- .../ClippingNodeTest/ClippingNodeTest.cpp | 10 +- .../DrawPrimitivesTest/DrawPrimitivesTest.cpp | 16 +- .../EffectsAdvancedTest.cpp | 6 +- .../Classes/EffectsTest/EffectsTest.cpp | 2 +- .../ArmatureTest/ArmatureScene.cpp | 4 +- .../HelloCocosBuilderLayer.cpp | 4 +- .../ComponentsTest/ComponentsTestScene.cpp | 4 +- .../ComponentsTest/GameOverScene.cpp | 6 +- .../CCControlButtonTest.cpp | 18 +- .../CCControlColourPickerTest.cpp | 2 +- .../EditBoxTest/EditBoxTest.cpp | 6 +- .../Cpp/TestCpp/Classes/FontTest/FontTest.cpp | 6 +- .../TestCpp/Classes/LabelTest/LabelTest.cpp | 76 ++-- .../TestCpp/Classes/LayerTest/LayerTest.cpp | 40 +- .../Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp | 6 +- .../MotionStreakTest/MotionStreakTest.cpp | 6 +- .../Classes/MutiTouchTest/MutiTouchTest.cpp | 16 +- .../Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp | 14 +- .../Classes/ParticleTest/ParticleTest.cpp | 120 ++--- .../PerformanceNodeChildrenTest.cpp | 8 +- .../PerformanceParticleTest.cpp | 44 +- .../PerformanceTest/PerformanceSpriteTest.cpp | 14 +- .../PerformanceTextureTest.cpp | 2 +- .../RenderTextureTest/RenderTextureTest.cpp | 28 +- .../RotateWorldTest/RotateWorldTest.cpp | 8 +- .../TestCpp/Classes/SceneTest/SceneTest.cpp | 4 +- .../TestCpp/Classes/ShaderTest/ShaderTest.cpp | 16 +- .../TestCpp/Classes/ShaderTest/ShaderTest.h | 4 +- .../SpriteTest/SpriteTest.cpp.REMOVED.git-id | 2 +- .../Classes/TextInputTest/TextInputTest.cpp | 2 +- .../Classes/Texture2dTest/Texture2dTest.cpp | 28 +- .../Classes/Texture2dTest/Texture2dTest.h | 4 +- .../Classes/TileMapTest/TileMapTest.cpp | 16 +- .../TransitionsTest/TransitionsTest.cpp | 10 +- .../Classes/ZwoptexTest/ZwoptexTest.cpp | 4 +- .../luaScript/ActionsTest/ActionsTest.lua | 14 +- .../Resources/luaScript/BugsTest/BugsTest.lua | 22 +- .../ClickAndMoveTest/ClickAndMoveTest.lua | 2 +- .../DrawPrimitivesTest/DrawPrimitivesTest.lua | 4 +- .../EffectsAdvancedTest.lua | 6 +- .../luaScript/EffectsTest/EffectsTest.lua | 2 +- .../ExtensionTest/CocosBuilderTest.lua | 14 +- .../luaScript/ExtensionTest/ExtensionTest.lua | 22 +- .../Resources/luaScript/FontTest/FontTest.lua | 6 +- .../luaScript/LabelTest/LabelTest.lua | 58 +-- .../luaScript/LayerTest/LayerTest.lua | 36 +- .../Resources/luaScript/MenuTest/MenuTest.lua | 6 +- .../MotionStreakTest/MotionStreakTest.lua | 6 +- .../Resources/luaScript/NodeTest/NodeTest.lua | 14 +- .../luaScript/OpenGLTest/OpenGLTest.lua | 12 +- .../luaScript/ParticleTest/ParticleTest.lua | 106 ++--- .../PerformanceTest/PerformanceSpriteTest.lua | 14 +- .../PerformanceTest/PerformanceTest.lua | 70 +-- .../RenderTextureTest/RenderTextureTest.lua | 26 +- .../RotateWorldTest/RotateWorldTest.lua | 8 +- .../luaScript/SceneTest/SceneTest.lua | 4 +- .../luaScript/Texture2dTest/Texture2dTest.lua | 32 +- .../luaScript/TileMapTest/TileMapTest.lua | 14 +- .../TransitionsTest/TransitionsTest.lua | 10 +- .../luaScript/ZwoptexTest/ZwoptexTest.lua | 4 +- .../javascript/bindings/ScriptingCore.cpp | 22 +- scripting/javascript/bindings/ScriptingCore.h | 14 +- .../cocos2d_specifics.cpp.REMOVED.git-id | 2 +- ...bfuscate_exclude_cocos2d.js.REMOVED.git-id | 2 +- .../LuaCocos2d.cpp.REMOVED.git-id | 2 +- 209 files changed, 1673 insertions(+), 1627 deletions(-) create mode 100644 cocos2dx/ccTypes.cpp create mode 100644 cocos2dx/ccTypes.h diff --git a/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index cb60732644..e1058a5d0c 100644 --- a/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -bcd62ba7c28d13abdba85491cb4ca7f70e3ee10b \ No newline at end of file +827e9946dfc2f9d2ce0be7e9e723764a0e614a96 \ No newline at end of file diff --git a/cocos2dx/actions/CCActionGrid.cpp b/cocos2dx/actions/CCActionGrid.cpp index 3b9d896b11..b7c022595c 100644 --- a/cocos2dx/actions/CCActionGrid.cpp +++ b/cocos2dx/actions/CCActionGrid.cpp @@ -95,19 +95,19 @@ GridBase* Grid3DAction::getGrid(void) return Grid3D::create(_gridSize); } -ccVertex3F Grid3DAction::vertex(const Point& position) +Vertex3F Grid3DAction::vertex(const Point& position) { Grid3D *g = (Grid3D*)_target->getGrid(); return g->vertex(position); } -ccVertex3F Grid3DAction::originalVertex(const Point& position) +Vertex3F Grid3DAction::originalVertex(const Point& position) { Grid3D *g = (Grid3D*)_target->getGrid(); return g->originalVertex(position); } -void Grid3DAction::setVertex(const Point& position, const ccVertex3F& vertex) +void Grid3DAction::setVertex(const Point& position, const Vertex3F& vertex) { Grid3D *g = (Grid3D*)_target->getGrid(); g->setVertex(position, vertex); @@ -120,19 +120,19 @@ GridBase* TiledGrid3DAction::getGrid(void) return TiledGrid3D::create(_gridSize); } -ccQuad3 TiledGrid3DAction::tile(const Point& pos) +Quad3 TiledGrid3DAction::tile(const Point& pos) { TiledGrid3D *g = (TiledGrid3D*)_target->getGrid(); return g->tile(pos); } -ccQuad3 TiledGrid3DAction::originalTile(const Point& pos) +Quad3 TiledGrid3DAction::originalTile(const Point& pos) { TiledGrid3D *g = (TiledGrid3D*)_target->getGrid(); return g->originalTile(pos); } -void TiledGrid3DAction::setTile(const Point& pos, const ccQuad3& coords) +void TiledGrid3DAction::setTile(const Point& pos, const Quad3& coords) { TiledGrid3D *g = (TiledGrid3D*)_target->getGrid(); return g->setTile(pos, coords); diff --git a/cocos2dx/actions/CCActionGrid.h b/cocos2dx/actions/CCActionGrid.h index 9c0049b73f..43d506bab6 100644 --- a/cocos2dx/actions/CCActionGrid.h +++ b/cocos2dx/actions/CCActionGrid.h @@ -74,11 +74,11 @@ public: /** returns the grid */ virtual GridBase* getGrid(void); /** returns the vertex than belongs to certain position in the grid */ - ccVertex3F vertex(const Point& position); + Vertex3F vertex(const Point& position); /** returns the non-transformed vertex than belongs to certain position in the grid */ - ccVertex3F originalVertex(const Point& position); + Vertex3F originalVertex(const Point& position); /** sets a new vertex to a certain position of the grid */ - void setVertex(const Point& position, const ccVertex3F& vertex); + void setVertex(const Point& position, const Vertex3F& vertex); }; /** @brief Base class for TiledGrid3D actions */ @@ -89,11 +89,11 @@ public: virtual TiledGrid3DAction * clone() const = 0; /** returns the tile that belongs to a certain position of the grid */ - ccQuad3 tile(const Point& position); + Quad3 tile(const Point& position); /** returns the non-transformed tile that belongs to a certain position of the grid */ - ccQuad3 originalTile(const Point& position); + Quad3 originalTile(const Point& position); /** sets a new tile to a certain position of the grid */ - void setTile(const Point& position, const ccQuad3& coords); + void setTile(const Point& position, const Quad3& coords); /** returns the grid */ virtual GridBase* getGrid(void); diff --git a/cocos2dx/actions/CCActionGrid3D.cpp b/cocos2dx/actions/CCActionGrid3D.cpp index 8380aaaae6..801a6ed972 100644 --- a/cocos2dx/actions/CCActionGrid3D.cpp +++ b/cocos2dx/actions/CCActionGrid3D.cpp @@ -104,7 +104,7 @@ void Waves3D::update(float time) { for (j = 0; j < _gridSize.height + 1; ++j) { - ccVertex3F v = originalVertex(ccp(i ,j)); + Vertex3F v = originalVertex(ccp(i ,j)); v.z += (sinf((float)M_PI * time * _waves * 2 + (v.y+v.x) * 0.01f) * _amplitude * _amplitudeRate); //CCLOG("v.z offset is %f\n", (sinf((float)M_PI * time * _waves * 2 + (v.y+v.x) * .01f) * _amplitude * _amplitudeRate)); setVertex(ccp(i, j), v); @@ -190,7 +190,7 @@ void FlipX3D::update(float time) angle = angle / 2.0f; // x calculates degrees from 0 to 90 float mx = cosf(angle); - ccVertex3F v0, v1, v, diff; + Vertex3F v0, v1, v, diff; v0 = originalVertex(ccp(1, 1)); v1 = originalVertex(ccp(0, 0)); @@ -298,7 +298,7 @@ void FlipY3D::update(float time) angle = angle / 2.0f; // x calculates degrees from 0 to 90 float my = cosf(angle); - ccVertex3F v0, v1, v, diff; + Vertex3F v0, v1, v, diff; v0 = originalVertex(ccp(1, 1)); v1 = originalVertex(ccp(0, 0)); @@ -446,7 +446,7 @@ void Lens3D::update(float time) { for (j = 0; j < _gridSize.height + 1; ++j) { - ccVertex3F v = originalVertex(ccp(i, j)); + Vertex3F v = originalVertex(ccp(i, j)); Point vect = ccpSub(_position, ccp(v.x, v.y)); float r = ccpLength(vect); @@ -561,7 +561,7 @@ void Ripple3D::update(float time) { for (j = 0; j < (_gridSize.height+1); ++j) { - ccVertex3F v = originalVertex(ccp(i, j)); + Vertex3F v = originalVertex(ccp(i, j)); Point vect = ccpSub(_position, ccp(v.x,v.y)); float r = ccpLength(vect); @@ -652,7 +652,7 @@ void Shaky3D::update(float time) { for (j = 0; j < (_gridSize.height+1); ++j) { - ccVertex3F v = originalVertex(ccp(i ,j)); + Vertex3F v = originalVertex(ccp(i ,j)); v.x += (rand() % (_randrange*2)) - _randrange; v.y += (rand() % (_randrange*2)) - _randrange; if (_shakeZ) @@ -740,7 +740,7 @@ void Liquid::update(float time) { for (j = 1; j < _gridSize.height; ++j) { - ccVertex3F v = originalVertex(ccp(i, j)); + Vertex3F v = originalVertex(ccp(i, j)); v.x = (v.x + (sinf(time * (float)M_PI * _waves * 2 + v.x * .01f) * _amplitude * _amplitudeRate)); v.y = (v.y + (sinf(time * (float)M_PI * _waves * 2 + v.y * .01f) * _amplitude * _amplitudeRate)); setVertex(ccp(i, j), v); @@ -825,7 +825,7 @@ void Waves::update(float time) { for (j = 0; j < _gridSize.height + 1; ++j) { - ccVertex3F v = originalVertex(ccp(i, j)); + Vertex3F v = originalVertex(ccp(i, j)); if (_vertical) { @@ -925,7 +925,7 @@ void Twirl::update(float time) { for (j = 0; j < (_gridSize.height+1); ++j) { - ccVertex3F v = originalVertex(ccp(i ,j)); + Vertex3F v = originalVertex(ccp(i ,j)); Point avg = ccp(i-(_gridSize.width/2.0f), j-(_gridSize.height/2.0f)); float r = ccpLength(avg); diff --git a/cocos2dx/actions/CCActionInterval.cpp b/cocos2dx/actions/CCActionInterval.cpp index ad47797a78..86b48b7837 100644 --- a/cocos2dx/actions/CCActionInterval.cpp +++ b/cocos2dx/actions/CCActionInterval.cpp @@ -2199,7 +2199,7 @@ bool TintTo::initWithDuration(float duration, GLubyte red, GLubyte green, GLubyt { if (ActionInterval::initWithDuration(duration)) { - _to = ccc3(red, green, blue); + _to = Color3B(red, green, blue); return true; } @@ -2260,7 +2260,7 @@ void TintTo::update(float time) RGBAProtocol *pRGBAProtocol = dynamic_cast(_target); if (pRGBAProtocol) { - pRGBAProtocol->setColor(ccc3(GLubyte(_from.r + (_to.r - _from.r) * time), + pRGBAProtocol->setColor(Color3B(GLubyte(_from.r + (_to.r - _from.r) * time), (GLbyte)(_from.g + (_to.g - _from.g) * time), (GLbyte)(_from.b + (_to.b - _from.b) * time))); } @@ -2332,7 +2332,7 @@ void TintBy::startWithTarget(Node *pTarget) RGBAProtocol *pRGBAProtocol = dynamic_cast(pTarget); if (pRGBAProtocol) { - ccColor3B color = pRGBAProtocol->getColor(); + Color3B color = pRGBAProtocol->getColor(); _fromR = color.r; _fromG = color.g; _fromB = color.b; @@ -2344,7 +2344,7 @@ void TintBy::update(float time) RGBAProtocol *pRGBAProtocol = dynamic_cast(_target); if (pRGBAProtocol) { - pRGBAProtocol->setColor(ccc3((GLubyte)(_fromR + _deltaR * time), + pRGBAProtocol->setColor(Color3B((GLubyte)(_fromR + _deltaR * time), (GLubyte)(_fromG + _deltaG * time), (GLubyte)(_fromB + _deltaB * time))); } diff --git a/cocos2dx/actions/CCActionInterval.h b/cocos2dx/actions/CCActionInterval.h index ffcaa09546..f991acc412 100644 --- a/cocos2dx/actions/CCActionInterval.h +++ b/cocos2dx/actions/CCActionInterval.h @@ -727,8 +727,8 @@ public: /** creates an action with duration and color */ static TintTo* create(float duration, GLubyte red, GLubyte green, GLubyte blue); protected: - ccColor3B _to; - ccColor3B _from; + Color3B _to; + Color3B _from; }; /** @brief Tints a Node that implements the NodeRGB protocol from current tint to a custom one. diff --git a/cocos2dx/actions/CCActionPageTurn3D.cpp b/cocos2dx/actions/CCActionPageTurn3D.cpp index 40c99032d8..989d377509 100644 --- a/cocos2dx/actions/CCActionPageTurn3D.cpp +++ b/cocos2dx/actions/CCActionPageTurn3D.cpp @@ -77,7 +77,7 @@ void PageTurn3D::update(float time) for (int j = 0; j <= _gridSize.height; ++j) { // Get original vertex - ccVertex3F p = originalVertex(ccp(i ,j)); + Vertex3F p = originalVertex(ccp(i ,j)); float R = sqrtf((p.x * p.x) + ((p.y - ay) * (p.y - ay))); float r = R * sinTheta; diff --git a/cocos2dx/actions/CCActionTiledGrid.cpp b/cocos2dx/actions/CCActionTiledGrid.cpp index e4f059b1bd..88b5dd6657 100644 --- a/cocos2dx/actions/CCActionTiledGrid.cpp +++ b/cocos2dx/actions/CCActionTiledGrid.cpp @@ -114,7 +114,7 @@ void ShakyTiles3D::update(float time) { for (j = 0; j < _gridSize.height; ++j) { - ccQuad3 coords = originalTile(ccp(i, j)); + Quad3 coords = originalTile(ccp(i, j)); // X coords.bl.x += ( rand() % (_randrange*2) ) - _randrange; @@ -219,7 +219,7 @@ void ShatteredTiles3D::update(float time) { for (j = 0; j < _gridSize.height; ++j) { - ccQuad3 coords = originalTile(ccp(i ,j)); + Quad3 coords = originalTile(ccp(i ,j)); // X coords.bl.x += ( rand() % (_randrange*2) ) - _randrange; @@ -347,7 +347,7 @@ Size ShuffleTiles::getDelta(const Size& pos) void ShuffleTiles::placeTile(const Point& pos, Tile *t) { - ccQuad3 coords = originalTile(pos); + Quad3 coords = originalTile(pos); Point step = _target->getGrid()->getStep(); coords.bl.x += (int)(t->position.x * step.x); @@ -470,14 +470,14 @@ void FadeOutTRTiles::turnOnTile(const Point& pos) void FadeOutTRTiles::turnOffTile(const Point& pos) { - ccQuad3 coords; - memset(&coords, 0, sizeof(ccQuad3)); + Quad3 coords; + memset(&coords, 0, sizeof(Quad3)); setTile(pos, coords); } void FadeOutTRTiles::transformTile(const Point& pos, float distance) { - ccQuad3 coords = originalTile(pos); + Quad3 coords = originalTile(pos); Point step = _target->getGrid()->getStep(); coords.bl.x += (step.x / 2) * (1.0f - distance); @@ -604,7 +604,7 @@ float FadeOutUpTiles::testFunc(const Size& pos, float time) void FadeOutUpTiles::transformTile(const Point& pos, float distance) { - ccQuad3 coords = originalTile(pos); + Quad3 coords = originalTile(pos); Point step = _target->getGrid()->getStep(); coords.bl.y += (step.y / 2) * (1.0f - distance); @@ -759,9 +759,9 @@ void TurnOffTiles::turnOnTile(const Point& pos) void TurnOffTiles::turnOffTile(const Point& pos) { - ccQuad3 coords; + Quad3 coords; - memset(&coords, 0, sizeof(ccQuad3)); + memset(&coords, 0, sizeof(Quad3)); setTile(pos, coords); } @@ -883,7 +883,7 @@ void WavesTiles3D::update(float time) { for( j = 0; j < _gridSize.height; j++ ) { - ccQuad3 coords = originalTile(ccp(i, j)); + Quad3 coords = originalTile(ccp(i, j)); coords.bl.z = (sinf(time * (float)M_PI *_waves * 2 + (coords.bl.y+coords.bl.x) * .01f) * _amplitude * _amplitudeRate ); @@ -972,7 +972,7 @@ void JumpTiles3D::update(float time) { for( j = 0; j < _gridSize.height; j++ ) { - ccQuad3 coords = originalTile(ccp(i, j)); + Quad3 coords = originalTile(ccp(i, j)); if ( ((i+j) % 2) == 0 ) { @@ -1065,7 +1065,7 @@ void SplitRows::update(float time) for (j = 0; j < _gridSize.height; ++j) { - ccQuad3 coords = originalTile(ccp(0, j)); + Quad3 coords = originalTile(ccp(0, j)); float direction = 1; if ( (j % 2 ) == 0 ) @@ -1151,7 +1151,7 @@ void SplitCols::update(float time) for (i = 0; i < _gridSize.width; ++i) { - ccQuad3 coords = originalTile(ccp(i, 0)); + Quad3 coords = originalTile(ccp(i, 0)); float direction = 1; if ( (i % 2 ) == 0 ) diff --git a/cocos2dx/base_nodes/CCAtlasNode.cpp b/cocos2dx/base_nodes/CCAtlasNode.cpp index 58e8231b3b..3ae28d8964 100644 --- a/cocos2dx/base_nodes/CCAtlasNode.cpp +++ b/cocos2dx/base_nodes/CCAtlasNode.cpp @@ -87,7 +87,7 @@ bool AtlasNode::initWithTexture(Texture2D* texture, unsigned int tileWidth, unsi _itemWidth = tileWidth; _itemHeight = tileHeight; - _colorUnmodified = ccWHITE; + _colorUnmodified = Color3B::white; _isOpacityModifyRGB = true; _blendFunc.src = CC_BLEND_SRC; @@ -152,7 +152,7 @@ void AtlasNode::draw(void) // AtlasNode - RGBA protocol -const ccColor3B& AtlasNode::getColor() +const Color3B& AtlasNode::getColor() { if(_isOpacityModifyRGB) { @@ -161,9 +161,9 @@ const ccColor3B& AtlasNode::getColor() return NodeRGBA::getColor(); } -void AtlasNode::setColor(const ccColor3B& color3) +void AtlasNode::setColor(const Color3B& color3) { - ccColor3B tmp = color3; + Color3B tmp = color3; _colorUnmodified = color3; if( _isOpacityModifyRGB ) @@ -186,7 +186,7 @@ void AtlasNode::setOpacity(GLubyte opacity) void AtlasNode::setOpacityModifyRGB(bool bValue) { - ccColor3B oldColor = this->getColor(); + Color3B oldColor = this->getColor(); _isOpacityModifyRGB = bValue; this->setColor(oldColor); } @@ -208,12 +208,12 @@ void AtlasNode::setIgnoreContentScaleFactor(bool bIgnoreContentScaleFactor) // AtlasNode - CocosNodeTexture protocol -const ccBlendFunc& AtlasNode::getBlendFunc() const +const BlendFunc& AtlasNode::getBlendFunc() const { return _blendFunc; } -void AtlasNode::setBlendFunc(const ccBlendFunc &blendFunc) +void AtlasNode::setBlendFunc(const BlendFunc &blendFunc) { _blendFunc = blendFunc; } diff --git a/cocos2dx/base_nodes/CCAtlasNode.h b/cocos2dx/base_nodes/CCAtlasNode.h index fdb6ba46ef..2f75f8d9cf 100644 --- a/cocos2dx/base_nodes/CCAtlasNode.h +++ b/cocos2dx/base_nodes/CCAtlasNode.h @@ -62,14 +62,14 @@ protected: //! height of each char unsigned int _itemHeight; - ccColor3B _colorUnmodified; + Color3B _colorUnmodified; CC_PROPERTY(TextureAtlas*, _textureAtlas, TextureAtlas); // protocol variables bool _isOpacityModifyRGB; - CC_PROPERTY_PASS_BY_REF(ccBlendFunc, _blendFunc, BlendFunc); + CC_PROPERTY_PASS_BY_REF(BlendFunc, _blendFunc, BlendFunc); // quads to draw CC_PROPERTY(unsigned int, _quadsToDraw, QuadsToDraw); @@ -109,8 +109,8 @@ public: virtual bool isOpacityModifyRGB(); virtual void setOpacityModifyRGB(bool isOpacityModifyRGB); - virtual const ccColor3B& getColor(void); - virtual void setColor(const ccColor3B& color); + virtual const Color3B& getColor(void); + virtual void setColor(const Color3B& color); virtual void setOpacity(GLubyte opacity); private : diff --git a/cocos2dx/base_nodes/CCNode.cpp b/cocos2dx/base_nodes/CCNode.cpp index 9bf2613da8..caeb74673c 100644 --- a/cocos2dx/base_nodes/CCNode.cpp +++ b/cocos2dx/base_nodes/CCNode.cpp @@ -1349,8 +1349,8 @@ void Node::removeAllComponents() NodeRGBA::NodeRGBA() : _displayedOpacity(255) , _realOpacity(255) -, _displayedColor(ccWHITE) -, _realColor(ccWHITE) +, _displayedColor(Color3B::white) +, _realColor(Color3B::white) , _cascadeColorEnabled(false) , _cascadeOpacityEnabled(false) {} @@ -1362,7 +1362,7 @@ bool NodeRGBA::init() if (Node::init()) { _displayedOpacity = _realOpacity = 255; - _displayedColor = _realColor = ccWHITE; + _displayedColor = _realColor = Color3B::white; _cascadeOpacityEnabled = _cascadeColorEnabled = false; return true; } @@ -1423,23 +1423,23 @@ void NodeRGBA::setCascadeOpacityEnabled(bool cascadeOpacityEnabled) _cascadeOpacityEnabled = cascadeOpacityEnabled; } -const ccColor3B& NodeRGBA::getColor(void) const +const Color3B& NodeRGBA::getColor(void) const { return _realColor; } -const ccColor3B& NodeRGBA::getDisplayedColor() const +const Color3B& NodeRGBA::getDisplayedColor() const { return _displayedColor; } -void NodeRGBA::setColor(const ccColor3B& color) +void NodeRGBA::setColor(const Color3B& color) { _displayedColor = _realColor = color; if (_cascadeColorEnabled) { - ccColor3B parentColor = ccWHITE; + Color3B parentColor = Color3B::white; RGBAProtocol *parent = dynamic_cast(_parent); if (parent && parent->isCascadeColorEnabled()) { @@ -1450,7 +1450,7 @@ void NodeRGBA::setColor(const ccColor3B& color) } } -void NodeRGBA::updateDisplayedColor(const ccColor3B& parentColor) +void NodeRGBA::updateDisplayedColor(const Color3B& parentColor) { _displayedColor.r = _realColor.r * parentColor.r/255.0; _displayedColor.g = _realColor.g * parentColor.g/255.0; diff --git a/cocos2dx/base_nodes/CCNode.h b/cocos2dx/base_nodes/CCNode.h index 523c03b4cb..8f061228bf 100644 --- a/cocos2dx/base_nodes/CCNode.h +++ b/cocos2dx/base_nodes/CCNode.h @@ -1435,10 +1435,10 @@ public: virtual bool isCascadeOpacityEnabled() const; virtual void setCascadeOpacityEnabled(bool cascadeOpacityEnabled); - virtual const ccColor3B& getColor(void) const; - virtual const ccColor3B& getDisplayedColor() const; - virtual void setColor(const ccColor3B& color); - virtual void updateDisplayedColor(const ccColor3B& parentColor); + virtual const Color3B& getColor(void) const; + virtual const Color3B& getDisplayedColor() const; + virtual void setColor(const Color3B& color); + virtual void updateDisplayedColor(const Color3B& parentColor); virtual bool isCascadeColorEnabled() const; virtual void setCascadeColorEnabled(bool cascadeColorEnabled); @@ -1448,8 +1448,8 @@ public: protected: GLubyte _displayedOpacity; GLubyte _realOpacity; - ccColor3B _displayedColor; - ccColor3B _realColor; + Color3B _displayedColor; + Color3B _realColor; bool _cascadeColorEnabled; bool _cascadeOpacityEnabled; }; diff --git a/cocos2dx/ccTypes.cpp b/cocos2dx/ccTypes.cpp new file mode 100644 index 0000000000..0d0f2aa6ea --- /dev/null +++ b/cocos2dx/ccTypes.cpp @@ -0,0 +1,48 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include "include/ccTypes.h" + +NS_CC_BEGIN + +const Color3B Color3B::white = {255,255,255}; +const Color3B Color3B::yellow = {255,255,0}; +const Color3B Color3B::green = {0,255,0}; +const Color3B Color3B::blue = {0,0,255}; +const Color3B Color3B::red = {255,0,0}; +const Color3B Color3B::magenta = {255,0,255}; +const Color3B Color3B::black = {0,0,0}; +const Color3B Color3B::orange = {255,127,0}; +const Color3B Color3B::gray = {166,166,166}; + +Color4B::Color4B(const Color4F &color4F) +:r((GLubyte)color4F.r * 255), +g((GLubyte)color4F.g * 255), +b((GLubyte)color4F.b * 255), +a((GLubyte)color4F.a * 255) +{} + +const BlendFunc BlendFunc::blendFuncDisable = {GL_ONE, GL_ZERO}; + +NS_CC_END diff --git a/cocos2dx/ccTypes.h b/cocos2dx/ccTypes.h new file mode 100644 index 0000000000..ef807c0641 --- /dev/null +++ b/cocos2dx/ccTypes.h @@ -0,0 +1,14 @@ +// +// ccTypes.h +// cocos2d_libs +// +// Created by minggo on 7/5/13. +// +// + +#ifndef __cocos2d_libs__ccTypes__ +#define __cocos2d_libs__ccTypes__ + +#include + +#endif /* defined(__cocos2d_libs__ccTypes__) */ diff --git a/cocos2dx/draw_nodes/CCDrawNode.cpp b/cocos2dx/draw_nodes/CCDrawNode.cpp index 07630577de..a1bc7e2400 100644 --- a/cocos2dx/draw_nodes/CCDrawNode.cpp +++ b/cocos2dx/draw_nodes/CCDrawNode.cpp @@ -27,69 +27,69 @@ NS_CC_BEGIN -// ccVertex2F == CGPoint in 32-bits, but not in 64-bits (OS X) +// Vertex2F == CGPoint in 32-bits, but not in 64-bits (OS X) // that's why the "v2f" functions are needed -static ccVertex2F v2fzero = {0.0f,0.0f}; +static Vertex2F v2fzero = {0.0f,0.0f}; -static inline ccVertex2F v2f(float x, float y) +static inline Vertex2F v2f(float x, float y) { - ccVertex2F ret = {x, y}; + Vertex2F ret = {x, y}; return ret; } -static inline ccVertex2F v2fadd(const ccVertex2F &v0, const ccVertex2F &v1) +static inline Vertex2F v2fadd(const Vertex2F &v0, const Vertex2F &v1) { return v2f(v0.x+v1.x, v0.y+v1.y); } -static inline ccVertex2F v2fsub(const ccVertex2F &v0, const ccVertex2F &v1) +static inline Vertex2F v2fsub(const Vertex2F &v0, const Vertex2F &v1) { return v2f(v0.x-v1.x, v0.y-v1.y); } -static inline ccVertex2F v2fmult(const ccVertex2F &v, float s) +static inline Vertex2F v2fmult(const Vertex2F &v, float s) { return v2f(v.x * s, v.y * s); } -static inline ccVertex2F v2fperp(const ccVertex2F &p0) +static inline Vertex2F v2fperp(const Vertex2F &p0) { return v2f(-p0.y, p0.x); } -static inline ccVertex2F v2fneg(const ccVertex2F &p0) +static inline Vertex2F v2fneg(const Vertex2F &p0) { return v2f(-p0.x, - p0.y); } -static inline float v2fdot(const ccVertex2F &p0, const ccVertex2F &p1) +static inline float v2fdot(const Vertex2F &p0, const Vertex2F &p1) { return p0.x * p1.x + p0.y * p1.y; } -static inline ccVertex2F v2fforangle(float _a_) +static inline Vertex2F v2fforangle(float _a_) { return v2f(cosf(_a_), sinf(_a_)); } -static inline ccVertex2F v2fnormalize(const ccVertex2F &p) +static inline Vertex2F v2fnormalize(const Vertex2F &p) { Point r = ccpNormalize(ccp(p.x, p.y)); return v2f(r.x, r.y); } -static inline ccVertex2F __v2f(const Point &v) +static inline Vertex2F __v2f(const Point &v) { //#ifdef __LP64__ return v2f(v.x, v.y); // #else -// return * ((ccVertex2F*) &v); +// return * ((Vertex2F*) &v); // #endif } -static inline ccTex2F __t(const ccVertex2F &v) +static inline Tex2F __t(const Vertex2F &v) { - return *(ccTex2F*)&v; + return *(Tex2F*)&v; } // implementation of DrawNode @@ -140,7 +140,7 @@ void DrawNode::ensureCapacity(unsigned int count) if(_bufferCount + count > _bufferCapacity) { _bufferCapacity += MAX(_bufferCapacity, count); - _buffer = (ccV2F_C4B_T2F*)realloc(_buffer, _bufferCapacity*sizeof(ccV2F_C4B_T2F)); + _buffer = (V2F_C4B_T2F*)realloc(_buffer, _bufferCapacity*sizeof(V2F_C4B_T2F)); } } @@ -160,16 +160,16 @@ bool DrawNode::init() glGenBuffers(1, &_vbo); glBindBuffer(GL_ARRAY_BUFFER, _vbo); - glBufferData(GL_ARRAY_BUFFER, sizeof(ccV2F_C4B_T2F)* _bufferCapacity, _buffer, GL_STREAM_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_T2F)* _bufferCapacity, _buffer, GL_STREAM_DRAW); glEnableVertexAttribArray(kVertexAttrib_Position); - glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, sizeof(ccV2F_C4B_T2F), (GLvoid *)offsetof(ccV2F_C4B_T2F, vertices)); + glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, vertices)); glEnableVertexAttribArray(kVertexAttrib_Color); - glVertexAttribPointer(kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(ccV2F_C4B_T2F), (GLvoid *)offsetof(ccV2F_C4B_T2F, colors)); + glVertexAttribPointer(kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, colors)); glEnableVertexAttribArray(kVertexAttrib_TexCoords); - glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, sizeof(ccV2F_C4B_T2F), (GLvoid *)offsetof(ccV2F_C4B_T2F, texCoords)); + glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, texCoords)); glBindBuffer(GL_ARRAY_BUFFER, 0); @@ -189,7 +189,7 @@ void DrawNode::render() if (_dirty) { glBindBuffer(GL_ARRAY_BUFFER, _vbo); - glBufferData(GL_ARRAY_BUFFER, sizeof(ccV2F_C4B_T2F)*_bufferCapacity, _buffer, GL_STREAM_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_T2F)*_bufferCapacity, _buffer, GL_STREAM_DRAW); _dirty = false; } #if CC_TEXTURE_ATLAS_USE_VAO @@ -198,13 +198,13 @@ void DrawNode::render() ccGLEnableVertexAttribs(kVertexAttribFlag_PosColorTex); glBindBuffer(GL_ARRAY_BUFFER, _vbo); // vertex - glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, sizeof(ccV2F_C4B_T2F), (GLvoid *)offsetof(ccV2F_C4B_T2F, vertices)); + glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, vertices)); // color - glVertexAttribPointer(kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(ccV2F_C4B_T2F), (GLvoid *)offsetof(ccV2F_C4B_T2F, colors)); + glVertexAttribPointer(kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, colors)); // texcood - glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, sizeof(ccV2F_C4B_T2F), (GLvoid *)offsetof(ccV2F_C4B_T2F, texCoords)); + glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, texCoords)); #endif glDrawArrays(GL_TRIANGLES, 0, _bufferCount); @@ -224,19 +224,19 @@ void DrawNode::draw() render(); } -void DrawNode::drawDot(const Point &pos, float radius, const ccColor4F &color) +void DrawNode::drawDot(const Point &pos, float radius, const Color4F &color) { unsigned int vertex_count = 2*3; ensureCapacity(vertex_count); - ccV2F_C4B_T2F a = {{pos.x - radius, pos.y - radius}, ccc4BFromccc4F(color), {-1.0, -1.0} }; - ccV2F_C4B_T2F b = {{pos.x - radius, pos.y + radius}, ccc4BFromccc4F(color), {-1.0, 1.0} }; - ccV2F_C4B_T2F c = {{pos.x + radius, pos.y + radius}, ccc4BFromccc4F(color), { 1.0, 1.0} }; - ccV2F_C4B_T2F d = {{pos.x + radius, pos.y - radius}, ccc4BFromccc4F(color), { 1.0, -1.0} }; + V2F_C4B_T2F a = {{pos.x - radius, pos.y - radius}, Color4F(color), {-1.0, -1.0} }; + V2F_C4B_T2F b = {{pos.x - radius, pos.y + radius}, Color4F(color), {-1.0, 1.0} }; + V2F_C4B_T2F c = {{pos.x + radius, pos.y + radius}, Color4F(color), { 1.0, 1.0} }; + V2F_C4B_T2F d = {{pos.x + radius, pos.y - radius}, Color4F(color), { 1.0, -1.0} }; - ccV2F_C4B_T2F_Triangle *triangles = (ccV2F_C4B_T2F_Triangle *)(_buffer + _bufferCount); - ccV2F_C4B_T2F_Triangle triangle0 = {a, b, c}; - ccV2F_C4B_T2F_Triangle triangle1 = {a, c, d}; + V2F_C4B_T2F_Triangle *triangles = (V2F_C4B_T2F_Triangle *)(_buffer + _bufferCount); + V2F_C4B_T2F_Triangle triangle0 = {a, b, c}; + V2F_C4B_T2F_Triangle triangle1 = {a, c, d}; triangles[0] = triangle0; triangles[1] = triangle1; @@ -245,71 +245,71 @@ void DrawNode::drawDot(const Point &pos, float radius, const ccColor4F &color) _dirty = true; } -void DrawNode::drawSegment(const Point &from, const Point &to, float radius, const ccColor4F &color) +void DrawNode::drawSegment(const Point &from, const Point &to, float radius, const Color4F &color) { unsigned int vertex_count = 6*3; ensureCapacity(vertex_count); - ccVertex2F a = __v2f(from); - ccVertex2F b = __v2f(to); + Vertex2F a = __v2f(from); + Vertex2F b = __v2f(to); - ccVertex2F n = v2fnormalize(v2fperp(v2fsub(b, a))); - ccVertex2F t = v2fperp(n); + Vertex2F n = v2fnormalize(v2fperp(v2fsub(b, a))); + Vertex2F t = v2fperp(n); - ccVertex2F nw = v2fmult(n, radius); - ccVertex2F tw = v2fmult(t, radius); - ccVertex2F v0 = v2fsub(b, v2fadd(nw, tw)); - ccVertex2F v1 = v2fadd(b, v2fsub(nw, tw)); - ccVertex2F v2 = v2fsub(b, nw); - ccVertex2F v3 = v2fadd(b, nw); - ccVertex2F v4 = v2fsub(a, nw); - ccVertex2F v5 = v2fadd(a, nw); - ccVertex2F v6 = v2fsub(a, v2fsub(nw, tw)); - ccVertex2F v7 = v2fadd(a, v2fadd(nw, tw)); + Vertex2F nw = v2fmult(n, radius); + Vertex2F tw = v2fmult(t, radius); + Vertex2F v0 = v2fsub(b, v2fadd(nw, tw)); + Vertex2F v1 = v2fadd(b, v2fsub(nw, tw)); + Vertex2F v2 = v2fsub(b, nw); + Vertex2F v3 = v2fadd(b, nw); + Vertex2F v4 = v2fsub(a, nw); + Vertex2F v5 = v2fadd(a, nw); + Vertex2F v6 = v2fsub(a, v2fsub(nw, tw)); + Vertex2F v7 = v2fadd(a, v2fadd(nw, tw)); - ccV2F_C4B_T2F_Triangle *triangles = (ccV2F_C4B_T2F_Triangle *)(_buffer + _bufferCount); + V2F_C4B_T2F_Triangle *triangles = (V2F_C4B_T2F_Triangle *)(_buffer + _bufferCount); - ccV2F_C4B_T2F_Triangle triangles0 = { - {v0, ccc4BFromccc4F(color), __t(v2fneg(v2fadd(n, t)))}, - {v1, ccc4BFromccc4F(color), __t(v2fsub(n, t))}, - {v2, ccc4BFromccc4F(color), __t(v2fneg(n))}, + V2F_C4B_T2F_Triangle triangles0 = { + {v0, Color4F(color), __t(v2fneg(v2fadd(n, t)))}, + {v1, Color4F(color), __t(v2fsub(n, t))}, + {v2, Color4F(color), __t(v2fneg(n))}, }; triangles[0] = triangles0; - ccV2F_C4B_T2F_Triangle triangles1 = { - {v3, ccc4BFromccc4F(color), __t(n)}, - {v1, ccc4BFromccc4F(color), __t(v2fsub(n, t))}, - {v2, ccc4BFromccc4F(color), __t(v2fneg(n))}, + V2F_C4B_T2F_Triangle triangles1 = { + {v3, Color4F(color), __t(n)}, + {v1, Color4F(color), __t(v2fsub(n, t))}, + {v2, Color4F(color), __t(v2fneg(n))}, }; triangles[1] = triangles1; - ccV2F_C4B_T2F_Triangle triangles2 = { - {v3, ccc4BFromccc4F(color), __t(n)}, - {v4, ccc4BFromccc4F(color), __t(v2fneg(n))}, - {v2, ccc4BFromccc4F(color), __t(v2fneg(n))}, + V2F_C4B_T2F_Triangle triangles2 = { + {v3, Color4F(color), __t(n)}, + {v4, Color4F(color), __t(v2fneg(n))}, + {v2, Color4F(color), __t(v2fneg(n))}, }; triangles[2] = triangles2; - ccV2F_C4B_T2F_Triangle triangles3 = { - {v3, ccc4BFromccc4F(color), __t(n)}, - {v4, ccc4BFromccc4F(color), __t(v2fneg(n))}, - {v5, ccc4BFromccc4F(color), __t(n) }, + V2F_C4B_T2F_Triangle triangles3 = { + {v3, Color4F(color), __t(n)}, + {v4, Color4F(color), __t(v2fneg(n))}, + {v5, Color4F(color), __t(n) }, }; triangles[3] = triangles3; - ccV2F_C4B_T2F_Triangle triangles4 = { - {v6, ccc4BFromccc4F(color), __t(v2fsub(t, n))}, - {v4, ccc4BFromccc4F(color), __t(v2fneg(n)) }, - {v5, ccc4BFromccc4F(color), __t(n)}, + V2F_C4B_T2F_Triangle triangles4 = { + {v6, Color4F(color), __t(v2fsub(t, n))}, + {v4, Color4F(color), __t(v2fneg(n)) }, + {v5, Color4F(color), __t(n)}, }; triangles[4] = triangles4; - ccV2F_C4B_T2F_Triangle triangles5 = { - {v6, ccc4BFromccc4F(color), __t(v2fsub(t, n))}, - {v7, ccc4BFromccc4F(color), __t(v2fadd(n, t))}, - {v5, ccc4BFromccc4F(color), __t(n)}, + V2F_C4B_T2F_Triangle triangles5 = { + {v6, Color4F(color), __t(v2fsub(t, n))}, + {v7, Color4F(color), __t(v2fadd(n, t))}, + {v5, Color4F(color), __t(n)}, }; triangles[5] = triangles5; @@ -318,22 +318,22 @@ void DrawNode::drawSegment(const Point &from, const Point &to, float radius, con _dirty = true; } -void DrawNode::drawPolygon(Point *verts, unsigned int count, const ccColor4F &fillColor, float borderWidth, const ccColor4F &borderColor) +void DrawNode::drawPolygon(Point *verts, unsigned int count, const Color4F &fillColor, float borderWidth, const Color4F &borderColor) { - struct ExtrudeVerts {ccVertex2F offset, n;}; + struct ExtrudeVerts {Vertex2F offset, n;}; struct ExtrudeVerts* extrude = (struct ExtrudeVerts*)malloc(sizeof(struct ExtrudeVerts)*count); memset(extrude, 0, sizeof(struct ExtrudeVerts)*count); for(unsigned int i = 0; i < count; i++) { - ccVertex2F v0 = __v2f(verts[(i-1+count)%count]); - ccVertex2F v1 = __v2f(verts[i]); - ccVertex2F v2 = __v2f(verts[(i+1)%count]); + Vertex2F v0 = __v2f(verts[(i-1+count)%count]); + Vertex2F v1 = __v2f(verts[i]); + Vertex2F v2 = __v2f(verts[(i+1)%count]); - ccVertex2F n1 = v2fnormalize(v2fperp(v2fsub(v1, v0))); - ccVertex2F n2 = v2fnormalize(v2fperp(v2fsub(v2, v1))); + Vertex2F n1 = v2fnormalize(v2fperp(v2fsub(v1, v0))); + Vertex2F n2 = v2fnormalize(v2fperp(v2fsub(v2, v1))); - ccVertex2F offset = v2fmult(v2fadd(n1, n2), 1.0/(v2fdot(n1, n2) + 1.0)); + Vertex2F offset = v2fmult(v2fadd(n1, n2), 1.0/(v2fdot(n1, n2) + 1.0)); struct ExtrudeVerts tmp = {offset, n2}; extrude[i] = tmp; } @@ -344,20 +344,20 @@ void DrawNode::drawPolygon(Point *verts, unsigned int count, const ccColor4F &fi unsigned int vertex_count = 3*triangle_count; ensureCapacity(vertex_count); - ccV2F_C4B_T2F_Triangle *triangles = (ccV2F_C4B_T2F_Triangle *)(_buffer + _bufferCount); - ccV2F_C4B_T2F_Triangle *cursor = triangles; + V2F_C4B_T2F_Triangle *triangles = (V2F_C4B_T2F_Triangle *)(_buffer + _bufferCount); + V2F_C4B_T2F_Triangle *cursor = triangles; float inset = (outline == 0.0 ? 0.5 : 0.0); for(unsigned int i = 0; i < count-2; i++) { - ccVertex2F v0 = v2fsub(__v2f(verts[0 ]), v2fmult(extrude[0 ].offset, inset)); - ccVertex2F v1 = v2fsub(__v2f(verts[i+1]), v2fmult(extrude[i+1].offset, inset)); - ccVertex2F v2 = v2fsub(__v2f(verts[i+2]), v2fmult(extrude[i+2].offset, inset)); + Vertex2F v0 = v2fsub(__v2f(verts[0 ]), v2fmult(extrude[0 ].offset, inset)); + Vertex2F v1 = v2fsub(__v2f(verts[i+1]), v2fmult(extrude[i+1].offset, inset)); + Vertex2F v2 = v2fsub(__v2f(verts[i+2]), v2fmult(extrude[i+2].offset, inset)); - ccV2F_C4B_T2F_Triangle tmp = { - {v0, ccc4BFromccc4F(fillColor), __t(v2fzero)}, - {v1, ccc4BFromccc4F(fillColor), __t(v2fzero)}, - {v2, ccc4BFromccc4F(fillColor), __t(v2fzero)}, + V2F_C4B_T2F_Triangle tmp = { + {v0, Color4F(fillColor), __t(v2fzero)}, + {v1, Color4F(fillColor), __t(v2fzero)}, + {v2, Color4F(fillColor), __t(v2fzero)}, }; *cursor++ = tmp; @@ -366,52 +366,52 @@ void DrawNode::drawPolygon(Point *verts, unsigned int count, const ccColor4F &fi for(unsigned int i = 0; i < count; i++) { int j = (i+1)%count; - ccVertex2F v0 = __v2f(verts[i]); - ccVertex2F v1 = __v2f(verts[j]); + Vertex2F v0 = __v2f(verts[i]); + Vertex2F v1 = __v2f(verts[j]); - ccVertex2F n0 = extrude[i].n; + Vertex2F n0 = extrude[i].n; - ccVertex2F offset0 = extrude[i].offset; - ccVertex2F offset1 = extrude[j].offset; + Vertex2F offset0 = extrude[i].offset; + Vertex2F offset1 = extrude[j].offset; if(outline) { - ccVertex2F inner0 = v2fsub(v0, v2fmult(offset0, borderWidth)); - ccVertex2F inner1 = v2fsub(v1, v2fmult(offset1, borderWidth)); - ccVertex2F outer0 = v2fadd(v0, v2fmult(offset0, borderWidth)); - ccVertex2F outer1 = v2fadd(v1, v2fmult(offset1, borderWidth)); + Vertex2F inner0 = v2fsub(v0, v2fmult(offset0, borderWidth)); + Vertex2F inner1 = v2fsub(v1, v2fmult(offset1, borderWidth)); + Vertex2F outer0 = v2fadd(v0, v2fmult(offset0, borderWidth)); + Vertex2F outer1 = v2fadd(v1, v2fmult(offset1, borderWidth)); - ccV2F_C4B_T2F_Triangle tmp1 = { - {inner0, ccc4BFromccc4F(borderColor), __t(v2fneg(n0))}, - {inner1, ccc4BFromccc4F(borderColor), __t(v2fneg(n0))}, - {outer1, ccc4BFromccc4F(borderColor), __t(n0)} + V2F_C4B_T2F_Triangle tmp1 = { + {inner0, Color4F(borderColor), __t(v2fneg(n0))}, + {inner1, Color4F(borderColor), __t(v2fneg(n0))}, + {outer1, Color4F(borderColor), __t(n0)} }; *cursor++ = tmp1; - ccV2F_C4B_T2F_Triangle tmp2 = { - {inner0, ccc4BFromccc4F(borderColor), __t(v2fneg(n0))}, - {outer0, ccc4BFromccc4F(borderColor), __t(n0)}, - {outer1, ccc4BFromccc4F(borderColor), __t(n0)} + V2F_C4B_T2F_Triangle tmp2 = { + {inner0, Color4F(borderColor), __t(v2fneg(n0))}, + {outer0, Color4F(borderColor), __t(n0)}, + {outer1, Color4F(borderColor), __t(n0)} }; *cursor++ = tmp2; } else { - ccVertex2F inner0 = v2fsub(v0, v2fmult(offset0, 0.5)); - ccVertex2F inner1 = v2fsub(v1, v2fmult(offset1, 0.5)); - ccVertex2F outer0 = v2fadd(v0, v2fmult(offset0, 0.5)); - ccVertex2F outer1 = v2fadd(v1, v2fmult(offset1, 0.5)); + Vertex2F inner0 = v2fsub(v0, v2fmult(offset0, 0.5)); + Vertex2F inner1 = v2fsub(v1, v2fmult(offset1, 0.5)); + Vertex2F outer0 = v2fadd(v0, v2fmult(offset0, 0.5)); + Vertex2F outer1 = v2fadd(v1, v2fmult(offset1, 0.5)); - ccV2F_C4B_T2F_Triangle tmp1 = { - {inner0, ccc4BFromccc4F(fillColor), __t(v2fzero)}, - {inner1, ccc4BFromccc4F(fillColor), __t(v2fzero)}, - {outer1, ccc4BFromccc4F(fillColor), __t(n0)} + V2F_C4B_T2F_Triangle tmp1 = { + {inner0, Color4F(fillColor), __t(v2fzero)}, + {inner1, Color4F(fillColor), __t(v2fzero)}, + {outer1, Color4F(fillColor), __t(n0)} }; *cursor++ = tmp1; - ccV2F_C4B_T2F_Triangle tmp2 = { - {inner0, ccc4BFromccc4F(fillColor), __t(v2fzero)}, - {outer0, ccc4BFromccc4F(fillColor), __t(n0)}, - {outer1, ccc4BFromccc4F(fillColor), __t(n0)} + V2F_C4B_T2F_Triangle tmp2 = { + {inner0, Color4F(fillColor), __t(v2fzero)}, + {outer0, Color4F(fillColor), __t(n0)}, + {outer1, Color4F(fillColor), __t(n0)} }; *cursor++ = tmp2; } @@ -430,12 +430,12 @@ void DrawNode::clear() _dirty = true; } -const ccBlendFunc& DrawNode::getBlendFunc() const +const BlendFunc& DrawNode::getBlendFunc() const { return _blendFunc; } -void DrawNode::setBlendFunc(const ccBlendFunc &blendFunc) +void DrawNode::setBlendFunc(const BlendFunc &blendFunc) { _blendFunc = blendFunc; } diff --git a/cocos2dx/draw_nodes/CCDrawNode.h b/cocos2dx/draw_nodes/CCDrawNode.h index 52c4d66f3a..3c74e56e5e 100644 --- a/cocos2dx/draw_nodes/CCDrawNode.h +++ b/cocos2dx/draw_nodes/CCDrawNode.h @@ -49,9 +49,9 @@ protected: unsigned int _bufferCapacity; GLsizei _bufferCount; - ccV2F_C4B_T2F *_buffer; + V2F_C4B_T2F *_buffer; - ccBlendFunc _blendFunc; + BlendFunc _blendFunc; bool _dirty; @@ -63,19 +63,19 @@ public: virtual void draw(); /** draw a dot at a position, with a given radius and color */ - void drawDot(const Point &pos, float radius, const ccColor4F &color); + void drawDot(const Point &pos, float radius, const Color4F &color); /** draw a segment with a radius and color */ - void drawSegment(const Point &from, const Point &to, float radius, const ccColor4F &color); + void drawSegment(const Point &from, const Point &to, float radius, const Color4F &color); /** draw a polygon with a fill color and line color */ - void drawPolygon(Point *verts, unsigned int count, const ccColor4F &fillColor, float borderWidth, const ccColor4F &borderColor); + void drawPolygon(Point *verts, unsigned int count, const Color4F &fillColor, float borderWidth, const Color4F &borderColor); /** Clear the geometry in the node's buffer. */ void clear(); - const ccBlendFunc& getBlendFunc() const; - void setBlendFunc(const ccBlendFunc &blendFunc); + const BlendFunc& getBlendFunc() const; + void setBlendFunc(const BlendFunc &blendFunc); DrawNode(); diff --git a/cocos2dx/draw_nodes/CCDrawingPrimitives.cpp b/cocos2dx/draw_nodes/CCDrawingPrimitives.cpp index 8e55c894ad..9dffb9c840 100644 --- a/cocos2dx/draw_nodes/CCDrawingPrimitives.cpp +++ b/cocos2dx/draw_nodes/CCDrawingPrimitives.cpp @@ -56,7 +56,7 @@ NS_CC_BEGIN static bool s_bInitialized = false; static GLProgram* s_pShader = NULL; static int s_nColorLocation = -1; -static ccColor4F s_tColor = {1.0f,1.0f,1.0f,1.0f}; +static Color4F s_tColor = {1.0f,1.0f,1.0f,1.0f}; static int s_nPointSizeLocation = -1; static GLfloat s_fPointSize = 1.0f; @@ -122,7 +122,7 @@ void ccDrawPoint( const Point& point ) { lazy_init(); - ccVertex2F p; + Vertex2F p; p.x = point.x; p.y = point.y; @@ -156,10 +156,10 @@ void ccDrawPoints( const Point *points, unsigned int numberOfPoints ) s_pShader->setUniformLocationWith1f(s_nPointSizeLocation, s_fPointSize); // XXX: Mac OpenGL error. arrays can't go out of scope before draw is executed - ccVertex2F* newPoints = new ccVertex2F[numberOfPoints]; + Vertex2F* newPoints = new Vertex2F[numberOfPoints]; // iPhone and 32-bit machines optimization - if( sizeof(Point) == sizeof(ccVertex2F) ) + if( sizeof(Point) == sizeof(Vertex2F) ) { #ifdef EMSCRIPTEN setGLBufferData((void*) points, numberOfPoints * sizeof(Point)); @@ -178,7 +178,7 @@ void ccDrawPoints( const Point *points, unsigned int numberOfPoints ) #ifdef EMSCRIPTEN // Suspect Emscripten won't be emitting 64-bit code for a while yet, // but want to make sure this continues to work even if they do. - setGLBufferData(newPoints, numberOfPoints * sizeof(ccVertex2F)); + setGLBufferData(newPoints, numberOfPoints * sizeof(Vertex2F)); glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0); #else glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, newPoints); @@ -197,7 +197,7 @@ void ccDrawLine( const Point& origin, const Point& destination ) { lazy_init(); - ccVertex2F vertices[2] = { + Vertex2F vertices[2] = { {origin.x, origin.y}, {destination.x, destination.y} }; @@ -226,7 +226,7 @@ void ccDrawRect( Point origin, Point destination ) ccDrawLine(CCPointMake(origin.x, destination.y), CCPointMake(origin.x, origin.y)); } -void ccDrawSolidRect( Point origin, Point destination, ccColor4F color ) +void ccDrawSolidRect( Point origin, Point destination, Color4F color ) { Point vertices[] = { origin, @@ -249,7 +249,7 @@ void ccDrawPoly( const Point *poli, unsigned int numberOfPoints, bool closePolyg ccGLEnableVertexAttribs( kVertexAttribFlag_Position ); // iPhone and 32-bit machines optimization - if( sizeof(Point) == sizeof(ccVertex2F) ) + if( sizeof(Point) == sizeof(Vertex2F) ) { #ifdef EMSCRIPTEN setGLBufferData((void*) poli, numberOfPoints * sizeof(Point)); @@ -267,13 +267,13 @@ void ccDrawPoly( const Point *poli, unsigned int numberOfPoints, bool closePolyg { // Mac on 64-bit // XXX: Mac OpenGL error. arrays can't go out of scope before draw is executed - ccVertex2F* newPoli = new ccVertex2F[numberOfPoints]; + Vertex2F* newPoli = new Vertex2F[numberOfPoints]; for( unsigned int i=0; i 0) { - memcpy(_originalVertices, _vertices, (_gridSize.width+1) * (_gridSize.height+1) * sizeof(ccVertex3F)); + memcpy(_originalVertices, _vertices, (_gridSize.width+1) * (_gridSize.height+1) * sizeof(Vertex3F)); --_reuseGrid; } } @@ -543,11 +543,11 @@ void TiledGrid3D::blit(void) int numQuads = _gridSize.width * _gridSize.height; // position - setGLBufferData(_vertices, (numQuads*4*sizeof(ccVertex3F)), 0); + setGLBufferData(_vertices, (numQuads*4*sizeof(Vertex3F)), 0); glVertexAttribPointer(kVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, 0, 0); // texCoords - setGLBufferData(_texCoordinates, (numQuads*4*sizeof(ccVertex2F)), 1); + setGLBufferData(_texCoordinates, (numQuads*4*sizeof(Vertex2F)), 1); glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, 0); setGLIndexData(_indices, n * 12, 0); @@ -578,9 +578,9 @@ void TiledGrid3D::calculateVertexPoints(void) CC_SAFE_FREE(_texCoordinates); CC_SAFE_FREE(_indices); - _vertices = malloc(numQuads*4*sizeof(ccVertex3F)); - _originalVertices = malloc(numQuads*4*sizeof(ccVertex3F)); - _texCoordinates = malloc(numQuads*4*sizeof(ccVertex2F)); + _vertices = malloc(numQuads*4*sizeof(Vertex3F)); + _originalVertices = malloc(numQuads*4*sizeof(Vertex3F)); + _texCoordinates = malloc(numQuads*4*sizeof(Vertex2F)); _indices = (GLushort*)malloc(numQuads*6*sizeof(GLushort)); GLfloat *vertArray = (GLfloat*)_vertices; @@ -645,34 +645,34 @@ void TiledGrid3D::calculateVertexPoints(void) memcpy(_originalVertices, _vertices, numQuads * 12 * sizeof(GLfloat)); } -void TiledGrid3D::setTile(const Point& pos, const ccQuad3& coords) +void TiledGrid3D::setTile(const Point& pos, const Quad3& coords) { CCAssert( pos.x == (unsigned int)pos.x && pos.y == (unsigned int) pos.y , "Numbers must be integers"); int idx = (_gridSize.height * pos.x + pos.y) * 4 * 3; float *vertArray = (float*)_vertices; - memcpy(&vertArray[idx], &coords, sizeof(ccQuad3)); + memcpy(&vertArray[idx], &coords, sizeof(Quad3)); } -ccQuad3 TiledGrid3D::originalTile(const Point& pos) +Quad3 TiledGrid3D::originalTile(const Point& pos) { CCAssert( pos.x == (unsigned int)pos.x && pos.y == (unsigned int) pos.y , "Numbers must be integers"); int idx = (_gridSize.height * pos.x + pos.y) * 4 * 3; float *vertArray = (float*)_originalVertices; - ccQuad3 ret; - memcpy(&ret, &vertArray[idx], sizeof(ccQuad3)); + Quad3 ret; + memcpy(&ret, &vertArray[idx], sizeof(Quad3)); return ret; } -ccQuad3 TiledGrid3D::tile(const Point& pos) +Quad3 TiledGrid3D::tile(const Point& pos) { CCAssert( pos.x == (unsigned int)pos.x && pos.y == (unsigned int) pos.y , "Numbers must be integers"); int idx = (_gridSize.height * pos.x + pos.y) * 4 * 3; float *vertArray = (float*)_vertices; - ccQuad3 ret; - memcpy(&ret, &vertArray[idx], sizeof(ccQuad3)); + Quad3 ret; + memcpy(&ret, &vertArray[idx], sizeof(Quad3)); return ret; } diff --git a/cocos2dx/effects/CCGrid.h b/cocos2dx/effects/CCGrid.h index 829138baf3..516ff0997a 100644 --- a/cocos2dx/effects/CCGrid.h +++ b/cocos2dx/effects/CCGrid.h @@ -117,11 +117,11 @@ public: ~Grid3D(void); /** returns the vertex at a given position */ - ccVertex3F vertex(const Point& pos); + Vertex3F vertex(const Point& pos); /** returns the original (non-transformed) vertex at a given position */ - ccVertex3F originalVertex(const Point& pos); + Vertex3F originalVertex(const Point& pos); /** sets a new vertex at a given position */ - void setVertex(const Point& pos, const ccVertex3F& vertex); + void setVertex(const Point& pos, const Vertex3F& vertex); virtual void blit(void); virtual void reuse(void); @@ -154,11 +154,11 @@ public: ~TiledGrid3D(void); /** returns the tile at the given position */ - ccQuad3 tile(const Point& pos); + Quad3 tile(const Point& pos); /** returns the original tile (untransformed) at the given position */ - ccQuad3 originalTile(const Point& pos); + Quad3 originalTile(const Point& pos); /** sets a new tile */ - void setTile(const Point& pos, const ccQuad3& coords); + void setTile(const Point& pos, const Quad3& coords); virtual void blit(void); virtual void reuse(void); diff --git a/cocos2dx/include/CCProtocols.h b/cocos2dx/include/CCProtocols.h index 737f7e3afb..f2c10d4db7 100644 --- a/cocos2dx/include/CCProtocols.h +++ b/cocos2dx/include/CCProtocols.h @@ -41,23 +41,23 @@ public: /** * Changes the color with R,G,B bytes * - * @param color Example: ccc3(255,100,0) means R=255, G=100, B=0 + * @param color Example: Color3B(255,100,0) means R=255, G=100, B=0 */ - virtual void setColor(const ccColor3B& color) = 0; + virtual void setColor(const Color3B& color) = 0; /** * Returns color that is currently used. * - * @return The ccColor3B contains R,G,B bytes. + * @return The Color3B contains R,G,B bytes. */ - virtual const ccColor3B& getColor(void) const = 0; + virtual const Color3B& getColor(void) const = 0; /** * Returns the displayed color. * - * @return The ccColor3B contains R,G,B bytes. + * @return The Color3B contains R,G,B bytes. */ - virtual const ccColor3B& getDisplayedColor(void) const = 0; + virtual const Color3B& getDisplayedColor(void) const = 0; /** * Returns the displayed opacity. @@ -111,7 +111,7 @@ public: /** * recursive method that updates display color */ - virtual void updateDisplayedColor(const ccColor3B& color) = 0; + virtual void updateDisplayedColor(const Color3B& color) = 0; /** * whether or not opacity should be propagated to its children. @@ -140,14 +140,14 @@ public: * e.g. {GL_ONE, GL_ONE}, {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}. * */ - virtual void setBlendFunc(const ccBlendFunc &blendFunc) = 0; + virtual void setBlendFunc(const BlendFunc &blendFunc) = 0; /** * Returns the blending function that is currently being used. * - * @return A ccBlendFunc structure with source and destination factor which specified pixel arithmetic. + * @return A BlendFunc structure with source and destination factor which specified pixel arithmetic. */ - virtual const ccBlendFunc &getBlendFunc(void) const = 0; + virtual const BlendFunc &getBlendFunc(void) const = 0; }; /** diff --git a/cocos2dx/include/ccTypes.h b/cocos2dx/include/ccTypes.h index 1c0aac778c..aa4d653f9f 100644 --- a/cocos2dx/include/ccTypes.h +++ b/cocos2dx/include/ccTypes.h @@ -35,289 +35,274 @@ THE SOFTWARE. NS_CC_BEGIN /** RGB color composed of bytes 3 bytes -@since v0.8 +@since v3.0 */ -typedef struct _ccColor3B +struct Color3B { + Color3B(): r(0), g(0), b(0) {} + + Color3B(float _r, float _g, float _b) + :r(_r), + g(_g), + b(_b) + {} + + bool equals(const Color3B &other) + { + return (this->r == other.r && + this->g == other.g && + this->b == other.b); + } + GLubyte r; GLubyte g; GLubyte b; -} ccColor3B; + + const static Color3B white; + const static Color3B yellow; + const static Color3B blue; + const static Color3B green; + const static Color3B red; + const static Color3B magenta; + const static Color3B black; + const static Color3B orange; + const static Color3B gray; +}; -//! helper macro that creates an ccColor3B type -static inline ccColor3B -ccc3(const GLubyte r, const GLubyte g, const GLubyte b) -{ - ccColor3B c = {r, g, b}; - return c; -} - -/** returns true if both ccColor3B are equal. Otherwise it returns false. - */ -static inline bool ccc3BEqual(const ccColor3B &col1, const ccColor3B &col2) -{ - return col1.r == col2.r && col1.g == col2.g && col1.b == col2.b; -} - -//ccColor3B predefined colors -//! White color (255,255,255) -static const ccColor3B ccWHITE={255,255,255}; -//! Yellow color (255,255,0) -static const ccColor3B ccYELLOW={255,255,0}; -//! Blue color (0,0,255) -static const ccColor3B ccBLUE={0,0,255}; -//! Green Color (0,255,0) -static const ccColor3B ccGREEN={0,255,0}; -//! Red Color (255,0,0,) -static const ccColor3B ccRED={255,0,0}; -//! Magenta Color (255,0,255) -static const ccColor3B ccMAGENTA={255,0,255}; -//! Black Color (0,0,0) -static const ccColor3B ccBLACK={0,0,0}; -//! Orange Color (255,127,0) -static const ccColor3B ccORANGE={255,127,0}; -//! Gray Color (166,166,166) -static const ccColor3B ccGRAY={166,166,166}; +struct Color4F; /** RGBA color composed of 4 bytes -@since v0.8 +@since v3.0 */ -typedef struct _ccColor4B +struct Color4B { + Color4B(float _r, float _g, float _b, float _a) + :r(_r), + g(_g), + b(_b), + a(_a) + {} + + Color4B(): r(0.f), g(0.f), b(0.f), a(0.f) {} + + // This function should use Color4F, so implement it in .cpp file. + Color4B(const Color4F &color4F); + GLubyte r; GLubyte g; GLubyte b; GLubyte a; -} ccColor4B; -//! helper macro that creates an ccColor4B type -static inline ccColor4B -ccc4(const GLubyte r, const GLubyte g, const GLubyte b, const GLubyte o) -{ - ccColor4B c = {r, g, b, o}; - return c; -} +}; /** RGBA color composed of 4 floats -@since v0.8 +@since v3.0 */ -typedef struct _ccColor4F { +struct Color4F +{ + Color4F(float _r, float _g, float _b, float _a) + :r(_r), + g(_g), + b(_b), + a(_a) + {} + + Color4F(const Color3B &color3B) + :r(color3B.r) + ,g(color3B.g) + ,b(color3B.b) + ,a(1.f) + {} + + Color4F(const Color4B &color4B) + :r(color4B.r / 255.0f), + g(color4B.g / 255.0f), + b(color4B.b / 255.0f), + a(color4B.a / 255.0f) + {} + + Color4F(): r(0.f), g(0.f), b(0.f), a(0.f) {} + + bool equals(const Color4F &other) + { + return (this->r == other.r && + this->g == other.g && + this->b == other.b && + this->a == other.a); + } + GLfloat r; GLfloat g; GLfloat b; GLfloat a; -} ccColor4F; - - -/** Returns a ccColor4F from a ccColor3B. Alpha will be 1. - @since v0.99.1 - */ -static inline ccColor4F ccc4FFromccc3B(ccColor3B c) -{ - ccColor4F c4 = {c.r/255.f, c.g/255.f, c.b/255.f, 1.f}; - return c4; -} - -//! helper that creates a ccColor4f type -static inline ccColor4F -ccc4f(const GLfloat r, const GLfloat g, const GLfloat b, const GLfloat a) -{ - ccColor4F c4 = {r, g, b, a}; - return c4; -} - -/** Returns a ccColor4F from a ccColor4B. - @since v0.99.1 - */ -static inline ccColor4F ccc4FFromccc4B(ccColor4B c) -{ - ccColor4F c4 = {c.r/255.f, c.g/255.f, c.b/255.f, c.a/255.f}; - return c4; -} - -static inline ccColor4B ccc4BFromccc4F(ccColor4F c) -{ - ccColor4B ret = {(GLubyte)(c.r*255), (GLubyte)(c.g*255), (GLubyte)(c.b*255), (GLubyte)(c.a*255)}; - return ret; -} - -/** returns YES if both ccColor4F are equal. Otherwise it returns NO. - @since v0.99.1 - */ -static inline bool ccc4FEqual(ccColor4F a, ccColor4F b) -{ - return a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a; -} +}; /** A vertex composed of 2 floats: x, y - @since v0.8 + @since v3.0 */ -typedef struct _ccVertex2F +struct Vertex2F { + Vertex2F(float _x, float _y) :x(_x), y(_y) {} + + Vertex2F(): x(0.f), y(0.f) {} + GLfloat x; GLfloat y; -} ccVertex2F; - -static inline ccVertex2F vertex2(const float x, const float y) -{ - ccVertex2F c = {x, y}; - return c; -} +}; /** A vertex composed of 2 floats: x, y - @since v0.8 + @since v3.0 */ -typedef struct _ccVertex3F +struct Vertex3F { + Vertex3F(float _x, float _y, float _z) + :x(_x), + y(_y), + z(_z) + {} + + Vertex3F(): x(0.f), y(0.f), z(0.f) {} + GLfloat x; GLfloat y; GLfloat z; -} ccVertex3F; - -static inline ccVertex3F vertex3(const float x, const float y, const float z) -{ - ccVertex3F c = {x, y, z}; - return c; -} +}; /** A texcoord composed of 2 floats: u, y - @since v0.8 + @since v3.0 */ -typedef struct _ccTex2F { - GLfloat u; - GLfloat v; -} ccTex2F; - -static inline ccTex2F tex2(const float u, const float v) -{ - ccTex2F t = {u , v}; - return t; -} +struct Tex2F { + Tex2F(float _u, float _v): u(_u), v(_v) {} + + Tex2F(): u(0.f), v(0.f) {} + + GLfloat u; + GLfloat v; +}; //! Point Sprite component -typedef struct _ccPointSprite +struct PointSprite { - ccVertex2F pos; // 8 bytes - ccColor4B color; // 4 bytes - GLfloat size; // 4 bytes -} ccPointSprite; + Vertex2F pos; // 8 bytes + Color4B color; // 4 bytes + GLfloat size; // 4 bytes +}; //! A 2D Quad. 4 * 2 floats -typedef struct _ccQuad2 { - ccVertex2F tl; - ccVertex2F tr; - ccVertex2F bl; - ccVertex2F br; -} ccQuad2; +struct Quad2 +{ + Vertex2F tl; + Vertex2F tr; + Vertex2F bl; + Vertex2F br; +}; //! A 3D Quad. 4 * 3 floats -typedef struct _ccQuad3 { - ccVertex3F bl; - ccVertex3F br; - ccVertex3F tl; - ccVertex3F tr; -} ccQuad3; +struct Quad3 { + Vertex3F bl; + Vertex3F br; + Vertex3F tl; + Vertex3F tr; +}; //! a Point with a vertex point, a tex coord point and a color 4B -typedef struct _ccV2F_C4B_T2F +struct V2F_C4B_T2F { //! vertices (2F) - ccVertex2F vertices; + Vertex2F vertices; //! colors (4B) - ccColor4B colors; + Color4B colors; //! tex coords (2F) - ccTex2F texCoords; -} ccV2F_C4B_T2F; + Tex2F texCoords; +}; //! a Point with a vertex point, a tex coord point and a color 4F -typedef struct _ccV2F_C4F_T2F +struct V2F_C4F_T2F { //! vertices (2F) - ccVertex2F vertices; + Vertex2F vertices; //! colors (4F) - ccColor4F colors; + Color4F colors; //! tex coords (2F) - ccTex2F texCoords; -} ccV2F_C4F_T2F; + Tex2F texCoords; +}; //! a Point with a vertex point, a tex coord point and a color 4B -typedef struct _ccV3F_C4B_T2F +struct V3F_C4B_T2F { //! vertices (3F) - ccVertex3F vertices; // 12 bytes -// char __padding__[4]; + Vertex3F vertices; // 12 bytes //! colors (4B) - ccColor4B colors; // 4 bytes -// char __padding2__[4]; + Color4B colors; // 4 bytes // tex coords (2F) - ccTex2F texCoords; // 8 bytes -} ccV3F_C4B_T2F; + Tex2F texCoords; // 8 bytes +}; -//! A Triangle of ccV2F_C4B_T2F -typedef struct _ccV2F_C4B_T2F_Triangle +//! A Triangle of V2F_C4B_T2F +struct V2F_C4B_T2F_Triangle { //! Point A - ccV2F_C4B_T2F a; + V2F_C4B_T2F a; //! Point B - ccV2F_C4B_T2F b; + V2F_C4B_T2F b; //! Point B - ccV2F_C4B_T2F c; -} ccV2F_C4B_T2F_Triangle; + V2F_C4B_T2F c; +}; -//! A Quad of ccV2F_C4B_T2F -typedef struct _ccV2F_C4B_T2F_Quad +//! A Quad of V2F_C4B_T2F +struct V2F_C4B_T2F_Quad { //! bottom left - ccV2F_C4B_T2F bl; + V2F_C4B_T2F bl; //! bottom right - ccV2F_C4B_T2F br; + V2F_C4B_T2F br; //! top left - ccV2F_C4B_T2F tl; + V2F_C4B_T2F tl; //! top right - ccV2F_C4B_T2F tr; -} ccV2F_C4B_T2F_Quad; + V2F_C4B_T2F tr; +}; -//! 4 ccVertex3FTex2FColor4B -typedef struct _ccV3F_C4B_T2F_Quad +//! 4 Vertex3FTex2FColor4B +struct V3F_C4B_T2F_Quad { //! top left - ccV3F_C4B_T2F tl; + V3F_C4B_T2F tl; //! bottom left - ccV3F_C4B_T2F bl; + V3F_C4B_T2F bl; //! top right - ccV3F_C4B_T2F tr; + V3F_C4B_T2F tr; //! bottom right - ccV3F_C4B_T2F br; -} ccV3F_C4B_T2F_Quad; + V3F_C4B_T2F br; +}; -//! 4 ccVertex2FTex2FColor4F Quad -typedef struct _ccV2F_C4F_T2F_Quad +//! 4 Vertex2FTex2FColor4F Quad +struct V2F_C4F_T2F_Quad { //! bottom left - ccV2F_C4F_T2F bl; + V2F_C4F_T2F bl; //! bottom right - ccV2F_C4F_T2F br; + V2F_C4F_T2F br; //! top left - ccV2F_C4F_T2F tl; + V2F_C4F_T2F tl; //! top right - ccV2F_C4F_T2F tr; -} ccV2F_C4F_T2F_Quad; + V2F_C4F_T2F tr; +}; //! Blend Function used for textures -typedef struct _ccBlendFunc +struct BlendFunc { //! source blend function GLenum src; //! destination blend function GLenum dst; -} ccBlendFunc; - -static const ccBlendFunc kBlendFuncDisable = {GL_ONE, GL_ZERO}; + + const static BlendFunc blendFuncDisable; +}; // XXX: If any of these enums are edited and/or reordered, update Texture2D.m //! Vertical text alignment type @@ -340,25 +325,25 @@ typedef enum // types for animation in particle systems // texture coordinates for a quad -typedef struct _ccT2F_Quad +struct T2F_Quad { //! bottom left - ccTex2F bl; + Tex2F bl; //! bottom right - ccTex2F br; + Tex2F br; //! top left - ccTex2F tl; + Tex2F tl; //! top right - ccTex2F tr; -} ccT2F_Quad; + Tex2F tr; +}; // struct that holds the size in pixels, texture coordinates and delays for animated ParticleSystemQuad -typedef struct +struct AnimationFrameData { - ccT2F_Quad texCoords; + T2F_Quad texCoords; float delay; Size size; -} ccAnimationFrameData; +}; @@ -367,55 +352,54 @@ typedef struct */ // shadow attributes -typedef struct _ccFontShadow +struct FontShadow { public: // shadow is not enabled by default - _ccFontShadow(): _shadowEnabled(false) {} + FontShadow(): _shadowEnabled(false) {} // true if shadow enabled bool _shadowEnabled; // shadow x and y offset - Size _shadowOffset; + Size _shadowOffset; // shadow blurrines float _shadowBlur; // shadow opacity float _shadowOpacity; - -} ccFontShadow; +}; // stroke attributes -typedef struct _ccFontStroke +struct FontStroke { public: // stroke is disabled by default - _ccFontStroke(): _strokeEnabled(false) {} + FontStroke(): _strokeEnabled(false) {} // true if stroke enabled - bool _strokeEnabled; + bool _strokeEnabled; // stroke color - ccColor3B _strokeColor; + Color3B _strokeColor; // stroke size - float _strokeSize; + float _strokeSize; -} ccFontStroke; +}; // font attributes -typedef struct _ccFontDefinition +struct FontDefinition { public: - _ccFontDefinition(): _alignment(kTextAlignmentCenter), + FontDefinition(): _alignment(kTextAlignmentCenter), _vertAlignment(kVerticalTextAlignmentTop), - _fontFillColor(ccWHITE) + _fontFillColor(Color3B::white) { _dimensions = CCSizeMake(0,0); } // font name - std::string _fontName; + std::string _fontName; // font size - int _fontSize; + int _fontSize; // horizontal alignment TextAlignment _alignment; // vertical alignment @@ -423,13 +407,13 @@ public: // renering box Size _dimensions; // font color - ccColor3B _fontFillColor; + Color3B _fontFillColor; // font shadow - ccFontShadow _shadow; + FontShadow _shadow; // font stroke - ccFontStroke _stroke; + FontStroke _stroke; -} ccFontDefinition; +}; NS_CC_END diff --git a/cocos2dx/label_nodes/CCLabelAtlas.cpp b/cocos2dx/label_nodes/CCLabelAtlas.cpp index 7b29d098c7..42e0fadcae 100644 --- a/cocos2dx/label_nodes/CCLabelAtlas.cpp +++ b/cocos2dx/label_nodes/CCLabelAtlas.cpp @@ -130,7 +130,7 @@ void LabelAtlas::updateAtlasValues() } CCAssert( n <= _textureAtlas->getCapacity(), "updateAtlasValues: Invalid String length"); - ccV3F_C4B_T2F_Quad* quads = _textureAtlas->getQuads(); + V3F_C4B_T2F_Quad* quads = _textureAtlas->getQuads(); for(unsigned int i = 0; i < n; i++) { unsigned char a = s[i] - _mapStartChar; @@ -171,7 +171,7 @@ void LabelAtlas::updateAtlasValues() quads[i].tr.vertices.x = (float)(i * _itemWidth + _itemWidth); quads[i].tr.vertices.y = (float)(_itemHeight); quads[i].tr.vertices.z = 0.0f; - ccColor4B c = { _displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity }; + Color4B c = { _displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity }; quads[i].tl.colors = c; quads[i].tr.colors = c; quads[i].bl.colors = c; diff --git a/cocos2dx/label_nodes/CCLabelBMFont.cpp b/cocos2dx/label_nodes/CCLabelBMFont.cpp index 593497320e..5b873009e8 100644 --- a/cocos2dx/label_nodes/CCLabelBMFont.cpp +++ b/cocos2dx/label_nodes/CCLabelBMFont.cpp @@ -507,7 +507,7 @@ bool LabelBMFont::initWithString(const char *theString, const char *fntFile, flo _alignment = alignment; _displayedOpacity = _realOpacity = 255; - _displayedColor = _realColor = ccWHITE; + _displayedColor = _realColor = Color3B::white; _cascadeOpacityEnabled = true; _cascadeColorEnabled = true; @@ -540,8 +540,8 @@ LabelBMFont::LabelBMFont() , _reusedChar(NULL) , _displayedOpacity(255) , _realOpacity(255) -, _displayedColor(ccWHITE) -, _realColor(ccWHITE) +, _displayedColor(Color3B::white) +, _realColor(Color3B::white) , _cascadeColorEnabled(true) , _cascadeOpacityEnabled(true) , _isOpacityModifyRGB(false) @@ -788,22 +788,22 @@ void LabelBMFont::setCString(const char *label) } //LabelBMFont - RGBAProtocol protocol -const ccColor3B& LabelBMFont::getColor() const +const Color3B& LabelBMFont::getColor() const { return _realColor; } -const ccColor3B& LabelBMFont::getDisplayedColor() const +const Color3B& LabelBMFont::getDisplayedColor() const { return _displayedColor; } -void LabelBMFont::setColor(const ccColor3B& color) +void LabelBMFont::setColor(const Color3B& color) { _displayedColor = _realColor = color; if( _cascadeColorEnabled ) { - ccColor3B parentColor = ccWHITE; + Color3B parentColor = Color3B::white; RGBAProtocol* pParent = dynamic_cast(_parent); if (pParent && pParent->isCascadeColorEnabled()) { @@ -876,7 +876,7 @@ void LabelBMFont::updateDisplayedOpacity(GLubyte parentOpacity) } } -void LabelBMFont::updateDisplayedColor(const ccColor3B& parentColor) +void LabelBMFont::updateDisplayedColor(const Color3B& parentColor) { _displayedColor.r = _realColor.r * parentColor.r/255.0; _displayedColor.g = _realColor.g * parentColor.g/255.0; diff --git a/cocos2dx/label_nodes/CCLabelBMFont.h b/cocos2dx/label_nodes/CCLabelBMFont.h index 3dec945f56..b7f65b915b 100644 --- a/cocos2dx/label_nodes/CCLabelBMFont.h +++ b/cocos2dx/label_nodes/CCLabelBMFont.h @@ -234,10 +234,10 @@ public: virtual void updateDisplayedOpacity(GLubyte parentOpacity); virtual bool isCascadeOpacityEnabled() const; virtual void setCascadeOpacityEnabled(bool cascadeOpacityEnabled); - virtual const ccColor3B& getColor(void) const; - virtual const ccColor3B& getDisplayedColor() const; - virtual void setColor(const ccColor3B& color); - virtual void updateDisplayedColor(const ccColor3B& parentColor); + virtual const Color3B& getColor(void) const; + virtual const Color3B& getDisplayedColor() const; + virtual void setColor(const Color3B& color); + virtual void updateDisplayedColor(const Color3B& parentColor); virtual bool isCascadeColorEnabled() const; virtual void setCascadeColorEnabled(bool cascadeColorEnabled); @@ -281,8 +281,8 @@ protected: // texture RGBA GLubyte _displayedOpacity; GLubyte _realOpacity; - ccColor3B _displayedColor; - ccColor3B _realColor; + Color3B _displayedColor; + Color3B _realColor; bool _cascadeColorEnabled; bool _cascadeOpacityEnabled; /** conforms to RGBAProtocol protocol */ diff --git a/cocos2dx/label_nodes/CCLabelTTF.cpp b/cocos2dx/label_nodes/CCLabelTTF.cpp index 25746cb793..5302596f06 100644 --- a/cocos2dx/label_nodes/CCLabelTTF.cpp +++ b/cocos2dx/label_nodes/CCLabelTTF.cpp @@ -47,7 +47,7 @@ LabelTTF::LabelTTF() , _string("") , _shadowEnabled(false) , _strokeEnabled(false) -, _textFillColor(ccWHITE) +, _textFillColor(Color3B::white) { } @@ -96,7 +96,7 @@ LabelTTF* LabelTTF::create(const char *string, const char *fontName, float fontS return NULL; } -LabelTTF * LabelTTF::createWithFontDefinition(const char *string, ccFontDefinition &textDefinition) +LabelTTF * LabelTTF::createWithFontDefinition(const char *string, FontDefinition &textDefinition) { LabelTTF *pRet = new LabelTTF(); if(pRet && pRet->initWithStringAndTextDefinition(string, textDefinition)) @@ -148,7 +148,7 @@ bool LabelTTF::initWithString(const char *string, const char *fontName, float fo return false; } -bool LabelTTF::initWithStringAndTextDefinition(const char *string, ccFontDefinition &textDefinition) +bool LabelTTF::initWithStringAndTextDefinition(const char *string, FontDefinition &textDefinition) { if (Sprite::init()) { @@ -300,7 +300,7 @@ bool LabelTTF::updateTexture() #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - ccFontDefinition texDef = _prepareTextDefinition(true); + FontDefinition texDef = _prepareTextDefinition(true); tex->initWithString( _string.c_str(), &texDef ); #else @@ -390,7 +390,7 @@ void LabelTTF::disableShadow(bool updateTexture) #endif } -void LabelTTF::enableStroke(const ccColor3B &strokeColor, float strokeSize, bool updateTexture) +void LabelTTF::enableStroke(const Color3B &strokeColor, float strokeSize, bool updateTexture) { #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) @@ -443,7 +443,7 @@ void LabelTTF::disableStroke(bool updateTexture) } -void LabelTTF::setFontFillColor(const ccColor3B &tintColor, bool updateTexture) +void LabelTTF::setFontFillColor(const Color3B &tintColor, bool updateTexture) { #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) if (_textFillColor.r != tintColor.r || _textFillColor.g != tintColor.g || _textFillColor.b != tintColor.b) @@ -458,7 +458,7 @@ void LabelTTF::setFontFillColor(const ccColor3B &tintColor, bool updateTexture) #endif } -void LabelTTF::setTextDefinition(ccFontDefinition *theDefinition) +void LabelTTF::setTextDefinition(FontDefinition *theDefinition) { if (theDefinition) { @@ -466,14 +466,14 @@ void LabelTTF::setTextDefinition(ccFontDefinition *theDefinition) } } -ccFontDefinition *LabelTTF::getTextDefinition() +FontDefinition *LabelTTF::getTextDefinition() { - ccFontDefinition *tempDefinition = new ccFontDefinition; + FontDefinition *tempDefinition = new FontDefinition; *tempDefinition = _prepareTextDefinition(false); return tempDefinition; } -void LabelTTF::_updateWithTextDefinition(ccFontDefinition & textDefinition, bool mustUpdateTexture) +void LabelTTF::_updateWithTextDefinition(FontDefinition & textDefinition, bool mustUpdateTexture) { _dimensions = CCSizeMake(textDefinition._dimensions.width, textDefinition._dimensions.height); _alignment = textDefinition._alignment; @@ -502,9 +502,9 @@ void LabelTTF::_updateWithTextDefinition(ccFontDefinition & textDefinition, bool updateTexture(); } -ccFontDefinition LabelTTF::_prepareTextDefinition(bool adjustForResolution) +FontDefinition LabelTTF::_prepareTextDefinition(bool adjustForResolution) { - ccFontDefinition texDef; + FontDefinition texDef; if (adjustForResolution) texDef._fontSize = _fontSize * CC_CONTENT_SCALE_FACTOR(); diff --git a/cocos2dx/label_nodes/CCLabelTTF.h b/cocos2dx/label_nodes/CCLabelTTF.h index d28ec826bf..07cf3643d8 100644 --- a/cocos2dx/label_nodes/CCLabelTTF.h +++ b/cocos2dx/label_nodes/CCLabelTTF.h @@ -81,7 +81,7 @@ public: /** Create a lable with string and a font definition*/ - static LabelTTF * createWithFontDefinition(const char *string, ccFontDefinition &textDefinition); + static LabelTTF * createWithFontDefinition(const char *string, FontDefinition &textDefinition); /** initializes the LabelTTF with a font name and font size */ bool initWithString(const char *string, const char *fontName, float fontSize); @@ -96,13 +96,13 @@ public: VerticalTextAlignment vAlignment); /** initializes the LabelTTF with a font name, alignment, dimension and font size */ - bool initWithStringAndTextDefinition(const char *string, ccFontDefinition &textDefinition); + bool initWithStringAndTextDefinition(const char *string, FontDefinition &textDefinition); /** set the text definition used by this label */ - void setTextDefinition(ccFontDefinition *theDefinition); + void setTextDefinition(FontDefinition *theDefinition); /** get the text definition used by this label */ - ccFontDefinition * getTextDefinition(); + FontDefinition * getTextDefinition(); @@ -113,13 +113,13 @@ public: void disableShadow(bool mustUpdateTexture = true); /** enable or disable stroke */ - void enableStroke(const ccColor3B &strokeColor, float strokeSize, bool mustUpdateTexture = true); + void enableStroke(const Color3B &strokeColor, float strokeSize, bool mustUpdateTexture = true); /** disable stroke */ void disableStroke(bool mustUpdateTexture = true); /** set text tinting */ - void setFontFillColor(const ccColor3B &tintColor, bool mustUpdateTexture = true); + void setFontFillColor(const Color3B &tintColor, bool mustUpdateTexture = true); @@ -156,8 +156,8 @@ private: protected: /** set the text definition for this label */ - void _updateWithTextDefinition(ccFontDefinition & textDefinition, bool mustUpdateTexture = true); - ccFontDefinition _prepareTextDefinition(bool adjustForResolution = false); + void _updateWithTextDefinition(FontDefinition & textDefinition, bool mustUpdateTexture = true); + FontDefinition _prepareTextDefinition(bool adjustForResolution = false); /** Dimensions of the label in Points */ Size _dimensions; @@ -174,18 +174,18 @@ protected: /** font shadow */ bool _shadowEnabled; - Size _shadowOffset; + Size _shadowOffset; float _shadowOpacity; float _shadowBlur; /** font stroke */ bool _strokeEnabled; - ccColor3B _strokeColor; + Color3B _strokeColor; float _strokeSize; /** font tint */ - ccColor3B _textFillColor; + Color3B _textFillColor; }; diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp index f45272dba1..f1fd6ac89b 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp @@ -557,8 +557,8 @@ void Layer::ccTouchesCancelled(Set *pTouches, Event *pEvent) LayerRGBA::LayerRGBA() : _displayedOpacity(255) , _realOpacity (255) -, _displayedColor(ccWHITE) -, _realColor(ccWHITE) +, _displayedColor(Color3B::white) +, _realColor(Color3B::white) , _cascadeOpacityEnabled(false) , _cascadeColorEnabled(false) {} @@ -570,7 +570,7 @@ bool LayerRGBA::init() if (Layer::init()) { _displayedOpacity = _realOpacity = 255; - _displayedColor = _realColor = ccWHITE; + _displayedColor = _realColor = Color3B::white; setCascadeOpacityEnabled(false); setCascadeColorEnabled(false); @@ -609,23 +609,23 @@ void LayerRGBA::setOpacity(GLubyte opacity) } } -const ccColor3B& LayerRGBA::getColor() const +const Color3B& LayerRGBA::getColor() const { return _realColor; } -const ccColor3B& LayerRGBA::getDisplayedColor() const +const Color3B& LayerRGBA::getDisplayedColor() const { return _displayedColor; } -void LayerRGBA::setColor(const ccColor3B& color) +void LayerRGBA::setColor(const Color3B& color) { _displayedColor = _realColor = color; if (_cascadeColorEnabled) { - ccColor3B parentColor = ccWHITE; + Color3B parentColor = Color3B::white; RGBAProtocol* parent = dynamic_cast(_parent); if (parent && parent->isCascadeColorEnabled()) { @@ -654,7 +654,7 @@ void LayerRGBA::updateDisplayedOpacity(GLubyte parentOpacity) } } -void LayerRGBA::updateDisplayedColor(const ccColor3B& parentColor) +void LayerRGBA::updateDisplayedColor(const Color3B& parentColor) { _displayedColor.r = _realColor.r * parentColor.r/255.0; _displayedColor.g = _realColor.g * parentColor.g/255.0; @@ -708,12 +708,12 @@ LayerColor::~LayerColor() } /// blendFunc getter -const ccBlendFunc &LayerColor::getBlendFunc() const +const BlendFunc &LayerColor::getBlendFunc() const { return _blendFunc; } /// blendFunc setter -void LayerColor::setBlendFunc(const ccBlendFunc &var) +void LayerColor::setBlendFunc(const BlendFunc &var) { _blendFunc = var; } @@ -732,7 +732,7 @@ LayerColor* LayerColor::create() return pRet; } -LayerColor * LayerColor::create(const ccColor4B& color, GLfloat width, GLfloat height) +LayerColor * LayerColor::create(const Color4B& color, GLfloat width, GLfloat height) { LayerColor * pLayer = new LayerColor(); if( pLayer && pLayer->initWithColor(color,width,height)) @@ -744,7 +744,7 @@ LayerColor * LayerColor::create(const ccColor4B& color, GLfloat width, GLfloat h return NULL; } -LayerColor * LayerColor::create(const ccColor4B& color) +LayerColor * LayerColor::create(const Color4B& color) { LayerColor * pLayer = new LayerColor(); if(pLayer && pLayer->initWithColor(color)) @@ -759,10 +759,10 @@ LayerColor * LayerColor::create(const ccColor4B& color) bool LayerColor::init() { Size s = Director::sharedDirector()->getWinSize(); - return initWithColor(ccc4(0,0,0,0), s.width, s.height); + return initWithColor(Color4B(0,0,0,0), s.width, s.height); } -bool LayerColor::initWithColor(const ccColor4B& color, GLfloat w, GLfloat h) +bool LayerColor::initWithColor(const Color4B& color, GLfloat w, GLfloat h) { if (Layer::init()) { @@ -791,7 +791,7 @@ bool LayerColor::initWithColor(const ccColor4B& color, GLfloat w, GLfloat h) return false; } -bool LayerColor::initWithColor(const ccColor4B& color) +bool LayerColor::initWithColor(const Color4B& color) { Size s = Director::sharedDirector()->getWinSize(); this->initWithColor(color, s.width, s.height); @@ -845,10 +845,10 @@ void LayerColor::draw() // Attributes // #ifdef EMSCRIPTEN - setGLBufferData(_squareVertices, 4 * sizeof(ccVertex2F), 0); + setGLBufferData(_squareVertices, 4 * sizeof(Vertex2F), 0); glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0); - setGLBufferData(_squareColors, 4 * sizeof(ccColor4F), 1); + setGLBufferData(_squareColors, 4 * sizeof(Color4F), 1); glVertexAttribPointer(kVertexAttrib_Color, 4, GL_FLOAT, GL_FALSE, 0, 0); #else glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, _squareVertices); @@ -862,7 +862,7 @@ void LayerColor::draw() CC_INCREMENT_GL_DRAWS(1); } -void LayerColor::setColor(const ccColor3B &color) +void LayerColor::setColor(const Color3B &color) { LayerRGBA::setColor(color); updateColor(); @@ -877,7 +877,7 @@ void LayerColor::setOpacity(GLubyte opacity) // // LayerGradient // -LayerGradient* LayerGradient::create(const ccColor4B& start, const ccColor4B& end) +LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end) { LayerGradient * pLayer = new LayerGradient(); if( pLayer && pLayer->initWithColor(start, end)) @@ -889,7 +889,7 @@ LayerGradient* LayerGradient::create(const ccColor4B& start, const ccColor4B& en return NULL; } -LayerGradient* LayerGradient::create(const ccColor4B& start, const ccColor4B& end, const Point& v) +LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end, const Point& v) { LayerGradient * pLayer = new LayerGradient(); if( pLayer && pLayer->initWithColor(start, end, v)) @@ -917,15 +917,15 @@ LayerGradient* LayerGradient::create() bool LayerGradient::init() { - return initWithColor(ccc4(0, 0, 0, 255), ccc4(0, 0, 0, 255)); + return initWithColor(Color4B(0, 0, 0, 255), Color4B(0, 0, 0, 255)); } -bool LayerGradient::initWithColor(const ccColor4B& start, const ccColor4B& end) +bool LayerGradient::initWithColor(const Color4B& start, const Color4B& end) { return initWithColor(start, end, ccp(0, -1)); } -bool LayerGradient::initWithColor(const ccColor4B& start, const ccColor4B& end, const Point& v) +bool LayerGradient::initWithColor(const Color4B& start, const Color4B& end, const Point& v) { _endColor.r = end.r; _endColor.g = end.g; @@ -937,7 +937,7 @@ bool LayerGradient::initWithColor(const ccColor4B& start, const ccColor4B& end, _compressedInterpolation = true; - return LayerColor::initWithColor(ccc4(start.r, start.g, start.b, 255)); + return LayerColor::initWithColor(Color4B(start.r, start.g, start.b, 255)); } void LayerGradient::updateColor() @@ -960,14 +960,14 @@ void LayerGradient::updateColor() float opacityf = (float)_displayedOpacity / 255.0f; - ccColor4F S = { + Color4F S = { _displayedColor.r / 255.0f, _displayedColor.g / 255.0f, _displayedColor.b / 255.0f, _startOpacity * opacityf / 255.0f }; - ccColor4F E = { + Color4F E = { _endColor.r / 255.0f, _endColor.g / 255.0f, _endColor.b / 255.0f, @@ -996,23 +996,23 @@ void LayerGradient::updateColor() _squareColors[3].a = E.a + (S.a - E.a) * ((c - u.x - u.y) / (2.0f * c)); } -const ccColor3B& LayerGradient::getStartColor() const +const Color3B& LayerGradient::getStartColor() const { return _realColor; } -void LayerGradient::setStartColor(const ccColor3B& color) +void LayerGradient::setStartColor(const Color3B& color) { setColor(color); } -void LayerGradient::setEndColor(const ccColor3B& color) +void LayerGradient::setEndColor(const Color3B& color) { _endColor = color; updateColor(); } -const ccColor3B& LayerGradient::getEndColor() const +const Color3B& LayerGradient::getEndColor() const { return _endColor; } diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h index 15381a6a83..784bd66742 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h @@ -202,10 +202,10 @@ public: virtual bool isCascadeOpacityEnabled() const; virtual void setCascadeOpacityEnabled(bool cascadeOpacityEnabled); - virtual const ccColor3B& getColor() const; - virtual const ccColor3B& getDisplayedColor() const; - virtual void setColor(const ccColor3B& color); - virtual void updateDisplayedColor(const ccColor3B& parentColor); + virtual const Color3B& getColor() const; + virtual const Color3B& getDisplayedColor() const; + virtual void setColor(const Color3B& color); + virtual void updateDisplayedColor(const Color3B& parentColor); virtual bool isCascadeColorEnabled() const; virtual void setCascadeColorEnabled(bool cascadeColorEnabled); @@ -213,7 +213,7 @@ public: virtual bool isOpacityModifyRGB() const { return false; } protected: GLubyte _displayedOpacity, _realOpacity; - ccColor3B _displayedColor, _realColor; + Color3B _displayedColor, _realColor; bool _cascadeOpacityEnabled, _cascadeColorEnabled; }; @@ -232,8 +232,8 @@ class CC_DLL LayerColor : public LayerRGBA, public BlendProtocol #endif // EMSCRIPTEN { protected: - ccVertex2F _squareVertices[4]; - ccColor4F _squareColors[4]; + Vertex2F _squareVertices[4]; + Color4F _squareColors[4]; public: LayerColor(); @@ -246,15 +246,15 @@ public: static LayerColor* create(); /** creates a Layer with color, width and height in Points */ - static LayerColor * create(const ccColor4B& color, GLfloat width, GLfloat height); + static LayerColor * create(const Color4B& color, GLfloat width, GLfloat height); /** creates a Layer with color. Width and height are the window size. */ - static LayerColor * create(const ccColor4B& color); + static LayerColor * create(const Color4B& color); virtual bool init(); /** initializes a Layer with color, width and height in Points */ - virtual bool initWithColor(const ccColor4B& color, GLfloat width, GLfloat height); + virtual bool initWithColor(const Color4B& color, GLfloat width, GLfloat height); /** initializes a Layer with color. Width and height are the window size. */ - virtual bool initWithColor(const ccColor4B& color); + virtual bool initWithColor(const Color4B& color); /** change width in Points*/ void changeWidth(GLfloat w); @@ -266,11 +266,11 @@ public: void changeWidthAndHeight(GLfloat w ,GLfloat h); /** BlendFunction. Conforms to BlendProtocol protocol */ - CC_PROPERTY_PASS_BY_REF(ccBlendFunc, _blendFunc, BlendFunc) + CC_PROPERTY_PASS_BY_REF(BlendFunc, _blendFunc, BlendFunc) virtual void setOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);} virtual bool isOpacityModifyRGB(void) const { return false;} - virtual void setColor(const ccColor3B &color); + virtual void setColor(const Color3B &color); virtual void setOpacity(GLubyte opacity); protected: @@ -307,17 +307,17 @@ public: static LayerGradient* create(); /** Creates a full-screen Layer with a gradient between start and end. */ - static LayerGradient* create(const ccColor4B& start, const ccColor4B& end); + static LayerGradient* create(const Color4B& start, const Color4B& end); /** Creates a full-screen Layer with a gradient between start and end in the direction of v. */ - static LayerGradient* create(const ccColor4B& start, const ccColor4B& end, const Point& v); + static LayerGradient* create(const Color4B& start, const Color4B& end, const Point& v); virtual bool init(); /** Initializes the Layer with a gradient between start and end. */ - virtual bool initWithColor(const ccColor4B& start, const ccColor4B& end); + virtual bool initWithColor(const Color4B& start, const Color4B& end); /** Initializes the Layer with a gradient between start and end in the direction of v. */ - virtual bool initWithColor(const ccColor4B& start, const ccColor4B& end, const Point& v); + virtual bool initWithColor(const Color4B& start, const Color4B& end, const Point& v); /** Whether or not the interpolation will be compressed in order to display all the colors of the gradient both in canonical and non canonical vectors Default: YES @@ -325,8 +325,8 @@ public: virtual void setCompressedInterpolation(bool bCompressedInterpolation); virtual bool isCompressedInterpolation() const; - CC_PROPERTY_PASS_BY_REF(ccColor3B, _startColor, StartColor) - CC_PROPERTY_PASS_BY_REF(ccColor3B, _endColor, EndColor) + CC_PROPERTY_PASS_BY_REF(Color3B, _startColor, StartColor) + CC_PROPERTY_PASS_BY_REF(Color3B, _endColor, EndColor) CC_PROPERTY(GLubyte, _startOpacity, StartOpacity) CC_PROPERTY(GLubyte, _endOpacity, EndOpacity) CC_PROPERTY_PASS_BY_REF(Point, _alongVector, Vector) diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCTransition.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCTransition.cpp index cb96550908..81f3c8c247 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCTransition.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCTransition.cpp @@ -1179,7 +1179,7 @@ TransitionFade::~TransitionFade() { } -TransitionFade * TransitionFade::create(float duration, Scene *scene, const ccColor3B& color) +TransitionFade * TransitionFade::create(float duration, Scene *scene, const Color3B& color) { TransitionFade * pTransition = new TransitionFade(); pTransition->initWithDuration(duration, scene, color); @@ -1189,10 +1189,10 @@ TransitionFade * TransitionFade::create(float duration, Scene *scene, const ccCo TransitionFade* TransitionFade::create(float duration,Scene* scene) { - return TransitionFade::create(duration, scene, ccBLACK); + return TransitionFade::create(duration, scene, Color3B::black); } -bool TransitionFade::initWithDuration(float duration, Scene *scene, const ccColor3B& color) +bool TransitionFade::initWithDuration(float duration, Scene *scene, const Color3B& color) { if (TransitionScene::initWithDuration(duration, scene)) { @@ -1206,7 +1206,7 @@ bool TransitionFade::initWithDuration(float duration, Scene *scene, const ccColo bool TransitionFade::initWithDuration(float t, Scene *scene) { - this->initWithDuration(t, scene, ccBLACK); + this->initWithDuration(t, scene, Color3B::black); return true; } @@ -1270,7 +1270,7 @@ void TransitionCrossFade::onEnter() // create a transparent color layer // in which we are going to add our rendertextures - ccColor4B color = {0,0,0,0}; + Color4B color = {0,0,0,0}; Size size = Director::sharedDirector()->getWinSize(); LayerColor* layer = LayerColor::create(color); @@ -1304,8 +1304,8 @@ void TransitionCrossFade::onEnter() // create blend functions - ccBlendFunc blend1 = {GL_ONE, GL_ONE}; // inScene will lay on background and will not be used with alpha - ccBlendFunc blend2 = {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}; // we are going to blend outScene via alpha + BlendFunc blend1 = {GL_ONE, GL_ONE}; // inScene will lay on background and will not be used with alpha + BlendFunc blend2 = {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}; // we are going to blend outScene via alpha // set blendfunctions inTexture->getSprite()->setBlendFunc(blend1); diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCTransition.h b/cocos2dx/layers_scenes_transitions_nodes/CCTransition.h index 4a18679167..884ba2bab0 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCTransition.h +++ b/cocos2dx/layers_scenes_transitions_nodes/CCTransition.h @@ -416,7 +416,7 @@ Fade out the outgoing scene and then fade in the incoming scene.''' class CC_DLL TransitionFade : public TransitionScene { protected: - ccColor4B _color; + Color4B _color; public: @@ -424,13 +424,13 @@ public: virtual ~TransitionFade(); /** creates the transition with a duration and with an RGB color - * Example: FadeTransition::create(2, scene, ccc3(255,0,0); // red color + * Example: FadeTransition::create(2, scene, Color3B(255,0,0); // red color */ - static TransitionFade* create(float duration,Scene* scene, const ccColor3B& color); + static TransitionFade* create(float duration,Scene* scene, const Color3B& color); static TransitionFade* create(float duration,Scene* scene); /** initializes the transition with a duration and with an RGB color */ - virtual bool initWithDuration(float t, Scene*scene ,const ccColor3B& color); + virtual bool initWithDuration(float t, Scene*scene ,const Color3B& color); virtual bool initWithDuration(float t,Scene* scene); virtual void onEnter(); diff --git a/cocos2dx/menu_nodes/CCMenuItem.cpp b/cocos2dx/menu_nodes/CCMenuItem.cpp index 3d0a7016cc..a2cc5a627f 100644 --- a/cocos2dx/menu_nodes/CCMenuItem.cpp +++ b/cocos2dx/menu_nodes/CCMenuItem.cpp @@ -185,11 +185,11 @@ void MenuItem::setCallback(const ccMenuCallback& callback) //CCMenuItemLabel // -const ccColor3B& MenuItemLabel::getDisabledColor() const +const Color3B& MenuItemLabel::getDisabledColor() const { return _disabledColor; } -void MenuItemLabel::setDisabledColor(const ccColor3B& var) +void MenuItemLabel::setDisabledColor(const Color3B& var) { _disabledColor = var; } @@ -251,8 +251,8 @@ bool MenuItemLabel::initWithLabel(Node* label, const ccMenuCallback& callback) { MenuItem::initWithCallback(callback); _originalScale = 1.0f; - _colorBackup = ccWHITE; - setDisabledColor(ccc3(126,126,126)); + _colorBackup = Color3B::white; + setDisabledColor(Color3B(126,126,126)); this->setLabel(label); setCascadeColorEnabled(true); diff --git a/cocos2dx/menu_nodes/CCMenuItem.h b/cocos2dx/menu_nodes/CCMenuItem.h index 55efa2335c..3db0b775ff 100644 --- a/cocos2dx/menu_nodes/CCMenuItem.h +++ b/cocos2dx/menu_nodes/CCMenuItem.h @@ -125,7 +125,7 @@ protected: class CC_DLL MenuItemLabel : public MenuItem { /** the color that will be used to disable the item */ - CC_PROPERTY_PASS_BY_REF(ccColor3B, _disabledColor, DisabledColor); + CC_PROPERTY_PASS_BY_REF(Color3B, _disabledColor, DisabledColor); /** Label that is rendered. It can be any Node that implements the LabelProtocol */ CC_PROPERTY(Node*, _label, Label); public: @@ -162,8 +162,8 @@ public: virtual void setEnabled(bool enabled); protected: - ccColor3B _colorBackup; - float _originalScale; + Color3B _colorBackup; + float _originalScale; }; diff --git a/cocos2dx/misc_nodes/CCClippingNode.cpp b/cocos2dx/misc_nodes/CCClippingNode.cpp index f78c6906f8..3cad2614b6 100644 --- a/cocos2dx/misc_nodes/CCClippingNode.cpp +++ b/cocos2dx/misc_nodes/CCClippingNode.cpp @@ -255,8 +255,8 @@ void ClippingNode::visit() glStencilOp(!_inverted ? GL_ZERO : GL_REPLACE, GL_KEEP, GL_KEEP); // draw a fullscreen solid rectangle to clear the stencil buffer - //ccDrawSolidRect(PointZero, ccpFromSize([[Director sharedDirector] winSize]), ccc4f(1, 1, 1, 1)); - ccDrawSolidRect(PointZero, ccpFromSize(Director::sharedDirector()->getWinSize()), ccc4f(1, 1, 1, 1)); + //ccDrawSolidRect(PointZero, ccpFromSize([[Director sharedDirector] winSize]), Color4F(1, 1, 1, 1)); + ccDrawSolidRect(PointZero, ccpFromSize(Director::sharedDirector()->getWinSize()), Color4F(1, 1, 1, 1)); /////////////////////////////////// // DRAW CLIPPING STENCIL diff --git a/cocos2dx/misc_nodes/CCMotionStreak.cpp b/cocos2dx/misc_nodes/CCMotionStreak.cpp index 6602a2f08b..d9706abdfb 100644 --- a/cocos2dx/misc_nodes/CCMotionStreak.cpp +++ b/cocos2dx/misc_nodes/CCMotionStreak.cpp @@ -65,7 +65,7 @@ MotionStreak::~MotionStreak() CC_SAFE_FREE(_texCoords); } -MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const ccColor3B& color, const char* path) +MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const Color3B& color, const char* path) { MotionStreak *pRet = new MotionStreak(); if (pRet && pRet->initWithFade(fade, minSeg, stroke, color, path)) @@ -78,7 +78,7 @@ MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const return NULL; } -MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const ccColor3B& color, Texture2D* texture) +MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const Color3B& color, Texture2D* texture) { MotionStreak *pRet = new MotionStreak(); if (pRet && pRet->initWithFade(fade, minSeg, stroke, color, texture)) @@ -91,7 +91,7 @@ MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const return NULL; } -bool MotionStreak::initWithFade(float fade, float minSeg, float stroke, const ccColor3B& color, const char* path) +bool MotionStreak::initWithFade(float fade, float minSeg, float stroke, const Color3B& color, const char* path) { CCAssert(path != NULL, "Invalid filename"); @@ -99,7 +99,7 @@ bool MotionStreak::initWithFade(float fade, float minSeg, float stroke, const cc return initWithFade(fade, minSeg, stroke, color, texture); } -bool MotionStreak::initWithFade(float fade, float minSeg, float stroke, const ccColor3B& color, Texture2D* texture) +bool MotionStreak::initWithFade(float fade, float minSeg, float stroke, const Color3B& color, Texture2D* texture) { Node::setPosition(PointZero); setAnchorPoint(PointZero); @@ -119,8 +119,8 @@ bool MotionStreak::initWithFade(float fade, float minSeg, float stroke, const cc _pointState = (float *)malloc(sizeof(float) * _maxPoints); _pointVertexes = (Point*)malloc(sizeof(Point) * _maxPoints); - _vertices = (ccVertex2F*)malloc(sizeof(ccVertex2F) * _maxPoints * 2); - _texCoords = (ccTex2F*)malloc(sizeof(ccTex2F) * _maxPoints * 2); + _vertices = (Vertex2F*)malloc(sizeof(Vertex2F) * _maxPoints * 2); + _texCoords = (Tex2F*)malloc(sizeof(Tex2F) * _maxPoints * 2); _colorPointer = (GLubyte*)malloc(sizeof(GLubyte) * _maxPoints * 2 * 4); // Set blend mode @@ -143,14 +143,14 @@ void MotionStreak::setPosition(const Point& position) _positionR = position; } -void MotionStreak::tintWithColor(const ccColor3B& colors) +void MotionStreak::tintWithColor(const Color3B& colors) { setColor(colors); // Fast assignation for(unsigned int i = 0; i<_nuPoints*2; i++) { - *((ccColor3B*) (_colorPointer+i*4)) = colors; + *((Color3B*) (_colorPointer+i*4)) = colors; } } @@ -169,12 +169,12 @@ void MotionStreak::setTexture(Texture2D *texture) } } -void MotionStreak::setBlendFunc(const ccBlendFunc &blendFunc) +void MotionStreak::setBlendFunc(const BlendFunc &blendFunc) { _blendFunc = blendFunc; } -const ccBlendFunc& MotionStreak::getBlendFunc(void) const +const BlendFunc& MotionStreak::getBlendFunc(void) const { return _blendFunc; } @@ -280,8 +280,8 @@ void MotionStreak::update(float delta) // Color assignment const unsigned int offset = _nuPoints*8; - *((ccColor3B*)(_colorPointer + offset)) = _displayedColor; - *((ccColor3B*)(_colorPointer + offset+4)) = _displayedColor; + *((Color3B*)(_colorPointer + offset)) = _displayedColor; + *((Color3B*)(_colorPointer + offset+4)) = _displayedColor; // Opacity _colorPointer[offset+3] = 255; @@ -312,8 +312,8 @@ void MotionStreak::update(float delta) if( _nuPoints && _previousNuPoints != _nuPoints ) { float texDelta = 1.0f / _nuPoints; for( i=0; i < _nuPoints; i++ ) { - _texCoords[i*2] = tex2(0, texDelta*i); - _texCoords[i*2+1] = tex2(1, texDelta*i); + _texCoords[i*2] = Tex2F(0, texDelta*i); + _texCoords[i*2+1] = Tex2F(1, texDelta*i); } _previousNuPoints = _nuPoints; @@ -339,10 +339,10 @@ void MotionStreak::draw() #ifdef EMSCRIPTEN // Size calculations from ::initWithFade - setGLBufferData(_vertices, (sizeof(ccVertex2F) * _maxPoints * 2), 0); + setGLBufferData(_vertices, (sizeof(Vertex2F) * _maxPoints * 2), 0); glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0); - setGLBufferData(_texCoords, (sizeof(ccTex2F) * _maxPoints * 2), 1); + setGLBufferData(_texCoords, (sizeof(Tex2F) * _maxPoints * 2), 1); glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, 0); setGLBufferData(_colorPointer, (sizeof(GLubyte) * _maxPoints * 2 * 4), 2); diff --git a/cocos2dx/misc_nodes/CCMotionStreak.h b/cocos2dx/misc_nodes/CCMotionStreak.h index f398532dbc..ab4d68f2a4 100644 --- a/cocos2dx/misc_nodes/CCMotionStreak.h +++ b/cocos2dx/misc_nodes/CCMotionStreak.h @@ -53,17 +53,17 @@ public: virtual ~MotionStreak(); /** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture filename */ - static MotionStreak* create(float fade, float minSeg, float stroke, const ccColor3B& color, const char* path); + static MotionStreak* create(float fade, float minSeg, float stroke, const Color3B& color, const char* path); /** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture */ - static MotionStreak* create(float fade, float minSeg, float stroke, const ccColor3B& color, Texture2D* texture); + static MotionStreak* create(float fade, float minSeg, float stroke, const Color3B& color, Texture2D* texture); /** initializes a motion streak with fade in seconds, minimum segments, stroke's width, color and texture filename */ - bool initWithFade(float fade, float minSeg, float stroke, const ccColor3B& color, const char* path); + bool initWithFade(float fade, float minSeg, float stroke, const Color3B& color, const char* path); /** initializes a motion streak with fade in seconds, minimum segments, stroke's width, color and texture */ - bool initWithFade(float fade, float minSeg, float stroke, const ccColor3B& color, Texture2D* texture); + bool initWithFade(float fade, float minSeg, float stroke, const Color3B& color, Texture2D* texture); /** color used for the tint */ - void tintWithColor(const ccColor3B& colors); + void tintWithColor(const Color3B& colors); /** Remove all living segments of the ribbon */ void reset(); @@ -76,8 +76,8 @@ public: /* Implement interfaces */ virtual Texture2D* getTexture(void); virtual void setTexture(Texture2D *texture); - virtual void setBlendFunc(const ccBlendFunc &blendFunc); - virtual const ccBlendFunc& getBlendFunc(void) const; + virtual void setBlendFunc(const BlendFunc &blendFunc); + virtual const BlendFunc& getBlendFunc(void) const; virtual GLubyte getOpacity(void) const; virtual void setOpacity(GLubyte opacity); virtual void setOpacityModifyRGB(bool bValue); @@ -98,7 +98,7 @@ protected: private: /** texture used for the motion streak */ Texture2D* _texture; - ccBlendFunc _blendFunc; + BlendFunc _blendFunc; Point _positionR; float _stroke; @@ -114,9 +114,9 @@ private: float* _pointState; // Opengl - ccVertex2F* _vertices; + Vertex2F* _vertices; GLubyte* _colorPointer; - ccTex2F* _texCoords; + Tex2F* _texCoords; }; // end of misc_nodes group diff --git a/cocos2dx/misc_nodes/CCProgressTimer.cpp b/cocos2dx/misc_nodes/CCProgressTimer.cpp index 60f9339e0a..6a2b6e9eb3 100644 --- a/cocos2dx/misc_nodes/CCProgressTimer.cpp +++ b/cocos2dx/misc_nodes/CCProgressTimer.cpp @@ -164,29 +164,29 @@ bool ProgressTimer::isOpacityModifyRGB(void) /// // @returns the vertex position from the texture coordinate /// -ccTex2F ProgressTimer::textureCoordFromAlphaPoint(Point alpha) +Tex2F ProgressTimer::textureCoordFromAlphaPoint(Point alpha) { - ccTex2F ret = {0.0f, 0.0f}; + Tex2F ret = {0.0f, 0.0f}; if (!_sprite) { return ret; } - ccV3F_C4B_T2F_Quad quad = _sprite->getQuad(); + V3F_C4B_T2F_Quad quad = _sprite->getQuad(); Point min = ccp(quad.bl.texCoords.u,quad.bl.texCoords.v); Point max = ccp(quad.tr.texCoords.u,quad.tr.texCoords.v); // Fix bug #1303 so that progress timer handles sprite frame texture rotation if (_sprite->isTextureRectRotated()) { CC_SWAP(alpha.x, alpha.y, float); } - return tex2(min.x * (1.f - alpha.x) + max.x * alpha.x, min.y * (1.f - alpha.y) + max.y * alpha.y); + return Tex2F(min.x * (1.f - alpha.x) + max.x * alpha.x, min.y * (1.f - alpha.y) + max.y * alpha.y); } -ccVertex2F ProgressTimer::vertexFromAlphaPoint(Point alpha) +Vertex2F ProgressTimer::vertexFromAlphaPoint(Point alpha) { - ccVertex2F ret = {0.0f, 0.0f}; + Vertex2F ret = {0.0f, 0.0f}; if (!_sprite) { return ret; } - ccV3F_C4B_T2F_Quad quad = _sprite->getQuad(); + V3F_C4B_T2F_Quad quad = _sprite->getQuad(); Point min = ccp(quad.bl.vertices.x,quad.bl.vertices.y); Point max = ccp(quad.tr.vertices.x,quad.tr.vertices.y); ret.x = min.x * (1.f - alpha.x) + max.x * alpha.x; @@ -202,7 +202,7 @@ void ProgressTimer::updateColor(void) if (_vertexData) { - ccColor4B sc = _sprite->getQuad().tl.colors; + Color4B sc = _sprite->getQuad().tl.colors; for (int i = 0; i < _vertexDataCount; ++i) { _vertexData[i].colors = sc; @@ -344,7 +344,7 @@ void ProgressTimer::updateRadial(void) if(!_vertexData) { _vertexDataCount = index + 3; - _vertexData = (ccV2F_C4B_T2F*)malloc(_vertexDataCount * sizeof(ccV2F_C4B_T2F)); + _vertexData = (V2F_C4B_T2F*)malloc(_vertexDataCount * sizeof(V2F_C4B_T2F)); CCAssert( _vertexData, "CCProgressTimer. Not enough memory"); } updateColor(); @@ -415,7 +415,7 @@ void ProgressTimer::updateBar(void) if (!_reverseDirection) { if(!_vertexData) { _vertexDataCount = 4; - _vertexData = (ccV2F_C4B_T2F*)malloc(_vertexDataCount * sizeof(ccV2F_C4B_T2F)); + _vertexData = (V2F_C4B_T2F*)malloc(_vertexDataCount * sizeof(V2F_C4B_T2F)); CCAssert( _vertexData, "CCProgressTimer. Not enough memory"); } // TOPLEFT @@ -436,7 +436,7 @@ void ProgressTimer::updateBar(void) } else { if(!_vertexData) { _vertexDataCount = 8; - _vertexData = (ccV2F_C4B_T2F*)malloc(_vertexDataCount * sizeof(ccV2F_C4B_T2F)); + _vertexData = (V2F_C4B_T2F*)malloc(_vertexDataCount * sizeof(V2F_C4B_T2F)); CCAssert( _vertexData, "CCProgressTimer. Not enough memory"); // TOPLEFT 1 _vertexData[0].texCoords = textureCoordFromAlphaPoint(ccp(0,1)); @@ -500,16 +500,16 @@ void ProgressTimer::draw(void) ccGLBindTexture2D( _sprite->getTexture()->getName() ); #ifdef EMSCRIPTEN - setGLBufferData((void*) _vertexData, (_vertexDataCount * sizeof(ccV2F_C4B_T2F)), 0); + setGLBufferData((void*) _vertexData, (_vertexDataCount * sizeof(V2F_C4B_T2F)), 0); int offset = 0; - glVertexAttribPointer( kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, sizeof(ccV2F_C4B_T2F), (GLvoid*)offset); + glVertexAttribPointer( kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid*)offset); - offset += sizeof(ccVertex2F); - glVertexAttribPointer( kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(ccV2F_C4B_T2F), (GLvoid*)offset); + offset += sizeof(Vertex2F); + glVertexAttribPointer( kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V2F_C4B_T2F), (GLvoid*)offset); - offset += sizeof(ccColor4B); - glVertexAttribPointer( kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, sizeof(ccV2F_C4B_T2F), (GLvoid*)offset); + offset += sizeof(Color4B); + glVertexAttribPointer( kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid*)offset); #else glVertexAttribPointer( kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, sizeof(_vertexData[0]) , &_vertexData[0].vertices); glVertexAttribPointer( kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, sizeof(_vertexData[0]), &_vertexData[0].texCoords); diff --git a/cocos2dx/misc_nodes/CCProgressTimer.h b/cocos2dx/misc_nodes/CCProgressTimer.h index babc5a2342..2b34e9b118 100644 --- a/cocos2dx/misc_nodes/CCProgressTimer.h +++ b/cocos2dx/misc_nodes/CCProgressTimer.h @@ -92,8 +92,8 @@ public: /** Creates a progress timer with the sprite as the shape the timer goes through */ static ProgressTimer* create(Sprite* sp); protected: - ccTex2F textureCoordFromAlphaPoint(Point alpha); - ccVertex2F vertexFromAlphaPoint(Point alpha); + Tex2F textureCoordFromAlphaPoint(Point alpha); + Vertex2F vertexFromAlphaPoint(Point alpha); void updateProgress(void); void updateBar(void); void updateRadial(void); @@ -105,7 +105,7 @@ protected: float _percentage; Sprite *_sprite; int _vertexDataCount; - ccV2F_C4B_T2F *_vertexData; + V2F_C4B_T2F *_vertexData; /** * Midpoint is used to modify the progress start position. diff --git a/cocos2dx/misc_nodes/CCRenderTexture.cpp b/cocos2dx/misc_nodes/CCRenderTexture.cpp index 01a2daf0fb..eab2105f54 100644 --- a/cocos2dx/misc_nodes/CCRenderTexture.cpp +++ b/cocos2dx/misc_nodes/CCRenderTexture.cpp @@ -54,7 +54,7 @@ RenderTexture::RenderTexture() , _UITextureImage(NULL) , _pixelFormat(kTexture2DPixelFormat_RGBA8888) , _clearFlags(0) -, _clearColor(ccc4f(0,0,0,0)) +, _clearColor(Color4F(0,0,0,0)) , _clearDepth(0.0f) , _clearStencil(0) , _autoDraw(false) @@ -163,12 +163,12 @@ void RenderTexture::setClearFlags(unsigned int uClearFlags) _clearFlags = uClearFlags; } -const ccColor4F& RenderTexture::getClearColor() const +const Color4F& RenderTexture::getClearColor() const { return _clearColor; } -void RenderTexture::setClearColor(const ccColor4F &clearColor) +void RenderTexture::setClearColor(const Color4F &clearColor) { _clearColor = clearColor; } @@ -339,7 +339,7 @@ bool RenderTexture::initWithWidthAndHeight(int w, int h, Texture2DPixelFormat eF _texture->release(); _sprite->setScaleY(-1); - ccBlendFunc tBlendFunc = {GL_ONE, GL_ONE_MINUS_SRC_ALPHA }; + BlendFunc tBlendFunc = {GL_ONE, GL_ONE_MINUS_SRC_ALPHA }; _sprite->setBlendFunc(tBlendFunc); glBindRenderbuffer(GL_RENDERBUFFER, oldRBO); diff --git a/cocos2dx/misc_nodes/CCRenderTexture.h b/cocos2dx/misc_nodes/CCRenderTexture.h index 13f10b2547..81b3035f4c 100644 --- a/cocos2dx/misc_nodes/CCRenderTexture.h +++ b/cocos2dx/misc_nodes/CCRenderTexture.h @@ -56,7 +56,7 @@ class CC_DLL RenderTexture : public Node /** The Sprite being used. The sprite, by default, will use the following blending function: GL_ONE, GL_ONE_MINUS_SRC_ALPHA. The blending function can be changed in runtime by calling: - - [[renderTexture sprite] setBlendFunc:(ccBlendFunc){GL_ONE, GL_ONE_MINUS_SRC_ALPHA}]; + - [[renderTexture sprite] setBlendFunc:(BlendFunc){GL_ONE, GL_ONE_MINUS_SRC_ALPHA}]; */ CC_PROPERTY(Sprite*, _sprite, Sprite) public: @@ -140,8 +140,8 @@ public: void setClearFlags(unsigned int uClearFlags); /** Clear color value. Valid only when "autoDraw" is true. */ - const ccColor4F& getClearColor() const; - void setClearColor(const ccColor4F &clearColor); + const Color4F& getClearColor() const; + void setClearColor(const Color4F &clearColor); /** Value for clearDepth. Valid only when autoDraw is true. */ float getClearDepth() const; @@ -171,7 +171,7 @@ protected: // code for "auto" update GLbitfield _clearFlags; - ccColor4F _clearColor; + Color4F _clearColor; GLclampf _clearDepth; GLint _clearStencil; bool _autoDraw; diff --git a/cocos2dx/particle_nodes/CCParticleBatchNode.cpp b/cocos2dx/particle_nodes/CCParticleBatchNode.cpp index 3b00d43ec2..b18c97ffa1 100644 --- a/cocos2dx/particle_nodes/CCParticleBatchNode.cpp +++ b/cocos2dx/particle_nodes/CCParticleBatchNode.cpp @@ -437,7 +437,7 @@ void ParticleBatchNode::increaseAtlasCapacityTo(unsigned int quantity) //sets a 0'd quad into the quads array void ParticleBatchNode::disableParticle(unsigned int particleIndex) { - ccV3F_C4B_T2F_Quad* quad = &((_textureAtlas->getQuads())[particleIndex]); + V3F_C4B_T2F_Quad* quad = &((_textureAtlas->getQuads())[particleIndex]); quad->br.vertices.x = quad->br.vertices.y = quad->tr.vertices.x = quad->tr.vertices.y = quad->tl.vertices.x = quad->tl.vertices.y = quad->bl.vertices.x = quad->bl.vertices.y = 0.0f; } @@ -509,12 +509,12 @@ Texture2D* ParticleBatchNode::getTexture(void) return _textureAtlas->getTexture(); } -void ParticleBatchNode::setBlendFunc(const ccBlendFunc &blendFunc) +void ParticleBatchNode::setBlendFunc(const BlendFunc &blendFunc) { _blendFunc = blendFunc; } // returns the blending function used for the texture -const ccBlendFunc& ParticleBatchNode::getBlendFunc(void) const +const BlendFunc& ParticleBatchNode::getBlendFunc(void) const { return _blendFunc; } diff --git a/cocos2dx/particle_nodes/CCParticleBatchNode.h b/cocos2dx/particle_nodes/CCParticleBatchNode.h index db1f28b205..36a4bbb0e4 100644 --- a/cocos2dx/particle_nodes/CCParticleBatchNode.h +++ b/cocos2dx/particle_nodes/CCParticleBatchNode.h @@ -102,9 +102,9 @@ public: virtual Texture2D* getTexture(void); // sets a new texture. it will be retained virtual void setTexture(Texture2D *texture); - virtual void setBlendFunc(const ccBlendFunc &blendFunc); + virtual void setBlendFunc(const BlendFunc &blendFunc); // returns the blending function used for the texture - virtual const ccBlendFunc& getBlendFunc(void) const; + virtual const BlendFunc& getBlendFunc(void) const; void visit(); @@ -119,7 +119,7 @@ private: CC_SYNTHESIZE(TextureAtlas*, _textureAtlas, TextureAtlas); private: /** the blend function used for drawing the quads */ - ccBlendFunc _blendFunc; + BlendFunc _blendFunc; }; // end of particle_nodes group diff --git a/cocos2dx/particle_nodes/CCParticleSystem.cpp b/cocos2dx/particle_nodes/CCParticleSystem.cpp index bbd3071739..3e72a56fcb 100644 --- a/cocos2dx/particle_nodes/CCParticleSystem.cpp +++ b/cocos2dx/particle_nodes/CCParticleSystem.cpp @@ -479,13 +479,13 @@ void ParticleSystem::initParticle(tParticle* particle) // Color - ccColor4F start; + Color4F start; start.r = clampf(_startColor.r + _startColorVar.r * CCRANDOM_MINUS1_1(), 0, 1); start.g = clampf(_startColor.g + _startColorVar.g * CCRANDOM_MINUS1_1(), 0, 1); start.b = clampf(_startColor.b + _startColorVar.b * CCRANDOM_MINUS1_1(), 0, 1); start.a = clampf(_startColor.a + _startColorVar.a * CCRANDOM_MINUS1_1(), 0, 1); - ccColor4F end; + Color4F end; end.r = clampf(_endColor.r + _endColorVar.r * CCRANDOM_MINUS1_1(), 0, 1); end.g = clampf(_endColor.g + _endColorVar.g * CCRANDOM_MINUS1_1(), 0, 1); end.b = clampf(_endColor.b + _endColorVar.b * CCRANDOM_MINUS1_1(), 0, 1); @@ -1146,42 +1146,42 @@ void ParticleSystem::setEndSizeVar(float var) _endSizeVar = var; } -const ccColor4F& ParticleSystem::getStartColor() const +const Color4F& ParticleSystem::getStartColor() const { return _startColor; } -void ParticleSystem::setStartColor(const ccColor4F& var) +void ParticleSystem::setStartColor(const Color4F& var) { _startColor = var; } -const ccColor4F& ParticleSystem::getStartColorVar() const +const Color4F& ParticleSystem::getStartColorVar() const { return _startColorVar; } -void ParticleSystem::setStartColorVar(const ccColor4F& var) +void ParticleSystem::setStartColorVar(const Color4F& var) { _startColorVar = var; } -const ccColor4F& ParticleSystem::getEndColor() const +const Color4F& ParticleSystem::getEndColor() const { return _endColor; } -void ParticleSystem::setEndColor(const ccColor4F& var) +void ParticleSystem::setEndColor(const Color4F& var) { _endColor = var; } -const ccColor4F& ParticleSystem::getEndColorVar() const +const Color4F& ParticleSystem::getEndColorVar() const { return _endColorVar; } -void ParticleSystem::setEndColorVar(const ccColor4F& var) +void ParticleSystem::setEndColorVar(const Color4F& var) { _endColorVar = var; } @@ -1246,12 +1246,12 @@ void ParticleSystem::setTotalParticles(unsigned int var) _totalParticles = var; } -const ccBlendFunc& ParticleSystem::getBlendFunc() const +const BlendFunc& ParticleSystem::getBlendFunc() const { return _blendFunc; } -void ParticleSystem::setBlendFunc(const ccBlendFunc &blendFunc) +void ParticleSystem::setBlendFunc(const BlendFunc &blendFunc) { if( _blendFunc.src != blendFunc.src || _blendFunc.dst != blendFunc.dst ) { _blendFunc = blendFunc; diff --git a/cocos2dx/particle_nodes/CCParticleSystem.h b/cocos2dx/particle_nodes/CCParticleSystem.h index 9de5c1ccd7..e4a2f530b9 100644 --- a/cocos2dx/particle_nodes/CCParticleSystem.h +++ b/cocos2dx/particle_nodes/CCParticleSystem.h @@ -86,8 +86,8 @@ typedef struct sParticle { Point pos; Point startPos; - ccColor4F color; - ccColor4F deltaColor; + Color4F color; + Color4F deltaColor; float size; float deltaSize; @@ -305,13 +305,13 @@ public: /** end size variance in pixels of each particle */ CC_PROPERTY(float, _endSizeVar, EndSizeVar) /** start color of each particle */ - CC_PROPERTY_PASS_BY_REF(ccColor4F, _startColor, StartColor) + CC_PROPERTY_PASS_BY_REF(Color4F, _startColor, StartColor) /** start color variance of each particle */ - CC_PROPERTY_PASS_BY_REF(ccColor4F, _startColorVar, StartColorVar) + CC_PROPERTY_PASS_BY_REF(Color4F, _startColorVar, StartColorVar) /** end color and end color variation of each particle */ - CC_PROPERTY_PASS_BY_REF(ccColor4F, _endColor, EndColor) + CC_PROPERTY_PASS_BY_REF(Color4F, _endColor, EndColor) /** end color variance of each particle */ - CC_PROPERTY_PASS_BY_REF(ccColor4F, _endColorVar, EndColorVar) + CC_PROPERTY_PASS_BY_REF(Color4F, _endColorVar, EndColorVar) //* initial angle of each particle CC_PROPERTY(float, _startSpin, StartSpin) //* initial angle of each particle @@ -327,7 +327,7 @@ public: /** conforms to CocosNodeTexture protocol */ CC_PROPERTY(Texture2D*, _texture, Texture) /** conforms to CocosNodeTexture protocol */ - CC_PROPERTY_PASS_BY_REF(ccBlendFunc, _blendFunc, BlendFunc) + CC_PROPERTY_PASS_BY_REF(BlendFunc, _blendFunc, BlendFunc) /** does the alpha value modify color */ CC_PROPERTY(bool, _opacityModifyRGB, OpacityModifyRGB) diff --git a/cocos2dx/particle_nodes/CCParticleSystemQuad.cpp b/cocos2dx/particle_nodes/CCParticleSystemQuad.cpp index 031d3d0b55..829987e7c6 100644 --- a/cocos2dx/particle_nodes/CCParticleSystemQuad.cpp +++ b/cocos2dx/particle_nodes/CCParticleSystemQuad.cpp @@ -163,7 +163,7 @@ void ParticleSystemQuad::initTexCoordsWithRect(const Rect& pointRect) // Important. Texture in cocos2d are inverted, so the Y component should be inverted CC_SWAP( top, bottom, float); - ccV3F_C4B_T2F_Quad *quads = NULL; + V3F_C4B_T2F_Quad *quads = NULL; unsigned int start = 0, end = 0; if (_batchNode) { @@ -239,20 +239,20 @@ void ParticleSystemQuad::initIndices() void ParticleSystemQuad::updateQuadWithParticle(tParticle* particle, const Point& newPosition) { - ccV3F_C4B_T2F_Quad *quad; + V3F_C4B_T2F_Quad *quad; if (_batchNode) { - ccV3F_C4B_T2F_Quad *batchQuads = _batchNode->getTextureAtlas()->getQuads(); + V3F_C4B_T2F_Quad *batchQuads = _batchNode->getTextureAtlas()->getQuads(); quad = &(batchQuads[_atlasIndex+particle->atlasIndex]); } else { quad = &(_quads[_particleIdx]); } - ccColor4B color = (_opacityModifyRGB) - ? ccc4( particle->color.r*particle->color.a*255, particle->color.g*particle->color.a*255, particle->color.b*particle->color.a*255, particle->color.a*255) - : ccc4( particle->color.r*255, particle->color.g*255, particle->color.b*255, particle->color.a*255); + Color4B color = (_opacityModifyRGB) + ? Color4B( particle->color.r*particle->color.a*255, particle->color.g*particle->color.a*255, particle->color.b*particle->color.a*255, particle->color.a*255) + : Color4B( particle->color.r*255, particle->color.g*255, particle->color.b*255, particle->color.a*255); quad->bl.colors = color; quad->br.colors = color; @@ -378,11 +378,11 @@ void ParticleSystemQuad::draw() glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]); // vertices - glVertexAttribPointer(kVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( ccV3F_C4B_T2F, vertices)); + glVertexAttribPointer(kVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( V3F_C4B_T2F, vertices)); // colors - glVertexAttribPointer(kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (GLvoid*) offsetof( ccV3F_C4B_T2F, colors)); + glVertexAttribPointer(kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (GLvoid*) offsetof( V3F_C4B_T2F, colors)); // tex coords - glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( ccV3F_C4B_T2F, texCoords)); + glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( V3F_C4B_T2F, texCoords)); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]); @@ -409,7 +409,7 @@ void ParticleSystemQuad::setTotalParticles(unsigned int tp) size_t indicesSize = sizeof(_indices[0]) * tp * 6 * 1; tParticle* particlesNew = (tParticle*)realloc(_particles, particlesSize); - ccV3F_C4B_T2F_Quad* quadsNew = (ccV3F_C4B_T2F_Quad*)realloc(_quads, quadsSize); + V3F_C4B_T2F_Quad* quadsNew = (V3F_C4B_T2F_Quad*)realloc(_quads, quadsSize); GLushort* indicesNew = (GLushort*)realloc(_indices, indicesSize); if (particlesNew && quadsNew && indicesNew) @@ -483,15 +483,15 @@ void ParticleSystemQuad::setupVBOandVAO() // vertices glEnableVertexAttribArray(kVertexAttrib_Position); - glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( ccV3F_C4B_T2F, vertices)); + glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( V3F_C4B_T2F, vertices)); // colors glEnableVertexAttribArray(kVertexAttrib_Color); - glVertexAttribPointer(kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (GLvoid*) offsetof( ccV3F_C4B_T2F, colors)); + glVertexAttribPointer(kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (GLvoid*) offsetof( V3F_C4B_T2F, colors)); // tex coords glEnableVertexAttribArray(kVertexAttrib_TexCoords); - glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( ccV3F_C4B_T2F, texCoords)); + glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( V3F_C4B_T2F, texCoords)); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]); glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * _totalParticles * 6, _indices, GL_STATIC_DRAW); @@ -541,7 +541,7 @@ bool ParticleSystemQuad::allocMemory() CC_SAFE_FREE(_quads); CC_SAFE_FREE(_indices); - _quads = (ccV3F_C4B_T2F_Quad*)malloc(_totalParticles * sizeof(ccV3F_C4B_T2F_Quad)); + _quads = (V3F_C4B_T2F_Quad*)malloc(_totalParticles * sizeof(V3F_C4B_T2F_Quad)); _indices = (GLushort*)malloc(_totalParticles * 6 * sizeof(GLushort)); if( !_quads || !_indices) @@ -553,7 +553,7 @@ bool ParticleSystemQuad::allocMemory() return false; } - memset(_quads, 0, _totalParticles * sizeof(ccV3F_C4B_T2F_Quad)); + memset(_quads, 0, _totalParticles * sizeof(V3F_C4B_T2F_Quad)); memset(_indices, 0, _totalParticles * 6 * sizeof(GLushort)); return true; @@ -583,8 +583,8 @@ void ParticleSystemQuad::setBatchNode(ParticleBatchNode * batchNode) else if( !oldBatch ) { // copy current state to batch - ccV3F_C4B_T2F_Quad *batchQuads = _batchNode->getTextureAtlas()->getQuads(); - ccV3F_C4B_T2F_Quad *quad = &(batchQuads[_atlasIndex] ); + V3F_C4B_T2F_Quad *batchQuads = _batchNode->getTextureAtlas()->getQuads(); + V3F_C4B_T2F_Quad *quad = &(batchQuads[_atlasIndex] ); memcpy( quad, _quads, _totalParticles * sizeof(_quads[0]) ); CC_SAFE_FREE(_quads); diff --git a/cocos2dx/particle_nodes/CCParticleSystemQuad.h b/cocos2dx/particle_nodes/CCParticleSystemQuad.h index b1109f0cb3..cb69954d5d 100644 --- a/cocos2dx/particle_nodes/CCParticleSystemQuad.h +++ b/cocos2dx/particle_nodes/CCParticleSystemQuad.h @@ -53,7 +53,7 @@ Special features and Limitations: class CC_DLL ParticleSystemQuad : public ParticleSystem { protected: - ccV3F_C4B_T2F_Quad *_quads; // quads to be rendered + V3F_C4B_T2F_Quad *_quads; // quads to be rendered GLushort *_indices; // indices #if CC_TEXTURE_ATLAS_USE_VAO diff --git a/cocos2dx/platform/mac/CCImage.mm b/cocos2dx/platform/mac/CCImage.mm index 68b692cb44..c3d4cabe98 100644 --- a/cocos2dx/platform/mac/CCImage.mm +++ b/cocos2dx/platform/mac/CCImage.mm @@ -328,7 +328,7 @@ static bool _isValidFontName(const char *fontName) return ret; } -static bool _initWithString(const char * pText, cocos2d::Image::ETextAlign eAlign, const char * pFontName, int nSize, tImageInfo* pInfo, cocos2d::ccColor3B* pStrokeColor) +static bool _initWithString(const char * pText, cocos2d::Image::ETextAlign eAlign, const char * pFontName, int nSize, tImageInfo* pInfo, cocos2d::Color3B* pStrokeColor) { bool bRet = false; diff --git a/cocos2dx/sprite_nodes/CCSprite.cpp b/cocos2dx/sprite_nodes/CCSprite.cpp index 858ef6fd74..971d79c2a2 100644 --- a/cocos2dx/sprite_nodes/CCSprite.cpp +++ b/cocos2dx/sprite_nodes/CCSprite.cpp @@ -176,7 +176,7 @@ bool Sprite::initWithTexture(Texture2D *pTexture, const Rect& rect, bool rotated memset(&_quad, 0, sizeof(_quad)); // Atlas: Color - ccColor4B tmpColor = { 255, 255, 255, 255 }; + Color4B tmpColor = { 255, 255, 255, 255 }; _quad.bl.colors = tmpColor; _quad.br.colors = tmpColor; _quad.tl.colors = tmpColor; @@ -351,10 +351,10 @@ void Sprite::setTextureRect(const Rect& rect, bool rotated, const Size& untrimme float y2 = y1 + _rect.size.height; // Don't update Z. - _quad.bl.vertices = vertex3(x1, y1, 0); - _quad.br.vertices = vertex3(x2, y1, 0); - _quad.tl.vertices = vertex3(x1, y2, 0); - _quad.tr.vertices = vertex3(x2, y2, 0); + _quad.bl.vertices = Vertex3F(x1, y1, 0); + _quad.br.vertices = Vertex3F(x2, y1, 0); + _quad.tl.vertices = Vertex3F(x1, y2, 0); + _quad.tr.vertices = Vertex3F(x2, y2, 0); } } @@ -457,7 +457,7 @@ void Sprite::updateTransform(void) // If it is not visible, or one of its ancestors is not visible, then do nothing: if( !_visible || ( _parent && _parent != _batchNode && ((Sprite*)_parent)->_shouldBeHidden) ) { - _quad.br.vertices = _quad.tl.vertices = _quad.tr.vertices = _quad.bl.vertices = vertex3(0,0,0); + _quad.br.vertices = _quad.tl.vertices = _quad.tr.vertices = _quad.bl.vertices = Vertex3F(0,0,0); _shouldBeHidden = true; } else @@ -504,10 +504,10 @@ void Sprite::updateTransform(void) float dx = x1 * cr - y2 * sr2 + x; float dy = x1 * sr + y2 * cr2 + y; - _quad.bl.vertices = vertex3( RENDER_IN_SUBPIXEL(ax), RENDER_IN_SUBPIXEL(ay), _vertexZ ); - _quad.br.vertices = vertex3( RENDER_IN_SUBPIXEL(bx), RENDER_IN_SUBPIXEL(by), _vertexZ ); - _quad.tl.vertices = vertex3( RENDER_IN_SUBPIXEL(dx), RENDER_IN_SUBPIXEL(dy), _vertexZ ); - _quad.tr.vertices = vertex3( RENDER_IN_SUBPIXEL(cx), RENDER_IN_SUBPIXEL(cy), _vertexZ ); + _quad.bl.vertices = Vertex3F( RENDER_IN_SUBPIXEL(ax), RENDER_IN_SUBPIXEL(ay), _vertexZ ); + _quad.br.vertices = Vertex3F( RENDER_IN_SUBPIXEL(bx), RENDER_IN_SUBPIXEL(by), _vertexZ ); + _quad.tl.vertices = Vertex3F( RENDER_IN_SUBPIXEL(dx), RENDER_IN_SUBPIXEL(dy), _vertexZ ); + _quad.tr.vertices = Vertex3F( RENDER_IN_SUBPIXEL(cx), RENDER_IN_SUBPIXEL(cy), _vertexZ ); } // MARMALADE CHANGE: ADDED CHECK FOR NULL, TO PERMIT SPRITES WITH NO BATCH NODE / TEXTURE ATLAS @@ -579,18 +579,18 @@ void Sprite::draw(void) #endif // EMSCRIPTEN // vertex - int diff = offsetof( ccV3F_C4B_T2F, vertices); + int diff = offsetof( V3F_C4B_T2F, vertices); glVertexAttribPointer(kVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, kQuadSize, (void*) (offset + diff)); if (_texture != NULL) { // texCoods - diff = offsetof( ccV3F_C4B_T2F, texCoords); + diff = offsetof( V3F_C4B_T2F, texCoords); glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, kQuadSize, (void*)(offset + diff)); } // color - diff = offsetof( ccV3F_C4B_T2F, colors); + diff = offsetof( V3F_C4B_T2F, colors); glVertexAttribPointer(kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (void*)(offset + diff)); @@ -902,7 +902,7 @@ bool Sprite::isFlipY(void) const void Sprite::updateColor(void) { - ccColor4B color4 = { _displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity }; + Color4B color4 = { _displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity }; // special opacity for premultiplied textures if (_opacityModifyRGB) @@ -943,7 +943,7 @@ void Sprite::setOpacity(GLubyte opacity) updateColor(); } -void Sprite::setColor(const ccColor3B& color3) +void Sprite::setColor(const Color3B& color3) { NodeRGBA::setColor(color3); @@ -964,7 +964,7 @@ bool Sprite::isOpacityModifyRGB(void) const return _opacityModifyRGB; } -void Sprite::updateDisplayedColor(const ccColor3B& parentColor) +void Sprite::updateDisplayedColor(const Color3B& parentColor) { NodeRGBA::updateDisplayedColor(parentColor); @@ -1049,10 +1049,10 @@ void Sprite::setBatchNode(SpriteBatchNode *pobSpriteBatchNode) float y1 = _offsetPosition.y; float x2 = x1 + _rect.size.width; float y2 = y1 + _rect.size.height; - _quad.bl.vertices = vertex3( x1, y1, 0 ); - _quad.br.vertices = vertex3( x2, y1, 0 ); - _quad.tl.vertices = vertex3( x1, y2, 0 ); - _quad.tr.vertices = vertex3( x2, y2, 0 ); + _quad.bl.vertices = Vertex3F( x1, y1, 0 ); + _quad.br.vertices = Vertex3F( x2, y1, 0 ); + _quad.tl.vertices = Vertex3F( x1, y2, 0 ); + _quad.tr.vertices = Vertex3F( x2, y2, 0 ); } else { diff --git a/cocos2dx/sprite_nodes/CCSprite.h b/cocos2dx/sprite_nodes/CCSprite.h index ba4d98d180..ec0826c926 100644 --- a/cocos2dx/sprite_nodes/CCSprite.h +++ b/cocos2dx/sprite_nodes/CCSprite.h @@ -263,8 +263,8 @@ public: /// @name Functions inherited from TextureProtocol virtual void setTexture(Texture2D *texture); virtual Texture2D* getTexture(void); - inline void setBlendFunc(const ccBlendFunc &blendFunc) { _blendFunc = blendFunc; } - inline const ccBlendFunc& getBlendFunc(void) const { return _blendFunc; } + inline void setBlendFunc(const BlendFunc &blendFunc) { _blendFunc = blendFunc; } + inline const BlendFunc& getBlendFunc(void) const { return _blendFunc; } /// @} /// @{ @@ -294,8 +294,8 @@ public: /// @{ /// @name Functions inherited from NodeRGBA - virtual void setColor(const ccColor3B& color3); - virtual void updateDisplayedColor(const ccColor3B& parentColor); + virtual void setColor(const Color3B& color3); + virtual void updateDisplayedColor(const Color3B& parentColor); virtual void setOpacity(GLubyte opacity); virtual void setOpacityModifyRGB(bool modify); virtual bool isOpacityModifyRGB(void) const; @@ -410,7 +410,7 @@ public: /** * Returns the quad (tex coords, vertex coords and color) information. */ - inline ccV3F_C4B_T2F_Quad getQuad(void) { return _quad; } + inline V3F_C4B_T2F_Quad getQuad(void) { return _quad; } /** * Returns whether or not the texture rectangle is rotated. @@ -510,7 +510,7 @@ protected: // // Data used when the sprite is self-rendered // - ccBlendFunc _blendFunc; /// It's required for TextureProtocol inheritance + BlendFunc _blendFunc; /// It's required for TextureProtocol inheritance Texture2D* _texture; /// Texture2D object that is used to render the sprite // @@ -526,7 +526,7 @@ protected: Point _unflippedOffsetPositionFromCenter; // vertex coords, texture coords and color info - ccV3F_C4B_T2F_Quad _quad; + V3F_C4B_T2F_Quad _quad; // opacity and RGB protocol bool _opacityModifyRGB; diff --git a/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp b/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp index cee4eac731..d0e0e1d1d5 100644 --- a/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp +++ b/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp @@ -365,10 +365,10 @@ void SpriteBatchNode::updateAtlasIndex(Sprite* sprite, int* curIndex) void SpriteBatchNode::swap(int oldIndex, int newIndex) { Object** x = _descendants->data->arr; - ccV3F_C4B_T2F_Quad* quads = _textureAtlas->getQuads(); + V3F_C4B_T2F_Quad* quads = _textureAtlas->getQuads(); Object* tempItem = x[oldIndex]; - ccV3F_C4B_T2F_Quad tempItemQuad=quads[oldIndex]; + V3F_C4B_T2F_Quad tempItemQuad=quads[oldIndex]; //update the index of other swapped item ((Sprite*) x[newIndex])->setAtlasIndex(oldIndex); @@ -566,7 +566,7 @@ void SpriteBatchNode::insertChild(Sprite *pSprite, unsigned int uIndex) increaseAtlasCapacity(); } - ccV3F_C4B_T2F_Quad quad = pSprite->getQuad(); + V3F_C4B_T2F_Quad quad = pSprite->getQuad(); _textureAtlas->insertQuad(&quad, uIndex); ccArray *descendantsData = _descendants->data; @@ -611,7 +611,7 @@ void SpriteBatchNode::appendChild(Sprite* sprite) sprite->setAtlasIndex(index); - ccV3F_C4B_T2F_Quad quad = sprite->getQuad(); + V3F_C4B_T2F_Quad quad = sprite->getQuad(); _textureAtlas->insertQuad(&quad, index); // add children recursively @@ -673,12 +673,12 @@ void SpriteBatchNode::updateBlendFunc(void) } // CocosNodeTexture protocol -void SpriteBatchNode::setBlendFunc(const ccBlendFunc &blendFunc) +void SpriteBatchNode::setBlendFunc(const BlendFunc &blendFunc) { _blendFunc = blendFunc; } -const ccBlendFunc& SpriteBatchNode::getBlendFunc(void) const +const BlendFunc& SpriteBatchNode::getBlendFunc(void) const { return _blendFunc; } @@ -714,7 +714,7 @@ void SpriteBatchNode::insertQuadFromSprite(Sprite *sprite, unsigned int index) sprite->setBatchNode(this); sprite->setAtlasIndex(index); - ccV3F_C4B_T2F_Quad quad = sprite->getQuad(); + V3F_C4B_T2F_Quad quad = sprite->getQuad(); _textureAtlas->insertQuad(&quad, index); // XXX: updateTransform will update the textureAtlas too, using updateQuad. diff --git a/cocos2dx/sprite_nodes/CCSpriteBatchNode.h b/cocos2dx/sprite_nodes/CCSpriteBatchNode.h index a1219f46f8..6a398f94b8 100644 --- a/cocos2dx/sprite_nodes/CCSpriteBatchNode.h +++ b/cocos2dx/sprite_nodes/CCSpriteBatchNode.h @@ -131,8 +131,8 @@ public: // TextureProtocol virtual Texture2D* getTexture(void); virtual void setTexture(Texture2D *texture); - virtual void setBlendFunc(const ccBlendFunc &blendFunc); - virtual const ccBlendFunc& getBlendFunc(void) const; + virtual void setBlendFunc(const BlendFunc &blendFunc); + virtual const BlendFunc& getBlendFunc(void) const; virtual void visit(void); virtual void addChild(Node * child); @@ -168,7 +168,7 @@ private: protected: TextureAtlas *_textureAtlas; - ccBlendFunc _blendFunc; + BlendFunc _blendFunc; // all descendants: children, gran children, etc... Array* _descendants; diff --git a/cocos2dx/support/CCVertex.cpp b/cocos2dx/support/CCVertex.cpp index 5b33c19c60..4b9c33c07c 100644 --- a/cocos2dx/support/CCVertex.cpp +++ b/cocos2dx/support/CCVertex.cpp @@ -29,7 +29,7 @@ NS_CC_BEGIN -void ccVertexLineToPolygon(Point *points, float stroke, ccVertex2F *vertices, unsigned int offset, unsigned int nuPoints) +void ccVertexLineToPolygon(Point *points, float stroke, Vertex2F *vertices, unsigned int offset, unsigned int nuPoints) { nuPoints += offset; if(nuPoints<=1) return; @@ -69,8 +69,8 @@ void ccVertexLineToPolygon(Point *points, float stroke, ccVertex2F *vertices, un } perpVector = ccpMult(perpVector, stroke); - vertices[idx] = vertex2(p1.x+perpVector.x, p1.y+perpVector.y); - vertices[idx+1] = vertex2(p1.x-perpVector.x, p1.y-perpVector.y); + vertices[idx] = Vertex2F(p1.x+perpVector.x, p1.y+perpVector.y); + vertices[idx+1] = Vertex2F(p1.x-perpVector.x, p1.y-perpVector.y); } @@ -81,10 +81,10 @@ void ccVertexLineToPolygon(Point *points, float stroke, ccVertex2F *vertices, un idx = i*2; const unsigned int idx1 = idx+2; - ccVertex2F p1 = vertices[idx]; - ccVertex2F p2 = vertices[idx+1]; - ccVertex2F p3 = vertices[idx1]; - ccVertex2F p4 = vertices[idx1+1]; + Vertex2F p1 = vertices[idx]; + Vertex2F p2 = vertices[idx+1]; + Vertex2F p3 = vertices[idx1]; + Vertex2F p4 = vertices[idx1+1]; float s; //BOOL fixVertex = !ccpLineIntersect(ccp(p1.x, p1.y), ccp(p4.x, p4.y), ccp(p2.x, p2.y), ccp(p3.x, p3.y), &s, &t); diff --git a/cocos2dx/support/CCVertex.h b/cocos2dx/support/CCVertex.h index 0298243b6e..25018f80e9 100644 --- a/cocos2dx/support/CCVertex.h +++ b/cocos2dx/support/CCVertex.h @@ -37,7 +37,7 @@ NS_CC_BEGIN /** @file Vertex.h */ /** converts a line to a polygon */ -void CC_DLL ccVertexLineToPolygon(Point *points, float stroke, ccVertex2F *vertices, unsigned int offset, unsigned int nuPoints); +void CC_DLL ccVertexLineToPolygon(Point *points, float stroke, Vertex2F *vertices, unsigned int offset, unsigned int nuPoints); /** returns whether or not the line intersects */ bool CC_DLL ccVertexLineIntersect(float Ax, float Ay, diff --git a/cocos2dx/text_input_node/CCTextFieldTTF.cpp b/cocos2dx/text_input_node/CCTextFieldTTF.cpp index 8666f7d77d..0380521d13 100644 --- a/cocos2dx/text_input_node/CCTextFieldTTF.cpp +++ b/cocos2dx/text_input_node/CCTextFieldTTF.cpp @@ -265,18 +265,18 @@ void TextFieldTTF::draw() } // draw placeholder - ccColor3B color = getColor(); + Color3B color = getColor(); setColor(_colorSpaceHolder); LabelTTF::draw(); setColor(color); } -const ccColor3B& TextFieldTTF::getColorSpaceHolder() +const Color3B& TextFieldTTF::getColorSpaceHolder() { return _colorSpaceHolder; } -void TextFieldTTF::setColorSpaceHolder(const ccColor3B& color) +void TextFieldTTF::setColorSpaceHolder(const Color3B& color) { _colorSpaceHolder = color; } diff --git a/cocos2dx/text_input_node/CCTextFieldTTF.h b/cocos2dx/text_input_node/CCTextFieldTTF.h index 15eb9e0bdf..7acd779387 100644 --- a/cocos2dx/text_input_node/CCTextFieldTTF.h +++ b/cocos2dx/text_input_node/CCTextFieldTTF.h @@ -127,8 +127,8 @@ public: CC_SYNTHESIZE(TextFieldDelegate *, _delegate, Delegate); CC_SYNTHESIZE_READONLY(int, _charCount, CharCount); - virtual const ccColor3B& getColorSpaceHolder(); - virtual void setColorSpaceHolder(const ccColor3B& color); + virtual const Color3B& getColorSpaceHolder(); + virtual void setColorSpaceHolder(const Color3B& color); // input text property public: @@ -144,7 +144,7 @@ public: virtual const char * getPlaceHolder(void); protected: std::string * _placeHolder; - ccColor3B _colorSpaceHolder; + Color3B _colorSpaceHolder; public: virtual void setSecureTextEntry(bool value); virtual bool isSecureTextEntry(); diff --git a/cocos2dx/textures/CCTexture2D.cpp b/cocos2dx/textures/CCTexture2D.cpp index 4857896b73..7356c96356 100644 --- a/cocos2dx/textures/CCTexture2D.cpp +++ b/cocos2dx/textures/CCTexture2D.cpp @@ -444,7 +444,7 @@ bool Texture2D::initWithString(const char *text, const char *fontName, float fon { #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - ccFontDefinition tempDef; + FontDefinition tempDef; tempDef._shadow._shadowEnabled = false; tempDef._stroke._strokeEnabled = false; @@ -455,7 +455,7 @@ bool Texture2D::initWithString(const char *text, const char *fontName, float fon tempDef._dimensions = dimensions; tempDef._alignment = hAlignment; tempDef._vertAlignment = vAlignment; - tempDef._fontFillColor = ccWHITE; + tempDef._fontFillColor = Color3B::white; return initWithString(text, &tempDef); @@ -510,7 +510,7 @@ bool Texture2D::initWithString(const char *text, const char *fontName, float fon } -bool Texture2D::initWithString(const char *text, ccFontDefinition *textDefinition) +bool Texture2D::initWithString(const char *text, FontDefinition *textDefinition) { #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) diff --git a/cocos2dx/textures/CCTexture2D.h b/cocos2dx/textures/CCTexture2D.h index 3c246d9ee4..d5106937ed 100644 --- a/cocos2dx/textures/CCTexture2D.h +++ b/cocos2dx/textures/CCTexture2D.h @@ -136,7 +136,7 @@ public: /** Initializes a texture from a string with font name and font size */ bool initWithString(const char *text, const char *fontName, float fontSize); /** Initializes a texture from a string using a text definition*/ - bool initWithString(const char *text, ccFontDefinition *textDefinition); + bool initWithString(const char *text, FontDefinition *textDefinition); /** Initializes a texture from a PVR file */ bool initWithPVRFile(const char* file); diff --git a/cocos2dx/textures/CCTextureAtlas.cpp b/cocos2dx/textures/CCTextureAtlas.cpp index 73bbeb0d10..33a0733de1 100644 --- a/cocos2dx/textures/CCTextureAtlas.cpp +++ b/cocos2dx/textures/CCTextureAtlas.cpp @@ -90,14 +90,14 @@ void TextureAtlas::setTexture(Texture2D * var) _texture = var; } -ccV3F_C4B_T2F_Quad* TextureAtlas::getQuads() +V3F_C4B_T2F_Quad* TextureAtlas::getQuads() { //if someone accesses the quads directly, presume that changes will be made _dirty = true; return _quads; } -void TextureAtlas::setQuads(ccV3F_C4B_T2F_Quad *var) +void TextureAtlas::setQuads(V3F_C4B_T2F_Quad *var) { _quads = var; } @@ -157,7 +157,7 @@ bool TextureAtlas::initWithTexture(Texture2D *texture, unsigned int capacity) // Re-initialization is not allowed CCAssert(_quads == NULL && _indices == NULL, ""); - _quads = (ccV3F_C4B_T2F_Quad*)malloc( _capacity * sizeof(ccV3F_C4B_T2F_Quad) ); + _quads = (V3F_C4B_T2F_Quad*)malloc( _capacity * sizeof(V3F_C4B_T2F_Quad) ); _indices = (GLushort *)malloc( _capacity * 6 * sizeof(GLushort) ); if( ! ( _quads && _indices) && _capacity > 0) @@ -172,7 +172,7 @@ bool TextureAtlas::initWithTexture(Texture2D *texture, unsigned int capacity) return false; } - memset( _quads, 0, _capacity * sizeof(ccV3F_C4B_T2F_Quad) ); + memset( _quads, 0, _capacity * sizeof(V3F_C4B_T2F_Quad) ); memset( _indices, 0, _capacity * 6 * sizeof(GLushort) ); // listen the event when app go to background @@ -256,15 +256,15 @@ void TextureAtlas::setupVBOandVAO() // vertices glEnableVertexAttribArray(kVertexAttrib_Position); - glVertexAttribPointer(kVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( ccV3F_C4B_T2F, vertices)); + glVertexAttribPointer(kVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( V3F_C4B_T2F, vertices)); // colors glEnableVertexAttribArray(kVertexAttrib_Color); - glVertexAttribPointer(kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (GLvoid*) offsetof( ccV3F_C4B_T2F, colors)); + glVertexAttribPointer(kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (GLvoid*) offsetof( V3F_C4B_T2F, colors)); // tex coords glEnableVertexAttribArray(kVertexAttrib_TexCoords); - glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( ccV3F_C4B_T2F, texCoords)); + glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( V3F_C4B_T2F, texCoords)); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]); glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * _capacity * 6, _indices, GL_STATIC_DRAW); @@ -303,7 +303,7 @@ void TextureAtlas::mapBuffers() // TextureAtlas - Update, Insert, Move & Remove -void TextureAtlas::updateQuad(ccV3F_C4B_T2F_Quad *quad, unsigned int index) +void TextureAtlas::updateQuad(V3F_C4B_T2F_Quad *quad, unsigned int index) { CCAssert( index >= 0 && index < _capacity, "updateQuadWithTexture: Invalid index"); @@ -316,7 +316,7 @@ void TextureAtlas::updateQuad(ccV3F_C4B_T2F_Quad *quad, unsigned int index) } -void TextureAtlas::insertQuad(ccV3F_C4B_T2F_Quad *quad, unsigned int index) +void TextureAtlas::insertQuad(V3F_C4B_T2F_Quad *quad, unsigned int index) { CCAssert( index < _capacity, "insertQuadWithTexture: Invalid index"); @@ -340,7 +340,7 @@ void TextureAtlas::insertQuad(ccV3F_C4B_T2F_Quad *quad, unsigned int index) } -void TextureAtlas::insertQuads(ccV3F_C4B_T2F_Quad* quads, unsigned int index, unsigned int amount) +void TextureAtlas::insertQuads(V3F_C4B_T2F_Quad* quads, unsigned int index, unsigned int amount) { CCAssert(index + amount <= _capacity, "insertQuadWithTexture: Invalid index + amount"); @@ -392,7 +392,7 @@ void TextureAtlas::insertQuadFromIndex(unsigned int oldIndex, unsigned int newIn } // texture coordinates - ccV3F_C4B_T2F_Quad quadsBackup = _quads[oldIndex]; + V3F_C4B_T2F_Quad quadsBackup = _quads[oldIndex]; memmove( &_quads[dst],&_quads[src], sizeof(_quads[0]) * howMany ); _quads[newIndex] = quadsBackup; @@ -455,14 +455,14 @@ bool TextureAtlas::resizeCapacity(unsigned int newCapacity) _totalQuads = MIN(_totalQuads, newCapacity); _capacity = newCapacity; - ccV3F_C4B_T2F_Quad* tmpQuads = NULL; + V3F_C4B_T2F_Quad* tmpQuads = NULL; GLushort* tmpIndices = NULL; // when calling initWithTexture(fileName, 0) on bada device, calloc(0, 1) will fail and return NULL, // so here must judge whether _quads and _indices is NULL. if (_quads == NULL) { - tmpQuads = (ccV3F_C4B_T2F_Quad*)malloc( _capacity * sizeof(_quads[0]) ); + tmpQuads = (V3F_C4B_T2F_Quad*)malloc( _capacity * sizeof(_quads[0]) ); if (tmpQuads != NULL) { memset(tmpQuads, 0, _capacity * sizeof(_quads[0]) ); @@ -470,7 +470,7 @@ bool TextureAtlas::resizeCapacity(unsigned int newCapacity) } else { - tmpQuads = (ccV3F_C4B_T2F_Quad*)realloc( _quads, sizeof(_quads[0]) * _capacity ); + tmpQuads = (V3F_C4B_T2F_Quad*)realloc( _quads, sizeof(_quads[0]) * _capacity ); if (tmpQuads != NULL && _capacity > uOldCapactiy) { memset(tmpQuads+uOldCapactiy, 0, (_capacity - uOldCapactiy)*sizeof(_quads[0]) ); @@ -532,8 +532,8 @@ void TextureAtlas::moveQuadsFromIndex(unsigned int oldIndex, unsigned int amount return; } //create buffer - size_t quadSize = sizeof(ccV3F_C4B_T2F_Quad); - ccV3F_C4B_T2F_Quad* tempQuads = (ccV3F_C4B_T2F_Quad*)malloc( quadSize * amount); + size_t quadSize = sizeof(V3F_C4B_T2F_Quad); + V3F_C4B_T2F_Quad* tempQuads = (V3F_C4B_T2F_Quad*)malloc( quadSize * amount); memcpy( tempQuads, &_quads[oldIndex], quadSize * amount ); if (newIndex < oldIndex) @@ -562,7 +562,7 @@ void TextureAtlas::moveQuadsFromIndex(unsigned int index, unsigned int newIndex) void TextureAtlas::fillWithEmptyQuadsFromIndex(unsigned int index, unsigned int amount) { - ccV3F_C4B_T2F_Quad quad; + V3F_C4B_T2F_Quad quad; memset(&quad, 0, sizeof(quad)); unsigned int to = index + amount; @@ -656,13 +656,13 @@ void TextureAtlas::drawNumberOfQuads(unsigned int n, unsigned int start) ccGLEnableVertexAttribs(kVertexAttribFlag_PosColorTex); // vertices - glVertexAttribPointer(kVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof(ccV3F_C4B_T2F, vertices)); + glVertexAttribPointer(kVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof(V3F_C4B_T2F, vertices)); // colors - glVertexAttribPointer(kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (GLvoid*) offsetof(ccV3F_C4B_T2F, colors)); + glVertexAttribPointer(kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (GLvoid*) offsetof(V3F_C4B_T2F, colors)); // tex coords - glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof(ccV3F_C4B_T2F, texCoords)); + glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof(V3F_C4B_T2F, texCoords)); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]); diff --git a/cocos2dx/textures/CCTextureAtlas.h b/cocos2dx/textures/CCTextureAtlas.h index 0e75782bcf..9051845b28 100644 --- a/cocos2dx/textures/CCTextureAtlas.h +++ b/cocos2dx/textures/CCTextureAtlas.h @@ -71,7 +71,7 @@ protected: /** Texture of the texture atlas */ CC_PROPERTY(Texture2D *, _texture, Texture) /** Quads that are going to be rendered */ - CC_PROPERTY(ccV3F_C4B_T2F_Quad *, _quads, Quads) + CC_PROPERTY(V3F_C4B_T2F_Quad *, _quads, Quads) public: @@ -111,20 +111,20 @@ public: * index must be between 0 and the atlas capacity - 1 @since v0.8 */ - void updateQuad(ccV3F_C4B_T2F_Quad* quad, unsigned int index); + void updateQuad(V3F_C4B_T2F_Quad* quad, unsigned int index); /** Inserts a Quad (texture, vertex and color) at a certain index index must be between 0 and the atlas capacity - 1 @since v0.8 */ - void insertQuad(ccV3F_C4B_T2F_Quad* quad, unsigned int index); + void insertQuad(V3F_C4B_T2F_Quad* quad, unsigned int index); /** Inserts a c array of quads at a given index index must be between 0 and the atlas capacity - 1 this method doesn't enlarge the array when amount + index > totalQuads @since v1.1 */ - void insertQuads(ccV3F_C4B_T2F_Quad* quads, unsigned int index, unsigned int amount); + void insertQuads(V3F_C4B_T2F_Quad* quads, unsigned int index, unsigned int amount); /** Removes the quad that is located at a certain index and inserts it at a new index This operation is faster than removing and inserting in a quad in 2 different steps diff --git a/cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.cpp b/cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.cpp index 9f881c83c9..90faed906a 100644 --- a/cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.cpp +++ b/cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.cpp @@ -101,8 +101,8 @@ void TileMapAtlas::calculateItemsToRender() { for( int y=0; y < _TGAInfo->height; y++ ) { - ccColor3B *ptr = (ccColor3B*) _TGAInfo->imageData; - ccColor3B value = ptr[x + y * _TGAInfo->width]; + Color3B *ptr = (Color3B*) _TGAInfo->imageData; + Color3B value = ptr[x + y * _TGAInfo->width]; if( value.r ) { ++_itemsToRender; @@ -132,7 +132,7 @@ void TileMapAtlas::loadTGAfile(const char *file) } // TileMapAtlas - Atlas generation / updates -void TileMapAtlas::setTile(const ccColor3B& tile, const Point& position) +void TileMapAtlas::setTile(const Color3B& tile, const Point& position) { CCAssert(_TGAInfo != NULL, "tgaInfo must not be nil"); CCAssert(_posToAtlasIndex != NULL, "posToAtlasIndex must not be nil"); @@ -140,8 +140,8 @@ void TileMapAtlas::setTile(const ccColor3B& tile, const Point& position) CCAssert(position.y < _TGAInfo->height, "Invalid position.x"); CCAssert(tile.r != 0, "R component must be non 0"); - ccColor3B *ptr = (ccColor3B*)_TGAInfo->imageData; - ccColor3B value = ptr[(unsigned int)(position.x + position.y * _TGAInfo->width)]; + Color3B *ptr = (Color3B*)_TGAInfo->imageData; + Color3B value = ptr[(unsigned int)(position.x + position.y * _TGAInfo->width)]; if( value.r == 0 ) { CCLOG("cocos2d: Value.r must be non 0."); @@ -159,23 +159,23 @@ void TileMapAtlas::setTile(const ccColor3B& tile, const Point& position) } } -ccColor3B TileMapAtlas::tileAt(const Point& position) +Color3B TileMapAtlas::tileAt(const Point& position) { CCAssert( _TGAInfo != NULL, "tgaInfo must not be nil"); CCAssert( position.x < _TGAInfo->width, "Invalid position.x"); CCAssert( position.y < _TGAInfo->height, "Invalid position.y"); - ccColor3B *ptr = (ccColor3B*)_TGAInfo->imageData; - ccColor3B value = ptr[(unsigned int)(position.x + position.y * _TGAInfo->width)]; + Color3B *ptr = (Color3B*)_TGAInfo->imageData; + Color3B value = ptr[(unsigned int)(position.x + position.y * _TGAInfo->width)]; return value; } -void TileMapAtlas::updateAtlasValueAt(const Point& pos, const ccColor3B& value, unsigned int index) +void TileMapAtlas::updateAtlasValueAt(const Point& pos, const Color3B& value, unsigned int index) { CCAssert( index >= 0 && index < _textureAtlas->getCapacity(), "updateAtlasValueAt: Invalid index"); - ccV3F_C4B_T2F_Quad* quad = &((_textureAtlas->getQuads())[index]); + V3F_C4B_T2F_Quad* quad = &((_textureAtlas->getQuads())[index]); int x = pos.x; int y = pos.y; @@ -222,7 +222,7 @@ void TileMapAtlas::updateAtlasValueAt(const Point& pos, const ccColor3B& value, quad->tr.vertices.y = (float)(y * _itemHeight + _itemHeight); quad->tr.vertices.z = 0.0f; - ccColor4B color = { _displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity }; + Color4B color = { _displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity }; quad->tr.colors = color; quad->tl.colors = color; quad->br.colors = color; @@ -247,8 +247,8 @@ void TileMapAtlas::updateAtlasValues() { if( total < _itemsToRender ) { - ccColor3B *ptr = (ccColor3B*) _TGAInfo->imageData; - ccColor3B value = ptr[x + y * _TGAInfo->width]; + Color3B *ptr = (Color3B*) _TGAInfo->imageData; + Color3B value = ptr[x + y * _TGAInfo->width]; if( value.r != 0 ) { diff --git a/cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.h b/cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.h index f95de666c6..817a612243 100644 --- a/cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.h +++ b/cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.h @@ -74,17 +74,17 @@ public: /** returns a tile from position x,y. For the moment only channel R is used */ - ccColor3B tileAt(const Point& position); + Color3B tileAt(const Point& position); /** sets a tile at position x,y. For the moment only channel R is used */ - void setTile(const ccColor3B& tile, const Point& position); + void setTile(const Color3B& tile, const Point& position); /** dealloc the map from memory */ void releaseMap(); private: void loadTGAfile(const char *file); void calculateItemsToRender(); - void updateAtlasValueAt(const Point& pos, const ccColor3B& value, unsigned int index); + void updateAtlasValueAt(const Point& pos, const Color3B& value, unsigned int index); void updateAtlasValues(); protected: diff --git a/extensions/CCArmature/CCArmature.h b/extensions/CCArmature/CCArmature.h index 71ebcc7006..08ba7f9ea1 100644 --- a/extensions/CCArmature/CCArmature.h +++ b/extensions/CCArmature/CCArmature.h @@ -120,8 +120,8 @@ public: */ virtual void updateOffsetPoint(); - inline void setBlendFunc(const ccBlendFunc& blendFunc) { _blendFunc = blendFunc; } - inline const ccBlendFunc& getBlendFunc(void) const { return _blendFunc; } + inline void setBlendFunc(const BlendFunc& blendFunc) { _blendFunc = blendFunc; } + inline const BlendFunc& getBlendFunc(void) const { return _blendFunc; } protected: @@ -149,7 +149,7 @@ protected: static std::map _armatureIndexDic; //! Use to save armature zorder info, - ccBlendFunc _blendFunc; //! It's required for TextureProtocol inheritance + BlendFunc _blendFunc; //! It's required for TextureProtocol inheritance Point _offsetPoint; }; diff --git a/extensions/CCArmature/CCBone.cpp b/extensions/CCArmature/CCBone.cpp index f721ab55a3..aed808649e 100644 --- a/extensions/CCArmature/CCBone.cpp +++ b/extensions/CCArmature/CCBone.cpp @@ -196,7 +196,7 @@ void Bone::update(float delta) } -void Bone::updateDisplayedColor(const ccColor3B &parentColor) +void Bone::updateDisplayedColor(const Color3B &parentColor) { NodeRGBA::updateDisplayedColor(parentColor); updateColor(); @@ -214,7 +214,7 @@ void Bone::updateColor() RGBAProtocol *protocol = dynamic_cast(display); if(protocol != NULL) { - protocol->setColor(ccc3(_displayedColor.r * _tweenData->r / 255, _displayedColor.g * _tweenData->g / 255, _displayedColor.b * _tweenData->b / 255)); + protocol->setColor(Color3B(_displayedColor.r * _tweenData->r / 255, _displayedColor.g * _tweenData->g / 255, _displayedColor.b * _tweenData->b / 255)); protocol->setOpacity(_displayedOpacity * _tweenData->a / 255); } } diff --git a/extensions/CCArmature/CCBone.h b/extensions/CCArmature/CCBone.h index 05d3ba8fa9..3c94ebc667 100644 --- a/extensions/CCArmature/CCBone.h +++ b/extensions/CCArmature/CCBone.h @@ -118,7 +118,7 @@ public: void update(float delta); - void updateDisplayedColor(const ccColor3B &parentColor); + void updateDisplayedColor(const Color3B &parentColor); void updateDisplayedOpacity(GLubyte parentOpacity); //! Update color to render display diff --git a/extensions/CCArmature/datas/CCDatas.h b/extensions/CCArmature/datas/CCDatas.h index ac6320f043..a98159c17e 100644 --- a/extensions/CCArmature/datas/CCDatas.h +++ b/extensions/CCArmature/datas/CCDatas.h @@ -394,9 +394,9 @@ public: }; -struct ContourVertex2 : public Object +struct ContourVertex2F : public Object { - ContourVertex2(float x, float y) + ContourVertex2F(float x, float y) { this->x = x; this->y = y; diff --git a/extensions/CCArmature/display/CCShaderNode.cpp b/extensions/CCArmature/display/CCShaderNode.cpp index 09f61f482b..588a052a7a 100644 --- a/extensions/CCArmature/display/CCShaderNode.cpp +++ b/extensions/CCArmature/display/CCShaderNode.cpp @@ -33,8 +33,8 @@ enum }; ShaderNode::ShaderNode() - : _center(vertex2(0.0f, 0.0f)) - , _resolution(vertex2(0.0f, 0.0f)) + : _center(Vertex2F(0.0f, 0.0f)) + , _resolution(Vertex2F(0.0f, 0.0f)) , _time(0.0f) , _uniformCenter(0) , _uniformResolution(0) @@ -57,7 +57,7 @@ bool ShaderNode::initWithVertex(const char *vert, const char *frag) loadShaderVertex(vert, frag); _time = 0; - _resolution = vertex2(SIZE_X, SIZE_Y); + _resolution = Vertex2F(SIZE_X, SIZE_Y); scheduleUpdate(); @@ -95,15 +95,15 @@ void ShaderNode::translateFormOtherNode(AffineTransform &transform) { Node::setAdditionalTransform(transform); - _center = vertex2(_additionalTransform.tx * CC_CONTENT_SCALE_FACTOR(), _additionalTransform.ty * CC_CONTENT_SCALE_FACTOR()); - _resolution = vertex2( SIZE_X * _additionalTransform.a, SIZE_Y * _additionalTransform.d); + _center = Vertex2F(_additionalTransform.tx * CC_CONTENT_SCALE_FACTOR(), _additionalTransform.ty * CC_CONTENT_SCALE_FACTOR()); + _resolution = Vertex2F( SIZE_X * _additionalTransform.a, SIZE_Y * _additionalTransform.d); } void ShaderNode::setPosition(const Point &newPosition) { Node::setPosition(newPosition); Point position = getPosition(); - _center = vertex2(position.x * CC_CONTENT_SCALE_FACTOR(), position.y * CC_CONTENT_SCALE_FACTOR()); + _center = Vertex2F(position.x * CC_CONTENT_SCALE_FACTOR(), position.y * CC_CONTENT_SCALE_FACTOR()); } void ShaderNode::draw() diff --git a/extensions/CCArmature/display/CCShaderNode.h b/extensions/CCArmature/display/CCShaderNode.h index b7c67f72b5..415c38585f 100644 --- a/extensions/CCArmature/display/CCShaderNode.h +++ b/extensions/CCArmature/display/CCShaderNode.h @@ -46,8 +46,8 @@ public: private: - ccVertex2F _center; - ccVertex2F _resolution; + Vertex2F _center; + Vertex2F _resolution; float _time; GLuint _uniformCenter, _uniformResolution, _uniformTime; }; diff --git a/extensions/CCArmature/display/CCSkin.cpp b/extensions/CCArmature/display/CCSkin.cpp index 725841e2a0..afc604e87b 100644 --- a/extensions/CCArmature/display/CCSkin.cpp +++ b/extensions/CCArmature/display/CCSkin.cpp @@ -89,7 +89,7 @@ void Skin::draw() // If it is not visible, or one of its ancestors is not visible, then do nothing: if( !_visible) { - _quad.br.vertices = _quad.tl.vertices = _quad.tr.vertices = _quad.bl.vertices = vertex3(0, 0, 0); + _quad.br.vertices = _quad.tl.vertices = _quad.tr.vertices = _quad.bl.vertices = Vertex3F(0, 0, 0); } else { @@ -124,10 +124,10 @@ void Skin::draw() float dx = x1 * cr - y2 * sr2 + x; float dy = x1 * sr + y2 * cr2 + y; - _quad.bl.vertices = vertex3( RENDER_IN_SUBPIXEL(ax), RENDER_IN_SUBPIXEL(ay), _vertexZ ); - _quad.br.vertices = vertex3( RENDER_IN_SUBPIXEL(bx), RENDER_IN_SUBPIXEL(by), _vertexZ ); - _quad.tl.vertices = vertex3( RENDER_IN_SUBPIXEL(dx), RENDER_IN_SUBPIXEL(dy), _vertexZ ); - _quad.tr.vertices = vertex3( RENDER_IN_SUBPIXEL(cx), RENDER_IN_SUBPIXEL(cy), _vertexZ ); + _quad.bl.vertices = Vertex3F( RENDER_IN_SUBPIXEL(ax), RENDER_IN_SUBPIXEL(ay), _vertexZ ); + _quad.br.vertices = Vertex3F( RENDER_IN_SUBPIXEL(bx), RENDER_IN_SUBPIXEL(by), _vertexZ ); + _quad.tl.vertices = Vertex3F( RENDER_IN_SUBPIXEL(dx), RENDER_IN_SUBPIXEL(dy), _vertexZ ); + _quad.tr.vertices = Vertex3F( RENDER_IN_SUBPIXEL(cx), RENDER_IN_SUBPIXEL(cy), _vertexZ ); } // MARMALADE CHANGE: ADDED CHECK FOR NULL, TO PERMIT SPRITES WITH NO BATCH NODE / TEXTURE ATLAS diff --git a/extensions/CCArmature/external_tool/CCTexture2DMutable.cpp b/extensions/CCArmature/external_tool/CCTexture2DMutable.cpp index 37cdf9752a..0c3c8d1ea4 100644 --- a/extensions/CCArmature/external_tool/CCTexture2DMutable.cpp +++ b/extensions/CCArmature/external_tool/CCTexture2DMutable.cpp @@ -108,10 +108,10 @@ bool Texture2DMutable::initWithData(const void* data, Texture2DPixelFormat pixel return true; } -ccColor4B Texture2DMutable::pixelAt(const Point& pt) +Color4B Texture2DMutable::pixelAt(const Point& pt) { - ccColor4B c = {0, 0, 0, 0}; + Color4B c = {0, 0, 0, 0}; if(!data_) return c; if(pt.x < 0 || pt.y < 0) return c; if(pt.x >= _contentSize.width || pt.y >= _contentSize.height) return c; @@ -162,7 +162,7 @@ ccColor4B Texture2DMutable::pixelAt(const Point& pt) return c; } -bool Texture2DMutable::setPixelAt(const Point& pt, ccColor4B c) +bool Texture2DMutable::setPixelAt(const Point& pt, Color4B c) { if(!data_)return false; if(pt.x < 0 || pt.y < 0) return false; @@ -199,7 +199,7 @@ bool Texture2DMutable::setPixelAt(const Point& pt, ccColor4B c) return true; } -void Texture2DMutable::fill(ccColor4B p) +void Texture2DMutable::fill(Color4B p) { for(int r = 0; r < _contentSize.height; ++r) for(int c = 0; c < _contentSize.width; ++c) diff --git a/extensions/CCArmature/external_tool/CCTexture2DMutable.h b/extensions/CCArmature/external_tool/CCTexture2DMutable.h index 6d523d7e27..bde9ab1fa0 100644 --- a/extensions/CCArmature/external_tool/CCTexture2DMutable.h +++ b/extensions/CCArmature/external_tool/CCTexture2DMutable.h @@ -48,20 +48,20 @@ public: bool initWithData(const void* data, cocos2d::Texture2DPixelFormat pixelFormat, unsigned int pixelsWide, unsigned int pixelsHigh, const cocos2d::Size& contentSize); - cocos2d::ccColor4B pixelAt(const cocos2d::Point& pt); + cocos2d::Color4B pixelAt(const cocos2d::Point& pt); /// // @param pt is a point to get a pixel (0,0) is top-left to (width,height) bottom-right - // @param c is a ccColor4B which is a colour. + // @param c is a Color4B which is a colour. // @returns if a pixel was set // Remember to call apply to actually update the texture canvas. /// - bool setPixelAt(const cocos2d::Point& pt, cocos2d::ccColor4B c); + bool setPixelAt(const cocos2d::Point& pt, cocos2d::Color4B c); /// // Fill with specified colour /// - void fill(cocos2d::ccColor4B c); + void fill(cocos2d::Color4B c); /// // @param textureToCopy is the texture image to copy over diff --git a/extensions/CCArmature/physics/CCColliderDetector.cpp b/extensions/CCArmature/physics/CCColliderDetector.cpp index 6fa879792d..8a830abf7f 100644 --- a/extensions/CCArmature/physics/CCColliderDetector.cpp +++ b/extensions/CCArmature/physics/CCColliderDetector.cpp @@ -101,7 +101,7 @@ void ColliderDetector::addContourData(ContourData *contourData) int i = 0; CCARRAY_FOREACH(array, object) { - ContourVertex2 *v = (ContourVertex2 *)object; + ContourVertex2F *v = (ContourVertex2F *)object; b2bv[i].Set(v->x / PT_RATIO, v->y / PT_RATIO); i++; } @@ -188,7 +188,7 @@ void ColliderDetector::updateTransform(AffineTransform &t) int i = 0; CCARRAY_FOREACH(array, object) { - ContourVertex2 *cv = (ContourVertex2 *)object; + ContourVertex2F *cv = (ContourVertex2F *)object; b2Vec2 &bv = shape->m_vertices[i]; helpPoint.setPoint(cv->x, cv->y); diff --git a/extensions/CCArmature/utils/CCDataReaderHelper.cpp b/extensions/CCArmature/utils/CCDataReaderHelper.cpp index 73180fab6e..700537b7ce 100644 --- a/extensions/CCArmature/utils/CCDataReaderHelper.cpp +++ b/extensions/CCArmature/utils/CCDataReaderHelper.cpp @@ -778,7 +778,7 @@ ContourData *DataReaderHelper::decodeContour(tinyxml2::XMLElement *contourXML) while (vertexDataXML) { - ContourVertex2 *vertex = new ContourVertex2(0, 0); + ContourVertex2F *vertex = new ContourVertex2F(0, 0); vertex->autorelease(); vertexDataXML->QueryFloatAttribute(A_X, &vertex->x); @@ -1096,7 +1096,7 @@ ContourData *DataReaderHelper::decodeContour(cs::CSJsonDictionary &json) { cs::CSJsonDictionary *dic = json.getSubItemFromArray(VERTEX_POINT, i); - ContourVertex2 *vertex = new ContourVertex2(0, 0); + ContourVertex2F *vertex = new ContourVertex2F(0, 0); vertex->x = dic->getItemFloatValue(A_X, 0); vertex->y = dic->getItemFloatValue(A_Y, 0); diff --git a/extensions/CCBReader/CCBAnimationManager.cpp b/extensions/CCBReader/CCBAnimationManager.cpp index 88ed15d98a..821d808274 100644 --- a/extensions/CCBReader/CCBAnimationManager.cpp +++ b/extensions/CCBReader/CCBAnimationManager.cpp @@ -312,8 +312,8 @@ ActionInterval* CCBAnimationManager::getAction(CCBKeyframe *pKeyframe0, CCBKeyfr } else if (strcmp(pPropName, "color") == 0) { - ccColor3BWapper* color = (ccColor3BWapper*)pKeyframe1->getValue(); - ccColor3B c = color->getColor(); + Color3BWapper* color = (Color3BWapper*)pKeyframe1->getValue(); + Color3B c = color->getColor(); return TintTo::create(duration, c.r, c.g, c.b); } @@ -472,7 +472,7 @@ void CCBAnimationManager::setAnimatedProperty(const char *pPropName, Node *pNode } else if (strcmp(pPropName, "color") == 0) { - ccColor3BWapper *color = (ccColor3BWapper*)pValue; + Color3BWapper *color = (Color3BWapper*)pValue; (dynamic_cast(pNode))->setColor(color->getColor()); } else if (strcmp(pPropName, "visible") == 0) diff --git a/extensions/CCBReader/CCBReader.cpp b/extensions/CCBReader/CCBReader.cpp index 9b8f22d884..c2b9ecbe1c 100644 --- a/extensions/CCBReader/CCBReader.cpp +++ b/extensions/CCBReader/CCBReader.cpp @@ -790,8 +790,8 @@ CCBKeyframe* CCBReader::readKeyframe(int type) int g = readByte(); int b = readByte(); - ccColor3B c = ccc3(r,g,b); - value = ccColor3BWapper::create(c); + Color3B c = Color3B(r,g,b); + value = Color3BWapper::create(c); } else if (type == kCCBPropTypeDegrees) { diff --git a/extensions/CCBReader/CCBValue.cpp b/extensions/CCBReader/CCBValue.cpp index 7fac2632be..4a17926416 100644 --- a/extensions/CCBReader/CCBValue.cpp +++ b/extensions/CCBReader/CCBValue.cpp @@ -4,11 +4,11 @@ using namespace cocos2d; NS_CC_EXT_BEGIN -// Implementation of ccColor3BWapper +// Implementation of Color3BWapper -ccColor3BWapper* ccColor3BWapper::create(const ccColor3B& color) +Color3BWapper* Color3BWapper::create(const Color3B& color) { - ccColor3BWapper *ret = new ccColor3BWapper(); + Color3BWapper *ret = new Color3BWapper(); if (ret) { ret->color.r = color.r; @@ -21,7 +21,7 @@ ccColor3BWapper* ccColor3BWapper::create(const ccColor3B& color) return ret; } -const ccColor3B& ccColor3BWapper::getColor() const +const Color3B& Color3BWapper::getColor() const { return color; } diff --git a/extensions/CCBReader/CCBValue.h b/extensions/CCBReader/CCBValue.h index d12245727c..d0359bf201 100644 --- a/extensions/CCBReader/CCBValue.h +++ b/extensions/CCBReader/CCBValue.h @@ -5,20 +5,20 @@ #include "ExtensionMacros.h" /* - These classes are wrapper of basic types, such as ccColor3B + These classes are wrapper of basic types, such as Color3B */ NS_CC_EXT_BEGIN -class ccColor3BWapper : public Object +class Color3BWapper : public Object { private: - ccColor3B color; + Color3B color; public: - static ccColor3BWapper* create(const ccColor3B& color); + static Color3BWapper* create(const Color3B& color); - const ccColor3B& getColor() const; + const Color3B& getColor() const; }; enum diff --git a/extensions/CCBReader/CCControlButtonLoader.cpp b/extensions/CCBReader/CCControlButtonLoader.cpp index 383fd3acba..d477a7decf 100644 --- a/extensions/CCBReader/CCControlButtonLoader.cpp +++ b/extensions/CCBReader/CCControlButtonLoader.cpp @@ -100,7 +100,7 @@ void ControlButtonLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pPare } } -void ControlButtonLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, ccColor3B pColor3B, CCBReader * pCCBReader) { +void ControlButtonLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * pCCBReader) { if(strcmp(pPropertyName, PROPERTY_TITLECOLOR_NORMAL) == 0) { ((ControlButton *)pNode)->setTitleColorForState(pColor3B, ControlStateNormal); } else if(strcmp(pPropertyName, PROPERTY_TITLECOLOR_HIGHLIGHTED) == 0) { diff --git a/extensions/CCBReader/CCControlButtonLoader.h b/extensions/CCBReader/CCControlButtonLoader.h index eedeb96a5f..59e041d881 100644 --- a/extensions/CCBReader/CCControlButtonLoader.h +++ b/extensions/CCBReader/CCControlButtonLoader.h @@ -24,7 +24,7 @@ class ControlButtonLoader : public ControlLoader { virtual void onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Point pPoint, CCBReader * pCCBReader); virtual void onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * pCCBReader); virtual void onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * pCCBReader); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, ccColor3B pColor3B, CCBReader * pCCBReader); + virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * pCCBReader); }; NS_CC_EXT_END diff --git a/extensions/CCBReader/CCLabelBMFontLoader.cpp b/extensions/CCBReader/CCLabelBMFontLoader.cpp index 3d8556ba05..9bc808e1a7 100644 --- a/extensions/CCBReader/CCLabelBMFontLoader.cpp +++ b/extensions/CCBReader/CCLabelBMFontLoader.cpp @@ -10,7 +10,7 @@ NS_CC_EXT_BEGIN #define PROPERTY_FNTFILE "fntFile" #define PROPERTY_STRING "string" -void LabelBMFontLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, ccColor3B pColor3B, CCBReader * pCCBReader) { +void LabelBMFontLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * pCCBReader) { if(strcmp(pPropertyName, PROPERTY_COLOR) == 0) { ((LabelBMFont *)pNode)->setColor(pColor3B); } else { @@ -26,7 +26,7 @@ void LabelBMFontLoader::onHandlePropTypeByte(Node * pNode, Node * pParent, const } } -void LabelBMFontLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, ccBlendFunc pBlendFunc, CCBReader * pCCBReader) { +void LabelBMFontLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * pCCBReader) { if(strcmp(pPropertyName, PROPERTY_BLENDFUNC) == 0) { ((LabelBMFont *)pNode)->setBlendFunc(pBlendFunc); } else { diff --git a/extensions/CCBReader/CCLabelBMFontLoader.h b/extensions/CCBReader/CCLabelBMFontLoader.h index 08b7ffe2fa..b2d4615d01 100644 --- a/extensions/CCBReader/CCLabelBMFontLoader.h +++ b/extensions/CCBReader/CCLabelBMFontLoader.h @@ -16,9 +16,9 @@ class LabelBMFontLoader : public NodeLoader { protected: CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(LabelBMFont); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, ccColor3B pColor3B, CCBReader * pCCBReader); + virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * pCCBReader); virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * pCCBReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, ccBlendFunc pBlendFunc, CCBReader * pCCBReader); + virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * pCCBReader); virtual void onHandlePropTypeFntFile(Node * pNode, Node * pParent, const char * pPropertyName, const char* pFntFile, CCBReader * pCCBReader); virtual void onHandlePropTypeText(Node * pNode, Node * pParent, const char * pPropertyName, const char* pText, CCBReader * pCCBReader); }; diff --git a/extensions/CCBReader/CCLabelTTFLoader.cpp b/extensions/CCBReader/CCLabelTTFLoader.cpp index 684a7ba069..a42e15f6c0 100644 --- a/extensions/CCBReader/CCLabelTTFLoader.cpp +++ b/extensions/CCBReader/CCLabelTTFLoader.cpp @@ -14,7 +14,7 @@ NS_CC_EXT_BEGIN -void LabelTTFLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, ccColor3B pColor3B, CCBReader * pCCBReader) { +void LabelTTFLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * pCCBReader) { if(strcmp(pPropertyName, PROPERTY_COLOR) == 0) { ((LabelTTF *)pNode)->setColor(pColor3B); } else { @@ -30,7 +30,7 @@ void LabelTTFLoader::onHandlePropTypeByte(Node * pNode, Node * pParent, const ch } } -void LabelTTFLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, ccBlendFunc pBlendFunc, CCBReader * pCCBReader) { +void LabelTTFLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * pCCBReader) { if(strcmp(pPropertyName, PROPERTY_BLENDFUNC) == 0) { ((LabelTTF *)pNode)->setBlendFunc(pBlendFunc); } else { diff --git a/extensions/CCBReader/CCLabelTTFLoader.h b/extensions/CCBReader/CCLabelTTFLoader.h index c18f34803c..86d854016f 100644 --- a/extensions/CCBReader/CCLabelTTFLoader.h +++ b/extensions/CCBReader/CCLabelTTFLoader.h @@ -16,9 +16,9 @@ class LabelTTFLoader : public NodeLoader { protected: CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(LabelTTF); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, ccColor3B pColor3B, CCBReader * pCCBReader); + virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * pCCBReader); virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * pCCBReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, ccBlendFunc pBlendFunc, CCBReader * pCCBReader); + virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * pCCBReader); virtual void onHandlePropTypeFontTTF(Node * pNode, Node * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * pCCBReader); virtual void onHandlePropTypeText(Node * pNode, Node * pParent, const char * pPropertyName, const char * pText, CCBReader * pCCBReader); virtual void onHandlePropTypeFloatScale(Node * pNode, Node * pParent, const char * pPropertyName, float pFloatScale, CCBReader * pCCBReader); diff --git a/extensions/CCBReader/CCLayerColorLoader.cpp b/extensions/CCBReader/CCLayerColorLoader.cpp index 601efd3507..cff9162f30 100644 --- a/extensions/CCBReader/CCLayerColorLoader.cpp +++ b/extensions/CCBReader/CCLayerColorLoader.cpp @@ -8,7 +8,7 @@ NS_CC_EXT_BEGIN #define PROPERTY_OPACITY "opacity" #define PROPERTY_BLENDFUNC "blendFunc" -void LayerColorLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, ccColor3B pColor3B, CCBReader * pCCBReader) { +void LayerColorLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * pCCBReader) { if(strcmp(pPropertyName, PROPERTY_COLOR) == 0) { ((LayerColor *)pNode)->setColor(pColor3B); } else { @@ -24,7 +24,7 @@ void LayerColorLoader::onHandlePropTypeByte(Node * pNode, Node * pParent, const } } -void LayerColorLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, ccBlendFunc pBlendFunc, CCBReader * pCCBReader) { +void LayerColorLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * pCCBReader) { if(strcmp(pPropertyName, PROPERTY_BLENDFUNC) == 0) { ((LayerColor *)pNode)->setBlendFunc(pBlendFunc); } else { diff --git a/extensions/CCBReader/CCLayerColorLoader.h b/extensions/CCBReader/CCLayerColorLoader.h index 223ad60439..f925eef772 100644 --- a/extensions/CCBReader/CCLayerColorLoader.h +++ b/extensions/CCBReader/CCLayerColorLoader.h @@ -16,9 +16,9 @@ class LayerColorLoader : public LayerLoader { protected: CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(LayerColor); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, ccColor3B pColor3B, CCBReader * pCCBReader); + virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * pCCBReader); virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * pCCBReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, ccBlendFunc pBlendFunc, CCBReader * pCCBReader); + virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * pCCBReader); }; NS_CC_EXT_END diff --git a/extensions/CCBReader/CCLayerGradientLoader.cpp b/extensions/CCBReader/CCLayerGradientLoader.cpp index 1e91154ab2..356ba2244f 100644 --- a/extensions/CCBReader/CCLayerGradientLoader.cpp +++ b/extensions/CCBReader/CCLayerGradientLoader.cpp @@ -11,7 +11,7 @@ NS_CC_EXT_BEGIN -void LayerGradientLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, ccColor3B pColor3B, CCBReader * pCCBReader) { +void LayerGradientLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * pCCBReader) { if(strcmp(pPropertyName, PROPERTY_STARTCOLOR) == 0) { ((LayerGradient *)pNode)->setStartColor(pColor3B); } else if(strcmp(pPropertyName, PROPERTY_ENDCOLOR) == 0) { @@ -31,7 +31,7 @@ void LayerGradientLoader::onHandlePropTypeByte(Node * pNode, Node * pParent, con } } -void LayerGradientLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, ccBlendFunc pBlendFunc, CCBReader * pCCBReader) { +void LayerGradientLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * pCCBReader) { if(strcmp(pPropertyName, PROPERTY_BLENDFUNC) == 0) { ((LayerGradient *)pNode)->setBlendFunc(pBlendFunc); } else { diff --git a/extensions/CCBReader/CCLayerGradientLoader.h b/extensions/CCBReader/CCLayerGradientLoader.h index a69a91cc05..cbe2d7d8c8 100644 --- a/extensions/CCBReader/CCLayerGradientLoader.h +++ b/extensions/CCBReader/CCLayerGradientLoader.h @@ -16,10 +16,10 @@ class LayerGradientLoader : public LayerLoader { protected: CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(LayerGradient); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, ccColor3B pColor3B, CCBReader * pCCBReader); + virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * pCCBReader); virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * pCCBReader); virtual void onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Point pPoint, CCBReader * pCCBReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, ccBlendFunc pBlendFunc, CCBReader * pCCBReader); + virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * pCCBReader); }; NS_CC_EXT_END diff --git a/extensions/CCBReader/CCNodeLoader.cpp b/extensions/CCBReader/CCNodeLoader.cpp index 569c89c103..79160a642a 100644 --- a/extensions/CCBReader/CCNodeLoader.cpp +++ b/extensions/CCBReader/CCNodeLoader.cpp @@ -258,7 +258,7 @@ void NodeLoader::parseProperties(Node * pNode, Node * pParent, CCBReader * pCCBR } case kCCBPropTypeColor3: { - ccColor3B color3B = this->parsePropTypeColor3(pNode, pParent, pCCBReader, propertyName.c_str()); + Color3B color3B = this->parsePropTypeColor3(pNode, pParent, pCCBReader, propertyName.c_str()); if(setProp) { this->onHandlePropTypeColor3(pNode, pParent, propertyName.c_str(), color3B, pCCBReader); @@ -267,7 +267,7 @@ void NodeLoader::parseProperties(Node * pNode, Node * pParent, CCBReader * pCCBR } case kCCBPropTypeColor4FVar: { - ccColor4F * color4FVar = this->parsePropTypeColor4FVar(pNode, pParent, pCCBReader); + Color4F * color4FVar = this->parsePropTypeColor4FVar(pNode, pParent, pCCBReader); if(setProp) { this->onHandlePropTypeColor4FVar(pNode, pParent, propertyName.c_str(), color4FVar, pCCBReader); @@ -285,7 +285,7 @@ void NodeLoader::parseProperties(Node * pNode, Node * pParent, CCBReader * pCCBR } case kCCBPropTypeBlendmode: { - ccBlendFunc blendFunc = this->parsePropTypeBlendFunc(pNode, pParent, pCCBReader); + BlendFunc blendFunc = this->parsePropTypeBlendFunc(pNode, pParent, pCCBReader); if(setProp) { this->onHandlePropTypeBlendFunc(pNode, pParent, propertyName.c_str(), blendFunc, pCCBReader); @@ -642,21 +642,21 @@ unsigned char NodeLoader::parsePropTypeByte(Node * pNode, Node * pParent, CCBRea return ret; } -ccColor3B NodeLoader::parsePropTypeColor3(Node * pNode, Node * pParent, CCBReader * pCCBReader, const char *pPropertyName) { +Color3B NodeLoader::parsePropTypeColor3(Node * pNode, Node * pParent, CCBReader * pCCBReader, const char *pPropertyName) { unsigned char red = pCCBReader->readByte(); unsigned char green = pCCBReader->readByte(); unsigned char blue = pCCBReader->readByte(); - ccColor3B color = { red, green, blue }; + Color3B color = { red, green, blue }; if (pCCBReader->getAnimatedProperties()->find(pPropertyName) != pCCBReader->getAnimatedProperties()->end()) { - ccColor3BWapper *value = ccColor3BWapper::create(color); + Color3BWapper *value = Color3BWapper::create(color); pCCBReader->getAnimationManager()->setBaseValue(value, pNode, pPropertyName); } return color; } -ccColor4F * NodeLoader::parsePropTypeColor4FVar(Node * pNode, Node * pParent, CCBReader * pCCBReader) { +Color4F * NodeLoader::parsePropTypeColor4FVar(Node * pNode, Node * pParent, CCBReader * pCCBReader) { float red = pCCBReader->readFloat(); float green = pCCBReader->readFloat(); float blue = pCCBReader->readFloat(); @@ -666,7 +666,7 @@ ccColor4F * NodeLoader::parsePropTypeColor4FVar(Node * pNode, Node * pParent, CC float blueVar = pCCBReader->readFloat(); float alphaVar = pCCBReader->readFloat(); - ccColor4F * colors = new ccColor4F[2]; + Color4F * colors = new Color4F[2]; colors[0].r = red; colors[0].g = green; colors[0].b = blue; @@ -691,12 +691,12 @@ bool * NodeLoader::parsePropTypeFlip(Node * pNode, Node * pParent, CCBReader * p return arr; } -ccBlendFunc NodeLoader::parsePropTypeBlendFunc(Node * pNode, Node * pParent, CCBReader * pCCBReader) +BlendFunc NodeLoader::parsePropTypeBlendFunc(Node * pNode, Node * pParent, CCBReader * pCCBReader) { int source = pCCBReader->readInt(false); int destination = pCCBReader->readInt(false); - ccBlendFunc blendFunc; + BlendFunc blendFunc; blendFunc.src = source; blendFunc.dst = destination; @@ -1056,11 +1056,11 @@ void NodeLoader::onHandlePropTypeByte(Node * pNode, Node * pParent, const char* ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName); } -void NodeLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char* pPropertyName, ccColor3B pColor3B, CCBReader * pCCBReader) { +void NodeLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char* pPropertyName, Color3B pColor3B, CCBReader * pCCBReader) { ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName); } -void NodeLoader::onHandlePropTypeColor4FVar(Node * pNode, Node * pParent, const char* pPropertyName, ccColor4F * pColor4FVar, CCBReader * pCCBReader) { +void NodeLoader::onHandlePropTypeColor4FVar(Node * pNode, Node * pParent, const char* pPropertyName, Color4F * pColor4FVar, CCBReader * pCCBReader) { ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName); } @@ -1068,7 +1068,7 @@ void NodeLoader::onHandlePropTypeFlip(Node * pNode, Node * pParent, const char* ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName); } -void NodeLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char* pPropertyName, ccBlendFunc pBlendFunc, CCBReader * pCCBReader) { +void NodeLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char* pPropertyName, BlendFunc pBlendFunc, CCBReader * pCCBReader) { ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName); } diff --git a/extensions/CCBReader/CCNodeLoader.h b/extensions/CCBReader/CCNodeLoader.h index 8e5191fee3..f9ba4f874a 100644 --- a/extensions/CCBReader/CCNodeLoader.h +++ b/extensions/CCBReader/CCNodeLoader.h @@ -72,10 +72,10 @@ class NodeLoader : public Object { virtual Animation * parsePropTypeAnimation(Node * pNode, Node * pParent, CCBReader * pCCBReader); virtual Texture2D * parsePropTypeTexture(Node * pNode, Node * pParent, CCBReader * pCCBReader); virtual unsigned char parsePropTypeByte(Node * pNode, Node * pParent, CCBReader * pCCBReader, const char *pPropertyName); - virtual ccColor3B parsePropTypeColor3(Node * pNode, Node * pParent, CCBReader * pCCBReader, const char *pPropertyName); - virtual ccColor4F * parsePropTypeColor4FVar(Node * pNode, Node * pParent, CCBReader * pCCBReader); + virtual Color3B parsePropTypeColor3(Node * pNode, Node * pParent, CCBReader * pCCBReader, const char *pPropertyName); + virtual Color4F * parsePropTypeColor4FVar(Node * pNode, Node * pParent, CCBReader * pCCBReader); virtual bool * parsePropTypeFlip(Node * pNode, Node * pParent, CCBReader * pCCBReader); - virtual ccBlendFunc parsePropTypeBlendFunc(Node * pNode, Node * pParent, CCBReader * pCCBReader); + virtual BlendFunc parsePropTypeBlendFunc(Node * pNode, Node * pParent, CCBReader * pCCBReader); virtual std::string parsePropTypeFntFile(Node * pNode, Node * pParent, CCBReader * pCCBReader); virtual std::string parsePropTypeString(Node * pNode, Node * pParent, CCBReader * pCCBReader); virtual std::string parsePropTypeText(Node * pNode, Node * pParent, CCBReader * pCCBReader); @@ -104,10 +104,10 @@ class NodeLoader : public Object { virtual void onHandlePropTypeAnimation(Node * pNode, Node * pParent, const char* pPropertyName, Animation * pAnimation, CCBReader * pCCBReader); virtual void onHandlePropTypeTexture(Node * pNode, Node * pParent, const char* pPropertyName, Texture2D * pTexture2D, CCBReader * pCCBReader); virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char* pPropertyName, unsigned char pByte, CCBReader * pCCBReader); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char* pPropertyName, ccColor3B pColor3B, CCBReader * pCCBReader); - virtual void onHandlePropTypeColor4FVar(Node * pNode, Node * pParent, const char* pPropertyName, ccColor4F * pColor4FVar, CCBReader * pCCBReader); + virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char* pPropertyName, Color3B pColor3B, CCBReader * pCCBReader); + virtual void onHandlePropTypeColor4FVar(Node * pNode, Node * pParent, const char* pPropertyName, Color4F * pColor4FVar, CCBReader * pCCBReader); virtual void onHandlePropTypeFlip(Node * pNode, Node * pParent, const char* pPropertyName, bool * pFlip, CCBReader * pCCBReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char* pPropertyName, ccBlendFunc pBlendFunc, CCBReader * pCCBReader); + virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char* pPropertyName, BlendFunc pBlendFunc, CCBReader * pCCBReader); virtual void onHandlePropTypeFntFile(Node * pNode, Node * pParent, const char* pPropertyName, const char * pFntFile, CCBReader * pCCBReader); virtual void onHandlePropTypeString(Node * pNode, Node * pParent, const char* pPropertyName, const char * pString, CCBReader * pCCBReader); virtual void onHandlePropTypeText(Node * pNode, Node * pParent, const char* pPropertyName, const char * pText, CCBReader * pCCBReader); diff --git a/extensions/CCBReader/CCParticleSystemQuadLoader.cpp b/extensions/CCBReader/CCParticleSystemQuadLoader.cpp index d162d968f3..74ed82c506 100644 --- a/extensions/CCBReader/CCParticleSystemQuadLoader.cpp +++ b/extensions/CCBReader/CCParticleSystemQuadLoader.cpp @@ -105,7 +105,7 @@ void ParticleSystemQuadLoader::onHandlePropTypeFloatVar(Node * pNode, Node * pPa } } -void ParticleSystemQuadLoader::onHandlePropTypeColor4FVar(Node * pNode, Node * pParent, const char * pPropertyName, ccColor4F * pColor4FVar, CCBReader * pCCBReader) { +void ParticleSystemQuadLoader::onHandlePropTypeColor4FVar(Node * pNode, Node * pParent, const char * pPropertyName, Color4F * pColor4FVar, CCBReader * pCCBReader) { if(strcmp(pPropertyName, PROPERTY_STARTCOLOR) == 0) { ((ParticleSystemQuad *)pNode)->setStartColor(pColor4FVar[0]); ((ParticleSystemQuad *)pNode)->setStartColorVar(pColor4FVar[1]); @@ -117,7 +117,7 @@ void ParticleSystemQuadLoader::onHandlePropTypeColor4FVar(Node * pNode, Node * p } } -void ParticleSystemQuadLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, ccBlendFunc pBlendFunc, CCBReader * pCCBReader) { +void ParticleSystemQuadLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * pCCBReader) { if(strcmp(pPropertyName, PROPERTY_BLENDFUNC) == 0) { ((ParticleSystemQuad *)pNode)->setBlendFunc(pBlendFunc); } else { diff --git a/extensions/CCBReader/CCParticleSystemQuadLoader.h b/extensions/CCBReader/CCParticleSystemQuadLoader.h index 7c209c045b..43003c2c0f 100644 --- a/extensions/CCBReader/CCParticleSystemQuadLoader.h +++ b/extensions/CCBReader/CCParticleSystemQuadLoader.h @@ -21,8 +21,8 @@ class ParticleSystemQuadLoader : public NodeLoader { virtual void onHandlePropTypeFloat(Node * pNode, Node * pParent, const char * pPropertyName, float pFloat, CCBReader * pCCBReader); virtual void onHandlePropTypeInteger(Node * pNode, Node * pParent, const char * pPropertyName, int pInteger, CCBReader * pCCBReader); virtual void onHandlePropTypeFloatVar(Node * pNode, Node * pParent, const char * pPropertyName, float * pFloatVar, CCBReader * pCCBReader); - virtual void onHandlePropTypeColor4FVar(Node * pNode, Node * pParent, const char * pPropertyName, ccColor4F * pColor4FVar, CCBReader * pCCBReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, ccBlendFunc pBlendFunc, CCBReader * pCCBReader); + virtual void onHandlePropTypeColor4FVar(Node * pNode, Node * pParent, const char * pPropertyName, Color4F * pColor4FVar, CCBReader * pCCBReader); + virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * pCCBReader); virtual void onHandlePropTypeTexture(Node * pNode, Node * pParent, const char * pPropertyName, Texture2D * pTexture2D, CCBReader * pCCBReader); }; diff --git a/extensions/CCBReader/CCScale9SpriteLoader.cpp b/extensions/CCBReader/CCScale9SpriteLoader.cpp index 2d495a6068..f7024b0042 100644 --- a/extensions/CCBReader/CCScale9SpriteLoader.cpp +++ b/extensions/CCBReader/CCScale9SpriteLoader.cpp @@ -23,7 +23,7 @@ void Scale9SpriteLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParen } } -void Scale9SpriteLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, ccColor3B pColor3B, CCBReader * pCCBReader) { +void Scale9SpriteLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * pCCBReader) { if(strcmp(pPropertyName, PROPERTY_COLOR) == 0) { ((Scale9Sprite *)pNode)->setColor(pColor3B); } else { @@ -39,7 +39,7 @@ void Scale9SpriteLoader::onHandlePropTypeByte(Node * pNode, Node * pParent, cons } } -void Scale9SpriteLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, ccBlendFunc pBlendFunc, CCBReader * pCCBReader) { +void Scale9SpriteLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * pCCBReader) { if(strcmp(pPropertyName, PROPERTY_BLENDFUNC) == 0) { // TODO Not exported by CocosBuilder yet! // ((Scale9Sprite *)pNode)->setBlendFunc(pBlendFunc); diff --git a/extensions/CCBReader/CCScale9SpriteLoader.h b/extensions/CCBReader/CCScale9SpriteLoader.h index 738389d129..8cf0dd07bd 100644 --- a/extensions/CCBReader/CCScale9SpriteLoader.h +++ b/extensions/CCBReader/CCScale9SpriteLoader.h @@ -18,9 +18,9 @@ class Scale9SpriteLoader : public NodeLoader { protected: CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Scale9Sprite); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, ccColor3B pColor3B, CCBReader * pCCBReader); + virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * pCCBReader); virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * pCCBReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, ccBlendFunc pBlendFunc, CCBReader * pCCBReader); + virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * pCCBReader); virtual void onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * pCCBReader); virtual void onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * pCCBReader); virtual void onHandlePropTypeFloat(Node * pNode, Node * pParent, const char * pPropertyName, float pFloat, CCBReader * pCCBReader); diff --git a/extensions/CCBReader/CCSpriteLoader.cpp b/extensions/CCBReader/CCSpriteLoader.cpp index 9df8f0d236..e6b447942e 100644 --- a/extensions/CCBReader/CCSpriteLoader.cpp +++ b/extensions/CCBReader/CCSpriteLoader.cpp @@ -29,7 +29,7 @@ void SpriteLoader::onHandlePropTypeFlip(Node * pNode, Node * pParent, const char } } -void SpriteLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, ccColor3B pColor3B, CCBReader * pCCBReader) { +void SpriteLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * pCCBReader) { if(strcmp(pPropertyName, PROPERTY_COLOR) == 0) { ((Sprite *)pNode)->setColor(pColor3B); } else { @@ -45,7 +45,7 @@ void SpriteLoader::onHandlePropTypeByte(Node * pNode, Node * pParent, const char } } -void SpriteLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, ccBlendFunc pBlendFunc, CCBReader * pCCBReader) { +void SpriteLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * pCCBReader) { if(strcmp(pPropertyName, PROPERTY_BLENDFUNC) == 0) { ((Sprite *)pNode)->setBlendFunc(pBlendFunc); } else { diff --git a/extensions/CCBReader/CCSpriteLoader.h b/extensions/CCBReader/CCSpriteLoader.h index 0bea3bc6f9..844ccda303 100644 --- a/extensions/CCBReader/CCSpriteLoader.h +++ b/extensions/CCBReader/CCSpriteLoader.h @@ -16,9 +16,9 @@ class SpriteLoader : public NodeLoader { protected: CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Sprite); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, ccColor3B pColor3B, CCBReader * pCCBReader); + virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * pCCBReader); virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * pCCBReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, ccBlendFunc pCCBBlendFunc, CCBReader * pCCBReader); + virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pCCBBlendFunc, CCBReader * pCCBReader); virtual void onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * pCCBReader); virtual void onHandlePropTypeFlip(Node * pNode, Node * pParent, const char * pPropertyName, bool * pFlip, CCBReader * pCCBReader); }; diff --git a/extensions/GUI/CCControlExtension/CCControlButton.cpp b/extensions/GUI/CCControlExtension/CCControlButton.cpp index b0a82282e0..d0b44a6351 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.cpp +++ b/extensions/GUI/CCControlExtension/CCControlButton.cpp @@ -44,7 +44,7 @@ enum ControlButton::ControlButton() : _currentTitle(NULL) -, _currentTitleColor(ccWHITE) +, _currentTitleColor(Color3B::white) , _doesAdjustBackgroundImage(false) , _titleLabel(NULL) , _backgroundSprite(NULL) @@ -118,7 +118,7 @@ bool ControlButton::initWithLabelAndBackgroundSprite(Node* node, Scale9Sprite* b setBackgroundSprite(backgroundSprite); // Set the default color and opacity - setColor(ccc3(255.0f, 255.0f, 255.0f)); + setColor(Color3B(255.0f, 255.0f, 255.0f)); setOpacity(255.0f); setOpacityModifyRGB(true); @@ -321,9 +321,9 @@ void ControlButton::setTitleForState(String* title, ControlState state) } -const ccColor3B ControlButton::getTitleColorForState(ControlState state) +const Color3B ControlButton::getTitleColorForState(ControlState state) { - ccColor3B returnColor = ccWHITE; + Color3B returnColor = Color3B::white; do { CC_BREAK_IF(NULL == _titleColorDispatchTable); @@ -344,9 +344,9 @@ const ccColor3B ControlButton::getTitleColorForState(ControlState state) return returnColor; } -void ControlButton::setTitleColorForState(ccColor3B color, ControlState state) +void ControlButton::setTitleColorForState(Color3B color, ControlState state) { - //ccColor3B* colorValue=&color; + //Color3B* colorValue=&color; _titleColorDispatchTable->removeObjectForKey(state); Color3bObject* pColor3bObject = new Color3bObject(color); pColor3bObject->autorelease(); @@ -729,7 +729,7 @@ GLubyte ControlButton::getOpacity() return _realOpacity; } -void ControlButton::setColor(const ccColor3B & color) +void ControlButton::setColor(const Color3B & color) { Control::setColor(color); @@ -741,7 +741,7 @@ void ControlButton::setColor(const ccColor3B & color) } } -const ccColor3B& ControlButton::getColor() +const Color3B& ControlButton::getColor() { return _realColor; } diff --git a/extensions/GUI/CCControlExtension/CCControlButton.h b/extensions/GUI/CCControlExtension/CCControlButton.h index 620ec4803a..9726a6110a 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.h +++ b/extensions/GUI/CCControlExtension/CCControlButton.h @@ -68,7 +68,7 @@ protected: CC_SYNTHESIZE_READONLY(String*, _currentTitle, CurrentTitle); /** The current color used to display the title. */ - CC_SYNTHESIZE_READONLY_PASS_BY_REF(ccColor3B, _currentTitleColor, CurrentTitleColor); + CC_SYNTHESIZE_READONLY_PASS_BY_REF(Color3B, _currentTitleColor, CurrentTitleColor); /** Adjust the background image. YES by default. If the property is set to NO, the background will use the prefered size of the background image. */ @@ -93,8 +93,8 @@ protected: /* Override setter to affect a background sprite too */ virtual GLubyte getOpacity(void); virtual void setOpacity(GLubyte var); - virtual const ccColor3B& getColor(void); - virtual void setColor(const ccColor3B&); + virtual const Color3B& getColor(void); + virtual void setColor(const Color3B&); /** Flag to know if the button is currently pushed. */ protected: @@ -170,7 +170,7 @@ public: * @return The color of the title for the specified state. */ - virtual const ccColor3B getTitleColorForState(ControlState state); + virtual const Color3B getTitleColorForState(ControlState state); /** * Sets the color of the title to use for the specified state. @@ -179,7 +179,7 @@ public: * @param state The state that uses the specified color. The values are described * in "CCControlState". */ - virtual void setTitleColorForState(ccColor3B color, ControlState state); + virtual void setTitleColorForState(Color3B color, ControlState state); /** * Returns the title label used for a state. diff --git a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp index 950628bc7b..916a431d0f 100644 --- a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp @@ -118,7 +118,7 @@ ControlColourPicker* ControlColourPicker::create() } -void ControlColourPicker::setColor(const ccColor3B& color) +void ControlColourPicker::setColor(const Color3B& color) { // XXX fixed me if not correct Control::setColor(color); @@ -169,7 +169,7 @@ void ControlColourPicker::hueSliderValueChanged(Object * sender, ControlEvent co // Update the value RGBA rgb = ControlUtils::RGBfromHSV(_hsv); // XXX fixed me if not correct - Control::setColor(ccc3((GLubyte)(rgb.r * 255.0f), (GLubyte)(rgb.g * 255.0f), (GLubyte)(rgb.b * 255.0f))); + Control::setColor(Color3B((GLubyte)(rgb.r * 255.0f), (GLubyte)(rgb.g * 255.0f), (GLubyte)(rgb.b * 255.0f))); // Send Control callback sendActionsForControlEvents(ControlEventValueChanged); @@ -185,7 +185,7 @@ void ControlColourPicker::colourSliderValueChanged(Object * sender, ControlEvent // Update the value RGBA rgb = ControlUtils::RGBfromHSV(_hsv); // XXX fixed me if not correct - Control::setColor(ccc3((GLubyte)(rgb.r * 255.0f), (GLubyte)(rgb.g * 255.0f), (GLubyte)(rgb.b * 255.0f))); + Control::setColor(Color3B((GLubyte)(rgb.r * 255.0f), (GLubyte)(rgb.g * 255.0f), (GLubyte)(rgb.b * 255.0f))); // Send Control callback sendActionsForControlEvents(ControlEventValueChanged); diff --git a/extensions/GUI/CCControlExtension/CCControlColourPicker.h b/extensions/GUI/CCControlExtension/CCControlColourPicker.h index e71caad657..9fac9f1906 100644 --- a/extensions/GUI/CCControlExtension/CCControlColourPicker.h +++ b/extensions/GUI/CCControlExtension/CCControlColourPicker.h @@ -52,7 +52,7 @@ class ControlColourPicker: public Control public: ControlColourPicker(); virtual ~ControlColourPicker(); - virtual void setColor(const ccColor3B& colorValue); + virtual void setColor(const Color3B& colorValue); virtual void setEnabled(bool bEnabled); protected: HSV _hsv; diff --git a/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp b/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp index 9c1f911b97..0861f144e6 100644 --- a/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp +++ b/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp @@ -231,7 +231,7 @@ float ControlPotentiometer::angleInDegreesBetweenLineFromPoint_toPoint_toLineFro void ControlPotentiometer::potentiometerBegan(Point location) { setSelected(true); - getThumbSprite()->setColor(ccGRAY); + getThumbSprite()->setColor(Color3B::gray); } void ControlPotentiometer::potentiometerMoved(Point location) @@ -259,7 +259,7 @@ void ControlPotentiometer::potentiometerMoved(Point location) void ControlPotentiometer::potentiometerEnded(Point location) { - getThumbSprite()->setColor(ccWHITE); + getThumbSprite()->setColor(Color3B::white); setSelected(false); } diff --git a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp index 197f13848c..d421b46183 100644 --- a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp @@ -104,7 +104,7 @@ void ControlSaturationBrightnessPicker::updateWithHSV(HSV hsv) hsvTemp.v = 1; RGBA rgb = ControlUtils::RGBfromHSV(hsvTemp); - _background->setColor(ccc3((GLubyte)(rgb.r * 255.0f), (GLubyte)(rgb.g * 255.0f), (GLubyte)(rgb.b * 255.0f))); + _background->setColor(Color3B((GLubyte)(rgb.r * 255.0f), (GLubyte)(rgb.g * 255.0f), (GLubyte)(rgb.b * 255.0f))); } void ControlSaturationBrightnessPicker::updateDraggerWithHSV(HSV hsv) diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.cpp b/extensions/GUI/CCControlExtension/CCControlSlider.cpp index 9a043480cf..14d7eb1036 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSlider.cpp @@ -249,7 +249,7 @@ void ControlSlider::needsLayout() void ControlSlider::sliderBegan(Point location) { this->setSelected(true); - this->getThumbSprite()->setColor(ccGRAY); + this->getThumbSprite()->setColor(Color3B::gray); setValue(valueForLocation(location)); } @@ -264,7 +264,7 @@ void ControlSlider::sliderEnded(Point location) { setValue(valueForLocation(_thumbSprite->getPosition())); } - this->getThumbSprite()->setColor(ccWHITE); + this->getThumbSprite()->setColor(Color3B::white); this->setSelected(false); } diff --git a/extensions/GUI/CCControlExtension/CCControlStepper.cpp b/extensions/GUI/CCControlExtension/CCControlStepper.cpp index 2e49a0ce7d..31c59cfe6b 100644 --- a/extensions/GUI/CCControlExtension/CCControlStepper.cpp +++ b/extensions/GUI/CCControlExtension/CCControlStepper.cpp @@ -29,8 +29,8 @@ NS_CC_EXT_BEGIN -#define ControlStepperLabelColorEnabled ccc3(55, 55, 55) -#define ControlStepperLabelColorDisabled ccc3(147, 147, 147) +#define ControlStepperLabelColorEnabled Color3B(55, 55, 55) +#define ControlStepperLabelColorDisabled Color3B(147, 147, 147) #define ControlStepperLabelFont "CourierNewPSMT" @@ -255,21 +255,21 @@ void ControlStepper::updateLayoutUsingTouchLocation(Point location) { _touchedPart = kControlStepperPartMinus; - _minusSprite->setColor(ccGRAY); - _plusSprite->setColor(ccWHITE); + _minusSprite->setColor(Color3B::gray); + _plusSprite->setColor(Color3B::white); } else if (location.x >= _minusSprite->getContentSize().width && _value < _maximumValue) { _touchedPart = kControlStepperPartPlus; - _minusSprite->setColor(ccWHITE); - _plusSprite->setColor(ccGRAY); + _minusSprite->setColor(Color3B::white); + _plusSprite->setColor(Color3B::gray); } else { _touchedPart = kControlStepperPartNone; - _minusSprite->setColor(ccWHITE); - _plusSprite->setColor(ccWHITE); + _minusSprite->setColor(Color3B::white); + _plusSprite->setColor(Color3B::white); } } @@ -316,8 +316,8 @@ void ControlStepper::ccTouchMoved(Touch *pTouch, Event *pEvent) _touchedPart = kControlStepperPartNone; - _minusSprite->setColor(ccWHITE); - _plusSprite->setColor(ccWHITE); + _minusSprite->setColor(Color3B::white); + _plusSprite->setColor(Color3B::white); if (_autorepeat) { @@ -328,8 +328,8 @@ void ControlStepper::ccTouchMoved(Touch *pTouch, Event *pEvent) void ControlStepper::ccTouchEnded(Touch *pTouch, Event *pEvent) { - _minusSprite->setColor(ccWHITE); - _plusSprite->setColor(ccWHITE); + _minusSprite->setColor(Color3B::white); + _plusSprite->setColor(Color3B::white); if (_autorepeat) { diff --git a/extensions/GUI/CCControlExtension/CCControlSwitch.cpp b/extensions/GUI/CCControlExtension/CCControlSwitch.cpp index d0a1959677..48f8510e22 100644 --- a/extensions/GUI/CCControlExtension/CCControlSwitch.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSwitch.cpp @@ -178,15 +178,15 @@ void ControlSwitchSprite::draw() #endif // EMSCRIPTEN // vertex - int diff = offsetof( ccV3F_C4B_T2F, vertices); + int diff = offsetof( V3F_C4B_T2F, vertices); glVertexAttribPointer(kVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, kQuadSize, (void*) (offset + diff)); // texCoods - diff = offsetof( ccV3F_C4B_T2F, texCoords); + diff = offsetof( V3F_C4B_T2F, texCoords); glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, kQuadSize, (void*)(offset + diff)); // color - diff = offsetof( ccV3F_C4B_T2F, colors); + diff = offsetof( V3F_C4B_T2F, colors); glVertexAttribPointer(kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (void*)(offset + diff)); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); @@ -400,7 +400,7 @@ bool ControlSwitch::ccTouchBegan(Touch *pTouch, Event *pEvent) _initialTouchXPosition = location.x - _switchSprite->getSliderXPosition(); - _switchSprite->getThumbSprite()->setColor(ccGRAY); + _switchSprite->getThumbSprite()->setColor(Color3B::gray); _switchSprite->needsLayout(); return true; @@ -420,7 +420,7 @@ void ControlSwitch::ccTouchEnded(Touch *pTouch, Event *pEvent) { Point location = this->locationFromTouch(pTouch); - _switchSprite->getThumbSprite()->setColor(ccWHITE); + _switchSprite->getThumbSprite()->setColor(Color3B::white); if (hasMoved()) { @@ -436,7 +436,7 @@ void ControlSwitch::ccTouchCancelled(Touch *pTouch, Event *pEvent) { Point location = this->locationFromTouch(pTouch); - _switchSprite->getThumbSprite()->setColor(ccWHITE); + _switchSprite->getThumbSprite()->setColor(Color3B::white); if (hasMoved()) { diff --git a/extensions/GUI/CCControlExtension/CCControlUtils.h b/extensions/GUI/CCControlExtension/CCControlUtils.h index 57a313489b..8f0983faf9 100644 --- a/extensions/GUI/CCControlExtension/CCControlUtils.h +++ b/extensions/GUI/CCControlExtension/CCControlUtils.h @@ -61,12 +61,12 @@ typedef struct * @{ */ -//helper class to store ccColor3B's in mutable arrays +//helper class to store Color3B's in mutable arrays class Color3bObject : public Object { public: - ccColor3B value; - Color3bObject(ccColor3B s_value):value(s_value){} + Color3B value; + Color3bObject(Color3B s_value):value(s_value){} }; class ControlUtils diff --git a/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp b/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp index f8d18c3edc..901d886879 100644 --- a/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp +++ b/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp @@ -62,7 +62,7 @@ Scale9Sprite::Scale9Sprite() , _bottomRight(NULL) , _opacityModifyRGB(false) , _opacity(255) -, _color(ccWHITE) +, _color(Color3B::white) { } @@ -112,7 +112,7 @@ bool Scale9Sprite::initWithBatchNode(SpriteBatchNode* batchnode, Rect rect, bool bool Scale9Sprite::updateWithBatchNode(SpriteBatchNode* batchnode, Rect rect, bool rotated, Rect capInsets) { GLubyte opacity = getOpacity(); - ccColor3B color = getColor(); + Color3B color = getColor(); // Release old sprites this->removeAllChildrenWithCleanup(true); @@ -790,7 +790,7 @@ void Scale9Sprite::visit() Node::visit(); } -void Scale9Sprite::setColor(const ccColor3B& color) +void Scale9Sprite::setColor(const Color3B& color) { _color = color; @@ -806,7 +806,7 @@ void Scale9Sprite::setColor(const ccColor3B& color) } } -const ccColor3B& Scale9Sprite::getColor() +const Color3B& Scale9Sprite::getColor() { return _color; } diff --git a/extensions/GUI/CCControlExtension/CCScale9Sprite.h b/extensions/GUI/CCControlExtension/CCScale9Sprite.h index de9ef8db50..431fec884f 100644 --- a/extensions/GUI/CCControlExtension/CCScale9Sprite.h +++ b/extensions/GUI/CCControlExtension/CCScale9Sprite.h @@ -98,7 +98,7 @@ protected: bool _opacityModifyRGB; GLubyte _opacity; - ccColor3B _color; + Color3B _color; void updateCapInset(); void updatePositions(); @@ -309,8 +309,8 @@ public: virtual bool isOpacityModifyRGB(void); virtual void setOpacity(GLubyte opacity); virtual GLubyte getOpacity(); - virtual void setColor(const ccColor3B& color); - virtual const ccColor3B& getColor(); + virtual void setColor(const Color3B& color); + virtual const Color3B& getColor(); virtual bool updateWithBatchNode(SpriteBatchNode* batchnode, Rect rect, bool rotated, Rect capInsets); diff --git a/extensions/GUI/CCEditBox/CCEditBox.cpp b/extensions/GUI/CCEditBox/CCEditBox.cpp index b9d4932dd5..7fa023b350 100644 --- a/extensions/GUI/CCEditBox/CCEditBox.cpp +++ b/extensions/GUI/CCEditBox/CCEditBox.cpp @@ -36,8 +36,8 @@ EditBox::EditBox(void) , _keyboardReturnType(kKeyboardReturnTypeDefault) , _fontSize(-1) , _placeholderFontSize(-1) -, _colText(ccWHITE) -, _colPlaceHolder(ccGRAY) +, _colText(Color3B::white) +, _colPlaceHolder(Color3B::gray) , _maxLength(0) , _adjustHeight(0.0f) , _scriptEditBoxHandler(0) @@ -167,7 +167,7 @@ void EditBox::setFontSize(int fontSize) } } -void EditBox::setFontColor(const ccColor3B& color) +void EditBox::setFontColor(const Color3B& color) { _colText = color; if (_editBoxImpl != NULL) @@ -207,7 +207,7 @@ void EditBox::setPlaceholderFontSize(int fontSize) } } -void EditBox::setPlaceholderFontColor(const ccColor3B& color) +void EditBox::setPlaceholderFontColor(const Color3B& color) { _colText = color; if (_editBoxImpl != NULL) diff --git a/extensions/GUI/CCEditBox/CCEditBox.h b/extensions/GUI/CCEditBox/CCEditBox.h index 40f3a2f238..71065bd8dd 100644 --- a/extensions/GUI/CCEditBox/CCEditBox.h +++ b/extensions/GUI/CCEditBox/CCEditBox.h @@ -268,7 +268,7 @@ public: /** * Set the font color of the widget's text. */ - void setFontColor(const ccColor3B& color); + void setFontColor(const Color3B& color); /** * Set the placeholder's font. @@ -293,7 +293,7 @@ public: * Set the font color of the placeholder text when the edit box is empty. * Not supported on IOS. */ - void setPlaceholderFontColor(const ccColor3B& color); + void setPlaceholderFontColor(const Color3B& color); /** * Set a text in the edit box that acts as a placeholder when an @@ -375,8 +375,8 @@ protected: int _fontSize; int _placeholderFontSize; - ccColor3B _colText; - ccColor3B _colPlaceHolder; + Color3B _colText; + Color3B _colPlaceHolder; int _maxLength; float _adjustHeight; diff --git a/extensions/GUI/CCEditBox/CCEditBoxImpl.h b/extensions/GUI/CCEditBox/CCEditBoxImpl.h index 0b0d57af0e..0cb83a847f 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImpl.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImpl.h @@ -41,9 +41,9 @@ public: virtual bool initWithSize(const Size& size) = 0; virtual void setFont(const char* pFontName, int fontSize) = 0; - virtual void setFontColor(const ccColor3B& color) = 0; + virtual void setFontColor(const Color3B& color) = 0; virtual void setPlaceholderFont(const char* pFontName, int fontSize) = 0; - virtual void setPlaceholderFontColor(const ccColor3B& color) = 0; + virtual void setPlaceholderFontColor(const Color3B& color) = 0; virtual void setInputMode(EditBoxInputMode inputMode) = 0; virtual void setInputFlag(EditBoxInputFlag inputFlag) = 0; virtual void setMaxLength(int maxLength) = 0; diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.cpp b/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.cpp index ca0df541ef..6567af9cba 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.cpp +++ b/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.cpp @@ -46,8 +46,8 @@ EditBoxImplAndroid::EditBoxImplAndroid(EditBox* pEditText) , _editBoxInputMode(kEditBoxInputModeSingleLine) , _editBoxInputFlag(kEditBoxInputFlagInitialCapsAllCharacters) , _keyboardReturnType(kKeyboardReturnTypeDefault) -, _colText(ccWHITE) -, _colPlaceHolder(ccGRAY) +, _colText(Color3B::white) +, _colPlaceHolder(Color3B::gray) , _maxLength(-1) { @@ -100,7 +100,7 @@ void EditBoxImplAndroid::setFont(const char* pFontName, int fontSize) } } -void EditBoxImplAndroid::setFontColor(const ccColor3B& color) +void EditBoxImplAndroid::setFontColor(const Color3B& color) { _colText = color; _label->setColor(color); @@ -114,7 +114,7 @@ void EditBoxImplAndroid::setPlaceholderFont(const char* pFontName, int fontSize) } } -void EditBoxImplAndroid::setPlaceholderFontColor(const ccColor3B& color) +void EditBoxImplAndroid::setPlaceholderFontColor(const Color3B& color) { _colPlaceHolder = color; _labelPlaceHolder->setColor(color); diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h b/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h index 28fac59a92..a85a6153f9 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h @@ -45,9 +45,9 @@ public: virtual bool initWithSize(const Size& size); virtual void setFont(const char* pFontName, int fontSize); - virtual void setFontColor(const ccColor3B& color); + virtual void setFontColor(const Color3B& color); virtual void setPlaceholderFont(const char* pFontName, int fontSize); - virtual void setPlaceholderFontColor(const ccColor3B& color); + virtual void setPlaceholderFontColor(const Color3B& color); virtual void setInputMode(EditBoxInputMode inputMode); virtual void setInputFlag(EditBoxInputFlag inputFlag); virtual void setMaxLength(int maxLength); @@ -78,8 +78,8 @@ private: std::string _text; std::string _placeHolder; - ccColor3B _colText; - ccColor3B _colPlaceHolder; + Color3B _colText; + Color3B _colPlaceHolder; int _maxLength; Size _editSize; diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h index 4e4ada0d3c..feaba09dc9 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h @@ -76,9 +76,9 @@ public: virtual bool initWithSize(const Size& size); virtual void setFont(const char* pFontName, int fontSize); - virtual void setFontColor(const ccColor3B& color); + virtual void setFontColor(const Color3B& color); virtual void setPlaceholderFont(const char* pFontName, int fontSize); - virtual void setPlaceholderFontColor(const ccColor3B& color); + virtual void setPlaceholderFontColor(const Color3B& color); virtual void setInputMode(EditBoxInputMode inputMode); virtual void setInputFlag(EditBoxInputFlag inputFlag); virtual void setMaxLength(int maxLength); diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm index c1bd9f77d4..28ded696fe 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm +++ b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm @@ -309,14 +309,14 @@ void EditBoxImplIOS::initInactiveLabels(const Size& size) _label = LabelTTF::create("", "", 0.0f); _label->setAnchorPoint(ccp(0, 0.5f)); - _label->setColor(ccWHITE); + _label->setColor(Color3B::white); _label->setVisible(false); _editBox->addChild(_label, kLabelZOrder); _labelPlaceHolder = LabelTTF::create("", "", 0.0f); // align the text vertically center _labelPlaceHolder->setAnchorPoint(ccp(0, 0.5f)); - _labelPlaceHolder->setColor(ccGRAY); + _labelPlaceHolder->setColor(Color3B::gray); _editBox->addChild(_labelPlaceHolder, kLabelZOrder); setFont(pDefaultFontName, size.height*2/3); @@ -378,7 +378,7 @@ void EditBoxImplIOS::setFont(const char* pFontName, int fontSize) _labelPlaceHolder->setFontSize(fontSize); } -void EditBoxImplIOS::setFontColor(const ccColor3B& color) +void EditBoxImplIOS::setFontColor(const Color3B& color) { _systemControl.textField.textColor = [UIColor colorWithRed:color.r / 255.0f green:color.g / 255.0f blue:color.b / 255.0f alpha:1.0f]; _label->setColor(color); @@ -389,7 +389,7 @@ void EditBoxImplIOS::setPlaceholderFont(const char* pFontName, int fontSize) // TODO need to be implemented. } -void EditBoxImplIOS::setPlaceholderFontColor(const ccColor3B& color) +void EditBoxImplIOS::setPlaceholderFontColor(const Color3B& color) { _labelPlaceHolder->setColor(color); } diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplMac.h b/extensions/GUI/CCEditBox/CCEditBoxImplMac.h index ee4ddbd1fd..2a037ed246 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplMac.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplMac.h @@ -75,9 +75,9 @@ public: virtual bool initWithSize(const Size& size); virtual void setFont(const char* pFontName, int fontSize); - virtual void setFontColor(const ccColor3B& color); + virtual void setFontColor(const Color3B& color); virtual void setPlaceholderFont(const char* pFontName, int fontSize); - virtual void setPlaceholderFontColor(const ccColor3B& color); + virtual void setPlaceholderFontColor(const Color3B& color); virtual void setInputMode(EditBoxInputMode inputMode); virtual void setInputFlag(EditBoxInputFlag inputFlag); virtual void setMaxLength(int maxLength); diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm b/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm index 18ddbf3c5e..1e25e5d8e7 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm +++ b/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm @@ -288,12 +288,12 @@ void EditBoxImplMac::setPlaceholderFont(const char* pFontName, int fontSize) // TODO need to be implemented. } -void EditBoxImplMac::setFontColor(const ccColor3B& color) +void EditBoxImplMac::setFontColor(const Color3B& color) { _sysEdit.textField.textColor = [NSColor colorWithCalibratedRed:color.r / 255.0f green:color.g / 255.0f blue:color.b / 255.0f alpha:1.0f]; } -void EditBoxImplMac::setPlaceholderFontColor(const ccColor3B& color) +void EditBoxImplMac::setPlaceholderFontColor(const Color3B& color) { // TODO need to be implemented. } diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplTizen.cpp b/extensions/GUI/CCEditBox/CCEditBoxImplTizen.cpp index c489af3b0e..87df3246f6 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplTizen.cpp +++ b/extensions/GUI/CCEditBox/CCEditBoxImplTizen.cpp @@ -47,8 +47,8 @@ EditBoxImplTizen::EditBoxImplTizen(EditBox* pEditText) , _editBoxInputMode(kEditBoxInputModeSingleLine) , _editBoxInputFlag(kEditBoxInputFlagInitialCapsAllCharacters) , _keyboardReturnType(kKeyboardReturnTypeDefault) -, _colText(ccWHITE) -, _colPlaceHolder(ccGRAY) +, _colText(Color3B::white) +, _colPlaceHolder(Color3B::gray) , _maxLength(-1) { } @@ -98,7 +98,7 @@ void EditBoxImplTizen::setFont(const char* pFontName, int fontSize) } } -void EditBoxImplTizen::setFontColor(const ccColor3B& color) +void EditBoxImplTizen::setFontColor(const Color3B& color) { _colText = color; _label->setColor(color); @@ -112,7 +112,7 @@ void EditBoxImplTizen::setPlaceholderFont(const char* pFontName, int fontSize) } } -void EditBoxImplTizen::setPlaceholderFontColor(const ccColor3B& color) +void EditBoxImplTizen::setPlaceholderFontColor(const Color3B& color) { _colPlaceHolder = color; _labelPlaceHolder->setColor(color); diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplTizen.h b/extensions/GUI/CCEditBox/CCEditBoxImplTizen.h index a2a4270cf2..0a69803d64 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplTizen.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplTizen.h @@ -46,9 +46,9 @@ public: virtual bool initWithSize(const Size& size); virtual void setFont(const char* pFontName, int fontSize); - virtual void setFontColor(const ccColor3B& color); + virtual void setFontColor(const Color3B& color); virtual void setPlaceholderFont(const char* pFontName, int fontSize); - virtual void setPlaceholderFontColor(const ccColor3B& color); + virtual void setPlaceholderFontColor(const Color3B& color); virtual void setInputMode(EditBoxInputMode inputMode); virtual void setInputFlag(EditBoxInputFlag inputFlag); virtual void setMaxLength(int maxLength); @@ -79,8 +79,8 @@ private: std::string _text; std::string _placeHolder; - ccColor3B _colText; - ccColor3B _colPlaceHolder; + Color3B _colText; + Color3B _colPlaceHolder; int _maxLength; Size _editSize; diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp b/extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp index 533a8d4595..b4716b417c 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp +++ b/extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp @@ -43,8 +43,8 @@ EditBoxImplWin::EditBoxImplWin(EditBox* pEditText) , _editBoxInputMode(kEditBoxInputModeSingleLine) , _editBoxInputFlag(kEditBoxInputFlagInitialCapsAllCharacters) , _keyboardReturnType(kKeyboardReturnTypeDefault) -, _colText(ccWHITE) -, _colPlaceHolder(ccGRAY) +, _colText(Color3B::white) +, _colPlaceHolder(Color3B::gray) , _maxLength(-1) { @@ -93,7 +93,7 @@ void EditBoxImplWin::setFont(const char* pFontName, int fontSize) } } -void EditBoxImplWin::setFontColor(const ccColor3B& color) +void EditBoxImplWin::setFontColor(const Color3B& color) { _colText = color; _label->setColor(color); @@ -107,7 +107,7 @@ void EditBoxImplWin::setPlaceholderFont(const char* pFontName, int fontSize) } } -void EditBoxImplWin::setPlaceholderFontColor(const ccColor3B& color) +void EditBoxImplWin::setPlaceholderFontColor(const Color3B& color) { _colPlaceHolder = color; _labelPlaceHolder->setColor(color); diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplWin.h b/extensions/GUI/CCEditBox/CCEditBoxImplWin.h index 0c0ef43795..6df1e864e1 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplWin.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplWin.h @@ -45,9 +45,9 @@ public: virtual bool initWithSize(const Size& size); virtual void setFont(const char* pFontName, int fontSize); - virtual void setFontColor(const ccColor3B& color); + virtual void setFontColor(const Color3B& color); virtual void setPlaceholderFont(const char* pFontName, int fontSize); - virtual void setPlaceholderFontColor(const ccColor3B& color); + virtual void setPlaceholderFontColor(const Color3B& color); virtual void setInputMode(EditBoxInputMode inputMode); virtual void setInputFlag(EditBoxInputFlag inputFlag); virtual void setMaxLength(int maxLength); @@ -78,8 +78,8 @@ private: std::string _text; std::string _placeHolder; - ccColor3B _colText; - ccColor3B _colPlaceHolder; + Color3B _colText; + Color3B _colPlaceHolder; int _maxLength; Size _editSize; diff --git a/extensions/physics_nodes/CCPhysicsDebugNode.cpp b/extensions/physics_nodes/CCPhysicsDebugNode.cpp index fa9e4e6607..02b569d421 100644 --- a/extensions/physics_nodes/CCPhysicsDebugNode.cpp +++ b/extensions/physics_nodes/CCPhysicsDebugNode.cpp @@ -43,19 +43,19 @@ NS_CC_EXT_BEGIN as the private API may change with little or no warning. */ -static ccColor4F ColorForBody(cpBody *body) +static Color4F ColorForBody(cpBody *body) { if (cpBodyIsRogue(body) || cpBodyIsSleeping(body)) { - return ccc4f(0.5f, 0.5f, 0.5f ,0.5f); + return Color4F(0.5f, 0.5f, 0.5f ,0.5f); } else if (body->CP_PRIVATE(node).idleTime > body->CP_PRIVATE(space)->sleepTimeThreshold) { - return ccc4f(0.33f, 0.33f, 0.33f, 0.5f); + return Color4F(0.33f, 0.33f, 0.33f, 0.5f); } else { - return ccc4f(1.0f, 0.0f, 0.0f, 0.5f); + return Color4F(1.0f, 0.0f, 0.0f, 0.5f); } } @@ -80,7 +80,7 @@ static Point* cpVertArray2ccpArrayN(const cpVect* cpVertArray, unsigned int coun static void DrawShape(cpShape *shape, DrawNode *renderer) { cpBody *body = shape->body; - ccColor4F color = ColorForBody(body); + Color4F color = ColorForBody(body); switch (shape->CP_PRIVATE(klass)->type) { @@ -102,7 +102,7 @@ static void DrawShape(cpShape *shape, DrawNode *renderer) case CP_POLY_SHAPE: { cpPolyShape *poly = (cpPolyShape *)shape; - ccColor4F line = color; + Color4F line = color; line.a = cpflerp(color.a, 1.0, 0.5); Point* pPoints = cpVertArray2ccpArrayN(poly->tVerts, poly->numVerts); renderer->drawPolygon(pPoints, poly->numVerts, color, 1.0, line); @@ -114,7 +114,7 @@ static void DrawShape(cpShape *shape, DrawNode *renderer) } } -static ccColor4F CONSTRAINT_COLOR = {0, 1, 0, 0.5}; +static Color4F CONSTRAINT_COLOR = {0, 1, 0, 0.5}; static void DrawConstraint(cpConstraint *constraint, DrawNode *renderer) { diff --git a/extensions/spine/CCSkeleton.cpp b/extensions/spine/CCSkeleton.cpp index 124209c246..72e9dfc28f 100644 --- a/extensions/spine/CCSkeleton.cpp +++ b/extensions/spine/CCSkeleton.cpp @@ -121,7 +121,7 @@ void CCSkeleton::draw () { CC_NODE_DRAW_SETUP(); ccGLBlendFunc(blendFunc.src, blendFunc.dst); - ccColor3B color = getColor(); + Color3B color = getColor(); skeleton->r = color.r / (float)255; skeleton->g = color.g / (float)255; skeleton->b = color.b / (float)255; @@ -133,7 +133,7 @@ void CCSkeleton::draw () { } TextureAtlas* textureAtlas = 0; - ccV3F_C4B_T2F_Quad quad; + V3F_C4B_T2F_Quad quad; quad.tl.vertices.z = 0; quad.tr.vertices.z = 0; quad.bl.vertices.z = 0; @@ -165,7 +165,7 @@ void CCSkeleton::draw () { ccDrawColor4B(0, 0, 255, 255); glLineWidth(1); Point points[4]; - ccV3F_C4B_T2F_Quad quad; + V3F_C4B_T2F_Quad quad; for (int i = 0, n = skeleton->slotCount; i < n; i++) { Slot* slot = skeleton->slots[i]; if (!slot->attachment || slot->attachment->type != ATTACHMENT_REGION) continue; @@ -271,12 +271,12 @@ bool CCSkeleton::setAttachment (const char* slotName, const char* attachmentName // --- BlendProtocol -const ccBlendFunc& CCSkeleton::getBlendFunc() const +const BlendFunc& CCSkeleton::getBlendFunc() const { return blendFunc; } -void CCSkeleton::setBlendFunc( const ccBlendFunc &blendFunc) { +void CCSkeleton::setBlendFunc( const BlendFunc &blendFunc) { this->blendFunc = blendFunc; } diff --git a/extensions/spine/CCSkeleton.h b/extensions/spine/CCSkeleton.h index 4715e87f3a..773fa84f82 100644 --- a/extensions/spine/CCSkeleton.h +++ b/extensions/spine/CCSkeleton.h @@ -80,7 +80,7 @@ public: bool setAttachment (const char* slotName, const char* attachmentName); // --- BlendProtocol - CC_PROPERTY_PASS_BY_REF(cocos2d::ccBlendFunc, blendFunc, BlendFunc); + CC_PROPERTY_PASS_BY_REF(cocos2d::BlendFunc, blendFunc, BlendFunc); virtual void setOpacityModifyRGB (bool value); virtual bool isOpacityModifyRGB (); diff --git a/extensions/spine/spine-cocos2dx.cpp b/extensions/spine/spine-cocos2dx.cpp index b0097e3cbd..550923b965 100644 --- a/extensions/spine/spine-cocos2dx.cpp +++ b/extensions/spine/spine-cocos2dx.cpp @@ -56,7 +56,7 @@ char* _Util_readFile (const char* path, int* length) { /**/ -void RegionAttachment_updateQuad (RegionAttachment* self, Slot* slot, ccV3F_C4B_T2F_Quad* quad, bool premultipliedAlpha) { +void RegionAttachment_updateQuad (RegionAttachment* self, Slot* slot, V3F_C4B_T2F_Quad* quad, bool premultipliedAlpha) { float vertices[8]; RegionAttachment_computeVertices(self, slot->skeleton->x, slot->skeleton->y, slot->bone, vertices); diff --git a/extensions/spine/spine-cocos2dx.h b/extensions/spine/spine-cocos2dx.h index baa42de009..234af2ecf1 100644 --- a/extensions/spine/spine-cocos2dx.h +++ b/extensions/spine/spine-cocos2dx.h @@ -33,7 +33,7 @@ namespace cocos2d { namespace extension { -void RegionAttachment_updateQuad (RegionAttachment* self, Slot* slot, cocos2d::ccV3F_C4B_T2F_Quad* quad, bool premultiplied = false); +void RegionAttachment_updateQuad (RegionAttachment* self, Slot* slot, cocos2d::V3F_C4B_T2F_Quad* quad, bool premultiplied = false); }} // namespace cocos2d { namespace extension { diff --git a/external/Box2D/Collision/Shapes/b2ChainShape.cpp b/external/Box2D/Collision/Shapes/b2ChainShape.cpp index 79b4304b5b..a7fac63c7b 100644 --- a/external/Box2D/Collision/Shapes/b2ChainShape.cpp +++ b/external/Box2D/Collision/Shapes/b2ChainShape.cpp @@ -91,7 +91,7 @@ void b2ChainShape::GetChildEdge(b2EdgeShape* edge, int32 index) const edge->m_radius = m_radius; edge->m_vertex1 = m_vertices[index + 0]; - edge->m_vertex2 = m_vertices[index + 1]; + edge->m_Vertex2F = m_vertices[index + 1]; if (index > 0) { @@ -106,13 +106,13 @@ void b2ChainShape::GetChildEdge(b2EdgeShape* edge, int32 index) const if (index < m_count - 2) { - edge->m_vertex3 = m_vertices[index + 2]; - edge->m_hasVertex3 = true; + edge->m_Vertex3F = m_vertices[index + 2]; + edge->m_hasVertex3F = true; } else { - edge->m_vertex3 = m_nextVertex; - edge->m_hasVertex3 = m_hasNextVertex; + edge->m_Vertex3F = m_nextVertex; + edge->m_hasVertex3F = m_hasNextVertex; } } @@ -138,7 +138,7 @@ bool b2ChainShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, } edgeShape.m_vertex1 = m_vertices[i1]; - edgeShape.m_vertex2 = m_vertices[i2]; + edgeShape.m_Vertex2F = m_vertices[i2]; return edgeShape.RayCast(output, input, xf, 0); } diff --git a/external/Box2D/Collision/Shapes/b2EdgeShape.cpp b/external/Box2D/Collision/Shapes/b2EdgeShape.cpp index 7b09e55bf4..5b76ffd146 100644 --- a/external/Box2D/Collision/Shapes/b2EdgeShape.cpp +++ b/external/Box2D/Collision/Shapes/b2EdgeShape.cpp @@ -23,9 +23,9 @@ using namespace std; void b2EdgeShape::Set(const b2Vec2& v1, const b2Vec2& v2) { m_vertex1 = v1; - m_vertex2 = v2; + m_Vertex2F = v2; m_hasVertex0 = false; - m_hasVertex3 = false; + m_hasVertex3F = false; } b2Shape* b2EdgeShape::Clone(b2BlockAllocator* allocator) const @@ -63,7 +63,7 @@ bool b2EdgeShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, b2Vec2 d = p2 - p1; b2Vec2 v1 = m_vertex1; - b2Vec2 v2 = m_vertex2; + b2Vec2 v2 = m_Vertex2F; b2Vec2 e = v2 - v1; b2Vec2 normal(e.y, -e.x); normal.Normalize(); @@ -119,7 +119,7 @@ void b2EdgeShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIn B2_NOT_USED(childIndex); b2Vec2 v1 = b2Mul(xf, m_vertex1); - b2Vec2 v2 = b2Mul(xf, m_vertex2); + b2Vec2 v2 = b2Mul(xf, m_Vertex2F); b2Vec2 lower = b2Min(v1, v2); b2Vec2 upper = b2Max(v1, v2); @@ -134,6 +134,6 @@ void b2EdgeShape::ComputeMass(b2MassData* massData, float32 density) const B2_NOT_USED(density); massData->mass = 0.0f; - massData->center = 0.5f * (m_vertex1 + m_vertex2); + massData->center = 0.5f * (m_vertex1 + m_Vertex2F); massData->I = 0.0f; } diff --git a/external/Box2D/Collision/Shapes/b2EdgeShape.h b/external/Box2D/Collision/Shapes/b2EdgeShape.h index 6163bcbf1c..055d10eea7 100644 --- a/external/Box2D/Collision/Shapes/b2EdgeShape.h +++ b/external/Box2D/Collision/Shapes/b2EdgeShape.h @@ -52,11 +52,11 @@ public: void ComputeMass(b2MassData* massData, float32 density) const; /// These are the edge vertices - b2Vec2 m_vertex1, m_vertex2; + b2Vec2 m_vertex1, m_Vertex2F; /// Optional adjacent vertices. These are used for smooth collision. - b2Vec2 m_vertex0, m_vertex3; - bool m_hasVertex0, m_hasVertex3; + b2Vec2 m_vertex0, m_Vertex3F; + bool m_hasVertex0, m_hasVertex3F; }; inline b2EdgeShape::b2EdgeShape() @@ -65,10 +65,10 @@ inline b2EdgeShape::b2EdgeShape() m_radius = b2_polygonRadius; m_vertex0.x = 0.0f; m_vertex0.y = 0.0f; - m_vertex3.x = 0.0f; - m_vertex3.y = 0.0f; + m_Vertex3F.x = 0.0f; + m_Vertex3F.y = 0.0f; m_hasVertex0 = false; - m_hasVertex3 = false; + m_hasVertex3F = false; } #endif diff --git a/external/Box2D/Collision/b2CollideEdge.cpp b/external/Box2D/Collision/b2CollideEdge.cpp index 7d8596a8e0..3c89d09059 100644 --- a/external/Box2D/Collision/b2CollideEdge.cpp +++ b/external/Box2D/Collision/b2CollideEdge.cpp @@ -33,7 +33,7 @@ void b2CollideEdgeAndCircle(b2Manifold* manifold, // Compute circle in frame of edge b2Vec2 Q = b2MulT(xfA, b2Mul(xfB, circleB->m_p)); - b2Vec2 A = edgeA->m_vertex1, B = edgeA->m_vertex2; + b2Vec2 A = edgeA->m_vertex1, B = edgeA->m_Vertex2F; b2Vec2 e = B - A; // Barycentric coordinates @@ -96,9 +96,9 @@ void b2CollideEdgeAndCircle(b2Manifold* manifold, } // Is there an edge connected to B? - if (edgeA->m_hasVertex3) + if (edgeA->m_hasVertex3F) { - b2Vec2 B2 = edgeA->m_vertex3; + b2Vec2 B2 = edgeA->m_Vertex3F; b2Vec2 A2 = B; b2Vec2 e2 = B2 - A2; float32 v2 = b2Dot(e2, Q - A2); @@ -236,11 +236,11 @@ void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const m_v0 = edgeA->m_vertex0; m_v1 = edgeA->m_vertex1; - m_v2 = edgeA->m_vertex2; - m_v3 = edgeA->m_vertex3; + m_v2 = edgeA->m_Vertex2F; + m_v3 = edgeA->m_Vertex3F; bool hasVertex0 = edgeA->m_hasVertex0; - bool hasVertex3 = edgeA->m_hasVertex3; + bool hasVertex3F = edgeA->m_hasVertex3F; b2Vec2 edge1 = m_v2 - m_v1; edge1.Normalize(); @@ -260,7 +260,7 @@ void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const } // Is there a following edge? - if (hasVertex3) + if (hasVertex3F) { b2Vec2 edge2 = m_v3 - m_v2; edge2.Normalize(); @@ -270,7 +270,7 @@ void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const } // Determine front or back collision. Determine collision normal limits. - if (hasVertex0 && hasVertex3) + if (hasVertex0 && hasVertex3F) { if (convex1 && convex2) { @@ -372,7 +372,7 @@ void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const } } } - else if (hasVertex3) + else if (hasVertex3F) { if (convex2) { diff --git a/external/Box2D/Dynamics/b2Fixture.cpp b/external/Box2D/Dynamics/b2Fixture.cpp index 774a78e5bb..9ada6646c9 100644 --- a/external/Box2D/Dynamics/b2Fixture.cpp +++ b/external/Box2D/Dynamics/b2Fixture.cpp @@ -255,10 +255,10 @@ void b2Fixture::Dump(int32 bodyIndex) b2Log(" shape.m_radius = %.15lef;\n", s->m_radius); b2Log(" shape.m_vertex0.Set(%.15lef, %.15lef);\n", s->m_vertex0.x, s->m_vertex0.y); b2Log(" shape.m_vertex1.Set(%.15lef, %.15lef);\n", s->m_vertex1.x, s->m_vertex1.y); - b2Log(" shape.m_vertex2.Set(%.15lef, %.15lef);\n", s->m_vertex2.x, s->m_vertex2.y); - b2Log(" shape.m_vertex3.Set(%.15lef, %.15lef);\n", s->m_vertex3.x, s->m_vertex3.y); + b2Log(" shape.m_Vertex2F.Set(%.15lef, %.15lef);\n", s->m_Vertex2F.x, s->m_Vertex2F.y); + b2Log(" shape.m_Vertex3F.Set(%.15lef, %.15lef);\n", s->m_Vertex3F.x, s->m_Vertex3F.y); b2Log(" shape.m_hasVertex0 = bool(%d);\n", s->m_hasVertex0); - b2Log(" shape.m_hasVertex3 = bool(%d);\n", s->m_hasVertex3); + b2Log(" shape.m_hasVertex3F = bool(%d);\n", s->m_hasVertex3F); } break; diff --git a/external/Box2D/Dynamics/b2World.cpp b/external/Box2D/Dynamics/b2World.cpp index 8a0aff5114..f4bab2f143 100644 --- a/external/Box2D/Dynamics/b2World.cpp +++ b/external/Box2D/Dynamics/b2World.cpp @@ -1048,7 +1048,7 @@ void b2World::DrawShape(b2Fixture* fixture, const b2Transform& xf, const b2Color { b2EdgeShape* edge = (b2EdgeShape*)fixture->GetShape(); b2Vec2 v1 = b2Mul(xf, edge->m_vertex1); - b2Vec2 v2 = b2Mul(xf, edge->m_vertex2); + b2Vec2 v2 = b2Mul(xf, edge->m_Vertex2F); m_debugDraw->DrawSegment(v1, v2, color); } break; diff --git a/external/chipmunk/src/cpBBTree.c b/external/chipmunk/src/cpBBTree.c index b1286867df..757606e797 100644 --- a/external/chipmunk/src/cpBBTree.c +++ b/external/chipmunk/src/cpBBTree.c @@ -864,17 +864,17 @@ NodeRender(Node *node, int depth) // glColor3f(1.0f - v, v, 0.0f); glLineWidth(cpfmax(5.0f - depth, 1.0f)); glBegin(GL_LINES); { - glVertex2f(bb.l, bb.b); - glVertex2f(bb.l, bb.t); + glVertex2F(bb.l, bb.b); + glVertex2F(bb.l, bb.t); - glVertex2f(bb.l, bb.t); - glVertex2f(bb.r, bb.t); + glVertex2F(bb.l, bb.t); + glVertex2F(bb.r, bb.t); - glVertex2f(bb.r, bb.t); - glVertex2f(bb.r, bb.b); + glVertex2F(bb.r, bb.t); + glVertex2F(bb.r, bb.b); - glVertex2f(bb.r, bb.b); - glVertex2f(bb.l, bb.b); + glVertex2F(bb.r, bb.b); + glVertex2F(bb.l, bb.b); }; glEnd(); } diff --git a/samples/Cpp/SimpleGame/Classes/GameOverScene.cpp b/samples/Cpp/SimpleGame/Classes/GameOverScene.cpp index e597877404..2fa8af6e82 100644 --- a/samples/Cpp/SimpleGame/Classes/GameOverScene.cpp +++ b/samples/Cpp/SimpleGame/Classes/GameOverScene.cpp @@ -56,12 +56,12 @@ GameOverScene::~GameOverScene() bool GameOverLayer::init() { - if ( LayerColor::initWithColor( ccc4(255,255,255,255) ) ) + if ( LayerColor::initWithColor( Color4B(255,255,255,255) ) ) { Size winSize = Director::sharedDirector()->getWinSize(); this->_label = LabelTTF::create("","Artial", 32); _label->retain(); - _label->setColor( ccc3(0, 0, 0) ); + _label->setColor( Color3B(0, 0, 0) ); _label->setPosition( ccp(winSize.width/2, winSize.height/2) ); this->addChild(_label); diff --git a/samples/Cpp/SimpleGame/Classes/HelloWorldScene.cpp b/samples/Cpp/SimpleGame/Classes/HelloWorldScene.cpp index fba75a33e8..3a68cfcee0 100644 --- a/samples/Cpp/SimpleGame/Classes/HelloWorldScene.cpp +++ b/samples/Cpp/SimpleGame/Classes/HelloWorldScene.cpp @@ -60,7 +60,7 @@ bool HelloWorld::init() // super init first ////////////////////////////////////////////////////////////////////////// - CC_BREAK_IF(! LayerColor::initWithColor( ccc4(255,255,255,255) ) ); + CC_BREAK_IF(! LayerColor::initWithColor( Color4B(255,255,255,255) ) ); ////////////////////////////////////////////////////////////////////////// // add your codes below... diff --git a/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp b/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp index 6c8812bfdc..b6a5e9384d 100644 --- a/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp @@ -92,7 +92,7 @@ void SpriteDemo::onEnter() { BaseTest::onEnter(); - LayerColor *background = LayerColor::create(ccc4(255,0,0,255)); + LayerColor *background = LayerColor::create(Color4B(255,0,0,255)); addChild(background, -10); } diff --git a/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.cpp b/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.cpp index 749e455690..7e483fb4cb 100644 --- a/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.cpp @@ -238,10 +238,10 @@ void ActionManual::onEnter() _grossini->setRotation( 120); _grossini->setPosition( ccp(s.width/2, s.height/2)); - _grossini->setColor( ccc3( 255,0,0)); + _grossini->setColor( Color3B( 255,0,0)); _kathia->setPosition( ccp(s.width-100, s.height/2)); - _kathia->setColor( ccBLUE); + _kathia->setColor( Color3B::blue); } std::string ActionManual::subtitle() @@ -368,7 +368,7 @@ void ActionRotationalSkewVSStandardSkew::onEnter() Size boxSize(100.0f, 100.0f); - auto box = LayerColor::create(ccc4(255,255,0,255)); + auto box = LayerColor::create(Color4B(255,255,0,255)); box->setAnchorPoint(ccp(0.5,0.5)); box->setContentSize( boxSize ); box->ignoreAnchorPointForPosition(false); @@ -384,7 +384,7 @@ void ActionRotationalSkewVSStandardSkew::onEnter() box->runAction(Sequence::create(actionTo, actionToBack, NULL)); - box = LayerColor::create(ccc4(255,255,0,255)); + box = LayerColor::create(Color4B(255,255,0,255)); box->setAnchorPoint(ccp(0.5,0.5)); box->setContentSize(boxSize); box->ignoreAnchorPointForPosition(false); @@ -414,19 +414,19 @@ void ActionSkewRotateScale::onEnter() Size boxSize(100.0f, 100.0f); - auto box = LayerColor::create(ccc4(255, 255, 0, 255)); + auto box = LayerColor::create(Color4B(255, 255, 0, 255)); box->setAnchorPoint(ccp(0, 0)); box->setPosition(ccp(190, 110)); box->setContentSize(boxSize); static float markrside = 10.0f; - auto uL = LayerColor::create(ccc4(255, 0, 0, 255)); + auto uL = LayerColor::create(Color4B(255, 0, 0, 255)); box->addChild(uL); uL->setContentSize(CCSizeMake(markrside, markrside)); uL->setPosition(ccp(0.f, boxSize.height - markrside)); uL->setAnchorPoint(ccp(0, 0)); - auto uR = LayerColor::create(ccc4(0, 0, 255, 255)); + auto uR = LayerColor::create(Color4B(0, 0, 255, 255)); box->addChild(uR); uR->setContentSize(CCSizeMake(markrside, markrside)); uR->setPosition(ccp(boxSize.width - markrside, boxSize.height - markrside)); diff --git a/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp b/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp index b37f6546d9..680d9d9036 100644 --- a/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp +++ b/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp @@ -39,7 +39,7 @@ Box2DTestLayer::Box2DTestLayer() LabelTTF *label = LabelTTF::create("Tap screen", "Marker Felt", 32); addChild(label, 0); - label->setColor(ccc3(0,0,255)); + label->setColor(Color3B(0,0,255)); label->setPosition(ccp( VisibleRect::center().x, VisibleRect::top().y-50)); scheduleUpdate(); diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/DumpShell.h b/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/DumpShell.h index c87a9ca33a..6e3039842d 100644 --- a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/DumpShell.h +++ b/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/DumpShell.h @@ -140,10 +140,10 @@ b2Joint** joints = (b2Joint**)b2Alloc(2 * sizeof(b2Joint*)); shape.m_radius = 9.999999776482582e-03f; shape.m_vertex0.Set(0.000000000000000e+00f, 0.000000000000000e+00f); shape.m_vertex1.Set(4.452173995971680e+01f, 1.669565200805664e+01f); - shape.m_vertex2.Set(4.452173995971680e+01f, 0.000000000000000e+00f); - shape.m_vertex3.Set(0.000000000000000e+00f, 0.000000000000000e+00f); + shape.m_Vertex2F.Set(4.452173995971680e+01f, 0.000000000000000e+00f); + shape.m_Vertex3F.Set(0.000000000000000e+00f, 0.000000000000000e+00f); shape.m_hasVertex0 = bool(0); - shape.m_hasVertex3 = bool(0); + shape.m_hasVertex3F = bool(0); fd.shape = &shape; @@ -162,10 +162,10 @@ b2Joint** joints = (b2Joint**)b2Alloc(2 * sizeof(b2Joint*)); shape.m_radius = 9.999999776482582e-03f; shape.m_vertex0.Set(0.000000000000000e+00f, 0.000000000000000e+00f); shape.m_vertex1.Set(0.000000000000000e+00f, 1.669565200805664e+01f); - shape.m_vertex2.Set(0.000000000000000e+00f, 0.000000000000000e+00f); - shape.m_vertex3.Set(0.000000000000000e+00f, 0.000000000000000e+00f); + shape.m_Vertex2F.Set(0.000000000000000e+00f, 0.000000000000000e+00f); + shape.m_Vertex3F.Set(0.000000000000000e+00f, 0.000000000000000e+00f); shape.m_hasVertex0 = bool(0); - shape.m_hasVertex3 = bool(0); + shape.m_hasVertex3F = bool(0); fd.shape = &shape; @@ -184,10 +184,10 @@ b2Joint** joints = (b2Joint**)b2Alloc(2 * sizeof(b2Joint*)); shape.m_radius = 9.999999776482582e-03f; shape.m_vertex0.Set(0.000000000000000e+00f, 0.000000000000000e+00f); shape.m_vertex1.Set(0.000000000000000e+00f, 1.669565200805664e+01f); - shape.m_vertex2.Set(4.452173995971680e+01f, 1.669565200805664e+01f); - shape.m_vertex3.Set(0.000000000000000e+00f, 0.000000000000000e+00f); + shape.m_Vertex2F.Set(4.452173995971680e+01f, 1.669565200805664e+01f); + shape.m_Vertex3F.Set(0.000000000000000e+00f, 0.000000000000000e+00f); shape.m_hasVertex0 = bool(0); - shape.m_hasVertex3 = bool(0); + shape.m_hasVertex3F = bool(0); fd.shape = &shape; @@ -206,10 +206,10 @@ b2Joint** joints = (b2Joint**)b2Alloc(2 * sizeof(b2Joint*)); shape.m_radius = 9.999999776482582e-03f; shape.m_vertex0.Set(0.000000000000000e+00f, 0.000000000000000e+00f); shape.m_vertex1.Set(0.000000000000000e+00f, 0.000000000000000e+00f); - shape.m_vertex2.Set(4.452173995971680e+01f, 0.000000000000000e+00f); - shape.m_vertex3.Set(0.000000000000000e+00f, 0.000000000000000e+00f); + shape.m_Vertex2F.Set(4.452173995971680e+01f, 0.000000000000000e+00f); + shape.m_Vertex3F.Set(0.000000000000000e+00f, 0.000000000000000e+00f); shape.m_hasVertex0 = bool(0); - shape.m_hasVertex3 = bool(0); + shape.m_hasVertex3F = bool(0); fd.shape = &shape; diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/EdgeTest.h b/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/EdgeTest.h index c5306beaba..12e4855fee 100644 --- a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/EdgeTest.h +++ b/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/EdgeTest.h @@ -35,36 +35,36 @@ public: b2EdgeShape shape; shape.Set(v1, v2); - shape.m_hasVertex3 = true; - shape.m_vertex3 = v3; + shape.m_hasVertex3F = true; + shape.m_Vertex3F = v3; ground->CreateFixture(&shape, 0.0f); shape.Set(v2, v3); shape.m_hasVertex0 = true; - shape.m_hasVertex3 = true; + shape.m_hasVertex3F = true; shape.m_vertex0 = v1; - shape.m_vertex3 = v4; + shape.m_Vertex3F = v4; ground->CreateFixture(&shape, 0.0f); shape.Set(v3, v4); shape.m_hasVertex0 = true; - shape.m_hasVertex3 = true; + shape.m_hasVertex3F = true; shape.m_vertex0 = v2; - shape.m_vertex3 = v5; + shape.m_Vertex3F = v5; ground->CreateFixture(&shape, 0.0f); shape.Set(v4, v5); shape.m_hasVertex0 = true; - shape.m_hasVertex3 = true; + shape.m_hasVertex3F = true; shape.m_vertex0 = v3; - shape.m_vertex3 = v6; + shape.m_Vertex3F = v6; ground->CreateFixture(&shape, 0.0f); shape.Set(v5, v6); shape.m_hasVertex0 = true; - shape.m_hasVertex3 = true; + shape.m_hasVertex3F = true; shape.m_vertex0 = v4; - shape.m_vertex3 = v7; + shape.m_Vertex3F = v7; ground->CreateFixture(&shape, 0.0f); shape.Set(v6, v7); diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.cpp b/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.cpp index c491c0b5d1..002dd639a2 100644 --- a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.cpp +++ b/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.cpp @@ -25,10 +25,10 @@ bool Bug1159Layer::init() Director::sharedDirector()->setDepthTest(true); Size s = Director::sharedDirector()->getWinSize(); - LayerColor *background = LayerColor::create(ccc4(255, 0, 255, 255)); + LayerColor *background = LayerColor::create(Color4B(255, 0, 255, 255)); addChild(background); - LayerColor *sprite_a = LayerColor::create(ccc4(255, 0, 0, 255), 700, 700); + LayerColor *sprite_a = LayerColor::create(Color4B(255, 0, 0, 255), 700, 700); sprite_a->setAnchorPoint(ccp(0.5f, 0.5f)); sprite_a->ignoreAnchorPointForPosition(false); sprite_a->setPosition(ccp(0.0f, s.height/2)); @@ -39,7 +39,7 @@ bool Bug1159Layer::init() MoveTo::create(1.0f, ccp(0.0f, 384.0f)), NULL))); - LayerColor *sprite_b = LayerColor::create(ccc4(0, 0, 255, 255), 400, 400); + LayerColor *sprite_b = LayerColor::create(Color4B(0, 0, 255, 255), 400, 400); sprite_b->setAnchorPoint(ccp(0.5f, 0.5f)); sprite_b->ignoreAnchorPointForPosition(false); sprite_b->setPosition(ccp(s.width/2, s.height/2)); diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-458/Bug-458.cpp b/samples/Cpp/TestCpp/Classes/BugsTest/Bug-458/Bug-458.cpp index 2c8ba05b46..a42cf0d0eb 100644 --- a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-458/Bug-458.cpp +++ b/samples/Cpp/TestCpp/Classes/BugsTest/Bug-458/Bug-458.cpp @@ -22,11 +22,11 @@ bool Bug458Layer::init() // [question2 setContentSize:CGSizeMake(50,50)]; MenuItemSprite* sprite = MenuItemSprite::create(question2, question, CC_CALLBACK_1(Bug458Layer::selectAnswer, this) ); - LayerColor* layer = LayerColor::create(ccc4(0,0,255,255), 100, 100); + LayerColor* layer = LayerColor::create(Color4B(0,0,255,255), 100, 100); question->release(); question2->release(); - LayerColor* layer2 = LayerColor::create(ccc4(255,0,0,255), 100, 100); + LayerColor* layer2 = LayerColor::create(Color4B(255,0,0,255), 100, 100); MenuItemSprite* sprite2 = MenuItemSprite::create(layer, layer2, CC_CALLBACK_1(Bug458Layer::selectAnswer, this) ); Menu* menu = Menu::create(sprite, sprite2, NULL); menu->alignItemsVerticallyWithPadding(100); diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp b/samples/Cpp/TestCpp/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp index b3f37bbdc8..414e79481e 100644 --- a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp +++ b/samples/Cpp/TestCpp/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp @@ -18,7 +18,7 @@ bool QuestionContainerSprite::init() int width = size.width * 0.9f - (corner->getContentSize().width * 2); int height = size.height * 0.15f - (corner->getContentSize().height * 2); - LayerColor* layer = LayerColor::create(ccc4(255, 255, 255, 255 * .75), width, height); + LayerColor* layer = LayerColor::create(Color4B(255, 255, 255, 255 * .75), width, height); layer->setPosition(ccp(-width / 2, -height / 2)); //First button is blue, @@ -27,11 +27,11 @@ bool QuestionContainerSprite::init() static int a = 0; if (a == 0) - label->setColor(ccBLUE); + label->setColor(Color3B::blue); else { CCLog("Color changed"); - label->setColor(ccRED); + label->setColor(Color3B::red); } a++; addChild(layer); diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-624.cpp b/samples/Cpp/TestCpp/Classes/BugsTest/Bug-624.cpp index e2bfa02c82..d1fb1d29cb 100644 --- a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-624.cpp +++ b/samples/Cpp/TestCpp/Classes/BugsTest/Bug-624.cpp @@ -34,7 +34,7 @@ void Bug624Layer::switchLayer(float dt) Scene *scene = Scene::create(); scene->addChild(Bug624Layer2::create(), 0); - Director::sharedDirector()->replaceScene(TransitionFade::create(2.0f, scene, ccWHITE)); + Director::sharedDirector()->replaceScene(TransitionFade::create(2.0f, scene, Color3B::white)); } void Bug624Layer::didAccelerate(Acceleration* acceleration) @@ -71,7 +71,7 @@ void Bug624Layer2::switchLayer(float dt) Scene *scene = Scene::create(); scene->addChild(Bug624Layer::create(), 0); - Director::sharedDirector()->replaceScene(TransitionFade::create(2.0f, scene, ccRED)); + Director::sharedDirector()->replaceScene(TransitionFade::create(2.0f, scene, Color3B::red)); } void Bug624Layer2::didAccelerate(Acceleration* acceleration) diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-914.cpp b/samples/Cpp/TestCpp/Classes/BugsTest/Bug-914.cpp index 47f1f46722..a1199ebcbd 100644 --- a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-914.cpp +++ b/samples/Cpp/TestCpp/Classes/BugsTest/Bug-914.cpp @@ -36,7 +36,7 @@ bool Bug914Layer::init() LayerColor *layer; for( int i=0;i < 5;i++) { - layer = LayerColor::create(ccc4(i*20, i*20, i*20,255)); + layer = LayerColor::create(Color4B(i*20, i*20, i*20,255)); layer->setContentSize(CCSizeMake(i*100, i*100)); layer->setPosition(ccp(size.width/2, size.height/2)); layer->setAnchorPoint(ccp(0.5f, 0.5f)); diff --git a/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp b/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp index f7c8cead11..1b8c65bce2 100644 --- a/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp @@ -21,7 +21,7 @@ MainLayer::MainLayer() Sprite* sprite = Sprite::create(s_pPathGrossini); - Layer* layer = LayerColor::create(ccc4(255,255,0,255)); + Layer* layer = LayerColor::create(Color4B(255,255,0,255)); addChild(layer, -1); addChild(sprite, 0, kTagSprite); diff --git a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp b/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp index dc709aaeca..eb862c1f21 100644 --- a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp @@ -201,7 +201,7 @@ DrawNode* BasicTest::shape() triangle[1] = ccp(100, -100); triangle[2] = ccp(0, 100); - static ccColor4F green = {0, 1, 0, 1}; + static Color4F green = {0, 1, 0, 1}; shape->drawPolygon(triangle, 3, green, 0, green); return shape; } @@ -514,7 +514,7 @@ void ScrollViewDemo::setup() rectangle[2] = ccp(clipper->getContentSize().width, clipper->getContentSize().height); rectangle[3] = ccp(0, clipper->getContentSize().height); - ccColor4F white = {1, 1, 1, 1}; + Color4F white = {1, 1, 1, 1}; stencil->drawPolygon(rectangle, 4, white, 1, white); clipper->setStencil(stencil); @@ -566,7 +566,7 @@ static GLint _stencilBits = -1; static const GLfloat _alphaThreshold = 0.05f; static const int _planeCount = 8; -static const ccColor4F _planeColor[] = { +static const Color4F _planeColor[] = { {0, 0, 0, 0.65f}, {0.7f, 0, 0, 0.6f}, {0, 0.7f, 0, 0.55f}, @@ -627,7 +627,7 @@ void RawStencilBufferTest::draw() this->setupStencilForClippingOnPlane(i); CHECK_GL_ERROR_DEBUG(); - ccDrawSolidRect(PointZero, stencilPoint, ccc4f(1, 1, 1, 1)); + ccDrawSolidRect(PointZero, stencilPoint, Color4F(1, 1, 1, 1)); kmGLPushMatrix(); this->transform(); @@ -813,7 +813,7 @@ void RawStencilBufferTest6::setupStencilForClippingOnPlane(GLint plane) glStencilMask(planeMask); glStencilFunc(GL_NEVER, 0, planeMask); glStencilOp(GL_REPLACE, GL_KEEP, GL_KEEP); - ccDrawSolidRect(PointZero, ccpFromSize(Director::sharedDirector()->getWinSize()), ccc4f(1, 1, 1, 1)); + ccDrawSolidRect(PointZero, ccpFromSize(Director::sharedDirector()->getWinSize()), Color4F(1, 1, 1, 1)); glStencilFunc(GL_NEVER, planeMask, planeMask); glStencilOp(GL_REPLACE, GL_KEEP, GL_KEEP); glDisable(GL_DEPTH_TEST); diff --git a/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp b/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp index bd35b80d5c..6e88f78420 100644 --- a/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp +++ b/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp @@ -190,7 +190,7 @@ void DrawPrimitivesTest::draw() // filled poly glLineWidth(1); Point filledVertices[] = { ccp(0,120), ccp(50,120), ccp(50,170), ccp(25,200), ccp(0,170) }; - ccDrawSolidPoly(filledVertices, 5, ccc4f(0.5f, 0.5f, 1, 1 ) ); + ccDrawSolidPoly(filledVertices, 5, Color4F(0.5f, 0.5f, 1, 1 ) ); // closed purble poly @@ -213,7 +213,7 @@ void DrawPrimitivesTest::draw() //draw a solid polygon Point vertices3[] = {ccp(60,160), ccp(70,190), ccp(100,190), ccp(90,160)}; - ccDrawSolidPoly( vertices3, 4, ccc4f(1,1,0,1) ); + ccDrawSolidPoly( vertices3, 4, Color4F(1,1,0,1) ); // restore original values glLineWidth(1); @@ -244,12 +244,12 @@ DrawNodeTest::DrawNodeTest() // Draw 10 circles for( int i=0; i < 10; i++) { - draw->drawDot(ccp(s.width/2, s.height/2), 10*(10-i), ccc4f(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1)); + draw->drawDot(ccp(s.width/2, s.height/2), 10*(10-i), Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1)); } // Draw polygons Point points[] = { Point(s.height/4,0), Point(s.width,s.height/5), Point(s.width/3*2,s.height) }; - draw->drawPolygon(points, sizeof(points)/sizeof(points[0]), ccc4f(1,0,0,0.5), 4, ccc4f(0,0,1,1)); + draw->drawPolygon(points, sizeof(points)/sizeof(points[0]), Color4F(1,0,0,0.5), 4, Color4F(0,0,1,1)); // star poly (triggers buggs) { @@ -263,7 +263,7 @@ DrawNodeTest::DrawNodeTest() // {o -h, o+w}, {o,o}, // left spike }; - draw->drawPolygon(star, sizeof(star)/sizeof(star[0]), ccc4f(1,0,0,0.5), 1, ccc4f(0,0,1,1)); + draw->drawPolygon(star, sizeof(star)/sizeof(star[0]), Color4F(1,0,0,0.5), 1, Color4F(0,0,1,1)); } // star poly (doesn't trigger bug... order is important un tesselation is supported. @@ -278,14 +278,14 @@ DrawNodeTest::DrawNodeTest() Point(o -h, o+w), // left spike }; - draw->drawPolygon(star, sizeof(star)/sizeof(star[0]), ccc4f(1,0,0,0.5), 1, ccc4f(0,0,1,1)); + draw->drawPolygon(star, sizeof(star)/sizeof(star[0]), Color4F(1,0,0,0.5), 1, Color4F(0,0,1,1)); } // Draw segment - draw->drawSegment(ccp(20,s.height), ccp(20,s.height/2), 10, ccc4f(0, 1, 0, 1)); + draw->drawSegment(ccp(20,s.height), ccp(20,s.height/2), 10, Color4F(0, 1, 0, 1)); - draw->drawSegment(ccp(10,s.height/2), ccp(s.width/2, s.height/2), 40, ccc4f(1, 0, 1, 0.5)); + draw->drawSegment(ccp(10,s.height/2), ccp(s.width/2, s.height/2), 40, Color4F(1, 0, 1, 0.5)); } string DrawNodeTest::title() diff --git a/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp b/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp index 311dcb073a..5772681074 100644 --- a/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp +++ b/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp @@ -234,17 +234,17 @@ void Issue631::onEnter() removeChild(bg, true); // background - LayerColor* layer = LayerColor::create( ccc4(255,0,0,255) ); + LayerColor* layer = LayerColor::create( Color4B(255,0,0,255) ); addChild(layer, -10); Sprite* sprite = Sprite::create("Images/grossini.png"); sprite->setPosition( ccp(50,80) ); layer->addChild(sprite, 10); // foreground - LayerColor* layer2 = LayerColor::create(ccc4( 0, 255,0,255 ) ); + LayerColor* layer2 = LayerColor::create(Color4B( 0, 255,0,255 ) ); Sprite* fog = Sprite::create("Images/Fog.png"); - ccBlendFunc bf = {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}; + BlendFunc bf = {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}; fog->setBlendFunc(bf); layer2->addChild(fog, 1); addChild(layer2, 1); diff --git a/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.cpp b/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.cpp index f5879563bb..1243369fa3 100644 --- a/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.cpp +++ b/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.cpp @@ -339,7 +339,7 @@ void EffectTestScene::runThisTest() TextLayer::TextLayer(void) : BaseTest() { - LayerColor *background = LayerColor::create( ccc4(32,128,32,255) ); + LayerColor *background = LayerColor::create( Color4B(32,128,32,255) ); this->addChild(background,-20); Node* node = Node::create(); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp index 012e576f4f..a0d7c357fe 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp @@ -127,7 +127,7 @@ void ArmatureTestLayer::onEnter() std::string str = title(); const char * pTitle = str.c_str(); LabelTTF* label = LabelTTF::create(pTitle, "Arial", 18); - label->setColor(ccc3(0, 0, 0)); + label->setColor(Color3B(0, 0, 0)); addChild(label, 1, 10000); label->setPosition( ccp(VisibleRect::center().x, VisibleRect::top().y - 30) ); @@ -135,7 +135,7 @@ void ArmatureTestLayer::onEnter() if( ! strSubtitle.empty() ) { LabelTTF* l = LabelTTF::create(strSubtitle.c_str(), "Arial", 18); - l->setColor(ccc3(0, 0, 0)); + l->setColor(Color3B(0, 0, 0)); addChild(l, 1, 10001); l->setPosition( ccp(VisibleRect::center().x, VisibleRect::top().y - 60) ); } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp index 8e47433912..87f5ae626b 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp @@ -52,7 +52,7 @@ void HelloCocosBuilderLayer::openTest(const char * pCCBFileName, const char * pN } /* Push the new scene with a fancy transition. */ - ccColor3B transitionColor; + Color3B transitionColor; transitionColor.r = 0; transitionColor.g = 0; transitionColor.b = 0; @@ -168,7 +168,7 @@ void HelloCocosBuilderLayer::onAnimationsTestClicked(Object * pSender, cocos2d:: } /* Push the new scene with a fancy transition. */ - ccColor3B transitionColor; + Color3B transitionColor; transitionColor.r = 0; transitionColor.g = 0; transitionColor.b = 0; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/ComponentsTestScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/ComponentsTestScene.cpp index 3d14ecd3fc..6366d7b84d 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/ComponentsTestScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/ComponentsTestScene.cpp @@ -43,7 +43,7 @@ bool ComponentsTestLayer::init() bool bRet = false; do { - CC_BREAK_IF(! LayerColor::initWithColor( ccc4(255,255,255,255) ) ); + CC_BREAK_IF(! LayerColor::initWithColor( Color4B(255,255,255,255) ) ); Node *root = createGameScene(); CC_BREAK_IF(!root); @@ -86,7 +86,7 @@ cocos2d::Node* ComponentsTestLayer::createGameScene() pScene->release(); }); - itemBack->setColor(ccc3(0, 0, 0)); + itemBack->setColor(Color3B(0, 0, 0)); itemBack->setPosition(ccp(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); Menu *menuBack = Menu::create(itemBack, NULL); menuBack->setPosition(PointZero); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/GameOverScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/GameOverScene.cpp index d29deeabe5..32a06a6351 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/GameOverScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/GameOverScene.cpp @@ -57,12 +57,12 @@ GameOverScene::~GameOverScene() bool GameOverLayer::init() { - if ( LayerColor::initWithColor( ccc4(255,255,255,255) ) ) + if ( LayerColor::initWithColor( Color4B(255,255,255,255) ) ) { Size winSize = Director::sharedDirector()->getWinSize(); this->_label = LabelTTF::create("","Artial", 32); _label->retain(); - _label->setColor( ccc3(0, 0, 0) ); + _label->setColor( Color3B(0, 0, 0) ); _label->setPosition( ccp(winSize.width/2, winSize.height/2) ); this->addChild(_label); @@ -79,7 +79,7 @@ bool GameOverLayer::init() pScene->release(); }); - itemBack->setColor(ccc3(0, 0, 0)); + itemBack->setColor(Color3B(0, 0, 0)); itemBack->setPosition(ccp(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); Menu *menuBack = Menu::create(itemBack, NULL); menuBack->setPosition(PointZero); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp index eb1521a913..c06428fa2f 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp @@ -55,17 +55,17 @@ bool ControlButtonTest_HelloVariableSize::init() if (i == 0) { button->setOpacity(50); - button->setColor(ccc3(0, 255, 0)); + button->setColor(Color3B(0, 255, 0)); } else if (i == 1) { button->setOpacity(200); - button->setColor(ccc3(0, 255, 0)); + button->setColor(Color3B(0, 255, 0)); } else if (i == 2) { button->setOpacity(100); - button->setColor(ccc3(0, 0, 255)); + button->setColor(Color3B(0, 0, 255)); } button->setPosition(ccp (total_width + button->getContentSize().width / 2, button->getContentSize().height / 2)); @@ -99,11 +99,11 @@ ControlButton *ControlButtonTest_HelloVariableSize::standardButtonWithTitle(cons LabelTTF *titleButton = LabelTTF::create(title, "Marker Felt", 30); - titleButton->setColor(ccc3(159, 168, 176)); + titleButton->setColor(Color3B(159, 168, 176)); ControlButton *button = ControlButton::create(titleButton, backgroundButton); button->setBackgroundSpriteForState(backgroundHighlightedButton, ControlStateHighlighted); - button->setTitleColorForState(ccWHITE, ControlStateHighlighted); + button->setTitleColorForState(Color3B::white, ControlStateHighlighted); return button; } @@ -137,11 +137,11 @@ bool ControlButtonTest_Event::init() LabelTTF *titleButton = LabelTTF::create("Touch Me!", "Marker Felt", 30); - titleButton->setColor(ccc3(159, 168, 176)); + titleButton->setColor(Color3B(159, 168, 176)); ControlButton *controlButton = ControlButton::create(titleButton, backgroundButton); controlButton->setBackgroundSpriteForState(backgroundHighlightedButton, ControlStateHighlighted); - controlButton->setTitleColorForState(ccWHITE, ControlStateHighlighted); + controlButton->setTitleColorForState(Color3B::white, ControlStateHighlighted); controlButton->setAnchorPoint(ccp(0.5f, 1)); controlButton->setPosition(ccp(screenSize.width / 2.0f, screenSize.height / 2.0f)); @@ -266,11 +266,11 @@ ControlButton *ControlButtonTest_Styling::standardButtonWithTitle(const char *ti LabelTTF *titleButton = LabelTTF::create(title, "Marker Felt", 30); - titleButton->setColor(ccc3(159, 168, 176)); + titleButton->setColor(Color3B(159, 168, 176)); ControlButton *button = ControlButton::create(titleButton, backgroundButton); button->setBackgroundSpriteForState(backgroundHighlightedButton, ControlStateHighlighted); - button->setTitleColorForState(ccWHITE, ControlStateHighlighted); + button->setTitleColorForState(Color3B::white, ControlStateHighlighted); return button; } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp index 2669a0ab3f..958ad5cbfe 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp @@ -46,7 +46,7 @@ bool ControlColourPickerTest::init() // Create the colour picker ControlColourPicker *colourPicker = ControlColourPicker::create(); - colourPicker->setColor(ccc3(37, 46, 252)); + colourPicker->setColor(Color3B(37, 46, 252)); colourPicker->setPosition(ccp (colourPicker->getContentSize().width / 2, 0)); // Add it to the layer diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp index 2bec915052..674b0b4f54 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp @@ -44,9 +44,9 @@ EditBoxTest::EditBoxTest() _editName->setFontName("fonts/Paint Boy.ttf"); #endif _editName->setFontSize(25); - _editName->setFontColor(ccRED); + _editName->setFontColor(Color3B::red); _editName->setPlaceHolder("Name:"); - _editName->setPlaceholderFontColor(ccWHITE); + _editName->setPlaceholderFontColor(Color3B::white); _editName->setMaxLength(8); _editName->setReturnType(kKeyboardReturnTypeDone); _editName->setDelegate(this); @@ -60,7 +60,7 @@ EditBoxTest::EditBoxTest() #else _editPassword->setFont("fonts/American Typewriter.ttf", 30); #endif - _editPassword->setFontColor(ccGREEN); + _editPassword->setFontColor(Color3B::green); _editPassword->setPlaceHolder("Password:"); _editPassword->setMaxLength(6); _editPassword->setInputFlag(kEditBoxInputFlagPassword); diff --git a/samples/Cpp/TestCpp/Classes/FontTest/FontTest.cpp b/samples/Cpp/TestCpp/Classes/FontTest/FontTest.cpp index 9b385f7cd6..ed4f718a11 100644 --- a/samples/Cpp/TestCpp/Classes/FontTest/FontTest.cpp +++ b/samples/Cpp/TestCpp/Classes/FontTest/FontTest.cpp @@ -105,9 +105,9 @@ void FontTest::showFont(const char *pFont) LabelTTF *right = LabelTTF::create("alignment right", pFont, fontSize, blockSize, kTextAlignmentRight, verticalAlignment[vAlignIdx]); - LayerColor *leftColor = LayerColor::create(ccc4(100, 100, 100, 255), blockSize.width, blockSize.height); - LayerColor *centerColor = LayerColor::create(ccc4(200, 100, 100, 255), blockSize.width, blockSize.height); - LayerColor *rightColor = LayerColor::create(ccc4(100, 100, 200, 255), blockSize.width, blockSize.height); + LayerColor *leftColor = LayerColor::create(Color4B(100, 100, 100, 255), blockSize.width, blockSize.height); + LayerColor *centerColor = LayerColor::create(Color4B(200, 100, 100, 255), blockSize.width, blockSize.height); + LayerColor *rightColor = LayerColor::create(Color4B(100, 100, 200, 255), blockSize.width, blockSize.height); leftColor->ignoreAnchorPointForPosition(false); centerColor->ignoreAnchorPointForPosition(false); diff --git a/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.cpp b/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.cpp index d10c8d46e7..17b6acee85 100644 --- a/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.cpp +++ b/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.cpp @@ -177,26 +177,26 @@ Atlas1::Atlas1() // // Notice: u,v tex coordinates are inverted // - ccV3F_C4B_T2F_Quad quads[] = + V3F_C4B_T2F_Quad quads[] = { { - {{0,0,0},ccc4(0,0,255,255),{0.0f,1.0f},}, // bottom left - {{s.width,0,0},ccc4(0,0,255,0),{1.0f,1.0f},}, // bottom right - {{0,s.height,0},ccc4(0,0,255,0),{0.0f,0.0f},}, // top left + {{0,0,0},Color4B(0,0,255,255),{0.0f,1.0f},}, // bottom left + {{s.width,0,0},Color4B(0,0,255,0),{1.0f,1.0f},}, // bottom right + {{0,s.height,0},Color4B(0,0,255,0),{0.0f,0.0f},}, // top left {{s.width,s.height,0},{0,0,255,255},{1.0f,0.0f},}, // top right }, { - {{40,40,0},ccc4(255,255,255,255),{0.0f,0.2f},}, // bottom left - {{120,80,0},ccc4(255,0,0,255),{0.5f,0.2f},}, // bottom right - {{40,160,0},ccc4(255,255,255,255),{0.0f,0.0f},}, // top left - {{160,160,0},ccc4(0,255,0,255),{0.5f,0.0f},}, // top right + {{40,40,0},Color4B(255,255,255,255),{0.0f,0.2f},}, // bottom left + {{120,80,0},Color4B(255,0,0,255),{0.5f,0.2f},}, // bottom right + {{40,160,0},Color4B(255,255,255,255),{0.0f,0.0f},}, // top left + {{160,160,0},Color4B(0,255,0,255),{0.5f,0.0f},}, // top right }, { - {{s.width/2,40,0},ccc4(255,0,0,255),{0.0f,1.0f},}, // bottom left - {{s.width,40,0},ccc4(0,255,0,255),{1.0f,1.0f},}, // bottom right - {{s.width/2-50,200,0},ccc4(0,0,255,255),{0.0f,0.0f},}, // top left - {{s.width,100,0},ccc4(255,255,0,255),{1.0f,0.0f},}, // top right + {{s.width/2,40,0},Color4B(255,0,0,255),{0.0f,1.0f},}, // bottom left + {{s.width,40,0},Color4B(0,255,0,255),{1.0f,1.0f},}, // bottom right + {{s.width/2-50,200,0},Color4B(0,0,255,255),{0.0f,0.0f},}, // top left + {{s.width,100,0},Color4B(255,255,0,255),{1.0f,0.0f},}, // top right }, }; @@ -299,7 +299,7 @@ LabelAtlasColorTest::LabelAtlasColorTest() LabelAtlas* label2 = LabelAtlas::create("0123456789", "fonts/tuffy_bold_italic-charmap.png", 48, 64, ' '); addChild(label2, 0, kTagSprite2); label2->setPosition( ccp(10,200) ); - label2->setColor( ccRED ); + label2->setColor( Color3B::red ); ActionInterval* fade = FadeOut::create(1.0f); ActionInterval* fade_in = fade->reverse(); @@ -395,7 +395,7 @@ Atlas3::Atlas3() { _time = 0; - LayerColor* col = LayerColor::create( ccc4(128,128,128,255) ); + LayerColor* col = LayerColor::create( Color4B(128,128,128,255) ); addChild(col, -10); LabelBMFont* label1 = LabelBMFont::create("Test", "fonts/bitmapFontTest2.fnt"); @@ -417,7 +417,7 @@ Atlas3::Atlas3() LabelBMFont *label2 = LabelBMFont::create("Test", "fonts/bitmapFontTest2.fnt"); // testing anchors label2->setAnchorPoint( ccp(0.5f, 0.5f) ); - label2->setColor( ccRED ); + label2->setColor( Color3B::red ); addChild(label2, 0, kTagBitmapAtlas2); label2->runAction( repeat->clone() ); @@ -646,7 +646,7 @@ AtlasBitmapColor::AtlasBitmapColor() LabelBMFont* label = NULL; label = LabelBMFont::create("Blue", "fonts/bitmapFontTest5.fnt"); - label->setColor( ccBLUE ); + label->setColor( Color3B::blue ); addChild(label); label->setPosition( ccp(s.width/2, s.height/4) ); label->setAnchorPoint( ccp(0.5f, 0.5f) ); @@ -655,13 +655,13 @@ AtlasBitmapColor::AtlasBitmapColor() addChild(label); label->setPosition( ccp(s.width/2, 2*s.height/4) ); label->setAnchorPoint( ccp(0.5f, 0.5f) ); - label->setColor( ccRED ); + label->setColor( Color3B::red ); label = LabelBMFont::create("G", "fonts/bitmapFontTest5.fnt"); addChild(label); label->setPosition( ccp(s.width/2, 3*s.height/4) ); label->setAnchorPoint( ccp(0.5f, 0.5f) ); - label->setColor( ccGREEN ); + label->setColor( Color3B::green ); label->setString("Green"); } @@ -894,7 +894,7 @@ LabelGlyphDesigner::LabelGlyphDesigner() { Size s = Director::sharedDirector()->getWinSize(); - LayerColor *layer = LayerColor::create(ccc4(128,128,128,255)); + LayerColor *layer = LayerColor::create(Color4B(128,128,128,255)); addChild(layer, -10); // LabelBMFont @@ -932,7 +932,7 @@ LabelTTFTest::LabelTTFTest() Size blockSize = CCSizeMake(200, 160); Size s = Director::sharedDirector()->getWinSize(); - LayerColor *colorLayer = LayerColor::create(ccc4(100, 100, 100, 255), blockSize.width, blockSize.height); + LayerColor *colorLayer = LayerColor::create(Color4B(100, 100, 100, 255), blockSize.width, blockSize.height); colorLayer->setAnchorPoint(ccp(0,0)); colorLayer->setPosition(ccp((s.width - blockSize.width) / 2, (s.height - blockSize.height) / 2)); @@ -1161,7 +1161,7 @@ BitmapFontMultiLineAlignment::BitmapFontMultiLineAlignment() Menu *stringMenu = Menu::create(longSentences, lineBreaks, mixed, NULL); stringMenu->alignItemsVertically(); - longSentences->setColor(ccRED); + longSentences->setColor(Color3B::red); _lastSentenceItem = longSentences; longSentences->setTag(LongSentences); lineBreaks->setTag(LineBreaks); @@ -1175,7 +1175,7 @@ BitmapFontMultiLineAlignment::BitmapFontMultiLineAlignment() Menu *alignmentMenu = Menu::create(left, center, right, NULL); alignmentMenu->alignItemsHorizontallyWithPadding(alignmentItemPadding); - center->setColor(ccRED); + center->setColor(Color3B::red); _lastAlignmentItem = center; left->setTag(LeftAlign); center->setTag(CenterAlign); @@ -1222,8 +1222,8 @@ std::string BitmapFontMultiLineAlignment::subtitle() void BitmapFontMultiLineAlignment::stringChanged(cocos2d::Object *sender) { MenuItemFont *item = (MenuItemFont*)sender; - item->setColor(ccRED); - this->_lastAlignmentItem->setColor(ccWHITE); + item->setColor(Color3B::red); + this->_lastAlignmentItem->setColor(Color3B::white); this->_lastAlignmentItem = item; switch(item->getTag()) @@ -1248,8 +1248,8 @@ void BitmapFontMultiLineAlignment::stringChanged(cocos2d::Object *sender) void BitmapFontMultiLineAlignment::alignmentChanged(cocos2d::Object *sender) { MenuItemFont *item = (MenuItemFont*)sender; - item->setColor(ccRED); - this->_lastAlignmentItem->setColor(ccWHITE); + item->setColor(Color3B::red); + this->_lastAlignmentItem->setColor(Color3B::white); this->_lastAlignmentItem = item; switch(item->getTag()) @@ -1322,13 +1322,13 @@ LabelTTFA8Test::LabelTTFA8Test() { Size s = Director::sharedDirector()->getWinSize(); - LayerColor *layer = LayerColor::create(ccc4(128, 128, 128, 255)); + LayerColor *layer = LayerColor::create(Color4B(128, 128, 128, 255)); addChild(layer, -10); // LabelBMFont LabelTTF *label1 = LabelTTF::create("Testing A8 Format", "Marker Felt", 48); addChild(label1); - label1->setColor(ccRED); + label1->setColor(Color3B::red); label1->setPosition(ccp(s.width/2, s.height/2)); FadeOut *fadeOut = FadeOut::create(2); @@ -1466,20 +1466,20 @@ std::string TTFFontInit::subtitle() TTFFontShadowAndStroke::TTFFontShadowAndStroke() { - LayerColor *layer = LayerColor::create(ccc4(0,190,0,255)); + LayerColor *layer = LayerColor::create(Color4B(0,190,0,255)); addChild(layer, -10); Size s = Director::sharedDirector()->getWinSize(); - ccColor3B tintColorRed = { 255, 0, 0 }; - ccColor3B tintColorYellow = { 255, 255, 0 }; - ccColor3B tintColorBlue = { 0, 0, 255 }; - ccColor3B strokeColor = { 0, 10, 255 }; - ccColor3B strokeShadowColor = { 255, 0, 0 }; + Color3B tintColorRed = { 255, 0, 0 }; + Color3B tintColorYellow = { 255, 255, 0 }; + Color3B tintColorBlue = { 0, 0, 255 }; + Color3B strokeColor = { 0, 10, 255 }; + Color3B strokeShadowColor = { 255, 0, 0 }; Size shadowOffset(12.0, 12.0); - ccFontDefinition shadowTextDef; + FontDefinition shadowTextDef; shadowTextDef._fontSize = 20; shadowTextDef._fontName = std::string("Marker Felt"); @@ -1499,7 +1499,7 @@ TTFFontShadowAndStroke::TTFFontShadowAndStroke() // create the stroke only label - ccFontDefinition strokeTextDef; + FontDefinition strokeTextDef; strokeTextDef._fontSize = 20; strokeTextDef._fontName = std::string("Marker Felt"); @@ -1519,7 +1519,7 @@ TTFFontShadowAndStroke::TTFFontShadowAndStroke() // create the label stroke and shadow - ccFontDefinition strokeShaodwTextDef; + FontDefinition strokeShaodwTextDef; strokeShaodwTextDef._fontSize = 20; strokeShaodwTextDef._fontName = std::string("Marker Felt"); @@ -1588,7 +1588,7 @@ LabelBMFontBounds::LabelBMFontBounds() { Size s = Director::sharedDirector()->getWinSize(); - LayerColor *layer = LayerColor::create(ccc4(128,128,128,255)); + LayerColor *layer = LayerColor::create(Color4B(128,128,128,255)); addChild(layer, -10); // LabelBMFont diff --git a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp index 944b50dca2..91e89bdb16 100644 --- a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp +++ b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp @@ -190,7 +190,7 @@ void LayerTestCascadingOpacityB::onEnter() LayerTest::onEnter(); Size s = Director::sharedDirector()->getWinSize(); - LayerColor* layer1 = LayerColor::create(ccc4(192, 0, 0, 255), s.width, s.height/2); + LayerColor* layer1 = LayerColor::create(Color4B(192, 0, 0, 255), s.width, s.height/2); layer1->setCascadeColorEnabled(false); layer1->setPosition( ccp(0, s.height/2)); @@ -242,7 +242,7 @@ void LayerTestCascadingOpacityC::onEnter() LayerTest::onEnter(); Size s = Director::sharedDirector()->getWinSize(); - LayerColor* layer1 = LayerColor::create(ccc4(192, 0, 0, 255), s.width, s.height/2); + LayerColor* layer1 = LayerColor::create(Color4B(192, 0, 0, 255), s.width, s.height/2); layer1->setCascadeColorEnabled(false); layer1->setCascadeOpacityEnabled(false); @@ -345,7 +345,7 @@ void LayerTestCascadingColorB::onEnter() { LayerTest::onEnter(); Size s = Director::sharedDirector()->getWinSize(); - LayerColor* layer1 = LayerColor::create(ccc4(255, 255, 255, 255), s.width, s.height/2); + LayerColor* layer1 = LayerColor::create(Color4B(255, 255, 255, 255), s.width, s.height/2); layer1->setPosition( ccp(0, s.height/2)); @@ -397,7 +397,7 @@ void LayerTestCascadingColorC::onEnter() { LayerTest::onEnter(); Size s = Director::sharedDirector()->getWinSize(); - LayerColor* layer1 = LayerColor::create(ccc4(255, 255, 255, 255), s.width, s.height/2); + LayerColor* layer1 = LayerColor::create(Color4B(255, 255, 255, 255), s.width, s.height/2); layer1->setCascadeColorEnabled(false); layer1->setPosition( ccp(0, s.height/2)); @@ -452,7 +452,7 @@ void LayerTest1::onEnter() setTouchEnabled(true); Size s = Director::sharedDirector()->getWinSize(); - LayerColor* layer = LayerColor::create( ccc4(0xFF, 0x00, 0x00, 0x80), 200, 200); + LayerColor* layer = LayerColor::create( Color4B(0xFF, 0x00, 0x00, 0x80), 200, 200); layer->ignoreAnchorPointForPosition(false); layer->setPosition( ccp(s.width/2, s.height/2) ); @@ -503,12 +503,12 @@ void LayerTest2::onEnter() LayerTest::onEnter(); Size s = Director::sharedDirector()->getWinSize(); - LayerColor* layer1 = LayerColor::create( ccc4(255, 255, 0, 80), 100, 300); + LayerColor* layer1 = LayerColor::create( Color4B(255, 255, 0, 80), 100, 300); layer1->setPosition(ccp(s.width/3, s.height/2)); layer1->ignoreAnchorPointForPosition(false); addChild(layer1, 1); - LayerColor* layer2 = LayerColor::create( ccc4(0, 0, 255, 255), 100, 300); + LayerColor* layer2 = LayerColor::create( Color4B(0, 0, 255, 255), 100, 300); layer2->setPosition(ccp((s.width/3)*2, s.height/2)); layer2->ignoreAnchorPointForPosition(false); addChild(layer2, 1); @@ -538,7 +538,7 @@ std::string LayerTest2::title() LayerTestBlend::LayerTestBlend() { Size s = Director::sharedDirector()->getWinSize(); - LayerColor* layer1 = LayerColor::create( ccc4(255, 255, 255, 80) ); + LayerColor* layer1 = LayerColor::create( Color4B(255, 255, 255, 80) ); Sprite* sister1 = Sprite::create(s_pPathSister1); Sprite* sister2 = Sprite::create(s_pPathSister2); @@ -571,7 +571,7 @@ void LayerTestBlend::newBlend(float dt) dst = GL_ZERO; } - ccBlendFunc bf = {src, dst}; + BlendFunc bf = {src, dst}; layer->setBlendFunc( bf ); } @@ -588,7 +588,7 @@ std::string LayerTestBlend::title() //------------------------------------------------------------------ LayerGradientTest::LayerGradientTest() { - LayerGradient* layer1 = LayerGradient::create(ccc4(255,0,0,255), ccc4(0,255,0,255), ccp(0.9f, 0.9f)); + LayerGradient* layer1 = LayerGradient::create(Color4B(255,0,0,255), Color4B(0,255,0,255), ccp(0.9f, 0.9f)); addChild(layer1, 0, kTagLayer); setTouchEnabled(true); @@ -643,7 +643,7 @@ string LayerGradientTest::subtitle() LayerGradientTest2::LayerGradientTest2() { LayerGradient* layer = new LayerGradient; - layer->initWithColor(ccc4(255,0,0,255), ccc4(255,255,0,255)); + layer->initWithColor(Color4B(255,0,0,255), Color4B(255,255,0,255)); layer->autorelease(); addChild(layer); } @@ -666,7 +666,7 @@ string LayerGradientTest2::subtitle() //------------------------------------------------------------------ LayerGradientTest3::LayerGradientTest3() { - LayerGradient* layer1 = LayerGradient::create(ccc4(255,0,0,255), ccc4(255,255,0,255)); + LayerGradient* layer1 = LayerGradient::create(Color4B(255,0,0,255), Color4B(255,255,0,255)); addChild(layer1); } @@ -690,7 +690,7 @@ void LayerIgnoreAnchorPointPos::onEnter() Size s = Director::sharedDirector()->getWinSize(); - LayerColor *l = LayerColor::create(ccc4(255, 0, 0, 255), 150, 150); + LayerColor *l = LayerColor::create(Color4B(255, 0, 0, 255), 150, 150); l->setAnchorPoint(ccp(0.5f, 0.5f)); l->setPosition(ccp( s.width/2, s.height/2)); @@ -738,7 +738,7 @@ void LayerIgnoreAnchorPointRot::onEnter() LayerTest::onEnter(); Size s = Director::sharedDirector()->getWinSize(); - LayerColor *l = LayerColor::create(ccc4(255, 0, 0, 255), 200, 200); + LayerColor *l = LayerColor::create(Color4B(255, 0, 0, 255), 200, 200); l->setAnchorPoint(ccp(0.5f, 0.5f)); l->setPosition(ccp( s.width/2, s.height/2)); @@ -786,7 +786,7 @@ void LayerIgnoreAnchorPointScale::onEnter() Size s = Director::sharedDirector()->getWinSize(); - LayerColor *l = LayerColor::create(ccc4(255, 0, 0, 255), 200, 200); + LayerColor *l = LayerColor::create(Color4B(255, 0, 0, 255), 200, 200); l->setAnchorPoint(ccp(0.5f, 1.0f)); l->setPosition(ccp( s.width/2, s.height/2)); @@ -841,12 +841,12 @@ void LayerTestScene::runThisTest() LayerExtendedBlendOpacityTest::LayerExtendedBlendOpacityTest() { - LayerGradient* layer1 = LayerGradient::create(ccc4(255, 0, 0, 255), ccc4(255, 0, 255, 255)); + LayerGradient* layer1 = LayerGradient::create(Color4B(255, 0, 0, 255), Color4B(255, 0, 255, 255)); layer1->setContentSize(CCSizeMake(80, 80)); layer1->setPosition(ccp(50,50)); addChild(layer1); - LayerGradient* layer2 = LayerGradient::create(ccc4(0, 0, 0, 127), ccc4(255, 255, 255, 127)); + LayerGradient* layer2 = LayerGradient::create(Color4B(0, 0, 0, 127), Color4B(255, 255, 255, 127)); layer2->setContentSize(CCSizeMake(80, 80)); layer2->setPosition(ccp(100,90)); addChild(layer2); @@ -854,11 +854,11 @@ LayerExtendedBlendOpacityTest::LayerExtendedBlendOpacityTest() LayerGradient* layer3 = LayerGradient::create(); layer3->setContentSize(CCSizeMake(80, 80)); layer3->setPosition(ccp(150,140)); - layer3->setStartColor(ccc3(255, 0, 0)); - layer3->setEndColor(ccc3(255, 0, 255)); + layer3->setStartColor(Color3B(255, 0, 0)); + layer3->setEndColor(Color3B(255, 0, 255)); layer3->setStartOpacity(255); layer3->setEndOpacity(255); - ccBlendFunc blend; + BlendFunc blend; blend.src = GL_SRC_ALPHA; blend.dst = GL_ONE_MINUS_SRC_ALPHA; layer3->setBlendFunc(blend); diff --git a/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp b/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp index d709e2a18e..a4709535a0 100644 --- a/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp +++ b/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp @@ -42,8 +42,8 @@ MenuLayerMainMenu::MenuLayerMainMenu() // Label Item (LabelAtlas) LabelAtlas* labelAtlas = LabelAtlas::create("0123456789", "fonts/labelatlas.png", 16, 24, '.'); MenuItemLabel* item3 = MenuItemLabel::create(labelAtlas, CC_CALLBACK_1(MenuLayerMainMenu::menuCallbackDisabled, this) ); - item3->setDisabledColor( ccc3(32,32,64) ); - item3->setColor( ccc3(200,200,255) ); + item3->setDisabledColor( Color3B(32,32,64) ); + item3->setColor( Color3B(200,200,255) ); // Font Item MenuItemFont *item4 = MenuItemFont::create("I toggle enable items", [&](Object *sender) { @@ -499,7 +499,7 @@ MenuLayerPriorityTest::MenuLayerPriorityTest() } }); - item1->setColor(ccc3(0,0,255)); + item1->setColor(Color3B(0,0,255)); _menu2->addChild(item1); addChild(_menu2); } diff --git a/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp b/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp index dec73a3b21..a1221a1489 100644 --- a/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp +++ b/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp @@ -34,7 +34,7 @@ void MotionStreakTest1::onEnter() _target->setPosition(ccp(s.width/4, 0)); // create the streak object and add it to the scene - streak = MotionStreak::create(2, 3, 32, ccGREEN, s_streak); + streak = MotionStreak::create(2, 3, 32, Color3B::green, s_streak); addChild(streak); // schedule an update on each frame so we can syncronize the streak with the target schedule(schedule_selector(MotionStreakTest1::onUpdate)); @@ -84,7 +84,7 @@ void MotionStreakTest2::onEnter() Size s = Director::sharedDirector()->getWinSize(); // create the streak object and add it to the scene - streak = MotionStreak::create(3, 3, 64, ccWHITE, s_streak ); + streak = MotionStreak::create(3, 3, 64, Color3B::white, s_streak ); addChild(streak); streak->setPosition( ccp(s.width/2, s.height/2) ); @@ -117,7 +117,7 @@ void Issue1358::onEnter() // ask director the the window size Size size = Director::sharedDirector()->getWinSize(); - streak = MotionStreak::create(2.0f, 1.0f, 50.0f, ccc3(255, 255, 0), "Images/Icon.png"); + streak = MotionStreak::create(2.0f, 1.0f, 50.0f, Color3B(255, 255, 0), "Images/Icon.png"); addChild(streak); diff --git a/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.cpp b/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.cpp index 0f6604ee62..c1f7e38249 100644 --- a/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.cpp +++ b/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.cpp @@ -1,12 +1,12 @@ #include "MutiTouchTest.h" -static ccColor3B s_TouchColors[CC_MAX_TOUCHES] = { - ccYELLOW, - ccBLUE, - ccGREEN, - ccRED, - ccMAGENTA +static Color3B s_TouchColors[CC_MAX_TOUCHES] = { + Color3B::yellow, + Color3B::blue, + Color3B::green, + Color3B::red, + Color3B::magenta }; class TouchPoint : public Node @@ -33,7 +33,7 @@ public: _touchPoint = pt; } - void setTouchColor(ccColor3B color) + void setTouchColor(Color3B color) { _touchColor = color; } @@ -49,7 +49,7 @@ public: private: Point _touchPoint; - ccColor3B _touchColor; + Color3B _touchColor; }; bool MutiTouchTestLayer::init() diff --git a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp index ddbc33daaf..f880f1b57d 100644 --- a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp +++ b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp @@ -659,7 +659,7 @@ CameraCenterTest::CameraCenterTest() sprite = Sprite::create("Images/white-512x512.png"); addChild( sprite, 0); sprite->setPosition(ccp(s.width/5*1, s.height/5*1)); - sprite->setColor(ccRED); + sprite->setColor(Color3B::red); sprite->setTextureRect(CCRectMake(0, 0, 120, 50)); orbit = OrbitCamera::create(10, 1, 0, 0, 360, 0, 0); sprite->runAction(RepeatForever::create( orbit )); @@ -671,7 +671,7 @@ CameraCenterTest::CameraCenterTest() sprite = Sprite::create("Images/white-512x512.png"); addChild( sprite, 0, 40); sprite->setPosition(ccp(s.width/5*1, s.height/5*4)); - sprite->setColor(ccBLUE); + sprite->setColor(Color3B::blue); sprite->setTextureRect(CCRectMake(0, 0, 120, 50)); orbit = OrbitCamera::create(10, 1, 0, 0, 360, 0, 0); sprite->runAction(RepeatForever::create( orbit )); @@ -681,7 +681,7 @@ CameraCenterTest::CameraCenterTest() sprite = Sprite::create("Images/white-512x512.png"); addChild( sprite, 0); sprite->setPosition(ccp(s.width/5*4, s.height/5*1)); - sprite->setColor(ccYELLOW); + sprite->setColor(Color3B::yellow); sprite->setTextureRect(CCRectMake(0, 0, 120, 50)); orbit = OrbitCamera::create(10, 1, 0, 0, 360, 0, 0); sprite->runAction(RepeatForever::create( orbit) ); @@ -691,7 +691,7 @@ CameraCenterTest::CameraCenterTest() sprite = Sprite::create("Images/white-512x512.png"); addChild( sprite, 0, 40); sprite->setPosition(ccp(s.width/5*4, s.height/5*4)); - sprite->setColor(ccGREEN); + sprite->setColor(Color3B::green); sprite->setTextureRect(CCRectMake(0, 0, 120, 50)); orbit = OrbitCamera::create(10, 1, 0, 0, 360, 0, 0); sprite->runAction( RepeatForever::create( orbit ) ); @@ -700,7 +700,7 @@ CameraCenterTest::CameraCenterTest() sprite = Sprite::create("Images/white-512x512.png"); addChild( sprite, 0, 40); sprite->setPosition(ccp(s.width/2, s.height/2)); - sprite->setColor(ccWHITE); + sprite->setColor(Color3B::white); sprite->setTextureRect(CCRectMake(0, 0, 120, 50)); orbit = OrbitCamera::create(10, 1, 0, 0, 360, 0, 0); sprite->runAction(RepeatForever::create( orbit ) ); @@ -799,7 +799,7 @@ NodeOpaqueTest::NodeOpaqueTest() for (int i = 0; i < 50; i++) { background = Sprite::create("Images/background1.png"); - ccBlendFunc blendFunc = {GL_ONE, GL_ONE_MINUS_SRC_ALPHA}; + BlendFunc blendFunc = {GL_ONE, GL_ONE_MINUS_SRC_ALPHA}; background->setBlendFunc(blendFunc); background->setAnchorPoint(PointZero); addChild(background); @@ -825,7 +825,7 @@ NodeNonOpaqueTest::NodeNonOpaqueTest() for (int i = 0; i < 50; i++) { background = Sprite::create("Images/background1.jpg"); - background->setBlendFunc(kBlendFuncDisable); + background->setBlendFunc(BlendFunc::blendFuncDisable); background->setAnchorPoint(PointZero); addChild(background); } diff --git a/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp b/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp index 20fb5aa7cc..17c08bdcbe 100644 --- a/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp @@ -185,16 +185,16 @@ void DemoBigFlower::onEnter() _emitter->setEndSpinVar(0); // color of particles - ccColor4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; _emitter->setStartColor(startColor); - ccColor4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; _emitter->setStartColorVar(startColorVar); - ccColor4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; _emitter->setEndColor(endColor); - ccColor4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; _emitter->setEndColorVar(endColorVar); // size, in pixels @@ -270,16 +270,16 @@ void DemoRotFlower::onEnter() _emitter->setEndSpinVar(2000); // color of particles - ccColor4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; _emitter->setStartColor(startColor); - ccColor4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; _emitter->setStartColorVar(startColorVar); - ccColor4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; _emitter->setEndColor(endColor); - ccColor4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; _emitter->setEndColorVar(endColorVar); // size, in pixels @@ -423,13 +423,13 @@ void DemoSnow::onEnter() _emitter->setSpeedVar(30); - ccColor4F startColor = _emitter->getStartColor(); + Color4F startColor = _emitter->getStartColor(); startColor.r = 0.9f; startColor.g = 0.9f; startColor.b = 0.9f; _emitter->setStartColor(startColor); - ccColor4F startColorVar = _emitter->getStartColorVar(); + Color4F startColorVar = _emitter->getStartColorVar(); startColorVar.b = 0.1f; _emitter->setStartColorVar(startColorVar); @@ -527,16 +527,16 @@ void DemoModernArt::onEnter() _emitter->setEmissionRate(_emitter->getTotalParticles()/_emitter->getLife()); // color of particles - ccColor4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; _emitter->setStartColor(startColor); - ccColor4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; _emitter->setStartColorVar(startColorVar); - ccColor4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; _emitter->setEndColor(endColor); - ccColor4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; _emitter->setEndColorVar(endColorVar); // size, in pixels @@ -640,7 +640,7 @@ void RadiusMode1::onEnter() { ParticleDemo::onEnter(); - _color->setColor(ccBLACK); + _color->setColor(Color3B::black); removeChild(_background, true); _background = NULL; @@ -686,16 +686,16 @@ void RadiusMode1::onEnter() _emitter->setEndSpinVar(0); // color of particles - ccColor4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; _emitter->setStartColor(startColor); - ccColor4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; _emitter->setStartColorVar(startColorVar); - ccColor4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; _emitter->setEndColor(endColor); - ccColor4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; _emitter->setEndColorVar(endColorVar); // size, in pixels @@ -724,7 +724,7 @@ void RadiusMode2::onEnter() { ParticleDemo::onEnter(); - _color->setColor(ccBLACK); + _color->setColor(Color3B::black); removeChild(_background, true); _background = NULL; @@ -770,16 +770,16 @@ void RadiusMode2::onEnter() _emitter->setEndSpinVar(0); // color of particles - ccColor4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; _emitter->setStartColor(startColor); - ccColor4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; _emitter->setStartColorVar(startColorVar); - ccColor4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; _emitter->setEndColor(endColor); - ccColor4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; _emitter->setEndColorVar(endColorVar); // size, in pixels @@ -808,7 +808,7 @@ void Issue704::onEnter() { ParticleDemo::onEnter(); - _color->setColor(ccBLACK); + _color->setColor(Color3B::black); removeChild(_background, true); _background = NULL; @@ -854,16 +854,16 @@ void Issue704::onEnter() _emitter->setEndSpinVar(0); // color of particles - ccColor4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; _emitter->setStartColor(startColor); - ccColor4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; _emitter->setStartColorVar(startColorVar); - ccColor4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; _emitter->setEndColor(endColor); - ccColor4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; _emitter->setEndColorVar(endColorVar); // size, in pixels @@ -900,7 +900,7 @@ void Issue870::onEnter() { ParticleDemo::onEnter(); - _color->setColor(ccBLACK); + _color->setColor(Color3B::black); removeChild(_background, true); _background = NULL; @@ -941,7 +941,7 @@ void DemoParticleFromFile::onEnter() { ParticleDemo::onEnter(); - _color->setColor(ccBLACK); + _color->setColor(Color3B::black); removeChild(_background, true); _background = NULL; @@ -1069,7 +1069,7 @@ void ParticleDemo::onEnter(void) { BaseTest::onEnter(); - _color = LayerColor::create( ccc4(127,127,127,255) ); + _color = LayerColor::create( Color4B(127,127,127,255) ); this->addChild(_color); _emitter = NULL; @@ -1211,7 +1211,7 @@ void ParticleBatchHybrid::onEnter() { ParticleDemo::onEnter(); - _color->setColor(ccBLACK); + _color->setColor(Color3B::black); removeChild(_background, true); _background = NULL; @@ -1259,16 +1259,16 @@ void ParticleBatchMultipleEmitters::onEnter() { ParticleDemo::onEnter(); - _color->setColor(ccBLACK); + _color->setColor(Color3B::black); removeChild(_background, true); _background = NULL; ParticleSystemQuad *emitter1 = ParticleSystemQuad::create("Particles/LavaFlow.plist"); - emitter1->setStartColor(ccc4f(1,0,0,1)); + emitter1->setStartColor(Color4F(1,0,0,1)); ParticleSystemQuad *emitter2 = ParticleSystemQuad::create("Particles/LavaFlow.plist"); - emitter2->setStartColor(ccc4f(0,1,0,1)); + emitter2->setStartColor(Color4F(0,1,0,1)); ParticleSystemQuad *emitter3 = ParticleSystemQuad::create("Particles/LavaFlow.plist"); - emitter3->setStartColor(ccc4f(0,0,1,1)); + emitter3->setStartColor(Color4F(0,0,1,1)); Size s = Director::sharedDirector()->getWinSize(); @@ -1302,7 +1302,7 @@ void ParticleReorder::onEnter() ParticleDemo::onEnter(); _order = 0; - _color->setColor(ccBLACK); + _color->setColor(Color3B::black); removeChild(_background, true); _background = NULL; @@ -1316,13 +1316,13 @@ void ParticleReorder::onEnter() Node *parent = ( i==0 ? parent1 : parent2 ); ParticleSystemQuad *emitter1 = ParticleSystemQuad::create("Particles/SmallSun.plist"); - emitter1->setStartColor(ccc4f(1,0,0,1)); + emitter1->setStartColor(Color4F(1,0,0,1)); emitter1->setBlendAdditive(false); ParticleSystemQuad *emitter2 = ParticleSystemQuad::create("Particles/SmallSun.plist"); - emitter2->setStartColor(ccc4f(0,1,0,1)); + emitter2->setStartColor(Color4F(0,1,0,1)); emitter2->setBlendAdditive(false); ParticleSystemQuad *emitter3 = ParticleSystemQuad::create("Particles/SmallSun.plist"); - emitter3->setStartColor(ccc4f(0,0,1,1)); + emitter3->setStartColor(Color4F(0,0,1,1)); emitter3->setBlendAdditive(false); Size s = Director::sharedDirector()->getWinSize(); @@ -1442,8 +1442,8 @@ bool RainbowEffect::initWithTotalParticles(unsigned int numberOfParticles) setEmissionRate(getTotalParticles()/getLife()); // color of particles - setStartColor(ccc4FFromccc4B(ccc4(50, 50, 50, 50))); - setEndColor(ccc4FFromccc4B(ccc4(0, 0, 0, 0))); + setStartColor(Color4F(Color4B(50, 50, 50, 50))); + setEndColor(Color4F(Color4B(0, 0, 0, 0))); _startColorVar.r = 0.0f; _startColorVar.g = 0.0f; @@ -1472,7 +1472,7 @@ void Issue1201::onEnter() { ParticleDemo::onEnter(); - _color->setColor(ccBLACK); + _color->setColor(Color3B::black); removeChild(_background, true); _background = NULL; @@ -1502,7 +1502,7 @@ void MultipleParticleSystems::onEnter() { ParticleDemo::onEnter(); - _color->setColor(ccBLACK); + _color->setColor(Color3B::black); removeChild(_background, true); _background = NULL; @@ -1557,7 +1557,7 @@ void MultipleParticleSystemsBatched::onEnter() { ParticleDemo::onEnter(); - _color->setColor(ccBLACK); + _color->setColor(Color3B::black); removeChild(_background, true); _background = NULL; @@ -1619,7 +1619,7 @@ void AddAndDeleteParticleSystems::onEnter() { ParticleDemo::onEnter(); - _color->setColor(ccBLACK); + _color->setColor(Color3B::black); removeChild(_background, true); _background = NULL; @@ -1708,7 +1708,7 @@ void ReorderParticleSystems::onEnter() { ParticleDemo::onEnter(); - _color->setColor(ccBLACK); + _color->setColor(Color3B::black); removeChild(_background ,true); _background = NULL; @@ -1761,16 +1761,16 @@ void ReorderParticleSystems::onEnter() // color of particles float color[3] = {0,0,0}; color[i] = 1; - ccColor4F startColor = {color[0], color[1], color[2], 1.0f}; + Color4F startColor = {color[0], color[1], color[2], 1.0f}; particleSystem->setStartColor(startColor); - ccColor4F startColorVar = {0, 0, 0, 0}; + Color4F startColorVar = {0, 0, 0, 0}; particleSystem->setStartColorVar(startColorVar); - ccColor4F endColor = startColor; + Color4F endColor = startColor; particleSystem->setEndColor(endColor); - ccColor4F endColorVar = startColorVar; + Color4F endColorVar = startColorVar; particleSystem->setEndColorVar(endColorVar); // size, in pixels @@ -1854,17 +1854,17 @@ void PremultipliedAlphaTest::onEnter() { ParticleDemo::onEnter(); - _color->setColor(ccBLUE); + _color->setColor(Color3B::blue); this->removeChild(_background, true); _background = NULL; _emitter = ParticleSystemQuad::create("Particles/BoilingFoam.plist"); _emitter->retain(); // Particle Designer "normal" blend func causes black halo on premul textures (ignores multiplication) - //this->emitter.blendFunc = (ccBlendFunc){ GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA }; + //this->emitter.blendFunc = (BlendFunc){ GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA }; // Cocos2d "normal" blend func for premul causes alpha to be ignored (oversaturates colors) - ccBlendFunc tBlendFunc = { GL_ONE, GL_ONE_MINUS_SRC_ALPHA }; + BlendFunc tBlendFunc = { GL_ONE, GL_ONE_MINUS_SRC_ALPHA }; _emitter->setBlendFunc(tBlendFunc); CCAssert(_emitter->getOpacityModifyRGB(), "Particle texture does not have premultiplied alpha, test is useless"); @@ -1872,10 +1872,10 @@ void PremultipliedAlphaTest::onEnter() // Toggle next line to see old behavior // this->emitter.opacityModifyRGB = NO; - _emitter->setStartColor(ccc4f(1, 1, 1, 1)); - _emitter->setEndColor(ccc4f(1, 1, 1, 0)); - _emitter->setStartColorVar(ccc4f(0, 0, 0, 0)); - _emitter->setEndColorVar(ccc4f(0, 0, 0, 0)); + _emitter->setStartColor(Color4F(1, 1, 1, 1)); + _emitter->setEndColor(Color4F(1, 1, 1, 0)); + _emitter->setStartColorVar(Color4F(0, 0, 0, 0)); + _emitter->setEndColorVar(Color4F(0, 0, 0, 0)); this->addChild(_emitter, 10); } @@ -1886,7 +1886,7 @@ void PremultipliedAlphaTest2::onEnter() { ParticleDemo::onEnter(); - _color->setColor(ccBLACK); + _color->setColor(Color3B::black); this->removeChild(_background, true); _background = NULL; diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp index aaf66a9222..fc72b8a948 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp @@ -76,7 +76,7 @@ void NodeChildrenMainScene::initWithQuantityOfNodes(unsigned int nNodes) LabelTTF *label = LabelTTF::create(title().c_str(), "Arial", 40); addChild(label, 1); label->setPosition(ccp(s.width/2, s.height-32)); - label->setColor(ccc3(255,255,40)); + label->setColor(Color3B(255,255,40)); // Subtitle std::string strSubTitle = subtitle(); @@ -100,7 +100,7 @@ void NodeChildrenMainScene::initWithQuantityOfNodes(unsigned int nNodes) updateQuantityLabel(); updateQuantityOfNodes(); }); - decrease->setColor(ccc3(0,200,20)); + decrease->setColor(Color3B(0,200,20)); MenuItemFont *increase = MenuItemFont::create(" + ", [&](Object *sender) { quantityOfNodes += kNodesIncrease; if( quantityOfNodes > kMaxNodes ) @@ -109,7 +109,7 @@ void NodeChildrenMainScene::initWithQuantityOfNodes(unsigned int nNodes) updateQuantityLabel(); updateQuantityOfNodes(); }); - increase->setColor(ccc3(0,200,20)); + increase->setColor(Color3B(0,200,20)); Menu *menu = Menu::create(decrease, increase, NULL); menu->alignItemsHorizontally(); @@ -117,7 +117,7 @@ void NodeChildrenMainScene::initWithQuantityOfNodes(unsigned int nNodes) addChild(menu, 1); LabelTTF *infoLabel = LabelTTF::create("0 nodes", "Marker Felt", 30); - infoLabel->setColor(ccc3(0,200,20)); + infoLabel->setColor(Color3B(0,200,20)); infoLabel->setPosition(ccp(s.width/2, s.height/2-15)); addChild(infoLabel, 1, kTagInfoLayer); diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp index 74052b04a7..5cb496a080 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp @@ -87,7 +87,7 @@ void ParticleMainScene::initWithSubTest(int asubtest, int particles) updateQuantityLabel(); createParticleSystem(); }); - decrease->setColor(ccc3(0,200,20)); + decrease->setColor(Color3B(0,200,20)); MenuItemFont *increase = MenuItemFont::create(" + ", [&](Object *sender) { quantityParticles += kNodesIncrease; if( quantityParticles > kMaxParticles ) @@ -96,7 +96,7 @@ void ParticleMainScene::initWithSubTest(int asubtest, int particles) updateQuantityLabel(); createParticleSystem(); }); - increase->setColor(ccc3(0,200,20)); + increase->setColor(Color3B(0,200,20)); Menu *menu = Menu::create(decrease, increase, NULL); menu->alignItemsHorizontally(); @@ -104,7 +104,7 @@ void ParticleMainScene::initWithSubTest(int asubtest, int particles) addChild(menu, 1); LabelTTF *infoLabel = LabelTTF::create("0 nodes", "Marker Felt", 30); - infoLabel->setColor(ccc3(0,200,20)); + infoLabel->setColor(Color3B(0,200,20)); infoLabel->setPosition(ccp(s.width/2, s.height - 90)); addChild(infoLabel, 1, kTagInfoLayer); @@ -131,11 +131,11 @@ void ParticleMainScene::initWithSubTest(int asubtest, int particles) if (i <= 3) { - itemFont->setColor(ccc3(200,20,20)); + itemFont->setColor(Color3B(200,20,20)); } else { - itemFont->setColor(ccc3(0,200,20)); + itemFont->setColor(Color3B(0,200,20)); } } pSubMenu->alignItemsHorizontally(); @@ -145,7 +145,7 @@ void ParticleMainScene::initWithSubTest(int asubtest, int particles) LabelTTF *label = LabelTTF::create(title().c_str(), "Arial", 40); addChild(label, 1); label->setPosition(ccp(s.width/2, s.height-32)); - label->setColor(ccc3(255,255,40)); + label->setColor(Color3B(255,255,40)); updateQuantityLabel(); createParticleSystem(); @@ -324,16 +324,16 @@ void ParticlePerformTest1::doTest() particleSystem->setEmissionRate(particleSystem->getTotalParticles() /particleSystem->getLife()); // color of particles - ccColor4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; particleSystem->setStartColor(startColor); - ccColor4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; particleSystem->setStartColorVar( startColorVar); - ccColor4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; particleSystem->setEndColor(endColor); - ccColor4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; particleSystem->setEndColorVar(endColorVar); // size, in pixels @@ -394,16 +394,16 @@ void ParticlePerformTest2::doTest() particleSystem->setEmissionRate(particleSystem->getTotalParticles() / particleSystem->getLife()); // color of particles - ccColor4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; particleSystem->setStartColor(startColor); - ccColor4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; particleSystem->setStartColorVar(startColorVar); - ccColor4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; particleSystem->setEndColor(endColor); - ccColor4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; particleSystem->setEndColorVar(endColorVar); // size, in pixels @@ -464,16 +464,16 @@ void ParticlePerformTest3::doTest() particleSystem->setEmissionRate(particleSystem->getTotalParticles() / particleSystem->getLife()); // color of particles - ccColor4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; particleSystem->setStartColor(startColor); - ccColor4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; particleSystem->setStartColorVar(startColorVar); - ccColor4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; particleSystem->setEndColor(endColor); - ccColor4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; particleSystem->setEndColorVar(endColorVar); // size, in pixels @@ -534,16 +534,16 @@ void ParticlePerformTest4::doTest() particleSystem->setEmissionRate(particleSystem->getTotalParticles() / particleSystem->getLife()); // color of particles - ccColor4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; particleSystem->setStartColor(startColor); - ccColor4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; + Color4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; particleSystem->setStartColorVar(startColorVar); - ccColor4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; particleSystem->setEndColor(endColor); - ccColor4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; + Color4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; particleSystem->setEndColorVar(endColorVar); // size, in pixels diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp index 60ef4cbec8..719c2dc57a 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp @@ -288,9 +288,9 @@ void SpriteMainScene::initWithSubTest(int asubtest, int nNodes) MenuItemFont::setFontSize(65); MenuItemFont *decrease = MenuItemFont::create(" - ", CC_CALLBACK_1(SpriteMainScene::onDecrease, this)); - decrease->setColor(ccc3(0,200,20)); + decrease->setColor(Color3B(0,200,20)); MenuItemFont *increase = MenuItemFont::create(" + ", CC_CALLBACK_1(SpriteMainScene::onIncrease, this)); - increase->setColor(ccc3(0,200,20)); + increase->setColor(Color3B(0,200,20)); Menu *menu = Menu::create(decrease, increase, NULL); menu->alignItemsHorizontally(); @@ -298,7 +298,7 @@ void SpriteMainScene::initWithSubTest(int asubtest, int nNodes) addChild(menu, 1); LabelTTF *infoLabel = LabelTTF::create("0 nodes", "Marker Felt", 30); - infoLabel->setColor(ccc3(0,200,20)); + infoLabel->setColor(Color3B(0,200,20)); infoLabel->setPosition(ccp(s.width/2, s.height-90)); addChild(infoLabel, 1, kTagInfoLayer); @@ -319,11 +319,11 @@ void SpriteMainScene::initWithSubTest(int asubtest, int nNodes) pSubMenu->addChild(itemFont, 10); if( i<= 3) - itemFont->setColor(ccc3(200,20,20)); + itemFont->setColor(Color3B(200,20,20)); else if(i <= 6) - itemFont->setColor(ccc3(0,200,20)); + itemFont->setColor(Color3B(0,200,20)); else - itemFont->setColor(ccc3(0,20,200)); + itemFont->setColor(Color3B(0,20,200)); } pSubMenu->alignItemsHorizontally(); @@ -334,7 +334,7 @@ void SpriteMainScene::initWithSubTest(int asubtest, int nNodes) LabelTTF *label = LabelTTF::create(title().c_str(), "Arial", 40); addChild(label, 1); label->setPosition(ccp(s.width/2, s.height-32)); - label->setColor(ccc3(255,255,40)); + label->setColor(Color3B(255,255,40)); while(quantityNodes < nNodes) onIncrease(this); diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTextureTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTextureTest.cpp index 8d036846e7..81006282bb 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTextureTest.cpp +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTextureTest.cpp @@ -51,7 +51,7 @@ void TextureMenuLayer::onEnter() LabelTTF *label = LabelTTF::create(title().c_str(), "Arial", 40); addChild(label, 1); label->setPosition(ccp(s.width/2, s.height-32)); - label->setColor(ccc3(255,255,40)); + label->setColor(Color3B(255,255,40)); // Subtitle std::string strSubTitle = subtitle(); diff --git a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp index e2079193c1..b56d0f2050 100644 --- a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp +++ b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp @@ -109,7 +109,7 @@ RenderTextureSave::RenderTextureSave() // create a brush image to draw into the texture with _brush = Sprite::create("Images/fire.png"); _brush->retain(); - _brush->setColor(ccRED); + _brush->setColor(Color3B::red); _brush->setOpacity(20); this->setTouchEnabled(true); @@ -200,9 +200,9 @@ void RenderTextureSave::ccTouchesMoved(Set* touches, Event* event) _brush->setRotation(rand() % 360); float r = (float)(rand() % 50 / 50.f) + 0.25f; _brush->setScale(r); - /*_brush->setColor(ccc3(CCRANDOM_0_1() * 127 + 128, 255, 255));*/ + /*_brush->setColor(Color3B(CCRANDOM_0_1() * 127 + 128, 255, 255));*/ // Use CCRANDOM_0_1() will cause error when loading libtests.so on android, I don't know why. - _brush->setColor(ccc3(rand() % 127 + 128, 255, 255)); + _brush->setColor(Color3B(rand() % 127 + 128, 255, 255)); // Call visit to draw the brush, don't call draw.. _brush->visit(); } @@ -230,7 +230,7 @@ RenderTextureIssue937::RenderTextureIssue937() * B1: non-premulti sprite * B2: non-premulti render */ - LayerColor *background = LayerColor::create(ccc4(200,200,200,255)); + LayerColor *background = LayerColor::create(Color4B(200,200,200,255)); addChild(background); Sprite *spr_premulti = Sprite::create("Images/fire.png"); @@ -251,7 +251,7 @@ RenderTextureIssue937::RenderTextureIssue937() } // It's possible to modify the RenderTexture blending function by - // [[rend sprite] setBlendFunc:(ccBlendFunc) {GL_ONE, GL_ONE_MINUS_SRC_ALPHA}]; + // [[rend sprite] setBlendFunc:(BlendFunc) {GL_ONE, GL_ONE_MINUS_SRC_ALPHA}]; rend->begin(); spr_premulti->visit(); @@ -348,7 +348,7 @@ RenderTextureZbuffer::RenderTextureZbuffer() sp9->setVertexZ(-400); sp9->setScale(2); - sp9->setColor(ccYELLOW); + sp9->setColor(Color3B::yellow); } string RenderTextureZbuffer::title() @@ -425,7 +425,7 @@ void RenderTextureZbuffer::renderScreenShot() sprite->setOpacity(182); sprite->setFlipY(1); this->addChild(sprite, 999999); - sprite->setColor(ccGREEN); + sprite->setColor(Color3B::green); sprite->runAction(Sequence::create(FadeTo::create(2, 0), Hide::create(), @@ -493,7 +493,7 @@ RenderTextureTargetNode::RenderTextureTargetNode() * B1: non-premulti sprite * B2: non-premulti render */ - LayerColor *background = LayerColor::create(ccc4(40,40,40,255)); + LayerColor *background = LayerColor::create(Color4B(40,40,40,255)); addChild(background); // sprite 1 @@ -515,7 +515,7 @@ RenderTextureTargetNode::RenderTextureTargetNode() /* add the sprites to the render texture */ renderTexture->addChild(sprite1); renderTexture->addChild(sprite2); - renderTexture->setClearColor(ccc4f(0, 0, 0, 0)); + renderTexture->setClearColor(Color4F(0, 0, 0, 0)); renderTexture->setClearFlags(GL_COLOR_BUFFER_BIT); /* add the render texture to the scene */ @@ -542,7 +542,7 @@ void RenderTextureTargetNode::touched(Object* sender) else { renderTexture->setClearFlags(0); - renderTexture->setClearColor(ccc4f( CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1)); + renderTexture->setClearColor(Color4F( CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1)); } } @@ -598,7 +598,7 @@ void SpriteRenderTextureBug::SimpleSprite::draw() CC_NODE_DRAW_SETUP(); - ccBlendFunc blend = getBlendFunc(); + BlendFunc blend = getBlendFunc(); ccGLBlendFunc(blend.src, blend.dst); ccGLBindTexture2D(getTexture()->getName()); @@ -613,15 +613,15 @@ void SpriteRenderTextureBug::SimpleSprite::draw() long offset = (long)&_quad; // vertex - int diff = offsetof( ccV3F_C4B_T2F, vertices); + int diff = offsetof( V3F_C4B_T2F, vertices); glVertexAttribPointer(kVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, kQuadSize, (void*) (offset + diff)); // texCoods - diff = offsetof( ccV3F_C4B_T2F, texCoords); + diff = offsetof( V3F_C4B_T2F, texCoords); glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, kQuadSize, (void*)(offset + diff)); // color - diff = offsetof( ccV3F_C4B_T2F, colors); + diff = offsetof( V3F_C4B_T2F, colors); glVertexAttribPointer(kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (void*)(offset + diff)); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); diff --git a/samples/Cpp/TestCpp/Classes/RotateWorldTest/RotateWorldTest.cpp b/samples/Cpp/TestCpp/Classes/RotateWorldTest/RotateWorldTest.cpp index 9efb759d32..83cf483c7e 100644 --- a/samples/Cpp/TestCpp/Classes/RotateWorldTest/RotateWorldTest.cpp +++ b/samples/Cpp/TestCpp/Classes/RotateWorldTest/RotateWorldTest.cpp @@ -90,10 +90,10 @@ void RotateWorldMainLayer::onEnter() x = size.width; y = size.height; - Node* blue = LayerColor::create(ccc4(0,0,255,255)); - Node* red = LayerColor::create(ccc4(255,0,0,255)); - Node* green = LayerColor::create(ccc4(0,255,0,255)); - Node* white = LayerColor::create(ccc4(255,255,255,255)); + Node* blue = LayerColor::create(Color4B(0,0,255,255)); + Node* red = LayerColor::create(Color4B(255,0,0,255)); + Node* green = LayerColor::create(Color4B(0,255,0,255)); + Node* white = LayerColor::create(Color4B(255,255,255,255)); blue->setScale(0.5f); blue->setPosition(ccp(-x/4,-y/4)); diff --git a/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.cpp b/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.cpp index a72cff3fd5..3348d6259d 100644 --- a/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.cpp +++ b/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.cpp @@ -167,7 +167,7 @@ SceneTestLayer3::SceneTestLayer3() bool SceneTestLayer3::init() { - if (LayerColor::initWithColor(ccc4(0,0,255,255))) + if (LayerColor::initWithColor(Color4B(0,0,255,255))) { Size s = Director::sharedDirector()->getWinSize(); @@ -202,7 +202,7 @@ void SceneTestLayer3::item0Clicked(Object* pSender) { Scene *newScene = Scene::create(); newScene->addChild(SceneTestLayer3::create()); - Director::sharedDirector()->pushScene(TransitionFade::create(0.5, newScene, ccc3(0,255,255))); + Director::sharedDirector()->pushScene(TransitionFade::create(0.5, newScene, Color3B(0,255,255))); } void SceneTestLayer3::item1Clicked(Object* pSender) diff --git a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.cpp b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.cpp index fc22ac3901..a0b6d0713a 100644 --- a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.cpp @@ -109,8 +109,8 @@ enum }; ShaderNode::ShaderNode() -:_center(vertex2(0.0f, 0.0f)) -,_resolution(vertex2(0.0f, 0.0f)) +:_center(Vertex2F(0.0f, 0.0f)) +,_resolution(Vertex2F(0.0f, 0.0f)) ,_time(0.0f) ,_uniformCenter(0) ,_uniformResolution(0) @@ -142,7 +142,7 @@ bool ShaderNode::initWithVertex(const char *vert, const char *frag) loadShaderVertex(vert, frag); _time = 0; - _resolution = vertex2(SIZE_X, SIZE_Y); + _resolution = Vertex2F(SIZE_X, SIZE_Y); scheduleUpdate(); @@ -189,7 +189,7 @@ void ShaderNode::setPosition(const Point &newPosition) { Node::setPosition(newPosition); Point position = getPosition(); - _center = vertex2(position.x * CC_CONTENT_SCALE_FACTOR(), position.y * CC_CONTENT_SCALE_FACTOR()); + _center = Vertex2F(position.x * CC_CONTENT_SCALE_FACTOR(), position.y * CC_CONTENT_SCALE_FACTOR()); } void ShaderNode::draw() @@ -522,7 +522,7 @@ void SpriteBlur::initProgram() void SpriteBlur::draw() { ccGLEnableVertexAttribs(kVertexAttribFlag_PosColorTex ); - ccBlendFunc blend = getBlendFunc(); + BlendFunc blend = getBlendFunc(); ccGLBlendFunc(blend.src, blend.dst); getShaderProgram()->use(); @@ -539,15 +539,15 @@ void SpriteBlur::draw() long offset = (long)&_quad; // vertex - int diff = offsetof( ccV3F_C4B_T2F, vertices); + int diff = offsetof( V3F_C4B_T2F, vertices); glVertexAttribPointer(kVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, kQuadSize, (void*) (offset + diff)); // texCoods - diff = offsetof( ccV3F_C4B_T2F, texCoords); + diff = offsetof( V3F_C4B_T2F, texCoords); glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, kQuadSize, (void*)(offset + diff)); // color - diff = offsetof( ccV3F_C4B_T2F, colors); + diff = offsetof( V3F_C4B_T2F, colors); glVertexAttribPointer(kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (void*)(offset + diff)); diff --git a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h index affc594563..09f70b987c 100644 --- a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h +++ b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h @@ -128,8 +128,8 @@ public: private: - ccVertex2F _center; - ccVertex2F _resolution; + Vertex2F _center; + Vertex2F _resolution; float _time; GLuint _uniformCenter, _uniformResolution, _uniformTime; std::string _vertFileName; diff --git a/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id b/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id index 60ce3793cf..b158328b7d 100644 --- a/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id +++ b/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id @@ -1 +1 @@ -9d636101bc1bf33b3bfec3876b688be6d848c863 \ No newline at end of file +0a20e584160edbced8ef614c066d758913ecdce9 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.cpp b/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.cpp index 62501bdae7..fcc99cfe72 100644 --- a/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.cpp +++ b/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.cpp @@ -369,7 +369,7 @@ bool TextFieldTTFActionTest::onTextFieldInsertText(TextFieldTTF * pSender, const // create a insert text sprite and do some action LabelTTF * label = LabelTTF::create(text, FONT_NAME, FONT_SIZE); this->addChild(label); - ccColor3B color = { 226, 121, 7}; + Color3B color = { 226, 121, 7}; label->setColor(color); // move the sprite from top to position diff --git a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp index 08469804d0..1a128309dd 100644 --- a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp +++ b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp @@ -116,7 +116,7 @@ void TextureDemo::onEnter() TextureCache::sharedTextureCache()->dumpCachedTextureInfo(); - LayerColor *col = LayerColor::create(ccc4(128,128,128,255)); + LayerColor *col = LayerColor::create(Color4B(128,128,128,255)); addChild(col, -10); TextureCache::sharedTextureCache()->dumpCachedTextureInfo(); @@ -1309,7 +1309,7 @@ void TexturePixelFormat::onEnter() Size s = Director::sharedDirector()->getWinSize(); - LayerColor *background = LayerColor::create(ccc4(128,128,128,255), s.width, s.height); + LayerColor *background = LayerColor::create(Color4B(128,128,128,255), s.width, s.height); addChild(background, -1); // RGBA 8888 image (32-bit) @@ -1412,7 +1412,7 @@ void TextureBlend::onEnter() Sprite *cloud = Sprite::create("Images/test_blend.png"); addChild(cloud, i+1, 100+i); cloud->setPosition(ccp(50+25*i, 80)); - ccBlendFunc blendFunc1 = { GL_ONE, GL_ONE_MINUS_SRC_ALPHA }; + BlendFunc blendFunc1 = { GL_ONE, GL_ONE_MINUS_SRC_ALPHA }; cloud->setBlendFunc(blendFunc1); // CENTER sprites have also alpha pre-multiplied @@ -1420,7 +1420,7 @@ void TextureBlend::onEnter() cloud = Sprite::create("Images/test_blend.png"); addChild(cloud, i+1, 200+i); cloud->setPosition(ccp(50+25*i, 160)); - ccBlendFunc blendFunc2 = { GL_ONE_MINUS_DST_COLOR, GL_ZERO }; + BlendFunc blendFunc2 = { GL_ONE_MINUS_DST_COLOR, GL_ZERO }; cloud->setBlendFunc(blendFunc2); // UPPER sprites are using custom blending function @@ -1428,7 +1428,7 @@ void TextureBlend::onEnter() cloud = Sprite::create("Images/test_blend.png"); addChild(cloud, i+1, 200+i); cloud->setPosition(ccp(50+25*i, 320-80)); - ccBlendFunc blendFunc3 = { GL_SRC_ALPHA, GL_ONE }; + BlendFunc blendFunc3 = { GL_SRC_ALPHA, GL_ONE }; cloud->setBlendFunc(blendFunc3); // additive blending } } @@ -1711,16 +1711,16 @@ void TextureDrawAtPoint::onEnter() TextureDemo::onEnter(); _tex1 = TextureCache::sharedTextureCache()->addImage("Images/grossinis_sister1.png"); - _tex2 = TextureCache::sharedTextureCache()->addImage("Images/grossinis_sister2.png"); + _Tex2F = TextureCache::sharedTextureCache()->addImage("Images/grossinis_sister2.png"); _tex1->retain(); - _tex2->retain(); + _Tex2F->retain(); } TextureDrawAtPoint::~TextureDrawAtPoint() { _tex1->release(); - _tex2->release(); + _Tex2F->release(); } std::string TextureDrawAtPoint::title() @@ -1740,7 +1740,7 @@ void TextureDrawAtPoint::draw() Size s = Director::sharedDirector()->getWinSize(); _tex1->drawAtPoint(ccp(s.width/2-50, s.height/2 - 50)); - _tex2->drawAtPoint(ccp(s.width/2+50, s.height/2 - 50)); + _Tex2F->drawAtPoint(ccp(s.width/2+50, s.height/2 - 50)); } @@ -1750,16 +1750,16 @@ void TextureDrawInRect::onEnter() { TextureDemo::onEnter(); _tex1 = TextureCache::sharedTextureCache()->addImage("Images/grossinis_sister1.png"); - _tex2 = TextureCache::sharedTextureCache()->addImage("Images/grossinis_sister2.png"); + _Tex2F = TextureCache::sharedTextureCache()->addImage("Images/grossinis_sister2.png"); _tex1->retain(); - _tex2->retain(); + _Tex2F->retain(); } TextureDrawInRect::~TextureDrawInRect() { _tex1->release(); - _tex2->release(); + _Tex2F->release(); } void TextureDrawInRect::draw() @@ -1772,7 +1772,7 @@ void TextureDrawInRect::draw() Rect rect2 = CCRectMake( s.width/2 + 80, s.height/2, _tex1->getContentSize().width * 2, _tex1->getContentSize().height * 0.5f ); _tex1->drawInRect(rect1); - _tex2->drawInRect(rect2); + _Tex2F->drawInRect(rect2); } @@ -1920,7 +1920,7 @@ TexturePVRv3Premult::TexturePVRv3Premult() { Size size = Director::sharedDirector()->getWinSize(); - LayerColor *background = LayerColor::create(ccc4(128,128,128,255), size.width, size.height); + LayerColor *background = LayerColor::create(Color4B(128,128,128,255), size.width, size.height); addChild(background, -1); diff --git a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h index 3b89db5140..b557237c98 100644 --- a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h +++ b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h @@ -399,7 +399,7 @@ public: virtual void onEnter(); virtual void draw(); private: - Texture2D* _tex1, *_tex2; + Texture2D* _tex1, *_Tex2F; }; class TextureDrawInRect : public TextureDemo @@ -411,7 +411,7 @@ public: virtual void onEnter(); virtual void draw(); private: - Texture2D* _tex1, *_tex2; + Texture2D* _tex1, *_Tex2F; }; class TextureTestScene : public TestScene diff --git a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp index 62dea8e334..9d42edc59b 100644 --- a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp +++ b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp @@ -84,7 +84,7 @@ void TileMapEditTest::updateMap(float dt) // over all your tiles in every frame. It's very expensive // for(int x=0; x < tilemap.tgaInfo->width; x++) { // for(int y=0; y < tilemap.tgaInfo->height; y++) { - // ccColor3B c =[tilemap tileAt:CCSizeMake(x,y)); + // Color3B c =[tilemap tileAt:CCSizeMake(x,y)); // if( c.r != 0 ) { // ////----CCLOG("%d,%d = %d", x,y,c.r); // } @@ -92,7 +92,7 @@ void TileMapEditTest::updateMap(float dt) // } // NEW since v0.7 - ccColor3B c = tilemap->tileAt(ccp(13,21)); + Color3B c = tilemap->tileAt(ccp(13,21)); c.r++; c.r %= 50; if( c.r==0) @@ -119,7 +119,7 @@ TMXOrthoTest::TMXOrthoTest() // // it should not flicker. No artifacts should appear // - //CCLayerColor* color = LayerColor::create( ccc4(64,64,64,255) ); + //CCLayerColor* color = LayerColor::create( Color4B(64,64,64,255) ); //addChild(color, -1); TMXTiledMap* map = TMXTiledMap::create("TileMaps/orthogonal-test2.tmx"); @@ -439,7 +439,7 @@ std::string TMXReadWriteTest::title() //------------------------------------------------------------------ TMXHexTest::TMXHexTest() { - LayerColor* color = LayerColor::create( ccc4(64,64,64,255) ); + LayerColor* color = LayerColor::create( Color4B(64,64,64,255) ); addChild(color, -1); TMXTiledMap* map = TMXTiledMap::create("TileMaps/hexa-test.tmx"); @@ -461,7 +461,7 @@ std::string TMXHexTest::title() //------------------------------------------------------------------ TMXIsoTest::TMXIsoTest() { - LayerColor* color = LayerColor::create( ccc4(64,64,64,255) ); + LayerColor* color = LayerColor::create( Color4B(64,64,64,255) ); addChild(color, -1); TMXTiledMap* map = TMXTiledMap::create("TileMaps/iso-test.tmx"); @@ -485,7 +485,7 @@ std::string TMXIsoTest::title() //------------------------------------------------------------------ TMXIsoTest1::TMXIsoTest1() { - LayerColor* color = LayerColor::create( ccc4(64,64,64,255) ); + LayerColor* color = LayerColor::create( Color4B(64,64,64,255) ); addChild(color, -1); TMXTiledMap *map = TMXTiledMap::create("TileMaps/iso-test1.tmx"); @@ -509,7 +509,7 @@ std::string TMXIsoTest1::title() //------------------------------------------------------------------ TMXIsoTest2::TMXIsoTest2() { - LayerColor* color = LayerColor::create( ccc4(64,64,64,255) ); + LayerColor* color = LayerColor::create( Color4B(64,64,64,255) ); addChild(color, -1); TMXTiledMap *map = TMXTiledMap::create("TileMaps/iso-test2.tmx"); @@ -536,7 +536,7 @@ std::string TMXIsoTest2::title() //------------------------------------------------------------------ TMXUncompressedTest::TMXUncompressedTest() { - LayerColor* color = LayerColor::create( ccc4(64,64,64,255) ); + LayerColor* color = LayerColor::create( Color4B(64,64,64,255) ); addChild(color, -1); TMXTiledMap *map = TMXTiledMap::create("TileMaps/iso-test2-uncompressed.tmx"); diff --git a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp b/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp index 1ee8ad276a..e6c63c3b61 100644 --- a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp +++ b/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp @@ -9,7 +9,7 @@ class FadeWhiteTransition : public TransitionFade public: static TransitionScene* create(float t, Scene* s) { - return TransitionFade::create(t, s, ccWHITE); + return TransitionFade::create(t, s, Color3B::white); } }; @@ -288,11 +288,11 @@ TestLayer1::TestLayer1(void) LabelTTF* title = LabelTTF::create( (transitions[s_nSceneIdx]).c_str(), "Thonburi", 32 ); addChild(title); - title->setColor( ccc3(255,32,32) ); + title->setColor( Color3B(255,32,32) ); title->setPosition( ccp(x/2, y-100) ); LabelTTF* label = LabelTTF::create("SCENE 1", "Marker Felt", 38); - label->setColor( ccc3(16,16,255)); + label->setColor( Color3B(16,16,255)); label->setPosition( ccp(x/2,y/2)); addChild( label); @@ -417,11 +417,11 @@ TestLayer2::TestLayer2() LabelTTF* title = LabelTTF::create((transitions[s_nSceneIdx]).c_str(), "Thonburi", 32 ); addChild(title); - title->setColor( ccc3(255,32,32) ); + title->setColor( Color3B(255,32,32) ); title->setPosition( ccp(x/2, y-100) ); LabelTTF* label = LabelTTF::create("SCENE 2", "Marker Felt", 38); - label->setColor( ccc3(16,16,255)); + label->setColor( Color3B(16,16,255)); label->setPosition( ccp(x/2,y/2)); addChild( label); diff --git a/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp b/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp index efaeb595d1..5782f3a359 100644 --- a/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp @@ -106,7 +106,7 @@ void ZwoptexGenericTest::onEnter() SpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("zwoptex/grossini.plist"); SpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("zwoptex/grossini-generic.plist"); - LayerColor *layer1 = LayerColor::create(ccc4(255, 0, 0, 255), 85, 121); + LayerColor *layer1 = LayerColor::create(Color4B(255, 0, 0, 255), 85, 121); layer1->setPosition(ccp(s.width/2-80 - (85.0f * 0.5f), s.height/2 - (121.0f * 0.5f))); addChild(layer1); @@ -117,7 +117,7 @@ void ZwoptexGenericTest::onEnter() sprite1->setFlipX(false); sprite1->setFlipY(false); - LayerColor *layer2 = LayerColor::create(ccc4(255, 0, 0, 255), 85, 121); + LayerColor *layer2 = LayerColor::create(Color4B(255, 0, 0, 255), 85, 121); layer2->setPosition(ccp(s.width/2+80 - (85.0f * 0.5f), s.height/2 - (121.0f * 0.5f))); addChild(layer2); diff --git a/samples/Lua/TestLua/Resources/luaScript/ActionsTest/ActionsTest.lua b/samples/Lua/TestLua/Resources/luaScript/ActionsTest/ActionsTest.lua index dced157738..335836eb2f 100644 --- a/samples/Lua/TestLua/Resources/luaScript/ActionsTest/ActionsTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/ActionsTest/ActionsTest.lua @@ -68,10 +68,10 @@ local function ActionManual() grossini:setRotation(120) grossini:setPosition(ccp(size.width / 2, size.height / 2)) - grossini:setColor(ccc3(255, 0, 0)) + grossini:setColor(Color3B(255, 0, 0)) kathia:setPosition(ccp(size.width - 100, size.height / 2)) - kathia:setColor(ccc3(0, 0, 255)) + kathia:setColor(Color3B(0, 0, 255)) Helper.subtitleLabel:setString("Manual Transformation") return layer @@ -178,7 +178,7 @@ local function ActionRotationalSkewVSStandardSkew() local s = CCDirector:sharedDirector():getWinSize(); local boxSize = CCSizeMake(100.0, 100.0); - local box = CCLayerColor:create(ccc4(255,255,0,255)); + local box = CCLayerColor:create(Color4B(255,255,0,255)); box:setAnchorPoint(ccp(0.5,0.5)); box:setContentSize( boxSize ); box:ignoreAnchorPointForPosition(false); @@ -193,7 +193,7 @@ local function ActionRotationalSkewVSStandardSkew() box:runAction(seq); - box = CCLayerColor:create(ccc4(255,255,0,255)); + box = CCLayerColor:create(Color4B(255,255,0,255)); box:setAnchorPoint(ccp(0.5,0.5)); box:setContentSize(boxSize); box:ignoreAnchorPointForPosition(false); @@ -224,19 +224,19 @@ local function ActionSkewRotate() local boxSize = CCSizeMake(100.0, 100.0) - local box = CCLayerColor:create(ccc4(255, 255, 0, 255)) + local box = CCLayerColor:create(Color4B(255, 255, 0, 255)) box:setAnchorPoint(ccp(0, 0)) box:setPosition(190, 110) box:setContentSize(boxSize) local markrside = 10.0 - local uL = CCLayerColor:create(ccc4(255, 0, 0, 255)) + local uL = CCLayerColor:create(Color4B(255, 0, 0, 255)) box:addChild(uL) uL:setContentSize(CCSizeMake(markrside, markrside)) uL:setPosition(0, boxSize.height - markrside) uL:setAnchorPoint(ccp(0, 0)) - local uR = CCLayerColor:create(ccc4(0, 0, 255, 255)) + local uR = CCLayerColor:create(Color4B(0, 0, 255, 255)) box:addChild(uR) uR:setContentSize(CCSizeMake(markrside, markrside)) uR:setPosition(boxSize.width - markrside, boxSize.height - markrside) diff --git a/samples/Lua/TestLua/Resources/luaScript/BugsTest/BugsTest.lua b/samples/Lua/TestLua/Resources/luaScript/BugsTest/BugsTest.lua index 787856efa6..16c22f163e 100644 --- a/samples/Lua/TestLua/Resources/luaScript/BugsTest/BugsTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/BugsTest/BugsTest.lua @@ -99,14 +99,14 @@ local function BugTest458() local pCorner = CCSprite:create("Images/bugs/corner.png"); local nWidth = Winsize.width * 0.9 - (pCorner:getContentSize().width * 2); local nHeight = Winsize.height * 0.15 - (pCorner:getContentSize().height * 2); - local pColorLayer = CCLayerColor:create(ccc4(255, 255, 255, 255 * .75), nWidth, nHeight); + local pColorLayer = CCLayerColor:create(Color4B(255, 255, 255, 255 * .75), nWidth, nHeight); pColorLayer:setPosition(ccp(-nWidth / 2, -nHeight / 2)); --First button is blue,Second is red,Used for testing - change later if (0 == nColorFlag) then - pLabel:setColor(ccc3(0,0,255)) + pLabel:setColor(Color3B(0,0,255)) else print("Color changed") - pLabel:setColor(ccc3(255,0,0)) + pLabel:setColor(Color3B(255,0,0)) end nColorFlag = nColorFlag + 1; pSprite:addChild(pColorLayer); @@ -167,11 +167,11 @@ local function BugTest458() end local pMenuItemSprite = CCMenuItemSprite:create(pQuestion1,pQuestion2) pMenuItemSprite:registerScriptTapHandler(menuCallback) - local pLayerColor1 = CCLayerColor:create(ccc4(0,0,255,255), 100, 100); + local pLayerColor1 = CCLayerColor:create(Color4B(0,0,255,255), 100, 100); -- question->release(); -- question2->release(); - local pLayerColor2 = CCLayerColor:create(ccc4(255,0,0,255), 100, 100); + local pLayerColor2 = CCLayerColor:create(Color4B(255,0,0,255), 100, 100); local pMenuItemSprite2 = CCMenuItemSprite:create(pLayerColor1, pLayerColor2); pMenuItemSprite2:registerScriptTapHandler(menuCallback) @@ -209,7 +209,7 @@ local function BugTest624() local pNewPlayer = BugTest624_2() CreateBugsTestBackMenuItem(pNewPlayer) pScene:addChild(pNewPlayer); - CCDirector:sharedDirector():replaceScene(CCTransitionFade:create(2.0, pScene, ccc3(255,255,255))); + CCDirector:sharedDirector():replaceScene(CCTransitionFade:create(2.0, pScene, Color3B(255,255,255))); end @@ -247,7 +247,7 @@ function BugTest624_2() local pNewPlayer = BugTest624() CreateBugsTestBackMenuItem(pNewPlayer) pScene:addChild(pNewPlayer); - CCDirector:sharedDirector():replaceScene(CCTransitionFade:create(2.0, pScene, ccc3(255,0,0))); + CCDirector:sharedDirector():replaceScene(CCTransitionFade:create(2.0, pScene, Color3B(255,0,0))); end local function BugTest624_2_OnEnterOrExit(tag) @@ -307,7 +307,7 @@ local function BugTest914() local pLayerColor = nil for i = 0, 4 do - pLayerColor = CCLayerColor:create(ccc4(i*20, i*20, i*20,255)) + pLayerColor = CCLayerColor:create(Color4B(i*20, i*20, i*20,255)) pLayerColor:setContentSize(CCSizeMake(i*100, i*100)); pLayerColor:setPosition(ccp(Winsize.width/2, Winsize.height/2)) pLayerColor:setAnchorPoint(ccp(0.5, 0.5)); @@ -367,10 +367,10 @@ local function BugTest1159() CCDirector:sharedDirector():setDepthTest(true) - local background = CCLayerColor:create(ccc4(255, 0, 255, 255)) + local background = CCLayerColor:create(Color4B(255, 0, 255, 255)) pLayer:addChild(background) - local sprite_a = CCLayerColor:create(ccc4(255, 0, 0, 255), 700, 700) + local sprite_a = CCLayerColor:create(Color4B(255, 0, 0, 255), 700, 700) sprite_a:setAnchorPoint(ccp(0.5, 0.5)) sprite_a:ignoreAnchorPointForPosition(false) sprite_a:setPosition(ccp(0.0, Winsize.height/2)) @@ -383,7 +383,7 @@ local function BugTest1159() local seq = CCSequence:create(arr) sprite_a:runAction(CCRepeatForever:create(seq)) - local sprite_b = CCLayerColor:create(ccc4(0, 0, 255, 255), 400, 400); + local sprite_b = CCLayerColor:create(Color4B(0, 0, 255, 255), 400, 400); sprite_b:setAnchorPoint(ccp(0.5, 0.5)) sprite_b:ignoreAnchorPointForPosition(false); sprite_b:setPosition(ccp(Winsize.width/2, Winsize.height/2)); diff --git a/samples/Lua/TestLua/Resources/luaScript/ClickAndMoveTest/ClickAndMoveTest.lua b/samples/Lua/TestLua/Resources/luaScript/ClickAndMoveTest/ClickAndMoveTest.lua index 76d2ce9ff0..ac194e390a 100644 --- a/samples/Lua/TestLua/Resources/luaScript/ClickAndMoveTest/ClickAndMoveTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/ClickAndMoveTest/ClickAndMoveTest.lua @@ -5,7 +5,7 @@ local kTagSprite = 1 local function initWithLayer() local sprite = CCSprite:create(s_pPathGrossini) - local bgLayer = CCLayerColor:create(ccc4(255,255,0,255)) + local bgLayer = CCLayerColor:create(Color4B(255,255,0,255)) layer:addChild(bgLayer, -1) layer:addChild(sprite, 0, kTagSprite) diff --git a/samples/Lua/TestLua/Resources/luaScript/DrawPrimitivesTest/DrawPrimitivesTest.lua b/samples/Lua/TestLua/Resources/luaScript/DrawPrimitivesTest/DrawPrimitivesTest.lua index 09eb761955..27c62fbb50 100644 --- a/samples/Lua/TestLua/Resources/luaScript/DrawPrimitivesTest/DrawPrimitivesTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/DrawPrimitivesTest/DrawPrimitivesTest.lua @@ -80,7 +80,7 @@ local function drawPrimitivesTest() -- // filled poly -- glLineWidth(1); -- CCPoint filledVertices[] = { ccp(0,120), ccp(50,120), ccp(50,170), ccp(25,200), ccp(0,170) }; --- ccDrawSolidPoly(filledVertices, 5, ccc4f(0.5f, 0.5f, 1, 1 ) ); +-- ccDrawSolidPoly(filledVertices, 5, Color4F(0.5f, 0.5f, 1, 1 ) ); -- -- -- // closed purble poly @@ -103,7 +103,7 @@ local function drawPrimitivesTest() -- -- //draw a solid polygon -- CCPoint vertices3[] = {ccp(60,160), ccp(70,190), ccp(100,190), ccp(90,160)}; --- ccDrawSolidPoly( vertices3, 4, ccc4f(1,1,0,1) ); +-- ccDrawSolidPoly( vertices3, 4, Color4F(1,1,0,1) ); -- -- // restore original values -- glLineWidth(1); diff --git a/samples/Lua/TestLua/Resources/luaScript/EffectsAdvancedTest/EffectsAdvancedTest.lua b/samples/Lua/TestLua/Resources/luaScript/EffectsAdvancedTest/EffectsAdvancedTest.lua index 5da5c4e367..936bf7e4fa 100644 --- a/samples/Lua/TestLua/Resources/luaScript/EffectsAdvancedTest/EffectsAdvancedTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/EffectsAdvancedTest/EffectsAdvancedTest.lua @@ -243,17 +243,17 @@ local function Issue631() ret:removeChild(bg, true) -- background - local layer = CCLayerColor:create( ccc4(255,0,0,255) ) + local layer = CCLayerColor:create( Color4B(255,0,0,255) ) ret:addChild(layer, -10) local sprite = CCSprite:create("Images/grossini.png") sprite:setPosition( ccp(50,80) ) layer:addChild(sprite, 10) -- foreground - local layer2 = CCLayerColor:create(ccc4( 0, 255,0,255 ) ) + local layer2 = CCLayerColor:create(Color4B( 0, 255,0,255 ) ) local fog = CCSprite:create("Images/Fog.png") - local bf = ccBlendFunc() + local bf = BlendFunc() bf.src = GL_SRC_ALPHA bf.dst = GL_ONE_MINUS_SRC_ALPHA diff --git a/samples/Lua/TestLua/Resources/luaScript/EffectsTest/EffectsTest.lua b/samples/Lua/TestLua/Resources/luaScript/EffectsTest/EffectsTest.lua index 81e342ac7f..690431ce24 100644 --- a/samples/Lua/TestLua/Resources/luaScript/EffectsTest/EffectsTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/EffectsTest/EffectsTest.lua @@ -357,7 +357,7 @@ local function createEffect(idx, t) end function CreateEffectsTestLayer() - testLayer = CCLayerColor:create(ccc4(32,128,32,255)) + testLayer = CCLayerColor:create(Color4B(32,128,32,255)) local x, y = size.width, size.height diff --git a/samples/Lua/TestLua/Resources/luaScript/ExtensionTest/CocosBuilderTest.lua b/samples/Lua/TestLua/Resources/luaScript/ExtensionTest/CocosBuilderTest.lua index 0c21dfbac4..e4ba61b1f0 100644 --- a/samples/Lua/TestLua/Resources/luaScript/ExtensionTest/CocosBuilderTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/ExtensionTest/CocosBuilderTest.lua @@ -96,7 +96,7 @@ local function onMenuTestClicked() if nil ~= scene then scene:addChild(layer) scene:addChild(CreateBackMenuItem()) - CCDirector:sharedDirector():pushScene(CCTransitionFade:create(0.5, scene, ccc3(0,0,0))); + CCDirector:sharedDirector():pushScene(CCTransitionFade:create(0.5, scene, Color3B(0,0,0))); end end @@ -125,7 +125,7 @@ local function onSpriteTestClicked() if nil ~= scene then scene:addChild(layer) scene:addChild(CreateBackMenuItem()) - CCDirector:sharedDirector():pushScene(CCTransitionFade:create(0.5, scene, ccc3(0,0,0))); + CCDirector:sharedDirector():pushScene(CCTransitionFade:create(0.5, scene, Color3B(0,0,0))); end end @@ -144,7 +144,7 @@ local function onButtonTestClicked() if nil ~= scene then scene:addChild(layer) scene:addChild(CreateBackMenuItem()) - CCDirector:sharedDirector():pushScene(CCTransitionFade:create(0.5, scene, ccc3(0,0,0))); + CCDirector:sharedDirector():pushScene(CCTransitionFade:create(0.5, scene, Color3B(0,0,0))); end end @@ -171,7 +171,7 @@ local function onAnimationsTestClicked() if nil ~= scene then scene:addChild(layer) scene:addChild(CreateBackMenuItem()) - CCDirector:sharedDirector():pushScene(CCTransitionFade:create(0.5, scene, ccc3(0,0,0))); + CCDirector:sharedDirector():pushScene(CCTransitionFade:create(0.5, scene, Color3B(0,0,0))); end end @@ -190,7 +190,7 @@ local function onParticleSystemTestClicked() if nil ~= scene then scene:addChild(layer) scene:addChild(CreateBackMenuItem()) - CCDirector:sharedDirector():pushScene(CCTransitionFade:create(0.5, scene, ccc3(0,0,0))); + CCDirector:sharedDirector():pushScene(CCTransitionFade:create(0.5, scene, Color3B(0,0,0))); end end @@ -250,7 +250,7 @@ local function onScrollViewTestClicked() if nil ~= scene then scene:addChild(layer) scene:addChild(CreateBackMenuItem()) - CCDirector:sharedDirector():pushScene(CCTransitionFade:create(0.5, scene, ccc3(0,0,0))); + CCDirector:sharedDirector():pushScene(CCTransitionFade:create(0.5, scene, Color3B(0,0,0))); end end @@ -269,7 +269,7 @@ local function onTimelineCallbackSoundClicked() if nil ~= scene then scene:addChild(layer) scene:addChild(CreateBackMenuItem()) - CCDirector:sharedDirector():pushScene(CCTransitionFade:create(0.5, scene, ccc3(0,0,0))); + CCDirector:sharedDirector():pushScene(CCTransitionFade:create(0.5, scene, Color3B(0,0,0))); end end diff --git a/samples/Lua/TestLua/Resources/luaScript/ExtensionTest/ExtensionTest.lua b/samples/Lua/TestLua/Resources/luaScript/ExtensionTest/ExtensionTest.lua index 80a5689a45..249c3b4d65 100644 --- a/samples/Lua/TestLua/Resources/luaScript/ExtensionTest/ExtensionTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/ExtensionTest/ExtensionTest.lua @@ -439,7 +439,7 @@ local function runCCControlTest() pColorLabel:setString(CCString:create(strFmt):getCString()) end local pColourPicker = CCControlColourPicker:create() - pColourPicker:setColor(ccc3(37, 46, 252)) + pColourPicker:setColor(Color3B(37, 46, 252)) pColourPicker:setPosition(ccp (pColourPicker:getContentSize().width / 2, 0)) pColourPicker:addHandleOfControlEvent(colourValueChanged, CCControlEventValueChanged) pNode:addChild(pColourPicker) @@ -534,11 +534,11 @@ local function runCCControlTest() pTitleButton = CCLabelTTF:create(pStrTitle, "Marker Felt", 30) - pTitleButton:setColor(ccc3(159, 168, 176)) + pTitleButton:setColor(Color3B(159, 168, 176)) local pButton = CCControlButton:create(pTitleButton, pBackgroundButton) pButton:setBackgroundSpriteForState(pBackgroundHighlightedButton, CCControlStateHighlighted) - pButton:setTitleColorForState(ccc3(255,255,255), CCControlStateHighlighted) + pButton:setTitleColorForState(Color3B(255,255,255), CCControlStateHighlighted) return pButton end @@ -594,11 +594,11 @@ local function runCCControlTest() local pTitleButton = CCLabelTTF:create(pStrTitle, "Marker Felt", 30) - pTitleButton:setColor(ccc3(159, 168, 176)) + pTitleButton:setColor(Color3B(159, 168, 176)) local pButton = CCControlButton:create(pTitleButton, pBackgroundButton) pButton:setBackgroundSpriteForState(pBackgroundHighlightedButton, CCControlStateHighlighted) - pButton:setTitleColorForState(ccc3(255,255,255), CCControlStateHighlighted) + pButton:setTitleColorForState(Color3B(255,255,255), CCControlStateHighlighted) return pButton end @@ -666,7 +666,7 @@ local function runCCControlTest() local pBackgroundHighlightedButton = CCScale9Sprite:create("extensions/buttonHighlighted.png") local pTitleButtonLabel = CCLabelTTF:create("Touch Me!", "Marker Felt", 30) - pTitleButtonLabel:setColor(ccc3(159, 168, 176)) + pTitleButtonLabel:setColor(Color3B(159, 168, 176)) local pControlButton = CCControlButton:create(pTitleButtonLabel, pBackgroundButton) local function touchDownAction() @@ -728,7 +728,7 @@ local function runCCControlTest() pControlButton:setBackgroundSpriteForState(pBackgroundHighlightedButton, CCControlStateHighlighted) - pControlButton:setTitleColorForState(ccc3(255, 255, 255), CCControlStateHighlighted) + pControlButton:setTitleColorForState(Color3B(255, 255, 255), CCControlStateHighlighted) pControlButton:setAnchorPoint(ccp(0.5, 1)) pControlButton:setPosition(ccp(screenSize.width / 2.0, screenSize.height / 2.0)) pControlButton:addHandleOfControlEvent(touchDownAction,CCControlEventTouchDown) @@ -955,9 +955,9 @@ local function runEditBoxTest() EditName:setFontName("fonts/Paint Boy.ttf") end EditName:setFontSize(25) - EditName:setFontColor(ccc3(255,0,0)) + EditName:setFontColor(Color3B(255,0,0)) EditName:setPlaceHolder("Name:") - EditName:setPlaceholderFontColor(ccc3(255,255,255)) + EditName:setPlaceholderFontColor(Color3B(255,255,255)) EditName:setMaxLength(8) EditName:setReturnType(kKeyboardReturnTypeDone) --Handler @@ -974,7 +974,7 @@ local function runEditBoxTest() end - EditPassword:setFontColor(ccc3(0,255,0)) + EditPassword:setFontColor(Color3B(0,255,0)) EditPassword:setPlaceHolder("Password:") EditPassword:setMaxLength(6) EditPassword:setInputFlag(kEditBoxInputFlagPassword) @@ -1007,7 +1007,7 @@ local function runScrollViewTest() pToMainMenu:setPosition(ccp(0, 0)) newLayer:addChild(pToMainMenu,10) - local layerColor = CCLayerColor:create(ccc4(128,64,0,255)) + local layerColor = CCLayerColor:create(Color4B(128,64,0,255)) newLayer:addChild(layerColor) local scrollView1 = CCScrollView:create() diff --git a/samples/Lua/TestLua/Resources/luaScript/FontTest/FontTest.lua b/samples/Lua/TestLua/Resources/luaScript/FontTest/FontTest.lua index 13cf465344..90b2771701 100644 --- a/samples/Lua/TestLua/Resources/luaScript/FontTest/FontTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/FontTest/FontTest.lua @@ -45,9 +45,9 @@ local function showFont(ret, pFont) local right = CCLabelTTF:create("alignment right", pFont, fontSize, blockSize, kCCTextAlignmentRight, verticalAlignment[vAlignIdx]) - local leftColor = CCLayerColor:create(ccc4(100, 100, 100, 255), blockSize.width, blockSize.height) - local centerColor = CCLayerColor:create(ccc4(200, 100, 100, 255), blockSize.width, blockSize.height) - local rightColor = CCLayerColor:create(ccc4(100, 100, 200, 255), blockSize.width, blockSize.height) + local leftColor = CCLayerColor:create(Color4B(100, 100, 100, 255), blockSize.width, blockSize.height) + local centerColor = CCLayerColor:create(Color4B(200, 100, 100, 255), blockSize.width, blockSize.height) + local rightColor = CCLayerColor:create(Color4B(100, 100, 200, 255), blockSize.width, blockSize.height) leftColor:ignoreAnchorPointForPosition(false) centerColor:ignoreAnchorPointForPosition(false) diff --git a/samples/Lua/TestLua/Resources/luaScript/LabelTest/LabelTest.lua b/samples/Lua/TestLua/Resources/luaScript/LabelTest/LabelTest.lua index 0941dbb871..bc2bfee58a 100644 --- a/samples/Lua/TestLua/Resources/luaScript/LabelTest/LabelTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/LabelTest/LabelTest.lua @@ -123,7 +123,7 @@ function LabelAtlasColorTest.create() local label2 = CCLabelAtlas:create("0123456789", "fonts/tuffy_bold_italic-charmap.plist") layer:addChild(label2, 0, kTagSprite2) label2:setPosition( ccp(10,200) ) - label2:setColor(ccc3(255, 0, 0)) + label2:setColor(Color3B(255, 0, 0)) local fade = CCFadeOut:create(1.0) local fade_in = fade:reverse() @@ -176,7 +176,7 @@ function Atlas3.create() m_time = 0 - local col = CCLayerColor:create( ccc4(128,128,128,255) ) + local col = CCLayerColor:create( Color4B(128,128,128,255) ) layer:addChild(col, -10) local label1 = CCLabelBMFont:create("Test", "fonts/bitmapFontTest2.fnt") @@ -203,7 +203,7 @@ function Atlas3.create() -- testing anchors label2:setAnchorPoint( ccp(0.5, 0.5) ) - label2:setColor(ccc3(255, 0, 0 )) + label2:setColor(Color3B(255, 0, 0 )) layer:addChild(label2, 0, kTagBitmapAtlas2) label2:runAction( tolua.cast(repeatAction:clone(), "CCAction") ) @@ -440,7 +440,7 @@ function AtlasBitmapColor:create() local s = CCDirector:sharedDirector():getWinSize() local label = CCLabelBMFont:create("Blue", "fonts/bitmapFontTest5.fnt") - label:setColor( ccc3(0, 0, 255 )) + label:setColor( Color3B(0, 0, 255 )) layer:addChild(label) label:setPosition( ccp(s.width/2, s.height/4) ) label:setAnchorPoint( ccp(0.5, 0.5) ) @@ -449,13 +449,13 @@ function AtlasBitmapColor:create() layer:addChild(label) label:setPosition( ccp(s.width/2, 2*s.height/4) ) label:setAnchorPoint( ccp(0.5, 0.5) ) - label:setColor( ccc3(255, 0, 0) ) + label:setColor( Color3B(255, 0, 0) ) label = CCLabelBMFont:create("G", "fonts/bitmapFontTest5.fnt") layer:addChild(label) label:setPosition( ccp(s.width/2, 3*s.height/4) ) label:setAnchorPoint( ccp(0.5, 0.5) ) - label:setColor( ccc3(0, 255, 0 )) + label:setColor( Color3B(0, 255, 0 )) label:setString("Green") Helper.titleLabel:setString("CCLabelBMFont") @@ -684,7 +684,7 @@ function LabelGlyphDesigner.create() local s = CCDirector:sharedDirector():getWinSize() - local colorlayer = CCLayerColor:create(ccc4(128,128,128,255)) + local colorlayer = CCLayerColor:create(Color4B(128,128,128,255)) layer:addChild(colorlayer, -10) -- CCLabelBMFont @@ -721,7 +721,7 @@ function LabelTTFTest.create() local blockSize = CCSizeMake(200, 160) local s = CCDirector:sharedDirector():getWinSize() - local colorLayer = CCLayerColor:create(ccc4(100, 100, 100, 255), blockSize.width, blockSize.height) + local colorLayer = CCLayerColor:create(Color4B(100, 100, 100, 255), blockSize.width, blockSize.height) colorLayer:setAnchorPoint(ccp(0,0)) colorLayer:setPosition(ccp((s.width - blockSize.width) / 2, (s.height - blockSize.height) / 2)) @@ -863,26 +863,26 @@ end -- -- -- -- Notice: u,v tex coordinates are inverted -- -- --- ccV3F_C4B_T2F_Quad quads[] = +-- V3F_C4B_T2F_Quad quads[] = -- { -- { --- {{0,0,0},ccc4(0,0,255,255),{0.0f,1.0f},}, -- bottom left --- {{s.width,0,0},ccc4(0,0,255,0),{1.0f,1.0f},}, -- bottom right --- {{0,s.height,0},ccc4(0,0,255,0),{0.0f,0.0f},}, -- top left +-- {{0,0,0},Color4B(0,0,255,255),{0.0f,1.0f},}, -- bottom left +-- {{s.width,0,0},Color4B(0,0,255,0),{1.0f,1.0f},}, -- bottom right +-- {{0,s.height,0},Color4B(0,0,255,0),{0.0f,0.0f},}, -- top left -- {{s.width,s.height,0},{0,0,255,255},{1.0f,0.0f},}, -- top right -- }, -- { --- {{40,40,0},ccc4(255,255,255,255),{0.0f,0.2f},}, -- bottom left --- {{120,80,0},ccc4(255,0,0,255),{0.5f,0.2f},}, -- bottom right --- {{40,160,0},ccc4(255,255,255,255),{0.0f,0.0f},}, -- top left --- {{160,160,0},ccc4(0,255,0,255),{0.5f,0.0f},}, -- top right +-- {{40,40,0},Color4B(255,255,255,255),{0.0f,0.2f},}, -- bottom left +-- {{120,80,0},Color4B(255,0,0,255),{0.5f,0.2f},}, -- bottom right +-- {{40,160,0},Color4B(255,255,255,255),{0.0f,0.0f},}, -- top left +-- {{160,160,0},Color4B(0,255,0,255),{0.5f,0.0f},}, -- top right -- }, -- -- { --- {{s.width/2,40,0},ccc4(255,0,0,255),{0.0f,1.0f},}, -- bottom left --- {{s.width,40,0},ccc4(0,255,0,255),{1.0f,1.0f},}, -- bottom right --- {{s.width/2-50,200,0},ccc4(0,0,255,255),{0.0f,0.0f},}, -- top left --- {{s.width,100,0},ccc4(255,255,0,255),{1.0f,0.0f},}, -- top right +-- {{s.width/2,40,0},Color4B(255,0,0,255),{0.0f,1.0f},}, -- bottom left +-- {{s.width,40,0},Color4B(0,255,0,255),{1.0f,1.0f},}, -- bottom right +-- {{s.width/2-50,200,0},Color4B(0,0,255,255),{0.0f,0.0f},}, -- top left +-- {{s.width,100,0},Color4B(255,255,0,255),{1.0f,0.0f},}, -- top right -- }, -- -- }; @@ -1032,7 +1032,7 @@ function BitmapFontMultiLineAlignment.create() stringMenu:addChild(mixed) stringMenu:alignItemsVertically() - longSentences:setColor(ccc3(255, 0, 0)) + longSentences:setColor(Color3B(255, 0, 0)) BitmapFontMultiLineAlignment._pLastSentenceItem = longSentences longSentences:setTag(LongSentences) @@ -1055,7 +1055,7 @@ function BitmapFontMultiLineAlignment.create() alignmentMenu:alignItemsHorizontallyWithPadding(alignmentItemPadding) - center:setColor(ccc3(255, 0, 0)) + center:setColor(Color3B(255, 0, 0)) BitmapFontMultiLineAlignment._pLastAlignmentItem = center left:setTag(LeftAlign) center:setTag(CenterAlign) @@ -1097,8 +1097,8 @@ end function BitmapFontMultiLineAlignment.stringChanged(tag, sender) local item = tolua.cast(sender, "CCMenuItemFont") - item:setColor(ccc3(255, 0, 0)) - BitmapFontMultiLineAlignment._pLastAlignmentItem:setColor(ccc3(255, 255, 255)) + item:setColor(Color3B(255, 0, 0)) + BitmapFontMultiLineAlignment._pLastAlignmentItem:setColor(Color3B(255, 255, 255)) BitmapFontMultiLineAlignment._pLastAlignmentItem = item if item:getTag() == LongSentences then @@ -1115,8 +1115,8 @@ end function BitmapFontMultiLineAlignment.alignmentChanged(tag, sender) -- cclog("BitmapFontMultiLineAlignment.alignmentChanged, tag:"..tag) local item = tolua.cast(sender, "CCMenuItemFont") - item:setColor(ccc3(255, 0, 0)) - BitmapFontMultiLineAlignment._pLastAlignmentItem:setColor(ccc3(255, 255, 255)) + item:setColor(Color3B(255, 0, 0)) + BitmapFontMultiLineAlignment._pLastAlignmentItem:setColor(Color3B(255, 255, 255)) BitmapFontMultiLineAlignment._pLastAlignmentItem = item if tag == LeftAlign then @@ -1176,13 +1176,13 @@ function LabelTTFA8Test.create() local s = CCDirector:sharedDirector():getWinSize() - local colorlayer = CCLayerColor:create(ccc4(128, 128, 128, 255)) + local colorlayer = CCLayerColor:create(Color4B(128, 128, 128, 255)) layer:addChild(colorlayer, -10) -- CCLabelBMFont local label1 = CCLabelTTF:create("Testing A8 Format", "Marker Felt", 48) layer:addChild(label1) - label1:setColor(ccc3(255, 0, 0)) + label1:setColor(Color3B(255, 0, 0)) label1:setPosition(ccp(s.width/2, s.height/2)) local fadeOut = CCFadeOut:create(2) @@ -1322,7 +1322,7 @@ function LabelBMFontBounds.create() local s = CCDirector:sharedDirector():getWinSize() - local colorlayer = CCLayerColor:create(ccc4(128,128,128,255)) + local colorlayer = CCLayerColor:create(Color4B(128,128,128,255)) layer:addChild(colorlayer, -10) -- CCLabelBMFont diff --git a/samples/Lua/TestLua/Resources/luaScript/LayerTest/LayerTest.lua b/samples/Lua/TestLua/Resources/luaScript/LayerTest/LayerTest.lua index 30c15fdaa2..026157bed8 100644 --- a/samples/Lua/TestLua/Resources/luaScript/LayerTest/LayerTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/LayerTest/LayerTest.lua @@ -103,7 +103,7 @@ local function LayerTestCascadingOpacityB() local ret = createLayerDemoLayer("CCLayerColor: cascading opacity") local s = CCDirector:sharedDirector():getWinSize() - local layer1 = CCLayerColor:create(ccc4(192, 0, 0, 255), s.width, s.height/2) + local layer1 = CCLayerColor:create(Color4B(192, 0, 0, 255), s.width, s.height/2) layer1:setCascadeColorEnabled(false) layer1:setPosition( ccp(0, s.height/2)) @@ -147,7 +147,7 @@ local function LayerTestCascadingOpacityC() local ret = createLayerDemoLayer("CCLayerColor: non-cascading opacity") local s = CCDirector:sharedDirector():getWinSize() - local layer1 = CCLayerColor:create(ccc4(192, 0, 0, 255), s.width, s.height/2) + local layer1 = CCLayerColor:create(Color4B(192, 0, 0, 255), s.width, s.height/2) layer1:setCascadeColorEnabled(false) layer1:setCascadeOpacityEnabled(false) @@ -245,7 +245,7 @@ local function LayerTestCascadingColorB() local ret = createLayerDemoLayer("CCLayerColor: cascading color") local s = CCDirector:sharedDirector():getWinSize() - local layer1 = CCLayerColor:create(ccc4(255, 255, 255, 255), s.width, s.height/2) + local layer1 = CCLayerColor:create(Color4B(255, 255, 255, 255), s.width, s.height/2) layer1:setPosition( ccp(0, s.height/2)) @@ -296,7 +296,7 @@ local function LayerTestCascadingColorC() local ret = createLayerDemoLayer("CCLayerColor: non-cascading color") local s = CCDirector:sharedDirector():getWinSize() - local layer1 = CCLayerColor:create(ccc4(255, 255, 255, 255), s.width, s.height/2) + local layer1 = CCLayerColor:create(Color4B(255, 255, 255, 255), s.width, s.height/2) layer1:setCascadeColorEnabled(false) layer1:setPosition( ccp(0, s.height/2)) @@ -350,7 +350,7 @@ local function LayerTest1() ret:setTouchEnabled(true) local s = CCDirector:sharedDirector():getWinSize() - local layer = CCLayerColor:create( ccc4(0xFF, 0x00, 0x00, 0x80), 200, 200) + local layer = CCLayerColor:create( Color4B(0xFF, 0x00, 0x00, 0x80), 200, 200) layer:ignoreAnchorPointForPosition(false) layer:setPosition( ccp(s.width/2, s.height/2) ) @@ -387,12 +387,12 @@ local function LayerTest2() local ret = createLayerDemoLayer("ColorLayer: fade and tint") local s = CCDirector:sharedDirector():getWinSize() - local layer1 = CCLayerColor:create( ccc4(255, 255, 0, 80), 100, 300) + local layer1 = CCLayerColor:create( Color4B(255, 255, 0, 80), 100, 300) layer1:setPosition(ccp(s.width/3, s.height/2)) layer1:ignoreAnchorPointForPosition(false) ret:addChild(layer1, 1) - local layer2 = CCLayerColor:create( ccc4(0, 0, 255, 255), 100, 300) + local layer2 = CCLayerColor:create( Color4B(0, 0, 255, 255), 100, 300) layer2:setPosition(ccp((s.width/3)*2, s.height/2)) layer2:ignoreAnchorPointForPosition(false) ret:addChild(layer2, 1) @@ -425,7 +425,7 @@ end local function LayerTestBlend() local ret = createLayerDemoLayer("ColorLayer: blend") local s = CCDirector:sharedDirector():getWinSize() - local layer1 = CCLayerColor:create( ccc4(255, 255, 255, 80) ) + local layer1 = CCLayerColor:create( Color4B(255, 255, 255, 80) ) local sister1 = CCSprite:create(s_pPathSister1) local sister2 = CCSprite:create(s_pPathSister2) @@ -451,7 +451,7 @@ local function LayerTestBlend() dst = GL_ZERO end - local bf = ccBlendFunc() + local bf = BlendFunc() bf.src = src bf.dst = dst layer:setBlendFunc( bf ) @@ -478,7 +478,7 @@ end -------------------------------------------------------------------- local function LayerGradient() local ret = createLayerDemoLayer("LayerGradient", "Touch the screen and move your finger") - local layer1 = CCLayerGradient:create(ccc4(255,0,0,255), ccc4(0,255,0,255), ccp(0.9, 0.9)) + local layer1 = CCLayerGradient:create(Color4B(255,0,0,255), Color4B(0,255,0,255), ccp(0.9, 0.9)) ret:addChild(layer1, 0, kTagLayer) ret:setTouchEnabled(true) @@ -532,7 +532,7 @@ local function LayerIgnoreAnchorPointPos() local s = CCDirector:sharedDirector():getWinSize() - local l = CCLayerColor:create(ccc4(255, 0, 0, 255), 150, 150) + local l = CCLayerColor:create(Color4B(255, 0, 0, 255), 150, 150) l:setAnchorPoint(ccp(0.5, 0.5)) l:setPosition(ccp( s.width/2, s.height/2)) @@ -574,7 +574,7 @@ local function LayerIgnoreAnchorPointRot() local s = CCDirector:sharedDirector():getWinSize() - local l = CCLayerColor:create(ccc4(255, 0, 0, 255), 200, 200) + local l = CCLayerColor:create(Color4B(255, 0, 0, 255), 200, 200) l:setAnchorPoint(ccp(0.5, 0.5)) l:setPosition(ccp( s.width/2, s.height/2)) @@ -611,7 +611,7 @@ local function LayerIgnoreAnchorPointScale() local ret = createLayerDemoLayer("IgnoreAnchorPoint - Scale", "Ignoring Anchor Point for scale") local s = CCDirector:sharedDirector():getWinSize() - local l = CCLayerColor:create(ccc4(255, 0, 0, 255), 200, 200) + local l = CCLayerColor:create(Color4B(255, 0, 0, 255), 200, 200) l:setAnchorPoint(ccp(0.5, 1.0)) l:setPosition(ccp( s.width/2, s.height/2)) @@ -653,12 +653,12 @@ end local function LayerExtendedBlendOpacityTest() local ret = createLayerDemoLayer("Extended Blend & Opacity", "You should see 3 layers") - local layer1 = CCLayerGradient:create(ccc4(255, 0, 0, 255), ccc4(255, 0, 255, 255)) + local layer1 = CCLayerGradient:create(Color4B(255, 0, 0, 255), Color4B(255, 0, 255, 255)) layer1:setContentSize(CCSizeMake(80, 80)) layer1:setPosition(ccp(50,50)) ret:addChild(layer1) - local layer2 = CCLayerGradient:create(ccc4(0, 0, 0, 127), ccc4(255, 255, 255, 127)) + local layer2 = CCLayerGradient:create(Color4B(0, 0, 0, 127), Color4B(255, 255, 255, 127)) layer2:setContentSize(CCSizeMake(80, 80)) layer2:setPosition(ccp(100,90)) ret:addChild(layer2) @@ -666,11 +666,11 @@ local function LayerExtendedBlendOpacityTest() local layer3 = CCLayerGradient:create() layer3:setContentSize(CCSizeMake(80, 80)) layer3:setPosition(ccp(150,140)) - layer3:setStartColor(ccc3(255, 0, 0)) - layer3:setEndColor(ccc3(255, 0, 255)) + layer3:setStartColor(Color3B(255, 0, 0)) + layer3:setEndColor(Color3B(255, 0, 255)) layer3:setStartOpacity(255) layer3:setEndOpacity(255) - local blend = ccBlendFunc() + local blend = BlendFunc() blend.src = GL_SRC_ALPHA blend.dst = GL_ONE_MINUS_SRC_ALPHA layer3:setBlendFunc(blend) diff --git a/samples/Lua/TestLua/Resources/luaScript/MenuTest/MenuTest.lua b/samples/Lua/TestLua/Resources/luaScript/MenuTest/MenuTest.lua index 2a217df4e7..7a48954b45 100644 --- a/samples/Lua/TestLua/Resources/luaScript/MenuTest/MenuTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/MenuTest/MenuTest.lua @@ -73,8 +73,8 @@ local function MenuLayerMainMenu() local labelAtlas = CCLabelAtlas:create("0123456789", "fonts/labelatlas.png", 16, 24, string.byte('.')) local item3 = CCMenuItemLabel:create(labelAtlas) item3:registerScriptTapHandler(menuCallbackDisabled) - item3:setDisabledColor( ccc3(32,32,64) ) - item3:setColor( ccc3(200,200,255) ) + item3:setDisabledColor( Color3B(32,32,64) ) + item3:setColor( Color3B(200,200,255) ) local function menuCallbackEnable(sender) m_disabledItem:setEnabled(not m_disabledItem:isEnabled() ) @@ -553,7 +553,7 @@ local function MenuLayerPriorityTest() CCMenuItemFont:setFontSize(48) item1 = CCMenuItemFont:create("Toggle priority") item2:registerScriptTapHandler(togglePriorityCallback) - item1:setColor(ccc3(0,0,255)) + item1:setColor(Color3B(0,0,255)) m_pMenu2:addChild(item1) ret:addChild(m_pMenu2) return ret diff --git a/samples/Lua/TestLua/Resources/luaScript/MotionStreakTest/MotionStreakTest.lua b/samples/Lua/TestLua/Resources/luaScript/MotionStreakTest/MotionStreakTest.lua index ba57c64701..57215ad307 100644 --- a/samples/Lua/TestLua/Resources/luaScript/MotionStreakTest/MotionStreakTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/MotionStreakTest/MotionStreakTest.lua @@ -69,7 +69,7 @@ local function MotionStreakTest1() root:addChild(target) target:setPosition(ccp(s.width / 4, 0)) - streak = CCMotionStreak:create(2, 3, 32, ccc3(0, 255, 0), s_streak) + streak = CCMotionStreak:create(2, 3, 32, Color3B(0, 255, 0), s_streak) layer:addChild(streak) local a1 = CCRotateBy:create(2, 360) @@ -103,7 +103,7 @@ end local function MotionStreakTest2() local layer = getBaseLayer() - streak = CCMotionStreak:create(3, 3, 64, ccc3(255, 255, 255), s_streak) + streak = CCMotionStreak:create(3, 3, 64, Color3B(255, 255, 255), s_streak) layer:addChild(streak) streak:setPosition(CCPointMake(s.width / 2, s.height / 2)) @@ -163,7 +163,7 @@ end local function Issue1358() local layer = getBaseLayer() - streak = CCMotionStreak:create(2.0, 1.0, 50.0, ccc3(255, 255, 0), "Images/Icon.png") + streak = CCMotionStreak:create(2.0, 1.0, 50.0, Color3B(255, 255, 0), "Images/Icon.png") layer:addChild(streak) center = ccp(s.width / 2, s.height / 2) diff --git a/samples/Lua/TestLua/Resources/luaScript/NodeTest/NodeTest.lua b/samples/Lua/TestLua/Resources/luaScript/NodeTest/NodeTest.lua index eccd8b69bb..1d8e26cd91 100644 --- a/samples/Lua/TestLua/Resources/luaScript/NodeTest/NodeTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/NodeTest/NodeTest.lua @@ -24,7 +24,7 @@ local function CameraCenterTest() local sprite = CCSprite:create("Images/white-512x512.png") layer:addChild(sprite, 0) sprite:setPosition(CCPointMake(s.width / 5 * 1, s.height / 5 * 1)) - sprite:setColor(ccc3(255, 0, 0)) + sprite:setColor(Color3B(255, 0, 0)) sprite:setTextureRect(CCRectMake(0, 0, 120, 50)) local orbit = CCOrbitCamera:create(10, 1, 0, 0, 360, 0, 0) sprite:runAction(CCRepeatForever:create(orbit)) @@ -34,7 +34,7 @@ local function CameraCenterTest() sprite = CCSprite:create("Images/white-512x512.png") layer:addChild(sprite, 0, 40) sprite:setPosition(CCPointMake(s.width / 5 * 1, s.height / 5 * 4)) - sprite:setColor(ccc3(0, 0, 255)) + sprite:setColor(Color3B(0, 0, 255)) sprite:setTextureRect(CCRectMake(0, 0, 120, 50)) orbit = CCOrbitCamera:create(10, 1, 0, 0, 360, 0, 0) sprite:runAction(CCRepeatForever:create(orbit)) @@ -43,7 +43,7 @@ local function CameraCenterTest() sprite = CCSprite:create("Images/white-512x512.png") layer:addChild(sprite, 0) sprite:setPosition(CCPointMake(s.width / 5 * 4, s.height / 5 * 1)) - sprite:setColor(ccc3(255, 255, 0)) + sprite:setColor(Color3B(255, 255, 0)) sprite:setTextureRect(CCRectMake(0, 0, 120, 50)) orbit = CCOrbitCamera:create(10, 1, 0, 0, 360, 0, 0) sprite:runAction(CCRepeatForever:create(orbit)) @@ -52,7 +52,7 @@ local function CameraCenterTest() sprite = CCSprite:create("Images/white-512x512.png") layer:addChild(sprite, 0, 40) sprite:setPosition(CCPointMake(s.width / 5 * 4, s.height / 5 * 4)) - sprite:setColor(ccc3(0, 255, 0)) + sprite:setColor(Color3B(0, 255, 0)) sprite:setTextureRect(CCRectMake(0, 0, 120, 50)) orbit = CCOrbitCamera:create(10, 1, 0, 0, 360, 0, 0) sprite:runAction(CCRepeatForever:create(orbit)) @@ -61,7 +61,7 @@ local function CameraCenterTest() sprite = CCSprite:create("Images/white-512x512.png") layer:addChild(sprite, 0, 40) sprite:setPosition(CCPointMake(s.width / 2, s.height / 2)) - sprite:setColor(ccc3(255, 255, 255)) + sprite:setColor(Color3B(255, 255, 255)) sprite:setTextureRect(CCRectMake(0, 0, 120, 50)) orbit = CCOrbitCamera:create(10, 1, 0, 0, 360, 0, 0) sprite:runAction(CCRepeatForever:create(orbit)) @@ -613,7 +613,7 @@ local function NodeOpaqueTest() for i = 0, 49 do local background = CCSprite:create("Images/background1.png") - local blendFunc = ccBlendFunc:new() + local blendFunc = BlendFunc:new() blendFunc.src = GL_ONE blendFunc.dst = GL_ONE_MINUS_SRC_ALPHA background:setBlendFunc(blendFunc) @@ -634,7 +634,7 @@ local function NodeNonOpaqueTest() for i = 0, 49 do background = CCSprite:create("Images/background1.jpg") - local blendFunc = ccBlendFunc:new() + local blendFunc = BlendFunc:new() blendFunc.src = GL_ONE blendFunc.dst = GL_ZERO background:setBlendFunc(blendFunc) diff --git a/samples/Lua/TestLua/Resources/luaScript/OpenGLTest/OpenGLTest.lua b/samples/Lua/TestLua/Resources/luaScript/OpenGLTest/OpenGLTest.lua index ec77bb972f..45d5dd1be7 100644 --- a/samples/Lua/TestLua/Resources/luaScript/OpenGLTest/OpenGLTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/OpenGLTest/OpenGLTest.lua @@ -128,7 +128,7 @@ local function OpenGLTestMainLayer() local lableTitle = CCLabelTTF:create(GetTitle(), "Arial", 40) layer:addChild(lableTitle, 15) lableTitle:setPosition(ccp(size.width/2, size.height-32)) - lableTitle:setColor(ccc3(255,255,40)) + lableTitle:setColor(Color3B(255,255,40)) --SubTitle local subLabelTitle = CCLabelTTF:create(GetSubTitle(), "Thonburi", 16) layer:addChild(subLabelTitle, 15) @@ -695,10 +695,10 @@ local function OpenGLTestMainLayer() local x = size.width local y = size.height - local blue = CCLayerColor:create(ccc4(0, 0, 255, 255)) - local red = CCLayerColor:create(ccc4(255, 0, 0, 255)) - local green = CCLayerColor:create(ccc4(0, 255, 0, 255)) - local white = CCLayerColor:create(ccc4(255, 255, 255, 255)) + local blue = CCLayerColor:create(Color4B(0, 0, 255, 255)) + local red = CCLayerColor:create(Color4B(255, 0, 0, 255)) + local green = CCLayerColor:create(Color4B(0, 255, 0, 255)) + local white = CCLayerColor:create(Color4B(255, 255, 255, 255)) blue:setScale(0.5) blue:setPosition(-x / 4, -y / 4) @@ -776,7 +776,7 @@ local function OpenGLTestMainLayer() local clearLayer = CCLayer:create() InitTitle(clearLayer) - local blue = CCLayerColor:create(ccc4(0, 0, 255, 255)) + local blue = CCLayerColor:create(Color4B(0, 0, 255, 255)) clearLayer:addChild( blue, 1 ) local glNode = gl.glNodeCreate() diff --git a/samples/Lua/TestLua/Resources/luaScript/ParticleTest/ParticleTest.lua b/samples/Lua/TestLua/Resources/luaScript/ParticleTest/ParticleTest.lua index 8953393edb..4d113d7fd5 100644 --- a/samples/Lua/TestLua/Resources/luaScript/ParticleTest/ParticleTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/ParticleTest/ParticleTest.lua @@ -94,7 +94,7 @@ local function baseLayer_onEnterOrExit(tag) end local function getBaseLayer() - local layer = CCLayerColor:create(ccc4(127,127,127,255)) + local layer = CCLayerColor:create(Color4B(127,127,127,255)) emitter = nil @@ -223,7 +223,7 @@ local function ParticleReorder() ParticleReorder_layer = getBaseLayer() ParticleReorder_Order = 0 - ParticleReorder_layer:setColor(ccc3(0, 0, 0)) + ParticleReorder_layer:setColor(Color3B(0, 0, 0)) ParticleReorder_layer:removeChild(background, true) background = nil @@ -241,13 +241,13 @@ local function ParticleReorder() end local emitter1 = CCParticleSystemQuad:create("Particles/SmallSun.plist") - emitter1:setStartColor(ccc4f(1,0,0,1)) + emitter1:setStartColor(Color4F(1,0,0,1)) emitter1:setBlendAdditive(false) local emitter2 = CCParticleSystemQuad:create("Particles/SmallSun.plist") - emitter2:setStartColor(ccc4f(0,1,0,1)) + emitter2:setStartColor(Color4F(0,1,0,1)) emitter2:setBlendAdditive(false) local emitter3 = CCParticleSystemQuad:create("Particles/SmallSun.plist") - emitter3:setStartColor(ccc4f(0,0,1,1)) + emitter3:setStartColor(Color4F(0,0,1,1)) emitter3:setBlendAdditive(false) local neg = nil @@ -313,7 +313,7 @@ end local function ParticleBatchHybrid() local layer = getBaseLayer() - layer:setColor(ccc3(0, 0, 0)) + layer:setColor(Color3B(0, 0, 0)) layer:removeChild(background, true) background = nil @@ -341,16 +341,16 @@ end local function ParticleBatchMultipleEmitters() local layer = getBaseLayer() - layer:setColor(ccc3(0, 0, 0)) + layer:setColor(Color3B(0, 0, 0)) layer:removeChild(background, true) background = nil local emitter1 = CCParticleSystemQuad:create("Particles/LavaFlow.plist") - emitter1:setStartColor(ccc4f(1,0,0,1)) + emitter1:setStartColor(Color4F(1,0,0,1)) local emitter2 = CCParticleSystemQuad:create("Particles/LavaFlow.plist") - emitter2:setStartColor(ccc4f(0,1,0,1)) + emitter2:setStartColor(Color4F(0,1,0,1)) local emitter3 = CCParticleSystemQuad:create("Particles/LavaFlow.plist") - emitter3:setStartColor(ccc4f(0,0,1,1)) + emitter3:setStartColor(Color4F(0,0,1,1)) emitter1:setPosition(ccp(s.width / 1.25, s.height / 1.25)) emitter2:setPosition(ccp(s.width / 2, s.height / 2)) @@ -647,10 +647,10 @@ local function DemoBigFlower() emitter:setEndSpinVar(0) -- color of particles - emitter:setStartColor(ccc4f(0.5, 0.5, 0.5, 1.0)) - emitter:setStartColorVar(ccc4f(0.5, 0.5, 0.5, 1.0)) - emitter:setEndColor(ccc4f(0.1, 0.1, 0.1, 0.2)) - emitter:setEndColorVar(ccc4f(0.1, 0.1, 0.1, 0.2)) + emitter:setStartColor(Color4F(0.5, 0.5, 0.5, 1.0)) + emitter:setStartColorVar(Color4F(0.5, 0.5, 0.5, 1.0)) + emitter:setEndColor(Color4F(0.1, 0.1, 0.1, 0.2)) + emitter:setEndColorVar(Color4F(0.1, 0.1, 0.1, 0.2)) -- size, in pixels emitter:setStartSize(80.0) @@ -720,10 +720,10 @@ local function DemoRotFlower() emitter:setEndSpinVar(2000) -- color of particles - emitter:setStartColor(ccc4f(0.5, 0.5, 0.5, 1.0)) - emitter:setStartColorVar(ccc4f(0.5, 0.5, 0.5, 1.0)) - emitter:setEndColor(ccc4f(0.1, 0.1, 0.1, 0.2)) - emitter:setEndColorVar(ccc4f(0.1, 0.1, 0.1, 0.2)) + emitter:setStartColor(Color4F(0.5, 0.5, 0.5, 1.0)) + emitter:setStartColorVar(Color4F(0.5, 0.5, 0.5, 1.0)) + emitter:setEndColor(Color4F(0.1, 0.1, 0.1, 0.2)) + emitter:setEndColorVar(Color4F(0.1, 0.1, 0.1, 0.2)) -- size, in pixels emitter:setStartSize(30.0) @@ -789,10 +789,10 @@ local function DemoModernArt() emitter:setEmissionRate(emitter:getTotalParticles() / emitter:getLife()) -- color of particles - emitter:setStartColor(ccc4f(0.5, 0.5, 0.5, 1.0)) - emitter:setStartColorVar(ccc4f(0.5, 0.5, 0.5, 1.0)) - emitter:setEndColor(ccc4f(0.1, 0.1, 0.1, 0.2)) - emitter:setEndColorVar(ccc4f(0.1, 0.1, 0.1, 0.2)) + emitter:setStartColor(Color4F(0.5, 0.5, 0.5, 1.0)) + emitter:setStartColorVar(Color4F(0.5, 0.5, 0.5, 1.0)) + emitter:setEndColor(Color4F(0.1, 0.1, 0.1, 0.2)) + emitter:setEndColorVar(Color4F(0.1, 0.1, 0.1, 0.2)) -- size, in pixels emitter:setStartSize(1.0) @@ -880,7 +880,7 @@ end local function DemoParticleFromFile(name) local layer = getBaseLayer() - layer:setColor(ccc3(0, 0, 0)) + layer:setColor(Color3B(0, 0, 0)) layer:removeChild(background, true) background = nil @@ -902,7 +902,7 @@ end local function RadiusMode1() local layer = getBaseLayer() - layer:setColor(ccc3(0, 0, 0)) + layer:setColor(Color3B(0, 0, 0)) layer:removeChild(background, true) background = nil @@ -947,10 +947,10 @@ local function RadiusMode1() emitter:setEndSpinVar(0) -- color of particles - emitter:setStartColor(ccc4f(0.5, 0.5, 0.5, 1.0)) - emitter:setStartColorVar(ccc4f(0.5, 0.5, 0.5, 1.0)) - emitter:setEndColor(ccc4f(0.1, 0.1, 0.1, 0.2)) - emitter:setEndColorVar(ccc4f(0.1, 0.1, 0.1, 0.2)) + emitter:setStartColor(Color4F(0.5, 0.5, 0.5, 1.0)) + emitter:setStartColorVar(Color4F(0.5, 0.5, 0.5, 1.0)) + emitter:setEndColor(Color4F(0.1, 0.1, 0.1, 0.2)) + emitter:setEndColorVar(Color4F(0.1, 0.1, 0.1, 0.2)) -- size, in pixels emitter:setStartSize(32) @@ -973,7 +973,7 @@ end local function RadiusMode2() local layer = getBaseLayer() - layer:setColor(ccc3(0, 0, 0)) + layer:setColor(Color3B(0, 0, 0)) layer:removeChild(background, true) background = nil @@ -1017,10 +1017,10 @@ local function RadiusMode2() emitter:setEndSpinVar(0) -- color of particles - emitter:setStartColor(ccc4f(0.5, 0.5, 0.5, 1.0)) - emitter:setStartColorVar(ccc4f(0.5, 0.5, 0.5, 1.0)) - emitter:setEndColor(ccc4f(0.1, 0.1, 0.1, 0.2)) - emitter:setEndColorVar(ccc4f(0.1, 0.1, 0.1, 0.2)) + emitter:setStartColor(Color4F(0.5, 0.5, 0.5, 1.0)) + emitter:setStartColorVar(Color4F(0.5, 0.5, 0.5, 1.0)) + emitter:setEndColor(Color4F(0.1, 0.1, 0.1, 0.2)) + emitter:setEndColorVar(Color4F(0.1, 0.1, 0.1, 0.2)) -- size, in pixels emitter:setStartSize(32) @@ -1043,7 +1043,7 @@ end local function Issue704() local layer = getBaseLayer() - layer:setColor(ccc3(0, 0, 0)) + layer:setColor(Color3B(0, 0, 0)) layer:removeChild(background, true) background = nil @@ -1088,10 +1088,10 @@ local function Issue704() emitter:setEndSpinVar(0) -- color of particles - emitter:setStartColor(ccc4f(0.5, 0.5, 0.5, 1.0)) - emitter:setStartColorVar(ccc4f(0.5, 0.5, 0.5, 1.0)) - emitter:setEndColor(ccc4f(0.1, 0.1, 0.1, 0.2)) - emitter:setEndColorVar(ccc4f(0.1, 0.1, 0.1, 0.2)) + emitter:setStartColor(Color4F(0.5, 0.5, 0.5, 1.0)) + emitter:setStartColorVar(Color4F(0.5, 0.5, 0.5, 1.0)) + emitter:setEndColor(Color4F(0.1, 0.1, 0.1, 0.2)) + emitter:setEndColorVar(Color4F(0.1, 0.1, 0.1, 0.2)) -- size, in pixels emitter:setStartSize(16) @@ -1138,7 +1138,7 @@ end local function Issue870() local layer = getBaseLayer() - layer:setColor(ccc3(0, 0, 0)) + layer:setColor(Color3B(0, 0, 0)) layer:removeChild(background, true) background = nil @@ -1162,7 +1162,7 @@ end local function MultipleParticleSystems() local layer = getBaseLayer() - layer:setColor(ccc3(0, 0, 0)) + layer:setColor(Color3B(0, 0, 0)) layer:removeChild(background, true) background = nil @@ -1188,7 +1188,7 @@ end local function MultipleParticleSystemsBatched() local layer = getBaseLayer() - layer:setColor(ccc3(0, 0, 0)) + layer:setColor(Color3B(0, 0, 0)) layer:removeChild(background, true) background = nil @@ -1250,7 +1250,7 @@ end local function AddAndDeleteParticleSystems() local layer = getBaseLayer() - layer:setColor(ccc3(0, 0, 0)) + layer:setColor(Color3B(0, 0, 0)) layer:removeChild(background, true) background = nil @@ -1308,7 +1308,7 @@ end local function ReorderParticleSystems() local layer = getBaseLayer() - layer:setColor(ccc3(0, 0, 0)) + layer:setColor(Color3B(0, 0, 0)) layer:removeChild(background ,true) background = nil @@ -1357,7 +1357,7 @@ local function ReorderParticleSystems() particleSystem:setEndSpinVar(0) -- color of particles - local startColor = ccColor4F:new() + local startColor = Color4F:new() startColor.r = 0 startColor.g = 0 startColor.b = 0 @@ -1368,11 +1368,11 @@ local function ReorderParticleSystems() end particleSystem:setStartColor(startColor) - particleSystem:setStartColorVar(ccc4f(0, 0, 0, 0)) + particleSystem:setStartColorVar(Color4F(0, 0, 0, 0)) local endColor = startColor particleSystem:setEndColor(endColor) - particleSystem:setEndColorVar(ccc4f(0, 0, 0, 0)) + particleSystem:setEndColorVar(Color4F(0, 0, 0, 0)) -- size, in pixels particleSystem:setStartSize(32) @@ -1405,23 +1405,23 @@ end local function PremultipliedAlphaTest() local layer = getBaseLayer() - layer:setColor(ccc3(0, 0, 255)) + layer:setColor(Color3B(0, 0, 255)) layer:removeChild(background, true) background = nil emitter = CCParticleSystemQuad:create("Particles/BoilingFoam.plist") - local tBlendFunc = ccBlendFunc:new() + local tBlendFunc = BlendFunc:new() tBlendFunc.src = 1 --GL_ONE tBlendFunc.dst = 0x0303 --GL_ONE_MINUS_SRC_ALPHA emitter:setBlendFunc(tBlendFunc) --assert(emitter:getOpacityModifyRGB(), "Particle texture does not have premultiplied alpha, test is useless") - emitter:setStartColor(ccc4f(1, 1, 1, 1)) - emitter:setEndColor(ccc4f(1, 1, 1, 0)) - emitter:setStartColorVar(ccc4f(0, 0, 0, 0)) - emitter:setEndColorVar(ccc4f(0, 0, 0, 0)) + emitter:setStartColor(Color4F(1, 1, 1, 1)) + emitter:setEndColor(Color4F(1, 1, 1, 0)) + emitter:setStartColorVar(Color4F(0, 0, 0, 0)) + emitter:setEndColorVar(Color4F(0, 0, 0, 0)) layer:addChild(emitter, 10) @@ -1436,7 +1436,7 @@ end local function PremultipliedAlphaTest2() local layer = getBaseLayer() - layer:setColor(ccc3(0, 0, 0)) + layer:setColor(Color3B(0, 0, 0)) layer:removeChild(background, true) background = nil diff --git a/samples/Lua/TestLua/Resources/luaScript/PerformanceTest/PerformanceSpriteTest.lua b/samples/Lua/TestLua/Resources/luaScript/PerformanceTest/PerformanceSpriteTest.lua index 3bf61fd67e..cb2281b10c 100644 --- a/samples/Lua/TestLua/Resources/luaScript/PerformanceTest/PerformanceSpriteTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/PerformanceTest/PerformanceSpriteTest.lua @@ -345,10 +345,10 @@ local function initWithMainTest(scene, asubtest, nNodes) CCMenuItemFont:setFontSize(65) local decrease = CCMenuItemFont:create(" - ") decrease:registerScriptTapHandler(onDecrease) - decrease:setColor(ccc3(0, 200, 20)) + decrease:setColor(Color3B(0, 200, 20)) local increase = CCMenuItemFont:create(" + ") increase:registerScriptTapHandler(onIncrease) - increase:setColor(ccc3(0, 200, 20)) + increase:setColor(Color3B(0, 200, 20)) local menu = CCMenu:create() menu:addChild(decrease) @@ -358,7 +358,7 @@ local function initWithMainTest(scene, asubtest, nNodes) scene:addChild(menu, 1) infoLabel = CCLabelTTF:create("0 nodes", "Marker Felt", 30) - infoLabel:setColor(ccc3(0, 200, 20)) + infoLabel:setColor(Color3B(0, 200, 20)) infoLabel:setPosition(s.width / 2, s.height - 90) scene:addChild(infoLabel, 1) @@ -375,11 +375,11 @@ local function initWithMainTest(scene, asubtest, nNodes) subMenu:addChild(itemFont, kBasicZOrder + i, kBasicZOrder + i) if i <= 3 then - itemFont:setColor(ccc3(200, 20, 20)) + itemFont:setColor(Color3B(200, 20, 20)) elseif i <= 6 then - itemFont:setColor(ccc3(0, 200, 20)) + itemFont:setColor(Color3B(0, 200, 20)) else - itemFont:setColor(ccc3(0, 20, 200)) + itemFont:setColor(Color3B(0, 20, 200)) end end @@ -391,7 +391,7 @@ local function initWithMainTest(scene, asubtest, nNodes) titleLabel = CCLabelTTF:create("No title", "Arial", 40) scene:addChild(titleLabel, 1) titleLabel:setPosition(s.width / 2, s.height - 32) - titleLabel:setColor(ccc3(255, 255, 40)) + titleLabel:setColor(Color3B(255, 255, 40)) while quantityNodes < nNodes do onIncrease() diff --git a/samples/Lua/TestLua/Resources/luaScript/PerformanceTest/PerformanceTest.lua b/samples/Lua/TestLua/Resources/luaScript/PerformanceTest/PerformanceTest.lua index 9a1f18ba4f..45e96b7c4f 100644 --- a/samples/Lua/TestLua/Resources/luaScript/PerformanceTest/PerformanceTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/PerformanceTest/PerformanceTest.lua @@ -342,7 +342,7 @@ local function runNodeChildrenTest() local pLabel = CCLabelTTF:create(GetTitle(), "Arial", 40) pNewscene:addChild(pLabel, 1) pLabel:setPosition(ccp(s.width/2, s.height-32)) - pLabel:setColor(ccc3(255,255,40)) + pLabel:setColor(Color3B(255,255,40)) if (nil ~= GetSubTitle()) and ("" ~= GetSubTitle()) then local pSubLabel = CCLabelTTF:create(GetSubTitle(), "Thonburi", 16) @@ -358,10 +358,10 @@ local function runNodeChildrenTest() CCMenuItemFont:setFontSize(65) local pDecrease = CCMenuItemFont:create(" - ") pDecrease:registerScriptTapHandler(onDecrease) - pDecrease:setColor(ccc3(0,200,20)) + pDecrease:setColor(Color3B(0,200,20)) local pIncrease = CCMenuItemFont:create(" + ") pIncrease:registerScriptTapHandler(onIncrease) - pIncrease:setColor(ccc3(0,200,20)) + pIncrease:setColor(Color3B(0,200,20)) local pMenuAddOrSub = CCMenu:create() pMenuAddOrSub:addChild(pDecrease) @@ -372,7 +372,7 @@ local function runNodeChildrenTest() --InfoLayer local pInfoLabel = CCLabelTTF:create("0 nodes", "Marker Felt", 30) - pInfoLabel:setColor(ccc3(0,200,20)) + pInfoLabel:setColor(Color3B(0,200,20)) pInfoLabel:setPosition(ccp(s.width/2, s.height/2-15)) pNewscene:addChild(pInfoLabel, 1, NodeChildrenTestParam.kTagInfoLayer) @@ -555,13 +555,13 @@ local function runParticleTest() pParticleSystem:setEmissionRate(pParticleSystem:getTotalParticles() / pParticleSystem:getLife()) --color of particles - pParticleSystem:setStartColor(ccc4f(0.5, 0.5, 0.5, 1.0)) + pParticleSystem:setStartColor(Color4F(0.5, 0.5, 0.5, 1.0)) - pParticleSystem:setStartColorVar( ccc4f(0.5, 0.5, 0.5, 1.0)) + pParticleSystem:setStartColorVar( Color4F(0.5, 0.5, 0.5, 1.0)) - pParticleSystem:setEndColor(ccc4f(0.1, 0.1, 0.1, 0.2)) + pParticleSystem:setEndColor(Color4F(0.1, 0.1, 0.1, 0.2)) - pParticleSystem:setEndColorVar(ccc4f(0.1, 0.1, 0.1, 0.2)) + pParticleSystem:setEndColorVar(Color4F(0.1, 0.1, 0.1, 0.2)) -- size, in pixels pParticleSystem:setEndSize(4.0) @@ -603,13 +603,13 @@ local function runParticleTest() pParticleSystem:setEmissionRate(pParticleSystem:getTotalParticles() / pParticleSystem:getLife()) --color of particles - pParticleSystem:setStartColor(ccc4f(0.5, 0.5, 0.5, 1.0)) + pParticleSystem:setStartColor(Color4F(0.5, 0.5, 0.5, 1.0)) - pParticleSystem:setStartColorVar( ccc4f(0.5, 0.5, 0.5, 1.0)) + pParticleSystem:setStartColorVar( Color4F(0.5, 0.5, 0.5, 1.0)) - pParticleSystem:setEndColor(ccc4f(0.1, 0.1, 0.1, 0.2)) + pParticleSystem:setEndColor(Color4F(0.1, 0.1, 0.1, 0.2)) - pParticleSystem:setEndColorVar(ccc4f(0.1, 0.1, 0.1, 0.2)) + pParticleSystem:setEndColorVar(Color4F(0.1, 0.1, 0.1, 0.2)) -- size, in pixels pParticleSystem:setEndSize(8.0) @@ -650,13 +650,13 @@ local function runParticleTest() pParticleSystem:setEmissionRate(pParticleSystem:getTotalParticles() / pParticleSystem:getLife()) --color of particles - pParticleSystem:setStartColor(ccc4f(0.5, 0.5, 0.5, 1.0)) + pParticleSystem:setStartColor(Color4F(0.5, 0.5, 0.5, 1.0)) - pParticleSystem:setStartColorVar( ccc4f(0.5, 0.5, 0.5, 1.0)) + pParticleSystem:setStartColorVar( Color4F(0.5, 0.5, 0.5, 1.0)) - pParticleSystem:setEndColor(ccc4f(0.1, 0.1, 0.1, 0.2)) + pParticleSystem:setEndColor(Color4F(0.1, 0.1, 0.1, 0.2)) - pParticleSystem:setEndColorVar(ccc4f(0.1, 0.1, 0.1, 0.2)) + pParticleSystem:setEndColorVar(Color4F(0.1, 0.1, 0.1, 0.2)) -- size, in pixels pParticleSystem:setEndSize(32.0) @@ -697,13 +697,13 @@ local function runParticleTest() pParticleSystem:setEmissionRate(pParticleSystem:getTotalParticles() / pParticleSystem:getLife()) --color of particles - pParticleSystem:setStartColor(ccc4f(0.5, 0.5, 0.5, 1.0)) + pParticleSystem:setStartColor(Color4F(0.5, 0.5, 0.5, 1.0)) - pParticleSystem:setStartColorVar( ccc4f(0.5, 0.5, 0.5, 1.0)) + pParticleSystem:setStartColorVar( Color4F(0.5, 0.5, 0.5, 1.0)) - pParticleSystem:setEndColor(ccc4f(0.1, 0.1, 0.1, 0.2)) + pParticleSystem:setEndColor(Color4F(0.1, 0.1, 0.1, 0.2)) - pParticleSystem:setEndColorVar(ccc4f(0.1, 0.1, 0.1, 0.2)) + pParticleSystem:setEndColorVar(Color4F(0.1, 0.1, 0.1, 0.2)) -- size, in pixels pParticleSystem:setEndSize(64.0) @@ -815,10 +815,10 @@ local function runParticleTest() CCMenuItemFont:setFontSize(65) local pDecrease = CCMenuItemFont:create(" - ") pDecrease:registerScriptTapHandler(onDecrease) - pDecrease:setColor(ccc3(0,200,20)) + pDecrease:setColor(Color3B(0,200,20)) local pIncrease = CCMenuItemFont:create(" + ") pIncrease:registerScriptTapHandler(onIncrease) - pIncrease:setColor(ccc3(0,200,20)) + pIncrease:setColor(Color3B(0,200,20)) local pMenuAddOrSub = CCMenu:create() pMenuAddOrSub:addChild(pDecrease) @@ -828,7 +828,7 @@ local function runParticleTest() pNewScene:addChild(pMenuAddOrSub,1) local pInfoLabel = CCLabelTTF:create("0 nodes", "Marker Felt", 30) - pInfoLabel:setColor(ccc3(0,200,20)) + pInfoLabel:setColor(Color3B(0,200,20)) pInfoLabel:setPosition(ccp(s.width/2, s.height - 90)) pNewScene:addChild(pInfoLabel, 1, ParticleTestParam.kTagInfoLayer) @@ -856,9 +856,9 @@ local function runParticleTest() pItemFont:registerScriptTapHandler(TestNCallback) pSubMenu:addChild(pItemFont, i + ParticleTestParam.kSubMenuBasicZOrder) if i <= 3 then - pItemFont:setColor(ccc3(200,20,20)) + pItemFont:setColor(Color3B(200,20,20)) else - pItemFont:setColor(ccc3(0,200,20)) + pItemFont:setColor(Color3B(0,200,20)) end end pSubMenu:alignItemsHorizontally() @@ -868,7 +868,7 @@ local function runParticleTest() local pLabel = CCLabelTTF:create(GetTitle(), "Arial", 40) pNewScene:addChild(pLabel, 1) pLabel:setPosition(ccp(s.width/2, s.height-32)) - pLabel:setColor(ccc3(255,255,40)) + pLabel:setColor(Color3B(255,255,40)) UpdateQuantityLabel() CreateParticleSystem() @@ -1268,10 +1268,10 @@ local function runSpriteTest() CCMenuItemFont:setFontSize(65) local pDecrease = CCMenuItemFont:create(" - ") pDecrease:registerScriptTapHandler(onDecrease) - pDecrease:setColor(ccc3(0,200,20)) + pDecrease:setColor(Color3B(0,200,20)) local pIncrease = CCMenuItemFont:create(" + ") pIncrease:registerScriptTapHandler(onIncrease) - pIncrease:setColor(ccc3(0,200,20)) + pIncrease:setColor(Color3B(0,200,20)) local pMenuAddOrSub = CCMenu:create() pMenuAddOrSub:addChild(pDecrease) @@ -1281,7 +1281,7 @@ local function runSpriteTest() pNewScene:addChild(pMenuAddOrSub,1) local pInfoLabel = CCLabelTTF:create("0 nodes", "Marker Felt", 30) - pInfoLabel:setColor(ccc3(0,200,20)) + pInfoLabel:setColor(Color3B(0,200,20)) pInfoLabel:setPosition(ccp(s.width/2, s.height - 90)) pNewScene:addChild(pInfoLabel, 1, SpriteTestParam.kTagInfoLayer) @@ -1305,11 +1305,11 @@ local function runSpriteTest() pItemFont:registerScriptTapHandler(TestNCallback) pSubMenu:addChild(pItemFont, i + SpriteTestParam.kSubMenuBasicZOrder) if i <= 3 then - pItemFont:setColor(ccc3(200,20,20)) + pItemFont:setColor(Color3B(200,20,20)) elseif i <= 6 then - pItemFont:setColor(ccc3(0,200,20)) + pItemFont:setColor(Color3B(0,200,20)) else - pItemFont:setColor(ccc3(0,20,200)) + pItemFont:setColor(Color3B(0,20,200)) end end @@ -1321,7 +1321,7 @@ local function runSpriteTest() local pLabel = CCLabelTTF:create(GetTitle(), "Arial", 40) pNewScene:addChild(pLabel, 1) pLabel:setPosition(ccp(s.width/2, s.height-32)) - pLabel:setColor(ccc3(255,255,40)) + pLabel:setColor(Color3B(255,255,40)) while nQuantityNodes < nNodes do onIncrease() end @@ -1440,7 +1440,7 @@ local function runTextureTest() local pLabel = CCLabelTTF:create(GetTitle(), "Arial", 40) pLayer:addChild(pLabel, 1) pLabel:setPosition(ccp(s.width/2, s.height-32)) - pLabel:setColor(ccc3(255,255,40)) + pLabel:setColor(Color3B(255,255,40)) --Subtitle local pSubLabel = CCLabelTTF:create(GetSubtitle(), "Thonburi", 16) @@ -1616,7 +1616,7 @@ local function runTouchesTest() local pLabel = CCLabelTTF:create(GetTitle(), "Arial", 40) pLayer:addChild(pLabel, 1) pLabel:setPosition(ccp(s.width/2, s.height-32)) - pLabel:setColor(ccc3(255,255,40)) + pLabel:setColor(Color3B(255,255,40)) pLayer:scheduleUpdateWithPriorityLua(update,0) diff --git a/samples/Lua/TestLua/Resources/luaScript/RenderTextureTest/RenderTextureTest.lua b/samples/Lua/TestLua/Resources/luaScript/RenderTextureTest/RenderTextureTest.lua index c4dd7c01d0..4dff8ab9d8 100644 --- a/samples/Lua/TestLua/Resources/luaScript/RenderTextureTest/RenderTextureTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/RenderTextureTest/RenderTextureTest.lua @@ -62,7 +62,7 @@ local function RenderTextureSave() -- create a brush image to draw into the texture with m_pBrush = CCSprite:create("Images/fire.png") m_pBrush:retain() - m_pBrush:setColor(ccc3(255, 0, 0)) + m_pBrush:setColor(Color3B(255, 0, 0)) m_pBrush:setOpacity(20) @@ -98,7 +98,7 @@ local function RenderTextureSave() m_pBrush:setScale(r) -- Use CCRANDOM_0_1() will cause error when loading libtests.so on android, I don't know why. - m_pBrush:setColor(ccc3(math.random(0, 126) + 128, 255, 255)) + m_pBrush:setColor(Color3B(math.random(0, 126) + 128, 255, 255)) -- Call visit to draw the brush, don't call draw.. m_pBrush:visit() end @@ -150,7 +150,7 @@ end -- * B1: non-premulti sprite -- * B2: non-premulti render -- */ --- local background = CCLayerColor:create(ccc4(200,200,200,255)) +-- local background = CCLayerColor:create(Color4B(200,200,200,255)) -- addChild(background) -- local spr_premulti = CCSprite:create("Images/fire.png") @@ -171,7 +171,7 @@ end -- end -- -- It's possible to modify the RenderTexture blending function by --- -- [[rend sprite] setBlendFunc:(ccBlendFunc) GL_ONE, GL_ONE_MINUS_SRC_ALPHAend] +-- -- [[rend sprite] setBlendFunc:(BlendFunc) GL_ONE, GL_ONE_MINUS_SRC_ALPHAend] -- rend:begin() -- spr_premulti:visit() @@ -268,7 +268,7 @@ end -- sp9:setVertexZ(-400) -- sp9:setScale(2) --- sp9:setColor(ccYELLOW) +-- sp9:setColor(Color3B::yellow) -- end -- local function title() @@ -348,7 +348,7 @@ end -- sprite:setOpacity(182) -- sprite:setFlipY(1) -- this:addChild(sprite, 999999) --- sprite:setColor(ccGREEN) +-- sprite:setColor(Color3B::green) -- sprite:runAction(CCSequence:create(CCFadeTo:create(2, 0), -- CCHide:create(), @@ -416,7 +416,7 @@ end -- * B1: non-premulti sprite -- * B2: non-premulti render -- */ --- local background = CCLayerColor:create(ccc4(40,40,40,255)) +-- local background = CCLayerColor:create(Color4B(40,40,40,255)) -- addChild(background) -- -- sprite 1 @@ -438,7 +438,7 @@ end -- /* add the sprites to the render texture */ -- renderTexture:addChild(sprite1) -- renderTexture:addChild(sprite2) --- renderTexture:setClearColor(ccc4f(0, 0, 0, 0)) +-- renderTexture:setClearColor(Color4F(0, 0, 0, 0)) -- renderTexture:setClearFlags(GL_COLOR_BUFFER_BIT) -- /* add the render texture to the scene */ @@ -465,7 +465,7 @@ end -- else -- renderTexture:setClearFlags(0) --- renderTexture:setClearColor(ccc4f( CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1)) +-- renderTexture:setClearColor(Color4F( CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1)) -- end -- end @@ -521,7 +521,7 @@ end -- CC_NODE_DRAW_SETUP() --- ccBlendFunc blend = getBlendFunc() +-- BlendFunc blend = getBlendFunc() -- ccGLBlendFunc(blend.src, blend.dst) -- ccGLBindTexture2D(getTexture():getName()) @@ -536,15 +536,15 @@ end -- long offset = (long)&m_sQuad -- -- vertex --- int diff = offsetof( ccV3F_C4B_T2F, vertices) +-- int diff = offsetof( V3F_C4B_T2F, vertices) -- glVertexAttribPointer(kCCVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, kQuadSize, (void*) (offset + diff)) -- -- texCoods --- diff = offsetof( ccV3F_C4B_T2F, texCoords) +-- diff = offsetof( V3F_C4B_T2F, texCoords) -- glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, kQuadSize, (void*)(offset + diff)) -- -- color --- diff = offsetof( ccV3F_C4B_T2F, colors) +-- diff = offsetof( V3F_C4B_T2F, colors) -- glVertexAttribPointer(kCCVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (void*)(offset + diff)) -- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4) diff --git a/samples/Lua/TestLua/Resources/luaScript/RotateWorldTest/RotateWorldTest.lua b/samples/Lua/TestLua/Resources/luaScript/RotateWorldTest/RotateWorldTest.lua index d1dd0e9f61..7a25265412 100644 --- a/samples/Lua/TestLua/Resources/luaScript/RotateWorldTest/RotateWorldTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/RotateWorldTest/RotateWorldTest.lua @@ -68,10 +68,10 @@ local function CreateRotateWorldLayer() x = size.width y = size.height - local blue = CCLayerColor:create(ccc4(0,0,255,255)) - local red = CCLayerColor:create(ccc4(255,0,0,255)) - local green = CCLayerColor:create(ccc4(0,255,0,255)) - local white = CCLayerColor:create(ccc4(255,255,255,255)) + local blue = CCLayerColor:create(Color4B(0,0,255,255)) + local red = CCLayerColor:create(Color4B(255,0,0,255)) + local green = CCLayerColor:create(Color4B(0,255,0,255)) + local white = CCLayerColor:create(Color4B(255,255,255,255)) blue:setScale(0.5) blue:setPosition(CCPointMake(- x / 4, - y / 4)) diff --git a/samples/Lua/TestLua/Resources/luaScript/SceneTest/SceneTest.lua b/samples/Lua/TestLua/Resources/luaScript/SceneTest/SceneTest.lua index 0b38245300..3258da52c4 100644 --- a/samples/Lua/TestLua/Resources/luaScript/SceneTest/SceneTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/SceneTest/SceneTest.lua @@ -139,13 +139,13 @@ end -------------------------------------------------------------------- SceneTestLayer3 = function() - local ret = CCLayerColor:create(ccc4(0,0,255,255)) + local ret = CCLayerColor:create(Color4B(0,0,255,255)) local s = CCDirector:sharedDirector():getWinSize() local function item0Clicked(tag, pSender) local newScene = CCScene:create() newScene:addChild(SceneTestLayer3()) - CCDirector:sharedDirector():pushScene(CCTransitionFade:create(0.5, newScene, ccc3(0,255,255))) + CCDirector:sharedDirector():pushScene(CCTransitionFade:create(0.5, newScene, Color3B(0,255,255))) end local function item1Clicked(tag, pSender) diff --git a/samples/Lua/TestLua/Resources/luaScript/Texture2dTest/Texture2dTest.lua b/samples/Lua/TestLua/Resources/luaScript/Texture2dTest/Texture2dTest.lua index 706c9ab029..81c67f0742 100644 --- a/samples/Lua/TestLua/Resources/luaScript/Texture2dTest/Texture2dTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/Texture2dTest/Texture2dTest.lua @@ -8,7 +8,7 @@ local function createTestLayer(title, subtitle) local ret = originCreateLayer(title, subtitle) Helper.titleLabel:setTag(kTagLabel) CCTextureCache:sharedTextureCache():dumpCachedTextureInfo() - local col = CCLayerColor:create(ccc4(128,128,128,255)) + local col = CCLayerColor:create(Color4B(128,128,128,255)) ret:addChild(col, -10) CCTextureCache:sharedTextureCache():dumpCachedTextureInfo() return ret @@ -872,11 +872,11 @@ local function TexturePixelFormat() -- 4- 16-bit RGB565 local label = tolua.cast(ret:getChildByTag(kTagLabel), "CCLabelTTF") - label:setColor(ccc3(16,16,255)) + label:setColor(Color3B(16,16,255)) local s = CCDirector:sharedDirector():getWinSize() - local background = CCLayerColor:create(ccc4(128,128,128,255), s.width, s.height) + local background = CCLayerColor:create(Color4B(128,128,128,255), s.width, s.height) ret:addChild(background, -1) -- RGBA 8888 image (32-bit) @@ -973,7 +973,7 @@ local function TextureBlend() local cloud = CCSprite:create("Images/test_blend.png") ret:addChild(cloud, i+1, 100+i) cloud:setPosition(ccp(50+25*i, 80)) - local blendFunc1 = ccBlendFunc() + local blendFunc1 = BlendFunc() blendFunc1.src = GL_ONE blendFunc1.dst = GL_ONE_MINUS_SRC_ALPHA cloud:setBlendFunc(blendFunc1) @@ -983,7 +983,7 @@ local function TextureBlend() cloud = CCSprite:create("Images/test_blend.png") ret:addChild(cloud, i+1, 200+i) cloud:setPosition(ccp(50+25*i, 160)) - local blendFunc2 = ccBlendFunc() + local blendFunc2 = BlendFunc() blendFunc2.src = GL_ONE_MINUS_DST_COLOR blendFunc2.dst = GL_ZERO cloud:setBlendFunc(blendFunc2) @@ -993,7 +993,7 @@ local function TextureBlend() cloud = CCSprite:create("Images/test_blend.png") ret:addChild(cloud, i+1, 200+i) cloud:setPosition(ccp(50+25*i, 320-80)) - local blendFunc3 = ccBlendFunc() + local blendFunc3 = BlendFunc() blendFunc3.src = GL_SRC_ALPHA blendFunc3.dst = GL_ONE cloud:setBlendFunc(blendFunc3) -- additive blending @@ -1256,7 +1256,7 @@ end -- TextureDrawAtPoint local function TextureDrawAtPoint() local m_pTex1 = nil - local m_pTex2 = nil + local m_pTex2F = nil local ret = createTestLayer("CCTexture2D: drawAtPoint", "draws 2 textures using drawAtPoint") @@ -1266,18 +1266,18 @@ local function TextureDrawAtPoint() local s = CCDirector:sharedDirector():getWinSize() m_pTex1:drawAtPoint(ccp(s.width/2-50, s.height/2 - 50)) - m_pTex2:drawAtPoint(ccp(s.width/2+50, s.height/2 - 50)) + m_pTex2F:drawAtPoint(ccp(s.width/2+50, s.height/2 - 50)) end m_pTex1 = CCTextureCache:sharedTextureCache():addImage("Images/grossinis_sister1.png") - m_pTex2 = CCTextureCache:sharedTextureCache():addImage("Images/grossinis_sister2.png") + m_pTex2F = CCTextureCache:sharedTextureCache():addImage("Images/grossinis_sister2.png") m_pTex1:retain() - m_pTex2:retain() + m_pTex2F:retain() local function onNodeEvent(event) if event == "exit" then m_pTex1:release() - m_pTex2:release() + m_pTex2F:release() end end @@ -1300,18 +1300,18 @@ local function TextureDrawInRect() local rect2 = CCRectMake( s.width/2 + 80, s.height/2, m_pTex1:getContentSize().width * 2, m_pTex1:getContentSize().height * 0.5 ) m_pTex1:drawInRect(rect1) - m_pTex2:drawInRect(rect2) + m_pTex2F:drawInRect(rect2) end local m_pTex1 = CCTextureCache:sharedTextureCache():addImage("Images/grossinis_sister1.png") - local m_pTex2 = CCTextureCache:sharedTextureCache():addImage("Images/grossinis_sister2.png") + local m_pTex2F = CCTextureCache:sharedTextureCache():addImage("Images/grossinis_sister2.png") m_pTex1:retain() - m_pTex2:retain() + m_pTex2F:retain() local function onNodeEvent(event) if event == "exit" then m_pTex1:release() - m_pTex2:release() + m_pTex2F:release() end end @@ -1433,7 +1433,7 @@ local function TexturePVRv3Premult() local size = CCDirector:sharedDirector():getWinSize() - local background = CCLayerColor:create(ccc4(128,128,128,255), size.width, size.height) + local background = CCLayerColor:create(Color4B(128,128,128,255), size.width, size.height) ret:addChild(background, -1) diff --git a/samples/Lua/TestLua/Resources/luaScript/TileMapTest/TileMapTest.lua b/samples/Lua/TestLua/Resources/luaScript/TileMapTest/TileMapTest.lua index e801544914..bb237d069a 100644 --- a/samples/Lua/TestLua/Resources/luaScript/TileMapTest/TileMapTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/TileMapTest/TileMapTest.lua @@ -101,7 +101,7 @@ local function TileMapEditTest() -- over all your tiles in every frame. It's very expensive -- for(int x=0 x < tilemap.tgaInfo:width x++) -- for(int y=0 y < tilemap.tgaInfo:height y++) - -- ccColor3B c =[tilemap tileAt:local Make(x,y)) + -- Color3B c =[tilemap tileAt:local Make(x,y)) -- if( c.r != 0 ) -- --------cclog("%d,%d = %d", x,y,c.r) -- end @@ -152,7 +152,7 @@ local function TMXOrthoTest() -- -- it should not flicker. No artifacts should appear -- - --local color = CCLayerColor:create( ccc4(64,64,64,255) ) + --local color = CCLayerColor:create( Color4B(64,64,64,255) ) --addChild(color, -1) local map = CCTMXTiledMap:create("TileMaps/orthogonal-test2.tmx") @@ -496,7 +496,7 @@ end -------------------------------------------------------------------- local function TMXHexTest() local ret = createTileDemoLayer("TMX Hex tes") - local color = CCLayerColor:create( ccc4(64,64,64,255) ) + local color = CCLayerColor:create( Color4B(64,64,64,255) ) ret:addChild(color, -1) local map = CCTMXTiledMap:create("TileMaps/hexa-test.tmx") @@ -514,7 +514,7 @@ end -------------------------------------------------------------------- local function TMXIsoTest() local ret = createTileDemoLayer("TMX Isometric test 0") - local color = CCLayerColor:create( ccc4(64,64,64,255) ) + local color = CCLayerColor:create( Color4B(64,64,64,255) ) ret:addChild(color, -1) local map = CCTMXTiledMap:create("TileMaps/iso-test.tmx") @@ -534,7 +534,7 @@ end -------------------------------------------------------------------- local function TMXIsoTest1() local ret = createTileDemoLayer("TMX Isometric test + anchorPoint") - local color = CCLayerColor:create( ccc4(64,64,64,255) ) + local color = CCLayerColor:create( Color4B(64,64,64,255) ) ret:addChild(color, -1) local map = CCTMXTiledMap:create("TileMaps/iso-test1.tmx") @@ -554,7 +554,7 @@ end -------------------------------------------------------------------- local function TMXIsoTest2() local ret = createTileDemoLayer("TMX Isometric test 2") - local color = CCLayerColor:create( ccc4(64,64,64,255) ) + local color = CCLayerColor:create( Color4B(64,64,64,255) ) ret:addChild(color, -1) local map = CCTMXTiledMap:create("TileMaps/iso-test2.tmx") @@ -577,7 +577,7 @@ end -------------------------------------------------------------------- local function TMXUncompressedTest() local ret = createTileDemoLayer("TMX Uncompressed test") - local color = CCLayerColor:create( ccc4(64,64,64,255) ) + local color = CCLayerColor:create( Color4B(64,64,64,255) ) ret:addChild(color, -1) local map = CCTMXTiledMap:create("TileMaps/iso-test2-uncompressed.tmx") diff --git a/samples/Lua/TestLua/Resources/luaScript/TransitionsTest/TransitionsTest.lua b/samples/Lua/TestLua/Resources/luaScript/TransitionsTest/TransitionsTest.lua index 01bddd7402..0145d4843b 100644 --- a/samples/Lua/TestLua/Resources/luaScript/TransitionsTest/TransitionsTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/TransitionsTest/TransitionsTest.lua @@ -64,11 +64,11 @@ local function createLayer1() local titleLabel = CCLabelTTF:create(Transition_Name[SceneIdx], "Thonburi", 32) layer:addChild(titleLabel) - titleLabel:setColor(ccc3(255,32,32)) + titleLabel:setColor(Color3B(255,32,32)) titleLabel:setPosition(x / 2, y - 100) local label = CCLabelTTF:create("SCENE 1", "Marker Felt", 38) - label:setColor(ccc3(16,16,255)) + label:setColor(Color3B(16,16,255)) label:setPosition(x / 2, y / 2) layer:addChild(label) @@ -107,11 +107,11 @@ local function createLayer2() local titleLabel = CCLabelTTF:create(Transition_Name[SceneIdx], "Thonburi", 32 ) layer:addChild(titleLabel) - titleLabel:setColor(ccc3(255,32,32)) + titleLabel:setColor(Color3B(255,32,32)) titleLabel:setPosition(x / 2, y - 100) local label = CCLabelTTF:create("SCENE 2", "Marker Felt", 38) - label:setColor(ccc3(16,16,255)) + label:setColor(Color3B(16,16,255)) label:setPosition(x / 2, y / 2) layer:addChild(label) @@ -187,7 +187,7 @@ local function createTransition(index, t, scene) elseif index == Transition_Table.CCTransitionFade then scene = CCTransitionFade:create(t, scene) elseif index == Transition_Table.FadeWhiteTransition then - scene = CCTransitionFade:create(t, scene, ccc3(255, 255, 255)) + scene = CCTransitionFade:create(t, scene, Color3B(255, 255, 255)) elseif index == Transition_Table.FlipXLeftOver then scene = CCTransitionFlipX:create(t, scene, kCCTransitionOrientationLeftOver) elseif index == Transition_Table.FlipXRightOver then diff --git a/samples/Lua/TestLua/Resources/luaScript/ZwoptexTest/ZwoptexTest.lua b/samples/Lua/TestLua/Resources/luaScript/ZwoptexTest/ZwoptexTest.lua index 7172ffd4e4..414be17b1d 100644 --- a/samples/Lua/TestLua/Resources/luaScript/ZwoptexTest/ZwoptexTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/ZwoptexTest/ZwoptexTest.lua @@ -19,7 +19,7 @@ local function ZwoptexGenericTest() CCSpriteFrameCache:sharedSpriteFrameCache():addSpriteFramesWithFile("zwoptex/grossini.plist") CCSpriteFrameCache:sharedSpriteFrameCache():addSpriteFramesWithFile("zwoptex/grossini-generic.plist") - local layer1 = CCLayerColor:create(ccc4(255, 0, 0, 255), 85, 121) + local layer1 = CCLayerColor:create(Color4B(255, 0, 0, 255), 85, 121) layer1:setPosition(ccp(s.width/2-80 - (85.0 * 0.5), s.height/2 - (121.0 * 0.5))) ret:addChild(layer1) @@ -30,7 +30,7 @@ local function ZwoptexGenericTest() sprite1:setFlipX(false) sprite1:setFlipY(false) - local layer2 = CCLayerColor:create(ccc4(255, 0, 0, 255), 85, 121) + local layer2 = CCLayerColor:create(Color4B(255, 0, 0, 255), 85, 121) layer2:setPosition(ccp(s.width/2+80 - (85.0 * 0.5), s.height/2 - (121.0 * 0.5))) ret:addChild(layer2) diff --git a/scripting/javascript/bindings/ScriptingCore.cpp b/scripting/javascript/bindings/ScriptingCore.cpp index cb211d2f91..f93cb14ef7 100644 --- a/scripting/javascript/bindings/ScriptingCore.cpp +++ b/scripting/javascript/bindings/ScriptingCore.cpp @@ -1182,7 +1182,7 @@ JSBool jsval_to_ccsize(JSContext *cx, jsval v, Size* ret) { return JS_TRUE; } -JSBool jsval_to_cccolor4b(JSContext *cx, jsval v, ccColor4B* ret) { +JSBool jsval_to_Color4B(JSContext *cx, jsval v, Color4B* ret) { JSObject *tmp; jsval jsr, jsg, jsb, jsa; double r, g, b, a; @@ -1205,7 +1205,7 @@ JSBool jsval_to_cccolor4b(JSContext *cx, jsval v, ccColor4B* ret) { return JS_TRUE; } -JSBool jsval_to_cccolor4f(JSContext *cx, jsval v, ccColor4F* ret) { +JSBool jsval_to_Color4F(JSContext *cx, jsval v, Color4F* ret) { JSObject *tmp; jsval jsr, jsg, jsb, jsa; double r, g, b, a; @@ -1227,7 +1227,7 @@ JSBool jsval_to_cccolor4f(JSContext *cx, jsval v, ccColor4F* ret) { return JS_TRUE; } -JSBool jsval_to_cccolor3b(JSContext *cx, jsval v, ccColor3B* ret) { +JSBool jsval_to_Color3B(JSContext *cx, jsval v, Color3B* ret) { JSObject *tmp; jsval jsr, jsg, jsb; double r, g, b; @@ -1658,7 +1658,7 @@ jsval ccsize_to_jsval(JSContext* cx, Size& v) { return JSVAL_NULL; } -jsval cccolor4b_to_jsval(JSContext* cx, ccColor4B& v) { +jsval Color4B_to_jsval(JSContext* cx, Color4B& v) { JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL); if (!tmp) return JSVAL_NULL; JSBool ok = JS_DefineProperty(cx, tmp, "r", INT_TO_JSVAL(v.r), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) && @@ -1671,7 +1671,7 @@ jsval cccolor4b_to_jsval(JSContext* cx, ccColor4B& v) { return JSVAL_NULL; } -jsval cccolor4f_to_jsval(JSContext* cx, ccColor4F& v) { +jsval Color4F_to_jsval(JSContext* cx, Color4F& v) { JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL); if (!tmp) return JSVAL_NULL; JSBool ok = JS_DefineProperty(cx, tmp, "r", DOUBLE_TO_JSVAL(v.r), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) && @@ -1684,7 +1684,7 @@ jsval cccolor4f_to_jsval(JSContext* cx, ccColor4F& v) { return JSVAL_NULL; } -jsval cccolor3b_to_jsval(JSContext* cx, const ccColor3B& v) { +jsval Color3B_to_jsval(JSContext* cx, const Color3B& v) { JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL); if (!tmp) return JSVAL_NULL; JSBool ok = JS_DefineProperty(cx, tmp, "r", INT_TO_JSVAL(v.r), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) && @@ -2054,10 +2054,10 @@ static void serverEntryPoint(void) } // while(true) } -ccColor3B getColorFromJSObject(JSContext *cx, JSObject *colorObject) +Color3B getColorFromJSObject(JSContext *cx, JSObject *colorObject) { jsval jsr; - ccColor3B out; + Color3B out; JS_GetProperty(cx, colorObject, "r", &jsr); double fontR = 0.0; JS_ValueToNumber(cx, jsr, &fontR); @@ -2098,7 +2098,7 @@ Size getSizeFromJSObject(JSContext *cx, JSObject *sizeObject) return out; } -JSBool jsval_to_ccfontdefinition( JSContext *cx, jsval vp, ccFontDefinition *out ) +JSBool jsval_to_ccfontdefinition( JSContext *cx, jsval vp, FontDefinition *out ) { JSObject *jsobj; @@ -2118,7 +2118,7 @@ JSBool jsval_to_ccfontdefinition( JSContext *cx, jsval vp, ccFontDefinition *out out->_stroke._strokeEnabled = false; // white text by default - out->_fontFillColor = ccWHITE; + out->_fontFillColor = Color3B::white; // font name jsval jsr; @@ -2262,7 +2262,7 @@ JSBool jsval_to_ccfontdefinition( JSContext *cx, jsval vp, ccFontDefinition *out { // default stroke values out->_stroke._strokeSize = 1; - out->_stroke._strokeColor = ccBLUE; + out->_stroke._strokeColor = Color3B::blue; // stroke color JS_HasProperty(cx, jsobj, "strokeColor", &hasProperty); diff --git a/scripting/javascript/bindings/ScriptingCore.h b/scripting/javascript/bindings/ScriptingCore.h index 6016bb4d7f..3c10e8a8bd 100644 --- a/scripting/javascript/bindings/ScriptingCore.h +++ b/scripting/javascript/bindings/ScriptingCore.h @@ -216,16 +216,16 @@ JSBool jsval_to_std_string(JSContext *cx, jsval v, std::string* ret); JSBool jsval_to_ccpoint(JSContext *cx, jsval v, Point* ret); JSBool jsval_to_ccrect(JSContext *cx, jsval v, Rect* ret); JSBool jsval_to_ccsize(JSContext *cx, jsval v, Size* ret); -JSBool jsval_to_cccolor4b(JSContext *cx, jsval v, ccColor4B* ret); -JSBool jsval_to_cccolor4f(JSContext *cx, jsval v, ccColor4F* ret); -JSBool jsval_to_cccolor3b(JSContext *cx, jsval v, ccColor3B* ret); +JSBool jsval_to_Color4B(JSContext *cx, jsval v, Color4B* ret); +JSBool jsval_to_Color4F(JSContext *cx, jsval v, Color4F* ret); +JSBool jsval_to_Color3B(JSContext *cx, jsval v, Color3B* ret); JSBool jsval_to_ccarray_of_CCPoint(JSContext* cx, jsval v, Point **points, int *numPoints); JSBool jsval_to_ccarray(JSContext* cx, jsval v, Array** ret); JSBool jsval_to_ccdictionary(JSContext* cx, jsval v, Dictionary** ret); JSBool jsval_to_ccacceleration(JSContext* cx,jsval v, Acceleration* ret); JSBool jsvals_variadic_to_ccarray( JSContext *cx, jsval *vp, int argc, Array** ret); JSBool jsval_to_ccaffinetransform(JSContext* cx, jsval v, AffineTransform* ret); -JSBool jsval_to_ccfontdefinition( JSContext *cx, jsval vp, ccFontDefinition *out ); +JSBool jsval_to_Vertex2F( JSContext *cx, jsval vp, Vertex2F *out ); // from native jsval int32_to_jsval( JSContext *cx, int32_t l); @@ -236,9 +236,9 @@ jsval c_string_to_jsval(JSContext* cx, const char* v, size_t length = -1); jsval ccpoint_to_jsval(JSContext* cx, Point& v); jsval ccrect_to_jsval(JSContext* cx, Rect& v); jsval ccsize_to_jsval(JSContext* cx, Size& v); -jsval cccolor4b_to_jsval(JSContext* cx, ccColor4B& v); -jsval cccolor4f_to_jsval(JSContext* cx, ccColor4F& v); -jsval cccolor3b_to_jsval(JSContext* cx, const ccColor3B& v); +jsval Color4B_to_jsval(JSContext* cx, Color4B& v); +jsval Color4F_to_jsval(JSContext* cx, Color4F& v); +jsval Color3B_to_jsval(JSContext* cx, const Color3B& v); jsval ccdictionary_to_jsval(JSContext* cx, Dictionary *dict); jsval ccarray_to_jsval(JSContext* cx, Array *arr); jsval ccacceleration_to_jsval(JSContext* cx, Acceleration& v); diff --git a/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id b/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id index 70143ae50c..d6a15db906 100644 --- a/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id +++ b/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id @@ -1 +1 @@ -d97bee7049e0d811ef10d72b7558ca857c1721c3 \ No newline at end of file +eecc7798376efd9a3a3f619a343e1b6aa7ab2be9 \ No newline at end of file diff --git a/scripting/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id b/scripting/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id index b8d21c1eac..a3b806cb55 100644 --- a/scripting/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id +++ b/scripting/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id @@ -1 +1 @@ -6ddddf80e821ca5ff218502a76a75d5eba5bb254 \ No newline at end of file +bc17469492fd8ddbefa6b4e22cb1949936954054 \ No newline at end of file diff --git a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id index 1dd380c38a..45dce60ab3 100644 --- a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id +++ b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id @@ -1 +1 @@ -7679f44ca80cad53eb5a4928aec3c91c9d26f8c3 \ No newline at end of file +01df689bb6370c21e9c3bf302041d180e19a699e \ No newline at end of file