issue #18, debug

This commit is contained in:
Walzer 2010-08-03 03:28:34 +00:00
parent 27eda1194a
commit db49ed49b9
9 changed files with 44 additions and 33 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -45,6 +45,7 @@ public:
CCScene();
virtual ~CCScene();
bool init();
static CCScene *node(void);
};
#endif // __CCSCENE_H__

View File

@ -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();
};

View File

@ -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)

View File

@ -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
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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();