Skip to content

Instantly share code, notes, and snippets.

@darkfall
Created May 21, 2012 02:33

Revisions

  1. darkfall renamed this gist May 21, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. darkfall created this gist May 21, 2012.
    18 changes: 18 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    template<typename T>
    void CCDirector::popSceneWithTransition(float t) {
    CCAssert(m_pRunningScene != NULL, "running scene should not null");

    m_pobScenesStack->removeLastObject();
    unsigned int c = m_pobScenesStack->count();

    if (c == 0) {
    end();
    }
    else {
    m_bSendCleanupToScene = true;
    m_pNextScene = m_pobScenesStack->getObjectAtIndex(c - 1);
    CCScene* trans = T::transitionWithDuration(t, m_pNextScene);
    m_pobScenesStack->replaceObjectAtIndex(c-1, trans);
    m_pNextScene = trans;
    }
    }