From 4d72bf940ccd5d28d718f04c991e44acb131f3d6 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Sun, 3 Dec 2023 22:07:49 +0100 Subject: [PATCH] [ts] Formatting --- spine-ts/spine-core/src/SkeletonBinary.ts | 7 ++++--- spine-ts/spine-webgl/example/physics.html | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/spine-ts/spine-core/src/SkeletonBinary.ts b/spine-ts/spine-core/src/SkeletonBinary.ts index d7164d219..8b1961fbf 100644 --- a/spine-ts/spine-core/src/SkeletonBinary.ts +++ b/spine-ts/spine-core/src/SkeletonBinary.ts @@ -335,7 +335,7 @@ export class SkeletonBinary { skin.constraints.push(skeletonData.transformConstraints[input.readInt(true)]); for (let i = 0, n = input.readInt(true); i < n; i++) skin.constraints.push(skeletonData.pathConstraints[input.readInt(true)]); - for (let i = 0, n = input.readInt(true); i < n; i++) + for (let i = 0, n = input.readInt(true); i < n; i++) skin.constraints.push(skeletonData.physicsConstraints[input.readInt(true)]); slotCount = input.readInt(true); @@ -345,7 +345,8 @@ export class SkeletonBinary { let slotIndex = input.readInt(true); for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { let name = input.readStringRef(); - if (!name) throw new Error("Attachment name must not be null"); + if (!name) + throw new Error("Attachment name must not be null"); let attachment = this.readAttachment(input, skeletonData, skin, slotIndex, name, nonessential); if (attachment) skin.setAttachment(slotIndex, name, attachment); } @@ -353,7 +354,7 @@ export class SkeletonBinary { return skin; } - private readAttachment (input: BinaryInput, skeletonData: SkeletonData, skin: Skin, slotIndex: number, attachmentName: string, nonessential: boolean): Attachment | null { + private readAttachment (input: BinaryInput, skeletonData: SkeletonData, skin: Skin, slotIndex: number, attachmentName: string | null | undefined, nonessential: boolean): Attachment | null { let scale = this.scale; let flags = input.readByte(); diff --git a/spine-ts/spine-webgl/example/physics.html b/spine-ts/spine-webgl/example/physics.html index 6fbc49bc8..4da50395c 100644 --- a/spine-ts/spine-webgl/example/physics.html +++ b/spine-ts/spine-webgl/example/physics.html @@ -53,6 +53,7 @@ this.animationState.apply(this.skeleton); // Let the skeleton update the transforms of its bones. this.skeleton.updateWorldTransform(spine.Physics.update); + this.skeleton.update(delta); } render(canvas) {