From 9fe21fcd8883b37bdc30224822e6e42afb35b8f0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 7 Feb 2016 16:18:13 +0300 Subject: Replace most static_cast to shorter versions from defines. --- src/resources/sprite/animatedsprite.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/resources/sprite') 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(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(mFrame->delay); + mFrameTime -= CAST_U32(mFrame->delay); mFrameIndex++; - if (mFrameIndex >= static_cast(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(i); - if (mFrameIndex >= static_cast( + 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(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(mAnimation->getLength()); + return CAST_U32(mAnimation->getLength()); else return 0; } -- cgit v1.2.3-70-g09d2