diff --git a/BBGE/Core.cpp b/BBGE/Core.cpp index 3d68e03..6502c26 100644 --- a/BBGE/Core.cpp +++ b/BBGE/Core.cpp @@ -1883,7 +1883,7 @@ void Core::shutdown() debugLog("OK"); debugLog("Clear All Resources..."); - texmgr.shutdown(); + texmgr.unloadAll(); debugLog("OK"); @@ -1961,10 +1961,7 @@ void Core::switchRenderObjectLayer(RenderObject *o, unsigned toLayer) void Core::unloadResources() { - /*for (size_t i = 0; i < resources.size(); i++) - { - resources[i]->unload(); - }*/ + this->texmgr.unloadAll(); } void Core::onReloadResources() @@ -1973,11 +1970,8 @@ void Core::onReloadResources() void Core::reloadResources() { - /*for (size_t i = 0; i < resources.size(); i++) - { - resources[i]->reload(); - } - onReloadResources();*/ + this->texmgr.reloadAll(TextureMgr::OVERWRITE); + this->onReloadResources(); } const std::string & Core::getBaseTexturePath() const diff --git a/BBGE/TextureMgr.cpp b/BBGE/TextureMgr.cpp index 7676868..3bc9f26 100644 --- a/BBGE/TextureMgr.cpp +++ b/BBGE/TextureMgr.cpp @@ -209,7 +209,7 @@ void TextureMgr::clearUnused() debugLog(os.str()); } -void TextureMgr::shutdown() +void TextureMgr::unloadAll() { for(TexCache::iterator it = cache.begin(); it != cache.end(); ++it) it->second->unload(); diff --git a/BBGE/TextureMgr.h b/BBGE/TextureMgr.h index f9e2741..53e05f3 100644 --- a/BBGE/TextureMgr.h +++ b/BBGE/TextureMgr.h @@ -21,7 +21,7 @@ public: size_t getNumLoaded() const; Texture *getOrLoad(const std::string& name); void clearUnused(); // clear everything whose refcount is 1 - void shutdown(); + void unloadAll(); enum LoadMode {