[flutter] Wrap remaining attachments.

This commit is contained in:
Mario Zechner 2022-09-08 09:40:35 +02:00
parent 302af378c0
commit f1ca95d32d
4 changed files with 909 additions and 4 deletions

View File

@ -1166,24 +1166,168 @@ class VertexAttachment<T extends Pointer> extends Attachment<T> {
} }
} }
// FIXME
class MeshAttachment extends VertexAttachment<spine_mesh_attachment> { class MeshAttachment extends VertexAttachment<spine_mesh_attachment> {
MeshAttachment._(spine_mesh_attachment attachment): super._(attachment.cast()); MeshAttachment._(spine_mesh_attachment attachment): super._(attachment.cast());
void updateRegion() {
_bindings.spine_mesh_attachment_update_region(_attachment);
}
int getHullLength() {
return _bindings.spine_mesh_attachment_get_hull_length(_attachment);
}
void setHullLength(int hullLength) {
_bindings.spine_mesh_attachment_set_hull_length(_attachment, hullLength);
}
Float32List getRegionUVs() {
final num = _bindings.spine_mesh_attachment_get_num_region_uvs(_attachment);
final uvs = _bindings.spine_mesh_attachment_get_region_uvs(_attachment);
return uvs.asTypedList(num);
}
Float32List getUVs() {
final num = _bindings.spine_mesh_attachment_get_num_uvs(_attachment);
final uvs = _bindings.spine_mesh_attachment_get_uvs(_attachment);
return uvs.asTypedList(num);
}
Uint16List getTriangles() {
final num = _bindings.spine_mesh_attachment_get_num_triangles(_attachment);
final triangles = _bindings.spine_mesh_attachment_get_triangles(_attachment);
return triangles.asTypedList(num);
}
Color getColor() {
final color = _bindings.spine_mesh_attachment_get_color(_attachment);
return Color(color.r, color.g, color.b, color.a);
}
void setColor(double r, double g, double b, double a) {
_bindings.spine_mesh_attachment_set_color(_attachment, r, g, b, a);
}
String getPath() {
Pointer<Utf8> path = _bindings.spine_mesh_attachment_get_path(_attachment).cast();
return path.toDartString();
}
TextureRegion? getRegion() {
final region = _bindings.spine_mesh_attachment_get_region(_attachment);
if (region.address == nullptr.address) return null;
return TextureRegion._(region);
}
Sequence? getSequence() {
final sequence = _bindings.spine_mesh_attachment_get_sequence(_attachment);
if (sequence.address == nullptr.address) return null;
return Sequence._(sequence);
}
MeshAttachment? getParentMesh() {
final parent = _bindings.spine_mesh_attachment_get_parent_mesh(_attachment);
if (parent.address == nullptr.address) return null;
return MeshAttachment._(parent);
}
void setParentMesh(MeshAttachment? parentMesh) {
_bindings.spine_mesh_attachment_set_parent_mesh(_attachment, parentMesh == null ? nullptr : parentMesh._attachment);
}
Uint16List getEdges() {
final num = _bindings.spine_mesh_attachment_get_num_edges(_attachment);
final edges = _bindings.spine_mesh_attachment_get_edges(_attachment);
return edges.asTypedList(num);
}
double getWidth() {
return _bindings.spine_mesh_attachment_get_width(_attachment);
}
void setWidth(double width) {
_bindings.spine_mesh_attachment_set_width(_attachment, width);
}
double getHeight() {
return _bindings.spine_mesh_attachment_get_height(_attachment);
}
void setHeight(double height) {
_bindings.spine_mesh_attachment_set_height(_attachment, height);
}
} }
// FIXME
class ClippingAttachment extends VertexAttachment<spine_clipping_attachment> { class ClippingAttachment extends VertexAttachment<spine_clipping_attachment> {
ClippingAttachment._(spine_clipping_attachment attachment): super._(attachment.cast()); ClippingAttachment._(spine_clipping_attachment attachment): super._(attachment.cast());
SlotData? getEndSlot() {
final endSlot = _bindings.spine_clipping_attachment_get_end_slot(_attachment);
if (endSlot.address == nullptr.address) return null;
return SlotData._(endSlot);
}
void setEndSlot(SlotData? endSlot) {
_bindings.spine_clipping_attachment_set_end_slot(_attachment, endSlot == null ? nullptr : endSlot._data);
}
Color getColor() {
final color = _bindings.spine_clipping_attachment_get_color(_attachment);
return Color(color.r, color.g, color.b, color.a);
}
void setColor(double r, double g, double b, double a) {
_bindings.spine_clipping_attachment_set_color(_attachment, r, g, b, a);
}
} }
// FIXME
class BoundingBoxAttachment extends VertexAttachment<spine_bounding_box_attachment> { class BoundingBoxAttachment extends VertexAttachment<spine_bounding_box_attachment> {
BoundingBoxAttachment._(spine_bounding_box_attachment attachment): super._(attachment); BoundingBoxAttachment._(spine_bounding_box_attachment attachment): super._(attachment);
Color getColor() {
final color = _bindings.spine_bounding_box_attachment_get_color(_attachment);
return Color(color.r, color.g, color.b, color.a);
}
void setColor(double r, double g, double b, double a) {
_bindings.spine_bounding_box_attachment_set_color(_attachment, r, g, b, a);
}
} }
// FIXME
class PathAttachment extends VertexAttachment<spine_path_attachment> { class PathAttachment extends VertexAttachment<spine_path_attachment> {
PathAttachment._(spine_path_attachment attachment): super._(attachment); PathAttachment._(spine_path_attachment attachment): super._(attachment);
Float32List getLengths() {
final num = _bindings.spine_path_attachment_get_num_lengths(_attachment);
final lengths = _bindings.spine_path_attachment_get_lengths(_attachment);
return lengths.asTypedList(num);
}
bool isClosed() {
return _bindings.spine_path_attachment_get_is_closed(_attachment) == -1;
}
void setIsClosed(bool isClosed) {
_bindings.spine_path_attachment_set_is_closed(_attachment, isClosed ? -1 : 0);
}
bool isConstantSpeed() {
return _bindings.spine_path_attachment_get_is_constant_speed(_attachment) == -1;
}
void setIsConstantSpeed(bool isClosed) {
_bindings.spine_path_attachment_set_is_constant_speed(_attachment, isClosed ? -1 : 0);
}
Color getColor() {
final color = _bindings.spine_path_attachment_get_color(_attachment);
return Color(color.r, color.g, color.b, color.a);
}
void setColor(double r, double g, double b, double a) {
_bindings.spine_path_attachment_set_color(_attachment, r, g, b, a);
}
} }
class PointAttachment extends Attachment<spine_point_attachment> { class PointAttachment extends Attachment<spine_point_attachment> {

View File

@ -5341,6 +5341,349 @@ class SpineFlutterBindings {
_spine_mesh_attachment_update_regionPtr _spine_mesh_attachment_update_regionPtr
.asFunction<void Function(spine_mesh_attachment)>(); .asFunction<void Function(spine_mesh_attachment)>();
int spine_mesh_attachment_get_hull_length(
spine_mesh_attachment attachment,
) {
return _spine_mesh_attachment_get_hull_length(
attachment,
);
}
late final _spine_mesh_attachment_get_hull_lengthPtr =
_lookup<ffi.NativeFunction<ffi.Int32 Function(spine_mesh_attachment)>>(
'spine_mesh_attachment_get_hull_length');
late final _spine_mesh_attachment_get_hull_length =
_spine_mesh_attachment_get_hull_lengthPtr
.asFunction<int Function(spine_mesh_attachment)>();
void spine_mesh_attachment_set_hull_length(
spine_mesh_attachment attachment,
int hullLength,
) {
return _spine_mesh_attachment_set_hull_length(
attachment,
hullLength,
);
}
late final _spine_mesh_attachment_set_hull_lengthPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(spine_mesh_attachment,
ffi.Int32)>>('spine_mesh_attachment_set_hull_length');
late final _spine_mesh_attachment_set_hull_length =
_spine_mesh_attachment_set_hull_lengthPtr
.asFunction<void Function(spine_mesh_attachment, int)>();
int spine_mesh_attachment_get_num_region_uvs(
spine_mesh_attachment attachment,
) {
return _spine_mesh_attachment_get_num_region_uvs(
attachment,
);
}
late final _spine_mesh_attachment_get_num_region_uvsPtr =
_lookup<ffi.NativeFunction<ffi.Int32 Function(spine_mesh_attachment)>>(
'spine_mesh_attachment_get_num_region_uvs');
late final _spine_mesh_attachment_get_num_region_uvs =
_spine_mesh_attachment_get_num_region_uvsPtr
.asFunction<int Function(spine_mesh_attachment)>();
ffi.Pointer<ffi.Float> spine_mesh_attachment_get_region_uvs(
spine_mesh_attachment attachment,
) {
return _spine_mesh_attachment_get_region_uvs(
attachment,
);
}
late final _spine_mesh_attachment_get_region_uvsPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<ffi.Float> Function(
spine_mesh_attachment)>>('spine_mesh_attachment_get_region_uvs');
late final _spine_mesh_attachment_get_region_uvs =
_spine_mesh_attachment_get_region_uvsPtr
.asFunction<ffi.Pointer<ffi.Float> Function(spine_mesh_attachment)>();
int spine_mesh_attachment_get_num_uvs(
spine_mesh_attachment attachment,
) {
return _spine_mesh_attachment_get_num_uvs(
attachment,
);
}
late final _spine_mesh_attachment_get_num_uvsPtr =
_lookup<ffi.NativeFunction<ffi.Int32 Function(spine_mesh_attachment)>>(
'spine_mesh_attachment_get_num_uvs');
late final _spine_mesh_attachment_get_num_uvs =
_spine_mesh_attachment_get_num_uvsPtr
.asFunction<int Function(spine_mesh_attachment)>();
ffi.Pointer<ffi.Float> spine_mesh_attachment_get_uvs(
spine_mesh_attachment attachment,
) {
return _spine_mesh_attachment_get_uvs(
attachment,
);
}
late final _spine_mesh_attachment_get_uvsPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<ffi.Float> Function(
spine_mesh_attachment)>>('spine_mesh_attachment_get_uvs');
late final _spine_mesh_attachment_get_uvs = _spine_mesh_attachment_get_uvsPtr
.asFunction<ffi.Pointer<ffi.Float> Function(spine_mesh_attachment)>();
int spine_mesh_attachment_get_num_triangles(
spine_mesh_attachment attachment,
) {
return _spine_mesh_attachment_get_num_triangles(
attachment,
);
}
late final _spine_mesh_attachment_get_num_trianglesPtr =
_lookup<ffi.NativeFunction<ffi.Int32 Function(spine_mesh_attachment)>>(
'spine_mesh_attachment_get_num_triangles');
late final _spine_mesh_attachment_get_num_triangles =
_spine_mesh_attachment_get_num_trianglesPtr
.asFunction<int Function(spine_mesh_attachment)>();
ffi.Pointer<ffi.Uint16> spine_mesh_attachment_get_triangles(
spine_mesh_attachment attachment,
) {
return _spine_mesh_attachment_get_triangles(
attachment,
);
}
late final _spine_mesh_attachment_get_trianglesPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<ffi.Uint16> Function(
spine_mesh_attachment)>>('spine_mesh_attachment_get_triangles');
late final _spine_mesh_attachment_get_triangles =
_spine_mesh_attachment_get_trianglesPtr.asFunction<
ffi.Pointer<ffi.Uint16> Function(spine_mesh_attachment)>();
spine_color spine_mesh_attachment_get_color(
spine_mesh_attachment attachment,
) {
return _spine_mesh_attachment_get_color(
attachment,
);
}
late final _spine_mesh_attachment_get_colorPtr =
_lookup<ffi.NativeFunction<spine_color Function(spine_mesh_attachment)>>(
'spine_mesh_attachment_get_color');
late final _spine_mesh_attachment_get_color =
_spine_mesh_attachment_get_colorPtr
.asFunction<spine_color Function(spine_mesh_attachment)>();
void spine_mesh_attachment_set_color(
spine_mesh_attachment attachment,
double r,
double g,
double b,
double a,
) {
return _spine_mesh_attachment_set_color(
attachment,
r,
g,
b,
a,
);
}
late final _spine_mesh_attachment_set_colorPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(spine_mesh_attachment, ffi.Float, ffi.Float,
ffi.Float, ffi.Float)>>('spine_mesh_attachment_set_color');
late final _spine_mesh_attachment_set_color =
_spine_mesh_attachment_set_colorPtr.asFunction<
void Function(
spine_mesh_attachment, double, double, double, double)>();
ffi.Pointer<ffi.Int8> spine_mesh_attachment_get_path(
spine_mesh_attachment attachment,
) {
return _spine_mesh_attachment_get_path(
attachment,
);
}
late final _spine_mesh_attachment_get_pathPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<ffi.Int8> Function(
spine_mesh_attachment)>>('spine_mesh_attachment_get_path');
late final _spine_mesh_attachment_get_path =
_spine_mesh_attachment_get_pathPtr
.asFunction<ffi.Pointer<ffi.Int8> Function(spine_mesh_attachment)>();
spine_texture_region spine_mesh_attachment_get_region(
spine_mesh_attachment attachment,
) {
return _spine_mesh_attachment_get_region(
attachment,
);
}
late final _spine_mesh_attachment_get_regionPtr = _lookup<
ffi.NativeFunction<
spine_texture_region Function(
spine_mesh_attachment)>>('spine_mesh_attachment_get_region');
late final _spine_mesh_attachment_get_region =
_spine_mesh_attachment_get_regionPtr
.asFunction<spine_texture_region Function(spine_mesh_attachment)>();
spine_sequence spine_mesh_attachment_get_sequence(
spine_mesh_attachment attachment,
) {
return _spine_mesh_attachment_get_sequence(
attachment,
);
}
late final _spine_mesh_attachment_get_sequencePtr = _lookup<
ffi.NativeFunction<spine_sequence Function(spine_mesh_attachment)>>(
'spine_mesh_attachment_get_sequence');
late final _spine_mesh_attachment_get_sequence =
_spine_mesh_attachment_get_sequencePtr
.asFunction<spine_sequence Function(spine_mesh_attachment)>();
spine_mesh_attachment spine_mesh_attachment_get_parent_mesh(
spine_mesh_attachment attachment,
) {
return _spine_mesh_attachment_get_parent_mesh(
attachment,
);
}
late final _spine_mesh_attachment_get_parent_meshPtr = _lookup<
ffi.NativeFunction<
spine_mesh_attachment Function(
spine_mesh_attachment)>>('spine_mesh_attachment_get_parent_mesh');
late final _spine_mesh_attachment_get_parent_mesh =
_spine_mesh_attachment_get_parent_meshPtr
.asFunction<spine_mesh_attachment Function(spine_mesh_attachment)>();
void spine_mesh_attachment_set_parent_mesh(
spine_mesh_attachment attachment,
spine_mesh_attachment parentMesh,
) {
return _spine_mesh_attachment_set_parent_mesh(
attachment,
parentMesh,
);
}
late final _spine_mesh_attachment_set_parent_meshPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(spine_mesh_attachment,
spine_mesh_attachment)>>('spine_mesh_attachment_set_parent_mesh');
late final _spine_mesh_attachment_set_parent_mesh =
_spine_mesh_attachment_set_parent_meshPtr.asFunction<
void Function(spine_mesh_attachment, spine_mesh_attachment)>();
int spine_mesh_attachment_get_num_edges(
spine_mesh_attachment attachment,
) {
return _spine_mesh_attachment_get_num_edges(
attachment,
);
}
late final _spine_mesh_attachment_get_num_edgesPtr =
_lookup<ffi.NativeFunction<ffi.Int32 Function(spine_mesh_attachment)>>(
'spine_mesh_attachment_get_num_edges');
late final _spine_mesh_attachment_get_num_edges =
_spine_mesh_attachment_get_num_edgesPtr
.asFunction<int Function(spine_mesh_attachment)>();
ffi.Pointer<ffi.Uint16> spine_mesh_attachment_get_edges(
spine_mesh_attachment attachment,
) {
return _spine_mesh_attachment_get_edges(
attachment,
);
}
late final _spine_mesh_attachment_get_edgesPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<ffi.Uint16> Function(
spine_mesh_attachment)>>('spine_mesh_attachment_get_edges');
late final _spine_mesh_attachment_get_edges =
_spine_mesh_attachment_get_edgesPtr.asFunction<
ffi.Pointer<ffi.Uint16> Function(spine_mesh_attachment)>();
double spine_mesh_attachment_get_width(
spine_mesh_attachment attachment,
) {
return _spine_mesh_attachment_get_width(
attachment,
);
}
late final _spine_mesh_attachment_get_widthPtr =
_lookup<ffi.NativeFunction<ffi.Float Function(spine_mesh_attachment)>>(
'spine_mesh_attachment_get_width');
late final _spine_mesh_attachment_get_width =
_spine_mesh_attachment_get_widthPtr
.asFunction<double Function(spine_mesh_attachment)>();
void spine_mesh_attachment_set_width(
spine_mesh_attachment attachment,
double width,
) {
return _spine_mesh_attachment_set_width(
attachment,
width,
);
}
late final _spine_mesh_attachment_set_widthPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(spine_mesh_attachment,
ffi.Float)>>('spine_mesh_attachment_set_width');
late final _spine_mesh_attachment_set_width =
_spine_mesh_attachment_set_widthPtr
.asFunction<void Function(spine_mesh_attachment, double)>();
double spine_mesh_attachment_get_height(
spine_mesh_attachment attachment,
) {
return _spine_mesh_attachment_get_height(
attachment,
);
}
late final _spine_mesh_attachment_get_heightPtr =
_lookup<ffi.NativeFunction<ffi.Float Function(spine_mesh_attachment)>>(
'spine_mesh_attachment_get_height');
late final _spine_mesh_attachment_get_height =
_spine_mesh_attachment_get_heightPtr
.asFunction<double Function(spine_mesh_attachment)>();
void spine_mesh_attachment_set_height(
spine_mesh_attachment attachment,
double height,
) {
return _spine_mesh_attachment_set_height(
attachment,
height,
);
}
late final _spine_mesh_attachment_set_heightPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(spine_mesh_attachment,
ffi.Float)>>('spine_mesh_attachment_set_height');
late final _spine_mesh_attachment_set_height =
_spine_mesh_attachment_set_heightPtr
.asFunction<void Function(spine_mesh_attachment, double)>();
spine_slot_data spine_clipping_attachment_get_end_slot( spine_slot_data spine_clipping_attachment_get_end_slot(
spine_clipping_attachment attachment, spine_clipping_attachment attachment,
) { ) {
@ -5357,6 +5700,64 @@ class SpineFlutterBindings {
_spine_clipping_attachment_get_end_slotPtr _spine_clipping_attachment_get_end_slotPtr
.asFunction<spine_slot_data Function(spine_clipping_attachment)>(); .asFunction<spine_slot_data Function(spine_clipping_attachment)>();
void spine_clipping_attachment_set_end_slot(
spine_clipping_attachment attachment,
spine_slot_data endSlot,
) {
return _spine_clipping_attachment_set_end_slot(
attachment,
endSlot,
);
}
late final _spine_clipping_attachment_set_end_slotPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(spine_clipping_attachment,
spine_slot_data)>>('spine_clipping_attachment_set_end_slot');
late final _spine_clipping_attachment_set_end_slot =
_spine_clipping_attachment_set_end_slotPtr.asFunction<
void Function(spine_clipping_attachment, spine_slot_data)>();
spine_color spine_clipping_attachment_get_color(
spine_clipping_attachment attachment,
) {
return _spine_clipping_attachment_get_color(
attachment,
);
}
late final _spine_clipping_attachment_get_colorPtr = _lookup<
ffi.NativeFunction<spine_color Function(spine_clipping_attachment)>>(
'spine_clipping_attachment_get_color');
late final _spine_clipping_attachment_get_color =
_spine_clipping_attachment_get_colorPtr
.asFunction<spine_color Function(spine_clipping_attachment)>();
void spine_clipping_attachment_set_color(
spine_clipping_attachment attachment,
double r,
double g,
double b,
double a,
) {
return _spine_clipping_attachment_set_color(
attachment,
r,
g,
b,
a,
);
}
late final _spine_clipping_attachment_set_colorPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(spine_clipping_attachment, ffi.Float, ffi.Float,
ffi.Float, ffi.Float)>>('spine_clipping_attachment_set_color');
late final _spine_clipping_attachment_set_color =
_spine_clipping_attachment_set_colorPtr.asFunction<
void Function(
spine_clipping_attachment, double, double, double, double)>();
spine_color spine_bounding_box_attachment_get_color( spine_color spine_bounding_box_attachment_get_color(
spine_bounding_box_attachment attachment, spine_bounding_box_attachment attachment,
) { ) {
@ -5402,6 +5803,103 @@ class SpineFlutterBindings {
void Function( void Function(
spine_bounding_box_attachment, double, double, double, double)>(); spine_bounding_box_attachment, double, double, double, double)>();
int spine_path_attachment_get_num_lengths(
spine_path_attachment attachment,
) {
return _spine_path_attachment_get_num_lengths(
attachment,
);
}
late final _spine_path_attachment_get_num_lengthsPtr =
_lookup<ffi.NativeFunction<ffi.Int32 Function(spine_path_attachment)>>(
'spine_path_attachment_get_num_lengths');
late final _spine_path_attachment_get_num_lengths =
_spine_path_attachment_get_num_lengthsPtr
.asFunction<int Function(spine_path_attachment)>();
ffi.Pointer<ffi.Float> spine_path_attachment_get_lengths(
spine_path_attachment attachment,
) {
return _spine_path_attachment_get_lengths(
attachment,
);
}
late final _spine_path_attachment_get_lengthsPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<ffi.Float> Function(
spine_path_attachment)>>('spine_path_attachment_get_lengths');
late final _spine_path_attachment_get_lengths =
_spine_path_attachment_get_lengthsPtr
.asFunction<ffi.Pointer<ffi.Float> Function(spine_path_attachment)>();
int spine_path_attachment_get_is_closed(
spine_path_attachment attachment,
) {
return _spine_path_attachment_get_is_closed(
attachment,
);
}
late final _spine_path_attachment_get_is_closedPtr =
_lookup<ffi.NativeFunction<ffi.Int32 Function(spine_path_attachment)>>(
'spine_path_attachment_get_is_closed');
late final _spine_path_attachment_get_is_closed =
_spine_path_attachment_get_is_closedPtr
.asFunction<int Function(spine_path_attachment)>();
void spine_path_attachment_set_is_closed(
spine_path_attachment attachment,
int isClosed,
) {
return _spine_path_attachment_set_is_closed(
attachment,
isClosed,
);
}
late final _spine_path_attachment_set_is_closedPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(spine_path_attachment,
ffi.Int32)>>('spine_path_attachment_set_is_closed');
late final _spine_path_attachment_set_is_closed =
_spine_path_attachment_set_is_closedPtr
.asFunction<void Function(spine_path_attachment, int)>();
int spine_path_attachment_get_is_constant_speed(
spine_path_attachment attachment,
) {
return _spine_path_attachment_get_is_constant_speed(
attachment,
);
}
late final _spine_path_attachment_get_is_constant_speedPtr =
_lookup<ffi.NativeFunction<ffi.Int32 Function(spine_path_attachment)>>(
'spine_path_attachment_get_is_constant_speed');
late final _spine_path_attachment_get_is_constant_speed =
_spine_path_attachment_get_is_constant_speedPtr
.asFunction<int Function(spine_path_attachment)>();
void spine_path_attachment_set_is_constant_speed(
spine_path_attachment attachment,
int isConstantSpeed,
) {
return _spine_path_attachment_set_is_constant_speed(
attachment,
isConstantSpeed,
);
}
late final _spine_path_attachment_set_is_constant_speedPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(spine_path_attachment,
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<void Function(spine_path_attachment, int)>();
spine_color spine_path_attachment_get_color( spine_color spine_path_attachment_get_color(
spine_path_attachment attachment, spine_path_attachment attachment,
) { ) {

View File

@ -2244,6 +2244,7 @@ FFI_PLUGIN_EXPORT int *spine_region_attachment_get_bones(spine_region_attachment
return _attachment->getBones().buffer(); return _attachment->getBones().buffer();
} }
// VertexAttachment
FFI_PLUGIN_EXPORT int spine_vertex_attachment_get_num_vertices(spine_vertex_attachment attachment) { FFI_PLUGIN_EXPORT int spine_vertex_attachment_get_num_vertices(spine_vertex_attachment attachment) {
if (attachment == nullptr) return 0; if (attachment == nullptr) return 0;
VertexAttachment *_attachment = (VertexAttachment*)attachment; VertexAttachment *_attachment = (VertexAttachment*)attachment;
@ -2268,6 +2269,238 @@ FFI_PLUGIN_EXPORT void spine_vertex_attachment_set_timeline_attachment(spine_ver
_attachment->setTimelineAttachment((Attachment*)timelineAttachment); _attachment->setTimelineAttachment((Attachment*)timelineAttachment);
} }
// MeshAttachment
FFI_PLUGIN_EXPORT void spine_mesh_attachment_update_region(spine_mesh_attachment attachment) {
if (attachment == nullptr) return;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
_attachment->updateRegion();
}
FFI_PLUGIN_EXPORT int 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) {
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) {
if (attachment == nullptr) return 0;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
return _attachment->getRegionUVs().size();
}
FFI_PLUGIN_EXPORT float *spine_mesh_attachment_get_region_uvs(spine_mesh_attachment attachment) {
if (attachment == nullptr) return nullptr;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
return _attachment->getRegionUVs().buffer();
}
FFI_PLUGIN_EXPORT int spine_mesh_attachment_get_num_uvs(spine_mesh_attachment attachment) {
if (attachment == nullptr) return 0;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
return _attachment->getUVs().size();
}
FFI_PLUGIN_EXPORT float *spine_mesh_attachment_get_uvs(spine_mesh_attachment attachment) {
if (attachment == nullptr) return 0;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
return _attachment->getUVs().buffer();
}
FFI_PLUGIN_EXPORT int spine_mesh_attachment_get_num_triangles(spine_mesh_attachment attachment) {
if (attachment == nullptr) return 0;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
return _attachment->getTriangles().size();
}
FFI_PLUGIN_EXPORT unsigned short *spine_mesh_attachment_get_triangles(spine_mesh_attachment attachment) {
if (attachment == nullptr) return nullptr;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
return _attachment->getTriangles().buffer();
}
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;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
Color &color = _attachment->getColor();
result = { color.r, color.g, color.b, color.a };
return result;
}
FFI_PLUGIN_EXPORT void spine_mesh_attachment_set_color(spine_mesh_attachment attachment, float r, float g, float b, float a) {
if (attachment == nullptr) return;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
_attachment->getColor().set(r, g, b, a);
}
FFI_PLUGIN_EXPORT const char *spine_mesh_attachment_get_path(spine_mesh_attachment attachment) {
if (attachment == nullptr) return nullptr;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
return _attachment->getPath().buffer();
}
FFI_PLUGIN_EXPORT spine_texture_region spine_mesh_attachment_get_region(spine_mesh_attachment attachment) {
if (attachment == nullptr) return nullptr;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
return (spine_texture_region)_attachment->getRegion();
}
FFI_PLUGIN_EXPORT spine_sequence spine_mesh_attachment_get_sequence(spine_mesh_attachment attachment) {
if (attachment == nullptr) return nullptr;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
return (spine_sequence)_attachment->getSequence();
}
FFI_PLUGIN_EXPORT spine_mesh_attachment spine_mesh_attachment_get_parent_mesh(spine_mesh_attachment attachment) {
if (attachment == nullptr) return nullptr;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
return (spine_mesh_attachment)_attachment->getParentMesh();
}
FFI_PLUGIN_EXPORT void spine_mesh_attachment_set_parent_mesh(spine_mesh_attachment attachment, spine_mesh_attachment parentMesh) {
if (attachment == nullptr) return;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
_attachment->setParentMesh((MeshAttachment*)parentMesh);
}
FFI_PLUGIN_EXPORT int spine_mesh_attachment_get_num_edges(spine_mesh_attachment attachment) {
if (attachment == nullptr) return 0;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
return _attachment->getEdges().size();
}
FFI_PLUGIN_EXPORT unsigned short *spine_mesh_attachment_get_edges(spine_mesh_attachment attachment) {
if (attachment == nullptr) return nullptr;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
return _attachment->getEdges().buffer();
}
FFI_PLUGIN_EXPORT float spine_mesh_attachment_get_width(spine_mesh_attachment attachment) {
if (attachment == nullptr) return 0;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
return _attachment->getWidth();
}
FFI_PLUGIN_EXPORT void spine_mesh_attachment_set_width(spine_mesh_attachment attachment, float width) {
if (attachment == nullptr) return;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
_attachment->setWidth(width);
}
FFI_PLUGIN_EXPORT float spine_mesh_attachment_get_height(spine_mesh_attachment attachment) {
if (attachment == nullptr) return 0;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
return _attachment->getHeight();
}
FFI_PLUGIN_EXPORT void spine_mesh_attachment_set_height(spine_mesh_attachment attachment, float height) {
if (attachment == nullptr) return;
MeshAttachment *_attachment = (MeshAttachment*)attachment;
_attachment->setHeight(height);
}
// ClippingAttachment
FFI_PLUGIN_EXPORT spine_slot_data spine_clipping_attachment_get_end_slot(spine_clipping_attachment attachment) {
if (attachment == nullptr) return nullptr;
ClippingAttachment *_attachment = (ClippingAttachment*)attachment;
return (spine_slot_data)_attachment->getEndSlot();
}
FFI_PLUGIN_EXPORT void spine_clipping_attachment_set_end_slot(spine_clipping_attachment attachment, spine_slot_data endSlot) {
if (attachment == nullptr) return;
ClippingAttachment *_attachment = (ClippingAttachment*)attachment;
_attachment->setEndSlot((SlotData*)endSlot);
}
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;
ClippingAttachment *_attachment = (ClippingAttachment*)attachment;
Color &color = _attachment->getColor();
result = { color.r, color.g, color.b, color.a };
return result;
}
FFI_PLUGIN_EXPORT void spine_clipping_attachment_set_color(spine_clipping_attachment attachment, float r, float g, float b, float a) {
if (attachment == nullptr) return;
ClippingAttachment *_attachment = (ClippingAttachment*)attachment;
_attachment->getColor().set(r, g, b, a);
}
// 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;
BoundingBoxAttachment *_attachment = (BoundingBoxAttachment*)attachment;
Color &color = _attachment->getColor();
result = { color.r, color.g, color.b, color.a };
return result;
}
FFI_PLUGIN_EXPORT void spine_bounding_box_attachment_set_color(spine_bounding_box_attachment attachment, float r, float g, float b, float a) {
if (attachment == nullptr) return;
BoundingBoxAttachment *_attachment = (BoundingBoxAttachment*)attachment;
_attachment->getColor().set(r, g, b, a);
}
// PathAttachment
FFI_PLUGIN_EXPORT int spine_path_attachment_get_num_lengths(spine_path_attachment attachment) {
if (attachment == nullptr) return 0;
PathAttachment *_attachment = (PathAttachment*)attachment;
return _attachment->getLengths().size();
}
FFI_PLUGIN_EXPORT float *spine_path_attachment_get_lengths(spine_path_attachment attachment) {
if (attachment == nullptr) return nullptr;
PathAttachment *_attachment = (PathAttachment*)attachment;
return _attachment->getLengths().buffer();
}
FFI_PLUGIN_EXPORT int 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) {
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) {
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) {
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;
PathAttachment *_attachment = (PathAttachment*)attachment;
Color &color = _attachment->getColor();
result = { color.r, color.g, color.b, color.a };
return result;
}
FFI_PLUGIN_EXPORT void spine_path_attachment_set_color(spine_path_attachment attachment, float r, float g, float b, float a) {
if (attachment == nullptr) return;
PathAttachment *_attachment = (PathAttachment*)attachment;
_attachment->getColor().set(r, g, b, a);
}
// Skin // 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, int slotIndex, const char* name, spine_attachment attachment) {
if (skin == nullptr) return; if (skin == nullptr) return;

View File

@ -530,12 +530,42 @@ FFI_PLUGIN_EXPORT spine_attachment spine_vertex_attachment_get_timeline_attachme
FFI_PLUGIN_EXPORT void spine_vertex_attachment_set_timeline_attachment(spine_vertex_attachment attachment, spine_attachment timelineAttachment); FFI_PLUGIN_EXPORT void spine_vertex_attachment_set_timeline_attachment(spine_vertex_attachment attachment, spine_attachment timelineAttachment);
FFI_PLUGIN_EXPORT void spine_mesh_attachment_update_region(spine_mesh_attachment attachment); 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 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 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 unsigned short *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 spine_texture_region spine_mesh_attachment_get_region(spine_mesh_attachment attachment);
FFI_PLUGIN_EXPORT spine_sequence spine_mesh_attachment_get_sequence(spine_mesh_attachment attachment);
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 unsigned short *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);
FFI_PLUGIN_EXPORT float spine_mesh_attachment_get_height(spine_mesh_attachment attachment);
FFI_PLUGIN_EXPORT void spine_mesh_attachment_set_height(spine_mesh_attachment attachment, float height);
FFI_PLUGIN_EXPORT spine_slot_data spine_clipping_attachment_get_end_slot(spine_clipping_attachment attachment); FFI_PLUGIN_EXPORT spine_slot_data spine_clipping_attachment_get_end_slot(spine_clipping_attachment attachment);
FFI_PLUGIN_EXPORT void spine_clipping_attachment_set_end_slot(spine_clipping_attachment attachment, spine_slot_data endSlot);
FFI_PLUGIN_EXPORT spine_color spine_clipping_attachment_get_color(spine_clipping_attachment attachment);
FFI_PLUGIN_EXPORT void spine_clipping_attachment_set_color(spine_clipping_attachment attachment, float r, float g, float b, float a);
FFI_PLUGIN_EXPORT spine_color spine_bounding_box_attachment_get_color(spine_bounding_box_attachment attachment); 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 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 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 spine_color spine_path_attachment_get_color(spine_path_attachment attachment); 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_path_attachment_set_color(spine_path_attachment attachment, float r, float g, float b, float a);