From c18d789b35f29611c88d0e3bdbb5619500ea7a2a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 27 May 2016 21:37:03 +0300 Subject: Move spritedef load function from resourcemanager into separate file. --- src/resources/resourcemanager/resourcemanager.cpp | 28 +---------------------- src/resources/resourcemanager/resourcemanager.h | 8 ------- 2 files changed, 1 insertion(+), 35 deletions(-) (limited to 'src/resources/resourcemanager') diff --git a/src/resources/resourcemanager/resourcemanager.cpp b/src/resources/resourcemanager/resourcemanager.cpp index dd652c22b..2289fcffd 100644 --- a/src/resources/resourcemanager/resourcemanager.cpp +++ b/src/resources/resourcemanager/resourcemanager.cpp @@ -72,8 +72,7 @@ ResourceManager::ResourceManager() : mOrphanedResources(), mDeletedResources(), mOldestOrphan(0), - mDestruction(0), - mUseLongLiveSprites(config.getBoolValue("uselonglivesprites")) + mDestruction(0) { logger->log1("Initializing resource manager..."); } @@ -527,31 +526,6 @@ Resource *ResourceManager::get(const std::string &idPath, return resource; } -struct SpriteDefLoader final -{ - std::string path; - int variant; - bool useLongLiveSprites; - static Resource *load(const void *const v) - { - if (!v) - return nullptr; - - const SpriteDefLoader *const - rl = static_cast(v); - return SpriteDef::load(rl->path, rl->variant, rl->useLongLiveSprites); - } -}; - -SpriteDef *ResourceManager::getSprite(const std::string &path, - const int variant) -{ - SpriteDefLoader rl = { path, variant, mUseLongLiveSprites }; - std::stringstream ss; - ss << path << "[" << variant << "]"; - return static_cast(get(ss.str(), SpriteDefLoader::load, &rl)); -} - void ResourceManager::release(Resource *const res) { if (!res || mDestruction) diff --git a/src/resources/resourcemanager/resourcemanager.h b/src/resources/resourcemanager/resourcemanager.h index 582359079..71643d1ac 100644 --- a/src/resources/resourcemanager/resourcemanager.h +++ b/src/resources/resourcemanager/resourcemanager.h @@ -133,13 +133,6 @@ class ResourceManager final : public MemoryCounter */ bool addResource(const std::string &idPath, Resource *const resource); - /** - * Creates a sprite definition based on a given path and the supplied - * variant. - */ - SpriteDef *getSprite(const std::string &path, - const int variant = 0) A_WARN_UNUSED; - /** * Releases a resource, placing it in the set of orphaned resources. */ @@ -223,7 +216,6 @@ class ResourceManager final : public MemoryCounter std::set mDeletedResources; time_t mOldestOrphan; bool mDestruction; - bool mUseLongLiveSprites; }; extern ResourceManager *resourceManager; -- cgit v1.2.3-70-g09d2