summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
authorRoderic Morris <roderic@ccs.neu.edu>2008-10-24 00:28:05 +0000
committerRoderic Morris <roderic@ccs.neu.edu>2008-10-24 00:28:05 +0000
commit0b2235dfff7f7c0f534746271ff66275297fd328 (patch)
tree27d0ed8f487ccf7793606f20d8ce5d9814343efd /src/gui/viewport.cpp
parentafa57ceea0df1ce1ca494d7794e2f6542befc214 (diff)
downloadmana-client-0b2235dfff7f7c0f534746271ff66275297fd328.tar.gz
mana-client-0b2235dfff7f7c0f534746271ff66275297fd328.tar.bz2
mana-client-0b2235dfff7f7c0f534746271ff66275297fd328.tar.xz
mana-client-0b2235dfff7f7c0f534746271ff66275297fd328.zip
fixes for targetting (by Chuck Miller)
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 80dcf489..d086418f 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -298,18 +298,15 @@ void Viewport::drawTargetCursor(Graphics *graphics)
Being::TargetCursorSize cursorSize = target->getTargetCursorSize();
Image* targetCursor;
if (rangeX > attackRange || rangeY > attackRange)
- {
- targetCursor = mTargetCursorOutRange[cursorSize]->getCurrentImage();
- }
- else {
- targetCursor = mTargetCursorInRange[cursorSize]->getCurrentImage();
- }
+ targetCursor = mTargetCursorOutRange[cursorSize]->getCurrentImage();
+ else
+ targetCursor = mTargetCursorInRange[cursorSize]->getCurrentImage();
// Draw the target cursor at the correct position
- int posX = target->getPixelX() + 16 -
- targetCursor->getWidth() / 2 - (int) mViewX;
- int posY = target->getPixelY() + 16 -
- targetCursor->getHeight() / 2 - (int) mViewY;
+ int posX = target->getPixelX() -
+ targetCursor->getWidth() / 2 - (int) mViewX;
+ int posY = target->getPixelY() - 16 -
+ targetCursor->getHeight() / 2 - (int) mViewY;
graphics->drawImage(targetCursor, posX, posY);
}
@@ -325,7 +322,7 @@ void Viewport::drawTargetName(Graphics *graphics)
graphics->setColor(gcn::Color(255, 32, 32));
const MonsterInfo &mi = static_cast<Monster*>(target)->getInfo();
- int posX = target->getPixelX() + 16 - (int) mViewX;
+ int posX = target->getPixelX() - (int) mViewX;
int posY = target->getPixelY() + 16 - target->getHeight() - (int) mViewY;
graphics->drawText(mi.getName(), posX, posY, gcn::Graphics::CENTER);