diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-08-25 18:06:19 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-08-25 18:06:19 +0000 |
commit | 2c7d0b3518d72a7ab0726b72f7d2137e5944f049 (patch) | |
tree | 7080b1e32df54b8b44875df3609e94888939eb89 /src/gui/playerbox.cpp | |
parent | 529ba0581833b05921d8dc3336b02a3c6abd511a (diff) | |
download | mana-2c7d0b3518d72a7ab0726b72f7d2137e5944f049.tar.gz mana-2c7d0b3518d72a7ab0726b72f7d2137e5944f049.tar.bz2 mana-2c7d0b3518d72a7ab0726b72f7d2137e5944f049.tar.xz mana-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.cpp | 39 |
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); } |