closed #4761, fix zfighting between tests

This commit is contained in:
andyque 2014-04-11 16:30:25 +08:00
parent 588d825691
commit 4be149e492
4 changed files with 11 additions and 0 deletions

View File

@ -1053,6 +1053,7 @@ void CameraTest1::onEnter()
void CameraTest1::onExit()
{
Director::getInstance()->setProjection(_preProjection);
Director::getInstance()->setDepthTest(false);
TestCocosNodeDemo::onExit();
}
@ -1100,6 +1101,7 @@ void CameraTest2::onEnter()
void CameraTest2::onExit()
{
Director::getInstance()->setProjection(_preProjection);
Director::getInstance()->setDepthTest(false);
TestCocosNodeDemo::onExit();
}

View File

@ -118,6 +118,11 @@ void TileDemo::onEnter()
BaseTest::onEnter();
}
void TileMapTestScene::onExit()
{
Layer::onExit();
Director::getInstance()->setDepthTest(false);
}
void TileDemo::restartCallback(Ref* sender)
{
auto s = new TileMapTestScene();
@ -166,6 +171,7 @@ void TileMapTestScene::runThisTest()
Director::getInstance()->replaceScene(this);
}
//------------------------------------------------------------------
//
// TileMapTest

View File

@ -14,6 +14,7 @@ public:
virtual std::string title() const override;
virtual std::string subtitle() const override;
virtual void onEnter() override;
virtual void onExit()override;
void restartCallback(Ref* sender);
void nextCallback(Ref* sender);

View File

@ -380,6 +380,7 @@ void TestLayer1::onExitTransitionDidStart()
void TestLayer1::onExit()
{
Layer::onExit();
Director::getInstance()->setDepthTest(false);
log("Scene 1 onExit");
}
@ -509,5 +510,6 @@ void TestLayer2::onExitTransitionDidStart()
void TestLayer2::onExit()
{
Layer::onExit();
Director::getInstance()->setDepthTest(false);
log("Scene 2 onExit");
}