diff options
Diffstat (limited to 'src/resources/resourcemanager.cpp')
-rw-r--r-- | src/resources/resourcemanager.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index e9595093..4f409431 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -32,6 +32,8 @@ #include "../log.h" +#include "../graphic/spriteset.h" + ResourceManager *ResourceManager::instance = NULL; @@ -199,6 +201,22 @@ ResourceManager::getSoundEffect(const std::string &idPath) return (SoundEffect*)get(SOUND_EFFECT, idPath); } +Spriteset* ResourceManager::createSpriteset(const std::string &imagePath, + int w, int h) +{ + Image *img; + + if (!(img = getImage(imagePath))) { + return NULL; + } + + Spriteset *result = new Spriteset(img, w, h); + + img->decRef(); + + return result; +} + void ResourceManager::release(const std::string &idPath) { |