]> git.localhorst.tv Git - l2e.git/commitdiff
made application state changes yet a bit safer
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 9 Aug 2012 12:53:25 +0000 (14:53 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 9 Aug 2012 12:53:25 +0000 (14:53 +0200)
src/app/Application.cpp
src/app/Application.h

index 80ebb5d1ac1c8ae51a63a508a4a763026d1b695e..29eaee781e9ba20780fafa2cc4bde331777d059a 100644 (file)
@@ -123,8 +123,10 @@ void Application::Loop() {
        if (deltaT > 34) deltaT = 34;
 
        HandleEvents();
-       UpdateWorld(deltaT);
-       Render();
+       if (!StateChangePending()) {
+               UpdateWorld(deltaT);
+               Render();
+       }
 
        last = now;
        UpdateState();
index 853d0cb25cefc91897beeaa41e7365f027a2604a..5e9e88838dfb05db9ae0dc4d11dc64dacd8b7275 100644 (file)
@@ -51,6 +51,7 @@ private:
 
 private:
        State *CurrentState();
+       bool StateChangePending() const { return !stateChanges.empty(); }
        void UpdateState();
        void RealChangeState(State *);
        void RealPushState(State *);