Merge pull request #7115 from minggo/windows-fix

fix compiling error on windows
This commit is contained in:
minggo 2014-06-18 14:14:39 +08:00
commit a587931ce3
3 changed files with 11 additions and 11 deletions

View File

@ -111,17 +111,17 @@ void Animate3D::update(float t)
auto curve = it.second; auto curve = it.second;
if (curve->translateCurve) if (curve->translateCurve)
{ {
curve->translateCurve->evaluate(t, transDst, EvaluateType::LINEAR); curve->translateCurve->evaluate(t, transDst, EvaluateType::INT_LINEAR);
trans = &transDst[0]; trans = &transDst[0];
} }
if (curve->rotCurve) if (curve->rotCurve)
{ {
curve->rotCurve->evaluate(t, rotDst, EvaluateType::QUAT_SLERP); curve->rotCurve->evaluate(t, rotDst, EvaluateType::INT_QUAT_SLERP);
rot = &rotDst[0]; rot = &rotDst[0];
} }
if (curve->scaleCurve) if (curve->scaleCurve)
{ {
curve->scaleCurve->evaluate(t, scaleDst, EvaluateType::LINEAR); curve->scaleCurve->evaluate(t, scaleDst, EvaluateType::INT_LINEAR);
scale = &scaleDst[0]; scale = &scaleDst[0];
} }
bone->setAnimationValue(trans, rot, scale, _weight); bone->setAnimationValue(trans, rot, scale, _weight);

View File

@ -40,10 +40,10 @@ NS_CC_BEGIN
enum class EvaluateType enum class EvaluateType
{ {
LINEAR, INT_LINEAR,
NEAR, INT_NEAR,
QUAT_SLERP, INT_QUAT_SLERP,
USER_FUNCTION, INT_USER_FUNCTION,
}; };
/** /**

View File

@ -25,20 +25,20 @@ void AnimationCurve<componentSize>::evaluate(float time, float* dst, EvaluateTyp
float* toValue = fromValue + componentSize; float* toValue = fromValue + componentSize;
switch (type) { switch (type) {
case EvaluateType::LINEAR: case EvaluateType::INT_LINEAR:
{ {
for (auto i = 0; i < componentSize; i++) { for (auto i = 0; i < componentSize; i++) {
dst[i] = fromValue[i] + (toValue[i] - fromValue[i]) * t; dst[i] = fromValue[i] + (toValue[i] - fromValue[i]) * t;
} }
} }
break; break;
case EvaluateType::NEAR: case EvaluateType::INT_NEAR:
{ {
float* src = t > 0.5f ? toValue : fromValue; float* src = t > 0.5f ? toValue : fromValue;
memcpy(dst, src, _componentSizeByte); memcpy(dst, src, _componentSizeByte);
} }
break; break;
case EvaluateType::QUAT_SLERP: case EvaluateType::INT_QUAT_SLERP:
{ {
// Evaluate. // Evaluate.
Quaternion quat; Quaternion quat;
@ -50,7 +50,7 @@ void AnimationCurve<componentSize>::evaluate(float time, float* dst, EvaluateTyp
dst[0] = quat.x, dst[1] = quat.y, dst[2] = quat.z, dst[3] = quat.w; dst[0] = quat.x, dst[1] = quat.y, dst[2] = quat.z, dst[3] = quat.w;
} }
break; break;
case EvaluateType::USER_FUNCTION: case EvaluateType::INT_USER_FUNCTION:
{ {
if (_evaluateFun) if (_evaluateFun)
_evaluateFun(time, dst); _evaluateFun(time, dst);