From f8ea8e99ca3e822f9647ededbc5fdde5966e90aa Mon Sep 17 00:00:00 2001 From: Nathan Sweet Date: Fri, 7 Apr 2017 11:14:25 +0900 Subject: [PATCH] Only use mixAlpha for multiple mixing. closes #871 --- .../spine/AnimationState.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java index b44188a95a..c3373caf96 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java @@ -387,21 +387,21 @@ private void setCurrent (int index, TrackEntry current, boolean interrupt) { TrackEntry mixingFrom = from.mixingFrom; if (mixingFrom != null && from.mixDuration > 0) { - // A mix was interrupted, mix from the closest animation. - if (!multipleMixing && from.mixTime / from.mixDuration < 0.5f && mixingFrom.animation != emptyAnimation) { - current.mixingFrom = mixingFrom; - mixingFrom.mixingFrom = from; - mixingFrom.mixTime = from.mixDuration - from.mixTime; - mixingFrom.mixDuration = from.mixDuration; - from.mixingFrom = null; - from = mixingFrom; - } - - // The interrupted mix will mix out from its current percentage to zero. - current.mixAlpha *= Math.min(from.mixTime / from.mixDuration, 1); + if (multipleMixing) { + // The interrupted mix will mix out from its current percentage to zero. + current.mixAlpha *= Math.min(from.mixTime / from.mixDuration, 1); + } else { + // A mix was interrupted, mix from the closest animation. + if (from.mixTime / from.mixDuration < 0.5f && mixingFrom.animation != emptyAnimation) { + current.mixingFrom = mixingFrom; + mixingFrom.mixingFrom = from; + mixingFrom.mixTime = from.mixDuration - from.mixTime; + mixingFrom.mixDuration = from.mixDuration; + from.mixingFrom = null; + from = mixingFrom; + } - // End the other animation after it is applied one last time. - if (!multipleMixing) { + // End the other animation after it is applied one last time. from.mixAlpha = 0; from.mixTime = 0; from.mixDuration = 0;