-void SelectTarget::RenderCursors(SDL_Surface *screen, const geometry::Vector<int> &offset) {
- // TODO: this should be related to the enemy's width
- // offset the cursor by 1/8th to the left and bottom
- Vector<int> cursorOffset(cursorIcon->Width() / -8, cursorIcon->Height() / 8);
- Vector<int> indicatorOffset(0, 0);
- vector<Point<int> > positions;
- if (selection->TargetsEnemies()) {
- for (vector<Point<int> >::const_iterator i(battle->MonsterPositions().begin()), end(battle->MonsterPositions().end()); i != end; ++i) {
- positions.push_back(*i);
- }
- } else {
- for (vector<Hero>::size_type i(0), end(battle->Heroes().size()); i < end; ++i) {
- Vector<int> positionCorrection(cursorIcon->Width() / 2, battle->HeroTagAt(i).HeroSprite()->Height() - cursorIcon->Height() / 2);
- // indicator offsets are inverted for heroes
- positionCorrection -= cursorOffset;
- positions.push_back(battle->HeroTagPositionAt(i) + battle->HeroTagAt(i).HeroOffset() + positionCorrection);
- }
- }
+void SelectTarget::RenderCursors(SDL_Surface *screen) {
+ vector<Vector<int> > &positions = selection->TargetsMonsters()
+ ? monsterPositions
+ : heroPositions;
+