From bd781912daaac520acc127a8f07b5349c2615dac Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Tue, 19 Mar 2024 16:03:30 +0100 Subject: [PATCH 1/2] [flutter] Fixes #2479, use default FilterQuality.none --- spine-flutter/CHANGELOG.md | 3 +++ spine-flutter/example/pubspec.lock | 6 +++--- spine-flutter/lib/spine_flutter.dart | 8 ++------ spine-flutter/pubspec.yaml | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/spine-flutter/CHANGELOG.md b/spine-flutter/CHANGELOG.md index f7fff6dfc..47bac0fb7 100644 --- a/spine-flutter/CHANGELOG.md +++ b/spine-flutter/CHANGELOG.md @@ -1,3 +1,6 @@ +# 4.1.14 +* Temporary "fix" for https://github.com/EsotericSoftware/spine-runtimes/issues/2479. It appears the canvaskit backend of Flutter has a bug. We currently do not set a `FilterQuality` anymore. The Flutter rendering backend is supposed to pick a good one depending the platform. Users can still set `FilterQuality` globally via `Atlas.filterQuality` as before. + # 4.1.13 * Fix multiply blend mode, see https://esotericsoftware.com/forum/d/25369-spine-flutter-slot%E6%B7%B7%E5%90%88%E6%A8%A1%E5%BC%8F%E5%90%8Ealpha%E4%B8%A2%E5%A4%B1/2 diff --git a/spine-flutter/example/pubspec.lock b/spine-flutter/example/pubspec.lock index ed2be16d8..75ccffa86 100644 --- a/spine-flutter/example/pubspec.lock +++ b/spine-flutter/example/pubspec.lock @@ -53,10 +53,10 @@ packages: dependency: "direct main" description: name: flame - sha256: b6bb76224fc29fd5eea25d66cda6e322e3678bdedc1f65956c6151326a6a798b + sha256: "2a2352741500ce47823dcf212f06b23e9bdb622454eab90244ee6da58e23b488" url: "https://pub.dev" source: hosted - version: "1.10.1" + version: "1.15.0" flutter: dependency: "direct main" description: flutter @@ -169,7 +169,7 @@ packages: path: ".." relative: true source: path - version: "4.1.7" + version: "4.1.13" string_scanner: dependency: transitive description: diff --git a/spine-flutter/lib/spine_flutter.dart b/spine-flutter/lib/spine_flutter.dart index af096f744..34ae82d07 100644 --- a/spine-flutter/lib/spine_flutter.dart +++ b/spine-flutter/lib/spine_flutter.dart @@ -101,7 +101,7 @@ class Vec2 { /// Use the static methods [fromAsset], [fromFile], and [fromHttp] to load an atlas. Call [dispose] /// when the atlas is no longer in use to release its resources. class Atlas { - static FilterQuality filterQuality = FilterQuality.medium; + static FilterQuality filterQuality = FilterQuality.none; final spine_atlas _atlas; final List atlasPages; final List> atlasPagePaints; @@ -183,11 +183,7 @@ class Atlas { for (final image in atlasPages) { image.dispose(); } - for (final map in atlasPagePaints) { - map.values.forEach((element) { - element.shader?.dispose(); - }); - } + atlasPagePaints.clear(); } } diff --git a/spine-flutter/pubspec.yaml b/spine-flutter/pubspec.yaml index 0e13d4c8a..53eebea2e 100644 --- a/spine-flutter/pubspec.yaml +++ b/spine-flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: spine_flutter description: The official Spine Flutter Runtime to load, display and interact with Spine animations. -version: 4.1.13 +version: 4.1.14 homepage: https://esotericsoftware.com repository: https://github.com/esotericsoftware/spine-runtimes issue_tracker: https://github.com/esotericsoftware/spine-runtimes/issues From c36f8473197fbf5aef7cdf12e5bfe4e58539e541 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Tue, 19 Mar 2024 16:13:30 +0100 Subject: [PATCH 2/2] [unity] SkeletonGraphic: re-joined Rebuild and MeshUpdate to fix IndexOutOfRangeException. Closes #2487. --- .../Runtime/spine-unity/Components/SkeletonGraphic.cs | 10 ++-------- spine-unity/Assets/Spine/package.json | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs index e89362338..56b00f1cd 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs @@ -121,7 +121,6 @@ namespace Spine.Unity { public bool updateSeparatorPartScale = false; private bool wasUpdatedAfterInit = true; - private bool requiresInstructionUpate = true; private Texture baseTexture = null; #if UNITY_EDITOR @@ -315,7 +314,7 @@ namespace Spine.Unity { if (!this.IsValid) return; if (canvasRenderer.cull) return; if (update == CanvasUpdate.PreRender) { - if (requiresInstructionUpate) PrepareInstructionsAndRenderers(isInRebuild: true); + PrepareInstructionsAndRenderers(isInRebuild: true); UpdateMeshToInstructions(); } if (allowMultipleCanvasRenderers) canvasRenderer.Clear(); @@ -420,9 +419,7 @@ namespace Spine.Unity { if (updateTiming == UpdateTiming.InLateUpdate) Update(unscaledTime ? Time.unscaledDeltaTime : Time.deltaTime); - PrepareInstructionsAndRenderers(); - - SetVerticesDirty(); // triggers Rebuild and avoids potential double-update in a single frame + UpdateMesh(); } protected void OnCullStateChanged (bool culled) { @@ -468,11 +465,9 @@ namespace Spine.Unity { public Skeleton Skeleton { get { Initialize(false); - requiresInstructionUpate = true; return skeleton; } set { - requiresInstructionUpate = true; skeleton = value; } } @@ -722,7 +717,6 @@ namespace Spine.Unity { } public void PrepareInstructionsAndRenderers (bool isInRebuild = false) { - requiresInstructionUpate = false; if (!this.allowMultipleCanvasRenderers) { MeshGenerator.GenerateSingleSubmeshInstruction(currentInstructions, skeleton, null); if (canvasRenderers.Count > 0) diff --git a/spine-unity/Assets/Spine/package.json b/spine-unity/Assets/Spine/package.json index bd6c23df3..ca90e9ff5 100644 --- a/spine-unity/Assets/Spine/package.json +++ b/spine-unity/Assets/Spine/package.json @@ -2,7 +2,7 @@ "name": "com.esotericsoftware.spine.spine-unity", "displayName": "spine-unity Runtime", "description": "This plugin provides the spine-unity runtime core.", - "version": "4.1.39", + "version": "4.1.40", "unity": "2018.3", "author": { "name": "Esoteric Software",