From d6776b664a92aa817d2cc153a5e1e051f29253fc Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 18 Jun 2014 14:01:57 +0800 Subject: [PATCH] fix compiling error on windows --- cocos/3d/CCAnimate3D.cpp | 6 +++--- cocos/3d/CCAnimationCurve.h | 8 ++++---- cocos/3d/CCAnimationCurve.inl | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cocos/3d/CCAnimate3D.cpp b/cocos/3d/CCAnimate3D.cpp index 47d74a3025..b92f452ef3 100644 --- a/cocos/3d/CCAnimate3D.cpp +++ b/cocos/3d/CCAnimate3D.cpp @@ -111,17 +111,17 @@ void Animate3D::update(float t) auto curve = it.second; if (curve->translateCurve) { - curve->translateCurve->evaluate(t, transDst, EvaluateType::LINEAR); + curve->translateCurve->evaluate(t, transDst, EvaluateType::INT_LINEAR); trans = &transDst[0]; } if (curve->rotCurve) { - curve->rotCurve->evaluate(t, rotDst, EvaluateType::QUAT_SLERP); + curve->rotCurve->evaluate(t, rotDst, EvaluateType::INT_QUAT_SLERP); rot = &rotDst[0]; } if (curve->scaleCurve) { - curve->scaleCurve->evaluate(t, scaleDst, EvaluateType::LINEAR); + curve->scaleCurve->evaluate(t, scaleDst, EvaluateType::INT_LINEAR); scale = &scaleDst[0]; } bone->setAnimationValue(trans, rot, scale, _weight); diff --git a/cocos/3d/CCAnimationCurve.h b/cocos/3d/CCAnimationCurve.h index 6bcc3aadc2..79d9986660 100644 --- a/cocos/3d/CCAnimationCurve.h +++ b/cocos/3d/CCAnimationCurve.h @@ -37,10 +37,10 @@ NS_CC_BEGIN enum class EvaluateType { - LINEAR, - NEAR, - QUAT_SLERP, - USER_FUNCTION, + INT_LINEAR, + INT_NEAR, + INT_QUAT_SLERP, + INT_USER_FUNCTION, }; /** diff --git a/cocos/3d/CCAnimationCurve.inl b/cocos/3d/CCAnimationCurve.inl index 247aa7b218..45920fe606 100644 --- a/cocos/3d/CCAnimationCurve.inl +++ b/cocos/3d/CCAnimationCurve.inl @@ -25,20 +25,20 @@ void AnimationCurve::evaluate(float time, float* dst, EvaluateTyp float* toValue = fromValue + componentSize; switch (type) { - case EvaluateType::LINEAR: + case EvaluateType::INT_LINEAR: { for (auto i = 0; i < componentSize; i++) { dst[i] = fromValue[i] + (toValue[i] - fromValue[i]) * t; } } break; - case EvaluateType::NEAR: + case EvaluateType::INT_NEAR: { float* src = t > 0.5f ? toValue : fromValue; memcpy(dst, src, _componentSizeByte); } break; - case EvaluateType::QUAT_SLERP: + case EvaluateType::INT_QUAT_SLERP: { // Evaluate. Quaternion quat; @@ -50,7 +50,7 @@ void AnimationCurve::evaluate(float time, float* dst, EvaluateTyp dst[0] = quat.x, dst[1] = quat.y, dst[2] = quat.z, dst[3] = quat.w; } break; - case EvaluateType::USER_FUNCTION: + case EvaluateType::INT_USER_FUNCTION: { if (_evaluateFun) _evaluateFun(time, dst);