From 58f99b1c0cf3bee6deb43747156d153b3ffd4fdf Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Thu, 13 Mar 2025 18:11:12 +0100 Subject: [PATCH 1/8] [csharp] Port of commit f1e0f0f: Fixed animation not being mixed out in some cases. See #2786. --- spine-csharp/src/AnimationState.cs | 20 +++++++++----------- spine-csharp/src/package.json | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) 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/package.json b/spine-csharp/src/package.json index 4ea5e9f60..81df33fec 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.35", "unity": "2018.3", "author": { "name": "Esoteric Software", From 9ae2b732c0fb9e3687150607c4bf88a3e04690c1 Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Fri, 14 Mar 2025 09:31:22 +0100 Subject: [PATCH 2/8] [ts] Port of commit f1e0f0f: Fixed animation not being mixed out in some cases. See #2786. --- spine-ts/spine-core/src/AnimationState.ts | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/spine-ts/spine-core/src/AnimationState.ts b/spine-ts/spine-core/src/AnimationState.ts index 60fadbe86..9bc1a4e44 100644 --- a/spine-ts/spine-core/src/AnimationState.ts +++ b/spine-ts/spine-core/src/AnimationState.ts @@ -138,18 +138,16 @@ export class AnimationState { from.animationLast = from.nextAnimationLast; from.trackLast = from.nextTrackLast; - if (to.nextTrackLast != -1) { // The from entry was applied at least once. - const 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; - this.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; + this.queue.end(from); } + return finished; } from.trackTime += delta * from.timeScale; From 319d27ced3e2cc0d8117c56cbdc6720531296f70 Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Fri, 14 Mar 2025 09:33:14 +0100 Subject: [PATCH 3/8] [haxe] Port of commit f1e0f0f: Fixed animation not being mixed out in some cases. See #2786. --- .../spine/animation/AnimationState.hx | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) 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; From f89251907e5c14485dc6ad2a49ff8328e117151c Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Fri, 14 Mar 2025 10:19:49 +0100 Subject: [PATCH 4/8] [csharp] Fix signed vs unsigned shift bug in SkeletonBinary.SkeletonInput.ReadInt. Closes #2785. --- spine-csharp/src/SkeletonBinary.cs | 2 +- spine-csharp/src/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 81df33fec..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.35", + "version": "4.2.36", "unity": "2018.3", "author": { "name": "Esoteric Software", From 5f28cae5647252086e2f04691574f32b5058144a Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Fri, 14 Mar 2025 16:42:58 +0100 Subject: [PATCH 5/8] [ts][phaser] Add inline loading example for Phaser. --- .../spine-phaser/example/inline-loading.html | 173 ++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 spine-ts/spine-phaser/example/inline-loading.html diff --git a/spine-ts/spine-phaser/example/inline-loading.html b/spine-ts/spine-phaser/example/inline-loading.html new file mode 100644 index 000000000..88f7c9958 --- /dev/null +++ b/spine-ts/spine-phaser/example/inline-loading.html @@ -0,0 +1,173 @@ + + + + + + + + + + Spine Phaser Example + + + +

Inline loading example

+ + + + + From e9ffad91c53e1672b0914410fb001b0c76b321fe Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Fri, 14 Mar 2025 16:44:29 +0100 Subject: [PATCH 6/8] [ts][phaser] Add inline loading example to the examples list. --- spine-ts/index.html | 3 +++ 1 file changed, 3 insertions(+) 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
    • From 34ccf846a9cfec71dd17b9bf3ef733f240460900 Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Tue, 18 Mar 2025 09:54:36 +0100 Subject: [PATCH 7/8] [haxe] Add dispose function to starling. Add clearListeners to dispose/destroy. --- spine-haxe/spine-haxe/spine/flixel/SkeletonSprite.hx | 4 ++-- spine-haxe/spine-haxe/spine/starling/SkeletonSprite.hx | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) 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(); + } } From 4eb2cc0869455f4ad1fec32c59fa806e6d76becf Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Tue, 18 Mar 2025 09:55:15 +0100 Subject: [PATCH 8/8] [haxe] Release 4.2.6 --- spine-haxe/haxelib.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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" ],