summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compoundsprite.cpp4
-rw-r--r--src/compoundsprite.h6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/compoundsprite.cpp b/src/compoundsprite.cpp
index a191afc59..074274ae1 100644
--- a/src/compoundsprite.cpp
+++ b/src/compoundsprite.cpp
@@ -60,6 +60,7 @@ CompoundSprite::CompoundSprite() :
mDisableAdvBeingCaching(config.getBoolValue("disableAdvBeingCaching")),
mDisableBeingCaching(config.getBoolValue("disableBeingCaching")),
mSprites(),
+ mTempFramesCount(0),
mNextRedrawTime(0)
{
mAlpha = 1.0f;
@@ -217,7 +218,7 @@ unsigned int CompoundSprite::getCurrentFrame() const
return 0;
}
-unsigned int CompoundSprite::getFrameCount() const
+unsigned int CompoundSprite::getActualFrameCount() const
{
FOR_EACH (SpriteConstIterator, it, mSprites)
{
@@ -406,6 +407,7 @@ void CompoundSprite::setAlpha(float alpha)
void CompoundSprite::updateImages() const
{
+ mTempFramesCount = getActualFrameCount();
#ifdef USE_OPENGL
if (imageHelper->useOpenGL())
return;
diff --git a/src/compoundsprite.h b/src/compoundsprite.h
index 6049cdeb9..20f5d371e 100644
--- a/src/compoundsprite.h
+++ b/src/compoundsprite.h
@@ -86,7 +86,10 @@ public:
unsigned int getCurrentFrame() const override A_WARN_UNUSED;
- unsigned int getFrameCount() const override A_WARN_UNUSED;
+ unsigned int getActualFrameCount() const A_WARN_UNUSED;
+
+ unsigned int getFrameCount() const override A_WARN_UNUSED
+ { return mTempFramesCount; }
size_t size() const A_WARN_UNUSED
{ return mSprites.size(); }
@@ -155,6 +158,7 @@ private:
bool mDisableAdvBeingCaching;
bool mDisableBeingCaching;
std::vector<Sprite*> mSprites;
+ mutable int mTempFramesCount;
mutable int mNextRedrawTime;
static bool mEnableDelay;
};