summaryrefslogtreecommitdiff
path: root/src/gui/playerbox.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-12-11 15:47:35 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-12-11 15:47:35 +0000
commit8da32105732949b4b0273c718d118bcfae70a1c9 (patch)
tree0a354974d48268cfaafcdb1e06b498fa26a59c1e /src/gui/playerbox.cpp
parentf9ce4e302cb3ed203d89a7a18e10b7ad4f11519c (diff)
downloadmana-8da32105732949b4b0273c718d118bcfae70a1c9.tar.gz
mana-8da32105732949b4b0273c718d118bcfae70a1c9.tar.bz2
mana-8da32105732949b4b0273c718d118bcfae70a1c9.tar.xz
mana-8da32105732949b4b0273c718d118bcfae70a1c9.zip
Merged 0.0 changes from revision 2825 to 2898 to trunk.
Diffstat (limited to 'src/gui/playerbox.cpp')
-rw-r--r--src/gui/playerbox.cpp37
1 files changed, 10 insertions, 27 deletions
diff --git a/src/gui/playerbox.cpp b/src/gui/playerbox.cpp
index 568c3350..5fbe79b7 100644
--- a/src/gui/playerbox.cpp
+++ b/src/gui/playerbox.cpp
@@ -23,7 +23,7 @@
#include "playerbox.h"
-#include "../being.h"
+#include "../player.h"
#include "../graphics.h"
#include "../resources/image.h"
@@ -32,17 +32,11 @@
#include "../utils/dtor.h"
-extern std::vector<Spriteset *> hairset;
-extern Spriteset *playerset[2];
-
int PlayerBox::instances = 0;
ImageRect PlayerBox::background;
-PlayerBox::PlayerBox(unsigned char sex):
- mHairColor(0),
- mHairStyle(0),
- mSex(sex),
- mShowPlayer(false)
+PlayerBox::PlayerBox(const Player *player):
+ mPlayer(player)
{
setBorderSize(2);
@@ -81,29 +75,18 @@ PlayerBox::~PlayerBox()
}
}
-void PlayerBox::draw(gcn::Graphics *graphics)
+void
+PlayerBox::draw(gcn::Graphics *graphics)
{
- if (!mShowPlayer) {
- return;
- }
-
- // Draw character
- dynamic_cast<Graphics*>(graphics)->drawImage(
- playerset[mSex]->get(0), 23, 12);
-
- // Draw his hair
- if (mHairStyle > 0 && mHairColor < NR_HAIR_COLORS &&
- mHairStyle < NR_HAIR_STYLES)
+ if (mPlayer)
{
- int hf = 5 * mHairColor;
- if (hf >= 0 && hf < (int)hairset[mHairStyle]->size()) {
- dynamic_cast<Graphics*>(graphics)->drawImage(
- hairset[mHairStyle - 1]->get(hf), 35, 7);
- }
+ // Draw character
+ mPlayer->draw(dynamic_cast<Graphics*>(graphics), 40, 42);
}
}
-void PlayerBox::drawBorder(gcn::Graphics *graphics)
+void
+PlayerBox::drawBorder(gcn::Graphics *graphics)
{
int w, h, bs;
bs = getBorderSize();