diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-06-03 20:06:08 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-06-03 20:18:49 +0300 |
commit | 98c10803f79ce9decb4a431719e18bb27aac4485 (patch) | |
tree | cbe6325a1e2deafe38170565a0c1d9c3f5cb7faa /src/simpleanimation.cpp | |
parent | 57a81ed6cf1c02d7ec8bfe1e6f0a1d3232309534 (diff) | |
download | plus-98c10803f79ce9decb4a431719e18bb27aac4485.tar.gz plus-98c10803f79ce9decb4a431719e18bb27aac4485.tar.bz2 plus-98c10803f79ce9decb4a431719e18bb27aac4485.tar.xz plus-98c10803f79ce9decb4a431719e18bb27aac4485.zip |
Improve a bit animation speed.
Diffstat (limited to 'src/simpleanimation.cpp')
-rw-r--r-- | src/simpleanimation.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/simpleanimation.cpp b/src/simpleanimation.cpp index 89431a916..483061516 100644 --- a/src/simpleanimation.cpp +++ b/src/simpleanimation.cpp @@ -39,7 +39,7 @@ SimpleAnimation::SimpleAnimation(Animation *animation): mAnimation(animation), mAnimationTime(0), mAnimationPhase(0), - mCurrentFrame(mAnimation->getFrame(0)), + mCurrentFrame(&mAnimation->mFrames[0]), mInitialized(true) { } @@ -53,7 +53,7 @@ SimpleAnimation::SimpleAnimation(XmlNodePtr animationNode, { initializeAnimation(animationNode, dyePalettes); if (mAnimation) - mCurrentFrame = mAnimation->getFrame(0); + mCurrentFrame = &mAnimation->mFrames[0]; else mCurrentFrame = nullptr; } @@ -90,7 +90,7 @@ void SimpleAnimation::setFrame(int frame) if (static_cast<unsigned>(frame) >= mAnimation->getLength()) frame = mAnimation->getLength() - 1; mAnimationPhase = frame; - mCurrentFrame = mAnimation->getFrame(mAnimationPhase); + mCurrentFrame = &mAnimation->mFrames[mAnimationPhase]; } bool SimpleAnimation::update(int timePassed) @@ -116,7 +116,7 @@ bool SimpleAnimation::update(int timePassed) mAnimationPhase = 0; } - mCurrentFrame = mAnimation->getFrame(mAnimationPhase); + mCurrentFrame = &mAnimation->mFrames[mAnimationPhase]; } } return updated; |