X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FApplication.h;h=cf1261b28f1a8c8799c3ce8aa2a5217af9ef3ab2;hb=69ed4a9c725c438079ceeed89d49656d808308ce;hp=dcc5e006c0dc36d28b65859bcbb048761cfc96be;hpb=c8bfdbd3b824fdd71bca1335a145aa19c42df1db;p=l2e.git diff --git a/src/app/Application.h b/src/app/Application.h index dcc5e00..cf1261b 100644 --- a/src/app/Application.h +++ b/src/app/Application.h @@ -9,6 +9,7 @@ #define APP_APPLICATION_H_ #include "Input.h" +#include "Timer.h" #include "../sdl/InitScreen.h" #include @@ -40,10 +41,21 @@ public: void Quit(); Input &Buttons() { return input; } const Input &Buttons() const { return input; } + Timers &GlobalTimers() { return globalTimers; } + +private: + struct StateCommand { + enum Type { + PUSH, POP, CHANGE + } type; + State *state; + }; private: State *CurrentState(); + bool StateChangePending() const { return !stateChanges.empty(); } void UpdateState(); + void RealChangeState(State *); void RealPushState(State *); void RealPopState(); void PopAllStates(); @@ -56,10 +68,10 @@ private: private: sdl::InitScreen *screen; std::stack states; - std::queue toPush; + std::queue stateChanges; + Timers globalTimers; Input input; Uint32 last; - int toPop; };