]> git.localhorst.tv Git - l2e.git/commitdiff
renamed BattleState's background functions
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 13 Aug 2012 19:57:54 +0000 (21:57 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 13 Aug 2012 19:57:54 +0000 (21:57 +0200)
BackgroundWidth() => Width()
BackgroundHeight() => Height()

src/battle/BattleState.cpp
src/battle/BattleState.h
src/battle/states/PerformAttacks.cpp
src/battle/states/RunState.cpp
src/battle/states/SelectAttackType.cpp
src/battle/states/SelectIkari.cpp
src/battle/states/SelectItem.cpp
src/battle/states/SelectMoveAction.cpp
src/battle/states/SelectSpell.cpp

index a4e8158a4339af806392d9e0b7489a9adc3d46b4..db221b43324293f29d1fe3e8df0303c2878f6945 100644 (file)
@@ -83,16 +83,16 @@ void BattleState::EnterState(Application &ctrl, SDL_Surface *screen) {
 
        int tagHeight(attackTypeMenu.Height());
        int tagWidth(attackTypeMenu.Width() * 2 + attackTypeMenu.Width() / 2);
-       int xOffset((BackgroundWidth() - 2 * tagWidth) / 2);
-       heroTagPositions[0] = Point<int>(xOffset, BackgroundHeight() - 2 * tagHeight);
-       heroTagPositions[1] = Point<int>(xOffset + tagWidth, BackgroundHeight() - 2 * tagHeight);
-       heroTagPositions[2] = Point<int>(xOffset, BackgroundHeight() - tagHeight);
-       heroTagPositions[3] = Point<int>(xOffset + tagWidth, BackgroundHeight() - tagHeight);
+       int xOffset((Width() - 2 * tagWidth) / 2);
+       heroTagPositions[0] = Point<int>(xOffset, Height() - 2 * tagHeight);
+       heroTagPositions[1] = Point<int>(xOffset + tagWidth, Height() - 2 * tagHeight);
+       heroTagPositions[2] = Point<int>(xOffset, Height() - tagHeight);
+       heroTagPositions[3] = Point<int>(xOffset + tagWidth, Height() - tagHeight);
 
        tagHeight = res->normalFont->CharHeight() * 4 + res->smallHeroTagFrame->BorderHeight() * 2;
        tagWidth = res->normalFont->CharWidth() * 6 + res->smallHeroTagFrame->BorderWidth() * 2;
-       xOffset = (BackgroundWidth() - 4 * tagWidth) / 2;
-       int yOffset(BackgroundHeight() - tagHeight);
+       xOffset = (Width() - 4 * tagWidth) / 2;
+       int yOffset(Height() - tagHeight);
        smallHeroTagPositions[0] = Point<int>(xOffset, yOffset);
        smallHeroTagPositions[1] = Point<int>(xOffset + 2 * tagWidth, yOffset);
        smallHeroTagPositions[2] = Point<int>(xOffset + tagWidth, yOffset);
@@ -316,8 +316,8 @@ void BattleState::RenderSmallHeroTags(SDL_Surface *screen, const Vector<int> &of
 
        SDL_Rect rect;
        rect.x = offset.X();
-       rect.y = offset.Y() + BackgroundHeight() - tagHeight;
-       rect.w = BackgroundWidth();
+       rect.y = offset.Y() + Height() - tagHeight;
+       rect.w = Width();
        rect.h = tagHeight;
        SDL_FillRect(screen, &rect, SDL_MapRGB(screen->format, 0, 0, 0));
        rect.y += res->normalFont->CharHeight() / 8;
index d0a002716268f1d9209988556e0e56f77a8c3ab1..3acc0b7699c79dd9ffeaef66c686d263c2a4d29e 100644 (file)
@@ -133,8 +133,8 @@ public:
                                (screen->w - background->w) / 2,
                                (screen->h - background->h) / 2);
        }
-       int BackgroundWidth() const { return background->w; }
-       int BackgroundHeight() const { return background->h; }
+       int Width() const { return background->w; }
+       int Height() const { return background->h; }
 
        void RenderBackground(SDL_Surface *screen, const geometry::Vector<int> &offset);
        void RenderMonsters(SDL_Surface *screen, const geometry::Vector<int> &offset);
index b5cd9bebec80754ee019001b972616b557829e34..dd0e0df1cd0a27de4102081e4b8a6e470e945f01 100644 (file)
@@ -181,10 +181,10 @@ void PerformAttacks::RenderTitleBar(SDL_Surface *screen, const Vector<int> &offs
        if (!titleBarText || !titleBarTimer.Running()) return;
 
        int height(battle->Res().titleFrame->BorderHeight() * 2 + battle->Res().titleFont->CharHeight());
-       battle->Res().titleFrame->Draw(screen, Point<int>(offset.X(), offset.Y()), battle->BackgroundWidth(), height);
+       battle->Res().titleFrame->Draw(screen, Point<int>(offset.X(), offset.Y()), battle->Width(), height);
 
        Point<int> textPosition(
-                       (battle->BackgroundWidth() - (std::strlen(titleBarText) * battle->Res().titleFont->CharWidth())) / 2,
+                       (battle->Width() - (std::strlen(titleBarText) * battle->Res().titleFont->CharWidth())) / 2,
                        battle->Res().titleFrame->BorderHeight());
        battle->Res().titleFont->DrawString(titleBarText, screen, textPosition + offset);
 }
index 1a90e280f5f9af70c10478a22470fa9df0ddc825..155313f0f686e675979ad4775815d334a3cc2017 100644 (file)
@@ -70,10 +70,10 @@ void RunState::Render(SDL_Surface *screen) {
 
 void RunState::RenderTitleBar(SDL_Surface *screen, const Vector<int> &offset) {
        int height(battle->Res().titleFrame->BorderHeight() * 2 + battle->Res().titleFont->CharHeight());
-       battle->Res().titleFrame->Draw(screen, Point<int>(offset.X(), offset.Y()), battle->BackgroundWidth(), height);
+       battle->Res().titleFrame->Draw(screen, Point<int>(offset.X(), offset.Y()), battle->Width(), height);
 
        Point<int> textPosition(
-                       (battle->BackgroundWidth() - (std::strlen(battle->Res().escapeText) * battle->Res().titleFont->CharWidth())) / 2,
+                       (battle->Width() - (std::strlen(battle->Res().escapeText) * battle->Res().titleFont->CharWidth())) / 2,
                        battle->Res().titleFrame->BorderHeight());
        battle->Res().titleFont->DrawString(battle->Res().escapeText, screen, textPosition + offset);
 }
index 17260928af9455b7a6aaa40468a4cd52276e0da5..f8ad21d54d9fb9a3ebe52f1fc3dc48eb6d048f0a 100644 (file)
@@ -125,8 +125,8 @@ void SelectAttackType::Render(SDL_Surface *screen) {
 
 void SelectAttackType::RenderMenu(SDL_Surface *screen, const Vector<int> &offset) {
        Point<int> position(
-                       (battle->BackgroundWidth() - battle->GetAttackTypeMenu().Width()) / 2,
-                       battle->BackgroundHeight() - battle->GetAttackTypeMenu().Height() - battle->GetAttackTypeMenu().Height() / 2);
+                       (battle->Width() - battle->GetAttackTypeMenu().Width()) / 2,
+                       battle->Height() - battle->GetAttackTypeMenu().Height() - battle->GetAttackTypeMenu().Height() / 2);
        battle->GetAttackTypeMenu().Render(screen, position + offset);
 }
 
index 97a951d7c82fea11a5f12d3e2eb4d99847127a1e..7ccfdc481aefa411c44339c7da9bb5d3fe0f2c80 100644 (file)
@@ -111,7 +111,7 @@ void SelectIkari::Render(SDL_Surface *screen) {
 void SelectIkari::RenderFrame(SDL_Surface *screen, const Vector<int> &offset) {
        const Frame *frame(battle->Res().selectFrame);
        Point<int> position(frame->BorderWidth(), frame->BorderHeight());
-       int width(battle->BackgroundWidth() - 2 * frame->BorderWidth());
+       int width(battle->Width() - 2 * frame->BorderWidth());
        int height(battle->Res().normalFont->CharHeight() * 13);
        frame->Draw(screen, position + offset, width, height);
 }
index 22369f304252d6cf7ff82cae5e86bc738ebe2621..0291b739c9c2746b5b17f6f72edf58fabb203f57 100644 (file)
@@ -110,7 +110,7 @@ void SelectItem::Render(SDL_Surface *screen) {
 void SelectItem::RenderFrame(SDL_Surface *screen, const Vector<int> &offset) {
        const Frame *frame(battle->Res().selectFrame);
        Point<int> position(frame->BorderWidth(), frame->BorderHeight());
-       int width(battle->BackgroundWidth() - 2 * frame->BorderWidth());
+       int width(battle->Width() - 2 * frame->BorderWidth());
        int height(battle->Res().normalFont->CharHeight() * 13);
        frame->Draw(screen, position + offset, width, height);
 }
index 8aa49067df121ee223784ddfaec6d3faca050d15..7eb8fbeb1a8d98b860e692c12edaad6fc7d53cdc 100644 (file)
@@ -84,8 +84,8 @@ void SelectMoveAction::Render(SDL_Surface *screen) {
 
 void SelectMoveAction::RenderMenu(SDL_Surface *screen, const Vector<int> &offset) {
        Point<int> position(
-                       (battle->BackgroundWidth() - battle->GetMoveMenu().Width()) / 2,
-                       battle->BackgroundHeight() - battle->GetMoveMenu().Height() - battle->GetMoveMenu().Height() / 2);
+                       (battle->Width() - battle->GetMoveMenu().Width()) / 2,
+                       battle->Height() - battle->GetMoveMenu().Height() - battle->GetMoveMenu().Height() / 2);
        battle->GetMoveMenu().Render(screen, position + offset);
 }
 
index a13d8fc822e3596fecb99676f9f5b6212fd072e6..f8b00e5b97cb53c8e651d071627813a3ee599ab8 100644 (file)
@@ -111,7 +111,7 @@ void SelectSpell::Render(SDL_Surface *screen) {
 void SelectSpell::RenderFrame(SDL_Surface *screen, const Vector<int> &offset) {
        const Frame *frame(battle->Res().selectFrame);
        Point<int> position(frame->BorderWidth(), frame->BorderHeight());
-       int width(battle->BackgroundWidth() - 2 * frame->BorderWidth());
+       int width(battle->Width() - 2 * frame->BorderWidth());
        int height(battle->Res().normalFont->CharHeight() * 13);
        frame->Draw(screen, position + offset, width, height);
 }