change TransitionPageTurn::_outSceneProxy when class construction instead of onEnter

This commit is contained in:
Huabing.Xu 2013-12-19 22:01:32 +08:00
parent 517fec4de7
commit 61cf9e49eb
2 changed files with 14 additions and 15 deletions

View File

@ -1346,7 +1346,6 @@ void TransitionCrossFade::onExit()
// TurnOffTilesTransition
//
TransitionTurnOffTiles::TransitionTurnOffTiles()
: _outSceneProxy(nullptr)
{
_outSceneProxy = NodeGrid::create();
_outSceneProxy->retain();
@ -1434,7 +1433,8 @@ ActionInterval* TransitionTurnOffTiles:: easeActionWithAction(ActionInterval* ac
//
TransitionSplitCols::TransitionSplitCols()
{
_gridProxy = nullptr;
_gridProxy = NodeGrid::create();
_gridProxy->retain();
}
TransitionSplitCols::~TransitionSplitCols()
{
@ -1457,8 +1457,6 @@ void TransitionSplitCols::onEnter()
{
TransitionScene::onEnter();
_gridProxy = NodeGrid::create();
_gridProxy->retain();
_gridProxy->setTarget(_outScene);
_gridProxy->onEnter();
@ -1496,6 +1494,7 @@ void TransitionSplitCols::draw()
void TransitionSplitCols::onExit()
{
_gridProxy->setTarget(nullptr);
_gridProxy->onExit();
TransitionScene::onExit();
}
@ -1545,7 +1544,8 @@ TransitionSplitRows* TransitionSplitRows::create(float t, Scene* scene)
//
TransitionFadeTR::TransitionFadeTR()
{
_outSceneProxy = nullptr;
_outSceneProxy = NodeGrid::create();
_outSceneProxy->retain();
}
TransitionFadeTR::~TransitionFadeTR()
{
@ -1572,8 +1572,7 @@ void TransitionFadeTR::sceneOrder()
void TransitionFadeTR::onEnter()
{
TransitionScene::onEnter();
_outSceneProxy = NodeGrid::create();
_outSceneProxy->retain();
_outSceneProxy->setTarget(_outScene);
_outSceneProxy->onEnter();
@ -1598,6 +1597,7 @@ void TransitionFadeTR::onEnter()
void TransitionFadeTR::onExit()
{
_outSceneProxy->setTarget(nullptr);
_outSceneProxy->onExit();
TransitionScene::onExit();
}

View File

@ -38,8 +38,11 @@ float TransitionPageTurn::POLYGON_OFFSET_UNITS = -20.f;
TransitionPageTurn::TransitionPageTurn()
{
_inSceneProxy = nullptr;
_outSceneProxy = nullptr;
_inSceneProxy = NodeGrid::create();
_outSceneProxy = NodeGrid::create();
_inSceneProxy->retain();
_outSceneProxy->retain();
}
TransitionPageTurn::~TransitionPageTurn()
@ -99,12 +102,6 @@ void TransitionPageTurn::draw()
void TransitionPageTurn::onEnter()
{
TransitionScene::onEnter();
_inSceneProxy = NodeGrid::create();
_outSceneProxy = NodeGrid::create();
CCASSERT(_inSceneProxy && _outSceneProxy, "TransitionPageTurn proxy scene can not be nullptr");
_inSceneProxy->retain();
_outSceneProxy->retain();
_inSceneProxy->setTarget(_inScene);
_outSceneProxy->setTarget(_outScene);
@ -159,6 +156,8 @@ void TransitionPageTurn::onEnter()
}
void TransitionPageTurn::onExit()
{
_outSceneProxy->setTarget(nullptr);
_outSceneProxy->setTarget(nullptr);
_outSceneProxy->onExit();
_inSceneProxy->onExit();