summaryrefslogtreecommitdiff
path: root/src/resources/sprite/animatedsprite.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/sprite/animatedsprite.cpp
parent4429cb14e9e187edef27aba692a4266733f79c17 (diff)
downloadplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz
plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2
plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz
plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/resources/sprite/animatedsprite.cpp')
-rw-r--r--src/resources/sprite/animatedsprite.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/resources/sprite/animatedsprite.cpp b/src/resources/sprite/animatedsprite.cpp
index 5210ce626..08d73c2c5 100644
--- a/src/resources/sprite/animatedsprite.cpp
+++ b/src/resources/sprite/animatedsprite.cpp
@@ -214,16 +214,16 @@ bool AnimatedSprite::updateCurrentAnimation(const unsigned int time) restrict2
mFrameTime += time;
- while ((mFrameTime > static_cast<unsigned int>(mFrame->delay) &&
+ while ((mFrameTime > CAST_U32(mFrame->delay) &&
mFrame->delay > 0) ||
(mFrame->type != Frame::ANIMATION &&
mFrame->type != Frame::PAUSE))
{
bool fail(true);
- mFrameTime -= static_cast<unsigned int>(mFrame->delay);
+ mFrameTime -= CAST_U32(mFrame->delay);
mFrameIndex++;
- if (mFrameIndex >= static_cast<unsigned int>(mAnimation->getLength()))
+ if (mFrameIndex >= CAST_U32(mAnimation->getLength()))
mFrameIndex = 0;
mFrame = &mAnimation->mFrames[mFrameIndex];
@@ -249,8 +249,8 @@ bool AnimatedSprite::updateCurrentAnimation(const unsigned int time) restrict2
if (frame->type == Frame::LABEL &&
mFrame->nextAction == frame->nextAction)
{
- mFrameIndex = static_cast<unsigned int>(i);
- if (mFrameIndex >= static_cast<unsigned int>(
+ mFrameIndex = CAST_U32(i);
+ if (mFrameIndex >= CAST_U32(
mAnimation->getLength()))
{
mFrameIndex = 0;
@@ -293,7 +293,7 @@ bool AnimatedSprite::updateCurrentAnimation(const unsigned int time) restrict2
else
{
if (mFrame->rand == 100 || mFrameIndex
- >= static_cast<unsigned int>(mAnimation->getLength()))
+ >= CAST_U32(mAnimation->getLength()))
{
fail = false;
}
@@ -376,7 +376,7 @@ bool AnimatedSprite::setSpriteDirection(const SpriteDirection::Type direction)
unsigned int AnimatedSprite::getFrameCount() const restrict2
{
if (mAnimation)
- return static_cast<unsigned int>(mAnimation->getLength());
+ return CAST_U32(mAnimation->getLength());
else
return 0;
}