]> git.localhorst.tv Git - l2e.git/commitdiff
fixed formatting of battle::RunState
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 4 Feb 2013 07:15:58 +0000 (08:15 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 4 Feb 2013 07:15:58 +0000 (08:15 +0100)
src/battle/states/RunState.cpp
src/battle/states/RunState.h

index 7fbb78347c5ad5c2cf76912a9414685b6cabc7b0..f49f36fa0336b9a8e421884085135860f2b56b27 100644 (file)
 
 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<int> (
                        battle->Width(),
-                       battle->Res().titleFrame->BorderHeight() * 2 + battle->Res().titleFont->CharHeight());
+                       frame.BorderHeight() * 2 + font.CharHeight());
 
        textPosition = Vector<int>(
-                       (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);
 }
index f94bd3e324414e960731977e1199ab35c8ed8e64..7cf5e715e521ad1ad916b46c8a124991a6353327 100644 (file)
@@ -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 *);