From 5994a6198ac35ea149a7211213dc296ee7406f44 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 25 May 2016 20:48:35 +0300 Subject: Move imageset load function from resourcemanager into separate file. --- src/resources/resourcemanager/resourcemanager.cpp | 34 ----------------------- src/resources/resourcemanager/resourcemanager.h | 7 ----- 2 files changed, 41 deletions(-) (limited to 'src/resources/resourcemanager') diff --git a/src/resources/resourcemanager/resourcemanager.cpp b/src/resources/resourcemanager/resourcemanager.cpp index aca30726b..2f32b7c71 100644 --- a/src/resources/resourcemanager/resourcemanager.cpp +++ b/src/resources/resourcemanager/resourcemanager.cpp @@ -527,40 +527,6 @@ Resource *ResourceManager::get(const std::string &idPath, return resource; } -struct ImageSetLoader final -{ - std::string path; - int w, h; - static Resource *load(const void *const v) - { - if (!v) - return nullptr; - - const ImageSetLoader *const - rl = static_cast(v); - - Image *const img = Loader::getImage(rl->path); - if (!img) - { - reportAlways("Image loading error: %s", rl->path.c_str()); - return nullptr; - } - ImageSet *const res = new ImageSet(img, rl->w, rl->h); - img->decRef(); - return res; - } -}; - -ImageSet *ResourceManager::getImageSet(const std::string &imagePath, - const int w, const int h) -{ - ImageSetLoader rl = { imagePath, w, h }; - std::stringstream ss; - ss << imagePath << "[" << w << "x" << h << "]"; - return static_cast(get(ss.str(), ImageSetLoader::load, &rl)); -} - - struct SubImageSetLoader final { ResourceManager *manager; diff --git a/src/resources/resourcemanager/resourcemanager.h b/src/resources/resourcemanager/resourcemanager.h index 13c99df63..2c54aeb5a 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 image set based on the image referenced by the given - * path and the supplied sprite sizes - */ - ImageSet *getImageSet(const std::string &imagePath, - const int w, const int h) A_WARN_UNUSED; - ImageSet *getSubImageSet(Image *const parent, const int width, const int height) A_WARN_UNUSED; -- cgit v1.2.3-70-g09d2