X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FSelectMoveAction.cpp;h=c8405da7968340d01aa58f5c6c4ee7ee48f7697b;hb=eb2ad5ffd08128d31af32f3929a3295fcfa251e9;hp=b77f98c1a2459a7da7aa9e80bfb590542f6a89cc;hpb=5d1a76ae7725af998c6ee46adfe492c68ee1d34f;p=l2e.git diff --git a/src/battle/states/SelectMoveAction.cpp b/src/battle/states/SelectMoveAction.cpp index b77f98c..c8405da 100644 --- a/src/battle/states/SelectMoveAction.cpp +++ b/src/battle/states/SelectMoveAction.cpp @@ -1,10 +1,3 @@ -/* - * SelectMoveAction.cpp - * - * Created on: Aug 7, 2012 - * Author: holy - */ - #include "SelectMoveAction.h" #include "RunState.h" @@ -14,6 +7,7 @@ #include "../MoveMenu.h" #include "../../app/Application.h" #include "../../app/Input.h" +#include "../../math/Vector.h" using app::Application; using app::Input; @@ -22,7 +16,7 @@ using math::Vector; namespace battle { void SelectMoveAction::OnEnterState(SDL_Surface *screen) { - + OnResize(screen->w, screen->h); } void SelectMoveAction::OnExitState(SDL_Surface *screen) { @@ -39,7 +33,9 @@ void SelectMoveAction::OnPauseState(SDL_Surface *screen) { void SelectMoveAction::OnResize(int width, int height) { - + position = battle->ScreenOffset() + Vector( + (battle->Width() - battle->GetMoveMenu().Width()) / 2, + battle->Height() - battle->GetMoveMenu().Height() - battle->GetMoveMenu().Height() / 2); } @@ -73,18 +69,14 @@ void SelectMoveAction::UpdateWorld(Uint32 deltaT) { } void SelectMoveAction::Render(SDL_Surface *screen) { - Vector offset(battle->CalculateScreenOffset(screen)); - battle->RenderBackground(screen, offset); - battle->RenderMonsters(screen, offset); - battle->RenderHeroTags(screen, offset); - RenderMenu(screen, offset); + battle->RenderBackground(screen); + battle->RenderMonsters(screen); + battle->RenderHeroTags(screen); + RenderMenu(screen); } -void SelectMoveAction::RenderMenu(SDL_Surface *screen, const Vector &offset) { - Vector position( - (battle->Width() - battle->GetMoveMenu().Width()) / 2, - battle->Height() - battle->GetMoveMenu().Height() - battle->GetMoveMenu().Height() / 2); - battle->GetMoveMenu().Render(screen, position + offset); +void SelectMoveAction::RenderMenu(SDL_Surface *screen) { + battle->GetMoveMenu().Render(screen, position); } }