diff --git a/spine-flutter/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt b/spine-flutter/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt new file mode 100644 index 000000000..e793a000d --- /dev/null +++ b/spine-flutter/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.example + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/spine-flutter/example/lib/main.dart b/spine-flutter/example/lib/main.dart index 2cfc3c23d..b7488fe2f 100644 --- a/spine-flutter/example/lib/main.dart +++ b/spine-flutter/example/lib/main.dart @@ -6,6 +6,7 @@ import 'pause_play_animation.dart'; import 'skins.dart'; import 'dress_up.dart'; import 'ik_following.dart'; +import 'package:spine_flutter/spine_flutter.dart'; class ExampleSelector extends StatelessWidget { const ExampleSelector({super.key}); @@ -98,7 +99,9 @@ class ExampleSelector extends StatelessWidget { } } -void main() { +void main() async { + WidgetsFlutterBinding.ensureInitialized(); + await initSpineFlutter(); runApp(const MaterialApp( title: "Spine Examples", home: ExampleSelector() diff --git a/spine-flutter/example/pubspec.lock b/spine-flutter/example/pubspec.lock index 79022a62c..0a6e03b6c 100644 --- a/spine-flutter/example/pubspec.lock +++ b/spine-flutter/example/pubspec.lock @@ -95,6 +95,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.0.1" + inject_js: + dependency: transitive + description: + name: inject_js + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.5" lints: dependency: transitive description: @@ -212,6 +226,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.2" + web_ffi: + dependency: transitive + description: + name: web_ffi + url: "https://pub.dartlang.org" + source: hosted + version: "0.7.2" sdks: dart: ">=2.17.6 <3.0.0" flutter: ">=2.11.0" diff --git a/spine-flutter/example/pubspec.yaml b/spine-flutter/example/pubspec.yaml index d170c5610..d3ef97567 100644 --- a/spine-flutter/example/pubspec.yaml +++ b/spine-flutter/example/pubspec.yaml @@ -45,8 +45,6 @@ dependencies: raw_image_provider: ^0.2.0 dev_dependencies: - flutter_test: - sdk: flutter # The "flutter_lints" package below contains a set of recommended lints to # encourage good coding practices. The lint set provided by the package is diff --git a/spine-flutter/example/web/favicon.png b/spine-flutter/example/web/favicon.png new file mode 100644 index 000000000..8aaa46ac1 Binary files /dev/null and b/spine-flutter/example/web/favicon.png differ diff --git a/spine-flutter/example/web/icons/Icon-192.png b/spine-flutter/example/web/icons/Icon-192.png new file mode 100644 index 000000000..b749bfef0 Binary files /dev/null and b/spine-flutter/example/web/icons/Icon-192.png differ diff --git a/spine-flutter/example/web/icons/Icon-512.png b/spine-flutter/example/web/icons/Icon-512.png new file mode 100644 index 000000000..88cfd48df Binary files /dev/null and b/spine-flutter/example/web/icons/Icon-512.png differ diff --git a/spine-flutter/example/web/icons/Icon-maskable-192.png b/spine-flutter/example/web/icons/Icon-maskable-192.png new file mode 100644 index 000000000..eb9b4d76e Binary files /dev/null and b/spine-flutter/example/web/icons/Icon-maskable-192.png differ diff --git a/spine-flutter/example/web/icons/Icon-maskable-512.png b/spine-flutter/example/web/icons/Icon-maskable-512.png new file mode 100644 index 000000000..d69c56691 Binary files /dev/null and b/spine-flutter/example/web/icons/Icon-maskable-512.png differ diff --git a/spine-flutter/example/web/index.html b/spine-flutter/example/web/index.html new file mode 100644 index 000000000..41b3bc336 --- /dev/null +++ b/spine-flutter/example/web/index.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + example + + + + + + + + + + diff --git a/spine-flutter/example/web/manifest.json b/spine-flutter/example/web/manifest.json new file mode 100644 index 000000000..096edf8fe --- /dev/null +++ b/spine-flutter/example/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "example", + "short_name": "example", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} diff --git a/spine-flutter/lib/ffi_proxy.dart b/spine-flutter/lib/ffi_proxy.dart new file mode 100644 index 000000000..5ff8e34e5 --- /dev/null +++ b/spine-flutter/lib/ffi_proxy.dart @@ -0,0 +1 @@ +export 'dart:ffi' if (dart.library.html) 'package:web_ffi/web_ffi.dart'; \ No newline at end of file diff --git a/spine-flutter/lib/ffi_utf8.dart b/spine-flutter/lib/ffi_utf8.dart new file mode 100644 index 000000000..2af6b78dd --- /dev/null +++ b/spine-flutter/lib/ffi_utf8.dart @@ -0,0 +1,87 @@ +// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:convert'; +import 'ffi_proxy.dart'; +import 'dart:typed_data'; + +/// The contents of a native zero-terminated array of UTF-8 code units. +/// +/// The Utf8 type itself has no functionality, it's only intended to be used +/// through a `Pointer` representing the entire array. This pointer is +/// the equivalent of a char pointer (`const char*`) in C code. +class Utf8 extends Opaque {} + +/// Extension method for converting a`Pointer` to a [String]. +extension Utf8Pointer on Pointer { + /// The number of UTF-8 code units in this zero-terminated UTF-8 string. + /// + /// The UTF-8 code units of the strings are the non-zero code units up to the + /// first zero code unit. + int get length { + _ensureNotNullptr('length'); + final codeUnits = cast(); + return _length(codeUnits); + } + + /// Converts this UTF-8 encoded string to a Dart string. + /// + /// Decodes the UTF-8 code units of this zero-terminated byte array as + /// Unicode code points and creates a Dart string containing those code + /// points. + /// + /// If [length] is provided, zero-termination is ignored and the result can + /// contain NUL characters. + /// + /// If [length] is not provided, the returned string is the string up til + /// but not including the first NUL character. + String toDartString({int? length}) { + _ensureNotNullptr('toDartString'); + final codeUnits = cast(); + if (length != null) { + RangeError.checkNotNegative(length, 'length'); + } else { + length = _length(codeUnits); + } + return utf8.decode(codeUnits.asTypedList(length)); + } + + static int _length(Pointer codeUnits) { + var length = 0; + while (codeUnits[length] != 0) { + length++; + } + return length; + } + + void _ensureNotNullptr(String operation) { + if (this == nullptr) { + throw UnsupportedError( + "Operation '$operation' not allowed on a 'nullptr'."); + } + } +} + +/// Extension method for converting a [String] to a `Pointer`. +extension StringUtf8Pointer on String { + /// Creates a zero-terminated [Utf8] code-unit array from this String. + /// + /// If this [String] contains NUL characters, converting it back to a string + /// using [Utf8Pointer.toDartString] will truncate the result if a length is + /// not passed. + /// + /// Unpaired surrogate code points in this [String] will be encoded as + /// replacement characters (U+FFFD, encoded as the bytes 0xEF 0xBF 0xBD) in + /// the UTF-8 encoded result. See [Utf8Encoder] for details on encoding. + /// + /// Returns an [allocator]-allocated pointer to the result. + Pointer toNativeUtf8(Allocator allocator) { + final units = utf8.encode(this); + final Pointer result = allocator(units.length + 1); + final Uint8List nativeString = result.asTypedList(units.length + 1); + nativeString.setAll(0, units); + nativeString[units.length] = 0; + return result.cast(); + } +} \ No newline at end of file diff --git a/spine-flutter/lib/init.dart b/spine-flutter/lib/init.dart new file mode 100644 index 000000000..93fc9fa7a --- /dev/null +++ b/spine-flutter/lib/init.dart @@ -0,0 +1,28 @@ +import 'dart:io'; +import 'dart:ffi'; +import 'package:ffi/ffi.dart'; + +const String _libName = 'spine_flutter'; +final DynamicLibrary _dylib = () { + if (Platform.isMacOS || Platform.isIOS) { + return DynamicLibrary.open('$_libName.framework/$_libName'); + } + if (Platform.isAndroid || Platform.isLinux) { + return DynamicLibrary.open('lib$_libName.so'); + } + if (Platform.isWindows) { + return DynamicLibrary.open('$_libName.dll'); + } + throw UnsupportedError('Unknown platform: ${Platform.operatingSystem}'); +}(); + +class SpineFlutterFFI { + DynamicLibrary dylib; + Allocator allocator; + + SpineFlutterFFI(this.dylib, this.allocator); +} + +Future initSpineFlutterFFI() async { + return SpineFlutterFFI(_dylib, malloc); +} diff --git a/spine-flutter/lib/init_web.dart b/spine-flutter/lib/init_web.dart new file mode 100644 index 000000000..3a38bf494 --- /dev/null +++ b/spine-flutter/lib/init_web.dart @@ -0,0 +1,77 @@ +import 'package:flutter/services.dart'; +import 'package:inject_js/inject_js.dart' as js; +import 'package:spine_flutter/ffi_utf8.dart'; +import 'package:web_ffi/web_ffi.dart'; +import 'package:web_ffi/web_ffi_modules.dart'; +import 'spine_flutter_bindings_generated.dart'; + +const String _basePath = 'packages/spine_flutter/assets'; +Module? _module; + +class SpineFlutterFFI { + final DynamicLibrary dylib; + final Allocator allocator; + + SpineFlutterFFI(this.dylib, this.allocator); +} + +Future initSpineFlutterFFI() async { + if (_module == null) { + Memory.init(); + + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + registerOpaqueType(); + + await js.importLibrary('$_basePath/libspine_flutter.js'); + String path = 'libspine_flutter.wasm'; + Uint8List wasmBinaries = (await rootBundle.load(path)).buffer.asUint8List(); + _module = await EmscriptenModule.compile(wasmBinaries, 'libspine_flutter'); + } + Module? m = _module; + if (m != null) { + final dylib = DynamicLibrary.fromModule(m); + return SpineFlutterFFI(dylib, dylib.boundMemory); + } else { + throw Exception("Couldn't load libspine-flutter.js/.wasm"); + } +} \ No newline at end of file diff --git a/spine-flutter/lib/spine_flutter.dart b/spine-flutter/lib/spine_flutter.dart index a3f317943..3293b5d46 100644 --- a/spine-flutter/lib/spine_flutter.dart +++ b/spine-flutter/lib/spine_flutter.dart @@ -1,18 +1,30 @@ import 'dart:convert' as convert; -import 'dart:ffi'; import 'dart:io'; import 'dart:typed_data'; import 'dart:ui'; -import 'package:ffi/ffi.dart'; import 'package:flutter/rendering.dart' as rendering; import 'package:flutter/services.dart'; import 'package:http/http.dart' as http; import 'package:path/path.dart' as path; import 'spine_flutter_bindings_generated.dart'; +import 'ffi_proxy.dart'; +import 'ffi_utf8.dart'; export 'spine_widget.dart'; +import 'init.dart' if (dart.library.html) 'init_web.dart'; +import 'package:flutter/foundation.dart' show kIsWeb; + +late SpineFlutterBindings _bindings; +late Allocator _allocator; + +Future initSpineFlutter() async { + final ffi = await initSpineFlutterFFI(); + _bindings = SpineFlutterBindings(ffi.dylib); + _allocator = ffi.allocator; + return; +} int majorVersion() => _bindings.spine_major_version(); @@ -46,7 +58,7 @@ class Vector2 { } class Atlas { - final Pointer _atlas; + final spine_atlas _atlas; final List atlasPages; final List atlasPagePaints; bool _disposed; @@ -56,11 +68,11 @@ class Atlas { static Future _load(String atlasFileName, Future Function(String name) loadFile) async { final atlasBytes = await loadFile(atlasFileName); final atlasData = convert.utf8.decode(atlasBytes); - final atlasDataNative = atlasData.toNativeUtf8(); + final atlasDataNative = atlasData.toNativeUtf8(_allocator); final atlas = _bindings.spine_atlas_load(atlasDataNative.cast()); - malloc.free(atlasDataNative); - if (atlas.ref.error.address != nullptr.address) { - final Pointer error = atlas.ref.error.cast(); + _allocator.free(atlasDataNative); + if (_bindings.spine_atlas_get_error(atlas).address != nullptr.address) { + final Pointer error = _bindings.spine_atlas_get_error(atlas).cast(); final message = error.toDartString(); _bindings.spine_atlas_dispose(atlas); throw Exception("Couldn't load atlas: $message"); @@ -69,8 +81,9 @@ class Atlas { final atlasDir = path.dirname(atlasFileName); List atlasPages = []; List atlasPagePaints = []; - for (int i = 0; i < atlas.ref.numImagePaths; i++) { - final Pointer atlasPageFile = atlas.ref.imagePaths[i].cast(); + final numImagePaths = _bindings.spine_atlas_get_num_image_paths(atlas); + for (int i = 0; i < numImagePaths; i++) { + final Pointer atlasPageFile = _bindings.spine_atlas_get_image_path(atlas, i).cast(); final imagePath = path.join(atlasDir, atlasPageFile.toDartString()); var imageData = await loadFile(imagePath); final Codec codec = await instantiateImageCodec(imageData); @@ -117,30 +130,34 @@ class SkeletonData { SkeletonData._(this._data) : _disposed = false; static SkeletonData fromJson(Atlas atlas, String json) { - final jsonNative = json.toNativeUtf8(); + final jsonNative = json.toNativeUtf8(_allocator); final result = _bindings.spine_skeleton_data_load_json(atlas._atlas, jsonNative.cast()); - malloc.free(jsonNative); - if (result.error.address != nullptr.address) { - final Pointer error = result.error.cast(); + _allocator.free(jsonNative); + if (_bindings.spine_skeleton_data_result_get_error(result).address != nullptr.address) { + final Pointer error = _bindings.spine_skeleton_data_result_get_error(result).cast(); final message = error.toDartString(); - malloc.free(error); + _bindings.spine_skeleton_data_result_dispose(result); throw Exception("Couldn't load skeleton data: $message"); } - return SkeletonData._(result.skeletonData); + var data = SkeletonData._(_bindings.spine_skeleton_data_result_get_data(result)); + _bindings.spine_skeleton_data_result_dispose(result); + return data; } static SkeletonData fromBinary(Atlas atlas, Uint8List binary) { - final Pointer binaryNative = malloc.allocate(binary.lengthInBytes); + final Pointer binaryNative = _allocator.allocate(binary.lengthInBytes); binaryNative.asTypedList(binary.lengthInBytes).setAll(0, binary); final result = _bindings.spine_skeleton_data_load_binary(atlas._atlas, binaryNative.cast(), binary.lengthInBytes); - malloc.free(binaryNative); - if (result.error.address != nullptr.address) { - final Pointer error = result.error.cast(); + _allocator.free(binaryNative); + if (_bindings.spine_skeleton_data_result_get_error(result).address != nullptr.address) { + final Pointer error = _bindings.spine_skeleton_data_result_get_error(result).cast(); final message = error.toDartString(); - malloc.free(error); + _bindings.spine_skeleton_data_result_dispose(result); throw Exception("Couldn't load skeleton data: $message"); } - return SkeletonData._(result.skeletonData); + var data = SkeletonData._(_bindings.spine_skeleton_data_result_get_data(result)); + _bindings.spine_skeleton_data_result_dispose(result); + return data; } static Future fromAsset(AssetBundle assetBundle, Atlas atlas, String skeletonFile) async { @@ -169,18 +186,18 @@ class SkeletonData { /// Finds a bone by comparing each bone's name. It is more efficient to cache the results of this method than to call it multiple times. BoneData? findBone(String name) { - final nativeName = name.toNativeUtf8(); + final nativeName = name.toNativeUtf8(_allocator); final bone = _bindings.spine_skeleton_data_find_bone(_data, nativeName.cast()); - malloc.free(nativeName); + _allocator.free(nativeName); if (bone.address == nullptr.address) return null; return BoneData._(bone); } /// Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it multiple times. SlotData? findSlot(String name) { - final nativeName = name.toNativeUtf8(); + final nativeName = name.toNativeUtf8(_allocator); final slot = _bindings.spine_skeleton_data_find_slot(_data, nativeName.cast()); - malloc.free(nativeName); + _allocator.free(nativeName); if (slot.address == nullptr.address) return null; return SlotData._(slot); } @@ -188,9 +205,9 @@ class SkeletonData { /// Finds a skin by comparing each skin's name. It is more efficient to cache the results of this method than to call it /// multiple times. Skin? findSkin(String name) { - final nativeName = name.toNativeUtf8(); + final nativeName = name.toNativeUtf8(_allocator); final skin = _bindings.spine_skeleton_data_find_skin(_data, nativeName.cast()); - malloc.free(nativeName); + _allocator.free(nativeName); if (skin.address == nullptr.address) return null; return Skin._(skin); } @@ -198,9 +215,9 @@ class SkeletonData { /// Finds an event by comparing each events's name. It is more efficient to cache the results of this method than to call it /// multiple times. EventData? findEvent(String name) { - final nativeName = name.toNativeUtf8(); + final nativeName = name.toNativeUtf8(_allocator); final event = _bindings.spine_skeleton_data_find_event(_data, nativeName.cast()); - malloc.free(nativeName); + _allocator.free(nativeName); if (event.address == nullptr.address) return null; return EventData._(event); } @@ -208,9 +225,9 @@ class SkeletonData { /// Finds an animation by comparing each animation's name. It is more efficient to cache the results of this method than to /// call it multiple times. Animation? findAnimation(String name) { - final nativeName = name.toNativeUtf8(); + final nativeName = name.toNativeUtf8(_allocator); final animation = _bindings.spine_skeleton_data_find_animation(_data, nativeName.cast()); - malloc.free(nativeName); + _allocator.free(nativeName); if (animation.address == nullptr.address) return null; return Animation._(animation); } @@ -218,9 +235,9 @@ class SkeletonData { /// Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method /// than to call it multiple times. IkConstraintData? findIkConstraint(String name) { - final nativeName = name.toNativeUtf8(); + final nativeName = name.toNativeUtf8(_allocator); final constraint = _bindings.spine_skeleton_data_find_ik_constraint(_data, nativeName.cast()); - malloc.free(nativeName); + _allocator.free(nativeName); if (constraint.address == nullptr.address) return null; return IkConstraintData._(constraint); } @@ -228,9 +245,9 @@ class SkeletonData { /// Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of /// this method than to call it multiple times. TransformConstraintData? findTransformConstraint(String name) { - final nativeName = name.toNativeUtf8(); + final nativeName = name.toNativeUtf8(_allocator); final constraint = _bindings.spine_skeleton_data_find_transform_constraint(_data, nativeName.cast()); - malloc.free(nativeName); + _allocator.free(nativeName); if (constraint.address == nullptr.address) return null; return TransformConstraintData._(constraint); } @@ -238,9 +255,9 @@ class SkeletonData { /// Finds a path constraint by comparing each path constraint's name. It is more efficient to cache the results of this method /// than to call it multiple times. PathConstraintData? findPathConstraint(String name) { - final nativeName = name.toNativeUtf8(); + final nativeName = name.toNativeUtf8(_allocator); final constraint = _bindings.spine_skeleton_data_find_path_constraint(_data, nativeName.cast()); - malloc.free(nativeName); + _allocator.free(nativeName); if (constraint.address == nullptr.address) return null; return PathConstraintData._(constraint); } @@ -588,7 +605,11 @@ class BoneData { Color getColor() { final color = _bindings.spine_bone_data_get_color(_data); - return Color(color.r, color.g, color.b, color.a); + return Color( + _bindings.spine_color_get_r(color), + _bindings.spine_color_get_g(color), + _bindings.spine_color_get_b(color), + _bindings.spine_color_get_a(color)); } void setColor(double r, double g, double b, double a) { @@ -633,12 +654,16 @@ class Bone { Vector2 worldToLocal(double worldX, double worldY) { final local = _bindings.spine_bone_world_to_local(_bone, worldX, worldY); - return Vector2(local.x, local.y); + final result = Vector2(_bindings.spine_vector_get_x(local), _bindings.spine_vector_get_y(local)); + _allocator.free(local); + return result; } Vector2 localToWorld(double localX, double localY) { final world = _bindings.spine_bone_local_to_world(_bone, localX, localY); - return Vector2(world.x, world.y); + final result = Vector2(_bindings.spine_vector_get_x(world), _bindings.spine_vector_get_y(world)); + _allocator.free(world); + return result; } double worldToLocalRotation(double worldRotation) { @@ -890,7 +915,11 @@ class SlotData { Color getColor() { final color = _bindings.spine_slot_data_get_color(_data); - return Color(color.r, color.g, color.b, color.a); + return Color( + _bindings.spine_color_get_r(color), + _bindings.spine_color_get_g(color), + _bindings.spine_color_get_b(color), + _bindings.spine_color_get_a(color)); } void setColor(double r, double g, double b, double a) { @@ -899,7 +928,11 @@ class SlotData { Color getDarkColor() { final color = _bindings.spine_slot_data_get_dark_color(_data); - return Color(color.r, color.g, color.b, color.a); + return Color( + _bindings.spine_color_get_r(color), + _bindings.spine_color_get_g(color), + _bindings.spine_color_get_b(color), + _bindings.spine_color_get_a(color)); } void setDarkColor(double r, double g, double b, double a) { @@ -920,9 +953,9 @@ class SlotData { } void setAttachmentName(String attachmentName) { - final nativeName = attachmentName.toNativeUtf8(); + final nativeName = attachmentName.toNativeUtf8(_allocator); _bindings.spine_slot_data_set_attachment_name(_data, nativeName.cast()); - malloc.free(nativeName); + _allocator.free(nativeName); } BlendMode getBlendMode() { @@ -962,7 +995,11 @@ class Slot { Color getColor() { final color = _bindings.spine_slot_get_color(_slot); - return Color(color.r, color.g, color.b, color.a); + return Color( + _bindings.spine_color_get_r(color), + _bindings.spine_color_get_g(color), + _bindings.spine_color_get_b(color), + _bindings.spine_color_get_a(color)); } void setColor(Color color) { @@ -971,7 +1008,11 @@ class Slot { Color getDarkColor() { final color = _bindings.spine_slot_get_dark_color(_slot); - return Color(color.r, color.g, color.b, color.a); + return Color( + _bindings.spine_color_get_r(color), + _bindings.spine_color_get_g(color), + _bindings.spine_color_get_b(color), + _bindings.spine_color_get_a(color)); } void setDarkColor(Color color) { @@ -1118,11 +1159,11 @@ class Sequence { } String getPath(String basePath, int index) { - final nativeBasePath = basePath.toNativeUtf8(); + final nativeBasePath = basePath.toNativeUtf8(_allocator); final Pointer path = _bindings.spine_sequence_get_path(_sequence, nativeBasePath.cast(), index).cast(); final result = path.toDartString(); - malloc.free(nativeBasePath); - malloc.free(path); + _allocator.free(nativeBasePath); + _allocator.free(path); return result; } @@ -1228,10 +1269,10 @@ class RegionAttachment extends Attachment { RegionAttachment._(spine_region_attachment attachment) : super._(attachment); List computeWorldVertices(Slot slot) { - Pointer vertices = malloc.allocate(4 * 8).cast(); + Pointer vertices = _allocator.allocate(4 * 8).cast(); _bindings.spine_region_attachment_compute_world_vertices(_attachment, slot._slot, vertices); final result = vertices.asTypedList(8).toList(); - malloc.free(vertices); + _allocator.free(vertices); return result; } @@ -1293,7 +1334,11 @@ class RegionAttachment extends Attachment { Color getColor() { final color = _bindings.spine_region_attachment_get_color(_attachment); - return Color(color.r, color.g, color.b, color.a); + return Color( + _bindings.spine_color_get_r(color), + _bindings.spine_color_get_g(color), + _bindings.spine_color_get_b(color), + _bindings.spine_color_get_a(color)); } void setColor(double r, double g, double b, double a) { @@ -1335,10 +1380,10 @@ class VertexAttachment extends Attachment { List computeWorldVertices(Slot slot) { final worldVerticesLength = _bindings.spine_vertex_attachment_get_world_vertices_length(_attachment.cast()); - Pointer vertices = malloc.allocate(4 * worldVerticesLength).cast(); + Pointer vertices = _allocator.allocate(4 * worldVerticesLength).cast(); _bindings.spine_vertex_attachment_compute_world_vertices(_attachment.cast(), slot._slot, vertices); final result = vertices.asTypedList(worldVerticesLength).toList(); - malloc.free(vertices); + _allocator.free(vertices); return result; } @@ -1401,7 +1446,11 @@ class MeshAttachment extends VertexAttachment { Color getColor() { final color = _bindings.spine_mesh_attachment_get_color(_attachment); - return Color(color.r, color.g, color.b, color.a); + return Color( + _bindings.spine_color_get_r(color), + _bindings.spine_color_get_g(color), + _bindings.spine_color_get_b(color), + _bindings.spine_color_get_a(color)); } void setColor(double r, double g, double b, double a) { @@ -1473,7 +1522,11 @@ class ClippingAttachment extends VertexAttachment { Color getColor() { final color = _bindings.spine_clipping_attachment_get_color(_attachment); - return Color(color.r, color.g, color.b, color.a); + return Color( + _bindings.spine_color_get_r(color), + _bindings.spine_color_get_g(color), + _bindings.spine_color_get_b(color), + _bindings.spine_color_get_a(color)); } void setColor(double r, double g, double b, double a) { @@ -1486,7 +1539,11 @@ class BoundingBoxAttachment extends VertexAttachment { Color getColor() { final color = _bindings.spine_path_attachment_get_color(_attachment); - return Color(color.r, color.g, color.b, color.a); + return Color( + _bindings.spine_color_get_r(color), + _bindings.spine_color_get_g(color), + _bindings.spine_color_get_b(color), + _bindings.spine_color_get_a(color)); } void setColor(double r, double g, double b, double a) { @@ -1534,7 +1595,9 @@ class PointAttachment extends Attachment { Vector2 computeWorldPosition(Bone bone) { final position = _bindings.spine_point_attachment_compute_world_position(_attachment, bone._bone); - return Vector2(position.x, position.y); + final result = Vector2(_bindings.spine_vector_get_x(position), _bindings.spine_vector_get_y(position)); + _allocator.free(position); + return result; } double computeWorldRotation(Bone bone) { @@ -1567,7 +1630,11 @@ class PointAttachment extends Attachment { Color getColor() { final color = _bindings.spine_point_attachment_get_color(_attachment); - return Color(color.r, color.g, color.b, color.a); + return Color( + _bindings.spine_color_get_r(color), + _bindings.spine_color_get_g(color), + _bindings.spine_color_get_b(color), + _bindings.spine_color_get_a(color)); } void setColor(double r, double g, double b, double a) { @@ -1590,9 +1657,9 @@ class Skin { Skin._(this._skin) : _isCustomSkin = false; Skin.new(String name) { - final nativeName = name.toNativeUtf8(); + final nativeName = name.toNativeUtf8(_allocator); _skin = _bindings.spine_skin_create(nativeName.cast()); - malloc.free(nativeName); + _allocator.free(nativeName); _isCustomSkin = true; } @@ -1602,24 +1669,24 @@ class Skin { } void setAttachment(int slotIndex, String name, Attachment? attachment) { - final nativeName = name.toNativeUtf8(); + final nativeName = name.toNativeUtf8(_allocator); _bindings.spine_skin_set_attachment( _skin, slotIndex, nativeName.cast(), attachment == null ? nullptr : attachment._attachment.cast()); - malloc.free(nativeName); + _allocator.free(nativeName); } Attachment? getAttachment(int slotIndex, String name) { - final nativeName = name.toNativeUtf8(); + final nativeName = name.toNativeUtf8(_allocator); final attachment = _bindings.spine_skin_get_attachment(_skin, slotIndex, nativeName.cast()); - malloc.free(nativeName); + _allocator.free(nativeName); if (attachment.address == nullptr.address) return null; return Attachment._toSubclass(attachment); } void removeAttachment(int slotIndex, String name) { - final nativeName = name.toNativeUtf8(); + final nativeName = name.toNativeUtf8(_allocator); _bindings.spine_skin_remove_attachment(_skin, slotIndex, nativeName.cast()); - malloc.free(nativeName); + _allocator.free(nativeName); } String getName() { @@ -1634,12 +1701,12 @@ class Skin { List getEntries() { List result = []; final entries = _bindings.spine_skin_get_entries(_skin); - int numEntries = entries.ref.numEntries; + int numEntries = _bindings.spine_skin_entries_get_num_entries(entries); for (int i = 0; i < numEntries; i++) { - final entry = entries.ref.entries[i]; - Pointer name = entry.name.cast(); - result.add(SkinEntry(entry.slotIndex, name.toDartString(), - entry.attachment.address == nullptr.address ? null : Attachment._toSubclass(entry.attachment))); + final entry = _bindings.spine_skin_entries_get_entry(entries, i); + Pointer name = _bindings.spine_skin_entry_get_name(entry).cast(); + result.add(SkinEntry(_bindings.spine_skin_entry_get_slot_index(entry), name.toDartString(), + _bindings.spine_skin_entry_get_attachment(entry).address == nullptr.address ? null : Attachment._toSubclass(_bindings.spine_skin_entry_get_attachment(entry)))); } return result; } @@ -2297,17 +2364,17 @@ class Skeleton { } Bone? findBone(String boneName) { - final nameNative = boneName.toNativeUtf8(); + final nameNative = boneName.toNativeUtf8(_allocator); final bone = _bindings.spine_skeleton_find_bone(_skeleton, nameNative.cast()); - malloc.free(nameNative); + _allocator.free(nameNative); if (bone.address == nullptr.address) return null; return Bone._(bone); } Slot? findSlot(String slotName) { - final nameNative = slotName.toNativeUtf8(); + final nameNative = slotName.toNativeUtf8(_allocator); final slot = _bindings.spine_skeleton_find_slot(_skeleton, nameNative.cast()); - malloc.free(nameNative); + _allocator.free(nameNative); if (slot.address == nullptr.address) return null; return Slot._(slot); } @@ -2320,9 +2387,9 @@ class Skeleton { /// skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin. /// @param skinName May be NULL. void setSkinByName(String skinName) { - final nameNative = skinName.toNativeUtf8(); + final nameNative = skinName.toNativeUtf8(_allocator); _bindings.spine_skeleton_set_skin_by_name(_skeleton, nameNative.cast()); - malloc.free(nameNative); + _allocator.free(nameNative); } void setSkin(Skin skin) { @@ -2330,52 +2397,52 @@ class Skeleton { } Attachment? getAttachmentByName(String slotName, String attachmentName) { - final slotNameNative = slotName.toNativeUtf8(); - final attachmentNameNative = attachmentName.toNativeUtf8(); + final slotNameNative = slotName.toNativeUtf8(_allocator); + final attachmentNameNative = attachmentName.toNativeUtf8(_allocator); final attachment = _bindings.spine_skeleton_get_attachment_by_name(_skeleton, slotNameNative.cast(), attachmentNameNative.cast()); - malloc.free(slotNameNative); - malloc.free(attachmentNameNative); + _allocator.free(slotNameNative); + _allocator.free(attachmentNameNative); if (attachment.address == nullptr.address) return null; return Attachment._toSubclass(attachment); } Attachment? getAttachment(int slotIndex, String attachmentName) { - final attachmentNameNative = attachmentName.toNativeUtf8(); + final attachmentNameNative = attachmentName.toNativeUtf8(_allocator); final attachment = _bindings.spine_skeleton_get_attachment(_skeleton, slotIndex, attachmentNameNative.cast()); - malloc.free(attachmentNameNative); + _allocator.free(attachmentNameNative); if (attachment.address == nullptr.address) return null; return Attachment._toSubclass(attachment); } void setAttachment(String slotName, String attachmentName) { - final slotNameNative = slotName.toNativeUtf8(); - final attachmentNameNative = attachmentName.toNativeUtf8(); + final slotNameNative = slotName.toNativeUtf8(_allocator); + final attachmentNameNative = attachmentName.toNativeUtf8(_allocator); _bindings.spine_skeleton_set_attachment(_skeleton, slotNameNative.cast(), attachmentNameNative.cast()); - malloc.free(slotNameNative); - malloc.free(attachmentNameNative); + _allocator.free(slotNameNative); + _allocator.free(attachmentNameNative); } IkConstraint? findIkConstraint(String constraintName) { - final nameNative = constraintName.toNativeUtf8(); + final nameNative = constraintName.toNativeUtf8(_allocator); final constraint = _bindings.spine_skeleton_find_ik_constraint(_skeleton, nameNative.cast()); - malloc.free(nameNative); + _allocator.free(nameNative); if (constraint.address == nullptr.address) return null; return IkConstraint._(constraint); } TransformConstraint? findTransformConstraint(String constraintName) { - final nameNative = constraintName.toNativeUtf8(); + final nameNative = constraintName.toNativeUtf8(_allocator); final constraint = _bindings.spine_skeleton_find_transform_constraint(_skeleton, nameNative.cast()); - malloc.free(nameNative); + _allocator.free(nameNative); if (constraint.address == nullptr.address) return null; return TransformConstraint._(constraint); } PathConstraint? findPathConstraint(String constraintName) { - final nameNative = constraintName.toNativeUtf8(); + final nameNative = constraintName.toNativeUtf8(_allocator); final constraint = _bindings.spine_skeleton_find_path_constraint(_skeleton, nameNative.cast()); - malloc.free(nameNative); + _allocator.free(nameNative); if (constraint.address == nullptr.address) return null; return PathConstraint._(constraint); } @@ -2388,7 +2455,13 @@ class Skeleton { /// @param outVertexBuffer Reference to hold a Vector of floats. This method will assign it with new floats as needed. Bounds getBounds() { final nativeBounds = _bindings.spine_skeleton_get_bounds(_skeleton); - return Bounds(nativeBounds.x, nativeBounds.y, nativeBounds.width, nativeBounds.height); + final bounds = Bounds( + _bindings.spine_bounds_get_x(nativeBounds), + _bindings.spine_bounds_get_y(nativeBounds), + _bindings.spine_bounds_get_width(nativeBounds), + _bindings.spine_bounds_get_height(nativeBounds)); + _allocator.free(nativeBounds); + return bounds; } Bone? getRootBone() { @@ -2471,7 +2544,11 @@ class Skeleton { Color getColor() { final color = _bindings.spine_skeleton_get_color(_skeleton); - return Color(color.r, color.g, color.b, color.a); + return Color( + _bindings.spine_color_get_r(color), + _bindings.spine_color_get_g(color), + _bindings.spine_color_get_b(color), + _bindings.spine_color_get_a(color)); } void setColor(Color color) { @@ -2848,9 +2925,9 @@ class EventData { } void setStringValue(String value) { - final nativeString = value.toNativeUtf8(); + final nativeString = value.toNativeUtf8(_allocator); _bindings.spine_event_data_set_string_value(_data, nativeString.cast()); - malloc.free(nativeString); + _allocator.free(nativeString); } String getAudioPath() { @@ -2910,9 +2987,9 @@ class Event { } void setStringValue(String value) { - final nativeString = value.toNativeUtf8(); + final nativeString = value.toNativeUtf8(_allocator); _bindings.spine_event_set_string_value(_event, nativeString.cast()); - malloc.free(nativeString); + _allocator.free(nativeString); } double getVolume() { @@ -2952,19 +3029,19 @@ class AnimationStateData { } void setMixByName(String fromName, String toName, double duration) { - final fromNative = fromName.toNativeUtf8(); - final toNative = toName.toNativeUtf8(); + final fromNative = fromName.toNativeUtf8(_allocator); + final toNative = toName.toNativeUtf8(_allocator); _bindings.spine_animation_state_data_set_mix_by_name(_data, fromNative.cast(), toNative.cast(), duration); - malloc.free(fromNative); - malloc.free(toNative); + _allocator.free(fromNative); + _allocator.free(toNative); } double getMixByName(String fromName, String toName) { - final fromNative = fromName.toNativeUtf8(); - final toNative = toName.toNativeUtf8(); + final fromNative = fromName.toNativeUtf8(_allocator); + final toNative = toName.toNativeUtf8(_allocator); final duration = _bindings.spine_animation_state_data_get_mix_by_name(_data, fromNative.cast(), toNative.cast()); - malloc.free(fromNative); - malloc.free(toNative); + _allocator.free(fromNative); + _allocator.free(toNative); return duration; } @@ -3072,10 +3149,10 @@ class AnimationState { /// A track entry to allow further customization of animation playback. References to the track entry must not be kept /// after AnimationState.Dispose. TrackEntry setAnimationByName(int trackIndex, String animationName, bool loop) { - final animation = animationName.toNativeUtf8(); + final animation = animationName.toNativeUtf8(_allocator); final entry = _bindings.spine_animation_state_set_animation_by_name(_state, trackIndex, animation.cast(), loop ? -1 : 0); - malloc.free(animation); + _allocator.free(animation); if (entry.address == nullptr.address) throw Exception("Couldn't set animation $animationName"); return TrackEntry._(entry, this); } @@ -3096,10 +3173,10 @@ class AnimationState { /// @return A track entry to allow further customization of animation playback. References to the track entry must not be kept /// after AnimationState.Dispose TrackEntry addAnimationByName(int trackIndex, String animationName, bool loop, double delay) { - final animation = animationName.toNativeUtf8(); + final animation = animationName.toNativeUtf8(_allocator); final entry = _bindings.spine_animation_state_add_animation_by_name( _state, trackIndex, animation.cast(), loop ? -1 : 0, delay); - malloc.free(animation); + _allocator.free(animation); if (entry.address == nullptr.address) throw Exception("Couldn't add animation $animationName"); return TrackEntry._(entry, this); } @@ -3167,7 +3244,7 @@ class AnimationState { class SkeletonDrawable { final Atlas atlas; final SkeletonData skeletonData; - late final Pointer _drawable; + late final spine_skeleton_drawable _drawable; late final Skeleton skeleton; late final AnimationStateData animationStateData; late final AnimationState animationState; @@ -3176,12 +3253,11 @@ class SkeletonDrawable { SkeletonDrawable(this.atlas, this.skeletonData, this._ownsAtlasAndSkeletonData) : _disposed = false { _drawable = _bindings.spine_skeleton_drawable_create(skeletonData._data); - skeleton = Skeleton._(_drawable.ref.skeleton); - animationStateData = AnimationStateData._(_drawable.ref.animationStateData); - animationState = AnimationState._(_drawable.ref.animationState, _drawable.ref.animationStateEvents); + skeleton = Skeleton._(_bindings.spine_skeleton_drawable_get_skeleton(_drawable)); + animationStateData = AnimationStateData._(_bindings.spine_skeleton_drawable_get_animation_state_data(_drawable)); + animationState = AnimationState._(_bindings.spine_skeleton_drawable_get_animation_state(_drawable), _bindings.spine_skeleton_drawable_get_animation_state_events(_drawable)); } - static Future fromAsset(String skeletonFile, String atlasFile) async { var atlas = await Atlas.fromAsset(rootBundle, atlasFile); var skeletonData = await SkeletonData.fromAsset(rootBundle, atlas, skeletonFile); @@ -3209,12 +3285,12 @@ class SkeletonDrawable { List render() { if (_disposed) return []; - Pointer nativeCmd = _bindings.spine_skeleton_drawable_render(_drawable); + spine_render_command nativeCmd = _bindings.spine_skeleton_drawable_render(_drawable); List commands = []; while (nativeCmd.address != nullptr.address) { - final atlasPage = atlas.atlasPages[nativeCmd.ref.atlasPage]; + final atlasPage = atlas.atlasPages[_bindings.spine_render_command_get_atlas_page(nativeCmd)]; commands.add(RenderCommand._(nativeCmd, atlasPage.width.toDouble(), atlasPage.height.toDouble())); - nativeCmd = nativeCmd.ref.next; + nativeCmd = _bindings.spine_render_command_get_next(nativeCmd); } return commands; } @@ -3242,40 +3318,38 @@ class RenderCommand { late final Vertices vertices; late final int atlasPageIndex; - RenderCommand._(Pointer nativeCmd, double pageWidth, double pageHeight) { - atlasPageIndex = nativeCmd.ref.atlasPage; - int numVertices = nativeCmd.ref.numVertices; - int numIndices = nativeCmd.ref.numIndices; - final positions = nativeCmd.ref.positions.asTypedList(numVertices * 2); - final uvs = nativeCmd.ref.uvs.asTypedList(numVertices * 2); + RenderCommand._(spine_render_command nativeCmd, double pageWidth, double pageHeight) { + atlasPageIndex = _bindings.spine_render_command_get_atlas_page(nativeCmd); + int numVertices = _bindings.spine_render_command_get_num_vertices(nativeCmd); + int numIndices = _bindings.spine_render_command_get_num_indices(nativeCmd); + final positions = _bindings.spine_render_command_get_positions(nativeCmd).asTypedList(numVertices * 2); + final uvs = _bindings.spine_render_command_get_uvs(nativeCmd).asTypedList(numVertices * 2); for (int i = 0; i < numVertices * 2; i += 2) { uvs[i] *= pageWidth; uvs[i + 1] *= pageHeight; } - // We pass the native data as views directly to Vertices.raw. According to the sources, the data - // is copied, so it doesn't matter that we free up the underlying memory on the next - // render call. See the implementation of Vertices.raw() here: - // https://github.com/flutter/engine/blob/5c60785b802ad2c8b8899608d949342d5c624952/lib/ui/painting/vertices.cc#L21 - vertices = Vertices.raw(VertexMode.triangles, positions, - textureCoordinates: uvs, - colors: nativeCmd.ref.colors.asTypedList(numVertices), - indices: nativeCmd.ref.indices.asTypedList(numIndices)); - } -} + final colors = _bindings.spine_render_command_get_colors(nativeCmd).asTypedList(numVertices); + final indices = _bindings.spine_render_command_get_indices(nativeCmd).asTypedList(numIndices); -const String _libName = 'spine_flutter'; - -final DynamicLibrary _dylib = () { - if (Platform.isMacOS || Platform.isIOS) { - return DynamicLibrary.open('$_libName.framework/$_libName'); + if (!kIsWeb) { + // We pass the native data as views directly to Vertices.raw. According to the sources, the data + // is copied, so it doesn't matter that we free up the underlying memory on the next + // render call. See the implementation of Vertices.raw() here: + // https://github.com/flutter/engine/blob/5c60785b802ad2c8b8899608d949342d5c624952/lib/ui/painting/vertices.cc#L21 + vertices = Vertices.raw(VertexMode.triangles, positions, + textureCoordinates: uvs, + colors: _bindings.spine_render_command_get_colors(nativeCmd).asTypedList(numVertices), + indices: _bindings.spine_render_command_get_indices(nativeCmd).asTypedList(numIndices)); + } else { + // On the web, rendering is done through CanvasKit, which requires copies of the native data. + final positionsCopy = Float32List.fromList(positions); + final uvsCopy = Float32List.fromList(uvs); + final colorsCopy = Int32List.fromList(colors); + final indicesCopy = Uint16List.fromList(indices); + vertices = Vertices.raw(VertexMode.triangles, positionsCopy, + textureCoordinates: uvsCopy, + colors: colorsCopy, + indices: indicesCopy); + } } - if (Platform.isAndroid || Platform.isLinux) { - return DynamicLibrary.open('lib$_libName.so'); - } - if (Platform.isWindows) { - return DynamicLibrary.open('$_libName.dll'); - } - throw UnsupportedError('Unknown platform: ${Platform.operatingSystem}'); -}(); - -final SpineFlutterBindings _bindings = SpineFlutterBindings(_dylib); +} \ No newline at end of file diff --git a/spine-flutter/lib/spine_flutter_bindings_generated.dart b/spine-flutter/lib/spine_flutter_bindings_generated.dart index 23a7a0a24..bbabff38c 100644 --- a/spine-flutter/lib/spine_flutter_bindings_generated.dart +++ b/spine-flutter/lib/spine_flutter_bindings_generated.dart @@ -5,7 +5,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. -import 'dart:ffi' as ffi; +import 'ffi_proxy.dart' as ffi; /// Bindings for `src/spine_flutter.h`. /// @@ -31,7 +31,7 @@ class SpineFlutterBindings { } late final _spine_major_versionPtr = - _lookup>('spine_major_version'); + _lookup>('spine_major_version'); late final _spine_major_version = _spine_major_versionPtr.asFunction(); @@ -40,7 +40,7 @@ class SpineFlutterBindings { } late final _spine_minor_versionPtr = - _lookup>('spine_minor_version'); + _lookup>('spine_minor_version'); late final _spine_minor_version = _spine_minor_versionPtr.asFunction(); @@ -53,23 +53,208 @@ class SpineFlutterBindings { late final _spine_report_leaks = _spine_report_leaksPtr.asFunction(); - ffi.Pointer spine_atlas_load( - ffi.Pointer atlasData, + double spine_color_get_r( + spine_color color, + ) { + return _spine_color_get_r( + color, + ); + } + + late final _spine_color_get_rPtr = + _lookup>( + 'spine_color_get_r'); + late final _spine_color_get_r = + _spine_color_get_rPtr.asFunction(); + + double spine_color_get_g( + spine_color color, + ) { + return _spine_color_get_g( + color, + ); + } + + late final _spine_color_get_gPtr = + _lookup>( + 'spine_color_get_g'); + late final _spine_color_get_g = + _spine_color_get_gPtr.asFunction(); + + double spine_color_get_b( + spine_color color, + ) { + return _spine_color_get_b( + color, + ); + } + + late final _spine_color_get_bPtr = + _lookup>( + 'spine_color_get_b'); + late final _spine_color_get_b = + _spine_color_get_bPtr.asFunction(); + + double spine_color_get_a( + spine_color color, + ) { + return _spine_color_get_a( + color, + ); + } + + late final _spine_color_get_aPtr = + _lookup>( + 'spine_color_get_a'); + late final _spine_color_get_a = + _spine_color_get_aPtr.asFunction(); + + double spine_bounds_get_x( + spine_bounds bounds, + ) { + return _spine_bounds_get_x( + bounds, + ); + } + + late final _spine_bounds_get_xPtr = + _lookup>( + 'spine_bounds_get_x'); + late final _spine_bounds_get_x = + _spine_bounds_get_xPtr.asFunction(); + + double spine_bounds_get_y( + spine_bounds bounds, + ) { + return _spine_bounds_get_y( + bounds, + ); + } + + late final _spine_bounds_get_yPtr = + _lookup>( + 'spine_bounds_get_y'); + late final _spine_bounds_get_y = + _spine_bounds_get_yPtr.asFunction(); + + double spine_bounds_get_width( + spine_bounds bounds, + ) { + return _spine_bounds_get_width( + bounds, + ); + } + + late final _spine_bounds_get_widthPtr = + _lookup>( + 'spine_bounds_get_width'); + late final _spine_bounds_get_width = + _spine_bounds_get_widthPtr.asFunction(); + + double spine_bounds_get_height( + spine_bounds bounds, + ) { + return _spine_bounds_get_height( + bounds, + ); + } + + late final _spine_bounds_get_heightPtr = + _lookup>( + 'spine_bounds_get_height'); + late final _spine_bounds_get_height = + _spine_bounds_get_heightPtr.asFunction(); + + double spine_vector_get_x( + spine_vector vector, + ) { + return _spine_vector_get_x( + vector, + ); + } + + late final _spine_vector_get_xPtr = + _lookup>( + 'spine_vector_get_x'); + late final _spine_vector_get_x = + _spine_vector_get_xPtr.asFunction(); + + double spine_vector_get_y( + spine_vector vector, + ) { + return _spine_vector_get_y( + vector, + ); + } + + late final _spine_vector_get_yPtr = + _lookup>( + 'spine_vector_get_y'); + late final _spine_vector_get_y = + _spine_vector_get_yPtr.asFunction(); + + spine_atlas spine_atlas_load( + ffi.Pointer atlasData, ) { return _spine_atlas_load( atlasData, ); } - late final _spine_atlas_loadPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('spine_atlas_load'); + late final _spine_atlas_loadPtr = + _lookup)>>( + 'spine_atlas_load'); late final _spine_atlas_load = _spine_atlas_loadPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction)>(); + + int spine_atlas_get_num_image_paths( + spine_atlas atlas, + ) { + return _spine_atlas_get_num_image_paths( + atlas, + ); + } + + late final _spine_atlas_get_num_image_pathsPtr = + _lookup>( + 'spine_atlas_get_num_image_paths'); + late final _spine_atlas_get_num_image_paths = + _spine_atlas_get_num_image_pathsPtr + .asFunction(); + + ffi.Pointer spine_atlas_get_image_path( + spine_atlas atlas, + int index, + ) { + return _spine_atlas_get_image_path( + atlas, + index, + ); + } + + late final _spine_atlas_get_image_pathPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + spine_atlas, ffi.Int32)>>('spine_atlas_get_image_path'); + late final _spine_atlas_get_image_path = _spine_atlas_get_image_pathPtr + .asFunction Function(spine_atlas, int)>(); + + ffi.Pointer spine_atlas_get_error( + spine_atlas atlas, + ) { + return _spine_atlas_get_error( + atlas, + ); + } + + late final _spine_atlas_get_errorPtr = + _lookup Function(spine_atlas)>>( + 'spine_atlas_get_error'); + late final _spine_atlas_get_error = _spine_atlas_get_errorPtr + .asFunction Function(spine_atlas)>(); void spine_atlas_dispose( - ffi.Pointer atlas, + spine_atlas atlas, ) { return _spine_atlas_dispose( atlas, @@ -77,14 +262,14 @@ class SpineFlutterBindings { } late final _spine_atlas_disposePtr = - _lookup)>>( + _lookup>( 'spine_atlas_dispose'); - late final _spine_atlas_dispose = _spine_atlas_disposePtr - .asFunction)>(); + late final _spine_atlas_dispose = + _spine_atlas_disposePtr.asFunction(); spine_skeleton_data_result spine_skeleton_data_load_json( - ffi.Pointer atlas, - ffi.Pointer skeletonData, + spine_atlas atlas, + ffi.Pointer skeletonData, ) { return _spine_skeleton_data_load_json( atlas, @@ -94,16 +279,16 @@ class SpineFlutterBindings { late final _spine_skeleton_data_load_jsonPtr = _lookup< ffi.NativeFunction< - spine_skeleton_data_result Function(ffi.Pointer, - ffi.Pointer)>>('spine_skeleton_data_load_json'); + spine_skeleton_data_result Function(spine_atlas, + ffi.Pointer)>>('spine_skeleton_data_load_json'); late final _spine_skeleton_data_load_json = _spine_skeleton_data_load_jsonPtr.asFunction< spine_skeleton_data_result Function( - ffi.Pointer, ffi.Pointer)>(); + spine_atlas, ffi.Pointer)>(); spine_skeleton_data_result spine_skeleton_data_load_binary( - ffi.Pointer atlas, - ffi.Pointer skeletonData, + spine_atlas atlas, + ffi.Pointer skeletonData, int length, ) { return _spine_skeleton_data_load_binary( @@ -116,17 +301,64 @@ class SpineFlutterBindings { late final _spine_skeleton_data_load_binaryPtr = _lookup< ffi.NativeFunction< spine_skeleton_data_result Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int)>>('spine_skeleton_data_load_binary'); + spine_atlas, + ffi.Pointer, + ffi.Int32)>>('spine_skeleton_data_load_binary'); late final _spine_skeleton_data_load_binary = _spine_skeleton_data_load_binaryPtr.asFunction< spine_skeleton_data_result Function( - ffi.Pointer, ffi.Pointer, int)>(); + spine_atlas, ffi.Pointer, int)>(); + + ffi.Pointer spine_skeleton_data_result_get_error( + spine_skeleton_data_result result, + ) { + return _spine_skeleton_data_result_get_error( + result, + ); + } + + late final _spine_skeleton_data_result_get_errorPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(spine_skeleton_data_result)>>( + 'spine_skeleton_data_result_get_error'); + late final _spine_skeleton_data_result_get_error = + _spine_skeleton_data_result_get_errorPtr + .asFunction Function(spine_skeleton_data_result)>(); + + spine_skeleton_data spine_skeleton_data_result_get_data( + spine_skeleton_data_result result, + ) { + return _spine_skeleton_data_result_get_data( + result, + ); + } + + late final _spine_skeleton_data_result_get_dataPtr = _lookup< + ffi.NativeFunction< + spine_skeleton_data Function(spine_skeleton_data_result)>>( + 'spine_skeleton_data_result_get_data'); + late final _spine_skeleton_data_result_get_data = + _spine_skeleton_data_result_get_dataPtr.asFunction< + spine_skeleton_data Function(spine_skeleton_data_result)>(); + + void spine_skeleton_data_result_dispose( + spine_skeleton_data_result result, + ) { + return _spine_skeleton_data_result_dispose( + result, + ); + } + + late final _spine_skeleton_data_result_disposePtr = _lookup< + ffi.NativeFunction>( + 'spine_skeleton_data_result_dispose'); + late final _spine_skeleton_data_result_dispose = + _spine_skeleton_data_result_disposePtr + .asFunction(); spine_bone_data spine_skeleton_data_find_bone( spine_skeleton_data data, - ffi.Pointer name, + ffi.Pointer name, ) { return _spine_skeleton_data_find_bone( data, @@ -137,15 +369,14 @@ class SpineFlutterBindings { late final _spine_skeleton_data_find_bonePtr = _lookup< ffi.NativeFunction< spine_bone_data Function(spine_skeleton_data, - ffi.Pointer)>>('spine_skeleton_data_find_bone'); + ffi.Pointer)>>('spine_skeleton_data_find_bone'); late final _spine_skeleton_data_find_bone = _spine_skeleton_data_find_bonePtr.asFunction< - spine_bone_data Function( - spine_skeleton_data, ffi.Pointer)>(); + spine_bone_data Function(spine_skeleton_data, ffi.Pointer)>(); spine_slot_data spine_skeleton_data_find_slot( spine_skeleton_data data, - ffi.Pointer name, + ffi.Pointer name, ) { return _spine_skeleton_data_find_slot( data, @@ -156,15 +387,14 @@ class SpineFlutterBindings { late final _spine_skeleton_data_find_slotPtr = _lookup< ffi.NativeFunction< spine_slot_data Function(spine_skeleton_data, - ffi.Pointer)>>('spine_skeleton_data_find_slot'); + ffi.Pointer)>>('spine_skeleton_data_find_slot'); late final _spine_skeleton_data_find_slot = _spine_skeleton_data_find_slotPtr.asFunction< - spine_slot_data Function( - spine_skeleton_data, ffi.Pointer)>(); + spine_slot_data Function(spine_skeleton_data, ffi.Pointer)>(); spine_skin spine_skeleton_data_find_skin( spine_skeleton_data data, - ffi.Pointer name, + ffi.Pointer name, ) { return _spine_skeleton_data_find_skin( data, @@ -175,14 +405,14 @@ class SpineFlutterBindings { late final _spine_skeleton_data_find_skinPtr = _lookup< ffi.NativeFunction< spine_skin Function(spine_skeleton_data, - ffi.Pointer)>>('spine_skeleton_data_find_skin'); + ffi.Pointer)>>('spine_skeleton_data_find_skin'); late final _spine_skeleton_data_find_skin = _spine_skeleton_data_find_skinPtr.asFunction< - spine_skin Function(spine_skeleton_data, ffi.Pointer)>(); + spine_skin Function(spine_skeleton_data, ffi.Pointer)>(); spine_event_data spine_skeleton_data_find_event( spine_skeleton_data data, - ffi.Pointer name, + ffi.Pointer name, ) { return _spine_skeleton_data_find_event( data, @@ -193,15 +423,14 @@ class SpineFlutterBindings { late final _spine_skeleton_data_find_eventPtr = _lookup< ffi.NativeFunction< spine_event_data Function(spine_skeleton_data, - ffi.Pointer)>>('spine_skeleton_data_find_event'); + ffi.Pointer)>>('spine_skeleton_data_find_event'); late final _spine_skeleton_data_find_event = _spine_skeleton_data_find_eventPtr.asFunction< - spine_event_data Function( - spine_skeleton_data, ffi.Pointer)>(); + spine_event_data Function(spine_skeleton_data, ffi.Pointer)>(); spine_animation spine_skeleton_data_find_animation( spine_skeleton_data data, - ffi.Pointer name, + ffi.Pointer name, ) { return _spine_skeleton_data_find_animation( data, @@ -212,15 +441,14 @@ class SpineFlutterBindings { late final _spine_skeleton_data_find_animationPtr = _lookup< ffi.NativeFunction< spine_animation Function(spine_skeleton_data, - ffi.Pointer)>>('spine_skeleton_data_find_animation'); + ffi.Pointer)>>('spine_skeleton_data_find_animation'); late final _spine_skeleton_data_find_animation = _spine_skeleton_data_find_animationPtr.asFunction< - spine_animation Function( - spine_skeleton_data, ffi.Pointer)>(); + spine_animation Function(spine_skeleton_data, ffi.Pointer)>(); spine_ik_constraint_data spine_skeleton_data_find_ik_constraint( spine_skeleton_data data, - ffi.Pointer name, + ffi.Pointer name, ) { return _spine_skeleton_data_find_ik_constraint( data, @@ -229,18 +457,17 @@ class SpineFlutterBindings { } late final _spine_skeleton_data_find_ik_constraintPtr = _lookup< - ffi.NativeFunction< - spine_ik_constraint_data Function( - spine_skeleton_data, ffi.Pointer)>>( - 'spine_skeleton_data_find_ik_constraint'); + ffi.NativeFunction< + spine_ik_constraint_data Function(spine_skeleton_data, + ffi.Pointer)>>('spine_skeleton_data_find_ik_constraint'); late final _spine_skeleton_data_find_ik_constraint = _spine_skeleton_data_find_ik_constraintPtr.asFunction< spine_ik_constraint_data Function( - spine_skeleton_data, ffi.Pointer)>(); + spine_skeleton_data, ffi.Pointer)>(); spine_transform_constraint_data spine_skeleton_data_find_transform_constraint( spine_skeleton_data data, - ffi.Pointer name, + ffi.Pointer name, ) { return _spine_skeleton_data_find_transform_constraint( data, @@ -251,16 +478,16 @@ class SpineFlutterBindings { late final _spine_skeleton_data_find_transform_constraintPtr = _lookup< ffi.NativeFunction< spine_transform_constraint_data Function( - spine_skeleton_data, ffi.Pointer)>>( + spine_skeleton_data, ffi.Pointer)>>( 'spine_skeleton_data_find_transform_constraint'); late final _spine_skeleton_data_find_transform_constraint = _spine_skeleton_data_find_transform_constraintPtr.asFunction< spine_transform_constraint_data Function( - spine_skeleton_data, ffi.Pointer)>(); + spine_skeleton_data, ffi.Pointer)>(); spine_path_constraint_data spine_skeleton_data_find_path_constraint( spine_skeleton_data data, - ffi.Pointer name, + ffi.Pointer name, ) { return _spine_skeleton_data_find_path_constraint( data, @@ -269,16 +496,15 @@ class SpineFlutterBindings { } late final _spine_skeleton_data_find_path_constraintPtr = _lookup< - ffi.NativeFunction< - spine_path_constraint_data Function( - spine_skeleton_data, ffi.Pointer)>>( - 'spine_skeleton_data_find_path_constraint'); + ffi.NativeFunction< + spine_path_constraint_data Function(spine_skeleton_data, + ffi.Pointer)>>('spine_skeleton_data_find_path_constraint'); late final _spine_skeleton_data_find_path_constraint = _spine_skeleton_data_find_path_constraintPtr.asFunction< spine_path_constraint_data Function( - spine_skeleton_data, ffi.Pointer)>(); + spine_skeleton_data, ffi.Pointer)>(); - ffi.Pointer spine_skeleton_data_get_name( + ffi.Pointer spine_skeleton_data_get_name( spine_skeleton_data data, ) { return _spine_skeleton_data_get_name( @@ -287,11 +513,10 @@ class SpineFlutterBindings { } late final _spine_skeleton_data_get_namePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - spine_skeleton_data)>>('spine_skeleton_data_get_name'); + ffi.NativeFunction Function(spine_skeleton_data)>>( + 'spine_skeleton_data_get_name'); late final _spine_skeleton_data_get_name = _spine_skeleton_data_get_namePtr - .asFunction Function(spine_skeleton_data)>(); + .asFunction Function(spine_skeleton_data)>(); /// OMITTED setName() int spine_skeleton_data_get_num_bones( @@ -303,7 +528,7 @@ class SpineFlutterBindings { } late final _spine_skeleton_data_get_num_bonesPtr = - _lookup>( + _lookup>( 'spine_skeleton_data_get_num_bones'); late final _spine_skeleton_data_get_num_bones = _spine_skeleton_data_get_num_bonesPtr @@ -333,7 +558,7 @@ class SpineFlutterBindings { } late final _spine_skeleton_data_get_num_slotsPtr = - _lookup>( + _lookup>( 'spine_skeleton_data_get_num_slots'); late final _spine_skeleton_data_get_num_slots = _spine_skeleton_data_get_num_slotsPtr @@ -363,7 +588,7 @@ class SpineFlutterBindings { } late final _spine_skeleton_data_get_num_skinsPtr = - _lookup>( + _lookup>( 'spine_skeleton_data_get_num_skins'); late final _spine_skeleton_data_get_num_skins = _spine_skeleton_data_get_num_skinsPtr @@ -426,7 +651,7 @@ class SpineFlutterBindings { } late final _spine_skeleton_data_get_num_eventsPtr = - _lookup>( + _lookup>( 'spine_skeleton_data_get_num_events'); late final _spine_skeleton_data_get_num_events = _spine_skeleton_data_get_num_eventsPtr @@ -457,7 +682,7 @@ class SpineFlutterBindings { } late final _spine_skeleton_data_get_num_animationsPtr = - _lookup>( + _lookup>( 'spine_skeleton_data_get_num_animations'); late final _spine_skeleton_data_get_num_animations = _spine_skeleton_data_get_num_animationsPtr @@ -488,7 +713,7 @@ class SpineFlutterBindings { } late final _spine_skeleton_data_get_num_ik_constraintsPtr = - _lookup>( + _lookup>( 'spine_skeleton_data_get_num_ik_constraints'); late final _spine_skeleton_data_get_num_ik_constraints = _spine_skeleton_data_get_num_ik_constraintsPtr @@ -520,7 +745,7 @@ class SpineFlutterBindings { } late final _spine_skeleton_data_get_num_transform_constraintsPtr = - _lookup>( + _lookup>( 'spine_skeleton_data_get_num_transform_constraints'); late final _spine_skeleton_data_get_num_transform_constraints = _spine_skeleton_data_get_num_transform_constraintsPtr @@ -554,7 +779,7 @@ class SpineFlutterBindings { } late final _spine_skeleton_data_get_num_path_constraintsPtr = - _lookup>( + _lookup>( 'spine_skeleton_data_get_num_path_constraints'); late final _spine_skeleton_data_get_num_path_constraints = _spine_skeleton_data_get_num_path_constraintsPtr @@ -705,7 +930,7 @@ class SpineFlutterBindings { _spine_skeleton_data_set_heightPtr .asFunction(); - ffi.Pointer spine_skeleton_data_get_version( + ffi.Pointer spine_skeleton_data_get_version( spine_skeleton_data data, ) { return _spine_skeleton_data_get_version( @@ -714,15 +939,14 @@ class SpineFlutterBindings { } late final _spine_skeleton_data_get_versionPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - spine_skeleton_data)>>('spine_skeleton_data_get_version'); + ffi.NativeFunction Function(spine_skeleton_data)>>( + 'spine_skeleton_data_get_version'); late final _spine_skeleton_data_get_version = _spine_skeleton_data_get_versionPtr - .asFunction Function(spine_skeleton_data)>(); + .asFunction Function(spine_skeleton_data)>(); /// OMITTED setVersion() - ffi.Pointer spine_skeleton_data_get_hash( + ffi.Pointer spine_skeleton_data_get_hash( spine_skeleton_data data, ) { return _spine_skeleton_data_get_hash( @@ -731,14 +955,13 @@ class SpineFlutterBindings { } late final _spine_skeleton_data_get_hashPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - spine_skeleton_data)>>('spine_skeleton_data_get_hash'); + ffi.NativeFunction Function(spine_skeleton_data)>>( + 'spine_skeleton_data_get_hash'); late final _spine_skeleton_data_get_hash = _spine_skeleton_data_get_hashPtr - .asFunction Function(spine_skeleton_data)>(); + .asFunction Function(spine_skeleton_data)>(); /// OMITTED setHash() - ffi.Pointer spine_skeleton_data_get_images_path( + ffi.Pointer spine_skeleton_data_get_images_path( spine_skeleton_data data, ) { return _spine_skeleton_data_get_images_path( @@ -747,15 +970,14 @@ class SpineFlutterBindings { } late final _spine_skeleton_data_get_images_pathPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - spine_skeleton_data)>>('spine_skeleton_data_get_images_path'); + ffi.NativeFunction Function(spine_skeleton_data)>>( + 'spine_skeleton_data_get_images_path'); late final _spine_skeleton_data_get_images_path = _spine_skeleton_data_get_images_pathPtr - .asFunction Function(spine_skeleton_data)>(); + .asFunction Function(spine_skeleton_data)>(); /// OMITTED setImagesPath() - ffi.Pointer spine_skeleton_data_get_audio_path( + ffi.Pointer spine_skeleton_data_get_audio_path( spine_skeleton_data data, ) { return _spine_skeleton_data_get_audio_path( @@ -764,12 +986,11 @@ class SpineFlutterBindings { } late final _spine_skeleton_data_get_audio_pathPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - spine_skeleton_data)>>('spine_skeleton_data_get_audio_path'); + ffi.NativeFunction Function(spine_skeleton_data)>>( + 'spine_skeleton_data_get_audio_path'); late final _spine_skeleton_data_get_audio_path = _spine_skeleton_data_get_audio_pathPtr - .asFunction Function(spine_skeleton_data)>(); + .asFunction Function(spine_skeleton_data)>(); /// OMITTED setAudioPath() double spine_skeleton_data_get_fps( @@ -801,7 +1022,7 @@ class SpineFlutterBindings { late final _spine_skeleton_data_dispose = _spine_skeleton_data_disposePtr .asFunction(); - ffi.Pointer spine_skeleton_drawable_create( + spine_skeleton_drawable spine_skeleton_drawable_create( spine_skeleton_data skeletonData, ) { return _spine_skeleton_drawable_create( @@ -811,14 +1032,14 @@ class SpineFlutterBindings { late final _spine_skeleton_drawable_createPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + spine_skeleton_drawable Function( spine_skeleton_data)>>('spine_skeleton_drawable_create'); late final _spine_skeleton_drawable_create = - _spine_skeleton_drawable_createPtr.asFunction< - ffi.Pointer Function(spine_skeleton_data)>(); + _spine_skeleton_drawable_createPtr + .asFunction(); - ffi.Pointer spine_skeleton_drawable_render( - ffi.Pointer drawable, + spine_render_command spine_skeleton_drawable_render( + spine_skeleton_drawable drawable, ) { return _spine_skeleton_drawable_render( drawable, @@ -826,32 +1047,231 @@ class SpineFlutterBindings { } late final _spine_skeleton_drawable_renderPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>( - 'spine_skeleton_drawable_render'); + ffi.NativeFunction< + spine_render_command Function( + spine_skeleton_drawable)>>('spine_skeleton_drawable_render'); late final _spine_skeleton_drawable_render = - _spine_skeleton_drawable_renderPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer)>(); + _spine_skeleton_drawable_renderPtr + .asFunction(); void spine_skeleton_drawable_dispose( - ffi.Pointer drawable, + spine_skeleton_drawable drawable, ) { return _spine_skeleton_drawable_dispose( drawable, ); } - late final _spine_skeleton_drawable_disposePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>( - 'spine_skeleton_drawable_dispose'); + late final _spine_skeleton_drawable_disposePtr = + _lookup>( + 'spine_skeleton_drawable_dispose'); late final _spine_skeleton_drawable_dispose = _spine_skeleton_drawable_disposePtr - .asFunction)>(); + .asFunction(); - ffi.Pointer spine_animation_get_name( + spine_skeleton spine_skeleton_drawable_get_skeleton( + spine_skeleton_drawable drawable, + ) { + return _spine_skeleton_drawable_get_skeleton( + drawable, + ); + } + + late final _spine_skeleton_drawable_get_skeletonPtr = _lookup< + ffi.NativeFunction>( + 'spine_skeleton_drawable_get_skeleton'); + late final _spine_skeleton_drawable_get_skeleton = + _spine_skeleton_drawable_get_skeletonPtr + .asFunction(); + + spine_animation_state spine_skeleton_drawable_get_animation_state( + spine_skeleton_drawable drawable, + ) { + return _spine_skeleton_drawable_get_animation_state( + drawable, + ); + } + + late final _spine_skeleton_drawable_get_animation_statePtr = _lookup< + ffi.NativeFunction< + spine_animation_state Function(spine_skeleton_drawable)>>( + 'spine_skeleton_drawable_get_animation_state'); + late final _spine_skeleton_drawable_get_animation_state = + _spine_skeleton_drawable_get_animation_statePtr.asFunction< + spine_animation_state Function(spine_skeleton_drawable)>(); + + spine_animation_state_data spine_skeleton_drawable_get_animation_state_data( + spine_skeleton_drawable drawable, + ) { + return _spine_skeleton_drawable_get_animation_state_data( + drawable, + ); + } + + late final _spine_skeleton_drawable_get_animation_state_dataPtr = _lookup< + ffi.NativeFunction< + spine_animation_state_data Function(spine_skeleton_drawable)>>( + 'spine_skeleton_drawable_get_animation_state_data'); + late final _spine_skeleton_drawable_get_animation_state_data = + _spine_skeleton_drawable_get_animation_state_dataPtr.asFunction< + spine_animation_state_data Function(spine_skeleton_drawable)>(); + + spine_animation_state_events + spine_skeleton_drawable_get_animation_state_events( + spine_skeleton_drawable drawable, + ) { + return _spine_skeleton_drawable_get_animation_state_events( + drawable, + ); + } + + late final _spine_skeleton_drawable_get_animation_state_eventsPtr = _lookup< + ffi.NativeFunction< + spine_animation_state_events Function(spine_skeleton_drawable)>>( + 'spine_skeleton_drawable_get_animation_state_events'); + late final _spine_skeleton_drawable_get_animation_state_events = + _spine_skeleton_drawable_get_animation_state_eventsPtr.asFunction< + spine_animation_state_events Function(spine_skeleton_drawable)>(); + + ffi.Pointer spine_render_command_get_positions( + spine_render_command command, + ) { + return _spine_render_command_get_positions( + command, + ); + } + + late final _spine_render_command_get_positionsPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + spine_render_command)>>('spine_render_command_get_positions'); + late final _spine_render_command_get_positions = + _spine_render_command_get_positionsPtr + .asFunction Function(spine_render_command)>(); + + ffi.Pointer spine_render_command_get_uvs( + spine_render_command command, + ) { + return _spine_render_command_get_uvs( + command, + ); + } + + late final _spine_render_command_get_uvsPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + spine_render_command)>>('spine_render_command_get_uvs'); + late final _spine_render_command_get_uvs = _spine_render_command_get_uvsPtr + .asFunction Function(spine_render_command)>(); + + ffi.Pointer spine_render_command_get_colors( + spine_render_command command, + ) { + return _spine_render_command_get_colors( + command, + ); + } + + late final _spine_render_command_get_colorsPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + spine_render_command)>>('spine_render_command_get_colors'); + late final _spine_render_command_get_colors = + _spine_render_command_get_colorsPtr + .asFunction Function(spine_render_command)>(); + + int spine_render_command_get_num_vertices( + spine_render_command command, + ) { + return _spine_render_command_get_num_vertices( + command, + ); + } + + late final _spine_render_command_get_num_verticesPtr = + _lookup>( + 'spine_render_command_get_num_vertices'); + late final _spine_render_command_get_num_vertices = + _spine_render_command_get_num_verticesPtr + .asFunction(); + + ffi.Pointer spine_render_command_get_indices( + spine_render_command command, + ) { + return _spine_render_command_get_indices( + command, + ); + } + + late final _spine_render_command_get_indicesPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + spine_render_command)>>('spine_render_command_get_indices'); + late final _spine_render_command_get_indices = + _spine_render_command_get_indicesPtr + .asFunction Function(spine_render_command)>(); + + int spine_render_command_get_num_indices( + spine_render_command command, + ) { + return _spine_render_command_get_num_indices( + command, + ); + } + + late final _spine_render_command_get_num_indicesPtr = + _lookup>( + 'spine_render_command_get_num_indices'); + late final _spine_render_command_get_num_indices = + _spine_render_command_get_num_indicesPtr + .asFunction(); + + int spine_render_command_get_atlas_page( + spine_render_command command, + ) { + return _spine_render_command_get_atlas_page( + command, + ); + } + + late final _spine_render_command_get_atlas_pagePtr = + _lookup>( + 'spine_render_command_get_atlas_page'); + late final _spine_render_command_get_atlas_page = + _spine_render_command_get_atlas_pagePtr + .asFunction(); + + int spine_render_command_get_blend_mode( + spine_render_command command, + ) { + return _spine_render_command_get_blend_mode( + command, + ); + } + + late final _spine_render_command_get_blend_modePtr = + _lookup>( + 'spine_render_command_get_blend_mode'); + late final _spine_render_command_get_blend_mode = + _spine_render_command_get_blend_modePtr + .asFunction(); + + spine_render_command spine_render_command_get_next( + spine_render_command command, + ) { + return _spine_render_command_get_next( + command, + ); + } + + late final _spine_render_command_get_nextPtr = _lookup< + ffi.NativeFunction< + spine_render_command Function( + spine_render_command)>>('spine_render_command_get_next'); + late final _spine_render_command_get_next = _spine_render_command_get_nextPtr + .asFunction(); + + ffi.Pointer spine_animation_get_name( spine_animation animation, ) { return _spine_animation_get_name( @@ -859,11 +1279,11 @@ class SpineFlutterBindings { ); } - late final _spine_animation_get_namePtr = _lookup< - ffi.NativeFunction Function(spine_animation)>>( - 'spine_animation_get_name'); + late final _spine_animation_get_namePtr = + _lookup Function(spine_animation)>>( + 'spine_animation_get_name'); late final _spine_animation_get_name = _spine_animation_get_namePtr - .asFunction Function(spine_animation)>(); + .asFunction Function(spine_animation)>(); /// OMITTED getTimelines() /// OMITTED hasTimeline() @@ -980,8 +1400,8 @@ class SpineFlutterBindings { void spine_animation_state_data_set_mix_by_name( spine_animation_state_data stateData, - ffi.Pointer fromName, - ffi.Pointer toName, + ffi.Pointer fromName, + ffi.Pointer toName, double duration, ) { return _spine_animation_state_data_set_mix_by_name( @@ -996,18 +1416,18 @@ class SpineFlutterBindings { ffi.NativeFunction< ffi.Void Function( spine_animation_state_data, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Float)>>('spine_animation_state_data_set_mix_by_name'); late final _spine_animation_state_data_set_mix_by_name = _spine_animation_state_data_set_mix_by_namePtr.asFunction< - void Function(spine_animation_state_data, ffi.Pointer, - ffi.Pointer, double)>(); + void Function(spine_animation_state_data, ffi.Pointer, + ffi.Pointer, double)>(); double spine_animation_state_data_get_mix_by_name( spine_animation_state_data stateData, - ffi.Pointer fromName, - ffi.Pointer toName, + ffi.Pointer fromName, + ffi.Pointer toName, ) { return _spine_animation_state_data_get_mix_by_name( stateData, @@ -1018,13 +1438,13 @@ class SpineFlutterBindings { late final _spine_animation_state_data_get_mix_by_namePtr = _lookup< ffi.NativeFunction< - ffi.Float Function(spine_animation_state_data, - ffi.Pointer, ffi.Pointer)>>( + ffi.Float Function(spine_animation_state_data, ffi.Pointer, + ffi.Pointer)>>( 'spine_animation_state_data_get_mix_by_name'); late final _spine_animation_state_data_get_mix_by_name = _spine_animation_state_data_get_mix_by_namePtr.asFunction< - double Function(spine_animation_state_data, ffi.Pointer, - ffi.Pointer)>(); + double Function(spine_animation_state_data, ffi.Pointer, + ffi.Pointer)>(); void spine_animation_state_data_clear( spine_animation_state_data stateData, @@ -1103,7 +1523,7 @@ class SpineFlutterBindings { late final _spine_animation_state_clear_trackPtr = _lookup< ffi.NativeFunction< ffi.Void Function(spine_animation_state, - ffi.Int)>>('spine_animation_state_clear_track'); + ffi.Int32)>>('spine_animation_state_clear_track'); late final _spine_animation_state_clear_track = _spine_animation_state_clear_trackPtr .asFunction(); @@ -1117,7 +1537,7 @@ class SpineFlutterBindings { } late final _spine_animation_state_get_num_tracksPtr = - _lookup>( + _lookup>( 'spine_animation_state_get_num_tracks'); late final _spine_animation_state_get_num_tracks = _spine_animation_state_get_num_tracksPtr @@ -1126,7 +1546,7 @@ class SpineFlutterBindings { spine_track_entry spine_animation_state_set_animation_by_name( spine_animation_state state, int trackIndex, - ffi.Pointer animationName, + ffi.Pointer animationName, int loop, ) { return _spine_animation_state_set_animation_by_name( @@ -1141,13 +1561,13 @@ class SpineFlutterBindings { ffi.NativeFunction< spine_track_entry Function( spine_animation_state, - ffi.Int, - ffi.Pointer, - ffi.Int)>>('spine_animation_state_set_animation_by_name'); + ffi.Int32, + ffi.Pointer, + ffi.Int32)>>('spine_animation_state_set_animation_by_name'); late final _spine_animation_state_set_animation_by_name = _spine_animation_state_set_animation_by_namePtr.asFunction< spine_track_entry Function( - spine_animation_state, int, ffi.Pointer, int)>(); + spine_animation_state, int, ffi.Pointer, int)>(); spine_track_entry spine_animation_state_set_animation( spine_animation_state state, @@ -1167,9 +1587,9 @@ class SpineFlutterBindings { ffi.NativeFunction< spine_track_entry Function( spine_animation_state, - ffi.Int, + ffi.Int32, spine_animation, - ffi.Int)>>('spine_animation_state_set_animation'); + ffi.Int32)>>('spine_animation_state_set_animation'); late final _spine_animation_state_set_animation = _spine_animation_state_set_animationPtr.asFunction< spine_track_entry Function( @@ -1178,7 +1598,7 @@ class SpineFlutterBindings { spine_track_entry spine_animation_state_add_animation_by_name( spine_animation_state state, int trackIndex, - ffi.Pointer animationName, + ffi.Pointer animationName, int loop, double delay, ) { @@ -1195,14 +1615,14 @@ class SpineFlutterBindings { ffi.NativeFunction< spine_track_entry Function( spine_animation_state, - ffi.Int, - ffi.Pointer, - ffi.Int, + ffi.Int32, + ffi.Pointer, + ffi.Int32, ffi.Float)>>('spine_animation_state_add_animation_by_name'); late final _spine_animation_state_add_animation_by_name = _spine_animation_state_add_animation_by_namePtr.asFunction< - spine_track_entry Function(spine_animation_state, int, - ffi.Pointer, int, double)>(); + spine_track_entry Function( + spine_animation_state, int, ffi.Pointer, int, double)>(); spine_track_entry spine_animation_state_add_animation( spine_animation_state state, @@ -1224,9 +1644,9 @@ class SpineFlutterBindings { ffi.NativeFunction< spine_track_entry Function( spine_animation_state, - ffi.Int, + ffi.Int32, spine_animation, - ffi.Int, + ffi.Int32, ffi.Float)>>('spine_animation_state_add_animation'); late final _spine_animation_state_add_animation = _spine_animation_state_add_animationPtr.asFunction< @@ -1247,7 +1667,7 @@ class SpineFlutterBindings { late final _spine_animation_state_set_empty_animationPtr = _lookup< ffi.NativeFunction< - spine_track_entry Function(spine_animation_state, ffi.Int, + spine_track_entry Function(spine_animation_state, ffi.Int32, ffi.Float)>>('spine_animation_state_set_empty_animation'); late final _spine_animation_state_set_empty_animation = _spine_animation_state_set_empty_animationPtr.asFunction< @@ -1269,7 +1689,10 @@ class SpineFlutterBindings { late final _spine_animation_state_add_empty_animationPtr = _lookup< ffi.NativeFunction< - spine_track_entry Function(spine_animation_state, ffi.Int, ffi.Float, + spine_track_entry Function( + spine_animation_state, + ffi.Int32, + ffi.Float, ffi.Float)>>('spine_animation_state_add_empty_animation'); late final _spine_animation_state_add_empty_animation = _spine_animation_state_add_empty_animationPtr.asFunction< @@ -1307,7 +1730,7 @@ class SpineFlutterBindings { late final _spine_animation_state_get_currentPtr = _lookup< ffi.NativeFunction< spine_track_entry Function(spine_animation_state, - ffi.Int)>>('spine_animation_state_get_current'); + ffi.Int32)>>('spine_animation_state_get_current'); late final _spine_animation_state_get_current = _spine_animation_state_get_currentPtr .asFunction(); @@ -1394,7 +1817,7 @@ class SpineFlutterBindings { } late final _spine_animation_state_events_get_num_eventsPtr = _lookup< - ffi.NativeFunction>( + ffi.NativeFunction>( 'spine_animation_state_events_get_num_events'); late final _spine_animation_state_events_get_num_events = _spine_animation_state_events_get_num_eventsPtr @@ -1413,7 +1836,7 @@ class SpineFlutterBindings { late final _spine_animation_state_events_get_event_typePtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(spine_animation_state_events, - ffi.Int)>>('spine_animation_state_events_get_event_type'); + ffi.Int32)>>('spine_animation_state_events_get_event_type'); late final _spine_animation_state_events_get_event_type = _spine_animation_state_events_get_event_typePtr .asFunction(); @@ -1431,7 +1854,7 @@ class SpineFlutterBindings { late final _spine_animation_state_events_get_track_entryPtr = _lookup< ffi.NativeFunction< spine_track_entry Function(spine_animation_state_events, - ffi.Int)>>('spine_animation_state_events_get_track_entry'); + ffi.Int32)>>('spine_animation_state_events_get_track_entry'); late final _spine_animation_state_events_get_track_entry = _spine_animation_state_events_get_track_entryPtr.asFunction< spine_track_entry Function(spine_animation_state_events, int)>(); @@ -1449,7 +1872,7 @@ class SpineFlutterBindings { late final _spine_animation_state_events_get_eventPtr = _lookup< ffi.NativeFunction< spine_event Function(spine_animation_state_events, - ffi.Int)>>('spine_animation_state_events_get_event'); + ffi.Int32)>>('spine_animation_state_events_get_event'); late final _spine_animation_state_events_get_event = _spine_animation_state_events_get_eventPtr.asFunction< spine_event Function(spine_animation_state_events, int)>(); @@ -1478,7 +1901,7 @@ class SpineFlutterBindings { } late final _spine_track_entry_get_track_indexPtr = - _lookup>( + _lookup>( 'spine_track_entry_get_track_index'); late final _spine_track_entry_get_track_index = _spine_track_entry_get_track_indexPtr @@ -1523,7 +1946,7 @@ class SpineFlutterBindings { } late final _spine_track_entry_get_loopPtr = - _lookup>( + _lookup>( 'spine_track_entry_get_loop'); late final _spine_track_entry_get_loop = _spine_track_entry_get_loopPtr .asFunction(); @@ -1539,7 +1962,7 @@ class SpineFlutterBindings { } late final _spine_track_entry_set_loopPtr = _lookup< - ffi.NativeFunction>( + ffi.NativeFunction>( 'spine_track_entry_set_loop'); late final _spine_track_entry_set_loop = _spine_track_entry_set_loopPtr .asFunction(); @@ -1553,7 +1976,7 @@ class SpineFlutterBindings { } late final _spine_track_entry_get_hold_previousPtr = - _lookup>( + _lookup>( 'spine_track_entry_get_hold_previous'); late final _spine_track_entry_get_hold_previous = _spine_track_entry_get_hold_previousPtr @@ -1570,7 +1993,7 @@ class SpineFlutterBindings { } late final _spine_track_entry_set_hold_previousPtr = _lookup< - ffi.NativeFunction>( + ffi.NativeFunction>( 'spine_track_entry_set_hold_previous'); late final _spine_track_entry_set_hold_previous = _spine_track_entry_set_hold_previousPtr @@ -1585,7 +2008,7 @@ class SpineFlutterBindings { } late final _spine_track_entry_get_reversePtr = - _lookup>( + _lookup>( 'spine_track_entry_get_reverse'); late final _spine_track_entry_get_reverse = _spine_track_entry_get_reversePtr .asFunction(); @@ -1601,7 +2024,7 @@ class SpineFlutterBindings { } late final _spine_track_entry_set_reversePtr = _lookup< - ffi.NativeFunction>( + ffi.NativeFunction>( 'spine_track_entry_set_reverse'); late final _spine_track_entry_set_reverse = _spine_track_entry_set_reversePtr .asFunction(); @@ -1615,7 +2038,7 @@ class SpineFlutterBindings { } late final _spine_track_entry_get_shortest_rotationPtr = - _lookup>( + _lookup>( 'spine_track_entry_get_shortest_rotation'); late final _spine_track_entry_get_shortest_rotation = _spine_track_entry_get_shortest_rotationPtr @@ -1632,7 +2055,7 @@ class SpineFlutterBindings { } late final _spine_track_entry_set_shortest_rotationPtr = _lookup< - ffi.NativeFunction>( + ffi.NativeFunction>( 'spine_track_entry_set_shortest_rotation'); late final _spine_track_entry_set_shortest_rotation = _spine_track_entry_set_shortest_rotationPtr @@ -2024,7 +2447,7 @@ class SpineFlutterBindings { } late final _spine_track_entry_is_completePtr = - _lookup>( + _lookup>( 'spine_track_entry_is_complete'); late final _spine_track_entry_is_complete = _spine_track_entry_is_completePtr .asFunction(); @@ -2281,7 +2704,7 @@ class SpineFlutterBindings { spine_bone spine_skeleton_find_bone( spine_skeleton skeleton, - ffi.Pointer boneName, + ffi.Pointer boneName, ) { return _spine_skeleton_find_bone( skeleton, @@ -2291,14 +2714,14 @@ class SpineFlutterBindings { late final _spine_skeleton_find_bonePtr = _lookup< ffi.NativeFunction< - spine_bone Function(spine_skeleton, - ffi.Pointer)>>('spine_skeleton_find_bone'); + spine_bone Function( + spine_skeleton, ffi.Pointer)>>('spine_skeleton_find_bone'); late final _spine_skeleton_find_bone = _spine_skeleton_find_bonePtr - .asFunction)>(); + .asFunction)>(); spine_slot spine_skeleton_find_slot( spine_skeleton skeleton, - ffi.Pointer slotName, + ffi.Pointer slotName, ) { return _spine_skeleton_find_slot( skeleton, @@ -2308,14 +2731,14 @@ class SpineFlutterBindings { late final _spine_skeleton_find_slotPtr = _lookup< ffi.NativeFunction< - spine_slot Function(spine_skeleton, - ffi.Pointer)>>('spine_skeleton_find_slot'); + spine_slot Function( + spine_skeleton, ffi.Pointer)>>('spine_skeleton_find_slot'); late final _spine_skeleton_find_slot = _spine_skeleton_find_slotPtr - .asFunction)>(); + .asFunction)>(); void spine_skeleton_set_skin_by_name( spine_skeleton skeleton, - ffi.Pointer skinName, + ffi.Pointer skinName, ) { return _spine_skeleton_set_skin_by_name( skeleton, @@ -2326,10 +2749,10 @@ class SpineFlutterBindings { late final _spine_skeleton_set_skin_by_namePtr = _lookup< ffi.NativeFunction< ffi.Void Function(spine_skeleton, - ffi.Pointer)>>('spine_skeleton_set_skin_by_name'); + ffi.Pointer)>>('spine_skeleton_set_skin_by_name'); late final _spine_skeleton_set_skin_by_name = _spine_skeleton_set_skin_by_namePtr - .asFunction)>(); + .asFunction)>(); void spine_skeleton_set_skin( spine_skeleton skeleton, @@ -2349,8 +2772,8 @@ class SpineFlutterBindings { spine_attachment spine_skeleton_get_attachment_by_name( spine_skeleton skeleton, - ffi.Pointer slotName, - ffi.Pointer attachmentName, + ffi.Pointer slotName, + ffi.Pointer attachmentName, ) { return _spine_skeleton_get_attachment_by_name( skeleton, @@ -2361,17 +2784,17 @@ class SpineFlutterBindings { late final _spine_skeleton_get_attachment_by_namePtr = _lookup< ffi.NativeFunction< - spine_attachment Function(spine_skeleton, ffi.Pointer, - ffi.Pointer)>>('spine_skeleton_get_attachment_by_name'); + spine_attachment Function(spine_skeleton, ffi.Pointer, + ffi.Pointer)>>('spine_skeleton_get_attachment_by_name'); late final _spine_skeleton_get_attachment_by_name = _spine_skeleton_get_attachment_by_namePtr.asFunction< spine_attachment Function( - spine_skeleton, ffi.Pointer, ffi.Pointer)>(); + spine_skeleton, ffi.Pointer, ffi.Pointer)>(); spine_attachment spine_skeleton_get_attachment( spine_skeleton skeleton, int slotIndex, - ffi.Pointer attachmentName, + ffi.Pointer attachmentName, ) { return _spine_skeleton_get_attachment( skeleton, @@ -2382,17 +2805,16 @@ class SpineFlutterBindings { late final _spine_skeleton_get_attachmentPtr = _lookup< ffi.NativeFunction< - spine_attachment Function(spine_skeleton, ffi.Int, - ffi.Pointer)>>('spine_skeleton_get_attachment'); + spine_attachment Function(spine_skeleton, ffi.Int32, + ffi.Pointer)>>('spine_skeleton_get_attachment'); late final _spine_skeleton_get_attachment = _spine_skeleton_get_attachmentPtr.asFunction< - spine_attachment Function( - spine_skeleton, int, ffi.Pointer)>(); + spine_attachment Function(spine_skeleton, int, ffi.Pointer)>(); void spine_skeleton_set_attachment( spine_skeleton skeleton, - ffi.Pointer slotName, - ffi.Pointer attachmentName, + ffi.Pointer slotName, + ffi.Pointer attachmentName, ) { return _spine_skeleton_set_attachment( skeleton, @@ -2403,16 +2825,16 @@ class SpineFlutterBindings { late final _spine_skeleton_set_attachmentPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(spine_skeleton, ffi.Pointer, - ffi.Pointer)>>('spine_skeleton_set_attachment'); + ffi.Void Function(spine_skeleton, ffi.Pointer, + ffi.Pointer)>>('spine_skeleton_set_attachment'); late final _spine_skeleton_set_attachment = _spine_skeleton_set_attachmentPtr.asFunction< void Function( - spine_skeleton, ffi.Pointer, ffi.Pointer)>(); + spine_skeleton, ffi.Pointer, ffi.Pointer)>(); spine_ik_constraint spine_skeleton_find_ik_constraint( spine_skeleton skeleton, - ffi.Pointer constraintName, + ffi.Pointer constraintName, ) { return _spine_skeleton_find_ik_constraint( skeleton, @@ -2423,15 +2845,14 @@ class SpineFlutterBindings { late final _spine_skeleton_find_ik_constraintPtr = _lookup< ffi.NativeFunction< spine_ik_constraint Function(spine_skeleton, - ffi.Pointer)>>('spine_skeleton_find_ik_constraint'); + ffi.Pointer)>>('spine_skeleton_find_ik_constraint'); late final _spine_skeleton_find_ik_constraint = _spine_skeleton_find_ik_constraintPtr.asFunction< - spine_ik_constraint Function( - spine_skeleton, ffi.Pointer)>(); + spine_ik_constraint Function(spine_skeleton, ffi.Pointer)>(); spine_transform_constraint spine_skeleton_find_transform_constraint( spine_skeleton skeleton, - ffi.Pointer constraintName, + ffi.Pointer constraintName, ) { return _spine_skeleton_find_transform_constraint( skeleton, @@ -2440,18 +2861,17 @@ class SpineFlutterBindings { } late final _spine_skeleton_find_transform_constraintPtr = _lookup< - ffi.NativeFunction< - spine_transform_constraint Function( - spine_skeleton, ffi.Pointer)>>( - 'spine_skeleton_find_transform_constraint'); + ffi.NativeFunction< + spine_transform_constraint Function(spine_skeleton, + ffi.Pointer)>>('spine_skeleton_find_transform_constraint'); late final _spine_skeleton_find_transform_constraint = _spine_skeleton_find_transform_constraintPtr.asFunction< spine_transform_constraint Function( - spine_skeleton, ffi.Pointer)>(); + spine_skeleton, ffi.Pointer)>(); spine_path_constraint spine_skeleton_find_path_constraint( spine_skeleton skeleton, - ffi.Pointer constraintName, + ffi.Pointer constraintName, ) { return _spine_skeleton_find_path_constraint( skeleton, @@ -2462,11 +2882,10 @@ class SpineFlutterBindings { late final _spine_skeleton_find_path_constraintPtr = _lookup< ffi.NativeFunction< spine_path_constraint Function(spine_skeleton, - ffi.Pointer)>>('spine_skeleton_find_path_constraint'); + ffi.Pointer)>>('spine_skeleton_find_path_constraint'); late final _spine_skeleton_find_path_constraint = _spine_skeleton_find_path_constraintPtr.asFunction< - spine_path_constraint Function( - spine_skeleton, ffi.Pointer)>(); + spine_path_constraint Function(spine_skeleton, ffi.Pointer)>(); spine_bounds spine_skeleton_get_bounds( spine_skeleton skeleton, @@ -2519,7 +2938,7 @@ class SpineFlutterBindings { } late final _spine_skeleton_get_num_bonesPtr = - _lookup>( + _lookup>( 'spine_skeleton_get_num_bones'); late final _spine_skeleton_get_num_bones = _spine_skeleton_get_num_bonesPtr .asFunction(); @@ -2548,7 +2967,7 @@ class SpineFlutterBindings { } late final _spine_skeleton_get_num_slotsPtr = - _lookup>( + _lookup>( 'spine_skeleton_get_num_slots'); late final _spine_skeleton_get_num_slots = _spine_skeleton_get_num_slotsPtr .asFunction(); @@ -2576,7 +2995,7 @@ class SpineFlutterBindings { } late final _spine_skeleton_get_num_draw_orderPtr = - _lookup>( + _lookup>( 'spine_skeleton_get_num_draw_order'); late final _spine_skeleton_get_num_draw_order = _spine_skeleton_get_num_draw_orderPtr @@ -2605,7 +3024,7 @@ class SpineFlutterBindings { } late final _spine_skeleton_get_num_ik_constraintsPtr = - _lookup>( + _lookup>( 'spine_skeleton_get_num_ik_constraints'); late final _spine_skeleton_get_num_ik_constraints = _spine_skeleton_get_num_ik_constraintsPtr @@ -2636,7 +3055,7 @@ class SpineFlutterBindings { } late final _spine_skeleton_get_num_transform_constraintsPtr = - _lookup>( + _lookup>( 'spine_skeleton_get_num_transform_constraints'); late final _spine_skeleton_get_num_transform_constraints = _spine_skeleton_get_num_transform_constraintsPtr @@ -2668,7 +3087,7 @@ class SpineFlutterBindings { } late final _spine_skeleton_get_num_path_constraintsPtr = - _lookup>( + _lookup>( 'spine_skeleton_get_num_path_constraints'); late final _spine_skeleton_get_num_path_constraints = _spine_skeleton_get_num_path_constraintsPtr @@ -2881,7 +3300,7 @@ class SpineFlutterBindings { late final _spine_skeleton_set_scale_y = _spine_skeleton_set_scale_yPtr .asFunction(); - ffi.Pointer spine_event_data_get_name( + ffi.Pointer spine_event_data_get_name( spine_event_data event, ) { return _spine_event_data_get_name( @@ -2889,11 +3308,11 @@ class SpineFlutterBindings { ); } - late final _spine_event_data_get_namePtr = _lookup< - ffi.NativeFunction Function(spine_event_data)>>( - 'spine_event_data_get_name'); + late final _spine_event_data_get_namePtr = + _lookup Function(spine_event_data)>>( + 'spine_event_data_get_name'); late final _spine_event_data_get_name = _spine_event_data_get_namePtr - .asFunction Function(spine_event_data)>(); + .asFunction Function(spine_event_data)>(); int spine_event_data_get_int_value( spine_event_data event, @@ -2904,7 +3323,7 @@ class SpineFlutterBindings { } late final _spine_event_data_get_int_valuePtr = - _lookup>( + _lookup>( 'spine_event_data_get_int_value'); late final _spine_event_data_get_int_value = _spine_event_data_get_int_valuePtr @@ -2920,9 +3339,9 @@ class SpineFlutterBindings { ); } - late final _spine_event_data_set_int_valuePtr = - _lookup>( - 'spine_event_data_set_int_value'); + late final _spine_event_data_set_int_valuePtr = _lookup< + ffi.NativeFunction>( + 'spine_event_data_set_int_value'); late final _spine_event_data_set_int_value = _spine_event_data_set_int_valuePtr .asFunction(); @@ -2959,7 +3378,7 @@ class SpineFlutterBindings { _spine_event_data_set_float_valuePtr .asFunction(); - ffi.Pointer spine_event_data_get_string_value( + ffi.Pointer spine_event_data_get_string_value( spine_event_data event, ) { return _spine_event_data_get_string_value( @@ -2967,16 +3386,16 @@ class SpineFlutterBindings { ); } - late final _spine_event_data_get_string_valuePtr = _lookup< - ffi.NativeFunction Function(spine_event_data)>>( - 'spine_event_data_get_string_value'); + late final _spine_event_data_get_string_valuePtr = + _lookup Function(spine_event_data)>>( + 'spine_event_data_get_string_value'); late final _spine_event_data_get_string_value = _spine_event_data_get_string_valuePtr - .asFunction Function(spine_event_data)>(); + .asFunction Function(spine_event_data)>(); void spine_event_data_set_string_value( spine_event_data event, - ffi.Pointer value, + ffi.Pointer value, ) { return _spine_event_data_set_string_value( event, @@ -2987,12 +3406,12 @@ class SpineFlutterBindings { late final _spine_event_data_set_string_valuePtr = _lookup< ffi.NativeFunction< ffi.Void Function(spine_event_data, - ffi.Pointer)>>('spine_event_data_set_string_value'); + ffi.Pointer)>>('spine_event_data_set_string_value'); late final _spine_event_data_set_string_value = _spine_event_data_set_string_valuePtr - .asFunction)>(); + .asFunction)>(); - ffi.Pointer spine_event_data_get_audio_path( + ffi.Pointer spine_event_data_get_audio_path( spine_event_data event, ) { return _spine_event_data_get_audio_path( @@ -3000,12 +3419,12 @@ class SpineFlutterBindings { ); } - late final _spine_event_data_get_audio_pathPtr = _lookup< - ffi.NativeFunction Function(spine_event_data)>>( - 'spine_event_data_get_audio_path'); + late final _spine_event_data_get_audio_pathPtr = + _lookup Function(spine_event_data)>>( + 'spine_event_data_get_audio_path'); late final _spine_event_data_get_audio_path = _spine_event_data_get_audio_pathPtr - .asFunction Function(spine_event_data)>(); + .asFunction Function(spine_event_data)>(); /// OMITTED setAudioPath() double spine_event_data_get_volume( @@ -3105,7 +3524,7 @@ class SpineFlutterBindings { } late final _spine_event_get_int_valuePtr = - _lookup>( + _lookup>( 'spine_event_get_int_value'); late final _spine_event_get_int_value = _spine_event_get_int_valuePtr.asFunction(); @@ -3121,7 +3540,7 @@ class SpineFlutterBindings { } late final _spine_event_set_int_valuePtr = - _lookup>( + _lookup>( 'spine_event_set_int_value'); late final _spine_event_set_int_value = _spine_event_set_int_valuePtr .asFunction(); @@ -3156,7 +3575,7 @@ class SpineFlutterBindings { late final _spine_event_set_float_value = _spine_event_set_float_valuePtr .asFunction(); - ffi.Pointer spine_event_get_string_value( + ffi.Pointer spine_event_get_string_value( spine_event event, ) { return _spine_event_get_string_value( @@ -3165,14 +3584,14 @@ class SpineFlutterBindings { } late final _spine_event_get_string_valuePtr = - _lookup Function(spine_event)>>( + _lookup Function(spine_event)>>( 'spine_event_get_string_value'); late final _spine_event_get_string_value = _spine_event_get_string_valuePtr - .asFunction Function(spine_event)>(); + .asFunction Function(spine_event)>(); void spine_event_set_string_value( spine_event event, - ffi.Pointer value, + ffi.Pointer value, ) { return _spine_event_set_string_value( event, @@ -3182,10 +3601,10 @@ class SpineFlutterBindings { late final _spine_event_set_string_valuePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(spine_event, - ffi.Pointer)>>('spine_event_set_string_value'); + ffi.Void Function( + spine_event, ffi.Pointer)>>('spine_event_set_string_value'); late final _spine_event_set_string_value = _spine_event_set_string_valuePtr - .asFunction)>(); + .asFunction)>(); double spine_event_get_volume( spine_event event, @@ -3256,12 +3675,12 @@ class SpineFlutterBindings { } late final _spine_slot_data_get_indexPtr = - _lookup>( + _lookup>( 'spine_slot_data_get_index'); late final _spine_slot_data_get_index = _spine_slot_data_get_indexPtr.asFunction(); - ffi.Pointer spine_slot_data_get_name( + ffi.Pointer spine_slot_data_get_name( spine_slot_data slot, ) { return _spine_slot_data_get_name( @@ -3269,11 +3688,11 @@ class SpineFlutterBindings { ); } - late final _spine_slot_data_get_namePtr = _lookup< - ffi.NativeFunction Function(spine_slot_data)>>( - 'spine_slot_data_get_name'); + late final _spine_slot_data_get_namePtr = + _lookup Function(spine_slot_data)>>( + 'spine_slot_data_get_name'); late final _spine_slot_data_get_name = _spine_slot_data_get_namePtr - .asFunction Function(spine_slot_data)>(); + .asFunction Function(spine_slot_data)>(); spine_bone_data spine_slot_data_get_bone_data( spine_slot_data slot, @@ -3375,7 +3794,7 @@ class SpineFlutterBindings { } late final _spine_slot_data_has_dark_colorPtr = - _lookup>( + _lookup>( 'spine_slot_data_has_dark_color'); late final _spine_slot_data_has_dark_color = _spine_slot_data_has_dark_colorPtr @@ -3391,14 +3810,14 @@ class SpineFlutterBindings { ); } - late final _spine_slot_data_set_has_dark_colorPtr = - _lookup>( - 'spine_slot_data_set_has_dark_color'); + late final _spine_slot_data_set_has_dark_colorPtr = _lookup< + ffi.NativeFunction>( + 'spine_slot_data_set_has_dark_color'); late final _spine_slot_data_set_has_dark_color = _spine_slot_data_set_has_dark_colorPtr .asFunction(); - ffi.Pointer spine_slot_data_get_attachment_name( + ffi.Pointer spine_slot_data_get_attachment_name( spine_slot_data slot, ) { return _spine_slot_data_get_attachment_name( @@ -3406,16 +3825,16 @@ class SpineFlutterBindings { ); } - late final _spine_slot_data_get_attachment_namePtr = _lookup< - ffi.NativeFunction Function(spine_slot_data)>>( - 'spine_slot_data_get_attachment_name'); + late final _spine_slot_data_get_attachment_namePtr = + _lookup Function(spine_slot_data)>>( + 'spine_slot_data_get_attachment_name'); late final _spine_slot_data_get_attachment_name = _spine_slot_data_get_attachment_namePtr - .asFunction Function(spine_slot_data)>(); + .asFunction Function(spine_slot_data)>(); void spine_slot_data_set_attachment_name( spine_slot_data slot, - ffi.Pointer attachmentName, + ffi.Pointer attachmentName, ) { return _spine_slot_data_set_attachment_name( slot, @@ -3426,10 +3845,10 @@ class SpineFlutterBindings { late final _spine_slot_data_set_attachment_namePtr = _lookup< ffi.NativeFunction< ffi.Void Function(spine_slot_data, - ffi.Pointer)>>('spine_slot_data_set_attachment_name'); + ffi.Pointer)>>('spine_slot_data_set_attachment_name'); late final _spine_slot_data_set_attachment_name = _spine_slot_data_set_attachment_namePtr - .asFunction)>(); + .asFunction)>(); int spine_slot_data_get_blend_mode( spine_slot_data slot, @@ -3602,7 +4021,7 @@ class SpineFlutterBindings { } late final _spine_slot_has_dark_colorPtr = - _lookup>( + _lookup>( 'spine_slot_has_dark_color'); late final _spine_slot_has_dark_color = _spine_slot_has_dark_colorPtr.asFunction(); @@ -3647,7 +4066,7 @@ class SpineFlutterBindings { } late final _spine_slot_get_sequence_indexPtr = - _lookup>( + _lookup>( 'spine_slot_get_sequence_index'); late final _spine_slot_get_sequence_index = _spine_slot_get_sequence_indexPtr.asFunction(); @@ -3663,7 +4082,7 @@ class SpineFlutterBindings { } late final _spine_slot_set_sequence_indexPtr = - _lookup>( + _lookup>( 'spine_slot_set_sequence_index'); late final _spine_slot_set_sequence_index = _spine_slot_set_sequence_indexPtr .asFunction(); @@ -3677,12 +4096,12 @@ class SpineFlutterBindings { } late final _spine_bone_data_get_indexPtr = - _lookup>( + _lookup>( 'spine_bone_data_get_index'); late final _spine_bone_data_get_index = _spine_bone_data_get_indexPtr.asFunction(); - ffi.Pointer spine_bone_data_get_name( + ffi.Pointer spine_bone_data_get_name( spine_bone_data data, ) { return _spine_bone_data_get_name( @@ -3690,11 +4109,11 @@ class SpineFlutterBindings { ); } - late final _spine_bone_data_get_namePtr = _lookup< - ffi.NativeFunction Function(spine_bone_data)>>( - 'spine_bone_data_get_name'); + late final _spine_bone_data_get_namePtr = + _lookup Function(spine_bone_data)>>( + 'spine_bone_data_get_name'); late final _spine_bone_data_get_name = _spine_bone_data_get_namePtr - .asFunction Function(spine_bone_data)>(); + .asFunction Function(spine_bone_data)>(); spine_bone_data spine_bone_data_get_parent( spine_bone_data data, @@ -3991,7 +4410,7 @@ class SpineFlutterBindings { } late final _spine_bone_data_is_skin_requiredPtr = - _lookup>( + _lookup>( 'spine_bone_data_is_skin_required'); late final _spine_bone_data_is_skin_required = _spine_bone_data_is_skin_requiredPtr @@ -4007,9 +4426,9 @@ class SpineFlutterBindings { ); } - late final _spine_bone_data_set_is_skin_requiredPtr = - _lookup>( - 'spine_bone_data_set_is_skin_required'); + late final _spine_bone_data_set_is_skin_requiredPtr = _lookup< + ffi.NativeFunction>( + 'spine_bone_data_set_is_skin_required'); late final _spine_bone_data_set_is_skin_required = _spine_bone_data_set_is_skin_requiredPtr .asFunction(); @@ -4061,7 +4480,7 @@ class SpineFlutterBindings { } late final _spine_bone_set_is_y_downPtr = - _lookup>( + _lookup>( 'spine_bone_set_is_y_down'); late final _spine_bone_set_is_y_down = _spine_bone_set_is_y_downPtr.asFunction(); @@ -4071,7 +4490,7 @@ class SpineFlutterBindings { } late final _spine_bone_get_is_y_downPtr = - _lookup>( + _lookup>( 'spine_bone_get_is_y_down'); late final _spine_bone_get_is_y_down = _spine_bone_get_is_y_downPtr.asFunction(); @@ -4326,7 +4745,7 @@ class SpineFlutterBindings { } late final _spine_bone_get_num_childrenPtr = - _lookup>( + _lookup>( 'spine_bone_get_num_children'); late final _spine_bone_get_num_children = _spine_bone_get_num_childrenPtr.asFunction(); @@ -5014,7 +5433,7 @@ class SpineFlutterBindings { } late final _spine_bone_get_is_activePtr = - _lookup>( + _lookup>( 'spine_bone_get_is_active'); late final _spine_bone_get_is_active = _spine_bone_get_is_activePtr.asFunction(); @@ -5030,12 +5449,12 @@ class SpineFlutterBindings { } late final _spine_bone_set_is_activePtr = - _lookup>( + _lookup>( 'spine_bone_set_is_active'); late final _spine_bone_set_is_active = _spine_bone_set_is_activePtr.asFunction(); - ffi.Pointer spine_attachment_get_name( + ffi.Pointer spine_attachment_get_name( spine_attachment attachment, ) { return _spine_attachment_get_name( @@ -5043,11 +5462,11 @@ class SpineFlutterBindings { ); } - late final _spine_attachment_get_namePtr = _lookup< - ffi.NativeFunction Function(spine_attachment)>>( - 'spine_attachment_get_name'); + late final _spine_attachment_get_namePtr = + _lookup Function(spine_attachment)>>( + 'spine_attachment_get_name'); late final _spine_attachment_get_name = _spine_attachment_get_namePtr - .asFunction Function(spine_attachment)>(); + .asFunction Function(spine_attachment)>(); int spine_attachment_get_type( spine_attachment attachment, @@ -5566,7 +5985,7 @@ class SpineFlutterBindings { void Function( spine_region_attachment, double, double, double, double)>(); - ffi.Pointer spine_region_attachment_get_path( + ffi.Pointer spine_region_attachment_get_path( spine_region_attachment attachment, ) { return _spine_region_attachment_get_path( @@ -5576,11 +5995,11 @@ class SpineFlutterBindings { late final _spine_region_attachment_get_pathPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( spine_region_attachment)>>('spine_region_attachment_get_path'); late final _spine_region_attachment_get_path = - _spine_region_attachment_get_pathPtr.asFunction< - ffi.Pointer Function(spine_region_attachment)>(); + _spine_region_attachment_get_pathPtr + .asFunction Function(spine_region_attachment)>(); /// OMITTED setPath() spine_texture_region spine_region_attachment_get_region( @@ -5625,7 +6044,7 @@ class SpineFlutterBindings { } late final _spine_region_attachment_get_num_offsetPtr = - _lookup>( + _lookup>( 'spine_region_attachment_get_num_offset'); late final _spine_region_attachment_get_num_offset = _spine_region_attachment_get_num_offsetPtr @@ -5656,7 +6075,7 @@ class SpineFlutterBindings { } late final _spine_region_attachment_get_num_uvsPtr = - _lookup>( + _lookup>( 'spine_region_attachment_get_num_uvs'); late final _spine_region_attachment_get_num_uvs = _spine_region_attachment_get_num_uvsPtr @@ -5687,7 +6106,7 @@ class SpineFlutterBindings { } late final _spine_vertex_attachment_get_world_vertices_lengthPtr = - _lookup>( + _lookup>( 'spine_vertex_attachment_get_world_vertices_length'); late final _spine_vertex_attachment_get_world_vertices_length = _spine_vertex_attachment_get_world_vertices_lengthPtr @@ -5725,7 +6144,7 @@ class SpineFlutterBindings { } late final _spine_vertex_attachment_get_num_bonesPtr = - _lookup>( + _lookup>( 'spine_vertex_attachment_get_num_bones'); late final _spine_vertex_attachment_get_num_bones = _spine_vertex_attachment_get_num_bonesPtr @@ -5756,7 +6175,7 @@ class SpineFlutterBindings { } late final _spine_vertex_attachment_get_num_verticesPtr = - _lookup>( + _lookup>( 'spine_vertex_attachment_get_num_vertices'); late final _spine_vertex_attachment_get_num_vertices = _spine_vertex_attachment_get_num_verticesPtr @@ -5837,7 +6256,7 @@ class SpineFlutterBindings { } late final _spine_mesh_attachment_get_hull_lengthPtr = - _lookup>( + _lookup>( 'spine_mesh_attachment_get_hull_length'); late final _spine_mesh_attachment_get_hull_length = _spine_mesh_attachment_get_hull_lengthPtr @@ -5856,7 +6275,7 @@ class SpineFlutterBindings { late final _spine_mesh_attachment_set_hull_lengthPtr = _lookup< ffi.NativeFunction< ffi.Void Function(spine_mesh_attachment, - ffi.Int)>>('spine_mesh_attachment_set_hull_length'); + ffi.Int32)>>('spine_mesh_attachment_set_hull_length'); late final _spine_mesh_attachment_set_hull_length = _spine_mesh_attachment_set_hull_lengthPtr .asFunction(); @@ -5870,7 +6289,7 @@ class SpineFlutterBindings { } late final _spine_mesh_attachment_get_num_region_uvsPtr = - _lookup>( + _lookup>( 'spine_mesh_attachment_get_num_region_uvs'); late final _spine_mesh_attachment_get_num_region_uvs = _spine_mesh_attachment_get_num_region_uvsPtr @@ -5901,7 +6320,7 @@ class SpineFlutterBindings { } late final _spine_mesh_attachment_get_num_uvsPtr = - _lookup>( + _lookup>( 'spine_mesh_attachment_get_num_uvs'); late final _spine_mesh_attachment_get_num_uvs = _spine_mesh_attachment_get_num_uvsPtr @@ -5931,7 +6350,7 @@ class SpineFlutterBindings { } late final _spine_mesh_attachment_get_num_trianglesPtr = - _lookup>( + _lookup>( 'spine_mesh_attachment_get_num_triangles'); late final _spine_mesh_attachment_get_num_triangles = _spine_mesh_attachment_get_num_trianglesPtr @@ -5993,7 +6412,7 @@ class SpineFlutterBindings { void Function( spine_mesh_attachment, double, double, double, double)>(); - ffi.Pointer spine_mesh_attachment_get_path( + ffi.Pointer spine_mesh_attachment_get_path( spine_mesh_attachment attachment, ) { return _spine_mesh_attachment_get_path( @@ -6003,11 +6422,11 @@ class SpineFlutterBindings { late final _spine_mesh_attachment_get_pathPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( spine_mesh_attachment)>>('spine_mesh_attachment_get_path'); late final _spine_mesh_attachment_get_path = _spine_mesh_attachment_get_pathPtr - .asFunction Function(spine_mesh_attachment)>(); + .asFunction Function(spine_mesh_attachment)>(); /// OMITTED setPath() spine_texture_region spine_mesh_attachment_get_region( @@ -6086,7 +6505,7 @@ class SpineFlutterBindings { } late final _spine_mesh_attachment_get_num_edgesPtr = - _lookup>( + _lookup>( 'spine_mesh_attachment_get_num_edges'); late final _spine_mesh_attachment_get_num_edges = _spine_mesh_attachment_get_num_edgesPtr @@ -6303,7 +6722,7 @@ class SpineFlutterBindings { } late final _spine_path_attachment_get_num_lengthsPtr = - _lookup>( + _lookup>( 'spine_path_attachment_get_num_lengths'); late final _spine_path_attachment_get_num_lengths = _spine_path_attachment_get_num_lengthsPtr @@ -6334,7 +6753,7 @@ class SpineFlutterBindings { } late final _spine_path_attachment_get_is_closedPtr = - _lookup>( + _lookup>( 'spine_path_attachment_get_is_closed'); late final _spine_path_attachment_get_is_closed = _spine_path_attachment_get_is_closedPtr @@ -6353,7 +6772,7 @@ class SpineFlutterBindings { late final _spine_path_attachment_set_is_closedPtr = _lookup< ffi.NativeFunction< ffi.Void Function(spine_path_attachment, - ffi.Int)>>('spine_path_attachment_set_is_closed'); + ffi.Int32)>>('spine_path_attachment_set_is_closed'); late final _spine_path_attachment_set_is_closed = _spine_path_attachment_set_is_closedPtr .asFunction(); @@ -6367,7 +6786,7 @@ class SpineFlutterBindings { } late final _spine_path_attachment_get_is_constant_speedPtr = - _lookup>( + _lookup>( 'spine_path_attachment_get_is_constant_speed'); late final _spine_path_attachment_get_is_constant_speed = _spine_path_attachment_get_is_constant_speedPtr @@ -6386,7 +6805,7 @@ class SpineFlutterBindings { late final _spine_path_attachment_set_is_constant_speedPtr = _lookup< ffi.NativeFunction< ffi.Void Function(spine_path_attachment, - ffi.Int)>>('spine_path_attachment_set_is_constant_speed'); + ffi.Int32)>>('spine_path_attachment_set_is_constant_speed'); late final _spine_path_attachment_set_is_constant_speed = _spine_path_attachment_set_is_constant_speedPtr .asFunction(); @@ -6434,7 +6853,7 @@ class SpineFlutterBindings { void spine_skin_set_attachment( spine_skin skin, int slotIndex, - ffi.Pointer name, + ffi.Pointer name, spine_attachment attachment, ) { return _spine_skin_set_attachment( @@ -6447,17 +6866,17 @@ class SpineFlutterBindings { late final _spine_skin_set_attachmentPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(spine_skin, ffi.Int, ffi.Pointer, + ffi.Void Function(spine_skin, ffi.Int32, ffi.Pointer, spine_attachment)>>('spine_skin_set_attachment'); late final _spine_skin_set_attachment = _spine_skin_set_attachmentPtr.asFunction< void Function( - spine_skin, int, ffi.Pointer, spine_attachment)>(); + spine_skin, int, ffi.Pointer, spine_attachment)>(); spine_attachment spine_skin_get_attachment( spine_skin skin, int slotIndex, - ffi.Pointer name, + ffi.Pointer name, ) { return _spine_skin_get_attachment( skin, @@ -6468,16 +6887,16 @@ class SpineFlutterBindings { late final _spine_skin_get_attachmentPtr = _lookup< ffi.NativeFunction< - spine_attachment Function(spine_skin, ffi.Int, - ffi.Pointer)>>('spine_skin_get_attachment'); + spine_attachment Function(spine_skin, ffi.Int32, + ffi.Pointer)>>('spine_skin_get_attachment'); late final _spine_skin_get_attachment = _spine_skin_get_attachmentPtr.asFunction< - spine_attachment Function(spine_skin, int, ffi.Pointer)>(); + spine_attachment Function(spine_skin, int, ffi.Pointer)>(); void spine_skin_remove_attachment( spine_skin skin, int slotIndex, - ffi.Pointer name, + ffi.Pointer name, ) { return _spine_skin_remove_attachment( skin, @@ -6488,14 +6907,14 @@ class SpineFlutterBindings { late final _spine_skin_remove_attachmentPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(spine_skin, ffi.Int, - ffi.Pointer)>>('spine_skin_remove_attachment'); + ffi.Void Function(spine_skin, ffi.Int32, + ffi.Pointer)>>('spine_skin_remove_attachment'); late final _spine_skin_remove_attachment = _spine_skin_remove_attachmentPtr - .asFunction)>(); + .asFunction)>(); /// OMITTED findNamesForSlot() /// OMITTED findAttachmentsForSlot() - ffi.Pointer spine_skin_get_name( + ffi.Pointer spine_skin_get_name( spine_skin skin, ) { return _spine_skin_get_name( @@ -6504,10 +6923,10 @@ class SpineFlutterBindings { } late final _spine_skin_get_namePtr = - _lookup Function(spine_skin)>>( + _lookup Function(spine_skin)>>( 'spine_skin_get_name'); late final _spine_skin_get_name = _spine_skin_get_namePtr - .asFunction Function(spine_skin)>(); + .asFunction Function(spine_skin)>(); void spine_skin_add_skin( spine_skin skin, @@ -6541,7 +6960,7 @@ class SpineFlutterBindings { late final _spine_skin_copy_skin = _spine_skin_copy_skinPtr .asFunction(); - ffi.Pointer spine_skin_get_entries( + spine_skin_entries spine_skin_get_entries( spine_skin skin, ) { return _spine_skin_get_entries( @@ -6549,27 +6968,101 @@ class SpineFlutterBindings { ); } - late final _spine_skin_get_entriesPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - spine_skin)>>('spine_skin_get_entries'); + late final _spine_skin_get_entriesPtr = + _lookup>( + 'spine_skin_get_entries'); late final _spine_skin_get_entries = _spine_skin_get_entriesPtr - .asFunction Function(spine_skin)>(); + .asFunction(); + + int spine_skin_entries_get_num_entries( + spine_skin_entries entries, + ) { + return _spine_skin_entries_get_num_entries( + entries, + ); + } + + late final _spine_skin_entries_get_num_entriesPtr = + _lookup>( + 'spine_skin_entries_get_num_entries'); + late final _spine_skin_entries_get_num_entries = + _spine_skin_entries_get_num_entriesPtr + .asFunction(); + + spine_skin_entry spine_skin_entries_get_entry( + spine_skin_entries entries, + int index, + ) { + return _spine_skin_entries_get_entry( + entries, + index, + ); + } + + late final _spine_skin_entries_get_entryPtr = _lookup< + ffi.NativeFunction< + spine_skin_entry Function( + spine_skin_entries, ffi.Int32)>>('spine_skin_entries_get_entry'); + late final _spine_skin_entries_get_entry = _spine_skin_entries_get_entryPtr + .asFunction(); void spine_skin_entries_dispose( - ffi.Pointer entries, + spine_skin_entries entries, ) { return _spine_skin_entries_dispose( entries, ); } - late final _spine_skin_entries_disposePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer)>>('spine_skin_entries_dispose'); + late final _spine_skin_entries_disposePtr = + _lookup>( + 'spine_skin_entries_dispose'); late final _spine_skin_entries_dispose = _spine_skin_entries_disposePtr - .asFunction)>(); + .asFunction(); + + int spine_skin_entry_get_slot_index( + spine_skin_entry entry, + ) { + return _spine_skin_entry_get_slot_index( + entry, + ); + } + + late final _spine_skin_entry_get_slot_indexPtr = + _lookup>( + 'spine_skin_entry_get_slot_index'); + late final _spine_skin_entry_get_slot_index = + _spine_skin_entry_get_slot_indexPtr + .asFunction(); + + ffi.Pointer spine_skin_entry_get_name( + spine_skin_entry entry, + ) { + return _spine_skin_entry_get_name( + entry, + ); + } + + late final _spine_skin_entry_get_namePtr = + _lookup Function(spine_skin_entry)>>( + 'spine_skin_entry_get_name'); + late final _spine_skin_entry_get_name = _spine_skin_entry_get_namePtr + .asFunction Function(spine_skin_entry)>(); + + spine_attachment spine_skin_entry_get_attachment( + spine_skin_entry entry, + ) { + return _spine_skin_entry_get_attachment( + entry, + ); + } + + late final _spine_skin_entry_get_attachmentPtr = + _lookup>( + 'spine_skin_entry_get_attachment'); + late final _spine_skin_entry_get_attachment = + _spine_skin_entry_get_attachmentPtr + .asFunction(); int spine_skin_get_num_bones( spine_skin skin, @@ -6580,7 +7073,7 @@ class SpineFlutterBindings { } late final _spine_skin_get_num_bonesPtr = - _lookup>( + _lookup>( 'spine_skin_get_num_bones'); late final _spine_skin_get_num_bones = _spine_skin_get_num_bonesPtr.asFunction(); @@ -6609,7 +7102,7 @@ class SpineFlutterBindings { } late final _spine_skin_get_num_constraintsPtr = - _lookup>( + _lookup>( 'spine_skin_get_num_constraints'); late final _spine_skin_get_num_constraints = _spine_skin_get_num_constraintsPtr.asFunction(); @@ -6630,7 +7123,7 @@ class SpineFlutterBindings { .asFunction Function(spine_skin)>(); spine_skin spine_skin_create( - ffi.Pointer name, + ffi.Pointer name, ) { return _spine_skin_create( name, @@ -6638,10 +7131,10 @@ class SpineFlutterBindings { } late final _spine_skin_createPtr = - _lookup)>>( + _lookup)>>( 'spine_skin_create'); late final _spine_skin_create = _spine_skin_createPtr - .asFunction)>(); + .asFunction)>(); void spine_skin_dispose( spine_skin skin, @@ -6672,7 +7165,7 @@ class SpineFlutterBindings { _spine_constraint_data_get_typePtr .asFunction(); - ffi.Pointer spine_constraint_data_get_name( + ffi.Pointer spine_constraint_data_get_name( spine_constraint_data data, ) { return _spine_constraint_data_get_name( @@ -6682,11 +7175,11 @@ class SpineFlutterBindings { late final _spine_constraint_data_get_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( spine_constraint_data)>>('spine_constraint_data_get_name'); late final _spine_constraint_data_get_name = _spine_constraint_data_get_namePtr - .asFunction Function(spine_constraint_data)>(); + .asFunction Function(spine_constraint_data)>(); int spine_constraint_data_get_order( spine_constraint_data data, @@ -6730,7 +7223,7 @@ class SpineFlutterBindings { } late final _spine_constraint_data_get_is_skin_requiredPtr = - _lookup>( + _lookup>( 'spine_constraint_data_get_is_skin_required'); late final _spine_constraint_data_get_is_skin_required = _spine_constraint_data_get_is_skin_requiredPtr @@ -6749,7 +7242,7 @@ class SpineFlutterBindings { late final _spine_constraint_data_set_is_skin_requiredPtr = _lookup< ffi.NativeFunction< ffi.Void Function(spine_constraint_data, - ffi.Int)>>('spine_constraint_data_set_is_skin_required'); + ffi.Int32)>>('spine_constraint_data_set_is_skin_required'); late final _spine_constraint_data_set_is_skin_required = _spine_constraint_data_set_is_skin_requiredPtr .asFunction(); @@ -6763,7 +7256,7 @@ class SpineFlutterBindings { } late final _spine_ik_constraint_data_get_num_bonesPtr = - _lookup>( + _lookup>( 'spine_ik_constraint_data_get_num_bones'); late final _spine_ik_constraint_data_get_num_bones = _spine_ik_constraint_data_get_num_bonesPtr @@ -6828,7 +7321,7 @@ class SpineFlutterBindings { } late final _spine_ik_constraint_data_get_bend_directionPtr = - _lookup>( + _lookup>( 'spine_ik_constraint_data_get_bend_direction'); late final _spine_ik_constraint_data_get_bend_direction = _spine_ik_constraint_data_get_bend_directionPtr @@ -6847,7 +7340,7 @@ class SpineFlutterBindings { late final _spine_ik_constraint_data_set_bend_directionPtr = _lookup< ffi.NativeFunction< ffi.Void Function(spine_ik_constraint_data, - ffi.Int)>>('spine_ik_constraint_data_set_bend_direction'); + ffi.Int32)>>('spine_ik_constraint_data_set_bend_direction'); late final _spine_ik_constraint_data_set_bend_direction = _spine_ik_constraint_data_set_bend_directionPtr .asFunction(); @@ -6861,7 +7354,7 @@ class SpineFlutterBindings { } late final _spine_ik_constraint_data_get_compressPtr = - _lookup>( + _lookup>( 'spine_ik_constraint_data_get_compress'); late final _spine_ik_constraint_data_get_compress = _spine_ik_constraint_data_get_compressPtr @@ -6880,7 +7373,7 @@ class SpineFlutterBindings { late final _spine_ik_constraint_data_set_compressPtr = _lookup< ffi.NativeFunction< ffi.Void Function(spine_ik_constraint_data, - ffi.Int)>>('spine_ik_constraint_data_set_compress'); + ffi.Int32)>>('spine_ik_constraint_data_set_compress'); late final _spine_ik_constraint_data_set_compress = _spine_ik_constraint_data_set_compressPtr .asFunction(); @@ -6894,7 +7387,7 @@ class SpineFlutterBindings { } late final _spine_ik_constraint_data_get_stretchPtr = - _lookup>( + _lookup>( 'spine_ik_constraint_data_get_stretch'); late final _spine_ik_constraint_data_get_stretch = _spine_ik_constraint_data_get_stretchPtr @@ -6913,7 +7406,7 @@ class SpineFlutterBindings { late final _spine_ik_constraint_data_set_stretchPtr = _lookup< ffi.NativeFunction< ffi.Void Function(spine_ik_constraint_data, - ffi.Int)>>('spine_ik_constraint_data_set_stretch'); + ffi.Int32)>>('spine_ik_constraint_data_set_stretch'); late final _spine_ik_constraint_data_set_stretch = _spine_ik_constraint_data_set_stretchPtr .asFunction(); @@ -6927,7 +7420,7 @@ class SpineFlutterBindings { } late final _spine_ik_constraint_data_get_uniformPtr = - _lookup>( + _lookup>( 'spine_ik_constraint_data_get_uniform'); late final _spine_ik_constraint_data_get_uniform = _spine_ik_constraint_data_get_uniformPtr @@ -6946,7 +7439,7 @@ class SpineFlutterBindings { late final _spine_ik_constraint_data_set_uniformPtr = _lookup< ffi.NativeFunction< ffi.Void Function(spine_ik_constraint_data, - ffi.Int)>>('spine_ik_constraint_data_set_uniform'); + ffi.Int32)>>('spine_ik_constraint_data_set_uniform'); late final _spine_ik_constraint_data_set_uniform = _spine_ik_constraint_data_set_uniformPtr .asFunction(); @@ -7040,7 +7533,7 @@ class SpineFlutterBindings { } late final _spine_ik_constraint_get_orderPtr = - _lookup>( + _lookup>( 'spine_ik_constraint_get_order'); late final _spine_ik_constraint_get_order = _spine_ik_constraint_get_orderPtr .asFunction(); @@ -7069,7 +7562,7 @@ class SpineFlutterBindings { } late final _spine_ik_constraint_get_num_bonesPtr = - _lookup>( + _lookup>( 'spine_ik_constraint_get_num_bones'); late final _spine_ik_constraint_get_num_bones = _spine_ik_constraint_get_num_bonesPtr @@ -7132,7 +7625,7 @@ class SpineFlutterBindings { } late final _spine_ik_constraint_get_bend_directionPtr = - _lookup>( + _lookup>( 'spine_ik_constraint_get_bend_direction'); late final _spine_ik_constraint_get_bend_direction = _spine_ik_constraint_get_bend_directionPtr @@ -7149,8 +7642,9 @@ class SpineFlutterBindings { } late final _spine_ik_constraint_set_bend_directionPtr = _lookup< - ffi.NativeFunction>( - 'spine_ik_constraint_set_bend_direction'); + ffi.NativeFunction< + ffi.Void Function(spine_ik_constraint, + ffi.Int32)>>('spine_ik_constraint_set_bend_direction'); late final _spine_ik_constraint_set_bend_direction = _spine_ik_constraint_set_bend_directionPtr .asFunction(); @@ -7164,7 +7658,7 @@ class SpineFlutterBindings { } late final _spine_ik_constraint_get_compressPtr = - _lookup>( + _lookup>( 'spine_ik_constraint_get_compress'); late final _spine_ik_constraint_get_compress = _spine_ik_constraint_get_compressPtr @@ -7181,8 +7675,9 @@ class SpineFlutterBindings { } late final _spine_ik_constraint_set_compressPtr = _lookup< - ffi.NativeFunction>( - 'spine_ik_constraint_set_compress'); + ffi.NativeFunction< + ffi.Void Function(spine_ik_constraint, + ffi.Int32)>>('spine_ik_constraint_set_compress'); late final _spine_ik_constraint_set_compress = _spine_ik_constraint_set_compressPtr .asFunction(); @@ -7196,7 +7691,7 @@ class SpineFlutterBindings { } late final _spine_ik_constraint_get_stretchPtr = - _lookup>( + _lookup>( 'spine_ik_constraint_get_stretch'); late final _spine_ik_constraint_get_stretch = _spine_ik_constraint_get_stretchPtr @@ -7213,8 +7708,9 @@ class SpineFlutterBindings { } late final _spine_ik_constraint_set_stretchPtr = _lookup< - ffi.NativeFunction>( - 'spine_ik_constraint_set_stretch'); + ffi.NativeFunction< + ffi.Void Function(spine_ik_constraint, + ffi.Int32)>>('spine_ik_constraint_set_stretch'); late final _spine_ik_constraint_set_stretch = _spine_ik_constraint_set_stretchPtr .asFunction(); @@ -7292,7 +7788,7 @@ class SpineFlutterBindings { } late final _spine_ik_constraint_get_is_activePtr = - _lookup>( + _lookup>( 'spine_ik_constraint_get_is_active'); late final _spine_ik_constraint_get_is_active = _spine_ik_constraint_get_is_activePtr @@ -7309,8 +7805,9 @@ class SpineFlutterBindings { } late final _spine_ik_constraint_set_is_activePtr = _lookup< - ffi.NativeFunction>( - 'spine_ik_constraint_set_is_active'); + ffi.NativeFunction< + ffi.Void Function(spine_ik_constraint, + ffi.Int32)>>('spine_ik_constraint_set_is_active'); late final _spine_ik_constraint_set_is_active = _spine_ik_constraint_set_is_activePtr .asFunction(); @@ -7325,7 +7822,7 @@ class SpineFlutterBindings { late final _spine_transform_constraint_data_get_num_bonesPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(spine_transform_constraint_data)>>( + ffi.Int32 Function(spine_transform_constraint_data)>>( 'spine_transform_constraint_data_get_num_bones'); late final _spine_transform_constraint_data_get_num_bones = _spine_transform_constraint_data_get_num_bonesPtr @@ -7801,7 +8298,7 @@ class SpineFlutterBindings { late final _spine_transform_constraint_data_get_is_relativePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(spine_transform_constraint_data)>>( + ffi.Int32 Function(spine_transform_constraint_data)>>( 'spine_transform_constraint_data_get_is_relative'); late final _spine_transform_constraint_data_get_is_relative = _spine_transform_constraint_data_get_is_relativePtr @@ -7820,7 +8317,7 @@ class SpineFlutterBindings { late final _spine_transform_constraint_data_set_is_relativePtr = _lookup< ffi.NativeFunction< ffi.Void Function(spine_transform_constraint_data, - ffi.Int)>>('spine_transform_constraint_data_set_is_relative'); + ffi.Int32)>>('spine_transform_constraint_data_set_is_relative'); late final _spine_transform_constraint_data_set_is_relative = _spine_transform_constraint_data_set_is_relativePtr .asFunction(); @@ -7835,7 +8332,7 @@ class SpineFlutterBindings { late final _spine_transform_constraint_data_get_is_localPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(spine_transform_constraint_data)>>( + ffi.Int32 Function(spine_transform_constraint_data)>>( 'spine_transform_constraint_data_get_is_local'); late final _spine_transform_constraint_data_get_is_local = _spine_transform_constraint_data_get_is_localPtr @@ -7854,7 +8351,7 @@ class SpineFlutterBindings { late final _spine_transform_constraint_data_set_is_localPtr = _lookup< ffi.NativeFunction< ffi.Void Function(spine_transform_constraint_data, - ffi.Int)>>('spine_transform_constraint_data_set_is_local'); + ffi.Int32)>>('spine_transform_constraint_data_set_is_local'); late final _spine_transform_constraint_data_set_is_local = _spine_transform_constraint_data_set_is_localPtr .asFunction(); @@ -7882,9 +8379,9 @@ class SpineFlutterBindings { ); } - late final _spine_transform_constraint_get_orderPtr = - _lookup>( - 'spine_transform_constraint_get_order'); + late final _spine_transform_constraint_get_orderPtr = _lookup< + ffi.NativeFunction>( + 'spine_transform_constraint_get_order'); late final _spine_transform_constraint_get_order = _spine_transform_constraint_get_orderPtr .asFunction(); @@ -7915,9 +8412,9 @@ class SpineFlutterBindings { ); } - late final _spine_transform_constraint_get_num_bonesPtr = - _lookup>( - 'spine_transform_constraint_get_num_bones'); + late final _spine_transform_constraint_get_num_bonesPtr = _lookup< + ffi.NativeFunction>( + 'spine_transform_constraint_get_num_bones'); late final _spine_transform_constraint_get_num_bones = _spine_transform_constraint_get_num_bonesPtr .asFunction(); @@ -8197,7 +8694,7 @@ class SpineFlutterBindings { late final _spine_transform_constraint_set_is_activePtr = _lookup< ffi.NativeFunction< ffi.Void Function(spine_transform_constraint, - ffi.Int)>>('spine_transform_constraint_set_is_active'); + ffi.Int32)>>('spine_transform_constraint_set_is_active'); late final _spine_transform_constraint_set_is_active = _spine_transform_constraint_set_is_activePtr .asFunction(); @@ -8210,9 +8707,9 @@ class SpineFlutterBindings { ); } - late final _spine_path_constraint_data_get_num_bonesPtr = - _lookup>( - 'spine_path_constraint_data_get_num_bones'); + late final _spine_path_constraint_data_get_num_bonesPtr = _lookup< + ffi.NativeFunction>( + 'spine_path_constraint_data_get_num_bones'); late final _spine_path_constraint_data_get_num_bones = _spine_path_constraint_data_get_num_bonesPtr .asFunction(); @@ -8588,7 +9085,7 @@ class SpineFlutterBindings { } late final _spine_path_constraint_get_orderPtr = - _lookup>( + _lookup>( 'spine_path_constraint_get_order'); late final _spine_path_constraint_get_order = _spine_path_constraint_get_orderPtr @@ -8619,7 +9116,7 @@ class SpineFlutterBindings { } late final _spine_path_constraint_get_num_bonesPtr = - _lookup>( + _lookup>( 'spine_path_constraint_get_num_bones'); late final _spine_path_constraint_get_num_bones = _spine_path_constraint_get_num_bonesPtr @@ -8848,7 +9345,7 @@ class SpineFlutterBindings { } late final _spine_path_constraint_get_is_activePtr = - _lookup>( + _lookup>( 'spine_path_constraint_get_is_active'); late final _spine_path_constraint_get_is_active = _spine_path_constraint_get_is_activePtr @@ -8867,7 +9364,7 @@ class SpineFlutterBindings { late final _spine_path_constraint_set_is_activePtr = _lookup< ffi.NativeFunction< ffi.Void Function(spine_path_constraint, - ffi.Int)>>('spine_path_constraint_set_is_active'); + ffi.Int32)>>('spine_path_constraint_set_is_active'); late final _spine_path_constraint_set_is_active = _spine_path_constraint_set_is_activePtr .asFunction(); @@ -8892,9 +9389,9 @@ class SpineFlutterBindings { late final _spine_sequence_apply = _spine_sequence_applyPtr.asFunction< void Function(spine_sequence, spine_slot, spine_attachment)>(); - ffi.Pointer spine_sequence_get_path( + ffi.Pointer spine_sequence_get_path( spine_sequence sequence, - ffi.Pointer basePath, + ffi.Pointer basePath, int index, ) { return _spine_sequence_get_path( @@ -8906,11 +9403,10 @@ class SpineFlutterBindings { late final _spine_sequence_get_pathPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(spine_sequence, ffi.Pointer, - ffi.Int)>>('spine_sequence_get_path'); + ffi.Pointer Function(spine_sequence, ffi.Pointer, + ffi.Int32)>>('spine_sequence_get_path'); late final _spine_sequence_get_path = _spine_sequence_get_pathPtr.asFunction< - ffi.Pointer Function( - spine_sequence, ffi.Pointer, int)>(); + ffi.Pointer Function(spine_sequence, ffi.Pointer, int)>(); int spine_sequence_get_id( spine_sequence sequence, @@ -8921,7 +9417,7 @@ class SpineFlutterBindings { } late final _spine_sequence_get_idPtr = - _lookup>( + _lookup>( 'spine_sequence_get_id'); late final _spine_sequence_get_id = _spine_sequence_get_idPtr.asFunction(); @@ -8937,7 +9433,7 @@ class SpineFlutterBindings { } late final _spine_sequence_set_idPtr = - _lookup>( + _lookup>( 'spine_sequence_set_id'); late final _spine_sequence_set_id = _spine_sequence_set_idPtr .asFunction(); @@ -8951,7 +9447,7 @@ class SpineFlutterBindings { } late final _spine_sequence_get_startPtr = - _lookup>( + _lookup>( 'spine_sequence_get_start'); late final _spine_sequence_get_start = _spine_sequence_get_startPtr.asFunction(); @@ -8967,7 +9463,7 @@ class SpineFlutterBindings { } late final _spine_sequence_set_startPtr = - _lookup>( + _lookup>( 'spine_sequence_set_start'); late final _spine_sequence_set_start = _spine_sequence_set_startPtr .asFunction(); @@ -8981,7 +9477,7 @@ class SpineFlutterBindings { } late final _spine_sequence_get_digitsPtr = - _lookup>( + _lookup>( 'spine_sequence_get_digits'); late final _spine_sequence_get_digits = _spine_sequence_get_digitsPtr.asFunction(); @@ -8997,7 +9493,7 @@ class SpineFlutterBindings { } late final _spine_sequence_set_digitsPtr = - _lookup>( + _lookup>( 'spine_sequence_set_digits'); late final _spine_sequence_set_digits = _spine_sequence_set_digitsPtr .asFunction(); @@ -9011,7 +9507,7 @@ class SpineFlutterBindings { } late final _spine_sequence_get_setup_indexPtr = - _lookup>( + _lookup>( 'spine_sequence_get_setup_index'); late final _spine_sequence_get_setup_index = _spine_sequence_get_setup_indexPtr @@ -9028,7 +9524,7 @@ class SpineFlutterBindings { } late final _spine_sequence_set_setup_indexPtr = - _lookup>( + _lookup>( 'spine_sequence_set_setup_index'); late final _spine_sequence_set_setup_index = _spine_sequence_set_setup_indexPtr @@ -9043,7 +9539,7 @@ class SpineFlutterBindings { } late final _spine_sequence_get_num_regionsPtr = - _lookup>( + _lookup>( 'spine_sequence_get_num_regions'); late final _spine_sequence_get_num_regions = _spine_sequence_get_num_regionsPtr @@ -9231,7 +9727,7 @@ class SpineFlutterBindings { } late final _spine_texture_region_get_degreesPtr = - _lookup>( + _lookup>( 'spine_texture_region_get_degrees'); late final _spine_texture_region_get_degrees = _spine_texture_region_get_degreesPtr @@ -9248,8 +9744,9 @@ class SpineFlutterBindings { } late final _spine_texture_region_set_degreesPtr = _lookup< - ffi.NativeFunction>( - 'spine_texture_region_set_degrees'); + ffi.NativeFunction< + ffi.Void Function(spine_texture_region, + ffi.Int32)>>('spine_texture_region_set_degrees'); late final _spine_texture_region_set_degrees = _spine_texture_region_set_degreesPtr .asFunction(); @@ -9329,7 +9826,7 @@ class SpineFlutterBindings { } late final _spine_texture_region_get_widthPtr = - _lookup>( + _lookup>( 'spine_texture_region_get_width'); late final _spine_texture_region_get_width = _spine_texture_region_get_widthPtr @@ -9346,8 +9843,9 @@ class SpineFlutterBindings { } late final _spine_texture_region_set_widthPtr = _lookup< - ffi.NativeFunction>( - 'spine_texture_region_set_width'); + ffi.NativeFunction< + ffi.Void Function(spine_texture_region, + ffi.Int32)>>('spine_texture_region_set_width'); late final _spine_texture_region_set_width = _spine_texture_region_set_widthPtr .asFunction(); @@ -9361,7 +9859,7 @@ class SpineFlutterBindings { } late final _spine_texture_region_get_heightPtr = - _lookup>( + _lookup>( 'spine_texture_region_get_height'); late final _spine_texture_region_get_height = _spine_texture_region_get_heightPtr @@ -9378,8 +9876,9 @@ class SpineFlutterBindings { } late final _spine_texture_region_set_heightPtr = _lookup< - ffi.NativeFunction>( - 'spine_texture_region_set_height'); + ffi.NativeFunction< + ffi.Void Function(spine_texture_region, + ffi.Int32)>>('spine_texture_region_set_height'); late final _spine_texture_region_set_height = _spine_texture_region_set_heightPtr .asFunction(); @@ -9393,7 +9892,7 @@ class SpineFlutterBindings { } late final _spine_texture_region_get_original_widthPtr = - _lookup>( + _lookup>( 'spine_texture_region_get_original_width'); late final _spine_texture_region_get_original_width = _spine_texture_region_get_original_widthPtr @@ -9410,8 +9909,9 @@ class SpineFlutterBindings { } late final _spine_texture_region_set_original_widthPtr = _lookup< - ffi.NativeFunction>( - 'spine_texture_region_set_original_width'); + ffi.NativeFunction< + ffi.Void Function(spine_texture_region, + ffi.Int32)>>('spine_texture_region_set_original_width'); late final _spine_texture_region_set_original_width = _spine_texture_region_set_original_widthPtr .asFunction(); @@ -9425,7 +9925,7 @@ class SpineFlutterBindings { } late final _spine_texture_region_get_original_heightPtr = - _lookup>( + _lookup>( 'spine_texture_region_get_original_height'); late final _spine_texture_region_get_original_height = _spine_texture_region_get_original_heightPtr @@ -9442,8 +9942,9 @@ class SpineFlutterBindings { } late final _spine_texture_region_set_original_heightPtr = _lookup< - ffi.NativeFunction>( - 'spine_texture_region_set_original_height'); + ffi.NativeFunction< + ffi.Void Function(spine_texture_region, + ffi.Int32)>>('spine_texture_region_set_original_height'); late final _spine_texture_region_set_original_height = _spine_texture_region_set_original_heightPtr .asFunction(); @@ -9513,24 +10014,23 @@ class spine_track_entry_wrapper extends ffi.Opaque {} class spine_animation_wrapper extends ffi.Opaque {} -class spine_atlas extends ffi.Struct { - external ffi.Pointer atlas; +class spine_atlas_wrapper extends ffi.Opaque {} - external ffi.Pointer> imagePaths; +class spine_skeleton_data_result_wrapper extends ffi.Opaque {} - @ffi.Int() - external int numImagePaths; +class spine_render_command_wrapper extends ffi.Opaque {} - external ffi.Pointer error; -} +class spine_bounds_wrapper extends ffi.Opaque {} -class spine_skeleton_data_result extends ffi.Struct { - external spine_skeleton_data skeletonData; +class spine_color_wrapper extends ffi.Opaque {} - external ffi.Pointer error; -} +class spine_vector_wrapper extends ffi.Opaque {} -typedef spine_skeleton_data = ffi.Pointer; +class spine_skeleton_drawable_wrapper extends ffi.Opaque {} + +class spine_skin_entry_wrapper extends ffi.Opaque {} + +class spine_skin_entries_wrapper extends ffi.Opaque {} abstract class spine_blend_mode { static const int SPINE_BLEND_MODE_NORMAL = 0; @@ -9596,105 +10096,14 @@ abstract class spine_rotate_mode { static const int SPINE_ROTATE_MODE_CHAIN_SCALE = 2; } -class spine_render_command extends ffi.Struct { - external ffi.Pointer positions; - - external ffi.Pointer uvs; - - external ffi.Pointer colors; - - @ffi.Int() - external int numVertices; - - external ffi.Pointer indices; - - @ffi.Int() - external int numIndices; - - @ffi.Int() - external int atlasPage; - - @ffi.Int32() - external int blendMode; - - external ffi.Pointer next; -} - -class spine_bounds extends ffi.Struct { - @ffi.Float() - external double x; - - @ffi.Float() - external double y; - - @ffi.Float() - external double width; - - @ffi.Float() - external double height; -} - -class spine_color extends ffi.Struct { - @ffi.Float() - external double r; - - @ffi.Float() - external double g; - - @ffi.Float() - external double b; - - @ffi.Float() - external double a; -} - -class spine_vector extends ffi.Struct { - @ffi.Float() - external double x; - - @ffi.Float() - external double y; -} - -class spine_skeleton_drawable extends ffi.Struct { - external spine_skeleton skeleton; - - external spine_animation_state animationState; - - external spine_animation_state_data animationStateData; - - external spine_animation_state_events animationStateEvents; - - external ffi.Pointer clipping; - - external ffi.Pointer renderCommand; -} - -typedef spine_skeleton = ffi.Pointer; -typedef spine_animation_state = ffi.Pointer; -typedef spine_animation_state_data - = ffi.Pointer; -typedef spine_animation_state_events - = ffi.Pointer; - -class spine_skin_entry extends ffi.Struct { - @ffi.Int() - external int slotIndex; - - external ffi.Pointer name; - - external spine_attachment attachment; -} - -typedef spine_attachment = ffi.Pointer; - -class spine_skin_entries extends ffi.Struct { - @ffi.Int() - external int numEntries; - - external ffi.Pointer entries; -} - +typedef spine_color = ffi.Pointer; +typedef spine_bounds = ffi.Pointer; +typedef spine_vector = ffi.Pointer; +typedef spine_atlas = ffi.Pointer; +typedef utf8 = ffi.Uint8; +typedef spine_skeleton_data_result + = ffi.Pointer; +typedef spine_skeleton_data = ffi.Pointer; typedef spine_bone_data = ffi.Pointer; typedef spine_slot_data = ffi.Pointer; typedef spine_skin = ffi.Pointer; @@ -9706,10 +10115,19 @@ typedef spine_transform_constraint_data = ffi.Pointer; typedef spine_path_constraint_data = ffi.Pointer; +typedef spine_skeleton_drawable = ffi.Pointer; +typedef spine_render_command = ffi.Pointer; +typedef spine_skeleton = ffi.Pointer; +typedef spine_animation_state = ffi.Pointer; +typedef spine_animation_state_data + = ffi.Pointer; +typedef spine_animation_state_events + = ffi.Pointer; typedef spine_track_entry = ffi.Pointer; typedef spine_event = ffi.Pointer; typedef spine_bone = ffi.Pointer; typedef spine_slot = ffi.Pointer; +typedef spine_attachment = ffi.Pointer; typedef spine_ik_constraint = ffi.Pointer; typedef spine_transform_constraint = ffi.Pointer; @@ -9725,4 +10143,6 @@ typedef spine_clipping_attachment typedef spine_bounding_box_attachment = ffi.Pointer; typedef spine_path_attachment = ffi.Pointer; +typedef spine_skin_entries = ffi.Pointer; +typedef spine_skin_entry = ffi.Pointer; typedef spine_constraint_data = ffi.Pointer; diff --git a/spine-flutter/pubspec.yaml b/spine-flutter/pubspec.yaml index ab7284582..e6d612c14 100644 --- a/spine-flutter/pubspec.yaml +++ b/spine-flutter/pubspec.yaml @@ -12,6 +12,8 @@ dependencies: sdk: flutter plugin_platform_interface: ^2.0.2 ffi: ^2.0.1 + web_ffi: ^0.7.2 + inject_js: ^2.0.0 http: ^0.13.5 dev_dependencies: diff --git a/spine-flutter/src/compile-wasm.sh b/spine-flutter/src/compile-wasm.sh new file mode 100755 index 000000000..f9bc23c29 --- /dev/null +++ b/spine-flutter/src/compile-wasm.sh @@ -0,0 +1,5 @@ +#!/bin/sh +dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +pushd $dir > /dev/null +emcc -Ispine-cpp/include --closure 1 -O3 -fno-rtti -fno-exceptions -s MAIN_MODULE=1 -s EXPORT_NAME=libspine_flutter -s MODULARIZE=1 spine_flutter.cpp `find spine-cpp/src -type f` -o ../lib/assets/libspine_flutter.js +popd \ No newline at end of file diff --git a/spine-flutter/src/spine_flutter.cpp b/spine-flutter/src/spine_flutter.cpp index 11e58e095..e295eb987 100644 --- a/spine-flutter/src/spine_flutter.cpp +++ b/spine-flutter/src/spine_flutter.cpp @@ -49,140 +49,283 @@ struct EventListener: public AnimationStateListenerObject { } }; +typedef struct _spine_atlas { + void *atlas; + utf8 **imagePaths; + int32_t numImagePaths; + utf8 *error; +} _spine_atlas; + +typedef struct _spine_skeleton_data_result { + spine_skeleton_data skeletonData; + utf8 *error; +} _spine_skeleton_data_result; + +typedef struct _spine_render_command { + float *positions; + float *uvs; + int32_t *colors; + int32_t numVertices; + uint16_t *indices; + int32_t numIndices; + int32_t atlasPage; + spine_blend_mode blendMode; + struct _spine_render_command *next; +} _spine_render_command; + +typedef struct _spine_bounds { + float x, y, width, height; +} _spine_bounds; + +typedef struct _spine_vector { + float x, y; +} _spine_vector; + +typedef struct _spine_skeleton_drawable { + spine_skeleton skeleton; + spine_animation_state animationState; + spine_animation_state_data animationStateData; + spine_animation_state_events animationStateEvents; + void *clipping; + _spine_render_command *renderCommand; +} _spine_skeleton_drawable; + +typedef struct _spine_skin_entry { + int32_t slotIndex; + utf8 *name; + spine_attachment attachment; +} _spine_skin_entry; + +typedef struct _spine_skin_entries { + int32_t numEntries; + _spine_skin_entry* entries; +} _spine_skin_entries; + +static Color NULL_COLOR(0, 0, 0, 0); + spine::SpineExtension *spine::getDefaultExtension() { return new spine::DebugExtension(new spine::DefaultSpineExtension()); } -FFI_PLUGIN_EXPORT int spine_major_version() { +FFI_PLUGIN_EXPORT int32_t spine_major_version() { return SPINE_MAJOR_VERSION; } -FFI_PLUGIN_EXPORT int spine_minor_version() { +FFI_PLUGIN_EXPORT int32_t spine_minor_version() { return SPINE_MINOR_VERSION; } -// Atlas - -FFI_PLUGIN_EXPORT spine_atlas* spine_atlas_load(const char *atlasData) { - if (!atlasData) return nullptr; - int length = (int)strlen(atlasData); - auto atlas = new (__FILE__, __LINE__) Atlas(atlasData, length, "", (TextureLoader*)nullptr, false); - spine_atlas *result = SpineExtension::calloc(1, __FILE__, __LINE__); - result->atlas = atlas; - result->numImagePaths = (int)atlas->getPages().size(); - result->imagePaths = SpineExtension::calloc(result->numImagePaths, __FILE__, __LINE__); - for (int i = 0; i < result->numImagePaths; i++) { - result->imagePaths[i] = strdup(atlas->getPages()[i]->texturePath.buffer()); - } - return result; -} - void spine_report_leaks() { ((DebugExtension*)spine::SpineExtension::getInstance())->reportLeaks(); } -FFI_PLUGIN_EXPORT void spine_atlas_dispose(spine_atlas *atlas) { - if (!atlas) return; - if (atlas->atlas) delete (Atlas*)atlas->atlas; - if (atlas->error) free(atlas->error); - for (int i = 0; i < atlas->numImagePaths; i++) { - free(atlas->imagePaths[i]); +// Color + +FFI_PLUGIN_EXPORT float spine_color_get_r(spine_color color) { + if (!color) return 0; + return ((Color*)color)->r; +} + +FFI_PLUGIN_EXPORT float spine_color_get_g(spine_color color) { + if (!color) return 0; + return ((Color*)color)->g; +} + +FFI_PLUGIN_EXPORT float spine_color_get_b(spine_color color) { + if (!color) return 0; + return ((Color*)color)->b; +} + +FFI_PLUGIN_EXPORT float spine_color_get_a(spine_color color) { + if (!color) return 0; + return ((Color*)color)->a; +} + +// Bounds + +FFI_PLUGIN_EXPORT float spine_bounds_get_x(spine_bounds bounds) { + if (!bounds) return 0; + return ((_spine_bounds*)bounds)->x; +} + +FFI_PLUGIN_EXPORT float spine_bounds_get_y(spine_bounds bounds) { + if (!bounds) return 0; + return ((_spine_bounds*)bounds)->y; +} + +FFI_PLUGIN_EXPORT float spine_bounds_get_width(spine_bounds bounds) { + if (!bounds) return 0; + return ((_spine_bounds*)bounds)->width; +} + +FFI_PLUGIN_EXPORT float spine_bounds_get_height(spine_bounds bounds) { + if (!bounds) return 0; + return ((_spine_bounds*)bounds)->height; +} + +// Vector +FFI_PLUGIN_EXPORT float spine_vector_get_x(spine_vector vector) { + if (!vector) return 0; + return ((_spine_vector*)vector)->x; +} + +FFI_PLUGIN_EXPORT float spine_vector_get_y(spine_vector vector) { + if (!vector) return 0; + return ((_spine_vector*)vector)->y; +} + +// Atlas + +FFI_PLUGIN_EXPORT spine_atlas spine_atlas_load(const utf8 *atlasData) { + if (!atlasData) return nullptr; + int32_t length = (int32_t)strlen((char*)atlasData); + auto atlas = new (__FILE__, __LINE__) Atlas((char*)atlasData, length, "", (TextureLoader*)nullptr, false); + _spine_atlas *result = SpineExtension::calloc<_spine_atlas>(1, __FILE__, __LINE__); + result->atlas = atlas; + result->numImagePaths = (int32_t)atlas->getPages().size(); + result->imagePaths = SpineExtension::calloc(result->numImagePaths, __FILE__, __LINE__); + for (int i = 0; i < result->numImagePaths; i++) { + result->imagePaths[i] = (utf8*)strdup(atlas->getPages()[i]->texturePath.buffer()); } - SpineExtension::free(atlas->imagePaths, __FILE__, __LINE__); - SpineExtension::free(atlas, __FILE__, __LINE__); + return (spine_atlas)result; +} + +FFI_PLUGIN_EXPORT int32_t spine_atlas_get_num_image_paths(spine_atlas atlas) { + if (!atlas) return 0; + return ((_spine_atlas*)atlas)->numImagePaths; +} + +FFI_PLUGIN_EXPORT utf8 *spine_atlas_get_image_path(spine_atlas atlas, int32_t index) { + if (!atlas) return nullptr; + return ((_spine_atlas*)atlas)->imagePaths[index]; +} + +FFI_PLUGIN_EXPORT utf8 *spine_atlas_get_error(spine_atlas atlas) { + if (!atlas) return nullptr; + return ((_spine_atlas*)atlas)->error; +} + +FFI_PLUGIN_EXPORT void spine_atlas_dispose(spine_atlas atlas) { + if (!atlas) return; + _spine_atlas *_atlas = (_spine_atlas*)atlas; + if (_atlas->atlas) delete (Atlas*)_atlas->atlas; + if (_atlas->error) free(_atlas->error); + for (int i = 0; i < _atlas->numImagePaths; i++) { + free(_atlas->imagePaths[i]); + } + SpineExtension::free(_atlas->imagePaths, __FILE__, __LINE__); + SpineExtension::free(_atlas, __FILE__, __LINE__); } // SkeletonData -FFI_PLUGIN_EXPORT spine_skeleton_data_result spine_skeleton_data_load_json(spine_atlas *atlas, const char *skeletonData) { - spine_skeleton_data_result result = { nullptr, nullptr }; +FFI_PLUGIN_EXPORT spine_skeleton_data_result spine_skeleton_data_load_json(spine_atlas atlas, const utf8 *skeletonData) { + _spine_skeleton_data_result *result = SpineExtension::calloc<_spine_skeleton_data_result>(1, __FILE__, __LINE__); + _spine_atlas *_atlas = (_spine_atlas*)atlas; Bone::setYDown(true); - if (!atlas) return result; - if (!atlas->atlas) return result; - if (!skeletonData) return result; - SkeletonJson json((Atlas*)atlas->atlas); - SkeletonData *data = json.readSkeletonData(skeletonData); - result.skeletonData = (spine_skeleton_data)data; + if (!_atlas) return (spine_skeleton_data_result)result; + if (!_atlas->atlas) return (spine_skeleton_data_result)result; + if (!skeletonData) return (spine_skeleton_data_result)result; + SkeletonJson json((Atlas*)_atlas->atlas); + SkeletonData *data = json.readSkeletonData((char*)skeletonData); + result->skeletonData = (spine_skeleton_data)data; if (!json.getError().isEmpty()) { - result.error = strdup(json.getError().buffer()); + result->error = (utf8*)strdup(json.getError().buffer()); } - return result; + return (spine_skeleton_data_result)result; } -FFI_PLUGIN_EXPORT spine_skeleton_data_result spine_skeleton_data_load_binary(spine_atlas *atlas, const unsigned char *skeletonData, int length) { - spine_skeleton_data_result result = { nullptr, nullptr }; +FFI_PLUGIN_EXPORT spine_skeleton_data_result spine_skeleton_data_load_binary(spine_atlas atlas, const uint8_t *skeletonData, int32_t length) { + _spine_skeleton_data_result *result = SpineExtension::calloc<_spine_skeleton_data_result>(1, __FILE__, __LINE__); + _spine_atlas *_atlas = (_spine_atlas*)atlas; Bone::setYDown(true); - if (!atlas) return result; - if (!atlas->atlas) return result; - if (!skeletonData) return result; - if (length <= 0) return result; - SkeletonBinary binary((Atlas*)atlas->atlas); + if (!_atlas) return (spine_skeleton_data_result)result; + if (!_atlas->atlas) return (spine_skeleton_data_result)result; + if (!skeletonData) return (spine_skeleton_data_result)result; + if (length <= 0) return (spine_skeleton_data_result)result; + SkeletonBinary binary((Atlas*)_atlas->atlas); SkeletonData *data = binary.readSkeletonData(skeletonData, length); - result.skeletonData = (spine_skeleton_data)data; + result->skeletonData = (spine_skeleton_data)data; if (!binary.getError().isEmpty()) { - result.error = strdup(binary.getError().buffer()); + result->error = (utf8*)strdup(binary.getError().buffer()); } - return result; + return (spine_skeleton_data_result)result; } -FFI_PLUGIN_EXPORT spine_bone_data spine_skeleton_data_find_bone(spine_skeleton_data data, const char *name) { +FFI_PLUGIN_EXPORT utf8 *spine_skeleton_data_result_get_error(spine_skeleton_data_result result) { + if (!result) return nullptr; + return ((_spine_skeleton_data_result*)result)->error; +} +FFI_PLUGIN_EXPORT spine_skeleton_data spine_skeleton_data_result_get_data(spine_skeleton_data_result result) { + if (!result) return nullptr; + return ((_spine_skeleton_data_result*)result)->skeletonData; +} + +FFI_PLUGIN_EXPORT void spine_skeleton_data_result_dispose(spine_skeleton_data_result result) { + if (!result) return; + _spine_skeleton_data_result *_result = (_spine_skeleton_data_result*)result; + if (_result->error) SpineExtension::free(_result->error, __FILE__, __LINE__); + SpineExtension::free(_result, __FILE__, __LINE__); +} + +FFI_PLUGIN_EXPORT spine_bone_data spine_skeleton_data_find_bone(spine_skeleton_data data, const utf8 *name) { if (data == nullptr) return nullptr; SkeletonData *_data = (SkeletonData*)data; - return (spine_bone_data)_data->findBone(name); + return (spine_bone_data)_data->findBone((char*)name); } -FFI_PLUGIN_EXPORT spine_slot_data spine_skeleton_data_find_slot(spine_skeleton_data data, const char *name) { +FFI_PLUGIN_EXPORT spine_slot_data spine_skeleton_data_find_slot(spine_skeleton_data data, const utf8 *name) { if (data == nullptr) return nullptr; SkeletonData *_data = (SkeletonData*)data; - return (spine_slot_data)_data->findSlot(name); + return (spine_slot_data)_data->findSlot((char*)name); } -FFI_PLUGIN_EXPORT spine_skin spine_skeleton_data_find_skin(spine_skeleton_data data, const char *name) { +FFI_PLUGIN_EXPORT spine_skin spine_skeleton_data_find_skin(spine_skeleton_data data, const utf8 *name) { if (data == nullptr) return nullptr; SkeletonData *_data = (SkeletonData*)data; - return (spine_skin)_data->findSkin(name); + return (spine_skin)_data->findSkin((char*)name); } -FFI_PLUGIN_EXPORT spine_event_data spine_skeleton_data_find_event(spine_skeleton_data data, const char *name) { +FFI_PLUGIN_EXPORT spine_event_data spine_skeleton_data_find_event(spine_skeleton_data data, const utf8 *name) { if (data == nullptr) return nullptr; SkeletonData *_data = (SkeletonData*)data; - return (spine_event_data)_data->findEvent(name); + return (spine_event_data)_data->findEvent((char*)name); } -FFI_PLUGIN_EXPORT spine_animation spine_skeleton_data_find_animation(spine_skeleton_data data, const char *name) { +FFI_PLUGIN_EXPORT spine_animation spine_skeleton_data_find_animation(spine_skeleton_data data, const utf8 *name) { if (data == nullptr) return nullptr; SkeletonData *_data = (SkeletonData*)data; - return (spine_animation)_data->findAnimation(name); + return (spine_animation)_data->findAnimation((char*)name); } -FFI_PLUGIN_EXPORT spine_ik_constraint_data spine_skeleton_data_find_ik_constraint(spine_skeleton_data data, const char *name) { +FFI_PLUGIN_EXPORT spine_ik_constraint_data spine_skeleton_data_find_ik_constraint(spine_skeleton_data data, const utf8 *name) { if (data == nullptr) return nullptr; SkeletonData *_data = (SkeletonData*)data; - return (spine_ik_constraint_data)_data->findIkConstraint(name); + return (spine_ik_constraint_data)_data->findIkConstraint((char*)name); } -FFI_PLUGIN_EXPORT spine_transform_constraint_data spine_skeleton_data_find_transform_constraint(spine_skeleton_data data, const char *name) { +FFI_PLUGIN_EXPORT spine_transform_constraint_data spine_skeleton_data_find_transform_constraint(spine_skeleton_data data, const utf8 *name) { if (data == nullptr) return nullptr; SkeletonData *_data = (SkeletonData*)data; - return (spine_transform_constraint_data)_data->findTransformConstraint(name); + return (spine_transform_constraint_data)_data->findTransformConstraint((char*)name); } -FFI_PLUGIN_EXPORT spine_path_constraint_data spine_skeleton_data_find_path_constraint(spine_skeleton_data data, const char *name) { +FFI_PLUGIN_EXPORT spine_path_constraint_data spine_skeleton_data_find_path_constraint(spine_skeleton_data data, const utf8 *name) { if (data == nullptr) return nullptr; SkeletonData *_data = (SkeletonData*)data; - return (spine_path_constraint_data)_data->findPathConstraint(name); + return (spine_path_constraint_data)_data->findPathConstraint((char*)name); } -FFI_PLUGIN_EXPORT const char* spine_skeleton_data_get_name(spine_skeleton_data data) { +FFI_PLUGIN_EXPORT const utf8* spine_skeleton_data_get_name(spine_skeleton_data data) { if (data == nullptr) return nullptr; SkeletonData *_data = (SkeletonData*)data; - return _data->getName().buffer(); + return (utf8*)_data->getName().buffer(); } -FFI_PLUGIN_EXPORT int spine_skeleton_data_get_num_bones(spine_skeleton_data data) { +FFI_PLUGIN_EXPORT int32_t spine_skeleton_data_get_num_bones(spine_skeleton_data data) { if (data == nullptr) return 0; SkeletonData *_data = (SkeletonData*)data; - return (int)_data->getBones().size(); + return (int32_t)_data->getBones().size(); } FFI_PLUGIN_EXPORT spine_bone_data* spine_skeleton_data_get_bones(spine_skeleton_data data) { @@ -191,10 +334,10 @@ FFI_PLUGIN_EXPORT spine_bone_data* spine_skeleton_data_get_bones(spine_skeleton_ return (spine_bone_data*)_data->getBones().buffer(); } -FFI_PLUGIN_EXPORT int spine_skeleton_data_get_num_slots(spine_skeleton_data data) { +FFI_PLUGIN_EXPORT int32_t spine_skeleton_data_get_num_slots(spine_skeleton_data data) { if (data == nullptr) return 0; SkeletonData *_data = (SkeletonData*)data; - return (int)_data->getSlots().size(); + return (int32_t)_data->getSlots().size(); } FFI_PLUGIN_EXPORT spine_slot_data* spine_skeleton_data_get_slots(spine_skeleton_data data) { @@ -203,10 +346,10 @@ FFI_PLUGIN_EXPORT spine_slot_data* spine_skeleton_data_get_slots(spine_skeleton_ return (spine_slot_data*)_data->getSlots().buffer(); } -FFI_PLUGIN_EXPORT int spine_skeleton_data_get_num_skins(spine_skeleton_data data) { +FFI_PLUGIN_EXPORT int32_t spine_skeleton_data_get_num_skins(spine_skeleton_data data) { if (data == nullptr) return 0; SkeletonData *_data = (SkeletonData*)data; - return (int)_data->getSkins().size(); + return (int32_t)_data->getSkins().size(); } FFI_PLUGIN_EXPORT spine_skin* spine_skeleton_data_get_skins(spine_skeleton_data data) { @@ -227,10 +370,10 @@ FFI_PLUGIN_EXPORT void spine_skeleton_data_set_default_skin(spine_skeleton_data _data->setDefaultSkin((Skin*)skin); } -FFI_PLUGIN_EXPORT int spine_skeleton_data_get_num_events(spine_skeleton_data data) { +FFI_PLUGIN_EXPORT int32_t spine_skeleton_data_get_num_events(spine_skeleton_data data) { if (data == nullptr) return 0; SkeletonData *_data = (SkeletonData*)data; - return (int)_data->getEvents().size(); + return (int32_t)_data->getEvents().size(); } FFI_PLUGIN_EXPORT spine_event_data* spine_skeleton_data_get_events(spine_skeleton_data data) { @@ -239,10 +382,10 @@ FFI_PLUGIN_EXPORT spine_event_data* spine_skeleton_data_get_events(spine_skeleto return (spine_event_data*)_data->getEvents().buffer(); } -FFI_PLUGIN_EXPORT int spine_skeleton_data_get_num_animations(spine_skeleton_data data) { +FFI_PLUGIN_EXPORT int32_t spine_skeleton_data_get_num_animations(spine_skeleton_data data) { if (data == nullptr) return 0; SkeletonData *_data = (SkeletonData*)data; - return (int)_data->getAnimations().size(); + return (int32_t)_data->getAnimations().size(); } FFI_PLUGIN_EXPORT spine_animation* spine_skeleton_data_get_animations(spine_skeleton_data data) { @@ -251,10 +394,10 @@ FFI_PLUGIN_EXPORT spine_animation* spine_skeleton_data_get_animations(spine_skel return (spine_animation*)_data->getAnimations().buffer(); } -FFI_PLUGIN_EXPORT int spine_skeleton_data_get_num_ik_constraints(spine_skeleton_data data) { +FFI_PLUGIN_EXPORT int32_t spine_skeleton_data_get_num_ik_constraints(spine_skeleton_data data) { if (data == nullptr) return 0; SkeletonData *_data = (SkeletonData*)data; - return (int)_data->getIkConstraints().size(); + return (int32_t)_data->getIkConstraints().size(); } FFI_PLUGIN_EXPORT spine_ik_constraint_data* spine_skeleton_data_get_ik_constraints(spine_skeleton_data data) { @@ -263,10 +406,10 @@ FFI_PLUGIN_EXPORT spine_ik_constraint_data* spine_skeleton_data_get_ik_constrain return (spine_ik_constraint_data*)_data->getIkConstraints().buffer(); } -FFI_PLUGIN_EXPORT int spine_skeleton_data_get_num_transform_constraints(spine_skeleton_data data) { +FFI_PLUGIN_EXPORT int32_t spine_skeleton_data_get_num_transform_constraints(spine_skeleton_data data) { if (data == nullptr) return 0; SkeletonData *_data = (SkeletonData*)data; - return (int)_data->getTransformConstraints().size(); + return (int32_t)_data->getTransformConstraints().size(); } FFI_PLUGIN_EXPORT spine_transform_constraint_data* spine_skeleton_data_get_transform_constraints(spine_skeleton_data data) { @@ -275,10 +418,10 @@ FFI_PLUGIN_EXPORT spine_transform_constraint_data* spine_skeleton_data_get_trans return (spine_transform_constraint_data*)_data->getTransformConstraints().buffer(); } -FFI_PLUGIN_EXPORT int spine_skeleton_data_get_num_path_constraints(spine_skeleton_data data) { +FFI_PLUGIN_EXPORT int32_t spine_skeleton_data_get_num_path_constraints(spine_skeleton_data data) { if (data == nullptr) return 0; SkeletonData *_data = (SkeletonData*)data; - return (int)_data->getPathConstraints().size(); + return (int32_t)_data->getPathConstraints().size(); } FFI_PLUGIN_EXPORT spine_path_constraint_data* spine_skeleton_data_get_path_constraints(spine_skeleton_data data) { @@ -335,28 +478,28 @@ FFI_PLUGIN_EXPORT void spine_skeleton_data_set_height(spine_skeleton_data data, _data->setHeight(height); } -FFI_PLUGIN_EXPORT const char* spine_skeleton_data_get_version(spine_skeleton_data data) { +FFI_PLUGIN_EXPORT const utf8* spine_skeleton_data_get_version(spine_skeleton_data data) { if (data == nullptr) return nullptr; SkeletonData *_data = (SkeletonData*)data; - return _data->getVersion().buffer(); + return (utf8*)_data->getVersion().buffer(); } -FFI_PLUGIN_EXPORT const char* spine_skeleton_data_get_hash(spine_skeleton_data data) { +FFI_PLUGIN_EXPORT const utf8* spine_skeleton_data_get_hash(spine_skeleton_data data) { if (data == nullptr) return nullptr; SkeletonData *_data = (SkeletonData*)data; - return _data->getHash().buffer(); + return (utf8*)_data->getHash().buffer(); } -FFI_PLUGIN_EXPORT const char* spine_skeleton_data_get_images_path(spine_skeleton_data data) { +FFI_PLUGIN_EXPORT const utf8* spine_skeleton_data_get_images_path(spine_skeleton_data data) { if (data == nullptr) return nullptr; SkeletonData *_data = (SkeletonData*)data; - return _data->getImagesPath().buffer(); + return (utf8*)_data->getImagesPath().buffer(); } -FFI_PLUGIN_EXPORT const char* spine_skeleton_data_get_audio_path(spine_skeleton_data data) { +FFI_PLUGIN_EXPORT const utf8* spine_skeleton_data_get_audio_path(spine_skeleton_data data) { if (data == nullptr) return nullptr; SkeletonData *_data = (SkeletonData*)data; - return _data->getAudioPath().buffer(); + return (utf8*)_data->getAudioPath().buffer(); } FFI_PLUGIN_EXPORT float spine_skeleton_data_get_fps(spine_skeleton_data data) { @@ -371,8 +514,8 @@ FFI_PLUGIN_EXPORT void spine_skeleton_data_dispose(spine_skeleton_data data) { } // RenderCommand -spine_render_command *spine_render_command_create(int numVertices, int numIndices, spine_blend_mode blendMode, int pageIndex) { - spine_render_command *cmd = SpineExtension::alloc(1, __FILE__, __LINE__); +_spine_render_command *spine_render_command_create(int numVertices, int32_t numIndices, spine_blend_mode blendMode, int32_t pageIndex) { + _spine_render_command *cmd = SpineExtension::alloc<_spine_render_command>(1, __FILE__, __LINE__); cmd->positions = SpineExtension::alloc(numVertices << 1, __FILE__, __LINE__); cmd->uvs = SpineExtension::alloc(numVertices << 1, __FILE__, __LINE__); cmd->colors = SpineExtension::alloc(numVertices, __FILE__, __LINE__); @@ -385,7 +528,7 @@ spine_render_command *spine_render_command_create(int numVertices, int numIndice return cmd; } -void spine_render_command_dispose(spine_render_command *cmd) { +void spine_render_command_dispose(_spine_render_command *cmd) { if (!cmd) return; if (cmd->positions) SpineExtension::free(cmd->positions, __FILE__, __LINE__); if (cmd->uvs) SpineExtension::free(cmd->uvs, __FILE__, __LINE__); @@ -396,8 +539,8 @@ void spine_render_command_dispose(spine_render_command *cmd) { // SkeletonDrawable -FFI_PLUGIN_EXPORT spine_skeleton_drawable *spine_skeleton_drawable_create(spine_skeleton_data skeletonData) { - spine_skeleton_drawable *drawable = SpineExtension::calloc(1, __FILE__, __LINE__); +FFI_PLUGIN_EXPORT spine_skeleton_drawable spine_skeleton_drawable_create(spine_skeleton_data skeletonData) { + _spine_skeleton_drawable *drawable = SpineExtension::calloc<_spine_skeleton_drawable>(1, __FILE__, __LINE__); drawable->skeleton = (spine_skeleton)new (__FILE__, __LINE__) Skeleton((SkeletonData*)skeletonData); AnimationStateData *stateData = new (__FILE__, __LINE__) AnimationStateData((SkeletonData*)skeletonData); drawable->animationStateData = (spine_animation_state_data)stateData; @@ -408,31 +551,33 @@ FFI_PLUGIN_EXPORT spine_skeleton_drawable *spine_skeleton_drawable_create(spine_ drawable->animationStateEvents = (spine_animation_state_events)listener; state->setListener(listener); drawable->clipping = new (__FILE__, __LINE__) SkeletonClipping(); - return drawable; + return (spine_skeleton_drawable)drawable; } -FFI_PLUGIN_EXPORT void spine_skeleton_drawable_dispose(spine_skeleton_drawable *drawable) { - if (!drawable) return; - if (drawable->skeleton) delete (Skeleton*)drawable->skeleton; - if (drawable->animationState) delete (AnimationState*)drawable->animationState; - if (drawable->animationStateData) delete (AnimationStateData*)drawable->animationStateData; - if (drawable->animationStateEvents) delete (Vector*)(drawable->animationStateEvents); - if (drawable->clipping) delete (SkeletonClipping*)drawable->clipping; - while (drawable->renderCommand) { - spine_render_command *cmd = drawable->renderCommand; - drawable->renderCommand = cmd->next; +FFI_PLUGIN_EXPORT void spine_skeleton_drawable_dispose(spine_skeleton_drawable drawable) { + _spine_skeleton_drawable *_drawable = (_spine_skeleton_drawable*)drawable; + if (!_drawable) return; + if (_drawable->skeleton) delete (Skeleton*)_drawable->skeleton; + if (_drawable->animationState) delete (AnimationState*)_drawable->animationState; + if (_drawable->animationStateData) delete (AnimationStateData*)_drawable->animationStateData; + if (_drawable->animationStateEvents) delete (Vector*)(_drawable->animationStateEvents); + if (_drawable->clipping) delete (SkeletonClipping*)_drawable->clipping; + while (_drawable->renderCommand) { + _spine_render_command *cmd = _drawable->renderCommand; + _drawable->renderCommand = cmd->next; spine_render_command_dispose(cmd); } SpineExtension::free(drawable, __FILE__, __LINE__); } -FFI_PLUGIN_EXPORT spine_render_command *spine_skeleton_drawable_render(spine_skeleton_drawable *drawable) { - if (!drawable) return nullptr; - if (!drawable->skeleton) return nullptr; +FFI_PLUGIN_EXPORT spine_render_command spine_skeleton_drawable_render(spine_skeleton_drawable drawable) { + _spine_skeleton_drawable *_drawable = (_spine_skeleton_drawable*)drawable; + if (!_drawable) return nullptr; + if (!_drawable->skeleton) return nullptr; - while (drawable->renderCommand) { - spine_render_command *cmd = drawable->renderCommand; - drawable->renderCommand = cmd->next; + while (_drawable->renderCommand) { + _spine_render_command *cmd = _drawable->renderCommand; + _drawable->renderCommand = cmd->next; spine_render_command_dispose(cmd); } @@ -444,9 +589,9 @@ FFI_PLUGIN_EXPORT spine_render_command *spine_skeleton_drawable_render(spine_ske quadIndices.add(3); quadIndices.add(0); Vector worldVertices; - SkeletonClipping &clipper = *(SkeletonClipping*)drawable->clipping; - Skeleton *skeleton = (Skeleton*)drawable->skeleton; - spine_render_command *lastCommand = nullptr; + SkeletonClipping &clipper = *(SkeletonClipping*)_drawable->clipping; + Skeleton *skeleton = (Skeleton*)_drawable->skeleton; + _spine_render_command *lastCommand = nullptr; for (unsigned i = 0; i < skeleton->getSlots().size(); ++i) { Slot &slot = *skeleton->getDrawOrder()[i]; @@ -460,12 +605,12 @@ FFI_PLUGIN_EXPORT spine_render_command *spine_skeleton_drawable_render(spine_ske } Vector *vertices = &worldVertices; - int verticesCount; + int32_t verticesCount; Vector *uvs; Vector *indices; - int indicesCount; + int32_t indicesCount; Color *attachmentColor; - int pageIndex; + int32_t pageIndex; if (attachment->getRTTI().isExactly(RegionAttachment::rtti)) { RegionAttachment *regionAttachment = (RegionAttachment *) attachment; @@ -497,10 +642,10 @@ FFI_PLUGIN_EXPORT spine_render_command *spine_skeleton_drawable_render(spine_ske worldVertices.setSize(mesh->getWorldVerticesLength(), 0); mesh->computeWorldVertices(slot, 0, mesh->getWorldVerticesLength(), worldVertices.buffer(), 0, 2); - verticesCount = (int)(mesh->getWorldVerticesLength() >> 1); + verticesCount = (int32_t)(mesh->getWorldVerticesLength() >> 1); uvs = &mesh->getUVs(); indices = &mesh->getTriangles(); - indicesCount = (int)indices->size(); + indicesCount = (int32_t)indices->size(); pageIndex = ((AtlasRegion*)mesh->getRegion())->page->index; } else if (attachment->getRTTI().isExactly(ClippingAttachment::rtti)) { @@ -519,13 +664,13 @@ FFI_PLUGIN_EXPORT spine_render_command *spine_skeleton_drawable_render(spine_ske if (clipper.isClipping()) { clipper.clipTriangles(worldVertices, *indices, *uvs, 2); vertices = &clipper.getClippedVertices(); - verticesCount = (int)(clipper.getClippedVertices().size() >> 1); + verticesCount = (int32_t)(clipper.getClippedVertices().size() >> 1); uvs = &clipper.getClippedUVs(); indices = &clipper.getClippedTriangles(); - indicesCount = (int)(clipper.getClippedTriangles().size()); + indicesCount = (int32_t)(clipper.getClippedTriangles().size()); } - spine_render_command *cmd = spine_render_command_create(verticesCount, indicesCount, (spine_blend_mode)slot.getData().getBlendMode(), pageIndex); + _spine_render_command *cmd = spine_render_command_create(verticesCount, indicesCount, (spine_blend_mode)slot.getData().getBlendMode(), pageIndex); memcpy(cmd->positions, vertices->buffer(), (verticesCount << 1) * sizeof(float)); memcpy(cmd->uvs, uvs->buffer(), (verticesCount << 1) * sizeof(float)); @@ -533,7 +678,7 @@ FFI_PLUGIN_EXPORT spine_render_command *spine_skeleton_drawable_render(spine_ske memcpy(cmd->indices, indices->buffer(), indices->size() * sizeof(uint16_t)); if (!lastCommand) { - drawable->renderCommand = lastCommand = cmd; + _drawable->renderCommand = lastCommand = cmd; } else { lastCommand->next = cmd; lastCommand = cmd; @@ -543,15 +688,81 @@ FFI_PLUGIN_EXPORT spine_render_command *spine_skeleton_drawable_render(spine_ske } clipper.clipEnd(); - return drawable->renderCommand; + return (spine_render_command)_drawable->renderCommand; +} + +FFI_PLUGIN_EXPORT spine_skeleton spine_skeleton_drawable_get_skeleton(spine_skeleton_drawable drawable) { + if (!drawable) return nullptr; + return ((_spine_skeleton_drawable*)drawable)->skeleton; +} + +FFI_PLUGIN_EXPORT spine_animation_state spine_skeleton_drawable_get_animation_state(spine_skeleton_drawable drawable) { + if (!drawable) return nullptr; + return ((_spine_skeleton_drawable*)drawable)->animationState; +} + +FFI_PLUGIN_EXPORT spine_animation_state_data spine_skeleton_drawable_get_animation_state_data(spine_skeleton_drawable drawable) { + if (!drawable) return nullptr; + return ((_spine_skeleton_drawable*)drawable)->animationStateData; +} + +FFI_PLUGIN_EXPORT spine_animation_state_events spine_skeleton_drawable_get_animation_state_events(spine_skeleton_drawable drawable) { + if (!drawable) return nullptr; + return ((_spine_skeleton_drawable*)drawable)->animationStateEvents; +} + +// Render command +FFI_PLUGIN_EXPORT float *spine_render_command_get_positions(spine_render_command command) { + if (!command) return nullptr; + return ((_spine_render_command*)command)->positions; +} + +FFI_PLUGIN_EXPORT float *spine_render_command_get_uvs(spine_render_command command) { + if (!command) return nullptr; + return ((_spine_render_command*)command)->uvs; +} + +FFI_PLUGIN_EXPORT int32_t *spine_render_command_get_colors(spine_render_command command) { + if (!command) return nullptr; + return ((_spine_render_command*)command)->colors; +} + +FFI_PLUGIN_EXPORT int32_t spine_render_command_get_num_vertices(spine_render_command command) { + if (!command) return 0; + return ((_spine_render_command*)command)->numVertices; +} + +FFI_PLUGIN_EXPORT uint16_t *spine_render_command_get_indices(spine_render_command command) { + if (!command) return nullptr; + return ((_spine_render_command*)command)->indices; +} + +FFI_PLUGIN_EXPORT int32_t spine_render_command_get_num_indices(spine_render_command command) { + if (!command) return 0; + return ((_spine_render_command*)command)->numIndices; +} + +FFI_PLUGIN_EXPORT int32_t spine_render_command_get_atlas_page(spine_render_command command) { + if (!command) return 0; + return ((_spine_render_command*)command)->atlasPage; +} + +FFI_PLUGIN_EXPORT spine_blend_mode spine_render_command_get_blend_mode(spine_render_command command) { + if (!command) return SPINE_BLEND_MODE_NORMAL; + return ((_spine_render_command*)command)->blendMode; +} + +FFI_PLUGIN_EXPORT spine_render_command spine_render_command_get_next(spine_render_command command) { + if (!command) return nullptr; + return (spine_render_command)((_spine_render_command*)command)->next; } // Animation -FFI_PLUGIN_EXPORT const char* spine_animation_get_name(spine_animation animation) { +FFI_PLUGIN_EXPORT const utf8* spine_animation_get_name(spine_animation animation) { if (animation == nullptr) return nullptr; Animation *_animation = (Animation*)animation; - return _animation->getName().buffer(); + return (utf8*)_animation->getName().buffer(); } FFI_PLUGIN_EXPORT float spine_animation_get_duration(spine_animation animation) { @@ -593,18 +804,18 @@ FFI_PLUGIN_EXPORT float spine_animation_state_data_get_mix(spine_animation_state return _stateData->getMix((Animation*)from, (Animation*)to); } -FFI_PLUGIN_EXPORT void spine_animation_state_data_set_mix_by_name(spine_animation_state_data stateData, const char* fromName, const char* toName, float duration) { +FFI_PLUGIN_EXPORT void spine_animation_state_data_set_mix_by_name(spine_animation_state_data stateData, const utf8* fromName, const utf8* toName, float duration) { if (stateData == nullptr) return; if (fromName == nullptr || toName == nullptr) return; AnimationStateData* _stateData = (AnimationStateData*)stateData; - _stateData->setMix(fromName, toName, duration); + _stateData->setMix((char*)fromName, (char*)toName, duration); } -FFI_PLUGIN_EXPORT float spine_animation_state_data_get_mix_by_name(spine_animation_state_data stateData, const char* fromName, const char* toName) { +FFI_PLUGIN_EXPORT float spine_animation_state_data_get_mix_by_name(spine_animation_state_data stateData, const utf8* fromName, const utf8* toName) { if (stateData == nullptr) return 0; AnimationStateData* _stateData = (AnimationStateData*)stateData; - Animation* from = _stateData->getSkeletonData()->findAnimation(fromName); - Animation* to = _stateData->getSkeletonData()->findAnimation(toName); + Animation* from = _stateData->getSkeletonData()->findAnimation((char*)fromName); + Animation* to = _stateData->getSkeletonData()->findAnimation((char*)toName); if (from == nullptr || to == nullptr) return 0; return _stateData->getMix(from, to); } @@ -641,49 +852,49 @@ FFI_PLUGIN_EXPORT void spine_animation_state_clear_tracks(spine_animation_state _state->clearTracks(); } -FFI_PLUGIN_EXPORT int spine_animation_state_get_num_tracks(spine_animation_state state) { +FFI_PLUGIN_EXPORT int32_t spine_animation_state_get_num_tracks(spine_animation_state state) { if (state == nullptr) return 0; AnimationState *_state = (AnimationState*)state; - return (int) _state->getTracks().size(); + return (int32_t) _state->getTracks().size(); } -FFI_PLUGIN_EXPORT void spine_animation_state_clear_track(spine_animation_state state, int trackIndex) { +FFI_PLUGIN_EXPORT void spine_animation_state_clear_track(spine_animation_state state, int32_t trackIndex) { if (state == nullptr) return; AnimationState *_state = (AnimationState*)state; _state->clearTrack(trackIndex); } -FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_set_animation_by_name(spine_animation_state state, int trackIndex, const char* animationName, int loop) { +FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_set_animation_by_name(spine_animation_state state, int32_t trackIndex, const utf8* animationName, int32_t loop) { if (state == nullptr) return nullptr; AnimationState *_state = (AnimationState*)state; - return (spine_track_entry)_state->setAnimation(trackIndex, animationName, loop); + return (spine_track_entry)_state->setAnimation(trackIndex, (char*)animationName, loop); } -FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_set_animation(spine_animation_state state, int trackIndex, spine_animation animation, int loop) { +FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_set_animation(spine_animation_state state, int32_t trackIndex, spine_animation animation, int32_t loop) { if (state == nullptr) return nullptr; AnimationState *_state = (AnimationState*)state; return (spine_track_entry)_state->setAnimation(trackIndex, (Animation*)animation, loop); } -FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_add_animation_by_name(spine_animation_state state, int trackIndex, const char* animationName, int loop, float delay) { +FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_add_animation_by_name(spine_animation_state state, int32_t trackIndex, const utf8* animationName, int32_t loop, float delay) { if (state == nullptr) return nullptr; AnimationState *_state = (AnimationState*)state; - return (spine_track_entry)_state->addAnimation(trackIndex, animationName, loop, delay); + return (spine_track_entry)_state->addAnimation(trackIndex, (char*)animationName, loop, delay); } -FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_add_animation(spine_animation_state state, int trackIndex, spine_animation animation, int loop, float delay) { +FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_add_animation(spine_animation_state state, int32_t trackIndex, spine_animation animation, int32_t loop, float delay) { if (state == nullptr) return nullptr; AnimationState *_state = (AnimationState*)state; return (spine_track_entry)_state->addAnimation(trackIndex, (Animation*)animation, loop, delay); } -FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_set_empty_animation(spine_animation_state state, int trackIndex, float mixDuration) { +FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_set_empty_animation(spine_animation_state state, int32_t trackIndex, float mixDuration) { if (state == nullptr) return nullptr; AnimationState *_state = (AnimationState*)state; return (spine_track_entry)_state->setEmptyAnimation(trackIndex, mixDuration); } -FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_add_empty_animation(spine_animation_state state, int trackIndex, float mixDuration, float delay) { +FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_add_empty_animation(spine_animation_state state, int32_t trackIndex, float mixDuration, float delay) { if (state == nullptr) return nullptr; AnimationState *_state = (AnimationState*)state; return (spine_track_entry)_state->addEmptyAnimation(trackIndex, mixDuration, delay); @@ -695,7 +906,7 @@ FFI_PLUGIN_EXPORT void spine_animation_state_set_empty_animations(spine_animatio _state->setEmptyAnimations(mixDuration); } -FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_get_current(spine_animation_state state, int trackIndex) { +FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_get_current(spine_animation_state state, int32_t trackIndex) { if (state == nullptr) return nullptr; AnimationState *_state = (AnimationState*)state; return (spine_track_entry)_state->getCurrent(trackIndex); @@ -719,13 +930,13 @@ FFI_PLUGIN_EXPORT void spine_animation_state_set_time_scale(spine_animation_stat _state->setTimeScale(timeScale); } -FFI_PLUGIN_EXPORT int spine_animation_state_events_get_num_events(spine_animation_state_events events) { +FFI_PLUGIN_EXPORT int32_t spine_animation_state_events_get_num_events(spine_animation_state_events events) { if (events == nullptr) return 0; EventListener *_events = (EventListener*)events; - return (int)_events->events.size(); + return (int32_t)_events->events.size(); } -FFI_PLUGIN_EXPORT spine_event_type spine_animation_state_events_get_event_type(spine_animation_state_events events, int index) { +FFI_PLUGIN_EXPORT spine_event_type spine_animation_state_events_get_event_type(spine_animation_state_events events, int32_t index) { if (events == nullptr) return SPINE_EVENT_TYPE_DISPOSE; if (index < 0) return SPINE_EVENT_TYPE_DISPOSE; EventListener *_events = (EventListener*)events; @@ -733,14 +944,14 @@ FFI_PLUGIN_EXPORT spine_event_type spine_animation_state_events_get_event_type(s return (spine_event_type)_events->events[index].type; } -FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_events_get_track_entry(spine_animation_state_events events, int index) { +FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_events_get_track_entry(spine_animation_state_events events, int32_t index) { if (events == nullptr) return nullptr; EventListener *_events = (EventListener*)events; if (index >= _events->events.size()) return nullptr; return (spine_track_entry)_events->events[index].entry; } -FFI_PLUGIN_EXPORT spine_event spine_animation_state_events_get_event(spine_animation_state_events events, int index) { +FFI_PLUGIN_EXPORT spine_event spine_animation_state_events_get_event(spine_animation_state_events events, int32_t index) { if (events == nullptr) return nullptr; EventListener *_events = (EventListener*)events; if (index >= _events->events.size()) return nullptr; @@ -755,7 +966,7 @@ FFI_PLUGIN_EXPORT void spine_animation_state_events_reset(spine_animation_state_ // TrackEntry -FFI_PLUGIN_EXPORT int spine_track_entry_get_track_index(spine_track_entry entry) { +FFI_PLUGIN_EXPORT int32_t spine_track_entry_get_track_index(spine_track_entry entry) { if (entry == nullptr) return 0; TrackEntry *_entry = (TrackEntry*)entry; return _entry->getTrackIndex(); @@ -773,49 +984,49 @@ FFI_PLUGIN_EXPORT spine_track_entry spine_track_entry_get_previous(spine_track_e return (spine_track_entry)_entry->getPrevious(); } -FFI_PLUGIN_EXPORT int spine_track_entry_get_loop(spine_track_entry entry) { +FFI_PLUGIN_EXPORT int32_t spine_track_entry_get_loop(spine_track_entry entry) { if (entry == nullptr) return 0; TrackEntry *_entry = (TrackEntry*)entry; return _entry->getLoop() ? -1 : 0; } -FFI_PLUGIN_EXPORT void spine_track_entry_set_loop(spine_track_entry entry, int loop) { +FFI_PLUGIN_EXPORT void spine_track_entry_set_loop(spine_track_entry entry, int32_t loop) { if (entry == nullptr) return; TrackEntry *_entry = (TrackEntry*)entry; _entry->setLoop(loop); } -FFI_PLUGIN_EXPORT int spine_track_entry_get_hold_previous(spine_track_entry entry) { +FFI_PLUGIN_EXPORT int32_t spine_track_entry_get_hold_previous(spine_track_entry entry) { if (entry == nullptr) return 0; TrackEntry *_entry = (TrackEntry*)entry; return _entry->getHoldPrevious() ? -1 : 0; } -FFI_PLUGIN_EXPORT void spine_track_entry_set_hold_previous(spine_track_entry entry, int holdPrevious) { +FFI_PLUGIN_EXPORT void spine_track_entry_set_hold_previous(spine_track_entry entry, int32_t holdPrevious) { if (entry == nullptr) return; TrackEntry *_entry = (TrackEntry*)entry; _entry->setHoldPrevious(holdPrevious); } -FFI_PLUGIN_EXPORT int spine_track_entry_get_reverse(spine_track_entry entry) { +FFI_PLUGIN_EXPORT int32_t spine_track_entry_get_reverse(spine_track_entry entry) { if (entry == nullptr) return 0; TrackEntry *_entry = (TrackEntry*)entry; return _entry->getReverse() ? -1 : 0; } -FFI_PLUGIN_EXPORT void spine_track_entry_set_reverse(spine_track_entry entry, int reverse) { +FFI_PLUGIN_EXPORT void spine_track_entry_set_reverse(spine_track_entry entry, int32_t reverse) { if (entry == nullptr) return; TrackEntry *_entry = (TrackEntry*)entry; _entry->setReverse(reverse); } -FFI_PLUGIN_EXPORT int spine_track_entry_get_shortest_rotation(spine_track_entry entry) { +FFI_PLUGIN_EXPORT int32_t spine_track_entry_get_shortest_rotation(spine_track_entry entry) { if (entry == nullptr) return 0; TrackEntry *_entry = (TrackEntry*)entry; return _entry->getShortestRotation() ? -1 : 0; } -FFI_PLUGIN_EXPORT void spine_track_entry_set_shortest_rotation(spine_track_entry entry, int shortestRotation) { +FFI_PLUGIN_EXPORT void spine_track_entry_set_shortest_rotation(spine_track_entry entry, int32_t shortestRotation) { if (entry == nullptr) return; TrackEntry *_entry = (TrackEntry*)entry; _entry->setShortestRotation(shortestRotation); @@ -965,7 +1176,7 @@ FFI_PLUGIN_EXPORT spine_track_entry spine_track_entry_get_next(spine_track_entry return (spine_track_entry)_entry->getNext(); } -FFI_PLUGIN_EXPORT int spine_track_entry_is_complete(spine_track_entry entry) { +FFI_PLUGIN_EXPORT int32_t spine_track_entry_is_complete(spine_track_entry entry) { if (entry == nullptr) return 0; TrackEntry *_entry = (TrackEntry*)entry; return _entry->isComplete() ? -1 : 0; @@ -1071,22 +1282,22 @@ FFI_PLUGIN_EXPORT void spine_skeleton_set_slots_to_setup_pose(spine_skeleton ske _skeleton->setSlotsToSetupPose(); } -FFI_PLUGIN_EXPORT spine_bone spine_skeleton_find_bone(spine_skeleton skeleton, const char* boneName) { +FFI_PLUGIN_EXPORT spine_bone spine_skeleton_find_bone(spine_skeleton skeleton, const utf8* boneName) { if (skeleton == nullptr) return nullptr; Skeleton *_skeleton = (Skeleton*)skeleton; - return (spine_bone)_skeleton->findBone(boneName); + return (spine_bone)_skeleton->findBone((char*)boneName); } -FFI_PLUGIN_EXPORT spine_slot spine_skeleton_find_slot(spine_skeleton skeleton, const char* slotName) { +FFI_PLUGIN_EXPORT spine_slot spine_skeleton_find_slot(spine_skeleton skeleton, const utf8* slotName) { if (skeleton == nullptr) return nullptr; Skeleton *_skeleton = (Skeleton*)skeleton; - return (spine_slot)_skeleton->findSlot(slotName); + return (spine_slot)_skeleton->findSlot((char*)slotName); } -FFI_PLUGIN_EXPORT void spine_skeleton_set_skin_by_name(spine_skeleton skeleton, const char* skinName) { +FFI_PLUGIN_EXPORT void spine_skeleton_set_skin_by_name(spine_skeleton skeleton, const utf8* skinName) { if (skeleton == nullptr) return; Skeleton *_skeleton = (Skeleton*)skeleton; - _skeleton->setSkin(skinName); + _skeleton->setSkin((char*)skinName); } FFI_PLUGIN_EXPORT void spine_skeleton_set_skin(spine_skeleton skeleton, spine_skin skin) { @@ -1096,49 +1307,49 @@ FFI_PLUGIN_EXPORT void spine_skeleton_set_skin(spine_skeleton skeleton, spine_sk _skeleton->setSkin((Skin*)skin); } -FFI_PLUGIN_EXPORT spine_attachment spine_skeleton_get_attachment_by_name(spine_skeleton skeleton, const char* slotName, const char* attachmentName) { +FFI_PLUGIN_EXPORT spine_attachment spine_skeleton_get_attachment_by_name(spine_skeleton skeleton, const utf8* slotName, const utf8* attachmentName) { if (skeleton == nullptr) return nullptr; Skeleton *_skeleton = (Skeleton*)skeleton; - return (spine_attachment)_skeleton->getAttachment(slotName, attachmentName); + return (spine_attachment)_skeleton->getAttachment((char*)slotName, (char*)attachmentName); } -FFI_PLUGIN_EXPORT spine_attachment spine_skeleton_get_attachment(spine_skeleton skeleton, int slotIndex, const char* attachmentName) { +FFI_PLUGIN_EXPORT spine_attachment spine_skeleton_get_attachment(spine_skeleton skeleton, int32_t slotIndex, const utf8* attachmentName) { if (skeleton == nullptr) return nullptr; Skeleton *_skeleton = (Skeleton*)skeleton; - return (spine_attachment)_skeleton->getAttachment(slotIndex, attachmentName); + return (spine_attachment)_skeleton->getAttachment(slotIndex, (char*)attachmentName); } -FFI_PLUGIN_EXPORT void spine_skeleton_set_attachment(spine_skeleton skeleton, const char* slotName, const char* attachmentName) { +FFI_PLUGIN_EXPORT void spine_skeleton_set_attachment(spine_skeleton skeleton, const utf8* slotName, const utf8* attachmentName) { if (skeleton == nullptr) return; Skeleton *_skeleton = (Skeleton*)skeleton; - return _skeleton->setAttachment(slotName, attachmentName); + return _skeleton->setAttachment((char*)slotName, (char*)attachmentName); } -FFI_PLUGIN_EXPORT spine_ik_constraint spine_skeleton_find_ik_constraint(spine_skeleton skeleton, const char* constraintName) { +FFI_PLUGIN_EXPORT spine_ik_constraint spine_skeleton_find_ik_constraint(spine_skeleton skeleton, const utf8* constraintName) { if (skeleton == nullptr) return nullptr; Skeleton *_skeleton = (Skeleton*)skeleton; - return (spine_ik_constraint)_skeleton->findIkConstraint(constraintName); + return (spine_ik_constraint)_skeleton->findIkConstraint((char*)constraintName); } -FFI_PLUGIN_EXPORT spine_transform_constraint spine_skeleton_find_transform_constraint(spine_skeleton skeleton, const char* constraintName) { +FFI_PLUGIN_EXPORT spine_transform_constraint spine_skeleton_find_transform_constraint(spine_skeleton skeleton, const utf8* constraintName) { if (skeleton == nullptr) return nullptr; Skeleton *_skeleton = (Skeleton*)skeleton; - return (spine_transform_constraint)_skeleton->findTransformConstraint(constraintName); + return (spine_transform_constraint)_skeleton->findTransformConstraint((char*)constraintName); } -FFI_PLUGIN_EXPORT spine_path_constraint spine_skeleton_find_path_constraint(spine_skeleton skeleton, const char* constraintName) { +FFI_PLUGIN_EXPORT spine_path_constraint spine_skeleton_find_path_constraint(spine_skeleton skeleton, const utf8* constraintName) { if (skeleton == nullptr) return nullptr; Skeleton *_skeleton = (Skeleton*)skeleton; - return (spine_path_constraint)_skeleton->findPathConstraint(constraintName); + return (spine_path_constraint)_skeleton->findPathConstraint((char*)constraintName); } FFI_PLUGIN_EXPORT spine_bounds spine_skeleton_get_bounds(spine_skeleton skeleton) { - spine_bounds bounds = {0, 0, 0, 0}; - if (skeleton == nullptr) return bounds; + _spine_bounds *bounds = SpineExtension::calloc<_spine_bounds>(1, __FILE__, __LINE__); + if (skeleton == nullptr) return (spine_bounds)bounds; Skeleton *_skeleton = (Skeleton*)skeleton; Vector vertices; - _skeleton->getBounds(bounds.x, bounds.y, bounds.width, bounds.height, vertices); - return bounds; + _skeleton->getBounds(bounds->x, bounds->y, bounds->width, bounds->height, vertices); + return (spine_bounds)bounds; } FFI_PLUGIN_EXPORT spine_bone spine_skeleton_get_root_bone(spine_skeleton skeleton) { @@ -1153,10 +1364,10 @@ FFI_PLUGIN_EXPORT spine_skeleton_data spine_skeleton_get_data(spine_skeleton ske return (spine_skeleton_data)_skeleton->getData(); } -FFI_PLUGIN_EXPORT int spine_skeleton_get_num_bones(spine_skeleton skeleton) { +FFI_PLUGIN_EXPORT int32_t spine_skeleton_get_num_bones(spine_skeleton skeleton) { if (skeleton == nullptr) return 0; Skeleton *_skeleton = (Skeleton*)skeleton; - return (int)_skeleton->getBones().size(); + return (int32_t)_skeleton->getBones().size(); } FFI_PLUGIN_EXPORT spine_bone* spine_skeleton_get_bones(spine_skeleton skeleton) { @@ -1165,10 +1376,10 @@ FFI_PLUGIN_EXPORT spine_bone* spine_skeleton_get_bones(spine_skeleton skeleton) return (spine_bone*)_skeleton->getBones().buffer(); } -FFI_PLUGIN_EXPORT int spine_skeleton_get_num_slots(spine_skeleton skeleton) { +FFI_PLUGIN_EXPORT int32_t spine_skeleton_get_num_slots(spine_skeleton skeleton) { if (skeleton == nullptr) return 0; Skeleton *_skeleton = (Skeleton*)skeleton; - return (int)_skeleton->getSlots().size(); + return (int32_t)_skeleton->getSlots().size(); } FFI_PLUGIN_EXPORT spine_slot* spine_skeleton_get_slots(spine_skeleton skeleton) { @@ -1177,10 +1388,10 @@ FFI_PLUGIN_EXPORT spine_slot* spine_skeleton_get_slots(spine_skeleton skeleton) return (spine_slot*)_skeleton->getSlots().buffer(); } -FFI_PLUGIN_EXPORT int spine_skeleton_get_num_draw_order(spine_skeleton skeleton) { +FFI_PLUGIN_EXPORT int32_t spine_skeleton_get_num_draw_order(spine_skeleton skeleton) { if (skeleton == nullptr) return 0; Skeleton *_skeleton = (Skeleton*)skeleton; - return (int)_skeleton->getDrawOrder().size(); + return (int32_t)_skeleton->getDrawOrder().size(); } FFI_PLUGIN_EXPORT spine_slot* spine_skeleton_get_draw_order(spine_skeleton skeleton) { @@ -1189,10 +1400,10 @@ FFI_PLUGIN_EXPORT spine_slot* spine_skeleton_get_draw_order(spine_skeleton skele return (spine_slot*)_skeleton->getDrawOrder().buffer(); } -FFI_PLUGIN_EXPORT int spine_skeleton_get_num_ik_constraints(spine_skeleton skeleton) { +FFI_PLUGIN_EXPORT int32_t spine_skeleton_get_num_ik_constraints(spine_skeleton skeleton) { if (skeleton == nullptr) return 0; Skeleton *_skeleton = (Skeleton*)skeleton; - return (int)_skeleton->getIkConstraints().size(); + return (int32_t)_skeleton->getIkConstraints().size(); } FFI_PLUGIN_EXPORT spine_ik_constraint* spine_skeleton_get_ik_constraints(spine_skeleton skeleton) { @@ -1201,10 +1412,10 @@ FFI_PLUGIN_EXPORT spine_ik_constraint* spine_skeleton_get_ik_constraints(spine_s return (spine_ik_constraint*)_skeleton->getIkConstraints().buffer(); } -FFI_PLUGIN_EXPORT int spine_skeleton_get_num_transform_constraints(spine_skeleton skeleton) { +FFI_PLUGIN_EXPORT int32_t spine_skeleton_get_num_transform_constraints(spine_skeleton skeleton) { if (skeleton == nullptr) return 0; Skeleton *_skeleton = (Skeleton*)skeleton; - return (int)_skeleton->getTransformConstraints().size(); + return (int32_t)_skeleton->getTransformConstraints().size(); } FFI_PLUGIN_EXPORT spine_transform_constraint* spine_skeleton_get_transform_constraints(spine_skeleton skeleton) { @@ -1213,10 +1424,10 @@ FFI_PLUGIN_EXPORT spine_transform_constraint* spine_skeleton_get_transform_const return (spine_transform_constraint*)_skeleton->getTransformConstraints().buffer(); } -FFI_PLUGIN_EXPORT int spine_skeleton_get_num_path_constraints(spine_skeleton skeleton) { +FFI_PLUGIN_EXPORT int32_t spine_skeleton_get_num_path_constraints(spine_skeleton skeleton) { if (skeleton == nullptr) return 0; Skeleton *_skeleton = (Skeleton*)skeleton; - return (int)_skeleton->getPathConstraints().size(); + return (int32_t)_skeleton->getPathConstraints().size(); } FFI_PLUGIN_EXPORT spine_path_constraint* spine_skeleton_get_path_constraints(spine_skeleton skeleton) { @@ -1232,12 +1443,9 @@ FFI_PLUGIN_EXPORT spine_skin spine_skeleton_get_skin(spine_skeleton skeleton) { } FFI_PLUGIN_EXPORT spine_color spine_skeleton_get_color(spine_skeleton skeleton) { - spine_color color = {0, 0, 0, 0}; - if (skeleton == nullptr) return color; + if (skeleton == nullptr) return (spine_color)&NULL_COLOR; Skeleton *_skeleton = (Skeleton*)skeleton; - Color &c = _skeleton->getColor(); - color = { c.r, c.g, c.b, c.a }; - return color; + return (spine_color)&_skeleton->getColor(); } FFI_PLUGIN_EXPORT void spine_skeleton_set_color(spine_skeleton skeleton, float r, float g, float b, float a) { @@ -1302,19 +1510,19 @@ FFI_PLUGIN_EXPORT void spine_skeleton_set_scale_y(spine_skeleton skeleton, float // EventData -FFI_PLUGIN_EXPORT const char* spine_event_data_get_name(spine_event_data event) { +FFI_PLUGIN_EXPORT const utf8* spine_event_data_get_name(spine_event_data event) { if (event == nullptr) return nullptr; EventData *_event = (EventData*)event; - return _event->getName().buffer(); + return (utf8*)_event->getName().buffer(); } -FFI_PLUGIN_EXPORT int spine_event_data_get_int_value(spine_event_data event) { +FFI_PLUGIN_EXPORT int32_t spine_event_data_get_int_value(spine_event_data event) { if (event == nullptr) return 0; EventData *_event = (EventData*)event; return _event->getIntValue(); } -FFI_PLUGIN_EXPORT void spine_event_data_set_int_value(spine_event_data event, int value) { +FFI_PLUGIN_EXPORT void spine_event_data_set_int_value(spine_event_data event, int32_t value) { if (event == nullptr) return; EventData *_event = (EventData*)event; _event->setIntValue(value); @@ -1332,22 +1540,22 @@ FFI_PLUGIN_EXPORT void spine_event_data_set_float_value(spine_event_data event, _event->setFloatValue(value); } -FFI_PLUGIN_EXPORT const char* spine_event_data_get_string_value(spine_event_data event) { +FFI_PLUGIN_EXPORT const utf8* spine_event_data_get_string_value(spine_event_data event) { if (event == nullptr) return nullptr; EventData *_event = (EventData*)event; - return _event->getStringValue().buffer(); + return (utf8*)_event->getStringValue().buffer(); } -FFI_PLUGIN_EXPORT void spine_event_data_set_string_value(spine_event_data event, const char *value) { +FFI_PLUGIN_EXPORT void spine_event_data_set_string_value(spine_event_data event, const utf8 *value) { if (event == nullptr) return; EventData *_event = (EventData*)event; - _event->setStringValue(value); + _event->setStringValue((char*)value); } -FFI_PLUGIN_EXPORT const char* spine_event_data_get_audio_path(spine_event_data event) { +FFI_PLUGIN_EXPORT const utf8* spine_event_data_get_audio_path(spine_event_data event) { if (event == nullptr) return nullptr; EventData *_event = (EventData*)event; - return _event->getAudioPath().buffer(); + return (utf8*)_event->getAudioPath().buffer(); } FFI_PLUGIN_EXPORT float spine_event_data_get_volume(spine_event_data event) { @@ -1388,13 +1596,13 @@ FFI_PLUGIN_EXPORT float spine_event_get_time(spine_event event) { return _event->getTime(); } -FFI_PLUGIN_EXPORT int spine_event_get_int_value(spine_event event) { +FFI_PLUGIN_EXPORT int32_t spine_event_get_int_value(spine_event event) { if (event == nullptr) return 0; Event *_event = (Event*)event; return _event->getIntValue(); } -FFI_PLUGIN_EXPORT void spine_event_set_int_value(spine_event event, int value) { +FFI_PLUGIN_EXPORT void spine_event_set_int_value(spine_event event, int32_t value) { if (event == nullptr) return; Event *_event = (Event*)event; _event->setIntValue(value); @@ -1412,16 +1620,16 @@ FFI_PLUGIN_EXPORT void spine_event_set_float_value(spine_event event, float valu _event->setFloatValue(value); } -FFI_PLUGIN_EXPORT const char* spine_event_get_string_value(spine_event event) { +FFI_PLUGIN_EXPORT const utf8* spine_event_get_string_value(spine_event event) { if (event == nullptr) return nullptr; Event *_event = (Event*)event; - return _event->getStringValue().buffer(); + return (utf8*)_event->getStringValue().buffer(); } -FFI_PLUGIN_EXPORT void spine_event_set_string_value(spine_event event, const char *value) { +FFI_PLUGIN_EXPORT void spine_event_set_string_value(spine_event event, const utf8 *value) { if (event == nullptr) return; Event *_event = (Event*)event; - _event->setStringValue(value); + _event->setStringValue((char*)value); } FFI_PLUGIN_EXPORT float spine_event_get_volume(spine_event event) { @@ -1449,16 +1657,16 @@ FFI_PLUGIN_EXPORT void spine_event_set_balance(spine_event event, float balance) } // SlotData -FFI_PLUGIN_EXPORT int spine_slot_data_get_index(spine_slot_data slot) { +FFI_PLUGIN_EXPORT int32_t spine_slot_data_get_index(spine_slot_data slot) { if (slot == nullptr) return 0; SlotData *_slot = (SlotData*)slot; return _slot->getIndex(); } -FFI_PLUGIN_EXPORT const char* spine_slot_data_get_name(spine_slot_data slot) { +FFI_PLUGIN_EXPORT const utf8* spine_slot_data_get_name(spine_slot_data slot) { if (slot == nullptr) return nullptr; SlotData *_slot = (SlotData*)slot; - return _slot->getName().buffer(); + return (utf8*)_slot->getName().buffer(); } FFI_PLUGIN_EXPORT spine_bone_data spine_slot_data_get_bone_data(spine_slot_data slot) { @@ -1468,11 +1676,9 @@ FFI_PLUGIN_EXPORT spine_bone_data spine_slot_data_get_bone_data(spine_slot_data } FFI_PLUGIN_EXPORT spine_color spine_slot_data_get_color(spine_slot_data slot) { - spine_color color = { 0, 0, 0, 0 }; - if (slot == nullptr) return color; + if (slot == nullptr) return (spine_color)&NULL_COLOR; SlotData *_slot = (SlotData*)slot; - color = { _slot->getColor().r, _slot->getColor().g, _slot->getColor().b, _slot->getColor().a }; - return color; + return (spine_color)&_slot->getColor(); } FFI_PLUGIN_EXPORT void spine_slot_data_set_color(spine_slot_data slot, float r, float g, float b, float a) { @@ -1482,11 +1688,9 @@ FFI_PLUGIN_EXPORT void spine_slot_data_set_color(spine_slot_data slot, float r, } FFI_PLUGIN_EXPORT spine_color spine_slot_data_get_dark_color(spine_slot_data slot) { - spine_color color = { 0, 0, 0, 0 }; - if (slot == nullptr) return color; + if (slot == nullptr) return (spine_color)&NULL_COLOR; SlotData *_slot = (SlotData*)slot; - color = { _slot->getDarkColor().r, _slot->getDarkColor().g, _slot->getDarkColor().b, _slot->getDarkColor().a }; - return color; + return (spine_color)&_slot->getDarkColor(); } FFI_PLUGIN_EXPORT void spine_slot_data_set_dark_color(spine_slot_data slot, float r, float g, float b, float a) { @@ -1495,28 +1699,28 @@ FFI_PLUGIN_EXPORT void spine_slot_data_set_dark_color(spine_slot_data slot, floa _slot->getDarkColor().set(r, g, b, a); } -FFI_PLUGIN_EXPORT int spine_slot_data_has_dark_color(spine_slot_data slot) { +FFI_PLUGIN_EXPORT int32_t spine_slot_data_has_dark_color(spine_slot_data slot) { if (slot == nullptr) return 0; SlotData *_slot = (SlotData*)slot; return _slot->hasDarkColor() ? -1 : 0; } -FFI_PLUGIN_EXPORT void spine_slot_data_set_has_dark_color(spine_slot_data slot, int hasDarkColor) { +FFI_PLUGIN_EXPORT void spine_slot_data_set_has_dark_color(spine_slot_data slot, int32_t hasDarkColor) { if (slot == nullptr) return; SlotData *_slot = (SlotData*)slot; _slot->setHasDarkColor(hasDarkColor); } -FFI_PLUGIN_EXPORT const char* spine_slot_data_get_attachment_name(spine_slot_data slot) { +FFI_PLUGIN_EXPORT const utf8* spine_slot_data_get_attachment_name(spine_slot_data slot) { if (slot == nullptr) return nullptr; SlotData *_slot = (SlotData*)slot; - return _slot->getAttachmentName().buffer(); + return (utf8*)_slot->getAttachmentName().buffer(); } -FFI_PLUGIN_EXPORT void spine_slot_data_set_attachment_name(spine_slot_data slot, const char* attachmentName) { +FFI_PLUGIN_EXPORT void spine_slot_data_set_attachment_name(spine_slot_data slot, const utf8 *attachmentName) { if (slot == nullptr) return; SlotData *_slot = (SlotData*)slot; - _slot->setAttachmentName(attachmentName); + _slot->setAttachmentName((char*)attachmentName); } FFI_PLUGIN_EXPORT spine_blend_mode spine_slot_data_get_blend_mode(spine_slot_data slot) { @@ -1551,11 +1755,9 @@ FFI_PLUGIN_EXPORT spine_skeleton spine_slot_get_skeleton(spine_slot slot) { } FFI_PLUGIN_EXPORT spine_color spine_slot_get_color(spine_slot slot) { - spine_color color = { 0, 0, 0, 0 }; - if (slot == nullptr) return color; + if (slot == nullptr) return (spine_color)&NULL_COLOR; Slot *_slot = (Slot*)slot; - color = { _slot->getColor().r, _slot->getColor().g, _slot->getColor().b, _slot->getColor().a }; - return color; + return (spine_color)&_slot->getColor(); } FFI_PLUGIN_EXPORT void spine_slot_set_color(spine_slot slot, float r, float g, float b, float a) { @@ -1565,11 +1767,9 @@ FFI_PLUGIN_EXPORT void spine_slot_set_color(spine_slot slot, float r, float g, f } FFI_PLUGIN_EXPORT spine_color spine_slot_get_dark_color(spine_slot slot) { - spine_color color = { 0, 0, 0, 0 }; - if (slot == nullptr) return color; + if (slot == nullptr) return (spine_color)&NULL_COLOR; Slot *_slot = (Slot*)slot; - color = { _slot->getDarkColor().r, _slot->getDarkColor().g, _slot->getDarkColor().b, _slot->getDarkColor().a }; - return color; + return (spine_color)&_slot->getDarkColor(); } FFI_PLUGIN_EXPORT void spine_slot_set_dark_color(spine_slot slot, float r, float g, float b, float a) { @@ -1578,7 +1778,7 @@ FFI_PLUGIN_EXPORT void spine_slot_set_dark_color(spine_slot slot, float r, float _slot->getDarkColor().set(r, g, b, a); } -FFI_PLUGIN_EXPORT int spine_slot_has_dark_color(spine_slot slot) { +FFI_PLUGIN_EXPORT int32_t spine_slot_has_dark_color(spine_slot slot) { if (slot == nullptr) return 0; Slot *_slot = (Slot*)slot; return _slot->hasDarkColor() ? -1 : 0; @@ -1596,29 +1796,29 @@ FFI_PLUGIN_EXPORT void spine_slot_set_attachment(spine_slot slot, spine_attachme _slot->setAttachment((Attachment*)attachment); } -FFI_PLUGIN_EXPORT int spine_slot_get_sequence_index(spine_slot slot) { +FFI_PLUGIN_EXPORT int32_t spine_slot_get_sequence_index(spine_slot slot) { if (slot == nullptr) return 0; Slot *_slot = (Slot*)slot; return _slot->getSequenceIndex(); } -FFI_PLUGIN_EXPORT void spine_slot_set_sequence_index(spine_slot slot, int sequenceIndex) { +FFI_PLUGIN_EXPORT void spine_slot_set_sequence_index(spine_slot slot, int32_t sequenceIndex) { if (slot == nullptr) return; Slot *_slot = (Slot*)slot; _slot->setSequenceIndex(sequenceIndex); } // BoneData -FFI_PLUGIN_EXPORT int spine_bone_data_get_index(spine_bone_data data) { +FFI_PLUGIN_EXPORT int32_t spine_bone_data_get_index(spine_bone_data data) { if (data == nullptr) return 0; BoneData *_data = (BoneData*)data; return _data->getIndex(); } -FFI_PLUGIN_EXPORT const char* spine_bone_data_get_name(spine_bone_data data) { +FFI_PLUGIN_EXPORT const utf8* spine_bone_data_get_name(spine_bone_data data) { if (data == nullptr) return nullptr; BoneData *_data = (BoneData*)data; - return _data->getName().buffer(); + return (utf8*)_data->getName().buffer(); } FFI_PLUGIN_EXPORT spine_bone_data spine_bone_data_get_parent(spine_bone_data data) { @@ -1735,24 +1935,22 @@ FFI_PLUGIN_EXPORT void spine_bone_data_set_transform_mode(spine_bone_data data, _data->setTransformMode((TransformMode)mode); } -FFI_PLUGIN_EXPORT int spine_bone_data_is_skin_required(spine_bone_data data) { +FFI_PLUGIN_EXPORT int32_t spine_bone_data_is_skin_required(spine_bone_data data) { if (data == nullptr) return 0; BoneData *_data = (BoneData*)data; return _data->isSkinRequired() ? -1 : 0; } -FFI_PLUGIN_EXPORT void spine_bone_data_set_is_skin_required(spine_bone_data data, int isSkinRequired) { +FFI_PLUGIN_EXPORT void spine_bone_data_set_is_skin_required(spine_bone_data data, int32_t isSkinRequired) { if (data == nullptr) return; BoneData *_data = (BoneData*)data; _data->setSkinRequired(isSkinRequired); } FFI_PLUGIN_EXPORT spine_color spine_bone_data_get_color(spine_bone_data data) { - spine_color color = { 0, 0, 0 , 0}; - if (data == nullptr) return color; + if (data == nullptr) return (spine_color)&NULL_COLOR; BoneData *_data = (BoneData*)data; - color = { _data->getColor().r, _data->getColor().g, _data->getColor().b, _data->getColor().a }; - return color; + return (spine_color)&_data->getColor(); } FFI_PLUGIN_EXPORT void spine_bone_data_set_color(spine_bone_data data, float r, float g, float b, float a) { @@ -1762,11 +1960,11 @@ FFI_PLUGIN_EXPORT void spine_bone_data_set_color(spine_bone_data data, float r, } // Bone -FFI_PLUGIN_EXPORT void spine_bone_set_is_y_down(int yDown) { +FFI_PLUGIN_EXPORT void spine_bone_set_is_y_down(int32_t yDown) { Bone::setYDown(yDown); } -FFI_PLUGIN_EXPORT int spine_bone_get_is_y_down() { +FFI_PLUGIN_EXPORT int32_t spine_bone_get_is_y_down() { return Bone::isYDown() ? -1 : 0; } @@ -1795,19 +1993,19 @@ FFI_PLUGIN_EXPORT void spine_bone_set_to_setup_pose(spine_bone bone) { } FFI_PLUGIN_EXPORT spine_vector spine_bone_world_to_local(spine_bone bone, float worldX, float worldY) { - spine_vector coords = { 0, 0 }; - if (bone == nullptr) return coords; + _spine_vector *coords = SpineExtension::calloc<_spine_vector>(1, __FILE__, __LINE__); + if (bone == nullptr) return (spine_vector)coords; Bone *_bone = (Bone*)bone; - _bone->worldToLocal(worldX, worldY, coords.x, coords.y); - return coords; + _bone->worldToLocal(worldX, worldY, coords->x, coords->y); + return (spine_vector)coords; } FFI_PLUGIN_EXPORT spine_vector spine_bone_local_to_world(spine_bone bone, float localX, float localY) { - spine_vector coords = { 0, 0 }; - if (bone == nullptr) return coords; + _spine_vector *coords = SpineExtension::calloc<_spine_vector>(1, __FILE__, __LINE__); + if (bone == nullptr) return (spine_vector)coords; Bone *_bone = (Bone*)bone; - _bone->localToWorld(localX, localY, coords.x, coords.y); - return coords; + _bone->localToWorld(localX, localY, coords->x, coords->y); + return (spine_vector)coords; } FFI_PLUGIN_EXPORT float spine_bone_world_to_local_rotation(spine_bone bone, float worldRotation) { @@ -1858,10 +2056,10 @@ FFI_PLUGIN_EXPORT spine_bone spine_bone_get_parent(spine_bone bone) { return (spine_bone)_bone->getParent(); } -FFI_PLUGIN_EXPORT int spine_bone_get_num_children(spine_bone bone) { +FFI_PLUGIN_EXPORT int32_t spine_bone_get_num_children(spine_bone bone) { if (bone == nullptr) return 0; Bone *_bone = (Bone*)bone; - return (int)_bone->getChildren().size(); + return (int32_t)_bone->getChildren().size(); } FFI_PLUGIN_EXPORT spine_bone* spine_bone_get_children(spine_bone bone) { @@ -2134,23 +2332,23 @@ FFI_PLUGIN_EXPORT float spine_bone_get_world_scale_y(spine_bone bone) { return _bone->getWorldScaleY(); } -FFI_PLUGIN_EXPORT int spine_bone_get_is_active(spine_bone bone) { +FFI_PLUGIN_EXPORT int32_t spine_bone_get_is_active(spine_bone bone) { if (bone == nullptr) return 0; Bone *_bone = (Bone*)bone; return _bone->isActive() ? -1 : 0; } -FFI_PLUGIN_EXPORT void spine_bone_set_is_active(spine_bone bone, int isActive) { +FFI_PLUGIN_EXPORT void spine_bone_set_is_active(spine_bone bone, int32_t isActive) { if (bone == nullptr) return; Bone *_bone = (Bone*)bone; _bone->setActive(isActive); } // Attachment -FFI_PLUGIN_EXPORT const char* spine_attachment_get_name(spine_attachment attachment) { +FFI_PLUGIN_EXPORT const utf8* spine_attachment_get_name(spine_attachment attachment) { if (attachment == nullptr) return nullptr; Attachment *_attachment = (Attachment*)attachment; - return _attachment->getName().buffer(); + return (utf8*)_attachment->getName().buffer(); } FFI_PLUGIN_EXPORT spine_attachment_type spine_attachment_get_type(spine_attachment attachment) { @@ -2187,11 +2385,11 @@ FFI_PLUGIN_EXPORT void spine_attachment_dispose(spine_attachment attachment) { // PointAttachment FFI_PLUGIN_EXPORT spine_vector spine_point_attachment_compute_world_position(spine_point_attachment attachment, spine_bone bone) { - spine_vector result = { 0, 0 }; - if (attachment == nullptr) return result; + _spine_vector *result = SpineExtension::calloc<_spine_vector>(1, __FILE__, __LINE__); + if (attachment == nullptr) return (spine_vector)result; PointAttachment *_attachment = (PointAttachment*)attachment; - _attachment->computeWorldPosition(*(Bone*)bone, result.x, result.y); - return result; + _attachment->computeWorldPosition(*(Bone*)bone, result->x, result->y); + return (spine_vector)result; } FFI_PLUGIN_EXPORT float spine_point_attachment_compute_world_rotation(spine_point_attachment attachment, spine_bone bone) { @@ -2237,12 +2435,9 @@ FFI_PLUGIN_EXPORT void spine_point_attachment_set_rotation(spine_point_attachmen } FFI_PLUGIN_EXPORT spine_color spine_point_attachment_get_color(spine_point_attachment attachment) { - spine_color result = { 0, 0, 0, 0 }; - if (attachment == nullptr) return result; + if (attachment == nullptr) return (spine_color)&NULL_COLOR; PointAttachment *_attachment = (PointAttachment*)attachment; - Color &color = _attachment->getColor(); - result = { color.r, color.g, color.b, color.a }; - return result; + return (spine_color)&_attachment->getColor(); } FFI_PLUGIN_EXPORT void spine_point_attachment_set_color(spine_point_attachment attachment, float r, float g, float b, float a) { @@ -2349,12 +2544,9 @@ FFI_PLUGIN_EXPORT void spine_region_attachment_set_height(spine_region_attachmen } FFI_PLUGIN_EXPORT spine_color spine_region_attachment_get_color(spine_region_attachment attachment) { - spine_color result = { 0, 0, 0, 0 }; - if (attachment == nullptr) return result; + if (attachment == nullptr) return (spine_color)&NULL_COLOR; RegionAttachment *_attachment = (RegionAttachment*)attachment; - Color &color = _attachment->getColor(); - result = { color.r, color.g, color.b, color.a }; - return result; + return (spine_color)&_attachment->getColor(); } FFI_PLUGIN_EXPORT void spine_region_attachment_set_color(spine_region_attachment attachment, float r, float g, float b, float a) { @@ -2363,10 +2555,10 @@ FFI_PLUGIN_EXPORT void spine_region_attachment_set_color(spine_region_attachment _attachment->getColor().set(r, g, b, a); } -FFI_PLUGIN_EXPORT const char *spine_region_attachment_get_path(spine_region_attachment attachment) { +FFI_PLUGIN_EXPORT const utf8 *spine_region_attachment_get_path(spine_region_attachment attachment) { if (attachment == nullptr) return nullptr; RegionAttachment *_attachment = (RegionAttachment*)attachment; - return _attachment->getPath().buffer(); + return (utf8*)_attachment->getPath().buffer(); } FFI_PLUGIN_EXPORT spine_texture_region spine_region_attachment_get_region(spine_region_attachment attachment) { @@ -2381,10 +2573,10 @@ FFI_PLUGIN_EXPORT spine_sequence spine_region_attachment_get_sequence(spine_regi return (spine_sequence)_attachment->getSequence(); } -FFI_PLUGIN_EXPORT int spine_region_attachment_get_num_offset(spine_region_attachment attachment) { +FFI_PLUGIN_EXPORT int32_t spine_region_attachment_get_num_offset(spine_region_attachment attachment) { if (attachment == nullptr) return 0; RegionAttachment *_attachment = (RegionAttachment*)attachment; - return (int)_attachment->getOffset().size(); + return (int32_t)_attachment->getOffset().size(); } FFI_PLUGIN_EXPORT float *spine_region_attachment_get_offset(spine_region_attachment attachment) { @@ -2393,10 +2585,10 @@ FFI_PLUGIN_EXPORT float *spine_region_attachment_get_offset(spine_region_attachm return _attachment->getOffset().buffer(); } -FFI_PLUGIN_EXPORT int spine_region_attachment_get_num_uvs(spine_region_attachment attachment) { +FFI_PLUGIN_EXPORT int32_t spine_region_attachment_get_num_uvs(spine_region_attachment attachment) { if (attachment == nullptr) return 0; RegionAttachment *_attachment = (RegionAttachment*)attachment; - return (int)_attachment->getUVs().size(); + return (int32_t)_attachment->getUVs().size(); } FFI_PLUGIN_EXPORT float *spine_region_attachment_get_uvs(spine_region_attachment attachment) { @@ -2406,10 +2598,10 @@ FFI_PLUGIN_EXPORT float *spine_region_attachment_get_uvs(spine_region_attachment } // VertexAttachment -FFI_PLUGIN_EXPORT int spine_vertex_attachment_get_world_vertices_length(spine_vertex_attachment attachment) { +FFI_PLUGIN_EXPORT int32_t spine_vertex_attachment_get_world_vertices_length(spine_vertex_attachment attachment) { if (attachment == nullptr) return 0; VertexAttachment *_attachment = (VertexAttachment*)attachment; - return (int)_attachment->getWorldVerticesLength(); + return (int32_t)_attachment->getWorldVerticesLength(); } FFI_PLUGIN_EXPORT void spine_vertex_attachment_compute_world_vertices(spine_vertex_attachment attachment, spine_slot slot, float *worldVertices) { @@ -2418,10 +2610,10 @@ FFI_PLUGIN_EXPORT void spine_vertex_attachment_compute_world_vertices(spine_vert _attachment->computeWorldVertices(*(Slot*)slot, worldVertices); } -FFI_PLUGIN_EXPORT int spine_vertex_attachment_get_num_bones(spine_vertex_attachment attachment) { +FFI_PLUGIN_EXPORT int32_t spine_vertex_attachment_get_num_bones(spine_vertex_attachment attachment) { if (attachment == nullptr) return 0; VertexAttachment *_attachment = (VertexAttachment*)attachment; - return (int)_attachment->getBones().size(); + return (int32_t)_attachment->getBones().size(); } FFI_PLUGIN_EXPORT int32_t *spine_vertex_attachment_get_bones(spine_vertex_attachment attachment) { @@ -2431,10 +2623,10 @@ FFI_PLUGIN_EXPORT int32_t *spine_vertex_attachment_get_bones(spine_vertex_attach } // VertexAttachment -FFI_PLUGIN_EXPORT int spine_vertex_attachment_get_num_vertices(spine_vertex_attachment attachment) { +FFI_PLUGIN_EXPORT int32_t spine_vertex_attachment_get_num_vertices(spine_vertex_attachment attachment) { if (attachment == nullptr) return 0; VertexAttachment *_attachment = (VertexAttachment*)attachment; - return (int)_attachment->getVertices().size(); + return (int32_t)_attachment->getVertices().size(); } FFI_PLUGIN_EXPORT float *spine_vertex_attachment_get_vertices(spine_vertex_attachment attachment) { @@ -2462,22 +2654,22 @@ FFI_PLUGIN_EXPORT void spine_mesh_attachment_update_region(spine_mesh_attachment _attachment->updateRegion(); } -FFI_PLUGIN_EXPORT int spine_mesh_attachment_get_hull_length(spine_mesh_attachment attachment) { +FFI_PLUGIN_EXPORT int32_t spine_mesh_attachment_get_hull_length(spine_mesh_attachment attachment) { if (attachment == nullptr) return 0; MeshAttachment *_attachment = (MeshAttachment*)attachment; return _attachment->getHullLength(); } -FFI_PLUGIN_EXPORT void spine_mesh_attachment_set_hull_length(spine_mesh_attachment attachment, int hullLength) { +FFI_PLUGIN_EXPORT void spine_mesh_attachment_set_hull_length(spine_mesh_attachment attachment, int32_t hullLength) { if (attachment == nullptr) return; MeshAttachment *_attachment = (MeshAttachment*)attachment; _attachment->setHullLength(hullLength); } -FFI_PLUGIN_EXPORT int spine_mesh_attachment_get_num_region_uvs(spine_mesh_attachment attachment) { +FFI_PLUGIN_EXPORT int32_t spine_mesh_attachment_get_num_region_uvs(spine_mesh_attachment attachment) { if (attachment == nullptr) return 0; MeshAttachment *_attachment = (MeshAttachment*)attachment; - return (int)_attachment->getRegionUVs().size(); + return (int32_t)_attachment->getRegionUVs().size(); } FFI_PLUGIN_EXPORT float *spine_mesh_attachment_get_region_uvs(spine_mesh_attachment attachment) { @@ -2486,10 +2678,10 @@ FFI_PLUGIN_EXPORT float *spine_mesh_attachment_get_region_uvs(spine_mesh_attachm return _attachment->getRegionUVs().buffer(); } -FFI_PLUGIN_EXPORT int spine_mesh_attachment_get_num_uvs(spine_mesh_attachment attachment) { +FFI_PLUGIN_EXPORT int32_t spine_mesh_attachment_get_num_uvs(spine_mesh_attachment attachment) { if (attachment == nullptr) return 0; MeshAttachment *_attachment = (MeshAttachment*)attachment; - return (int)_attachment->getUVs().size(); + return (int32_t)_attachment->getUVs().size(); } FFI_PLUGIN_EXPORT float *spine_mesh_attachment_get_uvs(spine_mesh_attachment attachment) { @@ -2498,10 +2690,10 @@ FFI_PLUGIN_EXPORT float *spine_mesh_attachment_get_uvs(spine_mesh_attachment att return _attachment->getUVs().buffer(); } -FFI_PLUGIN_EXPORT int spine_mesh_attachment_get_num_triangles(spine_mesh_attachment attachment) { +FFI_PLUGIN_EXPORT int32_t spine_mesh_attachment_get_num_triangles(spine_mesh_attachment attachment) { if (attachment == nullptr) return 0; MeshAttachment *_attachment = (MeshAttachment*)attachment; - return (int)_attachment->getTriangles().size(); + return (int32_t)_attachment->getTriangles().size(); } FFI_PLUGIN_EXPORT uint16_t *spine_mesh_attachment_get_triangles(spine_mesh_attachment attachment) { @@ -2511,12 +2703,9 @@ FFI_PLUGIN_EXPORT uint16_t *spine_mesh_attachment_get_triangles(spine_mesh_attac } FFI_PLUGIN_EXPORT spine_color spine_mesh_attachment_get_color(spine_mesh_attachment attachment) { - spine_color result = { 0, 0, 0, 0 }; - if (attachment == nullptr) return result; + if (attachment == nullptr) return (spine_color)&NULL_COLOR; MeshAttachment *_attachment = (MeshAttachment*)attachment; - Color &color = _attachment->getColor(); - result = { color.r, color.g, color.b, color.a }; - return result; + return (spine_color)&_attachment->getColor(); } FFI_PLUGIN_EXPORT void spine_mesh_attachment_set_color(spine_mesh_attachment attachment, float r, float g, float b, float a) { @@ -2525,10 +2714,10 @@ FFI_PLUGIN_EXPORT void spine_mesh_attachment_set_color(spine_mesh_attachment att _attachment->getColor().set(r, g, b, a); } -FFI_PLUGIN_EXPORT const char *spine_mesh_attachment_get_path(spine_mesh_attachment attachment) { +FFI_PLUGIN_EXPORT const utf8 *spine_mesh_attachment_get_path(spine_mesh_attachment attachment) { if (attachment == nullptr) return nullptr; MeshAttachment *_attachment = (MeshAttachment*)attachment; - return _attachment->getPath().buffer(); + return (utf8*)_attachment->getPath().buffer(); } FFI_PLUGIN_EXPORT spine_texture_region spine_mesh_attachment_get_region(spine_mesh_attachment attachment) { @@ -2555,10 +2744,10 @@ FFI_PLUGIN_EXPORT void spine_mesh_attachment_set_parent_mesh(spine_mesh_attachme _attachment->setParentMesh((MeshAttachment*)parentMesh); } -FFI_PLUGIN_EXPORT int spine_mesh_attachment_get_num_edges(spine_mesh_attachment attachment) { +FFI_PLUGIN_EXPORT int32_t spine_mesh_attachment_get_num_edges(spine_mesh_attachment attachment) { if (attachment == nullptr) return 0; MeshAttachment *_attachment = (MeshAttachment*)attachment; - return (int)_attachment->getEdges().size(); + return (int32_t)_attachment->getEdges().size(); } FFI_PLUGIN_EXPORT unsigned short *spine_mesh_attachment_get_edges(spine_mesh_attachment attachment) { @@ -2605,12 +2794,9 @@ FFI_PLUGIN_EXPORT void spine_clipping_attachment_set_end_slot(spine_clipping_att } FFI_PLUGIN_EXPORT spine_color spine_clipping_attachment_get_color(spine_clipping_attachment attachment) { - spine_color result = { 0, 0, 0, 0 }; - if (attachment == nullptr) return result; + if (attachment == nullptr) return (spine_color)&NULL_COLOR; ClippingAttachment *_attachment = (ClippingAttachment*)attachment; - Color &color = _attachment->getColor(); - result = { color.r, color.g, color.b, color.a }; - return result; + return (spine_color)&_attachment->getColor(); } FFI_PLUGIN_EXPORT void spine_clipping_attachment_set_color(spine_clipping_attachment attachment, float r, float g, float b, float a) { @@ -2621,12 +2807,9 @@ FFI_PLUGIN_EXPORT void spine_clipping_attachment_set_color(spine_clipping_attach // BoundingBoxAttachment FFI_PLUGIN_EXPORT spine_color spine_bounding_box_attachment_get_color(spine_bounding_box_attachment attachment) { - spine_color result = { 0, 0, 0, 0 }; - if (attachment == nullptr) return result; + if (attachment == nullptr) return (spine_color)&NULL_COLOR; BoundingBoxAttachment *_attachment = (BoundingBoxAttachment*)attachment; - Color &color = _attachment->getColor(); - result = { color.r, color.g, color.b, color.a }; - return result; + return (spine_color)&_attachment->getColor(); } FFI_PLUGIN_EXPORT void spine_bounding_box_attachment_set_color(spine_bounding_box_attachment attachment, float r, float g, float b, float a) { @@ -2636,10 +2819,10 @@ FFI_PLUGIN_EXPORT void spine_bounding_box_attachment_set_color(spine_bounding_bo } // PathAttachment -FFI_PLUGIN_EXPORT int spine_path_attachment_get_num_lengths(spine_path_attachment attachment) { +FFI_PLUGIN_EXPORT int32_t spine_path_attachment_get_num_lengths(spine_path_attachment attachment) { if (attachment == nullptr) return 0; PathAttachment *_attachment = (PathAttachment*)attachment; - return (int)_attachment->getLengths().size(); + return (int32_t)_attachment->getLengths().size(); } FFI_PLUGIN_EXPORT float *spine_path_attachment_get_lengths(spine_path_attachment attachment) { @@ -2648,37 +2831,34 @@ FFI_PLUGIN_EXPORT float *spine_path_attachment_get_lengths(spine_path_attachment return _attachment->getLengths().buffer(); } -FFI_PLUGIN_EXPORT int spine_path_attachment_get_is_closed(spine_path_attachment attachment) { +FFI_PLUGIN_EXPORT int32_t spine_path_attachment_get_is_closed(spine_path_attachment attachment) { if (attachment == nullptr) return 0; PathAttachment *_attachment = (PathAttachment*)attachment; return _attachment->isClosed() ? -1 : 0; } -FFI_PLUGIN_EXPORT void spine_path_attachment_set_is_closed(spine_path_attachment attachment, int isClosed) { +FFI_PLUGIN_EXPORT void spine_path_attachment_set_is_closed(spine_path_attachment attachment, int32_t isClosed) { if (attachment == nullptr) return; PathAttachment *_attachment = (PathAttachment*)attachment; _attachment->setClosed(isClosed); } -FFI_PLUGIN_EXPORT int spine_path_attachment_get_is_constant_speed(spine_path_attachment attachment) { +FFI_PLUGIN_EXPORT int32_t spine_path_attachment_get_is_constant_speed(spine_path_attachment attachment) { if (attachment == nullptr) return 0; PathAttachment *_attachment = (PathAttachment*)attachment; return _attachment->isConstantSpeed() ? -1 : 0; } -FFI_PLUGIN_EXPORT void spine_path_attachment_set_is_constant_speed(spine_path_attachment attachment, int isConstantSpeed) { +FFI_PLUGIN_EXPORT void spine_path_attachment_set_is_constant_speed(spine_path_attachment attachment, int32_t isConstantSpeed) { if (attachment == nullptr) return; PathAttachment *_attachment = (PathAttachment*)attachment; _attachment->setConstantSpeed(isConstantSpeed); } FFI_PLUGIN_EXPORT spine_color spine_path_attachment_get_color(spine_path_attachment attachment) { - spine_color result = { 0, 0, 0, 0 }; - if (attachment == nullptr) return result; + if (attachment == nullptr) return (spine_color)&NULL_COLOR; PathAttachment *_attachment = (PathAttachment*)attachment; - Color &color = _attachment->getColor(); - result = { color.r, color.g, color.b, color.a }; - return result; + return (spine_color)&_attachment->getColor(); } FFI_PLUGIN_EXPORT void spine_path_attachment_set_color(spine_path_attachment attachment, float r, float g, float b, float a) { @@ -2688,28 +2868,28 @@ FFI_PLUGIN_EXPORT void spine_path_attachment_set_color(spine_path_attachment att } // Skin -FFI_PLUGIN_EXPORT void spine_skin_set_attachment(spine_skin skin, int slotIndex, const char* name, spine_attachment attachment) { +FFI_PLUGIN_EXPORT void spine_skin_set_attachment(spine_skin skin, int32_t slotIndex, const utf8* name, spine_attachment attachment) { if (skin == nullptr) return; Skin *_skin = (Skin*)skin; - _skin->setAttachment(slotIndex, name, (Attachment*)attachment); + _skin->setAttachment(slotIndex, (char*)name, (Attachment*)attachment); } -FFI_PLUGIN_EXPORT spine_attachment spine_skin_get_attachment(spine_skin skin, int slotIndex, const char* name) { +FFI_PLUGIN_EXPORT spine_attachment spine_skin_get_attachment(spine_skin skin, int32_t slotIndex, const utf8* name) { if (skin == nullptr) return nullptr; Skin *_skin = (Skin*)skin; - return (spine_attachment)_skin->getAttachment(slotIndex, name); + return (spine_attachment)_skin->getAttachment(slotIndex, (char*)name); } -FFI_PLUGIN_EXPORT void spine_skin_remove_attachment(spine_skin skin, int slotIndex, const char* name) { +FFI_PLUGIN_EXPORT void spine_skin_remove_attachment(spine_skin skin, int32_t slotIndex, const utf8* name) { if (skin == nullptr) return; Skin *_skin = (Skin*)skin; - _skin->removeAttachment(slotIndex, name); + _skin->removeAttachment(slotIndex, (char*)name); } -FFI_PLUGIN_EXPORT const char* spine_skin_get_name(spine_skin skin) { +FFI_PLUGIN_EXPORT const utf8* spine_skin_get_name(spine_skin skin) { if (skin == nullptr) return nullptr; Skin *_skin = (Skin*)skin; - return _skin->getName().buffer(); + return (utf8*)_skin->getName().buffer(); } FFI_PLUGIN_EXPORT void spine_skin_add_skin(spine_skin skin, spine_skin other) { @@ -2726,36 +2906,61 @@ FFI_PLUGIN_EXPORT void spine_skin_copy_skin(spine_skin skin, spine_skin other) { _skin->copySkin((Skin*)other); } -FFI_PLUGIN_EXPORT spine_skin_entries *spine_skin_get_entries(spine_skin skin) { +FFI_PLUGIN_EXPORT spine_skin_entries spine_skin_get_entries(spine_skin skin) { if (skin == nullptr) return nullptr; Skin *_skin = (Skin*)skin; - spine_skin_entries *entries = SpineExtension::getInstance()->calloc(1, __FILE__, __LINE__); + _spine_skin_entries *entries = SpineExtension::getInstance()->calloc<_spine_skin_entries>(1, __FILE__, __LINE__); { Skin::AttachmentMap::Entries mapEntries = _skin->getAttachments(); while (mapEntries.hasNext()) entries->numEntries++; } { - entries->entries = SpineExtension::getInstance()->calloc(entries->numEntries, __FILE__, __LINE__); + entries->entries = SpineExtension::getInstance()->calloc<_spine_skin_entry>(entries->numEntries, __FILE__, __LINE__); Skin::AttachmentMap::Entries mapEntries = _skin->getAttachments(); - int i = 0; + int32_t i = 0; while (mapEntries.hasNext()) { Skin::AttachmentMap::Entry entry = mapEntries.next(); - entries->entries[i++] = { (int)entry._slotIndex, entry._name.buffer(), (spine_attachment)entry._attachment }; + entries->entries[i++] = { (int32_t)entry._slotIndex, (utf8*)entry._name.buffer(), (spine_attachment)entry._attachment }; } } - return entries; + return (spine_skin_entries)entries; } -FFI_PLUGIN_EXPORT void spine_skin_entries_dispose(spine_skin_entries *entries) { +FFI_PLUGIN_EXPORT int32_t spine_skin_entries_get_num_entries(spine_skin_entries entries) { + if (!entries) return 0; + return ((_spine_skin_entries*)entries)->numEntries; +} + +FFI_PLUGIN_EXPORT spine_skin_entry spine_skin_entries_get_entry(spine_skin_entries entries, int32_t index) { + if (!entries) return 0; + return (spine_skin_entry)&((_spine_skin_entries*)entries)->entries[index]; +} + +FFI_PLUGIN_EXPORT void spine_skin_entries_dispose(spine_skin_entries entries) { if (entries == nullptr) return; - SpineExtension::getInstance()->free(entries->entries, __FILE__, __LINE__); + SpineExtension::getInstance()->free(((_spine_skin_entries*)entries)->entries, __FILE__, __LINE__); SpineExtension::getInstance()->free(entries, __FILE__, __LINE__); } -FFI_PLUGIN_EXPORT int spine_skin_get_num_bones(spine_skin skin) { +FFI_PLUGIN_EXPORT int32_t spine_skin_entry_get_slot_index(spine_skin_entry entry) { + if (!entry) return 0; + return ((_spine_skin_entry*)entry)->slotIndex; +} + +FFI_PLUGIN_EXPORT utf8 *spine_skin_entry_get_name(spine_skin_entry entry) { + if (!entry) return nullptr; + return ((_spine_skin_entry*)entry)->name; +} + +FFI_PLUGIN_EXPORT spine_attachment spine_skin_entry_get_attachment(spine_skin_entry entry) { + if (!entry) return nullptr; + return ((_spine_skin_entry*)entry)->attachment; +} + +FFI_PLUGIN_EXPORT int32_t spine_skin_get_num_bones(spine_skin skin) { if (skin == nullptr) return 0; Skin *_skin = (Skin*)skin; - return (int)_skin->getBones().size(); + return (int32_t)_skin->getBones().size(); } FFI_PLUGIN_EXPORT spine_bone_data* spine_skin_get_bones(spine_skin skin) { @@ -2764,10 +2969,10 @@ FFI_PLUGIN_EXPORT spine_bone_data* spine_skin_get_bones(spine_skin skin) { return (spine_bone_data*)_skin->getBones().buffer(); } -FFI_PLUGIN_EXPORT int spine_skin_get_num_constraints(spine_skin skin) { +FFI_PLUGIN_EXPORT int32_t spine_skin_get_num_constraints(spine_skin skin) { if (skin == nullptr) return 0; Skin *_skin = (Skin*)skin; - return (int)_skin->getConstraints().size(); + return (int32_t)_skin->getConstraints().size(); } FFI_PLUGIN_EXPORT spine_constraint_data* spine_skin_get_constraints(spine_skin skin) { @@ -2776,9 +2981,9 @@ FFI_PLUGIN_EXPORT spine_constraint_data* spine_skin_get_constraints(spine_skin s return (spine_constraint_data*)_skin->getConstraints().buffer(); } -FFI_PLUGIN_EXPORT spine_skin spine_skin_create(const char* name) { +FFI_PLUGIN_EXPORT spine_skin spine_skin_create(const utf8* name) { if (name == nullptr) return nullptr; - return (spine_skin)new (__FILE__, __LINE__) Skin(name); + return (spine_skin)new (__FILE__, __LINE__) Skin((char*)name); } FFI_PLUGIN_EXPORT void spine_skin_dispose(spine_skin skin) { @@ -2802,10 +3007,10 @@ FFI_PLUGIN_EXPORT spine_constraint_type spine_constraint_data_get_type(spine_con } } -FFI_PLUGIN_EXPORT const char* spine_constraint_data_get_name(spine_constraint_data data) { +FFI_PLUGIN_EXPORT const utf8* spine_constraint_data_get_name(spine_constraint_data data) { if (data == nullptr) return nullptr; ConstraintData *_data = (ConstraintData*)data; - return _data->getName().buffer(); + return (utf8*)_data->getName().buffer(); } FFI_PLUGIN_EXPORT uint64_t spine_constraint_data_get_order(spine_constraint_data data) { @@ -2820,23 +3025,23 @@ FFI_PLUGIN_EXPORT void spine_constraint_data_set_order(spine_constraint_data dat _data->setOrder((size_t)order); } -FFI_PLUGIN_EXPORT int spine_constraint_data_get_is_skin_required(spine_constraint_data data) { +FFI_PLUGIN_EXPORT int32_t spine_constraint_data_get_is_skin_required(spine_constraint_data data) { if (data == nullptr) return 0; ConstraintData *_data = (ConstraintData*)data; return _data->isSkinRequired() ? -1 : 0; } -FFI_PLUGIN_EXPORT void spine_constraint_data_set_is_skin_required(spine_constraint_data data, int isSkinRequired) { +FFI_PLUGIN_EXPORT void spine_constraint_data_set_is_skin_required(spine_constraint_data data, int32_t isSkinRequired) { if (data == nullptr) return; ConstraintData *_data = (ConstraintData*)data; _data->setSkinRequired(isSkinRequired); } // IkConstraintData -FFI_PLUGIN_EXPORT int spine_ik_constraint_data_get_num_bones(spine_ik_constraint_data data) { +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_data_get_num_bones(spine_ik_constraint_data data) { if (data == nullptr) return 0; IkConstraintData *_data = (IkConstraintData*)data; - return (int)_data->getBones().size(); + return (int32_t)_data->getBones().size(); } FFI_PLUGIN_EXPORT spine_bone_data* spine_ik_constraint_data_get_bones(spine_ik_constraint_data data) { @@ -2857,43 +3062,43 @@ FFI_PLUGIN_EXPORT void spine_ik_constraint_data_set_target(spine_ik_constraint_d _data->setTarget((BoneData*)target); } -FFI_PLUGIN_EXPORT int spine_ik_constraint_data_get_bend_direction(spine_ik_constraint_data data) { +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_data_get_bend_direction(spine_ik_constraint_data data) { if (data == nullptr) return 1; IkConstraintData *_data = (IkConstraintData*)data; return _data->getBendDirection(); } -FFI_PLUGIN_EXPORT void spine_ik_constraint_data_set_bend_direction(spine_ik_constraint_data data, int bendDirection) { +FFI_PLUGIN_EXPORT void spine_ik_constraint_data_set_bend_direction(spine_ik_constraint_data data, int32_t bendDirection) { if (data == nullptr) return; IkConstraintData *_data = (IkConstraintData*)data; _data->setBendDirection(bendDirection); } -FFI_PLUGIN_EXPORT int spine_ik_constraint_data_get_compress(spine_ik_constraint_data data) { +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_data_get_compress(spine_ik_constraint_data data) { if (data == nullptr) return 0; IkConstraintData *_data = (IkConstraintData*)data; return _data->getCompress() ? -1 : 0; } -FFI_PLUGIN_EXPORT void spine_ik_constraint_data_set_compress(spine_ik_constraint_data data, int compress) { +FFI_PLUGIN_EXPORT void spine_ik_constraint_data_set_compress(spine_ik_constraint_data data, int32_t compress) { if (data == nullptr) return; IkConstraintData *_data = (IkConstraintData*)data; _data->setCompress(compress); } -FFI_PLUGIN_EXPORT int spine_ik_constraint_data_get_stretch(spine_ik_constraint_data data) { +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_data_get_stretch(spine_ik_constraint_data data) { if (data == nullptr) return 0; IkConstraintData *_data = (IkConstraintData*)data; return _data->getStretch() ? -1 : 0; } -FFI_PLUGIN_EXPORT void spine_ik_constraint_data_set_stretch(spine_ik_constraint_data data, int stretch) { +FFI_PLUGIN_EXPORT void spine_ik_constraint_data_set_stretch(spine_ik_constraint_data data, int32_t stretch) { if (data == nullptr) return; IkConstraintData *_data = (IkConstraintData*)data; _data->setStretch(stretch); } -FFI_PLUGIN_EXPORT int spine_ik_constraint_data_get_uniform(spine_ik_constraint_data data) { +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_data_get_uniform(spine_ik_constraint_data data) { if (data == nullptr) return 0; IkConstraintData *_data = (IkConstraintData*)data; return _data->getUniform() ? -1 : 0; @@ -2930,7 +3135,7 @@ FFI_PLUGIN_EXPORT void spine_ik_constraint_update(spine_ik_constraint constraint _constraint->update(); } -FFI_PLUGIN_EXPORT int spine_ik_constraint_get_order(spine_ik_constraint constraint) { +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_get_order(spine_ik_constraint constraint) { if (constraint == nullptr) return 0; IkConstraint *_constraint = (IkConstraint*)constraint; return _constraint->getOrder(); @@ -2942,10 +3147,10 @@ FFI_PLUGIN_EXPORT spine_ik_constraint_data spine_ik_constraint_get_data(spine_ik return (spine_ik_constraint_data)&_constraint->getData(); } -FFI_PLUGIN_EXPORT int spine_ik_constraint_get_num_bones(spine_ik_constraint constraint) { +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_get_num_bones(spine_ik_constraint constraint) { if (constraint == nullptr) return 0; IkConstraint *_constraint = (IkConstraint*)constraint; - return (int)_constraint->getBones().size(); + return (int32_t)_constraint->getBones().size(); } FFI_PLUGIN_EXPORT spine_bone* spine_ik_constraint_get_bones(spine_ik_constraint constraint) { @@ -2966,37 +3171,37 @@ FFI_PLUGIN_EXPORT void spine_ik_constraint_set_target(spine_ik_constraint constr _constraint->setTarget((Bone*)target); } -FFI_PLUGIN_EXPORT int spine_ik_constraint_get_bend_direction(spine_ik_constraint constraint) { +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_get_bend_direction(spine_ik_constraint constraint) { if (constraint == nullptr) return 1; IkConstraint *_constraint = (IkConstraint*)constraint; return _constraint->getBendDirection(); } -FFI_PLUGIN_EXPORT void spine_ik_constraint_set_bend_direction(spine_ik_constraint constraint, int bendDirection) { +FFI_PLUGIN_EXPORT void spine_ik_constraint_set_bend_direction(spine_ik_constraint constraint, int32_t bendDirection) { if (constraint == nullptr) return; IkConstraint *_constraint = (IkConstraint*)constraint; _constraint->setBendDirection(bendDirection); } -FFI_PLUGIN_EXPORT int spine_ik_constraint_get_compress(spine_ik_constraint constraint) { +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_get_compress(spine_ik_constraint constraint) { if (constraint == nullptr) return 0; IkConstraint *_constraint = (IkConstraint*)constraint; return _constraint->getCompress() ? -1 : 0; } -FFI_PLUGIN_EXPORT void spine_ik_constraint_set_compress(spine_ik_constraint constraint, int compress) { +FFI_PLUGIN_EXPORT void spine_ik_constraint_set_compress(spine_ik_constraint constraint, int32_t compress) { if (constraint == nullptr) return; IkConstraint *_constraint = (IkConstraint*)constraint; _constraint->setCompress(compress); } -FFI_PLUGIN_EXPORT int spine_ik_constraint_get_stretch(spine_ik_constraint constraint) { +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_get_stretch(spine_ik_constraint constraint) { if (constraint == nullptr) return 0; IkConstraint *_constraint = (IkConstraint*)constraint; return _constraint->getStretch() ? -1 : 0; } -FFI_PLUGIN_EXPORT void spine_ik_constraint_set_stretch(spine_ik_constraint constraint, int stretch) { +FFI_PLUGIN_EXPORT void spine_ik_constraint_set_stretch(spine_ik_constraint constraint, int32_t stretch) { if (constraint == nullptr) return; IkConstraint *_constraint = (IkConstraint*)constraint; _constraint->setStretch(stretch); @@ -3026,23 +3231,23 @@ FFI_PLUGIN_EXPORT void spine_ik_constraint_set_softness(spine_ik_constraint cons _constraint->setSoftness(softness); } -FFI_PLUGIN_EXPORT int spine_ik_constraint_get_is_active(spine_ik_constraint constraint) { +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_get_is_active(spine_ik_constraint constraint) { if (constraint == nullptr) return 0; IkConstraint *_constraint = (IkConstraint*)constraint; return _constraint->isActive() ? -1 : 0; } -FFI_PLUGIN_EXPORT void spine_ik_constraint_set_is_active(spine_ik_constraint constraint, int isActive) { +FFI_PLUGIN_EXPORT void spine_ik_constraint_set_is_active(spine_ik_constraint constraint, int32_t isActive) { if (constraint == nullptr) return; IkConstraint *_constraint = (IkConstraint*)constraint; _constraint->setActive(isActive); } // TransformConstraintData -FFI_PLUGIN_EXPORT int spine_transform_constraint_data_get_num_bones(spine_transform_constraint_data data) { +FFI_PLUGIN_EXPORT int32_t spine_transform_constraint_data_get_num_bones(spine_transform_constraint_data data) { if (data == nullptr) return 0; TransformConstraintData *_data = (TransformConstraintData*)data; - return (int)_data->getBones().size(); + return (int32_t)_data->getBones().size(); } FFI_PLUGIN_EXPORT spine_bone_data* spine_transform_constraint_data_get_bones(spine_transform_constraint_data data) { @@ -3207,25 +3412,25 @@ FFI_PLUGIN_EXPORT void spine_transform_constraint_data_set_offset_shear_y(spine_ _data->setOffsetShearY(offsetShearY); } -FFI_PLUGIN_EXPORT int spine_transform_constraint_data_get_is_relative(spine_transform_constraint_data data) { +FFI_PLUGIN_EXPORT int32_t spine_transform_constraint_data_get_is_relative(spine_transform_constraint_data data) { if (data == nullptr) return 0; TransformConstraintData *_data = (TransformConstraintData*)data; return _data->isRelative() ? -1 : 0; } -FFI_PLUGIN_EXPORT void spine_transform_constraint_data_set_is_relative(spine_transform_constraint_data data, int isRelative) { +FFI_PLUGIN_EXPORT void spine_transform_constraint_data_set_is_relative(spine_transform_constraint_data data, int32_t isRelative) { if (data == nullptr) return; TransformConstraintData *_data = (TransformConstraintData*)data; _data->setRelative(isRelative); } -FFI_PLUGIN_EXPORT int spine_transform_constraint_data_get_is_local(spine_transform_constraint_data data) { +FFI_PLUGIN_EXPORT int32_t spine_transform_constraint_data_get_is_local(spine_transform_constraint_data data) { if (data == nullptr) return 0; TransformConstraintData *_data = (TransformConstraintData*)data; return _data->isLocal() ? -1 : 0; } -FFI_PLUGIN_EXPORT void spine_transform_constraint_data_set_is_local(spine_transform_constraint_data data, int isLocal) { +FFI_PLUGIN_EXPORT void spine_transform_constraint_data_set_is_local(spine_transform_constraint_data data, int32_t isLocal) { if (data == nullptr) return; TransformConstraintData *_data = (TransformConstraintData*)data; _data->setLocal(isLocal); @@ -3238,7 +3443,7 @@ FFI_PLUGIN_EXPORT void spine_transform_constraint_update(spine_transform_constra _constraint->update(); } -FFI_PLUGIN_EXPORT int spine_transform_constraint_get_order(spine_transform_constraint constraint) { +FFI_PLUGIN_EXPORT int32_t spine_transform_constraint_get_order(spine_transform_constraint constraint) { if (constraint == nullptr) return 0; TransformConstraint *_constraint = (TransformConstraint*)constraint; return _constraint->getOrder(); @@ -3250,10 +3455,10 @@ FFI_PLUGIN_EXPORT spine_transform_constraint_data spine_transform_constraint_get return (spine_transform_constraint_data)&_constraint->getData(); } -FFI_PLUGIN_EXPORT int spine_transform_constraint_get_num_bones(spine_transform_constraint constraint) { +FFI_PLUGIN_EXPORT int32_t spine_transform_constraint_get_num_bones(spine_transform_constraint constraint) { if (constraint == nullptr) return 0; TransformConstraint *_constraint = (TransformConstraint*)constraint; - return (int)_constraint->getBones().size(); + return (int32_t)_constraint->getBones().size(); } FFI_PLUGIN_EXPORT spine_bone* spine_transform_constraint_get_bones(spine_transform_constraint constraint) { @@ -3352,17 +3557,17 @@ FFI_PLUGIN_EXPORT float spine_transform_constraint_get_is_active(spine_transform return _constraint->isActive() ? -1 : 0; } -FFI_PLUGIN_EXPORT void spine_transform_constraint_set_is_active(spine_transform_constraint constraint, int isActive) { +FFI_PLUGIN_EXPORT void spine_transform_constraint_set_is_active(spine_transform_constraint constraint, int32_t isActive) { if (constraint == nullptr) return; TransformConstraint *_constraint = (TransformConstraint*)constraint; _constraint->setActive(isActive); } // PathConstraintData -FFI_PLUGIN_EXPORT int spine_path_constraint_data_get_num_bones(spine_path_constraint_data data) { +FFI_PLUGIN_EXPORT int32_t spine_path_constraint_data_get_num_bones(spine_path_constraint_data data) { if (data == nullptr) return 0; PathConstraintData *_data = (PathConstraintData*)data; - return (int)_data->getBones().size(); + return (int32_t)_data->getBones().size(); } FFI_PLUGIN_EXPORT spine_bone_data* spine_path_constraint_data_get_bones(spine_path_constraint_data data) { @@ -3498,7 +3703,7 @@ FFI_PLUGIN_EXPORT void spine_path_constraint_update(spine_path_constraint constr _constraint->update(); } -FFI_PLUGIN_EXPORT int spine_path_constraint_get_order(spine_path_constraint constraint) { +FFI_PLUGIN_EXPORT int32_t spine_path_constraint_get_order(spine_path_constraint constraint) { if (constraint == nullptr) return 0; PathConstraint *_constraint = (PathConstraint*)constraint; return _constraint->getOrder(); @@ -3510,10 +3715,10 @@ FFI_PLUGIN_EXPORT spine_path_constraint_data spine_path_constraint_get_data(spin return (spine_path_constraint_data)&_constraint->getData(); } -FFI_PLUGIN_EXPORT int spine_path_constraint_get_num_bones(spine_path_constraint constraint) { +FFI_PLUGIN_EXPORT int32_t spine_path_constraint_get_num_bones(spine_path_constraint constraint) { if (constraint == nullptr) return 0; PathConstraint *_constraint = (PathConstraint*)constraint; - return (int)_constraint->getBones().size(); + return (int32_t)_constraint->getBones().size(); } FFI_PLUGIN_EXPORT spine_bone* spine_path_constraint_get_bones(spine_path_constraint constraint) { @@ -3594,13 +3799,13 @@ FFI_PLUGIN_EXPORT void spine_path_constraint_set_mix_y(spine_path_constraint con _constraint->setMixY(mixY); } -FFI_PLUGIN_EXPORT int spine_path_constraint_get_is_active(spine_path_constraint constraint) { +FFI_PLUGIN_EXPORT int32_t spine_path_constraint_get_is_active(spine_path_constraint constraint) { if (constraint == nullptr) return 0; PathConstraint *_constraint = (PathConstraint*)constraint; return _constraint->isActive() ? -1 : 0; } -FFI_PLUGIN_EXPORT void spine_path_constraint_set_is_active(spine_path_constraint constraint, int isActive) { +FFI_PLUGIN_EXPORT void spine_path_constraint_set_is_active(spine_path_constraint constraint, int32_t isActive) { if (constraint == nullptr) return; PathConstraint *_constraint = (PathConstraint*)constraint; _constraint->setActive(isActive); @@ -3613,64 +3818,64 @@ FFI_PLUGIN_EXPORT void spine_sequence_apply(spine_sequence sequence, spine_slot _sequence->apply((Slot*)slot, (Attachment*)attachment); } -FFI_PLUGIN_EXPORT const char* spine_sequence_get_path(spine_sequence sequence, const char *basePath, int index) { +FFI_PLUGIN_EXPORT const utf8* spine_sequence_get_path(spine_sequence sequence, const utf8 *basePath, int32_t index) { if (sequence == nullptr) return nullptr; Sequence *_sequence = (Sequence*)sequence; - return strdup(_sequence->getPath(basePath, index).buffer()); + return (utf8*)strdup(_sequence->getPath((char*)basePath, index).buffer()); } -FFI_PLUGIN_EXPORT int spine_sequence_get_id(spine_sequence sequence) { +FFI_PLUGIN_EXPORT int32_t spine_sequence_get_id(spine_sequence sequence) { if (sequence == nullptr) return 0; Sequence *_sequence = (Sequence *) sequence; return _sequence->getId(); } -FFI_PLUGIN_EXPORT void spine_sequence_set_id(spine_sequence sequence, int id) { +FFI_PLUGIN_EXPORT void spine_sequence_set_id(spine_sequence sequence, int32_t id) { if (sequence == nullptr) return; Sequence *_sequence = (Sequence *) sequence; _sequence->setId(id); } -FFI_PLUGIN_EXPORT int spine_sequence_get_start(spine_sequence sequence) { +FFI_PLUGIN_EXPORT int32_t spine_sequence_get_start(spine_sequence sequence) { if (sequence == nullptr) return 0; Sequence *_sequence = (Sequence *) sequence; return _sequence->getStart(); } -FFI_PLUGIN_EXPORT void spine_sequence_set_start(spine_sequence sequence, int start) { +FFI_PLUGIN_EXPORT void spine_sequence_set_start(spine_sequence sequence, int32_t start) { if (sequence == nullptr) return; Sequence *_sequence = (Sequence *) sequence; _sequence->setStart(start); } -FFI_PLUGIN_EXPORT int spine_sequence_get_digits(spine_sequence sequence) { +FFI_PLUGIN_EXPORT int32_t spine_sequence_get_digits(spine_sequence sequence) { if (sequence == nullptr) return 0; Sequence *_sequence = (Sequence *) sequence; return _sequence->getDigits(); } -FFI_PLUGIN_EXPORT void spine_sequence_set_digits(spine_sequence sequence, int digits) { +FFI_PLUGIN_EXPORT void spine_sequence_set_digits(spine_sequence sequence, int32_t digits) { if (sequence == nullptr) return; Sequence *_sequence = (Sequence *) sequence; _sequence->setDigits(digits); } -FFI_PLUGIN_EXPORT int spine_sequence_get_setup_index(spine_sequence sequence) { +FFI_PLUGIN_EXPORT int32_t spine_sequence_get_setup_index(spine_sequence sequence) { if (sequence == nullptr) return 0; Sequence *_sequence = (Sequence *) sequence; return _sequence->getSetupIndex(); } -FFI_PLUGIN_EXPORT void spine_sequence_set_setup_index(spine_sequence sequence, int setupIndex) { +FFI_PLUGIN_EXPORT void spine_sequence_set_setup_index(spine_sequence sequence, int32_t setupIndex) { if (sequence == nullptr) return; Sequence *_sequence = (Sequence *) sequence; _sequence->setSetupIndex(setupIndex); } -FFI_PLUGIN_EXPORT int spine_sequence_get_num_regions(spine_sequence sequence) { +FFI_PLUGIN_EXPORT int32_t spine_sequence_get_num_regions(spine_sequence sequence) { if (sequence == nullptr) return 0; Sequence *_sequence = (Sequence *) sequence; - return (int)_sequence->getRegions().size(); + return (int32_t)_sequence->getRegions().size(); } FFI_PLUGIN_EXPORT spine_texture_region* spine_sequence_get_regions(spine_sequence sequence) { @@ -3738,13 +3943,13 @@ FFI_PLUGIN_EXPORT void spine_texture_region_set_v2(spine_texture_region textureR _region->v2 = v2; } -FFI_PLUGIN_EXPORT int spine_texture_region_get_degrees(spine_texture_region textureRegion) { +FFI_PLUGIN_EXPORT int32_t spine_texture_region_get_degrees(spine_texture_region textureRegion) { if (textureRegion == nullptr) return 0; TextureRegion *_region = (TextureRegion*)textureRegion; return _region->degrees; } -FFI_PLUGIN_EXPORT void spine_texture_region_set_degrees(spine_texture_region textureRegion, int degrees) { +FFI_PLUGIN_EXPORT void spine_texture_region_set_degrees(spine_texture_region textureRegion, int32_t degrees) { if (textureRegion == nullptr) return; TextureRegion *_region = (TextureRegion*)textureRegion; _region->degrees = degrees; @@ -3774,49 +3979,49 @@ FFI_PLUGIN_EXPORT void spine_texture_region_set_offset_y(spine_texture_region te _region->offsetY = offsetY; } -FFI_PLUGIN_EXPORT int spine_texture_region_get_width(spine_texture_region textureRegion) { +FFI_PLUGIN_EXPORT int32_t spine_texture_region_get_width(spine_texture_region textureRegion) { if (textureRegion == nullptr) return 0; TextureRegion *_region = (TextureRegion*)textureRegion; return _region->width; } -FFI_PLUGIN_EXPORT void spine_texture_region_set_width(spine_texture_region textureRegion, int width) { +FFI_PLUGIN_EXPORT void spine_texture_region_set_width(spine_texture_region textureRegion, int32_t width) { if (textureRegion == nullptr) return; TextureRegion *_region = (TextureRegion*)textureRegion; _region->width = width; } -FFI_PLUGIN_EXPORT int spine_texture_region_get_height(spine_texture_region textureRegion) { +FFI_PLUGIN_EXPORT int32_t spine_texture_region_get_height(spine_texture_region textureRegion) { if (textureRegion == nullptr) return 0; TextureRegion *_region = (TextureRegion*)textureRegion; return _region->height; } -FFI_PLUGIN_EXPORT void spine_texture_region_set_height(spine_texture_region textureRegion, int height) { +FFI_PLUGIN_EXPORT void spine_texture_region_set_height(spine_texture_region textureRegion, int32_t height) { if (textureRegion == nullptr) return; TextureRegion *_region = (TextureRegion*)textureRegion; _region->height = height; } -FFI_PLUGIN_EXPORT int spine_texture_region_get_original_width(spine_texture_region textureRegion) { +FFI_PLUGIN_EXPORT int32_t spine_texture_region_get_original_width(spine_texture_region textureRegion) { if (textureRegion == nullptr) return 0; TextureRegion *_region = (TextureRegion*)textureRegion; return _region->originalWidth; } -FFI_PLUGIN_EXPORT void spine_texture_region_set_original_width(spine_texture_region textureRegion, int originalWidth) { +FFI_PLUGIN_EXPORT void spine_texture_region_set_original_width(spine_texture_region textureRegion, int32_t originalWidth) { if (textureRegion == nullptr) return; TextureRegion *_region = (TextureRegion*)textureRegion; _region->originalWidth = originalWidth; } -FFI_PLUGIN_EXPORT int spine_texture_region_get_original_height(spine_texture_region textureRegion) { +FFI_PLUGIN_EXPORT int32_t spine_texture_region_get_original_height(spine_texture_region textureRegion) { if (textureRegion == nullptr) return 0; TextureRegion *_region = (TextureRegion*)textureRegion; return _region->originalHeight; } -FFI_PLUGIN_EXPORT void spine_texture_region_set_original_height(spine_texture_region textureRegion, int originalHeight) { +FFI_PLUGIN_EXPORT void spine_texture_region_set_original_height(spine_texture_region textureRegion, int32_t originalHeight) { if (textureRegion == nullptr) return; TextureRegion *_region = (TextureRegion*)textureRegion; _region->originalHeight = originalHeight; diff --git a/spine-flutter/src/spine_flutter.h b/spine-flutter/src/spine_flutter.h index 8a857984d..451cd6152 100644 --- a/spine-flutter/src/spine_flutter.h +++ b/spine-flutter/src/spine_flutter.h @@ -82,18 +82,17 @@ SPINE_OPAQUE_TYPE(spine_event) SPINE_OPAQUE_TYPE(spine_event_data) SPINE_OPAQUE_TYPE(spine_track_entry) SPINE_OPAQUE_TYPE(spine_animation) +SPINE_OPAQUE_TYPE(spine_atlas) +SPINE_OPAQUE_TYPE(spine_skeleton_data_result) +SPINE_OPAQUE_TYPE(spine_render_command) +SPINE_OPAQUE_TYPE(spine_bounds) +SPINE_OPAQUE_TYPE(spine_color) +SPINE_OPAQUE_TYPE(spine_vector) +SPINE_OPAQUE_TYPE(spine_skeleton_drawable) +SPINE_OPAQUE_TYPE(spine_skin_entry) +SPINE_OPAQUE_TYPE(spine_skin_entries) -typedef struct spine_atlas { - void *atlas; - char **imagePaths; - int numImagePaths; - char *error; -} spine_atlas; - -typedef struct spine_skeleton_data_result { - spine_skeleton_data skeletonData; - char *error; -} spine_skeleton_data_result; +typedef uint8_t utf8; typedef enum spine_blend_mode { SPINE_BLEND_MODE_NORMAL = 0, @@ -159,86 +158,61 @@ typedef enum spine_rotate_mode { SPINE_ROTATE_MODE_CHAIN_SCALE } spine_rotate_mode; -typedef struct spine_render_command { - float *positions; - float *uvs; - int32_t *colors; - int numVertices; - uint16_t *indices; - int numIndices; - int atlasPage; - spine_blend_mode blendMode; - struct spine_render_command *next; -} spine_render_command; - -typedef struct spine_bounds { - float x, y, width, height; -} spine_bounds; - -typedef struct spine_color { - float r, g, b, a; -} spine_color; - -typedef struct spine_vector { - float x, y; -} spine_vector; - -typedef struct spine_skeleton_drawable { - spine_skeleton skeleton; - spine_animation_state animationState; - spine_animation_state_data animationStateData; - spine_animation_state_events animationStateEvents; - void *clipping; - spine_render_command *renderCommand; -} spine_skeleton_drawable; - -typedef struct spine_skin_entry { - int slotIndex; - const char* name; - spine_attachment attachment; -} spine_skin_entry; - -typedef struct spine_skin_entries { - int numEntries; - spine_skin_entry* entries; -} spine_skin_entries; - -FFI_PLUGIN_EXPORT int spine_major_version(); -FFI_PLUGIN_EXPORT int spine_minor_version(); +FFI_PLUGIN_EXPORT int32_t spine_major_version(); +FFI_PLUGIN_EXPORT int32_t spine_minor_version(); FFI_PLUGIN_EXPORT void spine_report_leaks(); -FFI_PLUGIN_EXPORT spine_atlas* spine_atlas_load(const char *atlasData); -FFI_PLUGIN_EXPORT void spine_atlas_dispose(spine_atlas *atlas); +FFI_PLUGIN_EXPORT float spine_color_get_r(spine_color color); +FFI_PLUGIN_EXPORT float spine_color_get_g(spine_color color); +FFI_PLUGIN_EXPORT float spine_color_get_b(spine_color color); +FFI_PLUGIN_EXPORT float spine_color_get_a(spine_color color); -FFI_PLUGIN_EXPORT spine_skeleton_data_result spine_skeleton_data_load_json(spine_atlas *atlas, const char *skeletonData); -FFI_PLUGIN_EXPORT spine_skeleton_data_result spine_skeleton_data_load_binary(spine_atlas *atlas, const unsigned char *skeletonData, int length); -FFI_PLUGIN_EXPORT spine_bone_data spine_skeleton_data_find_bone(spine_skeleton_data data, const char *name); -FFI_PLUGIN_EXPORT spine_slot_data spine_skeleton_data_find_slot(spine_skeleton_data data, const char *name); -FFI_PLUGIN_EXPORT spine_skin spine_skeleton_data_find_skin(spine_skeleton_data data, const char *name); -FFI_PLUGIN_EXPORT spine_event_data spine_skeleton_data_find_event(spine_skeleton_data data, const char *name); -FFI_PLUGIN_EXPORT spine_animation spine_skeleton_data_find_animation(spine_skeleton_data data, const char *name); -FFI_PLUGIN_EXPORT spine_ik_constraint_data spine_skeleton_data_find_ik_constraint(spine_skeleton_data data, const char *name); -FFI_PLUGIN_EXPORT spine_transform_constraint_data spine_skeleton_data_find_transform_constraint(spine_skeleton_data data, const char *name); -FFI_PLUGIN_EXPORT spine_path_constraint_data spine_skeleton_data_find_path_constraint(spine_skeleton_data data, const char *name); -FFI_PLUGIN_EXPORT const char* spine_skeleton_data_get_name(spine_skeleton_data data); +FFI_PLUGIN_EXPORT float spine_bounds_get_x(spine_bounds bounds); +FFI_PLUGIN_EXPORT float spine_bounds_get_y(spine_bounds bounds); +FFI_PLUGIN_EXPORT float spine_bounds_get_width(spine_bounds bounds); +FFI_PLUGIN_EXPORT float spine_bounds_get_height(spine_bounds bounds); + +FFI_PLUGIN_EXPORT float spine_vector_get_x(spine_vector vector); +FFI_PLUGIN_EXPORT float spine_vector_get_y(spine_vector vector); + +FFI_PLUGIN_EXPORT spine_atlas spine_atlas_load(const utf8 *atlasData); +FFI_PLUGIN_EXPORT int32_t spine_atlas_get_num_image_paths(spine_atlas atlas); +FFI_PLUGIN_EXPORT utf8 *spine_atlas_get_image_path(spine_atlas atlas, int32_t index); +FFI_PLUGIN_EXPORT utf8 *spine_atlas_get_error(spine_atlas atlas); +FFI_PLUGIN_EXPORT void spine_atlas_dispose(spine_atlas atlas); + +FFI_PLUGIN_EXPORT spine_skeleton_data_result spine_skeleton_data_load_json(spine_atlas atlas, const utf8 *skeletonData); +FFI_PLUGIN_EXPORT spine_skeleton_data_result spine_skeleton_data_load_binary(spine_atlas atlas, const uint8_t *skeletonData, int32_t length); +FFI_PLUGIN_EXPORT utf8 *spine_skeleton_data_result_get_error(spine_skeleton_data_result result); +FFI_PLUGIN_EXPORT spine_skeleton_data spine_skeleton_data_result_get_data(spine_skeleton_data_result result); +FFI_PLUGIN_EXPORT void spine_skeleton_data_result_dispose(spine_skeleton_data_result result); +FFI_PLUGIN_EXPORT spine_bone_data spine_skeleton_data_find_bone(spine_skeleton_data data, const utf8 *name); +FFI_PLUGIN_EXPORT spine_slot_data spine_skeleton_data_find_slot(spine_skeleton_data data, const utf8 *name); +FFI_PLUGIN_EXPORT spine_skin spine_skeleton_data_find_skin(spine_skeleton_data data, const utf8 *name); +FFI_PLUGIN_EXPORT spine_event_data spine_skeleton_data_find_event(spine_skeleton_data data, const utf8 *name); +FFI_PLUGIN_EXPORT spine_animation spine_skeleton_data_find_animation(spine_skeleton_data data, const utf8 *name); +FFI_PLUGIN_EXPORT spine_ik_constraint_data spine_skeleton_data_find_ik_constraint(spine_skeleton_data data, const utf8 *name); +FFI_PLUGIN_EXPORT spine_transform_constraint_data spine_skeleton_data_find_transform_constraint(spine_skeleton_data data, const utf8 *name); +FFI_PLUGIN_EXPORT spine_path_constraint_data spine_skeleton_data_find_path_constraint(spine_skeleton_data data, const utf8 *name); +FFI_PLUGIN_EXPORT const utf8* spine_skeleton_data_get_name(spine_skeleton_data data); // OMITTED setName() -FFI_PLUGIN_EXPORT int spine_skeleton_data_get_num_bones(spine_skeleton_data data); +FFI_PLUGIN_EXPORT int32_t spine_skeleton_data_get_num_bones(spine_skeleton_data data); FFI_PLUGIN_EXPORT spine_bone_data* spine_skeleton_data_get_bones(spine_skeleton_data data); -FFI_PLUGIN_EXPORT int spine_skeleton_data_get_num_slots(spine_skeleton_data data); +FFI_PLUGIN_EXPORT int32_t spine_skeleton_data_get_num_slots(spine_skeleton_data data); FFI_PLUGIN_EXPORT spine_slot_data* spine_skeleton_data_get_slots(spine_skeleton_data data); -FFI_PLUGIN_EXPORT int spine_skeleton_data_get_num_skins(spine_skeleton_data data); +FFI_PLUGIN_EXPORT int32_t spine_skeleton_data_get_num_skins(spine_skeleton_data data); FFI_PLUGIN_EXPORT spine_skin* spine_skeleton_data_get_skins(spine_skeleton_data data); FFI_PLUGIN_EXPORT spine_skin spine_skeleton_data_get_default_skin(spine_skeleton_data data); FFI_PLUGIN_EXPORT void spine_skeleton_data_set_default_skin(spine_skeleton_data data, spine_skin skin); -FFI_PLUGIN_EXPORT int spine_skeleton_data_get_num_events(spine_skeleton_data data); +FFI_PLUGIN_EXPORT int32_t spine_skeleton_data_get_num_events(spine_skeleton_data data); FFI_PLUGIN_EXPORT spine_event_data* spine_skeleton_data_get_events(spine_skeleton_data data); -FFI_PLUGIN_EXPORT int spine_skeleton_data_get_num_animations(spine_skeleton_data data); +FFI_PLUGIN_EXPORT int32_t spine_skeleton_data_get_num_animations(spine_skeleton_data data); FFI_PLUGIN_EXPORT spine_animation* spine_skeleton_data_get_animations(spine_skeleton_data data); -FFI_PLUGIN_EXPORT int spine_skeleton_data_get_num_ik_constraints(spine_skeleton_data data); +FFI_PLUGIN_EXPORT int32_t spine_skeleton_data_get_num_ik_constraints(spine_skeleton_data data); FFI_PLUGIN_EXPORT spine_ik_constraint_data* spine_skeleton_data_get_ik_constraints(spine_skeleton_data data); -FFI_PLUGIN_EXPORT int spine_skeleton_data_get_num_transform_constraints(spine_skeleton_data data); +FFI_PLUGIN_EXPORT int32_t spine_skeleton_data_get_num_transform_constraints(spine_skeleton_data data); FFI_PLUGIN_EXPORT spine_transform_constraint_data* spine_skeleton_data_get_transform_constraints(spine_skeleton_data data); -FFI_PLUGIN_EXPORT int spine_skeleton_data_get_num_path_constraints(spine_skeleton_data data); +FFI_PLUGIN_EXPORT int32_t spine_skeleton_data_get_num_path_constraints(spine_skeleton_data data); FFI_PLUGIN_EXPORT spine_path_constraint_data* spine_skeleton_data_get_path_constraints(spine_skeleton_data data); FFI_PLUGIN_EXPORT float spine_skeleton_data_get_x(spine_skeleton_data data); FFI_PLUGIN_EXPORT void spine_skeleton_data_set_x(spine_skeleton_data data, float x); @@ -248,23 +222,37 @@ FFI_PLUGIN_EXPORT float spine_skeleton_data_get_width(spine_skeleton_data data); FFI_PLUGIN_EXPORT void spine_skeleton_data_set_width(spine_skeleton_data data, float width); FFI_PLUGIN_EXPORT float spine_skeleton_data_get_height(spine_skeleton_data data); FFI_PLUGIN_EXPORT void spine_skeleton_data_set_height(spine_skeleton_data data, float height); -FFI_PLUGIN_EXPORT const char* spine_skeleton_data_get_version(spine_skeleton_data data); +FFI_PLUGIN_EXPORT const utf8 *spine_skeleton_data_get_version(spine_skeleton_data data); // OMITTED setVersion() -FFI_PLUGIN_EXPORT const char* spine_skeleton_data_get_hash(spine_skeleton_data data); +FFI_PLUGIN_EXPORT const utf8 *spine_skeleton_data_get_hash(spine_skeleton_data data); // OMITTED setHash() -FFI_PLUGIN_EXPORT const char* spine_skeleton_data_get_images_path(spine_skeleton_data data); +FFI_PLUGIN_EXPORT const utf8 *spine_skeleton_data_get_images_path(spine_skeleton_data data); // OMITTED setImagesPath() -FFI_PLUGIN_EXPORT const char* spine_skeleton_data_get_audio_path(spine_skeleton_data data); +FFI_PLUGIN_EXPORT const utf8 *spine_skeleton_data_get_audio_path(spine_skeleton_data data); // OMITTED setAudioPath() FFI_PLUGIN_EXPORT float spine_skeleton_data_get_fps(spine_skeleton_data data); // OMITTED setFps() FFI_PLUGIN_EXPORT void spine_skeleton_data_dispose(spine_skeleton_data data); -FFI_PLUGIN_EXPORT spine_skeleton_drawable *spine_skeleton_drawable_create(spine_skeleton_data skeletonData); -FFI_PLUGIN_EXPORT spine_render_command *spine_skeleton_drawable_render(spine_skeleton_drawable *drawable); -FFI_PLUGIN_EXPORT void spine_skeleton_drawable_dispose(spine_skeleton_drawable *drawable); +FFI_PLUGIN_EXPORT spine_skeleton_drawable spine_skeleton_drawable_create(spine_skeleton_data skeletonData); +FFI_PLUGIN_EXPORT spine_render_command spine_skeleton_drawable_render(spine_skeleton_drawable drawable); +FFI_PLUGIN_EXPORT void spine_skeleton_drawable_dispose(spine_skeleton_drawable drawable); +FFI_PLUGIN_EXPORT spine_skeleton spine_skeleton_drawable_get_skeleton(spine_skeleton_drawable drawable); +FFI_PLUGIN_EXPORT spine_animation_state spine_skeleton_drawable_get_animation_state(spine_skeleton_drawable drawable); +FFI_PLUGIN_EXPORT spine_animation_state_data spine_skeleton_drawable_get_animation_state_data(spine_skeleton_drawable drawable); +FFI_PLUGIN_EXPORT spine_animation_state_events spine_skeleton_drawable_get_animation_state_events(spine_skeleton_drawable drawable); -FFI_PLUGIN_EXPORT const char* spine_animation_get_name(spine_animation animation); +FFI_PLUGIN_EXPORT float *spine_render_command_get_positions(spine_render_command command); +FFI_PLUGIN_EXPORT float *spine_render_command_get_uvs(spine_render_command command); +FFI_PLUGIN_EXPORT int32_t *spine_render_command_get_colors(spine_render_command command); +FFI_PLUGIN_EXPORT int32_t spine_render_command_get_num_vertices(spine_render_command command); +FFI_PLUGIN_EXPORT uint16_t *spine_render_command_get_indices(spine_render_command command); +FFI_PLUGIN_EXPORT int32_t spine_render_command_get_num_indices(spine_render_command command); +FFI_PLUGIN_EXPORT int32_t spine_render_command_get_atlas_page(spine_render_command command); +FFI_PLUGIN_EXPORT spine_blend_mode spine_render_command_get_blend_mode(spine_render_command command); +FFI_PLUGIN_EXPORT spine_render_command spine_render_command_get_next(spine_render_command command); + +FFI_PLUGIN_EXPORT const utf8* spine_animation_get_name(spine_animation animation); // OMITTED getTimelines() // OMITTED hasTimeline() FFI_PLUGIN_EXPORT float spine_animation_get_duration(spine_animation animation); @@ -275,23 +263,23 @@ FFI_PLUGIN_EXPORT float spine_animation_state_data_get_default_mix(spine_animati FFI_PLUGIN_EXPORT void spine_animation_state_data_set_default_mix(spine_animation_state_data stateData, float defaultMix); FFI_PLUGIN_EXPORT void spine_animation_state_data_set_mix(spine_animation_state_data stateData, spine_animation from, spine_animation to, float duration); FFI_PLUGIN_EXPORT float spine_animation_state_data_get_mix(spine_animation_state_data stateData, spine_animation from, spine_animation to); -FFI_PLUGIN_EXPORT void spine_animation_state_data_set_mix_by_name(spine_animation_state_data stateData, const char* fromName, const char* toName, float duration); -FFI_PLUGIN_EXPORT float spine_animation_state_data_get_mix_by_name(spine_animation_state_data stateData, const char* fromName, const char* toName); +FFI_PLUGIN_EXPORT void spine_animation_state_data_set_mix_by_name(spine_animation_state_data stateData, const utf8* fromName, const utf8* toName, float duration); +FFI_PLUGIN_EXPORT float spine_animation_state_data_get_mix_by_name(spine_animation_state_data stateData, const utf8* fromName, const utf8* toName); FFI_PLUGIN_EXPORT void spine_animation_state_data_clear(spine_animation_state_data stateData); FFI_PLUGIN_EXPORT void spine_animation_state_update(spine_animation_state state, float delta); FFI_PLUGIN_EXPORT void spine_animation_state_apply(spine_animation_state state, spine_skeleton skeleton); FFI_PLUGIN_EXPORT void spine_animation_state_clear_tracks(spine_animation_state state); -FFI_PLUGIN_EXPORT void spine_animation_state_clear_track(spine_animation_state state, int trackIndex); -FFI_PLUGIN_EXPORT int spine_animation_state_get_num_tracks(spine_animation_state state); -FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_set_animation_by_name(spine_animation_state state, int trackIndex, const char* animationName, int loop); -FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_set_animation(spine_animation_state state, int trackIndex, spine_animation animation, int loop); -FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_add_animation_by_name(spine_animation_state state, int trackIndex, const char* animationName, int loop, float delay); -FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_add_animation(spine_animation_state state, int trackIndex, spine_animation animation, int loop, float delay); -FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_set_empty_animation(spine_animation_state state, int trackIndex, float mixDuration); -FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_add_empty_animation(spine_animation_state state, int trackIndex, float mixDuration, float delay); +FFI_PLUGIN_EXPORT void spine_animation_state_clear_track(spine_animation_state state, int32_t trackIndex); +FFI_PLUGIN_EXPORT int32_t spine_animation_state_get_num_tracks(spine_animation_state state); +FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_set_animation_by_name(spine_animation_state state, int32_t trackIndex, const utf8* animationName, int32_t loop); +FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_set_animation(spine_animation_state state, int32_t trackIndex, spine_animation animation, int32_t loop); +FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_add_animation_by_name(spine_animation_state state, int32_t trackIndex, const utf8* animationName, int32_t loop, float delay); +FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_add_animation(spine_animation_state state, int32_t trackIndex, spine_animation animation, int32_t loop, float delay); +FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_set_empty_animation(spine_animation_state state, int32_t trackIndex, float mixDuration); +FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_add_empty_animation(spine_animation_state state, int32_t trackIndex, float mixDuration, float delay); FFI_PLUGIN_EXPORT void spine_animation_state_set_empty_animations(spine_animation_state state, float mixDuration); -FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_get_current(spine_animation_state state, int trackIndex); +FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_get_current(spine_animation_state state, int32_t trackIndex); FFI_PLUGIN_EXPORT spine_animation_state_data spine_animation_state_get_data(spine_animation_state state); FFI_PLUGIN_EXPORT float spine_animation_state_get_time_scale(spine_animation_state state); FFI_PLUGIN_EXPORT void spine_animation_state_set_time_scale(spine_animation_state state, float timeScale); @@ -303,23 +291,23 @@ FFI_PLUGIN_EXPORT void spine_animation_state_set_time_scale(spine_animation_stat // OMITTED getManualTrackEntryDisposal() FFI_PLUGIN_EXPORT void spine_animation_state_dispose_track_entry(spine_animation_state state, spine_track_entry entry); -FFI_PLUGIN_EXPORT int spine_animation_state_events_get_num_events(spine_animation_state_events events); -FFI_PLUGIN_EXPORT spine_event_type spine_animation_state_events_get_event_type(spine_animation_state_events events, int index); -FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_events_get_track_entry(spine_animation_state_events events, int index); -FFI_PLUGIN_EXPORT spine_event spine_animation_state_events_get_event(spine_animation_state_events events, int index); +FFI_PLUGIN_EXPORT int32_t spine_animation_state_events_get_num_events(spine_animation_state_events events); +FFI_PLUGIN_EXPORT spine_event_type spine_animation_state_events_get_event_type(spine_animation_state_events events, int32_t index); +FFI_PLUGIN_EXPORT spine_track_entry spine_animation_state_events_get_track_entry(spine_animation_state_events events, int32_t index); +FFI_PLUGIN_EXPORT spine_event spine_animation_state_events_get_event(spine_animation_state_events events, int32_t index); FFI_PLUGIN_EXPORT void spine_animation_state_events_reset(spine_animation_state_events events); -FFI_PLUGIN_EXPORT int spine_track_entry_get_track_index(spine_track_entry entry); +FFI_PLUGIN_EXPORT int32_t spine_track_entry_get_track_index(spine_track_entry entry); FFI_PLUGIN_EXPORT spine_animation spine_track_entry_get_animation(spine_track_entry entry); FFI_PLUGIN_EXPORT spine_track_entry spine_track_entry_get_previous(spine_track_entry entry); -FFI_PLUGIN_EXPORT int spine_track_entry_get_loop(spine_track_entry entry); -FFI_PLUGIN_EXPORT void spine_track_entry_set_loop(spine_track_entry entry, int loop); -FFI_PLUGIN_EXPORT int spine_track_entry_get_hold_previous(spine_track_entry entry); -FFI_PLUGIN_EXPORT void spine_track_entry_set_hold_previous(spine_track_entry entry, int holdPrevious); -FFI_PLUGIN_EXPORT int spine_track_entry_get_reverse(spine_track_entry entry); -FFI_PLUGIN_EXPORT void spine_track_entry_set_reverse(spine_track_entry entry, int reverse); -FFI_PLUGIN_EXPORT int spine_track_entry_get_shortest_rotation(spine_track_entry entry); -FFI_PLUGIN_EXPORT void spine_track_entry_set_shortest_rotation(spine_track_entry entry, int shortestRotation); +FFI_PLUGIN_EXPORT int32_t spine_track_entry_get_loop(spine_track_entry entry); +FFI_PLUGIN_EXPORT void spine_track_entry_set_loop(spine_track_entry entry, int32_t loop); +FFI_PLUGIN_EXPORT int32_t spine_track_entry_get_hold_previous(spine_track_entry entry); +FFI_PLUGIN_EXPORT void spine_track_entry_set_hold_previous(spine_track_entry entry, int32_t holdPrevious); +FFI_PLUGIN_EXPORT int32_t spine_track_entry_get_reverse(spine_track_entry entry); +FFI_PLUGIN_EXPORT void spine_track_entry_set_reverse(spine_track_entry entry, int32_t reverse); +FFI_PLUGIN_EXPORT int32_t spine_track_entry_get_shortest_rotation(spine_track_entry entry); +FFI_PLUGIN_EXPORT void spine_track_entry_set_shortest_rotation(spine_track_entry entry, int32_t shortestRotation); FFI_PLUGIN_EXPORT float spine_track_entry_get_delay(spine_track_entry entry); FFI_PLUGIN_EXPORT void spine_track_entry_set_delay(spine_track_entry entry, float delay); FFI_PLUGIN_EXPORT float spine_track_entry_get_track_time(spine_track_entry entry); @@ -344,7 +332,7 @@ FFI_PLUGIN_EXPORT void spine_track_entry_set_attachment_threshold(spine_track_en FFI_PLUGIN_EXPORT float spine_track_entry_get_draw_order_threshold(spine_track_entry entry); FFI_PLUGIN_EXPORT void spine_track_entry_set_draw_order_threshold(spine_track_entry entry, float drawOrderThreshold); FFI_PLUGIN_EXPORT spine_track_entry spine_track_entry_get_next(spine_track_entry entry); -FFI_PLUGIN_EXPORT int spine_track_entry_is_complete(spine_track_entry entry); +FFI_PLUGIN_EXPORT int32_t spine_track_entry_is_complete(spine_track_entry entry); FFI_PLUGIN_EXPORT float spine_track_entry_get_mix_time(spine_track_entry entry); FFI_PLUGIN_EXPORT void spine_track_entry_set_mix_time(spine_track_entry entry, float mixTime); FFI_PLUGIN_EXPORT float spine_track_entry_get_mix_duration(spine_track_entry entry); @@ -365,31 +353,31 @@ FFI_PLUGIN_EXPORT void spine_skeleton_update_world_transform_bone(spine_skeleton FFI_PLUGIN_EXPORT void spine_skeleton_set_to_setup_pose(spine_skeleton skeleton); FFI_PLUGIN_EXPORT void spine_skeleton_set_bones_to_setup_pose(spine_skeleton skeleton); FFI_PLUGIN_EXPORT void spine_skeleton_set_slots_to_setup_pose(spine_skeleton skeleton); -FFI_PLUGIN_EXPORT spine_bone spine_skeleton_find_bone(spine_skeleton skeleton, const char* boneName); -FFI_PLUGIN_EXPORT spine_slot spine_skeleton_find_slot(spine_skeleton skeleton, const char* slotName); -FFI_PLUGIN_EXPORT void spine_skeleton_set_skin_by_name(spine_skeleton skeleton, const char* skinName); +FFI_PLUGIN_EXPORT spine_bone spine_skeleton_find_bone(spine_skeleton skeleton, const utf8* boneName); +FFI_PLUGIN_EXPORT spine_slot spine_skeleton_find_slot(spine_skeleton skeleton, const utf8* slotName); +FFI_PLUGIN_EXPORT void spine_skeleton_set_skin_by_name(spine_skeleton skeleton, const utf8* skinName); FFI_PLUGIN_EXPORT void spine_skeleton_set_skin(spine_skeleton skeleton, spine_skin skin); -FFI_PLUGIN_EXPORT spine_attachment spine_skeleton_get_attachment_by_name(spine_skeleton skeleton, const char* slotName, const char* attachmentName); -FFI_PLUGIN_EXPORT spine_attachment spine_skeleton_get_attachment(spine_skeleton skeleton, int slotIndex, const char* attachmentName); -FFI_PLUGIN_EXPORT void spine_skeleton_set_attachment(spine_skeleton skeleton, const char* slotName, const char* attachmentName); -FFI_PLUGIN_EXPORT spine_ik_constraint spine_skeleton_find_ik_constraint(spine_skeleton skeleton, const char* constraintName); -FFI_PLUGIN_EXPORT spine_transform_constraint spine_skeleton_find_transform_constraint(spine_skeleton skeleton, const char* constraintName); -FFI_PLUGIN_EXPORT spine_path_constraint spine_skeleton_find_path_constraint(spine_skeleton skeleton, const char* constraintName); +FFI_PLUGIN_EXPORT spine_attachment spine_skeleton_get_attachment_by_name(spine_skeleton skeleton, const utf8* slotName, const utf8* attachmentName); +FFI_PLUGIN_EXPORT spine_attachment spine_skeleton_get_attachment(spine_skeleton skeleton, int32_t slotIndex, const utf8* attachmentName); +FFI_PLUGIN_EXPORT void spine_skeleton_set_attachment(spine_skeleton skeleton, const utf8* slotName, const utf8* attachmentName); +FFI_PLUGIN_EXPORT spine_ik_constraint spine_skeleton_find_ik_constraint(spine_skeleton skeleton, const utf8* constraintName); +FFI_PLUGIN_EXPORT spine_transform_constraint spine_skeleton_find_transform_constraint(spine_skeleton skeleton, const utf8* constraintName); +FFI_PLUGIN_EXPORT spine_path_constraint spine_skeleton_find_path_constraint(spine_skeleton skeleton, const utf8* constraintName); FFI_PLUGIN_EXPORT spine_bounds spine_skeleton_get_bounds(spine_skeleton skeleton); FFI_PLUGIN_EXPORT spine_bone spine_skeleton_get_root_bone(spine_skeleton skeleton); FFI_PLUGIN_EXPORT spine_skeleton_data spine_skeleton_get_data(spine_skeleton skeleton); -FFI_PLUGIN_EXPORT int spine_skeleton_get_num_bones(spine_skeleton skeleton); +FFI_PLUGIN_EXPORT int32_t spine_skeleton_get_num_bones(spine_skeleton skeleton); FFI_PLUGIN_EXPORT spine_bone* spine_skeleton_get_bones(spine_skeleton skeleton); // OMITTED getUpdateCacheList() -FFI_PLUGIN_EXPORT int spine_skeleton_get_num_slots(spine_skeleton skeleton); +FFI_PLUGIN_EXPORT int32_t spine_skeleton_get_num_slots(spine_skeleton skeleton); FFI_PLUGIN_EXPORT spine_slot* spine_skeleton_get_slots(spine_skeleton skeleton); -FFI_PLUGIN_EXPORT int spine_skeleton_get_num_draw_order(spine_skeleton skeleton); +FFI_PLUGIN_EXPORT int32_t spine_skeleton_get_num_draw_order(spine_skeleton skeleton); FFI_PLUGIN_EXPORT spine_slot* spine_skeleton_get_draw_order(spine_skeleton skeleton); -FFI_PLUGIN_EXPORT int spine_skeleton_get_num_ik_constraints(spine_skeleton skeleton); +FFI_PLUGIN_EXPORT int32_t spine_skeleton_get_num_ik_constraints(spine_skeleton skeleton); FFI_PLUGIN_EXPORT spine_ik_constraint* spine_skeleton_get_ik_constraints(spine_skeleton skeleton); -FFI_PLUGIN_EXPORT int spine_skeleton_get_num_transform_constraints(spine_skeleton skeleton); +FFI_PLUGIN_EXPORT int32_t spine_skeleton_get_num_transform_constraints(spine_skeleton skeleton); FFI_PLUGIN_EXPORT spine_transform_constraint* spine_skeleton_get_transform_constraints(spine_skeleton skeleton); -FFI_PLUGIN_EXPORT int spine_skeleton_get_num_path_constraints(spine_skeleton skeleton); +FFI_PLUGIN_EXPORT int32_t spine_skeleton_get_num_path_constraints(spine_skeleton skeleton); FFI_PLUGIN_EXPORT spine_path_constraint* spine_skeleton_get_path_constraints(spine_skeleton skeleton); FFI_PLUGIN_EXPORT spine_skin spine_skeleton_get_skin(spine_skeleton skeleton); FFI_PLUGIN_EXPORT spine_color spine_skeleton_get_color(spine_skeleton skeleton); @@ -404,14 +392,14 @@ FFI_PLUGIN_EXPORT void spine_skeleton_set_scale_x(spine_skeleton skeleton, float FFI_PLUGIN_EXPORT float spine_skeleton_get_scale_y(spine_skeleton skeleton); FFI_PLUGIN_EXPORT void spine_skeleton_set_scale_y(spine_skeleton skeleton, float scaleY); -FFI_PLUGIN_EXPORT const char* spine_event_data_get_name(spine_event_data event); -FFI_PLUGIN_EXPORT int spine_event_data_get_int_value(spine_event_data event); -FFI_PLUGIN_EXPORT void spine_event_data_set_int_value(spine_event_data event, int value); +FFI_PLUGIN_EXPORT const utf8* spine_event_data_get_name(spine_event_data event); +FFI_PLUGIN_EXPORT int32_t spine_event_data_get_int_value(spine_event_data event); +FFI_PLUGIN_EXPORT void spine_event_data_set_int_value(spine_event_data event, int32_t value); FFI_PLUGIN_EXPORT float spine_event_data_get_float_value(spine_event_data event); FFI_PLUGIN_EXPORT void spine_event_data_set_float_value(spine_event_data event, float value); -FFI_PLUGIN_EXPORT const char* spine_event_data_get_string_value(spine_event_data event); -FFI_PLUGIN_EXPORT void spine_event_data_set_string_value(spine_event_data event, const char *value); -FFI_PLUGIN_EXPORT const char* spine_event_data_get_audio_path(spine_event_data event); +FFI_PLUGIN_EXPORT const utf8* spine_event_data_get_string_value(spine_event_data event); +FFI_PLUGIN_EXPORT void spine_event_data_set_string_value(spine_event_data event, const utf8 *value); +FFI_PLUGIN_EXPORT const utf8* spine_event_data_get_audio_path(spine_event_data event); // OMITTED setAudioPath() FFI_PLUGIN_EXPORT float spine_event_data_get_volume(spine_event_data event); FFI_PLUGIN_EXPORT void spine_event_data_set_volume(spine_event_data event, float volume); @@ -420,28 +408,28 @@ FFI_PLUGIN_EXPORT void spine_event_data_set_balance(spine_event_data event, floa FFI_PLUGIN_EXPORT spine_event_data spine_event_get_data(spine_event event); FFI_PLUGIN_EXPORT float spine_event_get_time(spine_event event); -FFI_PLUGIN_EXPORT int spine_event_get_int_value(spine_event event); -FFI_PLUGIN_EXPORT void spine_event_set_int_value(spine_event event, int value); +FFI_PLUGIN_EXPORT int32_t spine_event_get_int_value(spine_event event); +FFI_PLUGIN_EXPORT void spine_event_set_int_value(spine_event event, int32_t value); FFI_PLUGIN_EXPORT float spine_event_get_float_value(spine_event event); FFI_PLUGIN_EXPORT void spine_event_set_float_value(spine_event event, float value); -FFI_PLUGIN_EXPORT const char* spine_event_get_string_value(spine_event event); -FFI_PLUGIN_EXPORT void spine_event_set_string_value(spine_event event, const char *value); +FFI_PLUGIN_EXPORT const utf8* spine_event_get_string_value(spine_event event); +FFI_PLUGIN_EXPORT void spine_event_set_string_value(spine_event event, const utf8 *value); FFI_PLUGIN_EXPORT float spine_event_get_volume(spine_event event); FFI_PLUGIN_EXPORT void spine_event_set_volume(spine_event event, float volume); FFI_PLUGIN_EXPORT float spine_event_get_balance(spine_event event); FFI_PLUGIN_EXPORT void spine_event_set_balance(spine_event event, float balance); -FFI_PLUGIN_EXPORT int spine_slot_data_get_index(spine_slot_data slot); -FFI_PLUGIN_EXPORT const char* spine_slot_data_get_name(spine_slot_data slot); +FFI_PLUGIN_EXPORT int32_t spine_slot_data_get_index(spine_slot_data slot); +FFI_PLUGIN_EXPORT const utf8* spine_slot_data_get_name(spine_slot_data slot); FFI_PLUGIN_EXPORT spine_bone_data spine_slot_data_get_bone_data(spine_slot_data slot); FFI_PLUGIN_EXPORT spine_color spine_slot_data_get_color(spine_slot_data slot); FFI_PLUGIN_EXPORT void spine_slot_data_set_color(spine_slot_data slot, float r, float g, float b, float a); FFI_PLUGIN_EXPORT spine_color spine_slot_data_get_dark_color(spine_slot_data slot); FFI_PLUGIN_EXPORT void spine_slot_data_set_dark_color(spine_slot_data slot, float r, float g, float b, float a); -FFI_PLUGIN_EXPORT int spine_slot_data_has_dark_color(spine_slot_data slot); -FFI_PLUGIN_EXPORT void spine_slot_data_set_has_dark_color(spine_slot_data slot, int hasDarkColor); -FFI_PLUGIN_EXPORT const char* spine_slot_data_get_attachment_name(spine_slot_data slot); -FFI_PLUGIN_EXPORT void spine_slot_data_set_attachment_name(spine_slot_data slot, const char *attachmentName); +FFI_PLUGIN_EXPORT int32_t spine_slot_data_has_dark_color(spine_slot_data slot); +FFI_PLUGIN_EXPORT void spine_slot_data_set_has_dark_color(spine_slot_data slot, int32_t hasDarkColor); +FFI_PLUGIN_EXPORT const utf8* spine_slot_data_get_attachment_name(spine_slot_data slot); +FFI_PLUGIN_EXPORT void spine_slot_data_set_attachment_name(spine_slot_data slot, const utf8 *attachmentName); FFI_PLUGIN_EXPORT spine_blend_mode spine_slot_data_get_blend_mode(spine_slot_data slot); FFI_PLUGIN_EXPORT void spine_slot_data_set_blend_mode(spine_slot_data slot, spine_blend_mode blendMode); @@ -453,16 +441,16 @@ FFI_PLUGIN_EXPORT spine_color spine_slot_get_color(spine_slot slot); FFI_PLUGIN_EXPORT void spine_slot_set_color(spine_slot slot, float r, float g, float b, float a); FFI_PLUGIN_EXPORT spine_color spine_slot_get_dark_color(spine_slot slot); FFI_PLUGIN_EXPORT void spine_slot_set_dark_color(spine_slot slot, float r, float g, float b, float a); -FFI_PLUGIN_EXPORT int spine_slot_has_dark_color(spine_slot slot); +FFI_PLUGIN_EXPORT int32_t spine_slot_has_dark_color(spine_slot slot); FFI_PLUGIN_EXPORT spine_attachment spine_slot_get_attachment(spine_slot slot); FFI_PLUGIN_EXPORT void spine_slot_set_attachment(spine_slot slot, spine_attachment attachment); // OMITTED getDeform() -FFI_PLUGIN_EXPORT int spine_slot_get_sequence_index(spine_slot slot); -FFI_PLUGIN_EXPORT void spine_slot_set_sequence_index(spine_slot slot, int sequenceIndex); +FFI_PLUGIN_EXPORT int32_t spine_slot_get_sequence_index(spine_slot slot); +FFI_PLUGIN_EXPORT void spine_slot_set_sequence_index(spine_slot slot, int32_t sequenceIndex); -FFI_PLUGIN_EXPORT int spine_bone_data_get_index(spine_bone_data data); -FFI_PLUGIN_EXPORT const char* spine_bone_data_get_name(spine_bone_data data); +FFI_PLUGIN_EXPORT int32_t spine_bone_data_get_index(spine_bone_data data); +FFI_PLUGIN_EXPORT const utf8* spine_bone_data_get_name(spine_bone_data data); FFI_PLUGIN_EXPORT spine_bone_data spine_bone_data_get_parent(spine_bone_data data); FFI_PLUGIN_EXPORT float spine_bone_data_get_length(spine_bone_data data); FFI_PLUGIN_EXPORT void spine_bone_data_set_length(spine_bone_data data, float length); @@ -482,13 +470,13 @@ FFI_PLUGIN_EXPORT float spine_bone_data_get_shear_y(spine_bone_data data); FFI_PLUGIN_EXPORT void spine_bone_data_set_shear_y(spine_bone_data data, float shearY); FFI_PLUGIN_EXPORT spine_transform_mode spine_bone_data_get_transform_mode(spine_bone_data data); FFI_PLUGIN_EXPORT void spine_bone_data_set_transform_mode(spine_bone_data data, spine_transform_mode mode); -FFI_PLUGIN_EXPORT int spine_bone_data_is_skin_required(spine_bone_data data); -FFI_PLUGIN_EXPORT void spine_bone_data_set_is_skin_required(spine_bone_data data, int isSkinRequired); +FFI_PLUGIN_EXPORT int32_t spine_bone_data_is_skin_required(spine_bone_data data); +FFI_PLUGIN_EXPORT void spine_bone_data_set_is_skin_required(spine_bone_data data, int32_t isSkinRequired); FFI_PLUGIN_EXPORT spine_color spine_bone_data_get_color(spine_bone_data data); FFI_PLUGIN_EXPORT void spine_bone_data_set_color(spine_bone_data data, float r, float g, float b, float a); -FFI_PLUGIN_EXPORT void spine_bone_set_is_y_down(int yDown); -FFI_PLUGIN_EXPORT int spine_bone_get_is_y_down(); +FFI_PLUGIN_EXPORT void spine_bone_set_is_y_down(int32_t yDown); +FFI_PLUGIN_EXPORT int32_t spine_bone_get_is_y_down(); FFI_PLUGIN_EXPORT void spine_bone_update(spine_bone bone); FFI_PLUGIN_EXPORT void spine_bone_update_world_transform(spine_bone bone); FFI_PLUGIN_EXPORT void spine_bone_update_world_transform_with(spine_bone bone, float x, float y, float rotation, float scaleX, float scaleY, float shearX, float shearY); @@ -503,7 +491,7 @@ FFI_PLUGIN_EXPORT float spine_bone_get_world_to_local_rotation_y(spine_bone bone FFI_PLUGIN_EXPORT spine_bone_data spine_bone_get_data(spine_bone bone); FFI_PLUGIN_EXPORT spine_skeleton spine_bone_get_skeleton(spine_bone bone); FFI_PLUGIN_EXPORT spine_bone spine_bone_get_parent(spine_bone bone); -FFI_PLUGIN_EXPORT int spine_bone_get_num_children(spine_bone bone); +FFI_PLUGIN_EXPORT int32_t spine_bone_get_num_children(spine_bone bone); FFI_PLUGIN_EXPORT spine_bone* spine_bone_get_children(spine_bone bone); FFI_PLUGIN_EXPORT float spine_bone_get_x(spine_bone bone); FFI_PLUGIN_EXPORT void spine_bone_set_x(spine_bone bone, float x); @@ -549,10 +537,10 @@ FFI_PLUGIN_EXPORT float spine_bone_get_world_rotation_x(spine_bone bone); FFI_PLUGIN_EXPORT float spine_bone_get_world_rotation_y(spine_bone bone); FFI_PLUGIN_EXPORT float spine_bone_get_world_scale_x(spine_bone bone); FFI_PLUGIN_EXPORT float spine_bone_get_world_scale_y(spine_bone bone); -FFI_PLUGIN_EXPORT int spine_bone_get_is_active(spine_bone bone); -FFI_PLUGIN_EXPORT void spine_bone_set_is_active(spine_bone bone, int isActive); +FFI_PLUGIN_EXPORT int32_t spine_bone_get_is_active(spine_bone bone); +FFI_PLUGIN_EXPORT void spine_bone_set_is_active(spine_bone bone, int32_t isActive); -FFI_PLUGIN_EXPORT const char* spine_attachment_get_name(spine_attachment attachment); +FFI_PLUGIN_EXPORT const utf8* spine_attachment_get_name(spine_attachment attachment); FFI_PLUGIN_EXPORT spine_attachment_type spine_attachment_get_type(spine_attachment attachment); FFI_PLUGIN_EXPORT spine_attachment spine_attachment_copy(spine_attachment attachment); FFI_PLUGIN_EXPORT void spine_attachment_dispose(spine_attachment attachment); @@ -586,40 +574,40 @@ FFI_PLUGIN_EXPORT float spine_region_attachment_get_height(spine_region_attachme FFI_PLUGIN_EXPORT void spine_region_attachment_set_height(spine_region_attachment attachment, float height); FFI_PLUGIN_EXPORT spine_color spine_region_attachment_get_color(spine_region_attachment attachment); FFI_PLUGIN_EXPORT void spine_region_attachment_set_color(spine_region_attachment attachment, float r, float g, float b, float a); -FFI_PLUGIN_EXPORT const char *spine_region_attachment_get_path(spine_region_attachment attachment); +FFI_PLUGIN_EXPORT const utf8 *spine_region_attachment_get_path(spine_region_attachment attachment); // OMITTED setPath() FFI_PLUGIN_EXPORT spine_texture_region spine_region_attachment_get_region(spine_region_attachment attachment); // OMITTED setRegion() FFI_PLUGIN_EXPORT spine_sequence spine_region_attachment_get_sequence(spine_region_attachment attachment); // OMITTED setSequence() -FFI_PLUGIN_EXPORT int spine_region_attachment_get_num_offset(spine_region_attachment attachment); +FFI_PLUGIN_EXPORT int32_t spine_region_attachment_get_num_offset(spine_region_attachment attachment); FFI_PLUGIN_EXPORT float *spine_region_attachment_get_offset(spine_region_attachment attachment); -FFI_PLUGIN_EXPORT int spine_region_attachment_get_num_uvs(spine_region_attachment attachment); +FFI_PLUGIN_EXPORT int32_t spine_region_attachment_get_num_uvs(spine_region_attachment attachment); FFI_PLUGIN_EXPORT float *spine_region_attachment_get_uvs(spine_region_attachment attachment); -FFI_PLUGIN_EXPORT int spine_vertex_attachment_get_world_vertices_length(spine_vertex_attachment attachment); +FFI_PLUGIN_EXPORT int32_t spine_vertex_attachment_get_world_vertices_length(spine_vertex_attachment attachment); FFI_PLUGIN_EXPORT void spine_vertex_attachment_compute_world_vertices(spine_vertex_attachment attachment, spine_slot slot, float *worldVertices); // OMITTED getId() -FFI_PLUGIN_EXPORT int spine_vertex_attachment_get_num_bones(spine_vertex_attachment attachment); +FFI_PLUGIN_EXPORT int32_t spine_vertex_attachment_get_num_bones(spine_vertex_attachment attachment); FFI_PLUGIN_EXPORT int32_t *spine_vertex_attachment_get_bones(spine_vertex_attachment attachment); -FFI_PLUGIN_EXPORT int spine_vertex_attachment_get_num_vertices(spine_vertex_attachment attachment); +FFI_PLUGIN_EXPORT int32_t spine_vertex_attachment_get_num_vertices(spine_vertex_attachment attachment); FFI_PLUGIN_EXPORT float *spine_vertex_attachment_get_vertices(spine_vertex_attachment attachment); FFI_PLUGIN_EXPORT spine_attachment spine_vertex_attachment_get_timeline_attachment(spine_vertex_attachment timelineAttachment); FFI_PLUGIN_EXPORT void spine_vertex_attachment_set_timeline_attachment(spine_vertex_attachment attachment, spine_attachment timelineAttachment); // OMITTED copyTo() FFI_PLUGIN_EXPORT void spine_mesh_attachment_update_region(spine_mesh_attachment attachment); -FFI_PLUGIN_EXPORT int spine_mesh_attachment_get_hull_length(spine_mesh_attachment attachment); -FFI_PLUGIN_EXPORT void spine_mesh_attachment_set_hull_length(spine_mesh_attachment attachment, int hullLength); -FFI_PLUGIN_EXPORT int spine_mesh_attachment_get_num_region_uvs(spine_mesh_attachment attachment); +FFI_PLUGIN_EXPORT int32_t spine_mesh_attachment_get_hull_length(spine_mesh_attachment attachment); +FFI_PLUGIN_EXPORT void spine_mesh_attachment_set_hull_length(spine_mesh_attachment attachment, int32_t hullLength); +FFI_PLUGIN_EXPORT int32_t spine_mesh_attachment_get_num_region_uvs(spine_mesh_attachment attachment); FFI_PLUGIN_EXPORT float *spine_mesh_attachment_get_region_uvs(spine_mesh_attachment attachment); -FFI_PLUGIN_EXPORT int spine_mesh_attachment_get_num_uvs(spine_mesh_attachment attachment); +FFI_PLUGIN_EXPORT int32_t spine_mesh_attachment_get_num_uvs(spine_mesh_attachment attachment); FFI_PLUGIN_EXPORT float *spine_mesh_attachment_get_uvs(spine_mesh_attachment attachment); -FFI_PLUGIN_EXPORT int spine_mesh_attachment_get_num_triangles(spine_mesh_attachment attachment); +FFI_PLUGIN_EXPORT int32_t spine_mesh_attachment_get_num_triangles(spine_mesh_attachment attachment); FFI_PLUGIN_EXPORT uint16_t *spine_mesh_attachment_get_triangles(spine_mesh_attachment attachment); FFI_PLUGIN_EXPORT spine_color spine_mesh_attachment_get_color(spine_mesh_attachment attachment); FFI_PLUGIN_EXPORT void spine_mesh_attachment_set_color(spine_mesh_attachment attachment, float r, float g, float b, float a); -FFI_PLUGIN_EXPORT const char *spine_mesh_attachment_get_path(spine_mesh_attachment attachment); +FFI_PLUGIN_EXPORT const utf8 *spine_mesh_attachment_get_path(spine_mesh_attachment attachment); // OMITTED setPath() FFI_PLUGIN_EXPORT spine_texture_region spine_mesh_attachment_get_region(spine_mesh_attachment attachment); // OMITTED setRegion() @@ -627,7 +615,7 @@ FFI_PLUGIN_EXPORT spine_sequence spine_mesh_attachment_get_sequence(spine_mesh_a // OMITTED setSequence() FFI_PLUGIN_EXPORT spine_mesh_attachment spine_mesh_attachment_get_parent_mesh(spine_mesh_attachment attachment); FFI_PLUGIN_EXPORT void spine_mesh_attachment_set_parent_mesh(spine_mesh_attachment attachment, spine_mesh_attachment parentMesh); -FFI_PLUGIN_EXPORT int spine_mesh_attachment_get_num_edges(spine_mesh_attachment attachment); +FFI_PLUGIN_EXPORT int32_t spine_mesh_attachment_get_num_edges(spine_mesh_attachment attachment); FFI_PLUGIN_EXPORT uint16_t *spine_mesh_attachment_get_edges(spine_mesh_attachment attachment); FFI_PLUGIN_EXPORT float spine_mesh_attachment_get_width(spine_mesh_attachment attachment); FFI_PLUGIN_EXPORT void spine_mesh_attachment_set_width(spine_mesh_attachment attachment, float width); @@ -643,77 +631,82 @@ FFI_PLUGIN_EXPORT void spine_clipping_attachment_set_color(spine_clipping_attach FFI_PLUGIN_EXPORT spine_color spine_bounding_box_attachment_get_color(spine_bounding_box_attachment attachment); FFI_PLUGIN_EXPORT void spine_bounding_box_attachment_set_color(spine_bounding_box_attachment attachment, float r, float g, float b, float a); -FFI_PLUGIN_EXPORT int spine_path_attachment_get_num_lengths(spine_path_attachment attachment); +FFI_PLUGIN_EXPORT int32_t spine_path_attachment_get_num_lengths(spine_path_attachment attachment); FFI_PLUGIN_EXPORT float *spine_path_attachment_get_lengths(spine_path_attachment attachment); -FFI_PLUGIN_EXPORT int spine_path_attachment_get_is_closed(spine_path_attachment attachment); -FFI_PLUGIN_EXPORT void spine_path_attachment_set_is_closed(spine_path_attachment attachment, int isClosed); -FFI_PLUGIN_EXPORT int spine_path_attachment_get_is_constant_speed(spine_path_attachment attachment); -FFI_PLUGIN_EXPORT void spine_path_attachment_set_is_constant_speed(spine_path_attachment attachment, int isConstantSpeed); +FFI_PLUGIN_EXPORT int32_t spine_path_attachment_get_is_closed(spine_path_attachment attachment); +FFI_PLUGIN_EXPORT void spine_path_attachment_set_is_closed(spine_path_attachment attachment, int32_t isClosed); +FFI_PLUGIN_EXPORT int32_t spine_path_attachment_get_is_constant_speed(spine_path_attachment attachment); +FFI_PLUGIN_EXPORT void spine_path_attachment_set_is_constant_speed(spine_path_attachment attachment, int32_t isConstantSpeed); FFI_PLUGIN_EXPORT spine_color spine_path_attachment_get_color(spine_path_attachment attachment); FFI_PLUGIN_EXPORT void spine_path_attachment_set_color(spine_path_attachment attachment, float r, float g, float b, float a); -FFI_PLUGIN_EXPORT void spine_skin_set_attachment(spine_skin skin, int slotIndex, const char* name, spine_attachment attachment); -FFI_PLUGIN_EXPORT spine_attachment spine_skin_get_attachment(spine_skin skin, int slotIndex, const char* name); -FFI_PLUGIN_EXPORT void spine_skin_remove_attachment(spine_skin skin, int slotIndex, const char* name); +FFI_PLUGIN_EXPORT void spine_skin_set_attachment(spine_skin skin, int32_t slotIndex, const utf8* name, spine_attachment attachment); +FFI_PLUGIN_EXPORT spine_attachment spine_skin_get_attachment(spine_skin skin, int32_t slotIndex, const utf8* name); +FFI_PLUGIN_EXPORT void spine_skin_remove_attachment(spine_skin skin, int32_t slotIndex, const utf8* name); // OMITTED findNamesForSlot() // OMITTED findAttachmentsForSlot() -FFI_PLUGIN_EXPORT const char* spine_skin_get_name(spine_skin skin); +FFI_PLUGIN_EXPORT const utf8* spine_skin_get_name(spine_skin skin); FFI_PLUGIN_EXPORT void spine_skin_add_skin(spine_skin skin, spine_skin other); FFI_PLUGIN_EXPORT void spine_skin_copy_skin(spine_skin skin, spine_skin other); -FFI_PLUGIN_EXPORT spine_skin_entries *spine_skin_get_entries(spine_skin skin); -FFI_PLUGIN_EXPORT void spine_skin_entries_dispose(spine_skin_entries *entries); -FFI_PLUGIN_EXPORT int spine_skin_get_num_bones(spine_skin skin); +FFI_PLUGIN_EXPORT spine_skin_entries spine_skin_get_entries(spine_skin skin); +FFI_PLUGIN_EXPORT int32_t spine_skin_entries_get_num_entries(spine_skin_entries entries); +FFI_PLUGIN_EXPORT spine_skin_entry spine_skin_entries_get_entry(spine_skin_entries entries, int32_t index); +FFI_PLUGIN_EXPORT void spine_skin_entries_dispose(spine_skin_entries entries); +FFI_PLUGIN_EXPORT int32_t spine_skin_entry_get_slot_index(spine_skin_entry entry); +FFI_PLUGIN_EXPORT utf8 *spine_skin_entry_get_name(spine_skin_entry entry); +FFI_PLUGIN_EXPORT spine_attachment spine_skin_entry_get_attachment(spine_skin_entry entry); +FFI_PLUGIN_EXPORT int32_t spine_skin_get_num_bones(spine_skin skin); FFI_PLUGIN_EXPORT spine_bone_data* spine_skin_get_bones(spine_skin skin); -FFI_PLUGIN_EXPORT int spine_skin_get_num_constraints(spine_skin skin); +FFI_PLUGIN_EXPORT int32_t spine_skin_get_num_constraints(spine_skin skin); FFI_PLUGIN_EXPORT spine_constraint_data* spine_skin_get_constraints(spine_skin skin); -FFI_PLUGIN_EXPORT spine_skin spine_skin_create(const char* name); +FFI_PLUGIN_EXPORT spine_skin spine_skin_create(const utf8* name); FFI_PLUGIN_EXPORT void spine_skin_dispose(spine_skin skin); FFI_PLUGIN_EXPORT spine_constraint_type spine_constraint_data_get_type(spine_constraint_data data); -FFI_PLUGIN_EXPORT const char* spine_constraint_data_get_name(spine_constraint_data data); +FFI_PLUGIN_EXPORT const utf8* spine_constraint_data_get_name(spine_constraint_data data); FFI_PLUGIN_EXPORT uint64_t spine_constraint_data_get_order(spine_constraint_data data); FFI_PLUGIN_EXPORT void spine_constraint_data_set_order(spine_constraint_data data, uint64_t order); -FFI_PLUGIN_EXPORT int spine_constraint_data_get_is_skin_required(spine_constraint_data data); -FFI_PLUGIN_EXPORT void spine_constraint_data_set_is_skin_required(spine_constraint_data data, int isSkinRequired); +FFI_PLUGIN_EXPORT int32_t spine_constraint_data_get_is_skin_required(spine_constraint_data data); +FFI_PLUGIN_EXPORT void spine_constraint_data_set_is_skin_required(spine_constraint_data data, int32_t isSkinRequired); -FFI_PLUGIN_EXPORT int spine_ik_constraint_data_get_num_bones(spine_ik_constraint_data data); +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_data_get_num_bones(spine_ik_constraint_data data); FFI_PLUGIN_EXPORT spine_bone_data* spine_ik_constraint_data_get_bones(spine_ik_constraint_data data); FFI_PLUGIN_EXPORT spine_bone_data spine_ik_constraint_data_get_target(spine_ik_constraint_data data); FFI_PLUGIN_EXPORT void spine_ik_constraint_data_set_target(spine_ik_constraint_data data, spine_bone_data target); -FFI_PLUGIN_EXPORT int spine_ik_constraint_data_get_bend_direction(spine_ik_constraint_data data); -FFI_PLUGIN_EXPORT void spine_ik_constraint_data_set_bend_direction(spine_ik_constraint_data data, int bendDirection); -FFI_PLUGIN_EXPORT int spine_ik_constraint_data_get_compress(spine_ik_constraint_data data); -FFI_PLUGIN_EXPORT void spine_ik_constraint_data_set_compress(spine_ik_constraint_data data, int compress); -FFI_PLUGIN_EXPORT int spine_ik_constraint_data_get_stretch(spine_ik_constraint_data data); -FFI_PLUGIN_EXPORT void spine_ik_constraint_data_set_stretch(spine_ik_constraint_data data, int stretch); -FFI_PLUGIN_EXPORT int spine_ik_constraint_data_get_uniform(spine_ik_constraint_data data); -FFI_PLUGIN_EXPORT void spine_ik_constraint_data_set_uniform(spine_ik_constraint_data data, int uniform); +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_data_get_bend_direction(spine_ik_constraint_data data); +FFI_PLUGIN_EXPORT void spine_ik_constraint_data_set_bend_direction(spine_ik_constraint_data data, int32_t bendDirection); +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_data_get_compress(spine_ik_constraint_data data); +FFI_PLUGIN_EXPORT void spine_ik_constraint_data_set_compress(spine_ik_constraint_data data, int32_t compress); +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_data_get_stretch(spine_ik_constraint_data data); +FFI_PLUGIN_EXPORT void spine_ik_constraint_data_set_stretch(spine_ik_constraint_data data, int32_t stretch); +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_data_get_uniform(spine_ik_constraint_data data); +FFI_PLUGIN_EXPORT void spine_ik_constraint_data_set_uniform(spine_ik_constraint_data data, int32_t uniform); FFI_PLUGIN_EXPORT float spine_ik_constraint_data_get_mix(spine_ik_constraint_data data); FFI_PLUGIN_EXPORT void spine_ik_constraint_data_set_mix(spine_ik_constraint_data data, float mix); FFI_PLUGIN_EXPORT float spine_ik_constraint_data_get_softness(spine_ik_constraint_data data); FFI_PLUGIN_EXPORT void spine_ik_constraint_data_set_softness(spine_ik_constraint_data data, float softness); FFI_PLUGIN_EXPORT void spine_ik_constraint_update(spine_ik_constraint constraint); -FFI_PLUGIN_EXPORT int spine_ik_constraint_get_order(spine_ik_constraint constraint); +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_get_order(spine_ik_constraint constraint); FFI_PLUGIN_EXPORT spine_ik_constraint_data spine_ik_constraint_get_data(spine_ik_constraint constraint); -FFI_PLUGIN_EXPORT int spine_ik_constraint_get_num_bones(spine_ik_constraint constraint); +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_get_num_bones(spine_ik_constraint constraint); FFI_PLUGIN_EXPORT spine_bone* spine_ik_constraint_get_bones(spine_ik_constraint constraint); FFI_PLUGIN_EXPORT spine_bone spine_ik_constraint_get_target(spine_ik_constraint constraint); FFI_PLUGIN_EXPORT void spine_ik_constraint_set_target(spine_ik_constraint constraint, spine_bone target); -FFI_PLUGIN_EXPORT int spine_ik_constraint_get_bend_direction(spine_ik_constraint constraint); -FFI_PLUGIN_EXPORT void spine_ik_constraint_set_bend_direction(spine_ik_constraint constraint, int bendDirection); -FFI_PLUGIN_EXPORT int spine_ik_constraint_get_compress(spine_ik_constraint constraint); -FFI_PLUGIN_EXPORT void spine_ik_constraint_set_compress(spine_ik_constraint constraint, int compress); -FFI_PLUGIN_EXPORT int spine_ik_constraint_get_stretch(spine_ik_constraint constraint); -FFI_PLUGIN_EXPORT void spine_ik_constraint_set_stretch(spine_ik_constraint constraint, int stretch); +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_get_bend_direction(spine_ik_constraint constraint); +FFI_PLUGIN_EXPORT void spine_ik_constraint_set_bend_direction(spine_ik_constraint constraint, int32_t bendDirection); +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_get_compress(spine_ik_constraint constraint); +FFI_PLUGIN_EXPORT void spine_ik_constraint_set_compress(spine_ik_constraint constraint, int32_t compress); +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_get_stretch(spine_ik_constraint constraint); +FFI_PLUGIN_EXPORT void spine_ik_constraint_set_stretch(spine_ik_constraint constraint, int32_t stretch); FFI_PLUGIN_EXPORT float spine_ik_constraint_get_mix(spine_ik_constraint constraint); FFI_PLUGIN_EXPORT void spine_ik_constraint_set_mix(spine_ik_constraint constraint, float mix); FFI_PLUGIN_EXPORT float spine_ik_constraint_get_softness(spine_ik_constraint constraint); FFI_PLUGIN_EXPORT void spine_ik_constraint_set_softness(spine_ik_constraint constraint, float softness); -FFI_PLUGIN_EXPORT int spine_ik_constraint_get_is_active(spine_ik_constraint constraint); -FFI_PLUGIN_EXPORT void spine_ik_constraint_set_is_active(spine_ik_constraint constraint, int isActive); +FFI_PLUGIN_EXPORT int32_t spine_ik_constraint_get_is_active(spine_ik_constraint constraint); +FFI_PLUGIN_EXPORT void spine_ik_constraint_set_is_active(spine_ik_constraint constraint, int32_t isActive); -FFI_PLUGIN_EXPORT int spine_transform_constraint_data_get_num_bones(spine_transform_constraint_data data); +FFI_PLUGIN_EXPORT int32_t spine_transform_constraint_data_get_num_bones(spine_transform_constraint_data data); FFI_PLUGIN_EXPORT spine_bone_data* spine_transform_constraint_data_get_bones(spine_transform_constraint_data data); FFI_PLUGIN_EXPORT spine_bone_data spine_transform_constraint_data_get_target(spine_transform_constraint_data data); FFI_PLUGIN_EXPORT void spine_transform_constraint_data_set_target(spine_transform_constraint_data data, spine_bone_data target); @@ -741,15 +734,15 @@ FFI_PLUGIN_EXPORT float spine_transform_constraint_data_get_offset_scale_y(spine FFI_PLUGIN_EXPORT void spine_transform_constraint_data_set_offset_scale_y(spine_transform_constraint_data data, float offsetScaleY); FFI_PLUGIN_EXPORT float spine_transform_constraint_data_get_offset_shear_y(spine_transform_constraint_data data); FFI_PLUGIN_EXPORT void spine_transform_constraint_data_set_offset_shear_y(spine_transform_constraint_data data, float offsetShearY); -FFI_PLUGIN_EXPORT int spine_transform_constraint_data_get_is_relative(spine_transform_constraint_data data); -FFI_PLUGIN_EXPORT void spine_transform_constraint_data_set_is_relative(spine_transform_constraint_data data, int isRelative); -FFI_PLUGIN_EXPORT int spine_transform_constraint_data_get_is_local(spine_transform_constraint_data data); -FFI_PLUGIN_EXPORT void spine_transform_constraint_data_set_is_local(spine_transform_constraint_data data, int isLocal); +FFI_PLUGIN_EXPORT int32_t spine_transform_constraint_data_get_is_relative(spine_transform_constraint_data data); +FFI_PLUGIN_EXPORT void spine_transform_constraint_data_set_is_relative(spine_transform_constraint_data data, int32_t isRelative); +FFI_PLUGIN_EXPORT int32_t spine_transform_constraint_data_get_is_local(spine_transform_constraint_data data); +FFI_PLUGIN_EXPORT void spine_transform_constraint_data_set_is_local(spine_transform_constraint_data data, int32_t isLocal); FFI_PLUGIN_EXPORT void spine_transform_constraint_update(spine_transform_constraint constraint); -FFI_PLUGIN_EXPORT int spine_transform_constraint_get_order(spine_transform_constraint constraint); +FFI_PLUGIN_EXPORT int32_t spine_transform_constraint_get_order(spine_transform_constraint constraint); FFI_PLUGIN_EXPORT spine_transform_constraint_data spine_transform_constraint_get_data(spine_transform_constraint constraint); -FFI_PLUGIN_EXPORT int spine_transform_constraint_get_num_bones(spine_transform_constraint constraint); +FFI_PLUGIN_EXPORT int32_t spine_transform_constraint_get_num_bones(spine_transform_constraint constraint); FFI_PLUGIN_EXPORT spine_bone* spine_transform_constraint_get_bones(spine_transform_constraint constraint); FFI_PLUGIN_EXPORT spine_bone spine_transform_constraint_get_target(spine_transform_constraint constraint); FFI_PLUGIN_EXPORT void spine_transform_constraint_set_target(spine_transform_constraint constraint, spine_bone target); @@ -766,9 +759,9 @@ FFI_PLUGIN_EXPORT void spine_transform_constraint_set_mix_scale_y(spine_transfor FFI_PLUGIN_EXPORT float spine_transform_constraint_get_mix_shear_y(spine_transform_constraint constraint); FFI_PLUGIN_EXPORT void spine_transform_constraint_set_mix_shear_y(spine_transform_constraint constraint, float mixShearY); FFI_PLUGIN_EXPORT float spine_transform_constraint_get_is_active(spine_transform_constraint constraint); -FFI_PLUGIN_EXPORT void spine_transform_constraint_set_is_active(spine_transform_constraint constraint, int isActive); +FFI_PLUGIN_EXPORT void spine_transform_constraint_set_is_active(spine_transform_constraint constraint, int32_t isActive); -FFI_PLUGIN_EXPORT int spine_path_constraint_data_get_num_bones(spine_path_constraint_data data); +FFI_PLUGIN_EXPORT int32_t spine_path_constraint_data_get_num_bones(spine_path_constraint_data data); FFI_PLUGIN_EXPORT spine_bone_data* spine_path_constraint_data_get_bones(spine_path_constraint_data data); FFI_PLUGIN_EXPORT spine_slot_data spine_path_constraint_data_get_target(spine_path_constraint_data data); FFI_PLUGIN_EXPORT void spine_path_constraint_data_set_target(spine_path_constraint_data data, spine_slot_data target); @@ -792,9 +785,9 @@ FFI_PLUGIN_EXPORT float spine_path_constraint_data_get_mix_y(spine_path_constrai FFI_PLUGIN_EXPORT void spine_path_constraint_data_set_mix_y(spine_path_constraint_data data, float mixY); FFI_PLUGIN_EXPORT void spine_path_constraint_update(spine_path_constraint constraint); -FFI_PLUGIN_EXPORT int spine_path_constraint_get_order(spine_path_constraint constraint); +FFI_PLUGIN_EXPORT int32_t spine_path_constraint_get_order(spine_path_constraint constraint); FFI_PLUGIN_EXPORT spine_path_constraint_data spine_path_constraint_get_data(spine_path_constraint constraint); -FFI_PLUGIN_EXPORT int spine_path_constraint_get_num_bones(spine_path_constraint constraint); +FFI_PLUGIN_EXPORT int32_t spine_path_constraint_get_num_bones(spine_path_constraint constraint); FFI_PLUGIN_EXPORT spine_bone* spine_path_constraint_get_bones(spine_path_constraint constraint); FFI_PLUGIN_EXPORT spine_slot spine_path_constraint_get_target(spine_path_constraint constraint); FFI_PLUGIN_EXPORT void spine_path_constraint_set_target(spine_path_constraint constraint, spine_slot target); @@ -808,21 +801,21 @@ FFI_PLUGIN_EXPORT float spine_path_constraint_get_mix_x(spine_path_constraint co FFI_PLUGIN_EXPORT void spine_path_constraint_set_mix_x(spine_path_constraint constraint, float mixX); FFI_PLUGIN_EXPORT float spine_path_constraint_get_mix_y(spine_path_constraint constraint); FFI_PLUGIN_EXPORT void spine_path_constraint_set_mix_y(spine_path_constraint constraint, float mixY); -FFI_PLUGIN_EXPORT int spine_path_constraint_get_is_active(spine_path_constraint constraint); -FFI_PLUGIN_EXPORT void spine_path_constraint_set_is_active(spine_path_constraint constraint, int isActive); +FFI_PLUGIN_EXPORT int32_t spine_path_constraint_get_is_active(spine_path_constraint constraint); +FFI_PLUGIN_EXPORT void spine_path_constraint_set_is_active(spine_path_constraint constraint, int32_t isActive); // OMITTED copy() FFI_PLUGIN_EXPORT void spine_sequence_apply(spine_sequence sequence, spine_slot slot, spine_attachment attachment); -FFI_PLUGIN_EXPORT const char* spine_sequence_get_path(spine_sequence sequence, const char *basePath, int index); -FFI_PLUGIN_EXPORT int spine_sequence_get_id(spine_sequence sequence); -FFI_PLUGIN_EXPORT void spine_sequence_set_id(spine_sequence sequence, int id); -FFI_PLUGIN_EXPORT int spine_sequence_get_start(spine_sequence sequence); -FFI_PLUGIN_EXPORT void spine_sequence_set_start(spine_sequence sequence, int start); -FFI_PLUGIN_EXPORT int spine_sequence_get_digits(spine_sequence sequence); -FFI_PLUGIN_EXPORT void spine_sequence_set_digits(spine_sequence sequence, int digits); -FFI_PLUGIN_EXPORT int spine_sequence_get_setup_index(spine_sequence sequence); -FFI_PLUGIN_EXPORT void spine_sequence_set_setup_index(spine_sequence sequence, int setupIndex); -FFI_PLUGIN_EXPORT int spine_sequence_get_num_regions(spine_sequence sequence); +FFI_PLUGIN_EXPORT const utf8* spine_sequence_get_path(spine_sequence sequence, const utf8 *basePath, int32_t index); +FFI_PLUGIN_EXPORT int32_t spine_sequence_get_id(spine_sequence sequence); +FFI_PLUGIN_EXPORT void spine_sequence_set_id(spine_sequence sequence, int32_t id); +FFI_PLUGIN_EXPORT int32_t spine_sequence_get_start(spine_sequence sequence); +FFI_PLUGIN_EXPORT void spine_sequence_set_start(spine_sequence sequence, int32_t start); +FFI_PLUGIN_EXPORT int32_t spine_sequence_get_digits(spine_sequence sequence); +FFI_PLUGIN_EXPORT void spine_sequence_set_digits(spine_sequence sequence, int32_t digits); +FFI_PLUGIN_EXPORT int32_t spine_sequence_get_setup_index(spine_sequence sequence); +FFI_PLUGIN_EXPORT void spine_sequence_set_setup_index(spine_sequence sequence, int32_t setupIndex); +FFI_PLUGIN_EXPORT int32_t spine_sequence_get_num_regions(spine_sequence sequence); FFI_PLUGIN_EXPORT spine_texture_region* spine_sequence_get_regions(spine_sequence sequence); FFI_PLUGIN_EXPORT void* spine_texture_region_get_texture(spine_texture_region textureRegion); @@ -835,19 +828,19 @@ FFI_PLUGIN_EXPORT float spine_texture_region_get_u2(spine_texture_region texture FFI_PLUGIN_EXPORT void spine_texture_region_set_u2(spine_texture_region textureRegion, float u2); FFI_PLUGIN_EXPORT float spine_texture_region_get_v2(spine_texture_region textureRegion); FFI_PLUGIN_EXPORT void spine_texture_region_set_v2(spine_texture_region textureRegion, float v2); -FFI_PLUGIN_EXPORT int spine_texture_region_get_degrees(spine_texture_region textureRegion); -FFI_PLUGIN_EXPORT void spine_texture_region_set_degrees(spine_texture_region textureRegion, int degrees); +FFI_PLUGIN_EXPORT int32_t spine_texture_region_get_degrees(spine_texture_region textureRegion); +FFI_PLUGIN_EXPORT void spine_texture_region_set_degrees(spine_texture_region textureRegion, int32_t degrees); FFI_PLUGIN_EXPORT float spine_texture_region_get_offset_x(spine_texture_region textureRegion); FFI_PLUGIN_EXPORT void spine_texture_region_set_offset_x(spine_texture_region textureRegion, float offsetX); FFI_PLUGIN_EXPORT float spine_texture_region_get_offset_y(spine_texture_region textureRegion); FFI_PLUGIN_EXPORT void spine_texture_region_set_offset_y(spine_texture_region textureRegion, float offsetY); -FFI_PLUGIN_EXPORT int spine_texture_region_get_width(spine_texture_region textureRegion); -FFI_PLUGIN_EXPORT void spine_texture_region_set_width(spine_texture_region textureRegion, int width); -FFI_PLUGIN_EXPORT int spine_texture_region_get_height(spine_texture_region textureRegion); -FFI_PLUGIN_EXPORT void spine_texture_region_set_height(spine_texture_region textureRegion, int height); -FFI_PLUGIN_EXPORT int spine_texture_region_get_original_width(spine_texture_region textureRegion); -FFI_PLUGIN_EXPORT void spine_texture_region_set_original_width(spine_texture_region textureRegion, int originalWidth); -FFI_PLUGIN_EXPORT int spine_texture_region_get_original_height(spine_texture_region textureRegion); -FFI_PLUGIN_EXPORT void spine_texture_region_set_original_height(spine_texture_region textureRegion, int originalHeight); +FFI_PLUGIN_EXPORT int32_t spine_texture_region_get_width(spine_texture_region textureRegion); +FFI_PLUGIN_EXPORT void spine_texture_region_set_width(spine_texture_region textureRegion, int32_t width); +FFI_PLUGIN_EXPORT int32_t spine_texture_region_get_height(spine_texture_region textureRegion); +FFI_PLUGIN_EXPORT void spine_texture_region_set_height(spine_texture_region textureRegion, int32_t height); +FFI_PLUGIN_EXPORT int32_t spine_texture_region_get_original_width(spine_texture_region textureRegion); +FFI_PLUGIN_EXPORT void spine_texture_region_set_original_width(spine_texture_region textureRegion, int32_t originalWidth); +FFI_PLUGIN_EXPORT int32_t spine_texture_region_get_original_height(spine_texture_region textureRegion); +FFI_PLUGIN_EXPORT void spine_texture_region_set_original_height(spine_texture_region textureRegion, int32_t originalHeight); #endif \ No newline at end of file