From ffabda4c473711ffa8fdfe37c2a4460fe31347ac Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 14 Jun 2013 23:10:32 +0300 Subject: improve a bit draw speed. --- src/compoundsprite.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/compoundsprite.cpp') 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; -- cgit v1.2.3-60-g2f50