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/monster.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/monster.cpp')
-rw-r--r-- | src/monster.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/monster.cpp b/src/monster.cpp index f07f7447..299940c5 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -87,7 +87,10 @@ void Monster::draw(Graphics *graphics, int offsetX, int offsetY) mSpriteFrame += mFrame; } - mSpriteFrame = direction / 2 + 4 * mSpriteFrame; + unsigned char dir = 0; + while (!(direction & (1 << dir))) dir++; + + mSpriteFrame = dir + 4 * mSpriteFrame; Being::draw(graphics, offsetX - 12, offsetY - 25); } |