diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-06-20 00:34:39 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-06-21 00:59:10 +0300 |
commit | aa68511ad3d339be8c8f42fc6c083b696d8e687b (patch) | |
tree | 1bf138439c28b4a879c6b35e4361801bd5e1d246 /src/animatedsprite.h | |
parent | 12002b81544038bc5855189c74aca761d0c08f1b (diff) | |
download | manaplus-aa68511ad3d339be8c8f42fc6c083b696d8e687b.tar.gz manaplus-aa68511ad3d339be8c8f42fc6c083b696d8e687b.tar.bz2 manaplus-aa68511ad3d339be8c8f42fc6c083b696d8e687b.tar.xz manaplus-aa68511ad3d339be8c8f42fc6c083b696d8e687b.zip |
Add delayed images load.
Can work for now only in OpenGL modes.
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 |