X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Fanimation%2Fscene-graph-animator.h;h=ce7b1c0b798781845f86fa71ec554e292972b879;hb=3e5a6bbb6a052fba7e514bd7e8781afc1db6fa37;hp=b8da716b87f3eaf6dc78b489a044881e80180cca;hpb=39093bc48ee4ed2b4956c183faf59c36f3e9746c;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/update/animation/scene-graph-animator.h b/dali/internal/update/animation/scene-graph-animator.h index b8da716..ce7b1c0 100644 --- a/dali/internal/update/animation/scene-graph-animator.h +++ b/dali/internal/update/animation/scene-graph-animator.h @@ -19,11 +19,6 @@ */ // INTERNAL INCLUDES -#include -#include -#include -#include -#include #include #include #include @@ -31,6 +26,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include @@ -153,7 +153,7 @@ public: mSpeedFactor = factor; } - void SetLoopCount(int loopCount) + void SetLoopCount(int32_t loopCount) { mLoopCount = loopCount; } @@ -329,7 +329,7 @@ public: float upperBound(1.0f); float currentT(0.5f); float currentX = EvaluateCubicBezier( controlPoints.x, controlPoints.z, currentT); - while( fabs( progress - currentX ) > tolerance ) + while( fabsf( progress - currentX ) > tolerance ) { if( progress > currentX ) { @@ -442,7 +442,7 @@ protected: float mIntervalDelaySeconds; float mSpeedFactor; - int mLoopCount; + int32_t mLoopCount; AlphaFunction mAlphaFunction; @@ -558,7 +558,8 @@ public: const PropertyType& current = mPropertyAccessor.Get( bufferIndex ); - const PropertyType result = (*mAnimatorFunction)( alpha, current ); + // need to cast the return value in case property is integer + const PropertyType result = static_cast( (*mAnimatorFunction)( alpha, current ) ); if ( bake ) { mPropertyAccessor.Bake( bufferIndex, result ); @@ -717,8 +718,8 @@ public: const T& current = mPropertyAccessor.Get( bufferIndex ); - const T result = (*mAnimatorFunction)( alpha, current ); - + // need to cast the return value in case property is integer + T result = static_cast( (*mAnimatorFunction)( alpha, current ) ); if ( bake ) { @@ -796,14 +797,9 @@ struct AnimatorFunctionBase return property; } - virtual float operator()(float progress, const int& property) + virtual float operator()(float progress, const int32_t& property) { - return property; - } - - virtual float operator()(float progress, const unsigned int& property) - { - return property; + return static_cast( property ); } virtual float operator()(float progress, const float& property) @@ -842,12 +838,12 @@ struct AnimateByInteger : public AnimatorFunctionBase } using AnimatorFunctionBase::operator(); - float operator()(float alpha, const int& property) + float operator()(float alpha, const int32_t& property) { - return int(property + mRelative * alpha + 0.5f ); + return truncf(static_cast( property ) + static_cast( mRelative ) * alpha + 0.5f ); } - int mRelative; + int32_t mRelative; }; struct AnimateToInteger : public AnimatorFunctionBase @@ -858,12 +854,12 @@ struct AnimateToInteger : public AnimatorFunctionBase } using AnimatorFunctionBase::operator(); - float operator()(float alpha, const int& property) + float operator()(float alpha, const int32_t& property) { - return int(property + ((mTarget - property) * alpha) + 0.5f); + return truncf(static_cast( property ) + (static_cast(mTarget - property) * alpha) + 0.5f); } - int mTarget; + int32_t mTarget; }; struct AnimateByFloat : public AnimatorFunctionBase @@ -1134,13 +1130,13 @@ struct KeyFrameIntegerFunctor : public AnimatorFunctionBase } using AnimatorFunctionBase::operator(); - float operator()(float progress, const int& property) + float operator()(float progress, const int32_t& property) { if(mKeyFrames->IsActive(progress)) { - return mKeyFrames->GetValue(progress, mInterpolation); + return static_cast( mKeyFrames->GetValue(progress, mInterpolation) ); } - return property; + return static_cast( property ); } KeyFrameIntegerPtr mKeyFrames;