diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-11-15 23:44:01 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-11-15 23:44:01 +0000 |
commit | 0e925e97554aae573e895afa4e3d8450f01df342 (patch) | |
tree | bbc30319410aecb9fec7c005e667cd7fb628bb17 /src/gui/itemcontainer.cpp | |
parent | ffa0fae492d954c0aed35a0acbd7b856778d7328 (diff) | |
download | mana-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/itemcontainer.cpp')
-rw-r--r-- | src/gui/itemcontainer.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp index c51204a7..1abb8f0b 100644 --- a/src/gui/itemcontainer.cpp +++ b/src/gui/itemcontainer.cpp @@ -104,11 +104,10 @@ ItemContainer::draw(gcn::Graphics *graphics) Item *item = mInventory->getItem((j * mGridColumns) + i); - if (!item) - return; - if (item->getId() == 0) + if (!item || item->getId() == 0) continue; - Image *image = item->getInfo().getImage(); + + Image *image = item->getImage(); if (image) { if (item == mSelectedItem) @@ -232,7 +231,7 @@ ItemContainer::mousePressed(gcn::MouseEvent &event) { mSelectionStatus = SEL_DESELECTING; } - else if (item->getId()) + else if (item && item->getId()) { setSelectedItem(item); mSelectionStatus = SEL_SELECTING; |