Skip to content

Commit

Permalink
Merge branch '4.1' into 4.2-beta
Browse files Browse the repository at this point in the history
# Conflicts:
#	spine-ts/package-lock.json
#	spine-ts/package.json
#	spine-ts/spine-canvas/package.json
#	spine-ts/spine-core/package.json
#	spine-ts/spine-phaser/package.json
#	spine-ts/spine-pixi/package.json
#	spine-ts/spine-player/package.json
#	spine-ts/spine-threejs/package.json
#	spine-ts/spine-webgl/package.json
  • Loading branch information
badlogic committed Sep 5, 2023
2 parents 33e9c24 + 6b8170b commit db914b0
Show file tree
Hide file tree
Showing 21 changed files with 36 additions and 38 deletions.
4 changes: 2 additions & 2 deletions spine-godot/spine_godot/SpineSkeleton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Ref<SpineBone> 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<SpineBone> bone_ref(memnew(SpineBone));
Expand All @@ -129,7 +129,7 @@ Ref<SpineSlot> 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<SpineSlot> slot_ref(memnew(SpineSlot));
Expand Down
4 changes: 2 additions & 2 deletions spine-godot/spine_godot/SpineSkeleton.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ class SpineSkeleton : public REFCOUNTED {
spine::Vector<float> bounds_vertex_buffer;
Ref<SpineSkin> last_skin;

std::unordered_map<spine::Bone*, Ref<SpineBone>> _cached_bones;
std::unordered_map<spine::Slot*, Ref<SpineSlot>> _cached_slots;
std::unordered_map<spine::Bone *, Ref<SpineBone>> _cached_bones;
std::unordered_map<spine::Slot *, Ref<SpineSlot>> _cached_slots;

public:
SpineSkeleton();
Expand Down
10 changes: 4 additions & 6 deletions spine-godot/spine_godot/SpineSlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@ void SpineSlot::set_to_setup_pose() {

Ref<SpineSlotData> 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<SpineSlotData> slot_data_ref(memnew(SpineSlotData));
slot_data_ref->set_spine_object(*get_spine_owner()->get_skeleton_data_res(), &slot_data);
Expand All @@ -73,10 +72,9 @@ Ref<SpineSlotData> SpineSlot::get_data() {

Ref<SpineBone> 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<SpineBone> bone_ref(memnew(SpineBone));
bone_ref->set_spine_object(get_spine_owner(), &bone);
Expand Down
2 changes: 1 addition & 1 deletion spine-ts/spine-phaser/example/arcade-physics-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.60.0/dist/phaser.js"></script>
<script src="../dist/iife/spine-phaser.js"></script>
<title>Spine Phaser Example</title>
</head>
Expand Down
2 changes: 1 addition & 1 deletion spine-ts/spine-phaser/example/basic-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.60.0/dist/phaser.js"></script>
<script src="../dist/iife/spine-phaser.js"></script>
<title>Spine Phaser Example</title>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.60.0/dist/phaser.js"></script>
<script src="https://unpkg.com/@esotericsoftware/spine-phaser@4.1.*/dist/iife/spine-phaser.min.js"></script>
<title>Spine Phaser Example</title>
</head>
Expand Down
2 changes: 1 addition & 1 deletion spine-ts/spine-phaser/example/batching-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.60.0/dist/phaser.js"></script>
<title>Spine Phaser Example</title>
</head>

Expand Down
2 changes: 1 addition & 1 deletion spine-ts/spine-phaser/example/blend-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.60.0/dist/phaser.js"></script>
<title>Spine Phaser Example</title>
</head>

Expand Down
2 changes: 1 addition & 1 deletion spine-ts/spine-phaser/example/bounds-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.60.0/dist/phaser.js"></script>
<title>Spine Phaser Example</title>
</head>

Expand Down
2 changes: 1 addition & 1 deletion spine-ts/spine-phaser/example/camera-pipeline-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.60.0/dist/phaser.js"></script>
<title>Spine Phaser Example</title>
</head>

Expand Down
2 changes: 1 addition & 1 deletion spine-ts/spine-phaser/example/canvas-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.60.0/dist/phaser.js"></script>
<title>Spine Phaser Example</title>
</head>

Expand Down
12 changes: 6 additions & 6 deletions spine-ts/spine-phaser/example/control-bones-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.60.0/dist/phaser.js"></script>
<script src="../dist/iife/spine-phaser.js"></script>
<title>Spine Phaser Example</title>
</head>

<body>
<h1>Control bones</h1>
<script>
<script>
class ControlBonesExample extends Phaser.Scene {
preload() {
this.load.spineBinary("stretchyman-data", "assets/stretchyman-pro.skel");
this.load.spineAtlas("stretchyman-atlas", "assets/stretchyman-pma.atlas");
}

create() {
const stretchyman = this.add.spine(400, 580, 'stretchyman-data', "stretchyman-atlas");
const stretchyman = this.add.spine(400, 580, 'stretchyman-data', "stretchyman-atlas");
stretchyman.animationState.setAnimation(0, "idle", true);
stretchyman.updatePose(0);

Expand All @@ -38,12 +38,12 @@ <h1>Control bones</h1>
this.input.setDraggable(control);
this.input.on('drag', function (pointer, gameObject, dragX, dragY) {
gameObject.x = dragX;
gameObject.y = dragY;
gameObject.y = dragY;
}, this);
}

stretchyman.beforeUpdateWorldTransforms = () => {
for (let controlBone of controlBones) {
for (let controlBone of controlBones) {
const bone = controlBone.getData('bone');
const point = { x: controlBone.x, y: controlBone.y};
stretchyman.phaserWorldCoordinatesToBone(point, bone);
Expand All @@ -65,7 +65,7 @@ <h1>Control bones</h1>
{ key: "spine.SpinePlugin", plugin: spine.SpinePlugin, mapping: "spine" }
]
}
});
});
</script>
</body>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.60.0/dist/phaser.js"></script>
<script src="../dist/iife/spine-phaser.js"></script>
<title>Spine Phaser Example</title>
</head>
Expand Down
2 changes: 1 addition & 1 deletion spine-ts/spine-phaser/example/depth-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.60.0/dist/phaser.js"></script>
<title>Spine Phaser Example</title>
</head>

Expand Down
8 changes: 4 additions & 4 deletions spine-ts/spine-phaser/example/events-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.60.0/dist/phaser.js"></script>
<script src="../dist/iife/spine-phaser.js"></script>
<title>Spine Phaser Example</title>
</head>
Expand All @@ -17,7 +17,7 @@ <h1>Events example</h1>
<textarea id="log" style="height: 10em;"></textarea>
</div>
</body>
<script>
<script>
function log(message) {
let log = document.querySelector("#log");
log.textContent += message + "\n";
Expand All @@ -40,7 +40,7 @@ <h1>Events example</h1>
interrupt: (entry) => log(`Interrupted animation ${entry.animation.name}`),
end: (entry) => log(`Ended animation ${entry.animation.name}`),
dispose: (entry) => log(`Disposed animation ${entry.animation.name}`),
complete: (entry) => log(`Completed animation ${entry.animation.name}`),
complete: (entry) => log(`Completed animation ${entry.animation.name}`),
})

spineboy.animationState.setAnimation(0, "walk", true);
Expand All @@ -51,7 +51,7 @@ <h1>Events example</h1>
}
}

const config = {
const config = {
canvas: document.querySelector("#game"),
width: 800,
height: 600,
Expand Down
2 changes: 1 addition & 1 deletion spine-ts/spine-phaser/example/extended-class-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.60.0/dist/phaser.js"></script>
<script src="../dist/iife/spine-phaser.js"></script>
<title>Spine Phaser Example</title>
</head>
Expand Down
2 changes: 1 addition & 1 deletion spine-ts/spine-phaser/example/mix-and-match-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.60.0/dist/phaser.js"></script>
<title>Spine Phaser Example</title>
</head>

Expand Down
2 changes: 1 addition & 1 deletion spine-ts/spine-phaser/example/multi-scene-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.60.0/dist/phaser.js"></script>
<script src="../dist/iife/spine-phaser.js"></script>
<title>Spine Phaser Example</title>
</head>
Expand Down
4 changes: 2 additions & 2 deletions spine-ts/spine-phaser/example/render-to-texture-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.60.0/dist/phaser.js"></script>
<title>Spine Phaser Example</title>
</head>

Expand Down Expand Up @@ -37,7 +37,7 @@ <h1>Render to texture</h1>
}

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);
Expand Down
2 changes: 1 addition & 1 deletion spine-ts/spine-phaser/example/visibility-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.60.0/dist/phaser.js"></script>
<script src="../dist/iife/spine-phaser.js"></script>
<title>Spine Phaser Example</title>
</head>
Expand Down
4 changes: 2 additions & 2 deletions spine-ts/spine-phaser/src/SpinePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit db914b0

Please sign in to comment.