diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/equipmentwindow.cpp | 9 | ||||
-rw-r--r-- | src/gui/itemcontainer.cpp | 6 |
2 files changed, 5 insertions, 10 deletions
diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp index d1d23ee1..d3b5fc6b 100644 --- a/src/gui/equipmentwindow.cpp +++ b/src/gui/equipmentwindow.cpp @@ -30,7 +30,6 @@ #include "../graphic/spriteset.h" -#include "../resources/image.h" #include "../resources/iteminfo.h" #include "../resources/resourcemanager.h" @@ -43,11 +42,9 @@ EquipmentWindow::EquipmentWindow(): setDefaultSize(5, 230, 200, 90); loadWindowState(); - ResourceManager *resman = ResourceManager::getInstance(); - Image *itemImg = resman->getImage("graphics/sprites/items.png"); - if (!itemImg) logger->error("Unable to load items.png"); - itemset = new Spriteset(itemImg, 32, 32); - itemImg->decRef(); + itemset = ResourceManager::getInstance()->createSpriteset( + "graphics/sprites/items.png", 32, 32); + if (!itemset) logger->error("Unable to load items.png"); } EquipmentWindow::~EquipmentWindow() diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp index 3f00f9eb..0cdb8864 100644 --- a/src/gui/itemcontainer.cpp +++ b/src/gui/itemcontainer.cpp @@ -42,10 +42,8 @@ ItemContainer::ItemContainer(Inventory *inventory): mInventory(inventory) { ResourceManager *resman = ResourceManager::getInstance(); - Image *itemImg = resman->getImage("graphics/sprites/items.png"); - if (!itemImg) logger->error("Unable to load items.png"); - itemset = new Spriteset(itemImg, 32, 32); - itemImg->decRef(); + itemset = resman->createSpriteset("graphics/sprites/items.png", 32, 32); + if (!itemset) logger->error("Unable to load items.png"); selImg = resman->getImage("graphics/gui/selection.png"); if (!selImg) logger->error("Unable to load selection.png"); |