diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-05-25 22:17:03 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-05-25 22:17:03 +0300 |
commit | ea0809826d530f82dc84f8e046b3d11a797dd716 (patch) | |
tree | 65b8141e1c9d3591ad95f771a7ca2c4667865e81 /src/resources/resourcemanager/resourcemanager.cpp | |
parent | 5994a6198ac35ea149a7211213dc296ee7406f44 (diff) | |
download | manaplus-ea0809826d530f82dc84f8e046b3d11a797dd716.tar.gz manaplus-ea0809826d530f82dc84f8e046b3d11a797dd716.tar.bz2 manaplus-ea0809826d530f82dc84f8e046b3d11a797dd716.tar.xz manaplus-ea0809826d530f82dc84f8e046b3d11a797dd716.zip |
Move subimageset load function from resourcemanager into separate file.
Diffstat (limited to 'src/resources/resourcemanager/resourcemanager.cpp')
-rw-r--r-- | src/resources/resourcemanager/resourcemanager.cpp | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/resources/resourcemanager/resourcemanager.cpp b/src/resources/resourcemanager/resourcemanager.cpp index 2f32b7c71..539e89d3a 100644 --- a/src/resources/resourcemanager/resourcemanager.cpp +++ b/src/resources/resourcemanager/resourcemanager.cpp @@ -527,41 +527,6 @@ Resource *ResourceManager::get(const std::string &idPath, return resource; } -struct SubImageSetLoader final -{ - ResourceManager *manager; - Image *parent; - int width, height; - static Resource *load(const void *const v) - { - if (!v) - return nullptr; - - const SubImageSetLoader *const - rl = static_cast<const SubImageSetLoader *const>(v); - if (!rl->manager) - return nullptr; - - if (!rl->parent) - return nullptr; - ImageSet *const res = new ImageSet(rl->parent, rl->width, rl->height); - return res; - } -}; - -ImageSet *ResourceManager::getSubImageSet(Image *const parent, - const int width, const int height) -{ - if (!parent) - return nullptr; - - const SubImageSetLoader rl = { this, parent, width, height }; - std::stringstream ss; - ss << parent->getIdPath() << ", set[" << width << "x" << height << "]"; - return static_cast<ImageSet*>(get(ss.str(), - SubImageSetLoader::load, &rl)); -} - #ifdef USE_OPENGL struct AtlasLoader final { |