X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FApplication.cpp;h=4ff75d8ed10c1104f9abf38142b4ffe46c9d3a5a;hb=fc8a43f3745e7f3808e29b90a2fa9a958ecaf29b;hp=ac95ed0a26f69287d24f69518acd3ef001f4cdaf;hpb=a01c2f05b5a6493d7fe097eb15e5337a095992ae;p=l2e.git diff --git a/src/app/Application.cpp b/src/app/Application.cpp index ac95ed0..4ff75d8 100644 --- a/src/app/Application.cpp +++ b/src/app/Application.cpp @@ -106,7 +106,10 @@ void Application::Quit() { void Application::PopAllStates() { while (!states.empty()) { - RealPopState(); + states.top()->PauseState(*this, screen->Screen()); + states.top()->ExitState(*this, screen->Screen()); + delete states.top(); + states.pop(); } } @@ -164,7 +167,7 @@ void Application::HandleEvents() { void Application::UpdateWorld(Uint32 deltaT) { if (!CurrentState()) return; - for (Uint32 i(0); i < deltaT; ++i) { + for (Uint32 i(0); i < deltaT && !StateChangePending(); ++i) { CurrentState()->PhysicsTimers().Update(0.001f); CurrentState()->UpdateWorld(0.001f); }