]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/states/RunState.cpp
fixed formatting of battle::RunState
[l2e.git] / src / battle / states / RunState.cpp
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);
 }