mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[as3] Fixed dipping problem fix
This commit is contained in:
parent
01b20b568b
commit
dc9845bdc4
Binary file not shown.
@ -28,14 +28,12 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
package spine.animation {
|
||||
import spine.MathUtils;
|
||||
import spine.Bone;
|
||||
import spine.Pool;
|
||||
|
||||
import flash.utils.Dictionary;
|
||||
|
||||
import spine.Event;
|
||||
import spine.MathUtils;
|
||||
import spine.Pool;
|
||||
import spine.Skeleton;
|
||||
import flash.utils.Dictionary;
|
||||
|
||||
public class AnimationState {
|
||||
internal static var emptyAnimation : Animation = new Animation("<empty>", new Vector.<Timeline>(), 0);
|
||||
@ -365,21 +363,19 @@ package spine.animation {
|
||||
|
||||
var mixingFrom : TrackEntry = from.mixingFrom;
|
||||
if (mixingFrom != null && from.mixDuration > 0) {
|
||||
// A mix was interrupted, mix from the closest animation.
|
||||
if (!multipleMixing && from.mixTime / from.mixDuration < 0.5 && mixingFrom.animation != AnimationState.emptyAnimation) {
|
||||
current.mixingFrom = mixingFrom;
|
||||
mixingFrom.mixingFrom = from;
|
||||
mixingFrom.mixTime = from.mixDuration - from.mixTime;
|
||||
mixingFrom.mixDuration = from.mixDuration;
|
||||
from.mixingFrom = null;
|
||||
from = mixingFrom;
|
||||
}
|
||||
if (multipleMixing) {
|
||||
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.5 && mixingFrom.animation != AnimationState.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);
|
||||
|
||||
// End the other animation after it is applied one last time.
|
||||
if (!multipleMixing) {
|
||||
from.mixAlpha = 0;
|
||||
from.mixTime = 0;
|
||||
from.mixDuration = 0;
|
||||
@ -551,9 +547,7 @@ package spine.animation {
|
||||
if (multipleMixing) return;
|
||||
|
||||
// Set timelinesLast for mixingFrom entries, from highest track to lowest that has mixingFrom.
|
||||
for (var key2 : String in propertyIDs) {
|
||||
delete propertyIDs[key2];
|
||||
}
|
||||
propertyIDs = this.propertyIDs = new Dictionary();
|
||||
var lowestMixingFrom : int = n;
|
||||
for (i = 0; i < n; i++) { // Find lowest track with a mixingFrom entry.
|
||||
entry = tracks[i];
|
||||
@ -568,8 +562,7 @@ package spine.animation {
|
||||
// Store properties for non-mixingFrom entry but don't set timelinesLast, which is only used for mixingFrom entries.
|
||||
var timelines : Vector.<Timeline> = entry.animation.timelines;
|
||||
for (var ii : int = 0, nn : int = entry.animation.timelines.length; ii < nn; ii++)
|
||||
var id : String = timelines[ii].getPropertyId().toString();
|
||||
propertyIDs[id] = id;
|
||||
propertyIDs[timelines[ii].getPropertyId().toString()] = true;
|
||||
|
||||
entry = entry.mixingFrom;
|
||||
while (entry != null) {
|
||||
@ -591,8 +584,7 @@ package spine.animation {
|
||||
var usage : Vector.<Boolean> = entry.timelinesFirst;
|
||||
usage.length = n;
|
||||
for (var i : int = 0; i < n; i++) {
|
||||
var id : String = timelines[i].getPropertyId().toString();
|
||||
propertyIDs[id] = id;
|
||||
propertyIDs[timelines[i].getPropertyId().toString()] = true;
|
||||
usage[i] = true;
|
||||
}
|
||||
}
|
||||
@ -611,7 +603,7 @@ package spine.animation {
|
||||
for (var i : int = 0; i < n; i++) {
|
||||
var id : String = timelines[i].getPropertyId().toString();
|
||||
usage[i] = !propertyIDs.hasOwnProperty(id);
|
||||
propertyIDs[id] = id;
|
||||
propertyIDs[id] = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<AS3LibraryFolder>lib</AS3LibraryFolder>
|
||||
<AS3Classpath generateProblems="true" sdkBased="true" type="lib" useAsSharedCode="false">frameworks/libs/player/{playerVersion}/playerglobal.swc</AS3Classpath>
|
||||
<AS3Classpath generateProblems="true" sdkBased="false" type="source" useAsSharedCode="false">src</AS3Classpath>
|
||||
<AS3Classpath generateProblems="true" sdkBased="false" type="lib" useAsSharedCode="false">lib/spine-as3.swc</AS3Classpath>
|
||||
<AS3Classpath generateProblems="true" sdkBased="false" type="lib" useAsSharedCode="false">lib/spine-starling.swc</AS3Classpath>
|
||||
<AS3Classpath generateProblems="true" sdkBased="false" type="lib" useAsSharedCode="false">lib/starling-2.0.1.swc</AS3Classpath>
|
||||
<AS3Classpath generateProblems="true" sdkBased="false" type="lib" useAsSharedCode="false">lib/spine-as3.swc</AS3Classpath>
|
||||
</AS3Classpath>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user