diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-04-05 19:40:49 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-04-05 19:40:49 -0600 |
commit | 9078373860729cdf80db8d09cbdee478dc54ec64 (patch) | |
tree | 3e27392dfbca5fe0368d99d577044a6d90bbb41a | |
parent | a0c7d1f61783e77e552896824855377e4bb43f8d (diff) | |
download | mana-9078373860729cdf80db8d09cbdee478dc54ec64.tar.gz mana-9078373860729cdf80db8d09cbdee478dc54ec64.tar.bz2 mana-9078373860729cdf80db8d09cbdee478dc54ec64.tar.xz mana-9078373860729cdf80db8d09cbdee478dc54ec64.zip |
Remove some more #ifdefs
-rw-r--r-- | src/gui/itemshortcutcontainer.cpp | 9 | ||||
-rw-r--r-- | src/item.cpp | 11 | ||||
-rw-r--r-- | src/item.h | 11 |
3 files changed, 8 insertions, 23 deletions
diff --git a/src/gui/itemshortcutcontainer.cpp b/src/gui/itemshortcutcontainer.cpp index 97c3b640..62edd1af 100644 --- a/src/gui/itemshortcutcontainer.cpp +++ b/src/gui/itemshortcutcontainer.cpp @@ -39,6 +39,7 @@ #include "resources/resourcemanager.h" #include "utils/stringutils.h" +#include "utils/strprintf.h" ItemShortcutContainer::ItemShortcutContainer(): ShortcutContainer(), @@ -106,11 +107,9 @@ void ItemShortcutContainer::draw(gcn::Graphics *graphics) if (image) { - const std::string label = -#ifdef EATHENA_SUPPORT - item->isEquipped() ? "Eq." : -#endif - toString(item->getQuantity()); + const std::string label = strprintf("%d%s", + toString(item->getQuantity()).c_str(), + item->isEquipped() ? "(Eq)" : ""); g->drawImage(image, itemX, itemY); g->drawText(label, itemX + mBoxWidth / 2, itemY + mBoxHeight - 14, gcn::Graphics::CENTER); diff --git a/src/item.cpp b/src/item.cpp index 6f04b879..2fadc035 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -25,17 +25,10 @@ #include "resources/iteminfo.h" #include "resources/resourcemanager.h" -Item::Item(int id, int quantity, bool equipment -#ifdef EATHENA_SUPPORT - , bool equipped -#endif - ): +Item::Item(int id, int quantity, bool equipment, bool equipped): mImage(0), mQuantity(quantity), - mEquipment(equipment) -#ifdef EATHENA_SUPPORT - , mEquipped(equipped) -#endif + mEquipment(equipment), mEquipped(equipped) { setId(id); } @@ -35,11 +35,8 @@ class Item /** * Constructor. */ - Item(int id = -1, int quantity = 0, bool equipment = false -#ifdef EATHENA_SUPPORT - , bool equipped = false -#endif - ); + Item(int id = -1, int quantity = 0, bool equipment = false, + bool equipped = false); /** * Destructor. @@ -86,7 +83,6 @@ class Item */ bool isEquipment() const { return mEquipment; } -#ifdef EATHENA_SUPPORT /** * Sets whether this item is equipped. */ @@ -96,7 +92,6 @@ class Item * Returns whether this item is equipped. */ bool isEquipped() const { return mEquipped; } -#endif /** * Sets the inventory index of this item. @@ -118,9 +113,7 @@ class Item Image *mImage; /**< Item image. */ int mQuantity; /**< Number of items. */ bool mEquipment; /**< Item is equipment. */ -#ifdef EATHENA_SUPPORT bool mEquipped; /**< Item is equipped. */ -#endif int mInvIndex; /**< Inventory index. */ }; |