diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-05-27 21:37:03 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-05-27 21:37:03 +0300 |
commit | c18d789b35f29611c88d0e3bdbb5619500ea7a2a (patch) | |
tree | cdc7e6d57305bba43859b5a669df1e975220dc3f /src/resources/resourcemanager/resourcemanager.cpp | |
parent | 6ed4f7f09a297e9afb829634399c94ccc542729e (diff) | |
download | manaverse-c18d789b35f29611c88d0e3bdbb5619500ea7a2a.tar.gz manaverse-c18d789b35f29611c88d0e3bdbb5619500ea7a2a.tar.bz2 manaverse-c18d789b35f29611c88d0e3bdbb5619500ea7a2a.tar.xz manaverse-c18d789b35f29611c88d0e3bdbb5619500ea7a2a.zip |
Move spritedef load function from resourcemanager into separate file.
Diffstat (limited to 'src/resources/resourcemanager/resourcemanager.cpp')
-rw-r--r-- | src/resources/resourcemanager/resourcemanager.cpp | 28 |
1 files changed, 1 insertions, 27 deletions
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<const SpriteDefLoader *const>(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<SpriteDef*>(get(ss.str(), SpriteDefLoader::load, &rl)); -} - void ResourceManager::release(Resource *const res) { if (!res || mDestruction) |