diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-07-24 00:13:24 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-07-24 00:13:24 +0000 |
commit | 4789ebb11407eb9402c385f3cc6fa242d91214c2 (patch) | |
tree | 6bf5bed52073ae19ef4b5b08e7fe92af603f04d8 /src/resources/resourcemanager.h | |
parent | 1b7ff9ad4160fd0ff79d2da658eca8d8c8abf815 (diff) | |
download | mana-client-4789ebb11407eb9402c385f3cc6fa242d91214c2.tar.gz mana-client-4789ebb11407eb9402c385f3cc6fa242d91214c2.tar.bz2 mana-client-4789ebb11407eb9402c385f3cc6fa242d91214c2.tar.xz mana-client-4789ebb11407eb9402c385f3cc6fa242d91214c2.zip |
Implemented caching of spritesets, including a lot of cleanups to the new
animation system. Action now refers to the Spriteset directly and
AnimatedSprite refers to the current Action directly instead of using the
std::map with a std::string constantly. Some methods and parameters are marked
as const. The READ_PROP macro was replaced by static methods. Warnings are
logged when unnamed actions are defined or when actions refer to undefined
imagesets. Code is more tolerant towards missing actions.
Diffstat (limited to 'src/resources/resourcemanager.h')
-rw-r--r-- | src/resources/resourcemanager.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h index 8d60ae8c..f254a8b4 100644 --- a/src/resources/resourcemanager.h +++ b/src/resources/resourcemanager.h @@ -136,7 +136,7 @@ class ResourceManager * Creates a spriteset based on the image referenced by the given * path and the supplied sprite sizes */ - Spriteset* createSpriteset(const std::string &imagePath, int w, int h); + Spriteset* getSpriteset(const std::string &imagePath, int w, int h); /** * Releases a resource, removing it from the set of loaded resources. @@ -177,6 +177,12 @@ class ResourceManager deleteInstance(); private: + /** + * Deletes the resource after logging a cleanup message. + */ + static void + cleanUp(Resource *resource); + static ResourceManager *instance; typedef std::map<std::string, Resource*> Resources; typedef Resources::iterator ResourceIterator; |