mirror of https://github.com/axmolengine/axmol.git
closed #4761, fix zfighting between tests
This commit is contained in:
parent
588d825691
commit
4be149e492
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue