From f80bc5e110e27d60c27f8b675b126a9ec3877193 Mon Sep 17 00:00:00 2001 From: spayton Date: Tue, 5 Sep 2023 21:30:54 +0100 Subject: [PATCH 1/4] The new SpineGameObject should use the gameObject's scene ref, not the system scene (#2357) --- spine-ts/spine-phaser/src/SpinePlugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-ts/spine-phaser/src/SpinePlugin.ts b/spine-ts/spine-phaser/src/SpinePlugin.ts index e9d5cbfb1..ad28c6c7d 100644 --- a/spine-ts/spine-phaser/src/SpinePlugin.ts +++ b/spine-ts/spine-phaser/src/SpinePlugin.ts @@ -124,7 +124,7 @@ export class SpinePlugin extends Phaser.Plugins.ScenePlugin { let self = this; let addSpineGameObject = function (this: Phaser.GameObjects.GameObjectFactory, x: number, y: number, dataKey: string, atlasKey: string, boundsProvider: SpineGameObjectBoundsProvider) { - let gameObject = new SpineGameObject(scene, self, x, y, dataKey, atlasKey, boundsProvider); + let gameObject = new SpineGameObject(this.scene, self, x, y, dataKey, atlasKey, boundsProvider); this.displayList.add(gameObject); this.updateList.add(gameObject); return gameObject; From 7b9802122892ef70e921f1413b23ce2ca7ec85ec Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Tue, 5 Sep 2023 22:35:30 +0200 Subject: [PATCH 2/4] [phaser] Update examples to Phaser 3.60.0 --- .../spine-phaser/example/arcade-physics-example.html | 2 +- spine-ts/spine-phaser/example/basic-example.html | 2 +- .../example/basic-vanilla-js-example.html | 2 +- spine-ts/spine-phaser/example/batching-test.html | 2 +- spine-ts/spine-phaser/example/blend-test.html | 2 +- spine-ts/spine-phaser/example/bounds-test.html | 2 +- .../spine-phaser/example/camera-pipeline-test.html | 2 +- spine-ts/spine-phaser/example/canvas-test.html | 2 +- .../spine-phaser/example/control-bones-example.html | 12 ++++++------ .../example/custom-spine-object-type.html | 2 +- spine-ts/spine-phaser/example/depth-test.html | 2 +- spine-ts/spine-phaser/example/events-example.html | 8 ++++---- .../spine-phaser/example/extended-class-test.html | 2 +- .../spine-phaser/example/mix-and-match-example.html | 2 +- spine-ts/spine-phaser/example/multi-scene-test.html | 2 +- .../spine-phaser/example/render-to-texture-test.html | 4 ++-- spine-ts/spine-phaser/example/visibility-test.html | 2 +- 17 files changed, 26 insertions(+), 26 deletions(-) diff --git a/spine-ts/spine-phaser/example/arcade-physics-example.html b/spine-ts/spine-phaser/example/arcade-physics-example.html index 02f4f60d8..4187dbfdb 100644 --- a/spine-ts/spine-phaser/example/arcade-physics-example.html +++ b/spine-ts/spine-phaser/example/arcade-physics-example.html @@ -5,7 +5,7 @@ - + Spine Phaser Example diff --git a/spine-ts/spine-phaser/example/basic-example.html b/spine-ts/spine-phaser/example/basic-example.html index 06f0d17a1..4a1de398f 100644 --- a/spine-ts/spine-phaser/example/basic-example.html +++ b/spine-ts/spine-phaser/example/basic-example.html @@ -5,7 +5,7 @@ - + Spine Phaser Example diff --git a/spine-ts/spine-phaser/example/basic-vanilla-js-example.html b/spine-ts/spine-phaser/example/basic-vanilla-js-example.html index 7ee5af4c9..8834eb835 100644 --- a/spine-ts/spine-phaser/example/basic-vanilla-js-example.html +++ b/spine-ts/spine-phaser/example/basic-vanilla-js-example.html @@ -5,7 +5,7 @@ - + Spine Phaser Example diff --git a/spine-ts/spine-phaser/example/batching-test.html b/spine-ts/spine-phaser/example/batching-test.html index dc9390d07..11aff8a09 100644 --- a/spine-ts/spine-phaser/example/batching-test.html +++ b/spine-ts/spine-phaser/example/batching-test.html @@ -5,7 +5,7 @@ - + Spine Phaser Example diff --git a/spine-ts/spine-phaser/example/blend-test.html b/spine-ts/spine-phaser/example/blend-test.html index ed9784dc1..dc7e97be1 100644 --- a/spine-ts/spine-phaser/example/blend-test.html +++ b/spine-ts/spine-phaser/example/blend-test.html @@ -5,7 +5,7 @@ - + Spine Phaser Example diff --git a/spine-ts/spine-phaser/example/bounds-test.html b/spine-ts/spine-phaser/example/bounds-test.html index d51473368..2a7eaef6f 100644 --- a/spine-ts/spine-phaser/example/bounds-test.html +++ b/spine-ts/spine-phaser/example/bounds-test.html @@ -5,7 +5,7 @@ - + Spine Phaser Example diff --git a/spine-ts/spine-phaser/example/camera-pipeline-test.html b/spine-ts/spine-phaser/example/camera-pipeline-test.html index 9f05a328a..f19d6710e 100644 --- a/spine-ts/spine-phaser/example/camera-pipeline-test.html +++ b/spine-ts/spine-phaser/example/camera-pipeline-test.html @@ -5,7 +5,7 @@ - + Spine Phaser Example diff --git a/spine-ts/spine-phaser/example/canvas-test.html b/spine-ts/spine-phaser/example/canvas-test.html index 2cd4f2508..86340c985 100644 --- a/spine-ts/spine-phaser/example/canvas-test.html +++ b/spine-ts/spine-phaser/example/canvas-test.html @@ -5,7 +5,7 @@ - + Spine Phaser Example diff --git a/spine-ts/spine-phaser/example/control-bones-example.html b/spine-ts/spine-phaser/example/control-bones-example.html index 48823c1cd..d4772cc27 100644 --- a/spine-ts/spine-phaser/example/control-bones-example.html +++ b/spine-ts/spine-phaser/example/control-bones-example.html @@ -5,14 +5,14 @@ - + Spine Phaser Example

Control bones

- diff --git a/spine-ts/spine-phaser/example/custom-spine-object-type.html b/spine-ts/spine-phaser/example/custom-spine-object-type.html index f20882e0a..feccee4f8 100644 --- a/spine-ts/spine-phaser/example/custom-spine-object-type.html +++ b/spine-ts/spine-phaser/example/custom-spine-object-type.html @@ -5,7 +5,7 @@ - + Spine Phaser Example diff --git a/spine-ts/spine-phaser/example/depth-test.html b/spine-ts/spine-phaser/example/depth-test.html index 4bb71d6f5..91d18bdf6 100644 --- a/spine-ts/spine-phaser/example/depth-test.html +++ b/spine-ts/spine-phaser/example/depth-test.html @@ -5,7 +5,7 @@ - + Spine Phaser Example diff --git a/spine-ts/spine-phaser/example/events-example.html b/spine-ts/spine-phaser/example/events-example.html index 99b3fb740..5894e3d95 100644 --- a/spine-ts/spine-phaser/example/events-example.html +++ b/spine-ts/spine-phaser/example/events-example.html @@ -5,7 +5,7 @@ - + Spine Phaser Example @@ -17,7 +17,7 @@ - + Spine Phaser Example diff --git a/spine-ts/spine-phaser/example/mix-and-match-example.html b/spine-ts/spine-phaser/example/mix-and-match-example.html index fd87dedb3..35533bcaa 100644 --- a/spine-ts/spine-phaser/example/mix-and-match-example.html +++ b/spine-ts/spine-phaser/example/mix-and-match-example.html @@ -5,7 +5,7 @@ - + Spine Phaser Example diff --git a/spine-ts/spine-phaser/example/multi-scene-test.html b/spine-ts/spine-phaser/example/multi-scene-test.html index cb43d932f..c22d2355e 100644 --- a/spine-ts/spine-phaser/example/multi-scene-test.html +++ b/spine-ts/spine-phaser/example/multi-scene-test.html @@ -5,7 +5,7 @@ - + Spine Phaser Example diff --git a/spine-ts/spine-phaser/example/render-to-texture-test.html b/spine-ts/spine-phaser/example/render-to-texture-test.html index 2f3aa0057..3867e0a15 100644 --- a/spine-ts/spine-phaser/example/render-to-texture-test.html +++ b/spine-ts/spine-phaser/example/render-to-texture-test.html @@ -5,7 +5,7 @@ - + Spine Phaser Example @@ -37,7 +37,7 @@ } function create() { - const renderTexture = this.add.renderTexture(0, 0, 800, 600); + const renderTexture = this.add.renderTexture(400, 300, 800, 600); const spineboy = this.add.spine(400, 300, 'spineboy-data', "spineboy-atlas"); spineboy.scale = 0.5; spineboy.animationState.setAnimation(0, "walk", true); diff --git a/spine-ts/spine-phaser/example/visibility-test.html b/spine-ts/spine-phaser/example/visibility-test.html index 118f6bc6f..9b3eedd9e 100644 --- a/spine-ts/spine-phaser/example/visibility-test.html +++ b/spine-ts/spine-phaser/example/visibility-test.html @@ -5,7 +5,7 @@ - + Spine Phaser Example From 3acbc2ab7a3adea07fe5e48c394bc2fecddb9b48 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Tue, 5 Sep 2023 22:36:04 +0200 Subject: [PATCH 3/4] Formatting --- spine-godot/spine_godot/SpineSkeleton.cpp | 4 ++-- spine-godot/spine_godot/SpineSkeleton.h | 4 ++-- spine-godot/spine_godot/SpineSlot.cpp | 10 ++++------ spine-ts/spine-phaser/src/SpinePlugin.ts | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/spine-godot/spine_godot/SpineSkeleton.cpp b/spine-godot/spine_godot/SpineSkeleton.cpp index 9685d3456..ffbcbb40a 100644 --- a/spine-godot/spine_godot/SpineSkeleton.cpp +++ b/spine-godot/spine_godot/SpineSkeleton.cpp @@ -115,7 +115,7 @@ Ref SpineSkeleton::find_bone(const String &name) { if (EMPTY(name)) return nullptr; auto bone = skeleton->findBone(SPINE_STRING_TMP(name)); if (!bone) return nullptr; - if (_cached_bones.count(bone) > 0 ) { + if (_cached_bones.count(bone) > 0) { return _cached_bones[bone]; } Ref bone_ref(memnew(SpineBone)); @@ -129,7 +129,7 @@ Ref SpineSkeleton::find_slot(const String &name) { if (EMPTY(name)) return nullptr; auto slot = skeleton->findSlot(SPINE_STRING_TMP(name)); if (!slot) return nullptr; - if (_cached_slots.count(slot) > 0 ) { + if (_cached_slots.count(slot) > 0) { return _cached_slots[slot]; } Ref slot_ref(memnew(SpineSlot)); diff --git a/spine-godot/spine_godot/SpineSkeleton.h b/spine-godot/spine_godot/SpineSkeleton.h index 19256d5d5..2d479177e 100644 --- a/spine-godot/spine_godot/SpineSkeleton.h +++ b/spine-godot/spine_godot/SpineSkeleton.h @@ -68,8 +68,8 @@ private: spine::Vector bounds_vertex_buffer; Ref last_skin; - std::unordered_map> _cached_bones; - std::unordered_map> _cached_slots; + std::unordered_map> _cached_bones; + std::unordered_map> _cached_slots; public: SpineSkeleton(); diff --git a/spine-godot/spine_godot/SpineSlot.cpp b/spine-godot/spine_godot/SpineSlot.cpp index 71c9fdfa4..067efe269 100644 --- a/spine-godot/spine_godot/SpineSlot.cpp +++ b/spine-godot/spine_godot/SpineSlot.cpp @@ -59,10 +59,9 @@ void SpineSlot::set_to_setup_pose() { Ref SpineSlot::get_data() { SPINE_CHECK(get_spine_object(), nullptr) - if(_data.is_valid()) { + if (_data.is_valid()) { return _data; - } - else { + } else { auto &slot_data = get_spine_object()->getData(); Ref slot_data_ref(memnew(SpineSlotData)); slot_data_ref->set_spine_object(*get_spine_owner()->get_skeleton_data_res(), &slot_data); @@ -73,10 +72,9 @@ Ref SpineSlot::get_data() { Ref SpineSlot::get_bone() { SPINE_CHECK(get_spine_object(), nullptr) - if(_bone.is_valid()) { + if (_bone.is_valid()) { return _data; - } - else { + } else { auto &bone = get_spine_object()->getBone(); Ref bone_ref(memnew(SpineBone)); bone_ref->set_spine_object(get_spine_owner(), &bone); diff --git a/spine-ts/spine-phaser/src/SpinePlugin.ts b/spine-ts/spine-phaser/src/SpinePlugin.ts index ad28c6c7d..951bc2021 100644 --- a/spine-ts/spine-phaser/src/SpinePlugin.ts +++ b/spine-ts/spine-phaser/src/SpinePlugin.ts @@ -76,7 +76,7 @@ export class SpinePlugin extends Phaser.Plugins.ScenePlugin { private isWebGL: boolean; gl: WebGLRenderingContext | null; static gameWebGLRenderer: SceneRenderer | null = null; - get webGLRenderer(): SceneRenderer | null { + get webGLRenderer (): SceneRenderer | null { return SpinePlugin.gameWebGLRenderer; } canvasRenderer: SkeletonRenderer | null; From 6b8170bc2a5c0a20edf47c7d622271cb36221518 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Tue, 5 Sep 2023 22:44:56 +0200 Subject: [PATCH 4/4] [ts] Release 4.1.40 --- spine-ts/package-lock.json | 34 ++++++++++++++--------------- spine-ts/package.json | 2 +- spine-ts/spine-canvas/package.json | 4 ++-- spine-ts/spine-core/package.json | 2 +- spine-ts/spine-phaser/package.json | 8 +++---- spine-ts/spine-pixi/package.json | 4 ++-- spine-ts/spine-player/package.json | 4 ++-- spine-ts/spine-threejs/package.json | 4 ++-- spine-ts/spine-webgl/package.json | 4 ++-- 9 files changed, 33 insertions(+), 33 deletions(-) diff --git a/spine-ts/package-lock.json b/spine-ts/package-lock.json index 0c0160591..61e5e1651 100644 --- a/spine-ts/package-lock.json +++ b/spine-ts/package-lock.json @@ -1,12 +1,12 @@ { "name": "@esotericsoftware/spine-ts", - "version": "4.1.39", + "version": "4.1.40", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@esotericsoftware/spine-ts", - "version": "4.1.39", + "version": "4.1.40", "license": "LicenseRef-LICENSE", "workspaces": [ "spine-core", @@ -3735,33 +3735,33 @@ }, "spine-canvas": { "name": "@esotericsoftware/spine-canvas", - "version": "4.1.39", + "version": "4.1.40", "license": "LicenseRef-LICENSE", "dependencies": { - "@esotericsoftware/spine-core": "4.1.39" + "@esotericsoftware/spine-core": "4.1.40" } }, "spine-core": { "name": "@esotericsoftware/spine-core", - "version": "4.1.39", + "version": "4.1.40", "license": "LicenseRef-LICENSE" }, "spine-phaser": { "name": "@esotericsoftware/spine-phaser", - "version": "4.1.39", + "version": "4.1.40", "license": "LicenseRef-LICENSE", "dependencies": { - "@esotericsoftware/spine-canvas": "4.1.39", - "@esotericsoftware/spine-core": "4.1.39", - "@esotericsoftware/spine-webgl": "4.1.39" + "@esotericsoftware/spine-canvas": "4.1.40", + "@esotericsoftware/spine-core": "4.1.40", + "@esotericsoftware/spine-webgl": "4.1.40" } }, "spine-pixi": { "name": "@esotericsoftware/spine-pixi", - "version": "4.1.39", + "version": "4.1.40", "license": "LicenseRef-LICENSE", "dependencies": { - "@esotericsoftware/spine-core": "4.1.39" + "@esotericsoftware/spine-core": "4.1.40" }, "peerDependencies": { "@pixi/assets": "^7.2.4", @@ -3774,26 +3774,26 @@ }, "spine-player": { "name": "@esotericsoftware/spine-player", - "version": "4.1.39", + "version": "4.1.40", "license": "LicenseRef-LICENSE", "dependencies": { - "@esotericsoftware/spine-webgl": "4.1.39" + "@esotericsoftware/spine-webgl": "4.1.40" } }, "spine-threejs": { "name": "@esotericsoftware/spine-threejs", - "version": "4.1.39", + "version": "4.1.40", "license": "LicenseRef-LICENSE", "dependencies": { - "@esotericsoftware/spine-core": "4.1.39" + "@esotericsoftware/spine-core": "4.1.40" } }, "spine-webgl": { "name": "@esotericsoftware/spine-webgl", - "version": "4.1.39", + "version": "4.1.40", "license": "LicenseRef-LICENSE", "dependencies": { - "@esotericsoftware/spine-core": "4.1.39" + "@esotericsoftware/spine-core": "4.1.40" } } } diff --git a/spine-ts/package.json b/spine-ts/package.json index 9066473ea..2cd0d7d6c 100644 --- a/spine-ts/package.json +++ b/spine-ts/package.json @@ -1,6 +1,6 @@ { "name": "@esotericsoftware/spine-ts", - "version": "4.1.39", + "version": "4.1.40", "description": "The official Spine Runtimes for the web.", "files": [ "README.md" diff --git a/spine-ts/spine-canvas/package.json b/spine-ts/spine-canvas/package.json index 4ea2e686a..8fd120373 100644 --- a/spine-ts/spine-canvas/package.json +++ b/spine-ts/spine-canvas/package.json @@ -1,6 +1,6 @@ { "name": "@esotericsoftware/spine-canvas", - "version": "4.1.39", + "version": "4.1.40", "description": "The official Spine Runtimes for the web.", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -30,6 +30,6 @@ }, "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "dependencies": { - "@esotericsoftware/spine-core": "4.1.39" + "@esotericsoftware/spine-core": "4.1.40" } } \ No newline at end of file diff --git a/spine-ts/spine-core/package.json b/spine-ts/spine-core/package.json index d42f8bf7b..a7175738b 100644 --- a/spine-ts/spine-core/package.json +++ b/spine-ts/spine-core/package.json @@ -1,6 +1,6 @@ { "name": "@esotericsoftware/spine-core", - "version": "4.1.39", + "version": "4.1.40", "description": "The official Spine Runtimes for the web.", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/spine-ts/spine-phaser/package.json b/spine-ts/spine-phaser/package.json index c8a3a4320..46d1ac071 100644 --- a/spine-ts/spine-phaser/package.json +++ b/spine-ts/spine-phaser/package.json @@ -1,6 +1,6 @@ { "name": "@esotericsoftware/spine-phaser", - "version": "4.1.39", + "version": "4.1.40", "description": "The official Spine Runtimes for the Phaser.", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -30,8 +30,8 @@ }, "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "dependencies": { - "@esotericsoftware/spine-core": "4.1.39", - "@esotericsoftware/spine-webgl": "4.1.39", - "@esotericsoftware/spine-canvas": "4.1.39" + "@esotericsoftware/spine-core": "4.1.40", + "@esotericsoftware/spine-webgl": "4.1.40", + "@esotericsoftware/spine-canvas": "4.1.40" } } \ No newline at end of file diff --git a/spine-ts/spine-pixi/package.json b/spine-ts/spine-pixi/package.json index 0eb2ce217..e8df1df8e 100644 --- a/spine-ts/spine-pixi/package.json +++ b/spine-ts/spine-pixi/package.json @@ -1,6 +1,6 @@ { "name": "@esotericsoftware/spine-pixi", - "version": "4.1.39", + "version": "4.1.40", "description": "The official Spine Runtimes for the web.", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -30,7 +30,7 @@ }, "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "dependencies": { - "@esotericsoftware/spine-core": "4.1.39" + "@esotericsoftware/spine-core": "4.1.40" }, "peerDependencies": { "@pixi/core": "^7.2.4", diff --git a/spine-ts/spine-player/package.json b/spine-ts/spine-player/package.json index 61a47744b..75f6094c2 100644 --- a/spine-ts/spine-player/package.json +++ b/spine-ts/spine-player/package.json @@ -1,6 +1,6 @@ { "name": "@esotericsoftware/spine-player", - "version": "4.1.39", + "version": "4.1.40", "description": "The official Spine Runtimes for the web.", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -30,6 +30,6 @@ }, "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "dependencies": { - "@esotericsoftware/spine-webgl": "4.1.39" + "@esotericsoftware/spine-webgl": "4.1.40" } } \ No newline at end of file diff --git a/spine-ts/spine-threejs/package.json b/spine-ts/spine-threejs/package.json index dd695e53e..369cc5980 100644 --- a/spine-ts/spine-threejs/package.json +++ b/spine-ts/spine-threejs/package.json @@ -1,6 +1,6 @@ { "name": "@esotericsoftware/spine-threejs", - "version": "4.1.39", + "version": "4.1.40", "description": "The official Spine Runtimes for the web.", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -30,6 +30,6 @@ }, "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "dependencies": { - "@esotericsoftware/spine-core": "4.1.39" + "@esotericsoftware/spine-core": "4.1.40" } } \ No newline at end of file diff --git a/spine-ts/spine-webgl/package.json b/spine-ts/spine-webgl/package.json index 64ab0d91d..83df119c1 100644 --- a/spine-ts/spine-webgl/package.json +++ b/spine-ts/spine-webgl/package.json @@ -1,6 +1,6 @@ { "name": "@esotericsoftware/spine-webgl", - "version": "4.1.39", + "version": "4.1.40", "description": "The official Spine Runtimes for the web.", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -30,6 +30,6 @@ }, "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "dependencies": { - "@esotericsoftware/spine-core": "4.1.39" + "@esotericsoftware/spine-core": "4.1.40" } } \ No newline at end of file