summaryrefslogtreecommitdiff
path: root/src/simpleanimation.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-06-03 20:06:08 +0300
committerAndrei Karas <akaras@inbox.ru>2012-06-03 20:18:49 +0300
commit98c10803f79ce9decb4a431719e18bb27aac4485 (patch)
treecbe6325a1e2deafe38170565a0c1d9c3f5cb7faa /src/simpleanimation.cpp
parent57a81ed6cf1c02d7ec8bfe1e6f0a1d3232309534 (diff)
downloadmanaverse-98c10803f79ce9decb4a431719e18bb27aac4485.tar.gz
manaverse-98c10803f79ce9decb4a431719e18bb27aac4485.tar.bz2
manaverse-98c10803f79ce9decb4a431719e18bb27aac4485.tar.xz
manaverse-98c10803f79ce9decb4a431719e18bb27aac4485.zip
Improve a bit animation speed.
Diffstat (limited to 'src/simpleanimation.cpp')
-rw-r--r--src/simpleanimation.cpp8
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;