Merge pull request #5635 from andyque/fix_ease_action

fix wrong display of ease elastic action test.
This commit is contained in:
James Chen 2014-03-12 12:07:26 +08:00
commit 4b4b706066
3 changed files with 12 additions and 30 deletions

View File

@ -524,7 +524,7 @@ EaseElasticIn* EaseElasticIn::clone() const
void EaseElasticIn::update(float time) void EaseElasticIn::update(float time)
{ {
_inner->update(tweenfunc::elasticEaseIn(time, NULL)); _inner->update(tweenfunc::elasticEaseIn(time, _period));
} }
EaseElastic* EaseElasticIn::reverse() const EaseElastic* EaseElasticIn::reverse() const
@ -570,7 +570,7 @@ EaseElasticOut* EaseElasticOut::clone() const
void EaseElasticOut::update(float time) void EaseElasticOut::update(float time)
{ {
_inner->update(tweenfunc::elasticEaseOut(time, NULL)); _inner->update(tweenfunc::elasticEaseOut(time, _period));
} }
EaseElastic* EaseElasticOut::reverse() const EaseElastic* EaseElasticOut::reverse() const
@ -616,7 +616,7 @@ EaseElasticInOut* EaseElasticInOut::clone() const
void EaseElasticInOut::update(float time) void EaseElasticInOut::update(float time)
{ {
_inner->update(tweenfunc::elasticEaseInOut(time, NULL)); _inner->update(tweenfunc::elasticEaseInOut(time, _period));
} }
EaseElasticInOut* EaseElasticInOut::reverse() const EaseElasticInOut* EaseElasticInOut::reverse() const

View File

@ -121,13 +121,13 @@ float tweenTo(float time, TweenType type, float *easingParam)
break; break;
case Elastic_EaseIn: case Elastic_EaseIn:
delta = elasticEaseIn(time, easingParam); delta = elasticEaseIn(time, easingParam[0]);
break; break;
case Elastic_EaseOut: case Elastic_EaseOut:
delta = elasticEaseOut(time, easingParam); delta = elasticEaseOut(time, easingParam[0]);
break; break;
case Elastic_EaseInOut: case Elastic_EaseInOut:
delta = elasticEaseInOut(time, easingParam); delta = elasticEaseInOut(time, easingParam[0]);
break; break;
@ -315,14 +315,8 @@ float circEaseInOut(float time)
// Elastic Ease // Elastic Ease
float elasticEaseIn(float time, float *easingParam) float elasticEaseIn(float time, float period)
{ {
float period = 0.3f;
if (easingParam != NULL)
{
period = easingParam[0];
}
float newT = 0; float newT = 0;
if (time == 0 || time == 1) if (time == 0 || time == 1)
@ -338,14 +332,8 @@ float elasticEaseIn(float time, float *easingParam)
return newT; return newT;
} }
float elasticEaseOut(float time, float *easingParam) float elasticEaseOut(float time, float period)
{ {
float period = 0.3f;
if (easingParam != NULL)
{
period = easingParam[0];
}
float newT = 0; float newT = 0;
if (time == 0 || time == 1) if (time == 0 || time == 1)
@ -360,14 +348,8 @@ float elasticEaseOut(float time, float *easingParam)
return newT; return newT;
} }
float elasticEaseInOut(float time, float *easingParam) float elasticEaseInOut(float time, float period)
{ {
float period = 0.3f;
if (easingParam != NULL)
{
period = easingParam[0];
}
float newT = 0; float newT = 0;
if (time == 0 || time == 1) if (time == 0 || time == 1)

View File

@ -128,9 +128,9 @@ namespace tweenfunc {
float circEaseOut(float time); float circEaseOut(float time);
float circEaseInOut(float time); float circEaseInOut(float time);
float elasticEaseIn(float time, float *easingParam); float elasticEaseIn(float time, float period);
float elasticEaseOut(float time, float *easingParam); float elasticEaseOut(float time, float period);
float elasticEaseInOut(float time, float *easingParam); float elasticEaseInOut(float time, float period);
float backEaseIn(float time); float backEaseIn(float time);
float backEaseOut(float time); float backEaseOut(float time);