diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-07-24 00:13:24 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-07-24 00:13:24 +0000 |
commit | 4789ebb11407eb9402c385f3cc6fa242d91214c2 (patch) | |
tree | 6bf5bed52073ae19ef4b5b08e7fe92af603f04d8 /src/gui/equipmentwindow.cpp | |
parent | 1b7ff9ad4160fd0ff79d2da658eca8d8c8abf815 (diff) | |
download | mana-4789ebb11407eb9402c385f3cc6fa242d91214c2.tar.gz mana-4789ebb11407eb9402c385f3cc6fa242d91214c2.tar.bz2 mana-4789ebb11407eb9402c385f3cc6fa242d91214c2.tar.xz mana-4789ebb11407eb9402c385f3cc6fa242d91214c2.zip |
Implemented caching of spritesets, including a lot of cleanups to the new
animation system. Action now refers to the Spriteset directly and
AnimatedSprite refers to the current Action directly instead of using the
std::map with a std::string constantly. Some methods and parameters are marked
as const. The READ_PROP macro was replaced by static methods. Warnings are
logged when unnamed actions are defined or when actions refer to undefined
imagesets. Code is more tolerant towards missing actions.
Diffstat (limited to 'src/gui/equipmentwindow.cpp')
-rw-r--r-- | src/gui/equipmentwindow.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp index fd979beb..bef39dff 100644 --- a/src/gui/equipmentwindow.cpp +++ b/src/gui/equipmentwindow.cpp @@ -28,10 +28,9 @@ #include "../item.h" #include "../log.h" -#include "../graphic/spriteset.h" - #include "../resources/iteminfo.h" #include "../resources/resourcemanager.h" +#include "../resources/spriteset.h" #include "../utils/tostring.h" @@ -42,14 +41,14 @@ EquipmentWindow::EquipmentWindow(Equipment *equipment): setDefaultSize(5, 230, 200, 120); loadWindowState(); - mItemset = ResourceManager::getInstance()->createSpriteset( + mItemset = ResourceManager::getInstance()->getSpriteset( "graphics/sprites/items.png", 32, 32); if (!mItemset) logger->error("Unable to load items.png"); } EquipmentWindow::~EquipmentWindow() { - delete mItemset; + mItemset->decRef(); } void EquipmentWindow::draw(gcn::Graphics *graphics) |