]> git.localhorst.tv Git - l2e.git/blobdiff - src/graphics/ColorFade.cpp
fade out after victory
[l2e.git] / src / graphics / ColorFade.cpp
index f194665d1daecb35694880474e2b35dba549f2e8..55e14fc811d87e2427a4ef0443259a3da996d1da 100644 (file)
@@ -1,10 +1,3 @@
-/*
- * ColorFade.cpp
- *
- *  Created on: Oct 7, 2012
- *      Author: holy
- */
-
 #include "ColorFade.h"
 
 #include "../app/Application.h"
@@ -25,11 +18,12 @@ ColorFade::ColorFade(State *slave, Uint32 color, int duration, bool in, bool int
 , leadInDone(true)
 , fadeDone(false)
 , in(in)
-, interactive(interactive) {
+, interactive(interactive)
+, doublePop(false) {
 
 }
 
-void ColorFade::OnEnterState(Application &c, SDL_Surface *screen) {
+void ColorFade::OnEnterState(SDL_Surface *screen) {
        if (leadIn > 0) {
                timer = GraphicsTimers().StartCountdown(leadIn);
        } else {
@@ -38,18 +32,18 @@ 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) {
 
 }
 
@@ -93,15 +87,21 @@ void ColorFade::HandleEvents(const Input &input) {
                                timer = GraphicsTimers().StartCountdown(leadOut);
                        } else {
                                Ctrl().PopState();
+                               if (doublePop) {
+                                       Ctrl().PopState();
+                               }
                        }
                } else {
                        Ctrl().PopState();
+                       if (doublePop) {
+                               Ctrl().PopState();
+                       }
                }
        }
 }
 
 
-void ColorFade::UpdateWorld(float deltaT) {
+void ColorFade::UpdateWorld(Uint32 deltaT) {
        if (interactive) {
                slave->UpdateWorld(deltaT);
        }