Skip to content

Commit bf42201

Browse files
author
minggo
committed
Merge pull request #391 from liswei/master
resolve the effect of PageTransitionForward&PageTransitionBackward
2 parents 48420dc + 21ce679 commit bf42201

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/tests/TransitionsTest/TransitionsTest.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ class PageTransitionForward : public CCTransitionPageTurn
127127
public:
128128
static CCTransitionScene* transitionWithDuration(ccTime t, CCScene* s)
129129
{
130+
CCDirector::sharedDirector()->setDepthTest(true);
130131
return CCTransitionPageTurn::transitionWithDuration(t, s, false);
131132
}
132133
};
@@ -136,6 +137,7 @@ class PageTransitionBackward : public CCTransitionPageTurn
136137
public:
137138
static CCTransitionScene* transitionWithDuration(ccTime t, CCScene* s)
138139
{
140+
CCDirector::sharedDirector()->setDepthTest(true);
139141
return CCTransitionPageTurn::transitionWithDuration(t, s, true);
140142
}
141143
};
@@ -186,6 +188,9 @@ static int s_nSceneIdx = 0;
186188

187189
CCTransitionScene* createTransition(int nIndex, ccTime t, CCScene* s)
188190
{
191+
// fix bug #486, without setDepthTest(false), FlipX,Y will flickers
192+
CCDirector::sharedDirector()->setDepthTest(false);
193+
189194
switch(nIndex)
190195
{
191196
case 0: return CCTransitionJumpZoom::transitionWithDuration(t, s);
@@ -273,9 +278,6 @@ void TransitionsTestScene::runThisTest()
273278
CCLayer * pLayer = new TestLayer1();
274279
addChild(pLayer);
275280
pLayer->release();
276-
277-
// fix bug #486, without setDepthTest(false), FlipX,Y will flickers
278-
CCDirector::sharedDirector()->setDepthTest(false);
279281

280282
CCDirector::sharedDirector()->replaceScene(this);
281283
}

0 commit comments

Comments
 (0)