diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-02-06 07:27:58 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-02-06 07:27:58 +0000 |
commit | b0bc59179bd64ad6b1f006f8e109cbeb16ad7094 (patch) | |
tree | 179a50164d79d12f5c14e4b7172a5f514d97b1f1 /src/npc.cpp | |
parent | 323b0e57c673035ad8065c7daf399124f15c24d4 (diff) | |
download | mana-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/npc.cpp')
-rw-r--r-- | src/npc.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/npc.cpp b/src/npc.cpp index fd894969..9712a06d 100644 --- a/src/npc.cpp +++ b/src/npc.cpp @@ -23,13 +23,10 @@ #include "npc.h" -#include "graphics.h" - -#include "graphic/spriteset.h" - #include "net/messageout.h" #include "net/protocol.h" +class Spriteset; extern Spriteset *npcset; NPC *current_npc = 0; @@ -37,6 +34,8 @@ NPC *current_npc = 0; NPC::NPC(Uint32 id, Uint16 job, Map *map, Network *network): Being(id, job, map), mNetwork(network) { + mSpriteset = npcset; + mSpriteFrame = job-100; } Being::Type NPC::getType() const @@ -46,12 +45,7 @@ Being::Type NPC::getType() const void NPC::draw(Graphics *graphics, int offsetX, int offsetY) { - int px = mPx + offsetX; - int py = mPy + offsetY; - - graphics->drawImage(npcset->spriteset[job - 100], px - 8, py - 52); - - Being::draw(graphics, offsetX, offsetY); + Being::draw(graphics, offsetX - 8, offsetY - 52); } void NPC::talk() |