X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FColorFade.cpp;h=72bf40978791cfb1d0bad8143eda8d241fc98506;hb=5d1a76ae7725af998c6ee46adfe492c68ee1d34f;hp=b33ee0838540d36e46ea9a119fda3c9a2508b4fa;hpb=2ccc2369d32fb680a3047519d79c17de34c4e10a;p=l2e.git diff --git a/src/graphics/ColorFade.cpp b/src/graphics/ColorFade.cpp index b33ee08..72bf409 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::OnEnterState(Application &c, SDL_Surface *screen) { - ctrl = &c; +void ColorFade::OnEnterState(SDL_Surface *screen) { if (leadIn > 0) { timer = GraphicsTimers().StartCountdown(leadIn); } else { @@ -40,24 +31,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,16 +85,16 @@ void ColorFade::HandleEvents(const Input &input) { if (leadOut > 0) { timer = GraphicsTimers().StartCountdown(leadOut); } else { - ctrl->PopState(); + Ctrl().PopState(); } } else { - ctrl->PopState(); + Ctrl().PopState(); } } } -void ColorFade::UpdateWorld(float deltaT) { +void ColorFade::UpdateWorld(Uint32 deltaT) { if (interactive) { slave->UpdateWorld(deltaT); }