summaryrefslogtreecommitdiff
path: root/src/player.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-02-07 10:37:54 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-02-07 10:37:54 +0000
commitac08acd4b4029a2519c81eecf938e1c03b51233c (patch)
tree78405d149cff52b310343a1e557062345b784d41 /src/player.cpp
parentc395103a0f190598e234b2c5f373d3fde25f77cf (diff)
downloadmana-ac08acd4b4029a2519c81eecf938e1c03b51233c.tar.gz
mana-ac08acd4b4029a2519c81eecf938e1c03b51233c.tar.bz2
mana-ac08acd4b4029a2519c81eecf938e1c03b51233c.tar.xz
mana-ac08acd4b4029a2519c81eecf938e1c03b51233c.zip
Made the being directions being stored in a bitfield.
Diffstat (limited to 'src/player.cpp')
-rw-r--r--src/player.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/player.cpp b/src/player.cpp
index 71bb6ca5..d6363242 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -85,7 +85,6 @@ Being::Type Player::getType() const
void Player::draw(Graphics *graphics, int offsetX, int offsetY)
{
- unsigned char dir = direction / 2;
int px = mPx + offsetX;
int py = mPy + offsetY;
int frame = action;
@@ -102,6 +101,9 @@ void Player::draw(Graphics *graphics, int offsetX, int offsetY)
frame += 4 * (getWeapon() - 1);
}
+ unsigned char dir = 0;
+ while (!(direction & (1 << dir))) dir++;
+
graphics->drawImage(playerset->spriteset[frame + 16 * dir],
px - 16, py - 32);