X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FSelectTarget.cpp;h=e8572884cf2648c366403385e44c7824da413fa2;hb=2a1d9169e1f6c2dfe0f93ed40d5fb68d3da342af;hp=25838571162f0aa45e58ff88012063ce0024ade6;hpb=8a6225176cd0946363ac2d8219d54a13009de675;p=l2e.git diff --git a/src/battle/states/SelectTarget.cpp b/src/battle/states/SelectTarget.cpp index 2583857..e857288 100644 --- a/src/battle/states/SelectTarget.cpp +++ b/src/battle/states/SelectTarget.cpp @@ -11,12 +11,9 @@ #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; @@ -89,14 +86,13 @@ 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; - if (selection->TargetsEnemies()) { - for (vector >::const_iterator i(battle->MonsterPositions().begin()), end(battle->MonsterPositions().end()); i != end; ++i) { - positions.push_back(*i); + vector > positions; + if (selection->TargetsMonsters()) { + for (int i(0), end(battle->MaxMonsters()); i < end; ++i) { + positions.push_back(battle->MonsterAt(i).Position()); } } else { for (int i(0), end(battle->NumHeroes()); i < end; ++i) { @@ -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); }