diff options
Diffstat (limited to 'src/resources/resourcemanager/resourcemanager.cpp')
-rw-r--r-- | src/resources/resourcemanager/resourcemanager.cpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/resources/resourcemanager/resourcemanager.cpp b/src/resources/resourcemanager/resourcemanager.cpp index 0cff0fb2c..e9b8c687b 100644 --- a/src/resources/resourcemanager/resourcemanager.cpp +++ b/src/resources/resourcemanager/resourcemanager.cpp @@ -596,48 +596,6 @@ ImageSet *ResourceManager::getSubImageSet(Image *const parent, SubImageSetLoader::load, &rl)); } -struct SubImageLoader final -{ - ResourceManager *manager; - Image *parent; - int x, y; - int width, height; - static Resource *load(const void *const v) - { - if (!v) - return nullptr; - - const SubImageLoader *const - rl = static_cast<const SubImageLoader *const>(v); - if (!rl->manager || !rl->parent) - return nullptr; - - Image *const res = rl->parent->getSubImage(rl->x, rl->y, - rl->width, rl->height); - if (!res) - { - reportAlways("SubImage loading error: %s", - rl->parent->getSource().c_str()); - } - return res; - } -}; - -Image *ResourceManager::getSubImage(Image *const parent, - const int x, const int y, - const int width, const int height) -{ - if (!parent) - return nullptr; - - const SubImageLoader rl = { this, parent, x, y, width, height}; - - std::stringstream ss; - ss << parent->getIdPath() << ",[" << x << "," << y << "," - << width << "x" << height << "]"; - return static_cast<Image*>(get(ss.str(), SubImageLoader::load, &rl)); -} - #ifdef USE_OPENGL struct AtlasLoader final { |