]> git.localhorst.tv Git - l2e.git/blobdiff - src/app/Application.h
reworked Application's state stack
[l2e.git] / src / app / Application.h
index dcc5e006c0dc36d28b65859bcbb048761cfc96be..853d0cb25cefc91897beeaa41e7365f027a2604a 100644 (file)
@@ -41,9 +41,18 @@ public:
        Input &Buttons() { return input; }
        const Input &Buttons() const { return input; }
 
+private:
+       struct StateCommand {
+               enum Type {
+                       PUSH, POP, CHANGE
+               } type;
+               State *state;
+       };
+
 private:
        State *CurrentState();
        void UpdateState();
+       void RealChangeState(State *);
        void RealPushState(State *);
        void RealPopState();
        void PopAllStates();
@@ -56,10 +65,9 @@ private:
 private:
        sdl::InitScreen *screen;
        std::stack<State *> states;
-       std::queue<State *> toPush;
+       std::queue<StateCommand> stateChanges;
        Input input;
        Uint32 last;
-       int toPop;
 
 };