]> git.localhorst.tv Git - l2e.git/blobdiff - src/graphics/ColorFade.cpp
removed now superfluous Application parameter to State callbacks
[l2e.git] / src / graphics / ColorFade.cpp
index b33ee0838540d36e46ea9a119fda3c9a2508b4fa..8afd87be72b8345c76b1ca753b34ac8c5e6d6674 100644 (file)
@@ -16,8 +16,7 @@ using app::Input;
 namespace graphics {
 
 ColorFade::ColorFade(State *slave, Uint32 color, int duration, bool in, bool interactive)
-: ctrl(0)
-, slave(slave)
+: slave(slave)
 , blinds(0)
 , color(color)
 , duration(duration)
@@ -30,8 +29,7 @@ ColorFade::ColorFade(State *slave, Uint32 color, int duration, bool in, bool int
 
 }
 
-void ColorFade::OnEnterState(Application &c, SDL_Surface *screen) {
-       ctrl = &c;
+void ColorFade::OnEnterState(SDL_Surface *screen) {
        if (leadIn > 0) {
                timer = GraphicsTimers().StartCountdown(leadIn);
        } else {
@@ -40,24 +38,24 @@ void ColorFade::OnEnterState(Application &c, SDL_Surface *screen) {
        }
 }
 
-void ColorFade::OnExitState(Application &, SDL_Surface *screen) {
+void ColorFade::OnExitState(SDL_Surface *screen) {
        if (blinds) {
                SDL_FreeSurface(blinds);
                blinds = 0;
        }
 }
 
-void ColorFade::OnResumeState(Application &ctrl, SDL_Surface *screen) {
+void ColorFade::OnResumeState(SDL_Surface *screen) {
        UpdateBlinds(screen->w, screen->h);
 }
 
-void ColorFade::OnPauseState(Application &ctrl, SDL_Surface *screen) {
+void ColorFade::OnPauseState(SDL_Surface *screen) {
 
 }
 
 
 void ColorFade::OnResize(int width, int height) {
-       slave->OnResize(width, height);
+       slave->Resize(width, height);
        UpdateBlinds(width, height);
 }
 
@@ -94,10 +92,10 @@ void ColorFade::HandleEvents(const Input &input) {
                        if (leadOut > 0) {
                                timer = GraphicsTimers().StartCountdown(leadOut);
                        } else {
-                               ctrl->PopState();
+                               Ctrl().PopState();
                        }
                } else {
-                       ctrl->PopState();
+                       Ctrl().PopState();
                }
        }
 }