X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FColorFade.cpp;h=45cd6054ce1a810de47df3672da863e59dafad7f;hb=cc3d698b8c1ad09d7a3f9e3f28bc84e0ac1735ea;hp=e83edbb1c0ccf4313c9f1820723b3b968abf2869;hpb=123ca72f7a92d2529c6f9b6bdff3f13d6f0223c9;p=l2e.git diff --git a/src/graphics/ColorFade.cpp b/src/graphics/ColorFade.cpp index e83edbb..45cd605 100644 --- a/src/graphics/ColorFade.cpp +++ b/src/graphics/ColorFade.cpp @@ -1,10 +1,3 @@ -/* - * ColorFade.cpp - * - * Created on: Oct 7, 2012 - * Author: holy - */ - #include "ColorFade.h" #include "../app/Application.h" @@ -16,8 +9,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 +22,7 @@ ColorFade::ColorFade(State *slave, Uint32 color, int duration, bool in, bool int } -void ColorFade::EnterState(Application &c, SDL_Surface *screen) { - ctrl = &c; +void ColorFade::OnEnterState(SDL_Surface *screen) { if (leadIn > 0) { timer = GraphicsTimers().StartCountdown(leadIn); } else { @@ -40,23 +31,23 @@ void ColorFade::EnterState(Application &c, SDL_Surface *screen) { } } -void ColorFade::ExitState(Application &, SDL_Surface *screen) { +void ColorFade::OnExitState(SDL_Surface *screen) { if (blinds) { SDL_FreeSurface(blinds); blinds = 0; } } -void ColorFade::ResumeState(Application &ctrl, SDL_Surface *screen) { +void ColorFade::OnResumeState(SDL_Surface *screen) { UpdateBlinds(screen->w, screen->h); } -void ColorFade::PauseState(Application &ctrl, SDL_Surface *screen) { +void ColorFade::OnPauseState(SDL_Surface *screen) { } -void ColorFade::Resize(int width, int height) { +void ColorFade::OnResize(int width, int height) { slave->Resize(width, height); UpdateBlinds(width, height); } @@ -94,10 +85,10 @@ void ColorFade::HandleEvents(const Input &input) { if (leadOut > 0) { timer = GraphicsTimers().StartCountdown(leadOut); } else { - ctrl->PopState(); + Ctrl().PopState(); } } else { - ctrl->PopState(); + Ctrl().PopState(); } } }