X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FSelectTarget.cpp;h=591da6753972350cf1eb9f0f44041a8df2023368;hb=9718062e6ed305d9f8f1674ff172079688e78088;hp=8fe31cd60dad1e1953c3460d86f4998870158969;hpb=adb1e3d5eafba2ef3de1499be286be330afaefef;p=l2e.git diff --git a/src/battle/states/SelectTarget.cpp b/src/battle/states/SelectTarget.cpp index 8fe31cd..591da67 100644 --- a/src/battle/states/SelectTarget.cpp +++ b/src/battle/states/SelectTarget.cpp @@ -90,26 +90,23 @@ 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 - // offset the cursor by 1/8th to the left and bottom - Vector cursorOffset(cursorIcon->Width() / -8, cursorIcon->Height() / 8); - Vector indicatorOffset(0, 0); + 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); + 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) { - Vector 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); + positions.push_back(battle->HeroTagPositionAt(i) + battle->HeroTagAt(i).HeroOffset()); } } if (flipFlop) { for (vector >::size_type i(0); i < positions.size(); ++i) { if (selection->IsSelected(i)) { - cursorIcon->DrawTopRight(screen, positions[i] + offset); + cursorIcon->DrawTopRight(screen, positions[i] + indicatorOffset + offset); } } }