X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Fapp%2FApplication.h;h=5e9e88838dfb05db9ae0dc4d11dc64dacd8b7275;hb=25d7499f7923291d7287123320e7563a367e92e7;hp=dcc5e006c0dc36d28b65859bcbb048761cfc96be;hpb=c8bfdbd3b824fdd71bca1335a145aa19c42df1db;p=l2e.git diff --git a/src/app/Application.h b/src/app/Application.h index dcc5e00..5e9e888 100644 --- a/src/app/Application.h +++ b/src/app/Application.h @@ -41,9 +41,19 @@ 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(); + bool StateChangePending() const { return !stateChanges.empty(); } void UpdateState(); + void RealChangeState(State *); void RealPushState(State *); void RealPopState(); void PopAllStates(); @@ -56,10 +66,9 @@ private: private: sdl::InitScreen *screen; std::stack states; - std::queue toPush; + std::queue stateChanges; Input input; Uint32 last; - int toPop; };