From f98d003e354a1792117b7cbc771d1dd91475a156 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 18 Mar 2011 17:48:29 +0200 Subject: Fix most old style cast except manaserv and libxml2 defines. --- src/simpleanimation.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/simpleanimation.cpp') diff --git a/src/simpleanimation.cpp b/src/simpleanimation.cpp index 5d8f1dc33..9931f491c 100644 --- a/src/simpleanimation.cpp +++ b/src/simpleanimation.cpp @@ -83,7 +83,7 @@ void SimpleAnimation::setFrame(int frame) if (frame < 0) frame = 0; - if ((unsigned)frame >= mAnimation->getLength()) + if (static_cast(frame) >= mAnimation->getLength()) frame = mAnimation->getLength() - 1; mAnimationPhase = frame; mCurrentFrame = mAnimation->getFrame(mAnimationPhase); @@ -104,8 +104,11 @@ void SimpleAnimation::update(int timePassed) mAnimationTime -= mCurrentFrame->delay; mAnimationPhase++; - if ((unsigned)mAnimationPhase >= mAnimation->getLength()) + if (static_cast(mAnimationPhase) + >= mAnimation->getLength()) + { mAnimationPhase = 0; + } mCurrentFrame = mAnimation->getFrame(mAnimationPhase); } -- cgit v1.2.3-70-g09d2