diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-08-22 14:14:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-08-22 14:14:34 +0300 |
commit | da05d9dd98315378bdded216184294f376643191 (patch) | |
tree | ffc4b984c73c3bb68d26a1df6481634254075744 /src/resources/atlasmanager.cpp | |
parent | ec856b2026c7ceecab5f74942bb36661d7c6ae67 (diff) | |
download | manaverse-da05d9dd98315378bdded216184294f376643191.tar.gz manaverse-da05d9dd98315378bdded216184294f376643191.tar.bz2 manaverse-da05d9dd98315378bdded216184294f376643191.tar.xz manaverse-da05d9dd98315378bdded216184294f376643191.zip |
Use resource manager as global variable.
Diffstat (limited to 'src/resources/atlasmanager.cpp')
-rw-r--r-- | src/resources/atlasmanager.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/resources/atlasmanager.cpp b/src/resources/atlasmanager.cpp index 23a1ec653..a3836ad46 100644 --- a/src/resources/atlasmanager.cpp +++ b/src/resources/atlasmanager.cpp @@ -101,19 +101,18 @@ void AtlasManager::loadImages(const StringVect &files, std::vector<Image*> &images) { BLOCK_START("AtlasManager::loadImages") - ResourceManager *const resman = ResourceManager::getInstance(); FOR_EACH (StringVectCIter, it, files) { const std::string str = *it; // check is image with same name already in cache // and if yes, move it to deleted set - Resource *const res = resman->getTempResource(str); + Resource *const res = resourceManager->getTempResource(str); if (res) { // increase counter because in moveToDeleted it will be decreased. res->incRef(); - resman->moveToDeleted(res); + resourceManager->moveToDeleted(res); } std::string path = str; @@ -321,7 +320,6 @@ void AtlasManager::injectToResources(const AtlasResource *const resource) { if (!resource) return; - ResourceManager *const resman = ResourceManager::getInstance(); FOR_EACH (std::vector<TextureAtlas*>::const_iterator, it, resource->atlases) { @@ -331,14 +329,14 @@ void AtlasManager::injectToResources(const AtlasResource *const resource) { Image *const image = atlas->atlasImage; if (image) - resman->addResource(atlas->name, image); + resourceManager->addResource(atlas->name, image); FOR_EACH (std::vector<AtlasItem*>::iterator, it2, atlas->items) { AtlasItem *const item = *it2; if (!item) continue; // add each atlas sub image to resources - resman->addResource(item->name, item->image); + resourceManager->addResource(item->name, item->image); } } } @@ -348,7 +346,6 @@ void AtlasManager::moveToDeleted(AtlasResource *const resource) { if (!resource) return; - ResourceManager *const resman = ResourceManager::getInstance(); FOR_EACH (std::vector<TextureAtlas*>::iterator, it, resource->atlases) { // move each atlas image to deleted @@ -359,7 +356,7 @@ void AtlasManager::moveToDeleted(AtlasResource *const resource) if (image) { // move each atlas image to deleted - resman->moveToDeleted(image); + resourceManager->moveToDeleted(image); } FOR_EACH (std::vector<AtlasItem*>::iterator, it2, atlas->items) { @@ -370,7 +367,7 @@ void AtlasManager::moveToDeleted(AtlasResource *const resource) if (image2) { // move each atlas sub image to deleted - resman->moveToDeleted(image2); + resourceManager->moveToDeleted(image2); } } } |