diff options
Diffstat (limited to 'src/animatedsprite.h')
-rw-r--r-- | src/animatedsprite.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/animatedsprite.h b/src/animatedsprite.h index d28badfc1..4f4caff16 100644 --- a/src/animatedsprite.h +++ b/src/animatedsprite.h @@ -29,6 +29,7 @@ #include <string> class Animation; +class AnimationDelayLoad; struct Frame; /** @@ -53,6 +54,9 @@ class AnimatedSprite : public Sprite static AnimatedSprite *load(const std::string &filename, int variant = 0); + static AnimatedSprite *delayedLoad(const std::string &filename, + int variant = 0); + virtual ~AnimatedSprite(); bool reset(); @@ -86,9 +90,19 @@ class AnimatedSprite : public Sprite bool updateNumber(unsigned num); + void clearDelayLoad(); + + void setSprite(SpriteDef *sprite) + { mSprite = sprite; } + + static void setEnableCache(bool b) + { mEnableCache = b; } + private: bool updateCurrentAnimation(unsigned int dt); + void setDelayLoad(const std::string &filename, int variant); + SpriteDirection mDirection; /**< The sprite direction. */ int mLastTime; /**< The last time update was called. */ @@ -101,6 +115,8 @@ class AnimatedSprite : public Sprite Frame *mFrame; /**< The currently active frame. */ unsigned mNumber; unsigned mNumber1; + AnimationDelayLoad *mDelayLoad; + static bool mEnableCache; }; #endif |