diff --git a/Package.swift b/Package.swift index 6d561f8cf..db0feaf08 100644 --- a/Package.swift +++ b/Package.swift @@ -32,7 +32,7 @@ let package = Package( .target( name: "SpineiOSWrapper", dependencies: [ - .target(name: "SpineiOS", condition: .when(platforms: [.iOS, .visionOS, .tvOS, .macCatalyst ])) + .target(name: "SpineiOS", condition: .when(platforms: [.iOS, .visionOS, .tvOS, .macCatalyst])) ], path: "spine-ios/Sources/SpineiOSWrapper" ), @@ -49,7 +49,7 @@ let package = Package( path: "spine-ios/Sources/SpineC", sources: [ "src", - "spine" + "spine", ], linkerSettings: [ .linkedLibrary("c++") diff --git a/spine-android/spine-android/src/main/java/com/esotericsoftware/spine/android/SpineView.java b/spine-android/spine-android/src/main/java/com/esotericsoftware/spine/android/SpineView.java index ea5ef2866..bf5f75e44 100644 --- a/spine-android/spine-android/src/main/java/com/esotericsoftware/spine/android/SpineView.java +++ b/spine-android/spine-android/src/main/java/com/esotericsoftware/spine/android/SpineView.java @@ -352,10 +352,10 @@ public class SpineView extends View implements Choreographer.FrameCallback { this.rendering = rendering; } - /** Load the skeleton from a {@link AndroidSkeletonDrawableLoader}. This method is asynchronous. - * If you want to control the loading thread yourself, obtain an {@link AndroidSkeletonDrawable} - * using {@link AndroidSkeletonDrawable#fromHttp(URL, URL, File)} or another load method, - * then call {@link SpineView#loadFromDrawable(AndroidSkeletonDrawable)} or + /** Load the skeleton from a {@link AndroidSkeletonDrawableLoader}. This method is asynchronous. If you want to control the + * loading thread yourself, obtain an {@link AndroidSkeletonDrawable} using + * {@link AndroidSkeletonDrawable#fromHttp(URL, URL, File)} or another load method, then call + * {@link SpineView#loadFromDrawable(AndroidSkeletonDrawable)} or * {@link SpineView#setSkeletonDrawable(AndroidSkeletonDrawable)}. */ public void loadFrom (AndroidSkeletonDrawableLoader loader) { Handler mainHandler = new Handler(Looper.getMainLooper()); @@ -365,14 +365,14 @@ public class SpineView extends View implements Choreographer.FrameCallback { mainHandler.post( () -> { setSkeletonDrawable(skeletonDrawable); }); - }catch (Exception e) { + } catch (Exception e) { Log.e("SpineView", "Error loading skeleton", e); } }); backgroundThread.start(); } - /** Set the skeleton drawable. Must be called from the main thread.*/ + /** Set the skeleton drawable. Must be called from the main thread. */ @MainThread public final void setSkeletonDrawable (@NonNull AndroidSkeletonDrawable skeletonDrawable) { computedBounds = boundsProvider.computeBounds(skeletonDrawable); diff --git a/spine-flutter/example/macos/Flutter/GeneratedPluginRegistrant.swift b/spine-flutter/example/macos/Flutter/GeneratedPluginRegistrant.swift index cccf817a5..bfa0333a3 100644 --- a/spine-flutter/example/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/spine-flutter/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,6 +5,5 @@ import FlutterMacOS import Foundation - func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { } diff --git a/spine-godot/spine_godot/register_types.cpp b/spine-godot/spine_godot/register_types.cpp index e02eadecb..b8fa1bcc1 100644 --- a/spine-godot/spine_godot/register_types.cpp +++ b/spine-godot/spine_godot/register_types.cpp @@ -101,6 +101,26 @@ void initialize_spine_godot_module(ModuleInitializationLevel level) { GDREGISTER_CLASS(SpineEditorPlugin); EditorPlugins::add_plugin_class(StringName("SpineEditorPlugin")); #endif + return; + } + if (level == MODULE_INITIALIZATION_LEVEL_CORE) { + GDREGISTER_CLASS(SpineAtlasResourceFormatLoader); + GDREGISTER_CLASS(SpineAtlasResourceFormatSaver); + GDREGISTER_CLASS(SpineSkeletonFileResourceFormatLoader); + GDREGISTER_CLASS(SpineSkeletonFileResourceFormatSaver); + + atlas_loader = memnew(SpineAtlasResourceFormatLoader); + ResourceLoader::get_singleton()->add_resource_format_loader(atlas_loader); + + atlas_saver = memnew(SpineAtlasResourceFormatSaver); + ResourceSaver::get_singleton()->add_resource_format_saver(atlas_saver); + + skeleton_file_loader = memnew(SpineSkeletonFileResourceFormatLoader); + ResourceLoader::get_singleton()->add_resource_format_loader(skeleton_file_loader); + + skeleton_file_saver = memnew(SpineSkeletonFileResourceFormatSaver); + ResourceSaver::get_singleton()->add_resource_format_saver(skeleton_file_saver); + return; } if (level != MODULE_INITIALIZATION_LEVEL_SCENE) return; #else @@ -124,10 +144,12 @@ void register_spine_godot_types() { #endif spine::Bone::setYDown(true); +#ifndef SPINE_GODOT_EXTENSION GDREGISTER_CLASS(SpineAtlasResourceFormatLoader); GDREGISTER_CLASS(SpineAtlasResourceFormatSaver); GDREGISTER_CLASS(SpineSkeletonFileResourceFormatLoader); GDREGISTER_CLASS(SpineSkeletonFileResourceFormatSaver); +#endif GDREGISTER_CLASS(SpineObjectWrapper); GDREGISTER_CLASS(SpineAtlasResource); @@ -177,19 +199,7 @@ void register_spine_godot_types() { GDREGISTER_CLASS(SpineAnimationTrack); #endif -#ifdef SPINE_GODOT_EXTENSION - atlas_loader = memnew(SpineAtlasResourceFormatLoader); - ResourceLoader::get_singleton()->add_resource_format_loader(atlas_loader); - - atlas_saver = memnew(SpineAtlasResourceFormatSaver); - ResourceSaver::get_singleton()->add_resource_format_saver(atlas_saver); - - skeleton_file_loader = memnew(SpineSkeletonFileResourceFormatLoader); - ResourceLoader::get_singleton()->add_resource_format_loader(skeleton_file_loader); - - skeleton_file_saver = memnew(SpineSkeletonFileResourceFormatSaver); - ResourceSaver::get_singleton()->add_resource_format_saver(skeleton_file_saver); -#else +#ifndef SPINE_GODOT_EXTENSION #if VERSION_MAJOR > 3 atlas_loader = memnew(SpineAtlasResourceFormatLoader); ResourceLoader::add_resource_format_loader(atlas_loader); diff --git a/spine-ios/Sources/SpineiOSWrapper/stub.swift b/spine-ios/Sources/SpineiOSWrapper/stub.swift index 555cc2c46..7ce8cd1d6 100644 --- a/spine-ios/Sources/SpineiOSWrapper/stub.swift +++ b/spine-ios/Sources/SpineiOSWrapper/stub.swift @@ -4,4 +4,3 @@ // // Created by pbk20191 on 11/7/25. // -