diff options
Diffstat (limited to 'src/resources/resourcemanager/resourcemanager.cpp')
-rw-r--r-- | src/resources/resourcemanager/resourcemanager.cpp | 34 |
1 files changed, 0 insertions, 34 deletions
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<const ImageSetLoader *const>(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<ImageSet*>(get(ss.str(), ImageSetLoader::load, &rl)); -} - - struct SubImageSetLoader final { ResourceManager *manager; |