summaryrefslogtreecommitdiff
path: root/src/gui/playerbox.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-25 18:06:19 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-25 18:06:19 +0000
commit2c7d0b3518d72a7ab0726b72f7d2137e5944f049 (patch)
tree7080b1e32df54b8b44875df3609e94888939eb89 /src/gui/playerbox.cpp
parent529ba0581833b05921d8dc3336b02a3c6abd511a (diff)
downloadmana-client-2c7d0b3518d72a7ab0726b72f7d2137e5944f049.tar.gz
mana-client-2c7d0b3518d72a7ab0726b72f7d2137e5944f049.tar.bz2
mana-client-2c7d0b3518d72a7ab0726b72f7d2137e5944f049.tar.xz
mana-client-2c7d0b3518d72a7ab0726b72f7d2137e5944f049.zip
Made our drawImage() method respect the clip area from the guichan graphics part. Removed some (now) obsolete code. Fixed compilation errors.
Diffstat (limited to 'src/gui/playerbox.cpp')
-rw-r--r--src/gui/playerbox.cpp39
1 files changed, 17 insertions, 22 deletions
diff --git a/src/gui/playerbox.cpp b/src/gui/playerbox.cpp
index 169c37fc..b1414ef8 100644
--- a/src/gui/playerbox.cpp
+++ b/src/gui/playerbox.cpp
@@ -83,37 +83,32 @@ PlayerBox::~PlayerBox()
void PlayerBox::draw(gcn::Graphics *graphics)
{
- if (showPlayer)
+ if (!showPlayer) {
+ return;
+ }
+
+ // Draw character
+ dynamic_cast<Graphics*>(graphics)->drawImage(
+ playerset->spriteset[0], 23, 23);
+
+ // Draw his hair
+ if (hairColor >= 0 && hairStyle >= 0 &&
+ hairColor < NR_HAIR_COLORS && hairStyle < NR_HAIR_STYLES)
{
- int x, y;
- getAbsolutePosition(x, y);
-
- // Draw character
- dynamic_cast<Graphics*>(graphics)->drawImage(
- playerset->spriteset[0], x + 23, y + 23);
-
- // Draw his hair
- if (hairColor >= 0 && hairStyle >= 0 &&
- hairColor < NR_HAIR_COLORS && hairStyle < NR_HAIR_STYLES)
- {
- int hf = hairColor + 40 * (hairStyle);
- if (hf >= 0 && hf < (int)hairset->spriteset.size()) {
- dynamic_cast<Graphics*>(graphics)->drawImage(
- hairset->spriteset[hf], x + 37, y + 5);
- }
+ int hf = hairColor + 40 * (hairStyle);
+ if (hf >= 0 && hf < (int)hairset->spriteset.size()) {
+ dynamic_cast<Graphics*>(graphics)->drawImage(
+ hairset->spriteset[hf], 37, 5);
}
}
}
void PlayerBox::drawBorder(gcn::Graphics *graphics)
{
- int x, y, w, h, bs;
- getAbsolutePosition(x, y);
+ int w, h, bs;
bs = getBorderSize();
w = getWidth() + bs * 2;
h = getHeight() + bs * 2;
- x -= bs;
- y -= bs;
- dynamic_cast<Graphics*>(graphics)->drawImageRect(x, y, w, h, background);
+ dynamic_cast<Graphics*>(graphics)->drawImageRect(0, 0, w, h, background);
}