summaryrefslogtreecommitdiff
path: root/src/resources/resourcemanager.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/resourcemanager.h')
-rw-r--r--src/resources/resourcemanager.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h
index ca6bdb373..4900b7ce3 100644
--- a/src/resources/resourcemanager.h
+++ b/src/resources/resourcemanager.h
@@ -28,9 +28,11 @@
#include "utils/stringvector.h"
#include <ctime>
+#include <list>
#include <map>
#include <set>
+class AnimationDelayLoad;
class Image;
class ImageSet;
class Music;
@@ -41,6 +43,9 @@ class SpriteDef;
struct SDL_Surface;
struct SDL_RWops;
+typedef std::list<AnimationDelayLoad*> DelayedAnim;
+typedef DelayedAnim::iterator DelayedAnimIter;
+
/**
* A class for loading and managing resources.
*/
@@ -139,6 +144,10 @@ class ResourceManager
*/
Resource *get(const std::string &idPath, generator fun, void *data);
+ Resource *getFromCache(const std::string &idPath);
+
+ Resource *getFromCache(const std::string &filename, int variant);
+
/**
* Loads a resource from a file and adds it to the resource map.
*
@@ -269,13 +278,19 @@ class ResourceManager
void cleanOrphans(bool always = false);
+ static void addDelayedAnimation(AnimationDelayLoad *animation)
+ { mDelayedAnimations.push_back(animation); }
+
+ static void delayedLoad();
+
+ static void removeDelayLoad(AnimationDelayLoad *delayedLoad);
+
private:
/**
* Deletes the resource after logging a cleanup message.
*/
static void cleanUp(Resource *resource);
-
static ResourceManager *instance;
std::set<SDL_Surface*> deletedSurfaces;
Resources mResources;
@@ -284,6 +299,7 @@ class ResourceManager
std::string mSelectedSkin;
std::string mSkinName;
bool mDestruction;
+ static DelayedAnim mDelayedAnimations;
};
#endif