void Application::PopAllStates() {
while (!states.empty()) {
- RealPopState();
+ states.top()->PauseState(*this, screen->Screen());
+ states.top()->ExitState(*this, screen->Screen());
+ delete states.top();
+ states.pop();
}
}
break;
}
}
- CurrentState()->HandleEvents(input);
+ if (CurrentState()) CurrentState()->HandleEvents(input);
}
void Application::UpdateWorld(Uint32 deltaT) {