X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FSelectTarget.cpp;h=25838571162f0aa45e58ff88012063ce0024ade6;hb=8a6225176cd0946363ac2d8219d54a13009de675;hp=8fe31cd60dad1e1953c3460d86f4998870158969;hpb=00b557a47e47d9410730d47d436f6158a3fb79f5;p=l2e.git diff --git a/src/battle/states/SelectTarget.cpp b/src/battle/states/SelectTarget.cpp index 8fe31cd..2583857 100644 --- a/src/battle/states/SelectTarget.cpp +++ b/src/battle/states/SelectTarget.cpp @@ -90,9 +90,9 @@ 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) { @@ -100,16 +100,13 @@ void SelectTarget::RenderCursors(SDL_Surface *screen, const geometry::VectorNumHeroes()); 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); } } }