mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +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.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package spine.animation {
|
package spine.animation {
|
||||||
import spine.MathUtils;
|
|
||||||
import spine.Bone;
|
import spine.Bone;
|
||||||
import spine.Pool;
|
|
||||||
|
|
||||||
import flash.utils.Dictionary;
|
|
||||||
|
|
||||||
import spine.Event;
|
import spine.Event;
|
||||||
|
import spine.MathUtils;
|
||||||
|
import spine.Pool;
|
||||||
import spine.Skeleton;
|
import spine.Skeleton;
|
||||||
|
import flash.utils.Dictionary;
|
||||||
|
|
||||||
public class AnimationState {
|
public class AnimationState {
|
||||||
internal static var emptyAnimation : Animation = new Animation("<empty>", new Vector.<Timeline>(), 0);
|
internal static var emptyAnimation : Animation = new Animation("<empty>", new Vector.<Timeline>(), 0);
|
||||||
@ -365,21 +363,19 @@ package spine.animation {
|
|||||||
|
|
||||||
var mixingFrom : TrackEntry = from.mixingFrom;
|
var mixingFrom : TrackEntry = from.mixingFrom;
|
||||||
if (mixingFrom != null && from.mixDuration > 0) {
|
if (mixingFrom != null && from.mixDuration > 0) {
|
||||||
// A mix was interrupted, mix from the closest animation.
|
if (multipleMixing) {
|
||||||
if (!multipleMixing && from.mixTime / from.mixDuration < 0.5 && mixingFrom.animation != AnimationState.emptyAnimation) {
|
current.mixAlpha *= Math.min(from.mixTime / from.mixDuration, 1);
|
||||||
current.mixingFrom = mixingFrom;
|
} else {
|
||||||
mixingFrom.mixingFrom = from;
|
// A mix was interrupted, mix from the closest animation.
|
||||||
mixingFrom.mixTime = from.mixDuration - from.mixTime;
|
if (from.mixTime / from.mixDuration < 0.5 && mixingFrom.animation != AnimationState.emptyAnimation) {
|
||||||
mixingFrom.mixDuration = from.mixDuration;
|
current.mixingFrom = mixingFrom;
|
||||||
from.mixingFrom = null;
|
mixingFrom.mixingFrom = from;
|
||||||
from = mixingFrom;
|
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.mixAlpha = 0;
|
||||||
from.mixTime = 0;
|
from.mixTime = 0;
|
||||||
from.mixDuration = 0;
|
from.mixDuration = 0;
|
||||||
@ -551,9 +547,7 @@ package spine.animation {
|
|||||||
if (multipleMixing) return;
|
if (multipleMixing) return;
|
||||||
|
|
||||||
// Set timelinesLast for mixingFrom entries, from highest track to lowest that has mixingFrom.
|
// Set timelinesLast for mixingFrom entries, from highest track to lowest that has mixingFrom.
|
||||||
for (var key2 : String in propertyIDs) {
|
propertyIDs = this.propertyIDs = new Dictionary();
|
||||||
delete propertyIDs[key2];
|
|
||||||
}
|
|
||||||
var lowestMixingFrom : int = n;
|
var lowestMixingFrom : int = n;
|
||||||
for (i = 0; i < n; i++) { // Find lowest track with a mixingFrom entry.
|
for (i = 0; i < n; i++) { // Find lowest track with a mixingFrom entry.
|
||||||
entry = tracks[i];
|
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.
|
// 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;
|
var timelines : Vector.<Timeline> = entry.animation.timelines;
|
||||||
for (var ii : int = 0, nn : int = entry.animation.timelines.length; ii < nn; ii++)
|
for (var ii : int = 0, nn : int = entry.animation.timelines.length; ii < nn; ii++)
|
||||||
var id : String = timelines[ii].getPropertyId().toString();
|
propertyIDs[timelines[ii].getPropertyId().toString()] = true;
|
||||||
propertyIDs[id] = id;
|
|
||||||
|
|
||||||
entry = entry.mixingFrom;
|
entry = entry.mixingFrom;
|
||||||
while (entry != null) {
|
while (entry != null) {
|
||||||
@ -591,8 +584,7 @@ package spine.animation {
|
|||||||
var usage : Vector.<Boolean> = entry.timelinesFirst;
|
var usage : Vector.<Boolean> = entry.timelinesFirst;
|
||||||
usage.length = n;
|
usage.length = n;
|
||||||
for (var i : int = 0; i < n; i++) {
|
for (var i : int = 0; i < n; i++) {
|
||||||
var id : String = timelines[i].getPropertyId().toString();
|
propertyIDs[timelines[i].getPropertyId().toString()] = true;
|
||||||
propertyIDs[id] = id;
|
|
||||||
usage[i] = true;
|
usage[i] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -611,7 +603,7 @@ package spine.animation {
|
|||||||
for (var i : int = 0; i < n; i++) {
|
for (var i : int = 0; i < n; i++) {
|
||||||
var id : String = timelines[i].getPropertyId().toString();
|
var id : String = timelines[i].getPropertyId().toString();
|
||||||
usage[i] = !propertyIDs.hasOwnProperty(id);
|
usage[i] = !propertyIDs.hasOwnProperty(id);
|
||||||
propertyIDs[id] = id;
|
propertyIDs[id] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<AS3LibraryFolder>lib</AS3LibraryFolder>
|
<AS3LibraryFolder>lib</AS3LibraryFolder>
|
||||||
<AS3Classpath generateProblems="true" sdkBased="true" type="lib" useAsSharedCode="false">frameworks/libs/player/{playerVersion}/playerglobal.swc</AS3Classpath>
|
<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="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/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/starling-2.0.1.swc</AS3Classpath>
|
||||||
|
<AS3Classpath generateProblems="true" sdkBased="false" type="lib" useAsSharedCode="false">lib/spine-as3.swc</AS3Classpath>
|
||||||
</AS3Classpath>
|
</AS3Classpath>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user