Browse Source

[ts] Ported 0 timeScale fix, see #1194.

badlogic 7 years ago
parent
commit
0161fe59ca

+ 6 - 1
spine-ts/build/spine-all.js

@@ -1367,7 +1367,7 @@ var spine;
 			var finished = this.updateMixingFrom(from, delta);
 			from.animationLast = from.nextAnimationLast;
 			from.trackLast = from.nextTrackLast;
-			if (to.mixTime > 0 && (to.mixTime >= to.mixDuration || to.timeScale == 0)) {
+			if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {
 				if (from.totalAlpha == 0 || to.mixDuration == 0) {
 					to.mixingFrom = from.mixingFrom;
 					if (from.mixingFrom != null)
@@ -1377,6 +1377,11 @@ var spine;
 				}
 				return finished;
 			}
+			if (to.timeScale == 0 && to.mixingTo != null) {
+				to.timeScale = 1;
+				to.mixTime = 0;
+				to.mixDuration = 0;
+			}
 			from.trackTime += delta * from.timeScale;
 			to.mixTime += delta * to.timeScale;
 			return false;

File diff suppressed because it is too large
+ 0 - 0
spine-ts/build/spine-all.js.map


+ 6 - 1
spine-ts/build/spine-canvas.js

@@ -1367,7 +1367,7 @@ var spine;
 			var finished = this.updateMixingFrom(from, delta);
 			from.animationLast = from.nextAnimationLast;
 			from.trackLast = from.nextTrackLast;
-			if (to.mixTime > 0 && (to.mixTime >= to.mixDuration || to.timeScale == 0)) {
+			if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {
 				if (from.totalAlpha == 0 || to.mixDuration == 0) {
 					to.mixingFrom = from.mixingFrom;
 					if (from.mixingFrom != null)
@@ -1377,6 +1377,11 @@ var spine;
 				}
 				return finished;
 			}
+			if (to.timeScale == 0 && to.mixingTo != null) {
+				to.timeScale = 1;
+				to.mixTime = 0;
+				to.mixDuration = 0;
+			}
 			from.trackTime += delta * from.timeScale;
 			to.mixTime += delta * to.timeScale;
 			return false;

File diff suppressed because it is too large
+ 0 - 0
spine-ts/build/spine-canvas.js.map


+ 6 - 1
spine-ts/build/spine-core.js

@@ -1367,7 +1367,7 @@ var spine;
 			var finished = this.updateMixingFrom(from, delta);
 			from.animationLast = from.nextAnimationLast;
 			from.trackLast = from.nextTrackLast;
-			if (to.mixTime > 0 && (to.mixTime >= to.mixDuration || to.timeScale == 0)) {
+			if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {
 				if (from.totalAlpha == 0 || to.mixDuration == 0) {
 					to.mixingFrom = from.mixingFrom;
 					if (from.mixingFrom != null)
@@ -1377,6 +1377,11 @@ var spine;
 				}
 				return finished;
 			}
+			if (to.timeScale == 0 && to.mixingTo != null) {
+				to.timeScale = 1;
+				to.mixTime = 0;
+				to.mixDuration = 0;
+			}
 			from.trackTime += delta * from.timeScale;
 			to.mixTime += delta * to.timeScale;
 			return false;

File diff suppressed because it is too large
+ 0 - 0
spine-ts/build/spine-core.js.map


+ 6 - 1
spine-ts/build/spine-threejs.js

@@ -1367,7 +1367,7 @@ var spine;
 			var finished = this.updateMixingFrom(from, delta);
 			from.animationLast = from.nextAnimationLast;
 			from.trackLast = from.nextTrackLast;
-			if (to.mixTime > 0 && (to.mixTime >= to.mixDuration || to.timeScale == 0)) {
+			if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {
 				if (from.totalAlpha == 0 || to.mixDuration == 0) {
 					to.mixingFrom = from.mixingFrom;
 					if (from.mixingFrom != null)
@@ -1377,6 +1377,11 @@ var spine;
 				}
 				return finished;
 			}
+			if (to.timeScale == 0 && to.mixingTo != null) {
+				to.timeScale = 1;
+				to.mixTime = 0;
+				to.mixDuration = 0;
+			}
 			from.trackTime += delta * from.timeScale;
 			to.mixTime += delta * to.timeScale;
 			return false;

File diff suppressed because it is too large
+ 0 - 0
spine-ts/build/spine-threejs.js.map


+ 6 - 1
spine-ts/build/spine-webgl.js

@@ -1367,7 +1367,7 @@ var spine;
 			var finished = this.updateMixingFrom(from, delta);
 			from.animationLast = from.nextAnimationLast;
 			from.trackLast = from.nextTrackLast;
-			if (to.mixTime > 0 && (to.mixTime >= to.mixDuration || to.timeScale == 0)) {
+			if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {
 				if (from.totalAlpha == 0 || to.mixDuration == 0) {
 					to.mixingFrom = from.mixingFrom;
 					if (from.mixingFrom != null)
@@ -1377,6 +1377,11 @@ var spine;
 				}
 				return finished;
 			}
+			if (to.timeScale == 0 && to.mixingTo != null) {
+				to.timeScale = 1;
+				to.mixTime = 0;
+				to.mixDuration = 0;
+			}
 			from.trackTime += delta * from.timeScale;
 			to.mixTime += delta * to.timeScale;
 			return false;

File diff suppressed because it is too large
+ 0 - 0
spine-ts/build/spine-webgl.js.map


+ 6 - 1
spine-ts/build/spine-widget.js

@@ -1367,7 +1367,7 @@ var spine;
 			var finished = this.updateMixingFrom(from, delta);
 			from.animationLast = from.nextAnimationLast;
 			from.trackLast = from.nextTrackLast;
-			if (to.mixTime > 0 && (to.mixTime >= to.mixDuration || to.timeScale == 0)) {
+			if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {
 				if (from.totalAlpha == 0 || to.mixDuration == 0) {
 					to.mixingFrom = from.mixingFrom;
 					if (from.mixingFrom != null)
@@ -1377,6 +1377,11 @@ var spine;
 				}
 				return finished;
 			}
+			if (to.timeScale == 0 && to.mixingTo != null) {
+				to.timeScale = 1;
+				to.mixTime = 0;
+				to.mixDuration = 0;
+			}
 			from.trackTime += delta * from.timeScale;
 			to.mixTime += delta * to.timeScale;
 			return false;

File diff suppressed because it is too large
+ 0 - 0
spine-ts/build/spine-widget.js.map


+ 7 - 1
spine-ts/core/src/AnimationState.ts

@@ -118,7 +118,7 @@ module spine {
 			from.trackLast = from.nextTrackLast;
 
 			// Require mixTime > 0 to ensure the mixing from entry was applied at least once.
-			if (to.mixTime > 0 && (to.mixTime >= to.mixDuration || to.timeScale == 0)) {
+			if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {
 				// Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).
 				if (from.totalAlpha == 0 || to.mixDuration == 0) {
 					to.mixingFrom = from.mixingFrom;
@@ -129,6 +129,12 @@ module spine {
 				return finished;
 			}
 
+			if (to.timeScale == 0 && to.mixingTo != null) {
+				to.timeScale = 1;
+				to.mixTime = 0;
+				to.mixDuration = 0;
+			}
+
 			from.trackTime += delta * from.timeScale;
 			to.mixTime += delta * to.timeScale;
 			return false;

Some files were not shown because too many files changed in this diff