summaryrefslogtreecommitdiff
path: root/src/compoundsprite.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-14 23:10:32 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-14 23:10:32 +0300
commitffabda4c473711ffa8fdfe37c2a4460fe31347ac (patch)
treee6ca643efc58f718611481f44959528f129396a3 /src/compoundsprite.cpp
parenta95ddb41f2c17872e37cb7530816b4008789aeb7 (diff)
downloadmanaverse-ffabda4c473711ffa8fdfe37c2a4460fe31347ac.tar.gz
manaverse-ffabda4c473711ffa8fdfe37c2a4460fe31347ac.tar.bz2
manaverse-ffabda4c473711ffa8fdfe37c2a4460fe31347ac.tar.xz
manaverse-ffabda4c473711ffa8fdfe37c2a4460fe31347ac.zip
improve a bit draw speed.
Diffstat (limited to 'src/compoundsprite.cpp')
-rw-r--r--src/compoundsprite.cpp4
1 files changed, 3 insertions, 1 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;