summaryrefslogtreecommitdiff
path: root/src/animatedsprite.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-08 22:48:11 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-08 22:48:11 +0300
commit767b8400fb086616616a298655f0bc2eaf239256 (patch)
tree9d82215887c79c596127506f50daf2ed31c23d8c /src/animatedsprite.cpp
parentcd0de3bd2668294ab3174d3b5f032fefc25fa0e8 (diff)
downloadmv-767b8400fb086616616a298655f0bc2eaf239256.tar.gz
mv-767b8400fb086616616a298655f0bc2eaf239256.tar.bz2
mv-767b8400fb086616616a298655f0bc2eaf239256.tar.xz
mv-767b8400fb086616616a298655f0bc2eaf239256.zip
Fix code style in other files.
Diffstat (limited to 'src/animatedsprite.cpp')
-rw-r--r--src/animatedsprite.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp
index e1ca0a27d..e3ead0bf4 100644
--- a/src/animatedsprite.cpp
+++ b/src/animatedsprite.cpp
@@ -195,15 +195,15 @@ bool AnimatedSprite::updateCurrentAnimation(const unsigned int time)
mFrameTime += time;
- while ((mFrameTime > static_cast<unsigned>(mFrame->delay)
+ while ((mFrameTime > static_cast<unsigned int>(mFrame->delay)
&& mFrame->delay > 0) || (mFrame->type != Frame::ANIMATION
&& mFrame->type != Frame::PAUSE))
{
bool fail(true);
- mFrameTime -= static_cast<unsigned>(mFrame->delay);
+ mFrameTime -= static_cast<unsigned int>(mFrame->delay);
mFrameIndex++;
- if (mFrameIndex >= mAnimation->getLength())
+ if (mFrameIndex >= static_cast<unsigned int>(mAnimation->getLength()))
mFrameIndex = 0;
mFrame = &mAnimation->mFrames[mFrameIndex];
@@ -227,8 +227,11 @@ bool AnimatedSprite::updateCurrentAnimation(const unsigned int time)
&& mFrame->nextAction == frame->nextAction)
{
mFrameIndex = static_cast<unsigned int>(i);
- if (mFrameIndex >= mAnimation->getLength())
+ if (mFrameIndex >= static_cast<unsigned int>(
+ mAnimation->getLength()))
+ {
mFrameIndex = 0;
+ }
mFrame = &mAnimation->mFrames[mFrameIndex];
@@ -262,7 +265,8 @@ bool AnimatedSprite::updateCurrentAnimation(const unsigned int time)
}
else
{
- if (mFrame->rand == 100 || mFrameIndex >= mAnimation->getLength())
+ if (mFrame->rand == 100 || mFrameIndex
+ >= static_cast<unsigned int>(mAnimation->getLength()))
{
fail = false;
}