X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FColorFade.h;h=b3e98bd15f7973bff89c89ff0efe822be5f65dc3;hb=2255d436a0c2acc10b015827366a72b2ece86094;hp=66d8192933e80f78c7b29e2ba6bb59f8e4358bcf;hpb=f7555575e8f2f8b9dbf740628f66e34ff93d8390;p=l2e.git diff --git a/src/graphics/ColorFade.h b/src/graphics/ColorFade.h index 66d8192..b3e98bd 100644 --- a/src/graphics/ColorFade.h +++ b/src/graphics/ColorFade.h @@ -1,10 +1,3 @@ -/* - * ColorFade.h - * - * Created on: Oct 7, 2012 - * Author: holy - */ - #ifndef GRAPHICS_COLORFADE_H_ #define GRAPHICS_COLORFADE_H_ @@ -23,28 +16,36 @@ public: virtual ~ColorFade() { } public: - virtual void EnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void ExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void ResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void PauseState(app::Application &ctrl, SDL_Surface *screen); - - virtual void Resize(int width, int height); + void SetLeadInTime(int ms) { leadIn = ms; if (ms > 0) leadInDone = false; } + void SetLeadOutTime(int ms) { leadOut = ms; } +public: virtual void HandleEvents(const app::Input &); virtual void UpdateWorld(float deltaT); virtual void Render(SDL_Surface *); +private: + virtual void OnEnterState(SDL_Surface *screen); + virtual void OnExitState(SDL_Surface *screen); + virtual void OnResumeState(SDL_Surface *screen); + virtual void OnPauseState(SDL_Surface *screen); + + virtual void OnResize(int width, int height); + private: void UpdateBlinds(int width, int height); Uint8 GetAlpha() const; private: app::Timer timer; - app::Application *ctrl; app::State *slave; SDL_Surface *blinds; Uint32 color; int duration; + int leadIn; + int leadOut; + bool leadInDone; + bool fadeDone; bool in; bool interactive;