diff --git a/cocos2dx/base_nodes/CCNode.cpp b/cocos2dx/base_nodes/CCNode.cpp index 67b3e2c86c..eb80fced35 100644 --- a/cocos2dx/base_nodes/CCNode.cpp +++ b/cocos2dx/base_nodes/CCNode.cpp @@ -383,9 +383,9 @@ CGRect CCNode::boundingBox() CCNode * CCNode::node(void) { - CCNode * pNode = new CCNode(); - pNode->autorelease(); - return pNode; + CCNode * pRet = new CCNode(); + pRet->autorelease(); + return pRet; } diff --git a/cocos2dx/include/CCPageTurnTransition.h b/cocos2dx/include/CCPageTurnTransition.h index 6a10bcbcc2..50fce9712e 100644 --- a/cocos2dx/include/CCPageTurnTransition.h +++ b/cocos2dx/include/CCPageTurnTransition.h @@ -52,14 +52,14 @@ public: * if back is TRUE then the effect is reversed to appear as if the incoming * scene is being turned from left over the outgoing scene */ - static CCPageTurnTransition* transitionWithDurationAndScene(ccTime t,CCScene* scene,bool backwards); + static CCPageTurnTransition* transitionWithDuration(ccTime t,CCScene* scene,bool backwards); /** * creates a base transition with duration and incoming scene * if back is TRUE then the effect is reversed to appear as if the incoming * scene is being turned from left over the outgoing scene */ - virtual CCPageTurnTransition* initWithDurationAndScene(ccTime t,CCScene* scene,bool backwards); + virtual CCPageTurnTransition* initWithDuration(ccTime t,CCScene* scene,bool backwards); CCIntervalAction* actionWithSize(ccGridSize vector); diff --git a/cocos2dx/include/CCScene.h b/cocos2dx/include/CCScene.h index d4daa40be1..625d8f1d9a 100644 --- a/cocos2dx/include/CCScene.h +++ b/cocos2dx/include/CCScene.h @@ -45,6 +45,7 @@ public: CCScene(); virtual ~CCScene(); bool init(); + static CCScene *node(void); }; #endif // __CCSCENE_H__ diff --git a/cocos2dx/include/CCTransition.h b/cocos2dx/include/CCTransition.h index 51a4578ae9..76657af309 100644 --- a/cocos2dx/include/CCTransition.h +++ b/cocos2dx/include/CCTransition.h @@ -76,10 +76,10 @@ public: virtual void cleanup(); /** creates a base transition with duration and incoming scene */ - static CCTransitionScene * transitionWithDurationAndScene(ccTime t, CCScene *scene); + static CCTransitionScene * transitionWithDuration(ccTime t, CCScene *scene); /** initializes a transition with duration and incoming scene */ - virtual CCTransitionScene * initWithDurationAndScene(ccTime t,CCScene* scene); + virtual CCTransitionScene * initWithDuration(ccTime t,CCScene* scene); /** called after the transition finishes */ void finish(void); @@ -107,9 +107,9 @@ public: ~CCOrientedTransitionScene(); /** creates a base transition with duration and incoming scene */ - static CCOrientedTransitionScene * transitionWithDurationAndScene(ccTime t,CCScene* scene, tOrientation orientation); + static CCOrientedTransitionScene * transitionWithDuration(ccTime t,CCScene* scene, tOrientation orientation); /** initializes a transition with duration and incoming scene */ - virtual CCOrientedTransitionScene * initWithDurationAndScene(ccTime t,CCScene* scene,tOrientation orientation); + virtual CCOrientedTransitionScene * initWithDuration(ccTime t,CCScene* scene,tOrientation orientation); }; /** CCRotoZoomTransition: @@ -364,11 +364,11 @@ public: /** creates the transition with a duration and with an RGB color * Example: [FadeTransition transitionWithDuration:2 scene:s withColor:ccc3(255,0,0)]; // red color */ - static CCFadeTransition* transitionWithDurationAndColor(ccTime duration,CCScene* scene, ccColor3B color); + static CCFadeTransition* transitionWithDuration(ccTime duration,CCScene* scene, ccColor3B color); /** initializes the transition with a duration and with an RGB color */ - virtual CCFadeTransition* initWithDurationAndColor(ccTime t, CCScene*scene ,ccColor3B color); + virtual CCFadeTransition* initWithDuration(ccTime t, CCScene*scene ,ccColor3B color); - virtual CCFadeTransition * initWithDurationAndScene(ccTime t,CCScene* scene); + virtual CCFadeTransition * initWithDuration(ccTime t,CCScene* scene); virtual void onEnter(); virtual void onExit(); }; diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp index 824fabda1d..1647653fca 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp @@ -231,7 +231,7 @@ void CCColorLayer::setContentSize(CGSize size) m_pSquareVertices[6] = size.width; m_pSquareVertices[7] = size.height; - this->setContentSize(size); + __super::setContentSize(size); } void CCColorLayer::changeWidthAndHeight(GLfloat w ,GLfloat h) diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCPageTurnTransition.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCPageTurnTransition.cpp index 5833a04479..7673058bae 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCPageTurnTransition.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCPageTurnTransition.cpp @@ -33,21 +33,21 @@ CCPageTurnTransition::~CCPageTurnTransition() } /** creates a base transition with duration and incoming scene */ -CCPageTurnTransition * CCPageTurnTransition::transitionWithDurationAndScene(ccTime t, CCScene *scene, bool backwards) +CCPageTurnTransition * CCPageTurnTransition::transitionWithDuration(ccTime t, CCScene *scene, bool backwards) { CCPageTurnTransition * pTransition = new CCPageTurnTransition(); - pTransition->initWithDurationAndScene(t,scene,backwards); + pTransition->initWithDuration(t,scene,backwards); pTransition->autorelease(); return pTransition; } /** initializes a transition with duration and incoming scene */ -CCPageTurnTransition * CCPageTurnTransition::initWithDurationAndScene(ccTime t, CCScene *scene, bool backwards) +CCPageTurnTransition * CCPageTurnTransition::initWithDuration(ccTime t, CCScene *scene, bool backwards) { // XXX: needed before [super init] m_bBack = backwards; - if( __super::initWithDurationAndScene(t, scene) ) + if( __super::initWithDuration(t, scene) ) { // do something } diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCScene.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCScene.cpp index ac222184ef..0319e825ce 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCScene.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCScene.cpp @@ -48,6 +48,16 @@ bool CCScene::init() // success bRet = true; } while (0); - return bRet; } + +CCScene *CCScene::node() +{ + CCScene *pRet = new CCScene(); + if (pRet->init()) + { + pRet->autorelease(); + return pRet; + } + return NULL; +} diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCTransition.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCTransition.cpp index 578b41d2cf..1fefd46af7 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCTransition.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCTransition.cpp @@ -41,15 +41,15 @@ CCTransitionScene::~CCTransitionScene() m_pOutScene->release(); } -CCTransitionScene * CCTransitionScene::transitionWithDurationAndScene(ccTime t, CCScene *scene) +CCTransitionScene * CCTransitionScene::transitionWithDuration(ccTime t, CCScene *scene) { CCTransitionScene * pScene = new CCTransitionScene(); - pScene->initWithDurationAndScene(t,scene); + pScene->initWithDuration(t,scene); pScene->autorelease(); return pScene; } -CCTransitionScene * CCTransitionScene::initWithDurationAndScene(ccTime t, CCScene *scene) +CCTransitionScene * CCTransitionScene::initWithDuration(ccTime t, CCScene *scene) { NSAssert( scene != NULL, "Argument scene must be non-nil"); @@ -165,17 +165,17 @@ CCOrientedTransitionScene::~CCOrientedTransitionScene() { } -CCOrientedTransitionScene * CCOrientedTransitionScene::transitionWithDurationAndScene(ccTime t, CCScene *scene, tOrientation orientation) +CCOrientedTransitionScene * CCOrientedTransitionScene::transitionWithDuration(ccTime t, CCScene *scene, tOrientation orientation) { CCOrientedTransitionScene * pScene = new CCOrientedTransitionScene(); - pScene->initWithDurationAndScene(t,scene,orientation); + pScene->initWithDuration(t,scene,orientation); pScene->autorelease(); return pScene; } -CCOrientedTransitionScene * CCOrientedTransitionScene::initWithDurationAndScene(ccTime t, CCScene *scene, tOrientation orientation) +CCOrientedTransitionScene * CCOrientedTransitionScene::initWithDuration(ccTime t, CCScene *scene, tOrientation orientation) { - if ( __super::initWithDurationAndScene(t, scene) ) + if ( __super::initWithDuration(t, scene) ) { m_tOrientation = orientation; } @@ -887,17 +887,17 @@ CCFadeTransition::~CCFadeTransition() } -CCFadeTransition * CCFadeTransition::transitionWithDurationAndColor(ccTime duration, CCScene *scene, ccColor3B color) +CCFadeTransition * CCFadeTransition::transitionWithDuration(ccTime duration, CCScene *scene, ccColor3B color) { CCFadeTransition * pTransition = new CCFadeTransition(); - pTransition->initWithDurationAndColor(duration, scene, color); + pTransition->initWithDuration(duration, scene, color); pTransition->autorelease(); return pTransition; } -CCFadeTransition * CCFadeTransition::initWithDurationAndColor(ccTime duration, CCScene *scene, ccColor3B color) +CCFadeTransition * CCFadeTransition::initWithDuration(ccTime duration, CCScene *scene, ccColor3B color) { - if (__super::initWithDurationAndScene(duration, scene)) + if (__super::initWithDuration(duration, scene)) { m_tColor.r = color.r; m_tColor.g = color.g; @@ -906,9 +906,9 @@ CCFadeTransition * CCFadeTransition::initWithDurationAndColor(ccTime duration, C return this; } -CCFadeTransition * CCFadeTransition::initWithDurationAndScene(ccTime t, CCScene *scene) +CCFadeTransition * CCFadeTransition::initWithDuration(ccTime t, CCScene *scene) { - __super::initWithDurationAndScene(t, scene); + __super::initWithDuration(t, scene); return this; } diff --git a/cocos2dx/sprite_nodes/CCSprite.cpp b/cocos2dx/sprite_nodes/CCSprite.cpp index ec60bf1f10..d513a2c056 100644 --- a/cocos2dx/sprite_nodes/CCSprite.cpp +++ b/cocos2dx/sprite_nodes/CCSprite.cpp @@ -320,7 +320,7 @@ void CCSprite::useSelfRender(void) m_bUsesSpriteSheet = false; m_pobTextureAtlas = NULL; m_pobSpriteSheet = NULL; - m_bDirty = false; + m_bDirty = m_bRecursiveDirty = false; float x1 = 0 + m_obOffsetPosition.x; float y1 = 0 + m_obOffsetPosition.y; @@ -851,7 +851,7 @@ void CCSprite::setOpacity(GLubyte opacity) // special opacity for premultiplied textures if (m_bOpacityModifyRGB) { - setColor(m_sColor); + setColor(m_sColorUnmodified); } updateColor();