summaryrefslogtreecommitdiff
path: root/src/player.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-10-09 19:42:13 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-10-09 19:42:13 +0000
commit3fe1772b1e00344365e3cf8204225be19925b9e5 (patch)
tree0f66dddac8e14787096c01368611efa53f453134 /src/player.cpp
parent8cc0423b0c0aaa5dd9e91f673a691e5e634988c1 (diff)
downloadmana-client-3fe1772b1e00344365e3cf8204225be19925b9e5.tar.gz
mana-client-3fe1772b1e00344365e3cf8204225be19925b9e5.tar.bz2
mana-client-3fe1772b1e00344365e3cf8204225be19925b9e5.tar.xz
mana-client-3fe1772b1e00344365e3cf8204225be19925b9e5.zip
Merged the movement branch into trunk
I consider this the only way forward. In my tests this code isn't actually doing worse than what was there before. Of course some cases are a bit broken, and I'm open to any kind of feedback so that we can fix those issues.
Diffstat (limited to 'src/player.cpp')
-rw-r--r--src/player.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/player.cpp b/src/player.cpp
index 49f0221d..97c60789 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -46,7 +46,6 @@ Player::Player(int id, int job, Map *map):
Player::~Player()
{
- if (mMap) mMap->freeTile(mX / 32, mY / 32, getBlockType());
}
Being::Type
@@ -55,15 +54,15 @@ Player::getType() const
return PLAYER;
}
-void
-Player::drawName(Graphics *graphics, int offsetX, int offsetY)
+void Player::drawName(Graphics *graphics, int offsetX, int offsetY)
{
- int px = mPx + offsetX;
- int py = mPy + offsetY;
+ const Vector &pos = getPosition();
+ const int px = (int) pos.x + offsetX;
+ const int py = (int) pos.y + offsetY;
graphics->setFont(speechFont);
graphics->setColor(gcn::Color(255, 255, 255));
- graphics->drawText(mName, px + 15, py + 30, gcn::Graphics::CENTER);
+ graphics->drawText(mName, px, py, gcn::Graphics::CENTER);
}
void Player::setGender(Gender gender)