]> git.localhorst.tv Git - l2e.git/blobdiff - src/graphics/ColorFade.h
renamed app::State's Resize -> OnResize
[l2e.git] / src / graphics / ColorFade.h
index 66d8192933e80f78c7b29e2ba6bb59f8e4358bcf..947675e23ca1b238485f509e41feb20391316df1 100644 (file)
@@ -23,12 +23,16 @@ 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);
+       void SetLeadInTime(int ms) { leadIn = ms; if (ms > 0) leadInDone = false; }
+       void SetLeadOutTime(int ms) { leadOut = ms; }
 
-       virtual void Resize(int width, int height);
+public:
+       virtual void OnEnterState(app::Application &ctrl, SDL_Surface *screen);
+       virtual void OnExitState(app::Application &ctrl, SDL_Surface *screen);
+       virtual void OnResumeState(app::Application &ctrl, SDL_Surface *screen);
+       virtual void OnPauseState(app::Application &ctrl, SDL_Surface *screen);
+
+       virtual void OnResize(int width, int height);
 
        virtual void HandleEvents(const app::Input &);
        virtual void UpdateWorld(float deltaT);
@@ -45,6 +49,10 @@ private:
        SDL_Surface *blinds;
        Uint32 color;
        int duration;
+       int leadIn;
+       int leadOut;
+       bool leadInDone;
+       bool fadeDone;
        bool in;
        bool interactive;