Formatting

This commit is contained in:
Mario Zechner 2025-11-10 15:43:02 +01:00
parent fba64447bf
commit be2e8ff514
5 changed files with 31 additions and 23 deletions

View File

@ -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++")

View File

@ -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);

View File

@ -5,6 +5,5 @@
import FlutterMacOS
import Foundation
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
}

View File

@ -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);

View File

@ -4,4 +4,3 @@
//
// Created by pbk20191 on 11/7/25.
//