From afc144cfe396f10eea5b160c711eec4b20ae00c3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 26 May 2016 00:59:29 +0300 Subject: Move atlas load function from resourcemanager into separate file. --- src/resources/resourcemanager/resourcemanager.cpp | 26 ----------------------- src/resources/resourcemanager/resourcemanager.h | 3 --- 2 files changed, 29 deletions(-) (limited to 'src/resources/resourcemanager') diff --git a/src/resources/resourcemanager/resourcemanager.cpp b/src/resources/resourcemanager/resourcemanager.cpp index 539e89d3a..3bde069e5 100644 --- a/src/resources/resourcemanager/resourcemanager.cpp +++ b/src/resources/resourcemanager/resourcemanager.cpp @@ -528,32 +528,6 @@ Resource *ResourceManager::get(const std::string &idPath, } #ifdef USE_OPENGL -struct AtlasLoader final -{ - const std::string name; - const StringVect *files; - - static Resource *load(const void *const v) - { - if (!v) - return nullptr; - - const AtlasLoader *const rl = static_cast(v); - AtlasResource *const resource = AtlasManager::loadTextureAtlas( - rl->name, *rl->files); - if (!resource) - reportAlways("Atlas creation error: %s", rl->name.c_str()); - return resource; - } -}; - -Resource *ResourceManager::getAtlas(const std::string &name, - const StringVect &files) -{ - AtlasLoader rl = { name, &files }; - return get("atlas_" + name, AtlasLoader::load, &rl); -} - struct ShaderLoader final { const std::string name; diff --git a/src/resources/resourcemanager/resourcemanager.h b/src/resources/resourcemanager/resourcemanager.h index d8b080b68..cadc437d5 100644 --- a/src/resources/resourcemanager/resourcemanager.h +++ b/src/resources/resourcemanager/resourcemanager.h @@ -134,9 +134,6 @@ class ResourceManager final : public MemoryCounter bool addResource(const std::string &idPath, Resource *const resource); #ifdef USE_OPENGL - Resource *getAtlas(const std::string &name, - const StringVect &files) A_WARN_UNUSED; - Resource *getShader(const unsigned int type, const std::string &name) A_WARN_UNUSED; -- cgit v1.2.3-70-g09d2