diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-02-07 10:37:54 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-02-07 10:37:54 +0000 |
commit | ac08acd4b4029a2519c81eecf938e1c03b51233c (patch) | |
tree | 78405d149cff52b310343a1e557062345b784d41 /src/player.cpp | |
parent | c395103a0f190598e234b2c5f373d3fde25f77cf (diff) | |
download | mana-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.cpp | 4 |
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); |