From c3c74991a6e5dba5511d0a6da7ed9e069380bfe4 Mon Sep 17 00:00:00 2001 From: jabu Date: Tue, 23 Apr 2024 13:19:16 -0500 Subject: [PATCH] working 4.2 --- examples/miniquad.rs | 20 +- src/animation_state.rs | 8 +- src/bone.rs | 14 +- src/c/spine_c.rs | 14758 +++++++++++++++++++++++++-------------- src/c/wasm.rs | 22 +- src/controller.rs | 1 + src/mesh_attachment.rs | 2 +- src/skeleton.rs | 17 +- 8 files changed, 9670 insertions(+), 5172 deletions(-) diff --git a/examples/miniquad.rs b/examples/miniquad.rs index 471e952..e0566ce 100644 --- a/examples/miniquad.rs +++ b/examples/miniquad.rs @@ -481,6 +481,24 @@ impl Stage { backface_culling: true, }, SpineDemo { + atlas_path: "assets/celestial-circus/export/celestial-circus.atlas", + skeleton_path: SpineSkeletonPath::Json("assets/celestial-circus/export/celestial-circus-pro.json"), + animation: "swing", + position: Vec2::new(0., -120.), + scale: 0.2, + skin: None, + backface_culling: true, + }, + SpineDemo { + atlas_path: "assets/cloud-pot/export/cloud-pot.atlas", + skeleton_path: SpineSkeletonPath::Json("assets/cloud-pot/export/cloud-pot.json"), + animation: "playing-in-the-rain", + position: Vec2::new(0., -220.), + scale: 0.4, + skin: None, + backface_culling: true, + }, + /*SpineDemo { atlas_path: "assets/dragon/export/dragon.atlas", skeleton_path: SpineSkeletonPath::Json("assets/dragon/export/dragon-ess.json"), animation: "flying", @@ -488,7 +506,7 @@ impl Stage { scale: 0.7, skin: None, backface_culling: true, - }, + },*/ SpineDemo { atlas_path: "assets/goblins/export/goblins.atlas", skeleton_path: SpineSkeletonPath::Json("assets/goblins/export/goblins-pro.json"), diff --git a/src/animation_state.rs b/src/animation_state.rs index 996311b..48c1ad8 100644 --- a/src/animation_state.rs +++ b/src/animation_state.rs @@ -674,7 +674,7 @@ impl TrackEntry { eventThreshold, f32 ); - c_accessor_mut!( + /*c_accessor_mut!( /// When the mix percentage ([`mix_time`](`Self::mix_time`) / /// [`mix_duration`](`Self::mix_duration`)) is less than the `attachment_threshold`, /// attachment timelines are applied while this animation is being mixed out. Defaults to 0, @@ -685,8 +685,8 @@ impl TrackEntry { set_attachment_threshold, attachmentThreshold, f32 - ); - c_accessor_mut!( + );*/ + /*c_accessor_mut!( /// When the mix percentage ([`mix_time`](`Self::mix_time`) / /// [`mix_duration`](`Self::mix_duration`)) is less than the `draw_order_threshold`, draw /// order timelines are applied while this animation is being mixed out. Defaults to 0, so @@ -697,7 +697,7 @@ impl TrackEntry { set_draw_order_threshold, drawOrderThreshold, f32 - ); + );*/ c_accessor_mut!( /// Seconds when this animation starts, both initially and after looping. Defaults to 0. /// diff --git a/src/bone.rs b/src/bone.rs index 0817986..868bb07 100644 --- a/src/bone.rs +++ b/src/bone.rs @@ -5,7 +5,7 @@ use crate::{ spBone_rotateWorld, spBone_setToSetupPose, spBone_setYDown, spBone_update, spBone_updateAppliedTransform, spBone_updateWorldTransform, spBone_updateWorldTransformWith, spBone_worldToLocal, spBone_worldToLocalRotation, - spSkeleton, spTransformMode, + spSkeleton, spInherit, }, c_interface::{NewFromPtr, SyncPtr}, Skeleton, @@ -626,9 +626,9 @@ impl BoneData { c_accessor_bool!(skin_required, skinRequired); c_accessor_enum!( /// The transform mode for how parent world transforms affect this bone. - transform_mode, - transformMode, - TransformMode + set_inherit, + inherit, + Inherit ); c_accessor_tmp_ptr_optional!(parent, parent, BoneData, spBoneData); } @@ -664,7 +664,7 @@ impl BoneData { /// The transform mode for how bones are affected by their parents. /// /// See [`BoneData::transform_mode`]. -pub enum TransformMode { +pub enum Inherit { Normal = 0, OnlyTranslation = 1, NoRotationOrReflection = 2, @@ -673,8 +673,8 @@ pub enum TransformMode { Unknown = 99, } -impl From for TransformMode { - fn from(mode: spTransformMode) -> Self { +impl From for Inherit { + fn from(mode: spInherit) -> Self { match mode { 0 => Self::Normal, 1 => Self::OnlyTranslation, diff --git a/src/c/spine_c.rs b/src/c/spine_c.rs index 73fe045..89e1d87 100644 --- a/src/c/spine_c.rs +++ b/src/c/spine_c.rs @@ -1,51 +1,98 @@ -#![allow( - dead_code, - mutable_transmutes, - non_camel_case_types, - non_snake_case, - non_upper_case_globals, - unused_assignments, - unused_mut, - clippy::all, - clippy::cast_lossless, - clippy::missing_panics_doc, - clippy::ptr_cast_constness, - clippy::ptr_as_ptr, - clippy::missing_const_for_fn -)] +#![allow(dead_code, mutable_transmutes, non_camel_case_types, non_snake_case, non_upper_case_globals, unused_assignments, unused_mut)] extern "C" { - fn spine_memcpy(__dest: *mut c_void, __src: *const c_void, __n: size_t) -> *mut c_void; - fn spine_memmove(__dest: *mut c_void, __src: *const c_void, __n: size_t) -> *mut c_void; + fn spine_memcpy( + __dest: *mut c_void, + __src: *const c_void, + __n: size_t, + ) -> *mut c_void; + fn spine_memmove( + __dest: *mut c_void, + __src: *const c_void, + __n: size_t, + ) -> *mut c_void; fn spine_acosf(__x: c_float) -> c_float; fn spine_atan2f(__y: c_float, __x: c_float) -> c_float; - fn spine_memset(__s: *mut c_void, __c: c_int, __n: size_t) -> *mut c_void; + fn spine_memset( + __s: *mut c_void, + __c: c_int, + __n: size_t, + ) -> *mut c_void; fn spine_cosf(__x: c_float) -> c_float; - fn spine_sinf(_: c_float) -> c_float; - fn spine_strcasecmp(__s1: *const c_char, __s2: *const c_char) -> c_int; - fn spine_strcpy(__dest: *mut c_char, __src: *const c_char) -> *mut c_char; - fn spine_strncat(__dest: *mut c_char, __src: *const c_char, __n: size_t) -> *mut c_char; + fn sinf(_: c_float) -> c_float; + fn spine_strcasecmp( + __s1: *const c_char, + __s2: *const c_char, + ) -> c_int; + fn spine_strcpy( + __dest: *mut c_char, + __src: *const c_char, + ) -> *mut c_char; + fn strncpy( + _: *mut c_char, + _: *const c_char, + _: c_ulong, + ) -> *mut c_char; + fn spine_strncat( + __dest: *mut c_char, + __src: *const c_char, + __n: size_t, + ) -> *mut c_char; fn spine_strcmp(__s1: *const c_char, __s2: *const c_char) -> c_int; - fn spine_strncmp(__s1: *const c_char, __s2: *const c_char, __n: size_t) -> c_int; + fn spine_strncmp( + __s1: *const c_char, + __s2: *const c_char, + __n: size_t, + ) -> c_int; fn spine_pow(__x: c_double, __y: c_double) -> c_double; fn spine_sqrtf(__x: c_float) -> c_float; + fn ceil(_: c_double) -> c_double; fn _spAtlasPage_createTexture(self_0: *mut spAtlasPage, path: *const c_char); fn _spAtlasPage_disposeTexture(self_0: *mut spAtlasPage); - fn _spUtil_readFile(path: *const c_char, length: *mut c_int) -> *mut c_char; + fn _spUtil_readFile( + path: *const c_char, + length: *mut c_int, + ) -> *mut c_char; fn spine_fmodf(__x: c_float, __y: c_float) -> c_float; - fn spine_strtol(__nptr: *const c_char, __endptr: *mut *mut c_char, __base: c_int) -> c_long; - fn spine_strtoul(__nptr: *const c_char, __endptr: *mut *mut c_char, __base: c_int) -> c_ulong; + fn spine_strtol( + __nptr: *const c_char, + __endptr: *mut *mut c_char, + __base: c_int, + ) -> c_long; + fn spine_strtoul( + __nptr: *const c_char, + __endptr: *mut *mut c_char, + __base: c_int, + ) -> c_ulong; fn spine_fclose(__stream: *mut FILE) -> c_int; - fn spine_fopen(__filename: *const c_char, __modes: *const c_char) -> *mut FILE; + fn spine_fopen( + __filename: *const c_char, + __modes: *const c_char, + ) -> *mut FILE; fn spine_strrchr(__s: *const c_char, __c: c_int) -> *mut c_char; - + + fn snprintf( + _: *mut c_char, + _: c_ulong, + _: *const c_char, + _: ... + ) -> c_int; fn spine_strlen(__s: *const c_char) -> size_t; - + fn spine_rand() -> c_int; fn spine_malloc(__size: size_t) -> *mut c_void; fn spine_realloc(__ptr: *mut c_void, __size: size_t) -> *mut c_void; fn spine_free(__ptr: *mut c_void); - fn spine_fread(__ptr: *mut c_void, __size: size_t, __n: size_t, __stream: *mut FILE) -> size_t; - fn spine_fseek(__stream: *mut FILE, __off: c_long, __whence: c_int) -> c_int; + fn spine_fread( + __ptr: *mut c_void, + __size: size_t, + __n: size_t, + __stream: *mut FILE, + ) -> size_t; + fn spine_fseek( + __stream: *mut FILE, + __off: c_long, + __whence: c_int, + ) -> c_int; fn spine_ftell(__stream: *mut FILE) -> c_long; } #[derive(Copy, Clone)] @@ -54,8 +101,8 @@ pub struct spEventData { pub name: *mut c_char, pub intValue: c_int, pub floatValue: c_float, - pub stringValue: *const c_char, - pub audioPath: *const c_char, + pub stringValue: *mut c_char, + pub audioPath: *mut c_char, pub volume: c_float, pub balance: c_float, } @@ -67,7 +114,7 @@ pub struct spEvent { pub time: c_float, pub intValue: c_int, pub floatValue: c_float, - pub stringValue: *const c_char, + pub stringValue: *mut c_char, pub volume: c_float, pub balance: c_float, } @@ -76,7 +123,7 @@ pub struct spEvent { pub struct spAttachmentLoader { pub error1: *mut c_char, pub error2: *mut c_char, - pub vtable: *mut c_void, + pub vtable: *const c_void, } pub type spAttachmentType = c_uint; pub const SP_ATTACHMENT_CLIPPING: spAttachmentType = 6; @@ -91,15 +138,15 @@ pub const SP_ATTACHMENT_REGION: spAttachmentType = 0; pub struct spAttachment { pub name: *mut c_char, pub type_0: spAttachmentType, - pub vtable: *mut c_void, + pub vtable: *const c_void, pub refCount: c_int, pub attachmentLoader: *mut spAttachmentLoader, } #[derive(Copy, Clone)] #[repr(C)] pub struct _spAttachmentVtable { - pub dispose: Option ()>, - pub copy: Option *mut spAttachment>, + pub dispose: Option:: ()>, + pub copy: Option:: *mut spAttachment>, } #[derive(Copy, Clone)] #[repr(C)] @@ -109,12 +156,12 @@ pub struct spColor { pub b: c_float, pub a: c_float, } -pub type spTransformMode = c_uint; -pub const SP_TRANSFORMMODE_NOSCALEORREFLECTION: spTransformMode = 4; -pub const SP_TRANSFORMMODE_NOSCALE: spTransformMode = 3; -pub const SP_TRANSFORMMODE_NOROTATIONORREFLECTION: spTransformMode = 2; -pub const SP_TRANSFORMMODE_ONLYTRANSLATION: spTransformMode = 1; -pub const SP_TRANSFORMMODE_NORMAL: spTransformMode = 0; +pub type spInherit = c_uint; +pub const SP_INHERIT_NOSCALEORREFLECTION: spInherit = 4; +pub const SP_INHERIT_NOSCALE: spInherit = 3; +pub const SP_INHERIT_NOROTATIONORREFLECTION: spInherit = 2; +pub const SP_INHERIT_ONLYTRANSLATION: spInherit = 1; +pub const SP_INHERIT_NORMAL: spInherit = 0; #[derive(Copy, Clone)] #[repr(C)] pub struct spBoneData { @@ -129,10 +176,17 @@ pub struct spBoneData { pub scaleY: c_float, pub shearX: c_float, pub shearY: c_float, - pub transformMode: spTransformMode, + pub inherit: spInherit, pub skinRequired: c_int, pub color: spColor, -} + pub icon: *const c_char, + pub visible: c_int, +} +pub type spPhysics = c_uint; +pub const SP_PHYSICS_POSE: spPhysics = 3; +pub const SP_PHYSICS_UPDATE: spPhysics = 2; +pub const SP_PHYSICS_RESET: spPhysics = 1; +pub const SP_PHYSICS_NONE: spPhysics = 0; #[derive(Copy, Clone)] #[repr(C)] pub struct spSkeleton { @@ -149,12 +203,15 @@ pub struct spSkeleton { pub transformConstraints: *mut *mut spTransformConstraint, pub pathConstraintsCount: c_int, pub pathConstraints: *mut *mut spPathConstraint, + pub physicsConstraintsCount: c_int, + pub physicsConstraints: *mut *mut spPhysicsConstraint, pub skin: *mut spSkin, pub color: spColor, pub scaleX: c_float, pub scaleY: c_float, pub x: c_float, pub y: c_float, + pub time: c_float, } #[derive(Copy, Clone)] #[repr(C)] @@ -164,6 +221,44 @@ pub struct spSkin { pub ikConstraints: *mut spIkConstraintDataArray, pub transformConstraints: *mut spTransformConstraintDataArray, pub pathConstraints: *mut spPathConstraintDataArray, + pub physicsConstraints: *mut spPhysicsConstraintDataArray, + pub color: spColor, +} +#[derive(Copy, Clone)] +#[repr(C)] +pub struct spPhysicsConstraintDataArray { + pub size: c_int, + pub capacity: c_int, + pub items: *mut *mut spPhysicsConstraintData, +} +#[derive(Copy, Clone)] +#[repr(C)] +pub struct spPhysicsConstraintData { + pub name: *mut c_char, + pub order: c_int, + pub skinRequired: c_int, + pub bone: *mut spBoneData, + pub x: c_float, + pub y: c_float, + pub rotate: c_float, + pub scaleX: c_float, + pub shearX: c_float, + pub limit: c_float, + pub step: c_float, + pub inertia: c_float, + pub strength: c_float, + pub damping: c_float, + pub massInverse: c_float, + pub wind: c_float, + pub gravity: c_float, + pub mix: c_float, + pub inertiaGlobal: c_int, + pub strengthGlobal: c_int, + pub dampingGlobal: c_int, + pub massGlobal: c_int, + pub windGlobal: c_int, + pub gravityGlobal: c_int, + pub mixGlobal: c_int, } #[derive(Copy, Clone)] #[repr(C)] @@ -209,10 +304,12 @@ pub struct spSlotData { pub index: c_int, pub name: *mut c_char, pub boneData: *mut spBoneData, - pub attachmentName: *const c_char, + pub attachmentName: *mut c_char, pub color: spColor, pub darkColor: *mut spColor, pub blendMode: spBlendMode, + pub visible: c_int, + pub path: *mut c_char, } pub type spBlendMode = c_uint; pub const SP_BLEND_MODE_SCREEN: spBlendMode = 3; @@ -282,6 +379,70 @@ pub struct spBoneDataArray { } #[derive(Copy, Clone)] #[repr(C)] +pub struct spPhysicsConstraint { + pub data: *mut spPhysicsConstraintData, + pub bone: *mut spBone, + pub inertia: c_float, + pub strength: c_float, + pub damping: c_float, + pub massInverse: c_float, + pub wind: c_float, + pub gravity: c_float, + pub mix: c_float, + pub reset: c_int, + pub ux: c_float, + pub uy: c_float, + pub cx: c_float, + pub cy: c_float, + pub tx: c_float, + pub ty: c_float, + pub xOffset: c_float, + pub xVelocity: c_float, + pub yOffset: c_float, + pub yVelocity: c_float, + pub rotateOffset: c_float, + pub rotateVelocity: c_float, + pub scaleOffset: c_float, + pub scaleVelocity: c_float, + pub active: c_int, + pub skeleton: *mut spSkeleton, + pub remaining: c_float, + pub lastTime: c_float, +} +#[derive(Copy, Clone)] +#[repr(C)] +pub struct spBone { + pub data: *mut spBoneData, + pub skeleton: *mut spSkeleton, + pub parent: *mut spBone, + pub childrenCount: c_int, + pub children: *mut *mut spBone, + pub x: c_float, + pub y: c_float, + pub rotation: c_float, + pub scaleX: c_float, + pub scaleY: c_float, + pub shearX: c_float, + pub shearY: c_float, + pub ax: c_float, + pub ay: c_float, + pub arotation: c_float, + pub ascaleX: c_float, + pub ascaleY: c_float, + pub ashearX: c_float, + pub ashearY: c_float, + pub a: c_float, + pub b: c_float, + pub worldX: c_float, + pub c: c_float, + pub d: c_float, + pub worldY: c_float, + pub sorted: c_int, + pub active: c_int, + pub inherit: spInherit, +} +#[derive(Copy, Clone)] +#[repr(C)] pub struct spPathConstraint { pub data: *mut spPathConstraintData, pub bonesCount: c_int, @@ -321,37 +482,6 @@ pub struct spSlot { } #[derive(Copy, Clone)] #[repr(C)] -pub struct spBone { - pub data: *mut spBoneData, - pub skeleton: *mut spSkeleton, - pub parent: *mut spBone, - pub childrenCount: c_int, - pub children: *mut *mut spBone, - pub x: c_float, - pub y: c_float, - pub rotation: c_float, - pub scaleX: c_float, - pub scaleY: c_float, - pub shearX: c_float, - pub shearY: c_float, - pub ax: c_float, - pub ay: c_float, - pub arotation: c_float, - pub ascaleX: c_float, - pub ascaleY: c_float, - pub ashearX: c_float, - pub ashearY: c_float, - pub a: c_float, - pub b: c_float, - pub worldX: c_float, - pub c: c_float, - pub d: c_float, - pub worldY: c_float, - pub sorted: c_int, - pub active: c_int, -} -#[derive(Copy, Clone)] -#[repr(C)] pub struct spTransformConstraint { pub data: *mut spTransformConstraintData, pub bonesCount: c_int, @@ -382,12 +512,13 @@ pub struct spIkConstraint { #[derive(Copy, Clone)] #[repr(C)] pub struct spSkeletonData { - pub version: *const c_char, - pub hash: *const c_char, + pub version: *mut c_char, + pub hash: *mut c_char, pub x: c_float, pub y: c_float, pub width: c_float, pub height: c_float, + pub referenceScale: c_float, pub fps: c_float, pub imagesPath: *const c_char, pub audioPath: *const c_char, @@ -410,6 +541,8 @@ pub struct spSkeletonData { pub transformConstraints: *mut *mut spTransformConstraintData, pub pathConstraintsCount: c_int, pub pathConstraints: *mut *mut spPathConstraintData, + pub physicsConstraintsCount: c_int, + pub physicsConstraints: *mut *mut spPhysicsConstraintData, } #[derive(Copy, Clone)] #[repr(C)] @@ -448,15 +581,24 @@ pub struct spTimeline { pub type_0: spTimelineType, } pub type spTimelineType = c_uint; -pub const SP_TIMELINE_EVENT: spTimelineType = 24; -pub const SP_TIMELINE_DRAWORDER: spTimelineType = 23; -pub const SP_TIMELINE_TRANSFORMCONSTRAINT: spTimelineType = 22; -pub const SP_TIMELINE_RGB: spTimelineType = 21; -pub const SP_TIMELINE_RGBA: spTimelineType = 20; -pub const SP_TIMELINE_RGBA2: spTimelineType = 19; -pub const SP_TIMELINE_RGB2: spTimelineType = 18; -pub const SP_TIMELINE_PATHCONSTRAINTMIX: spTimelineType = 17; -pub const SP_TIMELINE_IKCONSTRAINT: spTimelineType = 16; +pub const SP_TIMELINE_EVENT: spTimelineType = 33; +pub const SP_TIMELINE_DRAWORDER: spTimelineType = 32; +pub const SP_TIMELINE_TRANSFORMCONSTRAINT: spTimelineType = 31; +pub const SP_TIMELINE_RGB: spTimelineType = 30; +pub const SP_TIMELINE_RGBA: spTimelineType = 29; +pub const SP_TIMELINE_RGBA2: spTimelineType = 28; +pub const SP_TIMELINE_RGB2: spTimelineType = 27; +pub const SP_TIMELINE_PHYSICSCONSTRAINT_RESET: spTimelineType = 26; +pub const SP_TIMELINE_PHYSICSCONSTRAINT_MIX: spTimelineType = 25; +pub const SP_TIMELINE_PHYSICSCONSTRAINT_GRAVITY: spTimelineType = 24; +pub const SP_TIMELINE_PHYSICSCONSTRAINT_WIND: spTimelineType = 23; +pub const SP_TIMELINE_PHYSICSCONSTRAINT_MASS: spTimelineType = 22; +pub const SP_TIMELINE_PHYSICSCONSTRAINT_DAMPING: spTimelineType = 21; +pub const SP_TIMELINE_PHYSICSCONSTRAINT_STRENGTH: spTimelineType = 20; +pub const SP_TIMELINE_PHYSICSCONSTRAINT_INERTIA: spTimelineType = 19; +pub const SP_TIMELINE_PATHCONSTRAINTMIX: spTimelineType = 18; +pub const SP_TIMELINE_IKCONSTRAINT: spTimelineType = 17; +pub const SP_TIMELINE_INHERIT: spTimelineType = 16; pub const SP_TIMELINE_SEQUENCE: spTimelineType = 15; pub const SP_TIMELINE_DEFORM: spTimelineType = 14; pub const SP_TIMELINE_TRANSLATE: spTimelineType = 13; @@ -483,7 +625,7 @@ pub struct spFloatArray { #[derive(Copy, Clone)] #[repr(C)] pub struct _spTimelineVtable { - pub apply: Option< + pub apply: Option::< unsafe extern "C" fn( *mut spTimeline, *mut spSkeleton, @@ -496,8 +638,8 @@ pub struct _spTimelineVtable { spMixDirection, ) -> (), >, - pub dispose: Option ()>, - pub setBezier: Option< + pub dispose: Option:: ()>, + pub setBezier: Option::< unsafe extern "C" fn( *mut spTimeline, c_int, @@ -532,7 +674,7 @@ pub struct _SkinHashTableEntry { #[repr(C)] pub struct _Entry { pub slotIndex: c_int, - pub name: *const c_char, + pub name: *mut c_char, pub attachment: *mut spAttachment, pub next: *mut _Entry, } @@ -594,7 +736,7 @@ pub struct spMeshAttachment { pub rendererObject: *mut c_void, pub region: *mut spTextureRegion, pub sequence: *mut spSequence, - pub path: *const c_char, + pub path: *mut c_char, pub regionUVs: *mut c_float, pub uvs: *mut c_float, pub trianglesCount: c_int, @@ -603,7 +745,7 @@ pub struct spMeshAttachment { pub hullLength: c_int, pub parentMesh: *mut spMeshAttachment, pub edgesCount: c_int, - pub edges: *mut c_int, + pub edges: *mut c_ushort, pub width: c_float, pub height: c_float, } @@ -611,7 +753,7 @@ pub struct spMeshAttachment { #[repr(C)] pub struct spRegionAttachment { pub super_0: spAttachment, - pub path: *const c_char, + pub path: *mut c_char, pub x: c_float, pub y: c_float, pub scaleX: c_float, @@ -764,19 +906,28 @@ pub type __off64_t = c_long; pub type int32_t = __int32_t; pub type uint32_t = __uint32_t; pub type C2RustUnnamed = c_uint; -pub const SP_PROPERTY_SEQUENCE: C2RustUnnamed = 524288; -pub const SP_PROPERTY_PATHCONSTRAINT_MIX: C2RustUnnamed = 262144; -pub const SP_PROPERTY_PATHCONSTRAINT_SPACING: C2RustUnnamed = 131072; -pub const SP_PROPERTY_PATHCONSTRAINT_POSITION: C2RustUnnamed = 65536; -pub const SP_PROPERTY_TRANSFORMCONSTRAINT: C2RustUnnamed = 32768; -pub const SP_PROPERTY_IKCONSTRAINT: C2RustUnnamed = 16384; -pub const SP_PROPERTY_DRAWORDER: C2RustUnnamed = 8192; -pub const SP_PROPERTY_EVENT: C2RustUnnamed = 4096; -pub const SP_PROPERTY_DEFORM: C2RustUnnamed = 2048; -pub const SP_PROPERTY_ATTACHMENT: C2RustUnnamed = 1024; -pub const SP_PROPERTY_RGB2: C2RustUnnamed = 512; -pub const SP_PROPERTY_ALPHA: C2RustUnnamed = 256; -pub const SP_PROPERTY_RGB: C2RustUnnamed = 128; +pub const SP_PROPERTY_SEQUENCE: C2RustUnnamed = 268435456; +pub const SP_PROPERTY_PHYSICSCONSTRAINT_RESET: C2RustUnnamed = 134217728; +pub const SP_PROPERTY_PHYSICSCONSTRAINT_MIX: C2RustUnnamed = 67108864; +pub const SP_PROPERTY_PHYSICSCONSTRAINT_GRAVITY: C2RustUnnamed = 33554432; +pub const SP_PROPERTY_PHYSICSCONSTRAINT_WIND: C2RustUnnamed = 16777216; +pub const SP_PROPERTY_PHYSICSCONSTRAINT_MASS: C2RustUnnamed = 8388608; +pub const SP_PROPERTY_PHYSICSCONSTRAINT_DAMPING: C2RustUnnamed = 4194304; +pub const SP_PROPERTY_PHYSICSCONSTRAINT_STRENGTH: C2RustUnnamed = 2097152; +pub const SP_PROPERTY_PHYSICSCONSTRAINT_INERTIA: C2RustUnnamed = 1048576; +pub const SP_PROPERTY_PATHCONSTRAINT_MIX: C2RustUnnamed = 524288; +pub const SP_PROPERTY_PATHCONSTRAINT_SPACING: C2RustUnnamed = 262144; +pub const SP_PROPERTY_PATHCONSTRAINT_POSITION: C2RustUnnamed = 131072; +pub const SP_PROPERTY_TRANSFORMCONSTRAINT: C2RustUnnamed = 65536; +pub const SP_PROPERTY_IKCONSTRAINT: C2RustUnnamed = 32768; +pub const SP_PROPERTY_DRAWORDER: C2RustUnnamed = 16384; +pub const SP_PROPERTY_EVENT: C2RustUnnamed = 8192; +pub const SP_PROPERTY_DEFORM: C2RustUnnamed = 4096; +pub const SP_PROPERTY_ATTACHMENT: C2RustUnnamed = 2048; +pub const SP_PROPERTY_RGB2: C2RustUnnamed = 1024; +pub const SP_PROPERTY_ALPHA: C2RustUnnamed = 512; +pub const SP_PROPERTY_RGB: C2RustUnnamed = 256; +pub const SP_PROPERTY_INHERIT: C2RustUnnamed = 128; pub const SP_PROPERTY_SHEARY: C2RustUnnamed = 64; pub const SP_PROPERTY_SHEARX: C2RustUnnamed = 32; pub const SP_PROPERTY_SCALEY: C2RustUnnamed = 16; @@ -920,6 +1071,12 @@ pub struct spDrawOrderTimeline { } #[derive(Copy, Clone)] #[repr(C)] +pub struct spInheritTimeline { + pub super_0: spTimeline, + pub boneIndex: c_int, +} +#[derive(Copy, Clone)] +#[repr(C)] pub struct spIkConstraintTimeline { pub super_0: spCurveTimeline, pub ikConstraintIndex: c_int, @@ -948,11 +1105,23 @@ pub struct spPathConstraintMixTimeline { pub super_0: spCurveTimeline, pub pathConstraintIndex: c_int, } +#[derive(Copy, Clone)] +#[repr(C)] +pub struct spPhysicsConstraintTimeline { + pub super_0: spCurveTimeline, + pub physicsConstraintIndex: c_int, +} +#[derive(Copy, Clone)] +#[repr(C)] +pub struct spPhysicsConstraintResetTimeline { + pub super_0: spTimeline, + pub physicsConstraintIndex: c_int, +} pub type spSkinEntry = _Entry; #[derive(Copy, Clone)] #[repr(C)] pub struct _spAttachmentLoaderVtable { - pub createAttachment: Option< + pub createAttachment: Option::< unsafe extern "C" fn( *mut spAttachmentLoader, *mut spSkin, @@ -962,11 +1131,13 @@ pub struct _spAttachmentLoaderVtable { *mut spSequence, ) -> *mut spAttachment, >, - pub configureAttachment: - Option ()>, - pub disposeAttachment: - Option ()>, - pub dispose: Option ()>, + pub configureAttachment: Option::< + unsafe extern "C" fn(*mut spAttachmentLoader, *mut spAttachment) -> (), + >, + pub disposeAttachment: Option::< + unsafe extern "C" fn(*mut spAttachmentLoader, *mut spAttachment) -> (), + >, + pub dispose: Option:: ()>, } #[derive(Copy, Clone)] #[repr(C)] @@ -993,6 +1164,7 @@ pub struct _spUpdate { pub object: *mut c_void, } pub type _spUpdateType = c_uint; +pub const SP_UPDATE_PHYSICS_CONSTRAINT: _spUpdateType = 4; pub const SP_UPDATE_TRANSFORM_CONSTRAINT: _spUpdateType = 3; pub const SP_UPDATE_PATH_CONSTRAINT: _spUpdateType = 2; pub const SP_UPDATE_IK_CONSTRAINT: _spUpdateType = 1; @@ -1024,7 +1196,7 @@ pub struct spPointAttachment { pub struct spAnimationStateData { pub skeletonData: *mut spSkeletonData, pub defaultMix: c_float, - pub entries: *mut c_void, + pub entries: *const c_void, } #[derive(Copy, Clone)] #[repr(C)] @@ -1059,8 +1231,13 @@ pub struct spAnimationState { pub userData: *mut c_void, pub unkeyedState: c_int, } -pub type spAnimationStateListener = Option< - unsafe extern "C" fn(*mut spAnimationState, spEventType, *mut spTrackEntry, *mut spEvent) -> (), +pub type spAnimationStateListener = Option::< + unsafe extern "C" fn( + *mut spAnimationState, + spEventType, + *mut spTrackEntry, + *mut spEvent, + ) -> (), >; #[derive(Copy, Clone)] #[repr(C)] @@ -1077,8 +1254,9 @@ pub struct spTrackEntry { pub reverse: c_int, pub shortestRotation: c_int, pub eventThreshold: c_float, - pub attachmentThreshold: c_float, - pub drawOrderThreshold: c_float, + pub mixAttachmentThreshold: c_float, + pub alphaAttachmentThreshold: c_float, + pub mixDrawOrderThreshold: c_float, pub animationStart: c_float, pub animationEnd: c_float, pub animationLast: c_float, @@ -1222,7 +1400,7 @@ pub struct _spSkeletonBinary { #[repr(C)] pub struct _spLinkedMeshBinary { pub parent: *const c_char, - pub skin: *const c_char, + pub skinIndex: c_int, pub slotIndex: c_int, pub mesh: *mut spMeshAttachment, pub inheritTimeline: c_int, @@ -1317,7 +1495,8 @@ pub unsafe extern "C" fn spPropertyIdArray_create( ) as *mut spPropertyIdArray; (*array).size = 0 as c_int; (*array).capacity = initialCapacity; - (*array).items = _spCalloc( + (*array) + .items = _spCalloc( initialCapacity as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, @@ -1341,12 +1520,16 @@ pub unsafe extern "C" fn spPropertyIdArray_setSize( ) -> *mut spPropertyIdArray { (*self_0).size = newSize; if (*self_0).capacity < newSize { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -1363,7 +1546,8 @@ pub unsafe extern "C" fn spPropertyIdArray_ensureCapacity( return; } (*self_0).capacity = newCapacity; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -1375,12 +1559,16 @@ pub unsafe extern "C" fn spPropertyIdArray_add( mut value: spPropertyId, ) { if (*self_0).size == (*self_0).capacity { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -1423,9 +1611,8 @@ pub unsafe extern "C" fn spPropertyIdArray_removeAt( (*self_0).size -= 1; spine_memmove( ((*self_0).items).offset(index as isize) as *mut c_void, - ((*self_0).items) - .offset(index as isize) - .offset(1 as c_int as isize) as *const c_void, + ((*self_0).items).offset(index as isize).offset(1 as c_int as isize) + as *const c_void, (::core::mem::size_of::() as c_ulong) .wrapping_mul(((*self_0).size - index) as c_ulong), ); @@ -1449,7 +1636,9 @@ pub unsafe extern "C" fn spPropertyIdArray_contains( return 0 as c_int; } #[no_mangle] -pub unsafe extern "C" fn spPropertyIdArray_pop(mut self_0: *mut spPropertyIdArray) -> spPropertyId { +pub unsafe extern "C" fn spPropertyIdArray_pop( + mut self_0: *mut spPropertyIdArray, +) -> spPropertyId { (*self_0).size -= 1; let mut item: spPropertyId = *((*self_0).items).offset((*self_0).size as isize); return item; @@ -1472,7 +1661,8 @@ pub unsafe extern "C" fn spTimelineArray_create( ) as *mut spTimelineArray; (*array).size = 0 as c_int; (*array).capacity = initialCapacity; - (*array).items = _spCalloc( + (*array) + .items = _spCalloc( initialCapacity as size_t, ::core::mem::size_of::<*mut spTimeline>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, @@ -1496,12 +1686,16 @@ pub unsafe extern "C" fn spTimelineArray_setSize( ) -> *mut spTimelineArray { (*self_0).size = newSize; if (*self_0).capacity < newSize { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spTimeline>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -1518,7 +1712,8 @@ pub unsafe extern "C" fn spTimelineArray_ensureCapacity( return; } (*self_0).capacity = newCapacity; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spTimeline>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -1530,12 +1725,16 @@ pub unsafe extern "C" fn spTimelineArray_add( mut value: *mut spTimeline, ) { if (*self_0).size == (*self_0).capacity { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spTimeline>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -1579,9 +1778,8 @@ pub unsafe extern "C" fn spTimelineArray_removeAt( (*self_0).size -= 1; spine_memmove( ((*self_0).items).offset(index as isize) as *mut c_void, - ((*self_0).items) - .offset(index as isize) - .offset(1 as c_int as isize) as *const c_void, + ((*self_0).items).offset(index as isize).offset(1 as c_int as isize) + as *const c_void, (::core::mem::size_of::<*mut spTimeline>() as c_ulong) .wrapping_mul(((*self_0).size - index) as c_ulong), ); @@ -1605,13 +1803,17 @@ pub unsafe extern "C" fn spTimelineArray_contains( return 0 as c_int; } #[no_mangle] -pub unsafe extern "C" fn spTimelineArray_pop(mut self_0: *mut spTimelineArray) -> *mut spTimeline { +pub unsafe extern "C" fn spTimelineArray_pop( + mut self_0: *mut spTimelineArray, +) -> *mut spTimeline { (*self_0).size -= 1; let mut item: *mut spTimeline = *((*self_0).items).offset((*self_0).size as isize); return item; } #[no_mangle] -pub unsafe extern "C" fn spTimelineArray_peek(mut self_0: *mut spTimelineArray) -> *mut spTimeline { +pub unsafe extern "C" fn spTimelineArray_peek( + mut self_0: *mut spTimelineArray, +) -> *mut spTimeline { return *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize); } #[no_mangle] @@ -1629,15 +1831,18 @@ pub unsafe extern "C" fn spAnimation_create( b"spine.c\0" as *const u8 as *const c_char, 43 as c_int, ) as *mut spAnimation; - let ref mut fresh3 = *(&mut (*self_0).name as *mut *mut c_char); - *fresh3 = _spMalloc( + (*self_0) + .name = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen(name)).wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, 44 as c_int, ) as *mut c_char; - spine_strcpy(*fresh3, name); - (*self_0).timelines = if !timelines.is_null() { + spine_strcpy((*self_0).name, name); + (*self_0) + .timelines = if !timelines.is_null() { timelines } else { spTimelineArray_create(1 as c_int) @@ -1691,7 +1896,9 @@ pub unsafe extern "C" fn spAnimation_hasTimeline( while i < n { ii = 0 as c_int; while ii < idsCount { - if *((*(*self_0).timelineIds).items).offset(i as isize) == *ids.offset(ii as isize) { + if *((*(*self_0).timelineIds).items).offset(i as isize) + == *ids.offset(ii as isize) + { return 1 as c_int; } ii += 1; @@ -1737,7 +1944,10 @@ pub unsafe extern "C" fn spAnimation_apply( i += 1; } } -unsafe extern "C" fn search(mut values: *mut spFloatArray, mut time: c_float) -> c_int { +unsafe extern "C" fn search( + mut values: *mut spFloatArray, + mut time: c_float, +) -> c_int { let mut i: c_int = 0; let mut n: c_int = 0; let mut items: *mut c_float = (*values).items; @@ -1777,8 +1987,8 @@ pub unsafe extern "C" fn _spTimeline_init( mut propertyIds: *mut spPropertyId, mut propertyIdsCount: c_int, mut type_0: spTimelineType, - mut dispose: Option ()>, - mut apply: Option< + mut dispose: Option:: ()>, + mut apply: Option::< unsafe extern "C" fn( *mut spTimeline, *mut spSkeleton, @@ -1791,7 +2001,7 @@ pub unsafe extern "C" fn _spTimeline_init( spMixDirection, ) -> (), >, - mut setBezier: Option< + mut setBezier: Option::< unsafe extern "C" fn( *mut spTimeline, c_int, @@ -1842,7 +2052,10 @@ pub unsafe extern "C" fn spTimeline_apply( mut blend: spMixBlend, mut direction: spMixDirection, ) { - ((*self_0).vtable.apply).expect("non-null function pointer")( + ((*self_0).vtable.apply) + .expect( + "non-null function pointer", + )( self_0, skeleton, lastTime, @@ -1870,13 +2083,29 @@ pub unsafe extern "C" fn spTimeline_setBezier( mut value2: c_float, ) { if ((*self_0).vtable.setBezier).is_some() { - ((*self_0).vtable.setBezier).expect("non-null function pointer")( - self_0, bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2, + ((*self_0).vtable.setBezier) + .expect( + "non-null function pointer", + )( + self_0, + bezier, + frame, + value, + time1, + value1, + cx1, + cy1, + cx2, + cy2, + time2, + value2, ); } } #[no_mangle] -pub unsafe extern "C" fn spTimeline_getDuration(mut self_0: *const spTimeline) -> c_float { +pub unsafe extern "C" fn spTimeline_getDuration( + mut self_0: *const spTimeline, +) -> c_float { return *((*(*self_0).frames).items) .offset(((*(*self_0).frames).size - (*self_0).frameEntries) as isize); } @@ -1889,8 +2118,8 @@ pub unsafe extern "C" fn _spCurveTimeline_init( mut propertyIds: *mut spPropertyId, mut propertyIdsCount: c_int, mut type_0: spTimelineType, - mut dispose: Option ()>, - mut apply: Option< + mut dispose: Option:: ()>, + mut apply: Option::< unsafe extern "C" fn( *mut spTimeline, *mut spSkeleton, @@ -1903,7 +2132,7 @@ pub unsafe extern "C" fn _spCurveTimeline_init( spMixDirection, ) -> (), >, - mut setBezier: Option< + mut setBezier: Option::< unsafe extern "C" fn( *mut spTimeline, c_int, @@ -1933,7 +2162,10 @@ pub unsafe extern "C" fn _spCurveTimeline_init( ); (*self_0).curves = spFloatArray_create(frameCount + bezierCount * 18 as c_int); (*(*self_0).curves).size = frameCount + bezierCount * 18 as c_int; - *((*(*self_0).curves).items).offset((frameCount - 1 as c_int) as isize) = 1 as c_int as c_float; + *((*(*self_0).curves).items) + .offset( + (frameCount - 1 as c_int) as isize, + ) = 1 as c_int as c_float; } #[no_mangle] pub unsafe extern "C" fn _spCurveTimeline_dispose(mut self_0: *mut spTimeline) { @@ -1971,18 +2203,20 @@ pub unsafe extern "C" fn _spCurveTimeline_setBezier( if value == 0 as c_int as c_float { *curves.offset(frame as isize) = (2 as c_int + i) as c_float; } - tmpx = ((time1 - cx1 * 2 as c_int as c_float + cx2) as c_double * 0.03f64) as c_float; - tmpy = ((value1 - cy1 * 2 as c_int as c_float + cy2) as c_double * 0.03f64) as c_float; - dddx = - (((cx1 - cx2) * 3 as c_int as c_float - time1 + time2) as c_double * 0.006f64) as c_float; - dddy = - (((cy1 - cy2) * 3 as c_int as c_float - value1 + value2) as c_double * 0.006f64) as c_float; + tmpx = ((time1 - cx1 * 2 as c_int as c_float + cx2) as c_double + * 0.03f64) as c_float; + tmpy = ((value1 - cy1 * 2 as c_int as c_float + cy2) as c_double + * 0.03f64) as c_float; + dddx = (((cx1 - cx2) * 3 as c_int as c_float - time1 + time2) + as c_double * 0.006f64) as c_float; + dddy = (((cy1 - cy2) * 3 as c_int as c_float - value1 + value2) + as c_double * 0.006f64) as c_float; ddx = tmpx * 2 as c_int as c_float + dddx; ddy = tmpy * 2 as c_int as c_float + dddy; - dx = ((cx1 - time1) as c_double * 0.3f64 + tmpx as c_double + dddx as c_double * 0.16666667f64) - as c_float; - dy = ((cy1 - value1) as c_double * 0.3f64 + tmpy as c_double + dddy as c_double * 0.16666667f64) - as c_float; + dx = ((cx1 - time1) as c_double * 0.3f64 + tmpx as c_double + + dddx as c_double * 0.16666667f64) as c_float; + dy = ((cy1 - value1) as c_double * 0.3f64 + tmpy as c_double + + dddy as c_double * 0.16666667f64) as c_float; x = time1 + dx; y = value1 + dy; n = i + 18 as c_int; @@ -2042,14 +2276,16 @@ pub unsafe extern "C" fn spCurveTimeline_setLinear( mut self_0: *mut spCurveTimeline, mut frame: c_int, ) { - *((*(*self_0).curves).items).offset(frame as isize) = 0 as c_int as c_float; + *((*(*self_0).curves).items) + .offset(frame as isize) = 0 as c_int as c_float; } #[no_mangle] pub unsafe extern "C" fn spCurveTimeline_setStepped( mut self_0: *mut spCurveTimeline, mut frame: c_int, ) { - *((*(*self_0).curves).items).offset(frame as isize) = 1 as c_int as c_float; + *((*(*self_0).curves).items) + .offset(frame as isize) = 1 as c_int as c_float; } #[no_mangle] pub unsafe extern "C" fn spCurveTimeline1_setFrame( @@ -2086,15 +2322,202 @@ pub unsafe extern "C" fn spCurveTimeline1_getCurveValue( match curveType { 0 => { let mut before: c_float = *frames.offset(i as isize); - let mut value: c_float = *frames.offset((i + 1 as c_int) as isize); + let mut value: c_float = *frames + .offset((i + 1 as c_int) as isize); return value - + (time - before) / (*frames.offset((i + 2 as c_int) as isize) - before) - * (*frames.offset((i + 2 as c_int + 1 as c_int) as isize) - value); + + (time - before) + / (*frames.offset((i + 2 as c_int) as isize) - before) + * (*frames.offset((i + 2 as c_int + 1 as c_int) as isize) + - value); } 1 => return *frames.offset((i + 1 as c_int) as isize), _ => {} } - return _spCurveTimeline_getBezierValue(self_0, time, i, 1 as c_int, curveType - 2 as c_int); + return _spCurveTimeline_getBezierValue( + self_0, + time, + i, + 1 as c_int, + curveType - 2 as c_int, + ); +} +#[no_mangle] +pub unsafe extern "C" fn spCurveTimeline1_getRelativeValue( + mut self_0: *mut spCurveTimeline1, + mut time: c_float, + mut alpha: c_float, + mut blend: spMixBlend, + mut current: c_float, + mut setup: c_float, +) -> c_float { + let mut frames: *mut c_float = (*(*self_0).super_0.frames).items; + if time < *frames.offset(0 as c_int as isize) { + match blend as c_uint { + 0 => return setup, + 1 => return current + (setup - current) * alpha, + _ => return current, + } + } + let mut value: c_float = spCurveTimeline1_getCurveValue(self_0, time); + match blend as c_uint { + 0 => return setup + value * alpha, + 1 | 2 => { + value += setup - current; + } + 3 | _ => {} + } + return current + value * alpha; +} +#[no_mangle] +pub unsafe extern "C" fn spCurveTimeline1_getAbsoluteValue( + mut self_0: *mut spCurveTimeline1, + mut time: c_float, + mut alpha: c_float, + mut blend: spMixBlend, + mut current: c_float, + mut setup: c_float, +) -> c_float { + let mut frames: *mut c_float = (*(*self_0).super_0.frames).items; + if time < *frames.offset(0 as c_int as isize) { + match blend as c_uint { + 0 => return setup, + 1 => return current + (setup - current) * alpha, + _ => return current, + } + } + let mut value: c_float = spCurveTimeline1_getCurveValue(self_0, time); + if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint { + return setup + (value - setup) * alpha; + } + return current + (value - current) * alpha; +} +#[no_mangle] +pub unsafe extern "C" fn spCurveTimeline1_getAbsoluteValue2( + mut self_0: *mut spCurveTimeline1, + mut time: c_float, + mut alpha: c_float, + mut blend: spMixBlend, + mut current: c_float, + mut setup: c_float, + mut value: c_float, +) -> c_float { + let mut frames: *mut c_float = (*(*self_0).super_0.frames).items; + if time < *frames.offset(0 as c_int as isize) { + match blend as c_uint { + 0 => return setup, + 1 => return current + (setup - current) * alpha, + _ => return current, + } + } + if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint { + return setup + (value - setup) * alpha; + } + return current + (value - current) * alpha; +} +#[no_mangle] +pub unsafe extern "C" fn spCurveTimeline1_getScaleValue( + mut self_0: *mut spCurveTimeline1, + mut time: c_float, + mut alpha: c_float, + mut blend: spMixBlend, + mut direction: spMixDirection, + mut current: c_float, + mut setup: c_float, +) -> c_float { + let mut frames: *mut c_float = (*(*self_0).super_0.frames).items; + if time < *frames.offset(0 as c_int as isize) { + match blend as c_uint { + 0 => return setup, + 1 => return current + (setup - current) * alpha, + _ => return current, + } + } + let mut value: c_float = spCurveTimeline1_getCurveValue(self_0, time) * setup; + if alpha == 1 as c_int as c_float { + if blend as c_uint == SP_MIX_BLEND_ADD as c_int as c_uint { + return current + value - setup; + } + return value; + } + if direction as c_uint == SP_MIX_DIRECTION_OUT as c_int as c_uint { + match blend as c_uint { + 0 => { + return setup + + ((if value < 0 as c_int as c_float { + -value + } else { + value + }) + * (if setup < 0 as c_int as c_float { + -1.0f32 + } else { + (if setup > 0 as c_int as c_float { + 1.0f32 + } else { + 0.0f32 + }) + }) - setup) * alpha; + } + 1 | 2 => { + return current + + ((if value < 0 as c_int as c_float { + -value + } else { + value + }) + * (if current < 0 as c_int as c_float { + -1.0f32 + } else { + (if current > 0 as c_int as c_float { + 1.0f32 + } else { + 0.0f32 + }) + }) - current) * alpha; + } + _ => {} + } + } else { + let mut s: c_float = 0.; + match blend as c_uint { + 0 => { + s = (if setup < 0 as c_int as c_float { + -setup + } else { + setup + }) + * (if value < 0 as c_int as c_float { + -1.0f32 + } else { + (if value > 0 as c_int as c_float { + 1.0f32 + } else { + 0.0f32 + }) + }); + return s + (value - s) * alpha; + } + 1 | 2 => { + s = (if current < 0 as c_int as c_float { + -current + } else { + current + }) + * (if value < 0 as c_int as c_float { + -1.0f32 + } else { + (if value > 0 as c_int as c_float { + 1.0f32 + } else { + 0.0f32 + }) + }); + return s + (value - s) * alpha; + } + _ => {} + } + } + return current + (value - setup) * alpha; } #[no_mangle] pub unsafe extern "C" fn spCurveTimeline2_setFrame( @@ -2114,59 +2537,28 @@ pub unsafe extern "C" fn spCurveTimeline2_setFrame( pub unsafe extern "C" fn _spRotateTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, - mut _direction: spMixDirection, + mut direction: spMixDirection, ) { - let mut bone: *mut spBone = std::ptr::null_mut(); - let mut r: c_float = 0.; let mut self_0: *mut spRotateTimeline = timeline as *mut spRotateTimeline; - let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items; - bone = *((*skeleton).bones).offset((*self_0).boneIndex as isize); - if (*bone).active == 0 { - return; + let mut bone: *mut spBone = *((*skeleton).bones) + .offset((*self_0).boneIndex as isize); + if (*bone).active != 0 { + (*bone) + .rotation = spCurveTimeline1_getRelativeValue( + &mut (*self_0).super_0, + time, + alpha, + blend, + (*bone).rotation, + (*(*bone).data).rotation, + ); } - if time < *frames.offset(0 as c_int as isize) { - match blend as c_uint { - 0 => { - (*bone).rotation = (*(*bone).data).rotation; - return; - } - 1 => { - (*bone).rotation += ((*(*bone).data).rotation - (*bone).rotation) * alpha; - } - _ => {} - } - return; - } - r = spCurveTimeline1_getCurveValue(&mut (*self_0).super_0, time); - let mut current_block_14: u64; - match blend as c_uint { - 0 => { - (*bone).rotation = (*(*bone).data).rotation + r * alpha; - current_block_14 = 12039483399334584727; - } - 1 | 2 => { - r += (*(*bone).data).rotation - (*bone).rotation; - current_block_14 = 1185040227185769797; - } - 3 => { - current_block_14 = 1185040227185769797; - } - _ => { - current_block_14 = 12039483399334584727; - } - } - match current_block_14 { - 1185040227185769797 => { - (*bone).rotation += r * alpha; - } - _ => {} - }; } #[no_mangle] pub unsafe extern "C" fn spRotateTimeline_create( @@ -2178,11 +2570,12 @@ pub unsafe extern "C" fn spRotateTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 359 as c_int, + 434 as c_int, ) as *mut spRotateTimeline; let mut ids: [spPropertyId; 1] = [0; 1]; - ids[0 as c_int as usize] = - (SP_PROPERTY_ROTATE as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_ROTATE as c_int as spPropertyId) + << 32 as c_int | boneIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, frameCount, @@ -2240,15 +2633,15 @@ pub unsafe extern "C" fn spRotateTimeline_setFrame( pub unsafe extern "C" fn _spTranslateTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, - mut _direction: spMixDirection, + mut direction: spMixDirection, ) { - let mut bone: *mut spBone = std::ptr::null_mut(); + let mut bone: *mut spBone = 0 as *mut spBone; let mut x: c_float = 0.; let mut y: c_float = 0.; let mut t: c_float = 0.; @@ -2283,9 +2676,14 @@ pub unsafe extern "C" fn _spTranslateTimeline_apply( let mut before: c_float = *frames.offset(i as isize); x = *frames.offset((i + 1 as c_int) as isize); y = *frames.offset((i + 2 as c_int) as isize); - t = (time - before) / (*frames.offset((i + 3 as c_int) as isize) - before); - x += (*frames.offset((i + 3 as c_int + 1 as c_int) as isize) - x) * t; - y += (*frames.offset((i + 3 as c_int + 2 as c_int) as isize) - y) * t; + t = (time - before) + / (*frames.offset((i + 3 as c_int) as isize) - before); + x + += (*frames.offset((i + 3 as c_int + 1 as c_int) as isize) + - x) * t; + y + += (*frames.offset((i + 3 as c_int + 2 as c_int) as isize) + - y) * t; } 1 => { x = *frames.offset((i + 1 as c_int) as isize); @@ -2334,13 +2732,15 @@ pub unsafe extern "C" fn spTranslateTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 449 as c_int, + 524 as c_int, ) as *mut spTranslateTimeline; let mut ids: [spPropertyId; 2] = [0; 2]; - ids[0 as c_int as usize] = - (SP_PROPERTY_X as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong; - ids[1 as c_int as usize] = - (SP_PROPERTY_Y as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_X as c_int as spPropertyId) << 32 as c_int + | boneIndex as c_ulong; + ids[1 as c_int + as usize] = (SP_PROPERTY_Y as c_int as spPropertyId) << 32 as c_int + | boneIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, frameCount, @@ -2399,15 +2799,15 @@ pub unsafe extern "C" fn spTranslateTimeline_setFrame( pub unsafe extern "C" fn _spTranslateXTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, - mut _direction: spMixDirection, + mut direction: spMixDirection, ) { - let mut bone: *mut spBone = std::ptr::null_mut(); + let mut bone: *mut spBone = 0 as *mut spBone; let mut x: c_float = 0.; let mut self_0: *mut spTranslateXTimeline = timeline as *mut spTranslateXTimeline; let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items; @@ -2452,11 +2852,12 @@ pub unsafe extern "C" fn spTranslateXTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 510 as c_int, + 585 as c_int, ) as *mut spTranslateXTimeline; let mut ids: [spPropertyId; 1] = [0; 1]; - ids[0 as c_int as usize] = - (SP_PROPERTY_X as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_X as c_int as spPropertyId) << 32 as c_int + | boneIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, frameCount, @@ -2514,15 +2915,15 @@ pub unsafe extern "C" fn spTranslateXTimeline_setFrame( pub unsafe extern "C" fn _spTranslateYTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, - mut _direction: spMixDirection, + mut direction: spMixDirection, ) { - let mut bone: *mut spBone = std::ptr::null_mut(); + let mut bone: *mut spBone = 0 as *mut spBone; let mut y: c_float = 0.; let mut self_0: *mut spTranslateYTimeline = timeline as *mut spTranslateYTimeline; let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items; @@ -2567,11 +2968,12 @@ pub unsafe extern "C" fn spTranslateYTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 570 as c_int, + 645 as c_int, ) as *mut spTranslateYTimeline; let mut ids: [spPropertyId; 1] = [0; 1]; - ids[0 as c_int as usize] = - (SP_PROPERTY_Y as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_Y as c_int as spPropertyId) << 32 as c_int + | boneIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, frameCount, @@ -2629,15 +3031,15 @@ pub unsafe extern "C" fn spTranslateYTimeline_setFrame( pub unsafe extern "C" fn _spScaleTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, mut direction: spMixDirection, ) { - let mut bone: *mut spBone = std::ptr::null_mut(); + let mut bone: *mut spBone = 0 as *mut spBone; let mut i: c_int = 0; let mut curveType: c_int = 0; let mut x: c_float = 0.; @@ -2672,9 +3074,14 @@ pub unsafe extern "C" fn _spScaleTimeline_apply( let mut before: c_float = *frames.offset(i as isize); x = *frames.offset((i + 1 as c_int) as isize); y = *frames.offset((i + 2 as c_int) as isize); - t = (time - before) / (*frames.offset((i + 3 as c_int) as isize) - before); - x += (*frames.offset((i + 3 as c_int + 1 as c_int) as isize) - x) * t; - y += (*frames.offset((i + 3 as c_int + 2 as c_int) as isize) - y) * t; + t = (time - before) + / (*frames.offset((i + 3 as c_int) as isize) - before); + x + += (*frames.offset((i + 3 as c_int + 1 as c_int) as isize) + - x) * t; + y + += (*frames.offset((i + 3 as c_int + 2 as c_int) as isize) + - y) * t; } 1 => { x = *frames.offset((i + 1 as c_int) as isize); @@ -2710,67 +3117,65 @@ pub unsafe extern "C" fn _spScaleTimeline_apply( } else { let mut bx: c_float = 0.; let mut by: c_float = 0.; - if direction as c_uint == SP_MIX_DIRECTION_OUT as c_int as c_uint { + if direction as c_uint + == SP_MIX_DIRECTION_OUT as c_int as c_uint + { match blend as c_uint { 0 => { bx = (*(*bone).data).scaleX; by = (*(*bone).data).scaleY; - (*bone).scaleX = bx + (*bone) + .scaleX = bx + ((if x < 0 as c_int as c_float { -x } else { x }) * (if bx < 0 as c_int as c_float { -1.0f32 } else { - if bx > 0 as c_int as c_float { + (if bx > 0 as c_int as c_float { 1.0f32 } else { 0.0f32 - } - }) - - bx) - * alpha; - (*bone).scaleY = by + }) + }) - bx) * alpha; + (*bone) + .scaleY = by + ((if y < 0 as c_int as c_float { -y } else { y }) * (if by < 0 as c_int as c_float { -1.0f32 } else { - if by > 0 as c_int as c_float { + (if by > 0 as c_int as c_float { 1.0f32 } else { 0.0f32 - } - }) - - by) - * alpha; + }) + }) - by) * alpha; } 1 | 2 => { bx = (*bone).scaleX; by = (*bone).scaleY; - (*bone).scaleX = bx + (*bone) + .scaleX = bx + ((if x < 0 as c_int as c_float { -x } else { x }) * (if bx < 0 as c_int as c_float { -1.0f32 } else { - if bx > 0 as c_int as c_float { + (if bx > 0 as c_int as c_float { 1.0f32 } else { 0.0f32 - } - }) - - bx) - * alpha; - (*bone).scaleY = by + }) + }) - bx) * alpha; + (*bone) + .scaleY = by + ((if y < 0 as c_int as c_float { -y } else { y }) * (if by < 0 as c_int as c_float { -1.0f32 } else { - if by > 0 as c_int as c_float { + (if by > 0 as c_int as c_float { 1.0f32 } else { 0.0f32 - } - }) - - by) - * alpha; + }) + }) - by) * alpha; } 3 => { (*bone).scaleX += (x - (*(*bone).data).scaleX) * alpha; @@ -2785,28 +3190,30 @@ pub unsafe extern "C" fn _spScaleTimeline_apply( -(*(*bone).data).scaleX } else { (*(*bone).data).scaleX - }) * (if x < 0 as c_int as c_float { - -1.0f32 - } else { - if x > 0 as c_int as c_float { - 1.0f32 + }) + * (if x < 0 as c_int as c_float { + -1.0f32 } else { - 0.0f32 - } - }); + (if x > 0 as c_int as c_float { + 1.0f32 + } else { + 0.0f32 + }) + }); by = (if (*(*bone).data).scaleY < 0 as c_int as c_float { -(*(*bone).data).scaleY } else { (*(*bone).data).scaleY - }) * (if y < 0 as c_int as c_float { - -1.0f32 - } else { - if y > 0 as c_int as c_float { - 1.0f32 + }) + * (if y < 0 as c_int as c_float { + -1.0f32 } else { - 0.0f32 - } - }); + (if y > 0 as c_int as c_float { + 1.0f32 + } else { + 0.0f32 + }) + }); (*bone).scaleX = bx + (x - bx) * alpha; (*bone).scaleY = by + (y - by) * alpha; } @@ -2815,28 +3222,30 @@ pub unsafe extern "C" fn _spScaleTimeline_apply( -(*bone).scaleX } else { (*bone).scaleX - }) * (if x < 0 as c_int as c_float { - -1.0f32 - } else { - if x > 0 as c_int as c_float { - 1.0f32 + }) + * (if x < 0 as c_int as c_float { + -1.0f32 } else { - 0.0f32 - } - }); + (if x > 0 as c_int as c_float { + 1.0f32 + } else { + 0.0f32 + }) + }); by = (if (*bone).scaleY < 0 as c_int as c_float { -(*bone).scaleY } else { (*bone).scaleY - }) * (if y < 0 as c_int as c_float { - -1.0f32 - } else { - if y > 0 as c_int as c_float { - 1.0f32 + }) + * (if y < 0 as c_int as c_float { + -1.0f32 } else { - 0.0f32 - } - }); + (if y > 0 as c_int as c_float { + 1.0f32 + } else { + 0.0f32 + }) + }); (*bone).scaleX = bx + (x - bx) * alpha; (*bone).scaleY = by + (y - by) * alpha; } @@ -2859,13 +3268,15 @@ pub unsafe extern "C" fn spScaleTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 695 as c_int, + 770 as c_int, ) as *mut spScaleTimeline; let mut ids: [spPropertyId; 2] = [0; 2]; - ids[0 as c_int as usize] = - (SP_PROPERTY_SCALEX as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong; - ids[1 as c_int as usize] = - (SP_PROPERTY_SCALEY as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_SCALEX as c_int as spPropertyId) + << 32 as c_int | boneIndex as c_ulong; + ids[1 as c_int + as usize] = (SP_PROPERTY_SCALEY as c_int as spPropertyId) + << 32 as c_int | boneIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, frameCount, @@ -2924,124 +3335,29 @@ pub unsafe extern "C" fn spScaleTimeline_setFrame( pub unsafe extern "C" fn _spScaleXTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, mut direction: spMixDirection, ) { - let mut bone: *mut spBone = std::ptr::null_mut(); - let mut x: c_float = 0.; let mut self_0: *mut spScaleXTimeline = timeline as *mut spScaleXTimeline; - let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items; - bone = *((*skeleton).bones).offset((*self_0).boneIndex as isize); - if (*bone).active == 0 { - return; - } - if time < *frames.offset(0 as c_int as isize) { - match blend as c_uint { - 0 => { - (*bone).scaleX = (*(*bone).data).scaleX; - return; - } - 1 => { - (*bone).scaleX += ((*(*bone).data).scaleX - (*bone).scaleX) * alpha; - } - _ => {} - } - return; + let mut bone: *mut spBone = *((*skeleton).bones) + .offset((*self_0).boneIndex as isize); + if (*bone).active != 0 { + (*bone) + .scaleX = spCurveTimeline1_getScaleValue( + &mut (*self_0).super_0, + time, + alpha, + blend, + direction, + (*bone).scaleX, + (*(*bone).data).scaleX, + ); } - x = spCurveTimeline1_getCurveValue(&mut (*self_0).super_0, time) * (*(*bone).data).scaleX; - if alpha == 1 as c_int as c_float { - if blend as c_uint == SP_MIX_BLEND_ADD as c_int as c_uint { - (*bone).scaleX += x - (*(*bone).data).scaleX; - } else { - (*bone).scaleX = x; - } - } else { - let mut bx: c_float = 0.; - if direction as c_uint == SP_MIX_DIRECTION_OUT as c_int as c_uint { - match blend as c_uint { - 0 => { - bx = (*(*bone).data).scaleX; - (*bone).scaleX = bx - + ((if x < 0 as c_int as c_float { -x } else { x }) - * (if bx < 0 as c_int as c_float { - -1.0f32 - } else { - if bx > 0 as c_int as c_float { - 1.0f32 - } else { - 0.0f32 - } - }) - - bx) - * alpha; - } - 1 | 2 => { - bx = (*bone).scaleX; - (*bone).scaleX = bx - + ((if x < 0 as c_int as c_float { -x } else { x }) - * (if bx < 0 as c_int as c_float { - -1.0f32 - } else { - if bx > 0 as c_int as c_float { - 1.0f32 - } else { - 0.0f32 - } - }) - - bx) - * alpha; - } - 3 => { - (*bone).scaleX += (x - (*(*bone).data).scaleX) * alpha; - } - _ => {} - } - } else { - match blend as c_uint { - 0 => { - bx = (if (*(*bone).data).scaleX < 0 as c_int as c_float { - -(*(*bone).data).scaleX - } else { - (*(*bone).data).scaleX - }) * (if x < 0 as c_int as c_float { - -1.0f32 - } else { - if x > 0 as c_int as c_float { - 1.0f32 - } else { - 0.0f32 - } - }); - (*bone).scaleX = bx + (x - bx) * alpha; - } - 1 | 2 => { - bx = (if (*bone).scaleX < 0 as c_int as c_float { - -(*bone).scaleX - } else { - (*bone).scaleX - }) * (if x < 0 as c_int as c_float { - -1.0f32 - } else { - if x > 0 as c_int as c_float { - 1.0f32 - } else { - 0.0f32 - } - }); - (*bone).scaleX = bx + (x - bx) * alpha; - } - 3 => { - (*bone).scaleX += (x - (*(*bone).data).scaleX) * alpha; - } - _ => {} - } - } - }; } #[no_mangle] pub unsafe extern "C" fn spScaleXTimeline_create( @@ -3053,11 +3369,12 @@ pub unsafe extern "C" fn spScaleXTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 782 as c_int, + 800 as c_int, ) as *mut spScaleXTimeline; let mut ids: [spPropertyId; 1] = [0; 1]; - ids[0 as c_int as usize] = - (SP_PROPERTY_SCALEX as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_SCALEX as c_int as spPropertyId) + << 32 as c_int | boneIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, frameCount, @@ -3115,124 +3432,29 @@ pub unsafe extern "C" fn spScaleXTimeline_setFrame( pub unsafe extern "C" fn _spScaleYTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, mut direction: spMixDirection, ) { - let mut bone: *mut spBone = std::ptr::null_mut(); - let mut y: c_float = 0.; let mut self_0: *mut spScaleYTimeline = timeline as *mut spScaleYTimeline; - let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items; - bone = *((*skeleton).bones).offset((*self_0).boneIndex as isize); - if (*bone).active == 0 { - return; - } - if time < *frames.offset(0 as c_int as isize) { - match blend as c_uint { - 0 => { - (*bone).scaleY = (*(*bone).data).scaleY; - return; - } - 1 => { - (*bone).scaleY += ((*(*bone).data).scaleY - (*bone).scaleY) * alpha; - } - _ => {} - } - return; + let mut bone: *mut spBone = *((*skeleton).bones) + .offset((*self_0).boneIndex as isize); + if (*bone).active != 0 { + (*bone) + .scaleY = spCurveTimeline1_getScaleValue( + &mut (*self_0).super_0, + time, + alpha, + blend, + direction, + (*bone).scaleX, + (*(*bone).data).scaleY, + ); } - y = spCurveTimeline1_getCurveValue(&mut (*self_0).super_0, time) * (*(*bone).data).scaleY; - if alpha == 1 as c_int as c_float { - if blend as c_uint == SP_MIX_BLEND_ADD as c_int as c_uint { - (*bone).scaleY += y - (*(*bone).data).scaleY; - } else { - (*bone).scaleY = y; - } - } else { - let mut by: c_float = 0 as c_int as c_float; - if direction as c_uint == SP_MIX_DIRECTION_OUT as c_int as c_uint { - match blend as c_uint { - 0 => { - by = (*(*bone).data).scaleY; - (*bone).scaleY = by - + ((if y < 0 as c_int as c_float { -y } else { y }) - * (if by < 0 as c_int as c_float { - -1.0f32 - } else { - if by > 0 as c_int as c_float { - 1.0f32 - } else { - 0.0f32 - } - }) - - by) - * alpha; - } - 1 | 2 => { - by = (*bone).scaleY; - (*bone).scaleY = by - + ((if y < 0 as c_int as c_float { -y } else { y }) - * (if by < 0 as c_int as c_float { - -1.0f32 - } else { - if by > 0 as c_int as c_float { - 1.0f32 - } else { - 0.0f32 - } - }) - - by) - * alpha; - } - 3 => { - (*bone).scaleY += (y - (*(*bone).data).scaleY) * alpha; - } - _ => {} - } - } else { - match blend as c_uint { - 0 => { - by = (if (*(*bone).data).scaleY < 0 as c_int as c_float { - -(*(*bone).data).scaleY - } else { - (*(*bone).data).scaleY - }) * (if y < 0 as c_int as c_float { - -1.0f32 - } else { - if y > 0 as c_int as c_float { - 1.0f32 - } else { - 0.0f32 - } - }); - (*bone).scaleY = by + (y - by) * alpha; - } - 1 | 2 => { - by = (if (*bone).scaleY < 0 as c_int as c_float { - -(*bone).scaleY - } else { - (*bone).scaleY - }) * (if y < 0 as c_int as c_float { - -1.0f32 - } else { - if y > 0 as c_int as c_float { - 1.0f32 - } else { - 0.0f32 - } - }); - (*bone).scaleY = by + (y - by) * alpha; - } - 3 => { - (*bone).scaleY += (y - (*(*bone).data).scaleY) * alpha; - } - _ => {} - } - } - }; } #[no_mangle] pub unsafe extern "C" fn spScaleYTimeline_create( @@ -3244,11 +3466,12 @@ pub unsafe extern "C" fn spScaleYTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 868 as c_int, + 829 as c_int, ) as *mut spScaleYTimeline; let mut ids: [spPropertyId; 1] = [0; 1]; - ids[0 as c_int as usize] = - (SP_PROPERTY_SCALEY as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_SCALEY as c_int as spPropertyId) + << 32 as c_int | boneIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, frameCount, @@ -3306,15 +3529,15 @@ pub unsafe extern "C" fn spScaleYTimeline_setFrame( pub unsafe extern "C" fn _spShearTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, - mut _direction: spMixDirection, + mut direction: spMixDirection, ) { - let mut bone: *mut spBone = std::ptr::null_mut(); + let mut bone: *mut spBone = 0 as *mut spBone; let mut x: c_float = 0.; let mut y: c_float = 0.; let mut t: c_float = 0.; @@ -3349,9 +3572,14 @@ pub unsafe extern "C" fn _spShearTimeline_apply( let mut before: c_float = *frames.offset(i as isize); x = *frames.offset((i + 1 as c_int) as isize); y = *frames.offset((i + 2 as c_int) as isize); - t = (time - before) / (*frames.offset((i + 3 as c_int) as isize) - before); - x += (*frames.offset((i + 3 as c_int + 1 as c_int) as isize) - x) * t; - y += (*frames.offset((i + 3 as c_int + 2 as c_int) as isize) - y) * t; + t = (time - before) + / (*frames.offset((i + 3 as c_int) as isize) - before); + x + += (*frames.offset((i + 3 as c_int + 1 as c_int) as isize) + - x) * t; + y + += (*frames.offset((i + 3 as c_int + 2 as c_int) as isize) + - y) * t; } 1 => { x = *frames.offset((i + 1 as c_int) as isize); @@ -3400,13 +3628,15 @@ pub unsafe extern "C" fn spShearTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 956 as c_int, + 917 as c_int, ) as *mut spShearTimeline; let mut ids: [spPropertyId; 2] = [0; 2]; - ids[0 as c_int as usize] = - (SP_PROPERTY_SHEARX as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong; - ids[1 as c_int as usize] = - (SP_PROPERTY_SHEARY as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_SHEARX as c_int as spPropertyId) + << 32 as c_int | boneIndex as c_ulong; + ids[1 as c_int + as usize] = (SP_PROPERTY_SHEARY as c_int as spPropertyId) + << 32 as c_int | boneIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, frameCount, @@ -3465,48 +3695,28 @@ pub unsafe extern "C" fn spShearTimeline_setFrame( pub unsafe extern "C" fn _spShearXTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, - mut _direction: spMixDirection, + mut direction: spMixDirection, ) { - let mut bone: *mut spBone = std::ptr::null_mut(); - let mut x: c_float = 0.; let mut self_0: *mut spShearXTimeline = timeline as *mut spShearXTimeline; - let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items; - bone = *((*skeleton).bones).offset((*self_0).boneIndex as isize); - if (*bone).active == 0 { - return; - } - if time < *frames.offset(0 as c_int as isize) { - match blend as c_uint { - 0 => { - (*bone).shearX = (*(*bone).data).shearX; - return; - } - 1 => { - (*bone).shearX += ((*(*bone).data).shearX - (*bone).shearX) * alpha; - } - _ => {} - } - return; + let mut bone: *mut spBone = *((*skeleton).bones) + .offset((*self_0).boneIndex as isize); + if (*bone).active != 0 { + (*bone) + .shearX = spCurveTimeline1_getRelativeValue( + &mut (*self_0).super_0, + time, + alpha, + blend, + (*bone).shearX, + (*(*bone).data).shearX, + ); } - x = spCurveTimeline1_getCurveValue(&mut (*self_0).super_0, time); - match blend as c_uint { - 0 => { - (*bone).shearX = (*(*bone).data).shearX + x * alpha; - } - 1 | 2 => { - (*bone).shearX += ((*(*bone).data).shearX + x - (*bone).shearX) * alpha; - } - 3 => { - (*bone).shearX += x * alpha; - } - _ => {} - }; } #[no_mangle] pub unsafe extern "C" fn spShearXTimeline_create( @@ -3518,11 +3728,12 @@ pub unsafe extern "C" fn spShearXTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 1016 as c_int, + 948 as c_int, ) as *mut spShearXTimeline; let mut ids: [spPropertyId; 1] = [0; 1]; - ids[0 as c_int as usize] = - (SP_PROPERTY_SHEARX as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_SHEARX as c_int as spPropertyId) + << 32 as c_int | boneIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, frameCount, @@ -3580,48 +3791,28 @@ pub unsafe extern "C" fn spShearXTimeline_setFrame( pub unsafe extern "C" fn _spShearYTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, - mut _direction: spMixDirection, + mut direction: spMixDirection, ) { - let mut bone: *mut spBone = std::ptr::null_mut(); - let mut y: c_float = 0.; let mut self_0: *mut spShearYTimeline = timeline as *mut spShearYTimeline; - let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items; - bone = *((*skeleton).bones).offset((*self_0).boneIndex as isize); - if (*bone).active == 0 { - return; - } - if time < *frames.offset(0 as c_int as isize) { - match blend as c_uint { - 0 => { - (*bone).shearY = (*(*bone).data).shearY; - return; - } - 1 => { - (*bone).shearY += ((*(*bone).data).shearY - (*bone).shearY) * alpha; - } - _ => {} - } - return; + let mut bone: *mut spBone = *((*skeleton).bones) + .offset((*self_0).boneIndex as isize); + if (*bone).active != 0 { + (*bone) + .shearY = spCurveTimeline1_getRelativeValue( + &mut (*self_0).super_0, + time, + alpha, + blend, + (*bone).shearY, + (*(*bone).data).shearY, + ); } - y = spCurveTimeline1_getCurveValue(&mut (*self_0).super_0, time); - match blend as c_uint { - 0 => { - (*bone).shearY = (*(*bone).data).shearY + y * alpha; - } - 1 | 2 => { - (*bone).shearY += ((*(*bone).data).shearY + y - (*bone).shearY) * alpha; - } - 3 => { - (*bone).shearY += y * alpha; - } - _ => {} - }; } #[no_mangle] pub unsafe extern "C" fn spShearYTimeline_create( @@ -3633,11 +3824,12 @@ pub unsafe extern "C" fn spShearYTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 1076 as c_int, + 978 as c_int, ) as *mut spShearYTimeline; let mut ids: [spPropertyId; 1] = [0; 1]; - ids[0 as c_int as usize] = - (SP_PROPERTY_SHEARY as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_SHEARY as c_int as spPropertyId) + << 32 as c_int | boneIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, frameCount, @@ -3700,15 +3892,15 @@ static mut COLOR_A: c_int = 4 as c_int; pub unsafe extern "C" fn _spRGBATimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, - mut _direction: spMixDirection, + mut direction: spMixDirection, ) { - let mut slot: *mut spSlot = std::ptr::null_mut(); + let mut slot: *mut spSlot = 0 as *mut spSlot; let mut i: c_int = 0; let mut curveType: c_int = 0; let mut r: c_float = 0.; @@ -3716,8 +3908,8 @@ pub unsafe extern "C" fn _spRGBATimeline_apply( let mut b: c_float = 0.; let mut a: c_float = 0.; let mut t: c_float = 0.; - let mut color: *mut spColor = std::ptr::null_mut(); - let mut setup: *mut spColor = std::ptr::null_mut(); + let mut color: *mut spColor = 0 as *mut spColor; + let mut setup: *mut spColor = 0 as *mut spColor; let mut self_0: *mut spRGBATimeline = timeline as *mut spRGBATimeline; let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items; let mut curves: *mut c_float = (*(*self_0).super_0.curves).items; @@ -3824,13 +4016,15 @@ pub unsafe extern "C" fn spRGBATimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 1173 as c_int, + 1075 as c_int, ) as *mut spRGBATimeline; let mut ids: [spPropertyId; 2] = [0; 2]; - ids[0 as c_int as usize] = - (SP_PROPERTY_RGB as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong; - ids[1 as c_int as usize] = - (SP_PROPERTY_ALPHA as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_RGB as c_int as spPropertyId) << 32 as c_int + | slotIndex as c_ulong; + ids[1 as c_int + as usize] = (SP_PROPERTY_ALPHA as c_int as spPropertyId) + << 32 as c_int | slotIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, framesCount, @@ -3897,23 +4091,23 @@ pub unsafe extern "C" fn spRGBATimeline_setFrame( pub unsafe extern "C" fn _spRGBTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, - mut _direction: spMixDirection, + mut direction: spMixDirection, ) { - let mut slot: *mut spSlot = std::ptr::null_mut(); + let mut slot: *mut spSlot = 0 as *mut spSlot; let mut i: c_int = 0; let mut curveType: c_int = 0; let mut r: c_float = 0.; let mut g: c_float = 0.; let mut b: c_float = 0.; let mut t: c_float = 0.; - let mut color: *mut spColor = std::ptr::null_mut(); - let mut setup: *mut spColor = std::ptr::null_mut(); + let mut color: *mut spColor = 0 as *mut spColor; + let mut setup: *mut spColor = 0 as *mut spColor; let mut self_0: *mut spRGBTimeline = timeline as *mut spRGBTimeline; let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items; let mut curves: *mut c_float = (*(*self_0).super_0.curves).items; @@ -3950,7 +4144,8 @@ pub unsafe extern "C" fn _spRGBTimeline_apply( r = *frames.offset((i + COLOR_R) as isize); g = *frames.offset((i + COLOR_G) as isize); b = *frames.offset((i + COLOR_B) as isize); - t = (time - before) / (*frames.offset((i + 4 as c_int) as isize) - before); + t = (time - before) + / (*frames.offset((i + 4 as c_int) as isize) - before); r += (*frames.offset((i + 4 as c_int + COLOR_R) as isize) - r) * t; g += (*frames.offset((i + 4 as c_int + COLOR_G) as isize) - g) * t; b += (*frames.offset((i + 4 as c_int + COLOR_B) as isize) - b) * t; @@ -4010,11 +4205,12 @@ pub unsafe extern "C" fn spRGBTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 1279 as c_int, + 1181 as c_int, ) as *mut spRGBTimeline; let mut ids: [spPropertyId; 1] = [0; 1]; - ids[0 as c_int as usize] = - (SP_PROPERTY_RGB as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_RGB as c_int as spPropertyId) << 32 as c_int + | slotIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, framesCount, @@ -4079,18 +4275,18 @@ pub unsafe extern "C" fn spRGBTimeline_setFrame( pub unsafe extern "C" fn _spAlphaTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, - mut _direction: spMixDirection, + mut direction: spMixDirection, ) { - let mut slot: *mut spSlot = std::ptr::null_mut(); + let mut slot: *mut spSlot = 0 as *mut spSlot; let mut a: c_float = 0.; - let mut color: *mut spColor = std::ptr::null_mut(); - let mut setup: *mut spColor = std::ptr::null_mut(); + let mut color: *mut spColor = 0 as *mut spColor; + let mut setup: *mut spColor = 0 as *mut spColor; let mut self_0: *mut spAlphaTimeline = timeline as *mut spAlphaTimeline; let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items; slot = *((*skeleton).slots).offset((*self_0).slotIndex as isize); @@ -4132,11 +4328,12 @@ pub unsafe extern "C" fn spAlphaTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 1342 as c_int, + 1244 as c_int, ) as *mut spAlphaTimeline; let mut ids: [spPropertyId; 1] = [0; 1]; - ids[0 as c_int as usize] = - (SP_PROPERTY_ALPHA as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_ALPHA as c_int as spPropertyId) + << 32 as c_int | slotIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, frameCount, @@ -4198,15 +4395,15 @@ static mut COLOR_B2: c_int = 7 as c_int; pub unsafe extern "C" fn _spRGBA2Timeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, - mut _direction: spMixDirection, + mut direction: spMixDirection, ) { - let mut slot: *mut spSlot = std::ptr::null_mut(); + let mut slot: *mut spSlot = 0 as *mut spSlot; let mut i: c_int = 0; let mut curveType: c_int = 0; let mut r: c_float = 0.; @@ -4217,10 +4414,10 @@ pub unsafe extern "C" fn _spRGBA2Timeline_apply( let mut g2: c_float = 0.; let mut b2: c_float = 0.; let mut t: c_float = 0.; - let mut light: *mut spColor = std::ptr::null_mut(); - let mut setupLight: *mut spColor = std::ptr::null_mut(); - let mut dark: *mut spColor = std::ptr::null_mut(); - let mut setupDark: *mut spColor = std::ptr::null_mut(); + let mut light: *mut spColor = 0 as *mut spColor; + let mut setupLight: *mut spColor = 0 as *mut spColor; + let mut dark: *mut spColor = 0 as *mut spColor; + let mut setupDark: *mut spColor = 0 as *mut spColor; let mut self_0: *mut spRGBA2Timeline = timeline as *mut spRGBA2Timeline; let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items; let mut curves: *mut c_float = (*(*self_0).super_0.curves).items; @@ -4236,7 +4433,12 @@ pub unsafe extern "C" fn _spRGBA2Timeline_apply( match blend as c_uint { 0 => { spColor_setFromColor(light, setupLight); - spColor_setFromFloats3(dark, (*setupDark).r, (*setupDark).g, (*setupDark).b); + spColor_setFromFloats3( + dark, + (*setupDark).r, + (*setupDark).g, + (*setupDark).b, + ); return; } 1 => { @@ -4274,7 +4476,8 @@ pub unsafe extern "C" fn _spRGBA2Timeline_apply( r2 = *frames.offset((i + COLOR_R2) as isize); g2 = *frames.offset((i + COLOR_G2) as isize); b2 = *frames.offset((i + COLOR_B2) as isize); - t = (time - before) / (*frames.offset((i + RGBA2_ENTRIES) as isize) - before); + t = (time - before) + / (*frames.offset((i + RGBA2_ENTRIES) as isize) - before); r += (*frames.offset((i + RGBA2_ENTRIES + COLOR_R) as isize) - r) * t; g += (*frames.offset((i + RGBA2_ENTRIES + COLOR_G) as isize) - g) * t; b += (*frames.offset((i + RGBA2_ENTRIES + COLOR_B) as isize) - b) * t; @@ -4376,15 +4579,18 @@ pub unsafe extern "C" fn spRGBA2Timeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 1469 as c_int, + 1371 as c_int, ) as *mut spRGBA2Timeline; let mut ids: [spPropertyId; 3] = [0; 3]; - ids[0 as c_int as usize] = - (SP_PROPERTY_RGB as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong; - ids[1 as c_int as usize] = - (SP_PROPERTY_ALPHA as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong; - ids[2 as c_int as usize] = - (SP_PROPERTY_RGB2 as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_RGB as c_int as spPropertyId) << 32 as c_int + | slotIndex as c_ulong; + ids[1 as c_int + as usize] = (SP_PROPERTY_ALPHA as c_int as spPropertyId) + << 32 as c_int | slotIndex as c_ulong; + ids[2 as c_int + as usize] = (SP_PROPERTY_RGB2 as c_int as spPropertyId) + << 32 as c_int | slotIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, framesCount, @@ -4461,15 +4667,15 @@ static mut COLOR2_B2: c_int = 7 as c_int; pub unsafe extern "C" fn _spRGB2Timeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, - mut _direction: spMixDirection, + mut direction: spMixDirection, ) { - let mut slot: *mut spSlot = std::ptr::null_mut(); + let mut slot: *mut spSlot = 0 as *mut spSlot; let mut i: c_int = 0; let mut curveType: c_int = 0; let mut r: c_float = 0.; @@ -4479,10 +4685,10 @@ pub unsafe extern "C" fn _spRGB2Timeline_apply( let mut g2: c_float = 0.; let mut b2: c_float = 0.; let mut t: c_float = 0.; - let mut light: *mut spColor = std::ptr::null_mut(); - let mut setupLight: *mut spColor = std::ptr::null_mut(); - let mut dark: *mut spColor = std::ptr::null_mut(); - let mut setupDark: *mut spColor = std::ptr::null_mut(); + let mut light: *mut spColor = 0 as *mut spColor; + let mut setupLight: *mut spColor = 0 as *mut spColor; + let mut dark: *mut spColor = 0 as *mut spColor; + let mut setupDark: *mut spColor = 0 as *mut spColor; let mut self_0: *mut spRGB2Timeline = timeline as *mut spRGB2Timeline; let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items; let mut curves: *mut c_float = (*(*self_0).super_0.curves).items; @@ -4625,13 +4831,15 @@ pub unsafe extern "C" fn spRGB2Timeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 1602 as c_int, + 1504 as c_int, ) as *mut spRGB2Timeline; let mut ids: [spPropertyId; 2] = [0; 2]; - ids[0 as c_int as usize] = - (SP_PROPERTY_RGB as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong; - ids[1 as c_int as usize] = - (SP_PROPERTY_RGB2 as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_RGB as c_int as spPropertyId) << 32 as c_int + | slotIndex as c_ulong; + ids[1 as c_int + as usize] = (SP_PROPERTY_RGB2 as c_int as spPropertyId) + << 32 as c_int | slotIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, framesCount, @@ -4707,9 +4915,13 @@ unsafe extern "C" fn _spSetAttachment( spSlot_setAttachment( slot, if attachmentName.is_null() { - std::ptr::null_mut() + 0 as *mut spAttachment } else { - spSkeleton_getAttachmentForSlotIndex(skeleton, (*timeline).slotIndex, attachmentName) + spSkeleton_getAttachmentForSlotIndex( + skeleton, + (*timeline).slotIndex, + attachmentName, + ) }, ); } @@ -4717,18 +4929,19 @@ unsafe extern "C" fn _spSetAttachment( pub unsafe extern "C" fn _spAttachmentTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, - mut _alpha: c_float, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, + mut alpha: c_float, mut blend: spMixBlend, mut direction: spMixDirection, ) { - let mut attachmentName: *const c_char = std::ptr::null(); + let mut attachmentName: *const c_char = 0 as *const c_char; let mut self_0: *mut spAttachmentTimeline = timeline as *mut spAttachmentTimeline; let mut frames: *mut c_float = (*(*self_0).super_0.frames).items; - let mut slot: *mut spSlot = *((*skeleton).slots).offset((*self_0).slotIndex as isize); + let mut slot: *mut spSlot = *((*skeleton).slots) + .offset((*self_0).slotIndex as isize); if (*(*slot).bone).active == 0 { return; } @@ -4754,8 +4967,8 @@ pub unsafe extern "C" fn _spAttachmentTimeline_apply( } return; } - attachmentName = - *((*self_0).attachmentNames).offset(search((*self_0).super_0.frames, time) as isize); + attachmentName = *((*self_0).attachmentNames) + .offset(search((*self_0).super_0.frames, time) as isize); _spSetAttachment(self_0, skeleton, slot, attachmentName); } #[no_mangle] @@ -4778,11 +4991,12 @@ pub unsafe extern "C" fn spAttachmentTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 1679 as c_int, + 1581 as c_int, ) as *mut spAttachmentTimeline; let mut ids: [spPropertyId; 1] = [0; 1]; - ids[0 as c_int as usize] = - (SP_PROPERTY_ATTACHMENT as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_ATTACHMENT as c_int as spPropertyId) + << 32 as c_int | slotIndex as c_ulong; _spTimeline_init( &mut (*self_0).super_0, framesCount, @@ -4790,7 +5004,9 @@ pub unsafe extern "C" fn spAttachmentTimeline_create( ids.as_mut_ptr(), 1 as c_int, SP_TIMELINE_ATTACHMENT, - Some(_spAttachmentTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()), + Some( + _spAttachmentTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> (), + ), Some( _spAttachmentTimeline_apply as unsafe extern "C" fn( @@ -4807,12 +5023,12 @@ pub unsafe extern "C" fn spAttachmentTimeline_create( ), None, ); - let ref mut fresh4 = *(&mut (*self_0).attachmentNames as *mut *mut *mut c_char); - *fresh4 = _spCalloc( + (*self_0) + .attachmentNames = _spCalloc( framesCount as size_t, ::core::mem::size_of::<*mut c_char>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 1684 as c_int, + 1586 as c_int, ) as *mut *mut c_char; (*self_0).slotIndex = slotIndex; return self_0; @@ -4827,18 +5043,20 @@ pub unsafe extern "C" fn spAttachmentTimeline_setFrame( *((*(*self_0).super_0.frames).items).offset(frame as isize) = time; _spFree(*((*self_0).attachmentNames).offset(frame as isize) as *mut c_void); if !attachmentName.is_null() { - let ref mut fresh5 = - *(&mut *((*self_0).attachmentNames).offset(frame as isize) as *mut *mut c_char); - *fresh5 = _spMalloc( + let ref mut fresh3 = *((*self_0).attachmentNames).offset(frame as isize); + *fresh3 = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(attachmentName)).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen(attachmentName)) + .wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 1694 as c_int, + 1596 as c_int, ) as *mut c_char; - spine_strcpy(*fresh5, attachmentName); + spine_strcpy(*fresh3, attachmentName); } else { - let ref mut fresh6 = *((*self_0).attachmentNames).offset(frame as isize); - *fresh6 = std::ptr::null_mut(); + let ref mut fresh4 = *((*self_0).attachmentNames).offset(frame as isize); + *fresh4 = 0 as *mut c_char; }; } #[no_mangle] @@ -4848,31 +5066,34 @@ pub unsafe extern "C" fn _spDeformTimeline_setBezier( mut frame: c_int, mut value: c_float, mut time1: c_float, - mut _value1: c_float, + mut value1: c_float, mut cx1: c_float, mut cy1: c_float, mut cx2: c_float, mut cy2: c_float, mut time2: c_float, - mut _value2: c_float, + mut value2: c_float, ) { let mut self_0: *mut spDeformTimeline = timeline as *mut spDeformTimeline; let mut n: c_int = 0; - let mut i: c_int = (*self_0).super_0.super_0.frameCount + bezier * 18 as c_int; + let mut i: c_int = (*self_0).super_0.super_0.frameCount + + bezier * 18 as c_int; let mut curves: *mut c_float = (*(*self_0).super_0.curves).items; - let mut tmpx: c_float = - ((time1 - cx1 * 2 as c_int as c_float + cx2) as c_double * 0.03f64) as c_float; - let mut tmpy: c_float = (cy2 as c_double * 0.03f64 - cy1 as c_double * 0.06f64) as c_float; - let mut dddx: c_float = - (((cx1 - cx2) * 3 as c_int as c_float - time1 + time2) as c_double * 0.006f64) as c_float; - let mut dddy: c_float = (((cy1 - cy2) as c_double + 0.33333333f64) * 0.018f64) as c_float; + let mut tmpx: c_float = ((time1 - cx1 * 2 as c_int as c_float + + cx2) as c_double * 0.03f64) as c_float; + let mut tmpy: c_float = (cy2 as c_double * 0.03f64 + - cy1 as c_double * 0.06f64) as c_float; + let mut dddx: c_float = (((cx1 - cx2) * 3 as c_int as c_float + - time1 + time2) as c_double * 0.006f64) as c_float; + let mut dddy: c_float = (((cy1 - cy2) as c_double + 0.33333333f64) + * 0.018f64) as c_float; let mut ddx: c_float = tmpx * 2 as c_int as c_float + dddx; let mut ddy: c_float = tmpy * 2 as c_int as c_float + dddy; let mut dx: c_float = ((cx1 - time1) as c_double * 0.3f64 - + tmpx as c_double - + dddx as c_double * 0.16666667f64) as c_float; - let mut dy: c_float = - (cy1 as c_double * 0.3f64 + tmpy as c_double + dddy as c_double * 0.16666667f64) as c_float; + + tmpx as c_double + dddx as c_double * 0.16666667f64) + as c_float; + let mut dy: c_float = (cy1 as c_double * 0.3f64 + tmpy as c_double + + dddy as c_double * 0.16666667f64) as c_float; let mut x: c_float = time1 + dx; let mut y: c_float = dy; if value == 0 as c_int as c_float { @@ -4940,26 +5161,27 @@ pub unsafe extern "C" fn _spDeformTimeline_getCurvePercent( pub unsafe extern "C" fn _spDeformTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, - mut _direction: spMixDirection, + mut direction: spMixDirection, ) { let mut frame: c_int = 0; let mut i: c_int = 0; let mut vertexCount: c_int = 0; let mut percent: c_float = 0.; - let mut prevVertices: *const c_float = std::ptr::null(); - let mut nextVertices: *const c_float = std::ptr::null(); - let mut frames: *mut c_float = std::ptr::null_mut(); + let mut prevVertices: *const c_float = 0 as *const c_float; + let mut nextVertices: *const c_float = 0 as *const c_float; + let mut frames: *mut c_float = 0 as *mut c_float; let mut framesCount: c_int = 0; - let mut frameVertices: *mut *mut c_float = std::ptr::null_mut(); - let mut deformArray: *mut c_float = std::ptr::null_mut(); + let mut frameVertices: *mut *mut c_float = 0 as *mut *mut c_float; + let mut deformArray: *mut c_float = 0 as *mut c_float; let mut self_0: *mut spDeformTimeline = timeline as *mut spDeformTimeline; - let mut slot: *mut spSlot = *((*skeleton).slots).offset((*self_0).slotIndex as isize); + let mut slot: *mut spSlot = *((*skeleton).slots) + .offset((*self_0).slotIndex as isize); if (*(*slot).bone).active == 0 { return; } @@ -4968,8 +5190,8 @@ pub unsafe extern "C" fn _spDeformTimeline_apply( } match (*(*slot).attachment).type_0 as c_uint { 1 | 6 | 2 | 4 => { - let mut vertexAttachment: *mut spVertexAttachment = - (*slot).attachment as *mut spVertexAttachment; + let mut vertexAttachment: *mut spVertexAttachment = (*slot).attachment + as *mut spVertexAttachment; if (*vertexAttachment).timelineAttachment != (*self_0).attachment { return; } @@ -4982,10 +5204,12 @@ pub unsafe extern "C" fn _spDeformTimeline_apply( if (*slot).deformCount < vertexCount { if (*slot).deformCapacity < vertexCount { _spFree((*slot).deform as *mut c_void); - (*slot).deform = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul(vertexCount as c_ulong), + (*slot) + .deform = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul(vertexCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 1797 as c_int, + 1699 as c_int, ) as *mut c_float; (*slot).deformCapacity = vertexCount; } @@ -4996,8 +5220,8 @@ pub unsafe extern "C" fn _spDeformTimeline_apply( frameVertices = (*self_0).frameVertices; deformArray = (*slot).deform; if time < *frames.offset(0 as c_int as isize) { - let mut vertexAttachment_0: *mut spVertexAttachment = - (*slot).attachment as *mut spVertexAttachment; + let mut vertexAttachment_0: *mut spVertexAttachment = (*slot).attachment + as *mut spVertexAttachment; match blend as c_uint { 0 => { (*slot).deformCount = 0 as c_int; @@ -5010,12 +5234,13 @@ pub unsafe extern "C" fn _spDeformTimeline_apply( } (*slot).deformCount = vertexCount; if ((*vertexAttachment_0).bones).is_null() { - let mut setupVertices: *mut c_float = (*vertexAttachment_0).vertices; + let mut setupVertices: *mut c_float = (*vertexAttachment_0) + .vertices; i = 0 as c_int; while i < vertexCount { - *deformArray.offset(i as isize) += (*setupVertices.offset(i as isize) - - *deformArray.offset(i as isize)) - * alpha; + *deformArray.offset(i as isize) + += (*setupVertices.offset(i as isize) + - *deformArray.offset(i as isize)) * alpha; i += 1; } } else { @@ -5033,24 +5258,27 @@ pub unsafe extern "C" fn _spDeformTimeline_apply( } (*slot).deformCount = vertexCount; if time >= *frames.offset((framesCount - 1 as c_int) as isize) { - let mut lastVertices: *const c_float = - *((*self_0).frameVertices).offset((framesCount - 1 as c_int) as isize); + let mut lastVertices: *const c_float = *((*self_0).frameVertices) + .offset((framesCount - 1 as c_int) as isize); if alpha == 1 as c_int as c_float { if blend as c_uint == SP_MIX_BLEND_ADD as c_int as c_uint { - let mut vertexAttachment_1: *mut spVertexAttachment = - (*slot).attachment as *mut spVertexAttachment; + let mut vertexAttachment_1: *mut spVertexAttachment = (*slot).attachment + as *mut spVertexAttachment; if ((*vertexAttachment_1).bones).is_null() { - let mut setupVertices_0: *mut c_float = (*vertexAttachment_1).vertices; + let mut setupVertices_0: *mut c_float = (*vertexAttachment_1) + .vertices; i = 0 as c_int; while i < vertexCount { - *deformArray.offset(i as isize) += - *lastVertices.offset(i as isize) - *setupVertices_0.offset(i as isize); + *deformArray.offset(i as isize) + += *lastVertices.offset(i as isize) + - *setupVertices_0.offset(i as isize); i += 1; } } else { i = 0 as c_int; while i < vertexCount { - *deformArray.offset(i as isize) += *lastVertices.offset(i as isize); + *deformArray.offset(i as isize) + += *lastVertices.offset(i as isize); i += 1; } } @@ -5059,28 +5287,38 @@ pub unsafe extern "C" fn _spDeformTimeline_apply( deformArray as *mut c_void, lastVertices as *const c_void, (vertexCount as c_ulong) - .wrapping_mul(::core::mem::size_of::() as c_ulong), + .wrapping_mul( + ::core::mem::size_of::() as c_ulong, + ), ); } } else { - let mut vertexAttachment_2: *mut spVertexAttachment = std::ptr::null_mut(); + let mut vertexAttachment_2: *mut spVertexAttachment = 0 + as *mut spVertexAttachment; match blend as c_uint { 0 => { vertexAttachment_2 = (*slot).attachment as *mut spVertexAttachment; if ((*vertexAttachment_2).bones).is_null() { - let mut setupVertices_1: *mut c_float = (*vertexAttachment_2).vertices; + let mut setupVertices_1: *mut c_float = (*vertexAttachment_2) + .vertices; i = 0 as c_int; while i < vertexCount { - let mut setup: c_float = *setupVertices_1.offset(i as isize); - *deformArray.offset(i as isize) = - setup + (*lastVertices.offset(i as isize) - setup) * alpha; + let mut setup: c_float = *setupVertices_1 + .offset(i as isize); + *deformArray + .offset( + i as isize, + ) = setup + + (*lastVertices.offset(i as isize) - setup) * alpha; i += 1; } } else { i = 0 as c_int; while i < vertexCount { - *deformArray.offset(i as isize) = - *lastVertices.offset(i as isize) * alpha; + *deformArray + .offset( + i as isize, + ) = *lastVertices.offset(i as isize) * alpha; i += 1; } } @@ -5088,28 +5326,29 @@ pub unsafe extern "C" fn _spDeformTimeline_apply( 1 | 2 => { i = 0 as c_int; while i < vertexCount { - *deformArray.offset(i as isize) += (*lastVertices.offset(i as isize) - - *deformArray.offset(i as isize)) - * alpha; + *deformArray.offset(i as isize) + += (*lastVertices.offset(i as isize) + - *deformArray.offset(i as isize)) * alpha; i += 1; } } 3 => { vertexAttachment_2 = (*slot).attachment as *mut spVertexAttachment; if ((*vertexAttachment_2).bones).is_null() { - let mut setupVertices_2: *mut c_float = (*vertexAttachment_2).vertices; + let mut setupVertices_2: *mut c_float = (*vertexAttachment_2) + .vertices; i = 0 as c_int; while i < vertexCount { - *deformArray.offset(i as isize) += (*lastVertices.offset(i as isize) - - *setupVertices_2.offset(i as isize)) - * alpha; + *deformArray.offset(i as isize) + += (*lastVertices.offset(i as isize) + - *setupVertices_2.offset(i as isize)) * alpha; i += 1; } } else { i = 0 as c_int; while i < vertexCount { - *deformArray.offset(i as isize) += - *lastVertices.offset(i as isize) * alpha; + *deformArray.offset(i as isize) + += *lastVertices.offset(i as isize) * alpha; i += 1; } } @@ -5125,24 +5364,26 @@ pub unsafe extern "C" fn _spDeformTimeline_apply( nextVertices = *frameVertices.offset((frame + 1 as c_int) as isize); if alpha == 1 as c_int as c_float { if blend as c_uint == SP_MIX_BLEND_ADD as c_int as c_uint { - let mut vertexAttachment_3: *mut spVertexAttachment = - (*slot).attachment as *mut spVertexAttachment; + let mut vertexAttachment_3: *mut spVertexAttachment = (*slot).attachment + as *mut spVertexAttachment; if ((*vertexAttachment_3).bones).is_null() { - let mut setupVertices_3: *mut c_float = (*vertexAttachment_3).vertices; + let mut setupVertices_3: *mut c_float = (*vertexAttachment_3) + .vertices; i = 0 as c_int; while i < vertexCount { let mut prev: c_float = *prevVertices.offset(i as isize); - *deformArray.offset(i as isize) += prev - + (*nextVertices.offset(i as isize) - prev) * percent - - *setupVertices_3.offset(i as isize); + *deformArray.offset(i as isize) + += prev + (*nextVertices.offset(i as isize) - prev) * percent + - *setupVertices_3.offset(i as isize); i += 1; } } else { i = 0 as c_int; while i < vertexCount { let mut prev_0: c_float = *prevVertices.offset(i as isize); - *deformArray.offset(i as isize) += - prev_0 + (*nextVertices.offset(i as isize) - prev_0) * percent; + *deformArray.offset(i as isize) + += prev_0 + + (*nextVertices.offset(i as isize) - prev_0) * percent; i += 1; } } @@ -5150,33 +5391,44 @@ pub unsafe extern "C" fn _spDeformTimeline_apply( i = 0 as c_int; while i < vertexCount { let mut prev_1: c_float = *prevVertices.offset(i as isize); - *deformArray.offset(i as isize) = - prev_1 + (*nextVertices.offset(i as isize) - prev_1) * percent; + *deformArray + .offset( + i as isize, + ) = prev_1 + (*nextVertices.offset(i as isize) - prev_1) * percent; i += 1; } } } else { - let mut vertexAttachment_4: *mut spVertexAttachment = std::ptr::null_mut(); + let mut vertexAttachment_4: *mut spVertexAttachment = 0 + as *mut spVertexAttachment; match blend as c_uint { 0 => { vertexAttachment_4 = (*slot).attachment as *mut spVertexAttachment; if ((*vertexAttachment_4).bones).is_null() { - let mut setupVertices_4: *mut c_float = (*vertexAttachment_4).vertices; + let mut setupVertices_4: *mut c_float = (*vertexAttachment_4) + .vertices; i = 0 as c_int; while i < vertexCount { let mut prev_2: c_float = *prevVertices.offset(i as isize); - let mut setup_0: c_float = *setupVertices_4.offset(i as isize); - *deformArray.offset(i as isize) = setup_0 - + (prev_2 + (*nextVertices.offset(i as isize) - prev_2) * percent - - setup_0) - * alpha; + let mut setup_0: c_float = *setupVertices_4 + .offset(i as isize); + *deformArray + .offset( + i as isize, + ) = setup_0 + + (prev_2 + + (*nextVertices.offset(i as isize) - prev_2) * percent + - setup_0) * alpha; i += 1; } } else { i = 0 as c_int; while i < vertexCount { let mut prev_3: c_float = *prevVertices.offset(i as isize); - *deformArray.offset(i as isize) = (prev_3 + *deformArray + .offset( + i as isize, + ) = (prev_3 + (*nextVertices.offset(i as isize) - prev_3) * percent) * alpha; i += 1; @@ -5187,33 +5439,35 @@ pub unsafe extern "C" fn _spDeformTimeline_apply( i = 0 as c_int; while i < vertexCount { let mut prev_4: c_float = *prevVertices.offset(i as isize); - *deformArray.offset(i as isize) += (prev_4 - + (*nextVertices.offset(i as isize) - prev_4) * percent - - *deformArray.offset(i as isize)) - * alpha; + *deformArray.offset(i as isize) + += (prev_4 + + (*nextVertices.offset(i as isize) - prev_4) * percent + - *deformArray.offset(i as isize)) * alpha; i += 1; } } 3 => { vertexAttachment_4 = (*slot).attachment as *mut spVertexAttachment; if ((*vertexAttachment_4).bones).is_null() { - let mut setupVertices_5: *mut c_float = (*vertexAttachment_4).vertices; + let mut setupVertices_5: *mut c_float = (*vertexAttachment_4) + .vertices; i = 0 as c_int; while i < vertexCount { let mut prev_5: c_float = *prevVertices.offset(i as isize); - *deformArray.offset(i as isize) += (prev_5 - + (*nextVertices.offset(i as isize) - prev_5) * percent - - *setupVertices_5.offset(i as isize)) - * alpha; + *deformArray.offset(i as isize) + += (prev_5 + + (*nextVertices.offset(i as isize) - prev_5) * percent + - *setupVertices_5.offset(i as isize)) * alpha; i += 1; } } else { i = 0 as c_int; while i < vertexCount { let mut prev_6: c_float = *prevVertices.offset(i as isize); - *deformArray.offset(i as isize) += (prev_6 - + (*nextVertices.offset(i as isize) - prev_6) * percent) - * alpha; + *deformArray.offset(i as isize) + += (prev_6 + + (*nextVertices.offset(i as isize) - prev_6) * percent) + * alpha; i += 1; } } @@ -5246,12 +5500,14 @@ pub unsafe extern "C" fn spDeformTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 1983 as c_int, + 1885 as c_int, ) as *mut spDeformTimeline; let mut ids: [spPropertyId; 1] = [0; 1]; - ids[0 as c_int as usize] = (SP_PROPERTY_DEFORM as c_int as spPropertyId) << 32 as c_int - | ((slotIndex << 16 as c_int | (*attachment).id) as c_uint & 0xffffffff as c_uint) - as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_DEFORM as c_int as spPropertyId) + << 32 as c_int + | ((slotIndex << 16 as c_int | (*attachment).id) as c_uint + & 0xffffffff as c_uint) as c_ulong; _spCurveTimeline_init( &mut (*self_0).super_0, framesCount, @@ -5293,14 +5549,14 @@ pub unsafe extern "C" fn spDeformTimeline_create( ) -> (), ), ); - let ref mut fresh7 = *(&mut (*self_0).frameVertices as *mut *mut *mut c_float); - *fresh7 = _spCalloc( + (*self_0) + .frameVertices = _spCalloc( framesCount as size_t, ::core::mem::size_of::<*mut c_float>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 1988 as c_int, + 1890 as c_int, ) as *mut *mut c_float; - *(&mut (*self_0).frameVerticesCount as *mut c_int) = frameVerticesCount; + (*self_0).frameVerticesCount = frameVerticesCount; (*self_0).slotIndex = slotIndex; (*self_0).attachment = &mut (*attachment).super_0; return self_0; @@ -5315,19 +5571,18 @@ pub unsafe extern "C" fn spDeformTimeline_setFrame( *((*(*self_0).super_0.super_0.frames).items).offset(frame as isize) = time; _spFree(*((*self_0).frameVertices).offset(frame as isize) as *mut c_void); if vertices.is_null() { - let ref mut fresh8 = *((*self_0).frameVertices).offset(frame as isize); - *fresh8 = std::ptr::null_mut(); + let ref mut fresh5 = *((*self_0).frameVertices).offset(frame as isize); + *fresh5 = 0 as *mut c_float; } else { - let ref mut fresh9 = *((*self_0).frameVertices).offset(frame as isize); - *fresh9 = _spMalloc( + let ref mut fresh6 = *((*self_0).frameVertices).offset(frame as isize); + *fresh6 = _spMalloc( (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).frameVerticesCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 2002 as c_int, + 1904 as c_int, ) as *mut c_float; spine_memcpy( - *(&mut *((*self_0).frameVertices).offset(frame as isize) as *mut *mut c_float) - as *mut c_void, + *((*self_0).frameVertices).offset(frame as isize) as *mut c_void, vertices as *const c_void, ((*self_0).frameVerticesCount as c_ulong) .wrapping_mul(::core::mem::size_of::() as c_ulong), @@ -5341,18 +5596,19 @@ static mut DELAY: c_int = 2 as c_int; pub unsafe extern "C" fn _spSequenceTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, - mut _alpha: c_float, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, + mut alpha: c_float, mut blend: spMixBlend, - mut _direction: spMixDirection, + mut direction: spMixDirection, ) { let mut self_0: *mut spSequenceTimeline = timeline as *mut spSequenceTimeline; - let mut slot: *mut spSlot = *((*skeleton).slots).offset((*self_0).slotIndex as isize); - let mut slotAttachment: *mut spAttachment = std::ptr::null_mut(); - let mut frames: *mut c_float = std::ptr::null_mut(); + let mut slot: *mut spSlot = *((*skeleton).slots) + .offset((*self_0).slotIndex as isize); + let mut slotAttachment: *mut spAttachment = 0 as *mut spAttachment; + let mut frames: *mut c_float = 0 as *mut c_float; let mut i: c_int = 0; let mut modeAndIndex: c_int = 0; let mut count: c_int = 0; @@ -5360,7 +5616,7 @@ pub unsafe extern "C" fn _spSequenceTimeline_apply( let mut mode: c_int = 0; let mut before: c_float = 0.; let mut delay: c_float = 0.; - let mut sequence: *mut spSequence = std::ptr::null_mut(); + let mut sequence: *mut spSequence = 0 as *mut spSequence; if (*(*slot).bone).active == 0 { return; } @@ -5371,8 +5627,8 @@ pub unsafe extern "C" fn _spSequenceTimeline_apply( } match (*slotAttachment).type_0 as c_uint { 1 | 6 | 2 | 4 => { - let mut vertexAttachment: *mut spVertexAttachment = - (*slot).attachment as *mut spVertexAttachment; + let mut vertexAttachment: *mut spVertexAttachment = (*slot).attachment + as *mut spVertexAttachment; if (*vertexAttachment).timelineAttachment != (*self_0).attachment { return; } @@ -5393,10 +5649,14 @@ pub unsafe extern "C" fn _spSequenceTimeline_apply( before = *frames.offset(i as isize); modeAndIndex = *frames.offset((i + MODE) as isize) as c_int; delay = *frames.offset((i + DELAY) as isize); - if (*(*self_0).attachment).type_0 as c_uint == SP_ATTACHMENT_REGION as c_int as c_uint { + if (*(*self_0).attachment).type_0 as c_uint + == SP_ATTACHMENT_REGION as c_int as c_uint + { sequence = (*((*self_0).attachment as *mut spRegionAttachment)).sequence; } - if (*(*self_0).attachment).type_0 as c_uint == SP_ATTACHMENT_MESH as c_int as c_uint { + if (*(*self_0).attachment).type_0 as c_uint + == SP_ATTACHMENT_MESH as c_int as c_uint + { sequence = (*((*self_0).attachment as *mut spMeshAttachment)).sequence; } if sequence.is_null() { @@ -5406,7 +5666,8 @@ pub unsafe extern "C" fn _spSequenceTimeline_apply( count = (*(*sequence).regions).size; mode = modeAndIndex & 0xf as c_int; if mode != 0 as c_int { - index += (((time - before) / delay) as c_double + 0.00001f64) as c_int; + index + += (((time - before) / delay) as c_double + 0.0001f64) as c_int; match mode { 1 => { index = if (count - 1 as c_int) < index { @@ -5420,11 +5681,7 @@ pub unsafe extern "C" fn _spSequenceTimeline_apply( } 3 => { let mut n: c_int = (count << 1 as c_int) - 2 as c_int; - index = if n == 0 as c_int { - 0 as c_int - } else { - index % n - }; + index = if n == 0 as c_int { 0 as c_int } else { index % n }; if index >= count { index = n - index; } @@ -5440,7 +5697,8 @@ pub unsafe extern "C" fn _spSequenceTimeline_apply( index = count - 1 as c_int - index % count; } 6 => { - let mut n_0: c_int = (count << 1 as c_int) - 2 as c_int; + let mut n_0: c_int = (count << 1 as c_int) + - 2 as c_int; index = if n_0 == 0 as c_int { 0 as c_int } else { @@ -5456,7 +5714,7 @@ pub unsafe extern "C" fn _spSequenceTimeline_apply( (*slot).sequenceIndex = index; } #[no_mangle] -pub unsafe extern "C" fn _spSequenceTimeline_dispose(mut _timeline: *mut spTimeline) {} +pub unsafe extern "C" fn _spSequenceTimeline_dispose(mut timeline: *mut spTimeline) {} #[no_mangle] pub unsafe extern "C" fn spSequenceTimeline_create( mut framesCount: c_int, @@ -5468,17 +5726,24 @@ pub unsafe extern "C" fn spSequenceTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 2101 as c_int, + 2003 as c_int, ) as *mut spSequenceTimeline; let mut ids: [spPropertyId; 1] = [0; 1]; - if (*attachment).type_0 as c_uint == SP_ATTACHMENT_REGION as c_int as c_uint { + if (*attachment).type_0 as c_uint + == SP_ATTACHMENT_REGION as c_int as c_uint + { sequenceId = (*(*(attachment as *mut spRegionAttachment)).sequence).id; } - if (*attachment).type_0 as c_uint == SP_ATTACHMENT_MESH as c_int as c_uint { + if (*attachment).type_0 as c_uint + == SP_ATTACHMENT_MESH as c_int as c_uint + { sequenceId = (*(*(attachment as *mut spMeshAttachment)).sequence).id; } - ids[0 as c_int as usize] = (SP_PROPERTY_SEQUENCE as c_int as spPropertyId) << 32 as c_int - | ((slotIndex << 16 as c_int | sequenceId) as c_uint & 0xffffffff as c_uint) as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_SEQUENCE as c_int as spPropertyId) + << 32 as c_int + | ((slotIndex << 16 as c_int | sequenceId) as c_uint + & 0xffffffff as c_uint) as c_ulong; _spTimeline_init( &mut (*self_0).super_0, framesCount, @@ -5519,7 +5784,10 @@ pub unsafe extern "C" fn spSequenceTimeline_setFrame( let mut frames: *mut c_float = (*(*self_0).super_0.frames).items; frame *= SEQUENCE_ENTRIES; *frames.offset(frame as isize) = time; - *frames.offset((frame + MODE) as isize) = (mode | index << 4 as c_int) as c_float; + *frames + .offset( + (frame + MODE) as isize, + ) = (mode | index << 4 as c_int) as c_float; *frames.offset((frame + DELAY) as isize) = delay; } #[no_mangle] @@ -5555,7 +5823,7 @@ pub unsafe extern "C" fn _spEventTimeline_apply( ); lastTime = -(1 as c_int) as c_float; } else if lastTime >= *frames.offset((framesCount - 1 as c_int) as isize) { - return; + return } if time < *frames.offset(0 as c_int as isize) { return; @@ -5574,8 +5842,8 @@ pub unsafe extern "C" fn _spEventTimeline_apply( } } while i < framesCount && time >= *frames.offset(i as isize) { - let ref mut fresh10 = *firedEvents.offset(*eventsCount as isize); - *fresh10 = *((*self_0).events).offset(i as isize); + let ref mut fresh7 = *firedEvents.offset(*eventsCount as isize); + *fresh7 = *((*self_0).events).offset(i as isize); *eventsCount += 1; i += 1; } @@ -5592,15 +5860,19 @@ pub unsafe extern "C" fn _spEventTimeline_dispose(mut timeline: *mut spTimeline) _spFree((*self_0).events as *mut c_void); } #[no_mangle] -pub unsafe extern "C" fn spEventTimeline_create(mut framesCount: c_int) -> *mut spEventTimeline { +pub unsafe extern "C" fn spEventTimeline_create( + mut framesCount: c_int, +) -> *mut spEventTimeline { let mut self_0: *mut spEventTimeline = _spCalloc( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 2171 as c_int, + 2073 as c_int, ) as *mut spEventTimeline; let mut ids: [spPropertyId; 1] = [0; 1]; - ids[0 as c_int as usize] = (SP_PROPERTY_EVENT as c_int as spPropertyId) << 32 as c_int; + ids[0 as c_int + as usize] = (SP_PROPERTY_EVENT as c_int as spPropertyId) + << 32 as c_int; _spTimeline_init( &mut (*self_0).super_0, framesCount, @@ -5625,12 +5897,12 @@ pub unsafe extern "C" fn spEventTimeline_create(mut framesCount: c_int) -> *mut ), None, ); - let ref mut fresh11 = *(&mut (*self_0).events as *mut *mut *mut spEvent); - *fresh11 = _spCalloc( + (*self_0) + .events = _spCalloc( framesCount as size_t, ::core::mem::size_of::<*mut spEvent>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 2176 as c_int, + 2078 as c_int, ) as *mut *mut spEvent; return self_0; } @@ -5642,23 +5914,23 @@ pub unsafe extern "C" fn spEventTimeline_setFrame( ) { *((*(*self_0).super_0.frames).items).offset(frame as isize) = (*event).time; _spFree(*((*self_0).events).offset(frame as isize) as *mut c_void); - let ref mut fresh12 = *((*self_0).events).offset(frame as isize); - *fresh12 = event; + let ref mut fresh8 = *((*self_0).events).offset(frame as isize); + *fresh8 = event; } #[no_mangle] pub unsafe extern "C" fn _spDrawOrderTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, - mut _alpha: c_float, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, + mut alpha: c_float, mut blend: spMixBlend, mut direction: spMixDirection, ) { let mut i: c_int = 0; - let mut drawOrderToSetupIndex: *const c_int = std::ptr::null(); + let mut drawOrderToSetupIndex: *const c_int = 0 as *const c_int; let mut self_0: *mut spDrawOrderTimeline = timeline as *mut spDrawOrderTimeline; let mut frames: *mut c_float = (*(*self_0).super_0.frames).items; if direction as c_uint == SP_MIX_DIRECTION_OUT as c_int as c_uint { @@ -5685,8 +5957,8 @@ pub unsafe extern "C" fn _spDrawOrderTimeline_apply( } return; } - drawOrderToSetupIndex = - *((*self_0).drawOrders).offset(search((*self_0).super_0.frames, time) as isize); + drawOrderToSetupIndex = *((*self_0).drawOrders) + .offset(search((*self_0).super_0.frames, time) as isize); if drawOrderToSetupIndex.is_null() { spine_memcpy( (*skeleton).drawOrder as *mut c_void, @@ -5697,9 +5969,9 @@ pub unsafe extern "C" fn _spDrawOrderTimeline_apply( } else { i = 0 as c_int; while i < (*self_0).slotsCount { - let ref mut fresh13 = *((*skeleton).drawOrder).offset(i as isize); - *fresh13 = - *((*skeleton).slots).offset(*drawOrderToSetupIndex.offset(i as isize) as isize); + let ref mut fresh9 = *((*skeleton).drawOrder).offset(i as isize); + *fresh9 = *((*skeleton).slots) + .offset(*drawOrderToSetupIndex.offset(i as isize) as isize); i += 1; } }; @@ -5724,10 +5996,12 @@ pub unsafe extern "C" fn spDrawOrderTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 2233 as c_int, + 2135 as c_int, ) as *mut spDrawOrderTimeline; let mut ids: [spPropertyId; 1] = [0; 1]; - ids[0 as c_int as usize] = (SP_PROPERTY_DRAWORDER as c_int as spPropertyId) << 32 as c_int; + ids[0 as c_int + as usize] = (SP_PROPERTY_DRAWORDER as c_int as spPropertyId) + << 32 as c_int; _spTimeline_init( &mut (*self_0).super_0, framesCount, @@ -5735,7 +6009,9 @@ pub unsafe extern "C" fn spDrawOrderTimeline_create( ids.as_mut_ptr(), 1 as c_int, SP_TIMELINE_DRAWORDER, - Some(_spDrawOrderTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()), + Some( + _spDrawOrderTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> (), + ), Some( _spDrawOrderTimeline_apply as unsafe extern "C" fn( @@ -5752,14 +6028,14 @@ pub unsafe extern "C" fn spDrawOrderTimeline_create( ), None, ); - let ref mut fresh14 = *(&mut (*self_0).drawOrders as *mut *mut *mut c_int); - *fresh14 = _spCalloc( + (*self_0) + .drawOrders = _spCalloc( framesCount as size_t, ::core::mem::size_of::<*mut c_int>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 2239 as c_int, + 2141 as c_int, ) as *mut *mut c_int; - *(&mut (*self_0).slotsCount as *mut c_int) = slotsCount; + (*self_0).slotsCount = slotsCount; return self_0; } #[no_mangle] @@ -5772,25 +6048,111 @@ pub unsafe extern "C" fn spDrawOrderTimeline_setFrame( *((*(*self_0).super_0.frames).items).offset(frame as isize) = time; _spFree(*((*self_0).drawOrders).offset(frame as isize) as *mut c_void); if drawOrder.is_null() { - let ref mut fresh15 = *((*self_0).drawOrders).offset(frame as isize); - *fresh15 = std::ptr::null_mut(); + let ref mut fresh10 = *((*self_0).drawOrders).offset(frame as isize); + *fresh10 = 0 as *mut c_int; } else { - let ref mut fresh16 = *((*self_0).drawOrders).offset(frame as isize); - *fresh16 = _spMalloc( + let ref mut fresh11 = *((*self_0).drawOrders).offset(frame as isize); + *fresh11 = _spMalloc( (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).slotsCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 2252 as c_int, + 2154 as c_int, ) as *mut c_int; spine_memcpy( - *(&mut *((*self_0).drawOrders).offset(frame as isize) as *mut *mut c_int) - as *mut c_void, + *((*self_0).drawOrders).offset(frame as isize) as *mut c_void, drawOrder as *const c_void, ((*self_0).slotsCount as c_ulong) .wrapping_mul(::core::mem::size_of::() as c_ulong), ); }; } +#[no_mangle] +pub unsafe extern "C" fn _spInheritTimeline_apply( + mut timeline: *mut spTimeline, + mut skeleton: *mut spSkeleton, + mut lastTime: c_float, + mut time: c_float, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, + mut alpha: c_float, + mut blend: spMixBlend, + mut direction: spMixDirection, +) { + let mut self_0: *mut spInheritTimeline = timeline as *mut spInheritTimeline; + let mut bone: *mut spBone = *((*skeleton).bones) + .offset((*self_0).boneIndex as isize); + let mut frames: *mut c_float = (*(*self_0).super_0.frames).items; + if (*bone).active == 0 { + return; + } + if time < *frames.offset(0 as c_int as isize) { + if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint + || blend as c_uint == SP_MIX_BLEND_FIRST as c_int as c_uint + { + (*bone).inherit = (*(*bone).data).inherit; + } + return; + } + let mut idx: c_int = search2((*self_0).super_0.frames, time, 2 as c_int) + + 1 as c_int; + (*bone).inherit = *frames.offset(idx as isize) as spInherit; +} +#[no_mangle] +pub unsafe extern "C" fn _spInheritTimeline_dispose(mut timeline: *mut spTimeline) {} +#[no_mangle] +pub unsafe extern "C" fn spInheritTimeline_create( + mut framesCount: c_int, + mut boneIndex: c_int, +) -> *mut spInheritTimeline { + let mut self_0: *mut spInheritTimeline = _spCalloc( + 1 as c_int as size_t, + ::core::mem::size_of::() as c_ulong, + b"spine.c\0" as *const u8 as *const c_char, + 2188 as c_int, + ) as *mut spInheritTimeline; + let mut ids: [spPropertyId; 1] = [0; 1]; + ids[0 as c_int + as usize] = (SP_PROPERTY_INHERIT as c_int as spPropertyId) + << 32 as c_int; + _spTimeline_init( + &mut (*self_0).super_0, + framesCount, + 2 as c_int, + ids.as_mut_ptr(), + 1 as c_int, + SP_TIMELINE_INHERIT, + Some(_spInheritTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()), + Some( + _spInheritTimeline_apply + as unsafe extern "C" fn( + *mut spTimeline, + *mut spSkeleton, + c_float, + c_float, + *mut *mut spEvent, + *mut c_int, + c_float, + spMixBlend, + spMixDirection, + ) -> (), + ), + None, + ); + (*self_0).boneIndex = boneIndex; + return self_0; +} +#[no_mangle] +pub unsafe extern "C" fn spInheritTimeline_setFrame( + mut self_0: *mut spInheritTimeline, + mut frame: c_int, + mut time: c_float, + mut inherit: spInherit, +) { + frame *= 2 as c_int; + *((*(*self_0).super_0.frames).items).offset(frame as isize) = time; + *((*(*self_0).super_0.frames).items) + .offset((frame + 1 as c_int) as isize) = inherit as c_float; +} static mut IKCONSTRAINT_ENTRIES: c_int = 6 as c_int; static mut IKCONSTRAINT_MIX: c_int = 1 as c_int; static mut IKCONSTRAINT_SOFTNESS: c_int = 2 as c_int; @@ -5801,10 +6163,10 @@ static mut IKCONSTRAINT_STRETCH: c_int = 5 as c_int; pub unsafe extern "C" fn _spIkConstraintTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, mut direction: spMixDirection, @@ -5814,11 +6176,13 @@ pub unsafe extern "C" fn _spIkConstraintTimeline_apply( let mut mix: c_float = 0.; let mut softness: c_float = 0.; let mut t: c_float = 0.; - let mut constraint: *mut spIkConstraint = std::ptr::null_mut(); - let mut self_0: *mut spIkConstraintTimeline = timeline as *mut spIkConstraintTimeline; + let mut constraint: *mut spIkConstraint = 0 as *mut spIkConstraint; + let mut self_0: *mut spIkConstraintTimeline = timeline + as *mut spIkConstraintTimeline; let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items; let mut curves: *mut c_float = (*(*self_0).super_0.curves).items; - constraint = *((*skeleton).ikConstraints).offset((*self_0).ikConstraintIndex as isize); + constraint = *((*skeleton).ikConstraints) + .offset((*self_0).ikConstraintIndex as isize); if (*constraint).active == 0 { return; } @@ -5833,9 +6197,10 @@ pub unsafe extern "C" fn _spIkConstraintTimeline_apply( return; } 1 => { - (*constraint).mix += ((*(*constraint).data).mix - (*constraint).mix) * alpha; - (*constraint).softness += - ((*(*constraint).data).softness - (*constraint).softness) * alpha; + (*constraint).mix + += ((*(*constraint).data).mix - (*constraint).mix) * alpha; + (*constraint).softness + += ((*(*constraint).data).softness - (*constraint).softness) * alpha; (*constraint).bendDirection = (*(*constraint).data).bendDirection; (*constraint).compress = (*(*constraint).data).compress; (*constraint).stretch = (*(*constraint).data).stretch; @@ -5851,13 +6216,16 @@ pub unsafe extern "C" fn _spIkConstraintTimeline_apply( let mut before: c_float = *frames.offset(i as isize); mix = *frames.offset((i + IKCONSTRAINT_MIX) as isize); softness = *frames.offset((i + IKCONSTRAINT_SOFTNESS) as isize); - t = (time - before) / (*frames.offset((i + IKCONSTRAINT_ENTRIES) as isize) - before); - mix += - (*frames.offset((i + IKCONSTRAINT_ENTRIES + IKCONSTRAINT_MIX) as isize) - mix) * t; - softness += (*frames - .offset((i + IKCONSTRAINT_ENTRIES + IKCONSTRAINT_SOFTNESS) as isize) - - softness) - * t; + t = (time - before) + / (*frames.offset((i + IKCONSTRAINT_ENTRIES) as isize) - before); + mix + += (*frames + .offset((i + IKCONSTRAINT_ENTRIES + IKCONSTRAINT_MIX) as isize) + - mix) * t; + softness + += (*frames + .offset((i + IKCONSTRAINT_ENTRIES + IKCONSTRAINT_SOFTNESS) as isize) + - softness) * t; } 1 => { mix = *frames.offset((i + IKCONSTRAINT_MIX) as isize); @@ -5881,30 +6249,42 @@ pub unsafe extern "C" fn _spIkConstraintTimeline_apply( } } if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint { - (*constraint).mix = (*(*constraint).data).mix + (mix - (*(*constraint).data).mix) * alpha; - (*constraint).softness = - (*(*constraint).data).softness + (softness - (*(*constraint).data).softness) * alpha; - if direction as c_uint == SP_MIX_DIRECTION_OUT as c_int as c_uint { + (*constraint) + .mix = (*(*constraint).data).mix + (mix - (*(*constraint).data).mix) * alpha; + (*constraint) + .softness = (*(*constraint).data).softness + + (softness - (*(*constraint).data).softness) * alpha; + if direction as c_uint + == SP_MIX_DIRECTION_OUT as c_int as c_uint + { (*constraint).bendDirection = (*(*constraint).data).bendDirection; (*constraint).compress = (*(*constraint).data).compress; (*constraint).stretch = (*(*constraint).data).stretch; } else { - (*constraint).bendDirection = - *frames.offset((i + IKCONSTRAINT_BEND_DIRECTION) as isize) as c_int; - (*constraint).compress = (*frames.offset((i + IKCONSTRAINT_COMPRESS) as isize) + (*constraint) + .bendDirection = *frames + .offset((i + IKCONSTRAINT_BEND_DIRECTION) as isize) as c_int; + (*constraint) + .compress = (*frames.offset((i + IKCONSTRAINT_COMPRESS) as isize) != 0 as c_int as c_float) as c_int; - (*constraint).stretch = (*frames.offset((i + IKCONSTRAINT_STRETCH) as isize) + (*constraint) + .stretch = (*frames.offset((i + IKCONSTRAINT_STRETCH) as isize) != 0 as c_int as c_float) as c_int; } } else { (*constraint).mix += (mix - (*constraint).mix) * alpha; (*constraint).softness += (softness - (*constraint).softness) * alpha; - if direction as c_uint == SP_MIX_DIRECTION_IN as c_int as c_uint { - (*constraint).bendDirection = - *frames.offset((i + IKCONSTRAINT_BEND_DIRECTION) as isize) as c_int; - (*constraint).compress = (*frames.offset((i + IKCONSTRAINT_COMPRESS) as isize) + if direction as c_uint + == SP_MIX_DIRECTION_IN as c_int as c_uint + { + (*constraint) + .bendDirection = *frames + .offset((i + IKCONSTRAINT_BEND_DIRECTION) as isize) as c_int; + (*constraint) + .compress = (*frames.offset((i + IKCONSTRAINT_COMPRESS) as isize) != 0 as c_int as c_float) as c_int; - (*constraint).stretch = (*frames.offset((i + IKCONSTRAINT_STRETCH) as isize) + (*constraint) + .stretch = (*frames.offset((i + IKCONSTRAINT_STRETCH) as isize) != 0 as c_int as c_float) as c_int; } }; @@ -5919,11 +6299,12 @@ pub unsafe extern "C" fn spIkConstraintTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 2349 as c_int, + 2298 as c_int, ) as *mut spIkConstraintTimeline; let mut ids: [spPropertyId; 1] = [0; 1]; - ids[0 as c_int as usize] = (SP_PROPERTY_IKCONSTRAINT as c_int as spPropertyId) << 32 as c_int - | ikConstraintIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_IKCONSTRAINT as c_int as spPropertyId) + << 32 as c_int | ikConstraintIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, framesCount, @@ -5984,14 +6365,20 @@ pub unsafe extern "C" fn spIkConstraintTimeline_setFrame( *frames.offset(frame as isize) = time; *frames.offset((frame + IKCONSTRAINT_MIX) as isize) = mix; *frames.offset((frame + IKCONSTRAINT_SOFTNESS) as isize) = softness; - *frames.offset((frame + IKCONSTRAINT_BEND_DIRECTION) as isize) = bendDirection as c_float; - *frames.offset((frame + IKCONSTRAINT_COMPRESS) as isize) = (if compress != 0 { - 1 as c_int - } else { - 0 as c_int - }) as c_float; - *frames.offset((frame + IKCONSTRAINT_STRETCH) as isize) = - (if stretch != 0 { 1 as c_int } else { 0 as c_int }) as c_float; + *frames + .offset( + (frame + IKCONSTRAINT_BEND_DIRECTION) as isize, + ) = bendDirection as c_float; + *frames + .offset( + (frame + IKCONSTRAINT_COMPRESS) as isize, + ) = (if compress != 0 { 1 as c_int } else { 0 as c_int }) + as c_float; + *frames + .offset( + (frame + IKCONSTRAINT_STRETCH) as isize, + ) = (if stretch != 0 { 1 as c_int } else { 0 as c_int }) + as c_float; } static mut TRANSFORMCONSTRAINT_ENTRIES: c_int = 7 as c_int; static mut TRANSFORMCONSTRAINT_ROTATE: c_int = 1 as c_int; @@ -6004,13 +6391,13 @@ static mut TRANSFORMCONSTRAINT_SHEARY: c_int = 6 as c_int; pub unsafe extern "C" fn _spTransformConstraintTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, - mut _direction: spMixDirection, + mut direction: spMixDirection, ) { let mut i: c_int = 0; let mut curveType: c_int = 0; @@ -6021,14 +6408,14 @@ pub unsafe extern "C" fn _spTransformConstraintTimeline_apply( let mut scaleY: c_float = 0.; let mut shearY: c_float = 0.; let mut t: c_float = 0.; - let mut constraint: *mut spTransformConstraint = std::ptr::null_mut(); - let mut self_0: *mut spTransformConstraintTimeline = - timeline as *mut spTransformConstraintTimeline; - let mut frames: *mut c_float = std::ptr::null_mut(); - let mut curves: *mut c_float = std::ptr::null_mut(); - let mut data: *mut spTransformConstraintData = std::ptr::null_mut(); - constraint = - *((*skeleton).transformConstraints).offset((*self_0).transformConstraintIndex as isize); + let mut constraint: *mut spTransformConstraint = 0 as *mut spTransformConstraint; + let mut self_0: *mut spTransformConstraintTimeline = timeline + as *mut spTransformConstraintTimeline; + let mut frames: *mut c_float = 0 as *mut c_float; + let mut curves: *mut c_float = 0 as *mut c_float; + let mut data: *mut spTransformConstraintData = 0 as *mut spTransformConstraintData; + constraint = *((*skeleton).transformConstraints) + .offset((*self_0).transformConstraintIndex as isize); if (*constraint).active == 0 { return; } @@ -6047,23 +6434,24 @@ pub unsafe extern "C" fn _spTransformConstraintTimeline_apply( return; } 1 => { - (*constraint).mixRotate += ((*data).mixRotate - (*constraint).mixRotate) * alpha; + (*constraint).mixRotate + += ((*data).mixRotate - (*constraint).mixRotate) * alpha; (*constraint).mixX += ((*data).mixX - (*constraint).mixX) * alpha; (*constraint).mixY += ((*data).mixY - (*constraint).mixY) * alpha; - (*constraint).mixScaleX += ((*data).mixScaleX - (*constraint).mixScaleX) * alpha; - (*constraint).mixScaleY += ((*data).mixScaleY - (*constraint).mixScaleY) * alpha; - (*constraint).mixShearY += ((*data).mixShearY - (*constraint).mixShearY) * alpha; + (*constraint).mixScaleX + += ((*data).mixScaleX - (*constraint).mixScaleX) * alpha; + (*constraint).mixScaleY + += ((*data).mixScaleY - (*constraint).mixScaleY) * alpha; + (*constraint).mixShearY + += ((*data).mixShearY - (*constraint).mixShearY) * alpha; return; } _ => return, } } - i = search2( - (*self_0).super_0.super_0.frames, - time, - TRANSFORMCONSTRAINT_ENTRIES, - ); - curveType = *curves.offset((i / TRANSFORMCONSTRAINT_ENTRIES) as isize) as c_int; + i = search2((*self_0).super_0.super_0.frames, time, TRANSFORMCONSTRAINT_ENTRIES); + curveType = *curves.offset((i / TRANSFORMCONSTRAINT_ENTRIES) as isize) + as c_int; match curveType { 0 => { let mut before: c_float = *frames.offset(i as isize); @@ -6075,30 +6463,42 @@ pub unsafe extern "C" fn _spTransformConstraintTimeline_apply( shearY = *frames.offset((i + TRANSFORMCONSTRAINT_SHEARY) as isize); t = (time - before) / (*frames.offset((i + TRANSFORMCONSTRAINT_ENTRIES) as isize) - before); - rotate += (*frames - .offset((i + TRANSFORMCONSTRAINT_ENTRIES + TRANSFORMCONSTRAINT_ROTATE) as isize) - - rotate) - * t; - x += (*frames - .offset((i + TRANSFORMCONSTRAINT_ENTRIES + TRANSFORMCONSTRAINT_X) as isize) - - x) - * t; - y += (*frames - .offset((i + TRANSFORMCONSTRAINT_ENTRIES + TRANSFORMCONSTRAINT_Y) as isize) - - y) - * t; - scaleX += (*frames - .offset((i + TRANSFORMCONSTRAINT_ENTRIES + TRANSFORMCONSTRAINT_SCALEX) as isize) - - scaleX) - * t; - scaleY += (*frames - .offset((i + TRANSFORMCONSTRAINT_ENTRIES + TRANSFORMCONSTRAINT_SCALEY) as isize) - - scaleY) - * t; - shearY += (*frames - .offset((i + TRANSFORMCONSTRAINT_ENTRIES + TRANSFORMCONSTRAINT_SHEARY) as isize) - - shearY) - * t; + rotate + += (*frames + .offset( + (i + TRANSFORMCONSTRAINT_ENTRIES + TRANSFORMCONSTRAINT_ROTATE) + as isize, + ) - rotate) * t; + x + += (*frames + .offset( + (i + TRANSFORMCONSTRAINT_ENTRIES + TRANSFORMCONSTRAINT_X) + as isize, + ) - x) * t; + y + += (*frames + .offset( + (i + TRANSFORMCONSTRAINT_ENTRIES + TRANSFORMCONSTRAINT_Y) + as isize, + ) - y) * t; + scaleX + += (*frames + .offset( + (i + TRANSFORMCONSTRAINT_ENTRIES + TRANSFORMCONSTRAINT_SCALEX) + as isize, + ) - scaleX) * t; + scaleY + += (*frames + .offset( + (i + TRANSFORMCONSTRAINT_ENTRIES + TRANSFORMCONSTRAINT_SCALEY) + as isize, + ) - scaleY) * t; + shearY + += (*frames + .offset( + (i + TRANSFORMCONSTRAINT_ENTRIES + TRANSFORMCONSTRAINT_SHEARY) + as isize, + ) - shearY) * t; } 1 => { rotate = *frames.offset((i + TRANSFORMCONSTRAINT_ROTATE) as isize); @@ -6154,12 +6554,16 @@ pub unsafe extern "C" fn _spTransformConstraintTimeline_apply( } } if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint { - (*constraint).mixRotate = (*data).mixRotate + (rotate - (*data).mixRotate) * alpha; + (*constraint) + .mixRotate = (*data).mixRotate + (rotate - (*data).mixRotate) * alpha; (*constraint).mixX = (*data).mixX + (x - (*data).mixX) * alpha; (*constraint).mixY = (*data).mixY + (y - (*data).mixY) * alpha; - (*constraint).mixScaleX = (*data).mixScaleX + (scaleX - (*data).mixScaleX) * alpha; - (*constraint).mixScaleY = (*data).mixScaleY + (scaleY - (*data).mixScaleY) * alpha; - (*constraint).mixShearY = (*data).mixShearY + (shearY - (*data).mixShearY) * alpha; + (*constraint) + .mixScaleX = (*data).mixScaleX + (scaleX - (*data).mixScaleX) * alpha; + (*constraint) + .mixScaleY = (*data).mixScaleY + (scaleY - (*data).mixScaleY) * alpha; + (*constraint) + .mixShearY = (*data).mixShearY + (shearY - (*data).mixShearY) * alpha; } else { (*constraint).mixRotate += (rotate - (*constraint).mixRotate) * alpha; (*constraint).mixX += (x - (*constraint).mixX) * alpha; @@ -6179,13 +6583,12 @@ pub unsafe extern "C" fn spTransformConstraintTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 2490 as c_int, - ) - as *mut spTransformConstraintTimeline; + 2439 as c_int, + ) as *mut spTransformConstraintTimeline; let mut ids: [spPropertyId; 1] = [0; 1]; - ids[0 as c_int as usize] = (SP_PROPERTY_TRANSFORMCONSTRAINT as c_int as spPropertyId) - << 32 as c_int - | transformConstraintIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_TRANSFORMCONSTRAINT as c_int as spPropertyId) + << 32 as c_int | transformConstraintIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, framesCount, @@ -6258,45 +6661,29 @@ static mut PATHCONSTRAINTPOSITION_VALUE: c_int = 1 as c_int; pub unsafe extern "C" fn _spPathConstraintPositionTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, - mut _direction: spMixDirection, -) { - let mut position: c_float = 0.; - let mut constraint: *mut spPathConstraint = std::ptr::null_mut(); - let mut self_0: *mut spPathConstraintPositionTimeline = - timeline as *mut spPathConstraintPositionTimeline; - let mut frames: *mut c_float = std::ptr::null_mut(); - constraint = *((*skeleton).pathConstraints).offset((*self_0).pathConstraintIndex as isize); - if (*constraint).active == 0 { - return; - } - frames = (*(*self_0).super_0.super_0.frames).items; - if time < *frames.offset(0 as c_int as isize) { - match blend as c_uint { - 0 => { - (*constraint).position = (*(*constraint).data).position; - return; - } - 1 => { - (*constraint).position += - ((*(*constraint).data).position - (*constraint).position) * alpha; - return; - } - _ => return, - } + mut direction: spMixDirection, +) { + let mut self_0: *mut spPathConstraintPositionTimeline = timeline + as *mut spPathConstraintPositionTimeline; + let mut constraint: *mut spPathConstraint = *((*skeleton).pathConstraints) + .offset((*self_0).pathConstraintIndex as isize); + if (*constraint).active != 0 { + (*constraint) + .position = spCurveTimeline1_getAbsoluteValue( + &mut (*self_0).super_0, + time, + alpha, + blend, + (*constraint).position, + (*(*constraint).data).position, + ); } - position = spCurveTimeline1_getCurveValue(&mut (*self_0).super_0, time); - if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint { - (*constraint).position = - (*(*constraint).data).position + (position - (*(*constraint).data).position) * alpha; - } else { - (*constraint).position += (position - (*constraint).position) * alpha; - }; } #[no_mangle] pub unsafe extern "C" fn spPathConstraintPositionTimeline_create( @@ -6308,13 +6695,12 @@ pub unsafe extern "C" fn spPathConstraintPositionTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 2558 as c_int, - ) - as *mut spPathConstraintPositionTimeline; + 2481 as c_int, + ) as *mut spPathConstraintPositionTimeline; let mut ids: [spPropertyId; 1] = [0; 1]; - ids[0 as c_int as usize] = (SP_PROPERTY_PATHCONSTRAINT_POSITION as c_int as spPropertyId) - << 32 as c_int - | pathConstraintIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_PATHCONSTRAINT_POSITION as c_int as spPropertyId) + << 32 as c_int | pathConstraintIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, framesCount, @@ -6377,45 +6763,29 @@ static mut PATHCONSTRAINTSPACING_VALUE: c_int = 1 as c_int; pub unsafe extern "C" fn _spPathConstraintSpacingTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, - mut _direction: spMixDirection, + mut direction: spMixDirection, ) { - let mut spacing: c_float = 0.; - let mut constraint: *mut spPathConstraint = std::ptr::null_mut(); - let mut self_0: *mut spPathConstraintSpacingTimeline = - timeline as *mut spPathConstraintSpacingTimeline; - let mut frames: *mut c_float = std::ptr::null_mut(); - constraint = *((*skeleton).pathConstraints).offset((*self_0).pathConstraintIndex as isize); - if (*constraint).active == 0 { - return; - } - frames = (*(*self_0).super_0.super_0.frames).items; - if time < *frames.offset(0 as c_int as isize) { - match blend as c_uint { - 0 => { - (*constraint).spacing = (*(*constraint).data).spacing; - return; - } - 1 => { - (*constraint).spacing += - ((*(*constraint).data).spacing - (*constraint).spacing) * alpha; - return; - } - _ => return, - } + let mut self_0: *mut spPathConstraintSpacingTimeline = timeline + as *mut spPathConstraintSpacingTimeline; + let mut constraint: *mut spPathConstraint = *((*skeleton).pathConstraints) + .offset((*self_0).pathConstraintIndex as isize); + if (*constraint).active != 0 { + (*constraint) + .spacing = spCurveTimeline1_getAbsoluteValue( + &mut (*self_0).super_0, + time, + alpha, + blend, + (*constraint).spacing, + (*(*constraint).data).spacing, + ); } - spacing = spCurveTimeline1_getCurveValue(&mut (*self_0).super_0, time); - if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint { - (*constraint).spacing = - (*(*constraint).data).spacing + (spacing - (*(*constraint).data).spacing) * alpha; - } else { - (*constraint).spacing += (spacing - (*constraint).spacing) * alpha; - }; } #[no_mangle] pub unsafe extern "C" fn spPathConstraintSpacingTimeline_create( @@ -6427,13 +6797,12 @@ pub unsafe extern "C" fn spPathConstraintSpacingTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 2620 as c_int, - ) - as *mut spPathConstraintSpacingTimeline; + 2517 as c_int, + ) as *mut spPathConstraintSpacingTimeline; let mut ids: [spPropertyId; 1] = [0; 1]; - ids[0 as c_int as usize] = (SP_PROPERTY_PATHCONSTRAINT_SPACING as c_int as spPropertyId) - << 32 as c_int - | pathConstraintIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_PATHCONSTRAINT_SPACING as c_int as spPropertyId) + << 32 as c_int | pathConstraintIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, framesCount, @@ -6498,13 +6867,13 @@ static mut PATHCONSTRAINTMIX_Y: c_int = 3 as c_int; pub unsafe extern "C" fn _spPathConstraintMixTimeline_apply( mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, - mut _lastTime: c_float, + mut lastTime: c_float, mut time: c_float, - mut _firedEvents: *mut *mut spEvent, - mut _eventsCount: *mut c_int, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, mut alpha: c_float, mut blend: spMixBlend, - mut _direction: spMixDirection, + mut direction: spMixDirection, ) { let mut i: c_int = 0; let mut curveType: c_int = 0; @@ -6512,11 +6881,13 @@ pub unsafe extern "C" fn _spPathConstraintMixTimeline_apply( let mut x: c_float = 0.; let mut y: c_float = 0.; let mut t: c_float = 0.; - let mut constraint: *mut spPathConstraint = std::ptr::null_mut(); - let mut self_0: *mut spPathConstraintMixTimeline = timeline as *mut spPathConstraintMixTimeline; - let mut frames: *mut c_float = std::ptr::null_mut(); - let mut curves: *mut c_float = std::ptr::null_mut(); - constraint = *((*skeleton).pathConstraints).offset((*self_0).pathConstraintIndex as isize); + let mut constraint: *mut spPathConstraint = 0 as *mut spPathConstraint; + let mut self_0: *mut spPathConstraintMixTimeline = timeline + as *mut spPathConstraintMixTimeline; + let mut frames: *mut c_float = 0 as *mut c_float; + let mut curves: *mut c_float = 0 as *mut c_float; + constraint = *((*skeleton).pathConstraints) + .offset((*self_0).pathConstraintIndex as isize); if (*constraint).active == 0 { return; } @@ -6531,20 +6902,19 @@ pub unsafe extern "C" fn _spPathConstraintMixTimeline_apply( return; } 1 => { - (*constraint).mixRotate += - ((*(*constraint).data).mixRotate - (*constraint).mixRotate) * alpha; - (*constraint).mixX += ((*(*constraint).data).mixX - (*constraint).mixX) * alpha; - (*constraint).mixY += ((*(*constraint).data).mixY - (*constraint).mixY) * alpha; + (*constraint).mixRotate + += ((*(*constraint).data).mixRotate - (*constraint).mixRotate) + * alpha; + (*constraint).mixX + += ((*(*constraint).data).mixX - (*constraint).mixX) * alpha; + (*constraint).mixY + += ((*(*constraint).data).mixY - (*constraint).mixY) * alpha; } _ => {} } return; } - i = search2( - (*self_0).super_0.super_0.frames, - time, - PATHCONSTRAINTMIX_ENTRIES, - ); + i = search2((*self_0).super_0.super_0.frames, time, PATHCONSTRAINTMIX_ENTRIES); curveType = *curves.offset((i >> 2 as c_int) as isize) as c_int; match curveType { 0 => { @@ -6554,16 +6924,22 @@ pub unsafe extern "C" fn _spPathConstraintMixTimeline_apply( y = *frames.offset((i + PATHCONSTRAINTMIX_Y) as isize); t = (time - before) / (*frames.offset((i + PATHCONSTRAINTMIX_ENTRIES) as isize) - before); - rotate += (*frames - .offset((i + PATHCONSTRAINTMIX_ENTRIES + PATHCONSTRAINTMIX_ROTATE) as isize) - - rotate) - * t; - x += (*frames.offset((i + PATHCONSTRAINTMIX_ENTRIES + PATHCONSTRAINTMIX_X) as isize) - - x) - * t; - y += (*frames.offset((i + PATHCONSTRAINTMIX_ENTRIES + PATHCONSTRAINTMIX_Y) as isize) - - y) - * t; + rotate + += (*frames + .offset( + (i + PATHCONSTRAINTMIX_ENTRIES + PATHCONSTRAINTMIX_ROTATE) + as isize, + ) - rotate) * t; + x + += (*frames + .offset( + (i + PATHCONSTRAINTMIX_ENTRIES + PATHCONSTRAINTMIX_X) as isize, + ) - x) * t; + y + += (*frames + .offset( + (i + PATHCONSTRAINTMIX_ENTRIES + PATHCONSTRAINTMIX_Y) as isize, + ) - y) * t; } 1 => { rotate = *frames.offset((i + PATHCONSTRAINTMIX_ROTATE) as isize); @@ -6596,7 +6972,8 @@ pub unsafe extern "C" fn _spPathConstraintMixTimeline_apply( } if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint { let mut data: *mut spPathConstraintData = (*constraint).data; - (*constraint).mixRotate = (*data).mixRotate + (rotate - (*data).mixRotate) * alpha; + (*constraint) + .mixRotate = (*data).mixRotate + (rotate - (*data).mixRotate) * alpha; (*constraint).mixX = (*data).mixX + (x - (*data).mixX) * alpha; (*constraint).mixY = (*data).mixY + (y - (*data).mixY) * alpha; } else { @@ -6615,12 +6992,12 @@ pub unsafe extern "C" fn spPathConstraintMixTimeline_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 2726 as c_int, + 2623 as c_int, ) as *mut spPathConstraintMixTimeline; let mut ids: [spPropertyId; 1] = [0; 1]; - ids[0 as c_int as usize] = (SP_PROPERTY_PATHCONSTRAINT_MIX as c_int as spPropertyId) - << 32 as c_int - | pathConstraintIndex as c_ulong; + ids[0 as c_int + as usize] = (SP_PROPERTY_PATHCONSTRAINT_MIX as c_int as spPropertyId) + << 32 as c_int | pathConstraintIndex as c_ulong; _spCurveTimeline_init( &mut (*timeline).super_0, framesCount, @@ -6682,127 +7059,505 @@ pub unsafe extern "C" fn spPathConstraintMixTimeline_setFrame( *frames.offset((frame + PATHCONSTRAINTMIX_Y) as isize) = mixY; } #[no_mangle] -pub unsafe extern "C" fn spTrackEntryArray_create( - mut initialCapacity: c_int, -) -> *mut spTrackEntryArray { - let mut array: *mut spTrackEntryArray = _spCalloc( - 1 as c_int as size_t, - ::core::mem::size_of::() as c_ulong, - b"spine.c\0" as *const u8 as *const c_char, - 2787 as c_int, - ) as *mut spTrackEntryArray; - (*array).size = 0 as c_int; - (*array).capacity = initialCapacity; - (*array).items = _spCalloc( - initialCapacity as size_t, - ::core::mem::size_of::<*mut spTrackEntry>() as c_ulong, - b"spine.c\0" as *const u8 as *const c_char, - 2787 as c_int, - ) as *mut *mut spTrackEntry; - return array; -} -#[no_mangle] -pub unsafe extern "C" fn spTrackEntryArray_dispose(mut self_0: *mut spTrackEntryArray) { - _spFree((*self_0).items as *mut c_void); - _spFree(self_0 as *mut c_void); +pub unsafe extern "C" fn _spPhysicsConstraintTimeline_global( + mut data: *mut spPhysicsConstraintData, + mut type_0: spTimelineType, +) -> c_int { + match type_0 as c_uint { + 19 => return (*data).inertiaGlobal, + 20 => return (*data).strengthGlobal, + 21 => return (*data).dampingGlobal, + 22 => return (*data).massGlobal, + 23 => return (*data).windGlobal, + 24 => return (*data).gravityGlobal, + 25 => return (*data).mixGlobal, + _ => return 0 as c_int, + }; } #[no_mangle] -pub unsafe extern "C" fn spTrackEntryArray_clear(mut self_0: *mut spTrackEntryArray) { - (*self_0).size = 0 as c_int; +pub unsafe extern "C" fn _spPhysicsConstraintTimeline_set( + mut constraint: *mut spPhysicsConstraint, + mut type_0: spTimelineType, + mut value: c_float, +) { + match type_0 as c_uint { + 19 => { + (*constraint).inertia = value; + } + 20 => { + (*constraint).strength = value; + } + 21 => { + (*constraint).damping = value; + } + 22 => { + (*constraint).massInverse = value; + } + 23 => { + (*constraint).wind = value; + } + 24 => { + (*constraint).gravity = value; + } + 25 => { + (*constraint).mix = value; + } + _ => {} + }; } #[no_mangle] -pub unsafe extern "C" fn spTrackEntryArray_setSize( - mut self_0: *mut spTrackEntryArray, - mut newSize: c_int, -) -> *mut spTrackEntryArray { - (*self_0).size = newSize; - if (*self_0).capacity < newSize { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { - 8 as c_int - } else { - ((*self_0).size as c_float * 1.75f32) as c_int - }; - (*self_0).items = _spRealloc( - (*self_0).items as *mut c_void, - (::core::mem::size_of::<*mut spTrackEntry>() as c_ulong) - .wrapping_mul((*self_0).capacity as c_ulong), - ) as *mut *mut spTrackEntry; - } - return self_0; +pub unsafe extern "C" fn _spPhysicsConstraintTimeline_get( + mut constraint: *mut spPhysicsConstraint, + mut type_0: spTimelineType, +) -> c_float { + match type_0 as c_uint { + 19 => return (*constraint).inertia, + 20 => return (*constraint).strength, + 21 => return (*constraint).damping, + 22 => return (*constraint).massInverse, + 23 => return (*constraint).wind, + 24 => return (*constraint).gravity, + 25 => return (*constraint).mix, + _ => return 0 as c_int as c_float, + }; } #[no_mangle] -pub unsafe extern "C" fn spTrackEntryArray_ensureCapacity( - mut self_0: *mut spTrackEntryArray, - mut newCapacity: c_int, -) { - if (*self_0).capacity >= newCapacity { - return; - } - (*self_0).capacity = newCapacity; - (*self_0).items = _spRealloc( - (*self_0).items as *mut c_void, - (::core::mem::size_of::<*mut spTrackEntry>() as c_ulong) - .wrapping_mul((*self_0).capacity as c_ulong), - ) as *mut *mut spTrackEntry; +pub unsafe extern "C" fn _spPhysicsConstraintTimeline_setup( + mut constraint: *mut spPhysicsConstraint, + mut type_0: spTimelineType, +) -> c_float { + match type_0 as c_uint { + 19 => return (*(*constraint).data).inertia, + 20 => return (*(*constraint).data).strength, + 21 => return (*(*constraint).data).damping, + 22 => return (*(*constraint).data).massInverse, + 23 => return (*(*constraint).data).wind, + 24 => return (*(*constraint).data).gravity, + 25 => return (*(*constraint).data).mix, + _ => return 0 as c_int as c_float, + }; } #[no_mangle] -pub unsafe extern "C" fn spTrackEntryArray_add( - mut self_0: *mut spTrackEntryArray, - mut value: *mut spTrackEntry, +pub unsafe extern "C" fn _spPhysicsConstraintTimeline_apply( + mut timeline: *mut spTimeline, + mut skeleton: *mut spSkeleton, + mut lastTime: c_float, + mut time: c_float, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, + mut alpha: c_float, + mut blend: spMixBlend, + mut direction: spMixDirection, ) { - if (*self_0).size == (*self_0).capacity { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { - 8 as c_int + let mut self_0: *mut spPhysicsConstraintTimeline = timeline + as *mut spPhysicsConstraintTimeline; + let mut type_0: spTimelineType = (*self_0).super_0.super_0.type_0; + let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items; + if (*self_0).physicsConstraintIndex == -(1 as c_int) { + let mut value: c_float = if time + >= *frames.offset(0 as c_int as isize) + { + spCurveTimeline1_getCurveValue(&mut (*self_0).super_0, time) } else { - ((*self_0).size as c_float * 1.75f32) as c_int + 0 as c_int as c_float }; - (*self_0).items = _spRealloc( - (*self_0).items as *mut c_void, - (::core::mem::size_of::<*mut spTrackEntry>() as c_ulong) - .wrapping_mul((*self_0).capacity as c_ulong), - ) as *mut *mut spTrackEntry; - } - let fresh17 = (*self_0).size; - (*self_0).size = (*self_0).size + 1; - let ref mut fresh18 = *((*self_0).items).offset(fresh17 as isize); - *fresh18 = value; -} -#[no_mangle] -pub unsafe extern "C" fn spTrackEntryArray_addAll( - mut self_0: *mut spTrackEntryArray, - mut other: *mut spTrackEntryArray, -) { - let mut i: c_int = 0 as c_int; - while i < (*other).size { - spTrackEntryArray_add(self_0, *((*other).items).offset(i as isize)); - i += 1; - } + let mut physicsConstraints: *mut *mut spPhysicsConstraint = (*skeleton) + .physicsConstraints; + let mut i: c_int = 0 as c_int; + while i < (*skeleton).physicsConstraintsCount { + let mut constraint: *mut spPhysicsConstraint = *physicsConstraints + .offset(i as isize); + if (*constraint).active != 0 + && _spPhysicsConstraintTimeline_global((*constraint).data, type_0) != 0 + { + _spPhysicsConstraintTimeline_set( + constraint, + type_0, + spCurveTimeline1_getAbsoluteValue2( + &mut (*self_0).super_0, + time, + alpha, + blend, + _spPhysicsConstraintTimeline_get(constraint, type_0), + _spPhysicsConstraintTimeline_setup(constraint, type_0), + value, + ), + ); + } + i += 1; + } + } else { + let mut constraint_0: *mut spPhysicsConstraint = *((*skeleton) + .physicsConstraints) + .offset((*self_0).physicsConstraintIndex as isize); + if (*constraint_0).active != 0 { + _spPhysicsConstraintTimeline_set( + constraint_0, + type_0, + spCurveTimeline1_getAbsoluteValue( + &mut (*self_0).super_0, + time, + alpha, + blend, + _spPhysicsConstraintTimeline_get(constraint_0, type_0), + _spPhysicsConstraintTimeline_setup(constraint_0, type_0), + ), + ); + } + }; } #[no_mangle] -pub unsafe extern "C" fn spTrackEntryArray_addAllValues( - mut self_0: *mut spTrackEntryArray, - mut values: *mut *mut spTrackEntry, - mut offset: c_int, - mut count: c_int, -) { - let mut i: c_int = offset; - let mut n: c_int = offset + count; - while i < n { - spTrackEntryArray_add(self_0, *values.offset(i as isize)); - i += 1; +pub unsafe extern "C" fn spPhysicsConstraintTimeline_create( + mut frameCount: c_int, + mut bezierCount: c_int, + mut physicsConstraintIndex: c_int, + mut type_0: spTimelineType, +) -> *mut spPhysicsConstraintTimeline { + let mut timeline: *mut spPhysicsConstraintTimeline = _spCalloc( + 1 as c_int as size_t, + ::core::mem::size_of::() as c_ulong, + b"spine.c\0" as *const u8 as *const c_char, + 2767 as c_int, + ) as *mut spPhysicsConstraintTimeline; + let mut ids: [spPropertyId; 1] = [0; 1]; + let mut id: spPropertyId = 0; + match type_0 as c_uint { + 19 => { + id = SP_PROPERTY_PHYSICSCONSTRAINT_INERTIA as c_int as spPropertyId; + } + 20 => { + id = SP_PROPERTY_PHYSICSCONSTRAINT_STRENGTH as c_int as spPropertyId; + } + 21 => { + id = SP_PROPERTY_PHYSICSCONSTRAINT_DAMPING as c_int as spPropertyId; + } + 22 => { + id = SP_PROPERTY_PHYSICSCONSTRAINT_MASS as c_int as spPropertyId; + } + 23 => { + id = SP_PROPERTY_PHYSICSCONSTRAINT_WIND as c_int as spPropertyId; + } + 24 => { + id = SP_PROPERTY_PHYSICSCONSTRAINT_GRAVITY as c_int as spPropertyId; + } + 25 => { + id = SP_PROPERTY_PHYSICSCONSTRAINT_MIX as c_int as spPropertyId; + } + _ => { + id = SP_PROPERTY_PHYSICSCONSTRAINT_INERTIA as c_int as spPropertyId; + } } -} -#[no_mangle] -pub unsafe extern "C" fn spTrackEntryArray_removeAt( - mut self_0: *mut spTrackEntryArray, - mut index: c_int, -) { - (*self_0).size -= 1; - spine_memmove( + ids[0 as c_int + as usize] = id << 32 as c_int | physicsConstraintIndex as c_ulong; + _spCurveTimeline_init( + &mut (*timeline).super_0, + frameCount, + 2 as c_int, + bezierCount, + ids.as_mut_ptr(), + 1 as c_int, + type_0, + Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()), + Some( + _spPhysicsConstraintTimeline_apply + as unsafe extern "C" fn( + *mut spTimeline, + *mut spSkeleton, + c_float, + c_float, + *mut *mut spEvent, + *mut c_int, + c_float, + spMixBlend, + spMixDirection, + ) -> (), + ), + Some( + _spCurveTimeline_setBezier + as unsafe extern "C" fn( + *mut spTimeline, + c_int, + c_int, + c_float, + c_float, + c_float, + c_float, + c_float, + c_float, + c_float, + c_float, + c_float, + ) -> (), + ), + ); + (*timeline).physicsConstraintIndex = physicsConstraintIndex; + return timeline; +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraintTimeline_setFrame( + mut self_0: *mut spPhysicsConstraintTimeline, + mut frame: c_int, + mut time: c_float, + mut value: c_float, +) { + spCurveTimeline1_setFrame(&mut (*self_0).super_0, frame, time, value); +} +#[no_mangle] +pub unsafe extern "C" fn _spPhysicsConstraintResetTimeline_apply( + mut timeline: *mut spTimeline, + mut skeleton: *mut spSkeleton, + mut lastTime: c_float, + mut time: c_float, + mut firedEvents: *mut *mut spEvent, + mut eventsCount: *mut c_int, + mut alpha: c_float, + mut blend: spMixBlend, + mut direction: spMixDirection, +) { + let mut self_0: *mut spPhysicsConstraintResetTimeline = timeline + as *mut spPhysicsConstraintResetTimeline; + let mut constraint: *mut spPhysicsConstraint = 0 as *mut spPhysicsConstraint; + if (*self_0).physicsConstraintIndex != -(1 as c_int) { + constraint = *((*skeleton).physicsConstraints) + .offset((*self_0).physicsConstraintIndex as isize); + if (*constraint).active == 0 { + return; + } + } + let mut frames: *mut c_float = (*(*self_0).super_0.frames).items; + if lastTime > time { + _spPhysicsConstraintResetTimeline_apply( + &mut (*self_0).super_0, + skeleton, + lastTime, + 0x7fffffff as c_int as c_float, + 0 as *mut *mut spEvent, + 0 as *mut c_int, + alpha, + blend, + direction, + ); + lastTime = -(1 as c_int) as c_float; + } else if lastTime + >= *frames.offset(((*self_0).super_0.frameCount - 1 as c_int) as isize) + { + return + } + if time < *frames.offset(0 as c_int as isize) { + return; + } + if lastTime < *frames.offset(0 as c_int as isize) + || time + >= *frames + .offset( + (search((*self_0).super_0.frames, lastTime) + 1 as c_int) + as isize, + ) + { + if !constraint.is_null() { + spPhysicsConstraint_reset(constraint); + } else { + let mut physicsConstraints: *mut *mut spPhysicsConstraint = (*skeleton) + .physicsConstraints; + let mut i: c_int = 0 as c_int; + while i < (*skeleton).physicsConstraintsCount { + constraint = *physicsConstraints.offset(i as isize); + if (*constraint).active != 0 { + spPhysicsConstraint_reset(constraint); + } + i += 1; + } + } + } +} +#[no_mangle] +pub unsafe extern "C" fn _spPhysicsConstraintResetTimeline_dispose( + mut timeline: *mut spTimeline, +) {} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraintResetTimeline_create( + mut framesCount: c_int, + mut physicsConstraintIndex: c_int, +) -> *mut spPhysicsConstraintResetTimeline { + let mut self_0: *mut spPhysicsConstraintResetTimeline = _spCalloc( + 1 as c_int as size_t, + ::core::mem::size_of::() as c_ulong, + b"spine.c\0" as *const u8 as *const c_char, + 2851 as c_int, + ) as *mut spPhysicsConstraintResetTimeline; + let mut ids: [spPropertyId; 1] = [0; 1]; + ids[0 as c_int + as usize] = (SP_PROPERTY_PHYSICSCONSTRAINT_RESET as c_int as spPropertyId) + << 32 as c_int; + _spTimeline_init( + &mut (*self_0).super_0, + framesCount, + 1 as c_int, + ids.as_mut_ptr(), + 1 as c_int, + SP_TIMELINE_PHYSICSCONSTRAINT_RESET, + Some( + _spPhysicsConstraintResetTimeline_dispose + as unsafe extern "C" fn(*mut spTimeline) -> (), + ), + Some( + _spPhysicsConstraintResetTimeline_apply + as unsafe extern "C" fn( + *mut spTimeline, + *mut spSkeleton, + c_float, + c_float, + *mut *mut spEvent, + *mut c_int, + c_float, + spMixBlend, + spMixDirection, + ) -> (), + ), + None, + ); + (*self_0).physicsConstraintIndex = physicsConstraintIndex; + return self_0; +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraintResetTimeline_setFrame( + mut self_0: *mut spPhysicsConstraintResetTimeline, + mut frame: c_int, + mut time: c_float, +) { + *((*(*self_0).super_0.frames).items).offset(frame as isize) = time; +} +#[no_mangle] +pub unsafe extern "C" fn spTrackEntryArray_create( + mut initialCapacity: c_int, +) -> *mut spTrackEntryArray { + let mut array: *mut spTrackEntryArray = _spCalloc( + 1 as c_int as size_t, + ::core::mem::size_of::() as c_ulong, + b"spine.c\0" as *const u8 as *const c_char, + 2907 as c_int, + ) as *mut spTrackEntryArray; + (*array).size = 0 as c_int; + (*array).capacity = initialCapacity; + (*array) + .items = _spCalloc( + initialCapacity as size_t, + ::core::mem::size_of::<*mut spTrackEntry>() as c_ulong, + b"spine.c\0" as *const u8 as *const c_char, + 2907 as c_int, + ) as *mut *mut spTrackEntry; + return array; +} +#[no_mangle] +pub unsafe extern "C" fn spTrackEntryArray_dispose(mut self_0: *mut spTrackEntryArray) { + _spFree((*self_0).items as *mut c_void); + _spFree(self_0 as *mut c_void); +} +#[no_mangle] +pub unsafe extern "C" fn spTrackEntryArray_clear(mut self_0: *mut spTrackEntryArray) { + (*self_0).size = 0 as c_int; +} +#[no_mangle] +pub unsafe extern "C" fn spTrackEntryArray_setSize( + mut self_0: *mut spTrackEntryArray, + mut newSize: c_int, +) -> *mut spTrackEntryArray { + (*self_0).size = newSize; + if (*self_0).capacity < newSize { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { + 8 as c_int + } else { + ((*self_0).size as c_float * 1.75f32) as c_int + }; + (*self_0) + .items = _spRealloc( + (*self_0).items as *mut c_void, + (::core::mem::size_of::<*mut spTrackEntry>() as c_ulong) + .wrapping_mul((*self_0).capacity as c_ulong), + ) as *mut *mut spTrackEntry; + } + return self_0; +} +#[no_mangle] +pub unsafe extern "C" fn spTrackEntryArray_ensureCapacity( + mut self_0: *mut spTrackEntryArray, + mut newCapacity: c_int, +) { + if (*self_0).capacity >= newCapacity { + return; + } + (*self_0).capacity = newCapacity; + (*self_0) + .items = _spRealloc( + (*self_0).items as *mut c_void, + (::core::mem::size_of::<*mut spTrackEntry>() as c_ulong) + .wrapping_mul((*self_0).capacity as c_ulong), + ) as *mut *mut spTrackEntry; +} +#[no_mangle] +pub unsafe extern "C" fn spTrackEntryArray_add( + mut self_0: *mut spTrackEntryArray, + mut value: *mut spTrackEntry, +) { + if (*self_0).size == (*self_0).capacity { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { + 8 as c_int + } else { + ((*self_0).size as c_float * 1.75f32) as c_int + }; + (*self_0) + .items = _spRealloc( + (*self_0).items as *mut c_void, + (::core::mem::size_of::<*mut spTrackEntry>() as c_ulong) + .wrapping_mul((*self_0).capacity as c_ulong), + ) as *mut *mut spTrackEntry; + } + let fresh12 = (*self_0).size; + (*self_0).size = (*self_0).size + 1; + let ref mut fresh13 = *((*self_0).items).offset(fresh12 as isize); + *fresh13 = value; +} +#[no_mangle] +pub unsafe extern "C" fn spTrackEntryArray_addAll( + mut self_0: *mut spTrackEntryArray, + mut other: *mut spTrackEntryArray, +) { + let mut i: c_int = 0 as c_int; + while i < (*other).size { + spTrackEntryArray_add(self_0, *((*other).items).offset(i as isize)); + i += 1; + } +} +#[no_mangle] +pub unsafe extern "C" fn spTrackEntryArray_addAllValues( + mut self_0: *mut spTrackEntryArray, + mut values: *mut *mut spTrackEntry, + mut offset: c_int, + mut count: c_int, +) { + let mut i: c_int = offset; + let mut n: c_int = offset + count; + while i < n { + spTrackEntryArray_add(self_0, *values.offset(i as isize)); + i += 1; + } +} +#[no_mangle] +pub unsafe extern "C" fn spTrackEntryArray_removeAt( + mut self_0: *mut spTrackEntryArray, + mut index: c_int, +) { + (*self_0).size -= 1; + spine_memmove( ((*self_0).items).offset(index as isize) as *mut c_void, - ((*self_0).items) - .offset(index as isize) - .offset(1 as c_int as isize) as *const c_void, + ((*self_0).items).offset(index as isize).offset(1 as c_int as isize) + as *const c_void, (::core::mem::size_of::<*mut spTrackEntry>() as c_ulong) .wrapping_mul(((*self_0).size - index) as c_ulong), ); @@ -6839,13 +7594,14 @@ pub unsafe extern "C" fn spTrackEntryArray_peek( ) -> *mut spTrackEntry { return *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize); } -static mut SP_EMPTY_ANIMATION: *mut spAnimation = std::ptr::null_mut(); +static mut SP_EMPTY_ANIMATION: *mut spAnimation = 0 as *const spAnimation + as *mut spAnimation; #[no_mangle] pub unsafe extern "C" fn spAnimationState_disposeStatics() { if !SP_EMPTY_ANIMATION.is_null() { spAnimation_dispose(SP_EMPTY_ANIMATION); } - SP_EMPTY_ANIMATION = std::ptr::null_mut(); + SP_EMPTY_ANIMATION = 0 as *mut spAnimation; } #[no_mangle] pub unsafe extern "C" fn _spEventQueue_create( @@ -6855,16 +7611,17 @@ pub unsafe extern "C" fn _spEventQueue_create( 1 as c_int as size_t, ::core::mem::size_of::<_spEventQueue>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 2835 as c_int, + 2955 as c_int, ) as *mut _spEventQueue; (*self_0).state = state; (*self_0).objectsCount = 0 as c_int; (*self_0).objectsCapacity = 16 as c_int; - (*self_0).objects = _spCalloc( + (*self_0) + .objects = _spCalloc( (*self_0).objectsCapacity as size_t, ::core::mem::size_of::<_spEventQueueItem>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 2839 as c_int, + 2959 as c_int, ) as *mut _spEventQueueItem; (*self_0).drainDisabled = 0 as c_int; return self_0; @@ -6880,13 +7637,13 @@ pub unsafe extern "C" fn _spEventQueue_ensureCapacity( mut newElements: c_int, ) { if (*self_0).objectsCount + newElements > (*self_0).objectsCapacity { - let mut newObjects: *mut _spEventQueueItem = std::ptr::null_mut(); + let mut newObjects: *mut _spEventQueueItem = 0 as *mut _spEventQueueItem; (*self_0).objectsCapacity <<= 1 as c_int; newObjects = _spCalloc( (*self_0).objectsCapacity as size_t, ::core::mem::size_of::<_spEventQueueItem>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 2853 as c_int, + 2973 as c_int, ) as *mut _spEventQueueItem; spine_memcpy( newObjects as *mut c_void, @@ -6904,9 +7661,9 @@ pub unsafe extern "C" fn _spEventQueue_addType( mut type_0: spEventType, ) { _spEventQueue_ensureCapacity(self_0, 1 as c_int); - let fresh19 = (*self_0).objectsCount; + let fresh14 = (*self_0).objectsCount; (*self_0).objectsCount = (*self_0).objectsCount + 1; - (*((*self_0).objects).offset(fresh19 as isize)).type_0 = type_0 as c_int; + (*((*self_0).objects).offset(fresh14 as isize)).type_0 = type_0 as c_int; } #[no_mangle] pub unsafe extern "C" fn _spEventQueue_addEntry( @@ -6914,10 +7671,10 @@ pub unsafe extern "C" fn _spEventQueue_addEntry( mut entry: *mut spTrackEntry, ) { _spEventQueue_ensureCapacity(self_0, 1 as c_int); - let fresh20 = (*self_0).objectsCount; + let fresh15 = (*self_0).objectsCount; (*self_0).objectsCount = (*self_0).objectsCount + 1; - let ref mut fresh21 = (*((*self_0).objects).offset(fresh20 as isize)).entry; - *fresh21 = entry; + let ref mut fresh16 = (*((*self_0).objects).offset(fresh15 as isize)).entry; + *fresh16 = entry; } #[no_mangle] pub unsafe extern "C" fn _spEventQueue_addEvent( @@ -6925,10 +7682,10 @@ pub unsafe extern "C" fn _spEventQueue_addEvent( mut event: *mut spEvent, ) { _spEventQueue_ensureCapacity(self_0, 1 as c_int); - let fresh22 = (*self_0).objectsCount; + let fresh17 = (*self_0).objectsCount; (*self_0).objectsCount = (*self_0).objectsCount + 1; - let ref mut fresh23 = (*((*self_0).objects).offset(fresh22 as isize)).event; - *fresh23 = event; + let ref mut fresh18 = (*((*self_0).objects).offset(fresh17 as isize)).event; + *fresh18 = event; } #[no_mangle] pub unsafe extern "C" fn _spEventQueue_start( @@ -6995,71 +7752,81 @@ pub unsafe extern "C" fn _spEventQueue_drain(mut self_0: *mut _spEventQueue) { (*self_0).drainDisabled = 1 as c_int; i = 0 as c_int; while i < (*self_0).objectsCount { - let mut type_0: spEventType = - (*((*self_0).objects).offset(i as isize)).type_0 as spEventType; - let mut entry: *mut spTrackEntry = - (*((*self_0).objects).offset((i + 1 as c_int) as isize)).entry; - let mut event: *mut spEvent = std::ptr::null_mut(); + let mut type_0: spEventType = (*((*self_0).objects).offset(i as isize)).type_0 + as spEventType; + let mut entry: *mut spTrackEntry = (*((*self_0).objects) + .offset((i + 1 as c_int) as isize)) + .entry; + let mut event: *mut spEvent = 0 as *mut spEvent; let mut current_block_22: u64; match type_0 as c_uint { 0 | 1 | 3 => { if ((*entry).listener).is_some() { - ((*entry).listener).expect("non-null function pointer")( + ((*entry).listener) + .expect( + "non-null function pointer", + )( &mut (*(*self_0).state).super_0, type_0, entry, - std::ptr::null_mut(), + 0 as *mut spEvent, ); } if ((*(*self_0).state).super_0.listener).is_some() { - ((*(*self_0).state).super_0.listener).expect("non-null function pointer")( + ((*(*self_0).state).super_0.listener) + .expect( + "non-null function pointer", + )( &mut (*(*self_0).state).super_0, type_0, entry, - std::ptr::null_mut(), + 0 as *mut spEvent, ); } current_block_22 = 10043043949733653460; } 2 => { if ((*entry).listener).is_some() { - ((*entry).listener).expect("non-null function pointer")( + ((*entry).listener) + .expect( + "non-null function pointer", + )( &mut (*(*self_0).state).super_0, type_0, entry, - std::ptr::null_mut(), + 0 as *mut spEvent, ); } if ((*(*self_0).state).super_0.listener).is_some() { - ((*(*self_0).state).super_0.listener).expect("non-null function pointer")( + ((*(*self_0).state).super_0.listener) + .expect( + "non-null function pointer", + )( &mut (*(*self_0).state).super_0, type_0, entry, - std::ptr::null_mut(), + 0 as *mut spEvent, ); } - current_block_22 = 18315969784848825930; + current_block_22 = 4264312688947386234; } 4 => { - current_block_22 = 18315969784848825930; + current_block_22 = 4264312688947386234; } 5 => { - event = (*((*self_0).objects).offset((i + 2 as c_int) as isize)).event; + event = (*((*self_0).objects).offset((i + 2 as c_int) as isize)) + .event; if ((*entry).listener).is_some() { - ((*entry).listener).expect("non-null function pointer")( - &mut (*(*self_0).state).super_0, - type_0, - entry, - event, - ); + ((*entry).listener) + .expect( + "non-null function pointer", + )(&mut (*(*self_0).state).super_0, type_0, entry, event); } if ((*(*self_0).state).super_0.listener).is_some() { - ((*(*self_0).state).super_0.listener).expect("non-null function pointer")( - &mut (*(*self_0).state).super_0, - type_0, - entry, - event, - ); + ((*(*self_0).state).super_0.listener) + .expect( + "non-null function pointer", + )(&mut (*(*self_0).state).super_0, type_0, entry, event); } i += 1; current_block_22 = 10043043949733653460; @@ -7069,21 +7836,27 @@ pub unsafe extern "C" fn _spEventQueue_drain(mut self_0: *mut _spEventQueue) { } } match current_block_22 { - 18315969784848825930 => { + 4264312688947386234 => { if ((*entry).listener).is_some() { - ((*entry).listener).expect("non-null function pointer")( + ((*entry).listener) + .expect( + "non-null function pointer", + )( &mut (*(*self_0).state).super_0, SP_ANIMATION_DISPOSE, entry, - std::ptr::null_mut(), + 0 as *mut spEvent, ); } if ((*(*self_0).state).super_0.listener).is_some() { - ((*(*self_0).state).super_0.listener).expect("non-null function pointer")( + ((*(*self_0).state).super_0.listener) + .expect( + "non-null function pointer", + )( &mut (*(*self_0).state).super_0, SP_ANIMATION_DISPOSE, entry, - std::ptr::null_mut(), + 0 as *mut spEvent, ); } _spAnimationState_disposeTrackEntry(entry); @@ -7096,17 +7869,23 @@ pub unsafe extern "C" fn _spEventQueue_drain(mut self_0: *mut _spEventQueue) { (*self_0).drainDisabled = 0 as c_int; } #[no_mangle] -pub unsafe extern "C" fn _spAnimationState_enableQueue(mut self_0: *mut spAnimationState) { +pub unsafe extern "C" fn _spAnimationState_enableQueue( + mut self_0: *mut spAnimationState, +) { let mut internal: *mut _spAnimationState = self_0 as *mut _spAnimationState; (*(*internal).queue).drainDisabled = 0 as c_int; } #[no_mangle] -pub unsafe extern "C" fn _spAnimationState_disableQueue(mut self_0: *mut spAnimationState) { +pub unsafe extern "C" fn _spAnimationState_disableQueue( + mut self_0: *mut spAnimationState, +) { let mut internal: *mut _spAnimationState = self_0 as *mut _spAnimationState; (*(*internal).queue).drainDisabled = 1 as c_int; } #[no_mangle] -pub unsafe extern "C" fn _spAnimationState_disposeTrackEntry(mut entry: *mut spTrackEntry) { +pub unsafe extern "C" fn _spAnimationState_disposeTrackEntry( + mut entry: *mut spTrackEntry, +) { spIntArray_dispose((*entry).timelineMode); spTrackEntryArray_dispose((*entry).timelineHoldMix); _spFree((*entry).timelinesRotation as *mut c_void); @@ -7123,39 +7902,31 @@ pub unsafe extern "C" fn _spAnimationState_disposeTrackEntries( while !from.is_null() { let mut nextFrom: *mut spTrackEntry = (*from).mixingFrom; if ((*entry).listener).is_some() { - ((*entry).listener).expect("non-null function pointer")( - state, - SP_ANIMATION_DISPOSE, - from, - std::ptr::null_mut(), - ); + ((*entry).listener) + .expect( + "non-null function pointer", + )(state, SP_ANIMATION_DISPOSE, from, 0 as *mut spEvent); } if ((*state).listener).is_some() { - ((*state).listener).expect("non-null function pointer")( - state, - SP_ANIMATION_DISPOSE, - from, - std::ptr::null_mut(), - ); + ((*state).listener) + .expect( + "non-null function pointer", + )(state, SP_ANIMATION_DISPOSE, from, 0 as *mut spEvent); } _spAnimationState_disposeTrackEntry(from); from = nextFrom; } if ((*entry).listener).is_some() { - ((*entry).listener).expect("non-null function pointer")( - state, - SP_ANIMATION_DISPOSE, - entry, - std::ptr::null_mut(), - ); + ((*entry).listener) + .expect( + "non-null function pointer", + )(state, SP_ANIMATION_DISPOSE, entry, 0 as *mut spEvent); } if ((*state).listener).is_some() { - ((*state).listener).expect("non-null function pointer")( - state, - SP_ANIMATION_DISPOSE, - entry, - std::ptr::null_mut(), - ); + ((*state).listener) + .expect( + "non-null function pointer", + )(state, SP_ANIMATION_DISPOSE, entry, 0 as *mut spEvent); } _spAnimationState_disposeTrackEntry(entry); entry = next; @@ -7165,13 +7936,13 @@ pub unsafe extern "C" fn _spAnimationState_disposeTrackEntries( pub unsafe extern "C" fn spAnimationState_create( mut data: *mut spAnimationStateData, ) -> *mut spAnimationState { - let mut internal: *mut _spAnimationState = std::ptr::null_mut(); - let mut self_0: *mut spAnimationState = std::ptr::null_mut(); + let mut internal: *mut _spAnimationState = 0 as *mut _spAnimationState; + let mut self_0: *mut spAnimationState = 0 as *mut spAnimationState; if SP_EMPTY_ANIMATION.is_null() { SP_EMPTY_ANIMATION = 1 as c_int as *mut spAnimation; SP_EMPTY_ANIMATION = spAnimation_create( b"\0" as *const u8 as *const c_char, - std::ptr::null_mut(), + 0 as *mut spTimelineArray, 0 as c_int as c_float, ); } @@ -7179,24 +7950,25 @@ pub unsafe extern "C" fn spAnimationState_create( 1 as c_int as size_t, ::core::mem::size_of::<_spAnimationState>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 2995 as c_int, + 3115 as c_int, ) as *mut _spAnimationState; self_0 = &mut (*internal).super_0; - let ref mut fresh24 = *(&mut (*self_0).data as *mut *mut spAnimationStateData); - *fresh24 = data; + (*self_0).data = data; (*self_0).timeScale = 1 as c_int as c_float; (*internal).queue = _spEventQueue_create(internal); - (*internal).events = _spCalloc( + (*internal) + .events = _spCalloc( 128 as c_int as size_t, ::core::mem::size_of::<*mut spEvent>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 3002 as c_int, + 3122 as c_int, ) as *mut *mut spEvent; - (*internal).propertyIDs = _spCalloc( + (*internal) + .propertyIDs = _spCalloc( 128 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 3004 as c_int, + 3124 as c_int, ) as *mut spPropertyId; (*internal).propertyIDsCapacity = 128 as c_int; return self_0; @@ -7207,7 +7979,10 @@ pub unsafe extern "C" fn spAnimationState_dispose(mut self_0: *mut spAnimationSt let mut internal: *mut _spAnimationState = self_0 as *mut _spAnimationState; i = 0 as c_int; while i < (*self_0).tracksCount { - _spAnimationState_disposeTrackEntries(self_0, *((*self_0).tracks).offset(i as isize)); + _spAnimationState_disposeTrackEntries( + self_0, + *((*self_0).tracks).offset(i as isize), + ); i += 1; } _spFree((*self_0).tracks as *mut c_void); @@ -7231,7 +8006,7 @@ pub unsafe extern "C" fn spAnimationState_update( while i < n { let mut currentDelta: c_float = 0.; let mut current: *mut spTrackEntry = *((*self_0).tracks).offset(i as isize); - let mut next: *mut spTrackEntry = std::ptr::null_mut(); + let mut next: *mut spTrackEntry = 0 as *mut spTrackEntry; if !current.is_null() { (*current).animationLast = (*current).nextAnimationLast; (*current).trackLast = (*current).nextTrackLast; @@ -7253,16 +8028,26 @@ pub unsafe extern "C" fn spAnimationState_update( _ => { next = (*current).next; if !next.is_null() { - let mut nextTime: c_float = (*current).trackLast - (*next).delay; + let mut nextTime: c_float = (*current).trackLast + - (*next).delay; if nextTime >= 0 as c_int as c_float { (*next).delay = 0 as c_int as c_float; - (*next).trackTime += if (*current).timeScale == 0 as c_int as c_float { - 0 as c_int as c_float - } else { - (nextTime / (*current).timeScale + delta) * (*next).timeScale - }; + (*next).trackTime + += if (*current).timeScale + == 0 as c_int as c_float + { + 0 as c_int as c_float + } else { + (nextTime / (*current).timeScale + delta) + * (*next).timeScale + }; (*current).trackTime += currentDelta; - _spAnimationState_setCurrent(self_0, i, next, 1 as c_int); + _spAnimationState_setCurrent( + self_0, + i, + next, + 1 as c_int, + ); while !((*next).mixingFrom).is_null() { (*next).mixTime += delta; next = (*next).mixingFrom; @@ -7274,8 +8059,8 @@ pub unsafe extern "C" fn spAnimationState_update( } else if (*current).trackLast >= (*current).trackEnd && ((*current).mixingFrom).is_null() { - let ref mut fresh25 = *((*self_0).tracks).offset(i as isize); - *fresh25 = std::ptr::null_mut(); + let ref mut fresh19 = *((*self_0).tracks).offset(i as isize); + *fresh19 = 0 as *mut spTrackEntry; _spEventQueue_end((*internal).queue, current); spAnimationState_clearNext(self_0, current); current_block_29 = 16559507199688588974; @@ -7286,12 +8071,16 @@ pub unsafe extern "C" fn spAnimationState_update( 16559507199688588974 => {} _ => { if !((*current).mixingFrom).is_null() - && _spAnimationState_updateMixingFrom(self_0, current, delta) != 0 + && _spAnimationState_updateMixingFrom( + self_0, + current, + delta, + ) != 0 { let mut from: *mut spTrackEntry = (*current).mixingFrom; - (*current).mixingFrom = std::ptr::null_mut(); + (*current).mixingFrom = 0 as *mut spTrackEntry; if !from.is_null() { - (*from).mixingTo = std::ptr::null_mut(); + (*from).mixingTo = 0 as *mut spTrackEntry; } while !from.is_null() { _spEventQueue_end((*internal).queue, from); @@ -7323,8 +8112,11 @@ pub unsafe extern "C" fn _spAnimationState_updateMixingFrom( finished = _spAnimationState_updateMixingFrom(self_0, from, delta); (*from).animationLast = (*from).nextAnimationLast; (*from).trackLast = (*from).nextTrackLast; - if (*to).mixTime > 0 as c_int as c_float && (*to).mixTime >= (*to).mixDuration { - if (*from).totalAlpha == 0 as c_int as c_float || (*to).mixDuration == 0 as c_int as c_float + if (*to).mixTime > 0 as c_int as c_float + && (*to).mixTime >= (*to).mixDuration + { + if (*from).totalAlpha == 0 as c_int as c_float + || (*to).mixDuration == 0 as c_int as c_float { (*to).mixingFrom = (*from).mixingFrom; if !((*from).mixingFrom).is_null() { @@ -7345,26 +8137,26 @@ pub unsafe extern "C" fn spAnimationState_apply( mut skeleton: *mut spSkeleton, ) -> c_int { let mut internal: *mut _spAnimationState = self_0 as *mut _spAnimationState; - let mut current: *mut spTrackEntry = std::ptr::null_mut(); + let mut current: *mut spTrackEntry = 0 as *mut spTrackEntry; let mut i: c_int = 0; let mut ii: c_int = 0; let mut n: c_int = 0; let mut animationLast: c_float = 0.; let mut animationTime: c_float = 0.; let mut timelineCount: c_int = 0; - let mut timelines: *mut *mut spTimeline = std::ptr::null_mut(); + let mut timelines: *mut *mut spTimeline = 0 as *mut *mut spTimeline; let mut firstFrame: c_int = 0; let mut shortestRotation: c_int = 0; - let mut timelinesRotation: *mut c_float = std::ptr::null_mut(); - let mut timeline: *mut spTimeline = std::ptr::null_mut(); + let mut timelinesRotation: *mut c_float = 0 as *mut c_float; + let mut timeline: *mut spTimeline = 0 as *mut spTimeline; let mut applied: c_int = 0 as c_int; let mut blend: spMixBlend = SP_MIX_BLEND_SETUP; let mut timelineBlend: spMixBlend = SP_MIX_BLEND_SETUP; let mut setupState: c_int = 0 as c_int; - let mut slots: *mut *mut spSlot = std::ptr::null_mut(); - let mut slot: *mut spSlot = std::ptr::null_mut(); - let mut attachmentName: *const c_char = std::ptr::null(); - let mut applyEvents: *mut *mut spEvent = std::ptr::null_mut(); + let mut slots: *mut *mut spSlot = 0 as *mut *mut spSlot; + let mut slot: *mut spSlot = 0 as *mut spSlot; + let mut attachmentName: *const c_char = 0 as *const c_char; + let mut applyEvents: *mut *mut spEvent = 0 as *mut *mut spEvent; let mut applyTime: c_float = 0.; if (*internal).animationsChanged != 0 { _spAnimationState_animationsChanged(self_0); @@ -7372,7 +8164,7 @@ pub unsafe extern "C" fn spAnimationState_apply( i = 0 as c_int; n = (*self_0).tracksCount; while i < n { - let mut mix: c_float = 0.; + let mut alpha: c_float = 0.; current = *((*self_0).tracks).offset(i as isize); if !(current.is_null() || (*current).delay > 0 as c_int as c_float) { applied = -(1 as c_int); @@ -7381,12 +8173,22 @@ pub unsafe extern "C" fn spAnimationState_apply( } else { (*current).mixBlend as c_uint }) as spMixBlend; - mix = (*current).alpha; + alpha = (*current).alpha; if !((*current).mixingFrom).is_null() { - mix *= _spAnimationState_applyMixingFrom(self_0, current, skeleton, blend); - } else if (*current).trackTime >= (*current).trackEnd && ((*current).next).is_null() { - mix = 0 as c_int as c_float; + alpha + *= _spAnimationState_applyMixingFrom( + self_0, + current, + skeleton, + blend, + ); + } else if (*current).trackTime >= (*current).trackEnd + && ((*current).next).is_null() + { + alpha = 0 as c_int as c_float; } + let mut attachments: c_int = (alpha + >= (*current).alphaAttachmentThreshold) as c_int; animationLast = (*current).animationLast; animationTime = spTrackEntry_getAnimationTime(current); timelineCount = (*(*(*current).animation).timelines).size; @@ -7394,23 +8196,26 @@ pub unsafe extern "C" fn spAnimationState_apply( applyTime = animationTime; if (*current).reverse != 0 { applyTime = (*(*current).animation).duration - applyTime; - applyEvents = std::ptr::null_mut(); + applyEvents = 0 as *mut *mut spEvent; } timelines = (*(*(*current).animation).timelines).items; - if i == 0 as c_int && mix == 1 as c_int as c_float - || blend as c_uint == SP_MIX_BLEND_ADD as c_int as c_uint + if i == 0 as c_int && alpha == 1 as c_int as c_float + || blend as c_uint + == SP_MIX_BLEND_ADD as c_int as c_uint { ii = 0 as c_int; while ii < timelineCount { timeline = *timelines.offset(ii as isize); - if (*timeline).type_0 as c_uint == SP_TIMELINE_ATTACHMENT as c_int as c_uint { + if (*timeline).type_0 as c_uint + == SP_TIMELINE_ATTACHMENT as c_int as c_uint + { _spAnimationState_applyAttachmentTimeline( self_0, timeline, skeleton, applyTime, blend, - -(1 as c_int), + attachments, ); } else { spTimeline_apply( @@ -7420,7 +8225,7 @@ pub unsafe extern "C" fn spAnimationState_apply( applyTime, applyEvents, &mut (*internal).eventsCount, - mix, + alpha, blend, SP_MIX_DIRECTION_IN, ); @@ -7431,29 +8236,35 @@ pub unsafe extern "C" fn spAnimationState_apply( let mut timelineMode: *mut spIntArray = (*current).timelineMode; shortestRotation = (*current).shortestRotation; firstFrame = (shortestRotation == 0 - && (*current).timelinesRotationCount != timelineCount << 1 as c_int) - as c_int; + && (*current).timelinesRotationCount + != timelineCount << 1 as c_int) as c_int; if firstFrame != 0 { - _spAnimationState_resizeTimelinesRotation(current, timelineCount << 1 as c_int); + _spAnimationState_resizeTimelinesRotation( + current, + timelineCount << 1 as c_int, + ); } timelinesRotation = (*current).timelinesRotation; ii = 0 as c_int; while ii < timelineCount { timeline = *timelines.offset(ii as isize); - timelineBlend = (if *((*timelineMode).items).offset(ii as isize) == 0 as c_int { + timelineBlend = (if *((*timelineMode).items).offset(ii as isize) + == 0 as c_int + { blend as c_uint } else { SP_MIX_BLEND_SETUP as c_int as c_uint }) as spMixBlend; if shortestRotation == 0 - && (*timeline).type_0 as c_uint == SP_TIMELINE_ROTATE as c_int as c_uint + && (*timeline).type_0 as c_uint + == SP_TIMELINE_ROTATE as c_int as c_uint { _spAnimationState_applyRotateTimeline( self_0, timeline, skeleton, applyTime, - mix, + alpha, timelineBlend, timelinesRotation, ii << 1 as c_int, @@ -7468,7 +8279,7 @@ pub unsafe extern "C" fn spAnimationState_apply( skeleton, applyTime, timelineBlend, - -(1 as c_int), + attachments, ); } else { spTimeline_apply( @@ -7478,7 +8289,7 @@ pub unsafe extern "C" fn spAnimationState_apply( applyTime, applyEvents, &mut (*internal).eventsCount, - mix, + alpha, timelineBlend, SP_MIX_DIRECTION_IN, ); @@ -7504,7 +8315,7 @@ pub unsafe extern "C" fn spAnimationState_apply( spSlot_setAttachment( slot, if attachmentName.is_null() { - std::ptr::null_mut() + 0 as *mut spAttachment } else { spSkeleton_getAttachmentForSlotIndex( skeleton, @@ -7529,24 +8340,24 @@ pub unsafe extern "C" fn _spAnimationState_applyMixingFrom( ) -> c_float { let mut internal: *mut _spAnimationState = self_0 as *mut _spAnimationState; let mut mix: c_float = 0.; - let mut events: *mut *mut spEvent = std::ptr::null_mut(); + let mut events: *mut *mut spEvent = 0 as *mut *mut spEvent; let mut attachments: c_int = 0; let mut drawOrder: c_int = 0; let mut animationLast: c_float = 0.; let mut animationTime: c_float = 0.; let mut timelineCount: c_int = 0; - let mut timelines: *mut *mut spTimeline = std::ptr::null_mut(); - let mut timelineMode: *mut spIntArray = std::ptr::null_mut(); - let mut timelineHoldMix: *mut spTrackEntryArray = std::ptr::null_mut(); + let mut timelines: *mut *mut spTimeline = 0 as *mut *mut spTimeline; + let mut timelineMode: *mut spIntArray = 0 as *mut spIntArray; + let mut timelineHoldMix: *mut spTrackEntryArray = 0 as *mut spTrackEntryArray; let mut timelineBlend: spMixBlend = SP_MIX_BLEND_SETUP; let mut alphaHold: c_float = 0.; let mut alphaMix: c_float = 0.; let mut alpha: c_float = 0.; let mut firstFrame: c_int = 0; let mut shortestRotation: c_int = 0; - let mut timelinesRotation: *mut c_float = std::ptr::null_mut(); + let mut timelinesRotation: *mut c_float = 0 as *mut c_float; let mut i: c_int = 0; - let mut holdMix: *mut spTrackEntry = std::ptr::null_mut(); + let mut holdMix: *mut spTrackEntry = 0 as *mut spTrackEntry; let mut applyTime: c_float = 0.; let mut from: *mut spTrackEntry = (*to).mixingFrom; if !((*from).mixingFrom).is_null() { @@ -7566,8 +8377,8 @@ pub unsafe extern "C" fn _spAnimationState_applyMixingFrom( blend = (*from).mixBlend; } } - attachments = (mix < (*from).attachmentThreshold) as c_int; - drawOrder = (mix < (*from).drawOrderThreshold) as c_int; + attachments = (mix < (*from).mixAttachmentThreshold) as c_int; + drawOrder = (mix < (*from).mixDrawOrderThreshold) as c_int; timelineCount = (*(*(*from).animation).timelines).size; timelines = (*(*(*from).animation).timelines).items; alphaHold = (*from).alpha * (*to).interruptAlpha; @@ -7575,7 +8386,7 @@ pub unsafe extern "C" fn _spAnimationState_applyMixingFrom( animationLast = (*from).animationLast; animationTime = spTrackEntry_getAnimationTime(from); applyTime = animationTime; - events = std::ptr::null_mut(); + events = 0 as *mut *mut spEvent; if (*from).reverse != 0 { applyTime = (*(*from).animation).duration - applyTime; } else if mix < (*from).eventThreshold { @@ -7606,7 +8417,10 @@ pub unsafe extern "C" fn _spAnimationState_applyMixingFrom( && (*from).timelinesRotationCount != timelineCount << 1 as c_int) as c_int; if firstFrame != 0 { - _spAnimationState_resizeTimelinesRotation(from, timelineCount << 1 as c_int); + _spAnimationState_resizeTimelinesRotation( + from, + timelineCount << 1 as c_int, + ); } timelinesRotation = (*from).timelinesRotation; (*from).totalAlpha = 0 as c_int as c_float; @@ -7648,11 +8462,13 @@ pub unsafe extern "C" fn _spAnimationState_applyMixingFrom( holdMix = *((*timelineHoldMix).items).offset(i as isize); alpha = alphaHold * (if 0 as c_int as c_float - > 1 as c_int as c_float - (*holdMix).mixTime / (*holdMix).mixDuration + > 1 as c_int as c_float + - (*holdMix).mixTime / (*holdMix).mixDuration { 0 as c_int as c_float } else { - 1 as c_int as c_float - (*holdMix).mixTime / (*holdMix).mixDuration + 1 as c_int as c_float + - (*holdMix).mixTime / (*holdMix).mixDuration }); current_block_62 = 12829669402821218572; } @@ -7661,7 +8477,8 @@ pub unsafe extern "C" fn _spAnimationState_applyMixingFrom( 12829669402821218572 => { (*from).totalAlpha += alpha; if shortestRotation == 0 - && (*timeline_0).type_0 as c_uint == SP_TIMELINE_ROTATE as c_int as c_uint + && (*timeline_0).type_0 as c_uint + == SP_TIMELINE_ROTATE as c_int as c_uint { _spAnimationState_applyRotateTimeline( self_0, @@ -7683,13 +8500,15 @@ pub unsafe extern "C" fn _spAnimationState_applyMixingFrom( skeleton, applyTime, timelineBlend, - attachments, + (attachments != 0 + && alpha >= (*from).alphaAttachmentThreshold) as c_int, ); } else { if drawOrder != 0 && (*timeline_0).type_0 as c_uint == SP_TIMELINE_DRAWORDER as c_int as c_uint - && timelineBlend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint + && timelineBlend as c_uint + == SP_MIX_BLEND_SETUP as c_int as c_uint { direction = SP_MIX_DIRECTION_IN; } @@ -7729,9 +8548,13 @@ unsafe extern "C" fn _spAnimationState_setAttachment( spSlot_setAttachment( slot, if attachmentName.is_null() { - std::ptr::null_mut() + 0 as *mut spAttachment } else { - spSkeleton_getAttachmentForSlotIndex(skeleton, (*(*slot).data).index, attachmentName) + spSkeleton_getAttachmentForSlotIndex( + skeleton, + (*(*slot).data).index, + attachmentName, + ) }, ); if attachments != 0 { @@ -7762,9 +8585,10 @@ pub unsafe extern "C" fn _spAnimationState_applyAttachmentTimeline( mut blend: spMixBlend, mut attachments: c_int, ) { - let mut attachmentTimeline: *mut spAttachmentTimeline = std::ptr::null_mut(); - let mut slot: *mut spSlot = std::ptr::null_mut(); - let mut frames: *mut c_float = std::ptr::null_mut(); + let mut attachmentTimeline: *mut spAttachmentTimeline = 0 + as *mut spAttachmentTimeline; + let mut slot: *mut spSlot = 0 as *mut spSlot; + let mut frames: *mut c_float = 0 as *mut c_float; attachmentTimeline = timeline as *mut spAttachmentTimeline; slot = *((*skeleton).slots).offset((*attachmentTimeline).slotIndex as isize); if (*(*slot).bone).active == 0 { @@ -7788,11 +8612,14 @@ pub unsafe extern "C" fn _spAnimationState_applyAttachmentTimeline( self_0, skeleton, slot, - *((*attachmentTimeline).attachmentNames).offset(binarySearch1( - frames, - (*(*attachmentTimeline).super_0.frames).size, - time, - ) as isize), + *((*attachmentTimeline).attachmentNames) + .offset( + binarySearch1( + frames, + (*(*attachmentTimeline).super_0.frames).size, + time, + ) as isize, + ), attachments, ); } @@ -7802,7 +8629,7 @@ pub unsafe extern "C" fn _spAnimationState_applyAttachmentTimeline( } #[no_mangle] pub unsafe extern "C" fn _spAnimationState_applyRotateTimeline( - mut _self_0: *mut spAnimationState, + mut self_0: *mut spAnimationState, mut timeline: *mut spTimeline, mut skeleton: *mut spSkeleton, mut time: c_float, @@ -7812,9 +8639,9 @@ pub unsafe extern "C" fn _spAnimationState_applyRotateTimeline( mut i: c_int, mut firstFrame: c_int, ) { - let mut rotateTimeline: *mut spRotateTimeline = std::ptr::null_mut(); - let mut frames: *mut c_float = std::ptr::null_mut(); - let mut bone: *mut spBone = std::ptr::null_mut(); + let mut rotateTimeline: *mut spRotateTimeline = 0 as *mut spRotateTimeline; + let mut frames: *mut c_float = 0 as *mut c_float; + let mut bone: *mut spBone = 0 as *mut spBone; let mut r1: c_float = 0.; let mut r2: c_float = 0.; let mut total: c_float = 0.; @@ -7830,8 +8657,8 @@ pub unsafe extern "C" fn _spAnimationState_applyRotateTimeline( skeleton, 0 as c_int as c_float, time, - std::ptr::null_mut(), - std::ptr::null_mut(), + 0 as *mut *mut spEvent, + 0 as *mut c_int, 1 as c_int as c_float, blend, SP_MIX_DIRECTION_IN, @@ -7860,7 +8687,9 @@ pub unsafe extern "C" fn _spAnimationState_applyRotateTimeline( return; } } else { - r1 = if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint { + r1 = if blend as c_uint + == SP_MIX_BLEND_SETUP as c_int as c_uint + { (*(*bone).data).rotation } else { (*bone).rotation @@ -7869,14 +8698,15 @@ pub unsafe extern "C" fn _spAnimationState_applyRotateTimeline( + spCurveTimeline1_getCurveValue(&mut (*rotateTimeline).super_0, time); } diff = r2 - r1; - diff -= ((16384 as c_int - - (16384.499999999996f64 - (diff / 360 as c_int as c_float) as c_double) as c_int) - * 360 as c_int) as c_float; + diff + -= ceil((diff / 360 as c_int as c_float) as c_double - 0.5f64) + as c_float * 360 as c_int as c_float; if diff == 0 as c_int as c_float { total = *timelinesRotation.offset(i as isize); } else { let mut lastTotal: c_float = 0.; let mut lastDiff: c_float = 0.; + let mut loops: c_float = 0.; if firstFrame != 0 { lastTotal = 0 as c_int as c_float; lastDiff = diff; @@ -7884,61 +8714,80 @@ pub unsafe extern "C" fn _spAnimationState_applyRotateTimeline( lastTotal = *timelinesRotation.offset(i as isize); lastDiff = *timelinesRotation.offset((i + 1 as c_int) as isize); } - current = (diff > 0 as c_int as c_float) as c_int; + loops = lastTotal - spine_fmodf(lastTotal, 360 as c_int as c_float); + total = diff + loops; + current = (diff >= 0 as c_int as c_float) as c_int; dir = (lastTotal >= 0 as c_int as c_float) as c_int; if (if lastDiff < 0 as c_int as c_float { - -1.0f32 - } else { - if lastDiff > 0 as c_int as c_float { - 1.0f32 - } else { - 0.0f32 - } - }) != (if diff < 0 as c_int as c_float { - -1.0f32 - } else { - if diff > 0 as c_int as c_float { - 1.0f32 - } else { - 0.0f32 - } - }) && (if lastDiff < 0 as c_int as c_float { -lastDiff } else { lastDiff }) <= 90 as c_int as c_float + && (if lastDiff < 0 as c_int as c_float { + -1.0f32 + } else { + (if lastDiff > 0 as c_int as c_float { + 1.0f32 + } else { + 0.0f32 + }) + }) + != (if diff < 0 as c_int as c_float { + -1.0f32 + } else { + (if diff > 0 as c_int as c_float { + 1.0f32 + } else { + 0.0f32 + }) + }) { - if (if lastTotal < 0 as c_int as c_float { - -lastTotal + if (if lastTotal - loops < 0 as c_int as c_float { + -(lastTotal - loops) } else { - lastTotal + lastTotal - loops }) > 180 as c_int as c_float { - lastTotal += 360 as c_int as c_float + total + += 360 as c_int as c_float + * (if lastTotal < 0 as c_int as c_float { + -1.0f32 + } else { + (if lastTotal > 0 as c_int as c_float { + 1.0f32 + } else { + 0.0f32 + }) + }); + dir = current; + } else if loops != 0 as c_int as c_float { + total + -= 360 as c_int as c_float + * (if lastTotal < 0 as c_int as c_float { + -1.0f32 + } else { + (if lastTotal > 0 as c_int as c_float { + 1.0f32 + } else { + 0.0f32 + }) + }); + } else { + dir = current; + } + } + if dir != current { + total + += 360 as c_int as c_float * (if lastTotal < 0 as c_int as c_float { -1.0f32 } else { - if lastTotal > 0 as c_int as c_float { + (if lastTotal > 0 as c_int as c_float { 1.0f32 } else { 0.0f32 - } + }) }); - } - dir = current; - } - total = diff + lastTotal - spine_fmodf(lastTotal, 360 as c_int as c_float); - if dir != current { - total += 360 as c_int as c_float - * (if lastTotal < 0 as c_int as c_float { - -1.0f32 - } else { - if lastTotal > 0 as c_int as c_float { - 1.0f32 - } else { - 0.0f32 - } - }); } *timelinesRotation.offset(i as isize) = total; } @@ -7951,8 +8800,8 @@ pub unsafe extern "C" fn _spAnimationState_queueEvents( mut entry: *mut spTrackEntry, mut animationTime: c_float, ) { - let mut events: *mut *mut spEvent = std::ptr::null_mut(); - let mut event: *mut spEvent = std::ptr::null_mut(); + let mut events: *mut *mut spEvent = 0 as *mut *mut spEvent; + let mut event: *mut spEvent = 0 as *mut spEvent; let mut internal: *mut _spAnimationState = self_0 as *mut _spAnimationState; let mut i: c_int = 0; let mut n: c_int = 0; @@ -7975,12 +8824,17 @@ pub unsafe extern "C" fn _spAnimationState_queueEvents( i += 1; } if (*entry).loop_0 != 0 { - complete = (duration == 0 as c_int as c_float - || trackLastWrapped > spine_fmodf((*entry).trackTime, duration)) - as c_int; + if duration == 0 as c_int as c_float { + complete = -(1 as c_int); + } else { + let mut cycles: c_int = ((*entry).trackTime / duration) as c_int; + complete = (cycles > 0 as c_int + && cycles > ((*entry).trackLast / duration) as c_int) + as c_int; + } } else { - complete = - (animationTime >= animationEnd && (*entry).animationLast < animationEnd) as c_int; + complete = (animationTime >= animationEnd + && (*entry).animationLast < animationEnd) as c_int; } if complete != 0 { _spEventQueue_complete((*internal).queue, entry); @@ -7994,7 +8848,9 @@ pub unsafe extern "C" fn _spAnimationState_queueEvents( } } #[no_mangle] -pub unsafe extern "C" fn spAnimationState_clearTracks(mut self_0: *mut spAnimationState) { +pub unsafe extern "C" fn spAnimationState_clearTracks( + mut self_0: *mut spAnimationState, +) { let mut internal: *mut _spAnimationState = self_0 as *mut _spAnimationState; let mut i: c_int = 0; let mut n: c_int = 0; @@ -8016,9 +8872,9 @@ pub unsafe extern "C" fn spAnimationState_clearTrack( mut self_0: *mut spAnimationState, mut trackIndex: c_int, ) { - let mut current: *mut spTrackEntry = std::ptr::null_mut(); - let mut entry: *mut spTrackEntry = std::ptr::null_mut(); - let mut from: *mut spTrackEntry = std::ptr::null_mut(); + let mut current: *mut spTrackEntry = 0 as *mut spTrackEntry; + let mut entry: *mut spTrackEntry = 0 as *mut spTrackEntry; + let mut from: *mut spTrackEntry = 0 as *mut spTrackEntry; let mut internal: *mut _spAnimationState = self_0 as *mut _spAnimationState; if trackIndex >= (*self_0).tracksCount { return; @@ -8036,12 +8892,12 @@ pub unsafe extern "C" fn spAnimationState_clearTrack( break; } _spEventQueue_end((*internal).queue, from); - (*entry).mixingFrom = std::ptr::null_mut(); - (*entry).mixingTo = std::ptr::null_mut(); + (*entry).mixingFrom = 0 as *mut spTrackEntry; + (*entry).mixingTo = 0 as *mut spTrackEntry; entry = from; } - let ref mut fresh26 = *((*self_0).tracks).offset((*current).trackIndex as isize); - *fresh26 = std::ptr::null_mut(); + let ref mut fresh20 = *((*self_0).tracks).offset((*current).trackIndex as isize); + *fresh20 = 0 as *mut spTrackEntry; _spEventQueue_drain((*internal).queue); } #[no_mangle] @@ -8053,9 +8909,9 @@ pub unsafe extern "C" fn _spAnimationState_setCurrent( ) { let mut internal: *mut _spAnimationState = self_0 as *mut _spAnimationState; let mut from: *mut spTrackEntry = _spAnimationState_expandToIndex(self_0, index); - let ref mut fresh27 = *((*self_0).tracks).offset(index as isize); - *fresh27 = current; - (*current).previous = std::ptr::null_mut(); + let ref mut fresh21 = *((*self_0).tracks).offset(index as isize); + *fresh21 = current; + (*current).previous = 0 as *mut spTrackEntry; if !from.is_null() { if interrupt != 0 { _spEventQueue_interrupt((*internal).queue, from); @@ -8063,9 +8919,13 @@ pub unsafe extern "C" fn _spAnimationState_setCurrent( (*current).mixingFrom = from; (*from).mixingTo = current; (*current).mixTime = 0 as c_int as c_float; - if !((*from).mixingFrom).is_null() && (*from).mixDuration > 0 as c_int as c_float { - (*current).interruptAlpha *= - if (1 as c_int as c_float) < (*from).mixTime / (*from).mixDuration { + if !((*from).mixingFrom).is_null() + && (*from).mixDuration > 0 as c_int as c_float + { + (*current).interruptAlpha + *= if (1 as c_int as c_float) + < (*from).mixTime / (*from).mixDuration + { 1 as c_int as c_float } else { (*from).mixTime / (*from).mixDuration @@ -8082,8 +8942,10 @@ pub unsafe extern "C" fn spAnimationState_setAnimationByName( mut animationName: *const c_char, mut loop_0: c_int, ) -> *mut spTrackEntry { - let mut animation: *mut spAnimation = - spSkeletonData_findAnimation((*(*self_0).data).skeletonData, animationName); + let mut animation: *mut spAnimation = spSkeletonData_findAnimation( + (*(*self_0).data).skeletonData, + animationName, + ); return spAnimationState_setAnimation(self_0, trackIndex, animation, loop_0); } #[no_mangle] @@ -8093,14 +8955,17 @@ pub unsafe extern "C" fn spAnimationState_setAnimation( mut animation: *mut spAnimation, mut loop_0: c_int, ) -> *mut spTrackEntry { - let mut entry: *mut spTrackEntry = std::ptr::null_mut(); + let mut entry: *mut spTrackEntry = 0 as *mut spTrackEntry; let mut internal: *mut _spAnimationState = self_0 as *mut _spAnimationState; let mut interrupt: c_int = 1 as c_int; - let mut current: *mut spTrackEntry = _spAnimationState_expandToIndex(self_0, trackIndex); + let mut current: *mut spTrackEntry = _spAnimationState_expandToIndex( + self_0, + trackIndex, + ); if !current.is_null() { if (*current).nextTrackLast == -(1 as c_int) as c_float { - let ref mut fresh28 = *((*self_0).tracks).offset(trackIndex as isize); - *fresh28 = (*current).mixingFrom; + let ref mut fresh22 = *((*self_0).tracks).offset(trackIndex as isize); + *fresh22 = (*current).mixingFrom; _spEventQueue_interrupt((*internal).queue, current); _spEventQueue_end((*internal).queue, current); spAnimationState_clearNext(self_0, current); @@ -8123,8 +8988,10 @@ pub unsafe extern "C" fn spAnimationState_addAnimationByName( mut loop_0: c_int, mut delay: c_float, ) -> *mut spTrackEntry { - let mut animation: *mut spAnimation = - spSkeletonData_findAnimation((*(*self_0).data).skeletonData, animationName); + let mut animation: *mut spAnimation = spSkeletonData_findAnimation( + (*(*self_0).data).skeletonData, + animationName, + ); return spAnimationState_addAnimation(self_0, trackIndex, animation, loop_0, delay); } #[no_mangle] @@ -8135,9 +9002,12 @@ pub unsafe extern "C" fn spAnimationState_addAnimation( mut loop_0: c_int, mut delay: c_float, ) -> *mut spTrackEntry { - let mut entry: *mut spTrackEntry = std::ptr::null_mut(); + let mut entry: *mut spTrackEntry = 0 as *mut spTrackEntry; let mut internal: *mut _spAnimationState = self_0 as *mut _spAnimationState; - let mut last: *mut spTrackEntry = _spAnimationState_expandToIndex(self_0, trackIndex); + let mut last: *mut spTrackEntry = _spAnimationState_expandToIndex( + self_0, + trackIndex, + ); if !last.is_null() { while !((*last).next).is_null() { last = (*last).next; @@ -8163,8 +9033,12 @@ pub unsafe extern "C" fn spAnimationState_setEmptyAnimation( mut trackIndex: c_int, mut mixDuration: c_float, ) -> *mut spTrackEntry { - let mut entry: *mut spTrackEntry = - spAnimationState_setAnimation(self_0, trackIndex, SP_EMPTY_ANIMATION, 0 as c_int); + let mut entry: *mut spTrackEntry = spAnimationState_setAnimation( + self_0, + trackIndex, + SP_EMPTY_ANIMATION, + 0 as c_int, + ); (*entry).mixDuration = mixDuration; (*entry).trackEnd = mixDuration; return entry; @@ -8176,8 +9050,13 @@ pub unsafe extern "C" fn spAnimationState_addEmptyAnimation( mut mixDuration: c_float, mut delay: c_float, ) -> *mut spTrackEntry { - let mut entry: *mut spTrackEntry = - spAnimationState_addAnimation(self_0, trackIndex, SP_EMPTY_ANIMATION, 0 as c_int, delay); + let mut entry: *mut spTrackEntry = spAnimationState_addAnimation( + self_0, + trackIndex, + SP_EMPTY_ANIMATION, + 0 as c_int, + delay, + ); if delay <= 0 as c_int as c_float { (*entry).delay += (*entry).mixDuration - mixDuration; } @@ -8193,7 +9072,7 @@ pub unsafe extern "C" fn spAnimationState_setEmptyAnimations( let mut i: c_int = 0; let mut n: c_int = 0; let mut oldDrainDisabled: c_int = 0; - let mut current: *mut spTrackEntry = std::ptr::null_mut(); + let mut current: *mut spTrackEntry = 0 as *mut spTrackEntry; let mut internal: *mut _spAnimationState = self_0 as *mut _spAnimationState; oldDrainDisabled = (*(*internal).queue).drainDisabled; (*(*internal).queue).drainDisabled = 1 as c_int; @@ -8202,7 +9081,11 @@ pub unsafe extern "C" fn spAnimationState_setEmptyAnimations( while i < n { current = *((*self_0).tracks).offset(i as isize); if !current.is_null() { - spAnimationState_setEmptyAnimation(self_0, (*current).trackIndex, mixDuration); + spAnimationState_setEmptyAnimation( + self_0, + (*current).trackIndex, + mixDuration, + ); } i += 1; } @@ -8214,7 +9097,7 @@ pub unsafe extern "C" fn _spAnimationState_expandToIndex( mut self_0: *mut spAnimationState, mut index: c_int, ) -> *mut spTrackEntry { - let mut newTracks: *mut *mut spTrackEntry = std::ptr::null_mut(); + let mut newTracks: *mut *mut spTrackEntry = 0 as *mut *mut spTrackEntry; if index < (*self_0).tracksCount { return *((*self_0).tracks).offset(index as isize); } @@ -8222,7 +9105,7 @@ pub unsafe extern "C" fn _spAnimationState_expandToIndex( (index + 1 as c_int) as size_t, ::core::mem::size_of::<*mut spTrackEntry>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 3632 as c_int, + 3762 as c_int, ) as *mut *mut spTrackEntry; spine_memcpy( newTracks as *mut c_void, @@ -8233,7 +9116,7 @@ pub unsafe extern "C" fn _spAnimationState_expandToIndex( _spFree((*self_0).tracks as *mut c_void); (*self_0).tracks = newTracks; (*self_0).tracksCount = index + 1 as c_int; - return std::ptr::null_mut(); + return 0 as *mut spTrackEntry; } #[no_mangle] pub unsafe extern "C" fn _spAnimationState_trackEntry( @@ -8247,7 +9130,7 @@ pub unsafe extern "C" fn _spAnimationState_trackEntry( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 3643 as c_int, + 3773 as c_int, ) as *mut spTrackEntry; (*entry).trackIndex = trackIndex; (*entry).animation = animation; @@ -8255,11 +9138,12 @@ pub unsafe extern "C" fn _spAnimationState_trackEntry( (*entry).holdPrevious = 0 as c_int; (*entry).reverse = 0 as c_int; (*entry).shortestRotation = 0 as c_int; - (*entry).previous = std::ptr::null_mut(); - (*entry).next = std::ptr::null_mut(); + (*entry).previous = 0 as *mut spTrackEntry; + (*entry).next = 0 as *mut spTrackEntry; (*entry).eventThreshold = 0 as c_int as c_float; - (*entry).attachmentThreshold = 0 as c_int as c_float; - (*entry).drawOrderThreshold = 0 as c_int as c_float; + (*entry).mixAttachmentThreshold = 0 as c_int as c_float; + (*entry).alphaAttachmentThreshold = 0 as c_int as c_float; + (*entry).mixDrawOrderThreshold = 0 as c_int as c_float; (*entry).animationStart = 0 as c_int as c_float; (*entry).animationEnd = (*animation).duration; (*entry).animationLast = -(1 as c_int) as c_float; @@ -8272,7 +9156,8 @@ pub unsafe extern "C" fn _spAnimationState_trackEntry( (*entry).timeScale = 1 as c_int as c_float; (*entry).alpha = 1 as c_int as c_float; (*entry).mixTime = 0 as c_int as c_float; - (*entry).mixDuration = if last.is_null() { + (*entry) + .mixDuration = if last.is_null() { 0 as c_int as c_float } else { spAnimationStateData_getMix((*self_0).data, (*last).animation, animation) @@ -8295,14 +9180,16 @@ pub unsafe extern "C" fn spAnimationState_clearNext( _spEventQueue_dispose((*internal).queue, next); next = (*next).next; } - (*entry).next = std::ptr::null_mut(); + (*entry).next = 0 as *mut spTrackEntry; } #[no_mangle] -pub unsafe extern "C" fn _spAnimationState_animationsChanged(mut self_0: *mut spAnimationState) { +pub unsafe extern "C" fn _spAnimationState_animationsChanged( + mut self_0: *mut spAnimationState, +) { let mut internal: *mut _spAnimationState = self_0 as *mut _spAnimationState; let mut i: c_int = 0; let mut n: c_int = 0; - let mut entry: *mut spTrackEntry = std::ptr::null_mut(); + let mut entry: *mut spTrackEntry = 0 as *mut spTrackEntry; (*internal).animationsChanged = 0 as c_int; (*internal).propertyIDsCount = 0 as c_int; i = 0 as c_int; @@ -8315,7 +9202,8 @@ pub unsafe extern "C" fn _spAnimationState_animationsChanged(mut self_0: *mut sp } loop { if ((*entry).mixingTo).is_null() - || (*entry).mixBlend as c_uint != SP_MIX_BLEND_ADD as c_int as c_uint + || (*entry).mixBlend as c_uint + != SP_MIX_BLEND_ADD as c_int as c_uint { _spTrackEntry_computeHold(entry, self_0); } @@ -8338,7 +9226,7 @@ pub unsafe extern "C" fn _spAnimationState_resizeTimelinesRotation( newSize as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 3716 as c_int, + 3847 as c_int, ) as *mut c_float; _spFree((*entry).timelinesRotation as *mut c_void); (*entry).timelinesRotation = newTimelinesRotation; @@ -8357,7 +9245,7 @@ pub unsafe extern "C" fn _spAnimationState_ensureCapacityPropertyIDs( (capacity << 1 as c_int) as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 3727 as c_int, + 3858 as c_int, ) as *mut spPropertyId; spine_memcpy( newPropertyIDs as *mut c_void, @@ -8386,7 +9274,10 @@ pub unsafe extern "C" fn _spAnimationState_addPropertyID( } i += 1; } - _spAnimationState_ensureCapacityPropertyIDs(self_0, (*internal).propertyIDsCount + 1 as c_int); + _spAnimationState_ensureCapacityPropertyIDs( + self_0, + (*internal).propertyIDsCount + 1 as c_int, + ); *((*internal).propertyIDs).offset((*internal).propertyIDsCount as isize) = id; (*internal).propertyIDsCount += 1; return 1 as c_int; @@ -8415,7 +9306,7 @@ pub unsafe extern "C" fn spAnimationState_getCurrent( mut trackIndex: c_int, ) -> *mut spTrackEntry { if trackIndex >= (*self_0).tracksCount { - return std::ptr::null_mut(); + return 0 as *mut spTrackEntry; } return *((*self_0).tracks).offset(trackIndex as isize); } @@ -8427,9 +9318,12 @@ pub unsafe extern "C" fn spAnimationState_clearListenerNotifications( _spEventQueue_clear((*internal).queue); } #[no_mangle] -pub unsafe extern "C" fn spTrackEntry_getAnimationTime(mut entry: *mut spTrackEntry) -> c_float { +pub unsafe extern "C" fn spTrackEntry_getAnimationTime( + mut entry: *mut spTrackEntry, +) -> c_float { if (*entry).loop_0 != 0 { - let mut duration: c_float = (*entry).animationEnd - (*entry).animationStart; + let mut duration: c_float = (*entry).animationEnd + - (*entry).animationStart; if duration == 0 as c_int as c_float { return (*entry).animationStart; } @@ -8442,11 +9336,23 @@ pub unsafe extern "C" fn spTrackEntry_getAnimationTime(mut entry: *mut spTrackEn }; } #[no_mangle] -pub unsafe extern "C" fn spTrackEntry_getTrackComplete(mut entry: *mut spTrackEntry) -> c_float { +pub unsafe extern "C" fn spTrackEntry_resetRotationDirections( + mut entry: *mut spTrackEntry, +) { + _spFree((*entry).timelinesRotation as *mut c_void); + (*entry).timelinesRotation = 0 as *mut c_float; + (*entry).timelinesRotationCount = 0 as c_int; +} +#[no_mangle] +pub unsafe extern "C" fn spTrackEntry_getTrackComplete( + mut entry: *mut spTrackEntry, +) -> c_float { let mut duration: c_float = (*entry).animationEnd - (*entry).animationStart; if duration != 0 as c_int as c_float { if (*entry).loop_0 != 0 { - return duration * (1 as c_int + ((*entry).trackTime / duration) as c_int) as c_float; + return duration + * (1 as c_int + ((*entry).trackTime / duration) as c_int) + as c_float; } if (*entry).trackTime < duration { return duration; @@ -8455,35 +9361,62 @@ pub unsafe extern "C" fn spTrackEntry_getTrackComplete(mut entry: *mut spTrackEn return (*entry).trackTime; } #[no_mangle] +pub unsafe extern "C" fn spTrackEntry_setMixDuration( + mut entry: *mut spTrackEntry, + mut mixDuration: c_float, + mut delay: c_float, +) { + (*entry).mixDuration = mixDuration; + if !((*entry).previous).is_null() && delay <= 0 as c_int as c_float { + delay += spTrackEntry_getTrackComplete(entry) - mixDuration; + } + (*entry).delay = delay; +} +#[no_mangle] +pub unsafe extern "C" fn spTrackEntry_wasApplied( + mut entry: *mut spTrackEntry, +) -> c_int { + return ((*entry).nextTrackLast != -(1 as c_int) as c_float) + as c_int; +} +#[no_mangle] pub unsafe extern "C" fn _spTrackEntry_computeHold( mut entry: *mut spTrackEntry, mut state: *mut spAnimationState, ) { - let mut to: *mut spTrackEntry = std::ptr::null_mut(); - let mut timelines: *mut *mut spTimeline = std::ptr::null_mut(); + let mut to: *mut spTrackEntry = 0 as *mut spTrackEntry; + let mut timelines: *mut *mut spTimeline = 0 as *mut *mut spTimeline; let mut timelinesCount: c_int = 0; - let mut timelineMode: *mut c_int = std::ptr::null_mut(); - let mut timelineHoldMix: *mut *mut spTrackEntry = std::ptr::null_mut(); - let mut next: *mut spTrackEntry = std::ptr::null_mut(); + let mut timelineMode: *mut c_int = 0 as *mut c_int; + let mut timelineHoldMix: *mut *mut spTrackEntry = 0 as *mut *mut spTrackEntry; + let mut next: *mut spTrackEntry = 0 as *mut spTrackEntry; let mut i: c_int = 0; to = (*entry).mixingTo; timelines = (*(*(*entry).animation).timelines).items; timelinesCount = (*(*(*entry).animation).timelines).size; timelineMode = (*spIntArray_setSize((*entry).timelineMode, timelinesCount)).items; spTrackEntryArray_clear((*entry).timelineHoldMix); - timelineHoldMix = (*spTrackEntryArray_setSize((*entry).timelineHoldMix, timelinesCount)).items; + timelineHoldMix = (*spTrackEntryArray_setSize( + (*entry).timelineHoldMix, + timelinesCount, + )) + .items; if !to.is_null() && (*to).holdPrevious != 0 { i = 0 as c_int; while i < timelinesCount { - let mut ids: *mut spPropertyId = - ((**timelines.offset(i as isize)).propertyIds).as_mut_ptr(); - let mut numIds: c_int = (**timelines.offset(i as isize)).propertyIdsCount; - *timelineMode.offset(i as isize) = - if _spAnimationState_addPropertyIDs(state, ids, numIds) != 0 { - 3 as c_int - } else { - 2 as c_int - }; + let mut ids: *mut spPropertyId = ((**timelines.offset(i as isize)) + .propertyIds) + .as_mut_ptr(); + let mut numIds: c_int = (**timelines.offset(i as isize)) + .propertyIdsCount; + *timelineMode + .offset( + i as isize, + ) = if _spAnimationState_addPropertyIDs(state, ids, numIds) != 0 { + 3 as c_int + } else { + 2 as c_int + }; i += 1; } return; @@ -8496,9 +9429,12 @@ pub unsafe extern "C" fn _spTrackEntry_computeHold( if _spAnimationState_addPropertyIDs(state, ids_0, numIds_0) == 0 { *timelineMode.offset(i as isize) = 0 as c_int; } else if to.is_null() - || (*timeline).type_0 as c_uint == SP_TIMELINE_ATTACHMENT as c_int as c_uint - || (*timeline).type_0 as c_uint == SP_TIMELINE_DRAWORDER as c_int as c_uint - || (*timeline).type_0 as c_uint == SP_TIMELINE_EVENT as c_int as c_uint + || (*timeline).type_0 as c_uint + == SP_TIMELINE_ATTACHMENT as c_int as c_uint + || (*timeline).type_0 as c_uint + == SP_TIMELINE_DRAWORDER as c_int as c_uint + || (*timeline).type_0 as c_uint + == SP_TIMELINE_EVENT as c_int as c_uint || spAnimation_hasTimeline((*to).animation, ids_0, numIds_0) == 0 { *timelineMode.offset(i as isize) = 1 as c_int; @@ -8512,8 +9448,8 @@ pub unsafe extern "C" fn _spTrackEntry_computeHold( break; } *timelineMode.offset(i as isize) = 4 as c_int; - let ref mut fresh29 = *timelineHoldMix.offset(i as isize); - *fresh29 = next; + let ref mut fresh23 = *timelineHoldMix.offset(i as isize); + *fresh23 = next; i += 1; continue 's_69; } @@ -8532,7 +9468,7 @@ pub unsafe extern "C" fn _ToEntry_create( 1 as c_int as size_t, ::core::mem::size_of::<_ToEntry>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 3882 as c_int, + 4029 as c_int, ) as *mut _ToEntry; (*self_0).animation = to; (*self_0).duration = duration; @@ -8543,12 +9479,14 @@ pub unsafe extern "C" fn _ToEntry_dispose(mut self_0: *mut _ToEntry) { _spFree(self_0 as *mut c_void); } #[no_mangle] -pub unsafe extern "C" fn _FromEntry_create(mut from: *mut spAnimation) -> *mut _FromEntry { +pub unsafe extern "C" fn _FromEntry_create( + mut from: *mut spAnimation, +) -> *mut _FromEntry { let mut self_0: *mut _FromEntry = _spCalloc( 1 as c_int as size_t, ::core::mem::size_of::<_FromEntry>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 3902 as c_int, + 4049 as c_int, ) as *mut _FromEntry; (*self_0).animation = from; return self_0; @@ -8565,17 +9503,18 @@ pub unsafe extern "C" fn spAnimationStateData_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 3914 as c_int, + 4061 as c_int, ) as *mut spAnimationStateData; - let ref mut fresh30 = *(&mut (*self_0).skeletonData as *mut *mut spSkeletonData); - *fresh30 = skeletonData; + (*self_0).skeletonData = skeletonData; return self_0; } #[no_mangle] -pub unsafe extern "C" fn spAnimationStateData_dispose(mut self_0: *mut spAnimationStateData) { - let mut toEntry: *mut _ToEntry = std::ptr::null_mut(); - let mut nextToEntry: *mut _ToEntry = std::ptr::null_mut(); - let mut nextFromEntry: *mut _FromEntry = std::ptr::null_mut(); +pub unsafe extern "C" fn spAnimationStateData_dispose( + mut self_0: *mut spAnimationStateData, +) { + let mut toEntry: *mut _ToEntry = 0 as *mut _ToEntry; + let mut nextToEntry: *mut _ToEntry = 0 as *mut _ToEntry; + let mut nextFromEntry: *mut _FromEntry = 0 as *mut _FromEntry; let mut fromEntry: *mut _FromEntry = (*self_0).entries as *mut _FromEntry; while !fromEntry.is_null() { toEntry = (*fromEntry).toEntries; @@ -8597,8 +9536,11 @@ pub unsafe extern "C" fn spAnimationStateData_setMixByName( mut toName: *const c_char, mut duration: c_float, ) { - let mut to: *mut spAnimation = std::ptr::null_mut(); - let mut from: *mut spAnimation = spSkeletonData_findAnimation((*self_0).skeletonData, fromName); + let mut to: *mut spAnimation = 0 as *mut spAnimation; + let mut from: *mut spAnimation = spSkeletonData_findAnimation( + (*self_0).skeletonData, + fromName, + ); if from.is_null() { return; } @@ -8615,7 +9557,7 @@ pub unsafe extern "C" fn spAnimationStateData_setMix( mut to: *mut spAnimation, mut duration: c_float, ) { - let mut toEntry: *mut _ToEntry = std::ptr::null_mut(); + let mut toEntry: *mut _ToEntry = 0 as *mut _ToEntry; let mut fromEntry: *mut _FromEntry = (*self_0).entries as *mut _FromEntry; while !fromEntry.is_null() { if (*fromEntry).animation == from { @@ -8635,8 +9577,7 @@ pub unsafe extern "C" fn spAnimationStateData_setMix( if fromEntry.is_null() { fromEntry = _FromEntry_create(from); (*fromEntry).next = (*self_0).entries as *mut _FromEntry; - let ref mut fresh31 = *(&mut (*self_0).entries as *mut *mut c_void as *mut *mut _FromEntry); - *fresh31 = fromEntry; + (*self_0).entries = fromEntry as *const c_void; } toEntry = _ToEntry_create(to, duration); (*toEntry).next = (*fromEntry).toEntries; @@ -8664,20 +9605,23 @@ pub unsafe extern "C" fn spAnimationStateData_getMix( return (*self_0).defaultMix; } #[no_mangle] -pub unsafe extern "C" fn spFloatArray_create(mut initialCapacity: c_int) -> *mut spFloatArray { +pub unsafe extern "C" fn spFloatArray_create( + mut initialCapacity: c_int, +) -> *mut spFloatArray { let mut array: *mut spFloatArray = _spCalloc( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4025 as c_int, + 4172 as c_int, ) as *mut spFloatArray; (*array).size = 0 as c_int; (*array).capacity = initialCapacity; - (*array).items = _spCalloc( + (*array) + .items = _spCalloc( initialCapacity as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4025 as c_int, + 4172 as c_int, ) as *mut c_float; return array; } @@ -8697,12 +9641,16 @@ pub unsafe extern "C" fn spFloatArray_setSize( ) -> *mut spFloatArray { (*self_0).size = newSize; if (*self_0).capacity < newSize { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -8719,28 +9667,37 @@ pub unsafe extern "C" fn spFloatArray_ensureCapacity( return; } (*self_0).capacity = newCapacity; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, - (::core::mem::size_of::() as c_ulong).wrapping_mul((*self_0).capacity as c_ulong), + (::core::mem::size_of::() as c_ulong) + .wrapping_mul((*self_0).capacity as c_ulong), ) as *mut c_float; } #[no_mangle] -pub unsafe extern "C" fn spFloatArray_add(mut self_0: *mut spFloatArray, mut value: c_float) { +pub unsafe extern "C" fn spFloatArray_add( + mut self_0: *mut spFloatArray, + mut value: c_float, +) { if (*self_0).size == (*self_0).capacity { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), ) as *mut c_float; } - let fresh32 = (*self_0).size; + let fresh24 = (*self_0).size; (*self_0).size = (*self_0).size + 1; - *((*self_0).items).offset(fresh32 as isize) = value; + *((*self_0).items).offset(fresh24 as isize) = value; } #[no_mangle] pub unsafe extern "C" fn spFloatArray_addAll( @@ -8768,13 +9725,15 @@ pub unsafe extern "C" fn spFloatArray_addAllValues( } } #[no_mangle] -pub unsafe extern "C" fn spFloatArray_removeAt(mut self_0: *mut spFloatArray, mut index: c_int) { +pub unsafe extern "C" fn spFloatArray_removeAt( + mut self_0: *mut spFloatArray, + mut index: c_int, +) { (*self_0).size -= 1; spine_memmove( ((*self_0).items).offset(index as isize) as *mut c_void, - ((*self_0).items) - .offset(index as isize) - .offset(1 as c_int as isize) as *const c_void, + ((*self_0).items).offset(index as isize).offset(1 as c_int as isize) + as *const c_void, (::core::mem::size_of::() as c_ulong) .wrapping_mul(((*self_0).size - index) as c_ulong), ); @@ -8798,30 +9757,37 @@ pub unsafe extern "C" fn spFloatArray_contains( return 0 as c_int; } #[no_mangle] -pub unsafe extern "C" fn spFloatArray_pop(mut self_0: *mut spFloatArray) -> c_float { +pub unsafe extern "C" fn spFloatArray_pop( + mut self_0: *mut spFloatArray, +) -> c_float { (*self_0).size -= 1; let mut item: c_float = *((*self_0).items).offset((*self_0).size as isize); return item; } #[no_mangle] -pub unsafe extern "C" fn spFloatArray_peek(mut self_0: *mut spFloatArray) -> c_float { +pub unsafe extern "C" fn spFloatArray_peek( + mut self_0: *mut spFloatArray, +) -> c_float { return *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize); } #[no_mangle] -pub unsafe extern "C" fn spIntArray_create(mut initialCapacity: c_int) -> *mut spIntArray { +pub unsafe extern "C" fn spIntArray_create( + mut initialCapacity: c_int, +) -> *mut spIntArray { let mut array: *mut spIntArray = _spCalloc( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4027 as c_int, + 4174 as c_int, ) as *mut spIntArray; (*array).size = 0 as c_int; (*array).capacity = initialCapacity; - (*array).items = _spCalloc( + (*array) + .items = _spCalloc( initialCapacity as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4027 as c_int, + 4174 as c_int, ) as *mut c_int; return array; } @@ -8841,12 +9807,16 @@ pub unsafe extern "C" fn spIntArray_setSize( ) -> *mut spIntArray { (*self_0).size = newSize; if (*self_0).capacity < newSize { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -8863,28 +9833,37 @@ pub unsafe extern "C" fn spIntArray_ensureCapacity( return; } (*self_0).capacity = newCapacity; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, - (::core::mem::size_of::() as c_ulong).wrapping_mul((*self_0).capacity as c_ulong), + (::core::mem::size_of::() as c_ulong) + .wrapping_mul((*self_0).capacity as c_ulong), ) as *mut c_int; } #[no_mangle] -pub unsafe extern "C" fn spIntArray_add(mut self_0: *mut spIntArray, mut value: c_int) { +pub unsafe extern "C" fn spIntArray_add( + mut self_0: *mut spIntArray, + mut value: c_int, +) { if (*self_0).size == (*self_0).capacity { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), ) as *mut c_int; } - let fresh33 = (*self_0).size; + let fresh25 = (*self_0).size; (*self_0).size = (*self_0).size + 1; - *((*self_0).items).offset(fresh33 as isize) = value; + *((*self_0).items).offset(fresh25 as isize) = value; } #[no_mangle] pub unsafe extern "C" fn spIntArray_addAll( @@ -8912,13 +9891,15 @@ pub unsafe extern "C" fn spIntArray_addAllValues( } } #[no_mangle] -pub unsafe extern "C" fn spIntArray_removeAt(mut self_0: *mut spIntArray, mut index: c_int) { +pub unsafe extern "C" fn spIntArray_removeAt( + mut self_0: *mut spIntArray, + mut index: c_int, +) { (*self_0).size -= 1; spine_memmove( ((*self_0).items).offset(index as isize) as *mut c_void, - ((*self_0).items) - .offset(index as isize) - .offset(1 as c_int as isize) as *const c_void, + ((*self_0).items).offset(index as isize).offset(1 as c_int as isize) + as *const c_void, (::core::mem::size_of::() as c_ulong) .wrapping_mul(((*self_0).size - index) as c_ulong), ); @@ -8952,20 +9933,23 @@ pub unsafe extern "C" fn spIntArray_peek(mut self_0: *mut spIntArray) -> c_int { return *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize); } #[no_mangle] -pub unsafe extern "C" fn spShortArray_create(mut initialCapacity: c_int) -> *mut spShortArray { +pub unsafe extern "C" fn spShortArray_create( + mut initialCapacity: c_int, +) -> *mut spShortArray { let mut array: *mut spShortArray = _spCalloc( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4029 as c_int, + 4176 as c_int, ) as *mut spShortArray; (*array).size = 0 as c_int; (*array).capacity = initialCapacity; - (*array).items = _spCalloc( + (*array) + .items = _spCalloc( initialCapacity as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4029 as c_int, + 4176 as c_int, ) as *mut c_short; return array; } @@ -8985,12 +9969,16 @@ pub unsafe extern "C" fn spShortArray_setSize( ) -> *mut spShortArray { (*self_0).size = newSize; if (*self_0).capacity < newSize { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -9007,28 +9995,37 @@ pub unsafe extern "C" fn spShortArray_ensureCapacity( return; } (*self_0).capacity = newCapacity; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, - (::core::mem::size_of::() as c_ulong).wrapping_mul((*self_0).capacity as c_ulong), + (::core::mem::size_of::() as c_ulong) + .wrapping_mul((*self_0).capacity as c_ulong), ) as *mut c_short; } #[no_mangle] -pub unsafe extern "C" fn spShortArray_add(mut self_0: *mut spShortArray, mut value: c_short) { +pub unsafe extern "C" fn spShortArray_add( + mut self_0: *mut spShortArray, + mut value: c_short, +) { if (*self_0).size == (*self_0).capacity { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), ) as *mut c_short; } - let fresh34 = (*self_0).size; + let fresh26 = (*self_0).size; (*self_0).size = (*self_0).size + 1; - *((*self_0).items).offset(fresh34 as isize) = value; + *((*self_0).items).offset(fresh26 as isize) = value; } #[no_mangle] pub unsafe extern "C" fn spShortArray_addAll( @@ -9056,13 +10053,15 @@ pub unsafe extern "C" fn spShortArray_addAllValues( } } #[no_mangle] -pub unsafe extern "C" fn spShortArray_removeAt(mut self_0: *mut spShortArray, mut index: c_int) { +pub unsafe extern "C" fn spShortArray_removeAt( + mut self_0: *mut spShortArray, + mut index: c_int, +) { (*self_0).size -= 1; spine_memmove( ((*self_0).items).offset(index as isize) as *mut c_void, - ((*self_0).items) - .offset(index as isize) - .offset(1 as c_int as isize) as *const c_void, + ((*self_0).items).offset(index as isize).offset(1 as c_int as isize) + as *const c_void, (::core::mem::size_of::() as c_ulong) .wrapping_mul(((*self_0).size - index) as c_ulong), ); @@ -9086,13 +10085,17 @@ pub unsafe extern "C" fn spShortArray_contains( return 0 as c_int; } #[no_mangle] -pub unsafe extern "C" fn spShortArray_pop(mut self_0: *mut spShortArray) -> c_short { +pub unsafe extern "C" fn spShortArray_pop( + mut self_0: *mut spShortArray, +) -> c_short { (*self_0).size -= 1; let mut item: c_short = *((*self_0).items).offset((*self_0).size as isize); return item; } #[no_mangle] -pub unsafe extern "C" fn spShortArray_peek(mut self_0: *mut spShortArray) -> c_short { +pub unsafe extern "C" fn spShortArray_peek( + mut self_0: *mut spShortArray, +) -> c_short { return *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize); } #[no_mangle] @@ -9103,25 +10106,30 @@ pub unsafe extern "C" fn spUnsignedShortArray_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4031 as c_int, + 4178 as c_int, ) as *mut spUnsignedShortArray; (*array).size = 0 as c_int; (*array).capacity = initialCapacity; - (*array).items = _spCalloc( + (*array) + .items = _spCalloc( initialCapacity as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4031 as c_int, + 4178 as c_int, ) as *mut c_ushort; return array; } #[no_mangle] -pub unsafe extern "C" fn spUnsignedShortArray_dispose(mut self_0: *mut spUnsignedShortArray) { +pub unsafe extern "C" fn spUnsignedShortArray_dispose( + mut self_0: *mut spUnsignedShortArray, +) { _spFree((*self_0).items as *mut c_void); _spFree(self_0 as *mut c_void); } #[no_mangle] -pub unsafe extern "C" fn spUnsignedShortArray_clear(mut self_0: *mut spUnsignedShortArray) { +pub unsafe extern "C" fn spUnsignedShortArray_clear( + mut self_0: *mut spUnsignedShortArray, +) { (*self_0).size = 0 as c_int; } #[no_mangle] @@ -9131,12 +10139,16 @@ pub unsafe extern "C" fn spUnsignedShortArray_setSize( ) -> *mut spUnsignedShortArray { (*self_0).size = newSize; if (*self_0).capacity < newSize { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -9153,9 +10165,11 @@ pub unsafe extern "C" fn spUnsignedShortArray_ensureCapacity( return; } (*self_0).capacity = newCapacity; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, - (::core::mem::size_of::() as c_ulong).wrapping_mul((*self_0).capacity as c_ulong), + (::core::mem::size_of::() as c_ulong) + .wrapping_mul((*self_0).capacity as c_ulong), ) as *mut c_ushort; } #[no_mangle] @@ -9164,20 +10178,24 @@ pub unsafe extern "C" fn spUnsignedShortArray_add( mut value: c_ushort, ) { if (*self_0).size == (*self_0).capacity { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), ) as *mut c_ushort; } - let fresh35 = (*self_0).size; + let fresh27 = (*self_0).size; (*self_0).size = (*self_0).size + 1; - *((*self_0).items).offset(fresh35 as isize) = value; + *((*self_0).items).offset(fresh27 as isize) = value; } #[no_mangle] pub unsafe extern "C" fn spUnsignedShortArray_addAll( @@ -9212,9 +10230,8 @@ pub unsafe extern "C" fn spUnsignedShortArray_removeAt( (*self_0).size -= 1; spine_memmove( ((*self_0).items).offset(index as isize) as *mut c_void, - ((*self_0).items) - .offset(index as isize) - .offset(1 as c_int as isize) as *const c_void, + ((*self_0).items).offset(index as isize).offset(1 as c_int as isize) + as *const c_void, (::core::mem::size_of::() as c_ulong) .wrapping_mul(((*self_0).size - index) as c_ulong), ); @@ -9259,15 +10276,16 @@ pub unsafe extern "C" fn spArrayFloatArray_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4033 as c_int, + 4180 as c_int, ) as *mut spArrayFloatArray; (*array).size = 0 as c_int; (*array).capacity = initialCapacity; - (*array).items = _spCalloc( + (*array) + .items = _spCalloc( initialCapacity as size_t, ::core::mem::size_of::<*mut spFloatArray>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4033 as c_int, + 4180 as c_int, ) as *mut *mut spFloatArray; return array; } @@ -9287,12 +10305,16 @@ pub unsafe extern "C" fn spArrayFloatArray_setSize( ) -> *mut spArrayFloatArray { (*self_0).size = newSize; if (*self_0).capacity < newSize { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spFloatArray>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -9309,7 +10331,8 @@ pub unsafe extern "C" fn spArrayFloatArray_ensureCapacity( return; } (*self_0).capacity = newCapacity; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spFloatArray>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -9321,21 +10344,25 @@ pub unsafe extern "C" fn spArrayFloatArray_add( mut value: *mut spFloatArray, ) { if (*self_0).size == (*self_0).capacity { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spFloatArray>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), ) as *mut *mut spFloatArray; } - let fresh36 = (*self_0).size; + let fresh28 = (*self_0).size; (*self_0).size = (*self_0).size + 1; - let ref mut fresh37 = *((*self_0).items).offset(fresh36 as isize); - *fresh37 = value; + let ref mut fresh29 = *((*self_0).items).offset(fresh28 as isize); + *fresh29 = value; } #[no_mangle] pub unsafe extern "C" fn spArrayFloatArray_addAll( @@ -9370,9 +10397,8 @@ pub unsafe extern "C" fn spArrayFloatArray_removeAt( (*self_0).size -= 1; spine_memmove( ((*self_0).items).offset(index as isize) as *mut c_void, - ((*self_0).items) - .offset(index as isize) - .offset(1 as c_int as isize) as *const c_void, + ((*self_0).items).offset(index as isize).offset(1 as c_int as isize) + as *const c_void, (::core::mem::size_of::<*mut spFloatArray>() as c_ulong) .wrapping_mul(((*self_0).size - index) as c_ulong), ); @@ -9417,15 +10443,16 @@ pub unsafe extern "C" fn spArrayShortArray_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4035 as c_int, + 4182 as c_int, ) as *mut spArrayShortArray; (*array).size = 0 as c_int; (*array).capacity = initialCapacity; - (*array).items = _spCalloc( + (*array) + .items = _spCalloc( initialCapacity as size_t, ::core::mem::size_of::<*mut spShortArray>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4035 as c_int, + 4182 as c_int, ) as *mut *mut spShortArray; return array; } @@ -9445,12 +10472,16 @@ pub unsafe extern "C" fn spArrayShortArray_setSize( ) -> *mut spArrayShortArray { (*self_0).size = newSize; if (*self_0).capacity < newSize { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spShortArray>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -9467,7 +10498,8 @@ pub unsafe extern "C" fn spArrayShortArray_ensureCapacity( return; } (*self_0).capacity = newCapacity; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spShortArray>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -9479,21 +10511,25 @@ pub unsafe extern "C" fn spArrayShortArray_add( mut value: *mut spShortArray, ) { if (*self_0).size == (*self_0).capacity { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spShortArray>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), ) as *mut *mut spShortArray; } - let fresh38 = (*self_0).size; + let fresh30 = (*self_0).size; (*self_0).size = (*self_0).size + 1; - let ref mut fresh39 = *((*self_0).items).offset(fresh38 as isize); - *fresh39 = value; + let ref mut fresh31 = *((*self_0).items).offset(fresh30 as isize); + *fresh31 = value; } #[no_mangle] pub unsafe extern "C" fn spArrayShortArray_addAll( @@ -9528,9 +10564,8 @@ pub unsafe extern "C" fn spArrayShortArray_removeAt( (*self_0).size -= 1; spine_memmove( ((*self_0).items).offset(index as isize) as *mut c_void, - ((*self_0).items) - .offset(index as isize) - .offset(1 as c_int as isize) as *const c_void, + ((*self_0).items).offset(index as isize).offset(1 as c_int as isize) + as *const c_void, (::core::mem::size_of::<*mut spShortArray>() as c_ulong) .wrapping_mul(((*self_0).size - index) as c_ulong), ); @@ -9579,7 +10614,8 @@ pub unsafe extern "C" fn spKeyValueArray_create( ) as *mut spKeyValueArray; (*array).size = 0 as c_int; (*array).capacity = initialCapacity; - (*array).items = _spCalloc( + (*array) + .items = _spCalloc( initialCapacity as size_t, ::core::mem::size_of::() as c_ulong, b"_file_name_\0" as *const u8 as *const c_char, @@ -9603,12 +10639,16 @@ pub unsafe extern "C" fn spKeyValueArray_setSize( ) -> *mut spKeyValueArray { (*self_0).size = newSize; if (*self_0).capacity < newSize { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -9625,7 +10665,8 @@ pub unsafe extern "C" fn spKeyValueArray_ensureCapacity( return; } (*self_0).capacity = newCapacity; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -9637,20 +10678,24 @@ pub unsafe extern "C" fn spKeyValueArray_add( mut value: spKeyValue, ) { if (*self_0).size == (*self_0).capacity { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), ) as *mut spKeyValue; } - let fresh40 = (*self_0).size; + let fresh32 = (*self_0).size; (*self_0).size = (*self_0).size + 1; - *((*self_0).items).offset(fresh40 as isize) = value; + *((*self_0).items).offset(fresh32 as isize) = value; } #[no_mangle] pub unsafe extern "C" fn spKeyValueArray_addAll( @@ -9696,13 +10741,17 @@ pub unsafe extern "C" fn spKeyValueArray_contains( return 0 as c_int; } #[no_mangle] -pub unsafe extern "C" fn spKeyValueArray_pop(mut self_0: *mut spKeyValueArray) -> spKeyValue { +pub unsafe extern "C" fn spKeyValueArray_pop( + mut self_0: *mut spKeyValueArray, +) -> spKeyValue { (*self_0).size -= 1; let mut item: spKeyValue = *((*self_0).items).offset((*self_0).size as isize); return item; } #[no_mangle] -pub unsafe extern "C" fn spKeyValueArray_peek(mut self_0: *mut spKeyValueArray) -> spKeyValue { +pub unsafe extern "C" fn spKeyValueArray_peek( + mut self_0: *mut spKeyValueArray, +) -> spKeyValue { return *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize); } #[no_mangle] @@ -9714,18 +10763,19 @@ pub unsafe extern "C" fn spAtlasPage_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4134 as c_int, + 4281 as c_int, ) as *mut spAtlasPage; - let ref mut fresh41 = *(&mut (*self_0).atlas as *mut *mut spAtlas); - *fresh41 = atlas; - let ref mut fresh42 = *(&mut (*self_0).name as *mut *mut c_char); - *fresh42 = _spMalloc( + (*self_0).atlas = atlas; + (*self_0) + .name = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen(name)).wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 4136 as c_int, + 4283 as c_int, ) as *mut c_char; - spine_strcpy(*fresh42, name); + spine_strcpy((*self_0).name, name); (*self_0).minFilter = SP_ATLAS_NEAREST; (*self_0).magFilter = SP_ATLAS_NEAREST; (*self_0).format = SP_ATLAS_RGBA8888; @@ -9745,7 +10795,7 @@ pub unsafe extern "C" fn spAtlasRegion_create() -> *mut spAtlasRegion { 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4154 as c_int, + 4301 as c_int, ) as *mut spAtlasRegion; (*region).keyValues = spKeyValueArray_create(2 as c_int); return region; @@ -9760,29 +10810,43 @@ pub unsafe extern "C" fn spAtlasRegion_dispose(mut self_0: *mut spAtlasRegion) { i = 0 as c_int; n = (*(*self_0).keyValues).size; while i < n { - _spFree((*((*(*self_0).keyValues).items).offset(i as isize)).name as *mut c_void); + _spFree( + (*((*(*self_0).keyValues).items).offset(i as isize)).name + as *mut c_void, + ); i += 1; } spKeyValueArray_dispose((*self_0).keyValues); _spFree(self_0 as *mut c_void); } unsafe extern "C" fn ss_trim(mut self_0: *mut SimpleString) -> *mut SimpleString { - while isspace_(*(*self_0).start as c_uchar as c_int) != 0 && (*self_0).start < (*self_0).end { + while isspace_(*(*self_0).start as c_uchar as c_int) != 0 + && (*self_0).start < (*self_0).end + { (*self_0).start = ((*self_0).start).offset(1); } if (*self_0).start == (*self_0).end { - (*self_0).length = ((*self_0).end).offset_from((*self_0).start) as c_long as c_int; + (*self_0) + .length = ((*self_0).end).offset_from((*self_0).start) as c_long + as c_int; return self_0; } (*self_0).end = ((*self_0).end).offset(-1); - while *(*self_0).end as c_uchar as c_int == '\r' as i32 && (*self_0).end >= (*self_0).start { + while *(*self_0).end as c_uchar as c_int == '\r' as i32 + && (*self_0).end >= (*self_0).start + { (*self_0).end = ((*self_0).end).offset(-1); } (*self_0).end = ((*self_0).end).offset(1); - (*self_0).length = ((*self_0).end).offset_from((*self_0).start) as c_long as c_int; + (*self_0) + .length = ((*self_0).end).offset_from((*self_0).start) as c_long + as c_int; return self_0; } -unsafe extern "C" fn ss_indexOf(mut self_0: *mut SimpleString, mut needle: c_char) -> c_int { +unsafe extern "C" fn ss_indexOf( + mut self_0: *mut SimpleString, + mut needle: c_char, +) -> c_int { let mut c: *mut c_char = (*self_0).start; while c < (*self_0).end { if *c as c_int == needle as c_int { @@ -9812,8 +10876,8 @@ unsafe extern "C" fn ss_substr( mut e: c_int, ) -> SimpleString { let mut result: SimpleString = SimpleString { - start: std::ptr::null_mut(), - end: std::ptr::null_mut(), + start: 0 as *mut c_char, + end: 0 as *mut c_char, length: 0, }; e = s + e; @@ -9822,18 +10886,25 @@ unsafe extern "C" fn ss_substr( result.length = e - s; return result; } -unsafe extern "C" fn ss_substr2(mut self_0: *mut SimpleString, mut s: c_int) -> SimpleString { +unsafe extern "C" fn ss_substr2( + mut self_0: *mut SimpleString, + mut s: c_int, +) -> SimpleString { let mut result: SimpleString = SimpleString { - start: std::ptr::null_mut(), - end: std::ptr::null_mut(), + start: 0 as *mut c_char, + end: 0 as *mut c_char, length: 0, }; result.start = ((*self_0).start).offset(s as isize); result.end = (*self_0).end; - result.length = (result.end).offset_from(result.start) as c_long as c_int; + result + .length = (result.end).offset_from(result.start) as c_long as c_int; return result; } -unsafe extern "C" fn ss_equals(mut self_0: *mut SimpleString, mut str: *const c_char) -> c_int { +unsafe extern "C" fn ss_equals( + mut self_0: *mut SimpleString, + mut str: *const c_char, +) -> c_int { let mut i: c_int = 0; let mut otherLen: c_int = spine_strlen(str) as c_int; if (*self_0).length != otherLen { @@ -9841,7 +10912,9 @@ unsafe extern "C" fn ss_equals(mut self_0: *mut SimpleString, mut str: *const c_ } i = 0 as c_int; while i < (*self_0).length { - if *((*self_0).start).offset(i as isize) as c_int != *str.offset(i as isize) as c_int { + if *((*self_0).start).offset(i as isize) as c_int + != *str.offset(i as isize) as c_int + { return 0 as c_int; } i += 1; @@ -9853,7 +10926,7 @@ unsafe extern "C" fn ss_copy(mut self_0: *mut SimpleString) -> *mut c_char { ((*self_0).length + 1 as c_int) as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4240 as c_int, + 4387 as c_int, ) as *mut c_char; spine_memcpy( string as *mut c_void, @@ -9864,14 +10937,16 @@ unsafe extern "C" fn ss_copy(mut self_0: *mut SimpleString) -> *mut c_char { return string; } unsafe extern "C" fn ss_toInt(mut self_0: *mut SimpleString) -> c_int { - return spine_strtol((*self_0).start, &mut (*self_0).end, 10 as c_int) as c_int; + return spine_strtol((*self_0).start, &mut (*self_0).end, 10 as c_int) + as c_int; } unsafe extern "C" fn ai_readLine(mut self_0: *mut AtlasInput) -> *mut SimpleString { if (*self_0).index >= (*self_0).end as *mut c_char { - return std::ptr::null_mut(); + return 0 as *mut SimpleString; } (*self_0).line.start = (*self_0).index; - while (*self_0).index < (*self_0).end as *mut c_char && *(*self_0).index as c_int != '\n' as i32 + while (*self_0).index < (*self_0).end as *mut c_char + && *(*self_0).index as c_int != '\n' as i32 { (*self_0).index = ((*self_0).index).offset(1); } @@ -9880,8 +10955,10 @@ unsafe extern "C" fn ai_readLine(mut self_0: *mut AtlasInput) -> *mut SimpleStri (*self_0).index = ((*self_0).index).offset(1); } (*self_0).line = *ss_trim(&mut (*self_0).line); - (*self_0).line.length = - ((*self_0).line.end).offset_from((*self_0).line.start) as c_long as c_int; + (*self_0) + .line + .length = ((*self_0).line.end).offset_from((*self_0).line.start) as c_long + as c_int; return &mut (*self_0).line; } unsafe extern "C" fn ai_readEntry( @@ -9892,8 +10969,8 @@ unsafe extern "C" fn ai_readEntry( let mut i: c_int = 0; let mut lastMatch: c_int = 0; let mut substr: SimpleString = SimpleString { - start: std::ptr::null_mut(), - end: std::ptr::null_mut(), + start: 0 as *mut c_char, + end: 0 as *mut c_char, length: 0, }; if line.is_null() { @@ -9912,7 +10989,11 @@ unsafe extern "C" fn ai_readEntry( i = 1 as c_int; lastMatch = colon + 1 as c_int; loop { - let mut comma: c_int = ss_indexOf2(line, ',' as i32 as c_char, lastMatch); + let mut comma: c_int = ss_indexOf2( + line, + ',' as i32 as c_char, + lastMatch, + ); if comma == -(1 as c_int) { substr = ss_substr2(line, lastMatch); *entry.offset(i as isize) = *ss_trim(&mut substr); @@ -9925,7 +11006,7 @@ unsafe extern "C" fn ai_readEntry( return 4 as c_int; } i += 1; - } + }; } static mut formatNames: [*const c_char; 8] = [ b"\0" as *const u8 as *const c_char, @@ -9970,38 +11051,39 @@ pub unsafe extern "C" fn spAtlas_create( mut dir: *const c_char, mut rendererObject: *mut c_void, ) -> *mut spAtlas { - let mut self_0: *mut spAtlas = std::ptr::null_mut(); + let mut self_0: *mut spAtlas = 0 as *mut spAtlas; let mut reader: AtlasInput = AtlasInput { - start: std::ptr::null(), - end: std::ptr::null(), - index: std::ptr::null_mut(), + start: 0 as *const c_char, + end: 0 as *const c_char, + index: 0 as *mut c_char, length: 0, line: SimpleString { - start: std::ptr::null_mut(), - end: std::ptr::null_mut(), + start: 0 as *mut c_char, + end: 0 as *mut c_char, length: 0, }, }; - let mut line: *mut SimpleString = std::ptr::null_mut(); + let mut line: *mut SimpleString = 0 as *mut SimpleString; let mut entry: [SimpleString; 5] = [SimpleString { - start: std::ptr::null_mut(), - end: std::ptr::null_mut(), + start: 0 as *mut c_char, + end: 0 as *mut c_char, length: 0, }; 5]; - let mut page: *mut spAtlasPage = std::ptr::null_mut(); - let mut lastPage: *mut spAtlasPage = std::ptr::null_mut(); - let mut lastRegion: *mut spAtlasRegion = std::ptr::null_mut(); + let mut page: *mut spAtlasPage = 0 as *mut spAtlasPage; + let mut lastPage: *mut spAtlasPage = 0 as *mut spAtlasPage; + let mut lastRegion: *mut spAtlasRegion = 0 as *mut spAtlasRegion; let mut count: c_int = 0; let mut dirLength: c_int = spine_strlen(dir) as c_int; let mut needsSlash: c_int = (dirLength > 0 as c_int - && *dir.offset((dirLength - 1 as c_int) as isize) as c_int != '/' as i32 - && *dir.offset((dirLength - 1 as c_int) as isize) as c_int != '\\' as i32) - as c_int; + && *dir.offset((dirLength - 1 as c_int) as isize) as c_int + != '/' as i32 + && *dir.offset((dirLength - 1 as c_int) as isize) as c_int + != '\\' as i32) as c_int; self_0 = _spCalloc( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4321 as c_int, + 4468 as c_int, ) as *mut spAtlas; (*self_0).rendererObject = rendererObject; reader.start = begin; @@ -10026,7 +11108,7 @@ pub unsafe extern "C" fn spAtlas_create( break; } if (*ss_trim(line)).length == 0 as c_int { - page = std::ptr::null_mut(); + page = 0 as *mut spAtlasPage; line = ai_readLine(&mut reader); } else if page.is_null() { let mut name: *mut c_char = ss_copy(line); @@ -10036,7 +11118,7 @@ pub unsafe extern "C" fn spAtlas_create( .wrapping_add(1 as c_int as c_ulong), ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4346 as c_int, + 4493 as c_int, ) as *mut c_char; spine_memcpy( path as *mut c_void, @@ -10068,14 +11150,21 @@ pub unsafe extern "C" fn spAtlas_create( b"size\0" as *const u8 as *const c_char, ) != 0 { - (*page).width = ss_toInt(&mut *entry.as_mut_ptr().offset(1 as c_int as isize)); - (*page).height = ss_toInt(&mut *entry.as_mut_ptr().offset(2 as c_int as isize)); + (*page) + .width = ss_toInt( + &mut *entry.as_mut_ptr().offset(1 as c_int as isize), + ); + (*page) + .height = ss_toInt( + &mut *entry.as_mut_ptr().offset(2 as c_int as isize), + ); } else if ss_equals( &mut *entry.as_mut_ptr().offset(0 as c_int as isize), b"format\0" as *const u8 as *const c_char, ) != 0 { - (*page).format = indexOf( + (*page) + .format = indexOf( formatNames.as_mut_ptr(), 8 as c_int, &mut *entry.as_mut_ptr().offset(1 as c_int as isize), @@ -10085,12 +11174,14 @@ pub unsafe extern "C" fn spAtlas_create( b"filter\0" as *const u8 as *const c_char, ) != 0 { - (*page).minFilter = indexOf( + (*page) + .minFilter = indexOf( textureFilterNames.as_mut_ptr(), 8 as c_int, &mut *entry.as_mut_ptr().offset(1 as c_int as isize), ) as spAtlasFilter; - (*page).magFilter = indexOf( + (*page) + .magFilter = indexOf( textureFilterNames.as_mut_ptr(), 8 as c_int, &mut *entry.as_mut_ptr().offset(2 as c_int as isize), @@ -10121,7 +11212,8 @@ pub unsafe extern "C" fn spAtlas_create( b"pma\0" as *const u8 as *const c_char, ) != 0 { - (*page).pma = ss_equals( + (*page) + .pma = ss_equals( &mut *entry.as_mut_ptr().offset(1 as c_int as isize), b"true\0" as *const u8 as *const c_char, ); @@ -10150,59 +11242,107 @@ pub unsafe extern "C" fn spAtlas_create( b"xy\0" as *const u8 as *const c_char, ) != 0 { - (*region).x = ss_toInt(&mut *entry.as_mut_ptr().offset(1 as c_int as isize)); - (*region).y = ss_toInt(&mut *entry.as_mut_ptr().offset(2 as c_int as isize)); + (*region) + .x = ss_toInt( + &mut *entry.as_mut_ptr().offset(1 as c_int as isize), + ); + (*region) + .y = ss_toInt( + &mut *entry.as_mut_ptr().offset(2 as c_int as isize), + ); } else if ss_equals( &mut *entry.as_mut_ptr().offset(0 as c_int as isize), b"size\0" as *const u8 as *const c_char, ) != 0 { - (*region).super_0.width = - ss_toInt(&mut *entry.as_mut_ptr().offset(1 as c_int as isize)); - (*region).super_0.height = - ss_toInt(&mut *entry.as_mut_ptr().offset(2 as c_int as isize)); + (*region) + .super_0 + .width = ss_toInt( + &mut *entry.as_mut_ptr().offset(1 as c_int as isize), + ); + (*region) + .super_0 + .height = ss_toInt( + &mut *entry.as_mut_ptr().offset(2 as c_int as isize), + ); } else if ss_equals( &mut *entry.as_mut_ptr().offset(0 as c_int as isize), b"bounds\0" as *const u8 as *const c_char, ) != 0 { - (*region).x = ss_toInt(&mut *entry.as_mut_ptr().offset(1 as c_int as isize)); - (*region).y = ss_toInt(&mut *entry.as_mut_ptr().offset(2 as c_int as isize)); - (*region).super_0.width = - ss_toInt(&mut *entry.as_mut_ptr().offset(3 as c_int as isize)); - (*region).super_0.height = - ss_toInt(&mut *entry.as_mut_ptr().offset(4 as c_int as isize)); + (*region) + .x = ss_toInt( + &mut *entry.as_mut_ptr().offset(1 as c_int as isize), + ); + (*region) + .y = ss_toInt( + &mut *entry.as_mut_ptr().offset(2 as c_int as isize), + ); + (*region) + .super_0 + .width = ss_toInt( + &mut *entry.as_mut_ptr().offset(3 as c_int as isize), + ); + (*region) + .super_0 + .height = ss_toInt( + &mut *entry.as_mut_ptr().offset(4 as c_int as isize), + ); } else if ss_equals( &mut *entry.as_mut_ptr().offset(0 as c_int as isize), b"offset\0" as *const u8 as *const c_char, ) != 0 { - (*region).super_0.offsetX = - ss_toInt(&mut *entry.as_mut_ptr().offset(1 as c_int as isize)) as c_float; - (*region).super_0.offsetY = - ss_toInt(&mut *entry.as_mut_ptr().offset(2 as c_int as isize)) as c_float; + (*region) + .super_0 + .offsetX = ss_toInt( + &mut *entry.as_mut_ptr().offset(1 as c_int as isize), + ) as c_float; + (*region) + .super_0 + .offsetY = ss_toInt( + &mut *entry.as_mut_ptr().offset(2 as c_int as isize), + ) as c_float; } else if ss_equals( &mut *entry.as_mut_ptr().offset(0 as c_int as isize), b"orig\0" as *const u8 as *const c_char, ) != 0 { - (*region).super_0.originalWidth = - ss_toInt(&mut *entry.as_mut_ptr().offset(1 as c_int as isize)); - (*region).super_0.originalHeight = - ss_toInt(&mut *entry.as_mut_ptr().offset(2 as c_int as isize)); + (*region) + .super_0 + .originalWidth = ss_toInt( + &mut *entry.as_mut_ptr().offset(1 as c_int as isize), + ); + (*region) + .super_0 + .originalHeight = ss_toInt( + &mut *entry.as_mut_ptr().offset(2 as c_int as isize), + ); } else if ss_equals( &mut *entry.as_mut_ptr().offset(0 as c_int as isize), b"offsets\0" as *const u8 as *const c_char, ) != 0 { - (*region).super_0.offsetX = - ss_toInt(&mut *entry.as_mut_ptr().offset(1 as c_int as isize)) as c_float; - (*region).super_0.offsetY = - ss_toInt(&mut *entry.as_mut_ptr().offset(2 as c_int as isize)) as c_float; - (*region).super_0.originalWidth = - ss_toInt(&mut *entry.as_mut_ptr().offset(3 as c_int as isize)); - (*region).super_0.originalHeight = - ss_toInt(&mut *entry.as_mut_ptr().offset(4 as c_int as isize)); + (*region) + .super_0 + .offsetX = ss_toInt( + &mut *entry.as_mut_ptr().offset(1 as c_int as isize), + ) as c_float; + (*region) + .super_0 + .offsetY = ss_toInt( + &mut *entry.as_mut_ptr().offset(2 as c_int as isize), + ) as c_float; + (*region) + .super_0 + .originalWidth = ss_toInt( + &mut *entry.as_mut_ptr().offset(3 as c_int as isize), + ); + (*region) + .super_0 + .originalHeight = ss_toInt( + &mut *entry.as_mut_ptr().offset(4 as c_int as isize), + ); } else if ss_equals( &mut *entry.as_mut_ptr().offset(0 as c_int as isize), b"rotate\0" as *const u8 as *const c_char, @@ -10219,28 +11359,40 @@ pub unsafe extern "C" fn spAtlas_create( b"false\0" as *const u8 as *const c_char, ) == 0 { - (*region).super_0.degrees = - ss_toInt(&mut *entry.as_mut_ptr().offset(1 as c_int as isize)); + (*region) + .super_0 + .degrees = ss_toInt( + &mut *entry.as_mut_ptr().offset(1 as c_int as isize), + ); } } else if ss_equals( &mut *entry.as_mut_ptr().offset(0 as c_int as isize), b"index\0" as *const u8 as *const c_char, ) != 0 { - (*region).index = - ss_toInt(&mut *entry.as_mut_ptr().offset(1 as c_int as isize)); + (*region) + .index = ss_toInt( + &mut *entry.as_mut_ptr().offset(1 as c_int as isize), + ); } else { let mut i: c_int = 0 as c_int; let mut keyValue: spKeyValue = spKeyValue { - name: std::ptr::null_mut(), + name: 0 as *mut c_char, values: [0.; 5], }; - keyValue.name = ss_copy(&mut *entry.as_mut_ptr().offset(0 as c_int as isize)); + keyValue + .name = ss_copy( + &mut *entry.as_mut_ptr().offset(0 as c_int as isize), + ); i = 0 as c_int; while i < count { - keyValue.values[i as usize] = - ss_toInt(&mut *entry.as_mut_ptr().offset((i + 1 as c_int) as isize)) - as c_float; + keyValue + .values[i + as usize] = ss_toInt( + &mut *entry + .as_mut_ptr() + .offset((i + 1 as c_int) as isize), + ) as c_float; i += 1; } spKeyValueArray_add((*region).keyValues, keyValue); @@ -10252,18 +11404,30 @@ pub unsafe extern "C" fn spAtlas_create( (*region).super_0.originalWidth = (*region).super_0.width; (*region).super_0.originalHeight = (*region).super_0.height; } - (*region).super_0.u = (*region).x as c_float / (*page).width as c_float; - (*region).super_0.v = (*region).y as c_float / (*page).height as c_float; + (*region) + .super_0 + .u = (*region).x as c_float / (*page).width as c_float; + (*region) + .super_0 + .v = (*region).y as c_float / (*page).height as c_float; if (*region).super_0.degrees == 90 as c_int { - (*region).super_0.u2 = - ((*region).x + (*region).super_0.height) as c_float / (*page).width as c_float; - (*region).super_0.v2 = - ((*region).y + (*region).super_0.width) as c_float / (*page).height as c_float; + (*region) + .super_0 + .u2 = ((*region).x + (*region).super_0.height) as c_float + / (*page).width as c_float; + (*region) + .super_0 + .v2 = ((*region).y + (*region).super_0.width) as c_float + / (*page).height as c_float; } else { - (*region).super_0.u2 = - ((*region).x + (*region).super_0.width) as c_float / (*page).width as c_float; - (*region).super_0.v2 = - ((*region).y + (*region).super_0.height) as c_float / (*page).height as c_float; + (*region) + .super_0 + .u2 = ((*region).x + (*region).super_0.width) as c_float + / (*page).width as c_float; + (*region) + .super_0 + .v2 = ((*region).y + (*region).super_0.height) as c_float + / (*page).height as c_float; } } } @@ -10275,10 +11439,10 @@ pub unsafe extern "C" fn spAtlas_createFromFile( mut rendererObject: *mut c_void, ) -> *mut spAtlas { let mut dirLength: c_int = 0; - let mut dir: *mut c_char = std::ptr::null_mut(); + let mut dir: *mut c_char = 0 as *mut c_char; let mut length: c_int = 0; - let mut data: *const c_char = std::ptr::null(); - let mut atlas: *mut spAtlas = std::ptr::null_mut(); + let mut data: *const c_char = 0 as *const c_char; + let mut atlas: *mut spAtlas = 0 as *mut spAtlas; let mut lastForwardSlash: *const c_char = spine_strrchr(path, '/' as i32); let mut lastBackwardSlash: *const c_char = spine_strrchr(path, '\\' as i32); let mut lastSlash: *const c_char = if lastForwardSlash > lastBackwardSlash { @@ -10298,7 +11462,7 @@ pub unsafe extern "C" fn spAtlas_createFromFile( (::core::mem::size_of::() as c_ulong) .wrapping_mul((dirLength + 1 as c_int) as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 4469 as c_int, + 4616 as c_int, ) as *mut c_char; spine_memcpy( dir as *mut c_void, @@ -10316,8 +11480,8 @@ pub unsafe extern "C" fn spAtlas_createFromFile( } #[no_mangle] pub unsafe extern "C" fn spAtlas_dispose(mut self_0: *mut spAtlas) { - let mut region: *mut spAtlasRegion = std::ptr::null_mut(); - let mut nextRegion: *mut spAtlasRegion = std::ptr::null_mut(); + let mut region: *mut spAtlasRegion = 0 as *mut spAtlasRegion; + let mut nextRegion: *mut spAtlasRegion = 0 as *mut spAtlasRegion; let mut page: *mut spAtlasPage = (*self_0).pages; while !page.is_null() { let mut nextPage: *mut spAtlasPage = (*page).next; @@ -10344,7 +11508,7 @@ pub unsafe extern "C" fn spAtlas_findRegion( } region = (*region).next; } - return std::ptr::null_mut(); + return 0 as *mut spAtlasRegion; } unsafe extern "C" fn loadSequence( mut atlas: *mut spAtlas, @@ -10358,24 +11522,25 @@ unsafe extern "C" fn loadSequence( .wrapping_add(2 as c_int as c_ulong), ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4543 as c_int, + 4690 as c_int, ) as *mut c_char; let mut i: c_int = 0; i = 0 as c_int; while i < (*regions).size { spSequence_getPath(sequence, basePath, i, path); - let ref mut fresh43 = *((*regions).items).offset(i as isize); - *fresh43 = &mut (*(spAtlas_findRegion - as unsafe extern "C" fn(*const spAtlas, *const c_char) -> *mut spAtlasRegion)( - atlas, path, - )) - .super_0; + let ref mut fresh33 = *((*regions).items).offset(i as isize); + *fresh33 = &mut (*(spAtlas_findRegion + as unsafe extern "C" fn( + *const spAtlas, + *const c_char, + ) -> *mut spAtlasRegion)(atlas, path)) + .super_0; if (*((*regions).items).offset(i as isize)).is_null() { _spFree(path as *mut c_void); return 0 as c_int; } - let ref mut fresh44 = (**((*regions).items).offset(i as isize)).rendererObject; - *fresh44 = *((*regions).items).offset(i as isize) as *mut c_void; + let ref mut fresh34 = (**((*regions).items).offset(i as isize)).rendererObject; + *fresh34 = *((*regions).items).offset(i as isize) as *mut c_void; i += 1; } _spFree(path as *mut c_void); @@ -10384,16 +11549,19 @@ unsafe extern "C" fn loadSequence( #[no_mangle] pub unsafe extern "C" fn _spAtlasAttachmentLoader_createAttachment( mut loader: *mut spAttachmentLoader, - mut _skin: *mut spSkin, + mut skin: *mut spSkin, mut type_0: spAttachmentType, mut name: *const c_char, mut path: *const c_char, mut sequence: *mut spSequence, ) -> *mut spAttachment { - let mut self_0: *mut spAtlasAttachmentLoader = loader as *mut spAtlasAttachmentLoader; + let mut self_0: *mut spAtlasAttachmentLoader = loader + as *mut spAtlasAttachmentLoader; match type_0 as c_uint { 0 => { - let mut attachment: *mut spRegionAttachment = spRegionAttachment_create(name); + let mut attachment: *mut spRegionAttachment = spRegionAttachment_create( + name, + ); if !sequence.is_null() { if loadSequence((*self_0).atlas, path, sequence) == 0 { spAttachment_dispose(&mut (*attachment).super_0); @@ -10403,10 +11571,13 @@ pub unsafe extern "C" fn _spAtlasAttachmentLoader_createAttachment( as *const c_char, path, ); - return std::ptr::null_mut(); + return 0 as *mut spAttachment; } } else { - let mut region: *mut spAtlasRegion = spAtlas_findRegion((*self_0).atlas, path); + let mut region: *mut spAtlasRegion = spAtlas_findRegion( + (*self_0).atlas, + path, + ); if region.is_null() { spAttachment_dispose(&mut (*attachment).super_0); _spAttachmentLoader_setError( @@ -10414,7 +11585,7 @@ pub unsafe extern "C" fn _spAtlasAttachmentLoader_createAttachment( b"Region not found: \0" as *const u8 as *const c_char, path, ); - return std::ptr::null_mut(); + return 0 as *mut spAttachment; } (*attachment).rendererObject = region as *mut c_void; (*attachment).region = &mut (*region).super_0; @@ -10432,17 +11603,20 @@ pub unsafe extern "C" fn _spAtlasAttachmentLoader_createAttachment( as *const c_char, path, ); - return std::ptr::null_mut(); + return 0 as *mut spAttachment; } } else { - let mut region_0: *mut spAtlasRegion = spAtlas_findRegion((*self_0).atlas, path); + let mut region_0: *mut spAtlasRegion = spAtlas_findRegion( + (*self_0).atlas, + path, + ); if region_0.is_null() { _spAttachmentLoader_setError( loader, b"Region not found: \0" as *const u8 as *const c_char, path, ); - return std::ptr::null_mut(); + return 0 as *mut spAttachment; } (*attachment_0).rendererObject = region_0 as *mut c_void; (*attachment_0).region = &mut (*region_0).super_0; @@ -10451,38 +11625,38 @@ pub unsafe extern "C" fn _spAtlasAttachmentLoader_createAttachment( } 1 => { return &mut (*(spBoundingBoxAttachment_create - as unsafe extern "C" fn(*const c_char) -> *mut spBoundingBoxAttachment)( - name - )) - .super_0 - .super_0; + as unsafe extern "C" fn( + *const c_char, + ) -> *mut spBoundingBoxAttachment)(name)) + .super_0 + .super_0; } 4 => { return &mut (*(spPathAttachment_create - as unsafe extern "C" fn(*const c_char) -> *mut spPathAttachment)( - name - )) - .super_0 - .super_0; + as unsafe extern "C" fn( + *const c_char, + ) -> *mut spPathAttachment)(name)) + .super_0 + .super_0; } 5 => { return &mut (*(spPointAttachment_create - as unsafe extern "C" fn(*const c_char) -> *mut spPointAttachment)( - name - )) - .super_0; + as unsafe extern "C" fn( + *const c_char, + ) -> *mut spPointAttachment)(name)) + .super_0; } 6 => { return &mut (*(spClippingAttachment_create - as unsafe extern "C" fn(*const c_char) -> *mut spClippingAttachment)( - name - )) - .super_0 - .super_0; + as unsafe extern "C" fn( + *const c_char, + ) -> *mut spClippingAttachment)(name)) + .super_0 + .super_0; } _ => { _spAttachmentLoader_setUnknownTypeError(loader, type_0); - return std::ptr::null_mut(); + return 0 as *mut spAttachment; } }; } @@ -10494,11 +11668,14 @@ pub unsafe extern "C" fn spAtlasAttachmentLoader_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4620 as c_int, + 4767 as c_int, ) as *mut spAtlasAttachmentLoader; _spAttachmentLoader_init( &mut (*self_0).super_0, - Some(_spAttachmentLoader_deinit as unsafe extern "C" fn(*mut spAttachmentLoader) -> ()), + Some( + _spAttachmentLoader_deinit + as unsafe extern "C" fn(*mut spAttachmentLoader) -> (), + ), Some( _spAtlasAttachmentLoader_createAttachment as unsafe extern "C" fn( @@ -10521,30 +11698,31 @@ pub unsafe extern "C" fn _spAttachment_init( mut self_0: *mut spAttachment, mut name: *const c_char, mut type_0: spAttachmentType, - mut dispose: Option ()>, - mut copy: Option *mut spAttachment>, + mut dispose: Option:: ()>, + mut copy: Option:: *mut spAttachment>, ) { - let ref mut fresh45 = - *(&mut (*self_0).vtable as *mut *mut c_void as *mut *mut _spAttachmentVtable); - *fresh45 = _spCalloc( + (*self_0) + .vtable = _spCalloc( 1 as c_int as size_t, ::core::mem::size_of::<_spAttachmentVtable>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4667 as c_int, - ) as *mut _spAttachmentVtable; - let ref mut fresh46 = (*((*self_0).vtable as *mut _spAttachmentVtable)).dispose; - *fresh46 = dispose; - let ref mut fresh47 = (*((*self_0).vtable as *mut _spAttachmentVtable)).copy; - *fresh47 = copy; - let ref mut fresh48 = *(&mut (*self_0).name as *mut *mut c_char); - *fresh48 = _spMalloc( + 4814 as c_int, + ) as *mut _spAttachmentVtable as *const c_void; + let ref mut fresh35 = (*((*self_0).vtable as *mut _spAttachmentVtable)).dispose; + *fresh35 = dispose; + let ref mut fresh36 = (*((*self_0).vtable as *mut _spAttachmentVtable)).copy; + *fresh36 = copy; + (*self_0) + .name = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen(name)).wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 4671 as c_int, + 4818 as c_int, ) as *mut c_char; - spine_strcpy(*fresh48, name); - *(&mut (*self_0).type_0 as *mut spAttachmentType) = type_0; + spine_strcpy((*self_0).name, name); + (*self_0).type_0 = type_0; } #[no_mangle] pub unsafe extern "C" fn _spAttachment_deinit(mut self_0: *mut spAttachment) { @@ -10555,7 +11733,9 @@ pub unsafe extern "C" fn _spAttachment_deinit(mut self_0: *mut spAttachment) { _spFree((*self_0).name as *mut c_void); } #[no_mangle] -pub unsafe extern "C" fn spAttachment_copy(mut self_0: *mut spAttachment) -> *mut spAttachment { +pub unsafe extern "C" fn spAttachment_copy( + mut self_0: *mut spAttachment, +) -> *mut spAttachment { return ((*((*self_0).vtable as *mut _spAttachmentVtable)).copy) .expect("non-null function pointer")(self_0); } @@ -10570,8 +11750,8 @@ pub unsafe extern "C" fn spAttachment_dispose(mut self_0: *mut spAttachment) { #[no_mangle] pub unsafe extern "C" fn _spAttachmentLoader_init( mut self_0: *mut spAttachmentLoader, - mut dispose: Option ()>, - mut createAttachment: Option< + mut dispose: Option:: ()>, + mut createAttachment: Option::< unsafe extern "C" fn( *mut spAttachmentLoader, *mut spSkin, @@ -10581,39 +11761,45 @@ pub unsafe extern "C" fn _spAttachmentLoader_init( *mut spSequence, ) -> *mut spAttachment, >, - mut configureAttachment: Option< + mut configureAttachment: Option::< unsafe extern "C" fn(*mut spAttachmentLoader, *mut spAttachment) -> (), >, - mut disposeAttachment: Option< + mut disposeAttachment: Option::< unsafe extern "C" fn(*mut spAttachmentLoader, *mut spAttachment) -> (), >, ) { - let ref mut fresh49 = - *(&mut (*self_0).vtable as *mut *mut c_void as *mut *mut _spAttachmentLoaderVtable); - *fresh49 = _spCalloc( + (*self_0) + .vtable = _spCalloc( 1 as c_int as size_t, ::core::mem::size_of::<_spAttachmentLoaderVtable>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4741 as c_int, - ) as *mut _spAttachmentLoaderVtable; - let ref mut fresh50 = (*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).dispose; - *fresh50 = dispose; - let ref mut fresh51 = (*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).createAttachment; - *fresh51 = createAttachment; - let ref mut fresh52 = - (*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).configureAttachment; - *fresh52 = configureAttachment; - let ref mut fresh53 = (*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).disposeAttachment; - *fresh53 = disposeAttachment; -} -#[no_mangle] -pub unsafe extern "C" fn _spAttachmentLoader_deinit(mut self_0: *mut spAttachmentLoader) { + 4888 as c_int, + ) as *mut _spAttachmentLoaderVtable as *const c_void; + let ref mut fresh37 = (*((*self_0).vtable as *mut _spAttachmentLoaderVtable)) + .dispose; + *fresh37 = dispose; + let ref mut fresh38 = (*((*self_0).vtable as *mut _spAttachmentLoaderVtable)) + .createAttachment; + *fresh38 = createAttachment; + let ref mut fresh39 = (*((*self_0).vtable as *mut _spAttachmentLoaderVtable)) + .configureAttachment; + *fresh39 = configureAttachment; + let ref mut fresh40 = (*((*self_0).vtable as *mut _spAttachmentLoaderVtable)) + .disposeAttachment; + *fresh40 = disposeAttachment; +} +#[no_mangle] +pub unsafe extern "C" fn _spAttachmentLoader_deinit( + mut self_0: *mut spAttachmentLoader, +) { _spFree((*self_0).vtable as *mut c_void); _spFree((*self_0).error1 as *mut c_void); _spFree((*self_0).error2 as *mut c_void); } #[no_mangle] -pub unsafe extern "C" fn spAttachmentLoader_dispose(mut self_0: *mut spAttachmentLoader) { +pub unsafe extern "C" fn spAttachmentLoader_dispose( + mut self_0: *mut spAttachmentLoader, +) { ((*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).dispose) .expect("non-null function pointer")(self_0); _spFree(self_0 as *mut c_void); @@ -10629,8 +11815,8 @@ pub unsafe extern "C" fn spAttachmentLoader_createAttachment( ) -> *mut spAttachment { _spFree((*self_0).error1 as *mut c_void); _spFree((*self_0).error2 as *mut c_void); - (*self_0).error1 = std::ptr::null_mut(); - (*self_0).error2 = std::ptr::null_mut(); + (*self_0).error1 = 0 as *mut c_char; + (*self_0).error2 = 0 as *mut c_char; return ((*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).createAttachment) .expect("non-null function pointer")(self_0, skin, type_0, name, path, sequence); } @@ -10639,7 +11825,9 @@ pub unsafe extern "C" fn spAttachmentLoader_configureAttachment( mut self_0: *mut spAttachmentLoader, mut attachment: *mut spAttachment, ) { - if ((*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).configureAttachment).is_none() { + if ((*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).configureAttachment) + .is_none() + { return; } ((*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).configureAttachment) @@ -10650,7 +11838,9 @@ pub unsafe extern "C" fn spAttachmentLoader_disposeAttachment( mut self_0: *mut spAttachmentLoader, mut attachment: *mut spAttachment, ) { - if ((*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).disposeAttachment).is_none() { + if ((*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).disposeAttachment) + .is_none() + { return; } ((*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).disposeAttachment) @@ -10664,22 +11854,26 @@ pub unsafe extern "C" fn _spAttachmentLoader_setError( ) { _spFree((*self_0).error1 as *mut c_void); _spFree((*self_0).error2 as *mut c_void); - let ref mut fresh54 = *(&mut (*self_0).error1 as *mut *mut c_char); - *fresh54 = _spMalloc( + (*self_0) + .error1 = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(error1)).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen(error1)).wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 4782 as c_int, + 4929 as c_int, ) as *mut c_char; - spine_strcpy(*fresh54, error1); - let ref mut fresh55 = *(&mut (*self_0).error2 as *mut *mut c_char); - *fresh55 = _spMalloc( + spine_strcpy((*self_0).error1, error1); + (*self_0) + .error2 = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(error2)).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen(error2)).wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 4783 as c_int, + 4930 as c_int, ) as *mut c_char; - spine_strcpy(*fresh55, error2); + spine_strcpy((*self_0).error2, error2); } #[no_mangle] pub unsafe extern "C" fn _spAttachmentLoader_setUnknownTypeError( @@ -10687,8 +11881,9 @@ pub unsafe extern "C" fn _spAttachmentLoader_setUnknownTypeError( mut type_0: spAttachmentType, ) { let mut buffer: [c_char; 16] = [0; 16]; - spine_sprintf!( + snprintf( buffer.as_mut_ptr(), + 16 as c_int as c_ulong, b"%d\0" as *const u8 as *const c_char, type_0 as c_uint, ); @@ -10717,16 +11912,15 @@ pub unsafe extern "C" fn spBone_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 4835 as c_int, + 4982 as c_int, ) as *mut spBone; - let ref mut fresh56 = *(&mut (*self_0).data as *mut *mut spBoneData); - *fresh56 = data; - let ref mut fresh57 = *(&mut (*self_0).skeleton as *mut *mut spSkeleton); - *fresh57 = skeleton; - let ref mut fresh58 = *(&mut (*self_0).parent as *mut *mut spBone); - *fresh58 = parent; - *(&mut (*self_0).a as *mut c_float) = 1.0f32; - *(&mut (*self_0).d as *mut c_float) = 1.0f32; + (*self_0).data = data; + (*self_0).skeleton = skeleton; + (*self_0).parent = parent; + (*self_0).a = 1.0f32; + (*self_0).d = 1.0f32; + (*self_0).active = -(1 as c_int); + (*self_0).inherit = SP_INHERIT_NORMAL; spBone_setToSetupPose(self_0); return self_0; } @@ -10772,20 +11966,15 @@ pub unsafe extern "C" fn spBone_updateWorldTransformWith( mut shearX: c_float, mut shearY: c_float, ) { - let mut cosine: c_float = 0.; - let mut sine: c_float = 0.; let mut pa: c_float = 0.; let mut pb: c_float = 0.; let mut pc: c_float = 0.; let mut pd: c_float = 0.; - let mut parent: *mut spBone = (*self_0).parent; let mut sx: c_float = (*(*self_0).skeleton).scaleX; let mut sy: c_float = (*(*self_0).skeleton).scaleY - * (if spBone_isYDown() != 0 { - -(1 as c_int) - } else { - 1 as c_int - }) as c_float; + * (if spBone_isYDown() != 0 { -(1 as c_int) } else { 1 as c_int }) + as c_float; + let mut parent: *mut spBone = (*self_0).parent; (*self_0).ax = x; (*self_0).ay = y; (*self_0).arotation = rotation; @@ -10794,162 +11983,127 @@ pub unsafe extern "C" fn spBone_updateWorldTransformWith( (*self_0).ashearX = shearX; (*self_0).ashearY = shearY; if parent.is_null() { - let mut rotationY: c_float = rotation + 90 as c_int as c_float + shearY; - *(&mut (*self_0).a as *mut c_float) = - spine_cosf((rotation + shearX) * (3.1415926535897932385f32 / 180 as c_int as c_float)) - * scaleX - * sx; - *(&mut (*self_0).b as *mut c_float) = - spine_cosf(rotationY * (3.1415926535897932385f32 / 180 as c_int as c_float)) - * scaleY - * sx; - *(&mut (*self_0).c as *mut c_float) = - spine_sinf((rotation + shearX) * (3.1415926535897932385f32 / 180 as c_int as c_float)) - * scaleX - * sy; - *(&mut (*self_0).d as *mut c_float) = - spine_sinf(rotationY * (3.1415926535897932385f32 / 180 as c_int as c_float)) - * scaleY - * sy; - *(&mut (*self_0).worldX as *mut c_float) = x * sx + (*(*self_0).skeleton).x; - *(&mut (*self_0).worldY as *mut c_float) = y * sy + (*(*self_0).skeleton).y; + let mut rx: c_float = (rotation + shearX) + * (3.1415926535897932385f32 / 180 as c_int as c_float); + let mut ry: c_float = (rotation + 90 as c_int as c_float + + shearY) * (3.1415926535897932385f32 / 180 as c_int as c_float); + (*self_0).a = spine_cosf(rx) * scaleX * sx; + (*self_0).b = spine_cosf(ry) * scaleY * sx; + (*self_0).c = sinf(rx) * scaleX * sy; + (*self_0).d = sinf(ry) * scaleY * sy; + (*self_0).worldX = x * sx + (*(*self_0).skeleton).x; + (*self_0).worldY = y * sy + (*(*self_0).skeleton).y; return; } pa = (*parent).a; pb = (*parent).b; pc = (*parent).c; pd = (*parent).d; - *(&mut (*self_0).worldX as *mut c_float) = pa * x + pb * y + (*parent).worldX; - *(&mut (*self_0).worldY as *mut c_float) = pc * x + pd * y + (*parent).worldY; - match (*(*self_0).data).transformMode as c_uint { + (*self_0).worldX = pa * x + pb * y + (*parent).worldX; + (*self_0).worldY = pc * x + pd * y + (*parent).worldY; + match (*self_0).inherit as c_uint { 0 => { - let mut rotationY_0: c_float = rotation + 90 as c_int as c_float + shearY; - let mut la: c_float = spine_cosf( - (rotation + shearX) * (3.1415926535897932385f32 / 180 as c_int as c_float), - ) * scaleX; - let mut lb: c_float = - spine_cosf(rotationY_0 * (3.1415926535897932385f32 / 180 as c_int as c_float)) - * scaleY; - let mut lc: c_float = spine_sinf( - (rotation + shearX) * (3.1415926535897932385f32 / 180 as c_int as c_float), - ) * scaleX; - let mut ld: c_float = - spine_sinf(rotationY_0 * (3.1415926535897932385f32 / 180 as c_int as c_float)) - * scaleY; - *(&mut (*self_0).a as *mut c_float) = pa * la + pb * lc; - *(&mut (*self_0).b as *mut c_float) = pa * lb + pb * ld; - *(&mut (*self_0).c as *mut c_float) = pc * la + pd * lc; - *(&mut (*self_0).d as *mut c_float) = pc * lb + pd * ld; + let mut rx_0: c_float = (rotation + shearX) + * (3.1415926535897932385f32 / 180 as c_int as c_float); + let mut ry_0: c_float = (rotation + 90 as c_int as c_float + + shearY) + * (3.1415926535897932385f32 / 180 as c_int as c_float); + let mut la: c_float = spine_cosf(rx_0) * scaleX; + let mut lb: c_float = spine_cosf(ry_0) * scaleY; + let mut lc: c_float = sinf(rx_0) * scaleX; + let mut ld: c_float = sinf(ry_0) * scaleY; + (*self_0).a = pa * la + pb * lc; + (*self_0).b = pa * lb + pb * ld; + (*self_0).c = pc * la + pd * lc; + (*self_0).d = pc * lb + pd * ld; return; } 1 => { - let mut rotationY_1: c_float = rotation + 90 as c_int as c_float + shearY; - *(&mut (*self_0).a as *mut c_float) = spine_cosf( - (rotation + shearX) * (3.1415926535897932385f32 / 180 as c_int as c_float), - ) * scaleX; - *(&mut (*self_0).b as *mut c_float) = - spine_cosf(rotationY_1 * (3.1415926535897932385f32 / 180 as c_int as c_float)) - * scaleY; - *(&mut (*self_0).c as *mut c_float) = spine_sinf( - (rotation + shearX) * (3.1415926535897932385f32 / 180 as c_int as c_float), - ) * scaleX; - *(&mut (*self_0).d as *mut c_float) = - spine_sinf(rotationY_1 * (3.1415926535897932385f32 / 180 as c_int as c_float)) - * scaleY; + let mut rx_1: c_float = (rotation + shearX) + * (3.1415926535897932385f32 / 180 as c_int as c_float); + let mut ry_1: c_float = (rotation + 90 as c_int as c_float + + shearY) + * (3.1415926535897932385f32 / 180 as c_int as c_float); + (*self_0).a = spine_cosf(rx_1) * scaleX; + (*self_0).b = spine_cosf(ry_1) * scaleY; + (*self_0).c = sinf(rx_1) * scaleX; + (*self_0).d = sinf(ry_1) * scaleY; } 2 => { let mut s: c_float = pa * pa + pc * pc; let mut prx: c_float = 0.; - let mut rx: c_float = 0.; - let mut ry: c_float = 0.; - let mut la_0: c_float = 0.; - let mut lb_0: c_float = 0.; - let mut lc_0: c_float = 0.; - let mut ld_0: c_float = 0.; if s > 0.0001f32 { s = (if pa * pd - pb * pc < 0 as c_int as c_float { -(pa * pd - pb * pc) } else { pa * pd - pb * pc }) / s; - pa /= (*(*self_0).skeleton).scaleX; - pc /= (*(*self_0).skeleton).scaleY; + pa /= sx; + pc /= sy; pb = pc * s; pd = pa * s; - prx = spine_atan2f(pc, pa) * (180 as c_int as c_float / 3.1415926535897932385f32); + prx = spine_atan2f(pc, pa) + * (180 as c_int as c_float / 3.1415926535897932385f32); } else { pa = 0 as c_int as c_float; pc = 0 as c_int as c_float; prx = 90 as c_int as c_float - - spine_atan2f(pd, pb) * (180 as c_int as c_float / 3.1415926535897932385f32); - } - rx = rotation + shearX - prx; - ry = rotation + shearY - prx + 90 as c_int as c_float; - la_0 = spine_cosf(rx * (3.1415926535897932385f32 / 180 as c_int as c_float)) * scaleX; - lb_0 = spine_cosf(ry * (3.1415926535897932385f32 / 180 as c_int as c_float)) * scaleY; - lc_0 = spine_sinf(rx * (3.1415926535897932385f32 / 180 as c_int as c_float)) * scaleX; - ld_0 = spine_sinf(ry * (3.1415926535897932385f32 / 180 as c_int as c_float)) * scaleY; - *(&mut (*self_0).a as *mut c_float) = pa * la_0 - pb * lc_0; - *(&mut (*self_0).b as *mut c_float) = pa * lb_0 - pb * ld_0; - *(&mut (*self_0).c as *mut c_float) = pc * la_0 + pd * lc_0; - *(&mut (*self_0).d as *mut c_float) = pc * lb_0 + pd * ld_0; + - spine_atan2f(pd, pb) + * (180 as c_int as c_float + / 3.1415926535897932385f32); + } + let mut rx_2: c_float = (rotation + shearX - prx) + * (3.1415926535897932385f32 / 180 as c_int as c_float); + let mut ry_2: c_float = (rotation + shearY - prx + + 90 as c_int as c_float) + * (3.1415926535897932385f32 / 180 as c_int as c_float); + let mut la_0: c_float = spine_cosf(rx_2) * scaleX; + let mut lb_0: c_float = spine_cosf(ry_2) * scaleY; + let mut lc_0: c_float = sinf(rx_2) * scaleX; + let mut ld_0: c_float = sinf(ry_2) * scaleY; + (*self_0).a = pa * la_0 - pb * lc_0; + (*self_0).b = pa * lb_0 - pb * ld_0; + (*self_0).c = pc * la_0 + pd * lc_0; + (*self_0).d = pc * lb_0 + pd * ld_0; } 3 | 4 => { - let mut za: c_float = 0.; - let mut zc: c_float = 0.; - let mut s_0: c_float = 0.; - let mut r: c_float = 0.; - let mut zb: c_float = 0.; - let mut zd: c_float = 0.; - let mut la_1: c_float = 0.; - let mut lb_1: c_float = 0.; - let mut lc_1: c_float = 0.; - let mut ld_1: c_float = 0.; - cosine = spine_cosf(rotation * (3.1415926535897932385f32 / 180 as c_int as c_float)); - sine = spine_sinf(rotation * (3.1415926535897932385f32 / 180 as c_int as c_float)); - za = (pa * cosine + pb * sine) / sx; - zc = (pc * cosine + pd * sine) / sy; - s_0 = spine_sqrtf(za * za + zc * zc); - if s_0 > 0.00001f32 { - s_0 = 1 as c_int as c_float / s_0; - } - za *= s_0; - zc *= s_0; - s_0 = spine_sqrtf(za * za + zc * zc); - if (*(*self_0).data).transformMode as c_uint - == SP_TRANSFORMMODE_NOSCALE as c_int as c_uint + rotation *= 3.1415926535897932385f32 / 180 as c_int as c_float; + let mut cosine: c_float = spine_cosf(rotation); + let mut sine: c_float = sinf(rotation); + let mut za: c_float = (pa * cosine + pb * sine) / sx; + let mut zc: c_float = (pc * cosine + pd * sine) / sy; + let mut s_0: c_float = spine_sqrtf(za * za + zc * zc); + if (*(*self_0).data).inherit as c_uint + == SP_INHERIT_NOSCALE as c_int as c_uint && (pa * pd - pb * pc < 0 as c_int as c_float) as c_int != ((sx < 0 as c_int as c_float) as c_int - != (sy < 0 as c_int as c_float) as c_int) as c_int + != (sy < 0 as c_int as c_float) as c_int) + as c_int { s_0 = -s_0; } - r = 3.1415926535897932385f32 / 2 as c_int as c_float + spine_atan2f(zc, za); - zb = spine_cosf(r) * s_0; - zd = spine_sinf(r) * s_0; - la_1 = - spine_cosf(shearX * (3.1415926535897932385f32 / 180 as c_int as c_float)) * scaleX; - lb_1 = spine_cosf( - (90 as c_int as c_float + shearY) - * (3.1415926535897932385f32 / 180 as c_int as c_float), - ) * scaleY; - lc_1 = - spine_sinf(shearX * (3.1415926535897932385f32 / 180 as c_int as c_float)) * scaleX; - ld_1 = spine_sinf( - (90 as c_int as c_float + shearY) - * (3.1415926535897932385f32 / 180 as c_int as c_float), - ) * scaleY; - *(&mut (*self_0).a as *mut c_float) = za * la_1 + zb * lc_1; - *(&mut (*self_0).b as *mut c_float) = za * lb_1 + zb * ld_1; - *(&mut (*self_0).c as *mut c_float) = zc * la_1 + zd * lc_1; - *(&mut (*self_0).d as *mut c_float) = zc * lb_1 + zd * ld_1; + rotation = 3.1415926535897932385f32 / 2 as c_int as c_float + + spine_atan2f(zc, za); + let mut zb: c_float = spine_cosf(rotation) * s_0; + let mut zd: c_float = sinf(rotation) * s_0; + shearX *= 3.1415926535897932385f32 / 180 as c_int as c_float; + shearY = (90 as c_int as c_float + shearY) + * (3.1415926535897932385f32 / 180 as c_int as c_float); + let mut la_1: c_float = spine_cosf(shearX) * scaleX; + let mut lb_1: c_float = spine_cosf(shearY) * scaleY; + let mut lc_1: c_float = sinf(shearX) * scaleX; + let mut ld_1: c_float = sinf(shearY) * scaleY; + (*self_0).a = za * la_1 + zb * lc_1; + (*self_0).b = za * lb_1 + zb * ld_1; + (*self_0).c = zc * la_1 + zd * lc_1; + (*self_0).d = zc * lb_1 + zd * ld_1; } _ => {} } - *(&mut (*self_0).a as *mut c_float) *= sx; - *(&mut (*self_0).b as *mut c_float) *= sx; - *(&mut (*self_0).c as *mut c_float) *= sy; - *(&mut (*self_0).d as *mut c_float) *= sy; + (*self_0).a *= sx; + (*self_0).b *= sx; + (*self_0).c *= sy; + (*self_0).d *= sy; } #[no_mangle] pub unsafe extern "C" fn spBone_setToSetupPose(mut self_0: *mut spBone) { @@ -10960,74 +12114,182 @@ pub unsafe extern "C" fn spBone_setToSetupPose(mut self_0: *mut spBone) { (*self_0).scaleY = (*(*self_0).data).scaleY; (*self_0).shearX = (*(*self_0).data).shearX; (*self_0).shearY = (*(*self_0).data).shearY; + (*self_0).inherit = (*(*self_0).data).inherit; } #[no_mangle] -pub unsafe extern "C" fn spBone_getWorldRotationX(mut self_0: *mut spBone) -> c_float { +pub unsafe extern "C" fn spBone_getWorldRotationX( + mut self_0: *mut spBone, +) -> c_float { return spine_atan2f((*self_0).c, (*self_0).a) * (180 as c_int as c_float / 3.1415926535897932385f32); } #[no_mangle] -pub unsafe extern "C" fn spBone_getWorldRotationY(mut self_0: *mut spBone) -> c_float { +pub unsafe extern "C" fn spBone_getWorldRotationY( + mut self_0: *mut spBone, +) -> c_float { return spine_atan2f((*self_0).d, (*self_0).b) * (180 as c_int as c_float / 3.1415926535897932385f32); } #[no_mangle] -pub unsafe extern "C" fn spBone_getWorldScaleX(mut self_0: *mut spBone) -> c_float { +pub unsafe extern "C" fn spBone_getWorldScaleX( + mut self_0: *mut spBone, +) -> c_float { return spine_sqrtf((*self_0).a * (*self_0).a + (*self_0).c * (*self_0).c); } #[no_mangle] -pub unsafe extern "C" fn spBone_getWorldScaleY(mut self_0: *mut spBone) -> c_float { +pub unsafe extern "C" fn spBone_getWorldScaleY( + mut self_0: *mut spBone, +) -> c_float { return spine_sqrtf((*self_0).b * (*self_0).b + (*self_0).d * (*self_0).d); } #[no_mangle] pub unsafe extern "C" fn spBone_updateAppliedTransform(mut self_0: *mut spBone) { + let mut pa: c_float = 0.; + let mut pb: c_float = 0.; + let mut pc: c_float = 0.; + let mut pd: c_float = 0.; + let mut pid: c_float = 0.; + let mut ia: c_float = 0.; + let mut ib: c_float = 0.; + let mut ic: c_float = 0.; + let mut id: c_float = 0.; + let mut dx: c_float = 0.; + let mut dy: c_float = 0.; + let mut ra: c_float = 0.; + let mut rb: c_float = 0.; + let mut rc: c_float = 0.; + let mut rd: c_float = 0.; + let mut s: c_float = 0.; + let mut sa: c_float = 0.; + let mut sc: c_float = 0.; + let mut cosine: c_float = 0.; + let mut sine: c_float = 0.; + let mut yDownScale: c_float = (if spBone_isYDown() != 0 { + -(1 as c_int) + } else { + 1 as c_int + }) as c_float; let mut parent: *mut spBone = (*self_0).parent; if parent.is_null() { (*self_0).ax = (*self_0).worldX - (*(*self_0).skeleton).x; (*self_0).ay = (*self_0).worldY - (*(*self_0).skeleton).y; - (*self_0).arotation = spine_atan2f((*self_0).c, (*self_0).a) + (*self_0) + .arotation = spine_atan2f((*self_0).c, (*self_0).a) * (180 as c_int as c_float / 3.1415926535897932385f32); - (*self_0).ascaleX = spine_sqrtf((*self_0).a * (*self_0).a + (*self_0).c * (*self_0).c); - (*self_0).ascaleY = spine_sqrtf((*self_0).b * (*self_0).b + (*self_0).d * (*self_0).d); + (*self_0) + .ascaleX = spine_sqrtf( + (*self_0).a * (*self_0).a + (*self_0).c * (*self_0).c, + ); + (*self_0) + .ascaleY = spine_sqrtf( + (*self_0).b * (*self_0).b + (*self_0).d * (*self_0).d, + ); (*self_0).ashearX = 0 as c_int as c_float; - (*self_0).ashearY = spine_atan2f( + (*self_0) + .ashearY = spine_atan2f( (*self_0).a * (*self_0).b + (*self_0).c * (*self_0).d, (*self_0).a * (*self_0).d - (*self_0).b * (*self_0).c, ) * (180 as c_int as c_float / 3.1415926535897932385f32); + return; + } + pa = (*parent).a; + pb = (*parent).b; + pc = (*parent).c; + pd = (*parent).d; + pid = 1 as c_int as c_float / (pa * pd - pb * pc); + ia = pd * pid; + ib = pb * pid; + ic = pc * pid; + id = pa * pid; + dx = (*self_0).worldX - (*parent).worldX; + dy = (*self_0).worldY - (*parent).worldY; + (*self_0).ax = dx * ia - dy * ib; + (*self_0).ay = dy * id - dx * ic; + if (*self_0).inherit as c_uint + == SP_INHERIT_ONLYTRANSLATION as c_int as c_uint + { + ra = (*self_0).a; + rb = (*self_0).b; + rc = (*self_0).c; + rd = (*self_0).d; } else { - let mut pa: c_float = (*parent).a; - let mut pb: c_float = (*parent).b; - let mut pc: c_float = (*parent).c; - let mut pd: c_float = (*parent).d; - let mut pid: c_float = 1 as c_int as c_float / (pa * pd - pb * pc); - let mut dx: c_float = (*self_0).worldX - (*parent).worldX; - let mut dy: c_float = (*self_0).worldY - (*parent).worldY; - let mut ia: c_float = pid * pd; - let mut id: c_float = pid * pa; - let mut ib: c_float = pid * pb; - let mut ic: c_float = pid * pc; - let mut ra: c_float = ia * (*self_0).a - ib * (*self_0).c; - let mut rb: c_float = ia * (*self_0).b - ib * (*self_0).d; - let mut rc: c_float = id * (*self_0).c - ic * (*self_0).a; - let mut rd: c_float = id * (*self_0).d - ic * (*self_0).b; - (*self_0).ax = dx * pd * pid - dy * pb * pid; - (*self_0).ay = dy * pa * pid - dx * pc * pid; - (*self_0).ashearX = 0 as c_int as c_float; - (*self_0).ascaleX = spine_sqrtf(ra * ra + rc * rc); - if (*self_0).ascaleX > 0.0001f32 { - let mut det: c_float = ra * rd - rb * rc; - (*self_0).ascaleY = det / (*self_0).ascaleX; - (*self_0).ashearY = spine_atan2f(ra * rb + rc * rd, det) + match (*self_0).inherit as c_uint { + 2 => { + s = (if pa * pd - pb * pc < 0 as c_int as c_float { + -(pa * pd - pb * pc) + } else { + pa * pd - pb * pc + }) / (pa * pa + pc * pc); + sa = pa / (*(*self_0).skeleton).scaleX; + sc = pc / (*(*self_0).skeleton).scaleY * yDownScale; + pb = -sc * s * (*(*self_0).skeleton).scaleX; + pd = sa * s * (*(*self_0).skeleton).scaleY * yDownScale; + pid = 1 as c_int as c_float / (pa * pd - pb * pc); + ia = pd * pid; + ib = pb * pid; + } + 3 | 4 => { + let mut r: c_float = (*self_0).rotation + * (3.1415926535897932385f32 / 180 as c_int as c_float); + cosine = spine_cosf(r); + sine = sinf(r); + pa = (pa * cosine + pb * sine) / (*(*self_0).skeleton).scaleX; + pc = (pc * cosine + pd * sine) / (*(*self_0).skeleton).scaleY + * yDownScale; + s = spine_sqrtf(pa * pa + pc * pc); + if s as c_double > 0.00001f64 { + s = 1 as c_int as c_float / s; + } + pa *= s; + pc *= s; + s = spine_sqrtf(pa * pa + pc * pc); + if (*self_0).inherit as c_uint + == SP_INHERIT_NOSCALE as c_int as c_uint + && (pid < 0 as c_int as c_float) as c_int + != (((*(*self_0).skeleton).scaleX + < 0 as c_int as c_float) as c_int + != ((*(*self_0).skeleton).scaleY * yDownScale + < 0 as c_int as c_float) as c_int) + as c_int + { + s = -s; + } + r = 3.1415926535897932385f32 / 2 as c_int as c_float + + spine_atan2f(pc, pa); + pb = spine_cosf(r) * s; + pd = sinf(r) * s; + pid = 1 as c_int as c_float / (pa * pd - pb * pc); + ia = pd * pid; + ib = pb * pid; + ic = pc * pid; + id = pa * pid; + } + 1 | 0 | _ => {} + } + ra = ia * (*self_0).a - ib * (*self_0).c; + rb = ia * (*self_0).b - ib * (*self_0).d; + rc = id * (*self_0).c - ic * (*self_0).a; + rd = id * (*self_0).d - ic * (*self_0).b; + } + (*self_0).ashearX = 0 as c_int as c_float; + (*self_0).ascaleX = spine_sqrtf(ra * ra + rc * rc); + if (*self_0).ascaleX > 0.0001f32 { + let mut det: c_float = ra * rd - rb * rc; + (*self_0).ascaleY = det / (*self_0).ascaleX; + (*self_0) + .ashearY = -(spine_atan2f(ra * rb + rc * rd, det) + * (180 as c_int as c_float / 3.1415926535897932385f32)); + (*self_0) + .arotation = spine_atan2f(rc, ra) + * (180 as c_int as c_float / 3.1415926535897932385f32); + } else { + (*self_0).ascaleX = 0 as c_int as c_float; + (*self_0).ascaleY = spine_sqrtf(rb * rb + rd * rd); + (*self_0).ashearY = 0 as c_int as c_float; + (*self_0) + .arotation = 90 as c_int as c_float + - spine_atan2f(rd, rb) * (180 as c_int as c_float / 3.1415926535897932385f32); - (*self_0).arotation = - spine_atan2f(rc, ra) * (180 as c_int as c_float / 3.1415926535897932385f32); - } else { - (*self_0).ascaleX = 0 as c_int as c_float; - (*self_0).ascaleY = spine_sqrtf(rb * rb + rd * rd); - (*self_0).ashearY = 0 as c_int as c_float; - (*self_0).arotation = 90 as c_int as c_float - - spine_atan2f(rd, rb) * (180 as c_int as c_float / 3.1415926535897932385f32); - } }; } #[no_mangle] @@ -11038,14 +12300,29 @@ pub unsafe extern "C" fn spBone_worldToLocal( mut localX: *mut c_float, mut localY: *mut c_float, ) { - let mut invDet: c_float = - 1 as c_int as c_float / ((*self_0).a * (*self_0).d - (*self_0).b * (*self_0).c); + let mut invDet: c_float = 1 as c_int as c_float + / ((*self_0).a * (*self_0).d - (*self_0).b * (*self_0).c); let mut x: c_float = worldX - (*self_0).worldX; let mut y: c_float = worldY - (*self_0).worldY; *localX = x * (*self_0).d * invDet - y * (*self_0).b * invDet; *localY = y * (*self_0).a * invDet - x * (*self_0).c * invDet; } #[no_mangle] +pub unsafe extern "C" fn spBone_worldToParent( + mut self_0: *mut spBone, + mut worldX: c_float, + mut worldY: c_float, + mut localX: *mut c_float, + mut localY: *mut c_float, +) { + if ((*self_0).parent).is_null() { + *localX = worldX; + *localY = worldY; + } else { + spBone_worldToLocal((*self_0).parent, worldX, worldY, localX, localY); + }; +} +#[no_mangle] pub unsafe extern "C" fn spBone_localToWorld( mut self_0: *mut spBone, mut localX: c_float, @@ -11059,50 +12336,62 @@ pub unsafe extern "C" fn spBone_localToWorld( *worldY = x * (*self_0).c + y * (*self_0).d + (*self_0).worldY; } #[no_mangle] +pub unsafe extern "C" fn spBone_parentToWorld( + mut self_0: *mut spBone, + mut localX: c_float, + mut localY: c_float, + mut worldX: *mut c_float, + mut worldY: *mut c_float, +) { + if !((*self_0).parent).is_null() { + *worldX = localX; + *worldY = localY; + } else { + spBone_localToWorld((*self_0).parent, localX, localY, worldX, worldY); + }; +} +#[no_mangle] pub unsafe extern "C" fn spBone_worldToLocalRotation( mut self_0: *mut spBone, mut worldRotation: c_float, ) -> c_float { - let mut sine: c_float = 0.; - let mut cosine: c_float = 0.; - sine = spine_sinf(worldRotation * (3.1415926535897932385f32 / 180 as c_int as c_float)); - cosine = spine_cosf(worldRotation * (3.1415926535897932385f32 / 180 as c_int as c_float)); + worldRotation *= 3.1415926535897932385f32 / 180 as c_int as c_float; + let mut sine: c_float = sinf(worldRotation); + let mut cosine: c_float = spine_cosf(worldRotation); return spine_atan2f( (*self_0).a * sine - (*self_0).c * cosine, (*self_0).d * cosine - (*self_0).b * sine, ) * (180 as c_int as c_float / 3.1415926535897932385f32) - + (*self_0).rotation - - (*self_0).shearX; + + (*self_0).rotation - (*self_0).shearX; } #[no_mangle] pub unsafe extern "C" fn spBone_localToWorldRotation( mut self_0: *mut spBone, mut localRotation: c_float, ) -> c_float { - let mut sine: c_float = 0.; - let mut cosine: c_float = 0.; - localRotation -= (*self_0).rotation - (*self_0).shearX; - sine = spine_sinf(localRotation * (3.1415926535897932385f32 / 180 as c_int as c_float)); - cosine = spine_cosf(localRotation * (3.1415926535897932385f32 / 180 as c_int as c_float)); + localRotation = (localRotation - (*self_0).rotation - (*self_0).shearX) + * (3.1415926535897932385f32 / 180 as c_int as c_float); + let mut sine: c_float = sinf(localRotation); + let mut cosine: c_float = spine_cosf(localRotation); return spine_atan2f( cosine * (*self_0).c + sine * (*self_0).d, cosine * (*self_0).a + sine * (*self_0).b, ) * (180 as c_int as c_float / 3.1415926535897932385f32); } #[no_mangle] -pub unsafe extern "C" fn spBone_rotateWorld(mut self_0: *mut spBone, mut degrees: c_float) { - let mut a: c_float = (*self_0).a; - let mut b: c_float = (*self_0).b; - let mut c: c_float = (*self_0).c; - let mut d: c_float = (*self_0).d; - let mut cosine: c_float = - spine_cosf(degrees * (3.1415926535897932385f32 / 180 as c_int as c_float)); - let mut sine: c_float = - spine_sinf(degrees * (3.1415926535897932385f32 / 180 as c_int as c_float)); - *(&mut (*self_0).a as *mut c_float) = cosine * a - sine * c; - *(&mut (*self_0).b as *mut c_float) = cosine * b - sine * d; - *(&mut (*self_0).c as *mut c_float) = sine * a + cosine * c; - *(&mut (*self_0).d as *mut c_float) = sine * b + cosine * d; +pub unsafe extern "C" fn spBone_rotateWorld( + mut self_0: *mut spBone, + mut degrees: c_float, +) { + degrees *= 3.1415926535897932385f32 / 180 as c_int as c_float; + let mut sine: c_float = sinf(degrees); + let mut cosine: c_float = spine_cosf(degrees); + let mut ra: c_float = (*self_0).a; + let mut rb: c_float = (*self_0).b; + (*self_0).a = cosine * ra - sine * (*self_0).c; + (*self_0).b = cosine * rb - sine * (*self_0).d; + (*self_0).c = sine * ra + cosine * (*self_0).c; + (*self_0).d = sine * rb + cosine * (*self_0).d; } #[no_mangle] pub unsafe extern "C" fn spBoneData_create( @@ -11114,32 +12403,39 @@ pub unsafe extern "C" fn spBoneData_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 5118 as c_int, + 5338 as c_int, ) as *mut spBoneData; - *(&mut (*self_0).index as *mut c_int) = index; - let ref mut fresh59 = *(&mut (*self_0).name as *mut *mut c_char); - *fresh59 = _spMalloc( + (*self_0).index = index; + (*self_0) + .name = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen(name)).wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 5120 as c_int, + 5340 as c_int, ) as *mut c_char; - spine_strcpy(*fresh59, name); - let ref mut fresh60 = *(&mut (*self_0).parent as *mut *mut spBoneData); - *fresh60 = parent; + spine_strcpy((*self_0).name, name); + (*self_0).parent = parent; (*self_0).scaleX = 1 as c_int as c_float; (*self_0).scaleY = 1 as c_int as c_float; - (*self_0).transformMode = SP_TRANSFORMMODE_NORMAL; + (*self_0).inherit = SP_INHERIT_NORMAL; + (*self_0).icon = 0 as *const c_char; + (*self_0).visible = -(1 as c_int); return self_0; } #[no_mangle] pub unsafe extern "C" fn spBoneData_dispose(mut self_0: *mut spBoneData) { _spFree((*self_0).name as *mut c_void); + _spFree((*self_0).icon as *mut c_void); _spFree(self_0 as *mut c_void); } #[no_mangle] -pub unsafe extern "C" fn _spBoundingBoxAttachment_dispose(mut attachment: *mut spAttachment) { - let mut self_0: *mut spBoundingBoxAttachment = attachment as *mut spBoundingBoxAttachment; +pub unsafe extern "C" fn _spBoundingBoxAttachment_dispose( + mut attachment: *mut spAttachment, +) { + let mut self_0: *mut spBoundingBoxAttachment = attachment + as *mut spBoundingBoxAttachment; _spVertexAttachment_deinit(&mut (*self_0).super_0); _spFree(self_0 as *mut c_void); } @@ -11147,8 +12443,11 @@ pub unsafe extern "C" fn _spBoundingBoxAttachment_dispose(mut attachment: *mut s pub unsafe extern "C" fn _spBoundingBoxAttachment_copy( mut attachment: *mut spAttachment, ) -> *mut spAttachment { - let mut copy: *mut spBoundingBoxAttachment = spBoundingBoxAttachment_create((*attachment).name); - let mut self_0: *mut spBoundingBoxAttachment = attachment as *mut spBoundingBoxAttachment; + let mut copy: *mut spBoundingBoxAttachment = spBoundingBoxAttachment_create( + (*attachment).name, + ); + let mut self_0: *mut spBoundingBoxAttachment = attachment + as *mut spBoundingBoxAttachment; spVertexAttachment_copyTo(&mut (*self_0).super_0, &mut (*copy).super_0); return &mut (*copy).super_0.super_0; } @@ -11160,14 +12459,17 @@ pub unsafe extern "C" fn spBoundingBoxAttachment_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 5180 as c_int, + 5403 as c_int, ) as *mut spBoundingBoxAttachment; _spVertexAttachment_init(&mut (*self_0).super_0); _spAttachment_init( &mut (*self_0).super_0.super_0, name, SP_ATTACHMENT_BOUNDING_BOX, - Some(_spBoundingBoxAttachment_dispose as unsafe extern "C" fn(*mut spAttachment) -> ()), + Some( + _spBoundingBoxAttachment_dispose + as unsafe extern "C" fn(*mut spAttachment) -> (), + ), Some( _spBoundingBoxAttachment_copy as unsafe extern "C" fn(*mut spAttachment) -> *mut spAttachment, @@ -11176,7 +12478,9 @@ pub unsafe extern "C" fn spBoundingBoxAttachment_create( return self_0; } #[no_mangle] -pub unsafe extern "C" fn _spClippingAttachment_dispose(mut attachment: *mut spAttachment) { +pub unsafe extern "C" fn _spClippingAttachment_dispose( + mut attachment: *mut spAttachment, +) { let mut self_0: *mut spClippingAttachment = attachment as *mut spClippingAttachment; _spVertexAttachment_deinit(&mut (*self_0).super_0); _spFree(self_0 as *mut c_void); @@ -11185,7 +12489,9 @@ pub unsafe extern "C" fn _spClippingAttachment_dispose(mut attachment: *mut spAt pub unsafe extern "C" fn _spClippingAttachment_copy( mut attachment: *mut spAttachment, ) -> *mut spAttachment { - let mut copy: *mut spClippingAttachment = spClippingAttachment_create((*attachment).name); + let mut copy: *mut spClippingAttachment = spClippingAttachment_create( + (*attachment).name, + ); let mut self_0: *mut spClippingAttachment = attachment as *mut spClippingAttachment; spVertexAttachment_copyTo(&mut (*self_0).super_0, &mut (*copy).super_0); (*copy).endSlot = (*self_0).endSlot; @@ -11199,28 +12505,32 @@ pub unsafe extern "C" fn spClippingAttachment_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 5235 as c_int, + 5458 as c_int, ) as *mut spClippingAttachment; _spVertexAttachment_init(&mut (*self_0).super_0); _spAttachment_init( &mut (*self_0).super_0.super_0, name, SP_ATTACHMENT_CLIPPING, - Some(_spClippingAttachment_dispose as unsafe extern "C" fn(*mut spAttachment) -> ()), + Some( + _spClippingAttachment_dispose + as unsafe extern "C" fn(*mut spAttachment) -> (), + ), Some( _spClippingAttachment_copy as unsafe extern "C" fn(*mut spAttachment) -> *mut spAttachment, ), ); - (*self_0).endSlot = std::ptr::null_mut(); + (*self_0).endSlot = 0 as *mut spSlotData; return self_0; } #[no_mangle] pub unsafe extern "C" fn spColor_create() -> *mut spColor { return _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul(1 as c_int as c_ulong), + (::core::mem::size_of::() as c_ulong) + .wrapping_mul(1 as c_int as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 5275 as c_int, + 5498 as c_int, ) as *mut spColor; } #[no_mangle] @@ -11275,7 +12585,10 @@ pub unsafe extern "C" fn spColor_setFromColor3( (*self_0).b = (*otherColor).b; } #[no_mangle] -pub unsafe extern "C" fn spColor_addColor(mut self_0: *mut spColor, mut otherColor: *mut spColor) { +pub unsafe extern "C" fn spColor_addColor( + mut self_0: *mut spColor, + mut otherColor: *mut spColor, +) { (*self_0).r += (*otherColor).r; (*self_0).g += (*otherColor).g; (*self_0).b += (*otherColor).b; @@ -11358,7 +12671,9 @@ static mut _spTimelineTypeNames: [*const c_char; 24] = [ b"Event\0" as *const u8 as *const c_char, ]; #[no_mangle] -pub unsafe extern "C" fn spDebug_printSkeletonData(mut skeletonData: *mut spSkeletonData) { +pub unsafe extern "C" fn spDebug_printSkeletonData( + mut skeletonData: *mut spSkeletonData, +) { let mut i: c_int = 0; let mut n: c_int = 0; spDebug_printBoneDatas((*skeletonData).bones, (*skeletonData).bonesCount); @@ -11388,7 +12703,9 @@ pub unsafe extern "C" fn _spDebug_printTimelineBase(mut timeline: *mut spTimelin spine_printf!(b"\n\0" as *const u8 as *const c_char); } #[no_mangle] -pub unsafe extern "C" fn _spDebug_printCurveTimeline(mut timeline: *mut spCurveTimeline) { +pub unsafe extern "C" fn _spDebug_printCurveTimeline( + mut timeline: *mut spCurveTimeline, +) { _spDebug_printTimelineBase(&mut (*timeline).super_0); spine_printf!(b" curves: \0" as *const u8 as *const c_char); spDebug_printFloats((*(*timeline).curves).items, (*(*timeline).curves).size); @@ -11396,110 +12713,160 @@ pub unsafe extern "C" fn _spDebug_printCurveTimeline(mut timeline: *mut spCurveT } #[no_mangle] pub unsafe extern "C" fn spDebug_printTimeline(mut timeline: *mut spTimeline) { + let mut current_block_29: u64; match (*timeline).type_0 as c_uint { 0 => { let mut t: *mut spAttachmentTimeline = timeline as *mut spAttachmentTimeline; _spDebug_printTimelineBase(&mut (*t).super_0); + current_block_29 = 17233182392562552756; } 1 => { let mut t_0: *mut spAlphaTimeline = timeline as *mut spAlphaTimeline; _spDebug_printCurveTimeline(&mut (*t_0).super_0); + current_block_29 = 17233182392562552756; } 2 => { - let mut t_1: *mut spPathConstraintPositionTimeline = - timeline as *mut spPathConstraintPositionTimeline; + let mut t_1: *mut spPathConstraintPositionTimeline = timeline + as *mut spPathConstraintPositionTimeline; _spDebug_printCurveTimeline(&mut (*t_1).super_0); + current_block_29 = 17233182392562552756; } 3 => { - let mut t_2: *mut spPathConstraintMixTimeline = - timeline as *mut spPathConstraintMixTimeline; + let mut t_2: *mut spPathConstraintMixTimeline = timeline + as *mut spPathConstraintMixTimeline; _spDebug_printCurveTimeline(&mut (*t_2).super_0); + current_block_29 = 17233182392562552756; } 4 => { let mut t_3: *mut spRotateTimeline = timeline as *mut spRotateTimeline; _spDebug_printCurveTimeline(&mut (*t_3).super_0); + current_block_29 = 17233182392562552756; } 5 => { let mut t_4: *mut spScaleXTimeline = timeline as *mut spScaleXTimeline; _spDebug_printCurveTimeline(&mut (*t_4).super_0); + current_block_29 = 17233182392562552756; } 6 => { let mut t_5: *mut spScaleYTimeline = timeline as *mut spScaleYTimeline; _spDebug_printCurveTimeline(&mut (*t_5).super_0); + current_block_29 = 17233182392562552756; } 7 => { let mut t_6: *mut spShearXTimeline = timeline as *mut spShearXTimeline; _spDebug_printCurveTimeline(&mut (*t_6).super_0); + current_block_29 = 17233182392562552756; } 8 => { let mut t_7: *mut spShearYTimeline = timeline as *mut spShearYTimeline; _spDebug_printCurveTimeline(&mut (*t_7).super_0); + current_block_29 = 17233182392562552756; } 9 => { - let mut t_8: *mut spTranslateXTimeline = timeline as *mut spTranslateXTimeline; + let mut t_8: *mut spTranslateXTimeline = timeline + as *mut spTranslateXTimeline; _spDebug_printCurveTimeline(&mut (*t_8).super_0); + current_block_29 = 17233182392562552756; } 10 => { - let mut t_9: *mut spTranslateYTimeline = timeline as *mut spTranslateYTimeline; + let mut t_9: *mut spTranslateYTimeline = timeline + as *mut spTranslateYTimeline; _spDebug_printCurveTimeline(&mut (*t_9).super_0); + current_block_29 = 17233182392562552756; } 11 => { let mut t_10: *mut spScaleTimeline = timeline as *mut spScaleTimeline; _spDebug_printCurveTimeline(&mut (*t_10).super_0); + current_block_29 = 17233182392562552756; } 12 => { let mut t_11: *mut spShearTimeline = timeline as *mut spShearTimeline; _spDebug_printCurveTimeline(&mut (*t_11).super_0); + current_block_29 = 17233182392562552756; } 13 => { - let mut t_12: *mut spTranslateTimeline = timeline as *mut spTranslateTimeline; + let mut t_12: *mut spTranslateTimeline = timeline + as *mut spTranslateTimeline; _spDebug_printCurveTimeline(&mut (*t_12).super_0); + current_block_29 = 17233182392562552756; } 14 => { let mut t_13: *mut spDeformTimeline = timeline as *mut spDeformTimeline; _spDebug_printCurveTimeline(&mut (*t_13).super_0); + current_block_29 = 17233182392562552756; } - 16 => { - let mut t_14: *mut spIkConstraintTimeline = timeline as *mut spIkConstraintTimeline; + 17 => { + let mut t_14: *mut spIkConstraintTimeline = timeline + as *mut spIkConstraintTimeline; _spDebug_printCurveTimeline(&mut (*t_14).super_0); + current_block_29 = 17233182392562552756; } - 17 => { - let mut t_15: *mut spPathConstraintMixTimeline = - timeline as *mut spPathConstraintMixTimeline; + 18 => { + let mut t_15: *mut spPathConstraintMixTimeline = timeline + as *mut spPathConstraintMixTimeline; _spDebug_printCurveTimeline(&mut (*t_15).super_0); + current_block_29 = 17233182392562552756; } - 18 => { + 27 => { let mut t_16: *mut spRGB2Timeline = timeline as *mut spRGB2Timeline; _spDebug_printCurveTimeline(&mut (*t_16).super_0); + current_block_29 = 17233182392562552756; } - 19 => { + 28 => { let mut t_17: *mut spRGBA2Timeline = timeline as *mut spRGBA2Timeline; _spDebug_printCurveTimeline(&mut (*t_17).super_0); + current_block_29 = 17233182392562552756; } - 20 => { + 29 => { let mut t_18: *mut spRGBATimeline = timeline as *mut spRGBATimeline; _spDebug_printCurveTimeline(&mut (*t_18).super_0); + current_block_29 = 17233182392562552756; } - 21 => { + 30 => { let mut t_19: *mut spRGBTimeline = timeline as *mut spRGBTimeline; _spDebug_printCurveTimeline(&mut (*t_19).super_0); + current_block_29 = 17233182392562552756; } - 22 => { - let mut t_20: *mut spTransformConstraintTimeline = - timeline as *mut spTransformConstraintTimeline; + 31 => { + let mut t_20: *mut spTransformConstraintTimeline = timeline + as *mut spTransformConstraintTimeline; _spDebug_printCurveTimeline(&mut (*t_20).super_0); + current_block_29 = 17233182392562552756; } - 23 => { - let mut t_21: *mut spDrawOrderTimeline = timeline as *mut spDrawOrderTimeline; + 32 => { + let mut t_21: *mut spDrawOrderTimeline = timeline + as *mut spDrawOrderTimeline; _spDebug_printTimelineBase(&mut (*t_21).super_0); + current_block_29 = 17233182392562552756; } - 24 => { + 33 => { let mut t_22: *mut spEventTimeline = timeline as *mut spEventTimeline; _spDebug_printTimelineBase(&mut (*t_22).super_0); + current_block_29 = 17233182392562552756; } 15 => { let mut t_23: *mut spSequenceTimeline = timeline as *mut spSequenceTimeline; _spDebug_printTimelineBase(&mut (*t_23).super_0); + current_block_29 = 3158310971426640666; + } + 16 => { + current_block_29 = 3158310971426640666; + } + _ => { + current_block_29 = 2747437779770811162; + } + } + match current_block_29 { + 3158310971426640666 => { + let mut t_24: *mut spInheritTimeline = timeline as *mut spInheritTimeline; + _spDebug_printTimelineBase(&mut (*t_24).super_0); + current_block_29 = 2747437779770811162; + } + _ => {} + } + match current_block_29 { + 2747437779770811162 => { + _spDebug_printTimelineBase(timeline); } _ => {} }; @@ -11535,7 +12902,8 @@ pub unsafe extern "C" fn spDebug_printBoneDatas( #[no_mangle] pub unsafe extern "C" fn spDebug_printBoneData(mut boneData: *mut spBoneData) { spine_printf!( - b"Bone data %s: %f, %f, %f, %f, %f, %f %f\n\0" as *const u8 as *const c_char, + b"Bone data %s: %f, %f, %f, %f, %f, %f %f\n\0" as *const u8 + as *const c_char, (*boneData).name, (*boneData).rotation as c_double, (*boneData).scaleX as c_double, @@ -11551,7 +12919,10 @@ pub unsafe extern "C" fn spDebug_printSkeleton(mut skeleton: *mut spSkeleton) { spDebug_printBones((*skeleton).bones, (*skeleton).bonesCount); } #[no_mangle] -pub unsafe extern "C" fn spDebug_printBones(mut bones: *mut *mut spBone, mut numBones: c_int) { +pub unsafe extern "C" fn spDebug_printBones( + mut bones: *mut *mut spBone, + mut numBones: c_int, +) { let mut i: c_int = 0; i = 0 as c_int; while i < numBones { @@ -11573,7 +12944,10 @@ pub unsafe extern "C" fn spDebug_printBone(mut bone: *mut spBone) { ); } #[no_mangle] -pub unsafe extern "C" fn spDebug_printFloats(mut values: *mut c_float, mut numFloats: c_int) { +pub unsafe extern "C" fn spDebug_printFloats( + mut values: *mut c_float, + mut numFloats: c_int, +) { let mut i: c_int = 0; spine_printf!(b"(%i) [\0" as *const u8 as *const c_char, numFloats); i = 0 as c_int; @@ -11595,11 +12969,10 @@ pub unsafe extern "C" fn spEvent_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 5642 as c_int, + 5872 as c_int, ) as *mut spEvent; - let ref mut fresh61 = *(&mut (*self_0).data as *mut *mut spEventData); - *fresh61 = data; - *(&mut (*self_0).time as *mut c_float) = time; + (*self_0).data = data; + (*self_0).time = time; return self_0; } #[no_mangle] @@ -11608,21 +12981,25 @@ pub unsafe extern "C" fn spEvent_dispose(mut self_0: *mut spEvent) { _spFree(self_0 as *mut c_void); } #[no_mangle] -pub unsafe extern "C" fn spEventData_create(mut name: *const c_char) -> *mut spEventData { +pub unsafe extern "C" fn spEventData_create( + mut name: *const c_char, +) -> *mut spEventData { let mut self_0: *mut spEventData = _spCalloc( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 5685 as c_int, + 5915 as c_int, ) as *mut spEventData; - let ref mut fresh62 = *(&mut (*self_0).name as *mut *mut c_char); - *fresh62 = _spMalloc( + (*self_0) + .name = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen(name)).wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 5686 as c_int, + 5916 as c_int, ) as *mut c_char; - spine_strcpy(*fresh62, name); + spine_strcpy((*self_0).name, name); return self_0; } #[no_mangle] @@ -11642,26 +13019,26 @@ pub unsafe extern "C" fn spIkConstraint_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 5733 as c_int, + 5963 as c_int, ) as *mut spIkConstraint; - let ref mut fresh63 = *(&mut (*self_0).data as *mut *mut spIkConstraintData); - *fresh63 = data; + (*self_0).data = data; (*self_0).bendDirection = (*data).bendDirection; (*self_0).compress = (*data).compress; (*self_0).stretch = (*data).stretch; (*self_0).mix = (*data).mix; (*self_0).softness = (*data).softness; (*self_0).bonesCount = (*(*self_0).data).bonesCount; - (*self_0).bones = _spMalloc( + (*self_0) + .bones = _spMalloc( (::core::mem::size_of::<*mut spBone>() as c_ulong) .wrapping_mul((*self_0).bonesCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 5742 as c_int, + 5972 as c_int, ) as *mut *mut spBone; i = 0 as c_int; while i < (*self_0).bonesCount { - let ref mut fresh64 = *((*self_0).bones).offset(i as isize); - *fresh64 = spSkeleton_findBone( + let ref mut fresh41 = *((*self_0).bones).offset(i as isize); + *fresh41 = spSkeleton_findBone( skeleton, (**((*(*self_0).data).bones).offset(i as isize)).name, ); @@ -11709,6 +13086,14 @@ pub unsafe extern "C" fn spIkConstraint_update(mut self_0: *mut spIkConstraint) }; } #[no_mangle] +pub unsafe extern "C" fn spIkConstraint_setToSetupPose(mut self_0: *mut spIkConstraint) { + (*self_0).bendDirection = (*(*self_0).data).bendDirection; + (*self_0).compress = (*(*self_0).data).compress; + (*self_0).stretch = (*(*self_0).data).stretch; + (*self_0).softness = (*(*self_0).data).softness; + (*self_0).mix = (*(*self_0).data).mix; +} +#[no_mangle] pub unsafe extern "C" fn spIkConstraint_apply1( mut bone: *mut spBone, mut targetX: c_float, @@ -11732,10 +13117,28 @@ pub unsafe extern "C" fn spIkConstraint_apply1( let mut sa: c_float = 0 as c_int as c_float; let mut sc: c_float = 0 as c_int as c_float; let mut current_block_16: u64; - match (*(*bone).data).transformMode as c_uint { + match (*(*bone).data).inherit as c_uint { 1 => { - tx = targetX - (*bone).worldX; - ty = targetY - (*bone).worldY; + tx = (targetX - (*bone).worldX) + * (if (*(*bone).skeleton).scaleX < 0 as c_int as c_float { + -1.0f32 + } else { + (if (*(*bone).skeleton).scaleX > 0 as c_int as c_float { + 1.0f32 + } else { + 0.0f32 + }) + }); + ty = (targetY - (*bone).worldY) + * (if (*(*bone).skeleton).scaleY < 0 as c_int as c_float { + -1.0f32 + } else { + (if (*(*bone).skeleton).scaleY > 0 as c_int as c_float { + 1.0f32 + } else { + 0.0f32 + }) + }); current_block_16 = 7149356873433890176; } 2 => { @@ -11743,29 +13146,32 @@ pub unsafe extern "C" fn spIkConstraint_apply1( -(pa * pd - pb * pc) } else { pa * pd - pb * pc - }) / (if 0.0001f32 > pa * pa + pc * pc { - 0.0001f32 - } else { - pa * pa + pc * pc - }); + }) + / (if 0.0001f32 > pa * pa + pc * pc { + 0.0001f32 + } else { + pa * pa + pc * pc + }); sa = pa / (*(*bone).skeleton).scaleX; sc = pc / (*(*bone).skeleton).scaleY; pb = -sc * s * (*(*bone).skeleton).scaleX; pd = sa * s * (*(*bone).skeleton).scaleY; - rotationIK += - spine_atan2f(sc, sa) * (180 as c_int as c_float / 3.1415926535897932385f32); - current_block_16 = 3604446901128867516; + rotationIK + += spine_atan2f(sc, sa) + * (180 as c_int as c_float / 3.1415926535897932385f32); + current_block_16 = 9103302926275267051; } _ => { - current_block_16 = 3604446901128867516; + current_block_16 = 9103302926275267051; } } match current_block_16 { - 3604446901128867516 => { + 9103302926275267051 => { let mut x: c_float = targetX - (*p).worldX; let mut y: c_float = targetY - (*p).worldY; let mut d: c_float = pa * pd - pb * pc; - if (if d < 0 as c_int as c_float { -d } else { d }) <= 0.0001f32 { + if (if d < 0 as c_int as c_float { -d } else { d }) <= 0.0001f32 + { tx = 0 as c_int as c_float; ty = 0 as c_int as c_float; } else { @@ -11775,7 +13181,9 @@ pub unsafe extern "C" fn spIkConstraint_apply1( } _ => {} } - rotationIK += spine_atan2f(ty, tx) * (180 as c_int as c_float / 3.1415926535897932385f32); + rotationIK + += spine_atan2f(ty, tx) + * (180 as c_int as c_float / 3.1415926535897932385f32); if (*bone).ascaleX < 0 as c_int as c_float { rotationIK += 180 as c_int as c_float; } @@ -11789,7 +13197,7 @@ pub unsafe extern "C" fn spIkConstraint_apply1( if compress != 0 || stretch != 0 { let mut b: c_float = 0.; let mut dd: c_float = 0.; - match (*(*bone).data).transformMode as c_uint { + match (*(*bone).data).inherit as c_uint { 3 | 4 => { tx = targetX - (*bone).worldX; ty = targetY - (*bone).worldY; @@ -11799,7 +13207,8 @@ pub unsafe extern "C" fn spIkConstraint_apply1( b = (*(*bone).data).length * sx; dd = spine_sqrtf(tx * tx + ty * ty); if compress != 0 && dd < b || stretch != 0 && dd > b && b > 0.0001f32 { - s = (dd / b - 1 as c_int as c_float) * alpha + 1 as c_int as c_float; + s = (dd / b - 1 as c_int as c_float) * alpha + + 1 as c_int as c_float; sx *= s; if uniform != 0 { sy *= s; @@ -11900,7 +13309,8 @@ pub unsafe extern "C" fn spIkConstraint_apply2( } r = psx - psy; cx = (*child).ax; - u = ((if r < 0 as c_int as c_float { -r } else { r }) <= 0.0001f32) as c_int; + u = ((if r < 0 as c_int as c_float { -r } else { r }) <= 0.0001f32) + as c_int; if u == 0 || stretch != 0 { cy = 0 as c_int as c_float; cwx = (*parent).a * cx + (*parent).worldX; @@ -11915,7 +13325,8 @@ pub unsafe extern "C" fn spIkConstraint_apply2( c = (*pp).c; d = (*pp).d; id = a * d - b * c; - id = if (if id < 0 as c_int as c_float { -id } else { id }) <= 0.0001f32 { + id = if (if id < 0 as c_int as c_float { -id } else { id }) <= 0.0001f32 + { 0 as c_int as c_float } else { 1 as c_int as c_float / id @@ -11928,7 +13339,13 @@ pub unsafe extern "C" fn spIkConstraint_apply2( l2 = (*(*child).data).length * csx; if (l1 as c_double) < 0.0001f64 { spIkConstraint_apply1( - parent, targetX, targetY, 0 as c_int, stretch, 0 as c_int, alpha, + parent, + targetX, + targetY, + 0 as c_int, + stretch, + 0 as c_int, + alpha, ); spBone_updateWorldTransformWith( child, @@ -11952,7 +13369,9 @@ pub unsafe extern "C" fn spIkConstraint_apply2( td = spine_sqrtf(dd); sd = td - l1 - l2 * psx + softness; if sd > 0 as c_int as c_float { - p = (if (1 as c_int as c_float) < sd / (softness * 2 as c_int as c_float) { + p = (if (1 as c_int as c_float) + < sd / (softness * 2 as c_int as c_float) + { 1 as c_int as c_float } else { sd / (softness * 2 as c_int as c_float) @@ -11966,7 +13385,8 @@ pub unsafe extern "C" fn spIkConstraint_apply2( if u != 0 { let mut cosine: c_float = 0.; l2 *= psx; - cosine = (dd - l1 * l1 - l2 * l2) / (2 as c_int as c_float * l1 * l2); + cosine = (dd - l1 * l1 - l2 * l2) + / (2 as c_int as c_float * l1 * l2); if cosine < -(1 as c_int) as c_float { cosine = -(1 as c_int) as c_float; a2 = 3.1415926535897932385f32 * bendDir as c_float; @@ -11974,8 +13394,8 @@ pub unsafe extern "C" fn spIkConstraint_apply2( cosine = 1 as c_int as c_float; a2 = 0 as c_int as c_float; if stretch != 0 { - a = (spine_sqrtf(dd) / (l1 + l2) - 1 as c_int as c_float) * alpha - + 1 as c_int as c_float; + a = (spine_sqrtf(dd) / (l1 + l2) - 1 as c_int as c_float) + * alpha + 1 as c_int as c_float; sx *= a; if uniform != 0 { sy *= a; @@ -11985,7 +13405,7 @@ pub unsafe extern "C" fn spIkConstraint_apply2( a2 = spine_acosf(cosine) * bendDir as c_float; } a = l1 + l2 * cosine; - b = l2 * spine_sinf(a2); + b = l2 * sinf(a2); a1 = spine_atan2f(ty * a - tx * b, tx * a + ty * b); } else { a = psx * l2; @@ -12015,19 +13435,20 @@ pub unsafe extern "C" fn spIkConstraint_apply2( } else { r1 }; - if r * r <= dd { - y = spine_sqrtf(dd - r * r) * bendDir as c_float; + y = dd - r * r; + if y > 0 as c_int as c_float { + y = spine_sqrtf(y) * bendDir as c_float; a1 = ta - spine_atan2f(y, r); a2 = spine_atan2f(y / psy, (r - l1) / psx); - current_block = 4934696218949787740; + current_block = 8807035328252033190; } else { - current_block = 1352918242886884122; + current_block = 6033931424626438518; } } else { - current_block = 1352918242886884122; + current_block = 6033931424626438518; } match current_block { - 4934696218949787740 => {} + 8807035328252033190 => {} _ => { let mut minAngle: c_float = 3.1415926535897932385f32; let mut minX: c_float = l1 - a; @@ -12038,10 +13459,12 @@ pub unsafe extern "C" fn spIkConstraint_apply2( let mut maxDist: c_float = maxX * maxX; let mut maxY: c_float = 0 as c_int as c_float; c0 = -a * l1 / (aa - bb); - if c0 >= -(1 as c_int) as c_float && c0 <= 1 as c_int as c_float { + if c0 >= -(1 as c_int) as c_float + && c0 <= 1 as c_int as c_float + { c0 = spine_acosf(c0); x = a * spine_cosf(c0) + l1; - y = b * spine_sinf(c0); + y = b * sinf(c0); d = x * x + y * y; if d < minDist { minAngle = c0; @@ -12068,8 +13491,8 @@ pub unsafe extern "C" fn spIkConstraint_apply2( } let mut os: c_float = spine_atan2f(cy, cx) * s2 as c_float; let mut rotation: c_float = (*parent).arotation; - a1 = - (a1 - os) * (180 as c_int as c_float / 3.1415926535897932385f32) + o1 as c_float - rotation; + a1 = (a1 - os) * (180 as c_int as c_float / 3.1415926535897932385f32) + + o1 as c_float - rotation; if a1 > 180 as c_int as c_float { a1 -= 360 as c_int as c_float; } else if a1 < -(180 as c_int) as c_float { @@ -12086,10 +13509,8 @@ pub unsafe extern "C" fn spIkConstraint_apply2( 0 as c_int as c_float, ); rotation = (*child).arotation; - a2 = ((a2 + os) * (180 as c_int as c_float / 3.1415926535897932385f32) - (*child).ashearX) - * s2 as c_float - + o2 as c_float - - rotation; + a2 = ((a2 + os) * (180 as c_int as c_float / 3.1415926535897932385f32) + - (*child).ashearX) * s2 as c_float + o2 as c_float - rotation; if a2 > 180 as c_int as c_float { a2 -= 360 as c_int as c_float; } else if a2 < -(180 as c_int) as c_float { @@ -12114,43 +13535,50 @@ pub unsafe extern "C" fn spIkConstraintData_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 6032 as c_int, + 6271 as c_int, ) as *mut spIkConstraintData; - let ref mut fresh65 = *(&mut (*self_0).name as *mut *mut c_char); - *fresh65 = _spMalloc( + (*self_0) + .name = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen(name)).wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 6033 as c_int, + 6272 as c_int, ) as *mut c_char; - spine_strcpy(*fresh65, name); - (*self_0).bendDirection = 1 as c_int; + spine_strcpy((*self_0).name, name); + (*self_0).bendDirection = 0 as c_int; (*self_0).compress = 0 as c_int; (*self_0).stretch = 0 as c_int; (*self_0).uniform = 0 as c_int; - (*self_0).mix = 1 as c_int as c_float; + (*self_0).mix = 0 as c_int as c_float; return self_0; } #[no_mangle] -pub unsafe extern "C" fn spIkConstraintData_dispose(mut self_0: *mut spIkConstraintData) { +pub unsafe extern "C" fn spIkConstraintData_dispose( + mut self_0: *mut spIkConstraintData, +) { _spFree((*self_0).name as *mut c_void); _spFree((*self_0).bones as *mut c_void); _spFree(self_0 as *mut c_void); } -static mut ep: *const c_char = std::ptr::null(); +static mut ep: *const c_char = 0 as *const c_char; #[no_mangle] pub unsafe extern "C" fn Json_getError() -> *const c_char { return ep; } -unsafe extern "C" fn Json_strcasecmp(mut s1: *const c_char, mut s2: *const c_char) -> c_int { +unsafe extern "C" fn Json_strcasecmp( + mut s1: *const c_char, + mut s2: *const c_char, +) -> c_int { if !s1.is_null() && !s2.is_null() { - return spine_strcasecmp(s1, s2); + return spine_strcasecmp(s1, s2) } else if s1 < s2 { - return -(1 as c_int); + return -(1 as c_int) } else if s1 == s2 { - return 0 as c_int; + return 0 as c_int } else { - return 1 as c_int; + return 1 as c_int }; } unsafe extern "C" fn Json_new() -> *mut Json { @@ -12158,12 +13586,12 @@ unsafe extern "C" fn Json_new() -> *mut Json { 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 6122 as c_int, + 6361 as c_int, ) as *mut Json; } #[no_mangle] pub unsafe extern "C" fn Json_dispose(mut c: *mut Json) { - let mut next: *mut Json = std::ptr::null_mut(); + let mut next: *mut Json = 0 as *mut Json; while !c.is_null() { next = (*c).next; if !((*c).child).is_null() { @@ -12179,7 +13607,10 @@ pub unsafe extern "C" fn Json_dispose(mut c: *mut Json) { c = next; } } -unsafe extern "C" fn parse_number(mut item: *mut Json, mut num: *const c_char) -> *const c_char { +unsafe extern "C" fn parse_number( + mut item: *mut Json, + mut num: *const c_char, +) -> *const c_char { let mut result: c_double = 0.0f64; let mut negative: c_int = 0 as c_int; let mut ptr: *mut c_char = num as *mut c_char; @@ -12196,7 +13627,8 @@ unsafe extern "C" fn parse_number(mut item: *mut Json, mut num: *const c_char) - let mut n: c_int = 0 as c_int; ptr = ptr.offset(1); while *ptr as c_int >= '0' as i32 && *ptr as c_int <= '9' as i32 { - fraction = fraction * 10.0f64 + (*ptr as c_int - '0' as i32) as c_double; + fraction = fraction * 10.0f64 + + (*ptr as c_int - '0' as i32) as c_double; ptr = ptr.offset(1); n += 1; } @@ -12208,7 +13640,6 @@ unsafe extern "C" fn parse_number(mut item: *mut Json, mut num: *const c_char) - if *ptr as c_int == 'e' as i32 || *ptr as c_int == 'E' as i32 { let mut exponent: c_double = 0 as c_int as c_double; let mut expNegative: c_int = 0 as c_int; - let mut _n_0: c_int = 0 as c_int; ptr = ptr.offset(1); if *ptr as c_int == '-' as i32 { expNegative = -(1 as c_int); @@ -12217,9 +13648,9 @@ unsafe extern "C" fn parse_number(mut item: *mut Json, mut num: *const c_char) - ptr = ptr.offset(1); } while *ptr as c_int >= '0' as i32 && *ptr as c_int <= '9' as i32 { - exponent = exponent * 10.0f64 + (*ptr as c_int - '0' as i32) as c_double; + exponent = exponent * 10.0f64 + + (*ptr as c_int - '0' as i32) as c_double; ptr = ptr.offset(1); - _n_0 += 1; } if expNegative != 0 { result = result / spine_pow(10 as c_int as c_double, exponent); @@ -12234,7 +13665,7 @@ unsafe extern "C" fn parse_number(mut item: *mut Json, mut num: *const c_char) - return ptr; } else { ep = num; - return std::ptr::null(); + return 0 as *const c_char; }; } static mut firstByteMark: [c_uchar; 7] = [ @@ -12246,72 +13677,78 @@ static mut firstByteMark: [c_uchar; 7] = [ 0xf8 as c_int as c_uchar, 0xfc as c_int as c_uchar, ]; -unsafe extern "C" fn parse_string(mut item: *mut Json, mut str: *const c_char) -> *const c_char { +unsafe extern "C" fn parse_string( + mut item: *mut Json, + mut str: *const c_char, +) -> *const c_char { let mut ptr: *const c_char = str.offset(1 as c_int as isize); - let mut ptr2: *mut c_char = std::ptr::null_mut(); - let mut out: *mut c_char = std::ptr::null_mut(); + let mut ptr2: *mut c_char = 0 as *mut c_char; + let mut out: *mut c_char = 0 as *mut c_char; let mut len: c_int = 0 as c_int; let mut uc: c_uint = 0; let mut uc2: c_uint = 0; if *str as c_int != '"' as i32 { ep = str; - return std::ptr::null(); + return 0 as *const c_char; } - while *ptr as c_int != '"' as i32 && *ptr as c_int != 0 && { - len += 1; - len != 0 - } { - let fresh66 = ptr; + while *ptr as c_int != '"' as i32 && *ptr as c_int != 0 + && { + len += 1; + len != 0 + } + { + let fresh42 = ptr; ptr = ptr.offset(1); - if *fresh66 as c_int == '\\' as i32 { + if *fresh42 as c_int == '\\' as i32 { ptr = ptr.offset(1); } } out = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul((len + 1 as c_int) as c_ulong), + (::core::mem::size_of::() as c_ulong) + .wrapping_mul((len + 1 as c_int) as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 6223 as c_int, + 6460 as c_int, ) as *mut c_char; if out.is_null() { - return std::ptr::null(); + return 0 as *const c_char; } ptr = str.offset(1 as c_int as isize); ptr2 = out; while *ptr as c_int != '"' as i32 && *ptr as c_int != 0 { if *ptr as c_int != '\\' as i32 { - let fresh67 = ptr; + let fresh43 = ptr; ptr = ptr.offset(1); - let fresh68 = ptr2; + let fresh44 = ptr2; ptr2 = ptr2.offset(1); - *fresh68 = *fresh67; + *fresh44 = *fresh43; } else { ptr = ptr.offset(1); let mut current_block_41: u64; match *ptr as c_int { 98 => { - let fresh69 = ptr2; + let fresh45 = ptr2; ptr2 = ptr2.offset(1); - *fresh69 = '\u{8}' as i32 as c_char; + *fresh45 = '\u{8}' as i32 as c_char; } 102 => { - let fresh70 = ptr2; + let fresh46 = ptr2; ptr2 = ptr2.offset(1); - *fresh70 = '\u{c}' as i32 as c_char; + *fresh46 = '\u{c}' as i32 as c_char; } 110 => { - let fresh71 = ptr2; + let fresh47 = ptr2; ptr2 = ptr2.offset(1); - *fresh71 = '\n' as i32 as c_char; + *fresh47 = '\n' as i32 as c_char; } 114 => { - let fresh72 = ptr2; + let fresh48 = ptr2; ptr2 = ptr2.offset(1); - *fresh72 = '\r' as i32 as c_char; + *fresh48 = '\r' as i32 as c_char; } 116 => { - let fresh73 = ptr2; + let fresh49 = ptr2; ptr2 = ptr2.offset(1); - *fresh73 = '\t' as i32 as c_char; + *fresh49 = '\t' as i32 as c_char; } 117 => { spine_sscanf!( @@ -12320,12 +13757,17 @@ unsafe extern "C" fn parse_string(mut item: *mut Json, mut str: *const c_char) - &mut uc as *mut c_uint, ); ptr = ptr.offset(4 as c_int as isize); - if !(uc >= 0xdc00 as c_int as c_uint && uc <= 0xdfff as c_int as c_uint + if !(uc >= 0xdc00 as c_int as c_uint + && uc <= 0xdfff as c_int as c_uint || uc == 0 as c_int as c_uint) { - if uc >= 0xd800 as c_int as c_uint && uc <= 0xdbff as c_int as c_uint { - if *ptr.offset(1 as c_int as isize) as c_int != '\\' as i32 - || *ptr.offset(2 as c_int as isize) as c_int != 'u' as i32 + if uc >= 0xd800 as c_int as c_uint + && uc <= 0xdbff as c_int as c_uint + { + if *ptr.offset(1 as c_int as isize) as c_int + != '\\' as i32 + || *ptr.offset(2 as c_int as isize) as c_int + != 'u' as i32 { current_block_41 = 9441801433784995173; } else { @@ -12340,10 +13782,12 @@ unsafe extern "C" fn parse_string(mut item: *mut Json, mut str: *const c_char) - { current_block_41 = 9441801433784995173; } else { - uc = (0x10000 as c_int as c_uint).wrapping_add( - (uc & 0x3ff as c_int as c_uint) << 10 as c_int - | uc2 & 0x3ff as c_int as c_uint, - ); + uc = (0x10000 as c_int as c_uint) + .wrapping_add( + (uc & 0x3ff as c_int as c_uint) + << 10 as c_int + | uc2 & 0x3ff as c_int as c_uint, + ); current_block_41 = 1608152415753874203; } } @@ -12367,51 +13811,48 @@ unsafe extern "C" fn parse_string(mut item: *mut Json, mut str: *const c_char) - 4 => { ptr2 = ptr2.offset(-1); *ptr2 = ((uc | 0x80 as c_int as c_uint) - & 0xbf as c_int as c_uint) - as c_char; + & 0xbf as c_int as c_uint) as c_char; uc >>= 6 as c_int; - current_block_38 = 8434578823904746288; + current_block_38 = 2481446828879050954; } 3 => { - current_block_38 = 8434578823904746288; + current_block_38 = 2481446828879050954; } 2 => { - current_block_38 = 6075955283988907118; + current_block_38 = 12070832161501940938; } 1 => { - current_block_38 = 14880373858123271436; + current_block_38 = 11419346003544691760; } _ => { current_block_38 = 4567019141635105728; } } match current_block_38 { - 8434578823904746288 => { + 2481446828879050954 => { ptr2 = ptr2.offset(-1); *ptr2 = ((uc | 0x80 as c_int as c_uint) - & 0xbf as c_int as c_uint) - as c_char; + & 0xbf as c_int as c_uint) as c_char; uc >>= 6 as c_int; - current_block_38 = 6075955283988907118; + current_block_38 = 12070832161501940938; } _ => {} } match current_block_38 { - 6075955283988907118 => { + 12070832161501940938 => { ptr2 = ptr2.offset(-1); *ptr2 = ((uc | 0x80 as c_int as c_uint) - & 0xbf as c_int as c_uint) - as c_char; + & 0xbf as c_int as c_uint) as c_char; uc >>= 6 as c_int; - current_block_38 = 14880373858123271436; + current_block_38 = 11419346003544691760; } _ => {} } match current_block_38 { - 14880373858123271436 => { + 11419346003544691760 => { ptr2 = ptr2.offset(-1); - *ptr2 = - (uc | firstByteMark[len as usize] as c_uint) as c_char; + *ptr2 = (uc | firstByteMark[len as usize] as c_uint) + as c_char; } _ => {} } @@ -12421,9 +13862,9 @@ unsafe extern "C" fn parse_string(mut item: *mut Json, mut str: *const c_char) - } } _ => { - let fresh74 = ptr2; + let fresh50 = ptr2; ptr2 = ptr2.offset(1); - *fresh74 = *ptr; + *fresh50 = *ptr; } } ptr = ptr.offset(1); @@ -12439,32 +13880,37 @@ unsafe extern "C" fn parse_string(mut item: *mut Json, mut str: *const c_char) - } unsafe extern "C" fn skip(mut in_0: *const c_char) -> *const c_char { if in_0.is_null() { - return std::ptr::null(); + return 0 as *const c_char; } - while *in_0 as c_int != 0 && *in_0 as c_uchar as c_int <= 32 as c_int { + while *in_0 as c_int != 0 + && *in_0 as c_uchar as c_int <= 32 as c_int + { in_0 = in_0.offset(1); } return in_0; } #[no_mangle] pub unsafe extern "C" fn Json_create(mut value: *const c_char) -> *mut Json { - let mut c: *mut Json = std::ptr::null_mut(); - ep = std::ptr::null(); + let mut c: *mut Json = 0 as *mut Json; + ep = 0 as *const c_char; if value.is_null() { - return std::ptr::null_mut(); + return 0 as *mut Json; } c = Json_new(); if c.is_null() { - return std::ptr::null_mut(); + return 0 as *mut Json; } value = parse_value(c, skip(value)); if value.is_null() { Json_dispose(c); - return std::ptr::null_mut(); + return 0 as *mut Json; } return c; } -unsafe extern "C" fn parse_value(mut item: *mut Json, mut value: *const c_char) -> *const c_char { +unsafe extern "C" fn parse_value( + mut item: *mut Json, + mut value: *const c_char, +) -> *const c_char { match *value as c_int { 110 => { if spine_strncmp( @@ -12509,10 +13955,13 @@ unsafe extern "C" fn parse_value(mut item: *mut Json, mut value: *const c_char) _ => {} } ep = value; - return std::ptr::null(); + return 0 as *const c_char; } -unsafe extern "C" fn parse_array(mut item: *mut Json, mut value: *const c_char) -> *const c_char { - let mut child: *mut Json = std::ptr::null_mut(); +unsafe extern "C" fn parse_array( + mut item: *mut Json, + mut value: *const c_char, +) -> *const c_char { + let mut child: *mut Json = 0 as *mut Json; (*item).type_0 = 5 as c_int; value = skip(value.offset(1 as c_int as isize)); if *value as c_int == ']' as i32 { @@ -12521,23 +13970,23 @@ unsafe extern "C" fn parse_array(mut item: *mut Json, mut value: *const c_char) child = Json_new(); (*item).child = child; if ((*item).child).is_null() { - return std::ptr::null(); + return 0 as *const c_char; } value = skip(parse_value(child, skip(value))); if value.is_null() { - return std::ptr::null(); + return 0 as *const c_char; } (*item).size = 1 as c_int; while *value as c_int == ',' as i32 { let mut new_item: *mut Json = Json_new(); if new_item.is_null() { - return std::ptr::null(); + return 0 as *const c_char; } (*child).next = new_item; child = new_item; value = skip(parse_value(child, skip(value.offset(1 as c_int as isize)))); if value.is_null() { - return std::ptr::null(); + return 0 as *const c_char; } (*item).size += 1; } @@ -12545,10 +13994,13 @@ unsafe extern "C" fn parse_array(mut item: *mut Json, mut value: *const c_char) return value.offset(1 as c_int as isize); } ep = value; - return std::ptr::null(); + return 0 as *const c_char; } -unsafe extern "C" fn parse_object(mut item: *mut Json, mut value: *const c_char) -> *const c_char { - let mut child: *mut Json = std::ptr::null_mut(); +unsafe extern "C" fn parse_object( + mut item: *mut Json, + mut value: *const c_char, +) -> *const c_char { + let mut child: *mut Json = 0 as *mut Json; (*item).type_0 = 6 as c_int; value = skip(value.offset(1 as c_int as isize)); if *value as c_int == '}' as i32 { @@ -12557,43 +14009,43 @@ unsafe extern "C" fn parse_object(mut item: *mut Json, mut value: *const c_char) child = Json_new(); (*item).child = child; if ((*item).child).is_null() { - return std::ptr::null(); + return 0 as *const c_char; } value = skip(parse_string(child, skip(value))); if value.is_null() { - return std::ptr::null(); + return 0 as *const c_char; } (*child).name = (*child).valueString; - (*child).valueString = std::ptr::null(); + (*child).valueString = 0 as *const c_char; if *value as c_int != ':' as i32 { ep = value; - return std::ptr::null(); + return 0 as *const c_char; } value = skip(parse_value(child, skip(value.offset(1 as c_int as isize)))); if value.is_null() { - return std::ptr::null(); + return 0 as *const c_char; } (*item).size = 1 as c_int; while *value as c_int == ',' as i32 { let mut new_item: *mut Json = Json_new(); if new_item.is_null() { - return std::ptr::null(); + return 0 as *const c_char; } (*child).next = new_item; child = new_item; value = skip(parse_string(child, skip(value.offset(1 as c_int as isize)))); if value.is_null() { - return std::ptr::null(); + return 0 as *const c_char; } (*child).name = (*child).valueString; - (*child).valueString = std::ptr::null(); + (*child).valueString = 0 as *const c_char; if *value as c_int != ':' as i32 { ep = value; - return std::ptr::null(); + return 0 as *const c_char; } value = skip(parse_value(child, skip(value.offset(1 as c_int as isize)))); if value.is_null() { - return std::ptr::null(); + return 0 as *const c_char; } (*item).size += 1; } @@ -12601,7 +14053,7 @@ unsafe extern "C" fn parse_object(mut item: *mut Json, mut value: *const c_char) return value.offset(1 as c_int as isize); } ep = value; - return std::ptr::null(); + return 0 as *const c_char; } #[no_mangle] pub unsafe extern "C" fn Json_getItem( @@ -12645,11 +14097,7 @@ pub unsafe extern "C" fn Json_getFloat( mut defaultValue: c_float, ) -> c_float { value = Json_getItem(value, name); - return if !value.is_null() { - (*value).valueFloat - } else { - defaultValue - }; + return if !value.is_null() { (*value).valueFloat } else { defaultValue }; } #[no_mangle] pub unsafe extern "C" fn Json_getInt( @@ -12658,11 +14106,7 @@ pub unsafe extern "C" fn Json_getInt( mut defaultValue: c_int, ) -> c_int { value = Json_getItem(value, name); - return if !value.is_null() { - (*value).valueInt - } else { - defaultValue - }; + return if !value.is_null() { (*value).valueInt } else { defaultValue }; } #[no_mangle] pub unsafe extern "C" fn _spMeshAttachment_dispose(mut attachment: *mut spAttachment) { @@ -12686,39 +14130,44 @@ pub unsafe extern "C" fn _spMeshAttachment_dispose(mut attachment: *mut spAttach pub unsafe extern "C" fn _spMeshAttachment_copy( mut attachment: *mut spAttachment, ) -> *mut spAttachment { - let mut copy: *mut spMeshAttachment = std::ptr::null_mut(); + let mut copy: *mut spMeshAttachment = 0 as *mut spMeshAttachment; let mut self_0: *mut spMeshAttachment = attachment as *mut spMeshAttachment; if !((*self_0).parentMesh).is_null() { return &mut (*(spMeshAttachment_newLinkedMesh - as unsafe extern "C" fn(*mut spMeshAttachment) -> *mut spMeshAttachment)( - self_0 - )) - .super_0 - .super_0; + as unsafe extern "C" fn( + *mut spMeshAttachment, + ) -> *mut spMeshAttachment)(self_0)) + .super_0 + .super_0; } copy = spMeshAttachment_create((*attachment).name); (*copy).rendererObject = (*self_0).rendererObject; (*copy).region = (*self_0).region; - (*copy).sequence = if !((*self_0).sequence).is_null() { + (*copy) + .sequence = if !((*self_0).sequence).is_null() { spSequence_copy((*self_0).sequence) } else { - std::ptr::null_mut() + 0 as *mut spSequence }; - let ref mut fresh75 = *(&mut (*copy).path as *mut *const c_char as *mut *mut c_char); - *fresh75 = _spMalloc( + (*copy) + .path = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen((*self_0).path)).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen((*self_0).path)) + .wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 6578 as c_int, + 6815 as c_int, ) as *mut c_char; - spine_strcpy(*fresh75, (*self_0).path); + spine_strcpy((*copy).path, (*self_0).path); spColor_setFromColor(&mut (*copy).color, &mut (*self_0).color); spVertexAttachment_copyTo(&mut (*self_0).super_0, &mut (*copy).super_0); - (*copy).regionUVs = _spMalloc( + (*copy) + .regionUVs = _spMalloc( (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).super_0.worldVerticesLength as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 6582 as c_int, + 6819 as c_int, ) as *mut c_float; spine_memcpy( (*copy).regionUVs as *mut c_void, @@ -12726,11 +14175,12 @@ pub unsafe extern "C" fn _spMeshAttachment_copy( ((*self_0).super_0.worldVerticesLength as c_ulong) .wrapping_mul(::core::mem::size_of::() as c_ulong), ); - (*copy).uvs = _spMalloc( + (*copy) + .uvs = _spMalloc( (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).super_0.worldVerticesLength as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 6584 as c_int, + 6821 as c_int, ) as *mut c_float; spine_memcpy( (*copy).uvs as *mut c_void, @@ -12739,11 +14189,12 @@ pub unsafe extern "C" fn _spMeshAttachment_copy( .wrapping_mul(::core::mem::size_of::() as c_ulong), ); (*copy).trianglesCount = (*self_0).trianglesCount; - (*copy).triangles = _spMalloc( + (*copy) + .triangles = _spMalloc( (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).trianglesCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 6587 as c_int, + 6824 as c_int, ) as *mut c_ushort; spine_memcpy( (*copy).triangles as *mut c_void, @@ -12754,12 +14205,13 @@ pub unsafe extern "C" fn _spMeshAttachment_copy( (*copy).hullLength = (*self_0).hullLength; if (*self_0).edgesCount > 0 as c_int { (*copy).edgesCount = (*self_0).edgesCount; - (*copy).edges = _spMalloc( - (::core::mem::size_of::() as c_ulong) + (*copy) + .edges = _spMalloc( + (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).edgesCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 6592 as c_int, - ) as *mut c_int; + 6829 as c_int, + ) as *mut c_ushort; spine_memcpy( (*copy).edges as *mut c_void, (*self_0).edges as *const c_void, @@ -12775,26 +14227,27 @@ pub unsafe extern "C" fn _spMeshAttachment_copy( pub unsafe extern "C" fn spMeshAttachment_newLinkedMesh( mut self_0: *mut spMeshAttachment, ) -> *mut spMeshAttachment { - let mut copy: *mut spMeshAttachment = spMeshAttachment_create((*self_0).super_0.super_0.name); + let mut copy: *mut spMeshAttachment = spMeshAttachment_create( + (*self_0).super_0.super_0.name, + ); (*copy).rendererObject = (*self_0).rendererObject; (*copy).region = (*self_0).region; - let ref mut fresh76 = *(&mut (*copy).path as *mut *const c_char as *mut *mut c_char); - *fresh76 = _spMalloc( + (*copy) + .path = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen((*self_0).path)).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen((*self_0).path)) + .wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 6606 as c_int, + 6843 as c_int, ) as *mut c_char; - spine_strcpy(*fresh76, (*self_0).path); + spine_strcpy((*copy).path, (*self_0).path); spColor_setFromColor(&mut (*copy).color, &mut (*self_0).color); (*copy).super_0.timelineAttachment = (*self_0).super_0.timelineAttachment; spMeshAttachment_setParentMesh( copy, - if !((*self_0).parentMesh).is_null() { - (*self_0).parentMesh - } else { - self_0 - }, + if !((*self_0).parentMesh).is_null() { (*self_0).parentMesh } else { self_0 }, ); if !((*copy).region).is_null() { spMeshAttachment_updateRegion(copy); @@ -12802,12 +14255,14 @@ pub unsafe extern "C" fn spMeshAttachment_newLinkedMesh( return copy; } #[no_mangle] -pub unsafe extern "C" fn spMeshAttachment_create(mut name: *const c_char) -> *mut spMeshAttachment { +pub unsafe extern "C" fn spMeshAttachment_create( + mut name: *const c_char, +) -> *mut spMeshAttachment { let mut self_0: *mut spMeshAttachment = _spCalloc( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 6615 as c_int, + 6852 as c_int, ) as *mut spMeshAttachment; _spVertexAttachment_init(&mut (*self_0).super_0); spColor_setFromFloats( @@ -12823,26 +14278,31 @@ pub unsafe extern "C" fn spMeshAttachment_create(mut name: *const c_char) -> *mu SP_ATTACHMENT_MESH, Some(_spMeshAttachment_dispose as unsafe extern "C" fn(*mut spAttachment) -> ()), Some( - _spMeshAttachment_copy as unsafe extern "C" fn(*mut spAttachment) -> *mut spAttachment, + _spMeshAttachment_copy + as unsafe extern "C" fn(*mut spAttachment) -> *mut spAttachment, ), ); return self_0; } #[no_mangle] -pub unsafe extern "C" fn spMeshAttachment_updateRegion(mut self_0: *mut spMeshAttachment) { +pub unsafe extern "C" fn spMeshAttachment_updateRegion( + mut self_0: *mut spMeshAttachment, +) { let mut i: c_int = 0; let mut n: c_int = 0; - let mut uvs: *mut c_float = std::ptr::null_mut(); + let mut uvs: *mut c_float = 0 as *mut c_float; let mut u: c_float = 0.; let mut v: c_float = 0.; let mut width: c_float = 0.; let mut height: c_float = 0.; let mut verticesLength: c_int = (*self_0).super_0.worldVerticesLength; _spFree((*self_0).uvs as *mut c_void); - (*self_0).uvs = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul(verticesLength as c_ulong), + (*self_0) + .uvs = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul(verticesLength as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 6628 as c_int, + 6865 as c_int, ) as *mut c_float; uvs = (*self_0).uvs; n = verticesLength; @@ -12850,47 +14310,63 @@ pub unsafe extern "C" fn spMeshAttachment_updateRegion(mut self_0: *mut spMeshAt v = (*(*self_0).region).v; match (*(*self_0).region).degrees { 90 => { - let mut textureWidth: c_float = (*(*self_0).region).height as c_float - / ((*(*self_0).region).u2 - (*(*self_0).region).u); - let mut textureHeight: c_float = (*(*self_0).region).width as c_float - / ((*(*self_0).region).v2 - (*(*self_0).region).v); - u -= ((*(*self_0).region).originalHeight as c_float - - (*(*self_0).region).offsetY - - (*(*self_0).region).height as c_float) - / textureWidth; - v -= ((*(*self_0).region).originalWidth as c_float - - (*(*self_0).region).offsetX - - (*(*self_0).region).width as c_float) - / textureHeight; + let mut textureWidth: c_float = (*(*self_0).region).height + as c_float / ((*(*self_0).region).u2 - (*(*self_0).region).u); + let mut textureHeight: c_float = (*(*self_0).region).width + as c_float / ((*(*self_0).region).v2 - (*(*self_0).region).v); + u + -= ((*(*self_0).region).originalHeight as c_float + - (*(*self_0).region).offsetY + - (*(*self_0).region).height as c_float) / textureWidth; + v + -= ((*(*self_0).region).originalWidth as c_float + - (*(*self_0).region).offsetX + - (*(*self_0).region).width as c_float) / textureHeight; width = (*(*self_0).region).originalHeight as c_float / textureWidth; height = (*(*self_0).region).originalWidth as c_float / textureHeight; i = 0 as c_int; while i < n { - *uvs.offset(i as isize) = - u + *((*self_0).regionUVs).offset((i + 1 as c_int) as isize) * width; - *uvs.offset((i + 1 as c_int) as isize) = v - + (1 as c_int as c_float - *((*self_0).regionUVs).offset(i as isize)) * height; + *uvs + .offset( + i as isize, + ) = u + + *((*self_0).regionUVs).offset((i + 1 as c_int) as isize) + * width; + *uvs + .offset( + (i + 1 as c_int) as isize, + ) = v + + (1 as c_int as c_float + - *((*self_0).regionUVs).offset(i as isize)) * height; i += 2 as c_int; } return; } 180 => { - let mut textureWidth_0: c_float = (*(*self_0).region).width as c_float - / ((*(*self_0).region).u2 - (*(*self_0).region).u); - let mut textureHeight_0: c_float = (*(*self_0).region).height as c_float - / ((*(*self_0).region).v2 - (*(*self_0).region).v); - u -= ((*(*self_0).region).originalWidth as c_float - - (*(*self_0).region).offsetX - - (*(*self_0).region).width as c_float) - / textureWidth_0; + let mut textureWidth_0: c_float = (*(*self_0).region).width + as c_float / ((*(*self_0).region).u2 - (*(*self_0).region).u); + let mut textureHeight_0: c_float = (*(*self_0).region).height + as c_float / ((*(*self_0).region).v2 - (*(*self_0).region).v); + u + -= ((*(*self_0).region).originalWidth as c_float + - (*(*self_0).region).offsetX + - (*(*self_0).region).width as c_float) / textureWidth_0; v -= (*(*self_0).region).offsetY / textureHeight_0; width = (*(*self_0).region).originalWidth as c_float / textureWidth_0; - height = (*(*self_0).region).originalHeight as c_float / textureHeight_0; + height = (*(*self_0).region).originalHeight as c_float + / textureHeight_0; i = 0 as c_int; while i < n { - *uvs.offset(i as isize) = - u + (1 as c_int as c_float - *((*self_0).regionUVs).offset(i as isize)) * width; - *uvs.offset((i + 1 as c_int) as isize) = v + *uvs + .offset( + i as isize, + ) = u + + (1 as c_int as c_float + - *((*self_0).regionUVs).offset(i as isize)) * width; + *uvs + .offset( + (i + 1 as c_int) as isize, + ) = v + (1 as c_int as c_float - *((*self_0).regionUVs).offset((i + 1 as c_int) as isize)) * height; @@ -12899,43 +14375,57 @@ pub unsafe extern "C" fn spMeshAttachment_updateRegion(mut self_0: *mut spMeshAt return; } 270 => { - let mut textureHeight_1: c_float = (*(*self_0).region).height as c_float - / ((*(*self_0).region).v2 - (*(*self_0).region).v); - let mut textureWidth_1: c_float = (*(*self_0).region).width as c_float - / ((*(*self_0).region).u2 - (*(*self_0).region).u); + let mut textureHeight_1: c_float = (*(*self_0).region).height + as c_float / ((*(*self_0).region).v2 - (*(*self_0).region).v); + let mut textureWidth_1: c_float = (*(*self_0).region).width + as c_float / ((*(*self_0).region).u2 - (*(*self_0).region).u); u -= (*(*self_0).region).offsetY / textureWidth_1; v -= (*(*self_0).region).offsetX / textureHeight_1; width = (*(*self_0).region).originalHeight as c_float / textureWidth_1; - height = (*(*self_0).region).originalWidth as c_float / textureHeight_1; + height = (*(*self_0).region).originalWidth as c_float + / textureHeight_1; i = 0 as c_int; while i < n { - *uvs.offset(i as isize) = u + *uvs + .offset( + i as isize, + ) = u + (1 as c_int as c_float - *((*self_0).regionUVs).offset((i + 1 as c_int) as isize)) * width; - *uvs.offset((i + 1 as c_int) as isize) = - v + *((*self_0).regionUVs).offset(i as isize) * height; + *uvs + .offset( + (i + 1 as c_int) as isize, + ) = v + *((*self_0).regionUVs).offset(i as isize) * height; i += 2 as c_int; } return; } _ => { - let mut textureWidth_2: c_float = (*(*self_0).region).width as c_float - / ((*(*self_0).region).u2 - (*(*self_0).region).u); - let mut textureHeight_2: c_float = (*(*self_0).region).height as c_float - / ((*(*self_0).region).v2 - (*(*self_0).region).v); + let mut textureWidth_2: c_float = (*(*self_0).region).width + as c_float / ((*(*self_0).region).u2 - (*(*self_0).region).u); + let mut textureHeight_2: c_float = (*(*self_0).region).height + as c_float / ((*(*self_0).region).v2 - (*(*self_0).region).v); u -= (*(*self_0).region).offsetX / textureWidth_2; - v -= ((*(*self_0).region).originalHeight as c_float - - (*(*self_0).region).offsetY - - (*(*self_0).region).height as c_float) - / textureHeight_2; + v + -= ((*(*self_0).region).originalHeight as c_float + - (*(*self_0).region).offsetY + - (*(*self_0).region).height as c_float) / textureHeight_2; width = (*(*self_0).region).originalWidth as c_float / textureWidth_2; - height = (*(*self_0).region).originalHeight as c_float / textureHeight_2; + height = (*(*self_0).region).originalHeight as c_float + / textureHeight_2; i = 0 as c_int; while i < n { - *uvs.offset(i as isize) = u + *((*self_0).regionUVs).offset(i as isize) * width; - *uvs.offset((i + 1 as c_int) as isize) = - v + *((*self_0).regionUVs).offset((i + 1 as c_int) as isize) * height; + *uvs + .offset( + i as isize, + ) = u + *((*self_0).regionUVs).offset(i as isize) * width; + *uvs + .offset( + (i + 1 as c_int) as isize, + ) = v + + *((*self_0).regionUVs).offset((i + 1 as c_int) as isize) + * height; i += 2 as c_int; } } @@ -12946,8 +14436,7 @@ pub unsafe extern "C" fn spMeshAttachment_setParentMesh( mut self_0: *mut spMeshAttachment, mut parentMesh: *mut spMeshAttachment, ) { - let ref mut fresh77 = *(&mut (*self_0).parentMesh as *mut *mut spMeshAttachment); - *fresh77 = parentMesh; + (*self_0).parentMesh = parentMesh; if !parentMesh.is_null() { (*self_0).super_0.bones = (*parentMesh).super_0.bones; (*self_0).super_0.bonesCount = (*parentMesh).super_0.bonesCount; @@ -12957,7 +14446,9 @@ pub unsafe extern "C" fn spMeshAttachment_setParentMesh( (*self_0).triangles = (*parentMesh).triangles; (*self_0).trianglesCount = (*parentMesh).trianglesCount; (*self_0).hullLength = (*parentMesh).hullLength; - (*self_0).super_0.worldVerticesLength = (*parentMesh).super_0.worldVerticesLength; + (*self_0) + .super_0 + .worldVerticesLength = (*parentMesh).super_0.worldVerticesLength; (*self_0).edges = (*parentMesh).edges; (*self_0).edgesCount = (*parentMesh).edgesCount; (*self_0).width = (*parentMesh).width; @@ -12979,11 +14470,12 @@ pub unsafe extern "C" fn _spPathAttachment_copy( let mut self_0: *mut spPathAttachment = attachment as *mut spPathAttachment; spVertexAttachment_copyTo(&mut (*self_0).super_0, &mut (*copy).super_0); (*copy).lengthsLength = (*self_0).lengthsLength; - (*copy).lengths = _spMalloc( + (*copy) + .lengths = _spMalloc( (::core::mem::size_of::() as c_ulong) .wrapping_mul((*self_0).lengthsLength as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 6759 as c_int, + 6996 as c_int, ) as *mut c_float; spine_memcpy( (*copy).lengths as *mut c_void, @@ -12996,12 +14488,14 @@ pub unsafe extern "C" fn _spPathAttachment_copy( return &mut (*copy).super_0.super_0; } #[no_mangle] -pub unsafe extern "C" fn spPathAttachment_create(mut name: *const c_char) -> *mut spPathAttachment { +pub unsafe extern "C" fn spPathAttachment_create( + mut name: *const c_char, +) -> *mut spPathAttachment { let mut self_0: *mut spPathAttachment = _spCalloc( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 6767 as c_int, + 7004 as c_int, ) as *mut spPathAttachment; _spVertexAttachment_init(&mut (*self_0).super_0); _spAttachment_init( @@ -13010,7 +14504,8 @@ pub unsafe extern "C" fn spPathAttachment_create(mut name: *const c_char) -> *mu SP_ATTACHMENT_PATH, Some(_spPathAttachment_dispose as unsafe extern "C" fn(*mut spAttachment) -> ()), Some( - _spPathAttachment_copy as unsafe extern "C" fn(*mut spAttachment) -> *mut spAttachment, + _spPathAttachment_copy + as unsafe extern "C" fn(*mut spAttachment) -> *mut spAttachment, ), ); return self_0; @@ -13025,22 +14520,21 @@ pub unsafe extern "C" fn spPathConstraint_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 6812 as c_int, + 7049 as c_int, ) as *mut spPathConstraint; - let ref mut fresh78 = *(&mut (*self_0).data as *mut *mut spPathConstraintData); - *fresh78 = data; + (*self_0).data = data; (*self_0).bonesCount = (*data).bonesCount; - let ref mut fresh79 = *(&mut (*self_0).bones as *mut *mut *mut spBone); - *fresh79 = _spMalloc( + (*self_0) + .bones = _spMalloc( (::core::mem::size_of::<*mut spBone>() as c_ulong) .wrapping_mul((*self_0).bonesCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 6815 as c_int, + 7052 as c_int, ) as *mut *mut spBone; i = 0 as c_int; while i < (*self_0).bonesCount { - let ref mut fresh80 = *((*self_0).bones).offset(i as isize); - *fresh80 = spSkeleton_findBone( + let ref mut fresh51 = *((*self_0).bones).offset(i as isize); + *fresh51 = spSkeleton_findBone( skeleton, (**((*(*self_0).data).bones).offset(i as isize)).name, ); @@ -13053,15 +14547,15 @@ pub unsafe extern "C" fn spPathConstraint_create( (*self_0).mixX = (*data).mixX; (*self_0).mixY = (*data).mixY; (*self_0).spacesCount = 0 as c_int; - (*self_0).spaces = std::ptr::null_mut(); + (*self_0).spaces = 0 as *mut c_float; (*self_0).positionsCount = 0 as c_int; - (*self_0).positions = std::ptr::null_mut(); + (*self_0).positions = 0 as *mut c_float; (*self_0).worldCount = 0 as c_int; - (*self_0).world = std::ptr::null_mut(); + (*self_0).world = 0 as *mut c_float; (*self_0).curvesCount = 0 as c_int; - (*self_0).curves = std::ptr::null_mut(); + (*self_0).curves = 0 as *mut c_float; (*self_0).lengthsCount = 0 as c_int; - (*self_0).lengths = std::ptr::null_mut(); + (*self_0).lengths = 0 as *mut c_float; return self_0; } #[no_mangle] @@ -13095,9 +14589,9 @@ pub unsafe extern "C" fn spPathConstraint_update(mut self_0: *mut spPathConstrai let mut dy: c_float = 0.; let mut s: c_float = 0.; let mut sum: c_float = 0.; - let mut spaces: *mut c_float = std::ptr::null_mut(); - let mut lengths: *mut c_float = std::ptr::null_mut(); - let mut positions: *mut c_float = std::ptr::null_mut(); + let mut spaces: *mut c_float = 0 as *mut c_float; + let mut lengths: *mut c_float = 0 as *mut c_float; + let mut positions: *mut c_float = 0 as *mut c_float; let mut spacing: c_float = 0.; let mut boneX: c_float = 0.; let mut boneY: c_float = 0.; @@ -13107,13 +14601,13 @@ pub unsafe extern "C" fn spPathConstraint_update(mut self_0: *mut spPathConstrai let mut mixX: c_float = (*self_0).mixX; let mut mixY: c_float = (*self_0).mixY; let mut lengthSpacing: c_int = 0; - let mut attachment: *mut spPathAttachment = - (*(*self_0).target).attachment as *mut spPathAttachment; + let mut attachment: *mut spPathAttachment = (*(*self_0).target).attachment + as *mut spPathAttachment; let mut data: *mut spPathConstraintData = (*self_0).data; - let mut tangents: c_int = - ((*data).rotateMode as c_uint == SP_ROTATE_MODE_TANGENT as c_int as c_uint) as c_int; - let mut scale: c_int = - ((*data).rotateMode as c_uint == SP_ROTATE_MODE_CHAIN_SCALE as c_int as c_uint) as c_int; + let mut tangents: c_int = ((*data).rotateMode as c_uint + == SP_ROTATE_MODE_TANGENT as c_int as c_uint) as c_int; + let mut scale: c_int = ((*data).rotateMode as c_uint + == SP_ROTATE_MODE_CHAIN_SCALE as c_int as c_uint) as c_int; let mut boneCount: c_int = (*self_0).bonesCount; let mut spacesCount: c_int = if tangents != 0 { boneCount @@ -13121,7 +14615,7 @@ pub unsafe extern "C" fn spPathConstraint_update(mut self_0: *mut spPathConstrai boneCount + 1 as c_int }; let mut bones: *mut *mut spBone = (*self_0).bones; - let mut pa: *mut spBone = std::ptr::null_mut(); + let mut pa: *mut spBone = 0 as *mut spBone; if mixRotate == 0 as c_int as c_float && mixX == 0 as c_int as c_float && mixY == 0 as c_int as c_float @@ -13129,7 +14623,8 @@ pub unsafe extern "C" fn spPathConstraint_update(mut self_0: *mut spPathConstrai return; } if attachment.is_null() - || (*attachment).super_0.super_0.type_0 as c_uint != SP_ATTACHMENT_PATH as c_int as c_uint + || (*attachment).super_0.super_0.type_0 as c_uint + != SP_ATTACHMENT_PATH as c_int as c_uint { return; } @@ -13137,26 +14632,30 @@ pub unsafe extern "C" fn spPathConstraint_update(mut self_0: *mut spPathConstrai if !((*self_0).spaces).is_null() { _spFree((*self_0).spaces as *mut c_void); } - (*self_0).spaces = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul(spacesCount as c_ulong), + (*self_0) + .spaces = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul(spacesCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 6868 as c_int, + 7105 as c_int, ) as *mut c_float; (*self_0).spacesCount = spacesCount; } spaces = (*self_0).spaces; *spaces.offset(0 as c_int as isize) = 0 as c_int as c_float; - lengths = std::ptr::null_mut(); + lengths = 0 as *mut c_float; spacing = (*self_0).spacing; if scale != 0 { if (*self_0).lengthsCount != boneCount { if !((*self_0).lengths).is_null() { _spFree((*self_0).lengths as *mut c_void); } - (*self_0).lengths = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul(boneCount as c_ulong), + (*self_0) + .lengths = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul(boneCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 6879 as c_int, + 7116 as c_int, ) as *mut c_float; (*self_0).lengthsCount = boneCount; } @@ -13170,13 +14669,9 @@ pub unsafe extern "C" fn spPathConstraint_update(mut self_0: *mut spPathConstrai while i < n { let mut bone: *mut spBone = *bones.offset(i as isize); setupLength = (*(*bone).data).length; - if setupLength < 0.00001f32 { - *lengths.offset(i as isize) = 0 as c_int as c_float; - } else { - x = setupLength * (*bone).a; - y = setupLength * (*bone).c; - *lengths.offset(i as isize) = spine_sqrtf(x * x + y * y); - } + x = setupLength * (*bone).a; + y = setupLength * (*bone).c; + *lengths.offset(i as isize) = spine_sqrtf(x * x + y * y); i += 1; } } @@ -13243,38 +14738,49 @@ pub unsafe extern "C" fn spPathConstraint_update(mut self_0: *mut spPathConstrai *lengths.offset(i as isize) = length; } i += 1; - *spaces.offset(i as isize) = (if lengthSpacing != 0 { + *spaces + .offset( + i as isize, + ) = (if lengthSpacing != 0 { setupLength + spacing } else { spacing - }) * length - / setupLength; + }) * length / setupLength; } } } } - positions = spPathConstraint_computeWorldPositions(self_0, attachment, spacesCount, tangents); + positions = spPathConstraint_computeWorldPositions( + self_0, + attachment, + spacesCount, + tangents, + ); boneX = *positions.offset(0 as c_int as isize); boneY = *positions.offset(1 as c_int as isize); offsetRotation = (*(*self_0).data).offsetRotation; tip = 0 as c_int; if offsetRotation == 0 as c_int as c_float { - tip = ((*data).rotateMode as c_uint == SP_ROTATE_MODE_CHAIN as c_int as c_uint) as c_int; + tip = ((*data).rotateMode as c_uint + == SP_ROTATE_MODE_CHAIN as c_int as c_uint) as c_int; } else { tip = 0 as c_int; pa = (*(*self_0).target).bone; - offsetRotation *= if (*pa).a * (*pa).d - (*pa).b * (*pa).c > 0 as c_int as c_float { - 3.1415926535897932385f32 / 180 as c_int as c_float - } else { - -(3.1415926535897932385f32 / 180 as c_int as c_float) - }; + offsetRotation + *= if (*pa).a * (*pa).d - (*pa).b * (*pa).c + > 0 as c_int as c_float + { + 3.1415926535897932385f32 / 180 as c_int as c_float + } else { + -(3.1415926535897932385f32 / 180 as c_int as c_float) + }; } i = 0 as c_int; p = 3 as c_int; while i < boneCount { let mut bone_2: *mut spBone = *bones.offset(i as isize); - *(&mut (*bone_2).worldX as *mut c_float) += (boneX - (*bone_2).worldX) * mixX; - *(&mut (*bone_2).worldY as *mut c_float) += (boneY - (*bone_2).worldY) * mixY; + (*bone_2).worldX += (boneX - (*bone_2).worldX) * mixX; + (*bone_2).worldY += (boneY - (*bone_2).worldY) * mixY; x = *positions.offset(p as isize); y = *positions.offset((p + 1 as c_int) as isize); dx = x - boneX; @@ -13282,10 +14788,11 @@ pub unsafe extern "C" fn spPathConstraint_update(mut self_0: *mut spPathConstrai if scale != 0 { length = *lengths.offset(i as isize); if length != 0 as c_int as c_float { - s = (spine_sqrtf(dx * dx + dy * dy) / length - 1 as c_int as c_float) * mixRotate + s = (spine_sqrtf(dx * dx + dy * dy) / length + - 1 as c_int as c_float) * mixRotate + 1 as c_int as c_float; - *(&mut (*bone_2).a as *mut c_float) *= s; - *(&mut (*bone_2).c as *mut c_float) *= s; + (*bone_2).a *= s; + (*bone_2).c *= s; } } boneX = x; @@ -13300,16 +14807,21 @@ pub unsafe extern "C" fn spPathConstraint_update(mut self_0: *mut spPathConstrai let mut sine: c_float = 0.; if tangents != 0 { r = *positions.offset((p - 1 as c_int) as isize); - } else if *spaces.offset((i + 1 as c_int) as isize) == 0 as c_int as c_float { + } else if *spaces.offset((i + 1 as c_int) as isize) + == 0 as c_int as c_float + { r = *positions.offset((p + 2 as c_int) as isize); } else { r = spine_atan2f(dy, dx); } - r -= spine_atan2f(c, a) - - offsetRotation * (3.1415926535897932385f32 / 180 as c_int as c_float); + r + -= spine_atan2f(c, a) + - offsetRotation + * (3.1415926535897932385f32 + / 180 as c_int as c_float); if tip != 0 { cosine = spine_cosf(r); - sine = spine_sinf(r); + sine = sinf(r); length = (*(*bone_2).data).length; boneX += (length * (cosine * a - sine * c) - dx) * mixRotate; boneY += (length * (sine * a + cosine * c) - dy) * mixRotate; @@ -13323,17 +14835,28 @@ pub unsafe extern "C" fn spPathConstraint_update(mut self_0: *mut spPathConstrai } r *= mixRotate; cosine = spine_cosf(r); - sine = spine_sinf(r); - *(&mut (*bone_2).a as *mut c_float) = cosine * a - sine * c; - *(&mut (*bone_2).b as *mut c_float) = cosine * b - sine * d; - *(&mut (*bone_2).c as *mut c_float) = sine * a + cosine * c; - *(&mut (*bone_2).d as *mut c_float) = sine * b + cosine * d; + sine = sinf(r); + (*bone_2).a = cosine * a - sine * c; + (*bone_2).b = cosine * b - sine * d; + (*bone_2).c = sine * a + cosine * c; + (*bone_2).d = sine * b + cosine * d; } spBone_updateAppliedTransform(bone_2); i += 1; p += 3 as c_int; } } +#[no_mangle] +pub unsafe extern "C" fn spPathConstraint_setToSetupPose( + mut self_0: *mut spPathConstraint, +) { + let mut data: *mut spPathConstraintData = (*self_0).data; + (*self_0).position = (*data).position; + (*self_0).spacing = (*data).spacing; + (*self_0).mixRotate = (*data).mixRotate; + (*self_0).mixX = (*data).mixX; + (*self_0).mixY = (*data).mixY; +} unsafe extern "C" fn _addBeforePosition( mut p: c_float, mut temp: *mut c_float, @@ -13347,7 +14870,7 @@ unsafe extern "C" fn _addBeforePosition( let mut dy: c_float = *temp.offset((i + 3 as c_int) as isize) - y1; let mut r: c_float = spine_atan2f(dy, dx); *out.offset(o as isize) = x1 + p * spine_cosf(r); - *out.offset((o + 1 as c_int) as isize) = y1 + p * spine_sinf(r); + *out.offset((o + 1 as c_int) as isize) = y1 + p * sinf(r); *out.offset((o + 2 as c_int) as isize) = r; } unsafe extern "C" fn _addAfterPosition( @@ -13363,7 +14886,7 @@ unsafe extern "C" fn _addAfterPosition( let mut dy: c_float = y1 - *temp.offset((i + 1 as c_int) as isize); let mut r: c_float = spine_atan2f(dy, dx); *out.offset(o as isize) = x1 + p * spine_cosf(r); - *out.offset((o + 1 as c_int) as isize) = y1 + p * spine_sinf(r); + *out.offset((o + 1 as c_int) as isize) = y1 + p * sinf(r); *out.offset((o + 2 as c_int) as isize) = r; } unsafe extern "C" fn _addCurvePosition( @@ -13412,9 +14935,15 @@ unsafe extern "C" fn _addCurvePosition( *out.offset((o + 1 as c_int) as isize) = y; if tangents != 0 { if (p as c_double) < 0.001f64 { - *out.offset((o + 2 as c_int) as isize) = spine_atan2f(cy1 - y1, cx1 - x1); + *out + .offset( + (o + 2 as c_int) as isize, + ) = spine_atan2f(cy1 - y1, cx1 - x1); } else { - *out.offset((o + 2 as c_int) as isize) = spine_atan2f( + *out + .offset( + (o + 2 as c_int) as isize, + ) = spine_atan2f( y - (y1 * uu + cy1 * ut * 2 as c_int as c_float + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 as c_int as c_float + cx2 * tt), ); @@ -13437,9 +14966,9 @@ pub unsafe extern "C" fn spPathConstraint_computeWorldPositions( let mut verticesLength: c_int = 0; let mut curveCount: c_int = 0; let mut prevCurve: c_int = 0; - let mut out: *mut c_float = std::ptr::null_mut(); - let mut curves: *mut c_float = std::ptr::null_mut(); - let mut segments: *mut c_float = std::ptr::null_mut(); + let mut out: *mut c_float = 0 as *mut c_float; + let mut curves: *mut c_float = 0 as *mut c_float; + let mut segments: *mut c_float = 0 as *mut c_float; let mut tmpx: c_float = 0.; let mut tmpy: c_float = 0.; let mut dddfx: c_float = 0.; @@ -13463,16 +14992,19 @@ pub unsafe extern "C" fn spPathConstraint_computeWorldPositions( let mut target: *mut spSlot = (*self_0).target; let mut position: c_float = (*self_0).position; let mut spaces: *mut c_float = (*self_0).spaces; - let mut world: *mut c_float = std::ptr::null_mut(); + let mut world: *mut c_float = 0 as *mut c_float; if (*self_0).positionsCount != spacesCount * 3 as c_int + 2 as c_int { if !((*self_0).positions).is_null() { _spFree((*self_0).positions as *mut c_void); } - (*self_0).positions = _spMalloc( + (*self_0) + .positions = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spacesCount * 3 as c_int + 2 as c_int) as c_ulong), + .wrapping_mul( + (spacesCount * 3 as c_int + 2 as c_int) as c_ulong, + ), b"spine.c\0" as *const u8 as *const c_char, - 7049 as c_int, + 7291 as c_int, ) as *mut c_float; (*self_0).positionsCount = spacesCount * 3 as c_int + 2 as c_int; } @@ -13485,7 +15017,9 @@ pub unsafe extern "C" fn spPathConstraint_computeWorldPositions( let mut lengths: *mut c_float = (*path).lengths; curveCount -= if closed != 0 { 1 as c_int } else { 2 as c_int }; pathLength = *lengths.offset(curveCount as isize); - if (*(*self_0).data).positionMode as c_uint == SP_POSITION_MODE_PERCENT as c_int as c_uint { + if (*(*self_0).data).positionMode as c_uint + == SP_POSITION_MODE_PERCENT as c_int as c_uint + { position *= pathLength; } match (*(*self_0).data).spacingMode as c_uint { @@ -13503,10 +15037,12 @@ pub unsafe extern "C" fn spPathConstraint_computeWorldPositions( if !((*self_0).world).is_null() { _spFree((*self_0).world as *mut c_void); } - (*self_0).world = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul(8 as c_int as c_ulong), + (*self_0) + .world = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul(8 as c_int as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 7074 as c_int, + 7316 as c_int, ) as *mut c_float; (*self_0).worldCount = 8 as c_int; } @@ -13569,8 +15105,8 @@ pub unsafe extern "C" fn spPathConstraint_computeWorldPositions( if curve == 0 as c_int { p /= length; } else { - let mut prev: c_float = - *lengths.offset((curve - 1 as c_int) as isize); + let mut prev: c_float = *lengths + .offset((curve - 1 as c_int) as isize); p = (p - prev) / (length - prev); } break; @@ -13621,7 +15157,9 @@ pub unsafe extern "C" fn spPathConstraint_computeWorldPositions( *world.offset(7 as c_int as isize), out, o, - (tangents != 0 || i > 0 as c_int && space == 0 as c_int as c_float) + (tangents != 0 + || i > 0 as c_int + && space == 0 as c_int as c_float) as c_int, ); } @@ -13638,11 +15176,12 @@ pub unsafe extern "C" fn spPathConstraint_computeWorldPositions( if !((*self_0).world).is_null() { _spFree((*self_0).world as *mut c_void); } - (*self_0).world = _spMalloc( + (*self_0) + .world = _spMalloc( (::core::mem::size_of::() as c_ulong) .wrapping_mul(verticesLength as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 7134 as c_int, + 7376 as c_int, ) as *mut c_float; (*self_0).worldCount = verticesLength; } @@ -13665,8 +15204,14 @@ pub unsafe extern "C" fn spPathConstraint_computeWorldPositions( verticesLength - 4 as c_int, 2 as c_int, ); - *world.offset((verticesLength - 2 as c_int) as isize) = *world.offset(0 as c_int as isize); - *world.offset((verticesLength - 1 as c_int) as isize) = *world.offset(1 as c_int as isize); + *world + .offset( + (verticesLength - 2 as c_int) as isize, + ) = *world.offset(0 as c_int as isize); + *world + .offset( + (verticesLength - 1 as c_int) as isize, + ) = *world.offset(1 as c_int as isize); } else { curveCount -= 1; verticesLength -= 4 as c_int; @@ -13674,11 +15219,12 @@ pub unsafe extern "C" fn spPathConstraint_computeWorldPositions( if !((*self_0).world).is_null() { _spFree((*self_0).world as *mut c_void); } - (*self_0).world = _spMalloc( + (*self_0) + .world = _spMalloc( (::core::mem::size_of::() as c_ulong) .wrapping_mul(verticesLength as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 7147 as c_int, + 7389 as c_int, ) as *mut c_float; (*self_0).worldCount = verticesLength; } @@ -13697,10 +15243,12 @@ pub unsafe extern "C" fn spPathConstraint_computeWorldPositions( if !((*self_0).curves).is_null() { _spFree((*self_0).curves as *mut c_void); } - (*self_0).curves = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul(curveCount as c_ulong), + (*self_0) + .curves = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul(curveCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 7157 as c_int, + 7399 as c_int, ) as *mut c_float; (*self_0).curvesCount = curveCount; } @@ -13749,7 +15297,9 @@ pub unsafe extern "C" fn spPathConstraint_computeWorldPositions( i += 1; w += 6 as c_int; } - if (*(*self_0).data).positionMode as c_uint == SP_POSITION_MODE_PERCENT as c_int as c_uint { + if (*(*self_0).data).positionMode as c_uint + == SP_POSITION_MODE_PERCENT as c_int as c_uint + { position *= pathLength; } match (*(*self_0).data).spacingMode as c_uint { @@ -13785,7 +15335,13 @@ pub unsafe extern "C" fn spPathConstraint_computeWorldPositions( _addBeforePosition(p, world, 0 as c_int, out, o); current_block_195 = 5404178929002277151; } else if p > pathLength { - _addAfterPosition(p - pathLength, world, verticesLength - 4 as c_int, out, o); + _addAfterPosition( + p - pathLength, + world, + verticesLength - 4 as c_int, + out, + o, + ); current_block_195 = 5404178929002277151; } else { current_block_195 = 15456862084301247793; @@ -13800,7 +15356,8 @@ pub unsafe extern "C" fn spPathConstraint_computeWorldPositions( if curve == 0 as c_int { p /= length_0; } else { - let mut prev_0: c_float = *curves.offset((curve - 1 as c_int) as isize); + let mut prev_0: c_float = *curves + .offset((curve - 1 as c_int) as isize); p = (p - prev_0) / (length_0 - prev_0); } break; @@ -13818,10 +15375,14 @@ pub unsafe extern "C" fn spPathConstraint_computeWorldPositions( cy2 = *world.offset((ii + 5 as c_int) as isize); x2 = *world.offset((ii + 6 as c_int) as isize); y2 = *world.offset((ii + 7 as c_int) as isize); - tmpx = (x1 - cx1 * 2 as c_int as c_float + cx2) * 0.03f32; - tmpy = (y1 - cy1 * 2 as c_int as c_float + cy2) * 0.03f32; - dddfx = ((cx1 - cx2) * 3 as c_int as c_float - x1 + x2) * 0.006f32; - dddfy = ((cy1 - cy2) * 3 as c_int as c_float - y1 + y2) * 0.006f32; + tmpx = (x1 - cx1 * 2 as c_int as c_float + cx2) + * 0.03f32; + tmpy = (y1 - cy1 * 2 as c_int as c_float + cy2) + * 0.03f32; + dddfx = ((cx1 - cx2) * 3 as c_int as c_float - x1 + x2) + * 0.006f32; + dddfy = ((cy1 - cy2) * 3 as c_int as c_float - y1 + y2) + * 0.006f32; ddfx = tmpx * 2 as c_int as c_float + dddfx; ddfy = tmpy * 2 as c_int as c_float + dddfy; dfx = (cx1 - x1) * 0.3f32 + tmpx + dddfx * 0.16666667f32; @@ -13848,68 +15409,492 @@ pub unsafe extern "C" fn spPathConstraint_computeWorldPositions( *segments.offset(9 as c_int as isize) = curveLength; segment = 0 as c_int; } - p *= curveLength; - loop { - let mut length_1: c_float = *segments.offset(segment as isize); - if p > length_1 { - segment += 1; + p *= curveLength; + loop { + let mut length_1: c_float = *segments.offset(segment as isize); + if p > length_1 { + segment += 1; + } else { + if segment == 0 as c_int { + p /= length_1; + } else { + let mut prev_1: c_float = *segments + .offset((segment - 1 as c_int) as isize); + p = segment as c_float + + (p - prev_1) / (length_1 - prev_1); + } + break; + } + } + _addCurvePosition( + p * 0.1f32, + x1, + y1, + cx1, + cy1, + cx2, + cy2, + x2, + y2, + out, + o, + (tangents != 0 + || i > 0 as c_int + && space_0 == 0 as c_int as c_float) + as c_int, + ); + } + _ => {} + } + i += 1; + o += 3 as c_int; + } + return out; +} +#[no_mangle] +pub unsafe extern "C" fn spPathConstraintData_create( + mut name: *const c_char, +) -> *mut spPathConstraintData { + let mut self_0: *mut spPathConstraintData = _spCalloc( + 1 as c_int as size_t, + ::core::mem::size_of::() as c_ulong, + b"spine.c\0" as *const u8 as *const c_char, + 7574 as c_int, + ) as *mut spPathConstraintData; + (*self_0) + .name = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul( + (spine_strlen(name)).wrapping_add(1 as c_int as c_ulong), + ), + b"spine.c\0" as *const u8 as *const c_char, + 7575 as c_int, + ) as *mut c_char; + spine_strcpy((*self_0).name, name); + return self_0; +} +#[no_mangle] +pub unsafe extern "C" fn spPathConstraintData_dispose( + mut self_0: *mut spPathConstraintData, +) { + _spFree((*self_0).name as *mut c_void); + _spFree((*self_0).bones as *mut c_void); + _spFree(self_0 as *mut c_void); +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraint_create( + mut data: *mut spPhysicsConstraintData, + mut skeleton: *mut spSkeleton, +) -> *mut spPhysicsConstraint { + let mut self_0: *mut spPhysicsConstraint = _spCalloc( + 1 as c_int as size_t, + ::core::mem::size_of::() as c_ulong, + b"spine.c\0" as *const u8 as *const c_char, + 7618 as c_int, + ) as *mut spPhysicsConstraint; + (*self_0).data = data; + (*self_0).skeleton = skeleton; + (*self_0).bone = *((*skeleton).bones).offset((*(*data).bone).index as isize); + (*self_0).inertia = (*data).inertia; + (*self_0).strength = (*data).strength; + (*self_0).damping = (*data).damping; + (*self_0).massInverse = (*data).massInverse; + (*self_0).wind = (*data).wind; + (*self_0).gravity = (*data).gravity; + (*self_0).mix = (*data).mix; + (*self_0).reset = -(1 as c_int); + (*self_0).ux = 0 as c_int as c_float; + (*self_0).uy = 0 as c_int as c_float; + (*self_0).cx = 0 as c_int as c_float; + (*self_0).tx = 0 as c_int as c_float; + (*self_0).ty = 0 as c_int as c_float; + (*self_0).xOffset = 0 as c_int as c_float; + (*self_0).xVelocity = 0 as c_int as c_float; + (*self_0).yOffset = 0 as c_int as c_float; + (*self_0).yVelocity = 0 as c_int as c_float; + (*self_0).rotateOffset = 0 as c_int as c_float; + (*self_0).rotateVelocity = 0 as c_int as c_float; + (*self_0).scaleOffset = 0 as c_int as c_float; + (*self_0).scaleVelocity = 0 as c_int as c_float; + (*self_0).active = 0 as c_int; + (*self_0).remaining = 0 as c_int as c_float; + (*self_0).lastTime = 0 as c_int as c_float; + return self_0; +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraint_dispose( + mut self_0: *mut spPhysicsConstraint, +) { + _spFree(self_0 as *mut c_void); +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraint_reset( + mut self_0: *mut spPhysicsConstraint, +) { + (*self_0).remaining = 0 as c_int as c_float; + (*self_0).lastTime = (*(*self_0).skeleton).time; + (*self_0).reset = -(1 as c_int); + (*self_0).xOffset = 0 as c_int as c_float; + (*self_0).xVelocity = 0 as c_int as c_float; + (*self_0).yOffset = 0 as c_int as c_float; + (*self_0).yVelocity = 0 as c_int as c_float; + (*self_0).rotateOffset = 0 as c_int as c_float; + (*self_0).rotateVelocity = 0 as c_int as c_float; + (*self_0).scaleOffset = 0 as c_int as c_float; + (*self_0).scaleVelocity = 0 as c_int as c_float; +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraint_setToSetupPose( + mut self_0: *mut spPhysicsConstraint, +) { + (*self_0).inertia = (*(*self_0).data).inertia; + (*self_0).strength = (*(*self_0).data).strength; + (*self_0).damping = (*(*self_0).data).damping; + (*self_0).massInverse = (*(*self_0).data).massInverse; + (*self_0).wind = (*(*self_0).data).wind; + (*self_0).gravity = (*(*self_0).data).gravity; + (*self_0).mix = (*(*self_0).data).mix; +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraint_update( + mut self_0: *mut spPhysicsConstraint, + mut physics: spPhysics, +) { + let mut mix: c_float = (*self_0).mix; + if mix == 0 as c_int as c_float { + return; + } + let mut x: c_int = ((*(*self_0).data).x > 0 as c_int as c_float) + as c_int; + let mut y: c_int = ((*(*self_0).data).y > 0 as c_int as c_float) + as c_int; + let mut rotateOrShearX: c_int = ((*(*self_0).data).rotate + > 0 as c_int as c_float + || (*(*self_0).data).shearX > 0 as c_int as c_float) as c_int; + let mut scaleX: c_int = ((*(*self_0).data).scaleX + > 0 as c_int as c_float) as c_int; + let mut bone: *mut spBone = (*self_0).bone; + let mut l: c_float = (*(*bone).data).length; + let mut current_block_92: u64; + match physics as c_uint { + 0 => return, + 1 => { + spPhysicsConstraint_reset(self_0); + current_block_92 = 2473556513754201174; + } + 2 => { + current_block_92 = 2473556513754201174; + } + 3 => { + if x != 0 { + (*bone).worldX += (*self_0).xOffset * mix * (*(*self_0).data).x; + } + if y != 0 { + (*bone).worldY += (*self_0).yOffset * mix * (*(*self_0).data).y; + } + current_block_92 = 5207889489643863322; + } + _ => { + current_block_92 = 5207889489643863322; + } + } + match current_block_92 { + 2473556513754201174 => { + let mut delta: c_float = if (*(*self_0).skeleton).time + - (*self_0).lastTime > 0.0f32 + { + (*(*self_0).skeleton).time - (*self_0).lastTime + } else { + 0.0f32 + }; + (*self_0).remaining += delta; + (*self_0).lastTime = (*(*self_0).skeleton).time; + let mut bx: c_float = (*bone).worldX; + let mut by: c_float = (*bone).worldY; + if (*self_0).reset != 0 { + (*self_0).reset = 0 as c_int; + (*self_0).ux = bx; + (*self_0).uy = by; + } else { + let mut a: c_float = (*self_0).remaining; + let mut i: c_float = (*self_0).inertia; + let mut q: c_float = (*(*self_0).data).limit * delta; + let mut t: c_float = (*(*self_0).data).step; + let mut f: c_float = (*(*(*self_0).skeleton).data).referenceScale; + let mut d: c_float = -(1 as c_int) as c_float; + if x != 0 || y != 0 { + if x != 0 { + let mut u: c_float = ((*self_0).ux - bx) * i; + (*self_0).xOffset + += if u > q { q } else if u < -q { -q } else { u }; + (*self_0).ux = bx; + } + if y != 0 { + let mut u_0: c_float = ((*self_0).uy - by) * i; + (*self_0).yOffset + += if u_0 > q { q } else if u_0 < -q { -q } else { u_0 }; + (*self_0).uy = by; + } + if a >= t { + d = spine_pow( + (*self_0).damping as c_double, + (60 as c_int as c_float * t) as c_double, + ) as c_float; + let mut m: c_float = (*self_0).massInverse * t; + let mut e: c_float = (*self_0).strength; + let mut w: c_float = (*self_0).wind * f; + let mut g: c_float = (*self_0).gravity * f + * (if spBone_isYDown() != 0 { + -(1 as c_int) + } else { + 1 as c_int + }) as c_float; + loop { + if x != 0 { + (*self_0).xVelocity += (w - (*self_0).xOffset * e) * m; + (*self_0).xOffset += (*self_0).xVelocity * t; + (*self_0).xVelocity *= d; + } + if y != 0 { + (*self_0).yVelocity -= (g + (*self_0).yOffset * e) * m; + (*self_0).yOffset += (*self_0).yVelocity * t; + (*self_0).yVelocity *= d; + } + a -= t; + if !(a >= t) { + break; + } + } + } + if x != 0 { + (*bone).worldX += (*self_0).xOffset * mix * (*(*self_0).data).x; + } + if y != 0 { + (*bone).worldY += (*self_0).yOffset * mix * (*(*self_0).data).y; + } + } + if rotateOrShearX != 0 || scaleX != 0 { + let mut ca: c_float = spine_atan2f((*bone).c, (*bone).a); + let mut c: c_float = 0.; + let mut s: c_float = 0.; + let mut mr: c_float = 0 as c_int as c_float; + let mut dx: c_float = (*self_0).cx - (*bone).worldX; + let mut dy: c_float = (*self_0).cy - (*bone).worldY; + if dx > q { + dx = q; + } else if dx < -q { + dx = -q; + } + if dy > q { + dy = q; + } else if dy < -q { + dy = -q; + } + if rotateOrShearX != 0 { + mr = ((*(*self_0).data).rotate + (*(*self_0).data).shearX) * mix; + let mut r: c_float = spine_atan2f( + dy + (*self_0).ty, + dx + (*self_0).tx, + ) - ca - (*self_0).rotateOffset * mr; + (*self_0).rotateOffset + += (r + - ceil( + (r + * (1 as c_int as c_float + / (3.1415926535897932385f32 + * 2 as c_int as c_float)) - 0.5f32) + as c_double, + ) as c_float + * (3.1415926535897932385f32 + * 2 as c_int as c_float)) * i; + r = (*self_0).rotateOffset * mr + ca; + c = spine_cosf(r); + s = sinf(r); + if scaleX != 0 { + r = l * spBone_getWorldScaleX(bone); + if r > 0 as c_int as c_float { + (*self_0).scaleOffset += (dx * c + dy * s) * i / r; + } + } } else { - if segment == 0 as c_int { - p /= length_1; - } else { - let mut prev_1: c_float = - *segments.offset((segment - 1 as c_int) as isize); - p = segment as c_float + (p - prev_1) / (length_1 - prev_1); + c = spine_cosf(ca); + s = sinf(ca); + let mut r_0: c_float = l * spBone_getWorldScaleX(bone); + if r_0 > 0 as c_int as c_float { + (*self_0).scaleOffset += (dx * c + dy * s) * i / r_0; + } + } + a = (*self_0).remaining; + if a >= t { + if d == -(1 as c_int) as c_float { + d = spine_pow( + (*self_0).damping as c_double, + (60 as c_int as c_float * t) as c_double, + ) as c_float; + } + let mut m_0: c_float = (*self_0).massInverse * t; + let mut e_0: c_float = (*self_0).strength; + let mut w_0: c_float = (*self_0).wind; + let mut g_0: c_float = (*self_0).gravity; + let mut h: c_float = l / f; + while -(1 as c_int) != 0 { + a -= t; + if scaleX != 0 { + (*self_0).scaleVelocity + += (w_0 * c - g_0 * s - (*self_0).scaleOffset * e_0) * m_0; + (*self_0).scaleOffset += (*self_0).scaleVelocity * t; + (*self_0).scaleVelocity *= d; + } + if rotateOrShearX != 0 { + (*self_0).rotateVelocity + -= ((w_0 * s + g_0 * c) * h + (*self_0).rotateOffset * e_0) + * m_0; + (*self_0).rotateOffset += (*self_0).rotateVelocity * t; + (*self_0).rotateVelocity *= d; + if a < t { + break; + } + let mut r_1: c_float = (*self_0).rotateOffset * mr + + ca; + c = spine_cosf(r_1); + s = sinf(r_1); + } else if a < t { + break; + } } - break; } } - _addCurvePosition( - p * 0.1f32, - x1, - y1, - cx1, - cy1, - cx2, - cy2, - x2, - y2, - out, - o, - (tangents != 0 || i > 0 as c_int && space_0 == 0 as c_int as c_float) as c_int, - ); + (*self_0).remaining = a; } - _ => {} + (*self_0).cx = (*bone).worldX; + (*self_0).cy = (*bone).worldY; } - i += 1; - o += 3 as c_int; + _ => {} } - return out; + if rotateOrShearX != 0 { + let mut o: c_float = (*self_0).rotateOffset * mix; + let mut s_0: c_float = 0 as c_int as c_float; + let mut c_0: c_float = 0 as c_int as c_float; + let mut a_0: c_float = 0 as c_int as c_float; + if (*(*self_0).data).shearX > 0 as c_int as c_float { + let mut r_2: c_float = 0 as c_int as c_float; + if (*(*self_0).data).rotate > 0 as c_int as c_float { + r_2 = o * (*(*self_0).data).rotate; + s_0 = sinf(r_2); + c_0 = spine_cosf(r_2); + a_0 = (*bone).b; + (*bone).b = c_0 * a_0 - s_0 * (*bone).d; + (*bone).d = s_0 * a_0 + c_0 * (*bone).d; + } + r_2 += o * (*(*self_0).data).shearX; + s_0 = sinf(r_2); + c_0 = spine_cosf(r_2); + a_0 = (*bone).a; + (*bone).a = c_0 * a_0 - s_0 * (*bone).c; + (*bone).c = s_0 * a_0 + c_0 * (*bone).c; + } else { + o *= (*(*self_0).data).rotate; + s_0 = sinf(o); + c_0 = spine_cosf(o); + a_0 = (*bone).a; + (*bone).a = c_0 * a_0 - s_0 * (*bone).c; + (*bone).c = s_0 * a_0 + c_0 * (*bone).c; + a_0 = (*bone).b; + (*bone).b = c_0 * a_0 - s_0 * (*bone).d; + (*bone).d = s_0 * a_0 + c_0 * (*bone).d; + } + } + if scaleX != 0 { + let mut s_1: c_float = 1 as c_int as c_float + + (*self_0).scaleOffset * mix * (*(*self_0).data).scaleX; + (*bone).a *= s_1; + (*bone).c *= s_1; + } + if physics as c_uint != SP_PHYSICS_POSE as c_int as c_uint { + (*self_0).tx = l * (*bone).a; + (*self_0).ty = l * (*bone).c; + } + spBone_updateAppliedTransform(bone); } #[no_mangle] -pub unsafe extern "C" fn spPathConstraintData_create( +pub unsafe extern "C" fn spPhysicsConstraint_rotate( + mut self_0: *mut spPhysicsConstraint, + mut x: c_float, + mut y: c_float, + mut degrees: c_float, +) { + let mut r: c_float = degrees + * (3.1415926535897932385f32 / 180 as c_int as c_float); + let mut cosine: c_float = spine_cosf(r); + let mut sine: c_float = sinf(r); + let mut dx: c_float = (*self_0).cx - x; + let mut dy: c_float = (*self_0).cy - y; + spPhysicsConstraint_translate( + self_0, + dx * cosine - dy * sine - dx, + dx * sine + dy * cosine - dy, + ); +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraint_translate( + mut self_0: *mut spPhysicsConstraint, + mut x: c_float, + mut y: c_float, +) { + (*self_0).ux -= x; + (*self_0).uy -= y; + (*self_0).cx -= x; + (*self_0).cy -= y; +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraintData_create( mut name: *const c_char, -) -> *mut spPathConstraintData { - let mut self_0: *mut spPathConstraintData = _spCalloc( +) -> *mut spPhysicsConstraintData { + let mut self_0: *mut spPhysicsConstraintData = _spCalloc( 1 as c_int as size_t, - ::core::mem::size_of::() as c_ulong, + ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 7332 as c_int, - ) as *mut spPathConstraintData; - let ref mut fresh81 = *(&mut (*self_0).name as *mut *mut c_char); - *fresh81 = _spMalloc( + 7895 as c_int, + ) as *mut spPhysicsConstraintData; + (*self_0) + .name = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen(name)).wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 7333 as c_int, + 7896 as c_int, ) as *mut c_char; - spine_strcpy(*fresh81, name); + spine_strcpy((*self_0).name, name); + (*self_0).bone = 0 as *mut spBoneData; + (*self_0).x = 0 as c_int as c_float; + (*self_0).y = 0 as c_int as c_float; + (*self_0).rotate = 0 as c_int as c_float; + (*self_0).scaleX = 0 as c_int as c_float; + (*self_0).shearX = 0 as c_int as c_float; + (*self_0).limit = 0 as c_int as c_float; + (*self_0).step = 0 as c_int as c_float; + (*self_0).inertia = 0 as c_int as c_float; + (*self_0).strength = 0 as c_int as c_float; + (*self_0).damping = 0 as c_int as c_float; + (*self_0).massInverse = 0 as c_int as c_float; + (*self_0).wind = 0 as c_int as c_float; + (*self_0).gravity = 0 as c_int as c_float; + (*self_0).mix = 0 as c_int as c_float; + (*self_0).inertiaGlobal = 0 as c_int; + (*self_0).strengthGlobal = 0 as c_int; + (*self_0).dampingGlobal = 0 as c_int; + (*self_0).massGlobal = 0 as c_int; + (*self_0).windGlobal = 0 as c_int; + (*self_0).gravityGlobal = 0 as c_int; + (*self_0).mixGlobal = 0 as c_int; return self_0; } #[no_mangle] -pub unsafe extern "C" fn spPathConstraintData_dispose(mut self_0: *mut spPathConstraintData) { +pub unsafe extern "C" fn spPhysicsConstraintData_dispose( + mut self_0: *mut spPhysicsConstraintData, +) { _spFree((*self_0).name as *mut c_void); - _spFree((*self_0).bones as *mut c_void); _spFree(self_0 as *mut c_void); } #[no_mangle] @@ -13938,15 +15923,18 @@ pub unsafe extern "C" fn spPointAttachment_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 7391 as c_int, + 7975 as c_int, ) as *mut spPointAttachment; _spAttachment_init( &mut (*self_0).super_0, name, SP_ATTACHMENT_POINT, - Some(_spPointAttachment_dispose as unsafe extern "C" fn(*mut spAttachment) -> ()), Some( - _spPointAttachment_copy as unsafe extern "C" fn(*mut spAttachment) -> *mut spAttachment, + _spPointAttachment_dispose as unsafe extern "C" fn(*mut spAttachment) -> (), + ), + Some( + _spPointAttachment_copy + as unsafe extern "C" fn(*mut spAttachment) -> *mut spAttachment, ), ); return self_0; @@ -13966,15 +15954,14 @@ pub unsafe extern "C" fn spPointAttachment_computeWorldRotation( mut self_0: *mut spPointAttachment, mut bone: *mut spBone, ) -> c_float { - let mut cosine: c_float = 0.; - let mut sine: c_float = 0.; - let mut x: c_float = 0.; - let mut y: c_float = 0.; - cosine = spine_cosf((*self_0).rotation * (3.1415926535897932385f32 / 180 as c_int as c_float)); - sine = spine_sinf((*self_0).rotation * (3.1415926535897932385f32 / 180 as c_int as c_float)); - x = cosine * (*bone).a + sine * (*bone).b; - y = cosine * (*bone).c + sine * (*bone).d; - return spine_atan2f(y, x) * (180 as c_int as c_float / 3.1415926535897932385f32); + let mut r: c_float = (*self_0).rotation + * (3.1415926535897932385f32 / 180 as c_int as c_float); + let mut cosine: c_float = spine_cosf(r); + let mut sine: c_float = sinf(r); + let mut x: c_float = cosine * (*bone).a + sine * (*bone).b; + let mut y: c_float = cosine * (*bone).c + sine * (*bone).d; + return spine_atan2f(y, x) + * (180 as c_int as c_float / 3.1415926535897932385f32); } #[no_mangle] pub unsafe extern "C" fn _spRegionAttachment_dispose(mut attachment: *mut spAttachment) { @@ -13991,17 +15978,22 @@ pub unsafe extern "C" fn _spRegionAttachment_copy( mut attachment: *mut spAttachment, ) -> *mut spAttachment { let mut self_0: *mut spRegionAttachment = attachment as *mut spRegionAttachment; - let mut copy: *mut spRegionAttachment = spRegionAttachment_create((*attachment).name); + let mut copy: *mut spRegionAttachment = spRegionAttachment_create( + (*attachment).name, + ); (*copy).region = (*self_0).region; (*copy).rendererObject = (*self_0).rendererObject; - let ref mut fresh82 = *(&mut (*copy).path as *mut *const c_char as *mut *mut c_char); - *fresh82 = _spMalloc( + (*copy) + .path = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen((*self_0).path)).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen((*self_0).path)) + .wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 7465 as c_int, + 8047 as c_int, ) as *mut c_char; - spine_strcpy(*fresh82, (*self_0).path); + spine_strcpy((*copy).path, (*self_0).path); (*copy).x = (*self_0).x; (*copy).y = (*self_0).y; (*copy).scaleX = (*self_0).scaleX; @@ -14012,18 +16004,21 @@ pub unsafe extern "C" fn _spRegionAttachment_copy( spine_memcpy( ((*copy).uvs).as_mut_ptr() as *mut c_void, ((*self_0).uvs).as_mut_ptr() as *const c_void, - (::core::mem::size_of::() as c_ulong).wrapping_mul(8 as c_int as c_ulong), + (::core::mem::size_of::() as c_ulong) + .wrapping_mul(8 as c_int as c_ulong), ); spine_memcpy( ((*copy).offset).as_mut_ptr() as *mut c_void, ((*self_0).offset).as_mut_ptr() as *const c_void, - (::core::mem::size_of::() as c_ulong).wrapping_mul(8 as c_int as c_ulong), + (::core::mem::size_of::() as c_ulong) + .wrapping_mul(8 as c_int as c_ulong), ); spColor_setFromColor(&mut (*copy).color, &mut (*self_0).color); - (*copy).sequence = if !((*self_0).sequence).is_null() { + (*copy) + .sequence = if !((*self_0).sequence).is_null() { spSequence_copy((*self_0).sequence) } else { - std::ptr::null_mut() + 0 as *mut spSequence }; return &mut (*copy).super_0; } @@ -14035,7 +16030,7 @@ pub unsafe extern "C" fn spRegionAttachment_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 7481 as c_int, + 8063 as c_int, ) as *mut spRegionAttachment; (*self_0).scaleX = 1 as c_int as c_float; (*self_0).scaleY = 1 as c_int as c_float; @@ -14050,7 +16045,9 @@ pub unsafe extern "C" fn spRegionAttachment_create( &mut (*self_0).super_0, name, SP_ATTACHMENT_REGION, - Some(_spRegionAttachment_dispose as unsafe extern "C" fn(*mut spAttachment) -> ()), + Some( + _spRegionAttachment_dispose as unsafe extern "C" fn(*mut spAttachment) -> (), + ), Some( _spRegionAttachment_copy as unsafe extern "C" fn(*mut spAttachment) -> *mut spAttachment, @@ -14059,7 +16056,9 @@ pub unsafe extern "C" fn spRegionAttachment_create( return self_0; } #[no_mangle] -pub unsafe extern "C" fn spRegionAttachment_updateRegion(mut self_0: *mut spRegionAttachment) { +pub unsafe extern "C" fn spRegionAttachment_updateRegion( + mut self_0: *mut spRegionAttachment, +) { let mut regionScaleX: c_float = 0.; let mut regionScaleY: c_float = 0.; let mut localX: c_float = 0.; @@ -14088,19 +16087,20 @@ pub unsafe extern "C" fn spRegionAttachment_updateRegion(mut self_0: *mut spRegi (*self_0).uvs[7 as c_int as usize] = 0 as c_int as c_float; return; } - regionScaleX = - (*self_0).width / (*(*self_0).region).originalWidth as c_float * (*self_0).scaleX; - regionScaleY = - (*self_0).height / (*(*self_0).region).originalHeight as c_float * (*self_0).scaleY; + regionScaleX = (*self_0).width / (*(*self_0).region).originalWidth as c_float + * (*self_0).scaleX; + regionScaleY = (*self_0).height / (*(*self_0).region).originalHeight as c_float + * (*self_0).scaleY; localX = -(*self_0).width / 2 as c_int as c_float * (*self_0).scaleX + (*(*self_0).region).offsetX * regionScaleX; localY = -(*self_0).height / 2 as c_int as c_float * (*self_0).scaleY + (*(*self_0).region).offsetY * regionScaleY; localX2 = localX + (*(*self_0).region).width as c_float * regionScaleX; localY2 = localY + (*(*self_0).region).height as c_float * regionScaleY; - radians = (*self_0).rotation * (3.1415926535897932385f32 / 180 as c_int as c_float); + radians = (*self_0).rotation + * (3.1415926535897932385f32 / 180 as c_int as c_float); cosine = spine_cosf(radians); - sine = spine_sinf(radians); + sine = sinf(radians); localXCos = localX * cosine + (*self_0).x; localXSin = localX * sine; localYCos = localY * cosine + (*self_0).y; @@ -14157,26 +16157,34 @@ pub unsafe extern "C" fn spRegionAttachment_computeWorldVertices( offsetX = *offsets.offset(BRX as c_int as isize); offsetY = *offsets.offset(BRY as c_int as isize); *vertices.offset(offset as isize) = offsetX * (*bone).a + offsetY * (*bone).b + x; - *vertices.offset((offset + 1 as c_int) as isize) = - offsetX * (*bone).c + offsetY * (*bone).d + y; + *vertices + .offset( + (offset + 1 as c_int) as isize, + ) = offsetX * (*bone).c + offsetY * (*bone).d + y; offset += stride; offsetX = *offsets.offset(BLX as c_int as isize); offsetY = *offsets.offset(BLY as c_int as isize); *vertices.offset(offset as isize) = offsetX * (*bone).a + offsetY * (*bone).b + x; - *vertices.offset((offset + 1 as c_int) as isize) = - offsetX * (*bone).c + offsetY * (*bone).d + y; + *vertices + .offset( + (offset + 1 as c_int) as isize, + ) = offsetX * (*bone).c + offsetY * (*bone).d + y; offset += stride; offsetX = *offsets.offset(ULX as c_int as isize); offsetY = *offsets.offset(ULY as c_int as isize); *vertices.offset(offset as isize) = offsetX * (*bone).a + offsetY * (*bone).b + x; - *vertices.offset((offset + 1 as c_int) as isize) = - offsetX * (*bone).c + offsetY * (*bone).d + y; + *vertices + .offset( + (offset + 1 as c_int) as isize, + ) = offsetX * (*bone).c + offsetY * (*bone).d + y; offset += stride; offsetX = *offsets.offset(URX as c_int as isize); offsetY = *offsets.offset(URY as c_int as isize); *vertices.offset(offset as isize) = offsetX * (*bone).a + offsetY * (*bone).b + x; - *vertices.offset((offset + 1 as c_int) as isize) = - offsetX * (*bone).c + offsetY * (*bone).d + y; + *vertices + .offset( + (offset + 1 as c_int) as isize, + ) = offsetX * (*bone).c + offsetY * (*bone).d + y; } #[no_mangle] pub unsafe extern "C" fn spTextureRegionArray_create( @@ -14186,25 +16194,30 @@ pub unsafe extern "C" fn spTextureRegionArray_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 7618 as c_int, + 8200 as c_int, ) as *mut spTextureRegionArray; (*array).size = 0 as c_int; (*array).capacity = initialCapacity; - (*array).items = _spCalloc( + (*array) + .items = _spCalloc( initialCapacity as size_t, ::core::mem::size_of::<*mut spTextureRegion>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 7618 as c_int, + 8200 as c_int, ) as *mut *mut spTextureRegion; return array; } #[no_mangle] -pub unsafe extern "C" fn spTextureRegionArray_dispose(mut self_0: *mut spTextureRegionArray) { +pub unsafe extern "C" fn spTextureRegionArray_dispose( + mut self_0: *mut spTextureRegionArray, +) { _spFree((*self_0).items as *mut c_void); _spFree(self_0 as *mut c_void); } #[no_mangle] -pub unsafe extern "C" fn spTextureRegionArray_clear(mut self_0: *mut spTextureRegionArray) { +pub unsafe extern "C" fn spTextureRegionArray_clear( + mut self_0: *mut spTextureRegionArray, +) { (*self_0).size = 0 as c_int; } #[no_mangle] @@ -14214,12 +16227,16 @@ pub unsafe extern "C" fn spTextureRegionArray_setSize( ) -> *mut spTextureRegionArray { (*self_0).size = newSize; if (*self_0).capacity < newSize { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spTextureRegion>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -14236,7 +16253,8 @@ pub unsafe extern "C" fn spTextureRegionArray_ensureCapacity( return; } (*self_0).capacity = newCapacity; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spTextureRegion>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -14248,21 +16266,25 @@ pub unsafe extern "C" fn spTextureRegionArray_add( mut value: *mut spTextureRegion, ) { if (*self_0).size == (*self_0).capacity { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spTextureRegion>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), ) as *mut *mut spTextureRegion; } - let fresh83 = (*self_0).size; + let fresh52 = (*self_0).size; (*self_0).size = (*self_0).size + 1; - let ref mut fresh84 = *((*self_0).items).offset(fresh83 as isize); - *fresh84 = value; + let ref mut fresh53 = *((*self_0).items).offset(fresh52 as isize); + *fresh53 = value; } #[no_mangle] pub unsafe extern "C" fn spTextureRegionArray_addAll( @@ -14297,9 +16319,8 @@ pub unsafe extern "C" fn spTextureRegionArray_removeAt( (*self_0).size -= 1; spine_memmove( ((*self_0).items).offset(index as isize) as *mut c_void, - ((*self_0).items) - .offset(index as isize) - .offset(1 as c_int as isize) as *const c_void, + ((*self_0).items).offset(index as isize).offset(1 as c_int as isize) + as *const c_void, (::core::mem::size_of::<*mut spTextureRegion>() as c_ulong) .wrapping_mul(((*self_0).size - index) as c_ulong), ); @@ -14327,7 +16348,8 @@ pub unsafe extern "C" fn spTextureRegionArray_pop( mut self_0: *mut spTextureRegionArray, ) -> *mut spTextureRegion { (*self_0).size -= 1; - let mut item: *mut spTextureRegion = *((*self_0).items).offset((*self_0).size as isize); + let mut item: *mut spTextureRegion = *((*self_0).items) + .offset((*self_0).size as isize); return item; } #[no_mangle] @@ -14338,16 +16360,18 @@ pub unsafe extern "C" fn spTextureRegionArray_peek( } static mut nextSequenceId: c_int = 0 as c_int; #[no_mangle] -pub unsafe extern "C" fn spSequence_create(mut numRegions: c_int) -> *mut spSequence { +pub unsafe extern "C" fn spSequence_create( + mut numRegions: c_int, +) -> *mut spSequence { let mut self_0: *mut spSequence = _spCalloc( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 7623 as c_int, + 8205 as c_int, ) as *mut spSequence; - let fresh85 = nextSequenceId; + let fresh54 = nextSequenceId; nextSequenceId = nextSequenceId + 1; - (*self_0).id = fresh85; + (*self_0).id = fresh54; (*self_0).regions = spTextureRegionArray_create(numRegions); spTextureRegionArray_setSize((*self_0).regions, numRegions); return self_0; @@ -14358,12 +16382,14 @@ pub unsafe extern "C" fn spSequence_dispose(mut self_0: *mut spSequence) { _spFree(self_0 as *mut c_void); } #[no_mangle] -pub unsafe extern "C" fn spSequence_copy(mut self_0: *mut spSequence) -> *mut spSequence { +pub unsafe extern "C" fn spSequence_copy( + mut self_0: *mut spSequence, +) -> *mut spSequence { let mut i: c_int = 0 as c_int; let mut copy: *mut spSequence = spSequence_create((*(*self_0).regions).size); while i < (*(*self_0).regions).size { - let ref mut fresh86 = *((*(*copy).regions).items).offset(i as isize); - *fresh86 = *((*(*self_0).regions).items).offset(i as isize); + let ref mut fresh55 = *((*(*copy).regions).items).offset(i as isize); + *fresh55 = *((*(*self_0).regions).items).offset(i as isize); i += 1; } (*copy).start = (*self_0).start; @@ -14378,7 +16404,7 @@ pub unsafe extern "C" fn spSequence_apply( mut attachment: *mut spAttachment, ) { let mut index: c_int = (*slot).sequenceIndex; - let mut region: *mut spTextureRegion = std::ptr::null_mut(); + let mut region: *mut spTextureRegion = 0 as *mut spTextureRegion; if index == -(1 as c_int) { index = (*self_0).setupIndex; } @@ -14386,16 +16412,22 @@ pub unsafe extern "C" fn spSequence_apply( index = (*(*self_0).regions).size - 1 as c_int; } region = *((*(*self_0).regions).items).offset(index as isize); - if (*attachment).type_0 as c_uint == SP_ATTACHMENT_REGION as c_int as c_uint { - let mut regionAttachment: *mut spRegionAttachment = attachment as *mut spRegionAttachment; + if (*attachment).type_0 as c_uint + == SP_ATTACHMENT_REGION as c_int as c_uint + { + let mut regionAttachment: *mut spRegionAttachment = attachment + as *mut spRegionAttachment; if (*regionAttachment).region != region { (*regionAttachment).rendererObject = region as *mut c_void; (*regionAttachment).region = region; spRegionAttachment_updateRegion(regionAttachment); } } - if (*attachment).type_0 as c_uint == SP_ATTACHMENT_MESH as c_int as c_uint { - let mut meshAttachment: *mut spMeshAttachment = attachment as *mut spMeshAttachment; + if (*attachment).type_0 as c_uint + == SP_ATTACHMENT_MESH as c_int as c_uint + { + let mut meshAttachment: *mut spMeshAttachment = attachment + as *mut spMeshAttachment; if (*meshAttachment).region != region { (*meshAttachment).rendererObject = region as *mut c_void; (*meshAttachment).region = region; @@ -14418,7 +16450,10 @@ unsafe extern "C" fn num_digits(mut value: c_int) -> c_int { } return count; } -unsafe extern "C" fn string_append(mut str: *mut c_char, mut b: *const c_char) -> *mut c_char { +unsafe extern "C" fn string_append( + mut str: *mut c_char, + mut b: *const c_char, +) -> *mut c_char { let mut lenB: c_int = spine_strlen(b) as c_int; spine_memcpy( str as *mut c_void, @@ -14427,10 +16462,14 @@ unsafe extern "C" fn string_append(mut str: *mut c_char, mut b: *const c_char) - ); return str.offset(lenB as isize); } -unsafe extern "C" fn string_append_int(mut str: *mut c_char, mut value: c_int) -> *mut c_char { +unsafe extern "C" fn string_append_int( + mut str: *mut c_char, + mut value: c_int, +) -> *mut c_char { let mut intStr: [c_char; 20] = [0; 20]; - spine_sprintf!( + snprintf( intStr.as_mut_ptr(), + 20 as c_int as c_ulong, b"%i\0" as *const u8 as *const c_char, value, ); @@ -14453,58 +16492,76 @@ pub unsafe extern "C" fn spSequence_getPath( path = string_append_int(path, (*self_0).start + index); } #[no_mangle] -pub unsafe extern "C" fn spSkeleton_create(mut data: *mut spSkeletonData) -> *mut spSkeleton { +pub unsafe extern "C" fn spSkeleton_create( + mut data: *mut spSkeletonData, +) -> *mut spSkeleton { let mut i: c_int = 0; - let mut childrenCounts: *mut c_int = std::ptr::null_mut(); + let mut childrenCounts: *mut c_int = 0 as *mut c_int; let mut internal: *mut _spSkeleton = _spCalloc( 1 as c_int as size_t, ::core::mem::size_of::<_spSkeleton>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 7758 as c_int, + 8341 as c_int, ) as *mut _spSkeleton; let mut self_0: *mut spSkeleton = &mut (*internal).super_0; - let ref mut fresh87 = *(&mut (*self_0).data as *mut *mut spSkeletonData); - *fresh87 = data; + (*self_0).data = data; + (*self_0).skin = 0 as *mut spSkin; + spColor_setFromFloats( + &mut (*self_0).color, + 1 as c_int as c_float, + 1 as c_int as c_float, + 1 as c_int as c_float, + 1 as c_int as c_float, + ); + (*self_0).scaleX = 1 as c_int as c_float; + (*self_0).scaleY = 1 as c_int as c_float; + (*self_0).time = 0 as c_int as c_float; (*self_0).bonesCount = (*(*self_0).data).bonesCount; - (*self_0).bones = _spMalloc( + (*self_0) + .bones = _spMalloc( (::core::mem::size_of::<*mut spBone>() as c_ulong) .wrapping_mul((*self_0).bonesCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 7763 as c_int, + 8351 as c_int, ) as *mut *mut spBone; childrenCounts = _spCalloc( (*self_0).bonesCount as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 7764 as c_int, + 8352 as c_int, ) as *mut c_int; i = 0 as c_int; while i < (*self_0).bonesCount { - let mut boneData: *mut spBoneData = *((*(*self_0).data).bones).offset(i as isize); - let mut newBone: *mut spBone = std::ptr::null_mut(); + let mut boneData: *mut spBoneData = *((*(*self_0).data).bones) + .offset(i as isize); + let mut newBone: *mut spBone = 0 as *mut spBone; if ((*boneData).parent).is_null() { - newBone = spBone_create(boneData, self_0, std::ptr::null_mut()); + newBone = spBone_create(boneData, self_0, 0 as *mut spBone); } else { - let mut parent: *mut spBone = - *((*self_0).bones).offset((*(*boneData).parent).index as isize); + let mut parent: *mut spBone = *((*self_0).bones) + .offset((*(*boneData).parent).index as isize); newBone = spBone_create(boneData, self_0, parent); - let ref mut fresh88 = *childrenCounts.offset((*(*boneData).parent).index as isize); - *fresh88 += 1; + let ref mut fresh56 = *childrenCounts + .offset((*(*boneData).parent).index as isize); + *fresh56 += 1; } - let ref mut fresh89 = *((*self_0).bones).offset(i as isize); - *fresh89 = newBone; + let ref mut fresh57 = *((*self_0).bones).offset(i as isize); + *fresh57 = newBone; i += 1; } i = 0 as c_int; while i < (*self_0).bonesCount { - let mut boneData_0: *mut spBoneData = *((*(*self_0).data).bones).offset(i as isize); + let mut boneData_0: *mut spBoneData = *((*(*self_0).data).bones) + .offset(i as isize); let mut bone: *mut spBone = *((*self_0).bones).offset(i as isize); - let ref mut fresh90 = *(&mut (*bone).children as *mut *mut *mut spBone); - *fresh90 = _spMalloc( + (*bone) + .children = _spMalloc( (::core::mem::size_of::<*mut spBone>() as c_ulong) - .wrapping_mul(*childrenCounts.offset((*boneData_0).index as isize) as c_ulong), + .wrapping_mul( + *childrenCounts.offset((*boneData_0).index as isize) as c_ulong, + ), b"spine.c\0" as *const u8 as *const c_char, - 7781 as c_int, + 8369 as c_int, ) as *mut *mut spBone; i += 1; } @@ -14513,40 +16570,42 @@ pub unsafe extern "C" fn spSkeleton_create(mut data: *mut spSkeletonData) -> *mu let mut bone_0: *mut spBone = *((*self_0).bones).offset(i as isize); let mut parent_0: *mut spBone = (*bone_0).parent; if !parent_0.is_null() { - let fresh91 = (*parent_0).childrenCount; + let fresh58 = (*parent_0).childrenCount; (*parent_0).childrenCount = (*parent_0).childrenCount + 1; - let ref mut fresh92 = *((*parent_0).children).offset(fresh91 as isize); - *fresh92 = bone_0; + let ref mut fresh59 = *((*parent_0).children).offset(fresh58 as isize); + *fresh59 = bone_0; } i += 1; } - let ref mut fresh93 = *(&mut (*self_0).root as *mut *mut spBone); - *fresh93 = if (*self_0).bonesCount > 0 as c_int { + (*self_0) + .root = if (*self_0).bonesCount > 0 as c_int { *((*self_0).bones).offset(0 as c_int as isize) } else { - std::ptr::null_mut() + 0 as *mut spBone }; (*self_0).slotsCount = (*data).slotsCount; - (*self_0).slots = _spMalloc( + (*self_0) + .slots = _spMalloc( (::core::mem::size_of::<*mut spSlot>() as c_ulong) .wrapping_mul((*self_0).slotsCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 7792 as c_int, + 8380 as c_int, ) as *mut *mut spSlot; i = 0 as c_int; while i < (*self_0).slotsCount { let mut slotData: *mut spSlotData = *((*data).slots).offset(i as isize); - let mut bone_1: *mut spBone = - *((*self_0).bones).offset((*(*slotData).boneData).index as isize); - let ref mut fresh94 = *((*self_0).slots).offset(i as isize); - *fresh94 = spSlot_create(slotData, bone_1); + let mut bone_1: *mut spBone = *((*self_0).bones) + .offset((*(*slotData).boneData).index as isize); + let ref mut fresh60 = *((*self_0).slots).offset(i as isize); + *fresh60 = spSlot_create(slotData, bone_1); i += 1; } - (*self_0).drawOrder = _spMalloc( + (*self_0) + .drawOrder = _spMalloc( (::core::mem::size_of::<*mut spSlot>() as c_ulong) .wrapping_mul((*self_0).slotsCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 7799 as c_int, + 8387 as c_int, ) as *mut *mut spSlot; spine_memcpy( (*self_0).drawOrder as *mut c_void, @@ -14555,53 +16614,73 @@ pub unsafe extern "C" fn spSkeleton_create(mut data: *mut spSkeletonData) -> *mu .wrapping_mul((*self_0).slotsCount as c_ulong), ); (*self_0).ikConstraintsCount = (*data).ikConstraintsCount; - (*self_0).ikConstraints = _spMalloc( + (*self_0) + .ikConstraints = _spMalloc( (::core::mem::size_of::<*mut spIkConstraint>() as c_ulong) .wrapping_mul((*self_0).ikConstraintsCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 7803 as c_int, + 8391 as c_int, ) as *mut *mut spIkConstraint; i = 0 as c_int; while i < (*(*self_0).data).ikConstraintsCount { - let ref mut fresh95 = *((*self_0).ikConstraints).offset(i as isize); - *fresh95 = spIkConstraint_create( + let ref mut fresh61 = *((*self_0).ikConstraints).offset(i as isize); + *fresh61 = spIkConstraint_create( *((*(*self_0).data).ikConstraints).offset(i as isize), self_0, ); i += 1; } (*self_0).transformConstraintsCount = (*data).transformConstraintsCount; - (*self_0).transformConstraints = _spMalloc( + (*self_0) + .transformConstraints = _spMalloc( (::core::mem::size_of::<*mut spTransformConstraint>() as c_ulong) .wrapping_mul((*self_0).transformConstraintsCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 7808 as c_int, + 8396 as c_int, ) as *mut *mut spTransformConstraint; i = 0 as c_int; while i < (*(*self_0).data).transformConstraintsCount { - let ref mut fresh96 = *((*self_0).transformConstraints).offset(i as isize); - *fresh96 = spTransformConstraint_create( + let ref mut fresh62 = *((*self_0).transformConstraints).offset(i as isize); + *fresh62 = spTransformConstraint_create( *((*(*self_0).data).transformConstraints).offset(i as isize), self_0, ); i += 1; } (*self_0).pathConstraintsCount = (*data).pathConstraintsCount; - (*self_0).pathConstraints = _spMalloc( + (*self_0) + .pathConstraints = _spMalloc( (::core::mem::size_of::<*mut spPathConstraint>() as c_ulong) .wrapping_mul((*self_0).pathConstraintsCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 7813 as c_int, + 8401 as c_int, ) as *mut *mut spPathConstraint; i = 0 as c_int; while i < (*(*self_0).data).pathConstraintsCount { - let ref mut fresh97 = *((*self_0).pathConstraints).offset(i as isize); - *fresh97 = spPathConstraint_create( + let ref mut fresh63 = *((*self_0).pathConstraints).offset(i as isize); + *fresh63 = spPathConstraint_create( *((*(*self_0).data).pathConstraints).offset(i as isize), self_0, ); i += 1; } + (*self_0).physicsConstraintsCount = (*data).physicsConstraintsCount; + (*self_0) + .physicsConstraints = _spMalloc( + (::core::mem::size_of::<*mut spPhysicsConstraint>() as c_ulong) + .wrapping_mul((*self_0).physicsConstraintsCount as c_ulong), + b"spine.c\0" as *const u8 as *const c_char, + 8406 as c_int, + ) as *mut *mut spPhysicsConstraint; + i = 0 as c_int; + while i < (*(*self_0).data).physicsConstraintsCount { + let ref mut fresh64 = *((*self_0).physicsConstraints).offset(i as isize); + *fresh64 = spPhysicsConstraint_create( + *((*(*self_0).data).physicsConstraints).offset(i as isize), + self_0, + ); + i += 1; + } spColor_setFromFloats( &mut (*self_0).color, 1 as c_int as c_float, @@ -14611,6 +16690,7 @@ pub unsafe extern "C" fn spSkeleton_create(mut data: *mut spSkeletonData) -> *mu ); (*self_0).scaleX = 1 as c_int as c_float; (*self_0).scaleY = 1 as c_int as c_float; + (*self_0).time = 0 as c_int as c_float; spSkeleton_updateCache(self_0); _spFree(childrenCounts as *mut c_void); return self_0; @@ -14640,7 +16720,9 @@ pub unsafe extern "C" fn spSkeleton_dispose(mut self_0: *mut spSkeleton) { _spFree((*self_0).ikConstraints as *mut c_void); i = 0 as c_int; while i < (*self_0).transformConstraintsCount { - spTransformConstraint_dispose(*((*self_0).transformConstraints).offset(i as isize)); + spTransformConstraint_dispose( + *((*self_0).transformConstraints).offset(i as isize), + ); i += 1; } _spFree((*self_0).transformConstraints as *mut c_void); @@ -14650,6 +16732,12 @@ pub unsafe extern "C" fn spSkeleton_dispose(mut self_0: *mut spSkeleton) { i += 1; } _spFree((*self_0).pathConstraints as *mut c_void); + i = 0 as c_int; + while i < (*self_0).physicsConstraintsCount { + spPhysicsConstraint_dispose(*((*self_0).physicsConstraints).offset(i as isize)); + i += 1; + } + _spFree((*self_0).physicsConstraints as *mut c_void); _spFree((*self_0).drawOrder as *mut c_void); _spFree(self_0 as *mut c_void); } @@ -14658,10 +16746,11 @@ unsafe extern "C" fn _addToUpdateCache( mut type_0: _spUpdateType, mut object: *mut c_void, ) { - let mut update: *mut _spUpdate = std::ptr::null_mut(); + let mut update: *mut _spUpdate = 0 as *mut _spUpdate; if (*internal).updateCacheCount == (*internal).updateCacheCapacity { (*internal).updateCacheCapacity *= 2 as c_int; - (*internal).updateCache = _spRealloc( + (*internal) + .updateCache = _spRealloc( (*internal).updateCache as *mut c_void, (::core::mem::size_of::<_spUpdate>() as c_ulong) .wrapping_mul((*internal).updateCacheCapacity as c_ulong), @@ -14688,9 +16777,11 @@ unsafe extern "C" fn _sortPathConstraintAttachmentBones( mut slotBone: *mut spBone, ) { let mut pathAttachment: *mut spPathAttachment = attachment as *mut spPathAttachment; - let mut pathBones: *mut c_int = std::ptr::null_mut(); + let mut pathBones: *mut c_int = 0 as *mut c_int; let mut pathBonesCount: c_int = 0; - if (*pathAttachment).super_0.super_0.type_0 as c_uint != SP_ATTACHMENT_PATH as c_int as c_uint { + if (*pathAttachment).super_0.super_0.type_0 as c_uint + != SP_ATTACHMENT_PATH as c_int as c_uint + { return; } pathBones = (*pathAttachment).super_0.bones; @@ -14704,16 +16795,16 @@ unsafe extern "C" fn _sortPathConstraintAttachmentBones( i = 0 as c_int; n = pathBonesCount; while i < n { - let fresh98 = i; + let fresh65 = i; i = i + 1; - let mut nn: c_int = *pathBones.offset(fresh98 as isize); + let mut nn: c_int = *pathBones.offset(fresh65 as isize); nn += i; while i < nn { - let fresh99 = i; + let fresh66 = i; i = i + 1; _sortBone( internal, - *bones.offset(*pathBones.offset(fresh99 as isize) as isize), + *bones.offset(*pathBones.offset(fresh66 as isize) as isize), ); } } @@ -14733,7 +16824,10 @@ unsafe extern "C" fn _sortPathConstraintAttachment( entry = (*entry).next; } } -unsafe extern "C" fn _sortReset(mut bones: *mut *mut spBone, mut bonesCount: c_int) { +unsafe extern "C" fn _sortReset( + mut bones: *mut *mut spBone, + mut bonesCount: c_int, +) { let mut i: c_int = 0; i = 0 as c_int; while i < bonesCount { @@ -14752,9 +16846,10 @@ unsafe extern "C" fn _sortIkConstraint( mut constraint: *mut spIkConstraint, ) { let mut target: *mut spBone = (*constraint).target; - let mut constrained: *mut *mut spBone = std::ptr::null_mut(); - let mut parent: *mut spBone = std::ptr::null_mut(); - (*constraint).active = ((*(*constraint).target).active != 0 + let mut constrained: *mut *mut spBone = 0 as *mut *mut spBone; + let mut parent: *mut spBone = 0 as *mut spBone; + (*constraint) + .active = ((*(*constraint).target).active != 0 && ((*(*constraint).data).skinRequired == 0 || !((*internal).super_0.skin).is_null() && spIkConstraintDataArray_contains( @@ -14769,13 +16864,21 @@ unsafe extern "C" fn _sortIkConstraint( parent = *constrained.offset(0 as c_int as isize); _sortBone(internal, parent); if (*constraint).bonesCount == 1 as c_int { - _addToUpdateCache(internal, SP_UPDATE_IK_CONSTRAINT, constraint as *mut c_void); + _addToUpdateCache( + internal, + SP_UPDATE_IK_CONSTRAINT, + constraint as *mut c_void, + ); _sortReset((*parent).children, (*parent).childrenCount); } else { - let mut child: *mut spBone = - *constrained.offset(((*constraint).bonesCount - 1 as c_int) as isize); + let mut child: *mut spBone = *constrained + .offset(((*constraint).bonesCount - 1 as c_int) as isize); _sortBone(internal, child); - _addToUpdateCache(internal, SP_UPDATE_IK_CONSTRAINT, constraint as *mut c_void); + _addToUpdateCache( + internal, + SP_UPDATE_IK_CONSTRAINT, + constraint as *mut c_void, + ); _sortReset((*parent).children, (*parent).childrenCount); (*child).sorted = 1 as c_int; }; @@ -14790,10 +16893,11 @@ unsafe extern "C" fn _sortPathConstraint( let mut i: c_int = 0; let mut n: c_int = 0; let mut boneCount: c_int = 0; - let mut attachment: *mut spAttachment = std::ptr::null_mut(); - let mut constrained: *mut *mut spBone = std::ptr::null_mut(); + let mut attachment: *mut spAttachment = 0 as *mut spAttachment; + let mut constrained: *mut *mut spBone = 0 as *mut *mut spBone; let mut skeleton: *mut spSkeleton = internal as *mut spSkeleton; - (*constraint).active = ((*(*(*constraint).target).bone).active != 0 + (*constraint) + .active = ((*(*(*constraint).target).bone).active != 0 && ((*(*constraint).data).skinRequired == 0 || !((*internal).super_0.skin).is_null() && spPathConstraintDataArray_contains( @@ -14829,7 +16933,8 @@ unsafe extern "C" fn _sortPathConstraint( } attachment = (*slot).attachment; if !attachment.is_null() - && (*attachment).type_0 as c_uint == SP_ATTACHMENT_PATH as c_int as c_uint + && (*attachment).type_0 as c_uint + == SP_ATTACHMENT_PATH as c_int as c_uint { _sortPathConstraintAttachmentBones(internal, attachment, slotBone); } @@ -14865,9 +16970,10 @@ unsafe extern "C" fn _sortTransformConstraint( ) { let mut i: c_int = 0; let mut boneCount: c_int = 0; - let mut constrained: *mut *mut spBone = std::ptr::null_mut(); - let mut child: *mut spBone = std::ptr::null_mut(); - (*constraint).active = ((*(*constraint).target).active != 0 + let mut constrained: *mut *mut spBone = 0 as *mut *mut spBone; + let mut child: *mut spBone = 0 as *mut spBone; + (*constraint) + .active = ((*(*constraint).target).active != 0 && ((*(*constraint).data).skinRequired == 0 || !((*internal).super_0.skin).is_null() && spTransformConstraintDataArray_contains( @@ -14914,29 +17020,60 @@ unsafe extern "C" fn _sortTransformConstraint( i += 1; } } +unsafe extern "C" fn _sortPhysicsConstraint( + internal: *mut _spSkeleton, + mut constraint: *mut spPhysicsConstraint, +) { + let mut bone: *mut spBone = (*constraint).bone; + (*constraint) + .active = ((*(*constraint).bone).active != 0 + && ((*(*constraint).data).skinRequired == 0 + || !((*internal).super_0.skin).is_null() + && spPhysicsConstraintDataArray_contains( + (*(*internal).super_0.skin).physicsConstraints, + (*constraint).data, + ) != 0)) as c_int; + if (*constraint).active == 0 { + return; + } + _sortBone(internal, bone); + _addToUpdateCache( + internal, + SP_UPDATE_PHYSICS_CONSTRAINT, + constraint as *mut c_void, + ); + _sortReset((*bone).children, (*bone).childrenCount); + (*bone).sorted = -(1 as c_int); +} #[no_mangle] pub unsafe extern "C" fn spSkeleton_updateCache(mut self_0: *mut spSkeleton) { let mut i: c_int = 0; let mut ii: c_int = 0; - let mut bones: *mut *mut spBone = std::ptr::null_mut(); - let mut ikConstraints: *mut *mut spIkConstraint = std::ptr::null_mut(); - let mut pathConstraints: *mut *mut spPathConstraint = std::ptr::null_mut(); - let mut transformConstraints: *mut *mut spTransformConstraint = std::ptr::null_mut(); + let mut bones: *mut *mut spBone = 0 as *mut *mut spBone; + let mut ikConstraints: *mut *mut spIkConstraint = 0 as *mut *mut spIkConstraint; + let mut pathConstraints: *mut *mut spPathConstraint = 0 + as *mut *mut spPathConstraint; + let mut transformConstraints: *mut *mut spTransformConstraint = 0 + as *mut *mut spTransformConstraint; + let mut physicsConstraints: *mut *mut spPhysicsConstraint = 0 + as *mut *mut spPhysicsConstraint; let mut ikCount: c_int = 0; let mut transformCount: c_int = 0; let mut pathCount: c_int = 0; + let mut physicsCount: c_int = 0; let mut constraintCount: c_int = 0; let mut internal: *mut _spSkeleton = self_0 as *mut _spSkeleton; - (*internal).updateCacheCapacity = (*self_0).bonesCount - + (*self_0).ikConstraintsCount - + (*self_0).transformConstraintsCount - + (*self_0).pathConstraintsCount; + (*internal) + .updateCacheCapacity = (*self_0).bonesCount + (*self_0).ikConstraintsCount + + (*self_0).transformConstraintsCount + (*self_0).pathConstraintsCount + + (*self_0).physicsConstraintsCount; _spFree((*internal).updateCache as *mut c_void); - (*internal).updateCache = _spMalloc( + (*internal) + .updateCache = _spMalloc( (::core::mem::size_of::<_spUpdate>() as c_ulong) .wrapping_mul((*internal).updateCacheCapacity as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 8035 as c_int, + 8653 as c_int, ) as *mut _spUpdate; (*internal).updateCacheCount = 0 as c_int; bones = (*self_0).bones; @@ -14967,42 +17104,58 @@ pub unsafe extern "C" fn spSkeleton_updateCache(mut self_0: *mut spSkeleton) { ikConstraints = (*self_0).ikConstraints; transformConstraints = (*self_0).transformConstraints; pathConstraints = (*self_0).pathConstraints; + physicsConstraints = (*self_0).physicsConstraints; ikCount = (*self_0).ikConstraintsCount; transformCount = (*self_0).transformConstraintsCount; pathCount = (*self_0).pathConstraintsCount; - constraintCount = ikCount + transformCount + pathCount; + physicsCount = (*self_0).physicsConstraintsCount; + constraintCount = ikCount + transformCount + pathCount + physicsCount; i = 0 as c_int; - 's_125: while i < constraintCount { + 's_133: while i < constraintCount { ii = 0 as c_int; while ii < ikCount { - let mut ikConstraint: *mut spIkConstraint = *ikConstraints.offset(ii as isize); + let mut ikConstraint: *mut spIkConstraint = *ikConstraints + .offset(ii as isize); if (*(*ikConstraint).data).order == i { _sortIkConstraint(internal, ikConstraint); i += 1; - continue 's_125; + continue 's_133; } else { ii += 1; } } ii = 0 as c_int; while ii < transformCount { - let mut transformConstraint: *mut spTransformConstraint = - *transformConstraints.offset(ii as isize); + let mut transformConstraint: *mut spTransformConstraint = *transformConstraints + .offset(ii as isize); if (*(*transformConstraint).data).order == i { _sortTransformConstraint(internal, transformConstraint); i += 1; - continue 's_125; + continue 's_133; } else { ii += 1; } } ii = 0 as c_int; while ii < pathCount { - let mut pathConstraint: *mut spPathConstraint = *pathConstraints.offset(ii as isize); + let mut pathConstraint: *mut spPathConstraint = *pathConstraints + .offset(ii as isize); if (*(*pathConstraint).data).order == i { _sortPathConstraint(internal, pathConstraint); i += 1; - continue 's_125; + continue 's_133; + } else { + ii += 1; + } + } + ii = 0 as c_int; + while ii < physicsCount { + let mut physicsConstraint: *mut spPhysicsConstraint = *physicsConstraints + .offset(ii as isize); + if (*(*physicsConstraint).data).order == i { + _sortPhysicsConstraint(internal, physicsConstraint); + i += 1; + continue 's_133; } else { ii += 1; } @@ -15016,7 +17169,10 @@ pub unsafe extern "C" fn spSkeleton_updateCache(mut self_0: *mut spSkeleton) { } } #[no_mangle] -pub unsafe extern "C" fn spSkeleton_updateWorldTransform(mut self_0: *const spSkeleton) { +pub unsafe extern "C" fn spSkeleton_updateWorldTransform( + mut self_0: *const spSkeleton, + mut physics: spPhysics, +) { let mut i: c_int = 0; let mut n: c_int = 0; let mut internal: *mut _spSkeleton = self_0 as *mut _spSkeleton; @@ -15044,20 +17200,36 @@ pub unsafe extern "C" fn spSkeleton_updateWorldTransform(mut self_0: *const spSk spIkConstraint_update((*update).object as *mut spIkConstraint); } 3 => { - spTransformConstraint_update((*update).object as *mut spTransformConstraint); + spTransformConstraint_update( + (*update).object as *mut spTransformConstraint, + ); } 2 => { spPathConstraint_update((*update).object as *mut spPathConstraint); } + 4 => { + spPhysicsConstraint_update( + (*update).object as *mut spPhysicsConstraint, + physics, + ); + } _ => {} } i += 1; } } #[no_mangle] +pub unsafe extern "C" fn spSkeleton_update( + mut self_0: *mut spSkeleton, + mut delta: c_float, +) { + (*self_0).time += delta; +} +#[no_mangle] pub unsafe extern "C" fn spSkeleton_updateWorldTransformWith( mut self_0: *const spSkeleton, mut parent: *const spBone, + mut physics: spPhysics, ) { let mut i: c_int = 0; let mut rotationY: c_float = 0.; @@ -15071,27 +17243,28 @@ pub unsafe extern "C" fn spSkeleton_updateWorldTransformWith( let mut pb: c_float = (*parent).b; let mut pc: c_float = (*parent).c; let mut pd: c_float = (*parent).d; - *(&mut (*rootBone).worldX as *mut c_float) = - pa * (*self_0).x + pb * (*self_0).y + (*parent).worldX; - *(&mut (*rootBone).worldY as *mut c_float) = - pc * (*self_0).x + pd * (*self_0).y + (*parent).worldY; - rotationY = (*rootBone).rotation + 90 as c_int as c_float + (*rootBone).shearY; + (*rootBone).worldX = pa * (*self_0).x + pb * (*self_0).y + (*parent).worldX; + (*rootBone).worldY = pc * (*self_0).x + pd * (*self_0).y + (*parent).worldY; + rotationY = (*rootBone).rotation + 90 as c_int as c_float + + (*rootBone).shearY; la = spine_cosf( ((*rootBone).rotation + (*rootBone).shearX) * (3.1415926535897932385f32 / 180 as c_int as c_float), ) * (*rootBone).scaleX; - lb = spine_cosf(rotationY * (3.1415926535897932385f32 / 180 as c_int as c_float)) - * (*rootBone).scaleY; - lc = spine_sinf( + lb = spine_cosf( + rotationY * (3.1415926535897932385f32 / 180 as c_int as c_float), + ) * (*rootBone).scaleY; + lc = sinf( ((*rootBone).rotation + (*rootBone).shearX) * (3.1415926535897932385f32 / 180 as c_int as c_float), ) * (*rootBone).scaleX; - ld = spine_sinf(rotationY * (3.1415926535897932385f32 / 180 as c_int as c_float)) - * (*rootBone).scaleY; - *(&mut (*rootBone).a as *mut c_float) = (pa * la + pb * lc) * (*self_0).scaleX; - *(&mut (*rootBone).b as *mut c_float) = (pa * lb + pb * ld) * (*self_0).scaleX; - *(&mut (*rootBone).c as *mut c_float) = (pc * la + pd * lc) * (*self_0).scaleY; - *(&mut (*rootBone).d as *mut c_float) = (pc * lb + pd * ld) * (*self_0).scaleY; + ld = sinf( + rotationY * (3.1415926535897932385f32 / 180 as c_int as c_float), + ) * (*rootBone).scaleY; + (*rootBone).a = (pa * la + pb * lc) * (*self_0).scaleX; + (*rootBone).b = (pa * lb + pb * ld) * (*self_0).scaleX; + (*rootBone).c = (pc * la + pd * lc) * (*self_0).scaleY; + (*rootBone).d = (pc * lb + pd * ld) * (*self_0).scaleY; i = 0 as c_int; while i < (*internal).updateCacheCount { let mut update: *mut _spUpdate = ((*internal).updateCache).offset(i as isize); @@ -15105,11 +17278,19 @@ pub unsafe extern "C" fn spSkeleton_updateWorldTransformWith( spIkConstraint_update((*update).object as *mut spIkConstraint); } 3 => { - spTransformConstraint_update((*update).object as *mut spTransformConstraint); + spTransformConstraint_update( + (*update).object as *mut spTransformConstraint, + ); } 2 => { spPathConstraint_update((*update).object as *mut spPathConstraint); } + 4 => { + spPhysicsConstraint_update( + (*update).object as *mut spPhysicsConstraint, + physics, + ); + } _ => {} } i += 1; @@ -15130,37 +17311,26 @@ pub unsafe extern "C" fn spSkeleton_setBonesToSetupPose(mut self_0: *const spSke } i = 0 as c_int; while i < (*self_0).ikConstraintsCount { - let mut ikConstraint: *mut spIkConstraint = *((*self_0).ikConstraints).offset(i as isize); - (*ikConstraint).bendDirection = (*(*ikConstraint).data).bendDirection; - (*ikConstraint).compress = (*(*ikConstraint).data).compress; - (*ikConstraint).stretch = (*(*ikConstraint).data).stretch; - (*ikConstraint).softness = (*(*ikConstraint).data).softness; - (*ikConstraint).mix = (*(*ikConstraint).data).mix; + spIkConstraint_setToSetupPose(*((*self_0).ikConstraints).offset(i as isize)); i += 1; } i = 0 as c_int; while i < (*self_0).transformConstraintsCount { - let mut constraint: *mut spTransformConstraint = - *((*self_0).transformConstraints).offset(i as isize); - let mut data: *mut spTransformConstraintData = (*constraint).data; - (*constraint).mixRotate = (*data).mixRotate; - (*constraint).mixX = (*data).mixX; - (*constraint).mixY = (*data).mixY; - (*constraint).mixScaleX = (*data).mixScaleX; - (*constraint).mixScaleY = (*data).mixScaleY; - (*constraint).mixShearY = (*data).mixShearY; + spTransformConstraint_setToSetupPose( + *((*self_0).transformConstraints).offset(i as isize), + ); i += 1; } i = 0 as c_int; while i < (*self_0).pathConstraintsCount { - let mut constraint_0: *mut spPathConstraint = - *((*self_0).pathConstraints).offset(i as isize); - let mut data_0: *mut spPathConstraintData = (*constraint_0).data; - (*constraint_0).position = (*data_0).position; - (*constraint_0).spacing = (*data_0).spacing; - (*constraint_0).mixRotate = (*data_0).mixRotate; - (*constraint_0).mixX = (*data_0).mixX; - (*constraint_0).mixY = (*data_0).mixY; + spPathConstraint_setToSetupPose(*((*self_0).pathConstraints).offset(i as isize)); + i += 1; + } + i = 0 as c_int; + while i < (*self_0).physicsConstraintsCount { + spPhysicsConstraint_setToSetupPose( + *((*self_0).physicsConstraints).offset(i as isize), + ); i += 1; } } @@ -15187,16 +17357,14 @@ pub unsafe extern "C" fn spSkeleton_findBone( let mut i: c_int = 0; i = 0 as c_int; while i < (*self_0).bonesCount { - if spine_strcmp( - (**((*(*self_0).data).bones).offset(i as isize)).name, - boneName, - ) == 0 as c_int + if spine_strcmp((**((*(*self_0).data).bones).offset(i as isize)).name, boneName) + == 0 as c_int { return *((*self_0).bones).offset(i as isize); } i += 1; } - return std::ptr::null_mut(); + return 0 as *mut spBone; } #[no_mangle] pub unsafe extern "C" fn spSkeleton_findSlot( @@ -15206,25 +17374,23 @@ pub unsafe extern "C" fn spSkeleton_findSlot( let mut i: c_int = 0; i = 0 as c_int; while i < (*self_0).slotsCount { - if spine_strcmp( - (**((*(*self_0).data).slots).offset(i as isize)).name, - slotName, - ) == 0 as c_int + if spine_strcmp((**((*(*self_0).data).slots).offset(i as isize)).name, slotName) + == 0 as c_int { return *((*self_0).slots).offset(i as isize); } i += 1; } - return std::ptr::null_mut(); + return 0 as *mut spSlot; } #[no_mangle] pub unsafe extern "C" fn spSkeleton_setSkinByName( mut self_0: *mut spSkeleton, mut skinName: *const c_char, ) -> c_int { - let mut skin: *mut spSkin = std::ptr::null_mut(); + let mut skin: *mut spSkin = 0 as *mut spSkin; if skinName.is_null() { - spSkeleton_setSkin(self_0, std::ptr::null_mut()); + spSkeleton_setSkin(self_0, 0 as *mut spSkin); return 1 as c_int; } skin = spSkeletonData_findSkin((*self_0).data, skinName); @@ -15235,7 +17401,10 @@ pub unsafe extern "C" fn spSkeleton_setSkinByName( return 1 as c_int; } #[no_mangle] -pub unsafe extern "C" fn spSkeleton_setSkin(mut self_0: *mut spSkeleton, mut newSkin: *mut spSkin) { +pub unsafe extern "C" fn spSkeleton_setSkin( + mut self_0: *mut spSkeleton, + mut newSkin: *mut spSkin, +) { if (*self_0).skin == newSkin { return; } @@ -15248,8 +17417,11 @@ pub unsafe extern "C" fn spSkeleton_setSkin(mut self_0: *mut spSkeleton, mut new while i < (*self_0).slotsCount { let mut slot: *mut spSlot = *((*self_0).slots).offset(i as isize); if !((*(*slot).data).attachmentName).is_null() { - let mut attachment: *mut spAttachment = - spSkin_getAttachment(newSkin, i, (*(*slot).data).attachmentName); + let mut attachment: *mut spAttachment = spSkin_getAttachment( + newSkin, + i, + (*(*slot).data).attachmentName, + ); if !attachment.is_null() { spSlot_setAttachment(slot, attachment); } @@ -15258,8 +17430,7 @@ pub unsafe extern "C" fn spSkeleton_setSkin(mut self_0: *mut spSkeleton, mut new } } } - let ref mut fresh100 = *(&mut (*self_0).skin as *mut *mut spSkin); - *fresh100 = newSkin; + (*self_0).skin = newSkin; spSkeleton_updateCache(self_0); } #[no_mangle] @@ -15268,7 +17439,8 @@ pub unsafe extern "C" fn spSkeleton_getAttachmentForSlotName( mut slotName: *const c_char, mut attachmentName: *const c_char, ) -> *mut spAttachment { - let mut slotIndex: c_int = (*spSkeletonData_findSlot((*self_0).data, slotName)).index; + let mut slotIndex: c_int = (*spSkeletonData_findSlot((*self_0).data, slotName)) + .index; return spSkeleton_getAttachmentForSlotIndex(self_0, slotIndex, attachmentName); } #[no_mangle] @@ -15278,23 +17450,29 @@ pub unsafe extern "C" fn spSkeleton_getAttachmentForSlotIndex( mut attachmentName: *const c_char, ) -> *mut spAttachment { if slotIndex == -(1 as c_int) { - return std::ptr::null_mut(); + return 0 as *mut spAttachment; } if !((*self_0).skin).is_null() { - let mut attachment: *mut spAttachment = - spSkin_getAttachment((*self_0).skin, slotIndex, attachmentName); + let mut attachment: *mut spAttachment = spSkin_getAttachment( + (*self_0).skin, + slotIndex, + attachmentName, + ); if !attachment.is_null() { return attachment; } } if !((*(*self_0).data).defaultSkin).is_null() { - let mut attachment_0: *mut spAttachment = - spSkin_getAttachment((*(*self_0).data).defaultSkin, slotIndex, attachmentName); + let mut attachment_0: *mut spAttachment = spSkin_getAttachment( + (*(*self_0).data).defaultSkin, + slotIndex, + attachmentName, + ); if !attachment_0.is_null() { return attachment_0; } } - return std::ptr::null_mut(); + return 0 as *mut spAttachment; } #[no_mangle] pub unsafe extern "C" fn spSkeleton_setAttachment( @@ -15308,10 +17486,13 @@ pub unsafe extern "C" fn spSkeleton_setAttachment( let mut slot: *mut spSlot = *((*self_0).slots).offset(i as isize); if spine_strcmp((*(*slot).data).name, slotName) == 0 as c_int { if attachmentName.is_null() { - spSlot_setAttachment(slot, std::ptr::null_mut()); + spSlot_setAttachment(slot, 0 as *mut spAttachment); } else { - let mut attachment: *mut spAttachment = - spSkeleton_getAttachmentForSlotIndex(self_0, i, attachmentName); + let mut attachment: *mut spAttachment = spSkeleton_getAttachmentForSlotIndex( + self_0, + i, + attachmentName, + ); if attachment.is_null() { return 0 as c_int; } @@ -15340,7 +17521,7 @@ pub unsafe extern "C" fn spSkeleton_findIkConstraint( } i += 1; } - return std::ptr::null_mut(); + return 0 as *mut spIkConstraint; } #[no_mangle] pub unsafe extern "C" fn spSkeleton_findTransformConstraint( @@ -15359,37 +17540,171 @@ pub unsafe extern "C" fn spSkeleton_findTransformConstraint( } i += 1; } - return std::ptr::null_mut(); + return 0 as *mut spTransformConstraint; +} +#[no_mangle] +pub unsafe extern "C" fn spSkeleton_findPathConstraint( + mut self_0: *const spSkeleton, + mut constraintName: *const c_char, +) -> *mut spPathConstraint { + let mut i: c_int = 0; + i = 0 as c_int; + while i < (*self_0).pathConstraintsCount { + if spine_strcmp( + (*(**((*self_0).pathConstraints).offset(i as isize)).data).name, + constraintName, + ) == 0 as c_int + { + return *((*self_0).pathConstraints).offset(i as isize); + } + i += 1; + } + return 0 as *mut spPathConstraint; +} +#[no_mangle] +pub unsafe extern "C" fn spSkeleton_findPhysicsConstraint( + mut self_0: *const spSkeleton, + mut constraintName: *const c_char, +) -> *mut spPhysicsConstraint { + let mut i: c_int = 0; + i = 0 as c_int; + while i < (*self_0).physicsConstraintsCount { + if spine_strcmp( + (*(**((*self_0).physicsConstraints).offset(i as isize)).data).name, + constraintName, + ) == 0 as c_int + { + return *((*self_0).physicsConstraints).offset(i as isize); + } + i += 1; + } + return 0 as *mut spPhysicsConstraint; +} +#[no_mangle] +pub unsafe extern "C" fn spSkeleton_physicsTranslate( + mut self_0: *mut spSkeleton, + mut x: c_float, + mut y: c_float, +) { + let mut i: c_int = 0 as c_int; + while i < (*self_0).physicsConstraintsCount { + spPhysicsConstraint_translate( + *((*self_0).physicsConstraints).offset(i as isize), + x, + y, + ); + i += 1; + } +} +#[no_mangle] +pub unsafe extern "C" fn spSkeleton_physicsRotate( + mut self_0: *mut spSkeleton, + mut x: c_float, + mut y: c_float, + mut degrees: c_float, +) { + let mut i: c_int = 0 as c_int; + while i < (*self_0).physicsConstraintsCount { + spPhysicsConstraint_rotate( + *((*self_0).physicsConstraints).offset(i as isize), + x, + y, + degrees, + ); + i += 1; + } +} +unsafe extern "C" fn string_lastIndexOf( + mut str: *const c_char, + mut needle: c_char, +) -> c_int { + if str.is_null() { + return -(1 as c_int); + } + let mut lastIndex: c_int = -(1 as c_int); + let mut i: c_int = 0 as c_int; + while *str.offset(i as isize) as c_int != '\0' as i32 { + if *str.offset(i as isize) as c_int == needle as c_int { + lastIndex = i; + } + i += 1; + } + return lastIndex; +} +unsafe extern "C" fn string_substring( + mut str: *const c_char, + mut start: c_int, + mut end: c_int, +) -> *mut c_char { + if str.is_null() || start > end || start < 0 as c_int { + return 0 as *mut c_char; + } + let mut len: c_int = end - start; + let mut substr: *mut c_char = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul((len + 1 as c_int) as c_ulong), + b"spine.c\0" as *const u8 as *const c_char, + 9047 as c_int, + ) as *mut c_char; + if substr.is_null() { + return 0 as *mut c_char; + } + strncpy(substr, str.offset(start as isize), len as c_ulong); + *substr.offset(len as isize) = '\0' as i32 as c_char; + return substr; } -#[no_mangle] -pub unsafe extern "C" fn spSkeleton_findPathConstraint( - mut self_0: *const spSkeleton, - mut constraintName: *const c_char, -) -> *mut spPathConstraint { +unsafe extern "C" fn string_starts_with_binary( + mut str: *const c_char, + mut needle: *const c_char, +) -> c_int { + let mut lenStr: c_int = 0; + let mut lenNeedle: c_int = 0; let mut i: c_int = 0; + if str.is_null() { + return 0 as c_int; + } + lenStr = spine_strlen(str) as c_int; + lenNeedle = spine_strlen(needle) as c_int; + if lenStr < lenNeedle { + return 0 as c_int; + } i = 0 as c_int; - while i < (*self_0).pathConstraintsCount { - if spine_strcmp( - (*(**((*self_0).pathConstraints).offset(i as isize)).data).name, - constraintName, - ) == 0 as c_int + while i < lenNeedle { + if *str.offset(i as isize) as c_int + != *needle.offset(i as isize) as c_int { - return *((*self_0).pathConstraints).offset(i as isize); + return 0 as c_int; } i += 1; } - return std::ptr::null_mut(); + return -(1 as c_int); +} +unsafe extern "C" fn string_copy(mut str: *const c_char) -> *mut c_char { + if str.is_null() { + return 0 as *mut c_char; + } + let mut len: c_int = spine_strlen(str) as c_int; + let mut tmp: *mut c_char = spine_malloc((len + 1 as c_int) as size_t) + as *mut c_char; + strncpy(tmp, str, len as c_ulong); + *tmp.offset(len as isize) = '\0' as i32 as c_char; + return tmp; } #[no_mangle] pub unsafe extern "C" fn spSkeletonBinary_createWithLoader( mut attachmentLoader: *mut spAttachmentLoader, ) -> *mut spSkeletonBinary { let mut self_0: *mut spSkeletonBinary = &mut (*((_spCalloc - as unsafe extern "C" fn(size_t, size_t, *const c_char, c_int) -> *mut c_void)( + as unsafe extern "C" fn( + size_t, + size_t, + *const c_char, + c_int, + ) -> *mut c_void)( 1 as c_int as size_t, ::core::mem::size_of::<_spSkeletonBinary>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 8388 as c_int, + 9081 as c_int, ) as *mut _spSkeletonBinary)) .super_0; (*self_0).scale = 1 as c_int as c_float; @@ -15397,10 +17712,15 @@ pub unsafe extern "C" fn spSkeletonBinary_createWithLoader( return self_0; } #[no_mangle] -pub unsafe extern "C" fn spSkeletonBinary_create(mut atlas: *mut spAtlas) -> *mut spSkeletonBinary { - let mut attachmentLoader: *mut spAtlasAttachmentLoader = spAtlasAttachmentLoader_create(atlas); - let mut self_0: *mut spSkeletonBinary = - spSkeletonBinary_createWithLoader(&mut (*attachmentLoader).super_0); +pub unsafe extern "C" fn spSkeletonBinary_create( + mut atlas: *mut spAtlas, +) -> *mut spSkeletonBinary { + let mut attachmentLoader: *mut spAtlasAttachmentLoader = spAtlasAttachmentLoader_create( + atlas, + ); + let mut self_0: *mut spSkeletonBinary = spSkeletonBinary_createWithLoader( + &mut (*attachmentLoader).super_0, + ); (*(self_0 as *mut _spSkeletonBinary)).ownsLoader = 1 as c_int; return self_0; } @@ -15432,19 +17752,22 @@ pub unsafe extern "C" fn _spSkeletonBinary_setError( (255 as c_int - length) as size_t, ); } - let ref mut fresh101 = *(&mut (*self_0).error as *mut *mut c_char); - *fresh101 = _spMalloc( + (*self_0) + .error = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(message.as_mut_ptr())).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen(message.as_mut_ptr())) + .wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 8416 as c_int, + 9109 as c_int, ) as *mut c_char; - spine_strcpy(*fresh101, message.as_mut_ptr()); + spine_strcpy((*self_0).error, message.as_mut_ptr()); } unsafe extern "C" fn readByte(mut input: *mut _dataInput) -> c_uchar { - let fresh102 = (*input).cursor; + let fresh67 = (*input).cursor; (*input).cursor = ((*input).cursor).offset(1); - return *fresh102; + return *fresh67; } unsafe extern "C" fn readSByte(mut input: *mut _dataInput) -> c_schar { return readByte(input) as c_schar; @@ -15462,7 +17785,10 @@ unsafe extern "C" fn readInt(mut input: *mut _dataInput) -> c_int { result |= readByte(input) as c_uint; return result as c_int; } -unsafe extern "C" fn readVarint(mut input: *mut _dataInput, mut optimizePositive: c_int) -> c_int { +unsafe extern "C" fn readVarint( + mut input: *mut _dataInput, + mut optimizePositive: c_int, +) -> c_int { let mut b: c_uchar = readByte(input); let mut value: int32_t = b as c_int & 0x7f as c_int; if b as c_int & 0x80 as c_int != 0 { @@ -15475,13 +17801,16 @@ unsafe extern "C" fn readVarint(mut input: *mut _dataInput, mut optimizePositive b = readByte(input); value |= (b as c_int & 0x7f as c_int) << 21 as c_int; if b as c_int & 0x80 as c_int != 0 { - value |= (readByte(input) as c_int & 0x7f as c_int) << 28 as c_int; + value + |= (readByte(input) as c_int & 0x7f as c_int) + << 28 as c_int; } } } } if optimizePositive == 0 { - value = (value as c_uint >> 1 as c_int ^ -(value & 1 as c_int) as c_uint) as int32_t; + value = (value as c_uint >> 1 as c_int + ^ -(value & 1 as c_int) as c_uint) as int32_t; } return value; } @@ -15494,14 +17823,15 @@ pub unsafe extern "C" fn readFloat(mut input: *mut _dataInput) -> c_float { #[no_mangle] pub unsafe extern "C" fn readString(mut input: *mut _dataInput) -> *mut c_char { let mut length: c_int = readVarint(input, 1 as c_int); - let mut string: *mut c_char = std::ptr::null_mut(); + let mut string: *mut c_char = 0 as *mut c_char; if length == 0 as c_int { - return std::ptr::null_mut(); + return 0 as *mut c_char; } string = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul(length as c_ulong), + (::core::mem::size_of::() as c_ulong) + .wrapping_mul(length as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 8475 as c_int, + 9168 as c_int, ) as *mut c_char; spine_memcpy( string as *mut c_void, @@ -15518,7 +17848,7 @@ unsafe extern "C" fn readStringRef( ) -> *mut c_char { let mut index: c_int = readVarint(input, 1 as c_int); return if index == 0 as c_int { - std::ptr::null_mut() + 0 as *mut c_char } else { *((*skeletonData).strings).offset((index - 1 as c_int) as isize) }; @@ -15536,11 +17866,9 @@ unsafe extern "C" fn readColor( *a = readByte(input) as c_int as c_float / 255.0f32; } unsafe extern "C" fn readSequenceBinary(mut input: *mut _dataInput) -> *mut spSequence { - let mut sequence: *mut spSequence = std::ptr::null_mut(); - if readBoolean(input) == 0 { - return std::ptr::null_mut(); - } - sequence = spSequence_create(readVarint(input, -(1 as c_int))); + let mut sequence: *mut spSequence = spSequence_create( + readVarint(input, -(1 as c_int)), + ); (*sequence).start = readVarint(input, -(1 as c_int)); (*sequence).digits = readVarint(input, -(1 as c_int)); (*sequence).setupIndex = readVarint(input, -(1 as c_int)); @@ -15579,9 +17907,10 @@ unsafe extern "C" fn setBezierBinary( } unsafe extern "C" fn readTimelineBinary( mut input: *mut _dataInput, + mut timelines: *mut spTimelineArray, mut timeline: *mut spCurveTimeline1, mut scale: c_float, -) -> *mut spTimeline { +) { let mut frame: c_int = 0; let mut bezier: c_int = 0; let mut frameLast: c_int = 0; @@ -15604,12 +17933,12 @@ unsafe extern "C" fn readTimelineBinary( spCurveTimeline_setStepped(timeline, frame); } 2 => { - let fresh103 = bezier; + let fresh68 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline).super_0, - fresh103, + fresh68, frame, 0 as c_int, time, @@ -15625,13 +17954,14 @@ unsafe extern "C" fn readTimelineBinary( value = value2; frame += 1; } - return &mut (*timeline).super_0; + spTimelineArray_add(timelines, &mut (*timeline).super_0); } unsafe extern "C" fn readTimeline2Binary( mut input: *mut _dataInput, + mut timelines: *mut spTimelineArray, mut timeline: *mut spCurveTimeline2, mut scale: c_float, -) -> *mut spTimeline { +) { let mut frame: c_int = 0; let mut bezier: c_int = 0; let mut frameLast: c_int = 0; @@ -15657,12 +17987,12 @@ unsafe extern "C" fn readTimeline2Binary( spCurveTimeline_setStepped(timeline, frame); } 2 => { - let fresh104 = bezier; + let fresh69 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline).super_0, - fresh104, + fresh69, frame, 0 as c_int, time, @@ -15671,12 +18001,12 @@ unsafe extern "C" fn readTimeline2Binary( nvalue1, scale, ); - let fresh105 = bezier; + let fresh70 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline).super_0, - fresh105, + fresh70, frame, 1 as c_int, time, @@ -15693,20 +18023,20 @@ unsafe extern "C" fn readTimeline2Binary( value2 = nvalue2; frame += 1; } - return &mut (*timeline).super_0; + spTimelineArray_add(timelines, &mut (*timeline).super_0); } unsafe extern "C" fn _spSkeletonBinary_addLinkedMesh( mut self_0: *mut spSkeletonBinary, mut mesh: *mut spMeshAttachment, - mut skin: *const c_char, + mut skinIndex: c_int, mut slotIndex: c_int, mut parent: *const c_char, mut inheritDeform: c_int, ) { - let mut linkedMesh: *mut _spLinkedMeshBinary = std::ptr::null_mut(); + let mut linkedMesh: *mut _spLinkedMeshBinary = 0 as *mut _spLinkedMeshBinary; let mut internal: *mut _spSkeletonBinary = self_0 as *mut _spSkeletonBinary; if (*internal).linkedMeshCount == (*internal).linkedMeshCapacity { - let mut linkedMeshes: *mut _spLinkedMeshBinary = std::ptr::null_mut(); + let mut linkedMeshes: *mut _spLinkedMeshBinary = 0 as *mut _spLinkedMeshBinary; (*internal).linkedMeshCapacity *= 2 as c_int; if (*internal).linkedMeshCapacity < 8 as c_int { (*internal).linkedMeshCapacity = 8 as c_int; @@ -15715,7 +18045,7 @@ unsafe extern "C" fn _spSkeletonBinary_addLinkedMesh( (::core::mem::size_of::<_spLinkedMeshBinary>() as c_ulong) .wrapping_mul((*internal).linkedMeshCapacity as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 8626 as c_int, + 9327 as c_int, ) as *mut _spLinkedMeshBinary; spine_memcpy( linkedMeshes as *mut c_void, @@ -15726,11 +18056,11 @@ unsafe extern "C" fn _spSkeletonBinary_addLinkedMesh( _spFree((*internal).linkedMeshes as *mut c_void); (*internal).linkedMeshes = linkedMeshes; } - let fresh106 = (*internal).linkedMeshCount; + let fresh71 = (*internal).linkedMeshCount; (*internal).linkedMeshCount = (*internal).linkedMeshCount + 1; - linkedMesh = ((*internal).linkedMeshes).offset(fresh106 as isize); + linkedMesh = ((*internal).linkedMeshes).offset(fresh71 as isize); (*linkedMesh).mesh = mesh; - (*linkedMesh).skin = skin; + (*linkedMesh).skinIndex = skinIndex; (*linkedMesh).slotIndex = slotIndex; (*linkedMesh).parent = parent; (*linkedMesh).inheritTimeline = inheritDeform; @@ -15753,9 +18083,9 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( let mut bezier: c_int = 0; let mut drawOrderCount: c_int = 0; let mut eventCount: c_int = 0; - let mut animation: *mut spAnimation = std::ptr::null_mut(); + let mut animation: *mut spAnimation = 0 as *mut spAnimation; let mut scale: c_float = (*self_0).scale; - let mut _numTimelines: c_int = readVarint(input, 1 as c_int); + let mut numTimelines: c_int = readVarint(input, 1 as c_int); i = 0 as c_int; n = readVarint(input, 1 as c_int); while i < n { @@ -15768,30 +18098,46 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( let mut frameLast: c_int = frameCount - 1 as c_int; match timelineType as c_int { 0 => { - let mut timeline: *mut spAttachmentTimeline = - spAttachmentTimeline_create(frameCount, slotIndex); + let mut timeline: *mut spAttachmentTimeline = spAttachmentTimeline_create( + frameCount, + slotIndex, + ); frame = 0 as c_int; while frame < frameCount { let mut time: c_float = readFloat(input); - let mut attachmentName: *const c_char = readStringRef(input, skeletonData); - spAttachmentTimeline_setFrame(timeline, frame, time, attachmentName); + let mut attachmentName: *const c_char = readStringRef( + input, + skeletonData, + ); + spAttachmentTimeline_setFrame( + timeline, + frame, + time, + attachmentName, + ); frame += 1; } spTimelineArray_add(timelines, &mut (*timeline).super_0); } 1 => { - let mut bezierCount: c_int = readVarint(input, 1 as c_int); - let mut timeline_0: *mut spRGBATimeline = - spRGBATimeline_create(frameCount, bezierCount, slotIndex); + let mut bezierCount: c_int = readVarint( + input, + 1 as c_int, + ); + let mut timeline_0: *mut spRGBATimeline = spRGBATimeline_create( + frameCount, + bezierCount, + slotIndex, + ); let mut time_0: c_float = readFloat(input); - let mut r: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; - let mut g: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; - let mut b: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; - let mut a: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; + let mut r: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; + let mut g: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; + let mut b: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; + let mut a: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; frame = 0 as c_int; bezier = 0 as c_int; loop { @@ -15805,21 +18151,28 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( break; } time2 = readFloat(input); - r2 = (readByte(input) as c_int as c_double / 255.0f64) as c_float; - g2 = (readByte(input) as c_int as c_double / 255.0f64) as c_float; - b2 = (readByte(input) as c_int as c_double / 255.0f64) as c_float; - a2 = (readByte(input) as c_int as c_double / 255.0f64) as c_float; + r2 = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; + g2 = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; + b2 = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; + a2 = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; match readSByte(input) as c_int { 1 => { - spCurveTimeline_setStepped(&mut (*timeline_0).super_0, frame); + spCurveTimeline_setStepped( + &mut (*timeline_0).super_0, + frame, + ); } 2 => { - let fresh107 = bezier; + let fresh72 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_0).super_0.super_0, - fresh107, + fresh72, frame, 0 as c_int, time_0, @@ -15828,12 +18181,12 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( r2, 1 as c_int as c_float, ); - let fresh108 = bezier; + let fresh73 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_0).super_0.super_0, - fresh108, + fresh73, frame, 1 as c_int, time_0, @@ -15842,12 +18195,12 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( g2, 1 as c_int as c_float, ); - let fresh109 = bezier; + let fresh74 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_0).super_0.super_0, - fresh109, + fresh74, frame, 2 as c_int, time_0, @@ -15856,12 +18209,12 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( b2, 1 as c_int as c_float, ); - let fresh110 = bezier; + let fresh75 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_0).super_0.super_0, - fresh110, + fresh75, frame, 3 as c_int, time_0, @@ -15883,16 +18236,22 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( spTimelineArray_add(timelines, &mut (*timeline_0).super_0.super_0); } 2 => { - let mut bezierCount_0: c_int = readVarint(input, 1 as c_int); - let mut timeline_1: *mut spRGBTimeline = - spRGBTimeline_create(frameCount, bezierCount_0, slotIndex); + let mut bezierCount_0: c_int = readVarint( + input, + 1 as c_int, + ); + let mut timeline_1: *mut spRGBTimeline = spRGBTimeline_create( + frameCount, + bezierCount_0, + slotIndex, + ); let mut time_1: c_float = readFloat(input); - let mut r_0: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; - let mut g_0: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; - let mut b_0: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; + let mut r_0: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; + let mut g_0: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; + let mut b_0: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; frame = 0 as c_int; bezier = 0 as c_int; loop { @@ -15905,20 +18264,26 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( break; } time2_0 = readFloat(input); - r2_0 = (readByte(input) as c_int as c_double / 255.0f64) as c_float; - g2_0 = (readByte(input) as c_int as c_double / 255.0f64) as c_float; - b2_0 = (readByte(input) as c_int as c_double / 255.0f64) as c_float; + r2_0 = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; + g2_0 = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; + b2_0 = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; match readSByte(input) as c_int { 1 => { - spCurveTimeline_setStepped(&mut (*timeline_1).super_0, frame); + spCurveTimeline_setStepped( + &mut (*timeline_1).super_0, + frame, + ); } 2 => { - let fresh111 = bezier; + let fresh76 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_1).super_0.super_0, - fresh111, + fresh76, frame, 0 as c_int, time_1, @@ -15927,12 +18292,12 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( r2_0, 1 as c_int as c_float, ); - let fresh112 = bezier; + let fresh77 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_1).super_0.super_0, - fresh112, + fresh77, frame, 1 as c_int, time_1, @@ -15941,12 +18306,12 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( g2_0, 1 as c_int as c_float, ); - let fresh113 = bezier; + let fresh78 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_1).super_0.super_0, - fresh113, + fresh78, frame, 2 as c_int, time_1, @@ -15967,24 +18332,30 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( spTimelineArray_add(timelines, &mut (*timeline_1).super_0.super_0); } 3 => { - let mut bezierCount_1: c_int = readVarint(input, 1 as c_int); - let mut timeline_2: *mut spRGBA2Timeline = - spRGBA2Timeline_create(frameCount, bezierCount_1, slotIndex); + let mut bezierCount_1: c_int = readVarint( + input, + 1 as c_int, + ); + let mut timeline_2: *mut spRGBA2Timeline = spRGBA2Timeline_create( + frameCount, + bezierCount_1, + slotIndex, + ); let mut time_2: c_float = readFloat(input); - let mut r_1: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; - let mut g_1: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; - let mut b_1: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; - let mut a_0: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; - let mut r2_1: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; - let mut g2_1: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; - let mut b2_1: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; + let mut r_1: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; + let mut g_1: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; + let mut b_1: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; + let mut a_0: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; + let mut r2_1: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; + let mut g2_1: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; + let mut b2_1: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; frame = 0 as c_int; bezier = 0 as c_int; loop { @@ -15997,30 +18368,49 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( let mut ng2: c_float = 0.; let mut nb2: c_float = 0.; spRGBA2Timeline_setFrame( - timeline_2, frame, time_2, r_1, g_1, b_1, a_0, r2_1, g2_1, b2_1, + timeline_2, + frame, + time_2, + r_1, + g_1, + b_1, + a_0, + r2_1, + g2_1, + b2_1, ); if frame == frameLast { break; } time2_1 = readFloat(input); - nr = (readByte(input) as c_int as c_double / 255.0f64) as c_float; - ng = (readByte(input) as c_int as c_double / 255.0f64) as c_float; - nb = (readByte(input) as c_int as c_double / 255.0f64) as c_float; - na = (readByte(input) as c_int as c_double / 255.0f64) as c_float; - nr2 = (readByte(input) as c_int as c_double / 255.0f64) as c_float; - ng2 = (readByte(input) as c_int as c_double / 255.0f64) as c_float; - nb2 = (readByte(input) as c_int as c_double / 255.0f64) as c_float; + nr = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; + ng = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; + nb = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; + na = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; + nr2 = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; + ng2 = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; + nb2 = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; match readSByte(input) as c_int { 1 => { - spCurveTimeline_setStepped(&mut (*timeline_2).super_0, frame); + spCurveTimeline_setStepped( + &mut (*timeline_2).super_0, + frame, + ); } 2 => { - let fresh114 = bezier; + let fresh79 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_2).super_0.super_0, - fresh114, + fresh79, frame, 0 as c_int, time_2, @@ -16029,12 +18419,12 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( nr, 1 as c_int as c_float, ); - let fresh115 = bezier; + let fresh80 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_2).super_0.super_0, - fresh115, + fresh80, frame, 1 as c_int, time_2, @@ -16043,12 +18433,12 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( ng, 1 as c_int as c_float, ); - let fresh116 = bezier; + let fresh81 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_2).super_0.super_0, - fresh116, + fresh81, frame, 2 as c_int, time_2, @@ -16057,12 +18447,12 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( nb, 1 as c_int as c_float, ); - let fresh117 = bezier; + let fresh82 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_2).super_0.super_0, - fresh117, + fresh82, frame, 3 as c_int, time_2, @@ -16071,12 +18461,12 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( na, 1 as c_int as c_float, ); - let fresh118 = bezier; + let fresh83 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_2).super_0.super_0, - fresh118, + fresh83, frame, 4 as c_int, time_2, @@ -16085,12 +18475,12 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( nr2, 1 as c_int as c_float, ); - let fresh119 = bezier; + let fresh84 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_2).super_0.super_0, - fresh119, + fresh84, frame, 5 as c_int, time_2, @@ -16099,12 +18489,12 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( ng2, 1 as c_int as c_float, ); - let fresh120 = bezier; + let fresh85 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_2).super_0.super_0, - fresh120, + fresh85, frame, 6 as c_int, time_2, @@ -16129,22 +18519,28 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( spTimelineArray_add(timelines, &mut (*timeline_2).super_0.super_0); } 4 => { - let mut bezierCount_2: c_int = readVarint(input, 1 as c_int); - let mut timeline_3: *mut spRGB2Timeline = - spRGB2Timeline_create(frameCount, bezierCount_2, slotIndex); + let mut bezierCount_2: c_int = readVarint( + input, + 1 as c_int, + ); + let mut timeline_3: *mut spRGB2Timeline = spRGB2Timeline_create( + frameCount, + bezierCount_2, + slotIndex, + ); let mut time_3: c_float = readFloat(input); - let mut r_2: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; - let mut g_2: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; - let mut b_2: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; - let mut r2_2: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; - let mut g2_2: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; - let mut b2_2: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; + let mut r_2: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; + let mut g_2: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; + let mut b_2: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; + let mut r2_2: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; + let mut g2_2: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; + let mut b2_2: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; frame = 0 as c_int; bezier = 0 as c_int; loop { @@ -16156,29 +18552,46 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( let mut ng2_0: c_float = 0.; let mut nb2_0: c_float = 0.; spRGB2Timeline_setFrame( - timeline_3, frame, time_3, r_2, g_2, b_2, r2_2, g2_2, b2_2, + timeline_3, + frame, + time_3, + r_2, + g_2, + b_2, + r2_2, + g2_2, + b2_2, ); if frame == frameLast { break; } time2_2 = readFloat(input); - nr_0 = (readByte(input) as c_int as c_double / 255.0f64) as c_float; - ng_0 = (readByte(input) as c_int as c_double / 255.0f64) as c_float; - nb_0 = (readByte(input) as c_int as c_double / 255.0f64) as c_float; - nr2_0 = (readByte(input) as c_int as c_double / 255.0f64) as c_float; - ng2_0 = (readByte(input) as c_int as c_double / 255.0f64) as c_float; - nb2_0 = (readByte(input) as c_int as c_double / 255.0f64) as c_float; + nr_0 = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; + ng_0 = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; + nb_0 = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; + nr2_0 = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; + ng2_0 = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; + nb2_0 = (readByte(input) as c_int as c_double + / 255.0f64) as c_float; match readSByte(input) as c_int { 1 => { - spCurveTimeline_setStepped(&mut (*timeline_3).super_0, frame); + spCurveTimeline_setStepped( + &mut (*timeline_3).super_0, + frame, + ); } 2 => { - let fresh121 = bezier; + let fresh86 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_3).super_0.super_0, - fresh121, + fresh86, frame, 0 as c_int, time_3, @@ -16187,12 +18600,12 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( nr_0, 1 as c_int as c_float, ); - let fresh122 = bezier; + let fresh87 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_3).super_0.super_0, - fresh122, + fresh87, frame, 1 as c_int, time_3, @@ -16201,12 +18614,12 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( ng_0, 1 as c_int as c_float, ); - let fresh123 = bezier; + let fresh88 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_3).super_0.super_0, - fresh123, + fresh88, frame, 2 as c_int, time_3, @@ -16215,12 +18628,12 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( nb_0, 1 as c_int as c_float, ); - let fresh124 = bezier; + let fresh89 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_3).super_0.super_0, - fresh124, + fresh89, frame, 3 as c_int, time_3, @@ -16229,12 +18642,12 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( nr2_0, 1 as c_int as c_float, ); - let fresh125 = bezier; + let fresh90 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_3).super_0.super_0, - fresh125, + fresh90, frame, 4 as c_int, time_3, @@ -16243,12 +18656,12 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( ng2_0, 1 as c_int as c_float, ); - let fresh126 = bezier; + let fresh91 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_3).super_0.super_0, - fresh126, + fresh91, frame, 5 as c_int, time_3, @@ -16272,12 +18685,18 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( spTimelineArray_add(timelines, &mut (*timeline_3).super_0.super_0); } 5 => { - let mut bezierCount_3: c_int = readVarint(input, 1 as c_int); - let mut timeline_4: *mut spAlphaTimeline = - spAlphaTimeline_create(frameCount, bezierCount_3, slotIndex); + let mut bezierCount_3: c_int = readVarint( + input, + 1 as c_int, + ); + let mut timeline_4: *mut spAlphaTimeline = spAlphaTimeline_create( + frameCount, + bezierCount_3, + slotIndex, + ); let mut time_4: c_float = readFloat(input); - let mut a_1: c_float = - (readByte(input) as c_int as c_double / 255.0f64) as c_float; + let mut a_1: c_float = (readByte(input) as c_int + as c_double / 255.0f64) as c_float; frame = 0 as c_int; bezier = 0 as c_int; loop { @@ -16288,18 +18707,22 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( break; } time2_3 = readFloat(input); - a2_0 = (readByte(input) as c_int / 255 as c_int) as c_float; + a2_0 = (readByte(input) as c_int / 255 as c_int) + as c_float; match readSByte(input) as c_int { 1 => { - spCurveTimeline_setStepped(&mut (*timeline_4).super_0, frame); + spCurveTimeline_setStepped( + &mut (*timeline_4).super_0, + frame, + ); } 2 => { - let fresh127 = bezier; + let fresh92 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_4).super_0.super_0, - fresh127, + fresh92, frame, 0 as c_int, time_4, @@ -16317,7 +18740,7 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( } spTimelineArray_add(timelines, &mut (*timeline_4).super_0.super_0); } - _ => return std::ptr::null_mut(), + _ => return 0 as *mut spAnimation, } ii += 1; } @@ -16332,170 +18755,221 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( while ii < nn { let mut timelineType_0: c_uchar = readByte(input); let mut frameCount_0: c_int = readVarint(input, 1 as c_int); - let mut bezierCount_4: c_int = readVarint(input, 1 as c_int); - let mut timeline_5: *mut spTimeline = std::ptr::null_mut(); - match timelineType_0 as c_int { - 0 => { - timeline_5 = readTimelineBinary( - input, - &mut (*(spRotateTimeline_create - as unsafe extern "C" fn(c_int, c_int, c_int) -> *mut spRotateTimeline)( - frameCount_0, - bezierCount_4, - boneIndex, - )) - .super_0, - 1 as c_int as c_float, - ); - } - 1 => { - timeline_5 = readTimeline2Binary( - input, - &mut (*(spTranslateTimeline_create - as unsafe extern "C" fn( - c_int, - c_int, - c_int, - ) - -> *mut spTranslateTimeline)( - frameCount_0, - bezierCount_4, - boneIndex, - )) - .super_0, - scale, - ); - } - 2 => { - timeline_5 = readTimelineBinary( - input, - &mut (*(spTranslateXTimeline_create - as unsafe extern "C" fn( - c_int, - c_int, - c_int, - ) - -> *mut spTranslateXTimeline)( - frameCount_0, - bezierCount_4, - boneIndex, - )) - .super_0, - scale, - ); - } - 3 => { - timeline_5 = readTimelineBinary( - input, - &mut (*(spTranslateYTimeline_create - as unsafe extern "C" fn( - c_int, - c_int, - c_int, - ) - -> *mut spTranslateYTimeline)( - frameCount_0, - bezierCount_4, - boneIndex, - )) - .super_0, - scale, - ); - } - 4 => { - timeline_5 = readTimeline2Binary( - input, - &mut (*(spScaleTimeline_create - as unsafe extern "C" fn(c_int, c_int, c_int) -> *mut spScaleTimeline)( - frameCount_0, - bezierCount_4, - boneIndex, - )) - .super_0, - 1 as c_int as c_float, - ); - } - 5 => { - timeline_5 = readTimelineBinary( - input, - &mut (*(spScaleXTimeline_create - as unsafe extern "C" fn(c_int, c_int, c_int) -> *mut spScaleXTimeline)( - frameCount_0, - bezierCount_4, - boneIndex, - )) - .super_0, - 1 as c_int as c_float, - ); - } - 6 => { - timeline_5 = readTimelineBinary( - input, - &mut (*(spScaleYTimeline_create - as unsafe extern "C" fn(c_int, c_int, c_int) -> *mut spScaleYTimeline)( - frameCount_0, - bezierCount_4, - boneIndex, - )) - .super_0, - 1 as c_int as c_float, - ); - } - 7 => { - timeline_5 = readTimeline2Binary( - input, - &mut (*(spShearTimeline_create - as unsafe extern "C" fn(c_int, c_int, c_int) -> *mut spShearTimeline)( - frameCount_0, - bezierCount_4, - boneIndex, - )) - .super_0, - 1 as c_int as c_float, - ); - } - 8 => { - timeline_5 = readTimelineBinary( - input, - &mut (*(spShearXTimeline_create - as unsafe extern "C" fn(c_int, c_int, c_int) -> *mut spShearXTimeline)( - frameCount_0, - bezierCount_4, - boneIndex, - )) - .super_0, - 1 as c_int as c_float, - ); - } - 9 => { - timeline_5 = readTimelineBinary( - input, - &mut (*(spShearYTimeline_create - as unsafe extern "C" fn(c_int, c_int, c_int) -> *mut spShearYTimeline)( - frameCount_0, - bezierCount_4, - boneIndex, - )) - .super_0, - 1 as c_int as c_float, - ); + if timelineType_0 as c_int == 10 as c_int { + let mut timeline_5: *mut spInheritTimeline = spInheritTimeline_create( + frameCount_0, + boneIndex, + ); + frame = 0 as c_int; + while frame < frameCount_0 { + let mut time_5: c_float = readFloat(input); + let mut inherit: spInherit = readByte(input) as spInherit; + spInheritTimeline_setFrame(timeline_5, frame, time_5, inherit); + frame += 1; } - _ => { - iii = 0 as c_int; - while iii < (*timelines).size { - spTimeline_dispose(*((*timelines).items).offset(iii as isize)); - iii += 1; + spTimelineArray_add(timelines, &mut (*timeline_5).super_0); + } else { + let mut bezierCount_4: c_int = readVarint(input, 1 as c_int); + match timelineType_0 as c_int { + 0 => { + readTimelineBinary( + input, + timelines, + &mut (*(spRotateTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + ) -> *mut spRotateTimeline)( + frameCount_0, + bezierCount_4, + boneIndex, + )) + .super_0, + 1 as c_int as c_float, + ); + } + 1 => { + readTimeline2Binary( + input, + timelines, + &mut (*(spTranslateTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + ) -> *mut spTranslateTimeline)( + frameCount_0, + bezierCount_4, + boneIndex, + )) + .super_0, + scale, + ); + } + 2 => { + readTimelineBinary( + input, + timelines, + &mut (*(spTranslateXTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + ) -> *mut spTranslateXTimeline)( + frameCount_0, + bezierCount_4, + boneIndex, + )) + .super_0, + scale, + ); + } + 3 => { + readTimelineBinary( + input, + timelines, + &mut (*(spTranslateYTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + ) -> *mut spTranslateYTimeline)( + frameCount_0, + bezierCount_4, + boneIndex, + )) + .super_0, + scale, + ); + } + 4 => { + readTimeline2Binary( + input, + timelines, + &mut (*(spScaleTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + ) -> *mut spScaleTimeline)( + frameCount_0, + bezierCount_4, + boneIndex, + )) + .super_0, + 1 as c_int as c_float, + ); + } + 5 => { + readTimelineBinary( + input, + timelines, + &mut (*(spScaleXTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + ) -> *mut spScaleXTimeline)( + frameCount_0, + bezierCount_4, + boneIndex, + )) + .super_0, + 1 as c_int as c_float, + ); + } + 6 => { + readTimelineBinary( + input, + timelines, + &mut (*(spScaleYTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + ) -> *mut spScaleYTimeline)( + frameCount_0, + bezierCount_4, + boneIndex, + )) + .super_0, + 1 as c_int as c_float, + ); + } + 7 => { + readTimeline2Binary( + input, + timelines, + &mut (*(spShearTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + ) -> *mut spShearTimeline)( + frameCount_0, + bezierCount_4, + boneIndex, + )) + .super_0, + 1 as c_int as c_float, + ); + } + 8 => { + readTimelineBinary( + input, + timelines, + &mut (*(spShearXTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + ) -> *mut spShearXTimeline)( + frameCount_0, + bezierCount_4, + boneIndex, + )) + .super_0, + 1 as c_int as c_float, + ); + } + 9 => { + readTimelineBinary( + input, + timelines, + &mut (*(spShearYTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + ) -> *mut spShearYTimeline)( + frameCount_0, + bezierCount_4, + boneIndex, + )) + .super_0, + 1 as c_int as c_float, + ); + } + _ => { + iii = 0 as c_int; + while iii < (*timelines).size { + spTimeline_dispose( + *((*timelines).items).offset(iii as isize), + ); + iii += 1; + } + spTimelineArray_dispose(timelines); + _spSkeletonBinary_setError( + self_0, + b"Invalid timeline type for a bone: \0" as *const u8 + as *const c_char, + (**((*skeletonData).bones).offset(boneIndex as isize)).name, + ); + return 0 as *mut spAnimation; } - spTimelineArray_dispose(timelines); - _spSkeletonBinary_setError( - self_0, - b"Invalid timeline type for a bone: \0" as *const u8 as *const c_char, - (**((*skeletonData).bones).offset(boneIndex as isize)).name, - ); - return std::ptr::null_mut(); } } - spTimelineArray_add(timelines, timeline_5); ii += 1; } i += 1; @@ -16507,73 +18981,100 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( let mut frameCount_1: c_int = readVarint(input, 1 as c_int); let mut frameLast_0: c_int = frameCount_1 - 1 as c_int; let mut bezierCount_5: c_int = readVarint(input, 1 as c_int); - let mut timeline_6: *mut spIkConstraintTimeline = - spIkConstraintTimeline_create(frameCount_1, bezierCount_5, index); - let mut time_5: c_float = readFloat(input); - let mut mix: c_float = readFloat(input); - let mut softness: c_float = readFloat(input) * scale; + let mut timeline_6: *mut spIkConstraintTimeline = spIkConstraintTimeline_create( + frameCount_1, + bezierCount_5, + index, + ); + let mut flags: c_int = readByte(input) as c_int; + let mut time_6: c_float = readFloat(input); + let mut mix: c_float = if flags & 1 as c_int != 0 as c_int { + if flags & 2 as c_int != 0 as c_int { + readFloat(input) + } else { + 1 as c_int as c_float + } + } else { + 0 as c_int as c_float + }; + let mut softness: c_float = if flags & 4 as c_int != 0 as c_int + { + readFloat(input) * scale + } else { + 0 as c_int as c_float + }; frame = 0 as c_int; bezier = 0 as c_int; loop { - let mut time2_4: c_float = 0.; - let mut mix2: c_float = 0.; - let mut softness2: c_float = 0.; - let mut bendDirection: c_int = readSByte(input) as c_int; - let mut compress: c_int = readBoolean(input); - let mut stretch: c_int = readBoolean(input); spIkConstraintTimeline_setFrame( timeline_6, frame, - time_5, + time_6, mix, softness, - bendDirection, - compress, - stretch, + if flags & 8 as c_int != 0 as c_int { + 1 as c_int + } else { + -(1 as c_int) + }, + (flags & 16 as c_int != 0 as c_int) as c_int, + (flags & 32 as c_int != 0 as c_int) as c_int, ); if frame == frameLast_0 { break; } - time2_4 = readFloat(input); - mix2 = readFloat(input); - softness2 = readFloat(input) * scale; - match readSByte(input) as c_int { - 1 => { - spCurveTimeline_setStepped(&mut (*timeline_6).super_0, frame); - } - 2 => { - let fresh128 = bezier; - bezier = bezier + 1; - setBezierBinary( - input, - &mut (*timeline_6).super_0.super_0, - fresh128, - frame, - 0 as c_int, - time_5, - time2_4, - mix, - mix2, - 1 as c_int as c_float, - ); - let fresh129 = bezier; - bezier = bezier + 1; - setBezierBinary( - input, - &mut (*timeline_6).super_0.super_0, - fresh129, - frame, - 1 as c_int, - time_5, - time2_4, - softness, - softness2, - scale, - ); + flags = readByte(input) as c_int; + let mut time2_4: c_float = readFloat(input); + let mut mix2: c_float = if flags & 1 as c_int != 0 as c_int + { + if flags & 2 as c_int != 0 as c_int { + readFloat(input) + } else { + 1 as c_int as c_float } - _ => {} + } else { + 0 as c_int as c_float + }; + let mut softness2: c_float = if flags & 4 as c_int + != 0 as c_int + { + readFloat(input) * scale + } else { + 0 as c_int as c_float + }; + if flags & 64 as c_int != 0 as c_int { + spCurveTimeline_setStepped(&mut (*timeline_6).super_0, frame); + } else if flags & 128 as c_int != 0 as c_int { + let fresh93 = bezier; + bezier = bezier + 1; + setBezierBinary( + input, + &mut (*timeline_6).super_0.super_0, + fresh93, + frame, + 0 as c_int, + time_6, + time2_4, + mix, + mix2, + 1 as c_int as c_float, + ); + let fresh94 = bezier; + bezier = bezier + 1; + setBezierBinary( + input, + &mut (*timeline_6).super_0.super_0, + fresh94, + frame, + 1 as c_int, + time_6, + time2_4, + softness, + softness2, + scale, + ); } - time_5 = time2_4; + time_6 = time2_4; mix = mix2; softness = softness2; frame += 1; @@ -16588,9 +19089,12 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( let mut frameCount_2: c_int = readVarint(input, 1 as c_int); let mut frameLast_1: c_int = frameCount_2 - 1 as c_int; let mut bezierCount_6: c_int = readVarint(input, 1 as c_int); - let mut timeline_7: *mut spTransformConstraintTimeline = - spTransformConstraintTimeline_create(frameCount_2, bezierCount_6, index_0); - let mut time_6: c_float = readFloat(input); + let mut timeline_7: *mut spTransformConstraintTimeline = spTransformConstraintTimeline_create( + frameCount_2, + bezierCount_6, + index_0, + ); + let mut time_7: c_float = readFloat(input); let mut mixRotate: c_float = readFloat(input); let mut mixX: c_float = readFloat(input); let mut mixY: c_float = readFloat(input); @@ -16608,7 +19112,15 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( let mut mixScaleY2: c_float = 0.; let mut mixShearY2: c_float = 0.; spTransformConstraintTimeline_setFrame( - timeline_7, frame, time_6, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY, + timeline_7, + frame, + time_7, + mixRotate, + mixX, + mixY, + mixScaleX, + mixScaleY, + mixShearY, ); if frame == frameLast_1 { break; @@ -16625,85 +19137,85 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( spCurveTimeline_setStepped(&mut (*timeline_7).super_0, frame); } 2 => { - let fresh130 = bezier; + let fresh95 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_7).super_0.super_0, - fresh130, + fresh95, frame, 0 as c_int, - time_6, + time_7, time2_5, mixRotate, mixRotate2, 1 as c_int as c_float, ); - let fresh131 = bezier; + let fresh96 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_7).super_0.super_0, - fresh131, + fresh96, frame, 1 as c_int, - time_6, + time_7, time2_5, mixX, mixX2, 1 as c_int as c_float, ); - let fresh132 = bezier; + let fresh97 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_7).super_0.super_0, - fresh132, + fresh97, frame, 2 as c_int, - time_6, + time_7, time2_5, mixY, mixY2, 1 as c_int as c_float, ); - let fresh133 = bezier; + let fresh98 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_7).super_0.super_0, - fresh133, + fresh98, frame, 3 as c_int, - time_6, + time_7, time2_5, mixScaleX, mixScaleX2, 1 as c_int as c_float, ); - let fresh134 = bezier; + let fresh99 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_7).super_0.super_0, - fresh134, + fresh99, frame, 4 as c_int, - time_6, + time_7, time2_5, mixScaleY, mixScaleY2, 1 as c_int as c_float, ); - let fresh135 = bezier; + let fresh100 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_7).super_0.super_0, - fresh135, + fresh100, frame, 5 as c_int, - time_6, + time_7, time2_5, mixShearY, mixShearY2, @@ -16712,7 +19224,7 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( } _ => {} } - time_6 = time2_5; + time_7 = time2_5; mixRotate = mixRotate2; mixX = mixX2; mixY = mixY2; @@ -16728,86 +19240,84 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( n = readVarint(input, 1 as c_int); while i < n { let mut index_1: c_int = readVarint(input, 1 as c_int); - let mut data: *mut spPathConstraintData = - *((*skeletonData).pathConstraints).offset(index_1 as isize); + let mut data: *mut spPathConstraintData = *((*skeletonData).pathConstraints) + .offset(index_1 as isize); ii = 0 as c_int; nn = readVarint(input, 1 as c_int); while ii < nn { - let mut type_0: c_int = readSByte(input) as c_int; + let mut type_0: c_int = readByte(input) as c_int; let mut frameCount_3: c_int = readVarint(input, 1 as c_int); let mut bezierCount_7: c_int = readVarint(input, 1 as c_int); match type_0 { 0 => { - spTimelineArray_add( + readTimelineBinary( + input, timelines, - readTimelineBinary( - input, - &mut (*(spPathConstraintPositionTimeline_create - as unsafe extern "C" fn( - c_int, - c_int, - c_int, - ) - -> *mut spPathConstraintPositionTimeline)( - frameCount_3, - bezierCount_7, - index_1, - )) + &mut (*(spPathConstraintPositionTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + ) -> *mut spPathConstraintPositionTimeline)( + frameCount_3, + bezierCount_7, + index_1, + )) .super_0, - if (*data).positionMode as c_uint - == SP_POSITION_MODE_FIXED as c_int as c_uint - { - scale - } else { - 1 as c_int as c_float - }, - ), + if (*data).positionMode as c_uint + == SP_POSITION_MODE_FIXED as c_int as c_uint + { + scale + } else { + 1 as c_int as c_float + }, ); } 1 => { - spTimelineArray_add( + readTimelineBinary( + input, timelines, - readTimelineBinary( - input, - &mut (*(spPathConstraintSpacingTimeline_create - as unsafe extern "C" fn( - c_int, - c_int, - c_int, - ) - -> *mut spPathConstraintSpacingTimeline)( - frameCount_3, - bezierCount_7, - index_1, - )) + &mut (*(spPathConstraintSpacingTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + ) -> *mut spPathConstraintSpacingTimeline)( + frameCount_3, + bezierCount_7, + index_1, + )) .super_0, - if (*data).spacingMode as c_uint - == SP_SPACING_MODE_LENGTH as c_int as c_uint - || (*data).spacingMode as c_uint - == SP_SPACING_MODE_FIXED as c_int as c_uint - { - scale - } else { - 1 as c_int as c_float - }, - ), + if (*data).spacingMode as c_uint + == SP_SPACING_MODE_LENGTH as c_int as c_uint + || (*data).spacingMode as c_uint + == SP_SPACING_MODE_FIXED as c_int as c_uint + { + scale + } else { + 1 as c_int as c_float + }, ); } 2 => { - let mut time_7: c_float = 0.; + let mut time_8: c_float = 0.; let mut mixRotate_0: c_float = 0.; let mut mixX_0: c_float = 0.; let mut mixY_0: c_float = 0.; let mut frameLast_2: c_int = 0; - let mut timeline_8: *mut spPathConstraintMixTimeline = - spPathConstraintMixTimeline_create(frameCount_3, bezierCount_7, index_1); - time_7 = readFloat(input); + let mut timeline_8: *mut spPathConstraintMixTimeline = spPathConstraintMixTimeline_create( + frameCount_3, + bezierCount_7, + index_1, + ); + time_8 = readFloat(input); mixRotate_0 = readFloat(input); mixX_0 = readFloat(input); mixY_0 = readFloat(input); frame = 0 as c_int; bezier = 0 as c_int; - frameLast_2 = (*timeline_8).super_0.super_0.frameCount - 1 as c_int; + frameLast_2 = (*timeline_8).super_0.super_0.frameCount + - 1 as c_int; loop { let mut time2_6: c_float = 0.; let mut mixRotate2_0: c_float = 0.; @@ -16816,7 +19326,7 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( spPathConstraintMixTimeline_setFrame( timeline_8, frame, - time_7, + time_8, mixRotate_0, mixX_0, mixY_0, @@ -16830,46 +19340,49 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( mixY2_0 = readFloat(input); match readSByte(input) as c_int { 1 => { - spCurveTimeline_setStepped(&mut (*timeline_8).super_0, frame); + spCurveTimeline_setStepped( + &mut (*timeline_8).super_0, + frame, + ); } 2 => { - let fresh136 = bezier; + let fresh101 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_8).super_0.super_0, - fresh136, + fresh101, frame, 0 as c_int, - time_7, + time_8, time2_6, mixRotate_0, mixRotate2_0, 1 as c_int as c_float, ); - let fresh137 = bezier; + let fresh102 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_8).super_0.super_0, - fresh137, + fresh102, frame, 1 as c_int, - time_7, + time_8, time2_6, mixX_0, mixX2_0, 1 as c_int as c_float, ); - let fresh138 = bezier; + let fresh103 = bezier; bezier = bezier + 1; setBezierBinary( input, &mut (*timeline_8).super_0.super_0, - fresh138, + fresh103, frame, 2 as c_int, - time_7, + time_8, time2_6, mixY_0, mixY2_0, @@ -16878,7 +19391,7 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( } _ => {} } - time_7 = time2_6; + time_8 = time2_6; mixRotate_0 = mixRotate2_0; mixX_0 = mixX2_0; mixY_0 = mixY2_0; @@ -16895,8 +19408,183 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( i = 0 as c_int; n = readVarint(input, 1 as c_int); while i < n { - let mut skin: *mut spSkin = - *((*skeletonData).skins).offset(readVarint(input, 1 as c_int) as isize); + let mut index_2: c_int = readVarint(input, 1 as c_int) + - 1 as c_int; + ii = 0 as c_int; + nn = readVarint(input, 1 as c_int); + while ii < nn { + let mut type_1: c_int = readByte(input) as c_int; + let mut frameCount_4: c_int = readVarint(input, 1 as c_int); + if type_1 == 8 as c_int { + let mut timeline_9: *mut spPhysicsConstraintResetTimeline = spPhysicsConstraintResetTimeline_create( + frameCount_4, + index_2, + ); + frame = 0 as c_int; + while frame < frameCount_4 { + spPhysicsConstraintResetTimeline_setFrame( + timeline_9, + frame, + readFloat(input), + ); + frame += 1; + } + spTimelineArray_add(timelines, &mut (*timeline_9).super_0); + } else { + let mut bezierCount_8: c_int = readVarint(input, 1 as c_int); + match type_1 { + 0 => { + readTimelineBinary( + input, + timelines, + &mut (*(spPhysicsConstraintTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + spTimelineType, + ) -> *mut spPhysicsConstraintTimeline)( + frameCount_4, + bezierCount_8, + index_2, + SP_TIMELINE_PHYSICSCONSTRAINT_INERTIA, + )) + .super_0, + 1 as c_int as c_float, + ); + } + 1 => { + readTimelineBinary( + input, + timelines, + &mut (*(spPhysicsConstraintTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + spTimelineType, + ) -> *mut spPhysicsConstraintTimeline)( + frameCount_4, + bezierCount_8, + index_2, + SP_TIMELINE_PHYSICSCONSTRAINT_STRENGTH, + )) + .super_0, + 1 as c_int as c_float, + ); + } + 2 => { + readTimelineBinary( + input, + timelines, + &mut (*(spPhysicsConstraintTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + spTimelineType, + ) -> *mut spPhysicsConstraintTimeline)( + frameCount_4, + bezierCount_8, + index_2, + SP_TIMELINE_PHYSICSCONSTRAINT_DAMPING, + )) + .super_0, + 1 as c_int as c_float, + ); + } + 4 => { + readTimelineBinary( + input, + timelines, + &mut (*(spPhysicsConstraintTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + spTimelineType, + ) -> *mut spPhysicsConstraintTimeline)( + frameCount_4, + bezierCount_8, + index_2, + SP_TIMELINE_PHYSICSCONSTRAINT_MASS, + )) + .super_0, + 1 as c_int as c_float, + ); + } + 5 => { + readTimelineBinary( + input, + timelines, + &mut (*(spPhysicsConstraintTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + spTimelineType, + ) -> *mut spPhysicsConstraintTimeline)( + frameCount_4, + bezierCount_8, + index_2, + SP_TIMELINE_PHYSICSCONSTRAINT_WIND, + )) + .super_0, + 1 as c_int as c_float, + ); + } + 6 => { + readTimelineBinary( + input, + timelines, + &mut (*(spPhysicsConstraintTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + spTimelineType, + ) -> *mut spPhysicsConstraintTimeline)( + frameCount_4, + bezierCount_8, + index_2, + SP_TIMELINE_PHYSICSCONSTRAINT_GRAVITY, + )) + .super_0, + 1 as c_int as c_float, + ); + } + 7 => { + readTimelineBinary( + input, + timelines, + &mut (*(spPhysicsConstraintTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + spTimelineType, + ) -> *mut spPhysicsConstraintTimeline)( + frameCount_4, + bezierCount_8, + index_2, + SP_TIMELINE_PHYSICSCONSTRAINT_MIX, + )) + .super_0, + 1 as c_int as c_float, + ); + } + _ => {} + } + } + ii += 1; + } + i += 1; + } + i = 0 as c_int; + n = readVarint(input, 1 as c_int); + while i < n { + let mut skin: *mut spSkin = *((*skeletonData).skins) + .offset(readVarint(input, 1 as c_int) as isize); ii = 0 as c_int; nn = readVarint(input, 1 as c_int); while ii < nn { @@ -16904,16 +19592,21 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( iii = 0 as c_int; nnn = readVarint(input, 1 as c_int); while iii < nnn { - let mut frameCount_4: c_int = 0; + let mut frameCount_5: c_int = 0; let mut frameLast_3: c_int = 0; - let mut bezierCount_8: c_int = 0; - let mut time_8: c_float = 0.; + let mut bezierCount_9: c_int = 0; + let mut time_9: c_float = 0.; let mut time2_7: c_float = 0.; let mut timelineType_1: c_uint = 0; - let mut attachmentName_0: *const c_char = readStringRef(input, skeletonData); - let mut attachment: *mut spVertexAttachment = - spSkin_getAttachment(skin, slotIndex_0, attachmentName_0) - as *mut spVertexAttachment; + let mut attachmentName_0: *const c_char = readStringRef( + input, + skeletonData, + ); + let mut attachment: *mut spVertexAttachment = spSkin_getAttachment( + skin, + slotIndex_0, + attachmentName_0, + ) as *mut spVertexAttachment; if attachment.is_null() { i = 0 as c_int; while i < (*timelines).size { @@ -16926,20 +19619,23 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( b"Attachment not found: \0" as *const u8 as *const c_char, attachmentName_0, ); - return std::ptr::null_mut(); + return 0 as *mut spAnimation; } timelineType_1 = readByte(input) as c_uint; - frameCount_4 = readVarint(input, 1 as c_int); - frameLast_3 = frameCount_4 - 1 as c_int; + frameCount_5 = readVarint(input, 1 as c_int); + frameLast_3 = frameCount_5 - 1 as c_int; match timelineType_1 { 0 => { - let mut tempDeform: *mut c_float = std::ptr::null_mut(); + let mut tempDeform: *mut c_float = 0 as *mut c_float; let mut weighted: c_int = 0; let mut deformLength: c_int = 0; - let mut timeline_9: *mut spDeformTimeline = std::ptr::null_mut(); - weighted = ((*attachment).bones != std::ptr::null_mut()) as c_int; + let mut timeline_10: *mut spDeformTimeline = 0 + as *mut spDeformTimeline; + weighted = ((*attachment).bones != 0 as *mut c_int) + as c_int; deformLength = if weighted != 0 { - (*attachment).verticesCount / 3 as c_int * 2 as c_int + (*attachment).verticesCount / 3 as c_int + * 2 as c_int } else { (*attachment).verticesCount }; @@ -16947,22 +19643,25 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( (::core::mem::size_of::() as c_ulong) .wrapping_mul(deformLength as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 9124 as c_int, + 9864 as c_int, ) as *mut c_float; - bezierCount_8 = readVarint(input, 1 as c_int); - timeline_9 = spDeformTimeline_create( - frameCount_4, + bezierCount_9 = readVarint(input, 1 as c_int); + timeline_10 = spDeformTimeline_create( + frameCount_5, deformLength, - bezierCount_8, + bezierCount_9, slotIndex_0, attachment, ); - time_8 = readFloat(input); + time_9 = readFloat(input); frame = 0 as c_int; bezier = 0 as c_int; loop { - let mut deform: *mut c_float = std::ptr::null_mut(); - let mut end: c_int = readVarint(input, 1 as c_int); + let mut deform: *mut c_float = 0 as *mut c_float; + let mut end: c_int = readVarint( + input, + 1 as c_int, + ); if end == 0 { if weighted != 0 { deform = tempDeform; @@ -16977,7 +19676,10 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( } } else { let mut v: c_int = 0; - let mut start: c_int = readVarint(input, 1 as c_int); + let mut start: c_int = readVarint( + input, + 1 as c_int, + ); deform = tempDeform; spine_memset( deform as *mut c_void, @@ -16995,8 +19697,8 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( } else { v = start; while v < end { - *deform.offset(v as isize) = - readFloat(input) * (*self_0).scale; + *deform + .offset(v as isize) = readFloat(input) * (*self_0).scale; v += 1; } } @@ -17007,7 +19709,8 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( .wrapping_mul((deformLength - v) as c_ulong), ); if weighted == 0 { - let mut vertices: *mut c_float = (*attachment).vertices; + let mut vertices: *mut c_float = (*attachment) + .vertices; v = 0 as c_int; while v < deformLength { *deform.offset(v as isize) += *vertices.offset(v as isize); @@ -17015,25 +19718,33 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( } } } - spDeformTimeline_setFrame(timeline_9, frame, time_8, deform); + spDeformTimeline_setFrame( + timeline_10, + frame, + time_9, + deform, + ); if frame == frameLast_3 { break; } time2_7 = readFloat(input); match readSByte(input) as c_int { 1 => { - spCurveTimeline_setStepped(&mut (*timeline_9).super_0, frame); + spCurveTimeline_setStepped( + &mut (*timeline_10).super_0, + frame, + ); } 2 => { - let fresh139 = bezier; + let fresh104 = bezier; bezier = bezier + 1; setBezierBinary( input, - &mut (*timeline_9).super_0.super_0, - fresh139, + &mut (*timeline_10).super_0.super_0, + fresh104, frame, 0 as c_int, - time_8, + time_9, time2_7, 0 as c_int as c_float, 1 as c_int as c_float, @@ -17042,36 +19753,36 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( } _ => {} } - time_8 = time2_7; + time_9 = time2_7; frame += 1; } _spFree(tempDeform as *mut c_void); - spTimelineArray_add(timelines, timeline_9 as *mut spTimeline); + spTimelineArray_add(timelines, timeline_10 as *mut spTimeline); } 1 => { let mut modeAndIndex: c_int = 0; let mut delay: c_float = 0.; - let mut timeline_10: *mut spSequenceTimeline = spSequenceTimeline_create( - frameCount_4, + let mut timeline_11: *mut spSequenceTimeline = spSequenceTimeline_create( + frameCount_5, slotIndex_0, attachment as *mut spAttachment, ); frame = 0 as c_int; - while frame < frameCount_4 { - time_8 = readFloat(input); + while frame < frameCount_5 { + time_9 = readFloat(input); modeAndIndex = readInt(input); delay = readFloat(input); spSequenceTimeline_setFrame( - timeline_10, + timeline_11, frame, - time_8, + time_9, modeAndIndex & 0xf as c_int, modeAndIndex >> 4 as c_int, delay, ); frame += 1; } - spTimelineArray_add(timelines, timeline_10 as *mut spTimeline); + spTimelineArray_add(timelines, timeline_11 as *mut spTimeline); } _ => {} } @@ -17083,23 +19794,27 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( } drawOrderCount = readVarint(input, 1 as c_int); if drawOrderCount != 0 { - let mut timeline_11: *mut spDrawOrderTimeline = - spDrawOrderTimeline_create(drawOrderCount, (*skeletonData).slotsCount); + let mut timeline_12: *mut spDrawOrderTimeline = spDrawOrderTimeline_create( + drawOrderCount, + (*skeletonData).slotsCount, + ); i = 0 as c_int; while i < drawOrderCount { - let mut time_9: c_float = readFloat(input); + let mut time_10: c_float = readFloat(input); let mut offsetCount: c_int = readVarint(input, 1 as c_int); let mut drawOrder: *mut c_int = _spMalloc( (::core::mem::size_of::() as c_ulong) .wrapping_mul((*skeletonData).slotsCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 9201 as c_int, + 9941 as c_int, ) as *mut c_int; let mut unchanged: *mut c_int = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul(((*skeletonData).slotsCount - offsetCount) as c_ulong), + .wrapping_mul( + ((*skeletonData).slotsCount - offsetCount) as c_ulong, + ), b"spine.c\0" as *const u8 as *const c_char, - 9202 as c_int, + 9942 as c_int, ) as *mut c_int; let mut originalIndex: c_int = 0 as c_int; let mut unchangedIndex: c_int = 0 as c_int; @@ -17113,79 +19828,78 @@ unsafe extern "C" fn _spSkeletonBinary_readAnimation( while ii < offsetCount { let mut slotIndex_1: c_int = readVarint(input, 1 as c_int); while originalIndex != slotIndex_1 { - let fresh140 = originalIndex; + let fresh105 = originalIndex; originalIndex = originalIndex + 1; - let fresh141 = unchangedIndex; + let fresh106 = unchangedIndex; unchangedIndex = unchangedIndex + 1; - *unchanged.offset(fresh141 as isize) = fresh140; + *unchanged.offset(fresh106 as isize) = fresh105; } - *drawOrder.offset((originalIndex + readVarint(input, 1 as c_int)) as isize) = - originalIndex; + *drawOrder + .offset( + (originalIndex + readVarint(input, 1 as c_int)) as isize, + ) = originalIndex; originalIndex += 1; ii += 1; } while originalIndex < (*skeletonData).slotsCount { - let fresh142 = originalIndex; + let fresh107 = originalIndex; originalIndex = originalIndex + 1; - let fresh143 = unchangedIndex; + let fresh108 = unchangedIndex; unchangedIndex = unchangedIndex + 1; - *unchanged.offset(fresh143 as isize) = fresh142; + *unchanged.offset(fresh108 as isize) = fresh107; } ii = (*skeletonData).slotsCount - 1 as c_int; while ii >= 0 as c_int { if *drawOrder.offset(ii as isize) == -(1 as c_int) { unchangedIndex -= 1; - *drawOrder.offset(ii as isize) = *unchanged.offset(unchangedIndex as isize); + *drawOrder + .offset( + ii as isize, + ) = *unchanged.offset(unchangedIndex as isize); } ii -= 1; } _spFree(unchanged as *mut c_void); - spDrawOrderTimeline_setFrame(timeline_11, i, time_9, drawOrder); + spDrawOrderTimeline_setFrame(timeline_12, i, time_10, drawOrder); _spFree(drawOrder as *mut c_void); i += 1; } - spTimelineArray_add(timelines, timeline_11 as *mut spTimeline); + spTimelineArray_add(timelines, timeline_12 as *mut spTimeline); } eventCount = readVarint(input, 1 as c_int); if eventCount != 0 { - let mut timeline_12: *mut spEventTimeline = spEventTimeline_create(eventCount); + let mut timeline_13: *mut spEventTimeline = spEventTimeline_create(eventCount); i = 0 as c_int; while i < eventCount { - let mut time_10: c_float = readFloat(input); - let mut eventData: *mut spEventData = - *((*skeletonData).events).offset(readVarint(input, 1 as c_int) as isize); - let mut event: *mut spEvent = spEvent_create(time_10, eventData); + let mut time_11: c_float = readFloat(input); + let mut eventData: *mut spEventData = *((*skeletonData).events) + .offset(readVarint(input, 1 as c_int) as isize); + let mut event: *mut spEvent = spEvent_create(time_11, eventData); (*event).intValue = readVarint(input, 0 as c_int); (*event).floatValue = readFloat(input); - if readBoolean(input) != 0 { - (*event).stringValue = readString(input); + let mut event_stringValue: *const c_char = readString(input); + if event_stringValue.is_null() { + (*event).stringValue = string_copy((*eventData).stringValue); } else { - let ref mut fresh144 = - *(&mut (*event).stringValue as *mut *const c_char as *mut *mut c_char); - *fresh144 = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul( - (spine_strlen((*eventData).stringValue)) - .wrapping_add(1 as c_int as c_ulong), - ), - b"spine.c\0" as *const u8 as *const c_char, - 9241 as c_int, - ) as *mut c_char; - spine_strcpy(*fresh144, (*eventData).stringValue); + (*event).stringValue = string_copy(event_stringValue); + _spFree(event_stringValue as *mut c_void); } if !((*eventData).audioPath).is_null() { (*event).volume = readFloat(input); (*event).balance = readFloat(input); } - spEventTimeline_setFrame(timeline_12, i, event); + spEventTimeline_setFrame(timeline_13, i, event); i += 1; } - spTimelineArray_add(timelines, timeline_12 as *mut spTimeline); + spTimelineArray_add(timelines, timeline_13 as *mut spTimeline); } duration = 0 as c_int as c_float; i = 0 as c_int; n = (*timelines).size; while i < n { - duration = if duration > spTimeline_getDuration(*((*timelines).items).offset(i as isize)) { + duration = if duration + > spTimeline_getDuration(*((*timelines).items).offset(i as isize)) + { duration } else { spTimeline_getDuration(*((*timelines).items).offset(i as isize)) @@ -17201,9 +19915,10 @@ unsafe extern "C" fn _readFloatArray( mut scale: c_float, ) -> *mut c_float { let mut array: *mut c_float = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul(n as c_ulong), + (::core::mem::size_of::() as c_ulong) + .wrapping_mul(n as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 9260 as c_int, + 9999 as c_int, ) as *mut c_float; let mut i: c_int = 0; if scale == 1 as c_int as c_float { @@ -17223,70 +19938,85 @@ unsafe extern "C" fn _readFloatArray( } unsafe extern "C" fn _readShortArray( mut input: *mut _dataInput, - mut length: *mut c_int, -) -> *mut c_short { - let mut n: c_int = readVarint(input, 1 as c_int); - let mut array: *mut c_short = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul(n as c_ulong), + mut n: c_int, +) -> *mut c_ushort { + let mut array: *mut c_ushort = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul(n as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 9273 as c_int, - ) as *mut c_short; + 10011 as c_int, + ) as *mut c_ushort; let mut i: c_int = 0; - *length = n; i = 0 as c_int; while i < n { - *array.offset(i as isize) = ((readByte(input) as c_int) << 8 as c_int) as c_short; - let ref mut fresh145 = *array.offset(i as isize); - *fresh145 = (*fresh145 as c_int | readByte(input) as c_int) as c_short; + *array + .offset(i as isize) = readVarint(input, 1 as c_int) as c_ushort; i += 1; } return array; } unsafe extern "C" fn _readVerticesBinary( - mut self_0: *mut spSkeletonBinary, mut input: *mut _dataInput, - mut bonesCount: *mut c_int, - mut bones2: *mut *mut c_int, - mut verticesCount: *mut c_int, mut vertices: *mut *mut c_float, - mut worldVerticesLength: *mut c_int, - mut vertexCount: c_int, -) { - let mut i: c_int = 0; - let mut ii: c_int = 0; - let mut verticesLength: c_int = vertexCount << 1 as c_int; - let mut weights: *mut spFloatArray = std::ptr::null_mut(); - let mut bones: *mut spIntArray = std::ptr::null_mut(); - *worldVerticesLength = verticesLength; - if readBoolean(input) == 0 { - *verticesCount = verticesLength; - *vertices = _readFloatArray(input, verticesLength, (*self_0).scale); + mut verticesLength: *mut c_int, + mut bones: *mut *mut c_int, + mut bonesCount: *mut c_int, + mut weighted: c_int, + mut scale: c_float, +) -> c_int { + let mut vertexCount: c_int = readVarint(input, 1 as c_int); + *verticesLength = vertexCount << 1 as c_int; + if weighted == 0 { + *vertices = _readFloatArray(input, *verticesLength, scale); + *bones = 0 as *mut c_int; *bonesCount = 0 as c_int; - *bones2 = std::ptr::null_mut(); - return; + return *verticesLength; } - weights = spFloatArray_create(verticesLength * 3 as c_int * 3 as c_int); - bones = spIntArray_create(verticesLength * 3 as c_int); - i = 0 as c_int; + let mut v: *mut c_float = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul( + (*verticesLength * 3 as c_int * 3 as c_int) as c_ulong, + ), + b"spine.c\0" as *const u8 as *const c_char, + 10029 as c_int, + ) as *mut c_float; + let mut b: *mut c_int = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul((*verticesLength * 3 as c_int) as c_ulong), + b"spine.c\0" as *const u8 as *const c_char, + 10030 as c_int, + ) as *mut c_int; + let mut boneIdx: c_int = 0 as c_int; + let mut vertexIdx: c_int = 0 as c_int; + let mut i: c_int = 0 as c_int; while i < vertexCount { let mut boneCount: c_int = readVarint(input, 1 as c_int); - spIntArray_add(bones, boneCount); - ii = 0 as c_int; + let fresh109 = boneIdx; + boneIdx = boneIdx + 1; + *b.offset(fresh109 as isize) = boneCount; + let mut ii: c_int = 0 as c_int; while ii < boneCount { - spIntArray_add(bones, readVarint(input, 1 as c_int)); - spFloatArray_add(weights, readFloat(input) * (*self_0).scale); - spFloatArray_add(weights, readFloat(input) * (*self_0).scale); - spFloatArray_add(weights, readFloat(input)); + let fresh110 = boneIdx; + boneIdx = boneIdx + 1; + *b.offset(fresh110 as isize) = readVarint(input, 1 as c_int); + let fresh111 = vertexIdx; + vertexIdx = vertexIdx + 1; + *v.offset(fresh111 as isize) = readFloat(input) * scale; + let fresh112 = vertexIdx; + vertexIdx = vertexIdx + 1; + *v.offset(fresh112 as isize) = readFloat(input) * scale; + let fresh113 = vertexIdx; + vertexIdx = vertexIdx + 1; + *v.offset(fresh113 as isize) = readFloat(input); ii += 1; } i += 1; } - *verticesCount = (*weights).size; - *vertices = (*weights).items; - _spFree(weights as *mut c_void); - *bonesCount = (*bones).size; - *bones2 = (*bones).items; - _spFree(bones as *mut c_void); + *vertices = v; + *bones = b; + *bonesCount = boneIdx; + *verticesLength = vertexIdx; + return vertexCount << 1 as c_int; } #[no_mangle] pub unsafe extern "C" fn spSkeletonBinary_readAttachment( @@ -17298,79 +20028,67 @@ pub unsafe extern "C" fn spSkeletonBinary_readAttachment( mut skeletonData: *mut spSkeletonData, mut nonessential: c_int, ) -> *mut spAttachment { - let mut i: c_int = 0; - let mut type_0: spAttachmentType = SP_ATTACHMENT_REGION; - let mut name: *const c_char = readStringRef(input, skeletonData); - if name.is_null() { - name = attachmentName; - } - type_0 = readByte(input) as spAttachmentType; + let mut flags: c_int = readByte(input) as c_int; + let mut name: *const c_char = if flags & 8 as c_int != 0 as c_int { + readStringRef(input, skeletonData) as *const c_char + } else { + attachmentName + }; + let mut type_0: spAttachmentType = (flags & 0x7 as c_int) as spAttachmentType; match type_0 as c_uint { 0 => { - let mut path: *const c_char = readStringRef(input, skeletonData); - let mut rotation: c_float = 0.; - let mut x: c_float = 0.; - let mut y: c_float = 0.; - let mut scaleX: c_float = 0.; - let mut scaleY: c_float = 0.; - let mut width: c_float = 0.; - let mut height: c_float = 0.; + let mut path: *mut c_char = if flags & 16 as c_int + != 0 as c_int + { + readStringRef(input, skeletonData) + } else { + name as *mut c_char + }; + path = string_copy(path); let mut color: spColor = spColor { r: 0., g: 0., b: 0., a: 0., }; - let mut sequence: *mut spSequence = std::ptr::null_mut(); - if path.is_null() { - let ref mut fresh146 = *(&mut path as *mut *const c_char as *mut *mut c_char); - *fresh146 = _spMalloc( - (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)), - b"spine.c\0" as *const u8 as *const c_char, - 9339 as c_int, - ) as *mut c_char; - spine_strcpy(*fresh146, name); - } else { - let mut tmp: *const c_char = std::ptr::null_mut(); - let ref mut fresh147 = *(&mut tmp as *mut *const c_char as *mut *mut c_char); - *fresh147 = _spMalloc( - (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(path)).wrapping_add(1 as c_int as c_ulong)), - b"spine.c\0" as *const u8 as *const c_char, - 9342 as c_int, - ) as *mut c_char; - spine_strcpy(*fresh147, path); - path = tmp; - } - rotation = readFloat(input); - x = readFloat(input) * (*self_0).scale; - y = readFloat(input) * (*self_0).scale; - scaleX = readFloat(input); - scaleY = readFloat(input); - width = readFloat(input) * (*self_0).scale; - height = readFloat(input) * (*self_0).scale; - readColor( - input, - &mut color.r, - &mut color.g, - &mut color.b, - &mut color.a, + spColor_setFromFloats( + &mut color, + 1 as c_int as c_float, + 1 as c_int as c_float, + 1 as c_int as c_float, + 1 as c_int as c_float, ); - sequence = readSequenceBinary(input); - let mut attachment: *mut spAttachment = spAttachmentLoader_createAttachment( + if flags & 32 as c_int != 0 as c_int { + readColor(input, &mut color.r, &mut color.g, &mut color.b, &mut color.a); + } + let mut sequence: *mut spSequence = if flags & 64 as c_int + != 0 as c_int + { + readSequenceBinary(input) + } else { + 0 as *mut spSequence + }; + let mut rotation: c_float = if flags & 128 as c_int + != 0 as c_int + { + readFloat(input) + } else { + 0 as c_int as c_float + }; + let mut x: c_float = readFloat(input) * (*self_0).scale; + let mut y: c_float = readFloat(input) * (*self_0).scale; + let mut scaleX: c_float = readFloat(input); + let mut scaleY: c_float = readFloat(input); + let mut width: c_float = readFloat(input) * (*self_0).scale; + let mut height: c_float = readFloat(input) * (*self_0).scale; + let mut region: *mut spRegionAttachment = spAttachmentLoader_createAttachment( (*self_0).attachmentLoader, skin, type_0, name, path, sequence, - ); - let mut region: *mut spRegionAttachment = std::ptr::null_mut(); - if attachment.is_null() { - return std::ptr::null_mut(); - } - region = attachment as *mut spRegionAttachment; + ) as *mut spRegionAttachment; (*region).path = path; (*region).rotation = rotation; (*region).x = x; @@ -17384,120 +20102,122 @@ pub unsafe extern "C" fn spSkeletonBinary_readAttachment( if sequence.is_null() { spRegionAttachment_updateRegion(region); } - spAttachmentLoader_configureAttachment((*self_0).attachmentLoader, attachment); - return attachment; + spAttachmentLoader_configureAttachment( + (*self_0).attachmentLoader, + &mut (*region).super_0, + ); + return &mut (*region).super_0; } 1 => { - let mut vertexCount: c_int = readVarint(input, 1 as c_int); - let mut attachment_0: *mut spAttachment = spAttachmentLoader_createAttachment( + let mut box_0: *mut spBoundingBoxAttachment = spAttachmentLoader_createAttachment( (*self_0).attachmentLoader, skin, type_0, name, - std::ptr::null(), - std::ptr::null_mut(), - ); - let mut vertexAttachment: *mut spVertexAttachment = std::ptr::null_mut(); - if attachment_0.is_null() { - return std::ptr::null_mut(); + 0 as *const c_char, + 0 as *mut spSequence, + ) as *mut spBoundingBoxAttachment; + if box_0.is_null() { + return 0 as *mut spAttachment; } - vertexAttachment = attachment_0 as *mut spVertexAttachment; _readVerticesBinary( - self_0, input, - &mut (*vertexAttachment).bonesCount, - &mut (*vertexAttachment).bones, - &mut (*vertexAttachment).verticesCount, - &mut (*vertexAttachment).vertices, - &mut (*vertexAttachment).worldVerticesLength, - vertexCount, + &mut (*box_0).super_0.vertices, + &mut (*box_0).super_0.verticesCount, + &mut (*box_0).super_0.bones, + &mut (*box_0).super_0.bonesCount, + (flags & 16 as c_int != 0 as c_int) as c_int, + (*self_0).scale, ); + (*box_0).super_0.worldVerticesLength = (*box_0).super_0.verticesCount; if nonessential != 0 { - let mut bbox: *mut spBoundingBoxAttachment = - attachment_0 as *mut spBoundingBoxAttachment; readColor( input, - &mut (*bbox).color.r, - &mut (*bbox).color.g, - &mut (*bbox).color.b, - &mut (*bbox).color.a, + &mut (*box_0).color.r, + &mut (*box_0).color.g, + &mut (*box_0).color.b, + &mut (*box_0).color.a, ); } - spAttachmentLoader_configureAttachment((*self_0).attachmentLoader, attachment_0); - return attachment_0; + spAttachmentLoader_configureAttachment( + (*self_0).attachmentLoader, + &mut (*box_0).super_0.super_0, + ); + return &mut (*box_0).super_0.super_0; } 2 => { - let mut vertexCount_0: c_int = 0; - let mut path_0: *const c_char = readStringRef(input, skeletonData); + let mut uvs: *mut c_float = 0 as *mut c_float; + let mut uvsCount: c_int = 0 as c_int; + let mut triangles: *mut c_ushort = 0 as *mut c_ushort; + let mut trianglesCount: c_int = 0 as c_int; + let mut vertices: *mut c_float = 0 as *mut c_float; + let mut verticesCount: c_int = 0 as c_int; + let mut bones: *mut c_int = 0 as *mut c_int; + let mut bonesCount: c_int = 0 as c_int; + let mut hullLength: c_int = 0 as c_int; + let mut width_0: c_float = 0 as c_int as c_float; + let mut height_0: c_float = 0 as c_int as c_float; + let mut edges: *mut c_ushort = 0 as *mut c_ushort; + let mut edgesCount: c_int = 0 as c_int; + let mut path_0: *mut c_char = if flags & 16 as c_int + != 0 as c_int + { + readStringRef(input, skeletonData) + } else { + name as *mut c_char + }; + path_0 = string_copy(path_0); let mut color_0: spColor = spColor { r: 0., g: 0., b: 0., a: 0., }; - let mut regionUVs: *mut c_float = std::ptr::null_mut(); - let mut triangles: *mut c_ushort = std::ptr::null_mut(); - let mut trianglesCount: c_int = 0; - let mut bones: *mut c_int = std::ptr::null_mut(); - let mut bonesCount: c_int = 0; - let mut vertices: *mut c_float = std::ptr::null_mut(); - let mut verticesCount: c_int = 0; - let mut worldVerticesLength: c_int = 0; - let mut hullLength: c_int = 0; - let mut sequence_0: *mut spSequence = std::ptr::null_mut(); - let mut edges: *mut c_int = std::ptr::null_mut(); - let mut edgesCount: c_int = 0 as c_int; - let mut width_0: c_float = 0 as c_int as c_float; - let mut height_0: c_float = 0 as c_int as c_float; - if path_0.is_null() { - let ref mut fresh148 = *(&mut path_0 as *mut *const c_char as *mut *mut c_char); - *fresh148 = _spMalloc( - (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)), - b"spine.c\0" as *const u8 as *const c_char, - 9413 as c_int, - ) as *mut c_char; - spine_strcpy(*fresh148, name); - } else { - let mut tmp_0: *const c_char = std::ptr::null(); - let ref mut fresh149 = *(&mut tmp_0 as *mut *const c_char as *mut *mut c_char); - *fresh149 = _spMalloc( - (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(path_0)).wrapping_add(1 as c_int as c_ulong)), - b"spine.c\0" as *const u8 as *const c_char, - 9416 as c_int, - ) as *mut c_char; - spine_strcpy(*fresh149, path_0); - path_0 = tmp_0; - } - readColor( - input, - &mut color_0.r, - &mut color_0.g, - &mut color_0.b, - &mut color_0.a, + spColor_setFromFloats( + &mut color_0, + 1 as c_int as c_float, + 1 as c_int as c_float, + 1 as c_int as c_float, + 1 as c_int as c_float, ); - vertexCount_0 = readVarint(input, 1 as c_int); - regionUVs = _readFloatArray(input, vertexCount_0 << 1 as c_int, 1 as c_int as c_float); - triangles = _readShortArray(input, &mut trianglesCount) as *mut c_ushort; - _readVerticesBinary( - self_0, + if flags & 32 as c_int != 0 as c_int { + readColor( + input, + &mut color_0.r, + &mut color_0.g, + &mut color_0.b, + &mut color_0.a, + ); + } + let mut sequence_0: *mut spSequence = if flags & 64 as c_int + != 0 as c_int + { + readSequenceBinary(input) + } else { + 0 as *mut spSequence + }; + hullLength = readVarint(input, 1 as c_int); + let mut verticesLength: c_int = _readVerticesBinary( input, - &mut bonesCount, - &mut bones, - &mut verticesCount, &mut vertices, - &mut worldVerticesLength, - vertexCount_0, + &mut verticesCount, + &mut bones, + &mut bonesCount, + (flags & 128 as c_int != 0 as c_int) as c_int, + (*self_0).scale, ); - hullLength = readVarint(input, 1 as c_int) << 1 as c_int; - sequence_0 = readSequenceBinary(input); + uvsCount = verticesLength; + uvs = _readFloatArray(input, uvsCount, 1 as c_int as c_float); + trianglesCount = (verticesLength - hullLength - 2 as c_int) + * 3 as c_int; + triangles = _readShortArray(input, trianglesCount); if nonessential != 0 { - edges = _readShortArray(input, &mut edgesCount) as *mut c_int; - width_0 = readFloat(input) * (*self_0).scale; - height_0 = readFloat(input) * (*self_0).scale; + edgesCount = readVarint(input, 1 as c_int); + edges = _readShortArray(input, edgesCount); + width_0 = readFloat(input); + height_0 = readFloat(input); } - let mut attachment_1: *mut spAttachment = spAttachmentLoader_createAttachment( + let mut attachment: *mut spAttachment = spAttachmentLoader_createAttachment( (*self_0).attachmentLoader, skin, type_0, @@ -17505,21 +20225,20 @@ pub unsafe extern "C" fn spSkeletonBinary_readAttachment( path_0, sequence_0, ); - let mut mesh: *mut spMeshAttachment = std::ptr::null_mut(); - if attachment_1.is_null() { - return std::ptr::null_mut(); + if attachment.is_null() { + return 0 as *mut spAttachment; } - mesh = attachment_1 as *mut spMeshAttachment; + let mut mesh: *mut spMeshAttachment = attachment as *mut spMeshAttachment; (*mesh).path = path_0; spColor_setFromColor(&mut (*mesh).color, &mut color_0); - (*mesh).regionUVs = regionUVs; + (*mesh).regionUVs = uvs; (*mesh).triangles = triangles; (*mesh).trianglesCount = trianglesCount; (*mesh).super_0.vertices = vertices; (*mesh).super_0.verticesCount = verticesCount; (*mesh).super_0.bones = bones; (*mesh).super_0.bonesCount = bonesCount; - (*mesh).super_0.worldVerticesLength = worldVerticesLength; + (*mesh).super_0.worldVerticesLength = verticesLength; (*mesh).hullLength = hullLength; (*mesh).edges = edges; (*mesh).edgesCount = edgesCount; @@ -17529,60 +20248,61 @@ pub unsafe extern "C" fn spSkeletonBinary_readAttachment( if sequence_0.is_null() { spMeshAttachment_updateRegion(mesh); } - spAttachmentLoader_configureAttachment((*self_0).attachmentLoader, attachment_1); - return attachment_1; + spAttachmentLoader_configureAttachment( + (*self_0).attachmentLoader, + attachment, + ); + return attachment; } 3 => { + let mut path_1: *mut c_char = if flags & 16 as c_int + != 0 as c_int + { + readStringRef(input, skeletonData) + } else { + name as *mut c_char + }; + path_1 = string_copy(path_1); let mut color_1: spColor = spColor { r: 0., g: 0., b: 0., a: 0., }; + spColor_setFromFloats( + &mut color_1, + 1 as c_int as c_float, + 1 as c_int as c_float, + 1 as c_int as c_float, + 1 as c_int as c_float, + ); + if flags & 32 as c_int != 0 as c_int { + readColor( + input, + &mut color_1.r, + &mut color_1.g, + &mut color_1.b, + &mut color_1.a, + ); + } + let mut sequence_1: *mut spSequence = if flags & 64 as c_int + != 0 as c_int + { + readSequenceBinary(input) + } else { + 0 as *mut spSequence + }; + let mut inheritTimelines: c_int = (flags & 128 as c_int + != 0 as c_int) as c_int; + let mut skinIndex: c_int = readVarint(input, 1 as c_int); + let mut parent: *mut c_char = readStringRef(input, skeletonData); let mut width_1: c_float = 0 as c_int as c_float; let mut height_1: c_float = 0 as c_int as c_float; - let mut skinName: *const c_char = std::ptr::null(); - let mut parent: *const c_char = std::ptr::null(); - let mut inheritTimeline: c_int = 0; - let mut sequence_1: *mut spSequence = std::ptr::null_mut(); - let mut path_1: *const c_char = readStringRef(input, skeletonData); - if path_1.is_null() { - let ref mut fresh150 = *(&mut path_1 as *mut *const c_char as *mut *mut c_char); - *fresh150 = _spMalloc( - (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)), - b"spine.c\0" as *const u8 as *const c_char, - 9468 as c_int, - ) as *mut c_char; - spine_strcpy(*fresh150, name); - } else { - let mut tmp_1: *const c_char = std::ptr::null(); - let ref mut fresh151 = *(&mut tmp_1 as *mut *const c_char as *mut *mut c_char); - *fresh151 = _spMalloc( - (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(path_1)).wrapping_add(1 as c_int as c_ulong)), - b"spine.c\0" as *const u8 as *const c_char, - 9471 as c_int, - ) as *mut c_char; - spine_strcpy(*fresh151, path_1); - path_1 = tmp_1; - } - readColor( - input, - &mut color_1.r, - &mut color_1.g, - &mut color_1.b, - &mut color_1.a, - ); - skinName = readStringRef(input, skeletonData); - parent = readStringRef(input, skeletonData); - inheritTimeline = readBoolean(input); - sequence_1 = readSequenceBinary(input); if nonessential != 0 { width_1 = readFloat(input) * (*self_0).scale; height_1 = readFloat(input) * (*self_0).scale; } - let mut attachment_2: *mut spAttachment = spAttachmentLoader_createAttachment( + let mut attachment_0: *mut spAttachment = spAttachmentLoader_createAttachment( (*self_0).attachmentLoader, skin, type_0, @@ -17590,12 +20310,26 @@ pub unsafe extern "C" fn spSkeletonBinary_readAttachment( path_1, sequence_1, ); - let mut mesh_0: *mut spMeshAttachment = std::ptr::null_mut(); - if attachment_2.is_null() { - return std::ptr::null_mut(); + let mut mesh_0: *mut spMeshAttachment = 0 as *mut spMeshAttachment; + if attachment_0.is_null() { + return 0 as *mut spAttachment; } - mesh_0 = attachment_2 as *mut spMeshAttachment; + mesh_0 = attachment_0 as *mut spMeshAttachment; (*mesh_0).path = path_1; + if !((*mesh_0).path).is_null() { + let mut tmp: *mut c_char = 0 as *mut c_char; + tmp = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul( + (spine_strlen((*mesh_0).path)) + .wrapping_add(1 as c_int as c_ulong), + ), + b"spine.c\0" as *const u8 as *const c_char, + 10182 as c_int, + ) as *mut c_char; + spine_strcpy(tmp, (*mesh_0).path); + (*mesh_0).path = tmp; + } spColor_setFromColor(&mut (*mesh_0).color, &mut color_1); (*mesh_0).sequence = sequence_1; (*mesh_0).width = width_1; @@ -17603,53 +20337,54 @@ pub unsafe extern "C" fn spSkeletonBinary_readAttachment( _spSkeletonBinary_addLinkedMesh( self_0, mesh_0, - skinName, + skinIndex, slotIndex, parent, - inheritTimeline, + inheritTimelines, ); - return attachment_2; + return attachment_0; } 4 => { - let mut attachment_3: *mut spAttachment = spAttachmentLoader_createAttachment( + let mut attachment_1: *mut spAttachment = spAttachmentLoader_createAttachment( (*self_0).attachmentLoader, skin, type_0, name, - std::ptr::null(), - std::ptr::null_mut(), + 0 as *const c_char, + 0 as *mut spSequence, ); - let mut path_2: *mut spPathAttachment = std::ptr::null_mut(); - let mut vertexAttachment_0: *mut spVertexAttachment = std::ptr::null_mut(); - let mut vertexCount_1: c_int = 0 as c_int; - if attachment_3.is_null() { - return std::ptr::null_mut(); + let mut path_2: *mut spPathAttachment = 0 as *mut spPathAttachment; + if attachment_1.is_null() { + return 0 as *mut spAttachment; } - path_2 = attachment_3 as *mut spPathAttachment; - vertexAttachment_0 = &mut (*path_2).super_0; - (*path_2).closed = readBoolean(input); - (*path_2).constantSpeed = readBoolean(input); - vertexCount_1 = readVarint(input, 1 as c_int); - _readVerticesBinary( - self_0, + path_2 = attachment_1 as *mut spPathAttachment; + (*path_2) + .closed = (flags & 16 as c_int != 0 as c_int) as c_int; + (*path_2) + .constantSpeed = (flags & 32 as c_int != 0 as c_int) + as c_int; + let mut verticesLength_0: c_int = _readVerticesBinary( input, - &mut (*vertexAttachment_0).bonesCount, - &mut (*vertexAttachment_0).bones, - &mut (*vertexAttachment_0).verticesCount, - &mut (*vertexAttachment_0).vertices, - &mut (*vertexAttachment_0).worldVerticesLength, - vertexCount_1, + &mut (*path_2).super_0.vertices, + &mut (*path_2).super_0.verticesCount, + &mut (*path_2).super_0.bones, + &mut (*path_2).super_0.bonesCount, + (flags & 64 as c_int != 0 as c_int) as c_int, + (*self_0).scale, ); - (*path_2).lengthsLength = vertexCount_1 / 3 as c_int; - (*path_2).lengths = _spMalloc( + (*path_2).super_0.worldVerticesLength = verticesLength_0; + (*path_2).lengthsLength = verticesLength_0 / 6 as c_int; + (*path_2) + .lengths = _spMalloc( (::core::mem::size_of::() as c_ulong) .wrapping_mul((*path_2).lengthsLength as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 9517 as c_int, + 10204 as c_int, ) as *mut c_float; - i = 0 as c_int; + let mut i: c_int = 0 as c_int; while i < (*path_2).lengthsLength { - *((*path_2).lengths).offset(i as isize) = readFloat(input) * (*self_0).scale; + *((*path_2).lengths) + .offset(i as isize) = readFloat(input) * (*self_0).scale; i += 1; } if nonessential != 0 { @@ -17661,23 +20396,26 @@ pub unsafe extern "C" fn spSkeletonBinary_readAttachment( &mut (*path_2).color.a, ); } - spAttachmentLoader_configureAttachment((*self_0).attachmentLoader, attachment_3); - return attachment_3; + spAttachmentLoader_configureAttachment( + (*self_0).attachmentLoader, + attachment_1, + ); + return attachment_1; } 5 => { - let mut attachment_4: *mut spAttachment = spAttachmentLoader_createAttachment( + let mut attachment_2: *mut spAttachment = spAttachmentLoader_createAttachment( (*self_0).attachmentLoader, skin, type_0, name, - std::ptr::null(), - std::ptr::null_mut(), + 0 as *const c_char, + 0 as *mut spSequence, ); - let mut point: *mut spPointAttachment = std::ptr::null_mut(); - if attachment_4.is_null() { - return std::ptr::null_mut(); + let mut point: *mut spPointAttachment = 0 as *mut spPointAttachment; + if attachment_2.is_null() { + return 0 as *mut spAttachment; } - point = attachment_4 as *mut spPointAttachment; + point = attachment_2 as *mut spPointAttachment; (*point).rotation = readFloat(input); (*point).x = readFloat(input) * (*self_0).scale; (*point).y = readFloat(input) * (*self_0).scale; @@ -17690,37 +20428,37 @@ pub unsafe extern "C" fn spSkeletonBinary_readAttachment( &mut (*point).color.a, ); } - spAttachmentLoader_configureAttachment((*self_0).attachmentLoader, attachment_4); - return attachment_4; + spAttachmentLoader_configureAttachment( + (*self_0).attachmentLoader, + attachment_2, + ); + return attachment_2; } 6 => { let mut endSlotIndex: c_int = readVarint(input, 1 as c_int); - let mut vertexCount_2: c_int = readVarint(input, 1 as c_int); - let mut attachment_5: *mut spAttachment = spAttachmentLoader_createAttachment( + let mut attachment_3: *mut spAttachment = spAttachmentLoader_createAttachment( (*self_0).attachmentLoader, skin, type_0, name, - std::ptr::null(), - std::ptr::null_mut(), + 0 as *const c_char, + 0 as *mut spSequence, ); - let mut clip: *mut spClippingAttachment = std::ptr::null_mut(); - let mut vertexAttachment_1: *mut spVertexAttachment = std::ptr::null_mut(); - if attachment_5.is_null() { - return std::ptr::null_mut(); + let mut clip: *mut spClippingAttachment = 0 as *mut spClippingAttachment; + if attachment_3.is_null() { + return 0 as *mut spAttachment; } - clip = attachment_5 as *mut spClippingAttachment; - vertexAttachment_1 = &mut (*clip).super_0; - _readVerticesBinary( - self_0, + clip = attachment_3 as *mut spClippingAttachment; + let mut verticesLength_1: c_int = _readVerticesBinary( input, - &mut (*vertexAttachment_1).bonesCount, - &mut (*vertexAttachment_1).bones, - &mut (*vertexAttachment_1).verticesCount, - &mut (*vertexAttachment_1).vertices, - &mut (*vertexAttachment_1).worldVerticesLength, - vertexCount_2, + &mut (*clip).super_0.vertices, + &mut (*clip).super_0.verticesCount, + &mut (*clip).super_0.bones, + &mut (*clip).super_0.bonesCount, + (flags & 16 as c_int != 0 as c_int) as c_int, + (*self_0).scale, ); + (*clip).super_0.worldVerticesLength = verticesLength_1; if nonessential != 0 { readColor( input, @@ -17731,12 +20469,15 @@ pub unsafe extern "C" fn spSkeletonBinary_readAttachment( ); } (*clip).endSlot = *((*skeletonData).slots).offset(endSlotIndex as isize); - spAttachmentLoader_configureAttachment((*self_0).attachmentLoader, attachment_5); - return attachment_5; + spAttachmentLoader_configureAttachment( + (*self_0).attachmentLoader, + attachment_3, + ); + return attachment_3; } _ => {} } - return std::ptr::null_mut(); + return 0 as *mut spAttachment; } #[no_mangle] pub unsafe extern "C" fn spSkeletonBinary_readSkin( @@ -17746,7 +20487,7 @@ pub unsafe extern "C" fn spSkeletonBinary_readSkin( mut skeletonData: *mut spSkeletonData, mut nonessential: c_int, ) -> *mut spSkin { - let mut skin: *mut spSkin = std::ptr::null_mut(); + let mut skin: *mut spSkin = 0 as *mut spSkin; let mut i: c_int = 0; let mut n: c_int = 0; let mut ii: c_int = 0; @@ -17755,17 +20496,29 @@ pub unsafe extern "C" fn spSkeletonBinary_readSkin( if defaultSkin != 0 { slotCount = readVarint(input, 1 as c_int); if slotCount == 0 as c_int { - return std::ptr::null_mut(); + return 0 as *mut spSkin; } skin = spSkin_create(b"default\0" as *const u8 as *const c_char); } else { - skin = spSkin_create(readStringRef(input, skeletonData)); + let mut name: *mut c_char = readString(input); + skin = spSkin_create(name); + _spFree(name as *mut c_void); + if nonessential != 0 { + readColor( + input, + &mut (*skin).color.r, + &mut (*skin).color.g, + &mut (*skin).color.b, + &mut (*skin).color.a, + ); + } i = 0 as c_int; n = readVarint(input, 1 as c_int); while i < n { spBoneDataArray_add( (*skin).bones, - *((*skeletonData).bones).offset(readVarint(input, 1 as c_int) as isize), + *((*skeletonData).bones) + .offset(readVarint(input, 1 as c_int) as isize), ); i += 1; } @@ -17774,7 +20527,8 @@ pub unsafe extern "C" fn spSkeletonBinary_readSkin( while i < n { spIkConstraintDataArray_add( (*skin).ikConstraints, - *((*skeletonData).ikConstraints).offset(readVarint(input, 1 as c_int) as isize), + *((*skeletonData).ikConstraints) + .offset(readVarint(input, 1 as c_int) as isize), ); i += 1; } @@ -17793,7 +20547,18 @@ pub unsafe extern "C" fn spSkeletonBinary_readSkin( while i < n { spPathConstraintDataArray_add( (*skin).pathConstraints, - *((*skeletonData).pathConstraints).offset(readVarint(input, 1 as c_int) as isize), + *((*skeletonData).pathConstraints) + .offset(readVarint(input, 1 as c_int) as isize), + ); + i += 1; + } + i = 0 as c_int; + n = readVarint(input, 1 as c_int); + while i < n { + spPhysicsConstraintDataArray_add( + (*skin).physicsConstraints, + *((*skeletonData).physicsConstraints) + .offset(readVarint(input, 1 as c_int) as isize), ); i += 1; } @@ -17805,69 +20570,49 @@ pub unsafe extern "C" fn spSkeletonBinary_readSkin( ii = 0 as c_int; nn = readVarint(input, 1 as c_int); while ii < nn { - let mut name: *const c_char = readStringRef(input, skeletonData); + let mut name_0: *const c_char = readStringRef(input, skeletonData); let mut attachment: *mut spAttachment = spSkeletonBinary_readAttachment( self_0, input, skin, slotIndex, - name, + name_0, skeletonData, nonessential, ); - if attachment.is_null() { - return std::ptr::null_mut(); - } - spSkin_setAttachment(skin, slotIndex, name, attachment); - ii += 1; - } - i += 1; - } - return skin; -} -#[no_mangle] -pub unsafe extern "C" fn spSkeletonBinary_readSkeletonDataFile( - mut self_0: *mut spSkeletonBinary, - mut path: *const c_char, -) -> *mut spSkeletonData { - let mut length: c_int = 0; - let mut skeletonData: *mut spSkeletonData = std::ptr::null_mut(); - let mut binary: *const c_char = _spUtil_readFile(path, &mut length); - if length == 0 as c_int || binary.is_null() { - _spSkeletonBinary_setError( - self_0, - b"Unable to read skeleton file: \0" as *const u8 as *const c_char, - path, - ); - return std::ptr::null_mut(); - } - skeletonData = spSkeletonBinary_readSkeletonData(self_0, binary as *mut c_uchar, length); - _spFree(binary as *mut c_void); - return skeletonData; -} -unsafe extern "C" fn string_starts_with_binary( - mut str: *const c_char, - mut needle: *const c_char, -) -> c_int { - let mut lenStr: c_int = 0; - let mut lenNeedle: c_int = 0; - let mut i: c_int = 0; - if str.is_null() { - return 0 as c_int; - } - lenStr = spine_strlen(str) as c_int; - lenNeedle = spine_strlen(needle) as c_int; - if lenStr < lenNeedle { - return 0 as c_int; - } - i = 0 as c_int; - while i < lenNeedle { - if *str.offset(i as isize) as c_int != *needle.offset(i as isize) as c_int { - return 0 as c_int; + if attachment.is_null() { + return 0 as *mut spSkin; + } + spSkin_setAttachment(skin, slotIndex, name_0, attachment); + ii += 1; } i += 1; } - return -(1 as c_int); + return skin; +} +#[no_mangle] +pub unsafe extern "C" fn spSkeletonBinary_readSkeletonDataFile( + mut self_0: *mut spSkeletonBinary, + mut path: *const c_char, +) -> *mut spSkeletonData { + let mut length: c_int = 0; + let mut skeletonData: *mut spSkeletonData = 0 as *mut spSkeletonData; + let mut binary: *const c_char = _spUtil_readFile(path, &mut length); + if length == 0 as c_int || binary.is_null() { + _spSkeletonBinary_setError( + self_0, + b"Unable to read skeleton file: \0" as *const u8 as *const c_char, + path, + ); + return 0 as *mut spSkeletonData; + } + skeletonData = spSkeletonBinary_readSkeletonData( + self_0, + binary as *mut c_uchar, + length, + ); + _spFree(binary as *mut c_void); + return skeletonData; } #[no_mangle] pub unsafe extern "C" fn spSkeletonBinary_readSkeletonData( @@ -17882,108 +20627,117 @@ pub unsafe extern "C" fn spSkeletonBinary_readSkeletonData( let mut buffer: [c_char; 32] = [0; 32]; let mut lowHash: c_int = 0; let mut highHash: c_int = 0; - let mut skeletonData: *mut spSkeletonData = std::ptr::null_mut(); + let mut skeletonData: *mut spSkeletonData = 0 as *mut spSkeletonData; let mut internal: *mut _spSkeletonBinary = self_0 as *mut _spSkeletonBinary; let mut input: *mut _dataInput = _spCalloc( 1 as c_int as size_t, ::core::mem::size_of::<_dataInput>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 9644 as c_int, + 10321 as c_int, ) as *mut _dataInput; (*input).cursor = binary; (*input).end = binary.offset(length as isize); _spFree((*self_0).error as *mut c_void); - let ref mut fresh152 = *(&mut (*self_0).error as *mut *mut c_char); - *fresh152 = std::ptr::null_mut(); + (*self_0).error = 0 as *mut c_char; (*internal).linkedMeshCount = 0 as c_int; skeletonData = spSkeletonData_create(); lowHash = readInt(input); highHash = readInt(input); - spine_sprintf!( + snprintf( buffer.as_mut_ptr(), + 32 as c_int as c_ulong, b"%x%x\0" as *const u8 as *const c_char, highHash, lowHash, ); buffer[31 as c_int as usize] = 0 as c_int as c_char; - let ref mut fresh153 = *(&mut (*skeletonData).hash as *mut *const c_char as *mut *mut c_char); - *fresh153 = _spMalloc( + (*skeletonData) + .hash = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(buffer.as_mut_ptr())).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen(buffer.as_mut_ptr())) + .wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 9657 as c_int, + 10334 as c_int, ) as *mut c_char; - spine_strcpy(*fresh153, buffer.as_mut_ptr()); + spine_strcpy((*skeletonData).hash, buffer.as_mut_ptr()); (*skeletonData).version = readString(input); if spine_strlen((*skeletonData).version) == 0 { _spFree((*skeletonData).version as *mut c_void); - (*skeletonData).version = std::ptr::null(); + (*skeletonData).version = 0 as *mut c_char; } else if string_starts_with_binary( (*skeletonData).version, - b"4.1\0" as *const u8 as *const c_char, + b"4.2\0" as *const u8 as *const c_char, ) == 0 { let mut errorMsg: [c_char; 255] = [0; 255]; - spine_sprintf!( + snprintf( errorMsg.as_mut_ptr(), + 255 as c_int as c_ulong, b"Skeleton version %s does not match runtime version %s\0" as *const u8 as *const c_char, (*skeletonData).version, - b"4.1\0" as *const u8 as *const c_char, + b"4.2\0" as *const u8 as *const c_char, + ); + _spSkeletonBinary_setError( + self_0, + errorMsg.as_mut_ptr(), + 0 as *const c_char, ); - _spSkeletonBinary_setError(self_0, errorMsg.as_mut_ptr(), std::ptr::null()); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } (*skeletonData).x = readFloat(input); (*skeletonData).y = readFloat(input); (*skeletonData).width = readFloat(input); (*skeletonData).height = readFloat(input); + (*skeletonData).referenceScale = readFloat(input); nonessential = readBoolean(input); if nonessential != 0 { (*skeletonData).fps = readFloat(input); (*skeletonData).imagesPath = readString(input); if spine_strlen((*skeletonData).imagesPath) == 0 { _spFree((*skeletonData).imagesPath as *mut c_void); - (*skeletonData).imagesPath = std::ptr::null(); + (*skeletonData).imagesPath = 0 as *const c_char; } (*skeletonData).audioPath = readString(input); if spine_strlen((*skeletonData).audioPath) == 0 { _spFree((*skeletonData).audioPath as *mut c_void); - (*skeletonData).audioPath = std::ptr::null(); + (*skeletonData).audioPath = 0 as *const c_char; } } n = readVarint(input, 1 as c_int); (*skeletonData).stringsCount = n; - (*skeletonData).strings = _spMalloc( + (*skeletonData) + .strings = _spMalloc( (::core::mem::size_of::<*mut c_char>() as c_ulong) .wrapping_mul((*skeletonData).stringsCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 9694 as c_int, + 10372 as c_int, ) as *mut *mut c_char; i = 0 as c_int; while i < n { - let ref mut fresh154 = *((*skeletonData).strings).offset(i as isize); - *fresh154 = readString(input); + let ref mut fresh114 = *((*skeletonData).strings).offset(i as isize); + *fresh114 = readString(input); i += 1; } (*skeletonData).bonesCount = readVarint(input, 1 as c_int); - (*skeletonData).bones = _spMalloc( + (*skeletonData) + .bones = _spMalloc( (::core::mem::size_of::<*mut spBoneData>() as c_ulong) .wrapping_mul((*skeletonData).bonesCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 9701 as c_int, + 10379 as c_int, ) as *mut *mut spBoneData; i = 0 as c_int; while i < (*skeletonData).bonesCount { - let mut data: *mut spBoneData = std::ptr::null_mut(); - let mut mode: c_int = 0; let mut name: *const c_char = readString(input); let mut parent: *mut spBoneData = if i == 0 as c_int { - std::ptr::null_mut() + 0 as *mut spBoneData } else { *((*skeletonData).bones).offset(readVarint(input, 1 as c_int) as isize) }; - data = spBoneData_create(i, name, parent); + let mut data: *mut spBoneData = spBoneData_create(i, name, parent); _spFree(name as *mut c_void); (*data).rotation = readFloat(input); (*data).x = readFloat(input) * (*self_0).scale; @@ -17993,25 +20747,7 @@ pub unsafe extern "C" fn spSkeletonBinary_readSkeletonData( (*data).shearX = readFloat(input); (*data).shearY = readFloat(input); (*data).length = readFloat(input) * (*self_0).scale; - mode = readVarint(input, 1 as c_int); - match mode { - 0 => { - (*data).transformMode = SP_TRANSFORMMODE_NORMAL; - } - 1 => { - (*data).transformMode = SP_TRANSFORMMODE_ONLYTRANSLATION; - } - 2 => { - (*data).transformMode = SP_TRANSFORMMODE_NOROTATIONORREFLECTION; - } - 3 => { - (*data).transformMode = SP_TRANSFORMMODE_NOSCALE; - } - 4 => { - (*data).transformMode = SP_TRANSFORMMODE_NOSCALEORREFLECTION; - } - _ => {} - } + (*data).inherit = readVarint(input, 1 as c_int) as spInherit; (*data).skinRequired = readBoolean(input); if nonessential != 0 { readColor( @@ -18021,28 +20757,41 @@ pub unsafe extern "C" fn spSkeletonBinary_readSkeletonData( &mut (*data).color.b, &mut (*data).color.a, ); + (*data).icon = readString(input); + (*data).visible = readBoolean(input); } - let ref mut fresh155 = *((*skeletonData).bones).offset(i as isize); - *fresh155 = data; + let ref mut fresh115 = *((*skeletonData).bones).offset(i as isize); + *fresh115 = data; i += 1; } (*skeletonData).slotsCount = readVarint(input, 1 as c_int); - (*skeletonData).slots = _spMalloc( + (*skeletonData) + .slots = _spMalloc( (::core::mem::size_of::<*mut spSlotData>() as c_ulong) .wrapping_mul((*skeletonData).slotsCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 9745 as c_int, + 10405 as c_int, ) as *mut *mut spSlotData; i = 0 as c_int; while i < (*skeletonData).slotsCount { - let mut r: c_int = 0; - let mut g: c_int = 0; - let mut b: c_int = 0; - let mut a: c_int = 0; - let mut attachmentName: *const c_char = std::ptr::null(); - let mut slotName: *const c_char = readString(input); - let mut boneData: *mut spBoneData = - *((*skeletonData).bones).offset(readVarint(input, 1 as c_int) as isize); + let mut slotName: *mut c_char = readString(input); + let mut pathName: *mut c_char = 0 as *mut c_char; + if nonessential != 0 { + let mut slash: c_int = string_lastIndexOf( + slotName, + '/' as i32 as c_char, + ); + if slash != -(1 as c_int) { + pathName = string_substring(slotName, 0 as c_int, slash); + slotName = string_substring( + slotName, + slash + 1 as c_int, + spine_strlen(slotName) as c_int, + ); + } + } + let mut boneData: *mut spBoneData = *((*skeletonData).bones) + .offset(readVarint(input, 1 as c_int) as isize); let mut slotData: *mut spSlotData = spSlotData_create(i, slotName, boneData); _spFree(slotName as *mut c_void); readColor( @@ -18052,11 +20801,13 @@ pub unsafe extern "C" fn spSkeletonBinary_readSkeletonData( &mut (*slotData).color.b, &mut (*slotData).color.a, ); - a = readByte(input) as c_int; - r = readByte(input) as c_int; - g = readByte(input) as c_int; - b = readByte(input) as c_int; - if !(r == 0xff as c_int && g == 0xff as c_int && b == 0xff as c_int && a == 0xff as c_int) { + let mut a: c_int = readByte(input) as c_int; + let mut r: c_int = readByte(input) as c_int; + let mut g: c_int = readByte(input) as c_int; + let mut b: c_int = readByte(input) as c_int; + if !(r == 0xff as c_int && g == 0xff as c_int + && b == 0xff as c_int && a == 0xff as c_int) + { (*slotData).darkColor = spColor_create(); spColor_setFromFloats( (*slotData).darkColor, @@ -18066,163 +20817,339 @@ pub unsafe extern "C" fn spSkeletonBinary_readSkeletonData( 1 as c_int as c_float, ); } - attachmentName = readStringRef(input, skeletonData); + let mut attachmentName: *mut c_char = readStringRef(input, skeletonData); if !attachmentName.is_null() { - let ref mut fresh156 = - *(&mut (*slotData).attachmentName as *mut *const c_char as *mut *mut c_char); - *fresh156 = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul( - (spine_strlen(attachmentName)).wrapping_add(1 as c_int as c_ulong), - ), + (*slotData) + .attachmentName = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul( + (spine_strlen(attachmentName)) + .wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 9764 as c_int, + 10429 as c_int, ) as *mut c_char; - spine_strcpy(*fresh156, attachmentName); + spine_strcpy((*slotData).attachmentName, attachmentName); } else { - (*slotData).attachmentName = std::ptr::null(); + (*slotData).attachmentName = 0 as *mut c_char; } (*slotData).blendMode = readVarint(input, 1 as c_int) as spBlendMode; - let ref mut fresh157 = *((*skeletonData).slots).offset(i as isize); - *fresh157 = slotData; + if nonessential != 0 { + (*slotData).visible = readBoolean(input); + (*slotData).path = pathName; + } + let ref mut fresh116 = *((*skeletonData).slots).offset(i as isize); + *fresh116 = slotData; i += 1; } (*skeletonData).ikConstraintsCount = readVarint(input, 1 as c_int); - (*skeletonData).ikConstraints = _spMalloc( + (*skeletonData) + .ikConstraints = _spMalloc( (::core::mem::size_of::<*mut spIkConstraintData>() as c_ulong) .wrapping_mul((*skeletonData).ikConstraintsCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 9773 as c_int, + 10442 as c_int, ) as *mut *mut spIkConstraintData; i = 0 as c_int; while i < (*skeletonData).ikConstraintsCount { let mut name_0: *const c_char = readString(input); let mut data_0: *mut spIkConstraintData = spIkConstraintData_create(name_0); - (*data_0).order = readVarint(input, 1 as c_int); - (*data_0).skinRequired = readBoolean(input); _spFree(name_0 as *mut c_void); + (*data_0).order = readVarint(input, 1 as c_int); (*data_0).bonesCount = readVarint(input, 1 as c_int); - (*data_0).bones = _spMalloc( + (*data_0) + .bones = _spMalloc( (::core::mem::size_of::<*mut spBoneData>() as c_ulong) .wrapping_mul((*data_0).bonesCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 9782 as c_int, + 10449 as c_int, ) as *mut *mut spBoneData; ii = 0 as c_int; while ii < (*data_0).bonesCount { - let ref mut fresh158 = *((*data_0).bones).offset(ii as isize); - *fresh158 = *((*skeletonData).bones).offset(readVarint(input, 1 as c_int) as isize); + let ref mut fresh117 = *((*data_0).bones).offset(ii as isize); + *fresh117 = *((*skeletonData).bones) + .offset(readVarint(input, 1 as c_int) as isize); ii += 1; } - (*data_0).target = *((*skeletonData).bones).offset(readVarint(input, 1 as c_int) as isize); - (*data_0).mix = readFloat(input); - (*data_0).softness = readFloat(input); - (*data_0).bendDirection = readSByte(input) as c_int; - (*data_0).compress = readBoolean(input); - (*data_0).stretch = readBoolean(input); - (*data_0).uniform = readBoolean(input); - let ref mut fresh159 = *((*skeletonData).ikConstraints).offset(i as isize); - *fresh159 = data_0; + (*data_0) + .target = *((*skeletonData).bones) + .offset(readVarint(input, 1 as c_int) as isize); + let mut flags: c_int = readByte(input) as c_int; + (*data_0) + .skinRequired = (flags & 1 as c_int != 0 as c_int) + as c_int; + (*data_0) + .bendDirection = if flags & 2 as c_int != 0 as c_int { + 1 as c_int + } else { + -(1 as c_int) + }; + (*data_0) + .compress = (flags & 4 as c_int != 0 as c_int) as c_int; + (*data_0) + .stretch = (flags & 8 as c_int != 0 as c_int) as c_int; + (*data_0) + .uniform = (flags & 16 as c_int != 0 as c_int) as c_int; + if flags & 32 as c_int != 0 as c_int { + (*data_0) + .mix = if flags & 64 as c_int != 0 as c_int { + readFloat(input) + } else { + 1 as c_int as c_float + }; + } + if flags & 128 as c_int != 0 as c_int { + (*data_0).softness = readFloat(input) * (*self_0).scale; + } + let ref mut fresh118 = *((*skeletonData).ikConstraints).offset(i as isize); + *fresh118 = data_0; i += 1; } (*skeletonData).transformConstraintsCount = readVarint(input, 1 as c_int); - (*skeletonData).transformConstraints = _spMalloc( + (*skeletonData) + .transformConstraints = _spMalloc( (::core::mem::size_of::<*mut spTransformConstraintData>() as c_ulong) .wrapping_mul((*skeletonData).transformConstraintsCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 9797 as c_int, + 10467 as c_int, ) as *mut *mut spTransformConstraintData; i = 0 as c_int; while i < (*skeletonData).transformConstraintsCount { let mut name_1: *const c_char = readString(input); - let mut data_1: *mut spTransformConstraintData = spTransformConstraintData_create(name_1); - (*data_1).order = readVarint(input, 1 as c_int); - (*data_1).skinRequired = readBoolean(input); + let mut data_1: *mut spTransformConstraintData = spTransformConstraintData_create( + name_1, + ); _spFree(name_1 as *mut c_void); + (*data_1).order = readVarint(input, 1 as c_int); (*data_1).bonesCount = readVarint(input, 1 as c_int); - let ref mut fresh160 = *(&mut (*data_1).bones as *mut *mut *mut spBoneData); - *fresh160 = _spMalloc( + (*data_1) + .bones = _spMalloc( (::core::mem::size_of::<*mut spBoneData>() as c_ulong) .wrapping_mul((*data_1).bonesCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 9807 as c_int, + 10475 as c_int, ) as *mut *mut spBoneData; ii = 0 as c_int; while ii < (*data_1).bonesCount { - let ref mut fresh161 = *((*data_1).bones).offset(ii as isize); - *fresh161 = *((*skeletonData).bones).offset(readVarint(input, 1 as c_int) as isize); + let ref mut fresh119 = *((*data_1).bones).offset(ii as isize); + *fresh119 = *((*skeletonData).bones) + .offset(readVarint(input, 1 as c_int) as isize); ii += 1; } - (*data_1).target = *((*skeletonData).bones).offset(readVarint(input, 1 as c_int) as isize); - (*data_1).local = readBoolean(input); - (*data_1).relative = readBoolean(input); - (*data_1).offsetRotation = readFloat(input); - (*data_1).offsetX = readFloat(input) * (*self_0).scale; - (*data_1).offsetY = readFloat(input) * (*self_0).scale; - (*data_1).offsetScaleX = readFloat(input); - (*data_1).offsetScaleY = readFloat(input); - (*data_1).offsetShearY = readFloat(input); - (*data_1).mixRotate = readFloat(input); - (*data_1).mixX = readFloat(input); - (*data_1).mixY = readFloat(input); - (*data_1).mixScaleX = readFloat(input); - (*data_1).mixScaleY = readFloat(input); - (*data_1).mixShearY = readFloat(input); - let ref mut fresh162 = *((*skeletonData).transformConstraints).offset(i as isize); - *fresh162 = data_1; + (*data_1) + .target = *((*skeletonData).bones) + .offset(readVarint(input, 1 as c_int) as isize); + let mut flags_0: c_int = readByte(input) as c_int; + (*data_1) + .skinRequired = (flags_0 & 1 as c_int != 0 as c_int) + as c_int; + (*data_1) + .local = (flags_0 & 2 as c_int != 0 as c_int) as c_int; + (*data_1) + .relative = (flags_0 & 4 as c_int != 0 as c_int) as c_int; + if flags_0 & 8 as c_int != 0 as c_int { + (*data_1).offsetRotation = readFloat(input); + } + if flags_0 & 16 as c_int != 0 as c_int { + (*data_1).offsetX = readFloat(input) * (*self_0).scale; + } + if flags_0 & 32 as c_int != 0 as c_int { + (*data_1).offsetY = readFloat(input) * (*self_0).scale; + } + if flags_0 & 64 as c_int != 0 as c_int { + (*data_1).offsetScaleX = readFloat(input); + } + if flags_0 & 128 as c_int != 0 as c_int { + (*data_1).offsetScaleY = readFloat(input); + } + flags_0 = readByte(input) as c_int; + if flags_0 & 1 as c_int != 0 as c_int { + (*data_1).offsetShearY = readFloat(input); + } + if flags_0 & 2 as c_int != 0 as c_int { + (*data_1).mixRotate = readFloat(input); + } + if flags_0 & 4 as c_int != 0 as c_int { + (*data_1).mixX = readFloat(input); + } + if flags_0 & 8 as c_int != 0 as c_int { + (*data_1).mixY = readFloat(input); + } + if flags_0 & 16 as c_int != 0 as c_int { + (*data_1).mixScaleX = readFloat(input); + } + if flags_0 & 32 as c_int != 0 as c_int { + (*data_1).mixScaleY = readFloat(input); + } + if flags_0 & 64 as c_int != 0 as c_int { + (*data_1).mixShearY = readFloat(input); + } + let ref mut fresh120 = *((*skeletonData).transformConstraints) + .offset(i as isize); + *fresh120 = data_1; i += 1; } (*skeletonData).pathConstraintsCount = readVarint(input, 1 as c_int); - (*skeletonData).pathConstraints = _spMalloc( + (*skeletonData) + .pathConstraints = _spMalloc( (::core::mem::size_of::<*mut spPathConstraintData>() as c_ulong) .wrapping_mul((*skeletonData).pathConstraintsCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 9830 as c_int, + 10502 as c_int, ) as *mut *mut spPathConstraintData; i = 0 as c_int; while i < (*skeletonData).pathConstraintsCount { let mut name_2: *const c_char = readString(input); let mut data_2: *mut spPathConstraintData = spPathConstraintData_create(name_2); + _spFree(name_2 as *mut c_void); (*data_2).order = readVarint(input, 1 as c_int); (*data_2).skinRequired = readBoolean(input); - _spFree(name_2 as *mut c_void); (*data_2).bonesCount = readVarint(input, 1 as c_int); - let ref mut fresh163 = *(&mut (*data_2).bones as *mut *mut *mut spBoneData); - *fresh163 = _spMalloc( + (*data_2) + .bones = _spMalloc( (::core::mem::size_of::<*mut spBoneData>() as c_ulong) .wrapping_mul((*data_2).bonesCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 9839 as c_int, + 10510 as c_int, ) as *mut *mut spBoneData; ii = 0 as c_int; while ii < (*data_2).bonesCount { - let ref mut fresh164 = *((*data_2).bones).offset(ii as isize); - *fresh164 = *((*skeletonData).bones).offset(readVarint(input, 1 as c_int) as isize); + let ref mut fresh121 = *((*data_2).bones).offset(ii as isize); + *fresh121 = *((*skeletonData).bones) + .offset(readVarint(input, 1 as c_int) as isize); ii += 1; } - (*data_2).target = *((*skeletonData).slots).offset(readVarint(input, 1 as c_int) as isize); - (*data_2).positionMode = readVarint(input, 1 as c_int) as spPositionMode; - (*data_2).spacingMode = readVarint(input, 1 as c_int) as spSpacingMode; - (*data_2).rotateMode = readVarint(input, 1 as c_int) as spRotateMode; - (*data_2).offsetRotation = readFloat(input); + (*data_2) + .target = *((*skeletonData).slots) + .offset(readVarint(input, 1 as c_int) as isize); + let mut flags_1: c_int = readByte(input) as c_int; + (*data_2).positionMode = (flags_1 & 1 as c_int) as spPositionMode; + (*data_2) + .spacingMode = (flags_1 >> 1 as c_int & 3 as c_int) + as spSpacingMode; + (*data_2) + .rotateMode = (flags_1 >> 3 as c_int & 3 as c_int) + as spRotateMode; + if flags_1 & 128 as c_int != 0 as c_int { + (*data_2).offsetRotation = readFloat(input); + } (*data_2).position = readFloat(input); - if (*data_2).positionMode as c_uint == SP_POSITION_MODE_FIXED as c_int as c_uint { + if (*data_2).positionMode as c_uint + == SP_POSITION_MODE_FIXED as c_int as c_uint + { (*data_2).position *= (*self_0).scale; } (*data_2).spacing = readFloat(input); - if (*data_2).spacingMode as c_uint == SP_SPACING_MODE_LENGTH as c_int as c_uint - || (*data_2).spacingMode as c_uint == SP_SPACING_MODE_FIXED as c_int as c_uint + if (*data_2).spacingMode as c_uint + == SP_SPACING_MODE_LENGTH as c_int as c_uint + || (*data_2).spacingMode as c_uint + == SP_SPACING_MODE_FIXED as c_int as c_uint { (*data_2).spacing *= (*self_0).scale; } (*data_2).mixRotate = readFloat(input); (*data_2).mixX = readFloat(input); (*data_2).mixY = readFloat(input); - let ref mut fresh165 = *((*skeletonData).pathConstraints).offset(i as isize); - *fresh165 = data_2; + let ref mut fresh122 = *((*skeletonData).pathConstraints).offset(i as isize); + *fresh122 = data_2; + i += 1; + } + (*skeletonData).physicsConstraintsCount = readVarint(input, 1 as c_int); + (*skeletonData) + .physicsConstraints = _spMalloc( + (::core::mem::size_of::<*mut spPhysicsConstraintData>() as c_ulong) + .wrapping_mul((*skeletonData).physicsConstraintsCount as c_ulong), + b"spine.c\0" as *const u8 as *const c_char, + 10532 as c_int, + ) as *mut *mut spPhysicsConstraintData; + i = 0 as c_int; + while i < (*skeletonData).physicsConstraintsCount { + let mut name_3: *const c_char = readString(input); + let mut data_3: *mut spPhysicsConstraintData = spPhysicsConstraintData_create( + name_3, + ); + _spFree(name_3 as *mut c_void); + (*data_3).order = readVarint(input, 1 as c_int); + (*data_3) + .bone = *((*skeletonData).bones) + .offset(readVarint(input, 1 as c_int) as isize); + let mut flags_2: c_int = readByte(input) as c_int; + (*data_3) + .skinRequired = (flags_2 & 1 as c_int != 0 as c_int) + as c_int; + if flags_2 & 2 as c_int != 0 as c_int { + (*data_3).x = readFloat(input); + } + if flags_2 & 4 as c_int != 0 as c_int { + (*data_3).y = readFloat(input); + } + if flags_2 & 8 as c_int != 0 as c_int { + (*data_3).rotate = readFloat(input); + } + if flags_2 & 16 as c_int != 0 as c_int { + (*data_3).scaleX = readFloat(input); + } + if flags_2 & 32 as c_int != 0 as c_int { + (*data_3).shearX = readFloat(input); + } + (*data_3) + .limit = (if flags_2 & 64 as c_int != 0 as c_int { + readFloat(input) + } else { + 5000 as c_int as c_float + }) * (*self_0).scale; + (*data_3).step = 1.0f32 / readByte(input) as c_int as c_float; + (*data_3).inertia = readFloat(input); + (*data_3).strength = readFloat(input); + (*data_3).damping = readFloat(input); + (*data_3) + .massInverse = if flags_2 & 128 as c_int != 0 as c_int { + readFloat(input) + } else { + 1 as c_int as c_float + }; + (*data_3).wind = readFloat(input); + (*data_3).gravity = readFloat(input); + flags_2 = readByte(input) as c_int; + if flags_2 & 1 as c_int != 0 as c_int { + (*data_3).inertiaGlobal = -(1 as c_int); + } + if flags_2 & 2 as c_int != 0 as c_int { + (*data_3).strengthGlobal = -(1 as c_int); + } + if flags_2 & 4 as c_int != 0 as c_int { + (*data_3).dampingGlobal = -(1 as c_int); + } + if flags_2 & 8 as c_int != 0 as c_int { + (*data_3).massGlobal = -(1 as c_int); + } + if flags_2 & 16 as c_int != 0 as c_int { + (*data_3).windGlobal = -(1 as c_int); + } + if flags_2 & 32 as c_int != 0 as c_int { + (*data_3).gravityGlobal = -(1 as c_int); + } + if flags_2 & 64 as c_int != 0 as c_int { + (*data_3).mixGlobal = -(1 as c_int); + } + (*data_3) + .mix = if flags_2 & 128 as c_int != 0 as c_int { + readFloat(input) + } else { + 1 as c_int as c_float + }; + let ref mut fresh123 = *((*skeletonData).physicsConstraints).offset(i as isize); + *fresh123 = data_3; i += 1; } - (*skeletonData).defaultSkin = - spSkeletonBinary_readSkin(self_0, input, -(1 as c_int), skeletonData, nonessential); + (*skeletonData) + .defaultSkin = spSkeletonBinary_readSkin( + self_0, + input, + -(1 as c_int), + skeletonData, + nonessential, + ); if !((*(*self_0).attachmentLoader).error1).is_null() { spSkeletonData_dispose(skeletonData); _spSkeletonBinary_setError( @@ -18230,21 +21157,23 @@ pub unsafe extern "C" fn spSkeletonBinary_readSkeletonData( (*(*self_0).attachmentLoader).error1, (*(*self_0).attachmentLoader).error2, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } (*skeletonData).skinsCount = readVarint(input, 1 as c_int); if !((*skeletonData).defaultSkin).is_null() { (*skeletonData).skinsCount += 1; } - (*skeletonData).skins = _spMalloc( + (*skeletonData) + .skins = _spMalloc( (::core::mem::size_of::<*mut spSkin>() as c_ulong) .wrapping_mul((*skeletonData).skinsCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 9870 as c_int, + 10578 as c_int, ) as *mut *mut spSkin; if !((*skeletonData).defaultSkin).is_null() { - let ref mut fresh166 = *((*skeletonData).skins).offset(0 as c_int as isize); - *fresh166 = (*skeletonData).defaultSkin; + let ref mut fresh124 = *((*skeletonData).skins) + .offset(0 as c_int as isize); + *fresh124 = (*skeletonData).defaultSkin; } i = if !((*skeletonData).defaultSkin).is_null() { 1 as c_int @@ -18252,8 +21181,13 @@ pub unsafe extern "C" fn spSkeletonBinary_readSkeletonData( 0 as c_int }; while i < (*skeletonData).skinsCount { - let mut skin: *mut spSkin = - spSkeletonBinary_readSkin(self_0, input, 0 as c_int, skeletonData, nonessential); + let mut skin: *mut spSkin = spSkeletonBinary_readSkin( + self_0, + input, + 0 as c_int, + skeletonData, + nonessential, + ); if !((*(*self_0).attachmentLoader).error1).is_null() { spSkeletonData_dispose(skeletonData); _spSkeletonBinary_setError( @@ -18261,33 +21195,33 @@ pub unsafe extern "C" fn spSkeletonBinary_readSkeletonData( (*(*self_0).attachmentLoader).error1, (*(*self_0).attachmentLoader).error2, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } - let ref mut fresh167 = *((*skeletonData).skins).offset(i as isize); - *fresh167 = skin; + let ref mut fresh125 = *((*skeletonData).skins).offset(i as isize); + *fresh125 = skin; i += 1; } i = 0 as c_int; while i < (*internal).linkedMeshCount { - let mut linkedMesh: *mut _spLinkedMeshBinary = - ((*internal).linkedMeshes).offset(i as isize); - let mut skin_0: *mut spSkin = if ((*linkedMesh).skin).is_null() { - (*skeletonData).defaultSkin - } else { - spSkeletonData_findSkin(skeletonData, (*linkedMesh).skin) - }; - let mut parent_0: *mut spAttachment = std::ptr::null_mut(); + let mut linkedMesh: *mut _spLinkedMeshBinary = ((*internal).linkedMeshes) + .offset(i as isize); + let mut skin_0: *mut spSkin = *((*skeletonData).skins) + .offset((*linkedMesh).skinIndex as isize); if skin_0.is_null() { _spFree(input as *mut c_void); spSkeletonData_dispose(skeletonData); _spSkeletonBinary_setError( self_0, - b"Skin not found: \0" as *const u8 as *const c_char, - (*linkedMesh).skin, + b"Skin not found\0" as *const u8 as *const c_char, + b"\0" as *const u8 as *const c_char, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } - parent_0 = spSkin_getAttachment(skin_0, (*linkedMesh).slotIndex, (*linkedMesh).parent); + let mut parent_0: *mut spAttachment = spSkin_getAttachment( + skin_0, + (*linkedMesh).slotIndex, + (*linkedMesh).parent, + ); if parent_0.is_null() { _spFree(input as *mut c_void); spSkeletonData_dispose(skeletonData); @@ -18296,14 +21230,19 @@ pub unsafe extern "C" fn spSkeletonBinary_readSkeletonData( b"Parent mesh not found: \0" as *const u8 as *const c_char, (*linkedMesh).parent, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } - (*(*linkedMesh).mesh).super_0.timelineAttachment = if (*linkedMesh).inheritTimeline != 0 { + (*(*linkedMesh).mesh) + .super_0 + .timelineAttachment = if (*linkedMesh).inheritTimeline != 0 { parent_0 } else { &mut (*(*linkedMesh).mesh).super_0.super_0 }; - spMeshAttachment_setParentMesh((*linkedMesh).mesh, parent_0 as *mut spMeshAttachment); + spMeshAttachment_setParentMesh( + (*linkedMesh).mesh, + parent_0 as *mut spMeshAttachment, + ); if !((*(*linkedMesh).mesh).region).is_null() { spMeshAttachment_updateRegion((*linkedMesh).mesh); } @@ -18314,16 +21253,18 @@ pub unsafe extern "C" fn spSkeletonBinary_readSkeletonData( i += 1; } (*skeletonData).eventsCount = readVarint(input, 1 as c_int); - (*skeletonData).events = _spMalloc( + (*skeletonData) + .events = _spMalloc( (::core::mem::size_of::<*mut spEventData>() as c_ulong) .wrapping_mul((*skeletonData).eventsCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 9913 as c_int, + 10620 as c_int, ) as *mut *mut spEventData; i = 0 as c_int; while i < (*skeletonData).eventsCount { - let mut name_3: *const c_char = readStringRef(input, skeletonData); - let mut eventData: *mut spEventData = spEventData_create(name_3); + let mut name_4: *const c_char = readString(input); + let mut eventData: *mut spEventData = spEventData_create(name_4); + _spFree(name_4 as *mut c_void); (*eventData).intValue = readVarint(input, 0 as c_int); (*eventData).floatValue = readFloat(input); (*eventData).stringValue = readString(input); @@ -18332,35 +21273,40 @@ pub unsafe extern "C" fn spSkeletonBinary_readSkeletonData( (*eventData).volume = readFloat(input); (*eventData).balance = readFloat(input); } - let ref mut fresh168 = *((*skeletonData).events).offset(i as isize); - *fresh168 = eventData; + let ref mut fresh126 = *((*skeletonData).events).offset(i as isize); + *fresh126 = eventData; i += 1; } (*skeletonData).animationsCount = readVarint(input, 1 as c_int); - (*skeletonData).animations = _spMalloc( + (*skeletonData) + .animations = _spMalloc( (::core::mem::size_of::<*mut spAnimation>() as c_ulong) .wrapping_mul((*skeletonData).animationsCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 9930 as c_int, + 10638 as c_int, ) as *mut *mut spAnimation; i = 0 as c_int; while i < (*skeletonData).animationsCount { - let mut name_4: *const c_char = readString(input); - let mut animation: *mut spAnimation = - _spSkeletonBinary_readAnimation(self_0, name_4, input, skeletonData); - _spFree(name_4 as *mut c_void); + let mut name_5: *const c_char = readString(input); + let mut animation: *mut spAnimation = _spSkeletonBinary_readAnimation( + self_0, + name_5, + input, + skeletonData, + ); + _spFree(name_5 as *mut c_void); if animation.is_null() { _spFree(input as *mut c_void); spSkeletonData_dispose(skeletonData); _spSkeletonBinary_setError( self_0, b"Animation corrupted: \0" as *const u8 as *const c_char, - name_4, + name_5, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } - let ref mut fresh169 = *((*skeletonData).animations).offset(i as isize); - *fresh169 = animation; + let ref mut fresh127 = *((*skeletonData).animations).offset(i as isize); + *fresh127 = animation; i += 1; } _spFree(input as *mut c_void); @@ -18372,14 +21318,15 @@ pub unsafe extern "C" fn spPolygon_create(mut capacity: c_int) -> *mut spPolygon 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 9981 as c_int, + 10689 as c_int, ) as *mut spPolygon; (*self_0).capacity = capacity; - let ref mut fresh170 = *(&mut (*self_0).vertices as *mut *mut c_float); - *fresh170 = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul(capacity as c_ulong), + (*self_0) + .vertices = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul(capacity as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 9983 as c_int, + 10691 as c_int, ) as *mut c_float; return self_0; } @@ -18399,14 +21346,15 @@ pub unsafe extern "C" fn spPolygon_containsPoint( let mut i: c_int = 0; i = 0 as c_int; while i < (*self_0).count { - let mut vertexY: c_float = *((*self_0).vertices).offset((i + 1 as c_int) as isize); - let mut prevY: c_float = *((*self_0).vertices).offset((prevIndex + 1 as c_int) as isize); + let mut vertexY: c_float = *((*self_0).vertices) + .offset((i + 1 as c_int) as isize); + let mut prevY: c_float = *((*self_0).vertices) + .offset((prevIndex + 1 as c_int) as isize); if vertexY < y && prevY >= y || prevY < y && vertexY >= y { let mut vertexX: c_float = *((*self_0).vertices).offset(i as isize); if vertexX + (y - vertexY) / (prevY - vertexY) - * (*((*self_0).vertices).offset(prevIndex as isize) - vertexX) - < x + * (*((*self_0).vertices).offset(prevIndex as isize) - vertexX) < x { inside = (inside == 0) as c_int; } @@ -18427,19 +21375,23 @@ pub unsafe extern "C" fn spPolygon_intersectsSegment( let mut width12: c_float = x1 - x2; let mut height12: c_float = y1 - y2; let mut det1: c_float = x1 * y2 - y1 * x2; - let mut x3: c_float = *((*self_0).vertices).offset(((*self_0).count - 2 as c_int) as isize); - let mut y3: c_float = *((*self_0).vertices).offset(((*self_0).count - 1 as c_int) as isize); + let mut x3: c_float = *((*self_0).vertices) + .offset(((*self_0).count - 2 as c_int) as isize); + let mut y3: c_float = *((*self_0).vertices) + .offset(((*self_0).count - 1 as c_int) as isize); let mut i: c_int = 0; i = 0 as c_int; while i < (*self_0).count { let mut x4: c_float = *((*self_0).vertices).offset(i as isize); - let mut y4: c_float = *((*self_0).vertices).offset((i + 1 as c_int) as isize); + let mut y4: c_float = *((*self_0).vertices) + .offset((i + 1 as c_int) as isize); let mut det2: c_float = x3 * y4 - y3 * x4; let mut width34: c_float = x3 - x4; let mut height34: c_float = y3 - y4; let mut det3: c_float = width12 * height34 - height12 * width34; let mut x: c_float = (det1 * width34 - width12 * det2) / det3; - if (x >= x3 && x <= x4 || x >= x4 && x <= x3) && (x >= x1 && x <= x2 || x >= x2 && x <= x1) + if (x >= x3 && x <= x4 || x >= x4 && x <= x3) + && (x >= x1 && x <= x2 || x >= x2 && x <= x1) { let mut y: c_float = (det1 * height34 - height12 * det2) / det3; if (y >= y3 && y <= y4 || y >= y4 && y <= y3) @@ -18457,11 +21409,16 @@ pub unsafe extern "C" fn spPolygon_intersectsSegment( #[no_mangle] pub unsafe extern "C" fn spSkeletonBounds_create() -> *mut spSkeletonBounds { return &mut (*((_spCalloc - as unsafe extern "C" fn(size_t, size_t, *const c_char, c_int) -> *mut c_void)( + as unsafe extern "C" fn( + size_t, + size_t, + *const c_char, + c_int, + ) -> *mut c_void)( 1 as c_int as size_t, ::core::mem::size_of::<_spSkeletonBounds>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 10039 as c_int, + 10747 as c_int, ) as *mut _spSkeletonBounds)) .super_0; } @@ -18488,19 +21445,20 @@ pub unsafe extern "C" fn spSkeletonBounds_update( let mut i: c_int = 0; let mut internal: *mut _spSkeletonBounds = self_0 as *mut _spSkeletonBounds; if (*internal).capacity < (*skeleton).slotsCount { - let mut newPolygons: *mut *mut spPolygon = std::ptr::null_mut(); + let mut newPolygons: *mut *mut spPolygon = 0 as *mut *mut spPolygon; _spFree((*self_0).boundingBoxes as *mut c_void); - (*self_0).boundingBoxes = _spMalloc( + (*self_0) + .boundingBoxes = _spMalloc( (::core::mem::size_of::<*mut spBoundingBoxAttachment>() as c_ulong) .wrapping_mul((*skeleton).slotsCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 10059 as c_int, + 10767 as c_int, ) as *mut *mut spBoundingBoxAttachment; newPolygons = _spCalloc( (*skeleton).slotsCount as size_t, ::core::mem::size_of::<*mut spPolygon>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 10061 as c_int, + 10769 as c_int, ) as *mut *mut spPolygon; spine_memcpy( newPolygons as *mut c_void, @@ -18519,18 +21477,21 @@ pub unsafe extern "C" fn spSkeletonBounds_update( (*self_0).count = 0 as c_int; i = 0 as c_int; while i < (*skeleton).slotsCount { - let mut polygon: *mut spPolygon = std::ptr::null_mut(); - let mut boundingBox: *mut spBoundingBoxAttachment = std::ptr::null_mut(); - let mut attachment: *mut spAttachment = std::ptr::null_mut(); + let mut polygon: *mut spPolygon = 0 as *mut spPolygon; + let mut boundingBox: *mut spBoundingBoxAttachment = 0 + as *mut spBoundingBoxAttachment; + let mut attachment: *mut spAttachment = 0 as *mut spAttachment; let mut slot: *mut spSlot = *((*skeleton).slots).offset(i as isize); if !((*(*slot).bone).active == 0) { attachment = (*slot).attachment; if !(attachment.is_null() - || (*attachment).type_0 as c_uint != SP_ATTACHMENT_BOUNDING_BOX as c_int as c_uint) + || (*attachment).type_0 as c_uint + != SP_ATTACHMENT_BOUNDING_BOX as c_int as c_uint) { boundingBox = attachment as *mut spBoundingBoxAttachment; - let ref mut fresh171 = *((*self_0).boundingBoxes).offset((*self_0).count as isize); - *fresh171 = boundingBox; + let ref mut fresh128 = *((*self_0).boundingBoxes) + .offset((*self_0).count as isize); + *fresh128 = boundingBox; polygon = *((*self_0).polygons).offset((*self_0).count as isize); if polygon.is_null() || (*polygon).capacity < (*boundingBox).super_0.worldVerticesLength @@ -18538,9 +21499,12 @@ pub unsafe extern "C" fn spSkeletonBounds_update( if !polygon.is_null() { spPolygon_dispose(polygon); } - polygon = spPolygon_create((*boundingBox).super_0.worldVerticesLength); - let ref mut fresh172 = *((*self_0).polygons).offset((*self_0).count as isize); - *fresh172 = polygon; + polygon = spPolygon_create( + (*boundingBox).super_0.worldVerticesLength, + ); + let ref mut fresh129 = *((*self_0).polygons) + .offset((*self_0).count as isize); + *fresh129 = polygon; } (*polygon).count = (*boundingBox).super_0.worldVerticesLength; spVertexAttachment_computeWorldVertices( @@ -18555,9 +21519,10 @@ pub unsafe extern "C" fn spSkeletonBounds_update( if updateAabb != 0 { let mut ii: c_int = 0 as c_int; while ii < (*polygon).count { - let mut x: c_float = *((*polygon).vertices).offset(ii as isize); - let mut y: c_float = - *((*polygon).vertices).offset((ii + 1 as c_int) as isize); + let mut x: c_float = *((*polygon).vertices) + .offset(ii as isize); + let mut y: c_float = *((*polygon).vertices) + .offset((ii + 1 as c_int) as isize); if x < (*self_0).minX { (*self_0).minX = x; } @@ -18585,9 +21550,7 @@ pub unsafe extern "C" fn spSkeletonBounds_aabbContainsPoint( mut x: c_float, mut y: c_float, ) -> c_int { - return (x >= (*self_0).minX - && x <= (*self_0).maxX - && y >= (*self_0).minY + return (x >= (*self_0).minX && x <= (*self_0).maxX && y >= (*self_0).minY && y <= (*self_0).maxY) as c_int; } #[no_mangle] @@ -18632,10 +21595,9 @@ pub unsafe extern "C" fn spSkeletonBounds_aabbIntersectsSkeleton( mut self_0: *mut spSkeletonBounds, mut bounds: *mut spSkeletonBounds, ) -> c_int { - return ((*self_0).minX < (*bounds).maxX - && (*self_0).maxX > (*bounds).minX - && (*self_0).minY < (*bounds).maxY - && (*self_0).maxY > (*bounds).minY) as c_int; + return ((*self_0).minX < (*bounds).maxX && (*self_0).maxX > (*bounds).minX + && (*self_0).minY < (*bounds).maxY && (*self_0).maxY > (*bounds).minY) + as c_int; } #[no_mangle] pub unsafe extern "C" fn spSkeletonBounds_containsPoint( @@ -18651,7 +21613,7 @@ pub unsafe extern "C" fn spSkeletonBounds_containsPoint( } i += 1; } - return std::ptr::null_mut(); + return 0 as *mut spBoundingBoxAttachment; } #[no_mangle] pub unsafe extern "C" fn spSkeletonBounds_intersectsSegment( @@ -18664,14 +21626,19 @@ pub unsafe extern "C" fn spSkeletonBounds_intersectsSegment( let mut i: c_int = 0; i = 0 as c_int; while i < (*self_0).count { - if spPolygon_intersectsSegment(*((*self_0).polygons).offset(i as isize), x1, y1, x2, y2) - != 0 + if spPolygon_intersectsSegment( + *((*self_0).polygons).offset(i as isize), + x1, + y1, + x2, + y2, + ) != 0 { return *((*self_0).boundingBoxes).offset(i as isize); } i += 1; } - return std::ptr::null_mut(); + return 0 as *mut spBoundingBoxAttachment; } #[no_mangle] pub unsafe extern "C" fn spSkeletonBounds_getPolygon( @@ -18686,7 +21653,7 @@ pub unsafe extern "C" fn spSkeletonBounds_getPolygon( } i += 1; } - return std::ptr::null_mut(); + return 0 as *mut spPolygon; } #[no_mangle] pub unsafe extern "C" fn spSkeletonClipping_create() -> *mut spSkeletonClipping { @@ -18694,7 +21661,7 @@ pub unsafe extern "C" fn spSkeletonClipping_create() -> *mut spSkeletonClipping 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 10190 as c_int, + 10898 as c_int, ) as *mut spSkeletonClipping; (*clipping).triangulator = spTriangulator_create(); (*clipping).clippingPolygon = spFloatArray_create(128 as c_int); @@ -18706,7 +21673,9 @@ pub unsafe extern "C" fn spSkeletonClipping_create() -> *mut spSkeletonClipping return clipping; } #[no_mangle] -pub unsafe extern "C" fn spSkeletonClipping_dispose(mut self_0: *mut spSkeletonClipping) { +pub unsafe extern "C" fn spSkeletonClipping_dispose( + mut self_0: *mut spSkeletonClipping, +) { spTriangulator_dispose((*self_0).triangulator); spFloatArray_dispose((*self_0).clippingPolygon); spFloatArray_dispose((*self_0).clipOutput); @@ -18722,7 +21691,8 @@ unsafe extern "C" fn _makeClockwise(mut polygon: *mut spFloatArray) { let mut lastX: c_int = 0; let mut vertices: *mut c_float = (*polygon).items; let mut verticeslength: c_int = (*polygon).size; - let mut area: c_float = *vertices.offset((verticeslength - 2 as c_int) as isize) + let mut area: c_float = *vertices + .offset((verticeslength - 2 as c_int) as isize) * *vertices.offset(1 as c_int as isize) - *vertices.offset(0 as c_int as isize) * *vertices.offset((verticeslength - 1 as c_int) as isize); @@ -18751,8 +21721,10 @@ unsafe extern "C" fn _makeClockwise(mut polygon: *mut spFloatArray) { let mut y: c_float = *vertices.offset((i + 1 as c_int) as isize); let mut other: c_int = lastX - i; *vertices.offset(i as isize) = *vertices.offset(other as isize); - *vertices.offset((i + 1 as c_int) as isize) = - *vertices.offset((other + 1 as c_int) as isize); + *vertices + .offset( + (i + 1 as c_int) as isize, + ) = *vertices.offset((other + 1 as c_int) as isize); *vertices.offset(other as isize) = x; *vertices.offset((other + 1 as c_int) as isize) = y; i += 2 as c_int; @@ -18766,7 +21738,7 @@ pub unsafe extern "C" fn spSkeletonClipping_clipStart( ) -> c_int { let mut i: c_int = 0; let mut n: c_int = 0; - let mut vertices: *mut c_float = std::ptr::null_mut(); + let mut vertices: *mut c_float = 0 as *mut c_float; if !((*self_0).clipAttachment).is_null() { return 0 as c_int; } @@ -18783,7 +21755,8 @@ pub unsafe extern "C" fn spSkeletonClipping_clipStart( 2 as c_int, ); _makeClockwise((*self_0).clippingPolygon); - (*self_0).clippingPolygons = spTriangulator_decompose( + (*self_0) + .clippingPolygons = spTriangulator_decompose( (*self_0).triangulator, (*self_0).clippingPolygon, spTriangulator_triangulate((*self_0).triangulator, (*self_0).clippingPolygon), @@ -18791,8 +21764,8 @@ pub unsafe extern "C" fn spSkeletonClipping_clipStart( i = 0 as c_int; n = (*(*self_0).clippingPolygons).size; while i < n { - let mut polygon: *mut spFloatArray = - *((*(*self_0).clippingPolygons).items).offset(i as isize); + let mut polygon: *mut spFloatArray = *((*(*self_0).clippingPolygons).items) + .offset(i as isize); _makeClockwise(polygon); spFloatArray_add(polygon, *((*polygon).items).offset(0 as c_int as isize)); spFloatArray_add(polygon, *((*polygon).items).offset(1 as c_int as isize)); @@ -18805,18 +21778,21 @@ pub unsafe extern "C" fn spSkeletonClipping_clipEnd( mut self_0: *mut spSkeletonClipping, mut slot: *mut spSlot, ) { - if !((*self_0).clipAttachment).is_null() && (*(*self_0).clipAttachment).endSlot == (*slot).data + if !((*self_0).clipAttachment).is_null() + && (*(*self_0).clipAttachment).endSlot == (*slot).data { spSkeletonClipping_clipEnd2(self_0); } } #[no_mangle] -pub unsafe extern "C" fn spSkeletonClipping_clipEnd2(mut self_0: *mut spSkeletonClipping) { +pub unsafe extern "C" fn spSkeletonClipping_clipEnd2( + mut self_0: *mut spSkeletonClipping, +) { if ((*self_0).clipAttachment).is_null() { return; } - (*self_0).clipAttachment = std::ptr::null_mut(); - (*self_0).clippingPolygons = std::ptr::null_mut(); + (*self_0).clipAttachment = 0 as *mut spClippingAttachment; + (*self_0).clippingPolygons = 0 as *mut spArrayFloatArray; spFloatArray_clear((*self_0).clippedVertices); spFloatArray_clear((*self_0).clippedUVs); spUnsignedShortArray_clear((*self_0).clippedTriangles); @@ -18826,7 +21802,7 @@ pub unsafe extern "C" fn spSkeletonClipping_clipEnd2(mut self_0: *mut spSkeleton pub unsafe extern "C" fn spSkeletonClipping_isClipping( mut self_0: *mut spSkeletonClipping, ) -> c_int { - return ((*self_0).clipAttachment != std::ptr::null_mut()) as c_int; + return ((*self_0).clipAttachment != 0 as *mut spClippingAttachment) as c_int; } #[no_mangle] pub unsafe extern "C" fn _clip( @@ -18843,9 +21819,9 @@ pub unsafe extern "C" fn _clip( let mut i: c_int = 0; let mut originalOutput: *mut spFloatArray = output; let mut clipped: c_int = 0 as c_int; - let mut clippingVertices: *mut c_float = std::ptr::null_mut(); + let mut clippingVertices: *mut c_float = 0 as *mut c_float; let mut clippingVerticesLast: c_int = 0; - let mut input: *mut spFloatArray = std::ptr::null_mut(); + let mut input: *mut spFloatArray = 0 as *mut spFloatArray; if (*clippingArea).size % 4 as c_int >= 2 as c_int { input = output; output = (*self_0).scratch; @@ -18867,11 +21843,14 @@ pub unsafe extern "C" fn _clip( i = 0 as c_int; loop { let mut ii: c_int = 0; - let mut temp: *mut spFloatArray = std::ptr::null_mut(); + let mut temp: *mut spFloatArray = 0 as *mut spFloatArray; let mut edgeX: c_float = *clippingVertices.offset(i as isize); - let mut edgeY: c_float = *clippingVertices.offset((i + 1 as c_int) as isize); - let mut edgeX2: c_float = *clippingVertices.offset((i + 2 as c_int) as isize); - let mut edgeY2: c_float = *clippingVertices.offset((i + 3 as c_int) as isize); + let mut edgeY: c_float = *clippingVertices + .offset((i + 1 as c_int) as isize); + let mut edgeX2: c_float = *clippingVertices + .offset((i + 2 as c_int) as isize); + let mut edgeY2: c_float = *clippingVertices + .offset((i + 3 as c_int) as isize); let mut deltaX: c_float = edgeX - edgeX2; let mut deltaY: c_float = edgeY - edgeY2; let mut inputVertices: *mut c_float = (*input).items; @@ -18881,12 +21860,18 @@ pub unsafe extern "C" fn _clip( ii = 0 as c_int; while ii < inputVerticesLength { let mut inputX: c_float = *inputVertices.offset(ii as isize); - let mut inputY: c_float = *inputVertices.offset((ii + 1 as c_int) as isize); - let mut inputX2: c_float = *inputVertices.offset((ii + 2 as c_int) as isize); - let mut inputY2: c_float = *inputVertices.offset((ii + 3 as c_int) as isize); - let mut side2: c_int = (deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) - > 0 as c_int as c_float) as c_int; - if deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0 as c_int as c_float { + let mut inputY: c_float = *inputVertices + .offset((ii + 1 as c_int) as isize); + let mut inputX2: c_float = *inputVertices + .offset((ii + 2 as c_int) as isize); + let mut inputY2: c_float = *inputVertices + .offset((ii + 3 as c_int) as isize); + let mut side2: c_int = (deltaX * (inputY2 - edgeY2) + - deltaY * (inputX2 - edgeX2) > 0 as c_int as c_float) + as c_int; + if deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) + > 0 as c_int as c_float + { let mut c0: c_float = 0.; let mut c2: c_float = 0.; let mut s: c_float = 0.; @@ -18899,7 +21884,9 @@ pub unsafe extern "C" fn _clip( c0 = inputY2 - inputY; c2 = inputX2 - inputX; s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); - if (if s < 0 as c_int as c_float { -s } else { s }) > 0.000001f32 { + if (if s < 0 as c_int as c_float { -s } else { s }) + > 0.000001f32 + { ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; spFloatArray_add(output, edgeX + (edgeX2 - edgeX) * ua); spFloatArray_add(output, edgeY + (edgeY2 - edgeY) * ua); @@ -18913,15 +21900,13 @@ pub unsafe extern "C" fn _clip( if side2 != 0 { let mut c0_0: c_float = inputY2 - inputY; let mut c2_0: c_float = inputX2 - inputX; - let mut s_0: c_float = c0_0 * (edgeX2 - edgeX) - c2_0 * (edgeY2 - edgeY); - if (if s_0 < 0 as c_int as c_float { - -s_0 - } else { - s_0 - }) > 0.000001f32 + let mut s_0: c_float = c0_0 * (edgeX2 - edgeX) + - c2_0 * (edgeY2 - edgeY); + if (if s_0 < 0 as c_int as c_float { -s_0 } else { s_0 }) + > 0.000001f32 { - let mut ua_0: c_float = - (c2_0 * (edgeY - inputY) - c0_0 * (edgeX - inputX)) / s_0; + let mut ua_0: c_float = (c2_0 * (edgeY - inputY) + - c0_0 * (edgeX - inputX)) / s_0; spFloatArray_add(output, edgeX + (edgeX2 - edgeX) * ua_0); spFloatArray_add(output, edgeY + (edgeY2 - edgeY) * ua_0); } else { @@ -18973,7 +21958,7 @@ pub unsafe extern "C" fn _clip( pub unsafe extern "C" fn spSkeletonClipping_clipTriangles( mut self_0: *mut spSkeletonClipping, mut vertices: *mut c_float, - mut _verticesLength: c_int, + mut verticesLength: c_int, mut triangles: *mut c_ushort, mut trianglesLength: c_int, mut uvs: *mut c_float, @@ -18993,7 +21978,8 @@ pub unsafe extern "C" fn spSkeletonClipping_clipTriangles( i = 0 as c_int; 's_30: while i < trianglesLength { let mut p: c_int = 0; - let mut vertexOffset: c_int = *triangles.offset(i as isize) as c_int * stride; + let mut vertexOffset: c_int = *triangles.offset(i as isize) as c_int + * stride; let mut x2: c_float = 0.; let mut y2: c_float = 0.; let mut u2: c_float = 0.; @@ -19003,15 +21989,19 @@ pub unsafe extern "C" fn spSkeletonClipping_clipTriangles( let mut u3: c_float = 0.; let mut v3: c_float = 0.; let mut x1: c_float = *vertices.offset(vertexOffset as isize); - let mut y1: c_float = *vertices.offset((vertexOffset + 1 as c_int) as isize); + let mut y1: c_float = *vertices + .offset((vertexOffset + 1 as c_int) as isize); let mut u1: c_float = *uvs.offset(vertexOffset as isize); - let mut v1: c_float = *uvs.offset((vertexOffset + 1 as c_int) as isize); - vertexOffset = *triangles.offset((i + 1 as c_int) as isize) as c_int * stride; + let mut v1: c_float = *uvs + .offset((vertexOffset + 1 as c_int) as isize); + vertexOffset = *triangles.offset((i + 1 as c_int) as isize) as c_int + * stride; x2 = *vertices.offset(vertexOffset as isize); y2 = *vertices.offset((vertexOffset + 1 as c_int) as isize); u2 = *uvs.offset(vertexOffset as isize); v2 = *uvs.offset((vertexOffset + 1 as c_int) as isize); - vertexOffset = *triangles.offset((i + 2 as c_int) as isize) as c_int * stride; + vertexOffset = *triangles.offset((i + 2 as c_int) as isize) as c_int + * stride; x3 = *vertices.offset(vertexOffset as isize); y3 = *vertices.offset((vertexOffset + 1 as c_int) as isize); u3 = *uvs.offset(vertexOffset as isize); @@ -19037,11 +22027,13 @@ pub unsafe extern "C" fn spSkeletonClipping_clipTriangles( let mut d2: c_float = 0.; let mut d4: c_float = 0.; let mut d: c_float = 0.; - let mut clippedTrianglesItems: *mut c_ushort = std::ptr::null_mut(); + let mut clippedTrianglesItems: *mut c_ushort = 0 + as *mut c_ushort; let mut clipOutputCount: c_int = 0; - let mut clipOutputItems: *mut c_float = std::ptr::null_mut(); - let mut clippedVerticesItems: *mut c_float = std::ptr::null_mut(); - let mut clippedUVsItems: *mut c_float = std::ptr::null_mut(); + let mut clipOutputItems: *mut c_float = 0 as *mut c_float; + let mut clippedVerticesItems: *mut c_float = 0 + as *mut c_float; + let mut clippedUVsItems: *mut c_float = 0 as *mut c_float; let mut clipOutputLength: c_int = (*clipOutput).size; if !(clipOutputLength == 0 as c_int) { d0 = y2 - y3; @@ -19055,10 +22047,12 @@ pub unsafe extern "C" fn spSkeletonClipping_clipTriangles( clippedVertices, s + (clipOutputCount << 1 as c_int), )) - .items; - clippedUVsItems = - (*spFloatArray_setSize(clippedUVs, s + (clipOutputCount << 1 as c_int))) - .items; + .items; + clippedUVsItems = (*spFloatArray_setSize( + clippedUVs, + s + (clipOutputCount << 1 as c_int), + )) + .items; ii = 0 as c_int; while ii < clipOutputLength { let mut c0: c_float = 0.; @@ -19067,17 +22061,21 @@ pub unsafe extern "C" fn spSkeletonClipping_clipTriangles( let mut b: c_float = 0.; let mut c: c_float = 0.; let mut x: c_float = *clipOutputItems.offset(ii as isize); - let mut y: c_float = *clipOutputItems.offset((ii + 1 as c_int) as isize); + let mut y: c_float = *clipOutputItems + .offset((ii + 1 as c_int) as isize); *clippedVerticesItems.offset(s as isize) = x; - *clippedVerticesItems.offset((s + 1 as c_int) as isize) = y; + *clippedVerticesItems + .offset((s + 1 as c_int) as isize) = y; c0 = x - x3; c1 = y - y3; a = (d0 * c0 + d1 * c1) * d; b = (d4 * c0 + d2 * c1) * d; c = 1 as c_int as c_float - a - b; *clippedUVsItems.offset(s as isize) = u1 * a + u2 * b + u3 * c; - *clippedUVsItems.offset((s + 1 as c_int) as isize) = - v1 * a + v2 * b + v3 * c; + *clippedUVsItems + .offset( + (s + 1 as c_int) as isize, + ) = v1 * a + v2 * b + v3 * c; s += 2 as c_int; ii += 2 as c_int; } @@ -19086,28 +22084,41 @@ pub unsafe extern "C" fn spSkeletonClipping_clipTriangles( clippedTriangles, s + 3 as c_int * (clipOutputCount - 2 as c_int), )) - .items; + .items; clipOutputCount -= 1; ii = 1 as c_int; while ii < clipOutputCount { - *clippedTrianglesItems.offset(s as isize) = index as c_ushort; - *clippedTrianglesItems.offset((s + 1 as c_int) as isize) = - (index as c_int + ii) as c_ushort; - *clippedTrianglesItems.offset((s + 2 as c_int) as isize) = - (index as c_int + ii + 1 as c_int) as c_ushort; + *clippedTrianglesItems + .offset(s as isize) = index as c_ushort; + *clippedTrianglesItems + .offset( + (s + 1 as c_int) as isize, + ) = (index as c_int + ii) as c_ushort; + *clippedTrianglesItems + .offset( + (s + 2 as c_int) as isize, + ) = (index as c_int + ii + 1 as c_int) + as c_ushort; s += 3 as c_int; ii += 1; } - index = (index as c_int + (clipOutputCount + 1 as c_int)) as c_short; + index = (index as c_int + (clipOutputCount + 1 as c_int)) + as c_short; } p += 1; } else { - let mut clippedTrianglesItems_0: *mut c_ushort = std::ptr::null_mut(); - let mut clippedVerticesItems_0: *mut c_float = - (*spFloatArray_setSize(clippedVertices, s + ((3 as c_int) << 1 as c_int))) - .items; - let mut clippedUVsItems_0: *mut c_float = - (*spFloatArray_setSize(clippedUVs, s + ((3 as c_int) << 1 as c_int))).items; + let mut clippedTrianglesItems_0: *mut c_ushort = 0 + as *mut c_ushort; + let mut clippedVerticesItems_0: *mut c_float = (*spFloatArray_setSize( + clippedVertices, + s + ((3 as c_int) << 1 as c_int), + )) + .items; + let mut clippedUVsItems_0: *mut c_float = (*spFloatArray_setSize( + clippedUVs, + s + ((3 as c_int) << 1 as c_int), + )) + .items; *clippedVerticesItems_0.offset(s as isize) = x1; *clippedVerticesItems_0.offset((s + 1 as c_int) as isize) = y1; *clippedVerticesItems_0.offset((s + 2 as c_int) as isize) = x2; @@ -19121,13 +22132,20 @@ pub unsafe extern "C" fn spSkeletonClipping_clipTriangles( *clippedUVsItems_0.offset((s + 4 as c_int) as isize) = u3; *clippedUVsItems_0.offset((s + 5 as c_int) as isize) = v3; s = (*clippedTriangles).size; - clippedTrianglesItems_0 = - (*spUnsignedShortArray_setSize(clippedTriangles, s + 3 as c_int)).items; + clippedTrianglesItems_0 = (*spUnsignedShortArray_setSize( + clippedTriangles, + s + 3 as c_int, + )) + .items; *clippedTrianglesItems_0.offset(s as isize) = index as c_ushort; - *clippedTrianglesItems_0.offset((s + 1 as c_int) as isize) = - (index as c_int + 1 as c_int) as c_ushort; - *clippedTrianglesItems_0.offset((s + 2 as c_int) as isize) = - (index as c_int + 2 as c_int) as c_ushort; + *clippedTrianglesItems_0 + .offset( + (s + 1 as c_int) as isize, + ) = (index as c_int + 1 as c_int) as c_ushort; + *clippedTrianglesItems_0 + .offset( + (s + 2 as c_int) as isize, + ) = (index as c_int + 2 as c_int) as c_ushort; index = (index as c_int + 3 as c_int) as c_short; i += 3 as c_int; continue 's_30; @@ -19142,7 +22160,7 @@ pub unsafe extern "C" fn spSkeletonData_create() -> *mut spSkeletonData { 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 10533 as c_int, + 11241 as c_int, ) as *mut spSkeletonData; } #[no_mangle] @@ -19192,7 +22210,9 @@ pub unsafe extern "C" fn spSkeletonData_dispose(mut self_0: *mut spSkeletonData) _spFree((*self_0).ikConstraints as *mut c_void); i = 0 as c_int; while i < (*self_0).transformConstraintsCount { - spTransformConstraintData_dispose(*((*self_0).transformConstraints).offset(i as isize)); + spTransformConstraintData_dispose( + *((*self_0).transformConstraints).offset(i as isize), + ); i += 1; } _spFree((*self_0).transformConstraints as *mut c_void); @@ -19202,6 +22222,14 @@ pub unsafe extern "C" fn spSkeletonData_dispose(mut self_0: *mut spSkeletonData) i += 1; } _spFree((*self_0).pathConstraints as *mut c_void); + i = 0 as c_int; + while i < (*self_0).physicsConstraintsCount { + spPhysicsConstraintData_dispose( + *((*self_0).physicsConstraints).offset(i as isize), + ); + i += 1; + } + _spFree((*self_0).physicsConstraints as *mut c_void); _spFree((*self_0).hash as *mut c_void); _spFree((*self_0).version as *mut c_void); _spFree((*self_0).imagesPath as *mut c_void); @@ -19216,12 +22244,14 @@ pub unsafe extern "C" fn spSkeletonData_findBone( let mut i: c_int = 0; i = 0 as c_int; while i < (*self_0).bonesCount { - if spine_strcmp((**((*self_0).bones).offset(i as isize)).name, boneName) == 0 as c_int { + if spine_strcmp((**((*self_0).bones).offset(i as isize)).name, boneName) + == 0 as c_int + { return *((*self_0).bones).offset(i as isize); } i += 1; } - return std::ptr::null_mut(); + return 0 as *mut spBoneData; } #[no_mangle] pub unsafe extern "C" fn spSkeletonData_findSlot( @@ -19231,12 +22261,14 @@ pub unsafe extern "C" fn spSkeletonData_findSlot( let mut i: c_int = 0; i = 0 as c_int; while i < (*self_0).slotsCount { - if spine_strcmp((**((*self_0).slots).offset(i as isize)).name, slotName) == 0 as c_int { + if spine_strcmp((**((*self_0).slots).offset(i as isize)).name, slotName) + == 0 as c_int + { return *((*self_0).slots).offset(i as isize); } i += 1; } - return std::ptr::null_mut(); + return 0 as *mut spSlotData; } #[no_mangle] pub unsafe extern "C" fn spSkeletonData_findSkin( @@ -19246,12 +22278,14 @@ pub unsafe extern "C" fn spSkeletonData_findSkin( let mut i: c_int = 0; i = 0 as c_int; while i < (*self_0).skinsCount { - if spine_strcmp((**((*self_0).skins).offset(i as isize)).name, skinName) == 0 as c_int { + if spine_strcmp((**((*self_0).skins).offset(i as isize)).name, skinName) + == 0 as c_int + { return *((*self_0).skins).offset(i as isize); } i += 1; } - return std::ptr::null_mut(); + return 0 as *mut spSkin; } #[no_mangle] pub unsafe extern "C" fn spSkeletonData_findEvent( @@ -19261,12 +22295,14 @@ pub unsafe extern "C" fn spSkeletonData_findEvent( let mut i: c_int = 0; i = 0 as c_int; while i < (*self_0).eventsCount { - if spine_strcmp((**((*self_0).events).offset(i as isize)).name, eventName) == 0 as c_int { + if spine_strcmp((**((*self_0).events).offset(i as isize)).name, eventName) + == 0 as c_int + { return *((*self_0).events).offset(i as isize); } i += 1; } - return std::ptr::null_mut(); + return 0 as *mut spEventData; } #[no_mangle] pub unsafe extern "C" fn spSkeletonData_findAnimation( @@ -19285,7 +22321,7 @@ pub unsafe extern "C" fn spSkeletonData_findAnimation( } i += 1; } - return std::ptr::null_mut(); + return 0 as *mut spAnimation; } #[no_mangle] pub unsafe extern "C" fn spSkeletonData_findIkConstraint( @@ -19304,7 +22340,7 @@ pub unsafe extern "C" fn spSkeletonData_findIkConstraint( } i += 1; } - return std::ptr::null_mut(); + return 0 as *mut spIkConstraintData; } #[no_mangle] pub unsafe extern "C" fn spSkeletonData_findTransformConstraint( @@ -19323,7 +22359,7 @@ pub unsafe extern "C" fn spSkeletonData_findTransformConstraint( } i += 1; } - return std::ptr::null_mut(); + return 0 as *mut spTransformConstraintData; } #[no_mangle] pub unsafe extern "C" fn spSkeletonData_findPathConstraint( @@ -19342,18 +22378,42 @@ pub unsafe extern "C" fn spSkeletonData_findPathConstraint( } i += 1; } - return std::ptr::null_mut(); + return 0 as *mut spPathConstraintData; +} +#[no_mangle] +pub unsafe extern "C" fn spSkeletonData_findPhysicsConstraint( + mut self_0: *const spSkeletonData, + mut constraintName: *const c_char, +) -> *mut spPhysicsConstraintData { + let mut i: c_int = 0; + i = 0 as c_int; + while i < (*self_0).physicsConstraintsCount { + if spine_strcmp( + (**((*self_0).physicsConstraints).offset(i as isize)).name, + constraintName, + ) == 0 as c_int + { + return *((*self_0).physicsConstraints).offset(i as isize); + } + i += 1; + } + return 0 as *mut spPhysicsConstraintData; } #[no_mangle] pub unsafe extern "C" fn spSkeletonJson_createWithLoader( mut attachmentLoader: *mut spAttachmentLoader, ) -> *mut spSkeletonJson { let mut self_0: *mut spSkeletonJson = &mut (*((_spCalloc - as unsafe extern "C" fn(size_t, size_t, *const c_char, c_int) -> *mut c_void)( + as unsafe extern "C" fn( + size_t, + size_t, + *const c_char, + c_int, + ) -> *mut c_void)( 1 as c_int as size_t, ::core::mem::size_of::<_spSkeletonJson>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 10694 as c_int, + 11413 as c_int, ) as *mut _spSkeletonJson)) .super_0; (*self_0).scale = 1 as c_int as c_float; @@ -19361,10 +22421,15 @@ pub unsafe extern "C" fn spSkeletonJson_createWithLoader( return self_0; } #[no_mangle] -pub unsafe extern "C" fn spSkeletonJson_create(mut atlas: *mut spAtlas) -> *mut spSkeletonJson { - let mut attachmentLoader: *mut spAtlasAttachmentLoader = spAtlasAttachmentLoader_create(atlas); - let mut self_0: *mut spSkeletonJson = - spSkeletonJson_createWithLoader(&mut (*attachmentLoader).super_0); +pub unsafe extern "C" fn spSkeletonJson_create( + mut atlas: *mut spAtlas, +) -> *mut spSkeletonJson { + let mut attachmentLoader: *mut spAtlasAttachmentLoader = spAtlasAttachmentLoader_create( + atlas, + ); + let mut self_0: *mut spSkeletonJson = spSkeletonJson_createWithLoader( + &mut (*attachmentLoader).super_0, + ); (*(self_0 as *mut _spSkeletonJson)).ownsLoader = 1 as c_int; return self_0; } @@ -19397,30 +22462,39 @@ pub unsafe extern "C" fn _spSkeletonJson_setError( (255 as c_int - length) as size_t, ); } - let ref mut fresh173 = *(&mut (*self_0).error as *mut *mut c_char); - *fresh173 = _spMalloc( + (*self_0) + .error = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(message.as_mut_ptr())).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen(message.as_mut_ptr())) + .wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 10722 as c_int, + 11441 as c_int, ) as *mut c_char; - spine_strcpy(*fresh173, message.as_mut_ptr()); + spine_strcpy((*self_0).error, message.as_mut_ptr()); if !root.is_null() { Json_dispose(root); } } -unsafe extern "C" fn toColor(mut value: *const c_char, mut index: c_int) -> c_float { +unsafe extern "C" fn toColor( + mut value: *const c_char, + mut index: c_int, +) -> c_float { let mut digits: [c_char; 3] = [0; 3]; - let mut error: *mut c_char = std::ptr::null_mut(); + let mut error: *mut c_char = 0 as *mut c_char; let mut color: c_int = 0; - if index as size_t >= (spine_strlen(value)).wrapping_div(2 as c_int as c_ulong) { + if index as size_t + >= (spine_strlen(value)).wrapping_div(2 as c_int as c_ulong) + { return -(1 as c_int) as c_float; } value = value.offset((index * 2 as c_int) as isize); digits[0 as c_int as usize] = *value; digits[1 as c_int as usize] = *value.offset(1 as c_int as isize); digits[2 as c_int as usize] = '\0' as i32 as c_char; - color = spine_strtoul(digits.as_mut_ptr(), &mut error, 16 as c_int) as c_int; + color = spine_strtoul(digits.as_mut_ptr(), &mut error, 16 as c_int) + as c_int; if *error as c_int != 0 as c_int { return -(1 as c_int) as c_float; } @@ -19503,7 +22577,18 @@ unsafe extern "C" fn readCurve( curve = (*curve).next; cy2 = (*curve).valueFloat * scale; setBezierJson( - timeline, frame, value, bezier, time1, value1, cx1, cy1, cx2, cy2, time2, value2, + timeline, + frame, + value, + bezier, + time1, + value1, + cx1, + cy1, + cx2, + cy2, + time2, + value2, ); return bezier + 1 as c_int; } @@ -19527,8 +22612,8 @@ unsafe extern "C" fn readTimelineJson( let mut bezier: c_int = 0 as c_int; frame = 0 as c_int; loop { - let mut nextMap: *mut Json = std::ptr::null_mut(); - let mut curve: *mut Json = std::ptr::null_mut(); + let mut nextMap: *mut Json = 0 as *mut Json; + let mut curve: *mut Json = 0 as *mut Json; let mut time2: c_float = 0.; let mut value2: c_float = 0.; spCurveTimeline1_setFrame(timeline, frame, time, value); @@ -19549,7 +22634,16 @@ unsafe extern "C" fn readTimelineJson( curve = Json_getItem(keyMap, b"curve\0" as *const u8 as *const c_char); if !curve.is_null() { bezier = readCurve( - curve, timeline, bezier, frame, 0 as c_int, time, time2, value, value2, scale, + curve, + timeline, + bezier, + frame, + 0 as c_int, + time, + time2, + value, + value2, + scale, ); } time = time2; @@ -19578,8 +22672,8 @@ unsafe extern "C" fn readTimeline2Json( let mut bezier: c_int = 0 as c_int; frame = 0 as c_int; loop { - let mut nextMap: *mut Json = std::ptr::null_mut(); - let mut curve: *mut Json = std::ptr::null_mut(); + let mut nextMap: *mut Json = 0 as *mut Json; + let mut curve: *mut Json = 0 as *mut Json; let mut time2: c_float = 0.; let mut nvalue1: c_float = 0.; let mut nvalue2: c_float = 0.; @@ -19598,10 +22692,28 @@ unsafe extern "C" fn readTimeline2Json( curve = Json_getItem(keyMap, b"curve\0" as *const u8 as *const c_char); if !curve.is_null() { bezier = readCurve( - curve, timeline, bezier, frame, 0 as c_int, time, time2, value1, nvalue1, scale, + curve, + timeline, + bezier, + frame, + 0 as c_int, + time, + time2, + value1, + nvalue1, + scale, ); bezier = readCurve( - curve, timeline, bezier, frame, 1 as c_int, time, time2, value2, nvalue2, scale, + curve, + timeline, + bezier, + frame, + 1 as c_int, + time, + time2, + value2, + nvalue2, + scale, ); } time = time2; @@ -19613,18 +22725,31 @@ unsafe extern "C" fn readTimeline2Json( return &mut (*timeline).super_0; } unsafe extern "C" fn readSequenceJson(mut item: *mut Json) -> *mut spSequence { - let mut sequence: *mut spSequence = std::ptr::null_mut(); + let mut sequence: *mut spSequence = 0 as *mut spSequence; if item.is_null() { - return std::ptr::null_mut(); + return 0 as *mut spSequence; } - sequence = spSequence_create(Json_getInt( + sequence = spSequence_create( + Json_getInt( + item, + b"count\0" as *const u8 as *const c_char, + 0 as c_int, + ), + ); + (*sequence) + .start = Json_getInt( item, - b"count\0" as *const u8 as *const c_char, + b"start\0" as *const u8 as *const c_char, + 1 as c_int, + ); + (*sequence) + .digits = Json_getInt( + item, + b"digits\0" as *const u8 as *const c_char, 0 as c_int, - )); - (*sequence).start = Json_getInt(item, b"start\0" as *const u8 as *const c_char, 1 as c_int); - (*sequence).digits = Json_getInt(item, b"digits\0" as *const u8 as *const c_char, 0 as c_int); - (*sequence).setupIndex = Json_getInt( + ); + (*sequence) + .setupIndex = Json_getInt( item, b"setupIndex\0" as *const u8 as *const c_char, 0 as c_int, @@ -19639,10 +22764,10 @@ unsafe extern "C" fn _spSkeletonJson_addLinkedMesh( mut parent: *const c_char, mut inheritDeform: c_int, ) { - let mut linkedMesh: *mut _spLinkedMeshJson = std::ptr::null_mut(); + let mut linkedMesh: *mut _spLinkedMeshJson = 0 as *mut _spLinkedMeshJson; let mut internal: *mut _spSkeletonJson = self_0 as *mut _spSkeletonJson; if (*internal).linkedMeshCount == (*internal).linkedMeshCapacity { - let mut linkedMeshes: *mut _spLinkedMeshJson = std::ptr::null_mut(); + let mut linkedMeshes: *mut _spLinkedMeshJson = 0 as *mut _spLinkedMeshJson; (*internal).linkedMeshCapacity *= 2 as c_int; if (*internal).linkedMeshCapacity < 8 as c_int { (*internal).linkedMeshCapacity = 8 as c_int; @@ -19651,7 +22776,7 @@ unsafe extern "C" fn _spSkeletonJson_addLinkedMesh( (::core::mem::size_of::<_spLinkedMeshJson>() as c_ulong) .wrapping_mul((*internal).linkedMeshCapacity as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 10847 as c_int, + 11566 as c_int, ) as *mut _spLinkedMeshJson; spine_memcpy( linkedMeshes as *mut c_void, @@ -19662,9 +22787,9 @@ unsafe extern "C" fn _spSkeletonJson_addLinkedMesh( _spFree((*internal).linkedMeshes as *mut c_void); (*internal).linkedMeshes = linkedMeshes; } - let fresh174 = (*internal).linkedMeshCount; + let fresh130 = (*internal).linkedMeshCount; (*internal).linkedMeshCount = (*internal).linkedMeshCount + 1; - linkedMesh = ((*internal).linkedMeshes).offset(fresh174 as isize); + linkedMesh = ((*internal).linkedMeshes).offset(fresh130 as isize); (*linkedMesh).mesh = mesh; (*linkedMesh).skin = skin; (*linkedMesh).slotIndex = slotIndex; @@ -19695,7 +22820,7 @@ unsafe extern "C" fn findSlotIndex( cleanUpTimelines(timelines); _spSkeletonJson_setError( json, - std::ptr::null_mut(), + 0 as *mut Json, b"Slot not found: \0" as *const u8 as *const c_char, slotName, ); @@ -19723,7 +22848,7 @@ pub unsafe extern "C" fn findIkConstraintIndex( cleanUpTimelines(timelines); _spSkeletonJson_setError( json, - std::ptr::null_mut(), + 0 as *mut Json, b"IK constraint not found: \0" as *const u8 as *const c_char, (*constraint).name, ); @@ -19751,7 +22876,7 @@ pub unsafe extern "C" fn findTransformConstraintIndex( cleanUpTimelines(timelines); _spSkeletonJson_setError( json, - std::ptr::null_mut(), + 0 as *mut Json, b"Transform constraint not found: \0" as *const u8 as *const c_char, (*constraint).name, ); @@ -19779,12 +22904,40 @@ pub unsafe extern "C" fn findPathConstraintIndex( cleanUpTimelines(timelines); _spSkeletonJson_setError( json, - std::ptr::null_mut(), + 0 as *mut Json, b"Path constraint not found: \0" as *const u8 as *const c_char, (*constraint).name, ); return -(1 as c_int); } +#[no_mangle] +pub unsafe extern "C" fn findPhysicsConstraintIndex( + mut json: *mut spSkeletonJson, + mut skeletonData: *const spSkeletonData, + mut constraint: *const spPhysicsConstraintData, + mut timelines: *mut spTimelineArray, +) -> c_int { + if !constraint.is_null() { + let mut i: c_int = 0; + i = 0 as c_int; + while i < (*skeletonData).physicsConstraintsCount { + if *((*skeletonData).physicsConstraints).offset(i as isize) + == constraint as *mut spPhysicsConstraintData + { + return i; + } + i += 1; + } + } + cleanUpTimelines(timelines); + _spSkeletonJson_setError( + json, + 0 as *mut Json, + b"Physics constraint not found: \0" as *const u8 as *const c_char, + (*constraint).name, + ); + return -(1 as c_int); +} unsafe extern "C" fn _spSkeletonJson_readAnimation( mut self_0: *mut spSkeletonJson, mut root: *mut Json, @@ -19793,24 +22946,50 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( let mut timelines: *mut spTimelineArray = spTimelineArray_create(8 as c_int); let mut scale: c_float = (*self_0).scale; let mut duration: c_float = 0.; - let mut bones: *mut Json = Json_getItem(root, b"bones\0" as *const u8 as *const c_char); - let mut slots: *mut Json = Json_getItem(root, b"slots\0" as *const u8 as *const c_char); - let mut ik: *mut Json = Json_getItem(root, b"ik\0" as *const u8 as *const c_char); - let mut transform: *mut Json = Json_getItem(root, b"transform\0" as *const u8 as *const c_char); - let mut paths: *mut Json = Json_getItem(root, b"path\0" as *const u8 as *const c_char); - let mut attachmentsJson: *mut Json = - Json_getItem(root, b"attachments\0" as *const u8 as *const c_char); - let mut drawOrderJson: *mut Json = - Json_getItem(root, b"drawOrder\0" as *const u8 as *const c_char); - let mut events: *mut Json = Json_getItem(root, b"events\0" as *const u8 as *const c_char); - let mut boneMap: *mut Json = std::ptr::null_mut(); - let mut slotMap: *mut Json = std::ptr::null_mut(); - let mut keyMap: *mut Json = std::ptr::null_mut(); - let mut nextMap: *mut Json = std::ptr::null_mut(); - let mut curve: *mut Json = std::ptr::null_mut(); - let mut timelineMap: *mut Json = std::ptr::null_mut(); - let mut attachmentsMap: *mut Json = std::ptr::null_mut(); - let mut constraintMap: *mut Json = std::ptr::null_mut(); + let mut bones: *mut Json = Json_getItem( + root, + b"bones\0" as *const u8 as *const c_char, + ); + let mut slots: *mut Json = Json_getItem( + root, + b"slots\0" as *const u8 as *const c_char, + ); + let mut ik: *mut Json = Json_getItem( + root, + b"ik\0" as *const u8 as *const c_char, + ); + let mut transform: *mut Json = Json_getItem( + root, + b"transform\0" as *const u8 as *const c_char, + ); + let mut paths: *mut Json = Json_getItem( + root, + b"path\0" as *const u8 as *const c_char, + ); + let mut physics: *mut Json = Json_getItem( + root, + b"physics\0" as *const u8 as *const c_char, + ); + let mut attachmentsJson: *mut Json = Json_getItem( + root, + b"attachments\0" as *const u8 as *const c_char, + ); + let mut drawOrderJson: *mut Json = Json_getItem( + root, + b"drawOrder\0" as *const u8 as *const c_char, + ); + let mut events: *mut Json = Json_getItem( + root, + b"events\0" as *const u8 as *const c_char, + ); + let mut boneMap: *mut Json = 0 as *mut Json; + let mut slotMap: *mut Json = 0 as *mut Json; + let mut keyMap: *mut Json = 0 as *mut Json; + let mut nextMap: *mut Json = 0 as *mut Json; + let mut curve: *mut Json = 0 as *mut Json; + let mut timelineMap: *mut Json = 0 as *mut Json; + let mut attachmentsMap: *mut Json = 0 as *mut Json; + let mut constraintMap: *mut Json = 0 as *mut Json; let mut frame: c_int = 0; let mut bezier: c_int = 0; let mut i: c_int = 0; @@ -19839,15 +23018,16 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b: 0., a: 0., }; - slotMap = if !slots.is_null() { - (*slots).child - } else { - std::ptr::null_mut() - }; + slotMap = if !slots.is_null() { (*slots).child } else { 0 as *mut Json }; while !slotMap.is_null() { - let mut slotIndex: c_int = findSlotIndex(self_0, skeletonData, (*slotMap).name, timelines); + let mut slotIndex: c_int = findSlotIndex( + self_0, + skeletonData, + (*slotMap).name, + timelines, + ); if slotIndex == -(1 as c_int) { - return std::ptr::null_mut(); + return 0 as *mut spAnimation; } timelineMap = (*slotMap).child; while !timelineMap.is_null() { @@ -19857,8 +23037,10 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"attachment\0" as *const u8 as *const c_char, ) == 0 as c_int { - let mut timeline: *mut spAttachmentTimeline = - spAttachmentTimeline_create(frames, slotIndex); + let mut timeline: *mut spAttachmentTimeline = spAttachmentTimeline_create( + frames, + slotIndex, + ); keyMap = (*timelineMap).child; frame = 0 as c_int; while !keyMap.is_null() { @@ -19870,25 +23052,36 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"time\0" as *const u8 as *const c_char, 0 as c_int as c_float, ), - if !(Json_getItem(keyMap, b"name\0" as *const u8 as *const c_char)) + if !(Json_getItem( + keyMap, + b"name\0" as *const u8 as *const c_char, + )) .is_null() { - (*Json_getItem(keyMap, b"name\0" as *const u8 as *const c_char)) + (*Json_getItem( + keyMap, + b"name\0" as *const u8 as *const c_char, + )) .valueString } else { - std::ptr::null() + 0 as *const c_char }, ); keyMap = (*keyMap).next; frame += 1; } spTimelineArray_add(timelines, &mut (*timeline).super_0); - } else if spine_strcmp((*timelineMap).name, b"rgba\0" as *const u8 as *const c_char) - == 0 as c_int + } else if spine_strcmp( + (*timelineMap).name, + b"rgba\0" as *const u8 as *const c_char, + ) == 0 as c_int { let mut time: c_float = 0.; - let mut timeline_0: *mut spRGBATimeline = - spRGBATimeline_create(frames, frames << 2 as c_int, slotIndex); + let mut timeline_0: *mut spRGBATimeline = spRGBATimeline_create( + frames, + frames << 2 as c_int, + slotIndex, + ); keyMap = (*timelineMap).child; time = Json_getFloat( keyMap, @@ -19900,7 +23093,7 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( Json_getString( keyMap, b"color\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ), 1 as c_int, ); @@ -19909,7 +23102,13 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( loop { let mut time2: c_float = 0.; spRGBATimeline_setFrame( - timeline_0, frame, time, color.r, color.g, color.b, color.a, + timeline_0, + frame, + time, + color.r, + color.g, + color.b, + color.a, ); nextMap = (*keyMap).next; if nextMap.is_null() { @@ -19925,11 +23124,14 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( Json_getString( nextMap, b"color\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ), 1 as c_int, ); - curve = Json_getItem(keyMap, b"curve\0" as *const u8 as *const c_char); + curve = Json_getItem( + keyMap, + b"curve\0" as *const u8 as *const c_char, + ); if !curve.is_null() { bezier = readCurve( curve, @@ -19986,12 +23188,17 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( frame += 1; } spTimelineArray_add(timelines, &mut (*timeline_0).super_0.super_0); - } else if spine_strcmp((*timelineMap).name, b"rgb\0" as *const u8 as *const c_char) - == 0 as c_int + } else if spine_strcmp( + (*timelineMap).name, + b"rgb\0" as *const u8 as *const c_char, + ) == 0 as c_int { let mut time_0: c_float = 0.; - let mut timeline_1: *mut spRGBTimeline = - spRGBTimeline_create(frames, frames * 3 as c_int, slotIndex); + let mut timeline_1: *mut spRGBTimeline = spRGBTimeline_create( + frames, + frames * 3 as c_int, + slotIndex, + ); keyMap = (*timelineMap).child; time_0 = Json_getFloat( keyMap, @@ -20003,7 +23210,7 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( Json_getString( keyMap, b"color\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ), 1 as c_int, ); @@ -20011,7 +23218,14 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( bezier = 0 as c_int; loop { let mut time2_0: c_float = 0.; - spRGBTimeline_setFrame(timeline_1, frame, time_0, color.r, color.g, color.b); + spRGBTimeline_setFrame( + timeline_1, + frame, + time_0, + color.r, + color.g, + color.b, + ); nextMap = (*keyMap).next; if nextMap.is_null() { break; @@ -20026,11 +23240,14 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( Json_getString( nextMap, b"color\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ), 1 as c_int, ); - curve = Json_getItem(keyMap, b"curve\0" as *const u8 as *const c_char); + curve = Json_getItem( + keyMap, + b"curve\0" as *const u8 as *const c_char, + ); if !curve.is_null() { bezier = readCurve( curve, @@ -20085,10 +23302,12 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( readTimelineJson( (*timelineMap).child, &mut (*(spAlphaTimeline_create - as unsafe extern "C" fn(c_int, c_int, c_int) -> *mut spAlphaTimeline)( - frames, frames, slotIndex, - )) - .super_0, + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + ) -> *mut spAlphaTimeline)(frames, frames, slotIndex)) + .super_0, 0 as c_int as c_float, 1 as c_int as c_float, ), @@ -20099,8 +23318,11 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( ) == 0 as c_int { let mut time_1: c_float = 0.; - let mut timeline_2: *mut spRGBA2Timeline = - spRGBA2Timeline_create(frames, frames * 7 as c_int, slotIndex); + let mut timeline_2: *mut spRGBA2Timeline = spRGBA2Timeline_create( + frames, + frames * 7 as c_int, + slotIndex, + ); keyMap = (*timelineMap).child; time_1 = Json_getFloat( keyMap, @@ -20112,7 +23334,7 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( Json_getString( keyMap, b"light\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ), 1 as c_int, ); @@ -20121,7 +23343,7 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( Json_getString( keyMap, b"dark\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ), 0 as c_int, ); @@ -20130,8 +23352,16 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( loop { let mut time2_1: c_float = 0.; spRGBA2Timeline_setFrame( - timeline_2, frame, time_1, color.r, color.g, color.b, color.a, color2.g, - color2.g, color2.b, + timeline_2, + frame, + time_1, + color.r, + color.g, + color.b, + color.a, + color2.g, + color2.g, + color2.b, ); nextMap = (*keyMap).next; if nextMap.is_null() { @@ -20147,7 +23377,7 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( Json_getString( nextMap, b"light\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ), 1 as c_int, ); @@ -20156,11 +23386,14 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( Json_getString( nextMap, b"dark\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ), 0 as c_int, ); - curve = Json_getItem(keyMap, b"curve\0" as *const u8 as *const c_char); + curve = Json_getItem( + keyMap, + b"curve\0" as *const u8 as *const c_char, + ); if !curve.is_null() { bezier = readCurve( curve, @@ -20254,12 +23487,17 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( frame += 1; } spTimelineArray_add(timelines, &mut (*timeline_2).super_0.super_0); - } else if spine_strcmp((*timelineMap).name, b"rgb2\0" as *const u8 as *const c_char) - == 0 as c_int + } else if spine_strcmp( + (*timelineMap).name, + b"rgb2\0" as *const u8 as *const c_char, + ) == 0 as c_int { let mut time_2: c_float = 0.; - let mut timeline_3: *mut spRGBA2Timeline = - spRGBA2Timeline_create(frames, frames * 6 as c_int, slotIndex); + let mut timeline_3: *mut spRGBA2Timeline = spRGBA2Timeline_create( + frames, + frames * 6 as c_int, + slotIndex, + ); keyMap = (*timelineMap).child; time_2 = Json_getFloat( keyMap, @@ -20271,7 +23509,7 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( Json_getString( keyMap, b"light\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ), 0 as c_int, ); @@ -20280,7 +23518,7 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( Json_getString( keyMap, b"dark\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ), 0 as c_int, ); @@ -20289,8 +23527,16 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( loop { let mut time2_2: c_float = 0.; spRGBA2Timeline_setFrame( - timeline_3, frame, time_2, color.r, color.g, color.b, color.a, color2.r, - color2.g, color2.b, + timeline_3, + frame, + time_2, + color.r, + color.g, + color.b, + color.a, + color2.r, + color2.g, + color2.b, ); nextMap = (*keyMap).next; if nextMap.is_null() { @@ -20306,7 +23552,7 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( Json_getString( nextMap, b"light\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ), 0 as c_int, ); @@ -20315,11 +23561,14 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( Json_getString( nextMap, b"dark\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ), 0 as c_int, ); - curve = Json_getItem(keyMap, b"curve\0" as *const u8 as *const c_char); + curve = Json_getItem( + keyMap, + b"curve\0" as *const u8 as *const c_char, + ); if !curve.is_null() { bezier = readCurve( curve, @@ -20405,21 +23654,18 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( cleanUpTimelines(timelines); _spSkeletonJson_setError( self_0, - std::ptr::null_mut(), - b"Invalid timeline type for a slot: \0" as *const u8 as *const c_char, + 0 as *mut Json, + b"Invalid timeline type for a slot: \0" as *const u8 + as *const c_char, (*timelineMap).name, ); - return std::ptr::null_mut(); + return 0 as *mut spAnimation; } timelineMap = (*timelineMap).next; } slotMap = (*slotMap).next; } - boneMap = if !bones.is_null() { - (*bones).child - } else { - std::ptr::null_mut() - }; + boneMap = if !bones.is_null() { (*bones).child } else { 0 as *mut Json }; while !boneMap.is_null() { let mut boneIndex: c_int = -(1 as c_int); i = 0 as c_int; @@ -20439,11 +23685,11 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( cleanUpTimelines(timelines); _spSkeletonJson_setError( self_0, - std::ptr::null_mut(), + 0 as *mut Json, b"Bone not found: \0" as *const u8 as *const c_char, (*boneMap).name, ); - return std::ptr::null_mut(); + return 0 as *mut spAnimation; } timelineMap = (*boneMap).child; while !timelineMap.is_null() { @@ -20463,11 +23709,8 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( c_int, c_int, c_int, - ) - -> *mut spRotateTimeline)( - frames_0, frames_0, boneIndex - )) - .super_0, + ) -> *mut spRotateTimeline)(frames_0, frames_0, boneIndex)) + .super_0, 0 as c_int as c_float, 1 as c_int as c_float, ), @@ -20477,8 +23720,11 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"translate\0" as *const u8 as *const c_char, ) == 0 as c_int { - let mut timeline_4: *mut spTranslateTimeline = - spTranslateTimeline_create(frames_0, frames_0 << 1 as c_int, boneIndex); + let mut timeline_4: *mut spTranslateTimeline = spTranslateTimeline_create( + frames_0, + frames_0 << 1 as c_int, + boneIndex, + ); spTimelineArray_add( timelines, readTimeline2Json( @@ -20495,8 +23741,11 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"translatex\0" as *const u8 as *const c_char, ) == 0 as c_int { - let mut timeline_5: *mut spTranslateXTimeline = - spTranslateXTimeline_create(frames_0, frames_0, boneIndex); + let mut timeline_5: *mut spTranslateXTimeline = spTranslateXTimeline_create( + frames_0, + frames_0, + boneIndex, + ); spTimelineArray_add( timelines, readTimelineJson( @@ -20511,8 +23760,11 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"translatey\0" as *const u8 as *const c_char, ) == 0 as c_int { - let mut timeline_6: *mut spTranslateYTimeline = - spTranslateYTimeline_create(frames_0, frames_0, boneIndex); + let mut timeline_6: *mut spTranslateYTimeline = spTranslateYTimeline_create( + frames_0, + frames_0, + boneIndex, + ); spTimelineArray_add( timelines, readTimelineJson( @@ -20527,8 +23779,11 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"scale\0" as *const u8 as *const c_char, ) == 0 as c_int { - let mut timeline_7: *mut spScaleTimeline = - spScaleTimeline_create(frames_0, frames_0 << 1 as c_int, boneIndex); + let mut timeline_7: *mut spScaleTimeline = spScaleTimeline_create( + frames_0, + frames_0 << 1 as c_int, + boneIndex, + ); spTimelineArray_add( timelines, readTimeline2Json( @@ -20545,8 +23800,11 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"scalex\0" as *const u8 as *const c_char, ) == 0 as c_int { - let mut timeline_8: *mut spScaleXTimeline = - spScaleXTimeline_create(frames_0, frames_0, boneIndex); + let mut timeline_8: *mut spScaleXTimeline = spScaleXTimeline_create( + frames_0, + frames_0, + boneIndex, + ); spTimelineArray_add( timelines, readTimelineJson( @@ -20561,8 +23819,11 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"scaley\0" as *const u8 as *const c_char, ) == 0 as c_int { - let mut timeline_9: *mut spScaleYTimeline = - spScaleYTimeline_create(frames_0, frames_0, boneIndex); + let mut timeline_9: *mut spScaleYTimeline = spScaleYTimeline_create( + frames_0, + frames_0, + boneIndex, + ); spTimelineArray_add( timelines, readTimelineJson( @@ -20577,8 +23838,11 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"shear\0" as *const u8 as *const c_char, ) == 0 as c_int { - let mut timeline_10: *mut spShearTimeline = - spShearTimeline_create(frames_0, frames_0 << 1 as c_int, boneIndex); + let mut timeline_10: *mut spShearTimeline = spShearTimeline_create( + frames_0, + frames_0 << 1 as c_int, + boneIndex, + ); spTimelineArray_add( timelines, readTimeline2Json( @@ -20595,8 +23859,11 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"shearx\0" as *const u8 as *const c_char, ) == 0 as c_int { - let mut timeline_11: *mut spShearXTimeline = - spShearXTimeline_create(frames_0, frames_0, boneIndex); + let mut timeline_11: *mut spShearXTimeline = spShearXTimeline_create( + frames_0, + frames_0, + boneIndex, + ); spTimelineArray_add( timelines, readTimelineJson( @@ -20611,8 +23878,11 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"sheary\0" as *const u8 as *const c_char, ) == 0 as c_int { - let mut timeline_12: *mut spShearYTimeline = - spShearYTimeline_create(frames_0, frames_0, boneIndex); + let mut timeline_12: *mut spShearYTimeline = spShearYTimeline_create( + frames_0, + frames_0, + boneIndex, + ); spTimelineArray_add( timelines, readTimelineJson( @@ -20622,46 +23892,115 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( 1 as c_int as c_float, ), ); + } else if spine_strcmp( + (*timelineMap).name, + b"inherit\0" as *const u8 as *const c_char, + ) == 0 as c_int + { + let mut timeline_13: *mut spInheritTimeline = spInheritTimeline_create( + frames_0, + boneIndex, + ); + keyMap = (*timelineMap).child; + frame = 0 as c_int; + loop { + let mut time_3: c_float = Json_getFloat( + keyMap, + b"time\0" as *const u8 as *const c_char, + 0 as c_int as c_float, + ); + let mut value: *const c_char = Json_getString( + keyMap, + b"value\0" as *const u8 as *const c_char, + b"normal\0" as *const u8 as *const c_char, + ); + let mut inherit: spInherit = SP_INHERIT_NORMAL; + if spine_strcmp( + value, + b"normal\0" as *const u8 as *const c_char, + ) == 0 as c_int + { + inherit = SP_INHERIT_NORMAL; + } else if spine_strcmp( + value, + b"onlyTranslation\0" as *const u8 as *const c_char, + ) == 0 as c_int + { + inherit = SP_INHERIT_ONLYTRANSLATION; + } else if spine_strcmp( + value, + b"noRotationOrReflection\0" as *const u8 + as *const c_char, + ) == 0 as c_int + { + inherit = SP_INHERIT_NOROTATIONORREFLECTION; + } else if spine_strcmp( + value, + b"noScale\0" as *const u8 as *const c_char, + ) == 0 as c_int + { + inherit = SP_INHERIT_NOSCALE; + } else if spine_strcmp( + value, + b"noScaleOrReflection\0" as *const u8 as *const c_char, + ) == 0 as c_int + { + inherit = SP_INHERIT_NOSCALEORREFLECTION; + } + spInheritTimeline_setFrame(timeline_13, frame, time_3, inherit); + nextMap = (*keyMap).next; + if nextMap.is_null() { + break; + } + frame += 1; + } + spTimelineArray_add(timelines, &mut (*timeline_13).super_0); } else { cleanUpTimelines(timelines); _spSkeletonJson_setError( self_0, - std::ptr::null_mut(), - b"Invalid timeline type for a bone: \0" as *const u8 as *const c_char, + 0 as *mut Json, + b"Invalid timeline type for a bone: \0" as *const u8 + as *const c_char, (*timelineMap).name, ); - return std::ptr::null_mut(); + return 0 as *mut spAnimation; } } timelineMap = (*timelineMap).next; } boneMap = (*boneMap).next; } - constraintMap = if !ik.is_null() { - (*ik).child - } else { - std::ptr::null_mut() - }; + constraintMap = if !ik.is_null() { (*ik).child } else { 0 as *mut Json }; while !constraintMap.is_null() { - let mut constraint: *mut spIkConstraintData = std::ptr::null_mut(); - let mut timeline_13: *mut spIkConstraintTimeline = std::ptr::null_mut(); + let mut constraint: *mut spIkConstraintData = 0 as *mut spIkConstraintData; + let mut timeline_14: *mut spIkConstraintTimeline = 0 + as *mut spIkConstraintTimeline; let mut constraintIndex: c_int = 0; - let mut time_3: c_float = 0.; + let mut time_4: c_float = 0.; let mut mix: c_float = 0.; let mut softness: c_float = 0.; keyMap = (*constraintMap).child; if !keyMap.is_null() { - constraint = spSkeletonData_findIkConstraint(skeletonData, (*constraintMap).name); - constraintIndex = findIkConstraintIndex(self_0, skeletonData, constraint, timelines); + constraint = spSkeletonData_findIkConstraint( + skeletonData, + (*constraintMap).name, + ); + constraintIndex = findIkConstraintIndex( + self_0, + skeletonData, + constraint, + timelines, + ); if constraintIndex == -(1 as c_int) { - return std::ptr::null_mut(); + return 0 as *mut spAnimation; } - timeline_13 = spIkConstraintTimeline_create( + timeline_14 = spIkConstraintTimeline_create( (*constraintMap).size, (*constraintMap).size << 1 as c_int, constraintIndex, ); - time_3 = Json_getFloat( + time_4 = Json_getFloat( keyMap, b"time\0" as *const u8 as *const c_char, 0 as c_int as c_float, @@ -20693,9 +24032,9 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( -(1 as c_int) }; spIkConstraintTimeline_setFrame( - timeline_13, + timeline_14, frame, - time_3, + time_4, mix, softness, bendDirection, @@ -20739,15 +24078,18 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"softness\0" as *const u8 as *const c_char, 0 as c_int as c_float, ) * scale; - curve = Json_getItem(keyMap, b"curve\0" as *const u8 as *const c_char); + curve = Json_getItem( + keyMap, + b"curve\0" as *const u8 as *const c_char, + ); if !curve.is_null() { bezier = readCurve( curve, - &mut (*timeline_13).super_0, + &mut (*timeline_14).super_0, bezier, frame, 0 as c_int, - time_3, + time_4, time2_3, mix, mix2, @@ -20755,37 +24097,39 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( ); bezier = readCurve( curve, - &mut (*timeline_13).super_0, + &mut (*timeline_14).super_0, bezier, frame, 1 as c_int, - time_3, + time_4, time2_3, softness, softness2, scale, ); } - time_3 = time2_3; + time_4 = time2_3; mix = mix2; softness = softness2; keyMap = nextMap; frame += 1; } - spTimelineArray_add(timelines, &mut (*timeline_13).super_0.super_0); + spTimelineArray_add(timelines, &mut (*timeline_14).super_0.super_0); } constraintMap = (*constraintMap).next; } constraintMap = if !transform.is_null() { (*transform).child } else { - std::ptr::null_mut() + 0 as *mut Json }; while !constraintMap.is_null() { - let mut constraint_0: *mut spTransformConstraintData = std::ptr::null_mut(); - let mut timeline_14: *mut spTransformConstraintTimeline = std::ptr::null_mut(); + let mut constraint_0: *mut spTransformConstraintData = 0 + as *mut spTransformConstraintData; + let mut timeline_15: *mut spTransformConstraintTimeline = 0 + as *mut spTransformConstraintTimeline; let mut constraintIndex_0: c_int = 0; - let mut time_4: c_float = 0.; + let mut time_5: c_float = 0.; let mut mixRotate: c_float = 0.; let mut mixShearY: c_float = 0.; let mut mixX: c_float = 0.; @@ -20794,19 +24138,25 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( let mut mixScaleY: c_float = 0.; keyMap = (*constraintMap).child; if !keyMap.is_null() { - constraint_0 = - spSkeletonData_findTransformConstraint(skeletonData, (*constraintMap).name); - constraintIndex_0 = - findTransformConstraintIndex(self_0, skeletonData, constraint_0, timelines); + constraint_0 = spSkeletonData_findTransformConstraint( + skeletonData, + (*constraintMap).name, + ); + constraintIndex_0 = findTransformConstraintIndex( + self_0, + skeletonData, + constraint_0, + timelines, + ); if constraintIndex_0 == -(1 as c_int) { - return std::ptr::null_mut(); + return 0 as *mut spAnimation; } - timeline_14 = spTransformConstraintTimeline_create( + timeline_15 = spTransformConstraintTimeline_create( (*constraintMap).size, (*constraintMap).size * 6 as c_int, constraintIndex_0, ); - time_4 = Json_getFloat( + time_5 = Json_getFloat( keyMap, b"time\0" as *const u8 as *const c_char, 0 as c_int as c_float, @@ -20826,7 +24176,11 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"mixX\0" as *const u8 as *const c_char, 1 as c_int as c_float, ); - mixY = Json_getFloat(keyMap, b"mixY\0" as *const u8 as *const c_char, mixX); + mixY = Json_getFloat( + keyMap, + b"mixY\0" as *const u8 as *const c_char, + mixX, + ); mixScaleX = Json_getFloat( keyMap, b"mixScaleX\0" as *const u8 as *const c_char, @@ -20848,9 +24202,9 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( let mut mixScaleX2: c_float = 0.; let mut mixScaleY2: c_float = 0.; spTransformConstraintTimeline_setFrame( - timeline_14, + timeline_15, frame, - time_4, + time_5, mixRotate, mixX, mixY, @@ -20882,7 +24236,11 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"mixX\0" as *const u8 as *const c_char, 1 as c_int as c_float, ); - mixY2 = Json_getFloat(nextMap, b"mixY\0" as *const u8 as *const c_char, mixX2); + mixY2 = Json_getFloat( + nextMap, + b"mixY\0" as *const u8 as *const c_char, + mixX2, + ); mixScaleX2 = Json_getFloat( nextMap, b"mixScaleX\0" as *const u8 as *const c_char, @@ -20893,15 +24251,18 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"mixScaleY\0" as *const u8 as *const c_char, mixScaleX2, ); - curve = Json_getItem(keyMap, b"curve\0" as *const u8 as *const c_char); + curve = Json_getItem( + keyMap, + b"curve\0" as *const u8 as *const c_char, + ); if !curve.is_null() { bezier = readCurve( curve, - &mut (*timeline_14).super_0, + &mut (*timeline_15).super_0, bezier, frame, 0 as c_int, - time_4, + time_5, time2_4, mixRotate, mixRotate2, @@ -20909,11 +24270,11 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( ); bezier = readCurve( curve, - &mut (*timeline_14).super_0, + &mut (*timeline_15).super_0, bezier, frame, 1 as c_int, - time_4, + time_5, time2_4, mixX, mixX2, @@ -20921,11 +24282,11 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( ); bezier = readCurve( curve, - &mut (*timeline_14).super_0, + &mut (*timeline_15).super_0, bezier, frame, 2 as c_int, - time_4, + time_5, time2_4, mixY, mixY2, @@ -20933,11 +24294,11 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( ); bezier = readCurve( curve, - &mut (*timeline_14).super_0, + &mut (*timeline_15).super_0, bezier, frame, 3 as c_int, - time_4, + time_5, time2_4, mixScaleX, mixScaleX2, @@ -20945,11 +24306,11 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( ); bezier = readCurve( curve, - &mut (*timeline_14).super_0, + &mut (*timeline_15).super_0, bezier, frame, 4 as c_int, - time_4, + time_5, time2_4, mixScaleY, mixScaleY2, @@ -20957,18 +24318,18 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( ); bezier = readCurve( curve, - &mut (*timeline_14).super_0, + &mut (*timeline_15).super_0, bezier, frame, 5 as c_int, - time_4, + time_5, time2_4, mixShearY, mixShearY2, 1 as c_int as c_float, ); } - time_4 = time2_4; + time_5 = time2_4; mixRotate = mixRotate2; mixX = mixX2; mixY = mixY2; @@ -20978,45 +24339,48 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( keyMap = nextMap; frame += 1; } - spTimelineArray_add(timelines, &mut (*timeline_14).super_0.super_0); + spTimelineArray_add(timelines, &mut (*timeline_15).super_0.super_0); } constraintMap = (*constraintMap).next; } - constraintMap = if !paths.is_null() { - (*paths).child - } else { - std::ptr::null_mut() - }; + constraintMap = if !paths.is_null() { (*paths).child } else { 0 as *mut Json }; while !constraintMap.is_null() { - let mut constraint_1: *mut spPathConstraintData = - spSkeletonData_findPathConstraint(skeletonData, (*constraintMap).name); - let mut constraintIndex_1: c_int = - findPathConstraintIndex(self_0, skeletonData, constraint_1, timelines); + let mut constraint_1: *mut spPathConstraintData = spSkeletonData_findPathConstraint( + skeletonData, + (*constraintMap).name, + ); + let mut constraintIndex_1: c_int = findPathConstraintIndex( + self_0, + skeletonData, + constraint_1, + timelines, + ); if constraintIndex_1 == -(1 as c_int) { - return std::ptr::null_mut(); + return 0 as *mut spAnimation; } timelineMap = (*constraintMap).child; while !timelineMap.is_null() { - let mut timelineName: *const c_char = std::ptr::null(); + let mut timelineName: *const c_char = 0 as *const c_char; let mut frames_1: c_int = 0; keyMap = (*timelineMap).child; if !keyMap.is_null() { frames_1 = (*timelineMap).size; timelineName = (*timelineMap).name; - if spine_strcmp(timelineName, b"position\0" as *const u8 as *const c_char) - == 0 as c_int + if spine_strcmp( + timelineName, + b"position\0" as *const u8 as *const c_char, + ) == 0 as c_int { - let mut timeline_15: *mut spPathConstraintPositionTimeline = - spPathConstraintPositionTimeline_create( - frames_1, - frames_1, - constraintIndex_1, - ); + let mut timeline_16: *mut spPathConstraintPositionTimeline = spPathConstraintPositionTimeline_create( + frames_1, + frames_1, + constraintIndex_1, + ); spTimelineArray_add( timelines, readTimelineJson( keyMap, - &mut (*timeline_15).super_0, + &mut (*timeline_16).super_0, 0 as c_int as c_float, if (*constraint_1).positionMode as c_uint == SP_POSITION_MODE_FIXED as c_int as c_uint @@ -21027,27 +24391,27 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( }, ), ); - } else if spine_strcmp(timelineName, b"spacing\0" as *const u8 as *const c_char) - == 0 as c_int + } else if spine_strcmp( + timelineName, + b"spacing\0" as *const u8 as *const c_char, + ) == 0 as c_int { - let mut timeline_16: *mut spCurveTimeline1 = - &mut (*(spPathConstraintSpacingTimeline_create - as unsafe extern "C" fn( - c_int, - c_int, - c_int, - ) - -> *mut spPathConstraintSpacingTimeline)( - frames_1, - frames_1, - constraintIndex_1, - )) + let mut timeline_17: *mut spCurveTimeline1 = &mut (*(spPathConstraintSpacingTimeline_create + as unsafe extern "C" fn( + c_int, + c_int, + c_int, + ) -> *mut spPathConstraintSpacingTimeline)( + frames_1, + frames_1, + constraintIndex_1, + )) .super_0; spTimelineArray_add( timelines, readTimelineJson( keyMap, - timeline_16, + timeline_17, 0 as c_int as c_float, if (*constraint_1).spacingMode as c_uint == SP_SPACING_MODE_LENGTH as c_int as c_uint @@ -21060,16 +24424,17 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( }, ), ); - } else if spine_strcmp(timelineName, b"mix\0" as *const u8 as *const c_char) - == 0 as c_int + } else if spine_strcmp( + timelineName, + b"mix\0" as *const u8 as *const c_char, + ) == 0 as c_int { - let mut timeline_17: *mut spPathConstraintMixTimeline = - spPathConstraintMixTimeline_create( - frames_1, - frames_1 * 3 as c_int, - constraintIndex_1, - ); - let mut time_5: c_float = Json_getFloat( + let mut timeline_18: *mut spPathConstraintMixTimeline = spPathConstraintMixTimeline_create( + frames_1, + frames_1 * 3 as c_int, + constraintIndex_1, + ); + let mut time_6: c_float = Json_getFloat( keyMap, b"time\0" as *const u8 as *const c_char, 0 as c_int as c_float, @@ -21084,8 +24449,11 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"mixX\0" as *const u8 as *const c_char, 1 as c_int as c_float, ); - let mut mixY_0: c_float = - Json_getFloat(keyMap, b"mixY\0" as *const u8 as *const c_char, mixX_0); + let mut mixY_0: c_float = Json_getFloat( + keyMap, + b"mixY\0" as *const u8 as *const c_char, + mixX_0, + ); frame = 0 as c_int; bezier = 0 as c_int; loop { @@ -21094,9 +24462,9 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( let mut mixX2_0: c_float = 0.; let mut mixY2_0: c_float = 0.; spPathConstraintMixTimeline_setFrame( - timeline_17, + timeline_18, frame, - time_5, + time_6, mixRotate_0, mixX_0, mixY_0, @@ -21125,15 +24493,18 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"mixY\0" as *const u8 as *const c_char, mixX2_0, ); - curve = Json_getItem(keyMap, b"curve\0" as *const u8 as *const c_char); + curve = Json_getItem( + keyMap, + b"curve\0" as *const u8 as *const c_char, + ); if !curve.is_null() { bezier = readCurve( curve, - &mut (*timeline_17).super_0, + &mut (*timeline_18).super_0, bezier, frame, 0 as c_int, - time_5, + time_6, time2_5, mixRotate_0, mixRotate2_0, @@ -21141,11 +24512,11 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( ); bezier = readCurve( curve, - &mut (*timeline_17).super_0, + &mut (*timeline_18).super_0, bezier, frame, 1 as c_int, - time_5, + time_6, time2_5, mixX_0, mixX2_0, @@ -21153,25 +24524,186 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( ); bezier = readCurve( curve, - &mut (*timeline_17).super_0, + &mut (*timeline_18).super_0, bezier, frame, 2 as c_int, - time_5, + time_6, time2_5, mixY_0, mixY2_0, 1 as c_int as c_float, ); } - time_5 = time2_5; + time_6 = time2_5; mixRotate_0 = mixRotate2_0; mixX_0 = mixX2_0; mixY_0 = mixY2_0; keyMap = nextMap; frame += 1; } - spTimelineArray_add(timelines, &mut (*timeline_17).super_0.super_0); + spTimelineArray_add(timelines, &mut (*timeline_18).super_0.super_0); + } + } + timelineMap = (*timelineMap).next; + } + constraintMap = (*constraintMap).next; + } + constraintMap = if !physics.is_null() { (*physics).child } else { 0 as *mut Json }; + while !constraintMap.is_null() { + let mut index: c_int = -(1 as c_int); + if !((*constraintMap).name).is_null() + && spine_strlen((*constraintMap).name) > 0 as c_int as c_ulong + { + let mut constraint_2: *mut spPhysicsConstraintData = spSkeletonData_findPhysicsConstraint( + skeletonData, + (*constraintMap).name, + ); + index = findPhysicsConstraintIndex( + self_0, + skeletonData, + constraint_2, + timelines, + ); + if index == -(1 as c_int) { + return 0 as *mut spAnimation; + } + } + let mut current_block_322: u64; + timelineMap = (*constraintMap).child; + while !timelineMap.is_null() { + keyMap = (*timelineMap).child; + if !keyMap.is_null() { + let mut timelineName_0: *const c_char = (*timelineMap).name; + let mut frames_2: c_int = (*timelineMap).size; + if spine_strcmp( + timelineName_0, + b"reset\0" as *const u8 as *const c_char, + ) == 0 as c_int + { + let mut timeline_19: *mut spPhysicsConstraintResetTimeline = spPhysicsConstraintResetTimeline_create( + frames_2, + index, + ); + frame = 0 as c_int; + while !keyMap.is_null() { + spPhysicsConstraintResetTimeline_setFrame( + timeline_19, + frame, + Json_getFloat( + keyMap, + b"time\0" as *const u8 as *const c_char, + 0 as c_int as c_float, + ), + ); + keyMap = (*keyMap).next; + frame += 1; + } + spTimelineArray_add(timelines, &mut (*timeline_19).super_0); + } else { + let mut timeline_20: *mut spPhysicsConstraintTimeline = 0 + as *mut spPhysicsConstraintTimeline; + if spine_strcmp( + timelineName_0, + b"inertia\0" as *const u8 as *const c_char, + ) == 0 as c_int + { + timeline_20 = spPhysicsConstraintTimeline_create( + frames_2, + frames_2, + index, + SP_TIMELINE_PHYSICSCONSTRAINT_INERTIA, + ); + current_block_322 = 2197125908392311113; + } else if spine_strcmp( + timelineName_0, + b"strength\0" as *const u8 as *const c_char, + ) == 0 as c_int + { + timeline_20 = spPhysicsConstraintTimeline_create( + frames_2, + frames_2, + index, + SP_TIMELINE_PHYSICSCONSTRAINT_STRENGTH, + ); + current_block_322 = 2197125908392311113; + } else if spine_strcmp( + timelineName_0, + b"damping\0" as *const u8 as *const c_char, + ) == 0 as c_int + { + timeline_20 = spPhysicsConstraintTimeline_create( + frames_2, + frames_2, + index, + SP_TIMELINE_PHYSICSCONSTRAINT_DAMPING, + ); + current_block_322 = 2197125908392311113; + } else if spine_strcmp( + timelineName_0, + b"mass\0" as *const u8 as *const c_char, + ) == 0 as c_int + { + timeline_20 = spPhysicsConstraintTimeline_create( + frames_2, + frames_2, + index, + SP_TIMELINE_PHYSICSCONSTRAINT_MASS, + ); + current_block_322 = 2197125908392311113; + } else if spine_strcmp( + timelineName_0, + b"wind\0" as *const u8 as *const c_char, + ) == 0 as c_int + { + timeline_20 = spPhysicsConstraintTimeline_create( + frames_2, + frames_2, + index, + SP_TIMELINE_PHYSICSCONSTRAINT_WIND, + ); + current_block_322 = 2197125908392311113; + } else if spine_strcmp( + timelineName_0, + b"gravity\0" as *const u8 as *const c_char, + ) == 0 as c_int + { + timeline_20 = spPhysicsConstraintTimeline_create( + frames_2, + frames_2, + index, + SP_TIMELINE_PHYSICSCONSTRAINT_GRAVITY, + ); + current_block_322 = 2197125908392311113; + } else if spine_strcmp( + timelineName_0, + b"mix\0" as *const u8 as *const c_char, + ) == 0 as c_int + { + timeline_20 = spPhysicsConstraintTimeline_create( + frames_2, + frames_2, + index, + SP_TIMELINE_PHYSICSCONSTRAINT_MIX, + ); + current_block_322 = 2197125908392311113; + } else { + current_block_322 = 2014163327383235100; + } + match current_block_322 { + 2014163327383235100 => {} + _ => { + spTimelineArray_add( + timelines, + readTimelineJson( + keyMap, + &mut (*timeline_20).super_0, + 0 as c_int as c_float, + 1 as c_int as c_float, + ), + ); + } + } } } timelineMap = (*timelineMap).next; @@ -21181,54 +24713,71 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( attachmentsMap = if !attachmentsJson.is_null() { (*attachmentsJson).child } else { - std::ptr::null_mut() + 0 as *mut Json }; while !attachmentsMap.is_null() { - let mut skin: *mut spSkin = spSkeletonData_findSkin(skeletonData, (*attachmentsMap).name); + let mut skin: *mut spSkin = spSkeletonData_findSkin( + skeletonData, + (*attachmentsMap).name, + ); slotMap = (*attachmentsMap).child; while !slotMap.is_null() { - let mut attachmentMap: *mut Json = std::ptr::null_mut(); - let mut slotIndex_0: c_int = - findSlotIndex(self_0, skeletonData, (*slotMap).name, timelines); + let mut attachmentMap: *mut Json = 0 as *mut Json; + let mut slotIndex_0: c_int = findSlotIndex( + self_0, + skeletonData, + (*slotMap).name, + timelines, + ); if slotIndex_0 == -(1 as c_int) { - return std::ptr::null_mut(); + return 0 as *mut spAnimation; } attachmentMap = (*slotMap).child; while !attachmentMap.is_null() { - let mut baseAttachment: *mut spAttachment = - spSkin_getAttachment(skin, slotIndex_0, (*attachmentMap).name); + let mut baseAttachment: *mut spAttachment = spSkin_getAttachment( + skin, + slotIndex_0, + (*attachmentMap).name, + ); if baseAttachment.is_null() { cleanUpTimelines(timelines); _spSkeletonJson_setError( self_0, - std::ptr::null_mut(), + 0 as *mut Json, b"Attachment not found: \0" as *const u8 as *const c_char, (*attachmentMap).name, ); - return std::ptr::null_mut(); + return 0 as *mut spAnimation; } timelineMap = (*attachmentMap).child; while !timelineMap.is_null() { - let mut frames_2: c_int = 0; - let mut timelineName_0: *const c_char = std::ptr::null(); + let mut frames_3: c_int = 0; + let mut timelineName_1: *const c_char = 0 + as *const c_char; keyMap = (*timelineMap).child; if !keyMap.is_null() { - frames_2 = (*timelineMap).size; - timelineName_0 = (*timelineMap).name; - if spine_strcmp(b"deform\0" as *const u8 as *const c_char, timelineName_0) - == 0 + frames_3 = (*timelineMap).size; + timelineName_1 = (*timelineMap).name; + if spine_strcmp( + b"deform\0" as *const u8 as *const c_char, + timelineName_1, + ) == 0 { - let mut tempDeform: *mut c_float = std::ptr::null_mut(); - let mut vertexAttachment: *mut spVertexAttachment = - std::ptr::null_mut(); + let mut tempDeform: *mut c_float = 0 + as *mut c_float; + let mut vertexAttachment: *mut spVertexAttachment = 0 + as *mut spVertexAttachment; let mut weighted: c_int = 0; let mut deformLength: c_int = 0; - let mut timeline_18: *mut spDeformTimeline = std::ptr::null_mut(); - let mut time_6: c_float = 0.; + let mut timeline_21: *mut spDeformTimeline = 0 + as *mut spDeformTimeline; + let mut time_7: c_float = 0.; vertexAttachment = baseAttachment as *mut spVertexAttachment; - weighted = ((*vertexAttachment).bones != std::ptr::null_mut()) as c_int; + weighted = ((*vertexAttachment).bones + != 0 as *mut c_int) as c_int; deformLength = if weighted != 0 { - (*vertexAttachment).verticesCount / 3 as c_int * 2 as c_int + (*vertexAttachment).verticesCount / 3 as c_int + * 2 as c_int } else { (*vertexAttachment).verticesCount }; @@ -21236,16 +24785,16 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( (::core::mem::size_of::() as c_ulong) .wrapping_mul(deformLength as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 11375 as c_int, + 12171 as c_int, ) as *mut c_float; - timeline_18 = spDeformTimeline_create( + timeline_21 = spDeformTimeline_create( (*timelineMap).size, deformLength, (*timelineMap).size, slotIndex_0, vertexAttachment, ); - time_6 = Json_getFloat( + time_7 = Json_getFloat( keyMap, b"time\0" as *const u8 as *const c_char, 0 as c_int as c_float, @@ -21257,7 +24806,8 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( keyMap, b"vertices\0" as *const u8 as *const c_char, ); - let mut deform: *mut c_float = std::ptr::null_mut(); + let mut deform: *mut c_float = 0 + as *mut c_float; let mut time2_6: c_float = 0.; if vertices.is_null() { if weighted != 0 { @@ -21278,7 +24828,7 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"offset\0" as *const u8 as *const c_char, 0 as c_int, ); - let mut vertex: *mut Json = std::ptr::null_mut(); + let mut vertex: *mut Json = 0 as *mut Json; deform = tempDeform; spine_memset( deform as *mut c_void, @@ -21298,8 +24848,10 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( vertex = (*vertices).child; v = start; while !vertex.is_null() { - *deform.offset(v as isize) = - (*vertex).valueFloat * (*self_0).scale; + *deform + .offset( + v as isize, + ) = (*vertex).valueFloat * (*self_0).scale; vertex = (*vertex).next; v += 1; } @@ -21311,17 +24863,22 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( .wrapping_mul((deformLength - v) as c_ulong), ); if weighted == 0 { - let mut verticesValues: *mut c_float = - (*vertexAttachment).vertices; + let mut verticesValues: *mut c_float = (*vertexAttachment) + .vertices; v = 0 as c_int; while v < deformLength { - *deform.offset(v as isize) += - *verticesValues.offset(v as isize); + *deform.offset(v as isize) + += *verticesValues.offset(v as isize); v += 1; } } } - spDeformTimeline_setFrame(timeline_18, frame, time_6, deform); + spDeformTimeline_setFrame( + timeline_21, + frame, + time_7, + deform, + ); nextMap = (*keyMap).next; if nextMap.is_null() { break; @@ -21331,36 +24888,45 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"time\0" as *const u8 as *const c_char, 0 as c_int as c_float, ); - curve = - Json_getItem(keyMap, b"curve\0" as *const u8 as *const c_char); + curve = Json_getItem( + keyMap, + b"curve\0" as *const u8 as *const c_char, + ); if !curve.is_null() { bezier = readCurve( curve, - &mut (*timeline_18).super_0, + &mut (*timeline_21).super_0, bezier, frame, 0 as c_int, - time_6, + time_7, time2_6, 0 as c_int as c_float, 1 as c_int as c_float, 1 as c_int as c_float, ); } - time_6 = time2_6; + time_7 = time2_6; keyMap = nextMap; frame += 1; } _spFree(tempDeform as *mut c_void); - spTimelineArray_add(timelines, &mut (*timeline_18).super_0.super_0); + spTimelineArray_add( + timelines, + &mut (*timeline_21).super_0.super_0, + ); } else if spine_strcmp( - timelineName_0, + timelineName_1, b"sequence\0" as *const u8 as *const c_char, ) == 0 { - let mut timeline_19: *mut spSequenceTimeline = - spSequenceTimeline_create(frames_2, slotIndex_0, baseAttachment); - let mut lastDelay: c_float = 0 as c_int as c_float; + let mut timeline_22: *mut spSequenceTimeline = spSequenceTimeline_create( + frames_3, + slotIndex_0, + baseAttachment, + ); + let mut lastDelay: c_float = 0 as c_int + as c_float; frame = 0 as c_int; while !keyMap.is_null() { let mut delay: c_float = Json_getFloat( @@ -21368,7 +24934,7 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"delay\0" as *const u8 as *const c_char, lastDelay, ); - let mut time_7: c_float = Json_getFloat( + let mut time_8: c_float = Json_getFloat( keyMap, b"time\0" as *const u8 as *const c_char, 0 as c_int as c_float, @@ -21378,19 +24944,23 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( b"mode\0" as *const u8 as *const c_char, b"hold\0" as *const u8 as *const c_char, ); - let mut index: c_int = Json_getInt( + let mut index_0: c_int = Json_getInt( keyMap, b"index\0" as *const u8 as *const c_char, 0 as c_int, ); let mut mode: c_int = 0 as c_int; - if spine_strcmp(modeString, b"once\0" as *const u8 as *const c_char) - == 0 + if spine_strcmp( + modeString, + b"once\0" as *const u8 as *const c_char, + ) == 0 { mode = 1 as c_int; } - if spine_strcmp(modeString, b"loop\0" as *const u8 as *const c_char) - == 0 + if spine_strcmp( + modeString, + b"loop\0" as *const u8 as *const c_char, + ) == 0 { mode = 2 as c_int; } @@ -21423,18 +24993,18 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( mode = 6 as c_int; } spSequenceTimeline_setFrame( - timeline_19, + timeline_22, frame, - time_7, + time_8, mode, - index, + index_0, delay, ); lastDelay = delay; keyMap = (*keyMap).next; frame += 1; } - spTimelineArray_add(timelines, &mut (*timeline_19).super_0); + spTimelineArray_add(timelines, &mut (*timeline_22).super_0); } } timelineMap = (*timelineMap).next; @@ -21446,22 +25016,29 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( attachmentsMap = (*attachmentsMap).next; } if !drawOrderJson.is_null() { - let mut timeline_20: *mut spDrawOrderTimeline = - spDrawOrderTimeline_create((*drawOrderJson).size, (*skeletonData).slotsCount); + let mut timeline_23: *mut spDrawOrderTimeline = spDrawOrderTimeline_create( + (*drawOrderJson).size, + (*skeletonData).slotsCount, + ); keyMap = (*drawOrderJson).child; frame = 0 as c_int; while !keyMap.is_null() { let mut ii: c_int = 0; - let mut drawOrder: *mut c_int = std::ptr::null_mut(); - let mut offsets: *mut Json = - Json_getItem(keyMap, b"offsets\0" as *const u8 as *const c_char); + let mut drawOrder: *mut c_int = 0 as *mut c_int; + let mut offsets: *mut Json = Json_getItem( + keyMap, + b"offsets\0" as *const u8 as *const c_char, + ); if !offsets.is_null() { - let mut offsetMap: *mut Json = std::ptr::null_mut(); + let mut offsetMap: *mut Json = 0 as *mut Json; let mut unchanged: *mut c_int = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul(((*skeletonData).slotsCount - (*offsets).size) as c_ulong), + .wrapping_mul( + ((*skeletonData).slotsCount - (*offsets).size) + as c_ulong, + ), b"spine.c\0" as *const u8 as *const c_char, - 11463 as c_int, + 12259 as c_int, ) as *mut c_int; let mut originalIndex: c_int = 0 as c_int; let mut unchangedIndex: c_int = 0 as c_int; @@ -21469,7 +25046,7 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( (::core::mem::size_of::() as c_ulong) .wrapping_mul((*skeletonData).slotsCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 11466 as c_int, + 12262 as c_int, ) as *mut c_int; ii = (*skeletonData).slotsCount - 1 as c_int; while ii >= 0 as c_int { @@ -21484,50 +25061,54 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( Json_getString( offsetMap, b"slot\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ), timelines, ); if slotIndex_1 == -(1 as c_int) { - return std::ptr::null_mut(); + return 0 as *mut spAnimation; } while originalIndex != slotIndex_1 { - let fresh175 = originalIndex; + let fresh131 = originalIndex; originalIndex = originalIndex + 1; - let fresh176 = unchangedIndex; + let fresh132 = unchangedIndex; unchangedIndex = unchangedIndex + 1; - *unchanged.offset(fresh176 as isize) = fresh175; + *unchanged.offset(fresh132 as isize) = fresh131; } - *drawOrder.offset( - (originalIndex - + Json_getInt( - offsetMap, - b"offset\0" as *const u8 as *const c_char, - 0 as c_int, - )) as isize, - ) = originalIndex; + *drawOrder + .offset( + (originalIndex + + Json_getInt( + offsetMap, + b"offset\0" as *const u8 as *const c_char, + 0 as c_int, + )) as isize, + ) = originalIndex; originalIndex += 1; offsetMap = (*offsetMap).next; } while originalIndex < (*skeletonData).slotsCount { - let fresh177 = originalIndex; + let fresh133 = originalIndex; originalIndex = originalIndex + 1; - let fresh178 = unchangedIndex; + let fresh134 = unchangedIndex; unchangedIndex = unchangedIndex + 1; - *unchanged.offset(fresh178 as isize) = fresh177; + *unchanged.offset(fresh134 as isize) = fresh133; } ii = (*skeletonData).slotsCount - 1 as c_int; while ii >= 0 as c_int { if *drawOrder.offset(ii as isize) == -(1 as c_int) { unchangedIndex -= 1; - *drawOrder.offset(ii as isize) = *unchanged.offset(unchangedIndex as isize); + *drawOrder + .offset( + ii as isize, + ) = *unchanged.offset(unchangedIndex as isize); } ii -= 1; } _spFree(unchanged as *mut c_void); } spDrawOrderTimeline_setFrame( - timeline_20, + timeline_23, frame, Json_getFloat( keyMap, @@ -21540,36 +25121,38 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( keyMap = (*keyMap).next; frame += 1; } - spTimelineArray_add(timelines, &mut (*timeline_20).super_0); + spTimelineArray_add(timelines, &mut (*timeline_23).super_0); } if !events.is_null() { - let mut timeline_21: *mut spEventTimeline = spEventTimeline_create((*events).size); + let mut timeline_24: *mut spEventTimeline = spEventTimeline_create( + (*events).size, + ); keyMap = (*events).child; frame = 0 as c_int; while !keyMap.is_null() { - let mut event: *mut spEvent = std::ptr::null_mut(); - let mut stringValue: *const c_char = std::ptr::null(); + let mut event: *mut spEvent = 0 as *mut spEvent; + let mut stringValue: *const c_char = 0 as *const c_char; let mut eventData: *mut spEventData = spSkeletonData_findEvent( skeletonData, Json_getString( keyMap, b"name\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ), ); if eventData.is_null() { cleanUpTimelines(timelines); _spSkeletonJson_setError( self_0, - std::ptr::null_mut(), + 0 as *mut Json, b"Event not found: \0" as *const u8 as *const c_char, Json_getString( keyMap, b"name\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ), ); - return std::ptr::null_mut(); + return 0 as *mut spAnimation; } event = spEvent_create( Json_getFloat( @@ -21579,12 +25162,14 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( ), eventData, ); - (*event).intValue = Json_getInt( + (*event) + .intValue = Json_getInt( keyMap, b"int\0" as *const u8 as *const c_char, (*eventData).intValue, ); - (*event).floatValue = Json_getFloat( + (*event) + .floatValue = Json_getFloat( keyMap, b"float\0" as *const u8 as *const c_char, (*eventData).floatValue, @@ -21595,40 +25180,45 @@ unsafe extern "C" fn _spSkeletonJson_readAnimation( (*eventData).stringValue, ); if !stringValue.is_null() { - let ref mut fresh179 = - *(&mut (*event).stringValue as *mut *const c_char as *mut *mut c_char); - *fresh179 = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul( - (spine_strlen(stringValue)).wrapping_add(1 as c_int as c_ulong), - ), + (*event) + .stringValue = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul( + (spine_strlen(stringValue)) + .wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 11512 as c_int, + 12308 as c_int, ) as *mut c_char; - spine_strcpy(*fresh179, stringValue); + spine_strcpy((*event).stringValue, stringValue); } if !((*eventData).audioPath).is_null() { - (*event).volume = Json_getFloat( + (*event) + .volume = Json_getFloat( keyMap, b"volume\0" as *const u8 as *const c_char, 1 as c_int as c_float, ); - (*event).balance = Json_getFloat( + (*event) + .balance = Json_getFloat( keyMap, b"volume\0" as *const u8 as *const c_char, 0 as c_int as c_float, ); } - spEventTimeline_setFrame(timeline_21, frame, event); + spEventTimeline_setFrame(timeline_24, frame, event); keyMap = (*keyMap).next; frame += 1; } - spTimelineArray_add(timelines, &mut (*timeline_21).super_0); + spTimelineArray_add(timelines, &mut (*timeline_24).super_0); } duration = 0 as c_int as c_float; i = 0 as c_int; n = (*timelines).size; while i < n { - duration = if duration > spTimeline_getDuration(*((*timelines).items).offset(i as isize)) { + duration = if duration + > spTimeline_getDuration(*((*timelines).items).offset(i as isize)) + { duration } else { spTimeline_getDuration(*((*timelines).items).offset(i as isize)) @@ -21643,21 +25233,25 @@ unsafe extern "C" fn _readVerticesJson( mut attachment: *mut spVertexAttachment, mut verticesLength: c_int, ) { - let mut entry: *mut Json = std::ptr::null_mut(); - let mut vertices: *mut c_float = std::ptr::null_mut(); + let mut entry: *mut Json = 0 as *mut Json; + let mut vertices: *mut c_float = 0 as *mut c_float; let mut i: c_int = 0; let mut n: c_int = 0; let mut nn: c_int = 0; let mut entrySize: c_int = 0; - let mut weights: *mut spFloatArray = std::ptr::null_mut(); - let mut bones: *mut spIntArray = std::ptr::null_mut(); + let mut weights: *mut spFloatArray = 0 as *mut spFloatArray; + let mut bones: *mut spIntArray = 0 as *mut spIntArray; (*attachment).worldVerticesLength = verticesLength; - entry = Json_getItem(attachmentMap, b"vertices\0" as *const u8 as *const c_char); + entry = Json_getItem( + attachmentMap, + b"vertices\0" as *const u8 as *const c_char, + ); entrySize = (*entry).size; vertices = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul(entrySize as c_ulong), + (::core::mem::size_of::() as c_ulong) + .wrapping_mul(entrySize as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 11540 as c_int, + 12336 as c_int, ) as *mut c_float; entry = (*entry).child; i = 0 as c_int; @@ -21677,7 +25271,7 @@ unsafe extern "C" fn _readVerticesJson( (*attachment).verticesCount = verticesLength; (*attachment).vertices = vertices; (*attachment).bonesCount = 0 as c_int; - (*attachment).bones = std::ptr::null_mut(); + (*attachment).bones = 0 as *mut c_int; return; } weights = spFloatArray_create(verticesLength * 3 as c_int * 3 as c_int); @@ -21685,9 +25279,10 @@ unsafe extern "C" fn _readVerticesJson( i = 0 as c_int; n = entrySize; while i < n { - let fresh180 = i; + let fresh135 = i; i = i + 1; - let mut boneCount: c_int = *vertices.offset(fresh180 as isize) as c_int; + let mut boneCount: c_int = *vertices.offset(fresh135 as isize) + as c_int; spIntArray_add(bones, boneCount); nn = i + boneCount * 4 as c_int; while i < nn { @@ -21718,16 +25313,16 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonDataFile( mut path: *const c_char, ) -> *mut spSkeletonData { let mut length: c_int = 0; - let mut skeletonData: *mut spSkeletonData = std::ptr::null_mut(); + let mut skeletonData: *mut spSkeletonData = 0 as *mut spSkeletonData; let mut json: *const c_char = _spUtil_readFile(path, &mut length); if length == 0 as c_int || json.is_null() { _spSkeletonJson_setError( self_0, - std::ptr::null_mut(), + 0 as *mut Json, b"Unable to read skeleton file: \0" as *const u8 as *const c_char, path, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } skeletonData = spSkeletonJson_readSkeletonData(self_0, json); _spFree(json as *mut c_void); @@ -21750,7 +25345,9 @@ unsafe extern "C" fn string_starts_with_json( } i = 0 as c_int; while i < lenNeedle { - if *str.offset(i as isize) as c_int != *needle.offset(i as isize) as c_int { + if *str.offset(i as isize) as c_int + != *needle.offset(i as isize) as c_int + { return 0 as c_int; } i += 1; @@ -21764,74 +25361,78 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( ) -> *mut spSkeletonData { let mut i: c_int = 0; let mut ii: c_int = 0; - let mut skeletonData: *mut spSkeletonData = std::ptr::null_mut(); - let mut root: *mut Json = std::ptr::null_mut(); - let mut skeleton: *mut Json = std::ptr::null_mut(); - let mut bones: *mut Json = std::ptr::null_mut(); - let mut boneMap: *mut Json = std::ptr::null_mut(); - let mut ik: *mut Json = std::ptr::null_mut(); - let mut transform: *mut Json = std::ptr::null_mut(); - let mut pathJson: *mut Json = std::ptr::null_mut(); - let mut slots: *mut Json = std::ptr::null_mut(); - let mut skins: *mut Json = std::ptr::null_mut(); - let mut animations: *mut Json = std::ptr::null_mut(); - let mut events: *mut Json = std::ptr::null_mut(); + let mut skeletonData: *mut spSkeletonData = 0 as *mut spSkeletonData; + let mut root: *mut Json = 0 as *mut Json; + let mut skeleton: *mut Json = 0 as *mut Json; + let mut bones: *mut Json = 0 as *mut Json; + let mut boneMap: *mut Json = 0 as *mut Json; + let mut ik: *mut Json = 0 as *mut Json; + let mut transform: *mut Json = 0 as *mut Json; + let mut pathJson: *mut Json = 0 as *mut Json; + let mut physics: *mut Json = 0 as *mut Json; + let mut slots: *mut Json = 0 as *mut Json; + let mut skins: *mut Json = 0 as *mut Json; + let mut animations: *mut Json = 0 as *mut Json; + let mut events: *mut Json = 0 as *mut Json; let mut internal: *mut _spSkeletonJson = self_0 as *mut _spSkeletonJson; _spFree((*self_0).error as *mut c_void); - let ref mut fresh181 = *(&mut (*self_0).error as *mut *mut c_char); - *fresh181 = std::ptr::null_mut(); + (*self_0).error = 0 as *mut c_char; (*internal).linkedMeshCount = 0 as c_int; root = Json_create(json); if root.is_null() { _spSkeletonJson_setError( self_0, - std::ptr::null_mut(), + 0 as *mut Json, b"Invalid skeleton JSON: \0" as *const u8 as *const c_char, Json_getError(), ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } skeletonData = spSkeletonData_create(); skeleton = Json_getItem(root, b"skeleton\0" as *const u8 as *const c_char); if !skeleton.is_null() { - let ref mut fresh182 = - *(&mut (*skeletonData).hash as *mut *const c_char as *mut *mut c_char); - *fresh182 = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul( - (spine_strlen(Json_getString( - skeleton, - b"hash\0" as *const u8 as *const c_char, - b"0\0" as *const u8 as *const c_char, - ))) - .wrapping_add(1 as c_int as c_ulong), - ), + (*skeletonData) + .hash = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul( + (spine_strlen( + Json_getString( + skeleton, + b"hash\0" as *const u8 as *const c_char, + b"0\0" as *const u8 as *const c_char, + ), + )) + .wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 11625 as c_int, + 12449 as c_int, ) as *mut c_char; spine_strcpy( - *fresh182, + (*skeletonData).hash, Json_getString( skeleton, b"hash\0" as *const u8 as *const c_char, b"0\0" as *const u8 as *const c_char, ), ); - let ref mut fresh183 = - *(&mut (*skeletonData).version as *mut *const c_char as *mut *mut c_char); - *fresh183 = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul( - (spine_strlen(Json_getString( - skeleton, - b"spine\0" as *const u8 as *const c_char, - b"0\0" as *const u8 as *const c_char, - ))) - .wrapping_add(1 as c_int as c_ulong), - ), + (*skeletonData) + .version = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul( + (spine_strlen( + Json_getString( + skeleton, + b"spine\0" as *const u8 as *const c_char, + b"0\0" as *const u8 as *const c_char, + ), + )) + .wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 11626 as c_int, + 12450 as c_int, ) as *mut c_char; spine_strcpy( - *fresh183, + (*skeletonData).version, Json_getString( skeleton, b"spine\0" as *const u8 as *const c_char, @@ -21840,105 +25441,122 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( ); if string_starts_with_json( (*skeletonData).version, - b"4.1\0" as *const u8 as *const c_char, + b"4.2\0" as *const u8 as *const c_char, ) == 0 { let mut errorMsg: [c_char; 255] = [0; 255]; - spine_sprintf!( + snprintf( errorMsg.as_mut_ptr(), + 255 as c_int as c_ulong, b"Skeleton version %s does not match runtime version %s\0" as *const u8 as *const c_char, (*skeletonData).version, - b"4.1\0" as *const u8 as *const c_char, + b"4.2\0" as *const u8 as *const c_char, ); _spSkeletonJson_setError( self_0, - std::ptr::null_mut(), + 0 as *mut Json, errorMsg.as_mut_ptr(), - std::ptr::null(), + 0 as *const c_char, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } - (*skeletonData).x = Json_getFloat( + (*skeletonData) + .x = Json_getFloat( skeleton, b"x\0" as *const u8 as *const c_char, 0 as c_int as c_float, ); - (*skeletonData).y = Json_getFloat( + (*skeletonData) + .y = Json_getFloat( skeleton, b"y\0" as *const u8 as *const c_char, 0 as c_int as c_float, ); - (*skeletonData).width = Json_getFloat( + (*skeletonData) + .width = Json_getFloat( skeleton, b"width\0" as *const u8 as *const c_char, 0 as c_int as c_float, ); - (*skeletonData).height = Json_getFloat( + (*skeletonData) + .height = Json_getFloat( skeleton, b"height\0" as *const u8 as *const c_char, 0 as c_int as c_float, ); - (*skeletonData).fps = Json_getFloat( + (*skeletonData) + .referenceScale = Json_getFloat( + skeleton, + b"referenceScale\0" as *const u8 as *const c_char, + 100 as c_int as c_float, + ) * (*self_0).scale; + (*skeletonData) + .fps = Json_getFloat( skeleton, b"fps\0" as *const u8 as *const c_char, 30 as c_int as c_float, ); - (*skeletonData).imagesPath = Json_getString( + (*skeletonData) + .imagesPath = Json_getString( skeleton, b"images\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ); if !((*skeletonData).imagesPath).is_null() { - let mut tmp: *mut c_char = std::ptr::null_mut(); - let ref mut fresh184 = *(&mut tmp as *mut *mut c_char); - *fresh184 = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul( - (spine_strlen((*skeletonData).imagesPath)).wrapping_add(1 as c_int as c_ulong), - ), + let mut tmp: *mut c_char = 0 as *mut c_char; + tmp = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul( + (spine_strlen((*skeletonData).imagesPath)) + .wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 11641 as c_int, + 12466 as c_int, ) as *mut c_char; - spine_strcpy(*fresh184, (*skeletonData).imagesPath); + spine_strcpy(tmp, (*skeletonData).imagesPath); (*skeletonData).imagesPath = tmp; } - (*skeletonData).audioPath = Json_getString( + (*skeletonData) + .audioPath = Json_getString( skeleton, b"audio\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ); if !((*skeletonData).audioPath).is_null() { - let mut tmp_0: *mut c_char = std::ptr::null_mut(); - let ref mut fresh185 = *(&mut tmp_0 as *mut *mut c_char); - *fresh185 = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul( - (spine_strlen((*skeletonData).audioPath)).wrapping_add(1 as c_int as c_ulong), - ), + let mut tmp_0: *mut c_char = 0 as *mut c_char; + tmp_0 = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul( + (spine_strlen((*skeletonData).audioPath)) + .wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 11647 as c_int, + 12472 as c_int, ) as *mut c_char; - spine_strcpy(*fresh185, (*skeletonData).audioPath); + spine_strcpy(tmp_0, (*skeletonData).audioPath); (*skeletonData).audioPath = tmp_0; } } bones = Json_getItem(root, b"bones\0" as *const u8 as *const c_char); - (*skeletonData).bones = _spMalloc( + (*skeletonData) + .bones = _spMalloc( (::core::mem::size_of::<*mut spBoneData>() as c_ulong) .wrapping_mul((*bones).size as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 11654 as c_int, + 12479 as c_int, ) as *mut *mut spBoneData; boneMap = (*bones).child; i = 0 as c_int; while !boneMap.is_null() { - let mut data: *mut spBoneData = std::ptr::null_mut(); - let mut transformMode: *const c_char = std::ptr::null(); - let mut color: *const c_char = std::ptr::null(); - let mut parent: *mut spBoneData = std::ptr::null_mut(); + let mut data: *mut spBoneData = 0 as *mut spBoneData; + let mut inherit: *const c_char = 0 as *const c_char; + let mut color: *const c_char = 0 as *const c_char; + let mut parent: *mut spBoneData = 0 as *mut spBoneData; let mut parentName: *const c_char = Json_getString( boneMap, b"parent\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ); if !parentName.is_null() { parent = spSkeletonData_findBone(skeletonData, parentName); @@ -21950,7 +25568,7 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( b"Parent bone not found: \0" as *const u8 as *const c_char, parentName, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } } data = spBoneData_create( @@ -21958,124 +25576,174 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( Json_getString( boneMap, b"name\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ), parent, ); - (*data).length = Json_getFloat( + (*data) + .length = Json_getFloat( boneMap, b"length\0" as *const u8 as *const c_char, 0 as c_int as c_float, ) * (*self_0).scale; - (*data).x = Json_getFloat( + (*data) + .x = Json_getFloat( boneMap, b"x\0" as *const u8 as *const c_char, 0 as c_int as c_float, ) * (*self_0).scale; - (*data).y = Json_getFloat( + (*data) + .y = Json_getFloat( boneMap, b"y\0" as *const u8 as *const c_char, 0 as c_int as c_float, ) * (*self_0).scale; - (*data).rotation = Json_getFloat( + (*data) + .rotation = Json_getFloat( boneMap, b"rotation\0" as *const u8 as *const c_char, 0 as c_int as c_float, ); - (*data).scaleX = Json_getFloat( + (*data) + .scaleX = Json_getFloat( boneMap, b"scaleX\0" as *const u8 as *const c_char, 1 as c_int as c_float, ); - (*data).scaleY = Json_getFloat( + (*data) + .scaleY = Json_getFloat( boneMap, b"scaleY\0" as *const u8 as *const c_char, 1 as c_int as c_float, ); - (*data).shearX = Json_getFloat( + (*data) + .shearX = Json_getFloat( boneMap, b"shearX\0" as *const u8 as *const c_char, 0 as c_int as c_float, ); - (*data).shearY = Json_getFloat( + (*data) + .shearY = Json_getFloat( boneMap, b"shearY\0" as *const u8 as *const c_char, 0 as c_int as c_float, ); - transformMode = Json_getString( + inherit = Json_getString( boneMap, - b"transform\0" as *const u8 as *const c_char, + b"inherit\0" as *const u8 as *const c_char, b"normal\0" as *const u8 as *const c_char, ); - (*data).transformMode = SP_TRANSFORMMODE_NORMAL; - if spine_strcmp(transformMode, b"normal\0" as *const u8 as *const c_char) == 0 as c_int { - (*data).transformMode = SP_TRANSFORMMODE_NORMAL; + (*data).inherit = SP_INHERIT_NORMAL; + if spine_strcmp(inherit, b"normal\0" as *const u8 as *const c_char) + == 0 as c_int + { + (*data).inherit = SP_INHERIT_NORMAL; } else if spine_strcmp( - transformMode, + inherit, b"onlyTranslation\0" as *const u8 as *const c_char, ) == 0 as c_int { - (*data).transformMode = SP_TRANSFORMMODE_ONLYTRANSLATION; + (*data).inherit = SP_INHERIT_ONLYTRANSLATION; } else if spine_strcmp( - transformMode, + inherit, b"noRotationOrReflection\0" as *const u8 as *const c_char, ) == 0 as c_int { - (*data).transformMode = SP_TRANSFORMMODE_NOROTATIONORREFLECTION; - } else if spine_strcmp(transformMode, b"noScale\0" as *const u8 as *const c_char) + (*data).inherit = SP_INHERIT_NOROTATIONORREFLECTION; + } else if spine_strcmp(inherit, b"noScale\0" as *const u8 as *const c_char) == 0 as c_int { - (*data).transformMode = SP_TRANSFORMMODE_NOSCALE; + (*data).inherit = SP_INHERIT_NOSCALE; } else if spine_strcmp( - transformMode, + inherit, b"noScaleOrReflection\0" as *const u8 as *const c_char, ) == 0 as c_int { - (*data).transformMode = SP_TRANSFORMMODE_NOSCALEORREFLECTION; + (*data).inherit = SP_INHERIT_NOSCALEORREFLECTION; } - (*data).skinRequired = - if Json_getInt(boneMap, b"skin\0" as *const u8 as *const c_char, 0 as c_int) != 0 { - 1 as c_int - } else { - 0 as c_int - }; + (*data) + .skinRequired = if Json_getInt( + boneMap, + b"skin\0" as *const u8 as *const c_char, + 0 as c_int, + ) != 0 + { + 1 as c_int + } else { + 0 as c_int + }; color = Json_getString( boneMap, b"color\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ); if !color.is_null() { toColor2(&mut (*data).color, color, -(1 as c_int)); } - let ref mut fresh186 = *((*skeletonData).bones).offset(i as isize); - *fresh186 = data; + (*data) + .icon = Json_getString( + boneMap, + b"icon\0" as *const u8 as *const c_char, + b"\0" as *const u8 as *const c_char, + ); + if !((*data).icon).is_null() { + let mut tmp_1: *mut c_char = 0 as *mut c_char; + tmp_1 = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul( + (spine_strlen((*data).icon)) + .wrapping_add(1 as c_int as c_ulong), + ), + b"spine.c\0" as *const u8 as *const c_char, + 12524 as c_int, + ) as *mut c_char; + spine_strcpy(tmp_1, (*data).icon); + (*data).icon = tmp_1; + } + (*data) + .visible = if Json_getInt( + boneMap, + b"visible\0" as *const u8 as *const c_char, + -(1 as c_int), + ) != 0 + { + -(1 as c_int) + } else { + 0 as c_int + }; + let ref mut fresh136 = *((*skeletonData).bones).offset(i as isize); + *fresh136 = data; (*skeletonData).bonesCount += 1; boneMap = (*boneMap).next; i += 1; } slots = Json_getItem(root, b"slots\0" as *const u8 as *const c_char); if !slots.is_null() { - let mut slotMap: *mut Json = std::ptr::null_mut(); + let mut slotMap: *mut Json = 0 as *mut Json; (*skeletonData).slotsCount = (*slots).size; - (*skeletonData).slots = _spMalloc( + (*skeletonData) + .slots = _spMalloc( (::core::mem::size_of::<*mut spSlotData>() as c_ulong) .wrapping_mul((*slots).size as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 11705 as c_int, + 12538 as c_int, ) as *mut *mut spSlotData; slotMap = (*slots).child; i = 0 as c_int; while !slotMap.is_null() { - let mut data_0: *mut spSlotData = std::ptr::null_mut(); - let mut color_0: *const c_char = std::ptr::null(); - let mut dark: *const c_char = std::ptr::null(); - let mut item: *mut Json = std::ptr::null_mut(); + let mut data_0: *mut spSlotData = 0 as *mut spSlotData; + let mut color_0: *const c_char = 0 as *const c_char; + let mut dark: *const c_char = 0 as *const c_char; + let mut item: *mut Json = 0 as *mut Json; let mut boneName: *const c_char = Json_getString( slotMap, b"bone\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, + ); + let mut boneData: *mut spBoneData = spSkeletonData_findBone( + skeletonData, + boneName, ); - let mut boneData: *mut spBoneData = spSkeletonData_findBone(skeletonData, boneName); if boneData.is_null() { spSkeletonData_dispose(skeletonData); _spSkeletonJson_setError( @@ -22084,21 +25752,29 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( b"Slot bone not found: \0" as *const u8 as *const c_char, boneName, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } - data_0 = spSlotData_create( - i, - Json_getString( - slotMap, - b"name\0" as *const u8 as *const c_char, - std::ptr::null(), - ), - boneData, - ); + let mut pathName: *mut c_char = 0 as *mut c_char; + let mut slotName: *mut c_char = Json_getString( + slotMap, + b"name\0" as *const u8 as *const c_char, + 0 as *const c_char, + ) as *mut c_char; + + let slash: c_int = string_lastIndexOf(slotName, '/' as i32 as c_char); + if slash != -1 { + pathName = string_substring(slotName, 0 as c_int, slash); + slotName = string_substring( + slotName, + slash + 1 as c_int, + spine_strlen(slotName) as c_int, + ); + } + data_0 = spSlotData_create(i, slotName, boneData); color_0 = Json_getString( slotMap, b"color\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ); if !color_0.is_null() { spColor_setFromFloats( @@ -22112,7 +25788,7 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( dark = Json_getString( slotMap, b"dark\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ); if !dark.is_null() { (*data_0).darkColor = spColor_create(); @@ -22124,7 +25800,10 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( 1.0f32, ); } - item = Json_getItem(slotMap, b"attachment\0" as *const u8 as *const c_char); + item = Json_getItem( + slotMap, + b"attachment\0" as *const u8 as *const c_char, + ); if !item.is_null() { spSlotData_setAttachmentName(data_0, (*item).valueString); } @@ -22150,37 +25829,49 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( (*data_0).blendMode = SP_BLEND_MODE_SCREEN; } } - let ref mut fresh187 = *((*skeletonData).slots).offset(i as isize); - *fresh187 = data_0; + (*data_0) + .visible = Json_getInt( + slotMap, + b"visible\0" as *const u8 as *const c_char, + -(1 as c_int), + ); + (*data_0).path = pathName; + let ref mut fresh137 = *((*skeletonData).slots).offset(i as isize); + *fresh137 = data_0; slotMap = (*slotMap).next; i += 1; } } ik = Json_getItem(root, b"ik\0" as *const u8 as *const c_char); if !ik.is_null() { - let mut constraintMap: *mut Json = std::ptr::null_mut(); + let mut constraintMap: *mut Json = 0 as *mut Json; (*skeletonData).ikConstraintsCount = (*ik).size; - (*skeletonData).ikConstraints = _spMalloc( + (*skeletonData) + .ikConstraints = _spMalloc( (::core::mem::size_of::<*mut spIkConstraintData>() as c_ulong) .wrapping_mul((*ik).size as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 11763 as c_int, + 12605 as c_int, ) as *mut *mut spIkConstraintData; constraintMap = (*ik).child; i = 0 as c_int; while !constraintMap.is_null() { - let mut targetName: *const c_char = std::ptr::null(); - let mut data_1: *mut spIkConstraintData = spIkConstraintData_create(Json_getString( - constraintMap, - b"name\0" as *const u8 as *const c_char, - std::ptr::null(), - )); - (*data_1).order = Json_getInt( + let mut targetName: *const c_char = 0 as *const c_char; + let mut data_1: *mut spIkConstraintData = spIkConstraintData_create( + Json_getString( + constraintMap, + b"name\0" as *const u8 as *const c_char, + 0 as *const c_char, + ), + ); + (*data_1) + .order = Json_getInt( constraintMap, b"order\0" as *const u8 as *const c_char, 0 as c_int, ); - (*data_1).skinRequired = if Json_getInt( + (*data_1) + .skinRequired = if Json_getInt( constraintMap, b"skin\0" as *const u8 as *const c_char, 0 as c_int, @@ -22190,19 +25881,26 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( } else { 0 as c_int }; - boneMap = Json_getItem(constraintMap, b"bones\0" as *const u8 as *const c_char); + boneMap = Json_getItem( + constraintMap, + b"bones\0" as *const u8 as *const c_char, + ); (*data_1).bonesCount = (*boneMap).size; - (*data_1).bones = _spMalloc( + (*data_1) + .bones = _spMalloc( (::core::mem::size_of::<*mut spBoneData>() as c_ulong) .wrapping_mul((*boneMap).size as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 11773 as c_int, + 12615 as c_int, ) as *mut *mut spBoneData; boneMap = (*boneMap).child; ii = 0 as c_int; while !boneMap.is_null() { - let ref mut fresh188 = *((*data_1).bones).offset(ii as isize); - *fresh188 = spSkeletonData_findBone(skeletonData, (*boneMap).valueString); + let ref mut fresh138 = *((*data_1).bones).offset(ii as isize); + *fresh138 = spSkeletonData_findBone( + skeletonData, + (*boneMap).valueString, + ); if (*((*data_1).bones).offset(ii as isize)).is_null() { spSkeletonData_dispose(skeletonData); _spSkeletonJson_setError( @@ -22211,7 +25909,7 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( b"IK bone not found: \0" as *const u8 as *const c_char, (*boneMap).valueString, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } boneMap = (*boneMap).next; ii += 1; @@ -22219,7 +25917,7 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( targetName = Json_getString( constraintMap, b"target\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ); (*data_1).target = spSkeletonData_findBone(skeletonData, targetName); if ((*data_1).target).is_null() { @@ -22230,9 +25928,10 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( b"Target bone not found: \0" as *const u8 as *const c_char, targetName, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } - (*data_1).bendDirection = if Json_getInt( + (*data_1) + .bendDirection = if Json_getInt( constraintMap, b"bendPositive\0" as *const u8 as *const c_char, 1 as c_int, @@ -22242,7 +25941,8 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( } else { -(1 as c_int) }; - (*data_1).compress = if Json_getInt( + (*data_1) + .compress = if Json_getInt( constraintMap, b"compress\0" as *const u8 as *const c_char, 0 as c_int, @@ -22252,7 +25952,8 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( } else { 0 as c_int }; - (*data_1).stretch = if Json_getInt( + (*data_1) + .stretch = if Json_getInt( constraintMap, b"stretch\0" as *const u8 as *const c_char, 0 as c_int, @@ -22262,7 +25963,8 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( } else { 0 as c_int }; - (*data_1).uniform = if Json_getInt( + (*data_1) + .uniform = if Json_getInt( constraintMap, b"uniform\0" as *const u8 as *const c_char, 0 as c_int, @@ -22272,48 +25974,54 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( } else { 0 as c_int }; - (*data_1).mix = Json_getFloat( + (*data_1) + .mix = Json_getFloat( constraintMap, b"mix\0" as *const u8 as *const c_char, 1 as c_int as c_float, ); - (*data_1).softness = Json_getFloat( + (*data_1) + .softness = Json_getFloat( constraintMap, b"softness\0" as *const u8 as *const c_char, 0 as c_int as c_float, ) * (*self_0).scale; - let ref mut fresh189 = *((*skeletonData).ikConstraints).offset(i as isize); - *fresh189 = data_1; + let ref mut fresh139 = *((*skeletonData).ikConstraints).offset(i as isize); + *fresh139 = data_1; constraintMap = (*constraintMap).next; i += 1; } } transform = Json_getItem(root, b"transform\0" as *const u8 as *const c_char); if !transform.is_null() { - let mut constraintMap_0: *mut Json = std::ptr::null_mut(); + let mut constraintMap_0: *mut Json = 0 as *mut Json; (*skeletonData).transformConstraintsCount = (*transform).size; - (*skeletonData).transformConstraints = _spMalloc( + (*skeletonData) + .transformConstraints = _spMalloc( (::core::mem::size_of::<*mut spTransformConstraintData>() as c_ulong) .wrapping_mul((*transform).size as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 11807 as c_int, + 12649 as c_int, ) as *mut *mut spTransformConstraintData; constraintMap_0 = (*transform).child; i = 0 as c_int; while !constraintMap_0.is_null() { - let mut name: *const c_char = std::ptr::null(); - let mut data_2: *mut spTransformConstraintData = - spTransformConstraintData_create(Json_getString( + let mut name: *const c_char = 0 as *const c_char; + let mut data_2: *mut spTransformConstraintData = spTransformConstraintData_create( + Json_getString( constraintMap_0, b"name\0" as *const u8 as *const c_char, - std::ptr::null(), - )); - (*data_2).order = Json_getInt( + 0 as *const c_char, + ), + ); + (*data_2) + .order = Json_getInt( constraintMap_0, b"order\0" as *const u8 as *const c_char, 0 as c_int, ); - (*data_2).skinRequired = if Json_getInt( + (*data_2) + .skinRequired = if Json_getInt( constraintMap_0, b"skin\0" as *const u8 as *const c_char, 0 as c_int, @@ -22323,29 +26031,36 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( } else { 0 as c_int }; - boneMap = Json_getItem(constraintMap_0, b"bones\0" as *const u8 as *const c_char); + boneMap = Json_getItem( + constraintMap_0, + b"bones\0" as *const u8 as *const c_char, + ); (*data_2).bonesCount = (*boneMap).size; - let ref mut fresh190 = *(&mut (*data_2).bones as *mut *mut *mut spBoneData); - *fresh190 = _spMalloc( + (*data_2) + .bones = _spMalloc( (::core::mem::size_of::<*mut spBoneData>() as c_ulong) .wrapping_mul((*boneMap).size as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 11818 as c_int, + 12660 as c_int, ) as *mut *mut spBoneData; boneMap = (*boneMap).child; ii = 0 as c_int; while !boneMap.is_null() { - let ref mut fresh191 = *((*data_2).bones).offset(ii as isize); - *fresh191 = spSkeletonData_findBone(skeletonData, (*boneMap).valueString); + let ref mut fresh140 = *((*data_2).bones).offset(ii as isize); + *fresh140 = spSkeletonData_findBone( + skeletonData, + (*boneMap).valueString, + ); if (*((*data_2).bones).offset(ii as isize)).is_null() { spSkeletonData_dispose(skeletonData); _spSkeletonJson_setError( self_0, root, - b"Transform bone not found: \0" as *const u8 as *const c_char, + b"Transform bone not found: \0" as *const u8 + as *const c_char, (*boneMap).valueString, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } boneMap = (*boneMap).next; ii += 1; @@ -22353,7 +26068,7 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( name = Json_getString( constraintMap_0, b"target\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ); (*data_2).target = spSkeletonData_findBone(skeletonData, name); if ((*data_2).target).is_null() { @@ -22364,111 +26079,130 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( b"Target bone not found: \0" as *const u8 as *const c_char, name, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } - (*data_2).local = Json_getInt( + (*data_2) + .local = Json_getInt( constraintMap_0, b"local\0" as *const u8 as *const c_char, 0 as c_int, ); - (*data_2).relative = Json_getInt( + (*data_2) + .relative = Json_getInt( constraintMap_0, b"relative\0" as *const u8 as *const c_char, 0 as c_int, ); - (*data_2).offsetRotation = Json_getFloat( + (*data_2) + .offsetRotation = Json_getFloat( constraintMap_0, b"rotation\0" as *const u8 as *const c_char, 0 as c_int as c_float, ); - (*data_2).offsetX = Json_getFloat( + (*data_2) + .offsetX = Json_getFloat( constraintMap_0, b"x\0" as *const u8 as *const c_char, 0 as c_int as c_float, ) * (*self_0).scale; - (*data_2).offsetY = Json_getFloat( + (*data_2) + .offsetY = Json_getFloat( constraintMap_0, b"y\0" as *const u8 as *const c_char, 0 as c_int as c_float, ) * (*self_0).scale; - (*data_2).offsetScaleX = Json_getFloat( + (*data_2) + .offsetScaleX = Json_getFloat( constraintMap_0, b"scaleX\0" as *const u8 as *const c_char, 0 as c_int as c_float, ); - (*data_2).offsetScaleY = Json_getFloat( + (*data_2) + .offsetScaleY = Json_getFloat( constraintMap_0, b"scaleY\0" as *const u8 as *const c_char, 0 as c_int as c_float, ); - (*data_2).offsetShearY = Json_getFloat( + (*data_2) + .offsetShearY = Json_getFloat( constraintMap_0, b"shearY\0" as *const u8 as *const c_char, 0 as c_int as c_float, ); - (*data_2).mixRotate = Json_getFloat( + (*data_2) + .mixRotate = Json_getFloat( constraintMap_0, b"mixRotate\0" as *const u8 as *const c_char, 1 as c_int as c_float, ); - (*data_2).mixX = Json_getFloat( + (*data_2) + .mixX = Json_getFloat( constraintMap_0, b"mixX\0" as *const u8 as *const c_char, 1 as c_int as c_float, ); - (*data_2).mixY = Json_getFloat( + (*data_2) + .mixY = Json_getFloat( constraintMap_0, b"mixY\0" as *const u8 as *const c_char, (*data_2).mixX, ); - (*data_2).mixScaleX = Json_getFloat( + (*data_2) + .mixScaleX = Json_getFloat( constraintMap_0, b"mixScaleX\0" as *const u8 as *const c_char, 1 as c_int as c_float, ); - (*data_2).mixScaleY = Json_getFloat( + (*data_2) + .mixScaleY = Json_getFloat( constraintMap_0, b"mixScaleY\0" as *const u8 as *const c_char, (*data_2).mixScaleX, ); - (*data_2).mixShearY = Json_getFloat( + (*data_2) + .mixShearY = Json_getFloat( constraintMap_0, b"mixShearY\0" as *const u8 as *const c_char, 1 as c_int as c_float, ); - let ref mut fresh192 = *((*skeletonData).transformConstraints).offset(i as isize); - *fresh192 = data_2; + let ref mut fresh141 = *((*skeletonData).transformConstraints) + .offset(i as isize); + *fresh141 = data_2; constraintMap_0 = (*constraintMap_0).next; i += 1; } } pathJson = Json_getItem(root, b"path\0" as *const u8 as *const c_char); if !pathJson.is_null() { - let mut constraintMap_1: *mut Json = std::ptr::null_mut(); + let mut constraintMap_1: *mut Json = 0 as *mut Json; (*skeletonData).pathConstraintsCount = (*pathJson).size; - (*skeletonData).pathConstraints = _spMalloc( + (*skeletonData) + .pathConstraints = _spMalloc( (::core::mem::size_of::<*mut spPathConstraintData>() as c_ulong) .wrapping_mul((*pathJson).size as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 11861 as c_int, + 12703 as c_int, ) as *mut *mut spPathConstraintData; constraintMap_1 = (*pathJson).child; i = 0 as c_int; while !constraintMap_1.is_null() { - let mut name_0: *const c_char = std::ptr::null(); - let mut item_0: *const c_char = std::ptr::null(); - let mut data_3: *mut spPathConstraintData = - spPathConstraintData_create(Json_getString( + let mut name_0: *const c_char = 0 as *const c_char; + let mut item_0: *const c_char = 0 as *const c_char; + let mut data_3: *mut spPathConstraintData = spPathConstraintData_create( + Json_getString( constraintMap_1, b"name\0" as *const u8 as *const c_char, - std::ptr::null(), - )); - (*data_3).order = Json_getInt( + 0 as *const c_char, + ), + ); + (*data_3) + .order = Json_getInt( constraintMap_1, b"order\0" as *const u8 as *const c_char, 0 as c_int, ); - (*data_3).skinRequired = if Json_getInt( + (*data_3) + .skinRequired = if Json_getInt( constraintMap_1, b"skin\0" as *const u8 as *const c_char, 0 as c_int, @@ -22478,20 +26212,26 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( } else { 0 as c_int }; - boneMap = Json_getItem(constraintMap_1, b"bones\0" as *const u8 as *const c_char); + boneMap = Json_getItem( + constraintMap_1, + b"bones\0" as *const u8 as *const c_char, + ); (*data_3).bonesCount = (*boneMap).size; - let ref mut fresh193 = *(&mut (*data_3).bones as *mut *mut *mut spBoneData); - *fresh193 = _spMalloc( + (*data_3) + .bones = _spMalloc( (::core::mem::size_of::<*mut spBoneData>() as c_ulong) .wrapping_mul((*boneMap).size as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 11872 as c_int, + 12714 as c_int, ) as *mut *mut spBoneData; boneMap = (*boneMap).child; ii = 0 as c_int; while !boneMap.is_null() { - let ref mut fresh194 = *((*data_3).bones).offset(ii as isize); - *fresh194 = spSkeletonData_findBone(skeletonData, (*boneMap).valueString); + let ref mut fresh142 = *((*data_3).bones).offset(ii as isize); + *fresh142 = spSkeletonData_findBone( + skeletonData, + (*boneMap).valueString, + ); if (*((*data_3).bones).offset(ii as isize)).is_null() { spSkeletonData_dispose(skeletonData); _spSkeletonJson_setError( @@ -22500,7 +26240,7 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( b"Path bone not found: \0" as *const u8 as *const c_char, (*boneMap).valueString, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } boneMap = (*boneMap).next; ii += 1; @@ -22508,7 +26248,7 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( name_0 = Json_getString( constraintMap_1, b"target\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ); (*data_3).target = spSkeletonData_findSlot(skeletonData, name_0); if ((*data_3).target).is_null() { @@ -22519,16 +26259,21 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( b"Target slot not found: \0" as *const u8 as *const c_char, name_0, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } item_0 = Json_getString( constraintMap_1, b"positionMode\0" as *const u8 as *const c_char, b"percent\0" as *const u8 as *const c_char, ); - if spine_strcmp(item_0, b"fixed\0" as *const u8 as *const c_char) == 0 as c_int { + if spine_strcmp(item_0, b"fixed\0" as *const u8 as *const c_char) + == 0 as c_int + { (*data_3).positionMode = SP_POSITION_MODE_FIXED; - } else if spine_strcmp(item_0, b"percent\0" as *const u8 as *const c_char) == 0 as c_int + } else if spine_strcmp( + item_0, + b"percent\0" as *const u8 as *const c_char, + ) == 0 as c_int { (*data_3).positionMode = SP_POSITION_MODE_PERCENT; } @@ -22537,11 +26282,20 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( b"spacingMode\0" as *const u8 as *const c_char, b"length\0" as *const u8 as *const c_char, ); - if spine_strcmp(item_0, b"length\0" as *const u8 as *const c_char) == 0 as c_int { + if spine_strcmp(item_0, b"length\0" as *const u8 as *const c_char) + == 0 as c_int + { (*data_3).spacingMode = SP_SPACING_MODE_LENGTH; - } else if spine_strcmp(item_0, b"fixed\0" as *const u8 as *const c_char) == 0 as c_int { + } else if spine_strcmp( + item_0, + b"fixed\0" as *const u8 as *const c_char, + ) == 0 as c_int + { (*data_3).spacingMode = SP_SPACING_MODE_FIXED; - } else if spine_strcmp(item_0, b"percent\0" as *const u8 as *const c_char) == 0 as c_int + } else if spine_strcmp( + item_0, + b"percent\0" as *const u8 as *const c_char, + ) == 0 as c_int { (*data_3).spacingMode = SP_SPACING_MODE_PERCENT; } else { @@ -22552,148 +26306,374 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( b"rotateMode\0" as *const u8 as *const c_char, b"tangent\0" as *const u8 as *const c_char, ); - if spine_strcmp(item_0, b"tangent\0" as *const u8 as *const c_char) == 0 as c_int { + if spine_strcmp(item_0, b"tangent\0" as *const u8 as *const c_char) + == 0 as c_int + { (*data_3).rotateMode = SP_ROTATE_MODE_TANGENT; - } else if spine_strcmp(item_0, b"chain\0" as *const u8 as *const c_char) == 0 as c_int { + } else if spine_strcmp( + item_0, + b"chain\0" as *const u8 as *const c_char, + ) == 0 as c_int + { (*data_3).rotateMode = SP_ROTATE_MODE_CHAIN; - } else if spine_strcmp(item_0, b"chainScale\0" as *const u8 as *const c_char) - == 0 as c_int + } else if spine_strcmp( + item_0, + b"chainScale\0" as *const u8 as *const c_char, + ) == 0 as c_int { (*data_3).rotateMode = SP_ROTATE_MODE_CHAIN_SCALE; } - (*data_3).offsetRotation = Json_getFloat( + (*data_3) + .offsetRotation = Json_getFloat( constraintMap_1, b"rotation\0" as *const u8 as *const c_char, 0 as c_int as c_float, ); - (*data_3).position = Json_getFloat( + (*data_3) + .position = Json_getFloat( constraintMap_1, b"position\0" as *const u8 as *const c_char, 0 as c_int as c_float, ); - if (*data_3).positionMode as c_uint == SP_POSITION_MODE_FIXED as c_int as c_uint { + if (*data_3).positionMode as c_uint + == SP_POSITION_MODE_FIXED as c_int as c_uint + { (*data_3).position *= (*self_0).scale; } - (*data_3).spacing = Json_getFloat( + (*data_3) + .spacing = Json_getFloat( constraintMap_1, b"spacing\0" as *const u8 as *const c_char, 0 as c_int as c_float, ); - if (*data_3).spacingMode as c_uint == SP_SPACING_MODE_LENGTH as c_int as c_uint - || (*data_3).spacingMode as c_uint == SP_SPACING_MODE_FIXED as c_int as c_uint + if (*data_3).spacingMode as c_uint + == SP_SPACING_MODE_LENGTH as c_int as c_uint + || (*data_3).spacingMode as c_uint + == SP_SPACING_MODE_FIXED as c_int as c_uint { (*data_3).spacing *= (*self_0).scale; } - (*data_3).mixRotate = Json_getFloat( + (*data_3) + .mixRotate = Json_getFloat( constraintMap_1, b"mixRotate\0" as *const u8 as *const c_char, 1 as c_int as c_float, ); - (*data_3).mixX = Json_getFloat( + (*data_3) + .mixX = Json_getFloat( constraintMap_1, b"mixX\0" as *const u8 as *const c_char, 1 as c_int as c_float, ); - (*data_3).mixY = Json_getFloat( + (*data_3) + .mixY = Json_getFloat( constraintMap_1, b"mixY\0" as *const u8 as *const c_char, (*data_3).mixX, ); - let ref mut fresh195 = *((*skeletonData).pathConstraints).offset(i as isize); - *fresh195 = data_3; + let ref mut fresh143 = *((*skeletonData).pathConstraints).offset(i as isize); + *fresh143 = data_3; constraintMap_1 = (*constraintMap_1).next; i += 1; } } + physics = Json_getItem(root, b"physics\0" as *const u8 as *const c_char); + if !physics.is_null() { + let mut constraintMap_2: *mut Json = 0 as *mut Json; + (*skeletonData).physicsConstraintsCount = (*physics).size; + (*skeletonData) + .physicsConstraints = _spMalloc( + (::core::mem::size_of::<*mut spPhysicsConstraintData>() as c_ulong) + .wrapping_mul((*physics).size as c_ulong), + b"spine.c\0" as *const u8 as *const c_char, + 12772 as c_int, + ) as *mut *mut spPhysicsConstraintData; + constraintMap_2 = (*physics).child; + i = 0 as c_int; + while !constraintMap_2.is_null() { + let mut name_1: *const c_char = 0 as *const c_char; + let mut data_4: *mut spPhysicsConstraintData = spPhysicsConstraintData_create( + Json_getString( + constraintMap_2, + b"name\0" as *const u8 as *const c_char, + 0 as *const c_char, + ), + ); + (*data_4) + .order = Json_getInt( + constraintMap_2, + b"order\0" as *const u8 as *const c_char, + 0 as c_int, + ); + (*data_4) + .skinRequired = Json_getInt( + constraintMap_2, + b"skin\0" as *const u8 as *const c_char, + 0 as c_int, + ); + name_1 = Json_getString( + constraintMap_2, + b"bone\0" as *const u8 as *const c_char, + 0 as *const c_char, + ); + (*data_4).bone = spSkeletonData_findBone(skeletonData, name_1); + if ((*data_4).bone).is_null() { + spSkeletonData_dispose(skeletonData); + _spSkeletonJson_setError( + self_0, + root, + b"Physics bone not found: \0" as *const u8 as *const c_char, + name_1, + ); + return 0 as *mut spSkeletonData; + } + (*data_4) + .x = Json_getFloat( + constraintMap_2, + b"x\0" as *const u8 as *const c_char, + 0 as c_int as c_float, + ); + (*data_4) + .y = Json_getFloat( + constraintMap_2, + b"y\0" as *const u8 as *const c_char, + 0 as c_int as c_float, + ); + (*data_4) + .rotate = Json_getFloat( + constraintMap_2, + b"rotate\0" as *const u8 as *const c_char, + 0 as c_int as c_float, + ); + (*data_4) + .scaleX = Json_getFloat( + constraintMap_2, + b"scaleX\0" as *const u8 as *const c_char, + 0 as c_int as c_float, + ); + (*data_4) + .shearX = Json_getFloat( + constraintMap_2, + b"shearX\0" as *const u8 as *const c_char, + 0 as c_int as c_float, + ); + (*data_4) + .limit = Json_getFloat( + constraintMap_2, + b"limit\0" as *const u8 as *const c_char, + 5000 as c_int as c_float, + ) * (*self_0).scale; + (*data_4) + .step = 1.0f32 + / Json_getInt( + constraintMap_2, + b"fps\0" as *const u8 as *const c_char, + 60 as c_int, + ) as c_float; + (*data_4) + .inertia = Json_getFloat( + constraintMap_2, + b"inertia\0" as *const u8 as *const c_char, + 1 as c_int as c_float, + ); + (*data_4) + .strength = Json_getFloat( + constraintMap_2, + b"strength\0" as *const u8 as *const c_char, + 100 as c_int as c_float, + ); + (*data_4) + .damping = Json_getFloat( + constraintMap_2, + b"damping\0" as *const u8 as *const c_char, + 1 as c_int as c_float, + ); + (*data_4) + .massInverse = 1.0f32 + / Json_getFloat( + constraintMap_2, + b"mass\0" as *const u8 as *const c_char, + 1 as c_int as c_float, + ); + (*data_4) + .wind = Json_getFloat( + constraintMap_2, + b"wind\0" as *const u8 as *const c_char, + 0 as c_int as c_float, + ); + (*data_4) + .gravity = Json_getFloat( + constraintMap_2, + b"gravity\0" as *const u8 as *const c_char, + 0 as c_int as c_float, + ); + (*data_4) + .mix = Json_getFloat( + constraintMap_2, + b"mix\0" as *const u8 as *const c_char, + 1 as c_int as c_float, + ); + (*data_4) + .inertiaGlobal = Json_getInt( + constraintMap_2, + b"inertiaGlobal\0" as *const u8 as *const c_char, + 0 as c_int, + ); + (*data_4) + .strengthGlobal = Json_getInt( + constraintMap_2, + b"strengthGlobal\0" as *const u8 as *const c_char, + 0 as c_int, + ); + (*data_4) + .dampingGlobal = Json_getInt( + constraintMap_2, + b"dampingGlobal\0" as *const u8 as *const c_char, + 0 as c_int, + ); + (*data_4) + .massGlobal = Json_getInt( + constraintMap_2, + b"massGlobal\0" as *const u8 as *const c_char, + 0 as c_int, + ); + (*data_4) + .windGlobal = Json_getInt( + constraintMap_2, + b"windGlobal\0" as *const u8 as *const c_char, + 0 as c_int, + ); + (*data_4) + .gravityGlobal = Json_getInt( + constraintMap_2, + b"gravityGlobal\0" as *const u8 as *const c_char, + 0 as c_int, + ); + (*data_4) + .mixGlobal = Json_getInt( + constraintMap_2, + b"mixGlobal\0" as *const u8 as *const c_char, + 0 as c_int, + ); + let ref mut fresh144 = *((*skeletonData).physicsConstraints) + .offset(i as isize); + *fresh144 = data_4; + constraintMap_2 = (*constraintMap_2).next; + i += 1; + } + } skins = Json_getItem(root, b"skins\0" as *const u8 as *const c_char); if !skins.is_null() { - let mut skinMap: *mut Json = std::ptr::null_mut(); - (*skeletonData).skins = _spMalloc( + let mut skinMap: *mut Json = 0 as *mut Json; + (*skeletonData) + .skins = _spMalloc( (::core::mem::size_of::<*mut spSkin>() as c_ulong) .wrapping_mul((*skins).size as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 11929 as c_int, + 12819 as c_int, ) as *mut *mut spSkin; skinMap = (*skins).child; i = 0 as c_int; while !skinMap.is_null() { - let mut attachmentsMap: *mut Json = std::ptr::null_mut(); - let mut curves: *mut Json = std::ptr::null_mut(); - let mut skinPart: *mut Json = std::ptr::null_mut(); - let mut skin: *mut spSkin = spSkin_create(Json_getString( + let mut attachmentsMap: *mut Json = 0 as *mut Json; + let mut curves: *mut Json = 0 as *mut Json; + let mut skinPart: *mut Json = 0 as *mut Json; + let mut skin: *mut spSkin = spSkin_create( + Json_getString( + skinMap, + b"name\0" as *const u8 as *const c_char, + b"\0" as *const u8 as *const c_char, + ), + ); + skinPart = Json_getItem( skinMap, - b"name\0" as *const u8 as *const c_char, - b"\0" as *const u8 as *const c_char, - )); - skinPart = Json_getItem(skinMap, b"bones\0" as *const u8 as *const c_char); + b"bones\0" as *const u8 as *const c_char, + ); if !skinPart.is_null() { skinPart = (*skinPart).child; while !skinPart.is_null() { - let mut bone: *mut spBoneData = - spSkeletonData_findBone(skeletonData, (*skinPart).valueString); + let mut bone: *mut spBoneData = spSkeletonData_findBone( + skeletonData, + (*skinPart).valueString, + ); if bone.is_null() { spSkeletonData_dispose(skeletonData); _spSkeletonJson_setError( self_0, root, - b"Skin bone constraint not found: \0" as *const u8 as *const c_char, + b"Skin bone constraint not found: \0" as *const u8 + as *const c_char, (*skinPart).valueString, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } spBoneDataArray_add((*skin).bones, bone); skinPart = (*skinPart).next; } } - skinPart = Json_getItem(skinMap, b"ik\0" as *const u8 as *const c_char); + skinPart = Json_getItem( + skinMap, + b"ik\0" as *const u8 as *const c_char, + ); if !skinPart.is_null() { skinPart = (*skinPart).child; while !skinPart.is_null() { - let mut constraint: *mut spIkConstraintData = - spSkeletonData_findIkConstraint(skeletonData, (*skinPart).valueString); + let mut constraint: *mut spIkConstraintData = spSkeletonData_findIkConstraint( + skeletonData, + (*skinPart).valueString, + ); if constraint.is_null() { spSkeletonData_dispose(skeletonData); _spSkeletonJson_setError( self_0, root, - b"Skin IK constraint not found: \0" as *const u8 as *const c_char, + b"Skin IK constraint not found: \0" as *const u8 + as *const c_char, (*skinPart).valueString, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } spIkConstraintDataArray_add((*skin).ikConstraints, constraint); skinPart = (*skinPart).next; } } - skinPart = Json_getItem(skinMap, b"path\0" as *const u8 as *const c_char); + skinPart = Json_getItem( + skinMap, + b"path\0" as *const u8 as *const c_char, + ); if !skinPart.is_null() { skinPart = (*skinPart).child; while !skinPart.is_null() { - let mut constraint_0: *mut spPathConstraintData = - spSkeletonData_findPathConstraint(skeletonData, (*skinPart).valueString); + let mut constraint_0: *mut spPathConstraintData = spSkeletonData_findPathConstraint( + skeletonData, + (*skinPart).valueString, + ); if constraint_0.is_null() { spSkeletonData_dispose(skeletonData); _spSkeletonJson_setError( self_0, root, - b"Skin path constraint not found: \0" as *const u8 as *const c_char, + b"Skin path constraint not found: \0" as *const u8 + as *const c_char, (*skinPart).valueString, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } spPathConstraintDataArray_add((*skin).pathConstraints, constraint_0); skinPart = (*skinPart).next; } } - skinPart = Json_getItem(skinMap, b"transform\0" as *const u8 as *const c_char); + skinPart = Json_getItem( + skinMap, + b"transform\0" as *const u8 as *const c_char, + ); if !skinPart.is_null() { skinPart = (*skinPart).child; while !skinPart.is_null() { - let mut constraint_1: *mut spTransformConstraintData = - spSkeletonData_findTransformConstraint( - skeletonData, - (*skinPart).valueString, - ); + let mut constraint_1: *mut spTransformConstraintData = spSkeletonData_findTransformConstraint( + skeletonData, + (*skinPart).valueString, + ); if constraint_1.is_null() { spSkeletonData_dispose(skeletonData); _spSkeletonJson_setError( @@ -22703,31 +26683,72 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( as *const c_char, (*skinPart).valueString, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; + } + spTransformConstraintDataArray_add( + (*skin).transformConstraints, + constraint_1, + ); + skinPart = (*skinPart).next; + } + } + skinPart = Json_getItem( + skinMap, + b"physics\0" as *const u8 as *const c_char, + ); + if !skinPart.is_null() { + skinPart = (*skinPart).child; + while !skinPart.is_null() { + let mut constraint_2: *mut spPhysicsConstraintData = spSkeletonData_findPhysicsConstraint( + skeletonData, + (*skinPart).valueString, + ); + if constraint_2.is_null() { + spSkeletonData_dispose(skeletonData); + _spSkeletonJson_setError( + self_0, + root, + b"Skin physics constraint not found: \0" as *const u8 + as *const c_char, + (*skinPart).valueString, + ); + return 0 as *mut spSkeletonData; } - spTransformConstraintDataArray_add((*skin).transformConstraints, constraint_1); + spPhysicsConstraintDataArray_add( + (*skin).physicsConstraints, + constraint_2, + ); skinPart = (*skinPart).next; } } - let fresh196 = (*skeletonData).skinsCount; + let fresh145 = (*skeletonData).skinsCount; (*skeletonData).skinsCount = (*skeletonData).skinsCount + 1; - let ref mut fresh197 = *((*skeletonData).skins).offset(fresh196 as isize); - *fresh197 = skin; - if spine_strcmp((*skin).name, b"default\0" as *const u8 as *const c_char) == 0 as c_int + let ref mut fresh146 = *((*skeletonData).skins).offset(fresh145 as isize); + *fresh146 = skin; + if spine_strcmp( + (*skin).name, + b"default\0" as *const u8 as *const c_char, + ) == 0 as c_int { (*skeletonData).defaultSkin = skin; } - skinPart = Json_getItem(skinMap, b"attachments\0" as *const u8 as *const c_char); + skinPart = Json_getItem( + skinMap, + b"attachments\0" as *const u8 as *const c_char, + ); if !skinPart.is_null() { attachmentsMap = (*skinPart).child; while !attachmentsMap.is_null() { - let mut slot: *mut spSlotData = - spSkeletonData_findSlot(skeletonData, (*attachmentsMap).name); - let mut attachmentMap: *mut Json = std::ptr::null_mut(); + let mut slot: *mut spSlotData = spSkeletonData_findSlot( + skeletonData, + (*attachmentsMap).name, + ); + let mut attachmentMap: *mut Json = 0 as *mut Json; attachmentMap = (*attachmentsMap).child; while !attachmentMap.is_null() { - let mut attachment: *mut spAttachment = std::ptr::null_mut(); - let mut skinAttachmentName: *const c_char = (*attachmentMap).name; + let mut attachment: *mut spAttachment = 0 as *mut spAttachment; + let mut skinAttachmentName: *const c_char = (*attachmentMap) + .name; let mut attachmentName: *const c_char = Json_getString( attachmentMap, b"name\0" as *const u8 as *const c_char, @@ -22738,21 +26759,25 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( b"path\0" as *const u8 as *const c_char, attachmentName, ); - let mut color_1: *const c_char = std::ptr::null(); - let mut entry: *mut Json = std::ptr::null_mut(); - let mut sequence: *mut spSequence = std::ptr::null_mut(); + let mut color_1: *const c_char = 0 as *const c_char; + let mut entry: *mut Json = 0 as *mut Json; + let mut sequence: *mut spSequence = 0 as *mut spSequence; let mut typeString: *const c_char = Json_getString( attachmentMap, b"type\0" as *const u8 as *const c_char, b"region\0" as *const u8 as *const c_char, ); let mut type_0: spAttachmentType = SP_ATTACHMENT_REGION; - if spine_strcmp(typeString, b"region\0" as *const u8 as *const c_char) - == 0 as c_int + if spine_strcmp( + typeString, + b"region\0" as *const u8 as *const c_char, + ) == 0 as c_int { type_0 = SP_ATTACHMENT_REGION; - } else if spine_strcmp(typeString, b"mesh\0" as *const u8 as *const c_char) - == 0 as c_int + } else if spine_strcmp( + typeString, + b"mesh\0" as *const u8 as *const c_char, + ) == 0 as c_int { type_0 = SP_ATTACHMENT_MESH; } else if spine_strcmp( @@ -22767,8 +26792,10 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( ) == 0 as c_int { type_0 = SP_ATTACHMENT_BOUNDING_BOX; - } else if spine_strcmp(typeString, b"path\0" as *const u8 as *const c_char) - == 0 as c_int + } else if spine_strcmp( + typeString, + b"path\0" as *const u8 as *const c_char, + ) == 0 as c_int { type_0 = SP_ATTACHMENT_PATH; } else if spine_strcmp( @@ -22777,8 +26804,10 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( ) == 0 as c_int { type_0 = SP_ATTACHMENT_CLIPPING; - } else if spine_strcmp(typeString, b"point\0" as *const u8 as *const c_char) - == 0 as c_int + } else if spine_strcmp( + typeString, + b"point\0" as *const u8 as *const c_char, + ) == 0 as c_int { type_0 = SP_ATTACHMENT_POINT; } else { @@ -22786,15 +26815,18 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( _spSkeletonJson_setError( self_0, root, - b"Unknown attachment type: \0" as *const u8 as *const c_char, + b"Unknown attachment type: \0" as *const u8 + as *const c_char, typeString, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } - sequence = readSequenceJson(Json_getItem( - attachmentMap, - b"sequence\0" as *const u8 as *const c_char, - )); + sequence = readSequenceJson( + Json_getItem( + attachmentMap, + b"sequence\0" as *const u8 as *const c_char, + ), + ); attachment = spAttachmentLoader_createAttachment( (*self_0).attachmentLoader, skin, @@ -22812,60 +26844,64 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( (*(*self_0).attachmentLoader).error1, (*(*self_0).attachmentLoader).error2, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } } else { match (*attachment).type_0 as c_uint { 0 => { - let mut region: *mut spRegionAttachment = - attachment as *mut spRegionAttachment; + let mut region: *mut spRegionAttachment = attachment + as *mut spRegionAttachment; if !path.is_null() { - let ref mut fresh198 = *(&mut (*region).path - as *mut *const c_char - as *mut *mut c_char); - *fresh198 = _spMalloc( + (*region) + .path = _spMalloc( (::core::mem::size_of::() as c_ulong) .wrapping_mul( (spine_strlen(path)) .wrapping_add(1 as c_int as c_ulong), ), b"spine.c\0" as *const u8 as *const c_char, - 12048 as c_int, - ) - as *mut c_char; - spine_strcpy(*fresh198, path); + 12952 as c_int, + ) as *mut c_char; + spine_strcpy((*region).path, path); } - (*region).x = Json_getFloat( + (*region) + .x = Json_getFloat( attachmentMap, b"x\0" as *const u8 as *const c_char, 0 as c_int as c_float, ) * (*self_0).scale; - (*region).y = Json_getFloat( + (*region) + .y = Json_getFloat( attachmentMap, b"y\0" as *const u8 as *const c_char, 0 as c_int as c_float, ) * (*self_0).scale; - (*region).scaleX = Json_getFloat( + (*region) + .scaleX = Json_getFloat( attachmentMap, b"scaleX\0" as *const u8 as *const c_char, 1 as c_int as c_float, ); - (*region).scaleY = Json_getFloat( + (*region) + .scaleY = Json_getFloat( attachmentMap, b"scaleY\0" as *const u8 as *const c_char, 1 as c_int as c_float, ); - (*region).rotation = Json_getFloat( + (*region) + .rotation = Json_getFloat( attachmentMap, b"rotation\0" as *const u8 as *const c_char, 0 as c_int as c_float, ); - (*region).width = Json_getFloat( + (*region) + .width = Json_getFloat( attachmentMap, b"width\0" as *const u8 as *const c_char, 32 as c_int as c_float, ) * (*self_0).scale; - (*region).height = Json_getFloat( + (*region) + .height = Json_getFloat( attachmentMap, b"height\0" as *const u8 as *const c_char, 32 as c_int as c_float, @@ -22874,7 +26910,7 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( color_1 = Json_getString( attachmentMap, b"color\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ); if !color_1.is_null() { spColor_setFromFloats( @@ -22894,24 +26930,23 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( ); } 2 | 3 => { - let mut mesh: *mut spMeshAttachment = - attachment as *mut spMeshAttachment; - let ref mut fresh199 = *(&mut (*mesh).path as *mut *const c_char - as *mut *mut c_char); - *fresh199 = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul( - (spine_strlen(path)) - .wrapping_add(1 as c_int as c_ulong), - ), + let mut mesh: *mut spMeshAttachment = attachment + as *mut spMeshAttachment; + (*mesh) + .path = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul( + (spine_strlen(path)) + .wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 12076 as c_int, - ) - as *mut c_char; - spine_strcpy(*fresh199, path); + 12980 as c_int, + ) as *mut c_char; + spine_strcpy((*mesh).path, path); color_1 = Json_getString( attachmentMap, b"color\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ); if !color_1.is_null() { spColor_setFromFloats( @@ -22922,12 +26957,14 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( toColor(color_1, 3 as c_int), ); } - (*mesh).width = Json_getFloat( + (*mesh) + .width = Json_getFloat( attachmentMap, b"width\0" as *const u8 as *const c_char, 32 as c_int as c_float, ) * (*self_0).scale; - (*mesh).height = Json_getFloat( + (*mesh) + .height = Json_getFloat( attachmentMap, b"height\0" as *const u8 as *const c_char, 32 as c_int as c_float, @@ -22944,18 +26981,18 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( b"triangles\0" as *const u8 as *const c_char, ); (*mesh).trianglesCount = (*entry).size; - (*mesh).triangles = _spMalloc( + (*mesh) + .triangles = _spMalloc( (::core::mem::size_of::() as c_ulong) .wrapping_mul((*entry).size as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 12096 as c_int, - ) - as *mut c_ushort; + 13000 as c_int, + ) as *mut c_ushort; entry = (*entry).child; ii = 0 as c_int; while !entry.is_null() { - *((*mesh).triangles).offset(ii as isize) = - (*entry).valueInt as c_ushort; + *((*mesh).triangles) + .offset(ii as isize) = (*entry).valueInt as c_ushort; entry = (*entry).next; ii += 1; } @@ -22964,18 +27001,18 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( b"uvs\0" as *const u8 as *const c_char, ); verticesLength = (*entry).size; - (*mesh).regionUVs = _spMalloc( + (*mesh) + .regionUVs = _spMalloc( (::core::mem::size_of::() as c_ulong) .wrapping_mul(verticesLength as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 12102 as c_int, - ) - as *mut c_float; + 13006 as c_int, + ) as *mut c_float; entry = (*entry).child; ii = 0 as c_int; while !entry.is_null() { - *((*mesh).regionUVs).offset(ii as isize) = - (*entry).valueFloat; + *((*mesh).regionUVs) + .offset(ii as isize) = (*entry).valueFloat; entry = (*entry).next; ii += 1; } @@ -22988,7 +27025,8 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( if !((*mesh).region).is_null() { spMeshAttachment_updateRegion(mesh); } - (*mesh).hullLength = Json_getInt( + (*mesh) + .hullLength = Json_getInt( attachmentMap, b"hull\0" as *const u8 as *const c_char, 0 as c_int, @@ -22999,18 +27037,18 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( ); if !entry.is_null() { (*mesh).edgesCount = (*entry).size; - (*mesh).edges = _spMalloc( - (::core::mem::size_of::() as c_ulong) + (*mesh) + .edges = _spMalloc( + (::core::mem::size_of::() as c_ulong) .wrapping_mul((*entry).size as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 12115 as c_int, - ) - as *mut c_int; + 13019 as c_int, + ) as *mut c_ushort; entry = (*entry).child; ii = 0 as c_int; while !entry.is_null() { - *((*mesh).edges).offset(ii as isize) = - (*entry).valueInt; + *((*mesh).edges) + .offset(ii as isize) = (*entry).valueInt as c_ushort; entry = (*entry).next; ii += 1; } @@ -23031,7 +27069,7 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( Json_getString( attachmentMap, b"skin\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ), (*slot).index, (*entry).valueString, @@ -23040,8 +27078,8 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( } } 1 => { - let mut box_0: *mut spBoundingBoxAttachment = - attachment as *mut spBoundingBoxAttachment; + let mut box_0: *mut spBoundingBoxAttachment = attachment + as *mut spBoundingBoxAttachment; let mut vertexCount: c_int = Json_getInt( attachmentMap, b"vertexCount\0" as *const u8 as *const c_char, @@ -23057,7 +27095,7 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( color_1 = Json_getString( attachmentMap, b"color\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ); if !color_1.is_null() { spColor_setFromFloats( @@ -23074,15 +27112,17 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( ); } 4 => { - let mut pathAttachment: *mut spPathAttachment = - attachment as *mut spPathAttachment; + let mut pathAttachment: *mut spPathAttachment = attachment + as *mut spPathAttachment; let mut vertexCount_0: c_int = 0 as c_int; - (*pathAttachment).closed = Json_getInt( + (*pathAttachment) + .closed = Json_getInt( attachmentMap, b"closed\0" as *const u8 as *const c_char, 0 as c_int, ); - (*pathAttachment).constantSpeed = Json_getInt( + (*pathAttachment) + .constantSpeed = Json_getInt( attachmentMap, b"constantSpeed\0" as *const u8 as *const c_char, 1 as c_int, @@ -23098,16 +27138,17 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( &mut (*pathAttachment).super_0, vertexCount_0 << 1 as c_int, ); - (*pathAttachment).lengthsLength = vertexCount_0 / 3 as c_int; - (*pathAttachment).lengths = _spMalloc( + (*pathAttachment) + .lengthsLength = vertexCount_0 / 3 as c_int; + (*pathAttachment) + .lengths = _spMalloc( (::core::mem::size_of::() as c_ulong) .wrapping_mul( (*pathAttachment).lengthsLength as c_ulong, ), b"spine.c\0" as *const u8 as *const c_char, - 12154 as c_int, - ) - as *mut c_float; + 13058 as c_int, + ) as *mut c_float; curves = Json_getItem( attachmentMap, b"lengths\0" as *const u8 as *const c_char, @@ -23115,15 +27156,17 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( curves = (*curves).child; ii = 0 as c_int; while !curves.is_null() { - *((*pathAttachment).lengths).offset(ii as isize) = - (*curves).valueFloat * (*self_0).scale; + *((*pathAttachment).lengths) + .offset( + ii as isize, + ) = (*curves).valueFloat * (*self_0).scale; curves = (*curves).next; ii += 1; } color_1 = Json_getString( attachmentMap, b"color\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ); if !color_1.is_null() { spColor_setFromFloats( @@ -23136,19 +27179,22 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( } } 5 => { - let mut point: *mut spPointAttachment = - attachment as *mut spPointAttachment; - (*point).x = Json_getFloat( + let mut point: *mut spPointAttachment = attachment + as *mut spPointAttachment; + (*point) + .x = Json_getFloat( attachmentMap, b"x\0" as *const u8 as *const c_char, 0 as c_int as c_float, ) * (*self_0).scale; - (*point).y = Json_getFloat( + (*point) + .y = Json_getFloat( attachmentMap, b"y\0" as *const u8 as *const c_char, 0 as c_int as c_float, ) * (*self_0).scale; - (*point).rotation = Json_getFloat( + (*point) + .rotation = Json_getFloat( attachmentMap, b"rotation\0" as *const u8 as *const c_char, 0 as c_int as c_float, @@ -23156,7 +27202,7 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( color_1 = Json_getString( attachmentMap, b"color\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ); if !color_1.is_null() { spColor_setFromFloats( @@ -23169,17 +27215,19 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( } } 6 => { - let mut clip: *mut spClippingAttachment = - attachment as *mut spClippingAttachment; + let mut clip: *mut spClippingAttachment = attachment + as *mut spClippingAttachment; let mut vertexCount_1: c_int = 0 as c_int; let mut end: *const c_char = Json_getString( attachmentMap, b"end\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ); if !end.is_null() { - let mut endSlot: *mut spSlotData = - spSkeletonData_findSlot(skeletonData, end); + let mut endSlot: *mut spSlotData = spSkeletonData_findSlot( + skeletonData, + end, + ); (*clip).endSlot = endSlot; } vertexCount_1 = Json_getInt( @@ -23196,7 +27244,7 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( color_1 = Json_getString( attachmentMap, b"color\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ); if !color_1.is_null() { spColor_setFromFloats( @@ -23232,8 +27280,9 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( } i = 0 as c_int; while i < (*internal).linkedMeshCount { - let mut parent_0: *mut spAttachment = std::ptr::null_mut(); - let mut linkedMesh: *mut _spLinkedMeshJson = ((*internal).linkedMeshes).offset(i as isize); + let mut parent_0: *mut spAttachment = 0 as *mut spAttachment; + let mut linkedMesh: *mut _spLinkedMeshJson = ((*internal).linkedMeshes) + .offset(i as isize); let mut skin_0: *mut spSkin = if ((*linkedMesh).skin).is_null() { (*skeletonData).defaultSkin } else { @@ -23243,29 +27292,38 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( spSkeletonData_dispose(skeletonData); _spSkeletonJson_setError( self_0, - std::ptr::null_mut(), + 0 as *mut Json, b"Skin not found: \0" as *const u8 as *const c_char, (*linkedMesh).skin, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } - parent_0 = spSkin_getAttachment(skin_0, (*linkedMesh).slotIndex, (*linkedMesh).parent); + parent_0 = spSkin_getAttachment( + skin_0, + (*linkedMesh).slotIndex, + (*linkedMesh).parent, + ); if parent_0.is_null() { spSkeletonData_dispose(skeletonData); _spSkeletonJson_setError( self_0, - std::ptr::null_mut(), + 0 as *mut Json, b"Parent mesh not found: \0" as *const u8 as *const c_char, (*linkedMesh).parent, ); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } - (*(*linkedMesh).mesh).super_0.timelineAttachment = if (*linkedMesh).inheritTimeline != 0 { + (*(*linkedMesh).mesh) + .super_0 + .timelineAttachment = if (*linkedMesh).inheritTimeline != 0 { parent_0 } else { &mut (*(*linkedMesh).mesh).super_0.super_0 }; - spMeshAttachment_setParentMesh((*linkedMesh).mesh, parent_0 as *mut spMeshAttachment); + spMeshAttachment_setParentMesh( + (*linkedMesh).mesh, + parent_0 as *mut spMeshAttachment, + ); if !((*(*linkedMesh).mesh).region).is_null() { spMeshAttachment_updateRegion((*linkedMesh).mesh); } @@ -23277,23 +27335,29 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( } events = Json_getItem(root, b"events\0" as *const u8 as *const c_char); if !events.is_null() { - let mut eventMap: *mut Json = std::ptr::null_mut(); - let mut stringValue: *const c_char = std::ptr::null(); - let mut audioPath: *const c_char = std::ptr::null(); + let mut eventMap: *mut Json = 0 as *mut Json; + let mut stringValue: *const c_char = 0 as *const c_char; + let mut audioPath: *const c_char = 0 as *const c_char; (*skeletonData).eventsCount = (*events).size; - (*skeletonData).events = _spMalloc( + (*skeletonData) + .events = _spMalloc( (::core::mem::size_of::<*mut spEventData>() as c_ulong) .wrapping_mul((*events).size as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 12245 as c_int, + 13149 as c_int, ) as *mut *mut spEventData; eventMap = (*events).child; i = 0 as c_int; while !eventMap.is_null() { let mut eventData: *mut spEventData = spEventData_create((*eventMap).name); - (*eventData).intValue = - Json_getInt(eventMap, b"int\0" as *const u8 as *const c_char, 0 as c_int); - (*eventData).floatValue = Json_getFloat( + (*eventData) + .intValue = Json_getInt( + eventMap, + b"int\0" as *const u8 as *const c_char, + 0 as c_int, + ); + (*eventData) + .floatValue = Json_getFloat( eventMap, b"float\0" as *const u8 as *const c_char, 0 as c_int as c_float, @@ -23301,74 +27365,83 @@ pub unsafe extern "C" fn spSkeletonJson_readSkeletonData( stringValue = Json_getString( eventMap, b"string\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ); if !stringValue.is_null() { - let ref mut fresh200 = - *(&mut (*eventData).stringValue as *mut *const c_char as *mut *mut c_char); - *fresh200 = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul( - (spine_strlen(stringValue)).wrapping_add(1 as c_int as c_ulong), - ), + (*eventData) + .stringValue = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul( + (spine_strlen(stringValue)) + .wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 12251 as c_int, + 13155 as c_int, ) as *mut c_char; - spine_strcpy(*fresh200, stringValue); + spine_strcpy((*eventData).stringValue, stringValue); } audioPath = Json_getString( eventMap, b"audio\0" as *const u8 as *const c_char, - std::ptr::null(), + 0 as *const c_char, ); if !audioPath.is_null() { - let ref mut fresh201 = - *(&mut (*eventData).audioPath as *mut *const c_char as *mut *mut c_char); - *fresh201 = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul( - (spine_strlen(audioPath)).wrapping_add(1 as c_int as c_ulong), - ), + (*eventData) + .audioPath = _spMalloc( + (::core::mem::size_of::() as c_ulong) + .wrapping_mul( + (spine_strlen(audioPath)) + .wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 12254 as c_int, + 13158 as c_int, ) as *mut c_char; - spine_strcpy(*fresh201, audioPath); - (*eventData).volume = Json_getFloat( + spine_strcpy((*eventData).audioPath, audioPath); + (*eventData) + .volume = Json_getFloat( eventMap, b"volume\0" as *const u8 as *const c_char, 1 as c_int as c_float, ); - (*eventData).balance = Json_getFloat( + (*eventData) + .balance = Json_getFloat( eventMap, b"balance\0" as *const u8 as *const c_char, 0 as c_int as c_float, ); } - let ref mut fresh202 = *((*skeletonData).events).offset(i as isize); - *fresh202 = eventData; + let ref mut fresh147 = *((*skeletonData).events).offset(i as isize); + *fresh147 = eventData; eventMap = (*eventMap).next; i += 1; } } animations = Json_getItem(root, b"animations\0" as *const u8 as *const c_char); if !animations.is_null() { - let mut animationMap: *mut Json = std::ptr::null_mut(); - (*skeletonData).animations = _spMalloc( + let mut animationMap: *mut Json = 0 as *mut Json; + (*skeletonData) + .animations = _spMalloc( (::core::mem::size_of::<*mut spAnimation>() as c_ulong) .wrapping_mul((*animations).size as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 12266 as c_int, + 13170 as c_int, ) as *mut *mut spAnimation; animationMap = (*animations).child; while !animationMap.is_null() { - let mut animation: *mut spAnimation = - _spSkeletonJson_readAnimation(self_0, animationMap, skeletonData); + let mut animation: *mut spAnimation = _spSkeletonJson_readAnimation( + self_0, + animationMap, + skeletonData, + ); if animation.is_null() { spSkeletonData_dispose(skeletonData); - return std::ptr::null_mut(); + return 0 as *mut spSkeletonData; } - let fresh203 = (*skeletonData).animationsCount; + let fresh148 = (*skeletonData).animationsCount; (*skeletonData).animationsCount = (*skeletonData).animationsCount + 1; - let ref mut fresh204 = *((*skeletonData).animations).offset(fresh203 as isize); - *fresh204 = animation; + let ref mut fresh149 = *((*skeletonData).animations) + .offset(fresh148 as isize); + *fresh149 = animation; animationMap = (*animationMap).next; } } @@ -23383,15 +27456,16 @@ pub unsafe extern "C" fn spBoneDataArray_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 12313 as c_int, + 13217 as c_int, ) as *mut spBoneDataArray; (*array).size = 0 as c_int; (*array).capacity = initialCapacity; - (*array).items = _spCalloc( + (*array) + .items = _spCalloc( initialCapacity as size_t, ::core::mem::size_of::<*mut spBoneData>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 12313 as c_int, + 13217 as c_int, ) as *mut *mut spBoneData; return array; } @@ -23411,12 +27485,16 @@ pub unsafe extern "C" fn spBoneDataArray_setSize( ) -> *mut spBoneDataArray { (*self_0).size = newSize; if (*self_0).capacity < newSize { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spBoneData>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -23433,7 +27511,8 @@ pub unsafe extern "C" fn spBoneDataArray_ensureCapacity( return; } (*self_0).capacity = newCapacity; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spBoneData>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -23445,21 +27524,25 @@ pub unsafe extern "C" fn spBoneDataArray_add( mut value: *mut spBoneData, ) { if (*self_0).size == (*self_0).capacity { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spBoneData>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), ) as *mut *mut spBoneData; } - let fresh205 = (*self_0).size; + let fresh150 = (*self_0).size; (*self_0).size = (*self_0).size + 1; - let ref mut fresh206 = *((*self_0).items).offset(fresh205 as isize); - *fresh206 = value; + let ref mut fresh151 = *((*self_0).items).offset(fresh150 as isize); + *fresh151 = value; } #[no_mangle] pub unsafe extern "C" fn spBoneDataArray_addAll( @@ -23494,9 +27577,8 @@ pub unsafe extern "C" fn spBoneDataArray_removeAt( (*self_0).size -= 1; spine_memmove( ((*self_0).items).offset(index as isize) as *mut c_void, - ((*self_0).items) - .offset(index as isize) - .offset(1 as c_int as isize) as *const c_void, + ((*self_0).items).offset(index as isize).offset(1 as c_int as isize) + as *const c_void, (::core::mem::size_of::<*mut spBoneData>() as c_ulong) .wrapping_mul(((*self_0).size - index) as c_ulong), ); @@ -23520,13 +27602,17 @@ pub unsafe extern "C" fn spBoneDataArray_contains( return 0 as c_int; } #[no_mangle] -pub unsafe extern "C" fn spBoneDataArray_pop(mut self_0: *mut spBoneDataArray) -> *mut spBoneData { +pub unsafe extern "C" fn spBoneDataArray_pop( + mut self_0: *mut spBoneDataArray, +) -> *mut spBoneData { (*self_0).size -= 1; let mut item: *mut spBoneData = *((*self_0).items).offset((*self_0).size as isize); return item; } #[no_mangle] -pub unsafe extern "C" fn spBoneDataArray_peek(mut self_0: *mut spBoneDataArray) -> *mut spBoneData { +pub unsafe extern "C" fn spBoneDataArray_peek( + mut self_0: *mut spBoneDataArray, +) -> *mut spBoneData { return *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize); } #[no_mangle] @@ -23537,25 +27623,30 @@ pub unsafe extern "C" fn spIkConstraintDataArray_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 12315 as c_int, + 13219 as c_int, ) as *mut spIkConstraintDataArray; (*array).size = 0 as c_int; (*array).capacity = initialCapacity; - (*array).items = _spCalloc( + (*array) + .items = _spCalloc( initialCapacity as size_t, ::core::mem::size_of::<*mut spIkConstraintData>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 12315 as c_int, + 13219 as c_int, ) as *mut *mut spIkConstraintData; return array; } #[no_mangle] -pub unsafe extern "C" fn spIkConstraintDataArray_dispose(mut self_0: *mut spIkConstraintDataArray) { +pub unsafe extern "C" fn spIkConstraintDataArray_dispose( + mut self_0: *mut spIkConstraintDataArray, +) { _spFree((*self_0).items as *mut c_void); _spFree(self_0 as *mut c_void); } #[no_mangle] -pub unsafe extern "C" fn spIkConstraintDataArray_clear(mut self_0: *mut spIkConstraintDataArray) { +pub unsafe extern "C" fn spIkConstraintDataArray_clear( + mut self_0: *mut spIkConstraintDataArray, +) { (*self_0).size = 0 as c_int; } #[no_mangle] @@ -23565,12 +27656,16 @@ pub unsafe extern "C" fn spIkConstraintDataArray_setSize( ) -> *mut spIkConstraintDataArray { (*self_0).size = newSize; if (*self_0).capacity < newSize { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spIkConstraintData>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -23587,7 +27682,8 @@ pub unsafe extern "C" fn spIkConstraintDataArray_ensureCapacity( return; } (*self_0).capacity = newCapacity; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spIkConstraintData>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -23599,21 +27695,25 @@ pub unsafe extern "C" fn spIkConstraintDataArray_add( mut value: *mut spIkConstraintData, ) { if (*self_0).size == (*self_0).capacity { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spIkConstraintData>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), ) as *mut *mut spIkConstraintData; } - let fresh207 = (*self_0).size; + let fresh152 = (*self_0).size; (*self_0).size = (*self_0).size + 1; - let ref mut fresh208 = *((*self_0).items).offset(fresh207 as isize); - *fresh208 = value; + let ref mut fresh153 = *((*self_0).items).offset(fresh152 as isize); + *fresh153 = value; } #[no_mangle] pub unsafe extern "C" fn spIkConstraintDataArray_addAll( @@ -23648,9 +27748,8 @@ pub unsafe extern "C" fn spIkConstraintDataArray_removeAt( (*self_0).size -= 1; spine_memmove( ((*self_0).items).offset(index as isize) as *mut c_void, - ((*self_0).items) - .offset(index as isize) - .offset(1 as c_int as isize) as *const c_void, + ((*self_0).items).offset(index as isize).offset(1 as c_int as isize) + as *const c_void, (::core::mem::size_of::<*mut spIkConstraintData>() as c_ulong) .wrapping_mul(((*self_0).size - index) as c_ulong), ); @@ -23678,7 +27777,8 @@ pub unsafe extern "C" fn spIkConstraintDataArray_pop( mut self_0: *mut spIkConstraintDataArray, ) -> *mut spIkConstraintData { (*self_0).size -= 1; - let mut item: *mut spIkConstraintData = *((*self_0).items).offset((*self_0).size as isize); + let mut item: *mut spIkConstraintData = *((*self_0).items) + .offset((*self_0).size as isize); return item; } #[no_mangle] @@ -23695,16 +27795,16 @@ pub unsafe extern "C" fn spTransformConstraintDataArray_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 12317 as c_int, - ) - as *mut spTransformConstraintDataArray; + 13221 as c_int, + ) as *mut spTransformConstraintDataArray; (*array).size = 0 as c_int; (*array).capacity = initialCapacity; - (*array).items = _spCalloc( + (*array) + .items = _spCalloc( initialCapacity as size_t, ::core::mem::size_of::<*mut spTransformConstraintData>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 12317 as c_int, + 13221 as c_int, ) as *mut *mut spTransformConstraintData; return array; } @@ -23728,12 +27828,16 @@ pub unsafe extern "C" fn spTransformConstraintDataArray_setSize( ) -> *mut spTransformConstraintDataArray { (*self_0).size = newSize; if (*self_0).capacity < newSize { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spTransformConstraintData>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -23750,7 +27854,8 @@ pub unsafe extern "C" fn spTransformConstraintDataArray_ensureCapacity( return; } (*self_0).capacity = newCapacity; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spTransformConstraintData>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -23762,21 +27867,25 @@ pub unsafe extern "C" fn spTransformConstraintDataArray_add( mut value: *mut spTransformConstraintData, ) { if (*self_0).size == (*self_0).capacity { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spTransformConstraintData>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), ) as *mut *mut spTransformConstraintData; } - let fresh209 = (*self_0).size; + let fresh154 = (*self_0).size; (*self_0).size = (*self_0).size + 1; - let ref mut fresh210 = *((*self_0).items).offset(fresh209 as isize); - *fresh210 = value; + let ref mut fresh155 = *((*self_0).items).offset(fresh154 as isize); + *fresh155 = value; } #[no_mangle] pub unsafe extern "C" fn spTransformConstraintDataArray_addAll( @@ -23811,9 +27920,8 @@ pub unsafe extern "C" fn spTransformConstraintDataArray_removeAt( (*self_0).size -= 1; spine_memmove( ((*self_0).items).offset(index as isize) as *mut c_void, - ((*self_0).items) - .offset(index as isize) - .offset(1 as c_int as isize) as *const c_void, + ((*self_0).items).offset(index as isize).offset(1 as c_int as isize) + as *const c_void, (::core::mem::size_of::<*mut spTransformConstraintData>() as c_ulong) .wrapping_mul(((*self_0).size - index) as c_ulong), ); @@ -23841,8 +27949,8 @@ pub unsafe extern "C" fn spTransformConstraintDataArray_pop( mut self_0: *mut spTransformConstraintDataArray, ) -> *mut spTransformConstraintData { (*self_0).size -= 1; - let mut item: *mut spTransformConstraintData = - *((*self_0).items).offset((*self_0).size as isize); + let mut item: *mut spTransformConstraintData = *((*self_0).items) + .offset((*self_0).size as isize); return item; } #[no_mangle] @@ -23859,15 +27967,16 @@ pub unsafe extern "C" fn spPathConstraintDataArray_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 12319 as c_int, + 13223 as c_int, ) as *mut spPathConstraintDataArray; (*array).size = 0 as c_int; (*array).capacity = initialCapacity; - (*array).items = _spCalloc( + (*array) + .items = _spCalloc( initialCapacity as size_t, ::core::mem::size_of::<*mut spPathConstraintData>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 12319 as c_int, + 13223 as c_int, ) as *mut *mut spPathConstraintData; return array; } @@ -23891,12 +28000,16 @@ pub unsafe extern "C" fn spPathConstraintDataArray_setSize( ) -> *mut spPathConstraintDataArray { (*self_0).size = newSize; if (*self_0).capacity < newSize { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spPathConstraintData>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -23913,7 +28026,8 @@ pub unsafe extern "C" fn spPathConstraintDataArray_ensureCapacity( return; } (*self_0).capacity = newCapacity; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spPathConstraintData>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), @@ -23925,21 +28039,25 @@ pub unsafe extern "C" fn spPathConstraintDataArray_add( mut value: *mut spPathConstraintData, ) { if (*self_0).size == (*self_0).capacity { - (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { 8 as c_int } else { ((*self_0).size as c_float * 1.75f32) as c_int }; - (*self_0).items = _spRealloc( + (*self_0) + .items = _spRealloc( (*self_0).items as *mut c_void, (::core::mem::size_of::<*mut spPathConstraintData>() as c_ulong) .wrapping_mul((*self_0).capacity as c_ulong), ) as *mut *mut spPathConstraintData; } - let fresh211 = (*self_0).size; + let fresh156 = (*self_0).size; (*self_0).size = (*self_0).size + 1; - let ref mut fresh212 = *((*self_0).items).offset(fresh211 as isize); - *fresh212 = value; + let ref mut fresh157 = *((*self_0).items).offset(fresh156 as isize); + *fresh157 = value; } #[no_mangle] pub unsafe extern "C" fn spPathConstraintDataArray_addAll( @@ -23974,9 +28092,8 @@ pub unsafe extern "C" fn spPathConstraintDataArray_removeAt( (*self_0).size -= 1; spine_memmove( ((*self_0).items).offset(index as isize) as *mut c_void, - ((*self_0).items) - .offset(index as isize) - .offset(1 as c_int as isize) as *const c_void, + ((*self_0).items).offset(index as isize).offset(1 as c_int as isize) + as *const c_void, (::core::mem::size_of::<*mut spPathConstraintData>() as c_ulong) .wrapping_mul(((*self_0).size - index) as c_ulong), ); @@ -24004,7 +28121,8 @@ pub unsafe extern "C" fn spPathConstraintDataArray_pop( mut self_0: *mut spPathConstraintDataArray, ) -> *mut spPathConstraintData { (*self_0).size -= 1; - let mut item: *mut spPathConstraintData = *((*self_0).items).offset((*self_0).size as isize); + let mut item: *mut spPathConstraintData = *((*self_0).items) + .offset((*self_0).size as isize); return item; } #[no_mangle] @@ -24014,6 +28132,178 @@ pub unsafe extern "C" fn spPathConstraintDataArray_peek( return *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize); } #[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraintDataArray_create( + mut initialCapacity: c_int, +) -> *mut spPhysicsConstraintDataArray { + let mut array: *mut spPhysicsConstraintDataArray = _spCalloc( + 1 as c_int as size_t, + ::core::mem::size_of::() as c_ulong, + b"spine.c\0" as *const u8 as *const c_char, + 13225 as c_int, + ) as *mut spPhysicsConstraintDataArray; + (*array).size = 0 as c_int; + (*array).capacity = initialCapacity; + (*array) + .items = _spCalloc( + initialCapacity as size_t, + ::core::mem::size_of::<*mut spPhysicsConstraintData>() as c_ulong, + b"spine.c\0" as *const u8 as *const c_char, + 13225 as c_int, + ) as *mut *mut spPhysicsConstraintData; + return array; +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraintDataArray_dispose( + mut self_0: *mut spPhysicsConstraintDataArray, +) { + _spFree((*self_0).items as *mut c_void); + _spFree(self_0 as *mut c_void); +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraintDataArray_clear( + mut self_0: *mut spPhysicsConstraintDataArray, +) { + (*self_0).size = 0 as c_int; +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraintDataArray_setSize( + mut self_0: *mut spPhysicsConstraintDataArray, + mut newSize: c_int, +) -> *mut spPhysicsConstraintDataArray { + (*self_0).size = newSize; + if (*self_0).capacity < newSize { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { + 8 as c_int + } else { + ((*self_0).size as c_float * 1.75f32) as c_int + }; + (*self_0) + .items = _spRealloc( + (*self_0).items as *mut c_void, + (::core::mem::size_of::<*mut spPhysicsConstraintData>() as c_ulong) + .wrapping_mul((*self_0).capacity as c_ulong), + ) as *mut *mut spPhysicsConstraintData; + } + return self_0; +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraintDataArray_ensureCapacity( + mut self_0: *mut spPhysicsConstraintDataArray, + mut newCapacity: c_int, +) { + if (*self_0).capacity >= newCapacity { + return; + } + (*self_0).capacity = newCapacity; + (*self_0) + .items = _spRealloc( + (*self_0).items as *mut c_void, + (::core::mem::size_of::<*mut spPhysicsConstraintData>() as c_ulong) + .wrapping_mul((*self_0).capacity as c_ulong), + ) as *mut *mut spPhysicsConstraintData; +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraintDataArray_add( + mut self_0: *mut spPhysicsConstraintDataArray, + mut value: *mut spPhysicsConstraintData, +) { + if (*self_0).size == (*self_0).capacity { + (*self_0) + .capacity = if 8 as c_int + > ((*self_0).size as c_float * 1.75f32) as c_int + { + 8 as c_int + } else { + ((*self_0).size as c_float * 1.75f32) as c_int + }; + (*self_0) + .items = _spRealloc( + (*self_0).items as *mut c_void, + (::core::mem::size_of::<*mut spPhysicsConstraintData>() as c_ulong) + .wrapping_mul((*self_0).capacity as c_ulong), + ) as *mut *mut spPhysicsConstraintData; + } + let fresh158 = (*self_0).size; + (*self_0).size = (*self_0).size + 1; + let ref mut fresh159 = *((*self_0).items).offset(fresh158 as isize); + *fresh159 = value; +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraintDataArray_addAll( + mut self_0: *mut spPhysicsConstraintDataArray, + mut other: *mut spPhysicsConstraintDataArray, +) { + let mut i: c_int = 0 as c_int; + while i < (*other).size { + spPhysicsConstraintDataArray_add(self_0, *((*other).items).offset(i as isize)); + i += 1; + } +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraintDataArray_addAllValues( + mut self_0: *mut spPhysicsConstraintDataArray, + mut values: *mut *mut spPhysicsConstraintData, + mut offset: c_int, + mut count: c_int, +) { + let mut i: c_int = offset; + let mut n: c_int = offset + count; + while i < n { + spPhysicsConstraintDataArray_add(self_0, *values.offset(i as isize)); + i += 1; + } +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraintDataArray_removeAt( + mut self_0: *mut spPhysicsConstraintDataArray, + mut index: c_int, +) { + (*self_0).size -= 1; + spine_memmove( + ((*self_0).items).offset(index as isize) as *mut c_void, + ((*self_0).items).offset(index as isize).offset(1 as c_int as isize) + as *const c_void, + (::core::mem::size_of::<*mut spPhysicsConstraintData>() as c_ulong) + .wrapping_mul(((*self_0).size - index) as c_ulong), + ); +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraintDataArray_contains( + mut self_0: *mut spPhysicsConstraintDataArray, + mut value: *mut spPhysicsConstraintData, +) -> c_int { + let mut items: *mut *mut spPhysicsConstraintData = (*self_0).items; + let mut i: c_int = 0; + let mut n: c_int = 0; + i = 0 as c_int; + n = (*self_0).size; + while i < n { + if *items.offset(i as isize) == value { + return -(1 as c_int); + } + i += 1; + } + return 0 as c_int; +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraintDataArray_pop( + mut self_0: *mut spPhysicsConstraintDataArray, +) -> *mut spPhysicsConstraintData { + (*self_0).size -= 1; + let mut item: *mut spPhysicsConstraintData = *((*self_0).items) + .offset((*self_0).size as isize); + return item; +} +#[no_mangle] +pub unsafe extern "C" fn spPhysicsConstraintDataArray_peek( + mut self_0: *mut spPhysicsConstraintDataArray, +) -> *mut spPhysicsConstraintData { + return *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize); +} +#[no_mangle] pub unsafe extern "C" fn _Entry_create( mut slotIndex: c_int, mut name: *const c_char, @@ -24023,17 +28313,20 @@ pub unsafe extern "C" fn _Entry_create( 1 as c_int as size_t, ::core::mem::size_of::<_Entry>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 12322 as c_int, + 13228 as c_int, ) as *mut _Entry; (*self_0).slotIndex = slotIndex; - let ref mut fresh213 = *(&mut (*self_0).name as *mut *const c_char as *mut *mut c_char); - *fresh213 = _spMalloc( + (*self_0) + .name = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen(name as *mut c_char)) + .wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 12324 as c_int, + 13230 as c_int, ) as *mut c_char; - spine_strcpy(*fresh213, name); + spine_strcpy((*self_0).name, name as *mut c_char); (*self_0).attachment = attachment; return self_0; } @@ -24050,7 +28343,7 @@ unsafe extern "C" fn _SkinHashTableEntry_create( 1 as c_int as size_t, ::core::mem::size_of::<_SkinHashTableEntry>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 12336 as c_int, + 13242 as c_int, ) as *mut _SkinHashTableEntry; (*self_0).entry = entry; return self_0; @@ -24061,25 +28354,42 @@ unsafe extern "C" fn _SkinHashTableEntry_dispose(mut self_0: *mut _SkinHashTable #[no_mangle] pub unsafe extern "C" fn spSkin_create(mut name: *const c_char) -> *mut spSkin { let mut self_0: *mut spSkin = &mut (*((_spCalloc - as unsafe extern "C" fn(size_t, size_t, *const c_char, c_int) -> *mut c_void)( + as unsafe extern "C" fn( + size_t, + size_t, + *const c_char, + c_int, + ) -> *mut c_void)( 1 as c_int as size_t, ::core::mem::size_of::<_spSkin>() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 12348 as c_int, + 13254 as c_int, ) as *mut _spSkin)) .super_0; - let ref mut fresh214 = *(&mut (*self_0).name as *mut *mut c_char); - *fresh214 = _spMalloc( + (*self_0) + .name = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen(name as *mut c_char)) + .wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 12349 as c_int, + 13255 as c_int, ) as *mut c_char; - spine_strcpy(*fresh214, name); + spine_strcpy((*self_0).name, name as *mut c_char); (*self_0).bones = spBoneDataArray_create(4 as c_int); (*self_0).ikConstraints = spIkConstraintDataArray_create(4 as c_int); - (*self_0).transformConstraints = spTransformConstraintDataArray_create(4 as c_int); + (*self_0) + .transformConstraints = spTransformConstraintDataArray_create(4 as c_int); (*self_0).pathConstraints = spPathConstraintDataArray_create(4 as c_int); + (*self_0).physicsConstraints = spPhysicsConstraintDataArray_create(4 as c_int); + spColor_setFromFloats( + &mut (*self_0).color, + 0.99607843f32, + 0.61960787f32, + 0.30980393f32, + 1 as c_int as c_float, + ); return self_0; } #[no_mangle] @@ -24090,8 +28400,10 @@ pub unsafe extern "C" fn spSkin_dispose(mut self_0: *mut spSkin) { _Entry_dispose(entry); entry = nextEntry; } - let mut currentHashtableEntry: *mut *mut _SkinHashTableEntry = - ((*(self_0 as *mut _spSkin)).entriesHashTable).as_mut_ptr(); + let mut currentHashtableEntry: *mut *mut _SkinHashTableEntry = ((*(self_0 + as *mut _spSkin)) + .entriesHashTable) + .as_mut_ptr(); let mut i: c_int = 0; i = 0 as c_int; while i < 100 as c_int { @@ -24108,6 +28420,7 @@ pub unsafe extern "C" fn spSkin_dispose(mut self_0: *mut spSkin) { spIkConstraintDataArray_dispose((*self_0).ikConstraints); spTransformConstraintDataArray_dispose((*self_0).transformConstraints); spPathConstraintDataArray_dispose((*self_0).pathConstraints); + spPhysicsConstraintDataArray_dispose((*self_0).physicsConstraints); _spFree((*self_0).name as *mut c_void); _spFree(self_0 as *mut c_void); } @@ -24118,9 +28431,10 @@ pub unsafe extern "C" fn spSkin_setAttachment( mut name: *const c_char, mut attachment: *mut spAttachment, ) { - let mut existingEntry: *mut _SkinHashTableEntry = std::ptr::null_mut(); - let mut hashEntry: *mut _SkinHashTableEntry = (*(self_0 as *mut _spSkin)).entriesHashTable - [(slotIndex as c_uint).wrapping_rem(100 as c_int as c_uint) as usize]; + let mut existingEntry: *mut _SkinHashTableEntry = 0 as *mut _SkinHashTableEntry; + let mut hashEntry: *mut _SkinHashTableEntry = (*(self_0 as *mut _spSkin)) + .entriesHashTable[(slotIndex as c_uint) + .wrapping_rem(100 as c_int as c_uint) as usize]; while !hashEntry.is_null() { if (*(*hashEntry).entry).slotIndex == slotIndex && spine_strcmp((*(*hashEntry).entry).name, name) == 0 as c_int @@ -24142,16 +28456,20 @@ pub unsafe extern "C" fn spSkin_setAttachment( } else { let mut newEntry: *mut _Entry = _Entry_create(slotIndex, name, attachment); (*newEntry).next = (*(self_0 as *mut _spSkin)).entries; - let ref mut fresh215 = (*(self_0 as *mut _spSkin)).entries; - *fresh215 = newEntry; - let mut hashTableIndex: c_uint = (slotIndex as c_uint).wrapping_rem(100 as c_int as c_uint); - let mut hashTable: *mut *mut _SkinHashTableEntry = - ((*(self_0 as *mut _spSkin)).entriesHashTable).as_mut_ptr(); - let mut newHashEntry: *mut _SkinHashTableEntry = _SkinHashTableEntry_create(newEntry); + let ref mut fresh160 = (*(self_0 as *mut _spSkin)).entries; + *fresh160 = newEntry; + let mut hashTableIndex: c_uint = (slotIndex as c_uint) + .wrapping_rem(100 as c_int as c_uint); + let mut hashTable: *mut *mut _SkinHashTableEntry = ((*(self_0 as *mut _spSkin)) + .entriesHashTable) + .as_mut_ptr(); + let mut newHashEntry: *mut _SkinHashTableEntry = _SkinHashTableEntry_create( + newEntry, + ); (*newHashEntry).next = *hashTable.offset(hashTableIndex as isize); - let ref mut fresh216 = - (*(self_0 as *mut _spSkin)).entriesHashTable[hashTableIndex as usize]; - *fresh216 = newHashEntry; + let ref mut fresh161 = (*(self_0 as *mut _spSkin)) + .entriesHashTable[hashTableIndex as usize]; + *fresh161 = newHashEntry; }; } #[no_mangle] @@ -24160,8 +28478,9 @@ pub unsafe extern "C" fn spSkin_getAttachment( mut slotIndex: c_int, mut name: *const c_char, ) -> *mut spAttachment { - let mut hashEntry: *const _SkinHashTableEntry = (*(self_0 as *mut _spSkin)).entriesHashTable - [(slotIndex as c_uint).wrapping_rem(100 as c_int as c_uint) as usize]; + let mut hashEntry: *const _SkinHashTableEntry = (*(self_0 as *mut _spSkin)) + .entriesHashTable[(slotIndex as c_uint) + .wrapping_rem(100 as c_int as c_uint) as usize]; while !hashEntry.is_null() { if (*(*hashEntry).entry).slotIndex == slotIndex && spine_strcmp((*(*hashEntry).entry).name, name) == 0 as c_int @@ -24170,7 +28489,7 @@ pub unsafe extern "C" fn spSkin_getAttachment( } hashEntry = (*hashEntry).next; } - return std::ptr::null_mut(); + return 0 as *mut spAttachment; } #[no_mangle] pub unsafe extern "C" fn spSkin_getAttachmentName( @@ -24189,7 +28508,7 @@ pub unsafe extern "C" fn spSkin_getAttachmentName( } entry = (*entry).next; } - return std::ptr::null(); + return 0 as *const c_char; } #[no_mangle] pub unsafe extern "C" fn spSkin_attachAll( @@ -24199,10 +28518,14 @@ pub unsafe extern "C" fn spSkin_attachAll( ) { let mut entry: *const _Entry = (*(oldSkin as *mut _spSkin)).entries; while !entry.is_null() { - let mut slot: *mut spSlot = *((*skeleton).slots).offset((*entry).slotIndex as isize); + let mut slot: *mut spSlot = *((*skeleton).slots) + .offset((*entry).slotIndex as isize); if (*slot).attachment == (*entry).attachment { - let mut attachment: *mut spAttachment = - spSkin_getAttachment(self_0, (*entry).slotIndex, (*entry).name); + let mut attachment: *mut spAttachment = spSkin_getAttachment( + self_0, + (*entry).slotIndex, + (*entry).name, + ); if !attachment.is_null() { spSlot_setAttachment(slot, attachment); } @@ -24211,9 +28534,12 @@ pub unsafe extern "C" fn spSkin_attachAll( } } #[no_mangle] -pub unsafe extern "C" fn spSkin_addSkin(mut self_0: *mut spSkin, mut other: *const spSkin) { +pub unsafe extern "C" fn spSkin_addSkin( + mut self_0: *mut spSkin, + mut other: *const spSkin, +) { let mut i: c_int = 0 as c_int; - let mut entry: *mut spSkinEntry = std::ptr::null_mut(); + let mut entry: *mut spSkinEntry = 0 as *mut spSkinEntry; i = 0 as c_int; while i < (*(*other).bones).size { if spBoneDataArray_contains( @@ -24270,6 +28596,20 @@ pub unsafe extern "C" fn spSkin_addSkin(mut self_0: *mut spSkin, mut other: *con } i += 1; } + i = 0 as c_int; + while i < (*(*other).physicsConstraints).size { + if spPhysicsConstraintDataArray_contains( + (*self_0).physicsConstraints, + *((*(*other).physicsConstraints).items).offset(i as isize), + ) == 0 + { + spPhysicsConstraintDataArray_add( + (*self_0).physicsConstraints, + *((*(*other).physicsConstraints).items).offset(i as isize), + ); + } + i += 1; + } entry = spSkin_getAttachments(other); while !entry.is_null() { spSkin_setAttachment( @@ -24282,9 +28622,12 @@ pub unsafe extern "C" fn spSkin_addSkin(mut self_0: *mut spSkin, mut other: *con } } #[no_mangle] -pub unsafe extern "C" fn spSkin_copySkin(mut self_0: *mut spSkin, mut other: *const spSkin) { +pub unsafe extern "C" fn spSkin_copySkin( + mut self_0: *mut spSkin, + mut other: *const spSkin, +) { let mut i: c_int = 0 as c_int; - let mut entry: *mut spSkinEntry = std::ptr::null_mut(); + let mut entry: *mut spSkinEntry = 0 as *mut spSkinEntry; i = 0 as c_int; while i < (*(*other).bones).size { if spBoneDataArray_contains( @@ -24341,11 +28684,28 @@ pub unsafe extern "C" fn spSkin_copySkin(mut self_0: *mut spSkin, mut other: *co } i += 1; } + i = 0 as c_int; + while i < (*(*other).physicsConstraints).size { + if spPhysicsConstraintDataArray_contains( + (*self_0).physicsConstraints, + *((*(*other).physicsConstraints).items).offset(i as isize), + ) == 0 + { + spPhysicsConstraintDataArray_add( + (*self_0).physicsConstraints, + *((*(*other).physicsConstraints).items).offset(i as isize), + ); + } + i += 1; + } entry = spSkin_getAttachments(other); while !entry.is_null() { - if (*(*entry).attachment).type_0 as c_uint == SP_ATTACHMENT_MESH as c_int as c_uint { - let mut attachment: *mut spMeshAttachment = - spMeshAttachment_newLinkedMesh((*entry).attachment as *mut spMeshAttachment); + if (*(*entry).attachment).type_0 as c_uint + == SP_ATTACHMENT_MESH as c_int as c_uint + { + let mut attachment: *mut spMeshAttachment = spMeshAttachment_newLinkedMesh( + (*entry).attachment as *mut spMeshAttachment, + ); spSkin_setAttachment( self_0, (*entry).slotIndex, @@ -24353,18 +28713,26 @@ pub unsafe extern "C" fn spSkin_copySkin(mut self_0: *mut spSkin, mut other: *co &mut (*attachment).super_0.super_0, ); } else { - let mut attachment_0: *mut spAttachment = if !((*entry).attachment).is_null() { + let mut attachment_0: *mut spAttachment = if !((*entry).attachment).is_null() + { spAttachment_copy((*entry).attachment) } else { - std::ptr::null_mut() + 0 as *mut spAttachment }; - spSkin_setAttachment(self_0, (*entry).slotIndex, (*entry).name, attachment_0); + spSkin_setAttachment( + self_0, + (*entry).slotIndex, + (*entry).name, + attachment_0, + ); } entry = (*entry).next; } } #[no_mangle] -pub unsafe extern "C" fn spSkin_getAttachments(mut self_0: *const spSkin) -> *mut spSkinEntry { +pub unsafe extern "C" fn spSkin_getAttachments( + mut self_0: *const spSkin, +) -> *mut spSkinEntry { return (*(self_0 as *mut _spSkin)).entries; } #[no_mangle] @@ -24375,10 +28743,12 @@ pub unsafe extern "C" fn spSkin_clear(mut self_0: *mut spSkin) { _Entry_dispose(entry); entry = nextEntry; } - let ref mut fresh217 = (*(self_0 as *mut _spSkin)).entries; - *fresh217 = std::ptr::null_mut(); - let mut currentHashtableEntry: *mut *mut _SkinHashTableEntry = - ((*(self_0 as *mut _spSkin)).entriesHashTable).as_mut_ptr(); + let ref mut fresh162 = (*(self_0 as *mut _spSkin)).entries; + *fresh162 = 0 as *mut _Entry; + let mut currentHashtableEntry: *mut *mut _SkinHashTableEntry = ((*(self_0 + as *mut _spSkin)) + .entriesHashTable) + .as_mut_ptr(); let mut i: c_int = 0; i = 0 as c_int; while i < 100 as c_int { @@ -24388,8 +28758,8 @@ pub unsafe extern "C" fn spSkin_clear(mut self_0: *mut spSkin) { _SkinHashTableEntry_dispose(hashtableEntry); hashtableEntry = nextEntry_0; } - let ref mut fresh218 = (*(self_0 as *mut _spSkin)).entriesHashTable[i as usize]; - *fresh218 = std::ptr::null_mut(); + let ref mut fresh163 = (*(self_0 as *mut _spSkin)).entriesHashTable[i as usize]; + *fresh163 = 0 as *mut _SkinHashTableEntry; i += 1; currentHashtableEntry = currentHashtableEntry.offset(1); } @@ -24397,6 +28767,7 @@ pub unsafe extern "C" fn spSkin_clear(mut self_0: *mut spSkin) { spIkConstraintDataArray_clear((*self_0).ikConstraints); spTransformConstraintDataArray_clear((*self_0).transformConstraints); spPathConstraintDataArray_clear((*self_0).pathConstraints); + spPhysicsConstraintDataArray_clear((*self_0).physicsConstraints); } #[no_mangle] pub unsafe extern "C" fn spSlot_create( @@ -24407,12 +28778,10 @@ pub unsafe extern "C" fn spSlot_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 12594 as c_int, + 13514 as c_int, ) as *mut spSlot; - let ref mut fresh219 = *(&mut (*self_0).data as *mut *mut spSlotData); - *fresh219 = data; - let ref mut fresh220 = *(&mut (*self_0).bone as *mut *mut spBone); - *fresh220 = bone; + (*self_0).data = data; + (*self_0).bone = bone; spColor_setFromFloats( &mut (*self_0).color, 1 as c_int as c_float, @@ -24420,8 +28789,9 @@ pub unsafe extern "C" fn spSlot_create( 1 as c_int as c_float, 1 as c_int as c_float, ); - (*self_0).darkColor = if ((*data).darkColor).is_null() { - std::ptr::null_mut() + (*self_0) + .darkColor = if ((*data).darkColor).is_null() { + 0 as *mut spColor } else { spColor_create() }; @@ -24434,7 +28804,9 @@ pub unsafe extern "C" fn spSlot_dispose(mut self_0: *mut spSlot) { _spFree((*self_0).darkColor as *mut c_void); _spFree(self_0 as *mut c_void); } -unsafe extern "C" fn isVertexAttachment(mut attachment: *mut spAttachment) -> c_int { +unsafe extern "C" fn isVertexAttachment( + mut attachment: *mut spAttachment, +) -> c_int { if attachment.is_null() { return 0 as c_int; } @@ -24458,8 +28830,7 @@ pub unsafe extern "C" fn spSlot_setAttachment( { (*self_0).deformCount = 0 as c_int; } - let ref mut fresh221 = *(&mut (*self_0).attachment as *mut *mut spAttachment); - *fresh221 = attachment; + (*self_0).attachment = attachment; (*self_0).sequenceIndex = -(1 as c_int); } #[no_mangle] @@ -24469,15 +28840,14 @@ pub unsafe extern "C" fn spSlot_setToSetupPose(mut self_0: *mut spSlot) { spColor_setFromColor((*self_0).darkColor, (*(*self_0).data).darkColor); } if ((*(*self_0).data).attachmentName).is_null() { - spSlot_setAttachment(self_0, std::ptr::null_mut()); + spSlot_setAttachment(self_0, 0 as *mut spAttachment); } else { let mut attachment: *mut spAttachment = spSkeleton_getAttachmentForSlotIndex( (*(*self_0).bone).skeleton, (*(*self_0).data).index, (*(*self_0).data).attachmentName, ); - let ref mut fresh222 = *(&mut (*self_0).attachment as *mut *mut spAttachment); - *fresh222 = std::ptr::null_mut(); + (*self_0).attachment = 0 as *mut spAttachment; spSlot_setAttachment(self_0, attachment); }; } @@ -24491,19 +28861,20 @@ pub unsafe extern "C" fn spSlotData_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 12680 as c_int, + 13600 as c_int, ) as *mut spSlotData; - *(&mut (*self_0).index as *mut c_int) = index; - let ref mut fresh223 = *(&mut (*self_0).name as *mut *mut c_char); - *fresh223 = _spMalloc( + (*self_0).index = index; + (*self_0) + .name = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen(name)).wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 12682 as c_int, + 13602 as c_int, ) as *mut c_char; - spine_strcpy(*fresh223, name); - let ref mut fresh224 = *(&mut (*self_0).boneData as *mut *mut spBoneData); - *fresh224 = boneData; + spine_strcpy((*self_0).name, name); + (*self_0).boneData = boneData; spColor_setFromFloats( &mut (*self_0).color, 1 as c_int as c_float, @@ -24511,6 +28882,7 @@ pub unsafe extern "C" fn spSlotData_create( 1 as c_int as c_float, 1 as c_int as c_float, ); + (*self_0).visible = -(1 as c_int); return self_0; } #[no_mangle] @@ -24527,19 +28899,19 @@ pub unsafe extern "C" fn spSlotData_setAttachmentName( ) { _spFree((*self_0).attachmentName as *mut c_void); if !attachmentName.is_null() { - let ref mut fresh225 = - *(&mut (*self_0).attachmentName as *mut *const c_char as *mut *mut c_char); - *fresh225 = _spMalloc( + (*self_0) + .attachmentName = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(attachmentName)).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen(attachmentName)) + .wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 12698 as c_int, + 13619 as c_int, ) as *mut c_char; - spine_strcpy(*fresh225, attachmentName); + spine_strcpy((*self_0).attachmentName, attachmentName); } else { - let ref mut fresh226 = - *(&mut (*self_0).attachmentName as *mut *const c_char as *mut *mut c_char); - *fresh226 = std::ptr::null_mut(); + (*self_0).attachmentName = 0 as *mut c_char; }; } #[no_mangle] @@ -24552,11 +28924,9 @@ pub unsafe extern "C" fn spTransformConstraint_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 12737 as c_int, + 13658 as c_int, ) as *mut spTransformConstraint; - let ref mut fresh227 = *(&(*self_0).data as *const *mut spTransformConstraintData - as *mut *mut spTransformConstraintData); - *fresh227 = data; + (*self_0).data = data; (*self_0).mixRotate = (*data).mixRotate; (*self_0).mixX = (*data).mixX; (*self_0).mixY = (*data).mixY; @@ -24564,17 +28934,17 @@ pub unsafe extern "C" fn spTransformConstraint_create( (*self_0).mixScaleY = (*data).mixScaleY; (*self_0).mixShearY = (*data).mixShearY; (*self_0).bonesCount = (*data).bonesCount; - let ref mut fresh228 = *(&mut (*self_0).bones as *mut *mut *mut spBone); - *fresh228 = _spMalloc( + (*self_0) + .bones = _spMalloc( (::core::mem::size_of::<*mut spBone>() as c_ulong) .wrapping_mul((*self_0).bonesCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 12746 as c_int, + 13667 as c_int, ) as *mut *mut spBone; i = 0 as c_int; while i < (*self_0).bonesCount { - let ref mut fresh229 = *((*self_0).bones).offset(i as isize); - *fresh229 = spSkeleton_findBone( + let ref mut fresh164 = *((*self_0).bones).offset(i as isize); + *fresh164 = spSkeleton_findBone( skeleton, (**((*(*self_0).data).bones).offset(i as isize)).name, ); @@ -24584,7 +28954,9 @@ pub unsafe extern "C" fn spTransformConstraint_create( return self_0; } #[no_mangle] -pub unsafe extern "C" fn spTransformConstraint_dispose(mut self_0: *mut spTransformConstraint) { +pub unsafe extern "C" fn spTransformConstraint_dispose( + mut self_0: *mut spTransformConstraint, +) { _spFree((*self_0).bones as *mut c_void); _spFree(self_0 as *mut c_void); } @@ -24598,19 +28970,22 @@ pub unsafe extern "C" fn _spTransformConstraint_applyAbsoluteWorld( let mut mixScaleX: c_float = (*self_0).mixScaleX; let mut mixScaleY: c_float = (*self_0).mixScaleY; let mut mixShearY: c_float = (*self_0).mixShearY; - let mut translate: c_int = - (mixX != 0 as c_int as c_float || mixY != 0 as c_int as c_float) as c_int; + let mut translate: c_int = (mixX != 0 as c_int as c_float + || mixY != 0 as c_int as c_float) as c_int; let mut target: *mut spBone = (*self_0).target; let mut ta: c_float = (*target).a; let mut tb: c_float = (*target).b; let mut tc: c_float = (*target).c; let mut td: c_float = (*target).d; - let mut degRadReflect: c_float = if ta * td - tb * tc > 0 as c_int as c_float { + let mut degRadReflect: c_float = if ta * td - tb * tc + > 0 as c_int as c_float + { 3.1415926535897932385f32 / 180 as c_int as c_float } else { -(3.1415926535897932385f32 / 180 as c_int as c_float) }; - let mut offsetRotation: c_float = (*(*self_0).data).offsetRotation * degRadReflect; + let mut offsetRotation: c_float = (*(*self_0).data).offsetRotation + * degRadReflect; let mut offsetShearY: c_float = (*(*self_0).data).offsetShearY * degRadReflect; let mut i: c_int = 0; let mut a: c_float = 0.; @@ -24640,11 +29015,11 @@ pub unsafe extern "C" fn _spTransformConstraint_applyAbsoluteWorld( } r *= mixRotate; cosine = spine_cosf(r); - sine = spine_sinf(r); - *(&mut (*bone).a as *mut c_float) = cosine * a - sine * c; - *(&mut (*bone).b as *mut c_float) = cosine * b - sine * d; - *(&mut (*bone).c as *mut c_float) = sine * a + cosine * c; - *(&mut (*bone).d as *mut c_float) = sine * b + cosine * d; + sine = sinf(r); + (*bone).a = cosine * a - sine * c; + (*bone).b = cosine * b - sine * d; + (*bone).c = sine * a + cosine * c; + (*bone).d = sine * b + cosine * d; } if translate != 0 { spBone_localToWorld( @@ -24654,37 +29029,34 @@ pub unsafe extern "C" fn _spTransformConstraint_applyAbsoluteWorld( &mut x, &mut y, ); - *(&mut (*bone).worldX as *mut c_float) += (x - (*bone).worldX) * mixX; - *(&mut (*bone).worldY as *mut c_float) += (y - (*bone).worldY) * mixY; + (*bone).worldX += (x - (*bone).worldX) * mixX; + (*bone).worldY += (y - (*bone).worldY) * mixY; } if mixScaleX > 0 as c_int as c_float { s = spine_sqrtf((*bone).a * (*bone).a + (*bone).c * (*bone).c); if s != 0 as c_int as c_float { s = (s - + (spine_sqrtf(ta * ta + tc * tc) - s + (*(*self_0).data).offsetScaleX) - * mixScaleX) - / s; + + (spine_sqrtf(ta * ta + tc * tc) - s + + (*(*self_0).data).offsetScaleX) * mixScaleX) / s; } - *(&mut (*bone).a as *mut c_float) *= s; - *(&mut (*bone).c as *mut c_float) *= s; + (*bone).a *= s; + (*bone).c *= s; } if mixScaleY != 0 as c_int as c_float { s = spine_sqrtf((*bone).b * (*bone).b + (*bone).d * (*bone).d); if s != 0 as c_int as c_float { s = (s - + (spine_sqrtf(tb * tb + td * td) - s + (*(*self_0).data).offsetScaleY) - * mixScaleY) - / s; + + (spine_sqrtf(tb * tb + td * td) - s + + (*(*self_0).data).offsetScaleY) * mixScaleY) / s; } - *(&mut (*bone).b as *mut c_float) *= s; - *(&mut (*bone).d as *mut c_float) *= s; + (*bone).b *= s; + (*bone).d *= s; } if mixShearY > 0 as c_int as c_float { b = (*bone).b; d = (*bone).d; by = spine_atan2f(d, b); - r = spine_atan2f(td, tb) - - spine_atan2f(tc, ta) + r = spine_atan2f(td, tb) - spine_atan2f(tc, ta) - (by - spine_atan2f((*bone).c, (*bone).a)); s = spine_sqrtf(b * b + d * d); if r > 3.1415926535897932385f32 { @@ -24693,8 +29065,8 @@ pub unsafe extern "C" fn _spTransformConstraint_applyAbsoluteWorld( r += 3.1415926535897932385f32 * 2 as c_int as c_float; } r = by + (r + offsetShearY) * mixShearY; - *(&mut (*bone).b as *mut c_float) = spine_cosf(r) * s; - *(&mut (*bone).d as *mut c_float) = spine_sinf(r) * s; + (*bone).b = spine_cosf(r) * s; + (*bone).d = sinf(r) * s; } spBone_updateAppliedTransform(bone); i += 1; @@ -24710,19 +29082,22 @@ pub unsafe extern "C" fn _spTransformConstraint_applyRelativeWorld( let mut mixScaleX: c_float = (*self_0).mixScaleX; let mut mixScaleY: c_float = (*self_0).mixScaleY; let mut mixShearY: c_float = (*self_0).mixShearY; - let mut translate: c_int = - (mixX != 0 as c_int as c_float || mixY != 0 as c_int as c_float) as c_int; + let mut translate: c_int = (mixX != 0 as c_int as c_float + || mixY != 0 as c_int as c_float) as c_int; let mut target: *mut spBone = (*self_0).target; let mut ta: c_float = (*target).a; let mut tb: c_float = (*target).b; let mut tc: c_float = (*target).c; let mut td: c_float = (*target).d; - let mut degRadReflect: c_float = if ta * td - tb * tc > 0 as c_int as c_float { + let mut degRadReflect: c_float = if ta * td - tb * tc + > 0 as c_int as c_float + { 3.1415926535897932385f32 / 180 as c_int as c_float } else { -(3.1415926535897932385f32 / 180 as c_int as c_float) }; - let mut offsetRotation: c_float = (*(*self_0).data).offsetRotation * degRadReflect; + let mut offsetRotation: c_float = (*(*self_0).data).offsetRotation + * degRadReflect; let mut offsetShearY: c_float = (*(*self_0).data).offsetShearY * degRadReflect; let mut i: c_int = 0; let mut a: c_float = 0.; @@ -24751,11 +29126,11 @@ pub unsafe extern "C" fn _spTransformConstraint_applyRelativeWorld( } r *= mixRotate; cosine = spine_cosf(r); - sine = spine_sinf(r); - *(&mut (*bone).a as *mut c_float) = cosine * a - sine * c; - *(&mut (*bone).b as *mut c_float) = cosine * b - sine * d; - *(&mut (*bone).c as *mut c_float) = sine * a + cosine * c; - *(&mut (*bone).d as *mut c_float) = sine * b + cosine * d; + sine = sinf(r); + (*bone).a = cosine * a - sine * c; + (*bone).b = cosine * b - sine * d; + (*bone).c = sine * a + cosine * c; + (*bone).d = sine * b + cosine * d; } if translate != 0 as c_int { spBone_localToWorld( @@ -24765,24 +29140,22 @@ pub unsafe extern "C" fn _spTransformConstraint_applyRelativeWorld( &mut x, &mut y, ); - *(&mut (*bone).worldX as *mut c_float) += x * mixX; - *(&mut (*bone).worldY as *mut c_float) += y * mixY; + (*bone).worldX += x * mixX; + (*bone).worldY += y * mixY; } if mixScaleX != 0 as c_int as c_float { s = (spine_sqrtf(ta * ta + tc * tc) - 1 as c_int as c_float - + (*(*self_0).data).offsetScaleX) - * mixScaleX + + (*(*self_0).data).offsetScaleX) * mixScaleX + 1 as c_int as c_float; - *(&mut (*bone).a as *mut c_float) *= s; - *(&mut (*bone).c as *mut c_float) *= s; + (*bone).a *= s; + (*bone).c *= s; } if mixScaleY > 0 as c_int as c_float { s = (spine_sqrtf(tb * tb + td * td) - 1 as c_int as c_float - + (*(*self_0).data).offsetScaleY) - * mixScaleY + + (*(*self_0).data).offsetScaleY) * mixScaleY + 1 as c_int as c_float; - *(&mut (*bone).b as *mut c_float) *= s; - *(&mut (*bone).d as *mut c_float) *= s; + (*bone).b *= s; + (*bone).d *= s; } if mixShearY > 0 as c_int as c_float { r = spine_atan2f(td, tb) - spine_atan2f(tc, ta); @@ -24794,10 +29167,11 @@ pub unsafe extern "C" fn _spTransformConstraint_applyRelativeWorld( b = (*bone).b; d = (*bone).d; r = spine_atan2f(d, b) - + (r - 3.1415926535897932385f32 / 2 as c_int as c_float + offsetShearY) * mixShearY; + + (r - 3.1415926535897932385f32 / 2 as c_int as c_float + + offsetShearY) * mixShearY; s = spine_sqrtf(b * b + d * d); - *(&mut (*bone).b as *mut c_float) = spine_cosf(r) * s; - *(&mut (*bone).d as *mut c_float) = spine_sinf(r) * s; + (*bone).b = spine_cosf(r) * s; + (*bone).d = sinf(r) * s; } spBone_updateAppliedTransform(bone); i += 1; @@ -24828,9 +29202,10 @@ pub unsafe extern "C" fn _spTransformConstraint_applyAbsoluteLocal( rotation = (*bone).arotation; if mixRotate != 0 as c_int as c_float { r = (*target).arotation - rotation + (*(*self_0).data).offsetRotation; - r -= ((16384 as c_int - - (16384.499999999996f64 - (r / 360 as c_int as c_float) as c_double) as c_int) - * 360 as c_int) as c_float; + r + -= ceil( + (r / 360 as c_int as c_float) as c_double - 0.5f64, + ) as c_float * 360 as c_int as c_float; rotation += r * mixRotate; } x = (*bone).ax; @@ -24839,22 +29214,27 @@ pub unsafe extern "C" fn _spTransformConstraint_applyAbsoluteLocal( y += ((*target).ay - y + (*(*self_0).data).offsetY) * mixY; scaleX = (*bone).ascaleX; scaleY = (*bone).ascaleY; - if mixScaleX != 0 as c_int as c_float && scaleX != 0 as c_int as c_float { + if mixScaleX != 0 as c_int as c_float + && scaleX != 0 as c_int as c_float + { scaleX = (scaleX - + ((*target).ascaleX - scaleX + (*(*self_0).data).offsetScaleX) * mixScaleX) - / scaleX; + + ((*target).ascaleX - scaleX + (*(*self_0).data).offsetScaleX) + * mixScaleX) / scaleX; } - if mixScaleY != 0 as c_int as c_float && scaleY != 0 as c_int as c_float { + if mixScaleY != 0 as c_int as c_float + && scaleY != 0 as c_int as c_float + { scaleY = (scaleY - + ((*target).ascaleY - scaleY + (*(*self_0).data).offsetScaleY) * mixScaleY) - / scaleY; + + ((*target).ascaleY - scaleY + (*(*self_0).data).offsetScaleY) + * mixScaleY) / scaleY; } shearY = (*bone).ashearY; if mixShearY != 0 as c_int as c_float { r = (*target).ashearY - shearY + (*(*self_0).data).offsetShearY; - r -= ((16384 as c_int - - (16384.499999999996f64 - (r / 360 as c_int as c_float) as c_double) as c_int) - * 360 as c_int) as c_float; + r + -= ceil( + (r / 360 as c_int as c_float) as c_double - 0.5f64, + ) as c_float * 360 as c_int as c_float; shearY += r * mixShearY; } spBone_updateWorldTransformWith( @@ -24896,14 +29276,15 @@ pub unsafe extern "C" fn _spTransformConstraint_applyRelativeLocal( x = (*bone).ax + ((*target).ax + (*(*self_0).data).offsetX) * mixX; y = (*bone).ay + ((*target).ay + (*(*self_0).data).offsetY) * mixY; scaleX = (*bone).ascaleX - * (((*target).ascaleX - 1 as c_int as c_float + (*(*self_0).data).offsetScaleX) - * mixScaleX + * (((*target).ascaleX - 1 as c_int as c_float + + (*(*self_0).data).offsetScaleX) * mixScaleX + 1 as c_int as c_float); scaleY = (*bone).ascaleY - * (((*target).ascaleY - 1 as c_int as c_float + (*(*self_0).data).offsetScaleY) - * mixScaleY + * (((*target).ascaleY - 1 as c_int as c_float + + (*(*self_0).data).offsetScaleY) * mixScaleY + 1 as c_int as c_float); - shearY = (*bone).ashearY + ((*target).ashearY + (*(*self_0).data).offsetShearY) * mixShearY; + shearY = (*bone).ashearY + + ((*target).ashearY + (*(*self_0).data).offsetShearY) * mixShearY; spBone_updateWorldTransformWith( bone, x, @@ -24918,7 +29299,9 @@ pub unsafe extern "C" fn _spTransformConstraint_applyRelativeLocal( } } #[no_mangle] -pub unsafe extern "C" fn spTransformConstraint_update(mut self_0: *mut spTransformConstraint) { +pub unsafe extern "C" fn spTransformConstraint_update( + mut self_0: *mut spTransformConstraint, +) { if (*self_0).mixRotate == 0 as c_int as c_float && (*self_0).mixX == 0 as c_int as c_float && (*self_0).mixY == 0 as c_int as c_float @@ -24941,6 +29324,18 @@ pub unsafe extern "C" fn spTransformConstraint_update(mut self_0: *mut spTransfo }; } #[no_mangle] +pub unsafe extern "C" fn spTransformConstraint_setToSetupPose( + mut self_0: *mut spTransformConstraint, +) { + let mut data: *mut spTransformConstraintData = (*self_0).data; + (*self_0).mixRotate = (*data).mixRotate; + (*self_0).mixX = (*data).mixX; + (*self_0).mixY = (*data).mixY; + (*self_0).mixScaleX = (*data).mixScaleX; + (*self_0).mixScaleY = (*data).mixScaleY; + (*self_0).mixShearY = (*data).mixShearY; +} +#[no_mangle] pub unsafe extern "C" fn spTransformConstraintData_create( mut name: *const c_char, ) -> *mut spTransformConstraintData { @@ -24948,16 +29343,18 @@ pub unsafe extern "C" fn spTransformConstraintData_create( 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 12994 as c_int, + 13925 as c_int, ) as *mut spTransformConstraintData; - let ref mut fresh230 = *(&mut (*self_0).name as *mut *mut c_char); - *fresh230 = _spMalloc( + (*self_0) + .name = _spMalloc( (::core::mem::size_of::() as c_ulong) - .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)), + .wrapping_mul( + (spine_strlen(name)).wrapping_add(1 as c_int as c_ulong), + ), b"spine.c\0" as *const u8 as *const c_char, - 12995 as c_int, + 13926 as c_int, ) as *mut c_char; - spine_strcpy(*fresh230, name); + spine_strcpy((*self_0).name, name); return self_0; } #[no_mangle] @@ -24974,7 +29371,7 @@ pub unsafe extern "C" fn spTriangulator_create() -> *mut spTriangulator { 1 as c_int as size_t, ::core::mem::size_of::() as c_ulong, b"spine.c\0" as *const u8 as *const c_char, - 13038 as c_int, + 13969 as c_int, ) as *mut spTriangulator; (*triangulator).convexPolygons = spArrayFloatArray_create(16 as c_int); (*triangulator).convexPolygonsIndices = spArrayShortArray_create(16 as c_int); @@ -24996,7 +29393,9 @@ pub unsafe extern "C" fn spTriangulator_dispose(mut self_0: *mut spTriangulator) spArrayFloatArray_dispose((*self_0).convexPolygons); i = 0 as c_int; while i < (*(*self_0).convexPolygonsIndices).size { - spShortArray_dispose(*((*(*self_0).convexPolygonsIndices).items).offset(i as isize)); + spShortArray_dispose( + *((*(*self_0).convexPolygonsIndices).items).offset(i as isize), + ); i += 1; } spArrayShortArray_dispose((*self_0).convexPolygonsIndices); @@ -25011,20 +29410,27 @@ pub unsafe extern "C" fn spTriangulator_dispose(mut self_0: *mut spTriangulator) spArrayFloatArray_dispose((*self_0).polygonPool); i = 0 as c_int; while i < (*(*self_0).polygonIndicesPool).size { - spShortArray_dispose(*((*(*self_0).polygonIndicesPool).items).offset(i as isize)); + spShortArray_dispose( + *((*(*self_0).polygonIndicesPool).items).offset(i as isize), + ); i += 1; } spArrayShortArray_dispose((*self_0).polygonIndicesPool); _spFree(self_0 as *mut c_void); } -unsafe extern "C" fn _obtainPolygon(mut self_0: *mut spTriangulator) -> *mut spFloatArray { +unsafe extern "C" fn _obtainPolygon( + mut self_0: *mut spTriangulator, +) -> *mut spFloatArray { if (*(*self_0).polygonPool).size == 0 as c_int { - return spFloatArray_create(16 as c_int); + return spFloatArray_create(16 as c_int) } else { - return spArrayFloatArray_pop((*self_0).polygonPool); + return spArrayFloatArray_pop((*self_0).polygonPool) }; } -unsafe extern "C" fn _freePolygon(mut self_0: *mut spTriangulator, mut polygon: *mut spFloatArray) { +unsafe extern "C" fn _freePolygon( + mut self_0: *mut spTriangulator, + mut polygon: *mut spFloatArray, +) { spArrayFloatArray_add((*self_0).polygonPool, polygon); } unsafe extern "C" fn _freeAllPolygons( @@ -25038,11 +29444,13 @@ unsafe extern "C" fn _freeAllPolygons( i += 1; } } -unsafe extern "C" fn _obtainPolygonIndices(mut self_0: *mut spTriangulator) -> *mut spShortArray { +unsafe extern "C" fn _obtainPolygonIndices( + mut self_0: *mut spTriangulator, +) -> *mut spShortArray { if (*(*self_0).polygonIndicesPool).size == 0 as c_int { - return spShortArray_create(16 as c_int); + return spShortArray_create(16 as c_int) } else { - return spArrayShortArray_pop((*self_0).polygonIndicesPool); + return spArrayShortArray_pop((*self_0).polygonIndicesPool) }; } unsafe extern "C" fn _freePolygonIndices( @@ -25070,8 +29478,8 @@ unsafe extern "C" fn _positiveArea( mut p3x: c_float, mut p3y: c_float, ) -> c_int { - return (p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0 as c_int as c_float) - as c_int; + return (p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) + >= 0 as c_int as c_float) as c_int; } unsafe extern "C" fn _isConcave( mut index: c_int, @@ -25079,12 +29487,14 @@ unsafe extern "C" fn _isConcave( mut vertices: *mut c_float, mut indices: *mut c_short, ) -> c_int { - let mut previous: c_int = - (*indices.offset(((vertexCount + index - 1 as c_int) % vertexCount) as isize) as c_int) - << 1 as c_int; - let mut current: c_int = (*indices.offset(index as isize) as c_int) << 1 as c_int; - let mut next: c_int = - (*indices.offset(((index + 1 as c_int) % vertexCount) as isize) as c_int) << 1 as c_int; + let mut previous: c_int = (*indices + .offset(((vertexCount + index - 1 as c_int) % vertexCount) as isize) + as c_int) << 1 as c_int; + let mut current: c_int = (*indices.offset(index as isize) as c_int) + << 1 as c_int; + let mut next: c_int = (*indices + .offset(((index + 1 as c_int) % vertexCount) as isize) as c_int) + << 1 as c_int; return (_positiveArea( *vertices.offset(previous as isize), *vertices.offset((previous + 1 as c_int) as isize), @@ -25104,7 +29514,9 @@ unsafe extern "C" fn _winding( ) -> c_int { let mut px: c_float = p2x - p1x; let mut py: c_float = p2y - p1y; - return if p3x * py - p3y * px + px * p1y - p1x * py >= 0 as c_int as c_float { + return if p3x * py - p3y * px + px * p1y - p1x * py + >= 0 as c_int as c_float + { 1 as c_int } else { -(1 as c_int) @@ -25121,10 +29533,10 @@ pub unsafe extern "C" fn spTriangulator_triangulate( let mut n: c_int = 0; let mut ii: c_int = 0; let mut indicesArray: *mut spShortArray = (*self_0).indicesArray; - let mut indices: *mut c_short = std::ptr::null_mut(); - let mut isConcaveArray: *mut spIntArray = std::ptr::null_mut(); - let mut isConcave: *mut c_int = std::ptr::null_mut(); - let mut triangles: *mut spShortArray = std::ptr::null_mut(); + let mut indices: *mut c_short = 0 as *mut c_short; + let mut isConcaveArray: *mut spIntArray = 0 as *mut spIntArray; + let mut isConcave: *mut c_int = 0 as *mut c_int; + let mut triangles: *mut spShortArray = 0 as *mut spShortArray; spShortArray_clear(indicesArray); indices = (*spShortArray_setSize(indicesArray, vertexCount)).items; i = 0 as c_int; @@ -25158,15 +29570,21 @@ pub unsafe extern "C" fn spTriangulator_triangulate( i = 0 as c_int; 's_80: loop { if *isConcave.offset(i as isize) == 0 { - let mut p1: c_int = (*indices.offset(previous as isize) as c_int) << 1 as c_int; - let mut p2: c_int = (*indices.offset(i as isize) as c_int) << 1 as c_int; - let mut p3: c_int = (*indices.offset(next as isize) as c_int) << 1 as c_int; + let mut p1: c_int = (*indices.offset(previous as isize) + as c_int) << 1 as c_int; + let mut p2: c_int = (*indices.offset(i as isize) as c_int) + << 1 as c_int; + let mut p3: c_int = (*indices.offset(next as isize) as c_int) + << 1 as c_int; let mut p1x: c_float = *vertices.offset(p1 as isize); - let mut p1y: c_float = *vertices.offset((p1 + 1 as c_int) as isize); + let mut p1y: c_float = *vertices + .offset((p1 + 1 as c_int) as isize); let mut p2x: c_float = *vertices.offset(p2 as isize); - let mut p2y: c_float = *vertices.offset((p2 + 1 as c_int) as isize); + let mut p2y: c_float = *vertices + .offset((p2 + 1 as c_int) as isize); let mut p3x: c_float = *vertices.offset(p3 as isize); - let mut p3y: c_float = *vertices.offset((p3 + 1 as c_int) as isize); + let mut p3y: c_float = *vertices + .offset((p3 + 1 as c_int) as isize); ii = (next + 1 as c_int) % vertexCount; loop { if !(ii != previous) { @@ -25176,7 +29594,8 @@ pub unsafe extern "C" fn spTriangulator_triangulate( let mut vx: c_float = 0.; let mut vy: c_float = 0.; if !(*isConcave.offset(ii as isize) == 0) { - v = (*indices.offset(ii as isize) as c_int) << 1 as c_int; + v = (*indices.offset(ii as isize) as c_int) + << 1 as c_int; vx = *vertices.offset(v as isize); vy = *vertices.offset((v + 1 as c_int) as isize); if _positiveArea(p3x, p3y, p1x, p1y, vx, vy) != 0 { @@ -25206,7 +29625,8 @@ pub unsafe extern "C" fn spTriangulator_triangulate( } spShortArray_add( triangles, - *indices.offset(((vertexCount + i - 1 as c_int) % vertexCount) as isize), + *indices + .offset(((vertexCount + i - 1 as c_int) % vertexCount) as isize), ); spShortArray_add(triangles, *indices.offset(i as isize)); spShortArray_add( @@ -25218,10 +29638,14 @@ pub unsafe extern "C" fn spTriangulator_triangulate( vertexCount -= 1; previousIndex = (vertexCount + i - 1 as c_int) % vertexCount; nextIndex = if i == vertexCount { 0 as c_int } else { i }; - *isConcave.offset(previousIndex as isize) = - _isConcave(previousIndex, vertexCount, vertices, indices); - *isConcave.offset(nextIndex as isize) = - _isConcave(nextIndex, vertexCount, vertices, indices); + *isConcave + .offset( + previousIndex as isize, + ) = _isConcave(previousIndex, vertexCount, vertices, indices); + *isConcave + .offset( + nextIndex as isize, + ) = _isConcave(nextIndex, vertexCount, vertices, indices); } if vertexCount == 3 as c_int { spShortArray_add(triangles, *indices.offset(2 as c_int as isize)); @@ -25238,12 +29662,12 @@ pub unsafe extern "C" fn spTriangulator_decompose( ) -> *mut spArrayFloatArray { let mut vertices: *mut c_float = (*verticesArray).items; let mut convexPolygons: *mut spArrayFloatArray = (*self_0).convexPolygons; - let mut convexPolygonsIndices: *mut spArrayShortArray = std::ptr::null_mut(); - let mut polygonIndices: *mut spShortArray = std::ptr::null_mut(); - let mut polygon: *mut spFloatArray = std::ptr::null_mut(); + let mut convexPolygonsIndices: *mut spArrayShortArray = 0 as *mut spArrayShortArray; + let mut polygonIndices: *mut spShortArray = 0 as *mut spShortArray; + let mut polygon: *mut spFloatArray = 0 as *mut spFloatArray; let mut fanBaseIndex: c_int = 0; let mut lastWinding: c_int = 0; - let mut trianglesItems: *mut c_short = std::ptr::null_mut(); + let mut trianglesItems: *mut c_short = 0 as *mut c_short; let mut i: c_int = 0; let mut n: c_int = 0; _freeAllPolygons(self_0, convexPolygons); @@ -25261,11 +29685,12 @@ pub unsafe extern "C" fn spTriangulator_decompose( i = 0 as c_int; n = (*triangles).size; while i < n { - let mut t1: c_int = (*trianglesItems.offset(i as isize) as c_int) << 1 as c_int; - let mut t2: c_int = - (*trianglesItems.offset((i + 1 as c_int) as isize) as c_int) << 1 as c_int; - let mut t3: c_int = - (*trianglesItems.offset((i + 2 as c_int) as isize) as c_int) << 1 as c_int; + let mut t1: c_int = (*trianglesItems.offset(i as isize) as c_int) + << 1 as c_int; + let mut t2: c_int = (*trianglesItems + .offset((i + 1 as c_int) as isize) as c_int) << 1 as c_int; + let mut t3: c_int = (*trianglesItems + .offset((i + 2 as c_int) as isize) as c_int) << 1 as c_int; let mut x1: c_float = *vertices.offset(t1 as isize); let mut y1: c_float = *vertices.offset((t1 + 1 as c_int) as isize); let mut x2: c_float = *vertices.offset(t2 as isize); @@ -25335,7 +29760,7 @@ pub unsafe extern "C" fn spTriangulator_decompose( let mut firstIndex: c_int = 0; let mut lastIndex: c_int = 0; let mut o_0: c_int = 0; - let mut p_0: *mut c_float = std::ptr::null_mut(); + let mut p_0: *mut c_float = 0 as *mut c_float; let mut prevPrevX: c_float = 0.; let mut prevPrevY: c_float = 0.; let mut prevX: c_float = 0.; @@ -25348,7 +29773,8 @@ pub unsafe extern "C" fn spTriangulator_decompose( let mut ii: c_int = 0; polygonIndices = *((*convexPolygonsIndices).items).offset(i as isize); if !((*polygonIndices).size == 0 as c_int) { - firstIndex = *((*polygonIndices).items).offset(0 as c_int as isize) as c_int; + firstIndex = *((*polygonIndices).items).offset(0 as c_int as isize) + as c_int; lastIndex = *((*polygonIndices).items) .offset(((*polygonIndices).size - 1 as c_int) as isize) as c_int; @@ -25366,11 +29792,11 @@ pub unsafe extern "C" fn spTriangulator_decompose( winding = _winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY); ii = 0 as c_int; while ii < n { - let mut otherIndices: *mut spShortArray = std::ptr::null_mut(); + let mut otherIndices: *mut spShortArray = 0 as *mut spShortArray; let mut otherFirstIndex: c_int = 0; let mut otherSecondIndex: c_int = 0; let mut otherLastIndex: c_int = 0; - let mut otherPoly: *mut spFloatArray = std::ptr::null_mut(); + let mut otherPoly: *mut spFloatArray = 0 as *mut spFloatArray; let mut x3_0: c_float = 0.; let mut y3_0: c_float = 0.; let mut winding1_0: c_int = 0; @@ -25378,26 +29804,45 @@ pub unsafe extern "C" fn spTriangulator_decompose( if !(ii == i) { otherIndices = *((*convexPolygonsIndices).items).offset(ii as isize); if !((*otherIndices).size != 3 as c_int) { - otherFirstIndex = - *((*otherIndices).items).offset(0 as c_int as isize) as c_int; - otherSecondIndex = - *((*otherIndices).items).offset(1 as c_int as isize) as c_int; - otherLastIndex = - *((*otherIndices).items).offset(2 as c_int as isize) as c_int; + otherFirstIndex = *((*otherIndices).items) + .offset(0 as c_int as isize) as c_int; + otherSecondIndex = *((*otherIndices).items) + .offset(1 as c_int as isize) as c_int; + otherLastIndex = *((*otherIndices).items) + .offset(2 as c_int as isize) as c_int; otherPoly = *((*convexPolygons).items).offset(ii as isize); - x3_0 = - *((*otherPoly).items).offset(((*otherPoly).size - 2 as c_int) as isize); - y3_0 = - *((*otherPoly).items).offset(((*otherPoly).size - 1 as c_int) as isize); - if !(otherFirstIndex != firstIndex || otherSecondIndex != lastIndex) { - winding1_0 = _winding(prevPrevX, prevPrevY, prevX, prevY, x3_0, y3_0); - winding2_0 = _winding(x3_0, y3_0, firstX, firstY, secondX, secondY); + x3_0 = *((*otherPoly).items) + .offset(((*otherPoly).size - 2 as c_int) as isize); + y3_0 = *((*otherPoly).items) + .offset(((*otherPoly).size - 1 as c_int) as isize); + if !(otherFirstIndex != firstIndex + || otherSecondIndex != lastIndex) + { + winding1_0 = _winding( + prevPrevX, + prevPrevY, + prevX, + prevY, + x3_0, + y3_0, + ); + winding2_0 = _winding( + x3_0, + y3_0, + firstX, + firstY, + secondX, + secondY, + ); if winding1_0 == winding && winding2_0 == winding { spFloatArray_clear(otherPoly); spShortArray_clear(otherIndices); spFloatArray_add(polygon, x3_0); spFloatArray_add(polygon, y3_0); - spShortArray_add(polygonIndices, otherLastIndex as c_short); + spShortArray_add( + polygonIndices, + otherLastIndex as c_short, + ); prevPrevX = prevX; prevPrevY = prevY; prevX = x3_0; @@ -25428,14 +29873,18 @@ pub unsafe extern "C" fn spTriangulator_decompose( } static mut nextID: c_int = 0 as c_int; #[no_mangle] -pub unsafe extern "C" fn _spVertexAttachment_init(mut attachment: *mut spVertexAttachment) { - let fresh231 = nextID; +pub unsafe extern "C" fn _spVertexAttachment_init( + mut attachment: *mut spVertexAttachment, +) { + let fresh165 = nextID; nextID = nextID + 1; - (*attachment).id = fresh231; + (*attachment).id = fresh165; (*attachment).timelineAttachment = &mut (*attachment).super_0; } #[no_mangle] -pub unsafe extern "C" fn _spVertexAttachment_deinit(mut attachment: *mut spVertexAttachment) { +pub unsafe extern "C" fn _spVertexAttachment_deinit( + mut attachment: *mut spVertexAttachment, +) { _spAttachment_deinit(&mut (*attachment).super_0); _spFree((*attachment).bones as *mut c_void); _spFree((*attachment).vertices as *mut c_void); @@ -25450,13 +29899,15 @@ pub unsafe extern "C" fn spVertexAttachment_computeWorldVertices( mut offset: c_int, mut stride: c_int, ) { - let mut skeleton: *mut spSkeleton = std::ptr::null_mut(); + let mut skeleton: *mut spSkeleton = 0 as *mut spSkeleton; let mut deformLength: c_int = 0; - let mut deformArray: *mut c_float = std::ptr::null_mut(); - let mut vertices: *mut c_float = std::ptr::null_mut(); - let mut bones: *mut c_int = std::ptr::null_mut(); - if (*self_0).super_0.type_0 as c_uint == SP_ATTACHMENT_MESH as c_int as c_uint - || (*self_0).super_0.type_0 as c_uint == SP_ATTACHMENT_LINKED_MESH as c_int as c_uint + let mut deformArray: *mut c_float = 0 as *mut c_float; + let mut vertices: *mut c_float = 0 as *mut c_float; + let mut bones: *mut c_int = 0 as *mut c_int; + if (*self_0).super_0.type_0 as c_uint + == SP_ATTACHMENT_MESH as c_int as c_uint + || (*self_0).super_0.type_0 as c_uint + == SP_ATTACHMENT_LINKED_MESH as c_int as c_uint { let mut mesh: *mut spMeshAttachment = self_0 as *mut spMeshAttachment; if !((*mesh).sequence).is_null() { @@ -25470,7 +29921,7 @@ pub unsafe extern "C" fn spVertexAttachment_computeWorldVertices( vertices = (*self_0).vertices; bones = (*self_0).bones; if bones.is_null() { - let mut bone: *mut spBone = std::ptr::null_mut(); + let mut bone: *mut spBone = 0 as *mut spBone; let mut v: c_int = 0; let mut w: c_int = 0; let mut x: c_float = 0.; @@ -25485,9 +29936,13 @@ pub unsafe extern "C" fn spVertexAttachment_computeWorldVertices( w = offset; while w < count { let mut vx: c_float = *vertices.offset(v as isize); - let mut vy: c_float = *vertices.offset((v + 1 as c_int) as isize); + let mut vy: c_float = *vertices + .offset((v + 1 as c_int) as isize); *worldVertices.offset(w as isize) = vx * (*bone).a + vy * (*bone).b + x; - *worldVertices.offset((w + 1 as c_int) as isize) = vx * (*bone).c + vy * (*bone).d + y; + *worldVertices + .offset( + (w + 1 as c_int) as isize, + ) = vx * (*bone).c + vy * (*bone).d + y; v += 2 as c_int; w += stride; } @@ -25495,7 +29950,7 @@ pub unsafe extern "C" fn spVertexAttachment_computeWorldVertices( let mut v_0: c_int = 0 as c_int; let mut skip_0: c_int = 0 as c_int; let mut i: c_int = 0; - let mut skeletonBones: *mut *mut spBone = std::ptr::null_mut(); + let mut skeletonBones: *mut *mut spBone = 0 as *mut *mut spBone; i = 0 as c_int; while i < start { let mut n: c_int = *bones.offset(v_0 as isize); @@ -25512,18 +29967,24 @@ pub unsafe extern "C" fn spVertexAttachment_computeWorldVertices( while w_0 < count { let mut wx: c_float = 0 as c_int as c_float; let mut wy: c_float = 0 as c_int as c_float; - let fresh232 = v_0; + let fresh166 = v_0; v_0 = v_0 + 1; - let mut n_0: c_int = *bones.offset(fresh232 as isize); + let mut n_0: c_int = *bones.offset(fresh166 as isize); n_0 += v_0; while v_0 < n_0 { - let mut bone_0: *mut spBone = - *skeletonBones.offset(*bones.offset(v_0 as isize) as isize); + let mut bone_0: *mut spBone = *skeletonBones + .offset(*bones.offset(v_0 as isize) as isize); let mut vx_0: c_float = *vertices.offset(b as isize); - let mut vy_0: c_float = *vertices.offset((b + 1 as c_int) as isize); - let mut weight: c_float = *vertices.offset((b + 2 as c_int) as isize); - wx += (vx_0 * (*bone_0).a + vy_0 * (*bone_0).b + (*bone_0).worldX) * weight; - wy += (vx_0 * (*bone_0).c + vy_0 * (*bone_0).d + (*bone_0).worldY) * weight; + let mut vy_0: c_float = *vertices + .offset((b + 1 as c_int) as isize); + let mut weight: c_float = *vertices + .offset((b + 2 as c_int) as isize); + wx + += (vx_0 * (*bone_0).a + vy_0 * (*bone_0).b + (*bone_0).worldX) + * weight; + wy + += (vx_0 * (*bone_0).c + vy_0 * (*bone_0).d + (*bone_0).worldY) + * weight; v_0 += 1; b += 3 as c_int; } @@ -25541,20 +30002,26 @@ pub unsafe extern "C" fn spVertexAttachment_computeWorldVertices( while w_1 < count { let mut wx_0: c_float = 0 as c_int as c_float; let mut wy_0: c_float = 0 as c_int as c_float; - let fresh233 = v_0; + let fresh167 = v_0; v_0 = v_0 + 1; - let mut n_1: c_int = *bones.offset(fresh233 as isize); + let mut n_1: c_int = *bones.offset(fresh167 as isize); n_1 += v_0; while v_0 < n_1 { - let mut bone_1: *mut spBone = - *skeletonBones.offset(*bones.offset(v_0 as isize) as isize); - let mut vx_1: c_float = - *vertices.offset(b_0 as isize) + *deformArray.offset(f as isize); - let mut vy_1: c_float = *vertices.offset((b_0 + 1 as c_int) as isize) + let mut bone_1: *mut spBone = *skeletonBones + .offset(*bones.offset(v_0 as isize) as isize); + let mut vx_1: c_float = *vertices.offset(b_0 as isize) + + *deformArray.offset(f as isize); + let mut vy_1: c_float = *vertices + .offset((b_0 + 1 as c_int) as isize) + *deformArray.offset((f + 1 as c_int) as isize); - let mut weight_0: c_float = *vertices.offset((b_0 + 2 as c_int) as isize); - wx_0 += (vx_1 * (*bone_1).a + vy_1 * (*bone_1).b + (*bone_1).worldX) * weight_0; - wy_0 += (vx_1 * (*bone_1).c + vy_1 * (*bone_1).d + (*bone_1).worldY) * weight_0; + let mut weight_0: c_float = *vertices + .offset((b_0 + 2 as c_int) as isize); + wx_0 + += (vx_1 * (*bone_1).a + vy_1 * (*bone_1).b + (*bone_1).worldX) + * weight_0; + wy_0 + += (vx_1 * (*bone_1).c + vy_1 * (*bone_1).d + (*bone_1).worldY) + * weight_0; v_0 += 1; b_0 += 3 as c_int; f += 2 as c_int; @@ -25573,11 +30040,12 @@ pub unsafe extern "C" fn spVertexAttachment_copyTo( ) { if (*from).bonesCount != 0 { (*to).bonesCount = (*from).bonesCount; - (*to).bones = _spMalloc( + (*to) + .bones = _spMalloc( (::core::mem::size_of::() as c_ulong) .wrapping_mul((*from).bonesCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 13499 as c_int, + 14430 as c_int, ) as *mut c_int; spine_memcpy( (*to).bones as *mut c_void, @@ -25589,16 +30057,17 @@ pub unsafe extern "C" fn spVertexAttachment_copyTo( (*to).bonesCount = 0 as c_int; if !((*to).bones).is_null() { _spFree((*to).bones as *mut c_void); - (*to).bones = std::ptr::null_mut(); + (*to).bones = 0 as *mut c_int; } } if (*from).verticesCount != 0 { (*to).verticesCount = (*from).verticesCount; - (*to).vertices = _spMalloc( + (*to) + .vertices = _spMalloc( (::core::mem::size_of::() as c_ulong) .wrapping_mul((*from).verticesCount as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 13511 as c_int, + 14442 as c_int, ) as *mut c_float; spine_memcpy( (*to).vertices as *mut c_void, @@ -25610,7 +30079,7 @@ pub unsafe extern "C" fn spVertexAttachment_copyTo( (*to).verticesCount = 0 as c_int; if !((*to).vertices).is_null() { _spFree((*to).vertices as *mut c_void); - (*to).vertices = std::ptr::null_mut(); + (*to).vertices = 0 as *mut c_float; } } (*to).worldVerticesLength = (*from).worldVerticesLength; @@ -25619,20 +30088,25 @@ pub unsafe extern "C" fn spVertexAttachment_copyTo( pub unsafe extern "C" fn _spInternalRandom() -> c_float { return spine_rand() as c_float / 2147483647 as c_int as c_float; } -static mut mallocFunc: Option *mut c_void> = - Some(spine_malloc as unsafe extern "C" fn(size_t) -> *mut c_void); -static mut reallocFunc: Option *mut c_void> = - Some(spine_realloc as unsafe extern "C" fn(*mut c_void, size_t) -> *mut c_void); -static mut debugMallocFunc: Option< +static mut mallocFunc: Option:: *mut c_void> = unsafe { + Some(spine_malloc as unsafe extern "C" fn(size_t) -> *mut c_void) +}; +static mut reallocFunc: Option::< + unsafe extern "C" fn(*mut c_void, size_t) -> *mut c_void, +> = unsafe { + Some( + spine_realloc + as unsafe extern "C" fn(*mut c_void, size_t) -> *mut c_void, + ) +}; +static mut debugMallocFunc: Option::< unsafe extern "C" fn(size_t, *const c_char, c_int) -> *mut c_void, > = None; -static mut freeFunc: Option ()> = - Some(spine_free as unsafe extern "C" fn(*mut c_void) -> ()); -static mut randomFunc: Option c_float> = unsafe { - Some(::core::mem::transmute::< - unsafe extern "C" fn() -> c_float, - unsafe extern "C" fn() -> c_float, - >(_spInternalRandom)) +static mut freeFunc: Option:: ()> = unsafe { + Some(spine_free as unsafe extern "C" fn(*mut c_void) -> ()) +}; +static mut randomFunc: Option:: c_float> = unsafe { + Some(_spInternalRandom as unsafe extern "C" fn() -> c_float) }; #[no_mangle] pub unsafe extern "C" fn _spMalloc( @@ -25659,7 +30133,10 @@ pub unsafe extern "C" fn _spCalloc( return ptr; } #[no_mangle] -pub unsafe extern "C" fn _spRealloc(mut ptr: *mut c_void, mut size: size_t) -> *mut c_void { +pub unsafe extern "C" fn _spRealloc( + mut ptr: *mut c_void, + mut size: size_t, +) -> *mut c_void { return reallocFunc.expect("non-null function pointer")(ptr, size); } #[no_mangle] @@ -25668,36 +30145,44 @@ pub unsafe extern "C" fn _spFree(mut ptr: *mut c_void) { } #[no_mangle] pub unsafe extern "C" fn _spRandom() -> c_float { - return ::core::mem::transmute::<_, fn() -> c_float>( - randomFunc.expect("non-null function pointer"), - )(); + return randomFunc.expect("non-null function pointer")(); } #[no_mangle] pub unsafe extern "C" fn _spSetDebugMalloc( - mut spine_malloc_0: Option *mut c_void>, + mut spine_malloc_0: Option::< + unsafe extern "C" fn( + size_t, + *const c_char, + c_int, + ) -> *mut c_void, + >, ) { debugMallocFunc = spine_malloc_0; } #[no_mangle] pub unsafe extern "C" fn _spSetMalloc( - mut spine_malloc_0: Option *mut c_void>, + mut spine_malloc_0: Option:: *mut c_void>, ) { mallocFunc = spine_malloc_0; } #[no_mangle] pub unsafe extern "C" fn _spSetRealloc( - mut spine_realloc_0: Option *mut c_void>, + mut spine_realloc_0: Option::< + unsafe extern "C" fn(*mut c_void, size_t) -> *mut c_void, + >, ) { reallocFunc = spine_realloc_0; } #[no_mangle] pub unsafe extern "C" fn _spSetFree( - mut spine_free_0: Option ()>, + mut spine_free_0: Option:: ()>, ) { freeFunc = spine_free_0; } #[no_mangle] -pub unsafe extern "C" fn _spSetRandom(mut random: Option c_float>) { +pub unsafe extern "C" fn _spSetRandom( + mut random: Option:: c_float>, +) { randomFunc = random; } #[no_mangle] @@ -25705,21 +30190,25 @@ pub unsafe extern "C" fn _spReadFile( mut path: *const c_char, mut length: *mut c_int, ) -> *mut c_char { - let mut data: *mut c_char = std::ptr::null_mut(); - let mut _result: size_t = 0; - let mut file: *mut FILE = spine_fopen(path, b"rb\0" as *const u8 as *const c_char); + let mut data: *mut c_char = 0 as *mut c_char; + let mut result: size_t = 0; + let mut file: *mut FILE = spine_fopen( + path, + b"rb\0" as *const u8 as *const c_char, + ); if file.is_null() { - return std::ptr::null_mut(); + return 0 as *mut c_char; } spine_fseek(file, 0 as c_int as c_long, 2 as c_int); *length = spine_ftell(file) as c_int; spine_fseek(file, 0 as c_int as c_long, 0 as c_int); data = _spMalloc( - (::core::mem::size_of::() as c_ulong).wrapping_mul(*length as c_ulong), + (::core::mem::size_of::() as c_ulong) + .wrapping_mul(*length as c_ulong), b"spine.c\0" as *const u8 as *const c_char, - 13623 as c_int, + 14554 as c_int, ) as *mut c_char; - _result = spine_fread( + result = spine_fread( data as *mut c_void, 1 as c_int as size_t, *length as size_t, @@ -25729,11 +30218,17 @@ pub unsafe extern "C" fn _spReadFile( return data; } #[no_mangle] -pub unsafe extern "C" fn _spMath_random(mut min: c_float, mut max: c_float) -> c_float { +pub unsafe extern "C" fn _spMath_random( + mut min: c_float, + mut max: c_float, +) -> c_float { return min + (max - min) * _spRandom(); } #[no_mangle] -pub unsafe extern "C" fn _spMath_randomTriangular(mut min: c_float, mut max: c_float) -> c_float { +pub unsafe extern "C" fn _spMath_randomTriangular( + mut min: c_float, + mut max: c_float, +) -> c_float { return _spMath_randomTriangularWith(min, max, (min + max) * 0.5f32); } #[no_mangle] @@ -25751,7 +30246,7 @@ pub unsafe extern "C" fn _spMath_randomTriangularWith( } #[no_mangle] pub unsafe extern "C" fn _spMath_interpolate( - mut apply: Option c_float>, + mut apply: Option:: c_float>, mut start: c_float, mut end: c_float, mut a: c_float, @@ -25767,21 +30262,24 @@ pub unsafe extern "C" fn _spMath_pow2_apply(mut a: c_float) -> c_float { ) / 2 as c_int as c_double) as c_float; } return (spine_pow( - ((a - 1 as c_int as c_float) * 2 as c_int as c_float) as c_double, + ((a - 1 as c_int as c_float) * 2 as c_int as c_float) + as c_double, 2 as c_int as c_double, - ) / -(2 as c_int) as c_double - + 1 as c_int as c_double) as c_float; + ) / -(2 as c_int) as c_double + 1 as c_int as c_double) + as c_float; } #[no_mangle] pub unsafe extern "C" fn _spMath_pow2out_apply(mut a: c_float) -> c_float { return (spine_pow( (a - 1 as c_int as c_float) as c_double, 2 as c_int as c_double, - ) * -(1 as c_int) as c_double - + 1 as c_int as c_double) as c_float; + ) * -(1 as c_int) as c_double + 1 as c_int as c_double) + as c_float; } + type _IO_wide_data = u8; type _IO_codecvt = u8; type _IO_marker = u8; pub use crate::c::environment::types::*; + \ No newline at end of file diff --git a/src/c/wasm.rs b/src/c/wasm.rs index 644123b..ce995cb 100644 --- a/src/c/wasm.rs +++ b/src/c/wasm.rs @@ -38,7 +38,7 @@ use crate::c::FILE; use std::alloc::Layout; use std::any::Any; use std::collections::HashMap; -use std::ffi::{CStr, CString}; +use std::ffi::{CStr}; use std::sync::{Arc, Mutex, Once}; pub mod types { @@ -973,15 +973,6 @@ pub(crate) fn printf(c_format: *const c_char, args: &[Box]) { print!("{}", fmt(&format, args)); } -pub(crate) fn sprintf(c_str: *mut c_char, c_format: *const c_char, args: &[Box]) { - let format = unsafe { CStr::from_ptr(c_format).to_str().unwrap().to_owned() }; - let result = fmt(&format, args); - unsafe { - let str = CString::new(result).unwrap(); - spine_strcpy(c_str, str.as_ptr()); - } -} - pub(crate) fn sscanf(c_str: *const c_char, c_format: *const c_char, args: *mut c_uint) { let str = unsafe { CStr::from_ptr(c_str).to_str().unwrap().to_owned() }; let format = unsafe { CStr::from_ptr(c_format).to_str().unwrap().to_owned() }; @@ -1002,17 +993,6 @@ macro_rules! spine_printf { }; } -macro_rules! spine_sprintf { - ($str:expr, $format:expr) => { - crate::c::wasm::sprintf($str, $format, vec![]); - }; - ($str:expr, $format:expr, $($arg:expr),+ $(,)? ) => { - crate::c::wasm::sprintf($str, $format, &[ - $(Box::new($arg)),+ - ]); - }; -} - macro_rules! spine_sscanf { ($str:expr, $format:expr, $a:expr) => { crate::c::wasm::sscanf($str, $format, $a); diff --git a/src/controller.rs b/src/controller.rs index 3f4050f..7cbb156 100644 --- a/src/controller.rs +++ b/src/controller.rs @@ -155,6 +155,7 @@ impl SkeletonController { pub fn update(&mut self, delta_seconds: f32) { self.animation_state.update(delta_seconds); self.animation_state.apply(&mut self.skeleton); + self.skeleton.update(delta_seconds); self.skeleton.update_world_transform(); } diff --git a/src/mesh_attachment.rs b/src/mesh_attachment.rs index 563520c..56c0e82 100644 --- a/src/mesh_attachment.rs +++ b/src/mesh_attachment.rs @@ -72,7 +72,7 @@ impl MeshAttachment { c_accessor!(triangles_count, trianglesCount, i32); c_accessor_passthrough!(triangles, triangles, *mut c_ushort); c_accessor!(edges_count, edgesCount, usize); - c_accessor_passthrough!(edges, edges, *mut i32); + c_accessor_passthrough!(edges, edges, *mut u16); c_accessor_passthrough!(uvs, uvs, *mut c_float); c_accessor_passthrough!(region_uvs, regionUVs, *mut c_float); c_ptr!(c_mesh_attachment, spMeshAttachment); diff --git a/src/skeleton.rs b/src/skeleton.rs index bb79b1f..151a13d 100644 --- a/src/skeleton.rs +++ b/src/skeleton.rs @@ -3,12 +3,7 @@ use std::{borrow::Cow, sync::Arc}; use crate::{ bone::Bone, c::{ - spBone, spSkeleton, spSkeletonData, spSkeleton_create, spSkeleton_dispose, - spSkeleton_getAttachmentForSlotIndex, spSkeleton_getAttachmentForSlotName, - spSkeleton_setAttachment, spSkeleton_setBonesToSetupPose, spSkeleton_setSkin, - spSkeleton_setSkinByName, spSkeleton_setSlotsToSetupPose, spSkeleton_setToSetupPose, - spSkeleton_updateCache, spSkeleton_updateWorldTransform, - spSkeleton_updateWorldTransformWith, spSkin, spSlot, + spBone, spSkeleton, spSkeletonData, spSkeleton_create, spSkeleton_dispose, spSkeleton_getAttachmentForSlotIndex, spSkeleton_getAttachmentForSlotName, spSkeleton_setAttachment, spSkeleton_setBonesToSetupPose, spSkeleton_setSkin, spSkeleton_setSkinByName, spSkeleton_setSlotsToSetupPose, spSkeleton_setToSetupPose, spSkeleton_update, spSkeleton_updateCache, spSkeleton_updateWorldTransform, spSkeleton_updateWorldTransformWith, spSkin, spSlot, SP_PHYSICS_UPDATE }, c_interface::{to_c_str, CTmpMut, CTmpRef, NewFromPtr, SyncPtr}, error::SpineError, @@ -50,6 +45,12 @@ impl Skeleton { } } + pub fn update(&mut self, delta: f32) { + unsafe { + spSkeleton_update(self.c_ptr(), delta); + } + } + /// Caches information about bones and constraints. Must be called if the skin is modified or if /// bones, constraints, or weighted path attachments are added or removed. pub fn update_cache(&mut self) { @@ -65,7 +66,7 @@ impl Skeleton { /// in the Spine Runtimes Guide. pub fn update_world_transform(&mut self) { unsafe { - spSkeleton_updateWorldTransform(self.c_ptr()); + spSkeleton_updateWorldTransform(self.c_ptr(), SP_PHYSICS_UPDATE); } } @@ -80,7 +81,7 @@ impl Skeleton { /// /// The bone must originate from this skeleton. pub unsafe fn update_world_transform_with(&mut self, parent: &Bone) { - spSkeleton_updateWorldTransformWith(self.c_ptr(), parent.c_ptr()); + spSkeleton_updateWorldTransformWith(self.c_ptr(), parent.c_ptr(), SP_PHYSICS_UPDATE); } /// Sets the bones, constraints, slots, and draw order to their setup pose values.