Skip to content

Commit

Permalink
[as3] Ported 0 timeScale fix, see #1194.
Browse files Browse the repository at this point in the history
  • Loading branch information
badlogic committed Oct 15, 2018
1 parent 03e5786 commit ed7b4ea
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
Binary file modified spine-as3/spine-as3-example/lib/spine-as3.swc
Binary file not shown.
9 changes: 8 additions & 1 deletion spine-as3/spine-as3/src/spine/animation/AnimationState.as
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ package spine.animation {
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;
Expand All @@ -145,6 +145,13 @@ package spine.animation {
}
return finished;
}

// If to has 0 timeScale and is not the first entry, remove the mix and apply it one more time to return to the setup pose.
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;
Expand Down
Binary file modified spine-starling/spine-starling-example/lib/spine-as3.swc
Binary file not shown.
Binary file modified spine-starling/spine-starling/lib/spine-as3.swc
Binary file not shown.

0 comments on commit ed7b4ea

Please sign in to comment.