summaryrefslogtreecommitdiff
path: root/src/gui/equipmentwindow.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-11-15 23:44:01 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-11-15 23:44:01 +0000
commit0e925e97554aae573e895afa4e3d8450f01df342 (patch)
treebbc30319410aecb9fec7c005e667cd7fb628bb17 /src/gui/equipmentwindow.cpp
parentffa0fae492d954c0aed35a0acbd7b856778d7328 (diff)
downloadmana-0e925e97554aae573e895afa4e3d8450f01df342.tar.gz
mana-0e925e97554aae573e895afa4e3d8450f01df342.tar.bz2
mana-0e925e97554aae573e895afa4e3d8450f01df342.tar.xz
mana-0e925e97554aae573e895afa4e3d8450f01df342.zip
Moved item icon from ItemInfo class to the Item class, so that it can be loaded
on demand. Results in faster startup time and reduced memory usage.
Diffstat (limited to 'src/gui/equipmentwindow.cpp')
-rw-r--r--src/gui/equipmentwindow.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp
index 20cc86e7..9a96b4d6 100644
--- a/src/gui/equipmentwindow.cpp
+++ b/src/gui/equipmentwindow.cpp
@@ -102,11 +102,11 @@ void EquipmentWindow::draw(gcn::Graphics *graphics)
for (int i = 0; i < EQUIPMENT_SIZE; i++)
{
- int itemId = mEquipment->getEquipment(i);
- if (itemId)
+ Item *item = mEquipment->getEquipment(i);
+ if (item)
{
// Draw Item.
- Image *image = Item(itemId).getInfo().getImage();
+ Image *image = item->getImage();
g->drawImage(image, mEquipBox[i].posX, mEquipBox[i].posY);
}
@@ -149,8 +149,7 @@ void EquipmentWindow::mousePressed(gcn::MouseEvent& mouseEvent)
BOX_WIDTH, BOX_HEIGHT);
if (tRect.isPointInRect(x, y))
{
- int itemId = mEquipment->getEquipment(i);
- if (itemId)
+ if (mEquipment->getEquipment(i))
{
mSelected = i;
}