diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-07-16 14:29:42 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-07-16 14:29:42 +0000 |
commit | 51224bed60d5bed45b53e99b44bc1123a2a9cb68 (patch) | |
tree | 2acbf76139b6ef76d21aaf98ee09e326a59c4467 /src/gui/equipment.cpp | |
parent | 96e61ed3ff7e41976ac8788363d6df8719037962 (diff) | |
download | mana-51224bed60d5bed45b53e99b44bc1123a2a9cb68.tar.gz mana-51224bed60d5bed45b53e99b44bc1123a2a9cb68.tar.bz2 mana-51224bed60d5bed45b53e99b44bc1123a2a9cb68.tar.xz mana-51224bed60d5bed45b53e99b44bc1123a2a9cb68.zip |
Made Image/SubImage being drawn by Graphics. Removed some redundant code.
Diffstat (limited to 'src/gui/equipment.cpp')
-rw-r--r-- | src/gui/equipment.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gui/equipment.cpp b/src/gui/equipment.cpp index 33786c36..37623637 100644 --- a/src/gui/equipment.cpp +++ b/src/gui/equipment.cpp @@ -55,15 +55,16 @@ void EquipmentWindow::draw(gcn::Graphics *graphics) { int x, y; getAbsolutePosition(x, y); - + // Draw window graphics Window::draw(graphics); - + for (int i = 0; i < 8; i++) { if (equipments[i].id > 0) { - itemset->spriteset[itemDb->getItemInfo( - equipments[i].id)->getImage() - 1]->draw( - screen, x + 36 * (i % 4) + 10, y + 36 * (i / 4) + 25); + Image *image = itemset->spriteset[itemDb->getItemInfo( + equipments[i].id)->getImage() - 1]; + dynamic_cast<Graphics*>(graphics)->drawImage( + image, x + 36 * (i % 4) + 10, y + 36 * (i / 4) + 25); } graphics->setColor(gcn::Color(0, 0, 0)); graphics->drawRectangle(gcn::Rectangle(10 + 36 * (i % 4), @@ -72,8 +73,11 @@ void EquipmentWindow::draw(gcn::Graphics *graphics) graphics->setColor(gcn::Color(0, 0, 0)); graphics->drawRectangle(gcn::Rectangle(160, 25, 32, 32)); if (arrows) { - itemset->spriteset[itemDb->getItemInfo(arrows)->getImage() - 1]->draw( - screen, x + 160, y + 25); + Image *image = itemset->spriteset[ + itemDb->getItemInfo(arrows)->getImage() - 1]; + + dynamic_cast<Graphics*>(graphics)->drawImage( + image, x + 160, y + 25); std::stringstream n; n << arrowsNumber; graphics->drawText(n.str(), 170, 62, |