void ParticleMenuLayer::showCurrentTest() { auto scene = (ParticleMainScene*)getParent(); int subTest = scene->getSubTestNum(); int parNum = scene->getParticlesNum(); ParticleMainScene* pNewScene = NULL; switch (_curCase) { case 0: pNewScene = new ParticlePerformTest1; break; case 1: pNewScene = new ParticlePerformTest2; break; case 2: pNewScene = new ParticlePerformTest3; break; case 3: pNewScene = new ParticlePerformTest4; break; } s_nParCurIdx = _curCase; if (pNewScene) { pNewScene->initWithSubTest(subTest, parNum); Director::getInstance()->replaceScene(pNewScene); pNewScene->release(); } }
void SpriteMenuLayer::showCurrentTest() { SpriteMainScene* scene = NULL; auto pPreScene = (SpriteMainScene*) getParent(); int nSubTest = pPreScene->getSubTestNum(); int nNodes = pPreScene->getNodesNum(); switch (_curCase) { case 0: scene = new SpritePerformTest1; break; case 1: scene = new SpritePerformTest2; break; case 2: scene = new SpritePerformTest3; break; case 3: scene = new SpritePerformTest4; break; case 4: scene = new SpritePerformTest5; break; case 5: scene = new SpritePerformTest6; break; case 6: scene = new SpritePerformTest7; break; } SpriteMainScene::_s_nSpriteCurCase = _curCase; if (scene) { scene->initWithSubTest(nSubTest, nNodes); Director::getInstance()->replaceScene(scene); scene->release(); } }
void SpriteMenuLayer::showCurrentTest() { SpriteMainScene* scene = nullptr; auto pPreScene = (SpriteMainScene*) getParent(); int nSubTest = pPreScene->getSubTestNum(); int nNodes = pPreScene->getNodesNum(); switch (_curCase) { case 0: scene = new (std::nothrow) SpritePerformTestA; break; case 1: scene = new (std::nothrow) SpritePerformTestB; break; case 2: scene = new (std::nothrow) SpritePerformTestC; break; case 3: scene = new (std::nothrow) SpritePerformTestD; break; case 4: scene = new (std::nothrow) SpritePerformTestE; break; case 5: scene = new (std::nothrow) SpritePerformTestF; break; case 6: scene = new (std::nothrow) SpritePerformTestG; break; } SpriteMainScene::_s_nSpriteCurCase = _curCase; if (scene) { scene->initWithSubTest(nSubTest, nNodes); Director::getInstance()->replaceScene(scene); scene->release(); } }