void runSpriteTest()
{
    SpriteMainScene* pScene = new SpritePerformTest1;
    pScene->initWithSubTest(1, 50);
    CCDirector::sharedDirector()->replaceScene(pScene);
    pScene->release();
}
Example #2
0
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();
    }
}
void  SpriteMainScene::autoShowSpriteTests(int curCase, int subTest, int nodes)
{
    
    SpriteMainScene* scene = nullptr;
    
    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;
        default:
            CCASSERT(false, "Invalid scene value");
            break;
    }

    if (scene)
    {
        scene->initWithSubTest(subTest, nodes);
        Director::getInstance()->replaceScene(scene);
        scene->release();
    }
}
Example #5
0
void  SpriteMainScene::autoShowSpriteTests(int curCase, int subTest,int nodes)
{
    
    SpriteMainScene* scene = NULL;
    
    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(subTest, nodes);
        Director::getInstance()->replaceScene(scene);
        scene->release();
    }
}
////////////////////////////////////////////////////////
//
// SpriteMenuLayer
//
////////////////////////////////////////////////////////
void SpriteMenuLayer::showCurrentTest()
{
    SpriteMainScene* pScene = NULL;
    SpriteMainScene* pPreScene = (SpriteMainScene*) getParent();
    int nSubTest = pPreScene->getSubTestNum();
    int nNodes   = pPreScene->getNodesNum();

    switch (m_nCurCase)
    {
    case 0:
        pScene = new SpritePerformTest1;
        break;
    case 1:
        pScene = new SpritePerformTest2;
        break;
    case 2:
        pScene = new SpritePerformTest3;
        break;
    case 3:
        pScene = new SpritePerformTest4;
        break;
    case 4:
        pScene = new SpritePerformTest5;
        break;
    case 5:
        pScene = new SpritePerformTest6;
        break;
    case 6:
        pScene = new SpritePerformTest7;
        break;
    }
    s_nSpriteCurCase = m_nCurCase;

    if (pScene)
    {
        pScene->initWithSubTest(nSubTest, nNodes);
        CCDirector::sharedDirector()->replaceScene(pScene);
        pScene->release();
    }
}