Fix macro usage in cc.delayTime

This commit is contained in:
pandamicro
2016-03-28 19:57:53 +08:00
parent aab8562bdd
commit e2a2eef60a
+2 -2
View File
@@ -81,7 +81,7 @@ cc.ActionInterval = cc.FiniteTimeAction.extend({
* @return {Boolean}
*/
initWithDuration:function (d) {
this._duration = (d === 0) ? cc.FLT_EPSILON : d;
this._duration = (d === 0) ? cc.macro.FLT_EPSILON : d;
// prevent division by 0
// This comparison could be in step:, but it might decrease the performance
// by 3% in heavy based action games.
@@ -156,7 +156,7 @@ cc.ActionInterval = cc.FiniteTimeAction.extend({
this._elapsed += dt;
//this.update((1 > (this._elapsed / this._duration)) ? this._elapsed / this._duration : 1);
//this.update(Math.max(0, Math.min(1, this._elapsed / Math.max(this._duration, cc.FLT_EPSILON))));
//this.update(Math.max(0, Math.min(1, this._elapsed / Math.max(this._duration, cc.macro.FLT_EPSILON))));
var t = this._elapsed / (this._duration > 0.0000001192092896 ? this._duration : 0.0000001192092896);
t = (1 > t ? t : 1);
this.update(t > 0 ? t : 0);