Beispiel #1
0
  void StateManager::resetActiveState(void)
  {
    // Is there no currently active state to reset?
    if(!mStack.empty())
    {
      // Retrieve the currently active state
      IState* anState = mStack.back();

      // Log the resetting of an active state
      ILOG() << "StateManager::resetActiveState(" << anState->getID() << ")" << std::endl;

      // Pause the currently active state
      anState->pause();

      // Call the ReInit method to Reset the currently active state
      anState->reInit();

      // Resume the currently active state
      anState->resume();

      // Don't keep pointers around we don't need anymore
      anState = NULL;
    }
    else
    {
      // Quit the application with an error status response
      if(NULL != mApp)
      {
        mApp->quit(StatusAppStackEmpty);
      }
      return;
    }
  }