summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-02-06 07:27:58 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-02-06 07:27:58 +0000
commitb0bc59179bd64ad6b1f006f8e109cbeb16ad7094 (patch)
tree179a50164d79d12f5c14e4b7172a5f514d97b1f1 /src/being.cpp
parent323b0e57c673035ad8065c7daf399124f15c24d4 (diff)
downloadmana-b0bc59179bd64ad6b1f006f8e109cbeb16ad7094.tar.gz
mana-b0bc59179bd64ad6b1f006f8e109cbeb16ad7094.tar.bz2
mana-b0bc59179bd64ad6b1f006f8e109cbeb16ad7094.tar.xz
mana-b0bc59179bd64ad6b1f006f8e109cbeb16ad7094.zip
Unify some of the drawing code for beings.
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 3570fe30..9a0e6d2f 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -22,15 +22,12 @@
*/
#include "being.h"
-#include <algorithm>
#include <sstream>
#include "game.h"
#include "graphics.h"
#include "log.h"
#include "map.h"
-#include "monster.h"
-#include "player.h"
#include "graphic/spriteset.h"
@@ -58,7 +55,8 @@ Being::Being(Uint32 id, Uint16 job, Map *map):
hairStyle(1), hairColor(1),
speech_time(0),
damage_time(0),
- showSpeech(false), showDamage(false)
+ showSpeech(false), showDamage(false),
+ mSpriteset(NULL), mSpriteFrame(0)
{
setMap(map);
}
@@ -217,6 +215,17 @@ Being::logic()
}
}
+void Being::draw(Graphics *graphics, int offsetX, int offsetY)
+{
+ if (!mSpriteset)
+ return;
+
+ int px = mPx + offsetX;
+ int py = mPy + offsetY;
+
+ graphics->drawImage(mSpriteset->spriteset[mSpriteFrame], px, py);
+}
+
void
Being::drawEmotion(Graphics *graphics, Sint32 offsetX, Sint32 offsetY)
{