summaryrefslogtreecommitdiff
path: root/src/resources/animation/simpleanimation.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
commit9fe21fcd8883b37bdc30224822e6e42afb35b8f0 (patch)
tree798117abd4dc7e610997d59d530a96ddc1509f53 /src/resources/animation/simpleanimation.cpp
parent4429cb14e9e187edef27aba692a4266733f79c17 (diff)
downloadmanaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz
manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2
manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz
manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/resources/animation/simpleanimation.cpp')
-rw-r--r--src/resources/animation/simpleanimation.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/resources/animation/simpleanimation.cpp b/src/resources/animation/simpleanimation.cpp
index 1a1d30094..e4c0d8a3f 100644
--- a/src/resources/animation/simpleanimation.cpp
+++ b/src/resources/animation/simpleanimation.cpp
@@ -98,8 +98,8 @@ void SimpleAnimation::setFrame(int frame)
if (frame < 0)
frame = 0;
- const unsigned int len = static_cast<unsigned>(mAnimation->getLength());
- if (static_cast<unsigned>(frame) >= len)
+ const unsigned int len = CAST_U32(mAnimation->getLength());
+ if (CAST_U32(frame) >= len)
frame = len - 1;
mAnimationPhase = frame;
mCurrentFrame = &mAnimation->mFrames[frame];
@@ -119,7 +119,7 @@ bool SimpleAnimation::update(const int timePassed)
mAnimationTime -= mCurrentFrame->delay;
mAnimationPhase++;
- if (static_cast<size_t>(mAnimationPhase) >= mAnimation->getLength())
+ if (CAST_SIZE(mAnimationPhase) >= mAnimation->getLength())
mAnimationPhase = 0;
mCurrentFrame = &mAnimation->mFrames[mAnimationPhase];
@@ -132,7 +132,7 @@ int SimpleAnimation::getLength() const
if (!mAnimation)
return 0;
- return static_cast<int>(mAnimation->getLength());
+ return CAST_S32(mAnimation->getLength());
}
Image *SimpleAnimation::getCurrentImage() const