This commit is contained in:
badlogic 2024-12-10 15:45:25 +01:00
commit db34a71cfa
13 changed files with 63 additions and 60 deletions

View File

@ -148,17 +148,18 @@ class AnimationState {
from.animationLast = from.nextAnimationLast; from.animationLast = from.nextAnimationLast;
from.trackLast = from.nextTrackLast; from.trackLast = from.nextTrackLast;
// Require mixTime > 0 to ensure the mixing from entry was applied at least once. if (to.nextTrackLast != -1) { // The from entry was applied at least once.
if (to.mixTime > 0 && to.mixTime >= to.mixDuration) { var discard:Bool = to.mixTime == 0 && from.mixTime == 0; // Discard the from entry when neither have advanced yet.
// Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame). if (to.mixTime >= to.mixDuration || discard) {
if (from.totalAlpha == 0 || to.mixDuration == 0) { // Require totalAlpha == 0 to ensure mixing is complete or the transition is a single frame or discarded.
to.mixingFrom = from.mixingFrom; if (from.totalAlpha == 0 || to.mixDuration == 0 || discard) {
if (from.mixingFrom != null) to.mixingFrom = from.mixingFrom;
from.mixingFrom.mixingTo = to; if (from.mixingFrom != null) from.mixingFrom.mixingTo = to;
to.interruptAlpha = from.interruptAlpha; to.interruptAlpha = from.interruptAlpha;
queue.end(from); queue.end(from);
}
return finished;
} }
return finished;
} }
from.trackTime += delta * from.timeScale; from.trackTime += delta * from.timeScale;

View File

@ -1,12 +1,12 @@
{ {
"name": "@esotericsoftware/spine-ts", "name": "@esotericsoftware/spine-ts",
"version": "4.2.67", "version": "4.2.68",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@esotericsoftware/spine-ts", "name": "@esotericsoftware/spine-ts",
"version": "4.2.67", "version": "4.2.68",
"license": "LicenseRef-LICENSE", "license": "LicenseRef-LICENSE",
"workspaces": [ "workspaces": [
"spine-core", "spine-core",
@ -3133,18 +3133,18 @@
}, },
"spine-canvas": { "spine-canvas": {
"name": "@esotericsoftware/spine-canvas", "name": "@esotericsoftware/spine-canvas",
"version": "4.2.67", "version": "4.2.68",
"license": "LicenseRef-LICENSE", "license": "LicenseRef-LICENSE",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.67" "@esotericsoftware/spine-core": "4.2.68"
} }
}, },
"spine-canvaskit": { "spine-canvaskit": {
"name": "@esotericsoftware/spine-canvaskit", "name": "@esotericsoftware/spine-canvaskit",
"version": "4.2.67", "version": "4.2.68",
"license": "LicenseRef-LICENSE", "license": "LicenseRef-LICENSE",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.67", "@esotericsoftware/spine-core": "4.2.68",
"canvaskit-wasm": "0.39.1" "canvaskit-wasm": "0.39.1"
}, },
"devDependencies": { "devDependencies": {
@ -3154,17 +3154,17 @@
}, },
"spine-core": { "spine-core": {
"name": "@esotericsoftware/spine-core", "name": "@esotericsoftware/spine-core",
"version": "4.2.67", "version": "4.2.68",
"license": "LicenseRef-LICENSE" "license": "LicenseRef-LICENSE"
}, },
"spine-phaser": { "spine-phaser": {
"name": "@esotericsoftware/spine-phaser", "name": "@esotericsoftware/spine-phaser",
"version": "4.2.67", "version": "4.2.68",
"license": "LicenseRef-LICENSE", "license": "LicenseRef-LICENSE",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-canvas": "4.2.67", "@esotericsoftware/spine-canvas": "4.2.68",
"@esotericsoftware/spine-core": "4.2.67", "@esotericsoftware/spine-core": "4.2.68",
"@esotericsoftware/spine-webgl": "4.2.67" "@esotericsoftware/spine-webgl": "4.2.68"
}, },
"peerDependencies": { "peerDependencies": {
"phaser": "^3.60.0" "phaser": "^3.60.0"
@ -3172,10 +3172,10 @@
}, },
"spine-pixi-v7": { "spine-pixi-v7": {
"name": "@esotericsoftware/spine-pixi-v7", "name": "@esotericsoftware/spine-pixi-v7",
"version": "4.2.67", "version": "4.2.68",
"license": "LicenseRef-LICENSE", "license": "LicenseRef-LICENSE",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.67" "@esotericsoftware/spine-core": "4.2.68"
}, },
"peerDependencies": { "peerDependencies": {
"@pixi/assets": "^7.2.4", "@pixi/assets": "^7.2.4",
@ -3188,10 +3188,10 @@
}, },
"spine-pixi-v8": { "spine-pixi-v8": {
"name": "@esotericsoftware/spine-pixi-v8", "name": "@esotericsoftware/spine-pixi-v8",
"version": "4.2.67", "version": "4.2.68",
"license": "LicenseRef-LICENSE", "license": "LicenseRef-LICENSE",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.67" "@esotericsoftware/spine-core": "4.2.68"
}, },
"peerDependencies": { "peerDependencies": {
"pixi.js": "^8.4.0" "pixi.js": "^8.4.0"
@ -3199,18 +3199,18 @@
}, },
"spine-player": { "spine-player": {
"name": "@esotericsoftware/spine-player", "name": "@esotericsoftware/spine-player",
"version": "4.2.67", "version": "4.2.68",
"license": "LicenseRef-LICENSE", "license": "LicenseRef-LICENSE",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-webgl": "4.2.67" "@esotericsoftware/spine-webgl": "4.2.68"
} }
}, },
"spine-threejs": { "spine-threejs": {
"name": "@esotericsoftware/spine-threejs", "name": "@esotericsoftware/spine-threejs",
"version": "4.2.67", "version": "4.2.68",
"license": "LicenseRef-LICENSE", "license": "LicenseRef-LICENSE",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.67" "@esotericsoftware/spine-core": "4.2.68"
}, },
"devDependencies": { "devDependencies": {
"@types/three": "0.162.0" "@types/three": "0.162.0"
@ -3221,10 +3221,10 @@
}, },
"spine-webgl": { "spine-webgl": {
"name": "@esotericsoftware/spine-webgl", "name": "@esotericsoftware/spine-webgl",
"version": "4.2.67", "version": "4.2.68",
"license": "LicenseRef-LICENSE", "license": "LicenseRef-LICENSE",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.67" "@esotericsoftware/spine-core": "4.2.68"
} }
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@esotericsoftware/spine-ts", "name": "@esotericsoftware/spine-ts",
"version": "4.2.67", "version": "4.2.68",
"description": "The official Spine Runtimes for the web.", "description": "The official Spine Runtimes for the web.",
"type": "module", "type": "module",
"files": [ "files": [

View File

@ -1,6 +1,6 @@
{ {
"name": "@esotericsoftware/spine-canvas", "name": "@esotericsoftware/spine-canvas",
"version": "4.2.67", "version": "4.2.68",
"description": "The official Spine Runtimes for the web.", "description": "The official Spine Runtimes for the web.",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
@ -31,6 +31,6 @@
}, },
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.67" "@esotericsoftware/spine-core": "4.2.68"
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@esotericsoftware/spine-canvaskit", "name": "@esotericsoftware/spine-canvaskit",
"version": "4.2.67", "version": "4.2.68",
"description": "The official Spine Runtimes for CanvasKit for NodeJS", "description": "The official Spine Runtimes for CanvasKit for NodeJS",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
@ -31,7 +31,7 @@
}, },
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.67", "@esotericsoftware/spine-core": "4.2.68",
"canvaskit-wasm": "0.39.1" "canvaskit-wasm": "0.39.1"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "@esotericsoftware/spine-core", "name": "@esotericsoftware/spine-core",
"version": "4.2.67", "version": "4.2.68",
"description": "The official Spine Runtimes for the web.", "description": "The official Spine Runtimes for the web.",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",

View File

@ -138,16 +138,18 @@ export class AnimationState {
from.animationLast = from.nextAnimationLast; from.animationLast = from.nextAnimationLast;
from.trackLast = from.nextTrackLast; from.trackLast = from.nextTrackLast;
// Require mixTime > 0 to ensure the mixing from entry was applied at least once. if (to.nextTrackLast != -1) { // The from entry was applied at least once.
if (to.mixTime > 0 && to.mixTime >= to.mixDuration) { const discard = to.mixTime == 0 && from.mixTime == 0; // Discard the from entry when neither have advanced yet.
// Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame). if (to.mixTime >= to.mixDuration || discard) {
if (from.totalAlpha == 0 || to.mixDuration == 0) { // Require totalAlpha == 0 to ensure mixing is complete or the transition is a single frame or discarded.
to.mixingFrom = from.mixingFrom; if (from.totalAlpha == 0 || to.mixDuration == 0 || discard) {
if (from.mixingFrom) from.mixingFrom.mixingTo = to; to.mixingFrom = from.mixingFrom;
to.interruptAlpha = from.interruptAlpha; if (from.mixingFrom != null) from.mixingFrom.mixingTo = to;
this.queue.end(from); to.interruptAlpha = from.interruptAlpha;
this.queue.end(from);
}
return finished;
} }
return finished;
} }
from.trackTime += delta * from.timeScale; from.trackTime += delta * from.timeScale;

View File

@ -1,6 +1,6 @@
{ {
"name": "@esotericsoftware/spine-phaser", "name": "@esotericsoftware/spine-phaser",
"version": "4.2.67", "version": "4.2.68",
"description": "The official Spine Runtimes for the Phaser.", "description": "The official Spine Runtimes for the Phaser.",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
@ -31,9 +31,9 @@
}, },
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.67", "@esotericsoftware/spine-core": "4.2.68",
"@esotericsoftware/spine-webgl": "4.2.67", "@esotericsoftware/spine-webgl": "4.2.68",
"@esotericsoftware/spine-canvas": "4.2.67" "@esotericsoftware/spine-canvas": "4.2.68"
}, },
"peerDependencies": { "peerDependencies": {
"phaser": "^3.60.0" "phaser": "^3.60.0"

View File

@ -1,6 +1,6 @@
{ {
"name": "@esotericsoftware/spine-pixi-v7", "name": "@esotericsoftware/spine-pixi-v7",
"version": "4.2.67", "version": "4.2.68",
"description": "The official Spine Runtimes for the web PixiJS v7.", "description": "The official Spine Runtimes for the web PixiJS v7.",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
@ -31,7 +31,7 @@
}, },
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.67" "@esotericsoftware/spine-core": "4.2.68"
}, },
"peerDependencies": { "peerDependencies": {
"@pixi/core": "^7.2.4", "@pixi/core": "^7.2.4",

View File

@ -1,6 +1,6 @@
{ {
"name": "@esotericsoftware/spine-pixi-v8", "name": "@esotericsoftware/spine-pixi-v8",
"version": "4.2.67", "version": "4.2.68",
"description": "The official Spine Runtimes for PixiJS v8.", "description": "The official Spine Runtimes for PixiJS v8.",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
@ -31,7 +31,7 @@
}, },
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.67" "@esotericsoftware/spine-core": "4.2.68"
}, },
"peerDependencies": { "peerDependencies": {
"pixi.js": "^8.4.0" "pixi.js": "^8.4.0"

View File

@ -1,6 +1,6 @@
{ {
"name": "@esotericsoftware/spine-player", "name": "@esotericsoftware/spine-player",
"version": "4.2.67", "version": "4.2.68",
"description": "The official Spine Runtimes for the web.", "description": "The official Spine Runtimes for the web.",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
@ -31,6 +31,6 @@
}, },
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-webgl": "4.2.67" "@esotericsoftware/spine-webgl": "4.2.68"
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@esotericsoftware/spine-threejs", "name": "@esotericsoftware/spine-threejs",
"version": "4.2.67", "version": "4.2.68",
"description": "The official Spine Runtimes for the web.", "description": "The official Spine Runtimes for the web.",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
@ -31,7 +31,7 @@
}, },
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.67" "@esotericsoftware/spine-core": "4.2.68"
}, },
"devDependencies": { "devDependencies": {
"@types/three": "0.162.0" "@types/three": "0.162.0"

View File

@ -1,6 +1,6 @@
{ {
"name": "@esotericsoftware/spine-webgl", "name": "@esotericsoftware/spine-webgl",
"version": "4.2.67", "version": "4.2.68",
"description": "The official Spine Runtimes for the web.", "description": "The official Spine Runtimes for the web.",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
@ -31,6 +31,6 @@
}, },
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.67" "@esotericsoftware/spine-core": "4.2.68"
} }
} }