X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FColorFade.h;fp=src%2Fgraphics%2FColorFade.h;h=66d8192933e80f78c7b29e2ba6bb59f8e4358bcf;hb=f7555575e8f2f8b9dbf740628f66e34ff93d8390;hp=0000000000000000000000000000000000000000;hpb=ed792d6d00d822384d79d049e644e372f7c3b4cd;p=l2e.git diff --git a/src/graphics/ColorFade.h b/src/graphics/ColorFade.h new file mode 100644 index 0000000..66d8192 --- /dev/null +++ b/src/graphics/ColorFade.h @@ -0,0 +1,55 @@ +/* + * ColorFade.h + * + * Created on: Oct 7, 2012 + * Author: holy + */ + +#ifndef GRAPHICS_COLORFADE_H_ +#define GRAPHICS_COLORFADE_H_ + +#include "../app/State.h" +#include "../app/Timer.h" + +#include + +namespace graphics { + +class ColorFade +: public app::State { + +public: + ColorFade(app::State *slave, Uint32 color, int duration, bool in = false, bool interactive = false); + 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); + + virtual void HandleEvents(const app::Input &); + virtual void UpdateWorld(float deltaT); + virtual void Render(SDL_Surface *); + +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; + bool in; + bool interactive; + +}; + +} + +#endif /* GRAPHICS_COLORFADE_H_ */