From: Daniel Karbach Date: Mon, 4 Feb 2013 07:15:58 +0000 (+0100) Subject: fixed formatting of battle::RunState X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=42fea5412a4423e827aac36465b2d9a38968390e;p=l2e.git fixed formatting of battle::RunState --- diff --git a/src/battle/states/RunState.cpp b/src/battle/states/RunState.cpp index 7fbb783..f49f36f 100644 --- a/src/battle/states/RunState.cpp +++ b/src/battle/states/RunState.cpp @@ -11,7 +11,10 @@ using app::Application; using app::Input; +using graphics::Font; +using graphics::Frame; using math::Vector; +using std::strlen; namespace battle { @@ -33,14 +36,18 @@ void RunState::OnPauseState(SDL_Surface *screen) { void RunState::OnResize(int width, int height) { + const Resources &res = battle->Res(); + const Frame &frame = *res.titleFrame; + const Font &font = *res.titleFont; + framePosition = battle->ScreenOffset(); frameSize = Vector ( battle->Width(), - battle->Res().titleFrame->BorderHeight() * 2 + battle->Res().titleFont->CharHeight()); + frame.BorderHeight() * 2 + font.CharHeight()); textPosition = Vector( - (battle->Width() - std::strlen(battle->Res().escapeText) * battle->Res().titleFont->CharWidth()) / 2, - battle->Res().titleFrame->BorderHeight()); + (battle->Width() - strlen(res.escapeText) * font.CharWidth()) / 2, + frame.BorderHeight()); } @@ -65,7 +72,7 @@ void RunState::Render(SDL_Surface *screen) { } void RunState::RenderTitleBar(SDL_Surface *screen) { -const Resources &res = battle->Res(); + const Resources &res = battle->Res(); res.titleFrame->Draw(screen, framePosition, frameSize.X(), frameSize.Y()); res.titleFont->DrawString(res.escapeText, screen, textPosition); } diff --git a/src/battle/states/RunState.h b/src/battle/states/RunState.h index f94bd3e..7cf5e71 100644 --- a/src/battle/states/RunState.h +++ b/src/battle/states/RunState.h @@ -15,10 +15,9 @@ class RunState public: explicit RunState(BattleState *battle) - : battle(battle){ } + : battle(battle) { } public: - virtual void HandleEvents(const app::Input &); virtual void UpdateWorld(Uint32 deltaT); virtual void Render(SDL_Surface *);