X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FSelectTarget.cpp;h=4645f6debd37dfaf50ad2c450c6725800b35c52d;hb=7252571fb926a187c4c40e8f4eec718f16d63ffa;hp=37f2da9829d603405b1b546aa446659e239582a5;hpb=fde7b27297882a7f033641df92e732abd137b532;p=l2e.git diff --git a/src/battle/states/SelectTarget.cpp b/src/battle/states/SelectTarget.cpp index 37f2da9..4645f6d 100644 --- a/src/battle/states/SelectTarget.cpp +++ b/src/battle/states/SelectTarget.cpp @@ -11,35 +11,32 @@ #include "../BattleState.h" #include "../../app/Application.h" #include "../../app/Input.h" -#include "../../geometry/operators.h" -#include "../../geometry/Point.h" using app::Application; using app::Input; -using geometry::Point; using geometry::Vector; using std::vector; namespace battle { -void SelectTarget::EnterState(Application &c, SDL_Surface *screen) { +void SelectTarget::OnEnterState(Application &c, SDL_Surface *screen) { ctrl = &c; } -void SelectTarget::ExitState(Application &c, SDL_Surface *screen) { +void SelectTarget::OnExitState(Application &c, SDL_Surface *screen) { ctrl = 0; } -void SelectTarget::ResumeState(Application &ctrl, SDL_Surface *screen) { +void SelectTarget::OnResumeState(Application &ctrl, SDL_Surface *screen) { } -void SelectTarget::PauseState(Application &ctrl, SDL_Surface *screen) { +void SelectTarget::OnPauseState(Application &ctrl, SDL_Surface *screen) { } -void SelectTarget::Resize(int width, int height) { +void SelectTarget::OnResize(int width, int height) { } @@ -89,11 +86,10 @@ void SelectTarget::Render(SDL_Surface *screen) { } void SelectTarget::RenderCursors(SDL_Surface *screen, const geometry::Vector &offset) { - // TODO: this should be related to the enemy's width Vector cursorOffset(cursorIcon->Width() / -2, cursorIcon->Height()); // offset the indicator by 1/8th to the right and top Vector indicatorOffset(cursorOffset + Vector(cursorIcon->Width() / 8, cursorIcon->Height() / -8)); - vector > positions; + vector > positions; if (selection->TargetsMonsters()) { for (int i(0), end(battle->MaxMonsters()); i < end; ++i) { positions.push_back(battle->MonsterAt(i).Position()); @@ -104,7 +100,7 @@ void SelectTarget::RenderCursors(SDL_Surface *screen, const geometry::Vector >::size_type i(0); i < positions.size(); ++i) { + for (vector >::size_type i(0); i < positions.size(); ++i) { if (selection->IsSelected(i)) { cursorIcon->DrawTopRight(screen, positions[i] + indicatorOffset + offset); }