diff --git a/spine-csharp/src/AnimationState.cs b/spine-csharp/src/AnimationState.cs index c2ba7bc66..a4547c9df 100644 --- a/spine-csharp/src/AnimationState.cs +++ b/spine-csharp/src/AnimationState.cs @@ -204,18 +204,16 @@ namespace Spine { from.animationLast = from.nextAnimationLast; from.trackLast = from.nextTrackLast; - if (to.nextTrackLast != -1) { // The from entry was applied at least once. - bool discard = to.mixTime == 0 && from.mixTime == 0; // Discard the from entry when neither have advanced yet. - if (to.mixTime >= to.mixDuration || discard) { - // Require totalAlpha == 0 to ensure mixing is complete or the transition is a single frame or discarded. - if (from.totalAlpha == 0 || to.mixDuration == 0 || discard) { - to.mixingFrom = from.mixingFrom; - if (from.mixingFrom != null) from.mixingFrom.mixingTo = to; - to.interruptAlpha = from.interruptAlpha; - queue.End(from); - } - return finished; + // The from entry was applied at least once and the mix is complete. + if (to.nextTrackLast != -1 && to.mixTime >= to.mixDuration) { + // Mixing is complete for all entries before the from entry or the mix is instantaneous. + if (from.totalAlpha == 0 || to.mixDuration == 0) { + to.mixingFrom = from.mixingFrom; + if (from.mixingFrom != null) from.mixingFrom.mixingTo = to; + to.interruptAlpha = from.interruptAlpha; + queue.End(from); } + return finished; } from.trackTime += delta * from.timeScale; diff --git a/spine-csharp/src/SkeletonBinary.cs b/spine-csharp/src/SkeletonBinary.cs index 5c1e758ba..b57d47167 100644 --- a/spine-csharp/src/SkeletonBinary.cs +++ b/spine-csharp/src/SkeletonBinary.cs @@ -1287,7 +1287,7 @@ namespace Spine { } } } - return optimizePositive ? result : ((result >> 1) ^ -(result & 1)); + return optimizePositive ? result : ((int)((uint)result >> 1) ^ -(result & 1)); } public string ReadString () { diff --git a/spine-csharp/src/package.json b/spine-csharp/src/package.json index 4ea5e9f60..ced3135bc 100644 --- a/spine-csharp/src/package.json +++ b/spine-csharp/src/package.json @@ -2,7 +2,7 @@ "name": "com.esotericsoftware.spine.spine-csharp", "displayName": "spine-csharp Runtime", "description": "This plugin provides the spine-csharp core runtime.", - "version": "4.2.34", + "version": "4.2.36", "unity": "2018.3", "author": { "name": "Esoteric Software", diff --git a/spine-haxe/haxelib.json b/spine-haxe/haxelib.json index 7f698369e..cf2fdbdab 100644 --- a/spine-haxe/haxelib.json +++ b/spine-haxe/haxelib.json @@ -17,8 +17,8 @@ "cpp" ], "description": "The official Spine Runtime for Haxe", - "version": "4.2.5", - "releasenote": "Update to 4.2.5", + "version": "4.2.6", + "releasenote": "Update to 4.2.6", "contributors": [ "esotericsoftware" ], diff --git a/spine-haxe/spine-haxe/spine/animation/AnimationState.hx b/spine-haxe/spine-haxe/spine/animation/AnimationState.hx index a39d94047..b402870b0 100644 --- a/spine-haxe/spine-haxe/spine/animation/AnimationState.hx +++ b/spine-haxe/spine-haxe/spine/animation/AnimationState.hx @@ -148,18 +148,16 @@ class AnimationState { from.animationLast = from.nextAnimationLast; from.trackLast = from.nextTrackLast; - if (to.nextTrackLast != -1) { // The from entry was applied at least once. - var discard:Bool = to.mixTime == 0 && from.mixTime == 0; // Discard the from entry when neither have advanced yet. - if (to.mixTime >= to.mixDuration || discard) { - // Require totalAlpha == 0 to ensure mixing is complete or the transition is a single frame or discarded. - if (from.totalAlpha == 0 || to.mixDuration == 0 || discard) { - to.mixingFrom = from.mixingFrom; - if (from.mixingFrom != null) from.mixingFrom.mixingTo = to; - to.interruptAlpha = from.interruptAlpha; - queue.end(from); - } - return finished; + // The from entry was applied at least once and the mix is complete. + if (to.nextTrackLast != -1 && to.mixTime >= to.mixDuration) { + // Mixing is complete for all entries before the from entry or the mix is instantaneous. + if (from.totalAlpha == 0 || to.mixDuration == 0) { + to.mixingFrom = from.mixingFrom; + if (from.mixingFrom != null) from.mixingFrom.mixingTo = to; + to.interruptAlpha = from.interruptAlpha; + queue.end(from); } + return finished; } from.trackTime += delta * from.timeScale; diff --git a/spine-haxe/spine-haxe/spine/flixel/SkeletonSprite.hx b/spine-haxe/spine-haxe/spine/flixel/SkeletonSprite.hx index be750d193..fb3d639a5 100644 --- a/spine-haxe/spine-haxe/spine/flixel/SkeletonSprite.hx +++ b/spine-haxe/spine-haxe/spine/flixel/SkeletonSprite.hx @@ -116,9 +116,9 @@ class SkeletonSprite extends FlxObject override public function destroy():Void { - skeleton = null; + state.clearListeners(); state = null; - stateData = null; + skeleton = null; _tempVertices = null; _quadTriangles = null; diff --git a/spine-haxe/spine-haxe/spine/starling/SkeletonSprite.hx b/spine-haxe/spine-haxe/spine/starling/SkeletonSprite.hx index c4e0729e1..62a300cd9 100644 --- a/spine-haxe/spine-haxe/spine/starling/SkeletonSprite.hx +++ b/spine-haxe/spine-haxe/spine/starling/SkeletonSprite.hx @@ -416,4 +416,13 @@ class SkeletonSprite extends DisplayObject implements IAnimatable { bone.worldToLocal(point); } } + + override public function dispose():Void { + if (_state != null) { + _state.clearListeners(); + _state = null; + } + if (_skeleton != null) _skeleton = null; + super.dispose(); + } } diff --git a/spine-ts/index.html b/spine-ts/index.html index 9a774d069..735067c01 100644 --- a/spine-ts/index.html +++ b/spine-ts/index.html @@ -151,6 +151,9 @@
  • Physics IV
  • +
  • + Inline loading +
  • Player