[c] Direct setListener on track entry and animation state

This commit is contained in:
Mario Zechner 2025-08-29 15:10:23 +02:00
parent ff8f5f7b6b
commit 51410a526e
145 changed files with 967 additions and 1192 deletions

View File

@ -73,7 +73,7 @@ namespace spine {
typedef std::function<void(AnimationState *state, EventType type, TrackEntry *entry, Event *event)> AnimationStateListener;
#else
typedef void (*AnimationStateListener)(AnimationState *state, EventType type, TrackEntry *entry, Event *event);
typedef void (*AnimationStateListener)(AnimationState *state, EventType type, TrackEntry *entry, Event *event, void *userData);
#endif
@ -308,7 +308,7 @@ namespace spine {
float getTrackComplete();
void setListener(AnimationStateListener listener);
void setListener(AnimationStateListener listener, void *userData = NULL);
void setListener(AnimationStateListenerObject *listener);
@ -353,6 +353,7 @@ namespace spine {
Array<TrackEntry *> _timelineHoldMix;
Array<float> _timelinesRotation;
AnimationStateListener _listener;
void *_listenerUserData;
AnimationStateListenerObject *_listenerObject;
AnimationState *_state;
@ -522,7 +523,7 @@ namespace spine {
void setTimeScale(float inValue);
/// Adds a listener to receive events for all track entries.
void setListener(AnimationStateListener listener);
void setListener(AnimationStateListener listener, void *userData = NULL);
/// Adds a listener to receive events for all track entries.
void setListener(AnimationStateListenerObject *listener);
@ -558,6 +559,7 @@ namespace spine {
bool _animationsChanged;
AnimationStateListener _listener;
void *_listenerUserData;
AnimationStateListenerObject *_listenerObject;
int _unkeyedState;

View File

@ -46,11 +46,12 @@
using namespace spine;
void dummyOnAnimationEventFunc(AnimationState *state, EventType type, TrackEntry *entry, Event *event = NULL) {
void dummyOnAnimationEventFunc(AnimationState *state, EventType type, TrackEntry *entry, Event *event, void *userData) {
SP_UNUSED(state);
SP_UNUSED(type);
SP_UNUSED(entry);
SP_UNUSED(event);
SP_UNUSED(userData);
}
TrackEntry::TrackEntry()
@ -58,7 +59,7 @@ TrackEntry::TrackEntry()
_reverse(false), _shortestRotation(false), _eventThreshold(0), _mixAttachmentThreshold(0), _alphaAttachmentThreshold(0),
_mixDrawOrderThreshold(0), _animationStart(0), _animationEnd(0), _animationLast(0), _nextAnimationLast(0), _delay(0), _trackTime(0),
_trackLast(0), _nextTrackLast(0), _trackEnd(0), _timeScale(1.0f), _alpha(0), _mixTime(0), _mixDuration(0), _interruptAlpha(0), _totalAlpha(0),
_mixBlend(MixBlend_Replace), _listener(dummyOnAnimationEventFunc), _listenerObject(NULL), _state(NULL) {
_mixBlend(MixBlend_Replace), _listener(dummyOnAnimationEventFunc), _listenerUserData(NULL), _listenerObject(NULL), _state(NULL) {
}
TrackEntry::~TrackEntry() {
@ -277,13 +278,15 @@ void TrackEntry::resetRotationDirections() {
_timelinesRotation.clear();
}
void TrackEntry::setListener(AnimationStateListener inValue) {
void TrackEntry::setListener(AnimationStateListener inValue, void *userData) {
_listener = inValue;
_listenerUserData = userData;
_listenerObject = NULL;
}
void TrackEntry::setListener(AnimationStateListenerObject *inValue) {
_listener = dummyOnAnimationEventFunc;
_listenerUserData = NULL;
_listenerObject = inValue;
}
@ -301,6 +304,7 @@ void TrackEntry::reset() {
_timelinesRotation.clear();
_listener = dummyOnAnimationEventFunc;
_listenerUserData = NULL;
_listenerObject = NULL;
}
@ -384,31 +388,31 @@ void EventQueue::drain() {
case EventType_Interrupt:
case EventType_Complete:
if (!trackEntry->_listenerObject)
trackEntry->_listener(&state, queueEntry._type, trackEntry, NULL);
trackEntry->_listener(&state, queueEntry._type, trackEntry, NULL, trackEntry->_listenerUserData);
else
trackEntry->_listenerObject->callback(&state, queueEntry._type, trackEntry, NULL);
if (!state._listenerObject)
state._listener(&state, queueEntry._type, trackEntry, NULL);
state._listener(&state, queueEntry._type, trackEntry, NULL, state._listenerUserData);
else
state._listenerObject->callback(&state, queueEntry._type, trackEntry, NULL);
break;
case EventType_End:
if (!trackEntry->_listenerObject)
trackEntry->_listener(&state, queueEntry._type, trackEntry, NULL);
trackEntry->_listener(&state, queueEntry._type, trackEntry, NULL, trackEntry->_listenerUserData);
else
trackEntry->_listenerObject->callback(&state, queueEntry._type, trackEntry, NULL);
if (!state._listenerObject)
state._listener(&state, queueEntry._type, trackEntry, NULL);
state._listener(&state, queueEntry._type, trackEntry, NULL, state._listenerUserData);
else
state._listenerObject->callback(&state, queueEntry._type, trackEntry, NULL);
/* Fall through. */
case EventType_Dispose:
if (!trackEntry->_listenerObject)
trackEntry->_listener(&state, EventType_Dispose, trackEntry, NULL);
trackEntry->_listener(&state, EventType_Dispose, trackEntry, NULL, trackEntry->_listenerUserData);
else
trackEntry->_listenerObject->callback(&state, EventType_Dispose, trackEntry, NULL);
if (!state._listenerObject)
state._listener(&state, EventType_Dispose, trackEntry, NULL);
state._listener(&state, EventType_Dispose, trackEntry, NULL, state._listenerUserData);
else
state._listenerObject->callback(&state, EventType_Dispose, trackEntry, NULL);
@ -416,11 +420,11 @@ void EventQueue::drain() {
break;
case EventType_Event:
if (!trackEntry->_listenerObject)
trackEntry->_listener(&state, queueEntry._type, trackEntry, queueEntry._event);
trackEntry->_listener(&state, queueEntry._type, trackEntry, queueEntry._event, trackEntry->_listenerUserData);
else
trackEntry->_listenerObject->callback(&state, queueEntry._type, trackEntry, queueEntry._event);
if (!state._listenerObject)
state._listener(&state, queueEntry._type, trackEntry, queueEntry._event);
state._listener(&state, queueEntry._type, trackEntry, queueEntry._event, state._listenerUserData);
else
state._listenerObject->callback(&state, queueEntry._type, trackEntry, queueEntry._event);
break;
@ -432,8 +436,8 @@ void EventQueue::drain() {
}
AnimationState::AnimationState(AnimationStateData &data)
: _data(&data), _queue(EventQueue::newEventQueue(*this)), _animationsChanged(false), _listener(dummyOnAnimationEventFunc), _listenerObject(NULL),
_unkeyedState(0), _timeScale(1), _manualTrackEntryDisposal(false) {
: _data(&data), _queue(EventQueue::newEventQueue(*this)), _animationsChanged(false), _listener(dummyOnAnimationEventFunc),
_listenerUserData(NULL), _listenerObject(NULL), _unkeyedState(0), _timeScale(1), _manualTrackEntryDisposal(false) {
}
AnimationState::~AnimationState() {
@ -755,13 +759,15 @@ void AnimationState::setTimeScale(float inValue) {
_timeScale = inValue;
}
void AnimationState::setListener(AnimationStateListener inValue) {
void AnimationState::setListener(AnimationStateListener inValue, void *userData) {
_listener = inValue;
_listenerUserData = userData;
_listenerObject = NULL;
}
void AnimationState::setListener(AnimationStateListenerObject *inValue) {
_listener = dummyOnAnimationEventFunc;
_listenerUserData = NULL;
_listenerObject = inValue;
}

View File

@ -7838,6 +7838,70 @@ class SpineDartBindings {
late final _spine_bone_pose_parent_to_world_v = _spine_bone_pose_parent_to_world_vPtr
.asFunction<void Function(spine_bone_pose, double, double, spine_array_float)>();
void spine_animation_state_set_listener(
spine_animation_state state,
spine_animation_state_listener listener,
ffi.Pointer<ffi.Void> user_data,
) {
return _spine_animation_state_set_listener(
state,
listener,
user_data,
);
}
late final _spine_animation_state_set_listenerPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(spine_animation_state, spine_animation_state_listener,
ffi.Pointer<ffi.Void>)>>('spine_animation_state_set_listener');
late final _spine_animation_state_set_listener = _spine_animation_state_set_listenerPtr
.asFunction<void Function(spine_animation_state, spine_animation_state_listener, ffi.Pointer<ffi.Void>)>();
void spine_animation_state_clear_listener(
spine_animation_state state,
) {
return _spine_animation_state_clear_listener(
state,
);
}
late final _spine_animation_state_clear_listenerPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(spine_animation_state)>>('spine_animation_state_clear_listener');
late final _spine_animation_state_clear_listener =
_spine_animation_state_clear_listenerPtr.asFunction<void Function(spine_animation_state)>();
void spine_track_entry_set_listener(
spine_track_entry entry,
spine_animation_state_listener listener,
ffi.Pointer<ffi.Void> user_data,
) {
return _spine_track_entry_set_listener(
entry,
listener,
user_data,
);
}
late final _spine_track_entry_set_listenerPtr = _lookup<
ffi
.NativeFunction<ffi.Void Function(spine_track_entry, spine_animation_state_listener, ffi.Pointer<ffi.Void>)>>(
'spine_track_entry_set_listener');
late final _spine_track_entry_set_listener = _spine_track_entry_set_listenerPtr
.asFunction<void Function(spine_track_entry, spine_animation_state_listener, ffi.Pointer<ffi.Void>)>();
void spine_track_entry_clear_listener(
spine_track_entry entry,
) {
return _spine_track_entry_clear_listener(
entry,
);
}
late final _spine_track_entry_clear_listenerPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(spine_track_entry)>>('spine_track_entry_clear_listener');
late final _spine_track_entry_clear_listener =
_spine_track_entry_clear_listenerPtr.asFunction<void Function(spine_track_entry)>();
spine_alpha_timeline spine_alpha_timeline_create(
int frameCount,
int bezierCount,
@ -40573,6 +40637,13 @@ typedef spine_skin_entries = ffi.Pointer<spine_skin_entries_wrapper>;
/// Custom types for spine-c-new (not generated)
typedef spine_skin_entry = ffi.Pointer<spine_skin_entry_wrapper>;
/// Event listener functions
typedef spine_animation_state_listener = ffi.Pointer<ffi.NativeFunction<spine_animation_state_listenerFunction>>;
typedef spine_animation_state_listenerFunction = ffi.Void Function(spine_animation_state state, ffi.Int32 type,
spine_track_entry entry, spine_event event, ffi.Pointer<ffi.Void> user_data);
typedef Dartspine_animation_state_listenerFunction = void Function(
spine_animation_state state, int type, spine_track_entry entry, spine_event event, ffi.Pointer<ffi.Void> user_data);
/// Forward declarations for all non-enum types
typedef spine_alpha_timeline = ffi.Pointer<spine_alpha_timeline_wrapper>;

View File

@ -80,6 +80,16 @@ void unload_texture(void *texture) {
texture_dispose((texture_t) (uintptr_t) texture);
}
void track_listener(spine_animation_state state, spine_event_type type, spine_track_entry entry, spine_event event, void *user_data) {
SP_UNUSED(state);
SP_UNUSED(entry);
SP_UNUSED(event);
SP_UNUSED(user_data);
if (type == SPINE_EVENT_TYPE_EVENT) {
printf("Custom event fired: %s\n", spine_event_data_get_name(spine_event_get_data(event)));
}
}
int main() {
// Initialize GLFW and glbinding
GLFWwindow *window = init_glfw();
@ -114,7 +124,8 @@ int main() {
spine_animation_state_data animation_state_data = spine_animation_state_get_data(animation_state);
spine_animation_state_data_set_default_mix(animation_state_data, 0.2f);
spine_animation_state_set_animation_1(animation_state, 0, "portal", true);
spine_animation_state_add_animation_1(animation_state, 0, "run", true, 0);
spine_track_entry entry = spine_animation_state_add_animation_1(animation_state, 0, "run", true, 0);
spine_track_entry_set_listener(entry, track_listener, NULL);
// Create the renderer and set the viewport size to match the window size. This sets up a
// pixel perfect orthogonal projection for 2D rendering.

View File

@ -88,7 +88,15 @@ int main() {
animationStateData.setDefaultMix(0.2f);
AnimationState animationState(animationStateData);
animationState.setAnimation(0, "portal", true);
animationState.addAnimation(0, "run", true, 0);
animationState.addAnimation(0, "run", true, 0).setListener([](AnimationState *state, EventType type, TrackEntry *entry, Event *event, void *userData) {
SP_UNUSED(state);
SP_UNUSED(entry);
SP_UNUSED(event);
SP_UNUSED(userData);
if (type == EventType_Event) {
printf("Custom event fired: %s\n", event->getData().getName().buffer());
}
});
// Create the renderer and set the viewport size to match the window size. This sets up a
// pixel perfect orthogonal projection for 2D rendering.

View File

@ -51,18 +51,17 @@ public class Animation: NSObject {
public var timelines: ArrayTimeline {
get {
let result = spine_animation_get_timelines(_ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
return ArrayTimeline(fromPointer: result!)
return ArrayTimeline(fromPointer: result!)
}
set {
spine_animation_set_timelines(
_ptr.assumingMemoryBound(to: spine_animation_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_timeline_wrapper.self))
spine_animation_set_timelines(_ptr.assumingMemoryBound(to: spine_animation_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_timeline_wrapper.self))
}
}
public var duration: Float {
get {
let result = spine_animation_get_duration(_ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
return result
return result
}
set {
spine_animation_set_duration(_ptr.assumingMemoryBound(to: spine_animation_wrapper.self), newValue)
@ -80,19 +79,12 @@ public class Animation: NSObject {
}
public func hasTimeline(_ ids: ArrayPropertyId) -> Bool {
let result = spine_animation_has_timeline(
_ptr.assumingMemoryBound(to: spine_animation_wrapper.self), ids._ptr.assumingMemoryBound(to: spine_array_property_id_wrapper.self))
let result = spine_animation_has_timeline(_ptr.assumingMemoryBound(to: spine_animation_wrapper.self), ids._ptr.assumingMemoryBound(to: spine_array_property_id_wrapper.self))
return result
}
public func apply(
_ skeleton: Skeleton, _ lastTime: Float, _ time: Float, _ loop: Bool, _ events: ArrayEvent?, _ alpha: Float, _ blend: MixBlend,
_ direction: MixDirection, _ appliedPose: Bool
) {
spine_animation_apply(
_ptr.assumingMemoryBound(to: spine_animation_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), lastTime,
time, loop, events?._ptr.assumingMemoryBound(to: spine_array_event_wrapper.self), alpha,
spine_mix_blend(rawValue: UInt32(blend.rawValue)), spine_mix_direction(rawValue: UInt32(direction.rawValue)), appliedPose)
public func apply(_ skeleton: Skeleton, _ lastTime: Float, _ time: Float, _ loop: Bool, _ events: ArrayEvent?, _ alpha: Float, _ blend: MixBlend, _ direction: MixDirection, _ appliedPose: Bool) {
spine_animation_apply(_ptr.assumingMemoryBound(to: spine_animation_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), lastTime, time, loop, events?._ptr.assumingMemoryBound(to: spine_array_event_wrapper.self), alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)), spine_mix_direction(rawValue: UInt32(direction.rawValue)), appliedPose)
}
public static func search(_ values: ArrayFloat, _ target: Float) -> Int32 {
@ -108,4 +100,4 @@ public class Animation: NSObject {
public func dispose() {
spine_animation_dispose(_ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
}
}
}

View File

@ -381,8 +381,7 @@ public class ArrayAnimation: NSObject {
/// Adds a value to the end of this array
public func add(_ value: Animation?) {
spine_array_animation_add(
_ptr.assumingMemoryBound(to: spine_array_animation_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
spine_array_animation_add(_ptr.assumingMemoryBound(to: spine_array_animation_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
}
/// Removes all elements from this array
@ -460,8 +459,7 @@ public class ArrayAtlasPage: NSObject {
/// Adds a value to the end of this array
public func add(_ value: AtlasPage?) {
spine_array_atlas_page_add(
_ptr.assumingMemoryBound(to: spine_array_atlas_page_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
spine_array_atlas_page_add(_ptr.assumingMemoryBound(to: spine_array_atlas_page_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
}
/// Removes all elements from this array
@ -539,8 +537,7 @@ public class ArrayAtlasRegion: NSObject {
/// Adds a value to the end of this array
public func add(_ value: AtlasRegion?) {
spine_array_atlas_region_add(
_ptr.assumingMemoryBound(to: spine_array_atlas_region_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
spine_array_atlas_region_add(_ptr.assumingMemoryBound(to: spine_array_atlas_region_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
}
/// Removes all elements from this array
@ -614,31 +611,29 @@ public class ArrayAttachment: NSObject {
let elementPtr = buffer[Int(index)]
guard let ptr = elementPtr else { return nil }
let rtti = spine_attachment_get_rtti(ptr)
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_bounding_box_attachment":
return BoundingBoxAttachment(
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
case "spine_clipping_attachment":
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
case "spine_mesh_attachment":
return MeshAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
case "spine_path_attachment":
return PathAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_attachment_wrapper.self))
case "spine_point_attachment":
return PointAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_point_attachment_wrapper.self))
case "spine_region_attachment":
return RegionAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_region_attachment_wrapper.self))
default:
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
}
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_bounding_box_attachment":
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
case "spine_clipping_attachment":
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
case "spine_mesh_attachment":
return MeshAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
case "spine_path_attachment":
return PathAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_attachment_wrapper.self))
case "spine_point_attachment":
return PointAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_point_attachment_wrapper.self))
case "spine_region_attachment":
return RegionAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_region_attachment_wrapper.self))
default:
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
}
}
}
/// Adds a value to the end of this array
public func add(_ value: Attachment?) {
spine_array_attachment_add(
_ptr.assumingMemoryBound(to: spine_array_attachment_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
spine_array_attachment_add(_ptr.assumingMemoryBound(to: spine_array_attachment_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
}
/// Removes all elements from this array
@ -716,8 +711,7 @@ public class ArrayBone: NSObject {
/// Adds a value to the end of this array
public func add(_ value: Bone?) {
spine_array_bone_add(
_ptr.assumingMemoryBound(to: spine_array_bone_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
spine_array_bone_add(_ptr.assumingMemoryBound(to: spine_array_bone_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
}
/// Removes all elements from this array
@ -795,8 +789,7 @@ public class ArrayBoneData: NSObject {
/// Adds a value to the end of this array
public func add(_ value: BoneData?) {
spine_array_bone_data_add(
_ptr.assumingMemoryBound(to: spine_array_bone_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
spine_array_bone_data_add(_ptr.assumingMemoryBound(to: spine_array_bone_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
}
/// Removes all elements from this array
@ -874,8 +867,7 @@ public class ArrayBonePose: NSObject {
/// Adds a value to the end of this array
public func add(_ value: BonePose?) {
spine_array_bone_pose_add(
_ptr.assumingMemoryBound(to: spine_array_bone_pose_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
spine_array_bone_pose_add(_ptr.assumingMemoryBound(to: spine_array_bone_pose_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
}
/// Removes all elements from this array
@ -953,9 +945,7 @@ public class ArrayBoundingBoxAttachment: NSObject {
/// Adds a value to the end of this array
public func add(_ value: BoundingBoxAttachment?) {
spine_array_bounding_box_attachment_add(
_ptr.assumingMemoryBound(to: spine_array_bounding_box_attachment_wrapper.self),
value?._ptr.assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
spine_array_bounding_box_attachment_add(_ptr.assumingMemoryBound(to: spine_array_bounding_box_attachment_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
}
/// Removes all elements from this array
@ -976,8 +966,7 @@ public class ArrayBoundingBoxAttachment: NSObject {
public var length: Int {
get { count }
set {
spine_array_bounding_box_attachment_set_size(
_ptr.assumingMemoryBound(to: spine_array_bounding_box_attachment_wrapper.self), newValue, nil)
spine_array_bounding_box_attachment_set_size(_ptr.assumingMemoryBound(to: spine_array_bounding_box_attachment_wrapper.self), newValue, nil)
}
}
@ -1030,28 +1019,27 @@ public class ArrayConstraint: NSObject {
let elementPtr = buffer[Int(index)]
guard let ptr = elementPtr else { return nil }
let rtti = spine_constraint_get_rtti(ptr)
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_ik_constraint":
return IkConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
case "spine_path_constraint":
return PathConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_wrapper.self))
case "spine_physics_constraint":
return PhysicsConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
case "spine_slider":
return Slider(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slider_wrapper.self))
case "spine_transform_constraint":
return TransformConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
default:
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Constraint")
}
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_ik_constraint":
return IkConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
case "spine_path_constraint":
return PathConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_wrapper.self))
case "spine_physics_constraint":
return PhysicsConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
case "spine_slider":
return Slider(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slider_wrapper.self))
case "spine_transform_constraint":
return TransformConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
default:
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Constraint")
}
}
}
/// Adds a value to the end of this array
public func add(_ value: Constraint?) {
spine_array_constraint_add(
_ptr.assumingMemoryBound(to: spine_array_constraint_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_constraint_wrapper.self))
spine_array_constraint_add(_ptr.assumingMemoryBound(to: spine_array_constraint_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_constraint_wrapper.self))
}
/// Removes all elements from this array
@ -1125,31 +1113,27 @@ public class ArrayConstraintData: NSObject {
let elementPtr = buffer[Int(index)]
guard let ptr = elementPtr else { return nil }
let rtti = spine_constraint_data_get_rtti(ptr)
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_ik_constraint_data":
return IkConstraintData(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self))
case "spine_path_constraint_data":
return PathConstraintData(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
case "spine_physics_constraint_data":
return PhysicsConstraintData(
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
case "spine_slider_data":
return SliderData(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slider_data_wrapper.self))
case "spine_transform_constraint_data":
return TransformConstraintData(
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
default:
fatalError("Unknown concrete type: \(rttiClassName) for abstract class ConstraintData")
}
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_ik_constraint_data":
return IkConstraintData(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self))
case "spine_path_constraint_data":
return PathConstraintData(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
case "spine_physics_constraint_data":
return PhysicsConstraintData(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
case "spine_slider_data":
return SliderData(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slider_data_wrapper.self))
case "spine_transform_constraint_data":
return TransformConstraintData(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
default:
fatalError("Unknown concrete type: \(rttiClassName) for abstract class ConstraintData")
}
}
}
/// Adds a value to the end of this array
public func add(_ value: ConstraintData?) {
spine_array_constraint_data_add(
_ptr.assumingMemoryBound(to: spine_array_constraint_data_wrapper.self),
value?._ptr.assumingMemoryBound(to: spine_constraint_data_wrapper.self))
spine_array_constraint_data_add(_ptr.assumingMemoryBound(to: spine_array_constraint_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_constraint_data_wrapper.self))
}
/// Removes all elements from this array
@ -1227,8 +1211,7 @@ public class ArrayEvent: NSObject {
/// Adds a value to the end of this array
public func add(_ value: Event?) {
spine_array_event_add(
_ptr.assumingMemoryBound(to: spine_array_event_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
spine_array_event_add(_ptr.assumingMemoryBound(to: spine_array_event_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
}
/// Removes all elements from this array
@ -1306,8 +1289,7 @@ public class ArrayEventData: NSObject {
/// Adds a value to the end of this array
public func add(_ value: EventData?) {
spine_array_event_data_add(
_ptr.assumingMemoryBound(to: spine_array_event_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
spine_array_event_data_add(_ptr.assumingMemoryBound(to: spine_array_event_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
}
/// Removes all elements from this array
@ -1381,31 +1363,29 @@ public class ArrayFromProperty: NSObject {
let elementPtr = buffer[Int(index)]
guard let ptr = elementPtr else { return nil }
let rtti = spine_from_property_get_rtti(ptr)
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_from_rotate":
return FromRotate(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_rotate_wrapper.self))
case "spine_from_scale_x":
return FromScaleX(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_scale_x_wrapper.self))
case "spine_from_scale_y":
return FromScaleY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_scale_y_wrapper.self))
case "spine_from_shear_y":
return FromShearY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_shear_y_wrapper.self))
case "spine_from_x":
return FromX(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_x_wrapper.self))
case "spine_from_y":
return FromY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_y_wrapper.self))
default:
fatalError("Unknown concrete type: \(rttiClassName) for abstract class FromProperty")
}
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_from_rotate":
return FromRotate(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_rotate_wrapper.self))
case "spine_from_scale_x":
return FromScaleX(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_scale_x_wrapper.self))
case "spine_from_scale_y":
return FromScaleY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_scale_y_wrapper.self))
case "spine_from_shear_y":
return FromShearY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_shear_y_wrapper.self))
case "spine_from_x":
return FromX(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_x_wrapper.self))
case "spine_from_y":
return FromY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_y_wrapper.self))
default:
fatalError("Unknown concrete type: \(rttiClassName) for abstract class FromProperty")
}
}
}
/// Adds a value to the end of this array
public func add(_ value: FromProperty?) {
spine_array_from_property_add(
_ptr.assumingMemoryBound(to: spine_array_from_property_wrapper.self),
value?._ptr.assumingMemoryBound(to: spine_from_property_wrapper.self))
spine_array_from_property_add(_ptr.assumingMemoryBound(to: spine_array_from_property_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_from_property_wrapper.self))
}
/// Removes all elements from this array
@ -1483,9 +1463,7 @@ public class ArrayPhysicsConstraint: NSObject {
/// Adds a value to the end of this array
public func add(_ value: PhysicsConstraint?) {
spine_array_physics_constraint_add(
_ptr.assumingMemoryBound(to: spine_array_physics_constraint_wrapper.self),
value?._ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
spine_array_physics_constraint_add(_ptr.assumingMemoryBound(to: spine_array_physics_constraint_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
}
/// Removes all elements from this array
@ -1563,8 +1541,7 @@ public class ArrayPolygon: NSObject {
/// Adds a value to the end of this array
public func add(_ value: Polygon?) {
spine_array_polygon_add(
_ptr.assumingMemoryBound(to: spine_array_polygon_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_polygon_wrapper.self))
spine_array_polygon_add(_ptr.assumingMemoryBound(to: spine_array_polygon_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_polygon_wrapper.self))
}
/// Removes all elements from this array
@ -1642,8 +1619,7 @@ public class ArraySkin: NSObject {
/// Adds a value to the end of this array
public func add(_ value: Skin?) {
spine_array_skin_add(
_ptr.assumingMemoryBound(to: spine_array_skin_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_skin_wrapper.self))
spine_array_skin_add(_ptr.assumingMemoryBound(to: spine_array_skin_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_skin_wrapper.self))
}
/// Removes all elements from this array
@ -1721,8 +1697,7 @@ public class ArraySlot: NSObject {
/// Adds a value to the end of this array
public func add(_ value: Slot?) {
spine_array_slot_add(
_ptr.assumingMemoryBound(to: spine_array_slot_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_slot_wrapper.self))
spine_array_slot_add(_ptr.assumingMemoryBound(to: spine_array_slot_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_slot_wrapper.self))
}
/// Removes all elements from this array
@ -1800,8 +1775,7 @@ public class ArraySlotData: NSObject {
/// Adds a value to the end of this array
public func add(_ value: SlotData?) {
spine_array_slot_data_add(
_ptr.assumingMemoryBound(to: spine_array_slot_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
spine_array_slot_data_add(_ptr.assumingMemoryBound(to: spine_array_slot_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
}
/// Removes all elements from this array
@ -1879,9 +1853,7 @@ public class ArrayTextureRegion: NSObject {
/// Adds a value to the end of this array
public func add(_ value: TextureRegion?) {
spine_array_texture_region_add(
_ptr.assumingMemoryBound(to: spine_array_texture_region_wrapper.self),
value?._ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
spine_array_texture_region_add(_ptr.assumingMemoryBound(to: spine_array_texture_region_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
}
/// Removes all elements from this array
@ -1955,103 +1927,89 @@ public class ArrayTimeline: NSObject {
let elementPtr = buffer[Int(index)]
guard let ptr = elementPtr else { return nil }
let rtti = spine_timeline_get_rtti(ptr)
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_alpha_timeline":
return AlphaTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_alpha_timeline_wrapper.self))
case "spine_attachment_timeline":
return AttachmentTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_attachment_timeline_wrapper.self))
case "spine_deform_timeline":
return DeformTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_deform_timeline_wrapper.self))
case "spine_draw_order_timeline":
return DrawOrderTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_draw_order_timeline_wrapper.self))
case "spine_event_timeline":
return EventTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_event_timeline_wrapper.self))
case "spine_ik_constraint_timeline":
return IkConstraintTimeline(
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_ik_constraint_timeline_wrapper.self))
case "spine_inherit_timeline":
return InheritTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_inherit_timeline_wrapper.self))
case "spine_path_constraint_mix_timeline":
return PathConstraintMixTimeline(
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self))
case "spine_path_constraint_position_timeline":
return PathConstraintPositionTimeline(
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_position_timeline_wrapper.self))
case "spine_path_constraint_spacing_timeline":
return PathConstraintSpacingTimeline(
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_spacing_timeline_wrapper.self))
case "spine_physics_constraint_damping_timeline":
return PhysicsConstraintDampingTimeline(
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_damping_timeline_wrapper.self))
case "spine_physics_constraint_gravity_timeline":
return PhysicsConstraintGravityTimeline(
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_gravity_timeline_wrapper.self))
case "spine_physics_constraint_inertia_timeline":
return PhysicsConstraintInertiaTimeline(
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_inertia_timeline_wrapper.self))
case "spine_physics_constraint_mass_timeline":
return PhysicsConstraintMassTimeline(
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_mass_timeline_wrapper.self))
case "spine_physics_constraint_mix_timeline":
return PhysicsConstraintMixTimeline(
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_mix_timeline_wrapper.self))
case "spine_physics_constraint_reset_timeline":
return PhysicsConstraintResetTimeline(
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self))
case "spine_physics_constraint_strength_timeline":
return PhysicsConstraintStrengthTimeline(
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_strength_timeline_wrapper.self))
case "spine_physics_constraint_wind_timeline":
return PhysicsConstraintWindTimeline(
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_wind_timeline_wrapper.self))
case "spine_rgb2_timeline":
return Rgb2Timeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_rgb2_timeline_wrapper.self))
case "spine_rgba2_timeline":
return Rgba2Timeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_rgba2_timeline_wrapper.self))
case "spine_rgba_timeline":
return RgbaTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_rgba_timeline_wrapper.self))
case "spine_rgb_timeline":
return RgbTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_rgb_timeline_wrapper.self))
case "spine_rotate_timeline":
return RotateTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_rotate_timeline_wrapper.self))
case "spine_scale_timeline":
return ScaleTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_scale_timeline_wrapper.self))
case "spine_scale_x_timeline":
return ScaleXTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_scale_x_timeline_wrapper.self))
case "spine_scale_y_timeline":
return ScaleYTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_scale_y_timeline_wrapper.self))
case "spine_sequence_timeline":
return SequenceTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_sequence_timeline_wrapper.self))
case "spine_shear_timeline":
return ShearTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_shear_timeline_wrapper.self))
case "spine_shear_x_timeline":
return ShearXTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_shear_x_timeline_wrapper.self))
case "spine_shear_y_timeline":
return ShearYTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_shear_y_timeline_wrapper.self))
case "spine_slider_mix_timeline":
return SliderMixTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slider_mix_timeline_wrapper.self))
case "spine_slider_timeline":
return SliderTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slider_timeline_wrapper.self))
case "spine_transform_constraint_timeline":
return TransformConstraintTimeline(
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_timeline_wrapper.self))
case "spine_translate_timeline":
return TranslateTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_translate_timeline_wrapper.self))
case "spine_translate_x_timeline":
return TranslateXTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_translate_x_timeline_wrapper.self))
case "spine_translate_y_timeline":
return TranslateYTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_translate_y_timeline_wrapper.self))
default:
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Timeline")
}
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_alpha_timeline":
return AlphaTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_alpha_timeline_wrapper.self))
case "spine_attachment_timeline":
return AttachmentTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_attachment_timeline_wrapper.self))
case "spine_deform_timeline":
return DeformTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_deform_timeline_wrapper.self))
case "spine_draw_order_timeline":
return DrawOrderTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_draw_order_timeline_wrapper.self))
case "spine_event_timeline":
return EventTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_event_timeline_wrapper.self))
case "spine_ik_constraint_timeline":
return IkConstraintTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_ik_constraint_timeline_wrapper.self))
case "spine_inherit_timeline":
return InheritTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_inherit_timeline_wrapper.self))
case "spine_path_constraint_mix_timeline":
return PathConstraintMixTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self))
case "spine_path_constraint_position_timeline":
return PathConstraintPositionTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_position_timeline_wrapper.self))
case "spine_path_constraint_spacing_timeline":
return PathConstraintSpacingTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_spacing_timeline_wrapper.self))
case "spine_physics_constraint_damping_timeline":
return PhysicsConstraintDampingTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_damping_timeline_wrapper.self))
case "spine_physics_constraint_gravity_timeline":
return PhysicsConstraintGravityTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_gravity_timeline_wrapper.self))
case "spine_physics_constraint_inertia_timeline":
return PhysicsConstraintInertiaTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_inertia_timeline_wrapper.self))
case "spine_physics_constraint_mass_timeline":
return PhysicsConstraintMassTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_mass_timeline_wrapper.self))
case "spine_physics_constraint_mix_timeline":
return PhysicsConstraintMixTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_mix_timeline_wrapper.self))
case "spine_physics_constraint_reset_timeline":
return PhysicsConstraintResetTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self))
case "spine_physics_constraint_strength_timeline":
return PhysicsConstraintStrengthTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_strength_timeline_wrapper.self))
case "spine_physics_constraint_wind_timeline":
return PhysicsConstraintWindTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_wind_timeline_wrapper.self))
case "spine_rgb2_timeline":
return Rgb2Timeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_rgb2_timeline_wrapper.self))
case "spine_rgba2_timeline":
return Rgba2Timeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_rgba2_timeline_wrapper.self))
case "spine_rgba_timeline":
return RgbaTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_rgba_timeline_wrapper.self))
case "spine_rgb_timeline":
return RgbTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_rgb_timeline_wrapper.self))
case "spine_rotate_timeline":
return RotateTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_rotate_timeline_wrapper.self))
case "spine_scale_timeline":
return ScaleTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_scale_timeline_wrapper.self))
case "spine_scale_x_timeline":
return ScaleXTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_scale_x_timeline_wrapper.self))
case "spine_scale_y_timeline":
return ScaleYTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_scale_y_timeline_wrapper.self))
case "spine_sequence_timeline":
return SequenceTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_sequence_timeline_wrapper.self))
case "spine_shear_timeline":
return ShearTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_shear_timeline_wrapper.self))
case "spine_shear_x_timeline":
return ShearXTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_shear_x_timeline_wrapper.self))
case "spine_shear_y_timeline":
return ShearYTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_shear_y_timeline_wrapper.self))
case "spine_slider_mix_timeline":
return SliderMixTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slider_mix_timeline_wrapper.self))
case "spine_slider_timeline":
return SliderTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slider_timeline_wrapper.self))
case "spine_transform_constraint_timeline":
return TransformConstraintTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_timeline_wrapper.self))
case "spine_translate_timeline":
return TranslateTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_translate_timeline_wrapper.self))
case "spine_translate_x_timeline":
return TranslateXTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_translate_x_timeline_wrapper.self))
case "spine_translate_y_timeline":
return TranslateYTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_translate_y_timeline_wrapper.self))
default:
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Timeline")
}
}
}
/// Adds a value to the end of this array
public func add(_ value: Timeline?) {
spine_array_timeline_add(
_ptr.assumingMemoryBound(to: spine_array_timeline_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_timeline_wrapper.self))
spine_array_timeline_add(_ptr.assumingMemoryBound(to: spine_array_timeline_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_timeline_wrapper.self))
}
/// Removes all elements from this array
@ -2125,30 +2083,29 @@ public class ArrayToProperty: NSObject {
let elementPtr = buffer[Int(index)]
guard let ptr = elementPtr else { return nil }
let rtti = spine_to_property_get_rtti(ptr)
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_to_rotate":
return ToRotate(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_rotate_wrapper.self))
case "spine_to_scale_x":
return ToScaleX(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_scale_x_wrapper.self))
case "spine_to_scale_y":
return ToScaleY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_scale_y_wrapper.self))
case "spine_to_shear_y":
return ToShearY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_shear_y_wrapper.self))
case "spine_to_x":
return ToX(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_x_wrapper.self))
case "spine_to_y":
return ToY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_y_wrapper.self))
default:
fatalError("Unknown concrete type: \(rttiClassName) for abstract class ToProperty")
}
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_to_rotate":
return ToRotate(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_rotate_wrapper.self))
case "spine_to_scale_x":
return ToScaleX(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_scale_x_wrapper.self))
case "spine_to_scale_y":
return ToScaleY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_scale_y_wrapper.self))
case "spine_to_shear_y":
return ToShearY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_shear_y_wrapper.self))
case "spine_to_x":
return ToX(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_x_wrapper.self))
case "spine_to_y":
return ToY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_y_wrapper.self))
default:
fatalError("Unknown concrete type: \(rttiClassName) for abstract class ToProperty")
}
}
}
/// Adds a value to the end of this array
public func add(_ value: ToProperty?) {
spine_array_to_property_add(
_ptr.assumingMemoryBound(to: spine_array_to_property_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_to_property_wrapper.self))
spine_array_to_property_add(_ptr.assumingMemoryBound(to: spine_array_to_property_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_to_property_wrapper.self))
}
/// Removes all elements from this array
@ -2226,8 +2183,7 @@ public class ArrayTrackEntry: NSObject {
/// Adds a value to the end of this array
public func add(_ value: TrackEntry?) {
spine_array_track_entry_add(
_ptr.assumingMemoryBound(to: spine_array_track_entry_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
spine_array_track_entry_add(_ptr.assumingMemoryBound(to: spine_array_track_entry_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
}
/// Removes all elements from this array
@ -2301,32 +2257,31 @@ public class ArrayUpdate: NSObject {
let elementPtr = buffer[Int(index)]
guard let ptr = elementPtr else { return nil }
let rtti = spine_update_get_rtti(ptr)
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_bone":
return Bone(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bone_wrapper.self))
case "spine_bone_pose":
return BonePose(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bone_pose_wrapper.self))
case "spine_ik_constraint":
return IkConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
case "spine_path_constraint":
return PathConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_wrapper.self))
case "spine_physics_constraint":
return PhysicsConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
case "spine_slider":
return Slider(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slider_wrapper.self))
case "spine_transform_constraint":
return TransformConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
default:
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Update")
}
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_bone":
return Bone(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bone_wrapper.self))
case "spine_bone_pose":
return BonePose(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bone_pose_wrapper.self))
case "spine_ik_constraint":
return IkConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
case "spine_path_constraint":
return PathConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_wrapper.self))
case "spine_physics_constraint":
return PhysicsConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
case "spine_slider":
return Slider(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slider_wrapper.self))
case "spine_transform_constraint":
return TransformConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
default:
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Update")
}
}
}
/// Adds a value to the end of this array
public func add(_ value: Update?) {
spine_array_update_add(
_ptr.assumingMemoryBound(to: spine_array_update_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_update_wrapper.self))
spine_array_update_add(_ptr.assumingMemoryBound(to: spine_array_update_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_update_wrapper.self))
}
/// Removes all elements from this array
@ -2361,4 +2316,4 @@ public class ArrayUpdate: NSObject {
spine_array_update_dispose(_ptr.assumingMemoryBound(to: spine_array_update_wrapper.self))
}
}
}
}

View File

@ -65,4 +65,4 @@ public class Atlas: NSObject {
public func dispose() {
spine_atlas_dispose(_ptr.assumingMemoryBound(to: spine_atlas_wrapper.self))
}
}
}

View File

@ -64,8 +64,7 @@ open class Attachment: NSObject {
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_bounding_box_attachment":
return BoundingBoxAttachment(
fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
case "spine_clipping_attachment":
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
case "spine_mesh_attachment":
@ -94,4 +93,4 @@ open class Attachment: NSObject {
return Rtti(fromPointer: result!)
}
}
}

View File

@ -42,14 +42,12 @@ public class Bone: PosedActive, Posed, Update {
}
public convenience init(_ data: BoneData, _ parent: Bone?) {
let ptr = spine_bone_create(
data._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self), parent?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
let ptr = spine_bone_create(data._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self), parent?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
self.init(fromPointer: ptr!)
}
public static func from(_ bone: Bone, _ parent: Bone?) -> Bone {
let ptr = spine_bone_create2(
bone._ptr.assumingMemoryBound(to: spine_bone_wrapper.self), parent?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
let ptr = spine_bone_create2(bone._ptr.assumingMemoryBound(to: spine_bone_wrapper.self), parent?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
return Bone(fromPointer: ptr!)
}
@ -98,9 +96,7 @@ public class Bone: PosedActive, Posed, Update {
}
public func update(_ skeleton: Skeleton, _ physics: Physics) {
spine_bone_update(
_ptr.assumingMemoryBound(to: spine_bone_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
spine_physics(rawValue: UInt32(physics.rawValue)))
spine_bone_update(_ptr.assumingMemoryBound(to: spine_bone_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
}
public func resetConstrained() {
@ -119,4 +115,4 @@ public class Bone: PosedActive, Posed, Update {
public override func dispose() {
spine_bone_dispose(_ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
}
}
}

View File

@ -56,7 +56,7 @@ public class Color: NSObject {
public var r: Float {
get {
let result = spine_color_get_r(_ptr.assumingMemoryBound(to: spine_color_wrapper.self))
return result
return result
}
set {
spine_color_set_r(_ptr.assumingMemoryBound(to: spine_color_wrapper.self), newValue)
@ -66,7 +66,7 @@ public class Color: NSObject {
public var g: Float {
get {
let result = spine_color_get_g(_ptr.assumingMemoryBound(to: spine_color_wrapper.self))
return result
return result
}
set {
spine_color_set_g(_ptr.assumingMemoryBound(to: spine_color_wrapper.self), newValue)
@ -76,7 +76,7 @@ public class Color: NSObject {
public var b: Float {
get {
let result = spine_color_get_b(_ptr.assumingMemoryBound(to: spine_color_wrapper.self))
return result
return result
}
set {
spine_color_set_b(_ptr.assumingMemoryBound(to: spine_color_wrapper.self), newValue)
@ -86,7 +86,7 @@ public class Color: NSObject {
public var a: Float {
get {
let result = spine_color_get_a(_ptr.assumingMemoryBound(to: spine_color_wrapper.self))
return result
return result
}
set {
spine_color_set_a(_ptr.assumingMemoryBound(to: spine_color_wrapper.self), newValue)
@ -122,8 +122,7 @@ public class Color: NSObject {
}
public func set3(_ other: Color) -> Color {
let result = spine_color_set_3(
_ptr.assumingMemoryBound(to: spine_color_wrapper.self), other._ptr.assumingMemoryBound(to: spine_color_wrapper.self))
let result = spine_color_set_3(_ptr.assumingMemoryBound(to: spine_color_wrapper.self), other._ptr.assumingMemoryBound(to: spine_color_wrapper.self))
return Color(fromPointer: result!)
}
@ -138,12 +137,11 @@ public class Color: NSObject {
}
public func add3(_ other: Color) -> Color {
let result = spine_color_add_3(
_ptr.assumingMemoryBound(to: spine_color_wrapper.self), other._ptr.assumingMemoryBound(to: spine_color_wrapper.self))
let result = spine_color_add_3(_ptr.assumingMemoryBound(to: spine_color_wrapper.self), other._ptr.assumingMemoryBound(to: spine_color_wrapper.self))
return Color(fromPointer: result!)
}
public func dispose() {
spine_color_dispose(_ptr.assumingMemoryBound(to: spine_color_wrapper.self))
}
}
}

View File

@ -41,4 +41,4 @@ public protocol Constraint: Update {
func sort(_ skeleton: Skeleton)
func update(_ skeleton: Skeleton, _ physics: Physics)
static func rttiStatic() -> Rtti
}
}

View File

@ -61,7 +61,7 @@ public class Event: NSObject {
public var intValue: Int32 {
get {
let result = spine_event_get_int(_ptr.assumingMemoryBound(to: spine_event_wrapper.self))
return result
return result
}
set {
spine_event_set_int(_ptr.assumingMemoryBound(to: spine_event_wrapper.self), newValue)
@ -71,7 +71,7 @@ public class Event: NSObject {
public var floatValue: Float {
get {
let result = spine_event_get_float(_ptr.assumingMemoryBound(to: spine_event_wrapper.self))
return result
return result
}
set {
spine_event_set_float(_ptr.assumingMemoryBound(to: spine_event_wrapper.self), newValue)
@ -81,7 +81,7 @@ public class Event: NSObject {
public var stringValue: String {
get {
let result = spine_event_get_string(_ptr.assumingMemoryBound(to: spine_event_wrapper.self))
return String(cString: result!)
return String(cString: result!)
}
set {
spine_event_set_string(_ptr.assumingMemoryBound(to: spine_event_wrapper.self), newValue)
@ -91,7 +91,7 @@ public class Event: NSObject {
public var volume: Float {
get {
let result = spine_event_get_volume(_ptr.assumingMemoryBound(to: spine_event_wrapper.self))
return result
return result
}
set {
spine_event_set_volume(_ptr.assumingMemoryBound(to: spine_event_wrapper.self), newValue)
@ -101,7 +101,7 @@ public class Event: NSObject {
public var balance: Float {
get {
let result = spine_event_get_balance(_ptr.assumingMemoryBound(to: spine_event_wrapper.self))
return result
return result
}
set {
spine_event_set_balance(_ptr.assumingMemoryBound(to: spine_event_wrapper.self), newValue)
@ -111,4 +111,4 @@ public class Event: NSObject {
public func dispose() {
spine_event_dispose(_ptr.assumingMemoryBound(to: spine_event_wrapper.self))
}
}
}

View File

@ -51,18 +51,17 @@ public class Polygon: NSObject {
public var vertices: ArrayFloat {
get {
let result = spine_polygon_get__vertices(_ptr.assumingMemoryBound(to: spine_polygon_wrapper.self))
return ArrayFloat(fromPointer: result!)
return ArrayFloat(fromPointer: result!)
}
set {
spine_polygon_set__vertices(
_ptr.assumingMemoryBound(to: spine_polygon_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
spine_polygon_set__vertices(_ptr.assumingMemoryBound(to: spine_polygon_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
}
}
public var count: Int32 {
get {
let result = spine_polygon_get__count(_ptr.assumingMemoryBound(to: spine_polygon_wrapper.self))
return result
return result
}
set {
spine_polygon_set__count(_ptr.assumingMemoryBound(to: spine_polygon_wrapper.self), newValue)
@ -72,4 +71,4 @@ public class Polygon: NSObject {
public func dispose() {
spine_polygon_dispose(_ptr.assumingMemoryBound(to: spine_polygon_wrapper.self))
}
}
}

View File

@ -38,4 +38,4 @@ public protocol Posed {
var isPoseEqualToApplied: Bool { get }
func constrained()
func resetConstrained()
}
}

View File

@ -49,18 +49,16 @@ public class Rtti: NSObject {
}
public func isExactly(_ rtti: Rtti) -> Bool {
let result = spine_rtti_is_exactly(
_ptr.assumingMemoryBound(to: spine_rtti_wrapper.self), rtti._ptr.assumingMemoryBound(to: spine_rtti_wrapper.self))
let result = spine_rtti_is_exactly(_ptr.assumingMemoryBound(to: spine_rtti_wrapper.self), rtti._ptr.assumingMemoryBound(to: spine_rtti_wrapper.self))
return result
}
public func instanceOf(_ rtti: Rtti) -> Bool {
let result = spine_rtti_instance_of(
_ptr.assumingMemoryBound(to: spine_rtti_wrapper.self), rtti._ptr.assumingMemoryBound(to: spine_rtti_wrapper.self))
let result = spine_rtti_instance_of(_ptr.assumingMemoryBound(to: spine_rtti_wrapper.self), rtti._ptr.assumingMemoryBound(to: spine_rtti_wrapper.self))
return result
}
public func dispose() {
spine_rtti_dispose(_ptr.assumingMemoryBound(to: spine_rtti_wrapper.self))
}
}
}

View File

@ -51,7 +51,7 @@ public class Sequence: NSObject {
public var id: Int32 {
get {
let result = spine_sequence_get_id(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
return result
return result
}
set {
spine_sequence_set_id(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), newValue)
@ -61,7 +61,7 @@ public class Sequence: NSObject {
public var start: Int32 {
get {
let result = spine_sequence_get_start(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
return result
return result
}
set {
spine_sequence_set_start(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), newValue)
@ -71,7 +71,7 @@ public class Sequence: NSObject {
public var digits: Int32 {
get {
let result = spine_sequence_get_digits(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
return result
return result
}
set {
spine_sequence_set_digits(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), newValue)
@ -81,7 +81,7 @@ public class Sequence: NSObject {
public var setupIndex: Int32 {
get {
let result = spine_sequence_get_setup_index(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
return result
return result
}
set {
spine_sequence_set_setup_index(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), newValue)
@ -99,9 +99,7 @@ public class Sequence: NSObject {
}
public func apply(_ slot: SlotPose?, _ attachment: Attachment?) {
spine_sequence_apply(
_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), slot?._ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self),
attachment?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
spine_sequence_apply(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), slot?._ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self), attachment?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
}
public func getPath(_ basePath: String, _ index: Int32) -> String {
@ -112,4 +110,4 @@ public class Sequence: NSObject {
public func dispose() {
spine_sequence_dispose(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
}
}
}

View File

@ -101,7 +101,7 @@ public class Skeleton: NSObject {
public var scaleX: Float {
get {
let result = spine_skeleton_get_scale_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
return result
return result
}
set {
spine_skeleton_set_scale_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
@ -111,7 +111,7 @@ public class Skeleton: NSObject {
public var scaleY: Float {
get {
let result = spine_skeleton_get_scale_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
return result
return result
}
set {
spine_skeleton_set_scale_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
@ -121,7 +121,7 @@ public class Skeleton: NSObject {
public var x: Float {
get {
let result = spine_skeleton_get_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
return result
return result
}
set {
spine_skeleton_set_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
@ -131,7 +131,7 @@ public class Skeleton: NSObject {
public var y: Float {
get {
let result = spine_skeleton_get_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
return result
return result
}
set {
spine_skeleton_set_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
@ -141,7 +141,7 @@ public class Skeleton: NSObject {
public var windX: Float {
get {
let result = spine_skeleton_get_wind_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
return result
return result
}
set {
spine_skeleton_set_wind_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
@ -151,7 +151,7 @@ public class Skeleton: NSObject {
public var windY: Float {
get {
let result = spine_skeleton_get_wind_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
return result
return result
}
set {
spine_skeleton_set_wind_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
@ -161,7 +161,7 @@ public class Skeleton: NSObject {
public var gravityX: Float {
get {
let result = spine_skeleton_get_gravity_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
return result
return result
}
set {
spine_skeleton_set_gravity_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
@ -171,7 +171,7 @@ public class Skeleton: NSObject {
public var gravityY: Float {
get {
let result = spine_skeleton_get_gravity_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
return result
return result
}
set {
spine_skeleton_set_gravity_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
@ -181,7 +181,7 @@ public class Skeleton: NSObject {
public var time: Float {
get {
let result = spine_skeleton_get_time(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
return result
return result
}
set {
spine_skeleton_set_time(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
@ -191,8 +191,7 @@ public class Skeleton: NSObject {
public var setColor: Color {
get { fatalError("Setter-only property") }
set(newValue) {
spine_skeleton_set_color_1(
_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_color_wrapper.self))
spine_skeleton_set_color_1(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_color_wrapper.self))
}
}
@ -205,13 +204,11 @@ public class Skeleton: NSObject {
}
public func constrained(_ object: Posed) {
spine_skeleton_constrained(
_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), object._ptr.assumingMemoryBound(to: spine_posed_wrapper.self))
spine_skeleton_constrained(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), object._ptr.assumingMemoryBound(to: spine_posed_wrapper.self))
}
public func sortBone(_ bone: Bone?) {
spine_skeleton_sort_bone(
_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), bone?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
spine_skeleton_sort_bone(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), bone?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
}
public static func sortReset(_ bones: ArrayBone) {
@ -219,8 +216,7 @@ public class Skeleton: NSObject {
}
public func updateWorldTransform(_ physics: Physics) {
spine_skeleton_update_world_transform(
_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
spine_skeleton_update_world_transform(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
}
public func setupPose() {
@ -274,8 +270,7 @@ public class Skeleton: NSObject {
}
public func setSkin2(_ newSkin: Skin?) {
spine_skeleton_set_skin_2(
_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newSkin?._ptr.assumingMemoryBound(to: spine_skin_wrapper.self))
spine_skeleton_set_skin_2(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newSkin?._ptr.assumingMemoryBound(to: spine_skin_wrapper.self))
}
public func getAttachment(_ slotName: String, _ attachmentName: String) -> Attachment? {
@ -285,8 +280,7 @@ public class Skeleton: NSObject {
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_bounding_box_attachment":
return BoundingBoxAttachment(
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
case "spine_clipping_attachment":
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
case "spine_mesh_attachment":
@ -309,8 +303,7 @@ public class Skeleton: NSObject {
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_bounding_box_attachment":
return BoundingBoxAttachment(
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
case "spine_clipping_attachment":
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
case "spine_mesh_attachment":
@ -333,4 +326,4 @@ public class Skeleton: NSObject {
public func dispose() {
spine_skeleton_dispose(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
}
}
}

View File

@ -69,9 +69,7 @@ public class Skin: NSObject {
}
public func setAttachment(_ slotIndex: Int, _ name: String, _ attachment: Attachment) {
spine_skin_set_attachment(
_ptr.assumingMemoryBound(to: spine_skin_wrapper.self), slotIndex, name,
attachment._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
spine_skin_set_attachment(_ptr.assumingMemoryBound(to: spine_skin_wrapper.self), slotIndex, name, attachment._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
}
public func getAttachment(_ slotIndex: Int, _ name: String) -> Attachment? {
@ -81,8 +79,7 @@ public class Skin: NSObject {
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_bounding_box_attachment":
return BoundingBoxAttachment(
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
case "spine_clipping_attachment":
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
case "spine_mesh_attachment":
@ -103,9 +100,7 @@ public class Skin: NSObject {
}
public func findAttachmentsForSlot(_ slotIndex: Int, _ attachments: ArrayAttachment) {
spine_skin_find_attachments_for_slot(
_ptr.assumingMemoryBound(to: spine_skin_wrapper.self), slotIndex,
attachments._ptr.assumingMemoryBound(to: spine_array_attachment_wrapper.self))
spine_skin_find_attachments_for_slot(_ptr.assumingMemoryBound(to: spine_skin_wrapper.self), slotIndex, attachments._ptr.assumingMemoryBound(to: spine_array_attachment_wrapper.self))
}
public func addSkin(_ other: Skin) {
@ -119,4 +114,4 @@ public class Skin: NSObject {
public func dispose() {
spine_skin_dispose(_ptr.assumingMemoryBound(to: spine_skin_wrapper.self))
}
}
}

View File

@ -42,8 +42,7 @@ public class Slider: PosedActive, Posed, Constraint {
}
public convenience init(_ data: SliderData, _ skeleton: Skeleton) {
let ptr = spine_slider_create(
data._ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
let ptr = spine_slider_create(data._ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
self.init(fromPointer: ptr!)
}
@ -60,11 +59,10 @@ public class Slider: PosedActive, Posed, Constraint {
public var bone: Bone {
get {
let result = spine_slider_get_bone(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self))
return Bone(fromPointer: result!)
return Bone(fromPointer: result!)
}
set {
spine_slider_set_bone(
_ptr.assumingMemoryBound(to: spine_slider_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
spine_slider_set_bone(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
}
}
@ -89,15 +87,12 @@ public class Slider: PosedActive, Posed, Constraint {
}
public func copyAttachment(_ skeleton: Skeleton) -> Slider {
let result = spine_slider_copy(
_ptr.assumingMemoryBound(to: spine_slider_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
let result = spine_slider_copy(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
return Slider(fromPointer: result!)
}
public func update(_ skeleton: Skeleton, _ physics: Physics) {
spine_slider_update(
_ptr.assumingMemoryBound(to: spine_slider_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
spine_physics(rawValue: UInt32(physics.rawValue)))
spine_slider_update(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
}
public func sort(_ skeleton: Skeleton) {
@ -120,4 +115,4 @@ public class Slider: PosedActive, Posed, Constraint {
public override func dispose() {
spine_slider_dispose(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self))
}
}
}

View File

@ -44,8 +44,7 @@ public class Slot: NSObject, Posed {
}
public convenience init(_ data: SlotData, _ skeleton: Skeleton) {
let ptr = spine_slot_create(
data._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
let ptr = spine_slot_create(data._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
self.init(fromPointer: ptr!)
}
@ -89,4 +88,4 @@ public class Slot: NSObject, Posed {
public func dispose() {
spine_slot_dispose(_ptr.assumingMemoryBound(to: spine_slot_wrapper.self))
}
}
}

View File

@ -73,14 +73,8 @@ open class Timeline: NSObject {
return ArrayPropertyId(fromPointer: result!)
}
public func apply(
_ skeleton: Skeleton, _ lastTime: Float, _ time: Float, _ events: ArrayEvent?, _ alpha: Float, _ blend: MixBlend, _ direction: MixDirection,
_ appliedPose: Bool
) {
spine_timeline_apply(
_ptr.assumingMemoryBound(to: spine_timeline_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), lastTime,
time, events?._ptr.assumingMemoryBound(to: spine_array_event_wrapper.self), alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)),
spine_mix_direction(rawValue: UInt32(direction.rawValue)), appliedPose)
public func apply(_ skeleton: Skeleton, _ lastTime: Float, _ time: Float, _ events: ArrayEvent?, _ alpha: Float, _ blend: MixBlend, _ direction: MixDirection, _ appliedPose: Bool) {
spine_timeline_apply(_ptr.assumingMemoryBound(to: spine_timeline_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), lastTime, time, events?._ptr.assumingMemoryBound(to: spine_array_event_wrapper.self), alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)), spine_mix_direction(rawValue: UInt32(direction.rawValue)), appliedPose)
}
public static func rttiStatic() -> Rtti {
@ -88,4 +82,4 @@ open class Timeline: NSObject {
return Rtti(fromPointer: result!)
}
}
}

View File

@ -38,4 +38,4 @@ public protocol Update {
var rtti: Rtti { get }
func update(_ skeleton: Skeleton, _ physics: Physics)
static func rttiStatic() -> Rtti
}
}

View File

@ -49,7 +49,7 @@ public class AlphaTimeline: CurveTimeline1, SlotTimeline {
public var slotIndex: Int32 {
get {
let result = spine_alpha_timeline_get_slot_index(_ptr.assumingMemoryBound(to: spine_alpha_timeline_wrapper.self))
return result
return result
}
set {
spine_alpha_timeline_set_slot_index(_ptr.assumingMemoryBound(to: spine_alpha_timeline_wrapper.self), newValue)
@ -59,4 +59,4 @@ public class AlphaTimeline: CurveTimeline1, SlotTimeline {
public func dispose() {
spine_alpha_timeline_dispose(_ptr.assumingMemoryBound(to: spine_alpha_timeline_wrapper.self))
}
}
}

View File

@ -68,7 +68,7 @@ public class AnimationState: NSObject {
public var timeScale: Float {
get {
let result = spine_animation_state_get_time_scale(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self))
return result
return result
}
set {
spine_animation_state_set_time_scale(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), newValue)
@ -78,7 +78,7 @@ public class AnimationState: NSObject {
public var manualTrackEntryDisposal: Bool {
get {
let result = spine_animation_state_get_manual_track_entry_disposal(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self))
return result
return result
}
set {
spine_animation_state_set_manual_track_entry_disposal(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), newValue)
@ -95,8 +95,7 @@ public class AnimationState: NSObject {
}
public func apply(_ skeleton: Skeleton) -> Bool {
let result = spine_animation_state_apply(
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
let result = spine_animation_state_apply(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
return result
}
@ -109,14 +108,12 @@ public class AnimationState: NSObject {
}
public func setEmptyAnimation(_ trackIndex: Int, _ mixDuration: Float) -> TrackEntry {
let result = spine_animation_state_set_empty_animation(
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, mixDuration)
let result = spine_animation_state_set_empty_animation(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, mixDuration)
return TrackEntry(fromPointer: result!)
}
public func addEmptyAnimation(_ trackIndex: Int, _ mixDuration: Float, _ delay: Float) -> TrackEntry {
let result = spine_animation_state_add_empty_animation(
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, mixDuration, delay)
let result = spine_animation_state_add_empty_animation(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, mixDuration, delay)
return TrackEntry(fromPointer: result!)
}
@ -134,37 +131,30 @@ public class AnimationState: NSObject {
}
public func disposeTrackEntry(_ entry: TrackEntry?) {
spine_animation_state_dispose_track_entry(
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), entry?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
spine_animation_state_dispose_track_entry(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), entry?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
}
public func setAnimation(_ trackIndex: Int, _ animationName: String, _ loop: Bool) -> TrackEntry {
let result = spine_animation_state_set_animation_1(
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, animationName, loop)
let result = spine_animation_state_set_animation_1(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, animationName, loop)
return TrackEntry(fromPointer: result!)
}
public func setAnimation2(_ trackIndex: Int, _ animation: Animation, _ loop: Bool) -> TrackEntry {
let result = spine_animation_state_set_animation_2(
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex,
animation._ptr.assumingMemoryBound(to: spine_animation_wrapper.self), loop)
let result = spine_animation_state_set_animation_2(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, animation._ptr.assumingMemoryBound(to: spine_animation_wrapper.self), loop)
return TrackEntry(fromPointer: result!)
}
public func addAnimation(_ trackIndex: Int, _ animationName: String, _ loop: Bool, _ delay: Float) -> TrackEntry {
let result = spine_animation_state_add_animation_1(
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, animationName, loop, delay)
let result = spine_animation_state_add_animation_1(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, animationName, loop, delay)
return TrackEntry(fromPointer: result!)
}
public func addAnimation2(_ trackIndex: Int, _ animation: Animation, _ loop: Bool, _ delay: Float) -> TrackEntry {
let result = spine_animation_state_add_animation_2(
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex,
animation._ptr.assumingMemoryBound(to: spine_animation_wrapper.self), loop, delay)
let result = spine_animation_state_add_animation_2(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, animation._ptr.assumingMemoryBound(to: spine_animation_wrapper.self), loop, delay)
return TrackEntry(fromPointer: result!)
}
public func dispose() {
spine_animation_state_dispose(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self))
}
}
}

View File

@ -56,7 +56,7 @@ public class AnimationStateData: NSObject {
public var defaultMix: Float {
get {
let result = spine_animation_state_data_get_default_mix(_ptr.assumingMemoryBound(to: spine_animation_state_data_wrapper.self))
return result
return result
}
set {
spine_animation_state_data_set_default_mix(_ptr.assumingMemoryBound(to: spine_animation_state_data_wrapper.self), newValue)
@ -64,9 +64,7 @@ public class AnimationStateData: NSObject {
}
public func getMix(_ from: Animation, _ to: Animation) -> Float {
let result = spine_animation_state_data_get_mix(
_ptr.assumingMemoryBound(to: spine_animation_state_data_wrapper.self), from._ptr.assumingMemoryBound(to: spine_animation_wrapper.self),
to._ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
let result = spine_animation_state_data_get_mix(_ptr.assumingMemoryBound(to: spine_animation_state_data_wrapper.self), from._ptr.assumingMemoryBound(to: spine_animation_wrapper.self), to._ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
return result
}
@ -79,12 +77,10 @@ public class AnimationStateData: NSObject {
}
public func setMix2(_ from: Animation, _ to: Animation, _ duration: Float) {
spine_animation_state_data_set_mix_2(
_ptr.assumingMemoryBound(to: spine_animation_state_data_wrapper.self), from._ptr.assumingMemoryBound(to: spine_animation_wrapper.self),
to._ptr.assumingMemoryBound(to: spine_animation_wrapper.self), duration)
spine_animation_state_data_set_mix_2(_ptr.assumingMemoryBound(to: spine_animation_state_data_wrapper.self), from._ptr.assumingMemoryBound(to: spine_animation_wrapper.self), to._ptr.assumingMemoryBound(to: spine_animation_wrapper.self), duration)
}
public func dispose() {
spine_animation_state_data_dispose(_ptr.assumingMemoryBound(to: spine_animation_state_data_wrapper.self))
}
}
}

View File

@ -49,44 +49,32 @@ public class AtlasAttachmentLoader: NSObject, AttachmentLoader {
}
public func newRegionAttachment(_ skin: Skin, _ name: String, _ path: String, _ sequence: Sequence?) -> RegionAttachment? {
let result = spine_atlas_attachment_loader_new_region_attachment(
_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self),
name, path, sequence?._ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
let result = spine_atlas_attachment_loader_new_region_attachment(_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name, path, sequence?._ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
return result.map { RegionAttachment(fromPointer: $0) }
}
public func newMeshAttachment(_ skin: Skin, _ name: String, _ path: String, _ sequence: Sequence?) -> MeshAttachment? {
let result = spine_atlas_attachment_loader_new_mesh_attachment(
_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self),
name, path, sequence?._ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
let result = spine_atlas_attachment_loader_new_mesh_attachment(_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name, path, sequence?._ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
return result.map { MeshAttachment(fromPointer: $0) }
}
public func newBoundingBoxAttachment(_ skin: Skin, _ name: String) -> BoundingBoxAttachment? {
let result = spine_atlas_attachment_loader_new_bounding_box_attachment(
_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name
)
let result = spine_atlas_attachment_loader_new_bounding_box_attachment(_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name)
return result.map { BoundingBoxAttachment(fromPointer: $0) }
}
public func newPathAttachment(_ skin: Skin, _ name: String) -> PathAttachment? {
let result = spine_atlas_attachment_loader_new_path_attachment(
_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name
)
let result = spine_atlas_attachment_loader_new_path_attachment(_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name)
return result.map { PathAttachment(fromPointer: $0) }
}
public func newPointAttachment(_ skin: Skin, _ name: String) -> PointAttachment? {
let result = spine_atlas_attachment_loader_new_point_attachment(
_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name
)
let result = spine_atlas_attachment_loader_new_point_attachment(_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name)
return result.map { PointAttachment(fromPointer: $0) }
}
public func newClippingAttachment(_ skin: Skin, _ name: String) -> ClippingAttachment? {
let result = spine_atlas_attachment_loader_new_clipping_attachment(
_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name
)
let result = spine_atlas_attachment_loader_new_clipping_attachment(_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name)
return result.map { ClippingAttachment(fromPointer: $0) }
}
@ -98,4 +86,4 @@ public class AtlasAttachmentLoader: NSObject, AttachmentLoader {
public func dispose() {
spine_atlas_attachment_loader_dispose(_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self))
}
}
}

View File

@ -51,7 +51,7 @@ public class AtlasPage: NSObject {
public var name: String {
get {
let result = spine_atlas_page_get_name(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
return String(cString: result!)
return String(cString: result!)
}
set {
spine_atlas_page_set_name(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), newValue)
@ -61,7 +61,7 @@ public class AtlasPage: NSObject {
public var texturePath: String {
get {
let result = spine_atlas_page_get_texture_path(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
return String(cString: result!)
return String(cString: result!)
}
set {
spine_atlas_page_set_texture_path(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), newValue)
@ -71,62 +71,57 @@ public class AtlasPage: NSObject {
public var format: Format {
get {
let result = spine_atlas_page_get_format(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
return Format(rawValue: Int32(result.rawValue))!
return Format(rawValue: Int32(result.rawValue))!
}
set {
spine_atlas_page_set_format(
_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_format(rawValue: UInt32(newValue.rawValue)))
spine_atlas_page_set_format(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_format(rawValue: UInt32(newValue.rawValue)))
}
}
public var minFilter: TextureFilter {
get {
let result = spine_atlas_page_get_min_filter(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
return TextureFilter(rawValue: Int32(result.rawValue))!
return TextureFilter(rawValue: Int32(result.rawValue))!
}
set {
spine_atlas_page_set_min_filter(
_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_filter(rawValue: UInt32(newValue.rawValue)))
spine_atlas_page_set_min_filter(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_filter(rawValue: UInt32(newValue.rawValue)))
}
}
public var magFilter: TextureFilter {
get {
let result = spine_atlas_page_get_mag_filter(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
return TextureFilter(rawValue: Int32(result.rawValue))!
return TextureFilter(rawValue: Int32(result.rawValue))!
}
set {
spine_atlas_page_set_mag_filter(
_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_filter(rawValue: UInt32(newValue.rawValue)))
spine_atlas_page_set_mag_filter(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_filter(rawValue: UInt32(newValue.rawValue)))
}
}
public var uWrap: TextureWrap {
get {
let result = spine_atlas_page_get_u_wrap(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
return TextureWrap(rawValue: Int32(result.rawValue))!
return TextureWrap(rawValue: Int32(result.rawValue))!
}
set {
spine_atlas_page_set_u_wrap(
_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_wrap(rawValue: UInt32(newValue.rawValue)))
spine_atlas_page_set_u_wrap(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_wrap(rawValue: UInt32(newValue.rawValue)))
}
}
public var vWrap: TextureWrap {
get {
let result = spine_atlas_page_get_v_wrap(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
return TextureWrap(rawValue: Int32(result.rawValue))!
return TextureWrap(rawValue: Int32(result.rawValue))!
}
set {
spine_atlas_page_set_v_wrap(
_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_wrap(rawValue: UInt32(newValue.rawValue)))
spine_atlas_page_set_v_wrap(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_wrap(rawValue: UInt32(newValue.rawValue)))
}
}
public var width: Int32 {
get {
let result = spine_atlas_page_get_width(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
return result
return result
}
set {
spine_atlas_page_set_width(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), newValue)
@ -136,7 +131,7 @@ public class AtlasPage: NSObject {
public var height: Int32 {
get {
let result = spine_atlas_page_get_height(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
return result
return result
}
set {
spine_atlas_page_set_height(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), newValue)
@ -146,7 +141,7 @@ public class AtlasPage: NSObject {
public var pma: Bool {
get {
let result = spine_atlas_page_get_pma(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
return result
return result
}
set {
spine_atlas_page_set_pma(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), newValue)
@ -156,7 +151,7 @@ public class AtlasPage: NSObject {
public var index: Int32 {
get {
let result = spine_atlas_page_get_index(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
return result
return result
}
set {
spine_atlas_page_set_index(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), newValue)
@ -171,4 +166,4 @@ public class AtlasPage: NSObject {
public func dispose() {
spine_atlas_page_dispose(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
}
}
}

View File

@ -49,18 +49,17 @@ public class AtlasRegion: TextureRegion {
public var page: AtlasPage? {
get {
let result = spine_atlas_region_get_page(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
return result.map { AtlasPage(fromPointer: $0) }
return result.map { AtlasPage(fromPointer: $0) }
}
set {
spine_atlas_region_set_page(
_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
spine_atlas_region_set_page(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
}
}
public var name: String {
get {
let result = spine_atlas_region_get_name(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
return String(cString: result!)
return String(cString: result!)
}
set {
spine_atlas_region_set_name(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
@ -70,7 +69,7 @@ public class AtlasRegion: TextureRegion {
public var index: Int32 {
get {
let result = spine_atlas_region_get_index(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
return result
return result
}
set {
spine_atlas_region_set_index(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
@ -80,7 +79,7 @@ public class AtlasRegion: TextureRegion {
public var x: Int32 {
get {
let result = spine_atlas_region_get_x(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
return result
return result
}
set {
spine_atlas_region_set_x(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
@ -90,7 +89,7 @@ public class AtlasRegion: TextureRegion {
public var y: Int32 {
get {
let result = spine_atlas_region_get_y(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
return result
return result
}
set {
spine_atlas_region_set_y(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
@ -100,7 +99,7 @@ public class AtlasRegion: TextureRegion {
public var offsetX: Float {
get {
let result = spine_atlas_region_get_offset_x(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
return result
return result
}
set {
spine_atlas_region_set_offset_x(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
@ -110,7 +109,7 @@ public class AtlasRegion: TextureRegion {
public var offsetY: Float {
get {
let result = spine_atlas_region_get_offset_y(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
return result
return result
}
set {
spine_atlas_region_set_offset_y(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
@ -120,7 +119,7 @@ public class AtlasRegion: TextureRegion {
public var packedWidth: Int32 {
get {
let result = spine_atlas_region_get_packed_width(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
return result
return result
}
set {
spine_atlas_region_set_packed_width(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
@ -130,7 +129,7 @@ public class AtlasRegion: TextureRegion {
public var packedHeight: Int32 {
get {
let result = spine_atlas_region_get_packed_height(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
return result
return result
}
set {
spine_atlas_region_set_packed_height(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
@ -140,7 +139,7 @@ public class AtlasRegion: TextureRegion {
public var originalWidth: Int32 {
get {
let result = spine_atlas_region_get_original_width(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
return result
return result
}
set {
spine_atlas_region_set_original_width(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
@ -150,7 +149,7 @@ public class AtlasRegion: TextureRegion {
public var originalHeight: Int32 {
get {
let result = spine_atlas_region_get_original_height(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
return result
return result
}
set {
spine_atlas_region_set_original_height(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
@ -160,7 +159,7 @@ public class AtlasRegion: TextureRegion {
public var rotate: Bool {
get {
let result = spine_atlas_region_get_rotate(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
return result
return result
}
set {
spine_atlas_region_set_rotate(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
@ -170,7 +169,7 @@ public class AtlasRegion: TextureRegion {
public var degrees: Int32 {
get {
let result = spine_atlas_region_get_degrees(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
return result
return result
}
set {
spine_atlas_region_set_degrees(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
@ -180,37 +179,34 @@ public class AtlasRegion: TextureRegion {
public var splits: ArrayInt {
get {
let result = spine_atlas_region_get_splits(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
return ArrayInt(fromPointer: result!)
return ArrayInt(fromPointer: result!)
}
set {
spine_atlas_region_set_splits(
_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
spine_atlas_region_set_splits(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
}
}
public var pads: ArrayInt {
get {
let result = spine_atlas_region_get_pads(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
return ArrayInt(fromPointer: result!)
return ArrayInt(fromPointer: result!)
}
set {
spine_atlas_region_set_pads(
_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
spine_atlas_region_set_pads(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
}
}
public var values: ArrayFloat {
get {
let result = spine_atlas_region_get_values(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
return ArrayFloat(fromPointer: result!)
return ArrayFloat(fromPointer: result!)
}
set {
spine_atlas_region_set_values(
_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
spine_atlas_region_set_values(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
}
}
public override func dispose() {
spine_atlas_region_dispose(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
}
}
}

View File

@ -41,4 +41,4 @@ public protocol AttachmentLoader {
func newPathAttachment(_ skin: Skin, _ name: String) -> PathAttachment?
func newPointAttachment(_ skin: Skin, _ name: String) -> PointAttachment?
func newClippingAttachment(_ skin: Skin, _ name: String) -> ClippingAttachment?
}
}

View File

@ -49,7 +49,7 @@ public class AttachmentTimeline: Timeline, SlotTimeline {
public var slotIndex: Int32 {
get {
let result = spine_attachment_timeline_get_slot_index(_ptr.assumingMemoryBound(to: spine_attachment_timeline_wrapper.self))
return result
return result
}
set {
spine_attachment_timeline_set_slot_index(_ptr.assumingMemoryBound(to: spine_attachment_timeline_wrapper.self), newValue)
@ -63,4 +63,4 @@ public class AttachmentTimeline: Timeline, SlotTimeline {
public func dispose() {
spine_attachment_timeline_dispose(_ptr.assumingMemoryBound(to: spine_attachment_timeline_wrapper.self))
}
}
}

View File

@ -44,4 +44,4 @@ public enum AttachmentType: Int32, CaseIterable {
public static func fromValue(_ value: Int32) -> AttachmentType? {
return AttachmentType(rawValue: value)
}
}
}

View File

@ -41,4 +41,4 @@ public enum BlendMode: Int32, CaseIterable {
public static func fromValue(_ value: Int32) -> BlendMode? {
return BlendMode(rawValue: value)
}
}
}

View File

@ -59,7 +59,7 @@ public class BoneData: PosedData {
public var length: Float {
get {
let result = spine_bone_data_get_length(_ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
return result
return result
}
set {
spine_bone_data_set_length(_ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self), newValue)
@ -74,7 +74,7 @@ public class BoneData: PosedData {
public var icon: String {
get {
let result = spine_bone_data_get_icon(_ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
return String(cString: result!)
return String(cString: result!)
}
set {
spine_bone_data_set_icon(_ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self), newValue)
@ -84,7 +84,7 @@ public class BoneData: PosedData {
public var visible: Bool {
get {
let result = spine_bone_data_get_visible(_ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
return result
return result
}
set {
spine_bone_data_set_visible(_ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self), newValue)
@ -99,4 +99,4 @@ public class BoneData: PosedData {
public override func dispose() {
spine_bone_data_dispose(_ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
}
}
}

View File

@ -51,7 +51,7 @@ public class BoneLocal: NSObject {
public var x: Float {
get {
let result = spine_bone_local_get_x(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
return result
return result
}
set {
spine_bone_local_set_x(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
@ -61,7 +61,7 @@ public class BoneLocal: NSObject {
public var y: Float {
get {
let result = spine_bone_local_get_y(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
return result
return result
}
set {
spine_bone_local_set_y(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
@ -71,7 +71,7 @@ public class BoneLocal: NSObject {
public var rotation: Float {
get {
let result = spine_bone_local_get_rotation(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
return result
return result
}
set {
spine_bone_local_set_rotation(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
@ -81,7 +81,7 @@ public class BoneLocal: NSObject {
public var scaleX: Float {
get {
let result = spine_bone_local_get_scale_x(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
return result
return result
}
set {
spine_bone_local_set_scale_x(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
@ -91,7 +91,7 @@ public class BoneLocal: NSObject {
public var scaleY: Float {
get {
let result = spine_bone_local_get_scale_y(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
return result
return result
}
set {
spine_bone_local_set_scale_y(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
@ -101,7 +101,7 @@ public class BoneLocal: NSObject {
public var shearX: Float {
get {
let result = spine_bone_local_get_shear_x(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
return result
return result
}
set {
spine_bone_local_set_shear_x(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
@ -111,7 +111,7 @@ public class BoneLocal: NSObject {
public var shearY: Float {
get {
let result = spine_bone_local_get_shear_y(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
return result
return result
}
set {
spine_bone_local_set_shear_y(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
@ -121,11 +121,10 @@ public class BoneLocal: NSObject {
public var inherit: Inherit {
get {
let result = spine_bone_local_get_inherit(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
return Inherit(rawValue: Int32(result.rawValue))!
return Inherit(rawValue: Int32(result.rawValue))!
}
set {
spine_bone_local_set_inherit(
_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), spine_inherit(rawValue: UInt32(newValue.rawValue)))
spine_bone_local_set_inherit(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), spine_inherit(rawValue: UInt32(newValue.rawValue)))
}
}
@ -137,8 +136,7 @@ public class BoneLocal: NSObject {
}
public func set(_ pose: BoneLocal) {
spine_bone_local_set(
_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
spine_bone_local_set(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
}
public func setPosition(_ x: Float, _ y: Float) {
@ -152,4 +150,4 @@ public class BoneLocal: NSObject {
public func dispose() {
spine_bone_local_dispose(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
}
}
}

View File

@ -54,7 +54,7 @@ public class BonePose: BoneLocal, Update {
public var a: Float {
get {
let result = spine_bone_pose_get_a(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
return result
return result
}
set {
spine_bone_pose_set_a(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), newValue)
@ -64,7 +64,7 @@ public class BonePose: BoneLocal, Update {
public var b: Float {
get {
let result = spine_bone_pose_get_b(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
return result
return result
}
set {
spine_bone_pose_set_b(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), newValue)
@ -74,7 +74,7 @@ public class BonePose: BoneLocal, Update {
public var c: Float {
get {
let result = spine_bone_pose_get_c(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
return result
return result
}
set {
spine_bone_pose_set_c(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), newValue)
@ -84,7 +84,7 @@ public class BonePose: BoneLocal, Update {
public var d: Float {
get {
let result = spine_bone_pose_get_d(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
return result
return result
}
set {
spine_bone_pose_set_d(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), newValue)
@ -94,7 +94,7 @@ public class BonePose: BoneLocal, Update {
public var worldX: Float {
get {
let result = spine_bone_pose_get_world_x(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
return result
return result
}
set {
spine_bone_pose_set_world_x(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), newValue)
@ -104,7 +104,7 @@ public class BonePose: BoneLocal, Update {
public var worldY: Float {
get {
let result = spine_bone_pose_get_world_y(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
return result
return result
}
set {
spine_bone_pose_set_world_y(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), newValue)
@ -132,29 +132,23 @@ public class BonePose: BoneLocal, Update {
}
public func update(_ skeleton: Skeleton, _ physics: Physics) {
spine_bone_pose_update(
_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
spine_physics(rawValue: UInt32(physics.rawValue)))
spine_bone_pose_update(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
}
public func updateWorldTransform(_ skeleton: Skeleton) {
spine_bone_pose_update_world_transform(
_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
spine_bone_pose_update_world_transform(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
}
public func updateLocalTransform(_ skeleton: Skeleton) {
spine_bone_pose_update_local_transform(
_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
spine_bone_pose_update_local_transform(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
}
public func validateLocalTransform(_ skeleton: Skeleton) {
spine_bone_pose_validate_local_transform(
_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
spine_bone_pose_validate_local_transform(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
}
public func modifyLocal(_ skeleton: Skeleton) {
spine_bone_pose_modify_local(
_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
spine_bone_pose_modify_local(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
}
public func modifyWorld(_ update: Int32) {
@ -187,4 +181,4 @@ public class BonePose: BoneLocal, Update {
public override func dispose() {
spine_bone_pose_dispose(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
}
}
}

View File

@ -38,4 +38,4 @@ public protocol BoneTimeline {
var rtti: Rtti { get }
var boneIndex: Int32 { get set }
static func rttiStatic() -> Rtti
}
}

View File

@ -44,11 +44,11 @@ open class BoneTimeline1: CurveTimeline1, BoneTimeline {
public var boneIndex: Int32 {
get {
let result = spine_bone_timeline1_get_bone_index(_ptr.assumingMemoryBound(to: spine_bone_timeline1_wrapper.self))
return result
return result
}
set {
spine_bone_timeline1_set_bone_index(_ptr.assumingMemoryBound(to: spine_bone_timeline1_wrapper.self), newValue)
}
}
}
}

View File

@ -44,7 +44,7 @@ open class BoneTimeline2: CurveTimeline, BoneTimeline {
public var boneIndex: Int32 {
get {
let result = spine_bone_timeline2_get_bone_index(_ptr.assumingMemoryBound(to: spine_bone_timeline2_wrapper.self))
return result
return result
}
set {
spine_bone_timeline2_set_bone_index(_ptr.assumingMemoryBound(to: spine_bone_timeline2_wrapper.self), newValue)
@ -55,4 +55,4 @@ open class BoneTimeline2: CurveTimeline, BoneTimeline {
spine_bone_timeline2_set_frame(_ptr.assumingMemoryBound(to: spine_bone_timeline2_wrapper.self), frame, time, value1, value2)
}
}
}

View File

@ -54,4 +54,4 @@ public class BoundingBoxAttachment: VertexAttachment {
public func dispose() {
spine_bounding_box_attachment_dispose(_ptr.assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
}
}
}

View File

@ -49,12 +49,10 @@ public class ClippingAttachment: VertexAttachment {
public var endSlot: SlotData? {
get {
let result = spine_clipping_attachment_get_end_slot(_ptr.assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
return result.map { SlotData(fromPointer: $0) }
return result.map { SlotData(fromPointer: $0) }
}
set {
spine_clipping_attachment_set_end_slot(
_ptr.assumingMemoryBound(to: spine_clipping_attachment_wrapper.self),
newValue?._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
spine_clipping_attachment_set_end_slot(_ptr.assumingMemoryBound(to: spine_clipping_attachment_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
}
}
@ -66,4 +64,4 @@ public class ClippingAttachment: VertexAttachment {
public func dispose() {
spine_clipping_attachment_dispose(_ptr.assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
}
}
}

View File

@ -40,4 +40,4 @@ public protocol ConstraintData {
var skinRequired: Bool { get }
func createMethod(_ skeleton: Skeleton) -> Constraint
static func rttiStatic() -> Rtti
}
}

View File

@ -38,4 +38,4 @@ public protocol ConstraintTimeline {
var rtti: Rtti { get }
var constraintIndex: Int32 { get set }
static func rttiStatic() -> Rtti
}
}

View File

@ -44,11 +44,11 @@ open class ConstraintTimeline1: CurveTimeline1, ConstraintTimeline {
public var constraintIndex: Int32 {
get {
let result = spine_constraint_timeline1_get_constraint_index(_ptr.assumingMemoryBound(to: spine_constraint_timeline1_wrapper.self))
return result
return result
}
set {
spine_constraint_timeline1_set_constraint_index(_ptr.assumingMemoryBound(to: spine_constraint_timeline1_wrapper.self), newValue)
}
}
}
}

View File

@ -60,18 +60,13 @@ open class CurveTimeline: Timeline {
return ArrayFloat(fromPointer: result!)
}
public func setBezier(
_ bezier: Int, _ frame: Int, _ value: Float, _ time1: Float, _ value1: Float, _ cx1: Float, _ cy1: Float, _ cx2: Float, _ cy2: Float,
_ time2: Float, _ value2: Float
) {
spine_curve_timeline_set_bezier(
_ptr.assumingMemoryBound(to: spine_curve_timeline_wrapper.self), bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2)
public func setBezier(_ bezier: Int, _ frame: Int, _ value: Float, _ time1: Float, _ value1: Float, _ cx1: Float, _ cy1: Float, _ cx2: Float, _ cy2: Float, _ time2: Float, _ value2: Float) {
spine_curve_timeline_set_bezier(_ptr.assumingMemoryBound(to: spine_curve_timeline_wrapper.self), bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2)
}
public func getBezierValue(_ time: Float, _ frame: Int, _ valueOffset: Int, _ i: Int) -> Float {
let result = spine_curve_timeline_get_bezier_value(
_ptr.assumingMemoryBound(to: spine_curve_timeline_wrapper.self), time, frame, valueOffset, i)
let result = spine_curve_timeline_get_bezier_value(_ptr.assumingMemoryBound(to: spine_curve_timeline_wrapper.self), time, frame, valueOffset, i)
return result
}
}
}

View File

@ -51,32 +51,23 @@ open class CurveTimeline1: CurveTimeline {
}
public func getRelativeValue(_ time: Float, _ alpha: Float, _ blend: MixBlend, _ current: Float, _ setup: Float) -> Float {
let result = spine_curve_timeline1_get_relative_value(
_ptr.assumingMemoryBound(to: spine_curve_timeline1_wrapper.self), time, alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)), current,
setup)
let result = spine_curve_timeline1_get_relative_value(_ptr.assumingMemoryBound(to: spine_curve_timeline1_wrapper.self), time, alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)), current, setup)
return result
}
public func getScaleValue(_ time: Float, _ alpha: Float, _ blend: MixBlend, _ direction: MixDirection, _ current: Float, _ setup: Float) -> Float
{
let result = spine_curve_timeline1_get_scale_value(
_ptr.assumingMemoryBound(to: spine_curve_timeline1_wrapper.self), time, alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)),
spine_mix_direction(rawValue: UInt32(direction.rawValue)), current, setup)
public func getScaleValue(_ time: Float, _ alpha: Float, _ blend: MixBlend, _ direction: MixDirection, _ current: Float, _ setup: Float) -> Float {
let result = spine_curve_timeline1_get_scale_value(_ptr.assumingMemoryBound(to: spine_curve_timeline1_wrapper.self), time, alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)), spine_mix_direction(rawValue: UInt32(direction.rawValue)), current, setup)
return result
}
public func getAbsoluteValue(_ time: Float, _ alpha: Float, _ blend: MixBlend, _ current: Float, _ setup: Float) -> Float {
let result = spine_curve_timeline1_get_absolute_value_1(
_ptr.assumingMemoryBound(to: spine_curve_timeline1_wrapper.self), time, alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)), current,
setup)
let result = spine_curve_timeline1_get_absolute_value_1(_ptr.assumingMemoryBound(to: spine_curve_timeline1_wrapper.self), time, alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)), current, setup)
return result
}
public func getAbsoluteValue2(_ time: Float, _ alpha: Float, _ blend: MixBlend, _ current: Float, _ setup: Float, _ value: Float) -> Float {
let result = spine_curve_timeline1_get_absolute_value_2(
_ptr.assumingMemoryBound(to: spine_curve_timeline1_wrapper.self), time, alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)), current,
setup, value)
let result = spine_curve_timeline1_get_absolute_value_2(_ptr.assumingMemoryBound(to: spine_curve_timeline1_wrapper.self), time, alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)), current, setup, value)
return result
}
}
}

View File

@ -42,42 +42,35 @@ public class DeformTimeline: SlotCurveTimeline {
}
public convenience init(_ frameCount: Int, _ bezierCount: Int, _ slotIndex: Int32, _ attachment: VertexAttachment) {
let ptr = spine_deform_timeline_create(
frameCount, bezierCount, slotIndex, attachment._ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
let ptr = spine_deform_timeline_create(frameCount, bezierCount, slotIndex, attachment._ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
self.init(fromPointer: ptr!)
}
public var attachment: VertexAttachment {
get {
let result = spine_deform_timeline_get_attachment(_ptr.assumingMemoryBound(to: spine_deform_timeline_wrapper.self))
let rtti = spine_vertex_attachment_get_rtti(result!)
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_bounding_box_attachment":
return BoundingBoxAttachment(
fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
case "spine_clipping_attachment":
return ClippingAttachment(
fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
case "spine_mesh_attachment":
return MeshAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
case "spine_path_attachment":
return PathAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_path_attachment_wrapper.self))
default:
fatalError("Unknown concrete type: \(rttiClassName) for abstract class VertexAttachment")
}
let rtti = spine_vertex_attachment_get_rtti(result!)
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
case "spine_bounding_box_attachment":
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
case "spine_clipping_attachment":
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
case "spine_mesh_attachment":
return MeshAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
case "spine_path_attachment":
return PathAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_path_attachment_wrapper.self))
default:
fatalError("Unknown concrete type: \(rttiClassName) for abstract class VertexAttachment")
}
}
set {
spine_deform_timeline_set_attachment(
_ptr.assumingMemoryBound(to: spine_deform_timeline_wrapper.self),
newValue._ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
spine_deform_timeline_set_attachment(_ptr.assumingMemoryBound(to: spine_deform_timeline_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
}
}
public func setFrame(_ frameIndex: Int32, _ time: Float, _ vertices: ArrayFloat) {
spine_deform_timeline_set_frame(
_ptr.assumingMemoryBound(to: spine_deform_timeline_wrapper.self), frameIndex, time,
vertices._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
spine_deform_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_deform_timeline_wrapper.self), frameIndex, time, vertices._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
}
public func getCurvePercent(_ time: Float, _ frame: Int32) -> Float {
@ -88,4 +81,4 @@ public class DeformTimeline: SlotCurveTimeline {
public func dispose() {
spine_deform_timeline_dispose(_ptr.assumingMemoryBound(to: spine_deform_timeline_wrapper.self))
}
}
}

View File

@ -47,12 +47,10 @@ public class DrawOrderTimeline: Timeline {
}
public func setFrame(_ frame: Int, _ time: Float, _ drawOrder: ArrayInt?) {
spine_draw_order_timeline_set_frame(
_ptr.assumingMemoryBound(to: spine_draw_order_timeline_wrapper.self), frame, time,
drawOrder?._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
spine_draw_order_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_draw_order_timeline_wrapper.self), frame, time, drawOrder?._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
}
public func dispose() {
spine_draw_order_timeline_dispose(_ptr.assumingMemoryBound(to: spine_draw_order_timeline_wrapper.self))
}
}
}

View File

@ -56,7 +56,7 @@ public class EventData: NSObject {
public var intValue: Int32 {
get {
let result = spine_event_data_get_int(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
return result
return result
}
set {
spine_event_data_set_int(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self), newValue)
@ -66,7 +66,7 @@ public class EventData: NSObject {
public var floatValue: Float {
get {
let result = spine_event_data_get_float(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
return result
return result
}
set {
spine_event_data_set_float(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self), newValue)
@ -76,7 +76,7 @@ public class EventData: NSObject {
public var stringValue: String {
get {
let result = spine_event_data_get_string(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
return String(cString: result!)
return String(cString: result!)
}
set {
spine_event_data_set_string(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self), newValue)
@ -86,7 +86,7 @@ public class EventData: NSObject {
public var audioPath: String {
get {
let result = spine_event_data_get_audio_path(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
return String(cString: result!)
return String(cString: result!)
}
set {
spine_event_data_set_audio_path(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self), newValue)
@ -96,7 +96,7 @@ public class EventData: NSObject {
public var volume: Float {
get {
let result = spine_event_data_get_volume(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
return result
return result
}
set {
spine_event_data_set_volume(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self), newValue)
@ -106,7 +106,7 @@ public class EventData: NSObject {
public var balance: Float {
get {
let result = spine_event_data_get_balance(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
return result
return result
}
set {
spine_event_data_set_balance(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self), newValue)
@ -116,4 +116,4 @@ public class EventData: NSObject {
public func dispose() {
spine_event_data_dispose(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
}
}
}

View File

@ -44,47 +44,41 @@ public class EventQueueEntry: NSObject {
}
public convenience init(_ eventType: EventType, _ trackEntry: TrackEntry?, _ event: Event?) {
let ptr = spine_event_queue_entry_create(
spine_event_type(rawValue: UInt32(eventType.rawValue)), trackEntry?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self),
event?._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
let ptr = spine_event_queue_entry_create(spine_event_type(rawValue: UInt32(eventType.rawValue)), trackEntry?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), event?._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
self.init(fromPointer: ptr!)
}
public var type: EventType {
get {
let result = spine_event_queue_entry_get__type(_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self))
return EventType(rawValue: Int32(result.rawValue))!
return EventType(rawValue: Int32(result.rawValue))!
}
set {
spine_event_queue_entry_set__type(
_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self), spine_event_type(rawValue: UInt32(newValue.rawValue)))
spine_event_queue_entry_set__type(_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self), spine_event_type(rawValue: UInt32(newValue.rawValue)))
}
}
public var entry: TrackEntry? {
get {
let result = spine_event_queue_entry_get__entry(_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self))
return result.map { TrackEntry(fromPointer: $0) }
return result.map { TrackEntry(fromPointer: $0) }
}
set {
spine_event_queue_entry_set__entry(
_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self),
newValue?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
spine_event_queue_entry_set__entry(_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
}
}
public var event: Event? {
get {
let result = spine_event_queue_entry_get__event(_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self))
return result.map { Event(fromPointer: $0) }
return result.map { Event(fromPointer: $0) }
}
set {
spine_event_queue_entry_set__event(
_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
spine_event_queue_entry_set__event(_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
}
}
public func dispose() {
spine_event_queue_entry_dispose(_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self))
}
}
}

View File

@ -52,11 +52,10 @@ public class EventTimeline: Timeline {
}
public func setFrame(_ frame: Int, _ event: Event) {
spine_event_timeline_set_frame(
_ptr.assumingMemoryBound(to: spine_event_timeline_wrapper.self), frame, event._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
spine_event_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_event_timeline_wrapper.self), frame, event._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
}
public func dispose() {
spine_event_timeline_dispose(_ptr.assumingMemoryBound(to: spine_event_timeline_wrapper.self))
}
}
}

View File

@ -43,4 +43,4 @@ public enum EventType: Int32, CaseIterable {
public static func fromValue(_ value: Int32) -> EventType? {
return EventType(rawValue: value)
}
}
}

View File

@ -44,4 +44,4 @@ public enum Format: Int32, CaseIterable {
public static func fromValue(_ value: Int32) -> Format? {
return Format(rawValue: value)
}
}
}

View File

@ -51,7 +51,7 @@ open class FromProperty: NSObject {
public var offset: Float {
get {
let result = spine_from_property_get__offset(_ptr.assumingMemoryBound(to: spine_from_property_wrapper.self))
return result
return result
}
set {
spine_from_property_set__offset(_ptr.assumingMemoryBound(to: spine_from_property_wrapper.self), newValue)
@ -61,12 +61,10 @@ open class FromProperty: NSObject {
public var to: ArrayToProperty? {
get {
let result = spine_from_property_get__to(_ptr.assumingMemoryBound(to: spine_from_property_wrapper.self))
return result.map { ArrayToProperty(fromPointer: $0) }
return result.map { ArrayToProperty(fromPointer: $0) }
}
set {
spine_from_property_set__to(
_ptr.assumingMemoryBound(to: spine_from_property_wrapper.self),
newValue?._ptr.assumingMemoryBound(to: spine_array_to_property_wrapper.self))
spine_from_property_set__to(_ptr.assumingMemoryBound(to: spine_from_property_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_array_to_property_wrapper.self))
}
}
@ -75,4 +73,4 @@ open class FromProperty: NSObject {
return Rtti(fromPointer: result!)
}
}
}

View File

@ -49,4 +49,4 @@ public class FromRotate: FromProperty {
public func dispose() {
spine_from_rotate_dispose(_ptr.assumingMemoryBound(to: spine_from_rotate_wrapper.self))
}
}
}

View File

@ -49,4 +49,4 @@ public class FromScaleX: FromProperty {
public func dispose() {
spine_from_scale_x_dispose(_ptr.assumingMemoryBound(to: spine_from_scale_x_wrapper.self))
}
}
}

View File

@ -49,4 +49,4 @@ public class FromScaleY: FromProperty {
public func dispose() {
spine_from_scale_y_dispose(_ptr.assumingMemoryBound(to: spine_from_scale_y_wrapper.self))
}
}
}

View File

@ -49,4 +49,4 @@ public class FromShearY: FromProperty {
public func dispose() {
spine_from_shear_y_dispose(_ptr.assumingMemoryBound(to: spine_from_shear_y_wrapper.self))
}
}
}

View File

@ -49,4 +49,4 @@ public class FromX: FromProperty {
public func dispose() {
spine_from_x_dispose(_ptr.assumingMemoryBound(to: spine_from_x_wrapper.self))
}
}
}

View File

@ -49,4 +49,4 @@ public class FromY: FromProperty {
public func dispose() {
spine_from_y_dispose(_ptr.assumingMemoryBound(to: spine_from_y_wrapper.self))
}
}
}

View File

@ -42,9 +42,7 @@ public class IkConstraint: PosedActive, Posed, Constraint {
}
public convenience init(_ data: IkConstraintData, _ skeleton: Skeleton) {
let ptr = spine_ik_constraint_create(
data._ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self),
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
let ptr = spine_ik_constraint_create(data._ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
self.init(fromPointer: ptr!)
}
@ -71,11 +69,10 @@ public class IkConstraint: PosedActive, Posed, Constraint {
public var target: Bone {
get {
let result = spine_ik_constraint_get_target(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
return Bone(fromPointer: result!)
return Bone(fromPointer: result!)
}
set {
spine_ik_constraint_set_target(
_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
spine_ik_constraint_set_target(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
}
}
@ -95,20 +92,16 @@ public class IkConstraint: PosedActive, Posed, Constraint {
}
public func copyAttachment(_ skeleton: Skeleton) -> IkConstraint {
let result = spine_ik_constraint_copy(
_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
let result = spine_ik_constraint_copy(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
return IkConstraint(fromPointer: result!)
}
public func update(_ skeleton: Skeleton, _ physics: Physics) {
spine_ik_constraint_update(
_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
spine_physics(rawValue: UInt32(physics.rawValue)))
spine_ik_constraint_update(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
}
public func sort(_ skeleton: Skeleton) {
spine_ik_constraint_sort(
_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
spine_ik_constraint_sort(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
}
public func resetConstrained() {
@ -124,24 +117,15 @@ public class IkConstraint: PosedActive, Posed, Constraint {
return Rtti(fromPointer: result!)
}
public static func apply(
_ skeleton: Skeleton, _ bone: BonePose, _ targetX: Float, _ targetY: Float, _ compress: Bool, _ stretch: Bool, _ uniform: Bool, _ mix: Float
) {
spine_ik_constraint_apply_1(
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), bone._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self),
targetX, targetY, compress, stretch, uniform, mix)
public static func apply(_ skeleton: Skeleton, _ bone: BonePose, _ targetX: Float, _ targetY: Float, _ compress: Bool, _ stretch: Bool, _ uniform: Bool, _ mix: Float) {
spine_ik_constraint_apply_1(skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), bone._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), targetX, targetY, compress, stretch, uniform, mix)
}
public static func apply2(
_ skeleton: Skeleton, _ parent: BonePose, _ child: BonePose, _ targetX: Float, _ targetY: Float, _ bendDirection: Int32, _ stretch: Bool,
_ uniform: Bool, _ softness: Float, _ mix: Float
) {
spine_ik_constraint_apply_2(
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), parent._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self),
child._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), targetX, targetY, bendDirection, stretch, uniform, softness, mix)
public static func apply2(_ skeleton: Skeleton, _ parent: BonePose, _ child: BonePose, _ targetX: Float, _ targetY: Float, _ bendDirection: Int32, _ stretch: Bool, _ uniform: Bool, _ softness: Float, _ mix: Float) {
spine_ik_constraint_apply_2(skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), parent._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), child._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), targetX, targetY, bendDirection, stretch, uniform, softness, mix)
}
public override func dispose() {
spine_ik_constraint_dispose(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
}
}
}

View File

@ -59,19 +59,17 @@ public class IkConstraintData: PosedData, ConstraintData {
public var target: BoneData {
get {
let result = spine_ik_constraint_data_get_target(_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self))
return BoneData(fromPointer: result!)
return BoneData(fromPointer: result!)
}
set {
spine_ik_constraint_data_set_target(
_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self),
newValue._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
spine_ik_constraint_data_set_target(_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
}
}
public var uniform: Bool {
get {
let result = spine_ik_constraint_data_get_uniform(_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self))
return result
return result
}
set {
spine_ik_constraint_data_set_uniform(_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self), newValue)
@ -84,8 +82,7 @@ public class IkConstraintData: PosedData, ConstraintData {
}
public func createMethod(_ skeleton: Skeleton) -> Constraint {
let result = spine_ik_constraint_data_create_method(
_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
let result = spine_ik_constraint_data_create_method(_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
let rtti = spine_constraint_get_rtti(result!)
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
@ -112,4 +109,4 @@ public class IkConstraintData: PosedData, ConstraintData {
public override func dispose() {
spine_ik_constraint_data_dispose(_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self))
}
}
}

View File

@ -51,7 +51,7 @@ public class IkConstraintPose: NSObject {
public var mix: Float {
get {
let result = spine_ik_constraint_pose_get_mix(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
return result
return result
}
set {
spine_ik_constraint_pose_set_mix(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self), newValue)
@ -61,7 +61,7 @@ public class IkConstraintPose: NSObject {
public var softness: Float {
get {
let result = spine_ik_constraint_pose_get_softness(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
return result
return result
}
set {
spine_ik_constraint_pose_set_softness(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self), newValue)
@ -71,7 +71,7 @@ public class IkConstraintPose: NSObject {
public var bendDirection: Int32 {
get {
let result = spine_ik_constraint_pose_get_bend_direction(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
return result
return result
}
set {
spine_ik_constraint_pose_set_bend_direction(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self), newValue)
@ -81,7 +81,7 @@ public class IkConstraintPose: NSObject {
public var compress: Bool {
get {
let result = spine_ik_constraint_pose_get_compress(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
return result
return result
}
set {
spine_ik_constraint_pose_set_compress(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self), newValue)
@ -91,7 +91,7 @@ public class IkConstraintPose: NSObject {
public var stretch: Bool {
get {
let result = spine_ik_constraint_pose_get_stretch(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
return result
return result
}
set {
spine_ik_constraint_pose_set_stretch(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self), newValue)
@ -99,12 +99,10 @@ public class IkConstraintPose: NSObject {
}
public func set(_ pose: IkConstraintPose) {
spine_ik_constraint_pose_set(
_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self),
pose._ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
spine_ik_constraint_pose_set(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
}
public func dispose() {
spine_ik_constraint_pose_dispose(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
}
}
}

View File

@ -49,7 +49,7 @@ public class IkConstraintTimeline: CurveTimeline, ConstraintTimeline {
public var constraintIndex: Int32 {
get {
let result = spine_ik_constraint_timeline_get_constraint_index(_ptr.assumingMemoryBound(to: spine_ik_constraint_timeline_wrapper.self))
return result
return result
}
set {
spine_ik_constraint_timeline_set_constraint_index(_ptr.assumingMemoryBound(to: spine_ik_constraint_timeline_wrapper.self), newValue)
@ -57,11 +57,10 @@ public class IkConstraintTimeline: CurveTimeline, ConstraintTimeline {
}
public func setFrame(_ frame: Int32, _ time: Float, _ mix: Float, _ softness: Float, _ bendDirection: Int32, _ compress: Bool, _ stretch: Bool) {
spine_ik_constraint_timeline_set_frame(
_ptr.assumingMemoryBound(to: spine_ik_constraint_timeline_wrapper.self), frame, time, mix, softness, bendDirection, compress, stretch)
spine_ik_constraint_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_ik_constraint_timeline_wrapper.self), frame, time, mix, softness, bendDirection, compress, stretch)
}
public func dispose() {
spine_ik_constraint_timeline_dispose(_ptr.assumingMemoryBound(to: spine_ik_constraint_timeline_wrapper.self))
}
}
}

View File

@ -42,4 +42,4 @@ public enum Inherit: Int32, CaseIterable {
public static func fromValue(_ value: Int32) -> Inherit? {
return Inherit(rawValue: value)
}
}
}

View File

@ -49,7 +49,7 @@ public class InheritTimeline: Timeline, BoneTimeline {
public var boneIndex: Int32 {
get {
let result = spine_inherit_timeline_get_bone_index(_ptr.assumingMemoryBound(to: spine_inherit_timeline_wrapper.self))
return result
return result
}
set {
spine_inherit_timeline_set_bone_index(_ptr.assumingMemoryBound(to: spine_inherit_timeline_wrapper.self), newValue)
@ -57,11 +57,10 @@ public class InheritTimeline: Timeline, BoneTimeline {
}
public func setFrame(_ frame: Int32, _ time: Float, _ inherit: Inherit) {
spine_inherit_timeline_set_frame(
_ptr.assumingMemoryBound(to: spine_inherit_timeline_wrapper.self), frame, time, spine_inherit(rawValue: UInt32(inherit.rawValue)))
spine_inherit_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_inherit_timeline_wrapper.self), frame, time, spine_inherit(rawValue: UInt32(inherit.rawValue)))
}
public func dispose() {
spine_inherit_timeline_dispose(_ptr.assumingMemoryBound(to: spine_inherit_timeline_wrapper.self))
}
}
}

View File

@ -35,4 +35,4 @@ import SpineC
/// LinkedMesh wrapper
public protocol LinkedMesh {
var _ptr: UnsafeMutableRawPointer { get }
}
}

View File

@ -49,7 +49,7 @@ public class MeshAttachment: VertexAttachment {
public var hullLength: Int32 {
get {
let result = spine_mesh_attachment_get_hull_length(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
return result
return result
}
set {
spine_mesh_attachment_set_hull_length(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue)
@ -59,12 +59,10 @@ public class MeshAttachment: VertexAttachment {
public var regionUVs: ArrayFloat {
get {
let result = spine_mesh_attachment_get_region_u_vs(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
return ArrayFloat(fromPointer: result!)
return ArrayFloat(fromPointer: result!)
}
set {
spine_mesh_attachment_set_region_u_vs(
_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self),
newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
spine_mesh_attachment_set_region_u_vs(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
}
}
@ -76,12 +74,10 @@ public class MeshAttachment: VertexAttachment {
public var triangles: ArrayUnsignedShort {
get {
let result = spine_mesh_attachment_get_triangles(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
return ArrayUnsignedShort(fromPointer: result!)
return ArrayUnsignedShort(fromPointer: result!)
}
set {
spine_mesh_attachment_set_triangles(
_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self),
newValue._ptr.assumingMemoryBound(to: spine_array_unsigned_short_wrapper.self))
spine_mesh_attachment_set_triangles(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_unsigned_short_wrapper.self))
}
}
@ -93,7 +89,7 @@ public class MeshAttachment: VertexAttachment {
public var path: String {
get {
let result = spine_mesh_attachment_get_path(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
return String(cString: result!)
return String(cString: result!)
}
set {
spine_mesh_attachment_set_path(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue)
@ -103,54 +99,47 @@ public class MeshAttachment: VertexAttachment {
public var region: TextureRegion? {
get {
let result = spine_mesh_attachment_get_region(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
return result.map { TextureRegion(fromPointer: $0) }
return result.map { TextureRegion(fromPointer: $0) }
}
set {
spine_mesh_attachment_set_region(
_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self),
newValue?._ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
spine_mesh_attachment_set_region(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
}
}
public var sequence: Sequence? {
get {
let result = spine_mesh_attachment_get_sequence(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
return result.map { Sequence(fromPointer: $0) }
return result.map { Sequence(fromPointer: $0) }
}
set {
spine_mesh_attachment_set_sequence(
_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
spine_mesh_attachment_set_sequence(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
}
}
public var parentMesh: MeshAttachment? {
get {
let result = spine_mesh_attachment_get_parent_mesh(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
return result.map { MeshAttachment(fromPointer: $0) }
return result.map { MeshAttachment(fromPointer: $0) }
}
set {
spine_mesh_attachment_set_parent_mesh(
_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self),
newValue?._ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
spine_mesh_attachment_set_parent_mesh(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
}
}
public var edges: ArrayUnsignedShort {
get {
let result = spine_mesh_attachment_get_edges(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
return ArrayUnsignedShort(fromPointer: result!)
return ArrayUnsignedShort(fromPointer: result!)
}
set {
spine_mesh_attachment_set_edges(
_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self),
newValue._ptr.assumingMemoryBound(to: spine_array_unsigned_short_wrapper.self))
spine_mesh_attachment_set_edges(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_unsigned_short_wrapper.self))
}
}
public var width: Float {
get {
let result = spine_mesh_attachment_get_width(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
return result
return result
}
set {
spine_mesh_attachment_set_width(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue)
@ -160,7 +149,7 @@ public class MeshAttachment: VertexAttachment {
public var height: Float {
get {
let result = spine_mesh_attachment_get_height(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
return result
return result
}
set {
spine_mesh_attachment_set_height(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue)
@ -179,4 +168,4 @@ public class MeshAttachment: VertexAttachment {
public func dispose() {
spine_mesh_attachment_dispose(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
}
}
}

View File

@ -41,4 +41,4 @@ public enum MixBlend: Int32, CaseIterable {
public static func fromValue(_ value: Int32) -> MixBlend? {
return MixBlend(rawValue: value)
}
}
}

View File

@ -39,4 +39,4 @@ public enum MixDirection: Int32, CaseIterable {
public static func fromValue(_ value: Int32) -> MixDirection? {
return MixDirection(rawValue: value)
}
}
}

View File

@ -49,19 +49,17 @@ public class PathAttachment: VertexAttachment {
public var lengths: ArrayFloat {
get {
let result = spine_path_attachment_get_lengths(_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self))
return ArrayFloat(fromPointer: result!)
return ArrayFloat(fromPointer: result!)
}
set {
spine_path_attachment_set_lengths(
_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self),
newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
spine_path_attachment_set_lengths(_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
}
}
public var closed: Bool {
get {
let result = spine_path_attachment_get_closed(_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self))
return result
return result
}
set {
spine_path_attachment_set_closed(_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self), newValue)
@ -71,7 +69,7 @@ public class PathAttachment: VertexAttachment {
public var constantSpeed: Bool {
get {
let result = spine_path_attachment_get_constant_speed(_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self))
return result
return result
}
set {
spine_path_attachment_set_constant_speed(_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self), newValue)
@ -86,4 +84,4 @@ public class PathAttachment: VertexAttachment {
public func dispose() {
spine_path_attachment_dispose(_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self))
}
}
}

View File

@ -42,9 +42,7 @@ public class PathConstraint: PosedActive, Posed, Constraint {
}
public convenience init(_ data: PathConstraintData, _ skeleton: Skeleton) {
let ptr = spine_path_constraint_create(
data._ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self),
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
let ptr = spine_path_constraint_create(data._ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
self.init(fromPointer: ptr!)
}
@ -66,11 +64,10 @@ public class PathConstraint: PosedActive, Posed, Constraint {
public var slot: Slot {
get {
let result = spine_path_constraint_get_slot(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self))
return Slot(fromPointer: result!)
return Slot(fromPointer: result!)
}
set {
spine_path_constraint_set_slot(
_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_slot_wrapper.self))
spine_path_constraint_set_slot(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_slot_wrapper.self))
}
}
@ -95,20 +92,16 @@ public class PathConstraint: PosedActive, Posed, Constraint {
}
public func copyAttachment(_ skeleton: Skeleton) -> PathConstraint {
let result = spine_path_constraint_copy(
_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
let result = spine_path_constraint_copy(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
return PathConstraint(fromPointer: result!)
}
public func update(_ skeleton: Skeleton, _ physics: Physics) {
spine_path_constraint_update(
_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
spine_physics(rawValue: UInt32(physics.rawValue)))
spine_path_constraint_update(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
}
public func sort(_ skeleton: Skeleton) {
spine_path_constraint_sort(
_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
spine_path_constraint_sort(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
}
public func resetConstrained() {
@ -127,4 +120,4 @@ public class PathConstraint: PosedActive, Posed, Constraint {
public override func dispose() {
spine_path_constraint_dispose(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self))
}
}
}

View File

@ -59,52 +59,47 @@ public class PathConstraintData: PosedData, ConstraintData {
public var slot: SlotData {
get {
let result = spine_path_constraint_data_get_slot(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
return SlotData(fromPointer: result!)
return SlotData(fromPointer: result!)
}
set {
spine_path_constraint_data_set_slot(
_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self),
newValue._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
spine_path_constraint_data_set_slot(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
}
}
public var positionMode: PositionMode {
get {
let result = spine_path_constraint_data_get_position_mode(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
return PositionMode(rawValue: Int32(result.rawValue))!
return PositionMode(rawValue: Int32(result.rawValue))!
}
set {
spine_path_constraint_data_set_position_mode(
_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), spine_position_mode(rawValue: UInt32(newValue.rawValue)))
spine_path_constraint_data_set_position_mode(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), spine_position_mode(rawValue: UInt32(newValue.rawValue)))
}
}
public var spacingMode: SpacingMode {
get {
let result = spine_path_constraint_data_get_spacing_mode(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
return SpacingMode(rawValue: Int32(result.rawValue))!
return SpacingMode(rawValue: Int32(result.rawValue))!
}
set {
spine_path_constraint_data_set_spacing_mode(
_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), spine_spacing_mode(rawValue: UInt32(newValue.rawValue)))
spine_path_constraint_data_set_spacing_mode(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), spine_spacing_mode(rawValue: UInt32(newValue.rawValue)))
}
}
public var rotateMode: RotateMode {
get {
let result = spine_path_constraint_data_get_rotate_mode(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
return RotateMode(rawValue: Int32(result.rawValue))!
return RotateMode(rawValue: Int32(result.rawValue))!
}
set {
spine_path_constraint_data_set_rotate_mode(
_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), spine_rotate_mode(rawValue: UInt32(newValue.rawValue)))
spine_path_constraint_data_set_rotate_mode(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), spine_rotate_mode(rawValue: UInt32(newValue.rawValue)))
}
}
public var offsetRotation: Float {
get {
let result = spine_path_constraint_data_get_offset_rotation(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
return result
return result
}
set {
spine_path_constraint_data_set_offset_rotation(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), newValue)
@ -117,8 +112,7 @@ public class PathConstraintData: PosedData, ConstraintData {
}
public func createMethod(_ skeleton: Skeleton) -> Constraint {
let result = spine_path_constraint_data_create_method(
_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
let result = spine_path_constraint_data_create_method(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
let rtti = spine_constraint_get_rtti(result!)
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
@ -145,4 +139,4 @@ public class PathConstraintData: PosedData, ConstraintData {
public override func dispose() {
spine_path_constraint_data_dispose(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
}
}
}

View File

@ -48,22 +48,19 @@ public class PathConstraintMixTimeline: CurveTimeline, ConstraintTimeline {
public var constraintIndex: Int32 {
get {
let result = spine_path_constraint_mix_timeline_get_constraint_index(
_ptr.assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self))
return result
let result = spine_path_constraint_mix_timeline_get_constraint_index(_ptr.assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self))
return result
}
set {
spine_path_constraint_mix_timeline_set_constraint_index(
_ptr.assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self), newValue)
spine_path_constraint_mix_timeline_set_constraint_index(_ptr.assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self), newValue)
}
}
public func setFrame(_ frame: Int32, _ time: Float, _ mixRotate: Float, _ mixX: Float, _ mixY: Float) {
spine_path_constraint_mix_timeline_set_frame(
_ptr.assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self), frame, time, mixRotate, mixX, mixY)
spine_path_constraint_mix_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self), frame, time, mixRotate, mixX, mixY)
}
public func dispose() {
spine_path_constraint_mix_timeline_dispose(_ptr.assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self))
}
}
}

View File

@ -51,7 +51,7 @@ public class PathConstraintPose: NSObject {
public var position: Float {
get {
let result = spine_path_constraint_pose_get_position(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
return result
return result
}
set {
spine_path_constraint_pose_set_position(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self), newValue)
@ -61,7 +61,7 @@ public class PathConstraintPose: NSObject {
public var spacing: Float {
get {
let result = spine_path_constraint_pose_get_spacing(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
return result
return result
}
set {
spine_path_constraint_pose_set_spacing(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self), newValue)
@ -71,7 +71,7 @@ public class PathConstraintPose: NSObject {
public var mixRotate: Float {
get {
let result = spine_path_constraint_pose_get_mix_rotate(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
return result
return result
}
set {
spine_path_constraint_pose_set_mix_rotate(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self), newValue)
@ -81,7 +81,7 @@ public class PathConstraintPose: NSObject {
public var mixX: Float {
get {
let result = spine_path_constraint_pose_get_mix_x(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
return result
return result
}
set {
spine_path_constraint_pose_set_mix_x(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self), newValue)
@ -91,7 +91,7 @@ public class PathConstraintPose: NSObject {
public var mixY: Float {
get {
let result = spine_path_constraint_pose_get_mix_y(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
return result
return result
}
set {
spine_path_constraint_pose_set_mix_y(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self), newValue)
@ -99,12 +99,10 @@ public class PathConstraintPose: NSObject {
}
public func set(_ pose: PathConstraintPose) {
spine_path_constraint_pose_set(
_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self),
pose._ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
spine_path_constraint_pose_set(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
}
public func dispose() {
spine_path_constraint_pose_dispose(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
}
}
}

View File

@ -49,4 +49,4 @@ public class PathConstraintPositionTimeline: ConstraintTimeline1 {
public func dispose() {
spine_path_constraint_position_timeline_dispose(_ptr.assumingMemoryBound(to: spine_path_constraint_position_timeline_wrapper.self))
}
}
}

View File

@ -49,4 +49,4 @@ public class PathConstraintSpacingTimeline: ConstraintTimeline1 {
public func dispose() {
spine_path_constraint_spacing_timeline_dispose(_ptr.assumingMemoryBound(to: spine_path_constraint_spacing_timeline_wrapper.self))
}
}
}

View File

@ -41,4 +41,4 @@ public enum Physics: Int32, CaseIterable {
public static func fromValue(_ value: Int32) -> Physics? {
return Physics(rawValue: value)
}
}
}

View File

@ -42,9 +42,7 @@ public class PhysicsConstraint: PosedActive, Posed, Constraint {
}
public convenience init(_ data: PhysicsConstraintData, _ skeleton: Skeleton) {
let ptr = spine_physics_constraint_create(
data._ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self),
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
let ptr = spine_physics_constraint_create(data._ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
self.init(fromPointer: ptr!)
}
@ -61,12 +59,10 @@ public class PhysicsConstraint: PosedActive, Posed, Constraint {
public var bone: BonePose {
get {
let result = spine_physics_constraint_get_bone(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
return BonePose(fromPointer: result!)
return BonePose(fromPointer: result!)
}
set {
spine_physics_constraint_set_bone(
_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self),
newValue._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
spine_physics_constraint_set_bone(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
}
}
@ -91,25 +87,20 @@ public class PhysicsConstraint: PosedActive, Posed, Constraint {
}
public func update(_ skeleton: Skeleton, _ physics: Physics) {
spine_physics_constraint_update(
_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
spine_physics(rawValue: UInt32(physics.rawValue)))
spine_physics_constraint_update(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
}
public func sort(_ skeleton: Skeleton) {
spine_physics_constraint_sort(
_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
spine_physics_constraint_sort(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
}
public func copyAttachment(_ skeleton: Skeleton) -> PhysicsConstraint {
let result = spine_physics_constraint_copy(
_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
let result = spine_physics_constraint_copy(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
return PhysicsConstraint(fromPointer: result!)
}
public func reset(_ skeleton: Skeleton) {
spine_physics_constraint_reset(
_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
spine_physics_constraint_reset(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
}
public func translate(_ x: Float, _ y: Float) {
@ -136,4 +127,4 @@ public class PhysicsConstraint: PosedActive, Posed, Constraint {
public override func dispose() {
spine_physics_constraint_dispose(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
}
}
}

View File

@ -49,4 +49,4 @@ public class PhysicsConstraintDampingTimeline: PhysicsConstraintTimeline {
public func dispose() {
spine_physics_constraint_damping_timeline_dispose(_ptr.assumingMemoryBound(to: spine_physics_constraint_damping_timeline_wrapper.self))
}
}
}

View File

@ -54,19 +54,17 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
public var bone: BoneData {
get {
let result = spine_physics_constraint_data_get_bone(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
return BoneData(fromPointer: result!)
return BoneData(fromPointer: result!)
}
set {
spine_physics_constraint_data_set_bone(
_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self),
newValue._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
spine_physics_constraint_data_set_bone(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
}
}
public var step: Float {
get {
let result = spine_physics_constraint_data_get_step(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_data_set_step(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
@ -76,7 +74,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
public var x: Float {
get {
let result = spine_physics_constraint_data_get_x(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_data_set_x(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
@ -86,7 +84,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
public var y: Float {
get {
let result = spine_physics_constraint_data_get_y(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_data_set_y(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
@ -96,7 +94,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
public var rotate: Float {
get {
let result = spine_physics_constraint_data_get_rotate(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_data_set_rotate(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
@ -106,7 +104,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
public var scaleX: Float {
get {
let result = spine_physics_constraint_data_get_scale_x(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_data_set_scale_x(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
@ -116,7 +114,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
public var shearX: Float {
get {
let result = spine_physics_constraint_data_get_shear_x(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_data_set_shear_x(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
@ -126,7 +124,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
public var limit: Float {
get {
let result = spine_physics_constraint_data_get_limit(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_data_set_limit(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
@ -136,7 +134,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
public var inertiaGlobal: Bool {
get {
let result = spine_physics_constraint_data_get_inertia_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_data_set_inertia_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
@ -146,7 +144,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
public var strengthGlobal: Bool {
get {
let result = spine_physics_constraint_data_get_strength_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_data_set_strength_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
@ -156,7 +154,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
public var dampingGlobal: Bool {
get {
let result = spine_physics_constraint_data_get_damping_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_data_set_damping_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
@ -166,7 +164,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
public var massGlobal: Bool {
get {
let result = spine_physics_constraint_data_get_mass_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_data_set_mass_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
@ -176,7 +174,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
public var windGlobal: Bool {
get {
let result = spine_physics_constraint_data_get_wind_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_data_set_wind_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
@ -186,7 +184,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
public var gravityGlobal: Bool {
get {
let result = spine_physics_constraint_data_get_gravity_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_data_set_gravity_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
@ -196,7 +194,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
public var mixGlobal: Bool {
get {
let result = spine_physics_constraint_data_get_mix_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_data_set_mix_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
@ -209,9 +207,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
}
public func createMethod(_ skeleton: Skeleton) -> Constraint {
let result = spine_physics_constraint_data_create_method(
_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self),
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
let result = spine_physics_constraint_data_create_method(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
let rtti = spine_constraint_get_rtti(result!)
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
switch rttiClassName {
@ -238,4 +234,4 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
public override func dispose() {
spine_physics_constraint_data_dispose(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
}
}
}

View File

@ -49,4 +49,4 @@ public class PhysicsConstraintGravityTimeline: PhysicsConstraintTimeline {
public func dispose() {
spine_physics_constraint_gravity_timeline_dispose(_ptr.assumingMemoryBound(to: spine_physics_constraint_gravity_timeline_wrapper.self))
}
}
}

View File

@ -49,4 +49,4 @@ public class PhysicsConstraintInertiaTimeline: PhysicsConstraintTimeline {
public func dispose() {
spine_physics_constraint_inertia_timeline_dispose(_ptr.assumingMemoryBound(to: spine_physics_constraint_inertia_timeline_wrapper.self))
}
}
}

View File

@ -49,4 +49,4 @@ public class PhysicsConstraintMassTimeline: PhysicsConstraintTimeline {
public func dispose() {
spine_physics_constraint_mass_timeline_dispose(_ptr.assumingMemoryBound(to: spine_physics_constraint_mass_timeline_wrapper.self))
}
}
}

View File

@ -49,4 +49,4 @@ public class PhysicsConstraintMixTimeline: PhysicsConstraintTimeline {
public func dispose() {
spine_physics_constraint_mix_timeline_dispose(_ptr.assumingMemoryBound(to: spine_physics_constraint_mix_timeline_wrapper.self))
}
}
}

View File

@ -51,7 +51,7 @@ public class PhysicsConstraintPose: NSObject {
public var inertia: Float {
get {
let result = spine_physics_constraint_pose_get_inertia(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_pose_set_inertia(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
@ -61,7 +61,7 @@ public class PhysicsConstraintPose: NSObject {
public var strength: Float {
get {
let result = spine_physics_constraint_pose_get_strength(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_pose_set_strength(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
@ -71,7 +71,7 @@ public class PhysicsConstraintPose: NSObject {
public var damping: Float {
get {
let result = spine_physics_constraint_pose_get_damping(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_pose_set_damping(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
@ -81,7 +81,7 @@ public class PhysicsConstraintPose: NSObject {
public var massInverse: Float {
get {
let result = spine_physics_constraint_pose_get_mass_inverse(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_pose_set_mass_inverse(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
@ -91,7 +91,7 @@ public class PhysicsConstraintPose: NSObject {
public var wind: Float {
get {
let result = spine_physics_constraint_pose_get_wind(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_pose_set_wind(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
@ -101,7 +101,7 @@ public class PhysicsConstraintPose: NSObject {
public var gravity: Float {
get {
let result = spine_physics_constraint_pose_get_gravity(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_pose_set_gravity(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
@ -111,7 +111,7 @@ public class PhysicsConstraintPose: NSObject {
public var mix: Float {
get {
let result = spine_physics_constraint_pose_get_mix(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
return result
return result
}
set {
spine_physics_constraint_pose_set_mix(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
@ -119,12 +119,10 @@ public class PhysicsConstraintPose: NSObject {
}
public func set(_ pose: PhysicsConstraintPose) {
spine_physics_constraint_pose_set(
_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self),
pose._ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
spine_physics_constraint_pose_set(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
}
public func dispose() {
spine_physics_constraint_pose_dispose(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
}
}
}

View File

@ -48,22 +48,19 @@ public class PhysicsConstraintResetTimeline: Timeline, ConstraintTimeline {
public var constraintIndex: Int32 {
get {
let result = spine_physics_constraint_reset_timeline_get_constraint_index(
_ptr.assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self))
return result
let result = spine_physics_constraint_reset_timeline_get_constraint_index(_ptr.assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self))
return result
}
set {
spine_physics_constraint_reset_timeline_set_constraint_index(
_ptr.assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self), newValue)
spine_physics_constraint_reset_timeline_set_constraint_index(_ptr.assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self), newValue)
}
}
public func setFrame(_ frame: Int32, _ time: Float) {
spine_physics_constraint_reset_timeline_set_frame(
_ptr.assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self), frame, time)
spine_physics_constraint_reset_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self), frame, time)
}
public func dispose() {
spine_physics_constraint_reset_timeline_dispose(_ptr.assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self))
}
}
}

View File

@ -49,4 +49,4 @@ public class PhysicsConstraintStrengthTimeline: PhysicsConstraintTimeline {
public func dispose() {
spine_physics_constraint_strength_timeline_dispose(_ptr.assumingMemoryBound(to: spine_physics_constraint_strength_timeline_wrapper.self))
}
}
}

View File

@ -43,14 +43,12 @@ open class PhysicsConstraintTimeline: CurveTimeline1, ConstraintTimeline {
public var constraintIndex: Int32 {
get {
let result = spine_physics_constraint_timeline_get_constraint_index(
_ptr.assumingMemoryBound(to: spine_physics_constraint_timeline_wrapper.self))
return result
let result = spine_physics_constraint_timeline_get_constraint_index(_ptr.assumingMemoryBound(to: spine_physics_constraint_timeline_wrapper.self))
return result
}
set {
spine_physics_constraint_timeline_set_constraint_index(
_ptr.assumingMemoryBound(to: spine_physics_constraint_timeline_wrapper.self), newValue)
spine_physics_constraint_timeline_set_constraint_index(_ptr.assumingMemoryBound(to: spine_physics_constraint_timeline_wrapper.self), newValue)
}
}
}
}

View File

@ -49,4 +49,4 @@ public class PhysicsConstraintWindTimeline: PhysicsConstraintTimeline {
public func dispose() {
spine_physics_constraint_wind_timeline_dispose(_ptr.assumingMemoryBound(to: spine_physics_constraint_wind_timeline_wrapper.self))
}
}
}

View File

@ -49,7 +49,7 @@ public class PointAttachment: Attachment {
public var x: Float {
get {
let result = spine_point_attachment_get_x(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self))
return result
return result
}
set {
spine_point_attachment_set_x(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self), newValue)
@ -59,7 +59,7 @@ public class PointAttachment: Attachment {
public var y: Float {
get {
let result = spine_point_attachment_get_y(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self))
return result
return result
}
set {
spine_point_attachment_set_y(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self), newValue)
@ -69,7 +69,7 @@ public class PointAttachment: Attachment {
public var rotation: Float {
get {
let result = spine_point_attachment_get_rotation(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self))
return result
return result
}
set {
spine_point_attachment_set_rotation(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self), newValue)
@ -82,12 +82,11 @@ public class PointAttachment: Attachment {
}
public func computeWorldRotation(_ bone: BonePose) -> Float {
let result = spine_point_attachment_compute_world_rotation(
_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self), bone._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
let result = spine_point_attachment_compute_world_rotation(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self), bone._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
return result
}
public func dispose() {
spine_point_attachment_dispose(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self))
}
}
}

View File

@ -58,4 +58,4 @@ public class PosedActive: NSObject {
public func dispose() {
spine_posed_active_dispose(_ptr.assumingMemoryBound(to: spine_posed_active_wrapper.self))
}
}
}

View File

@ -56,7 +56,7 @@ public class PosedData: NSObject {
public var skinRequired: Bool {
get {
let result = spine_posed_data_get_skin_required(_ptr.assumingMemoryBound(to: spine_posed_data_wrapper.self))
return result
return result
}
set {
spine_posed_data_set_skin_required(_ptr.assumingMemoryBound(to: spine_posed_data_wrapper.self), newValue)
@ -66,4 +66,4 @@ public class PosedData: NSObject {
public func dispose() {
spine_posed_data_dispose(_ptr.assumingMemoryBound(to: spine_posed_data_wrapper.self))
}
}
}

View File

@ -39,4 +39,4 @@ public enum PositionMode: Int32, CaseIterable {
public static func fromValue(_ value: Int32) -> PositionMode? {
return PositionMode(rawValue: value)
}
}
}

View File

@ -53,19 +53,19 @@ public enum Property: Int32, CaseIterable {
case pathConstraintPosition = 131072
case pathConstraintSpacing = 262144
case pathConstraintMix = 524288
case physicsConstraintInertia = 1_048_576
case physicsConstraintStrength = 2_097_152
case physicsConstraintDamping = 4_194_304
case physicsConstraintMass = 8_388_608
case physicsConstraintWind = 16_777_216
case physicsConstraintGravity = 33_554_432
case physicsConstraintMix = 67_108_864
case physicsConstraintReset = 134_217_728
case sequence = 268_435_456
case sliderTime = 536_870_912
case sliderMix = 1_073_741_824
case physicsConstraintInertia = 1048576
case physicsConstraintStrength = 2097152
case physicsConstraintDamping = 4194304
case physicsConstraintMass = 8388608
case physicsConstraintWind = 16777216
case physicsConstraintGravity = 33554432
case physicsConstraintMix = 67108864
case physicsConstraintReset = 134217728
case sequence = 268435456
case sliderTime = 536870912
case sliderMix = 1073741824
public static func fromValue(_ value: Int32) -> Property? {
return Property(rawValue: value)
}
}
}

View File

@ -49,7 +49,7 @@ public class RegionAttachment: Attachment {
public var x: Float {
get {
let result = spine_region_attachment_get_x(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
return result
return result
}
set {
spine_region_attachment_set_x(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
@ -59,7 +59,7 @@ public class RegionAttachment: Attachment {
public var y: Float {
get {
let result = spine_region_attachment_get_y(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
return result
return result
}
set {
spine_region_attachment_set_y(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
@ -69,7 +69,7 @@ public class RegionAttachment: Attachment {
public var rotation: Float {
get {
let result = spine_region_attachment_get_rotation(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
return result
return result
}
set {
spine_region_attachment_set_rotation(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
@ -79,7 +79,7 @@ public class RegionAttachment: Attachment {
public var scaleX: Float {
get {
let result = spine_region_attachment_get_scale_x(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
return result
return result
}
set {
spine_region_attachment_set_scale_x(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
@ -89,7 +89,7 @@ public class RegionAttachment: Attachment {
public var scaleY: Float {
get {
let result = spine_region_attachment_get_scale_y(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
return result
return result
}
set {
spine_region_attachment_set_scale_y(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
@ -99,7 +99,7 @@ public class RegionAttachment: Attachment {
public var width: Float {
get {
let result = spine_region_attachment_get_width(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
return result
return result
}
set {
spine_region_attachment_set_width(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
@ -109,7 +109,7 @@ public class RegionAttachment: Attachment {
public var height: Float {
get {
let result = spine_region_attachment_get_height(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
return result
return result
}
set {
spine_region_attachment_set_height(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
@ -124,7 +124,7 @@ public class RegionAttachment: Attachment {
public var path: String {
get {
let result = spine_region_attachment_get_path(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
return String(cString: result!)
return String(cString: result!)
}
set {
spine_region_attachment_set_path(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
@ -134,24 +134,20 @@ public class RegionAttachment: Attachment {
public var region: TextureRegion? {
get {
let result = spine_region_attachment_get_region(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
return result.map { TextureRegion(fromPointer: $0) }
return result.map { TextureRegion(fromPointer: $0) }
}
set {
spine_region_attachment_set_region(
_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self),
newValue?._ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
spine_region_attachment_set_region(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
}
}
public var sequence: Sequence? {
get {
let result = spine_region_attachment_get_sequence(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
return result.map { Sequence(fromPointer: $0) }
return result.map { Sequence(fromPointer: $0) }
}
set {
spine_region_attachment_set_sequence(
_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self),
newValue?._ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
spine_region_attachment_set_sequence(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
}
}
@ -170,12 +166,10 @@ public class RegionAttachment: Attachment {
}
public func computeWorldVertices(_ slot: Slot, _ worldVertices: ArrayFloat, _ offset: Int, _ stride: Int) {
spine_region_attachment_compute_world_vertices_2(
_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), slot._ptr.assumingMemoryBound(to: spine_slot_wrapper.self),
worldVertices._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self), offset, stride)
spine_region_attachment_compute_world_vertices_2(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), slot._ptr.assumingMemoryBound(to: spine_slot_wrapper.self), worldVertices._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self), offset, stride)
}
public func dispose() {
spine_region_attachment_dispose(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
}
}
}

View File

@ -96,4 +96,4 @@ public class RenderCommand: NSObject {
public func dispose() {
spine_render_command_dispose(_ptr.assumingMemoryBound(to: spine_render_command_wrapper.self))
}
}
}

View File

@ -53,4 +53,4 @@ public class Rgb2Timeline: SlotCurveTimeline {
public func dispose() {
spine_rgb2_timeline_dispose(_ptr.assumingMemoryBound(to: spine_rgb2_timeline_wrapper.self))
}
}
}

View File

@ -53,4 +53,4 @@ public class RgbTimeline: SlotCurveTimeline {
public func dispose() {
spine_rgb_timeline_dispose(_ptr.assumingMemoryBound(to: spine_rgb_timeline_wrapper.self))
}
}
}

View File

@ -53,4 +53,4 @@ public class Rgba2Timeline: SlotCurveTimeline {
public func dispose() {
spine_rgba2_timeline_dispose(_ptr.assumingMemoryBound(to: spine_rgba2_timeline_wrapper.self))
}
}
}

Some files were not shown because too many files have changed in this diff Show More