1#![allow(
2 dead_code,
3 mutable_transmutes,
4 non_camel_case_types,
5 non_snake_case,
6 non_upper_case_globals,
7 unused_assignments,
8 unused_mut,
9 clippy::all,
10 clippy::cast_lossless,
11 clippy::missing_panics_doc,
12 clippy::ptr_cast_constness,
13 clippy::ptr_as_ptr,
14 clippy::missing_const_for_fn
15)]
16extern "C" {
17
18 fn spine_memcpy(__dest: *mut c_void, __src: *const c_void, __n: size_t) -> *mut c_void;
19 fn spine_memmove(__dest: *mut c_void, __src: *const c_void, __n: size_t) -> *mut c_void;
20 fn spine_acosf(__x: c_float) -> c_float;
21 fn spine_atan2f(__y: c_float, __x: c_float) -> c_float;
22 fn spine_memset(__s: *mut c_void, __c: c_int, __n: size_t) -> *mut c_void;
23 fn spine_cosf(__x: c_float) -> c_float;
24 fn spine_sinf(__x: c_float) -> c_float;
25 fn spine_strcasecmp(__s1: *const c_char, __s2: *const c_char) -> c_int;
26 fn spine_strcpy(__dest: *mut c_char, __src: *const c_char) -> *mut c_char;
27 fn spine_strncpy(__dest: *mut c_char, __src: *const c_char, __n: size_t) -> *mut c_char;
28 fn spine_strncat(__dest: *mut c_char, __src: *const c_char, __n: size_t) -> *mut c_char;
29 fn spine_strcmp(__s1: *const c_char, __s2: *const c_char) -> c_int;
30 fn spine_strncmp(__s1: *const c_char, __s2: *const c_char, __n: size_t) -> c_int;
31 fn spine_pow(__x: c_double, __y: c_double) -> c_double;
32 fn spine_sqrtf(__x: c_float) -> c_float;
33 fn spine_ceil(__x: c_double) -> c_double;
34 fn _spAtlasPage_createTexture(self_0: *mut spAtlasPage, path: *const c_char);
35 fn _spAtlasPage_disposeTexture(self_0: *mut spAtlasPage);
36 fn _spUtil_readFile(path: *const c_char, length: *mut c_int) -> *mut c_char;
37 fn spine_fmodf(__x: c_float, __y: c_float) -> c_float;
38 fn spine_strtol(__nptr: *const c_char, __endptr: *mut *mut c_char, __base: c_int) -> c_long;
39 fn spine_strtoul(__nptr: *const c_char, __endptr: *mut *mut c_char, __base: c_int) -> c_ulong;
40 fn spine_fclose(__stream: *mut FILE) -> c_int;
41 fn spine_fopen(__filename: *const c_char, __modes: *const c_char) -> *mut FILE;
42 fn spine_strrchr(__s: *const c_char, __c: c_int) -> *mut c_char;
43
44 fn spine_strlen(__s: *const c_char) -> size_t;
45
46 fn spine_rand() -> c_int;
47 fn spine_malloc(__size: size_t) -> *mut c_void;
48 fn spine_realloc(__ptr: *mut c_void, __size: size_t) -> *mut c_void;
49 fn spine_free(__ptr: *mut c_void);
50 fn spine_fread(__ptr: *mut c_void, __size: size_t, __n: size_t, __stream: *mut FILE) -> size_t;
51 fn spine_fseek(__stream: *mut FILE, __off: c_long, __whence: c_int) -> c_int;
52 fn spine_ftell(__stream: *mut FILE) -> c_long;
53}
54#[derive(Copy, Clone)]
55#[repr(C)]
56pub struct spEventData {
57 pub name: *mut c_char,
58 pub intValue: c_int,
59 pub floatValue: c_float,
60 pub stringValue: *mut c_char,
61 pub audioPath: *mut c_char,
62 pub volume: c_float,
63 pub balance: c_float,
64}
65pub type size_t = c_ulong;
66#[derive(Copy, Clone)]
67#[repr(C)]
68pub struct spEvent {
69 pub data: *mut spEventData,
70 pub time: c_float,
71 pub intValue: c_int,
72 pub floatValue: c_float,
73 pub stringValue: *mut c_char,
74 pub volume: c_float,
75 pub balance: c_float,
76}
77#[derive(Copy, Clone)]
78#[repr(C)]
79pub struct spAttachmentLoader {
80 pub error1: *mut c_char,
81 pub error2: *mut c_char,
82 pub vtable: *const c_void,
83}
84pub type spAttachmentType = c_uint;
85pub const SP_ATTACHMENT_CLIPPING: spAttachmentType = 6;
86pub const SP_ATTACHMENT_POINT: spAttachmentType = 5;
87pub const SP_ATTACHMENT_PATH: spAttachmentType = 4;
88pub const SP_ATTACHMENT_LINKED_MESH: spAttachmentType = 3;
89pub const SP_ATTACHMENT_MESH: spAttachmentType = 2;
90pub const SP_ATTACHMENT_BOUNDING_BOX: spAttachmentType = 1;
91pub const SP_ATTACHMENT_REGION: spAttachmentType = 0;
92#[derive(Copy, Clone)]
93#[repr(C)]
94pub struct spAttachment {
95 pub name: *mut c_char,
96 pub type_0: spAttachmentType,
97 pub vtable: *const c_void,
98 pub refCount: c_int,
99 pub attachmentLoader: *mut spAttachmentLoader,
100}
101#[derive(Copy, Clone)]
102#[repr(C)]
103pub struct _spAttachmentVtable {
104 pub dispose: Option<unsafe extern "C" fn(*mut spAttachment) -> ()>,
105 pub copy: Option<unsafe extern "C" fn(*mut spAttachment) -> *mut spAttachment>,
106}
107#[derive(Copy, Clone)]
108#[repr(C)]
109pub struct spColor {
110 pub r: c_float,
111 pub g: c_float,
112 pub b: c_float,
113 pub a: c_float,
114}
115pub type spInherit = c_uint;
116pub const SP_INHERIT_NOSCALEORREFLECTION: spInherit = 4;
117pub const SP_INHERIT_NOSCALE: spInherit = 3;
118pub const SP_INHERIT_NOROTATIONORREFLECTION: spInherit = 2;
119pub const SP_INHERIT_ONLYTRANSLATION: spInherit = 1;
120pub const SP_INHERIT_NORMAL: spInherit = 0;
121#[derive(Copy, Clone)]
122#[repr(C)]
123pub struct spBoneData {
124 pub index: c_int,
125 pub name: *mut c_char,
126 pub parent: *mut spBoneData,
127 pub length: c_float,
128 pub x: c_float,
129 pub y: c_float,
130 pub rotation: c_float,
131 pub scaleX: c_float,
132 pub scaleY: c_float,
133 pub shearX: c_float,
134 pub shearY: c_float,
135 pub inherit: spInherit,
136 pub skinRequired: c_int,
137 pub color: spColor,
138 pub icon: *const c_char,
139 pub visible: c_int,
140}
141pub type spPhysics = c_uint;
142pub const SP_PHYSICS_POSE: spPhysics = 3;
143pub const SP_PHYSICS_UPDATE: spPhysics = 2;
144pub const SP_PHYSICS_RESET: spPhysics = 1;
145pub const SP_PHYSICS_NONE: spPhysics = 0;
146#[derive(Copy, Clone)]
147#[repr(C)]
148pub struct spSkeleton {
149 pub data: *mut spSkeletonData,
150 pub bonesCount: c_int,
151 pub bones: *mut *mut spBone,
152 pub root: *mut spBone,
153 pub slotsCount: c_int,
154 pub slots: *mut *mut spSlot,
155 pub drawOrder: *mut *mut spSlot,
156 pub ikConstraintsCount: c_int,
157 pub ikConstraints: *mut *mut spIkConstraint,
158 pub transformConstraintsCount: c_int,
159 pub transformConstraints: *mut *mut spTransformConstraint,
160 pub pathConstraintsCount: c_int,
161 pub pathConstraints: *mut *mut spPathConstraint,
162 pub physicsConstraintsCount: c_int,
163 pub physicsConstraints: *mut *mut spPhysicsConstraint,
164 pub skin: *mut spSkin,
165 pub color: spColor,
166 pub scaleX: c_float,
167 pub scaleY: c_float,
168 pub x: c_float,
169 pub y: c_float,
170 pub time: c_float,
171}
172#[derive(Copy, Clone)]
173#[repr(C)]
174pub struct spSkin {
175 pub name: *mut c_char,
176 pub bones: *mut spBoneDataArray,
177 pub ikConstraints: *mut spIkConstraintDataArray,
178 pub transformConstraints: *mut spTransformConstraintDataArray,
179 pub pathConstraints: *mut spPathConstraintDataArray,
180 pub physicsConstraints: *mut spPhysicsConstraintDataArray,
181 pub color: spColor,
182}
183#[derive(Copy, Clone)]
184#[repr(C)]
185pub struct spPhysicsConstraintDataArray {
186 pub size: c_int,
187 pub capacity: c_int,
188 pub items: *mut *mut spPhysicsConstraintData,
189}
190#[derive(Copy, Clone)]
191#[repr(C)]
192pub struct spPhysicsConstraintData {
193 pub name: *mut c_char,
194 pub order: c_int,
195 pub skinRequired: c_int,
196 pub bone: *mut spBoneData,
197 pub x: c_float,
198 pub y: c_float,
199 pub rotate: c_float,
200 pub scaleX: c_float,
201 pub shearX: c_float,
202 pub limit: c_float,
203 pub step: c_float,
204 pub inertia: c_float,
205 pub strength: c_float,
206 pub damping: c_float,
207 pub massInverse: c_float,
208 pub wind: c_float,
209 pub gravity: c_float,
210 pub mix: c_float,
211 pub inertiaGlobal: c_int,
212 pub strengthGlobal: c_int,
213 pub dampingGlobal: c_int,
214 pub massGlobal: c_int,
215 pub windGlobal: c_int,
216 pub gravityGlobal: c_int,
217 pub mixGlobal: c_int,
218}
219#[derive(Copy, Clone)]
220#[repr(C)]
221pub struct spPathConstraintDataArray {
222 pub size: c_int,
223 pub capacity: c_int,
224 pub items: *mut *mut spPathConstraintData,
225}
226#[derive(Copy, Clone)]
227#[repr(C)]
228pub struct spPathConstraintData {
229 pub name: *mut c_char,
230 pub order: c_int,
231 pub skinRequired: c_int,
232 pub bonesCount: c_int,
233 pub bones: *mut *mut spBoneData,
234 pub target: *mut spSlotData,
235 pub positionMode: spPositionMode,
236 pub spacingMode: spSpacingMode,
237 pub rotateMode: spRotateMode,
238 pub offsetRotation: c_float,
239 pub position: c_float,
240 pub spacing: c_float,
241 pub mixRotate: c_float,
242 pub mixX: c_float,
243 pub mixY: c_float,
244}
245pub type spRotateMode = c_uint;
246pub const SP_ROTATE_MODE_CHAIN_SCALE: spRotateMode = 2;
247pub const SP_ROTATE_MODE_CHAIN: spRotateMode = 1;
248pub const SP_ROTATE_MODE_TANGENT: spRotateMode = 0;
249pub type spSpacingMode = c_uint;
250pub const SP_SPACING_MODE_PROPORTIONAL: spSpacingMode = 3;
251pub const SP_SPACING_MODE_PERCENT: spSpacingMode = 2;
252pub const SP_SPACING_MODE_FIXED: spSpacingMode = 1;
253pub const SP_SPACING_MODE_LENGTH: spSpacingMode = 0;
254pub type spPositionMode = c_uint;
255pub const SP_POSITION_MODE_PERCENT: spPositionMode = 1;
256pub const SP_POSITION_MODE_FIXED: spPositionMode = 0;
257#[derive(Copy, Clone)]
258#[repr(C)]
259pub struct spSlotData {
260 pub index: c_int,
261 pub name: *mut c_char,
262 pub boneData: *mut spBoneData,
263 pub attachmentName: *mut c_char,
264 pub color: spColor,
265 pub darkColor: *mut spColor,
266 pub blendMode: spBlendMode,
267 pub visible: c_int,
268 pub path: *mut c_char,
269}
270pub type spBlendMode = c_uint;
271pub const SP_BLEND_MODE_SCREEN: spBlendMode = 3;
272pub const SP_BLEND_MODE_MULTIPLY: spBlendMode = 2;
273pub const SP_BLEND_MODE_ADDITIVE: spBlendMode = 1;
274pub const SP_BLEND_MODE_NORMAL: spBlendMode = 0;
275#[derive(Copy, Clone)]
276#[repr(C)]
277pub struct spTransformConstraintDataArray {
278 pub size: c_int,
279 pub capacity: c_int,
280 pub items: *mut *mut spTransformConstraintData,
281}
282#[derive(Copy, Clone)]
283#[repr(C)]
284pub struct spTransformConstraintData {
285 pub name: *mut c_char,
286 pub order: c_int,
287 pub skinRequired: c_int,
288 pub bonesCount: c_int,
289 pub bones: *mut *mut spBoneData,
290 pub target: *mut spBoneData,
291 pub mixRotate: c_float,
292 pub mixX: c_float,
293 pub mixY: c_float,
294 pub mixScaleX: c_float,
295 pub mixScaleY: c_float,
296 pub mixShearY: c_float,
297 pub offsetRotation: c_float,
298 pub offsetX: c_float,
299 pub offsetY: c_float,
300 pub offsetScaleX: c_float,
301 pub offsetScaleY: c_float,
302 pub offsetShearY: c_float,
303 pub relative: c_int,
304 pub local: c_int,
305}
306#[derive(Copy, Clone)]
307#[repr(C)]
308pub struct spIkConstraintDataArray {
309 pub size: c_int,
310 pub capacity: c_int,
311 pub items: *mut *mut spIkConstraintData,
312}
313#[derive(Copy, Clone)]
314#[repr(C)]
315pub struct spIkConstraintData {
316 pub name: *mut c_char,
317 pub order: c_int,
318 pub skinRequired: c_int,
319 pub bonesCount: c_int,
320 pub bones: *mut *mut spBoneData,
321 pub target: *mut spBoneData,
322 pub bendDirection: c_int,
323 pub compress: c_int,
324 pub stretch: c_int,
325 pub uniform: c_int,
326 pub mix: c_float,
327 pub softness: c_float,
328}
329#[derive(Copy, Clone)]
330#[repr(C)]
331pub struct spBoneDataArray {
332 pub size: c_int,
333 pub capacity: c_int,
334 pub items: *mut *mut spBoneData,
335}
336#[derive(Copy, Clone)]
337#[repr(C)]
338pub struct spPhysicsConstraint {
339 pub data: *mut spPhysicsConstraintData,
340 pub bone: *mut spBone,
341 pub inertia: c_float,
342 pub strength: c_float,
343 pub damping: c_float,
344 pub massInverse: c_float,
345 pub wind: c_float,
346 pub gravity: c_float,
347 pub mix: c_float,
348 pub reset: c_int,
349 pub ux: c_float,
350 pub uy: c_float,
351 pub cx: c_float,
352 pub cy: c_float,
353 pub tx: c_float,
354 pub ty: c_float,
355 pub xOffset: c_float,
356 pub xVelocity: c_float,
357 pub yOffset: c_float,
358 pub yVelocity: c_float,
359 pub rotateOffset: c_float,
360 pub rotateVelocity: c_float,
361 pub scaleOffset: c_float,
362 pub scaleVelocity: c_float,
363 pub active: c_int,
364 pub skeleton: *mut spSkeleton,
365 pub remaining: c_float,
366 pub lastTime: c_float,
367}
368#[derive(Copy, Clone)]
369#[repr(C)]
370pub struct spBone {
371 pub data: *mut spBoneData,
372 pub skeleton: *mut spSkeleton,
373 pub parent: *mut spBone,
374 pub childrenCount: c_int,
375 pub children: *mut *mut spBone,
376 pub x: c_float,
377 pub y: c_float,
378 pub rotation: c_float,
379 pub scaleX: c_float,
380 pub scaleY: c_float,
381 pub shearX: c_float,
382 pub shearY: c_float,
383 pub ax: c_float,
384 pub ay: c_float,
385 pub arotation: c_float,
386 pub ascaleX: c_float,
387 pub ascaleY: c_float,
388 pub ashearX: c_float,
389 pub ashearY: c_float,
390 pub a: c_float,
391 pub b: c_float,
392 pub worldX: c_float,
393 pub c: c_float,
394 pub d: c_float,
395 pub worldY: c_float,
396 pub sorted: c_int,
397 pub active: c_int,
398 pub inherit: spInherit,
399}
400#[derive(Copy, Clone)]
401#[repr(C)]
402pub struct spPathConstraint {
403 pub data: *mut spPathConstraintData,
404 pub bonesCount: c_int,
405 pub bones: *mut *mut spBone,
406 pub target: *mut spSlot,
407 pub position: c_float,
408 pub spacing: c_float,
409 pub mixRotate: c_float,
410 pub mixX: c_float,
411 pub mixY: c_float,
412 pub spacesCount: c_int,
413 pub spaces: *mut c_float,
414 pub positionsCount: c_int,
415 pub positions: *mut c_float,
416 pub worldCount: c_int,
417 pub world: *mut c_float,
418 pub curvesCount: c_int,
419 pub curves: *mut c_float,
420 pub lengthsCount: c_int,
421 pub lengths: *mut c_float,
422 pub segments: [c_float; 10],
423 pub active: c_int,
424}
425#[derive(Copy, Clone)]
426#[repr(C)]
427pub struct spSlot {
428 pub data: *mut spSlotData,
429 pub bone: *mut spBone,
430 pub color: spColor,
431 pub darkColor: *mut spColor,
432 pub attachment: *mut spAttachment,
433 pub attachmentState: c_int,
434 pub deformCapacity: c_int,
435 pub deformCount: c_int,
436 pub deform: *mut c_float,
437 pub sequenceIndex: c_int,
438}
439#[derive(Copy, Clone)]
440#[repr(C)]
441pub struct spTransformConstraint {
442 pub data: *mut spTransformConstraintData,
443 pub bonesCount: c_int,
444 pub bones: *mut *mut spBone,
445 pub target: *mut spBone,
446 pub mixRotate: c_float,
447 pub mixX: c_float,
448 pub mixY: c_float,
449 pub mixScaleX: c_float,
450 pub mixScaleY: c_float,
451 pub mixShearY: c_float,
452 pub active: c_int,
453}
454#[derive(Copy, Clone)]
455#[repr(C)]
456pub struct spIkConstraint {
457 pub data: *mut spIkConstraintData,
458 pub bonesCount: c_int,
459 pub bones: *mut *mut spBone,
460 pub target: *mut spBone,
461 pub bendDirection: c_int,
462 pub compress: c_int,
463 pub stretch: c_int,
464 pub mix: c_float,
465 pub softness: c_float,
466 pub active: c_int,
467}
468#[derive(Copy, Clone)]
469#[repr(C)]
470pub struct spSkeletonData {
471 pub version: *mut c_char,
472 pub hash: *mut c_char,
473 pub x: c_float,
474 pub y: c_float,
475 pub width: c_float,
476 pub height: c_float,
477 pub referenceScale: c_float,
478 pub fps: c_float,
479 pub imagesPath: *const c_char,
480 pub audioPath: *const c_char,
481 pub stringsCount: c_int,
482 pub strings: *mut *mut c_char,
483 pub bonesCount: c_int,
484 pub bones: *mut *mut spBoneData,
485 pub slotsCount: c_int,
486 pub slots: *mut *mut spSlotData,
487 pub skinsCount: c_int,
488 pub skins: *mut *mut spSkin,
489 pub defaultSkin: *mut spSkin,
490 pub eventsCount: c_int,
491 pub events: *mut *mut spEventData,
492 pub animationsCount: c_int,
493 pub animations: *mut *mut spAnimation,
494 pub ikConstraintsCount: c_int,
495 pub ikConstraints: *mut *mut spIkConstraintData,
496 pub transformConstraintsCount: c_int,
497 pub transformConstraints: *mut *mut spTransformConstraintData,
498 pub pathConstraintsCount: c_int,
499 pub pathConstraints: *mut *mut spPathConstraintData,
500 pub physicsConstraintsCount: c_int,
501 pub physicsConstraints: *mut *mut spPhysicsConstraintData,
502}
503#[derive(Copy, Clone)]
504#[repr(C)]
505pub struct spAnimation {
506 pub name: *mut c_char,
507 pub duration: c_float,
508 pub timelines: *mut spTimelineArray,
509 pub timelineIds: *mut spPropertyIdArray,
510}
511#[derive(Copy, Clone)]
512#[repr(C)]
513pub struct spPropertyIdArray {
514 pub size: c_int,
515 pub capacity: c_int,
516 pub items: *mut spPropertyId,
517}
518pub type spPropertyId = uint64_t;
519pub type uint64_t = __uint64_t;
520pub type __uint64_t = c_ulong;
521#[derive(Copy, Clone)]
522#[repr(C)]
523pub struct spTimelineArray {
524 pub size: c_int,
525 pub capacity: c_int,
526 pub items: *mut *mut spTimeline,
527}
528#[derive(Copy, Clone)]
529#[repr(C)]
530pub struct spTimeline {
531 pub vtable: _spTimelineVtable,
532 pub propertyIds: [spPropertyId; 3],
533 pub propertyIdsCount: c_int,
534 pub frames: *mut spFloatArray,
535 pub frameCount: c_int,
536 pub frameEntries: c_int,
537 pub type_0: spTimelineType,
538}
539pub type spTimelineType = c_uint;
540pub const SP_TIMELINE_EVENT: spTimelineType = 33;
541pub const SP_TIMELINE_DRAWORDER: spTimelineType = 32;
542pub const SP_TIMELINE_TRANSFORMCONSTRAINT: spTimelineType = 31;
543pub const SP_TIMELINE_RGB: spTimelineType = 30;
544pub const SP_TIMELINE_RGBA: spTimelineType = 29;
545pub const SP_TIMELINE_RGBA2: spTimelineType = 28;
546pub const SP_TIMELINE_RGB2: spTimelineType = 27;
547pub const SP_TIMELINE_PHYSICSCONSTRAINT_RESET: spTimelineType = 26;
548pub const SP_TIMELINE_PHYSICSCONSTRAINT_MIX: spTimelineType = 25;
549pub const SP_TIMELINE_PHYSICSCONSTRAINT_GRAVITY: spTimelineType = 24;
550pub const SP_TIMELINE_PHYSICSCONSTRAINT_WIND: spTimelineType = 23;
551pub const SP_TIMELINE_PHYSICSCONSTRAINT_MASS: spTimelineType = 22;
552pub const SP_TIMELINE_PHYSICSCONSTRAINT_DAMPING: spTimelineType = 21;
553pub const SP_TIMELINE_PHYSICSCONSTRAINT_STRENGTH: spTimelineType = 20;
554pub const SP_TIMELINE_PHYSICSCONSTRAINT_INERTIA: spTimelineType = 19;
555pub const SP_TIMELINE_PATHCONSTRAINTMIX: spTimelineType = 18;
556pub const SP_TIMELINE_IKCONSTRAINT: spTimelineType = 17;
557pub const SP_TIMELINE_INHERIT: spTimelineType = 16;
558pub const SP_TIMELINE_SEQUENCE: spTimelineType = 15;
559pub const SP_TIMELINE_DEFORM: spTimelineType = 14;
560pub const SP_TIMELINE_TRANSLATE: spTimelineType = 13;
561pub const SP_TIMELINE_SHEAR: spTimelineType = 12;
562pub const SP_TIMELINE_SCALE: spTimelineType = 11;
563pub const SP_TIMELINE_TRANSLATEY: spTimelineType = 10;
564pub const SP_TIMELINE_TRANSLATEX: spTimelineType = 9;
565pub const SP_TIMELINE_SHEARY: spTimelineType = 8;
566pub const SP_TIMELINE_SHEARX: spTimelineType = 7;
567pub const SP_TIMELINE_SCALEY: spTimelineType = 6;
568pub const SP_TIMELINE_SCALEX: spTimelineType = 5;
569pub const SP_TIMELINE_ROTATE: spTimelineType = 4;
570pub const SP_TIMELINE_PATHCONSTRAINTSPACING: spTimelineType = 3;
571pub const SP_TIMELINE_PATHCONSTRAINTPOSITION: spTimelineType = 2;
572pub const SP_TIMELINE_ALPHA: spTimelineType = 1;
573pub const SP_TIMELINE_ATTACHMENT: spTimelineType = 0;
574#[derive(Copy, Clone)]
575#[repr(C)]
576pub struct spFloatArray {
577 pub size: c_int,
578 pub capacity: c_int,
579 pub items: *mut c_float,
580}
581#[derive(Copy, Clone)]
582#[repr(C)]
583pub struct _spTimelineVtable {
584 pub apply: Option<
585 unsafe extern "C" fn(
586 *mut spTimeline,
587 *mut spSkeleton,
588 c_float,
589 c_float,
590 *mut *mut spEvent,
591 *mut c_int,
592 c_float,
593 spMixBlend,
594 spMixDirection,
595 ) -> (),
596 >,
597 pub dispose: Option<unsafe extern "C" fn(*mut spTimeline) -> ()>,
598 pub setBezier: Option<
599 unsafe extern "C" fn(
600 *mut spTimeline,
601 c_int,
602 c_int,
603 c_float,
604 c_float,
605 c_float,
606 c_float,
607 c_float,
608 c_float,
609 c_float,
610 c_float,
611 c_float,
612 ) -> (),
613 >,
614}
615pub type spMixDirection = c_uint;
616pub const SP_MIX_DIRECTION_OUT: spMixDirection = 1;
617pub const SP_MIX_DIRECTION_IN: spMixDirection = 0;
618pub type spMixBlend = c_uint;
619pub const SP_MIX_BLEND_ADD: spMixBlend = 3;
620pub const SP_MIX_BLEND_REPLACE: spMixBlend = 2;
621pub const SP_MIX_BLEND_FIRST: spMixBlend = 1;
622pub const SP_MIX_BLEND_SETUP: spMixBlend = 0;
623#[derive(Copy, Clone)]
624#[repr(C)]
625pub struct _SkinHashTableEntry {
626 pub entry: *mut _Entry,
627 pub next: *mut _SkinHashTableEntry,
628}
629#[derive(Copy, Clone)]
630#[repr(C)]
631pub struct _Entry {
632 pub slotIndex: c_int,
633 pub name: *mut c_char,
634 pub attachment: *mut spAttachment,
635 pub next: *mut _Entry,
636}
637#[derive(Copy, Clone)]
638#[repr(C)]
639pub struct _spSkin {
640 pub super_0: spSkin,
641 pub entries: *mut _Entry,
642 pub entriesHashTable: [*mut _SkinHashTableEntry; 100],
643}
644#[derive(Copy, Clone)]
645#[repr(C)]
646pub struct spVertexAttachment {
647 pub super_0: spAttachment,
648 pub bonesCount: c_int,
649 pub bones: *mut c_int,
650 pub verticesCount: c_int,
651 pub vertices: *mut c_float,
652 pub worldVerticesLength: c_int,
653 pub timelineAttachment: *mut spAttachment,
654 pub id: c_int,
655}
656#[derive(Copy, Clone)]
657#[repr(C)]
658pub struct spSequence {
659 pub id: c_int,
660 pub start: c_int,
661 pub digits: c_int,
662 pub setupIndex: c_int,
663 pub regions: *mut spTextureRegionArray,
664}
665#[derive(Copy, Clone)]
666#[repr(C)]
667pub struct spTextureRegionArray {
668 pub size: c_int,
669 pub capacity: c_int,
670 pub items: *mut *mut spTextureRegion,
671}
672#[derive(Copy, Clone)]
673#[repr(C)]
674pub struct spTextureRegion {
675 pub rendererObject: *mut c_void,
676 pub u: c_float,
677 pub v: c_float,
678 pub u2: c_float,
679 pub v2: c_float,
680 pub degrees: c_int,
681 pub offsetX: c_float,
682 pub offsetY: c_float,
683 pub width: c_int,
684 pub height: c_int,
685 pub originalWidth: c_int,
686 pub originalHeight: c_int,
687}
688#[derive(Copy, Clone)]
689#[repr(C)]
690pub struct spMeshAttachment {
691 pub super_0: spVertexAttachment,
692 pub rendererObject: *mut c_void,
693 pub region: *mut spTextureRegion,
694 pub sequence: *mut spSequence,
695 pub path: *mut c_char,
696 pub regionUVs: *mut c_float,
697 pub uvs: *mut c_float,
698 pub trianglesCount: c_int,
699 pub triangles: *mut c_ushort,
700 pub color: spColor,
701 pub hullLength: c_int,
702 pub parentMesh: *mut spMeshAttachment,
703 pub edgesCount: c_int,
704 pub edges: *mut c_ushort,
705 pub width: c_float,
706 pub height: c_float,
707}
708#[derive(Copy, Clone)]
709#[repr(C)]
710pub struct spRegionAttachment {
711 pub super_0: spAttachment,
712 pub path: *mut c_char,
713 pub x: c_float,
714 pub y: c_float,
715 pub scaleX: c_float,
716 pub scaleY: c_float,
717 pub rotation: c_float,
718 pub width: c_float,
719 pub height: c_float,
720 pub color: spColor,
721 pub rendererObject: *mut c_void,
722 pub region: *mut spTextureRegion,
723 pub sequence: *mut spSequence,
724 pub offset: [c_float; 8],
725 pub uvs: [c_float; 8],
726}
727pub const BLY: C2RustUnnamed_1 = 1;
728pub const BLX: C2RustUnnamed_1 = 0;
729pub const BRY: C2RustUnnamed_1 = 7;
730pub const BRX: C2RustUnnamed_1 = 6;
731pub const URY: C2RustUnnamed_1 = 5;
732pub const URX: C2RustUnnamed_1 = 4;
733pub const ULY: C2RustUnnamed_1 = 3;
734pub const ULX: C2RustUnnamed_1 = 2;
735#[derive(Copy, Clone)]
736#[repr(C)]
737pub struct spIntArray {
738 pub size: c_int,
739 pub capacity: c_int,
740 pub items: *mut c_int,
741}
742#[derive(Copy, Clone)]
743#[repr(C)]
744pub struct spShortArray {
745 pub size: c_int,
746 pub capacity: c_int,
747 pub items: *mut c_short,
748}
749#[derive(Copy, Clone)]
750#[repr(C)]
751pub struct spUnsignedShortArray {
752 pub size: c_int,
753 pub capacity: c_int,
754 pub items: *mut c_ushort,
755}
756#[derive(Copy, Clone)]
757#[repr(C)]
758pub struct spArrayFloatArray {
759 pub size: c_int,
760 pub capacity: c_int,
761 pub items: *mut *mut spFloatArray,
762}
763#[derive(Copy, Clone)]
764#[repr(C)]
765pub struct spArrayShortArray {
766 pub size: c_int,
767 pub capacity: c_int,
768 pub items: *mut *mut spShortArray,
769}
770#[derive(Copy, Clone)]
771#[repr(C)]
772pub struct spAtlas {
773 pub pages: *mut spAtlasPage,
774 pub regions: *mut spAtlasRegion,
775 pub rendererObject: *mut c_void,
776}
777#[derive(Copy, Clone)]
778#[repr(C)]
779pub struct spAtlasRegion {
780 pub super_0: spTextureRegion,
781 pub name: *const c_char,
782 pub x: c_int,
783 pub y: c_int,
784 pub index: c_int,
785 pub splits: *mut c_int,
786 pub pads: *mut c_int,
787 pub keyValues: *mut spKeyValueArray,
788 pub page: *mut spAtlasPage,
789 pub next: *mut spAtlasRegion,
790}
791#[derive(Copy, Clone)]
792#[repr(C)]
793pub struct spAtlasPage {
794 pub atlas: *mut spAtlas,
795 pub name: *mut c_char,
796 pub format: spAtlasFormat,
797 pub minFilter: spAtlasFilter,
798 pub magFilter: spAtlasFilter,
799 pub uWrap: spAtlasWrap,
800 pub vWrap: spAtlasWrap,
801 pub rendererObject: *mut c_void,
802 pub width: c_int,
803 pub height: c_int,
804 pub pma: c_int,
805 pub next: *mut spAtlasPage,
806}
807pub type spAtlasWrap = c_uint;
808pub const SP_ATLAS_REPEAT: spAtlasWrap = 2;
809pub const SP_ATLAS_CLAMPTOEDGE: spAtlasWrap = 1;
810pub const SP_ATLAS_MIRROREDREPEAT: spAtlasWrap = 0;
811pub type spAtlasFilter = c_uint;
812pub const SP_ATLAS_MIPMAP_LINEAR_LINEAR: spAtlasFilter = 7;
813pub const SP_ATLAS_MIPMAP_NEAREST_LINEAR: spAtlasFilter = 6;
814pub const SP_ATLAS_MIPMAP_LINEAR_NEAREST: spAtlasFilter = 5;
815pub const SP_ATLAS_MIPMAP_NEAREST_NEAREST: spAtlasFilter = 4;
816pub const SP_ATLAS_MIPMAP: spAtlasFilter = 3;
817pub const SP_ATLAS_LINEAR: spAtlasFilter = 2;
818pub const SP_ATLAS_NEAREST: spAtlasFilter = 1;
819pub const SP_ATLAS_UNKNOWN_FILTER: spAtlasFilter = 0;
820pub type spAtlasFormat = c_uint;
821pub const SP_ATLAS_RGBA8888: spAtlasFormat = 7;
822pub const SP_ATLAS_RGB888: spAtlasFormat = 6;
823pub const SP_ATLAS_RGBA4444: spAtlasFormat = 5;
824pub const SP_ATLAS_RGB565: spAtlasFormat = 4;
825pub const SP_ATLAS_LUMINANCE_ALPHA: spAtlasFormat = 3;
826pub const SP_ATLAS_INTENSITY: spAtlasFormat = 2;
827pub const SP_ATLAS_ALPHA: spAtlasFormat = 1;
828pub const SP_ATLAS_UNKNOWN_FORMAT: spAtlasFormat = 0;
829#[derive(Copy, Clone)]
830#[repr(C)]
831pub struct spKeyValueArray {
832 pub size: c_int,
833 pub capacity: c_int,
834 pub items: *mut spKeyValue,
835}
836#[derive(Copy, Clone)]
837#[repr(C)]
838pub struct spKeyValue {
839 pub name: *mut c_char,
840 pub values: [c_float; 5],
841}
842#[derive(Copy, Clone)]
843#[repr(C)]
844pub struct SimpleString {
845 pub start: *mut c_char,
846 pub end: *mut c_char,
847 pub length: c_int,
848}
849#[derive(Copy, Clone)]
850#[repr(C)]
851pub struct AtlasInput {
852 pub start: *const c_char,
853 pub end: *const c_char,
854 pub index: *mut c_char,
855 pub length: c_int,
856 pub line: SimpleString,
857}
858pub type __int32_t = c_int;
859pub type __uint32_t = c_uint;
860pub type __off_t = c_long;
861pub type __off64_t = c_long;
862pub type int32_t = __int32_t;
863pub type uint32_t = __uint32_t;
864pub type C2RustUnnamed = c_uint;
865pub const SP_PROPERTY_SEQUENCE: C2RustUnnamed = 268435456;
866pub const SP_PROPERTY_PHYSICSCONSTRAINT_RESET: C2RustUnnamed = 134217728;
867pub const SP_PROPERTY_PHYSICSCONSTRAINT_MIX: C2RustUnnamed = 67108864;
868pub const SP_PROPERTY_PHYSICSCONSTRAINT_GRAVITY: C2RustUnnamed = 33554432;
869pub const SP_PROPERTY_PHYSICSCONSTRAINT_WIND: C2RustUnnamed = 16777216;
870pub const SP_PROPERTY_PHYSICSCONSTRAINT_MASS: C2RustUnnamed = 8388608;
871pub const SP_PROPERTY_PHYSICSCONSTRAINT_DAMPING: C2RustUnnamed = 4194304;
872pub const SP_PROPERTY_PHYSICSCONSTRAINT_STRENGTH: C2RustUnnamed = 2097152;
873pub const SP_PROPERTY_PHYSICSCONSTRAINT_INERTIA: C2RustUnnamed = 1048576;
874pub const SP_PROPERTY_PATHCONSTRAINT_MIX: C2RustUnnamed = 524288;
875pub const SP_PROPERTY_PATHCONSTRAINT_SPACING: C2RustUnnamed = 262144;
876pub const SP_PROPERTY_PATHCONSTRAINT_POSITION: C2RustUnnamed = 131072;
877pub const SP_PROPERTY_TRANSFORMCONSTRAINT: C2RustUnnamed = 65536;
878pub const SP_PROPERTY_IKCONSTRAINT: C2RustUnnamed = 32768;
879pub const SP_PROPERTY_DRAWORDER: C2RustUnnamed = 16384;
880pub const SP_PROPERTY_EVENT: C2RustUnnamed = 8192;
881pub const SP_PROPERTY_DEFORM: C2RustUnnamed = 4096;
882pub const SP_PROPERTY_ATTACHMENT: C2RustUnnamed = 2048;
883pub const SP_PROPERTY_RGB2: C2RustUnnamed = 1024;
884pub const SP_PROPERTY_ALPHA: C2RustUnnamed = 512;
885pub const SP_PROPERTY_RGB: C2RustUnnamed = 256;
886pub const SP_PROPERTY_INHERIT: C2RustUnnamed = 128;
887pub const SP_PROPERTY_SHEARY: C2RustUnnamed = 64;
888pub const SP_PROPERTY_SHEARX: C2RustUnnamed = 32;
889pub const SP_PROPERTY_SCALEY: C2RustUnnamed = 16;
890pub const SP_PROPERTY_SCALEX: C2RustUnnamed = 8;
891pub const SP_PROPERTY_Y: C2RustUnnamed = 4;
892pub const SP_PROPERTY_X: C2RustUnnamed = 2;
893pub const SP_PROPERTY_ROTATE: C2RustUnnamed = 1;
894#[derive(Copy, Clone)]
895#[repr(C)]
896pub struct spCurveTimeline {
897 pub super_0: spTimeline,
898 pub curves: *mut spFloatArray,
899}
900pub type spCurveTimeline1 = spCurveTimeline;
901pub type spCurveTimeline2 = spCurveTimeline;
902#[derive(Copy, Clone)]
903#[repr(C)]
904pub struct spRotateTimeline {
905 pub super_0: spCurveTimeline1,
906 pub boneIndex: c_int,
907}
908#[derive(Copy, Clone)]
909#[repr(C)]
910pub struct spTranslateTimeline {
911 pub super_0: spCurveTimeline2,
912 pub boneIndex: c_int,
913}
914#[derive(Copy, Clone)]
915#[repr(C)]
916pub struct spTranslateXTimeline {
917 pub super_0: spCurveTimeline1,
918 pub boneIndex: c_int,
919}
920#[derive(Copy, Clone)]
921#[repr(C)]
922pub struct spTranslateYTimeline {
923 pub super_0: spCurveTimeline1,
924 pub boneIndex: c_int,
925}
926#[derive(Copy, Clone)]
927#[repr(C)]
928pub struct spScaleTimeline {
929 pub super_0: spCurveTimeline2,
930 pub boneIndex: c_int,
931}
932#[derive(Copy, Clone)]
933#[repr(C)]
934pub struct spScaleXTimeline {
935 pub super_0: spCurveTimeline1,
936 pub boneIndex: c_int,
937}
938#[derive(Copy, Clone)]
939#[repr(C)]
940pub struct spScaleYTimeline {
941 pub super_0: spCurveTimeline1,
942 pub boneIndex: c_int,
943}
944#[derive(Copy, Clone)]
945#[repr(C)]
946pub struct spShearTimeline {
947 pub super_0: spCurveTimeline2,
948 pub boneIndex: c_int,
949}
950#[derive(Copy, Clone)]
951#[repr(C)]
952pub struct spShearXTimeline {
953 pub super_0: spCurveTimeline1,
954 pub boneIndex: c_int,
955}
956#[derive(Copy, Clone)]
957#[repr(C)]
958pub struct spShearYTimeline {
959 pub super_0: spCurveTimeline1,
960 pub boneIndex: c_int,
961}
962#[derive(Copy, Clone)]
963#[repr(C)]
964pub struct spRGBATimeline {
965 pub super_0: spCurveTimeline2,
966 pub slotIndex: c_int,
967}
968#[derive(Copy, Clone)]
969#[repr(C)]
970pub struct spRGBTimeline {
971 pub super_0: spCurveTimeline2,
972 pub slotIndex: c_int,
973}
974#[derive(Copy, Clone)]
975#[repr(C)]
976pub struct spAlphaTimeline {
977 pub super_0: spCurveTimeline1,
978 pub slotIndex: c_int,
979}
980#[derive(Copy, Clone)]
981#[repr(C)]
982pub struct spRGBA2Timeline {
983 pub super_0: spCurveTimeline,
984 pub slotIndex: c_int,
985}
986#[derive(Copy, Clone)]
987#[repr(C)]
988pub struct spRGB2Timeline {
989 pub super_0: spCurveTimeline,
990 pub slotIndex: c_int,
991}
992#[derive(Copy, Clone)]
993#[repr(C)]
994pub struct spAttachmentTimeline {
995 pub super_0: spTimeline,
996 pub slotIndex: c_int,
997 pub attachmentNames: *mut *mut c_char,
998}
999#[derive(Copy, Clone)]
1000#[repr(C)]
1001pub struct spDeformTimeline {
1002 pub super_0: spCurveTimeline,
1003 pub frameVerticesCount: c_int,
1004 pub frameVertices: *mut *mut c_float,
1005 pub slotIndex: c_int,
1006 pub attachment: *mut spAttachment,
1007}
1008#[derive(Copy, Clone)]
1009#[repr(C)]
1010pub struct spSequenceTimeline {
1011 pub super_0: spTimeline,
1012 pub slotIndex: c_int,
1013 pub attachment: *mut spAttachment,
1014}
1015#[derive(Copy, Clone)]
1016#[repr(C)]
1017pub struct spEventTimeline {
1018 pub super_0: spTimeline,
1019 pub events: *mut *mut spEvent,
1020}
1021#[derive(Copy, Clone)]
1022#[repr(C)]
1023pub struct spDrawOrderTimeline {
1024 pub super_0: spTimeline,
1025 pub drawOrders: *mut *mut c_int,
1026 pub slotsCount: c_int,
1027}
1028#[derive(Copy, Clone)]
1029#[repr(C)]
1030pub struct spInheritTimeline {
1031 pub super_0: spTimeline,
1032 pub boneIndex: c_int,
1033}
1034#[derive(Copy, Clone)]
1035#[repr(C)]
1036pub struct spIkConstraintTimeline {
1037 pub super_0: spCurveTimeline,
1038 pub ikConstraintIndex: c_int,
1039}
1040#[derive(Copy, Clone)]
1041#[repr(C)]
1042pub struct spTransformConstraintTimeline {
1043 pub super_0: spCurveTimeline,
1044 pub transformConstraintIndex: c_int,
1045}
1046#[derive(Copy, Clone)]
1047#[repr(C)]
1048pub struct spPathConstraintPositionTimeline {
1049 pub super_0: spCurveTimeline,
1050 pub pathConstraintIndex: c_int,
1051}
1052#[derive(Copy, Clone)]
1053#[repr(C)]
1054pub struct spPathConstraintSpacingTimeline {
1055 pub super_0: spCurveTimeline,
1056 pub pathConstraintIndex: c_int,
1057}
1058#[derive(Copy, Clone)]
1059#[repr(C)]
1060pub struct spPathConstraintMixTimeline {
1061 pub super_0: spCurveTimeline,
1062 pub pathConstraintIndex: c_int,
1063}
1064#[derive(Copy, Clone)]
1065#[repr(C)]
1066pub struct spPhysicsConstraintTimeline {
1067 pub super_0: spCurveTimeline,
1068 pub physicsConstraintIndex: c_int,
1069}
1070#[derive(Copy, Clone)]
1071#[repr(C)]
1072pub struct spPhysicsConstraintResetTimeline {
1073 pub super_0: spTimeline,
1074 pub physicsConstraintIndex: c_int,
1075}
1076pub type spSkinEntry = _Entry;
1077#[derive(Copy, Clone)]
1078#[repr(C)]
1079pub struct _spAttachmentLoaderVtable {
1080 pub createAttachment: Option<
1081 unsafe extern "C" fn(
1082 *mut spAttachmentLoader,
1083 *mut spSkin,
1084 spAttachmentType,
1085 *const c_char,
1086 *const c_char,
1087 *mut spSequence,
1088 ) -> *mut spAttachment,
1089 >,
1090 pub configureAttachment:
1091 Option<unsafe extern "C" fn(*mut spAttachmentLoader, *mut spAttachment) -> ()>,
1092 pub disposeAttachment:
1093 Option<unsafe extern "C" fn(*mut spAttachmentLoader, *mut spAttachment) -> ()>,
1094 pub dispose: Option<unsafe extern "C" fn(*mut spAttachmentLoader) -> ()>,
1095}
1096#[derive(Copy, Clone)]
1097#[repr(C)]
1098pub struct spPathAttachment {
1099 pub super_0: spVertexAttachment,
1100 pub lengthsLength: c_int,
1101 pub lengths: *mut c_float,
1102 pub closed: c_int,
1103 pub constantSpeed: c_int,
1104 pub color: spColor,
1105}
1106#[derive(Copy, Clone)]
1107#[repr(C)]
1108pub struct _spSkeleton {
1109 pub super_0: spSkeleton,
1110 pub updateCacheCount: c_int,
1111 pub updateCacheCapacity: c_int,
1112 pub updateCache: *mut _spUpdate,
1113}
1114#[derive(Copy, Clone)]
1115#[repr(C)]
1116pub struct _spUpdate {
1117 pub type_0: _spUpdateType,
1118 pub object: *mut c_void,
1119}
1120pub type _spUpdateType = c_uint;
1121pub const SP_UPDATE_PHYSICS_CONSTRAINT: _spUpdateType = 4;
1122pub const SP_UPDATE_TRANSFORM_CONSTRAINT: _spUpdateType = 3;
1123pub const SP_UPDATE_PATH_CONSTRAINT: _spUpdateType = 2;
1124pub const SP_UPDATE_IK_CONSTRAINT: _spUpdateType = 1;
1125pub const SP_UPDATE_BONE: _spUpdateType = 0;
1126#[derive(Copy, Clone)]
1127#[repr(C)]
1128pub struct spBoundingBoxAttachment {
1129 pub super_0: spVertexAttachment,
1130 pub color: spColor,
1131}
1132#[derive(Copy, Clone)]
1133#[repr(C)]
1134pub struct spClippingAttachment {
1135 pub super_0: spVertexAttachment,
1136 pub endSlot: *mut spSlotData,
1137 pub color: spColor,
1138}
1139#[derive(Copy, Clone)]
1140#[repr(C)]
1141pub struct spPointAttachment {
1142 pub super_0: spAttachment,
1143 pub x: c_float,
1144 pub y: c_float,
1145 pub rotation: c_float,
1146 pub color: spColor,
1147}
1148#[derive(Copy, Clone)]
1149#[repr(C)]
1150pub struct spAnimationStateData {
1151 pub skeletonData: *mut spSkeletonData,
1152 pub defaultMix: c_float,
1153 pub entries: *const c_void,
1154}
1155#[derive(Copy, Clone)]
1156#[repr(C)]
1157pub struct _FromEntry {
1158 pub animation: *mut spAnimation,
1159 pub toEntries: *mut _ToEntry,
1160 pub next: *mut _FromEntry,
1161}
1162#[derive(Copy, Clone)]
1163#[repr(C)]
1164pub struct _ToEntry {
1165 pub animation: *mut spAnimation,
1166 pub duration: c_float,
1167 pub next: *mut _ToEntry,
1168}
1169pub type spEventType = c_uint;
1170pub const SP_ANIMATION_EVENT: spEventType = 5;
1171pub const SP_ANIMATION_DISPOSE: spEventType = 4;
1172pub const SP_ANIMATION_COMPLETE: spEventType = 3;
1173pub const SP_ANIMATION_END: spEventType = 2;
1174pub const SP_ANIMATION_INTERRUPT: spEventType = 1;
1175pub const SP_ANIMATION_START: spEventType = 0;
1176#[derive(Copy, Clone)]
1177#[repr(C)]
1178pub struct spAnimationState {
1179 pub data: *mut spAnimationStateData,
1180 pub tracksCount: c_int,
1181 pub tracks: *mut *mut spTrackEntry,
1182 pub listener: spAnimationStateListener,
1183 pub timeScale: c_float,
1184 pub rendererObject: *mut c_void,
1185 pub userData: *mut c_void,
1186 pub unkeyedState: c_int,
1187}
1188pub type spAnimationStateListener = Option<
1189 unsafe extern "C" fn(*mut spAnimationState, spEventType, *mut spTrackEntry, *mut spEvent) -> (),
1190>;
1191#[derive(Copy, Clone)]
1192#[repr(C)]
1193pub struct spTrackEntry {
1194 pub animation: *mut spAnimation,
1195 pub previous: *mut spTrackEntry,
1196 pub next: *mut spTrackEntry,
1197 pub mixingFrom: *mut spTrackEntry,
1198 pub mixingTo: *mut spTrackEntry,
1199 pub listener: spAnimationStateListener,
1200 pub trackIndex: c_int,
1201 pub loop_0: c_int,
1202 pub holdPrevious: c_int,
1203 pub reverse: c_int,
1204 pub shortestRotation: c_int,
1205 pub eventThreshold: c_float,
1206 pub mixAttachmentThreshold: c_float,
1207 pub alphaAttachmentThreshold: c_float,
1208 pub mixDrawOrderThreshold: c_float,
1209 pub animationStart: c_float,
1210 pub animationEnd: c_float,
1211 pub animationLast: c_float,
1212 pub nextAnimationLast: c_float,
1213 pub delay: c_float,
1214 pub trackTime: c_float,
1215 pub trackLast: c_float,
1216 pub nextTrackLast: c_float,
1217 pub trackEnd: c_float,
1218 pub timeScale: c_float,
1219 pub alpha: c_float,
1220 pub mixTime: c_float,
1221 pub mixDuration: c_float,
1222 pub interruptAlpha: c_float,
1223 pub totalAlpha: c_float,
1224 pub mixBlend: spMixBlend,
1225 pub timelineMode: *mut spIntArray,
1226 pub timelineHoldMix: *mut spTrackEntryArray,
1227 pub timelinesRotation: *mut c_float,
1228 pub timelinesRotationCount: c_int,
1229 pub rendererObject: *mut c_void,
1230 pub userData: *mut c_void,
1231}
1232#[derive(Copy, Clone)]
1233#[repr(C)]
1234pub struct spTrackEntryArray {
1235 pub size: c_int,
1236 pub capacity: c_int,
1237 pub items: *mut *mut spTrackEntry,
1238}
1239#[derive(Copy, Clone)]
1240#[repr(C)]
1241pub struct _spAnimationState {
1242 pub super_0: spAnimationState,
1243 pub eventsCount: c_int,
1244 pub events: *mut *mut spEvent,
1245 pub queue: *mut _spEventQueue,
1246 pub propertyIDs: *mut spPropertyId,
1247 pub propertyIDsCount: c_int,
1248 pub propertyIDsCapacity: c_int,
1249 pub animationsChanged: c_int,
1250}
1251#[derive(Copy, Clone)]
1252#[repr(C)]
1253pub struct _spEventQueue {
1254 pub state: *mut _spAnimationState,
1255 pub objects: *mut _spEventQueueItem,
1256 pub objectsCount: c_int,
1257 pub objectsCapacity: c_int,
1258 pub drainDisabled: c_int,
1259}
1260#[derive(Copy, Clone)]
1261#[repr(C)]
1262pub union _spEventQueueItem {
1263 pub type_0: c_int,
1264 pub entry: *mut spTrackEntry,
1265 pub event: *mut spEvent,
1266}
1267pub type FILE = _IO_FILE;
1268#[derive(Copy, Clone)]
1269#[repr(C)]
1270pub struct _IO_FILE {
1271 pub _flags: c_int,
1272 pub _IO_read_ptr: *mut c_char,
1273 pub _IO_read_end: *mut c_char,
1274 pub _IO_read_base: *mut c_char,
1275 pub _IO_write_base: *mut c_char,
1276 pub _IO_write_ptr: *mut c_char,
1277 pub _IO_write_end: *mut c_char,
1278 pub _IO_buf_base: *mut c_char,
1279 pub _IO_buf_end: *mut c_char,
1280 pub _IO_save_base: *mut c_char,
1281 pub _IO_backup_base: *mut c_char,
1282 pub _IO_save_end: *mut c_char,
1283 pub _markers: *mut _IO_marker,
1284 pub _chain: *mut _IO_FILE,
1285 pub _fileno: c_int,
1286 pub _flags2: c_int,
1287 pub _old_offset: __off_t,
1288 pub _cur_column: c_ushort,
1289 pub _vtable_offset: c_schar,
1290 pub _shortbuf: [c_char; 1],
1291 pub _lock: *mut c_void,
1292 pub _offset: __off64_t,
1293 pub _codecvt: *mut _IO_codecvt,
1294 pub _wide_data: *mut _IO_wide_data,
1295 pub _freeres_list: *mut _IO_FILE,
1296 pub _freeres_buf: *mut c_void,
1297 pub __pad5: size_t,
1298 pub _mode: c_int,
1299 pub _unused2: [c_char; 20],
1300}
1301pub type _IO_lock_t = ();
1302#[derive(Copy, Clone)]
1303#[repr(C)]
1304pub struct spAtlasAttachmentLoader {
1305 pub super_0: spAttachmentLoader,
1306 pub atlas: *mut spAtlas,
1307}
1308#[derive(Copy, Clone)]
1309#[repr(C)]
1310pub struct spPolygon {
1311 pub vertices: *mut c_float,
1312 pub count: c_int,
1313 pub capacity: c_int,
1314}
1315#[derive(Copy, Clone)]
1316#[repr(C)]
1317pub struct spSkeletonBounds {
1318 pub count: c_int,
1319 pub boundingBoxes: *mut *mut spBoundingBoxAttachment,
1320 pub polygons: *mut *mut spPolygon,
1321 pub minX: c_float,
1322 pub minY: c_float,
1323 pub maxX: c_float,
1324 pub maxY: c_float,
1325}
1326#[derive(Copy, Clone)]
1327#[repr(C)]
1328pub struct _spSkeletonBounds {
1329 pub super_0: spSkeletonBounds,
1330 pub capacity: c_int,
1331}
1332#[derive(Copy, Clone)]
1333#[repr(C)]
1334pub struct spSkeletonBinary {
1335 pub scale: c_float,
1336 pub attachmentLoader: *mut spAttachmentLoader,
1337 pub error: *mut c_char,
1338}
1339#[derive(Copy, Clone)]
1340#[repr(C)]
1341pub struct _spSkeletonBinary {
1342 pub super_0: spSkeletonBinary,
1343 pub ownsLoader: c_int,
1344 pub linkedMeshCount: c_int,
1345 pub linkedMeshCapacity: c_int,
1346 pub linkedMeshes: *mut _spLinkedMeshBinary,
1347}
1348#[derive(Copy, Clone)]
1349#[repr(C)]
1350pub struct _spLinkedMeshBinary {
1351 pub parent: *const c_char,
1352 pub skinIndex: c_int,
1353 pub slotIndex: c_int,
1354 pub mesh: *mut spMeshAttachment,
1355 pub inheritTimeline: c_int,
1356}
1357#[derive(Copy, Clone)]
1358#[repr(C)]
1359pub struct _dataInput {
1360 pub cursor: *const c_uchar,
1361 pub end: *const c_uchar,
1362}
1363#[derive(Copy, Clone)]
1364#[repr(C)]
1365pub union C2RustUnnamed_0 {
1366 pub intValue: c_int,
1367 pub floatValue: c_float,
1368}
1369#[derive(Copy, Clone)]
1370#[repr(C)]
1371pub struct spSkeletonJson {
1372 pub scale: c_float,
1373 pub attachmentLoader: *mut spAttachmentLoader,
1374 pub error: *mut c_char,
1375}
1376#[derive(Copy, Clone)]
1377#[repr(C)]
1378pub struct _spSkeletonJson {
1379 pub super_0: spSkeletonJson,
1380 pub ownsLoader: c_int,
1381 pub linkedMeshCount: c_int,
1382 pub linkedMeshCapacity: c_int,
1383 pub linkedMeshes: *mut _spLinkedMeshJson,
1384}
1385#[derive(Copy, Clone)]
1386#[repr(C)]
1387pub struct _spLinkedMeshJson {
1388 pub parent: *const c_char,
1389 pub skin: *const c_char,
1390 pub slotIndex: c_int,
1391 pub mesh: *mut spMeshAttachment,
1392 pub inheritTimeline: c_int,
1393}
1394#[derive(Copy, Clone)]
1395#[repr(C)]
1396pub struct Json {
1397 pub next: *mut Json,
1398 pub child: *mut Json,
1399 pub type_0: c_int,
1400 pub size: c_int,
1401 pub valueString: *const c_char,
1402 pub valueInt: c_int,
1403 pub valueFloat: c_float,
1404 pub name: *const c_char,
1405}
1406#[derive(Copy, Clone)]
1407#[repr(C)]
1408pub struct spTriangulator {
1409 pub convexPolygons: *mut spArrayFloatArray,
1410 pub convexPolygonsIndices: *mut spArrayShortArray,
1411 pub indicesArray: *mut spShortArray,
1412 pub isConcaveArray: *mut spIntArray,
1413 pub triangles: *mut spShortArray,
1414 pub polygonPool: *mut spArrayFloatArray,
1415 pub polygonIndicesPool: *mut spArrayShortArray,
1416}
1417#[derive(Copy, Clone)]
1418#[repr(C)]
1419pub struct spSkeletonClipping {
1420 pub triangulator: *mut spTriangulator,
1421 pub clippingPolygon: *mut spFloatArray,
1422 pub clipOutput: *mut spFloatArray,
1423 pub clippedVertices: *mut spFloatArray,
1424 pub clippedUVs: *mut spFloatArray,
1425 pub clippedTriangles: *mut spUnsignedShortArray,
1426 pub scratch: *mut spFloatArray,
1427 pub clipAttachment: *mut spClippingAttachment,
1428 pub clippingPolygons: *mut spArrayFloatArray,
1429}
1430pub type C2RustUnnamed_1 = c_uint;
1431#[no_mangle]
1432pub unsafe extern "C" fn isspace_(mut x: c_int) -> c_int {
1433 (x <= 32 as c_int) as c_int
1434}
1435#[no_mangle]
1436pub unsafe extern "C" fn spPropertyIdArray_create(
1437 mut initialCapacity: c_int,
1438) -> *mut spPropertyIdArray {
1439 let mut array: *mut spPropertyIdArray = _spCalloc(
1440 1 as c_int as size_t,
1441 ::core::mem::size_of::<spPropertyIdArray>() as c_ulong,
1442 (b"spine.c\0" as *const u8).cast::<c_char>(),
1443 37 as c_int,
1444 )
1445 .cast::<spPropertyIdArray>();
1446 (*array).size = 0 as c_int;
1447 (*array).capacity = initialCapacity;
1448 (*array).items = _spCalloc(
1449 initialCapacity as size_t,
1450 ::core::mem::size_of::<spPropertyId>() as c_ulong,
1451 (b"spine.c\0" as *const u8).cast::<c_char>(),
1452 37 as c_int,
1453 )
1454 .cast::<spPropertyId>();
1455 array
1456}
1457#[no_mangle]
1458pub unsafe extern "C" fn spPropertyIdArray_dispose(mut self_0: *mut spPropertyIdArray) {
1459 _spFree((*self_0).items.cast::<c_void>());
1460 _spFree(self_0.cast::<c_void>());
1461}
1462#[no_mangle]
1463pub unsafe extern "C" fn spPropertyIdArray_clear(mut self_0: *mut spPropertyIdArray) {
1464 (*self_0).size = 0 as c_int;
1465}
1466#[no_mangle]
1467pub unsafe extern "C" fn spPropertyIdArray_setSize(
1468 mut self_0: *mut spPropertyIdArray,
1469 mut newSize: c_int,
1470) -> *mut spPropertyIdArray {
1471 (*self_0).size = newSize;
1472 if (*self_0).capacity < newSize {
1473 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
1474 8 as c_int
1475 } else {
1476 ((*self_0).size as c_float * 1.75f32) as c_int
1477 };
1478 (*self_0).items = _spRealloc(
1479 (*self_0).items.cast::<c_void>(),
1480 (::core::mem::size_of::<spPropertyId>() as c_ulong)
1481 .wrapping_mul((*self_0).capacity as c_ulong),
1482 )
1483 .cast::<spPropertyId>();
1484 }
1485 self_0
1486}
1487#[no_mangle]
1488pub unsafe extern "C" fn spPropertyIdArray_ensureCapacity(
1489 mut self_0: *mut spPropertyIdArray,
1490 mut newCapacity: c_int,
1491) {
1492 if (*self_0).capacity >= newCapacity {
1493 return;
1494 }
1495 (*self_0).capacity = newCapacity;
1496 (*self_0).items = _spRealloc(
1497 (*self_0).items.cast::<c_void>(),
1498 (::core::mem::size_of::<spPropertyId>() as c_ulong)
1499 .wrapping_mul((*self_0).capacity as c_ulong),
1500 )
1501 .cast::<spPropertyId>();
1502}
1503#[no_mangle]
1504pub unsafe extern "C" fn spPropertyIdArray_add(
1505 mut self_0: *mut spPropertyIdArray,
1506 mut value: spPropertyId,
1507) {
1508 if (*self_0).size == (*self_0).capacity {
1509 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
1510 8 as c_int
1511 } else {
1512 ((*self_0).size as c_float * 1.75f32) as c_int
1513 };
1514 (*self_0).items = _spRealloc(
1515 (*self_0).items.cast::<c_void>(),
1516 (::core::mem::size_of::<spPropertyId>() as c_ulong)
1517 .wrapping_mul((*self_0).capacity as c_ulong),
1518 )
1519 .cast::<spPropertyId>();
1520 }
1521 let fresh0 = (*self_0).size;
1522 (*self_0).size += 1;
1523 *((*self_0).items).offset(fresh0 as isize) = value;
1524}
1525#[no_mangle]
1526pub unsafe extern "C" fn spPropertyIdArray_addAll(
1527 mut self_0: *mut spPropertyIdArray,
1528 mut other: *mut spPropertyIdArray,
1529) {
1530 let mut i: c_int = 0 as c_int;
1531 while i < (*other).size {
1532 spPropertyIdArray_add(self_0, *((*other).items).offset(i as isize));
1533 i += 1;
1534 }
1535}
1536#[no_mangle]
1537pub unsafe extern "C" fn spPropertyIdArray_addAllValues(
1538 mut self_0: *mut spPropertyIdArray,
1539 mut values: *mut spPropertyId,
1540 mut offset: c_int,
1541 mut count: c_int,
1542) {
1543 let mut i: c_int = offset;
1544 let mut n: c_int = offset + count;
1545 while i < n {
1546 spPropertyIdArray_add(self_0, *values.offset(i as isize));
1547 i += 1;
1548 }
1549}
1550#[no_mangle]
1551pub unsafe extern "C" fn spPropertyIdArray_removeAt(
1552 mut self_0: *mut spPropertyIdArray,
1553 mut index: c_int,
1554) {
1555 (*self_0).size -= 1;
1556 spine_memmove(
1557 ((*self_0).items).offset(index as isize).cast::<c_void>(),
1558 ((*self_0).items)
1559 .offset(index as isize)
1560 .offset(1 as c_int as isize) as *const c_void,
1561 (::core::mem::size_of::<spPropertyId>() as c_ulong)
1562 .wrapping_mul(((*self_0).size - index) as c_ulong),
1563 );
1564}
1565#[no_mangle]
1566pub unsafe extern "C" fn spPropertyIdArray_contains(
1567 mut self_0: *mut spPropertyIdArray,
1568 mut value: spPropertyId,
1569) -> c_int {
1570 let mut items: *mut spPropertyId = (*self_0).items;
1571 let mut i: c_int = 0;
1572 let mut n: c_int = 0;
1573 i = 0 as c_int;
1574 n = (*self_0).size;
1575 while i < n {
1576 if *items.offset(i as isize) == value {
1577 return -(1 as c_int);
1578 }
1579 i += 1;
1580 }
1581 0 as c_int
1582}
1583#[no_mangle]
1584pub unsafe extern "C" fn spPropertyIdArray_pop(mut self_0: *mut spPropertyIdArray) -> spPropertyId {
1585 (*self_0).size -= 1;
1586 let mut item: spPropertyId = *((*self_0).items).offset((*self_0).size as isize);
1587 item
1588}
1589#[no_mangle]
1590pub unsafe extern "C" fn spPropertyIdArray_peek(
1591 mut self_0: *mut spPropertyIdArray,
1592) -> spPropertyId {
1593 *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize)
1594}
1595#[no_mangle]
1596pub unsafe extern "C" fn spTimelineArray_create(
1597 mut initialCapacity: c_int,
1598) -> *mut spTimelineArray {
1599 let mut array: *mut spTimelineArray = _spCalloc(
1600 1 as c_int as size_t,
1601 ::core::mem::size_of::<spTimelineArray>() as c_ulong,
1602 (b"spine.c\0" as *const u8).cast::<c_char>(),
1603 39 as c_int,
1604 )
1605 .cast::<spTimelineArray>();
1606 (*array).size = 0 as c_int;
1607 (*array).capacity = initialCapacity;
1608 (*array).items = _spCalloc(
1609 initialCapacity as size_t,
1610 ::core::mem::size_of::<*mut spTimeline>() as c_ulong,
1611 (b"spine.c\0" as *const u8).cast::<c_char>(),
1612 39 as c_int,
1613 )
1614 .cast::<*mut spTimeline>();
1615 array
1616}
1617#[no_mangle]
1618pub unsafe extern "C" fn spTimelineArray_dispose(mut self_0: *mut spTimelineArray) {
1619 _spFree((*self_0).items.cast::<c_void>());
1620 _spFree(self_0.cast::<c_void>());
1621}
1622#[no_mangle]
1623pub unsafe extern "C" fn spTimelineArray_clear(mut self_0: *mut spTimelineArray) {
1624 (*self_0).size = 0 as c_int;
1625}
1626#[no_mangle]
1627pub unsafe extern "C" fn spTimelineArray_setSize(
1628 mut self_0: *mut spTimelineArray,
1629 mut newSize: c_int,
1630) -> *mut spTimelineArray {
1631 (*self_0).size = newSize;
1632 if (*self_0).capacity < newSize {
1633 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
1634 8 as c_int
1635 } else {
1636 ((*self_0).size as c_float * 1.75f32) as c_int
1637 };
1638 (*self_0).items = _spRealloc(
1639 (*self_0).items.cast::<c_void>(),
1640 (::core::mem::size_of::<*mut spTimeline>() as c_ulong)
1641 .wrapping_mul((*self_0).capacity as c_ulong),
1642 )
1643 .cast::<*mut spTimeline>();
1644 }
1645 self_0
1646}
1647#[no_mangle]
1648pub unsafe extern "C" fn spTimelineArray_ensureCapacity(
1649 mut self_0: *mut spTimelineArray,
1650 mut newCapacity: c_int,
1651) {
1652 if (*self_0).capacity >= newCapacity {
1653 return;
1654 }
1655 (*self_0).capacity = newCapacity;
1656 (*self_0).items = _spRealloc(
1657 (*self_0).items.cast::<c_void>(),
1658 (::core::mem::size_of::<*mut spTimeline>() as c_ulong)
1659 .wrapping_mul((*self_0).capacity as c_ulong),
1660 )
1661 .cast::<*mut spTimeline>();
1662}
1663#[no_mangle]
1664pub unsafe extern "C" fn spTimelineArray_add(
1665 mut self_0: *mut spTimelineArray,
1666 mut value: *mut spTimeline,
1667) {
1668 if (*self_0).size == (*self_0).capacity {
1669 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
1670 8 as c_int
1671 } else {
1672 ((*self_0).size as c_float * 1.75f32) as c_int
1673 };
1674 (*self_0).items = _spRealloc(
1675 (*self_0).items.cast::<c_void>(),
1676 (::core::mem::size_of::<*mut spTimeline>() as c_ulong)
1677 .wrapping_mul((*self_0).capacity as c_ulong),
1678 )
1679 .cast::<*mut spTimeline>();
1680 }
1681 let fresh1 = (*self_0).size;
1682 (*self_0).size += 1;
1683 let fresh2 = &mut (*((*self_0).items).offset(fresh1 as isize));
1684 *fresh2 = value;
1685}
1686#[no_mangle]
1687pub unsafe extern "C" fn spTimelineArray_addAll(
1688 mut self_0: *mut spTimelineArray,
1689 mut other: *mut spTimelineArray,
1690) {
1691 let mut i: c_int = 0 as c_int;
1692 while i < (*other).size {
1693 spTimelineArray_add(self_0, *((*other).items).offset(i as isize));
1694 i += 1;
1695 }
1696}
1697#[no_mangle]
1698pub unsafe extern "C" fn spTimelineArray_addAllValues(
1699 mut self_0: *mut spTimelineArray,
1700 mut values: *mut *mut spTimeline,
1701 mut offset: c_int,
1702 mut count: c_int,
1703) {
1704 let mut i: c_int = offset;
1705 let mut n: c_int = offset + count;
1706 while i < n {
1707 spTimelineArray_add(self_0, *values.offset(i as isize));
1708 i += 1;
1709 }
1710}
1711#[no_mangle]
1712pub unsafe extern "C" fn spTimelineArray_removeAt(
1713 mut self_0: *mut spTimelineArray,
1714 mut index: c_int,
1715) {
1716 (*self_0).size -= 1;
1717 spine_memmove(
1718 ((*self_0).items).offset(index as isize).cast::<c_void>(),
1719 ((*self_0).items)
1720 .offset(index as isize)
1721 .offset(1 as c_int as isize) as *const c_void,
1722 (::core::mem::size_of::<*mut spTimeline>() as c_ulong)
1723 .wrapping_mul(((*self_0).size - index) as c_ulong),
1724 );
1725}
1726#[no_mangle]
1727pub unsafe extern "C" fn spTimelineArray_contains(
1728 mut self_0: *mut spTimelineArray,
1729 mut value: *mut spTimeline,
1730) -> c_int {
1731 let mut items: *mut *mut spTimeline = (*self_0).items;
1732 let mut i: c_int = 0;
1733 let mut n: c_int = 0;
1734 i = 0 as c_int;
1735 n = (*self_0).size;
1736 while i < n {
1737 if *items.offset(i as isize) == value {
1738 return -(1 as c_int);
1739 }
1740 i += 1;
1741 }
1742 0 as c_int
1743}
1744#[no_mangle]
1745pub unsafe extern "C" fn spTimelineArray_pop(mut self_0: *mut spTimelineArray) -> *mut spTimeline {
1746 (*self_0).size -= 1;
1747 let mut item: *mut spTimeline = *((*self_0).items).offset((*self_0).size as isize);
1748 item
1749}
1750#[no_mangle]
1751pub unsafe extern "C" fn spTimelineArray_peek(mut self_0: *mut spTimelineArray) -> *mut spTimeline {
1752 *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize)
1753}
1754#[no_mangle]
1755pub unsafe extern "C" fn spAnimation_create(
1756 mut name: *const c_char,
1757 mut timelines: *mut spTimelineArray,
1758 mut duration: c_float,
1759) -> *mut spAnimation {
1760 let mut i: c_int = 0;
1761 let mut n: c_int = 0;
1762 let mut totalCount: c_int = 0 as c_int;
1763 let mut self_0: *mut spAnimation = _spCalloc(
1764 1 as c_int as size_t,
1765 ::core::mem::size_of::<spAnimation>() as c_ulong,
1766 (b"spine.c\0" as *const u8).cast::<c_char>(),
1767 43 as c_int,
1768 )
1769 .cast::<spAnimation>();
1770 (*self_0).name = _spMalloc(
1771 (::core::mem::size_of::<c_char>() as c_ulong)
1772 .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)),
1773 (b"spine.c\0" as *const u8).cast::<c_char>(),
1774 44 as c_int,
1775 )
1776 .cast::<c_char>();
1777 spine_strcpy((*self_0).name, name);
1778 (*self_0).timelines = if !timelines.is_null() {
1779 timelines
1780 } else {
1781 spTimelineArray_create(1 as c_int)
1782 };
1783 timelines = (*self_0).timelines;
1784 i = 0 as c_int;
1785 n = (*timelines).size;
1786 while i < n {
1787 totalCount += (**((*timelines).items).offset(i as isize)).propertyIdsCount;
1788 i += 1;
1789 }
1790 (*self_0).timelineIds = spPropertyIdArray_create(totalCount);
1791 i = 0 as c_int;
1792 n = (*timelines).size;
1793 while i < n {
1794 spPropertyIdArray_addAllValues(
1795 (*self_0).timelineIds,
1796 ((**((*timelines).items).offset(i as isize)).propertyIds).as_mut_ptr(),
1797 0 as c_int,
1798 (**((*timelines).items).offset(i as isize)).propertyIdsCount,
1799 );
1800 i += 1;
1801 }
1802 (*self_0).duration = duration;
1803 self_0
1804}
1805#[no_mangle]
1806pub unsafe extern "C" fn spAnimation_dispose(mut self_0: *mut spAnimation) {
1807 let mut i: c_int = 0;
1808 i = 0 as c_int;
1809 while i < (*(*self_0).timelines).size {
1810 spTimeline_dispose(*((*(*self_0).timelines).items).offset(i as isize));
1811 i += 1;
1812 }
1813 spTimelineArray_dispose((*self_0).timelines);
1814 spPropertyIdArray_dispose((*self_0).timelineIds);
1815 _spFree((*self_0).name.cast::<c_void>());
1816 _spFree(self_0.cast::<c_void>());
1817}
1818#[no_mangle]
1819pub unsafe extern "C" fn spAnimation_hasTimeline(
1820 mut self_0: *mut spAnimation,
1821 mut ids: *mut spPropertyId,
1822 mut idsCount: c_int,
1823) -> c_int {
1824 let mut i: c_int = 0;
1825 let mut n: c_int = 0;
1826 let mut ii: c_int = 0;
1827 i = 0 as c_int;
1828 n = (*(*self_0).timelineIds).size;
1829 while i < n {
1830 ii = 0 as c_int;
1831 while ii < idsCount {
1832 if *((*(*self_0).timelineIds).items).offset(i as isize) == *ids.offset(ii as isize) {
1833 return 1 as c_int;
1834 }
1835 ii += 1;
1836 }
1837 i += 1;
1838 }
1839 0 as c_int
1840}
1841#[no_mangle]
1842pub unsafe extern "C" fn spAnimation_apply(
1843 mut self_0: *const spAnimation,
1844 mut skeleton: *mut spSkeleton,
1845 mut lastTime: c_float,
1846 mut time: c_float,
1847 mut loop_0: c_int,
1848 mut events: *mut *mut spEvent,
1849 mut eventsCount: *mut c_int,
1850 mut alpha: c_float,
1851 mut blend: spMixBlend,
1852 mut direction: spMixDirection,
1853) {
1854 let mut i: c_int = 0;
1855 let mut n: c_int = (*(*self_0).timelines).size;
1856 if loop_0 != 0 && (*self_0).duration != 0. {
1857 time = spine_fmodf(time, (*self_0).duration);
1858 if lastTime > 0 as c_int as c_float {
1859 lastTime = spine_fmodf(lastTime, (*self_0).duration);
1860 }
1861 }
1862 i = 0 as c_int;
1863 while i < n {
1864 spTimeline_apply(
1865 *((*(*self_0).timelines).items).offset(i as isize),
1866 skeleton,
1867 lastTime,
1868 time,
1869 events,
1870 eventsCount,
1871 alpha,
1872 blend,
1873 direction,
1874 );
1875 i += 1;
1876 }
1877}
1878unsafe extern "C" fn search(mut values: *mut spFloatArray, mut time: c_float) -> c_int {
1879 let mut i: c_int = 0;
1880 let mut n: c_int = 0;
1881 let mut items: *mut c_float = (*values).items;
1882 i = 1 as c_int;
1883 n = (*values).size;
1884 while i < n {
1885 if *items.offset(i as isize) > time {
1886 return i - 1 as c_int;
1887 }
1888 i += 1;
1889 }
1890 (*values).size - 1 as c_int
1891}
1892unsafe extern "C" fn search2(
1893 mut values: *mut spFloatArray,
1894 mut time: c_float,
1895 mut step: c_int,
1896) -> c_int {
1897 let mut i: c_int = 0;
1898 let mut n: c_int = 0;
1899 let mut items: *mut c_float = (*values).items;
1900 i = step;
1901 n = (*values).size;
1902 while i < n {
1903 if *items.offset(i as isize) > time {
1904 return i - step;
1905 }
1906 i += step;
1907 }
1908 (*values).size - step
1909}
1910#[no_mangle]
1911pub unsafe extern "C" fn _spTimeline_init(
1912 mut self_0: *mut spTimeline,
1913 mut frameCount: c_int,
1914 mut frameEntries: c_int,
1915 mut propertyIds: *mut spPropertyId,
1916 mut propertyIdsCount: c_int,
1917 mut type_0: spTimelineType,
1918 mut dispose: Option<unsafe extern "C" fn(*mut spTimeline) -> ()>,
1919 mut apply: Option<
1920 unsafe extern "C" fn(
1921 *mut spTimeline,
1922 *mut spSkeleton,
1923 c_float,
1924 c_float,
1925 *mut *mut spEvent,
1926 *mut c_int,
1927 c_float,
1928 spMixBlend,
1929 spMixDirection,
1930 ) -> (),
1931 >,
1932 mut setBezier: Option<
1933 unsafe extern "C" fn(
1934 *mut spTimeline,
1935 c_int,
1936 c_int,
1937 c_float,
1938 c_float,
1939 c_float,
1940 c_float,
1941 c_float,
1942 c_float,
1943 c_float,
1944 c_float,
1945 c_float,
1946 ) -> (),
1947 >,
1948) {
1949 let mut i: c_int = 0;
1950 (*self_0).frames = spFloatArray_create(frameCount * frameEntries);
1951 (*(*self_0).frames).size = frameCount * frameEntries;
1952 (*self_0).frameCount = frameCount;
1953 (*self_0).frameEntries = frameEntries;
1954 i = 0 as c_int;
1955 while i < propertyIdsCount {
1956 (*self_0).propertyIds[i as usize] = *propertyIds.offset(i as isize);
1957 i += 1;
1958 }
1959 (*self_0).propertyIdsCount = propertyIdsCount;
1960 (*self_0).type_0 = type_0;
1961 (*self_0).vtable.dispose = dispose;
1962 (*self_0).vtable.apply = apply;
1963 (*self_0).vtable.setBezier = setBezier;
1964}
1965#[no_mangle]
1966pub unsafe extern "C" fn spTimeline_dispose(mut self_0: *mut spTimeline) {
1967 ((*self_0).vtable.dispose).expect("non-null function pointer")(self_0);
1968 spFloatArray_dispose((*self_0).frames);
1969 _spFree(self_0.cast::<c_void>());
1970}
1971#[no_mangle]
1972pub unsafe extern "C" fn spTimeline_apply(
1973 mut self_0: *mut spTimeline,
1974 mut skeleton: *mut spSkeleton,
1975 mut lastTime: c_float,
1976 mut time: c_float,
1977 mut firedEvents: *mut *mut spEvent,
1978 mut eventsCount: *mut c_int,
1979 mut alpha: c_float,
1980 mut blend: spMixBlend,
1981 mut direction: spMixDirection,
1982) {
1983 ((*self_0).vtable.apply).expect("non-null function pointer")(
1984 self_0,
1985 skeleton,
1986 lastTime,
1987 time,
1988 firedEvents,
1989 eventsCount,
1990 alpha,
1991 blend,
1992 direction,
1993 );
1994}
1995#[no_mangle]
1996pub unsafe extern "C" fn spTimeline_setBezier(
1997 mut self_0: *mut spTimeline,
1998 mut bezier: c_int,
1999 mut frame: c_int,
2000 mut value: c_float,
2001 mut time1: c_float,
2002 mut value1: c_float,
2003 mut cx1: c_float,
2004 mut cy1: c_float,
2005 mut cx2: c_float,
2006 mut cy2: c_float,
2007 mut time2: c_float,
2008 mut value2: c_float,
2009) {
2010 if ((*self_0).vtable.setBezier).is_some() {
2011 ((*self_0).vtable.setBezier).expect("non-null function pointer")(
2012 self_0, bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2,
2013 );
2014 }
2015}
2016#[no_mangle]
2017pub unsafe extern "C" fn spTimeline_getDuration(mut self_0: *const spTimeline) -> c_float {
2018 *((*(*self_0).frames).items)
2019 .offset(((*(*self_0).frames).size - (*self_0).frameEntries) as isize)
2020}
2021#[no_mangle]
2022pub unsafe extern "C" fn _spCurveTimeline_init(
2023 mut self_0: *mut spCurveTimeline,
2024 mut frameCount: c_int,
2025 mut frameEntries: c_int,
2026 mut bezierCount: c_int,
2027 mut propertyIds: *mut spPropertyId,
2028 mut propertyIdsCount: c_int,
2029 mut type_0: spTimelineType,
2030 mut dispose: Option<unsafe extern "C" fn(*mut spTimeline) -> ()>,
2031 mut apply: Option<
2032 unsafe extern "C" fn(
2033 *mut spTimeline,
2034 *mut spSkeleton,
2035 c_float,
2036 c_float,
2037 *mut *mut spEvent,
2038 *mut c_int,
2039 c_float,
2040 spMixBlend,
2041 spMixDirection,
2042 ) -> (),
2043 >,
2044 mut setBezier: Option<
2045 unsafe extern "C" fn(
2046 *mut spTimeline,
2047 c_int,
2048 c_int,
2049 c_float,
2050 c_float,
2051 c_float,
2052 c_float,
2053 c_float,
2054 c_float,
2055 c_float,
2056 c_float,
2057 c_float,
2058 ) -> (),
2059 >,
2060) {
2061 _spTimeline_init(
2062 &mut (*self_0).super_0,
2063 frameCount,
2064 frameEntries,
2065 propertyIds,
2066 propertyIdsCount,
2067 type_0,
2068 dispose,
2069 apply,
2070 setBezier,
2071 );
2072 (*self_0).curves = spFloatArray_create(frameCount + bezierCount * 18 as c_int);
2073 (*(*self_0).curves).size = frameCount + bezierCount * 18 as c_int;
2074 *((*(*self_0).curves).items).offset((frameCount - 1 as c_int) as isize) = 1 as c_int as c_float;
2075}
2076#[no_mangle]
2077pub unsafe extern "C" fn _spCurveTimeline_dispose(mut self_0: *mut spTimeline) {
2078 spFloatArray_dispose((*self_0.cast::<spCurveTimeline>()).curves);
2079}
2080#[no_mangle]
2081pub unsafe extern "C" fn _spCurveTimeline_setBezier(
2082 mut timeline: *mut spTimeline,
2083 mut bezier: c_int,
2084 mut frame: c_int,
2085 mut value: c_float,
2086 mut time1: c_float,
2087 mut value1: c_float,
2088 mut cx1: c_float,
2089 mut cy1: c_float,
2090 mut cx2: c_float,
2091 mut cy2: c_float,
2092 mut time2: c_float,
2093 mut value2: c_float,
2094) {
2095 let mut self_0: *mut spCurveTimeline = timeline.cast::<spCurveTimeline>();
2096 let mut tmpx: c_float = 0.;
2097 let mut tmpy: c_float = 0.;
2098 let mut dddx: c_float = 0.;
2099 let mut dddy: c_float = 0.;
2100 let mut ddx: c_float = 0.;
2101 let mut ddy: c_float = 0.;
2102 let mut dx: c_float = 0.;
2103 let mut dy: c_float = 0.;
2104 let mut x: c_float = 0.;
2105 let mut y: c_float = 0.;
2106 let mut i: c_int = (*self_0).super_0.frameCount + bezier * 18 as c_int;
2107 let mut n: c_int = 0;
2108 let mut curves: *mut c_float = (*(*self_0).curves).items;
2109 if value == 0 as c_int as c_float {
2110 *curves.offset(frame as isize) = (2 as c_int + i) as c_float;
2111 }
2112 tmpx = ((time1 - cx1 * 2 as c_int as c_float + cx2) as c_double * 0.03f64) as c_float;
2113 tmpy = ((value1 - cy1 * 2 as c_int as c_float + cy2) as c_double * 0.03f64) as c_float;
2114 dddx =
2115 (((cx1 - cx2) * 3 as c_int as c_float - time1 + time2) as c_double * 0.006f64) as c_float;
2116 dddy =
2117 (((cy1 - cy2) * 3 as c_int as c_float - value1 + value2) as c_double * 0.006f64) as c_float;
2118 ddx = tmpx * 2 as c_int as c_float + dddx;
2119 ddy = tmpy * 2 as c_int as c_float + dddy;
2120 dx = ((cx1 - time1) as c_double * 0.3f64 + tmpx as c_double + dddx as c_double * 0.16666667f64)
2121 as c_float;
2122 dy = ((cy1 - value1) as c_double * 0.3f64 + tmpy as c_double + dddy as c_double * 0.16666667f64)
2123 as c_float;
2124 x = time1 + dx;
2125 y = value1 + dy;
2126 n = i + 18 as c_int;
2127 while i < n {
2128 *curves.offset(i as isize) = x;
2129 *curves.offset((i + 1 as c_int) as isize) = y;
2130 dx += ddx;
2131 dy += ddy;
2132 ddx += dddx;
2133 ddy += dddy;
2134 x += dx;
2135 y += dy;
2136 i += 2 as c_int;
2137 }
2138}
2139#[no_mangle]
2140pub unsafe extern "C" fn _spCurveTimeline_getBezierValue(
2141 mut self_0: *mut spCurveTimeline,
2142 mut time: c_float,
2143 mut frameIndex: c_int,
2144 mut valueOffset: c_int,
2145 mut i: c_int,
2146) -> c_float {
2147 let mut curves: *mut c_float = (*(*self_0).curves).items;
2148 let mut frames: *mut c_float = (*(*self_0).super_0.frames).items;
2149 let mut x: c_float = 0.;
2150 let mut y: c_float = 0.;
2151 let mut n: c_int = 0;
2152 if *curves.offset(i as isize) > time {
2153 x = *frames.offset(frameIndex as isize);
2154 y = *frames.offset((frameIndex + valueOffset) as isize);
2155 return y
2156 + (time - x) / (*curves.offset(i as isize) - x)
2157 * (*curves.offset((i + 1 as c_int) as isize) - y);
2158 }
2159 n = i + 18 as c_int;
2160 i += 2 as c_int;
2161 while i < n {
2162 if *curves.offset(i as isize) >= time {
2163 x = *curves.offset((i - 2 as c_int) as isize);
2164 y = *curves.offset((i - 1 as c_int) as isize);
2165 return y
2166 + (time - x) / (*curves.offset(i as isize) - x)
2167 * (*curves.offset((i + 1 as c_int) as isize) - y);
2168 }
2169 i += 2 as c_int;
2170 }
2171 frameIndex += (*self_0).super_0.frameEntries;
2172 x = *curves.offset((n - 2 as c_int) as isize);
2173 y = *curves.offset((n - 1 as c_int) as isize);
2174 y + (time - x) / (*frames.offset(frameIndex as isize) - x)
2175 * (*frames.offset((frameIndex + valueOffset) as isize) - y)
2176}
2177#[no_mangle]
2178pub unsafe extern "C" fn spCurveTimeline_setLinear(
2179 mut self_0: *mut spCurveTimeline,
2180 mut frame: c_int,
2181) {
2182 *((*(*self_0).curves).items).offset(frame as isize) = 0 as c_int as c_float;
2183}
2184#[no_mangle]
2185pub unsafe extern "C" fn spCurveTimeline_setStepped(
2186 mut self_0: *mut spCurveTimeline,
2187 mut frame: c_int,
2188) {
2189 *((*(*self_0).curves).items).offset(frame as isize) = 1 as c_int as c_float;
2190}
2191#[no_mangle]
2192pub unsafe extern "C" fn spCurveTimeline1_setFrame(
2193 mut self_0: *mut spCurveTimeline1,
2194 mut frame: c_int,
2195 mut time: c_float,
2196 mut value: c_float,
2197) {
2198 let mut frames: *mut c_float = (*(*self_0).super_0.frames).items;
2199 frame <<= 1 as c_int;
2200 *frames.offset(frame as isize) = time;
2201 *frames.offset((frame + 1 as c_int) as isize) = value;
2202}
2203#[no_mangle]
2204pub unsafe extern "C" fn spCurveTimeline1_getCurveValue(
2205 mut self_0: *mut spCurveTimeline1,
2206 mut time: c_float,
2207) -> c_float {
2208 let mut frames: *mut c_float = (*(*self_0).super_0.frames).items;
2209 let mut curves: *mut c_float = (*(*self_0).curves).items;
2210 let mut i: c_int = (*(*self_0).super_0.frames).size - 2 as c_int;
2211 let mut ii: c_int = 0;
2212 let mut curveType: c_int = 0;
2213 ii = 2 as c_int;
2214 while ii <= i {
2215 if *frames.offset(ii as isize) > time {
2216 i = ii - 2 as c_int;
2217 break;
2218 } else {
2219 ii += 2 as c_int;
2220 }
2221 }
2222 curveType = *curves.offset((i >> 1 as c_int) as isize) as c_int;
2223 match curveType {
2224 0 => {
2225 let mut before: c_float = *frames.offset(i as isize);
2226 let mut value: c_float = *frames.offset((i + 1 as c_int) as isize);
2227 return value
2228 + (time - before) / (*frames.offset((i + 2 as c_int) as isize) - before)
2229 * (*frames.offset((i + 2 as c_int + 1 as c_int) as isize) - value);
2230 }
2231 1 => return *frames.offset((i + 1 as c_int) as isize),
2232 _ => {}
2233 }
2234 _spCurveTimeline_getBezierValue(self_0, time, i, 1 as c_int, curveType - 2 as c_int)
2235}
2236#[no_mangle]
2237pub unsafe extern "C" fn spCurveTimeline1_getRelativeValue(
2238 mut self_0: *mut spCurveTimeline1,
2239 mut time: c_float,
2240 mut alpha: c_float,
2241 mut blend: spMixBlend,
2242 mut current: c_float,
2243 mut setup: c_float,
2244) -> c_float {
2245 let mut frames: *mut c_float = (*(*self_0).super_0.frames).items;
2246 if time < *frames.offset(0 as c_int as isize) {
2247 match blend as c_uint {
2248 0 => return setup,
2249 1 => return current + (setup - current) * alpha,
2250 _ => return current,
2251 }
2252 }
2253 let mut value: c_float = spCurveTimeline1_getCurveValue(self_0, time);
2254 match blend as c_uint {
2255 0 => return setup + value * alpha,
2256 1 | 2 => {
2257 value += setup - current;
2258 }
2259 3 | _ => {}
2260 }
2261 current + value * alpha
2262}
2263#[no_mangle]
2264pub unsafe extern "C" fn spCurveTimeline1_getAbsoluteValue(
2265 mut self_0: *mut spCurveTimeline1,
2266 mut time: c_float,
2267 mut alpha: c_float,
2268 mut blend: spMixBlend,
2269 mut current: c_float,
2270 mut setup: c_float,
2271) -> c_float {
2272 let mut frames: *mut c_float = (*(*self_0).super_0.frames).items;
2273 if time < *frames.offset(0 as c_int as isize) {
2274 match blend as c_uint {
2275 0 => return setup,
2276 1 => return current + (setup - current) * alpha,
2277 _ => return current,
2278 }
2279 }
2280 let mut value: c_float = spCurveTimeline1_getCurveValue(self_0, time);
2281 if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint {
2282 return setup + (value - setup) * alpha;
2283 }
2284 current + (value - current) * alpha
2285}
2286#[no_mangle]
2287pub unsafe extern "C" fn spCurveTimeline1_getAbsoluteValue2(
2288 mut self_0: *mut spCurveTimeline1,
2289 mut time: c_float,
2290 mut alpha: c_float,
2291 mut blend: spMixBlend,
2292 mut current: c_float,
2293 mut setup: c_float,
2294 mut value: c_float,
2295) -> c_float {
2296 let mut frames: *mut c_float = (*(*self_0).super_0.frames).items;
2297 if time < *frames.offset(0 as c_int as isize) {
2298 match blend as c_uint {
2299 0 => return setup,
2300 1 => return current + (setup - current) * alpha,
2301 _ => return current,
2302 }
2303 }
2304 if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint {
2305 return setup + (value - setup) * alpha;
2306 }
2307 current + (value - current) * alpha
2308}
2309#[no_mangle]
2310pub unsafe extern "C" fn spCurveTimeline1_getScaleValue(
2311 mut self_0: *mut spCurveTimeline1,
2312 mut time: c_float,
2313 mut alpha: c_float,
2314 mut blend: spMixBlend,
2315 mut direction: spMixDirection,
2316 mut current: c_float,
2317 mut setup: c_float,
2318) -> c_float {
2319 let mut frames: *mut c_float = (*(*self_0).super_0.frames).items;
2320 if time < *frames.offset(0 as c_int as isize) {
2321 match blend as c_uint {
2322 0 => return setup,
2323 1 => return current + (setup - current) * alpha,
2324 _ => return current,
2325 }
2326 }
2327 let mut value: c_float = spCurveTimeline1_getCurveValue(self_0, time) * setup;
2328 if alpha == 1 as c_int as c_float {
2329 if blend as c_uint == SP_MIX_BLEND_ADD as c_int as c_uint {
2330 return current + value - setup;
2331 }
2332 return value;
2333 }
2334 if direction as c_uint == SP_MIX_DIRECTION_OUT as c_int as c_uint {
2335 match blend as c_uint {
2336 0 => {
2337 return setup
2338 + ((if value < 0 as c_int as c_float {
2339 -value
2340 } else {
2341 value
2342 }) * (if setup < 0 as c_int as c_float {
2343 -1.0f32
2344 } else if setup > 0 as c_int as c_float {
2345 1.0f32
2346 } else {
2347 0.0f32
2348 }) - setup)
2349 * alpha;
2350 }
2351 1 | 2 => {
2352 return current
2353 + ((if value < 0 as c_int as c_float {
2354 -value
2355 } else {
2356 value
2357 }) * (if current < 0 as c_int as c_float {
2358 -1.0f32
2359 } else if current > 0 as c_int as c_float {
2360 1.0f32
2361 } else {
2362 0.0f32
2363 }) - current)
2364 * alpha;
2365 }
2366 _ => {}
2367 }
2368 } else {
2369 let mut s: c_float = 0.;
2370 match blend as c_uint {
2371 0 => {
2372 s = (if setup < 0 as c_int as c_float {
2373 -setup
2374 } else {
2375 setup
2376 }) * (if value < 0 as c_int as c_float {
2377 -1.0f32
2378 } else if value > 0 as c_int as c_float {
2379 1.0f32
2380 } else {
2381 0.0f32
2382 });
2383 return s + (value - s) * alpha;
2384 }
2385 1 | 2 => {
2386 s = (if current < 0 as c_int as c_float {
2387 -current
2388 } else {
2389 current
2390 }) * (if value < 0 as c_int as c_float {
2391 -1.0f32
2392 } else if value > 0 as c_int as c_float {
2393 1.0f32
2394 } else {
2395 0.0f32
2396 });
2397 return s + (value - s) * alpha;
2398 }
2399 _ => {}
2400 }
2401 }
2402 current + (value - setup) * alpha
2403}
2404#[no_mangle]
2405pub unsafe extern "C" fn spCurveTimeline2_setFrame(
2406 mut self_0: *mut spCurveTimeline1,
2407 mut frame: c_int,
2408 mut time: c_float,
2409 mut value1: c_float,
2410 mut value2: c_float,
2411) {
2412 let mut frames: *mut c_float = (*(*self_0).super_0.frames).items;
2413 frame *= 3 as c_int;
2414 *frames.offset(frame as isize) = time;
2415 *frames.offset((frame + 1 as c_int) as isize) = value1;
2416 *frames.offset((frame + 2 as c_int) as isize) = value2;
2417}
2418#[no_mangle]
2419pub unsafe extern "C" fn _spRotateTimeline_apply(
2420 mut timeline: *mut spTimeline,
2421 mut skeleton: *mut spSkeleton,
2422 mut _lastTime: c_float,
2423 mut time: c_float,
2424 mut _firedEvents: *mut *mut spEvent,
2425 mut _eventsCount: *mut c_int,
2426 mut alpha: c_float,
2427 mut blend: spMixBlend,
2428 mut _direction: spMixDirection,
2429) {
2430 let mut self_0: *mut spRotateTimeline = timeline.cast::<spRotateTimeline>();
2431 let mut bone: *mut spBone = *((*skeleton).bones).offset((*self_0).boneIndex as isize);
2432 if (*bone).active != 0 {
2433 (*bone).rotation = spCurveTimeline1_getRelativeValue(
2434 &mut (*self_0).super_0,
2435 time,
2436 alpha,
2437 blend,
2438 (*bone).rotation,
2439 (*(*bone).data).rotation,
2440 );
2441 }
2442}
2443#[no_mangle]
2444pub unsafe extern "C" fn spRotateTimeline_create(
2445 mut frameCount: c_int,
2446 mut bezierCount: c_int,
2447 mut boneIndex: c_int,
2448) -> *mut spRotateTimeline {
2449 let mut timeline: *mut spRotateTimeline = _spCalloc(
2450 1 as c_int as size_t,
2451 ::core::mem::size_of::<spRotateTimeline>() as c_ulong,
2452 (b"spine.c\0" as *const u8).cast::<c_char>(),
2453 434 as c_int,
2454 )
2455 .cast::<spRotateTimeline>();
2456 let mut ids: [spPropertyId; 1] = [0; 1];
2457 ids[0 as c_int as usize] =
2458 (SP_PROPERTY_ROTATE as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong;
2459 _spCurveTimeline_init(
2460 &mut (*timeline).super_0,
2461 frameCount,
2462 2 as c_int,
2463 bezierCount,
2464 ids.as_mut_ptr(),
2465 1 as c_int,
2466 SP_TIMELINE_ROTATE,
2467 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
2468 Some(
2469 _spRotateTimeline_apply
2470 as unsafe extern "C" fn(
2471 *mut spTimeline,
2472 *mut spSkeleton,
2473 c_float,
2474 c_float,
2475 *mut *mut spEvent,
2476 *mut c_int,
2477 c_float,
2478 spMixBlend,
2479 spMixDirection,
2480 ) -> (),
2481 ),
2482 Some(
2483 _spCurveTimeline_setBezier
2484 as unsafe extern "C" fn(
2485 *mut spTimeline,
2486 c_int,
2487 c_int,
2488 c_float,
2489 c_float,
2490 c_float,
2491 c_float,
2492 c_float,
2493 c_float,
2494 c_float,
2495 c_float,
2496 c_float,
2497 ) -> (),
2498 ),
2499 );
2500 (*timeline).boneIndex = boneIndex;
2501 timeline
2502}
2503#[no_mangle]
2504pub unsafe extern "C" fn spRotateTimeline_setFrame(
2505 mut self_0: *mut spRotateTimeline,
2506 mut frame: c_int,
2507 mut time: c_float,
2508 mut degrees: c_float,
2509) {
2510 spCurveTimeline1_setFrame(&mut (*self_0).super_0, frame, time, degrees);
2511}
2512#[no_mangle]
2513pub unsafe extern "C" fn _spTranslateTimeline_apply(
2514 mut timeline: *mut spTimeline,
2515 mut skeleton: *mut spSkeleton,
2516 mut _lastTime: c_float,
2517 mut time: c_float,
2518 mut _firedEvents: *mut *mut spEvent,
2519 mut _eventsCount: *mut c_int,
2520 mut alpha: c_float,
2521 mut blend: spMixBlend,
2522 mut _direction: spMixDirection,
2523) {
2524 let mut bone: *mut spBone = std::ptr::null_mut::<spBone>();
2525 let mut x: c_float = 0.;
2526 let mut y: c_float = 0.;
2527 let mut t: c_float = 0.;
2528 let mut i: c_int = 0;
2529 let mut curveType: c_int = 0;
2530 let mut self_0: *mut spTranslateTimeline = timeline.cast::<spTranslateTimeline>();
2531 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
2532 let mut curves: *mut c_float = (*(*self_0).super_0.curves).items;
2533 bone = *((*skeleton).bones).offset((*self_0).boneIndex as isize);
2534 if (*bone).active == 0 {
2535 return;
2536 }
2537 if time < *frames.offset(0 as c_int as isize) {
2538 match blend as c_uint {
2539 0 => {
2540 (*bone).x = (*(*bone).data).x;
2541 (*bone).y = (*(*bone).data).y;
2542 return;
2543 }
2544 1 => {
2545 (*bone).x += ((*(*bone).data).x - (*bone).x) * alpha;
2546 (*bone).y += ((*(*bone).data).y - (*bone).y) * alpha;
2547 }
2548 _ => {}
2549 }
2550 return;
2551 }
2552 i = search2((*self_0).super_0.super_0.frames, time, 3 as c_int);
2553 curveType = *curves.offset((i / 3 as c_int) as isize) as c_int;
2554 match curveType {
2555 0 => {
2556 let mut before: c_float = *frames.offset(i as isize);
2557 x = *frames.offset((i + 1 as c_int) as isize);
2558 y = *frames.offset((i + 2 as c_int) as isize);
2559 t = (time - before) / (*frames.offset((i + 3 as c_int) as isize) - before);
2560 x += (*frames.offset((i + 3 as c_int + 1 as c_int) as isize) - x) * t;
2561 y += (*frames.offset((i + 3 as c_int + 2 as c_int) as isize) - y) * t;
2562 }
2563 1 => {
2564 x = *frames.offset((i + 1 as c_int) as isize);
2565 y = *frames.offset((i + 2 as c_int) as isize);
2566 }
2567 _ => {
2568 x = _spCurveTimeline_getBezierValue(
2569 &mut (*self_0).super_0,
2570 time,
2571 i,
2572 1 as c_int,
2573 curveType - 2 as c_int,
2574 );
2575 y = _spCurveTimeline_getBezierValue(
2576 &mut (*self_0).super_0,
2577 time,
2578 i,
2579 2 as c_int,
2580 curveType + 18 as c_int - 2 as c_int,
2581 );
2582 }
2583 }
2584 match blend as c_uint {
2585 0 => {
2586 (*bone).x = (*(*bone).data).x + x * alpha;
2587 (*bone).y = (*(*bone).data).y + y * alpha;
2588 }
2589 1 | 2 => {
2590 (*bone).x += ((*(*bone).data).x + x - (*bone).x) * alpha;
2591 (*bone).y += ((*(*bone).data).y + y - (*bone).y) * alpha;
2592 }
2593 3 => {
2594 (*bone).x += x * alpha;
2595 (*bone).y += y * alpha;
2596 }
2597 _ => {}
2598 };
2599}
2600#[no_mangle]
2601pub unsafe extern "C" fn spTranslateTimeline_create(
2602 mut frameCount: c_int,
2603 mut bezierCount: c_int,
2604 mut boneIndex: c_int,
2605) -> *mut spTranslateTimeline {
2606 let mut timeline: *mut spTranslateTimeline = _spCalloc(
2607 1 as c_int as size_t,
2608 ::core::mem::size_of::<spTranslateTimeline>() as c_ulong,
2609 (b"spine.c\0" as *const u8).cast::<c_char>(),
2610 524 as c_int,
2611 )
2612 .cast::<spTranslateTimeline>();
2613 let mut ids: [spPropertyId; 2] = [0; 2];
2614 ids[0 as c_int as usize] =
2615 (SP_PROPERTY_X as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong;
2616 ids[1 as c_int as usize] =
2617 (SP_PROPERTY_Y as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong;
2618 _spCurveTimeline_init(
2619 &mut (*timeline).super_0,
2620 frameCount,
2621 3 as c_int,
2622 bezierCount,
2623 ids.as_mut_ptr(),
2624 2 as c_int,
2625 SP_TIMELINE_TRANSLATE,
2626 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
2627 Some(
2628 _spTranslateTimeline_apply
2629 as unsafe extern "C" fn(
2630 *mut spTimeline,
2631 *mut spSkeleton,
2632 c_float,
2633 c_float,
2634 *mut *mut spEvent,
2635 *mut c_int,
2636 c_float,
2637 spMixBlend,
2638 spMixDirection,
2639 ) -> (),
2640 ),
2641 Some(
2642 _spCurveTimeline_setBezier
2643 as unsafe extern "C" fn(
2644 *mut spTimeline,
2645 c_int,
2646 c_int,
2647 c_float,
2648 c_float,
2649 c_float,
2650 c_float,
2651 c_float,
2652 c_float,
2653 c_float,
2654 c_float,
2655 c_float,
2656 ) -> (),
2657 ),
2658 );
2659 (*timeline).boneIndex = boneIndex;
2660 timeline
2661}
2662#[no_mangle]
2663pub unsafe extern "C" fn spTranslateTimeline_setFrame(
2664 mut self_0: *mut spTranslateTimeline,
2665 mut frame: c_int,
2666 mut time: c_float,
2667 mut x: c_float,
2668 mut y: c_float,
2669) {
2670 spCurveTimeline2_setFrame(&mut (*self_0).super_0, frame, time, x, y);
2671}
2672#[no_mangle]
2673pub unsafe extern "C" fn _spTranslateXTimeline_apply(
2674 mut timeline: *mut spTimeline,
2675 mut skeleton: *mut spSkeleton,
2676 mut _lastTime: c_float,
2677 mut time: c_float,
2678 mut _firedEvents: *mut *mut spEvent,
2679 mut _eventsCount: *mut c_int,
2680 mut alpha: c_float,
2681 mut blend: spMixBlend,
2682 mut _direction: spMixDirection,
2683) {
2684 let mut bone: *mut spBone = std::ptr::null_mut::<spBone>();
2685 let mut x: c_float = 0.;
2686 let mut self_0: *mut spTranslateXTimeline = timeline.cast::<spTranslateXTimeline>();
2687 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
2688 bone = *((*skeleton).bones).offset((*self_0).boneIndex as isize);
2689 if (*bone).active == 0 {
2690 return;
2691 }
2692 if time < *frames.offset(0 as c_int as isize) {
2693 match blend as c_uint {
2694 0 => {
2695 (*bone).x = (*(*bone).data).x;
2696 return;
2697 }
2698 1 => {
2699 (*bone).x += ((*(*bone).data).x - (*bone).x) * alpha;
2700 }
2701 _ => {}
2702 }
2703 return;
2704 }
2705 x = spCurveTimeline1_getCurveValue(&mut (*self_0).super_0, time);
2706 match blend as c_uint {
2707 0 => {
2708 (*bone).x = (*(*bone).data).x + x * alpha;
2709 }
2710 1 | 2 => {
2711 (*bone).x += ((*(*bone).data).x + x - (*bone).x) * alpha;
2712 }
2713 3 => {
2714 (*bone).x += x * alpha;
2715 }
2716 _ => {}
2717 };
2718}
2719#[no_mangle]
2720pub unsafe extern "C" fn spTranslateXTimeline_create(
2721 mut frameCount: c_int,
2722 mut bezierCount: c_int,
2723 mut boneIndex: c_int,
2724) -> *mut spTranslateXTimeline {
2725 let mut timeline: *mut spTranslateXTimeline = _spCalloc(
2726 1 as c_int as size_t,
2727 ::core::mem::size_of::<spTranslateXTimeline>() as c_ulong,
2728 (b"spine.c\0" as *const u8).cast::<c_char>(),
2729 585 as c_int,
2730 )
2731 .cast::<spTranslateXTimeline>();
2732 let mut ids: [spPropertyId; 1] = [0; 1];
2733 ids[0 as c_int as usize] =
2734 (SP_PROPERTY_X as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong;
2735 _spCurveTimeline_init(
2736 &mut (*timeline).super_0,
2737 frameCount,
2738 2 as c_int,
2739 bezierCount,
2740 ids.as_mut_ptr(),
2741 1 as c_int,
2742 SP_TIMELINE_TRANSLATEX,
2743 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
2744 Some(
2745 _spTranslateXTimeline_apply
2746 as unsafe extern "C" fn(
2747 *mut spTimeline,
2748 *mut spSkeleton,
2749 c_float,
2750 c_float,
2751 *mut *mut spEvent,
2752 *mut c_int,
2753 c_float,
2754 spMixBlend,
2755 spMixDirection,
2756 ) -> (),
2757 ),
2758 Some(
2759 _spCurveTimeline_setBezier
2760 as unsafe extern "C" fn(
2761 *mut spTimeline,
2762 c_int,
2763 c_int,
2764 c_float,
2765 c_float,
2766 c_float,
2767 c_float,
2768 c_float,
2769 c_float,
2770 c_float,
2771 c_float,
2772 c_float,
2773 ) -> (),
2774 ),
2775 );
2776 (*timeline).boneIndex = boneIndex;
2777 timeline
2778}
2779#[no_mangle]
2780pub unsafe extern "C" fn spTranslateXTimeline_setFrame(
2781 mut self_0: *mut spTranslateXTimeline,
2782 mut frame: c_int,
2783 mut time: c_float,
2784 mut x: c_float,
2785) {
2786 spCurveTimeline1_setFrame(&mut (*self_0).super_0, frame, time, x);
2787}
2788#[no_mangle]
2789pub unsafe extern "C" fn _spTranslateYTimeline_apply(
2790 mut timeline: *mut spTimeline,
2791 mut skeleton: *mut spSkeleton,
2792 mut _lastTime: c_float,
2793 mut time: c_float,
2794 mut _firedEvents: *mut *mut spEvent,
2795 mut _eventsCount: *mut c_int,
2796 mut alpha: c_float,
2797 mut blend: spMixBlend,
2798 mut _direction: spMixDirection,
2799) {
2800 let mut bone: *mut spBone = std::ptr::null_mut::<spBone>();
2801 let mut y: c_float = 0.;
2802 let mut self_0: *mut spTranslateYTimeline = timeline.cast::<spTranslateYTimeline>();
2803 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
2804 bone = *((*skeleton).bones).offset((*self_0).boneIndex as isize);
2805 if (*bone).active == 0 {
2806 return;
2807 }
2808 if time < *frames.offset(0 as c_int as isize) {
2809 match blend as c_uint {
2810 0 => {
2811 (*bone).y = (*(*bone).data).y;
2812 return;
2813 }
2814 1 => {
2815 (*bone).y += ((*(*bone).data).y - (*bone).y) * alpha;
2816 }
2817 _ => {}
2818 }
2819 return;
2820 }
2821 y = spCurveTimeline1_getCurveValue(&mut (*self_0).super_0, time);
2822 match blend as c_uint {
2823 0 => {
2824 (*bone).y = (*(*bone).data).y + y * alpha;
2825 }
2826 1 | 2 => {
2827 (*bone).y += ((*(*bone).data).y + y - (*bone).y) * alpha;
2828 }
2829 3 => {
2830 (*bone).y += y * alpha;
2831 }
2832 _ => {}
2833 };
2834}
2835#[no_mangle]
2836pub unsafe extern "C" fn spTranslateYTimeline_create(
2837 mut frameCount: c_int,
2838 mut bezierCount: c_int,
2839 mut boneIndex: c_int,
2840) -> *mut spTranslateYTimeline {
2841 let mut timeline: *mut spTranslateYTimeline = _spCalloc(
2842 1 as c_int as size_t,
2843 ::core::mem::size_of::<spTranslateYTimeline>() as c_ulong,
2844 (b"spine.c\0" as *const u8).cast::<c_char>(),
2845 645 as c_int,
2846 )
2847 .cast::<spTranslateYTimeline>();
2848 let mut ids: [spPropertyId; 1] = [0; 1];
2849 ids[0 as c_int as usize] =
2850 (SP_PROPERTY_Y as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong;
2851 _spCurveTimeline_init(
2852 &mut (*timeline).super_0,
2853 frameCount,
2854 2 as c_int,
2855 bezierCount,
2856 ids.as_mut_ptr(),
2857 1 as c_int,
2858 SP_TIMELINE_TRANSLATEY,
2859 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
2860 Some(
2861 _spTranslateYTimeline_apply
2862 as unsafe extern "C" fn(
2863 *mut spTimeline,
2864 *mut spSkeleton,
2865 c_float,
2866 c_float,
2867 *mut *mut spEvent,
2868 *mut c_int,
2869 c_float,
2870 spMixBlend,
2871 spMixDirection,
2872 ) -> (),
2873 ),
2874 Some(
2875 _spCurveTimeline_setBezier
2876 as unsafe extern "C" fn(
2877 *mut spTimeline,
2878 c_int,
2879 c_int,
2880 c_float,
2881 c_float,
2882 c_float,
2883 c_float,
2884 c_float,
2885 c_float,
2886 c_float,
2887 c_float,
2888 c_float,
2889 ) -> (),
2890 ),
2891 );
2892 (*timeline).boneIndex = boneIndex;
2893 timeline
2894}
2895#[no_mangle]
2896pub unsafe extern "C" fn spTranslateYTimeline_setFrame(
2897 mut self_0: *mut spTranslateYTimeline,
2898 mut frame: c_int,
2899 mut time: c_float,
2900 mut y: c_float,
2901) {
2902 spCurveTimeline1_setFrame(&mut (*self_0).super_0, frame, time, y);
2903}
2904#[no_mangle]
2905pub unsafe extern "C" fn _spScaleTimeline_apply(
2906 mut timeline: *mut spTimeline,
2907 mut skeleton: *mut spSkeleton,
2908 mut _lastTime: c_float,
2909 mut time: c_float,
2910 mut _firedEvents: *mut *mut spEvent,
2911 mut _eventsCount: *mut c_int,
2912 mut alpha: c_float,
2913 mut blend: spMixBlend,
2914 mut direction: spMixDirection,
2915) {
2916 let mut bone: *mut spBone = std::ptr::null_mut::<spBone>();
2917 let mut i: c_int = 0;
2918 let mut curveType: c_int = 0;
2919 let mut x: c_float = 0.;
2920 let mut y: c_float = 0.;
2921 let mut t: c_float = 0.;
2922 let mut self_0: *mut spScaleTimeline = timeline.cast::<spScaleTimeline>();
2923 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
2924 let mut curves: *mut c_float = (*(*self_0).super_0.curves).items;
2925 bone = *((*skeleton).bones).offset((*self_0).boneIndex as isize);
2926 if (*bone).active == 0 {
2927 return;
2928 }
2929 if time < *frames.offset(0 as c_int as isize) {
2930 match blend as c_uint {
2931 0 => {
2932 (*bone).scaleX = (*(*bone).data).scaleX;
2933 (*bone).scaleY = (*(*bone).data).scaleY;
2934 return;
2935 }
2936 1 => {
2937 (*bone).scaleX += ((*(*bone).data).scaleX - (*bone).scaleX) * alpha;
2938 (*bone).scaleY += ((*(*bone).data).scaleY - (*bone).scaleY) * alpha;
2939 }
2940 _ => {}
2941 }
2942 return;
2943 }
2944 i = search2((*self_0).super_0.super_0.frames, time, 3 as c_int);
2945 curveType = *curves.offset((i / 3 as c_int) as isize) as c_int;
2946 match curveType {
2947 0 => {
2948 let mut before: c_float = *frames.offset(i as isize);
2949 x = *frames.offset((i + 1 as c_int) as isize);
2950 y = *frames.offset((i + 2 as c_int) as isize);
2951 t = (time - before) / (*frames.offset((i + 3 as c_int) as isize) - before);
2952 x += (*frames.offset((i + 3 as c_int + 1 as c_int) as isize) - x) * t;
2953 y += (*frames.offset((i + 3 as c_int + 2 as c_int) as isize) - y) * t;
2954 }
2955 1 => {
2956 x = *frames.offset((i + 1 as c_int) as isize);
2957 y = *frames.offset((i + 2 as c_int) as isize);
2958 }
2959 _ => {
2960 x = _spCurveTimeline_getBezierValue(
2961 &mut (*self_0).super_0,
2962 time,
2963 i,
2964 1 as c_int,
2965 curveType - 2 as c_int,
2966 );
2967 y = _spCurveTimeline_getBezierValue(
2968 &mut (*self_0).super_0,
2969 time,
2970 i,
2971 2 as c_int,
2972 curveType + 18 as c_int - 2 as c_int,
2973 );
2974 }
2975 }
2976 x *= (*(*bone).data).scaleX;
2977 y *= (*(*bone).data).scaleY;
2978 if alpha == 1 as c_int as c_float {
2979 if blend as c_uint == SP_MIX_BLEND_ADD as c_int as c_uint {
2980 (*bone).scaleX += x - (*(*bone).data).scaleX;
2981 (*bone).scaleY += y - (*(*bone).data).scaleY;
2982 } else {
2983 (*bone).scaleX = x;
2984 (*bone).scaleY = y;
2985 }
2986 } else {
2987 let mut bx: c_float = 0.;
2988 let mut by: c_float = 0.;
2989 if direction as c_uint == SP_MIX_DIRECTION_OUT as c_int as c_uint {
2990 match blend as c_uint {
2991 0 => {
2992 bx = (*(*bone).data).scaleX;
2993 by = (*(*bone).data).scaleY;
2994 (*bone).scaleX = bx
2995 + ((if x < 0 as c_int as c_float { -x } else { x })
2996 * (if bx < 0 as c_int as c_float {
2997 -1.0f32
2998 } else if bx > 0 as c_int as c_float {
2999 1.0f32
3000 } else {
3001 0.0f32
3002 })
3003 - bx)
3004 * alpha;
3005 (*bone).scaleY = by
3006 + ((if y < 0 as c_int as c_float { -y } else { y })
3007 * (if by < 0 as c_int as c_float {
3008 -1.0f32
3009 } else if by > 0 as c_int as c_float {
3010 1.0f32
3011 } else {
3012 0.0f32
3013 })
3014 - by)
3015 * alpha;
3016 }
3017 1 | 2 => {
3018 bx = (*bone).scaleX;
3019 by = (*bone).scaleY;
3020 (*bone).scaleX = bx
3021 + ((if x < 0 as c_int as c_float { -x } else { x })
3022 * (if bx < 0 as c_int as c_float {
3023 -1.0f32
3024 } else if bx > 0 as c_int as c_float {
3025 1.0f32
3026 } else {
3027 0.0f32
3028 })
3029 - bx)
3030 * alpha;
3031 (*bone).scaleY = by
3032 + ((if y < 0 as c_int as c_float { -y } else { y })
3033 * (if by < 0 as c_int as c_float {
3034 -1.0f32
3035 } else if by > 0 as c_int as c_float {
3036 1.0f32
3037 } else {
3038 0.0f32
3039 })
3040 - by)
3041 * alpha;
3042 }
3043 3 => {
3044 (*bone).scaleX += (x - (*(*bone).data).scaleX) * alpha;
3045 (*bone).scaleY += (y - (*(*bone).data).scaleY) * alpha;
3046 }
3047 _ => {}
3048 }
3049 } else {
3050 match blend as c_uint {
3051 0 => {
3052 bx = (if (*(*bone).data).scaleX < 0 as c_int as c_float {
3053 -(*(*bone).data).scaleX
3054 } else {
3055 (*(*bone).data).scaleX
3056 }) * (if x < 0 as c_int as c_float {
3057 -1.0f32
3058 } else if x > 0 as c_int as c_float {
3059 1.0f32
3060 } else {
3061 0.0f32
3062 });
3063 by = (if (*(*bone).data).scaleY < 0 as c_int as c_float {
3064 -(*(*bone).data).scaleY
3065 } else {
3066 (*(*bone).data).scaleY
3067 }) * (if y < 0 as c_int as c_float {
3068 -1.0f32
3069 } else if y > 0 as c_int as c_float {
3070 1.0f32
3071 } else {
3072 0.0f32
3073 });
3074 (*bone).scaleX = bx + (x - bx) * alpha;
3075 (*bone).scaleY = by + (y - by) * alpha;
3076 }
3077 1 | 2 => {
3078 bx = (if (*bone).scaleX < 0 as c_int as c_float {
3079 -(*bone).scaleX
3080 } else {
3081 (*bone).scaleX
3082 }) * (if x < 0 as c_int as c_float {
3083 -1.0f32
3084 } else if x > 0 as c_int as c_float {
3085 1.0f32
3086 } else {
3087 0.0f32
3088 });
3089 by = (if (*bone).scaleY < 0 as c_int as c_float {
3090 -(*bone).scaleY
3091 } else {
3092 (*bone).scaleY
3093 }) * (if y < 0 as c_int as c_float {
3094 -1.0f32
3095 } else if y > 0 as c_int as c_float {
3096 1.0f32
3097 } else {
3098 0.0f32
3099 });
3100 (*bone).scaleX = bx + (x - bx) * alpha;
3101 (*bone).scaleY = by + (y - by) * alpha;
3102 }
3103 3 => {
3104 (*bone).scaleX += (x - (*(*bone).data).scaleX) * alpha;
3105 (*bone).scaleY += (y - (*(*bone).data).scaleY) * alpha;
3106 }
3107 _ => {}
3108 }
3109 }
3110 };
3111}
3112#[no_mangle]
3113pub unsafe extern "C" fn spScaleTimeline_create(
3114 mut frameCount: c_int,
3115 mut bezierCount: c_int,
3116 mut boneIndex: c_int,
3117) -> *mut spScaleTimeline {
3118 let mut timeline: *mut spScaleTimeline = _spCalloc(
3119 1 as c_int as size_t,
3120 ::core::mem::size_of::<spScaleTimeline>() as c_ulong,
3121 (b"spine.c\0" as *const u8).cast::<c_char>(),
3122 770 as c_int,
3123 )
3124 .cast::<spScaleTimeline>();
3125 let mut ids: [spPropertyId; 2] = [0; 2];
3126 ids[0 as c_int as usize] =
3127 (SP_PROPERTY_SCALEX as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong;
3128 ids[1 as c_int as usize] =
3129 (SP_PROPERTY_SCALEY as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong;
3130 _spCurveTimeline_init(
3131 &mut (*timeline).super_0,
3132 frameCount,
3133 3 as c_int,
3134 bezierCount,
3135 ids.as_mut_ptr(),
3136 2 as c_int,
3137 SP_TIMELINE_SCALE,
3138 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
3139 Some(
3140 _spScaleTimeline_apply
3141 as unsafe extern "C" fn(
3142 *mut spTimeline,
3143 *mut spSkeleton,
3144 c_float,
3145 c_float,
3146 *mut *mut spEvent,
3147 *mut c_int,
3148 c_float,
3149 spMixBlend,
3150 spMixDirection,
3151 ) -> (),
3152 ),
3153 Some(
3154 _spCurveTimeline_setBezier
3155 as unsafe extern "C" fn(
3156 *mut spTimeline,
3157 c_int,
3158 c_int,
3159 c_float,
3160 c_float,
3161 c_float,
3162 c_float,
3163 c_float,
3164 c_float,
3165 c_float,
3166 c_float,
3167 c_float,
3168 ) -> (),
3169 ),
3170 );
3171 (*timeline).boneIndex = boneIndex;
3172 timeline
3173}
3174#[no_mangle]
3175pub unsafe extern "C" fn spScaleTimeline_setFrame(
3176 mut self_0: *mut spScaleTimeline,
3177 mut frame: c_int,
3178 mut time: c_float,
3179 mut x: c_float,
3180 mut y: c_float,
3181) {
3182 spCurveTimeline2_setFrame(&mut (*self_0).super_0, frame, time, x, y);
3183}
3184#[no_mangle]
3185pub unsafe extern "C" fn _spScaleXTimeline_apply(
3186 mut timeline: *mut spTimeline,
3187 mut skeleton: *mut spSkeleton,
3188 mut _lastTime: c_float,
3189 mut time: c_float,
3190 mut _firedEvents: *mut *mut spEvent,
3191 mut _eventsCount: *mut c_int,
3192 mut alpha: c_float,
3193 mut blend: spMixBlend,
3194 mut direction: spMixDirection,
3195) {
3196 let mut self_0: *mut spScaleXTimeline = timeline.cast::<spScaleXTimeline>();
3197 let mut bone: *mut spBone = *((*skeleton).bones).offset((*self_0).boneIndex as isize);
3198 if (*bone).active != 0 {
3199 (*bone).scaleX = spCurveTimeline1_getScaleValue(
3200 &mut (*self_0).super_0,
3201 time,
3202 alpha,
3203 blend,
3204 direction,
3205 (*bone).scaleX,
3206 (*(*bone).data).scaleX,
3207 );
3208 }
3209}
3210#[no_mangle]
3211pub unsafe extern "C" fn spScaleXTimeline_create(
3212 mut frameCount: c_int,
3213 mut bezierCount: c_int,
3214 mut boneIndex: c_int,
3215) -> *mut spScaleXTimeline {
3216 let mut timeline: *mut spScaleXTimeline = _spCalloc(
3217 1 as c_int as size_t,
3218 ::core::mem::size_of::<spScaleXTimeline>() as c_ulong,
3219 (b"spine.c\0" as *const u8).cast::<c_char>(),
3220 800 as c_int,
3221 )
3222 .cast::<spScaleXTimeline>();
3223 let mut ids: [spPropertyId; 1] = [0; 1];
3224 ids[0 as c_int as usize] =
3225 (SP_PROPERTY_SCALEX as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong;
3226 _spCurveTimeline_init(
3227 &mut (*timeline).super_0,
3228 frameCount,
3229 2 as c_int,
3230 bezierCount,
3231 ids.as_mut_ptr(),
3232 1 as c_int,
3233 SP_TIMELINE_SCALEX,
3234 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
3235 Some(
3236 _spScaleXTimeline_apply
3237 as unsafe extern "C" fn(
3238 *mut spTimeline,
3239 *mut spSkeleton,
3240 c_float,
3241 c_float,
3242 *mut *mut spEvent,
3243 *mut c_int,
3244 c_float,
3245 spMixBlend,
3246 spMixDirection,
3247 ) -> (),
3248 ),
3249 Some(
3250 _spCurveTimeline_setBezier
3251 as unsafe extern "C" fn(
3252 *mut spTimeline,
3253 c_int,
3254 c_int,
3255 c_float,
3256 c_float,
3257 c_float,
3258 c_float,
3259 c_float,
3260 c_float,
3261 c_float,
3262 c_float,
3263 c_float,
3264 ) -> (),
3265 ),
3266 );
3267 (*timeline).boneIndex = boneIndex;
3268 timeline
3269}
3270#[no_mangle]
3271pub unsafe extern "C" fn spScaleXTimeline_setFrame(
3272 mut self_0: *mut spScaleXTimeline,
3273 mut frame: c_int,
3274 mut time: c_float,
3275 mut y: c_float,
3276) {
3277 spCurveTimeline1_setFrame(&mut (*self_0).super_0, frame, time, y);
3278}
3279#[no_mangle]
3280pub unsafe extern "C" fn _spScaleYTimeline_apply(
3281 mut timeline: *mut spTimeline,
3282 mut skeleton: *mut spSkeleton,
3283 mut _lastTime: c_float,
3284 mut time: c_float,
3285 mut _firedEvents: *mut *mut spEvent,
3286 mut _eventsCount: *mut c_int,
3287 mut alpha: c_float,
3288 mut blend: spMixBlend,
3289 mut direction: spMixDirection,
3290) {
3291 let mut self_0: *mut spScaleYTimeline = timeline.cast::<spScaleYTimeline>();
3292 let mut bone: *mut spBone = *((*skeleton).bones).offset((*self_0).boneIndex as isize);
3293 if (*bone).active != 0 {
3294 (*bone).scaleY = spCurveTimeline1_getScaleValue(
3295 &mut (*self_0).super_0,
3296 time,
3297 alpha,
3298 blend,
3299 direction,
3300 (*bone).scaleX,
3301 (*(*bone).data).scaleY,
3302 );
3303 }
3304}
3305#[no_mangle]
3306pub unsafe extern "C" fn spScaleYTimeline_create(
3307 mut frameCount: c_int,
3308 mut bezierCount: c_int,
3309 mut boneIndex: c_int,
3310) -> *mut spScaleYTimeline {
3311 let mut timeline: *mut spScaleYTimeline = _spCalloc(
3312 1 as c_int as size_t,
3313 ::core::mem::size_of::<spScaleYTimeline>() as c_ulong,
3314 (b"spine.c\0" as *const u8).cast::<c_char>(),
3315 829 as c_int,
3316 )
3317 .cast::<spScaleYTimeline>();
3318 let mut ids: [spPropertyId; 1] = [0; 1];
3319 ids[0 as c_int as usize] =
3320 (SP_PROPERTY_SCALEY as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong;
3321 _spCurveTimeline_init(
3322 &mut (*timeline).super_0,
3323 frameCount,
3324 2 as c_int,
3325 bezierCount,
3326 ids.as_mut_ptr(),
3327 1 as c_int,
3328 SP_TIMELINE_SCALEY,
3329 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
3330 Some(
3331 _spScaleYTimeline_apply
3332 as unsafe extern "C" fn(
3333 *mut spTimeline,
3334 *mut spSkeleton,
3335 c_float,
3336 c_float,
3337 *mut *mut spEvent,
3338 *mut c_int,
3339 c_float,
3340 spMixBlend,
3341 spMixDirection,
3342 ) -> (),
3343 ),
3344 Some(
3345 _spCurveTimeline_setBezier
3346 as unsafe extern "C" fn(
3347 *mut spTimeline,
3348 c_int,
3349 c_int,
3350 c_float,
3351 c_float,
3352 c_float,
3353 c_float,
3354 c_float,
3355 c_float,
3356 c_float,
3357 c_float,
3358 c_float,
3359 ) -> (),
3360 ),
3361 );
3362 (*timeline).boneIndex = boneIndex;
3363 timeline
3364}
3365#[no_mangle]
3366pub unsafe extern "C" fn spScaleYTimeline_setFrame(
3367 mut self_0: *mut spScaleYTimeline,
3368 mut frame: c_int,
3369 mut time: c_float,
3370 mut y: c_float,
3371) {
3372 spCurveTimeline1_setFrame(&mut (*self_0).super_0, frame, time, y);
3373}
3374#[no_mangle]
3375pub unsafe extern "C" fn _spShearTimeline_apply(
3376 mut timeline: *mut spTimeline,
3377 mut skeleton: *mut spSkeleton,
3378 mut _lastTime: c_float,
3379 mut time: c_float,
3380 mut _firedEvents: *mut *mut spEvent,
3381 mut _eventsCount: *mut c_int,
3382 mut alpha: c_float,
3383 mut blend: spMixBlend,
3384 mut _direction: spMixDirection,
3385) {
3386 let mut bone: *mut spBone = std::ptr::null_mut::<spBone>();
3387 let mut x: c_float = 0.;
3388 let mut y: c_float = 0.;
3389 let mut t: c_float = 0.;
3390 let mut i: c_int = 0;
3391 let mut curveType: c_int = 0;
3392 let mut self_0: *mut spShearTimeline = timeline.cast::<spShearTimeline>();
3393 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
3394 let mut curves: *mut c_float = (*(*self_0).super_0.curves).items;
3395 bone = *((*skeleton).bones).offset((*self_0).boneIndex as isize);
3396 if (*bone).active == 0 {
3397 return;
3398 }
3399 if time < *frames.offset(0 as c_int as isize) {
3400 match blend as c_uint {
3401 0 => {
3402 (*bone).shearX = (*(*bone).data).shearX;
3403 (*bone).shearY = (*(*bone).data).shearY;
3404 return;
3405 }
3406 1 => {
3407 (*bone).shearX += ((*(*bone).data).shearX - (*bone).shearX) * alpha;
3408 (*bone).shearY += ((*(*bone).data).shearY - (*bone).shearY) * alpha;
3409 }
3410 _ => {}
3411 }
3412 return;
3413 }
3414 i = search2((*self_0).super_0.super_0.frames, time, 3 as c_int);
3415 curveType = *curves.offset((i / 3 as c_int) as isize) as c_int;
3416 match curveType {
3417 0 => {
3418 let mut before: c_float = *frames.offset(i as isize);
3419 x = *frames.offset((i + 1 as c_int) as isize);
3420 y = *frames.offset((i + 2 as c_int) as isize);
3421 t = (time - before) / (*frames.offset((i + 3 as c_int) as isize) - before);
3422 x += (*frames.offset((i + 3 as c_int + 1 as c_int) as isize) - x) * t;
3423 y += (*frames.offset((i + 3 as c_int + 2 as c_int) as isize) - y) * t;
3424 }
3425 1 => {
3426 x = *frames.offset((i + 1 as c_int) as isize);
3427 y = *frames.offset((i + 2 as c_int) as isize);
3428 }
3429 _ => {
3430 x = _spCurveTimeline_getBezierValue(
3431 &mut (*self_0).super_0,
3432 time,
3433 i,
3434 1 as c_int,
3435 curveType - 2 as c_int,
3436 );
3437 y = _spCurveTimeline_getBezierValue(
3438 &mut (*self_0).super_0,
3439 time,
3440 i,
3441 2 as c_int,
3442 curveType + 18 as c_int - 2 as c_int,
3443 );
3444 }
3445 }
3446 match blend as c_uint {
3447 0 => {
3448 (*bone).shearX = (*(*bone).data).shearX + x * alpha;
3449 (*bone).shearY = (*(*bone).data).shearY + y * alpha;
3450 }
3451 1 | 2 => {
3452 (*bone).shearX += ((*(*bone).data).shearX + x - (*bone).shearX) * alpha;
3453 (*bone).shearY += ((*(*bone).data).shearY + y - (*bone).shearY) * alpha;
3454 }
3455 3 => {
3456 (*bone).shearX += x * alpha;
3457 (*bone).shearY += y * alpha;
3458 }
3459 _ => {}
3460 };
3461}
3462#[no_mangle]
3463pub unsafe extern "C" fn spShearTimeline_create(
3464 mut frameCount: c_int,
3465 mut bezierCount: c_int,
3466 mut boneIndex: c_int,
3467) -> *mut spShearTimeline {
3468 let mut timeline: *mut spShearTimeline = _spCalloc(
3469 1 as c_int as size_t,
3470 ::core::mem::size_of::<spShearTimeline>() as c_ulong,
3471 (b"spine.c\0" as *const u8).cast::<c_char>(),
3472 917 as c_int,
3473 )
3474 .cast::<spShearTimeline>();
3475 let mut ids: [spPropertyId; 2] = [0; 2];
3476 ids[0 as c_int as usize] =
3477 (SP_PROPERTY_SHEARX as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong;
3478 ids[1 as c_int as usize] =
3479 (SP_PROPERTY_SHEARY as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong;
3480 _spCurveTimeline_init(
3481 &mut (*timeline).super_0,
3482 frameCount,
3483 3 as c_int,
3484 bezierCount,
3485 ids.as_mut_ptr(),
3486 2 as c_int,
3487 SP_TIMELINE_SHEAR,
3488 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
3489 Some(
3490 _spShearTimeline_apply
3491 as unsafe extern "C" fn(
3492 *mut spTimeline,
3493 *mut spSkeleton,
3494 c_float,
3495 c_float,
3496 *mut *mut spEvent,
3497 *mut c_int,
3498 c_float,
3499 spMixBlend,
3500 spMixDirection,
3501 ) -> (),
3502 ),
3503 Some(
3504 _spCurveTimeline_setBezier
3505 as unsafe extern "C" fn(
3506 *mut spTimeline,
3507 c_int,
3508 c_int,
3509 c_float,
3510 c_float,
3511 c_float,
3512 c_float,
3513 c_float,
3514 c_float,
3515 c_float,
3516 c_float,
3517 c_float,
3518 ) -> (),
3519 ),
3520 );
3521 (*timeline).boneIndex = boneIndex;
3522 timeline
3523}
3524#[no_mangle]
3525pub unsafe extern "C" fn spShearTimeline_setFrame(
3526 mut self_0: *mut spShearTimeline,
3527 mut frame: c_int,
3528 mut time: c_float,
3529 mut x: c_float,
3530 mut y: c_float,
3531) {
3532 spCurveTimeline2_setFrame(&mut (*self_0).super_0, frame, time, x, y);
3533}
3534#[no_mangle]
3535pub unsafe extern "C" fn _spShearXTimeline_apply(
3536 mut timeline: *mut spTimeline,
3537 mut skeleton: *mut spSkeleton,
3538 mut _lastTime: c_float,
3539 mut time: c_float,
3540 mut _firedEvents: *mut *mut spEvent,
3541 mut _eventsCount: *mut c_int,
3542 mut alpha: c_float,
3543 mut blend: spMixBlend,
3544 mut _direction: spMixDirection,
3545) {
3546 let mut self_0: *mut spShearXTimeline = timeline.cast::<spShearXTimeline>();
3547 let mut bone: *mut spBone = *((*skeleton).bones).offset((*self_0).boneIndex as isize);
3548 if (*bone).active != 0 {
3549 (*bone).shearX = spCurveTimeline1_getRelativeValue(
3550 &mut (*self_0).super_0,
3551 time,
3552 alpha,
3553 blend,
3554 (*bone).shearX,
3555 (*(*bone).data).shearX,
3556 );
3557 }
3558}
3559#[no_mangle]
3560pub unsafe extern "C" fn spShearXTimeline_create(
3561 mut frameCount: c_int,
3562 mut bezierCount: c_int,
3563 mut boneIndex: c_int,
3564) -> *mut spShearXTimeline {
3565 let mut timeline: *mut spShearXTimeline = _spCalloc(
3566 1 as c_int as size_t,
3567 ::core::mem::size_of::<spShearXTimeline>() as c_ulong,
3568 (b"spine.c\0" as *const u8).cast::<c_char>(),
3569 948 as c_int,
3570 )
3571 .cast::<spShearXTimeline>();
3572 let mut ids: [spPropertyId; 1] = [0; 1];
3573 ids[0 as c_int as usize] =
3574 (SP_PROPERTY_SHEARX as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong;
3575 _spCurveTimeline_init(
3576 &mut (*timeline).super_0,
3577 frameCount,
3578 2 as c_int,
3579 bezierCount,
3580 ids.as_mut_ptr(),
3581 1 as c_int,
3582 SP_TIMELINE_SHEARX,
3583 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
3584 Some(
3585 _spShearXTimeline_apply
3586 as unsafe extern "C" fn(
3587 *mut spTimeline,
3588 *mut spSkeleton,
3589 c_float,
3590 c_float,
3591 *mut *mut spEvent,
3592 *mut c_int,
3593 c_float,
3594 spMixBlend,
3595 spMixDirection,
3596 ) -> (),
3597 ),
3598 Some(
3599 _spCurveTimeline_setBezier
3600 as unsafe extern "C" fn(
3601 *mut spTimeline,
3602 c_int,
3603 c_int,
3604 c_float,
3605 c_float,
3606 c_float,
3607 c_float,
3608 c_float,
3609 c_float,
3610 c_float,
3611 c_float,
3612 c_float,
3613 ) -> (),
3614 ),
3615 );
3616 (*timeline).boneIndex = boneIndex;
3617 timeline
3618}
3619#[no_mangle]
3620pub unsafe extern "C" fn spShearXTimeline_setFrame(
3621 mut self_0: *mut spShearXTimeline,
3622 mut frame: c_int,
3623 mut time: c_float,
3624 mut x: c_float,
3625) {
3626 spCurveTimeline1_setFrame(&mut (*self_0).super_0, frame, time, x);
3627}
3628#[no_mangle]
3629pub unsafe extern "C" fn _spShearYTimeline_apply(
3630 mut timeline: *mut spTimeline,
3631 mut skeleton: *mut spSkeleton,
3632 mut _lastTime: c_float,
3633 mut time: c_float,
3634 mut _firedEvents: *mut *mut spEvent,
3635 mut _eventsCount: *mut c_int,
3636 mut alpha: c_float,
3637 mut blend: spMixBlend,
3638 mut _direction: spMixDirection,
3639) {
3640 let mut self_0: *mut spShearYTimeline = timeline.cast::<spShearYTimeline>();
3641 let mut bone: *mut spBone = *((*skeleton).bones).offset((*self_0).boneIndex as isize);
3642 if (*bone).active != 0 {
3643 (*bone).shearY = spCurveTimeline1_getRelativeValue(
3644 &mut (*self_0).super_0,
3645 time,
3646 alpha,
3647 blend,
3648 (*bone).shearY,
3649 (*(*bone).data).shearY,
3650 );
3651 }
3652}
3653#[no_mangle]
3654pub unsafe extern "C" fn spShearYTimeline_create(
3655 mut frameCount: c_int,
3656 mut bezierCount: c_int,
3657 mut boneIndex: c_int,
3658) -> *mut spShearYTimeline {
3659 let mut timeline: *mut spShearYTimeline = _spCalloc(
3660 1 as c_int as size_t,
3661 ::core::mem::size_of::<spShearYTimeline>() as c_ulong,
3662 (b"spine.c\0" as *const u8).cast::<c_char>(),
3663 978 as c_int,
3664 )
3665 .cast::<spShearYTimeline>();
3666 let mut ids: [spPropertyId; 1] = [0; 1];
3667 ids[0 as c_int as usize] =
3668 (SP_PROPERTY_SHEARY as c_int as spPropertyId) << 32 as c_int | boneIndex as c_ulong;
3669 _spCurveTimeline_init(
3670 &mut (*timeline).super_0,
3671 frameCount,
3672 2 as c_int,
3673 bezierCount,
3674 ids.as_mut_ptr(),
3675 1 as c_int,
3676 SP_TIMELINE_SHEARY,
3677 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
3678 Some(
3679 _spShearYTimeline_apply
3680 as unsafe extern "C" fn(
3681 *mut spTimeline,
3682 *mut spSkeleton,
3683 c_float,
3684 c_float,
3685 *mut *mut spEvent,
3686 *mut c_int,
3687 c_float,
3688 spMixBlend,
3689 spMixDirection,
3690 ) -> (),
3691 ),
3692 Some(
3693 _spCurveTimeline_setBezier
3694 as unsafe extern "C" fn(
3695 *mut spTimeline,
3696 c_int,
3697 c_int,
3698 c_float,
3699 c_float,
3700 c_float,
3701 c_float,
3702 c_float,
3703 c_float,
3704 c_float,
3705 c_float,
3706 c_float,
3707 ) -> (),
3708 ),
3709 );
3710 (*timeline).boneIndex = boneIndex;
3711 timeline
3712}
3713#[no_mangle]
3714pub unsafe extern "C" fn spShearYTimeline_setFrame(
3715 mut self_0: *mut spShearYTimeline,
3716 mut frame: c_int,
3717 mut time: c_float,
3718 mut y: c_float,
3719) {
3720 spCurveTimeline1_setFrame(&mut (*self_0).super_0, frame, time, y);
3721}
3722static mut RGBA_ENTRIES: c_int = 5 as c_int;
3723static mut COLOR_R: c_int = 1 as c_int;
3724static mut COLOR_G: c_int = 2 as c_int;
3725static mut COLOR_B: c_int = 3 as c_int;
3726static mut COLOR_A: c_int = 4 as c_int;
3727#[no_mangle]
3728pub unsafe extern "C" fn _spRGBATimeline_apply(
3729 mut timeline: *mut spTimeline,
3730 mut skeleton: *mut spSkeleton,
3731 mut _lastTime: c_float,
3732 mut time: c_float,
3733 mut _firedEvents: *mut *mut spEvent,
3734 mut _eventsCount: *mut c_int,
3735 mut alpha: c_float,
3736 mut blend: spMixBlend,
3737 mut _direction: spMixDirection,
3738) {
3739 let mut slot: *mut spSlot = std::ptr::null_mut::<spSlot>();
3740 let mut i: c_int = 0;
3741 let mut curveType: c_int = 0;
3742 let mut r: c_float = 0.;
3743 let mut g: c_float = 0.;
3744 let mut b: c_float = 0.;
3745 let mut a: c_float = 0.;
3746 let mut t: c_float = 0.;
3747 let mut color: *mut spColor = std::ptr::null_mut::<spColor>();
3748 let mut setup: *mut spColor = std::ptr::null_mut::<spColor>();
3749 let mut self_0: *mut spRGBATimeline = timeline.cast::<spRGBATimeline>();
3750 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
3751 let mut curves: *mut c_float = (*(*self_0).super_0.curves).items;
3752 slot = *((*skeleton).slots).offset((*self_0).slotIndex as isize);
3753 if (*(*slot).bone).active == 0 {
3754 return;
3755 }
3756 if time < *frames.offset(0 as c_int as isize) {
3757 color = &mut (*slot).color;
3758 setup = &mut (*(*slot).data).color;
3759 match blend as c_uint {
3760 0 => {
3761 spColor_setFromColor(color, setup);
3762 return;
3763 }
3764 1 => {
3765 spColor_addFloats(
3766 color,
3767 ((*setup).r - (*color).r) * alpha,
3768 ((*setup).g - (*color).g) * alpha,
3769 ((*setup).b - (*color).b) * alpha,
3770 ((*setup).a - (*color).a) * alpha,
3771 );
3772 }
3773 _ => {}
3774 }
3775 return;
3776 }
3777 i = search2((*self_0).super_0.super_0.frames, time, RGBA_ENTRIES);
3778 curveType = *curves.offset((i / RGBA_ENTRIES) as isize) as c_int;
3779 match curveType {
3780 0 => {
3781 let mut before: c_float = *frames.offset(i as isize);
3782 r = *frames.offset((i + COLOR_R) as isize);
3783 g = *frames.offset((i + COLOR_G) as isize);
3784 b = *frames.offset((i + COLOR_B) as isize);
3785 a = *frames.offset((i + COLOR_A) as isize);
3786 t = (time - before) / (*frames.offset((i + RGBA_ENTRIES) as isize) - before);
3787 r += (*frames.offset((i + RGBA_ENTRIES + COLOR_R) as isize) - r) * t;
3788 g += (*frames.offset((i + RGBA_ENTRIES + COLOR_G) as isize) - g) * t;
3789 b += (*frames.offset((i + RGBA_ENTRIES + COLOR_B) as isize) - b) * t;
3790 a += (*frames.offset((i + RGBA_ENTRIES + COLOR_A) as isize) - a) * t;
3791 }
3792 1 => {
3793 r = *frames.offset((i + COLOR_R) as isize);
3794 g = *frames.offset((i + COLOR_G) as isize);
3795 b = *frames.offset((i + COLOR_B) as isize);
3796 a = *frames.offset((i + COLOR_A) as isize);
3797 }
3798 _ => {
3799 r = _spCurveTimeline_getBezierValue(
3800 &mut (*self_0).super_0,
3801 time,
3802 i,
3803 COLOR_R,
3804 curveType - 2 as c_int,
3805 );
3806 g = _spCurveTimeline_getBezierValue(
3807 &mut (*self_0).super_0,
3808 time,
3809 i,
3810 COLOR_G,
3811 curveType + 18 as c_int - 2 as c_int,
3812 );
3813 b = _spCurveTimeline_getBezierValue(
3814 &mut (*self_0).super_0,
3815 time,
3816 i,
3817 COLOR_B,
3818 curveType + 18 as c_int * 2 as c_int - 2 as c_int,
3819 );
3820 a = _spCurveTimeline_getBezierValue(
3821 &mut (*self_0).super_0,
3822 time,
3823 i,
3824 COLOR_A,
3825 curveType + 18 as c_int * 3 as c_int - 2 as c_int,
3826 );
3827 }
3828 }
3829 color = &mut (*slot).color;
3830 if alpha == 1 as c_int as c_float {
3831 spColor_setFromFloats(color, r, g, b, a);
3832 } else {
3833 if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint {
3834 spColor_setFromColor(color, &mut (*(*slot).data).color);
3835 }
3836 spColor_addFloats(
3837 color,
3838 (r - (*color).r) * alpha,
3839 (g - (*color).g) * alpha,
3840 (b - (*color).b) * alpha,
3841 (a - (*color).a) * alpha,
3842 );
3843 };
3844}
3845#[no_mangle]
3846pub unsafe extern "C" fn spRGBATimeline_create(
3847 mut framesCount: c_int,
3848 mut bezierCount: c_int,
3849 mut slotIndex: c_int,
3850) -> *mut spRGBATimeline {
3851 let mut timeline: *mut spRGBATimeline = _spCalloc(
3852 1 as c_int as size_t,
3853 ::core::mem::size_of::<spRGBATimeline>() as c_ulong,
3854 (b"spine.c\0" as *const u8).cast::<c_char>(),
3855 1075 as c_int,
3856 )
3857 .cast::<spRGBATimeline>();
3858 let mut ids: [spPropertyId; 2] = [0; 2];
3859 ids[0 as c_int as usize] =
3860 (SP_PROPERTY_RGB as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong;
3861 ids[1 as c_int as usize] =
3862 (SP_PROPERTY_ALPHA as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong;
3863 _spCurveTimeline_init(
3864 &mut (*timeline).super_0,
3865 framesCount,
3866 RGBA_ENTRIES,
3867 bezierCount,
3868 ids.as_mut_ptr(),
3869 2 as c_int,
3870 SP_TIMELINE_RGBA,
3871 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
3872 Some(
3873 _spRGBATimeline_apply
3874 as unsafe extern "C" fn(
3875 *mut spTimeline,
3876 *mut spSkeleton,
3877 c_float,
3878 c_float,
3879 *mut *mut spEvent,
3880 *mut c_int,
3881 c_float,
3882 spMixBlend,
3883 spMixDirection,
3884 ) -> (),
3885 ),
3886 Some(
3887 _spCurveTimeline_setBezier
3888 as unsafe extern "C" fn(
3889 *mut spTimeline,
3890 c_int,
3891 c_int,
3892 c_float,
3893 c_float,
3894 c_float,
3895 c_float,
3896 c_float,
3897 c_float,
3898 c_float,
3899 c_float,
3900 c_float,
3901 ) -> (),
3902 ),
3903 );
3904 (*timeline).slotIndex = slotIndex;
3905 timeline
3906}
3907#[no_mangle]
3908pub unsafe extern "C" fn spRGBATimeline_setFrame(
3909 mut self_0: *mut spRGBATimeline,
3910 mut frame: c_int,
3911 mut time: c_float,
3912 mut r: c_float,
3913 mut g: c_float,
3914 mut b: c_float,
3915 mut a: c_float,
3916) {
3917 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
3918 frame *= RGBA_ENTRIES;
3919 *frames.offset(frame as isize) = time;
3920 *frames.offset((frame + COLOR_R) as isize) = r;
3921 *frames.offset((frame + COLOR_G) as isize) = g;
3922 *frames.offset((frame + COLOR_B) as isize) = b;
3923 *frames.offset((frame + COLOR_A) as isize) = a;
3924}
3925#[no_mangle]
3926pub unsafe extern "C" fn _spRGBTimeline_apply(
3927 mut timeline: *mut spTimeline,
3928 mut skeleton: *mut spSkeleton,
3929 mut _lastTime: c_float,
3930 mut time: c_float,
3931 mut _firedEvents: *mut *mut spEvent,
3932 mut _eventsCount: *mut c_int,
3933 mut alpha: c_float,
3934 mut blend: spMixBlend,
3935 mut _direction: spMixDirection,
3936) {
3937 let mut slot: *mut spSlot = std::ptr::null_mut::<spSlot>();
3938 let mut i: c_int = 0;
3939 let mut curveType: c_int = 0;
3940 let mut r: c_float = 0.;
3941 let mut g: c_float = 0.;
3942 let mut b: c_float = 0.;
3943 let mut t: c_float = 0.;
3944 let mut color: *mut spColor = std::ptr::null_mut::<spColor>();
3945 let mut setup: *mut spColor = std::ptr::null_mut::<spColor>();
3946 let mut self_0: *mut spRGBTimeline = timeline.cast::<spRGBTimeline>();
3947 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
3948 let mut curves: *mut c_float = (*(*self_0).super_0.curves).items;
3949 slot = *((*skeleton).slots).offset((*self_0).slotIndex as isize);
3950 if (*(*slot).bone).active == 0 {
3951 return;
3952 }
3953 if time < *frames.offset(0 as c_int as isize) {
3954 color = &mut (*slot).color;
3955 setup = &mut (*(*slot).data).color;
3956 match blend as c_uint {
3957 0 => {
3958 spColor_setFromColor(color, setup);
3959 return;
3960 }
3961 1 => {
3962 spColor_addFloats(
3963 color,
3964 ((*setup).r - (*color).r) * alpha,
3965 ((*setup).g - (*color).g) * alpha,
3966 ((*setup).b - (*color).b) * alpha,
3967 ((*setup).a - (*color).a) * alpha,
3968 );
3969 }
3970 _ => {}
3971 }
3972 return;
3973 }
3974 i = search2((*self_0).super_0.super_0.frames, time, 4 as c_int);
3975 curveType = *curves.offset((i / 4 as c_int) as isize) as c_int;
3976 match curveType {
3977 0 => {
3978 let mut before: c_float = *frames.offset(i as isize);
3979 r = *frames.offset((i + COLOR_R) as isize);
3980 g = *frames.offset((i + COLOR_G) as isize);
3981 b = *frames.offset((i + COLOR_B) as isize);
3982 t = (time - before) / (*frames.offset((i + 4 as c_int) as isize) - before);
3983 r += (*frames.offset((i + 4 as c_int + COLOR_R) as isize) - r) * t;
3984 g += (*frames.offset((i + 4 as c_int + COLOR_G) as isize) - g) * t;
3985 b += (*frames.offset((i + 4 as c_int + COLOR_B) as isize) - b) * t;
3986 }
3987 1 => {
3988 r = *frames.offset((i + COLOR_R) as isize);
3989 g = *frames.offset((i + COLOR_G) as isize);
3990 b = *frames.offset((i + COLOR_B) as isize);
3991 }
3992 _ => {
3993 r = _spCurveTimeline_getBezierValue(
3994 &mut (*self_0).super_0,
3995 time,
3996 i,
3997 COLOR_R,
3998 curveType - 2 as c_int,
3999 );
4000 g = _spCurveTimeline_getBezierValue(
4001 &mut (*self_0).super_0,
4002 time,
4003 i,
4004 COLOR_G,
4005 curveType + 18 as c_int - 2 as c_int,
4006 );
4007 b = _spCurveTimeline_getBezierValue(
4008 &mut (*self_0).super_0,
4009 time,
4010 i,
4011 COLOR_B,
4012 curveType + 18 as c_int * 2 as c_int - 2 as c_int,
4013 );
4014 }
4015 }
4016 color = &mut (*slot).color;
4017 if alpha == 1 as c_int as c_float {
4018 (*color).r = r;
4019 (*color).g = g;
4020 (*color).b = b;
4021 } else {
4022 if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint {
4023 (*color).r = (*(*slot).data).color.r;
4024 (*color).g = (*(*slot).data).color.g;
4025 (*color).b = (*(*slot).data).color.b;
4026 }
4027 (*color).r += (r - (*color).r) * alpha;
4028 (*color).g += (g - (*color).g) * alpha;
4029 (*color).b += (b - (*color).b) * alpha;
4030 };
4031}
4032#[no_mangle]
4033pub unsafe extern "C" fn spRGBTimeline_create(
4034 mut framesCount: c_int,
4035 mut bezierCount: c_int,
4036 mut slotIndex: c_int,
4037) -> *mut spRGBTimeline {
4038 let mut timeline: *mut spRGBTimeline = _spCalloc(
4039 1 as c_int as size_t,
4040 ::core::mem::size_of::<spRGBTimeline>() as c_ulong,
4041 (b"spine.c\0" as *const u8).cast::<c_char>(),
4042 1181 as c_int,
4043 )
4044 .cast::<spRGBTimeline>();
4045 let mut ids: [spPropertyId; 1] = [0; 1];
4046 ids[0 as c_int as usize] =
4047 (SP_PROPERTY_RGB as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong;
4048 _spCurveTimeline_init(
4049 &mut (*timeline).super_0,
4050 framesCount,
4051 4 as c_int,
4052 bezierCount,
4053 ids.as_mut_ptr(),
4054 1 as c_int,
4055 SP_TIMELINE_RGB,
4056 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
4057 Some(
4058 _spRGBTimeline_apply
4059 as unsafe extern "C" fn(
4060 *mut spTimeline,
4061 *mut spSkeleton,
4062 c_float,
4063 c_float,
4064 *mut *mut spEvent,
4065 *mut c_int,
4066 c_float,
4067 spMixBlend,
4068 spMixDirection,
4069 ) -> (),
4070 ),
4071 Some(
4072 _spCurveTimeline_setBezier
4073 as unsafe extern "C" fn(
4074 *mut spTimeline,
4075 c_int,
4076 c_int,
4077 c_float,
4078 c_float,
4079 c_float,
4080 c_float,
4081 c_float,
4082 c_float,
4083 c_float,
4084 c_float,
4085 c_float,
4086 ) -> (),
4087 ),
4088 );
4089 (*timeline).slotIndex = slotIndex;
4090 timeline
4091}
4092#[no_mangle]
4093pub unsafe extern "C" fn spRGBTimeline_setFrame(
4094 mut self_0: *mut spRGBTimeline,
4095 mut frame: c_int,
4096 mut time: c_float,
4097 mut r: c_float,
4098 mut g: c_float,
4099 mut b: c_float,
4100) {
4101 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
4102 frame *= 4 as c_int;
4103 *frames.offset(frame as isize) = time;
4104 *frames.offset((frame + COLOR_R) as isize) = r;
4105 *frames.offset((frame + COLOR_G) as isize) = g;
4106 *frames.offset((frame + COLOR_B) as isize) = b;
4107}
4108#[no_mangle]
4109pub unsafe extern "C" fn _spAlphaTimeline_apply(
4110 mut timeline: *mut spTimeline,
4111 mut skeleton: *mut spSkeleton,
4112 mut _lastTime: c_float,
4113 mut time: c_float,
4114 mut _firedEvents: *mut *mut spEvent,
4115 mut _eventsCount: *mut c_int,
4116 mut alpha: c_float,
4117 mut blend: spMixBlend,
4118 mut _direction: spMixDirection,
4119) {
4120 let mut slot: *mut spSlot = std::ptr::null_mut::<spSlot>();
4121 let mut a: c_float = 0.;
4122 let mut color: *mut spColor = std::ptr::null_mut::<spColor>();
4123 let mut setup: *mut spColor = std::ptr::null_mut::<spColor>();
4124 let mut self_0: *mut spAlphaTimeline = timeline.cast::<spAlphaTimeline>();
4125 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
4126 slot = *((*skeleton).slots).offset((*self_0).slotIndex as isize);
4127 if (*(*slot).bone).active == 0 {
4128 return;
4129 }
4130 if time < *frames.offset(0 as c_int as isize) {
4131 color = &mut (*slot).color;
4132 setup = &mut (*(*slot).data).color;
4133 match blend as c_uint {
4134 0 => {
4135 (*color).a = (*setup).a;
4136 return;
4137 }
4138 1 => {
4139 (*color).a += ((*setup).a - (*color).a) * alpha;
4140 }
4141 _ => {}
4142 }
4143 return;
4144 }
4145 a = spCurveTimeline1_getCurveValue(&mut (*self_0).super_0, time);
4146 if alpha == 1 as c_int as c_float {
4147 (*slot).color.a = a;
4148 } else {
4149 if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint {
4150 (*slot).color.a = (*(*slot).data).color.a;
4151 }
4152 (*slot).color.a += (a - (*slot).color.a) * alpha;
4153 };
4154}
4155#[no_mangle]
4156pub unsafe extern "C" fn spAlphaTimeline_create(
4157 mut frameCount: c_int,
4158 mut bezierCount: c_int,
4159 mut slotIndex: c_int,
4160) -> *mut spAlphaTimeline {
4161 let mut timeline: *mut spAlphaTimeline = _spCalloc(
4162 1 as c_int as size_t,
4163 ::core::mem::size_of::<spAlphaTimeline>() as c_ulong,
4164 (b"spine.c\0" as *const u8).cast::<c_char>(),
4165 1244 as c_int,
4166 )
4167 .cast::<spAlphaTimeline>();
4168 let mut ids: [spPropertyId; 1] = [0; 1];
4169 ids[0 as c_int as usize] =
4170 (SP_PROPERTY_ALPHA as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong;
4171 _spCurveTimeline_init(
4172 &mut (*timeline).super_0,
4173 frameCount,
4174 2 as c_int,
4175 bezierCount,
4176 ids.as_mut_ptr(),
4177 1 as c_int,
4178 SP_TIMELINE_ALPHA,
4179 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
4180 Some(
4181 _spAlphaTimeline_apply
4182 as unsafe extern "C" fn(
4183 *mut spTimeline,
4184 *mut spSkeleton,
4185 c_float,
4186 c_float,
4187 *mut *mut spEvent,
4188 *mut c_int,
4189 c_float,
4190 spMixBlend,
4191 spMixDirection,
4192 ) -> (),
4193 ),
4194 Some(
4195 _spCurveTimeline_setBezier
4196 as unsafe extern "C" fn(
4197 *mut spTimeline,
4198 c_int,
4199 c_int,
4200 c_float,
4201 c_float,
4202 c_float,
4203 c_float,
4204 c_float,
4205 c_float,
4206 c_float,
4207 c_float,
4208 c_float,
4209 ) -> (),
4210 ),
4211 );
4212 (*timeline).slotIndex = slotIndex;
4213 timeline
4214}
4215#[no_mangle]
4216pub unsafe extern "C" fn spAlphaTimeline_setFrame(
4217 mut self_0: *mut spAlphaTimeline,
4218 mut frame: c_int,
4219 mut time: c_float,
4220 mut alpha: c_float,
4221) {
4222 spCurveTimeline1_setFrame(&mut (*self_0).super_0, frame, time, alpha);
4223}
4224static mut RGBA2_ENTRIES: c_int = 8 as c_int;
4225static mut COLOR_R2: c_int = 5 as c_int;
4226static mut COLOR_G2: c_int = 6 as c_int;
4227static mut COLOR_B2: c_int = 7 as c_int;
4228#[no_mangle]
4229pub unsafe extern "C" fn _spRGBA2Timeline_apply(
4230 mut timeline: *mut spTimeline,
4231 mut skeleton: *mut spSkeleton,
4232 mut _lastTime: c_float,
4233 mut time: c_float,
4234 mut _firedEvents: *mut *mut spEvent,
4235 mut _eventsCount: *mut c_int,
4236 mut alpha: c_float,
4237 mut blend: spMixBlend,
4238 mut _direction: spMixDirection,
4239) {
4240 let mut slot: *mut spSlot = std::ptr::null_mut::<spSlot>();
4241 let mut i: c_int = 0;
4242 let mut curveType: c_int = 0;
4243 let mut r: c_float = 0.;
4244 let mut g: c_float = 0.;
4245 let mut b: c_float = 0.;
4246 let mut a: c_float = 0.;
4247 let mut r2: c_float = 0.;
4248 let mut g2: c_float = 0.;
4249 let mut b2: c_float = 0.;
4250 let mut t: c_float = 0.;
4251 let mut light: *mut spColor = std::ptr::null_mut::<spColor>();
4252 let mut setupLight: *mut spColor = std::ptr::null_mut::<spColor>();
4253 let mut dark: *mut spColor = std::ptr::null_mut::<spColor>();
4254 let mut setupDark: *mut spColor = std::ptr::null_mut::<spColor>();
4255 let mut self_0: *mut spRGBA2Timeline = timeline.cast::<spRGBA2Timeline>();
4256 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
4257 let mut curves: *mut c_float = (*(*self_0).super_0.curves).items;
4258 slot = *((*skeleton).slots).offset((*self_0).slotIndex as isize);
4259 if (*(*slot).bone).active == 0 {
4260 return;
4261 }
4262 if time < *frames.offset(0 as c_int as isize) {
4263 light = &mut (*slot).color;
4264 dark = (*slot).darkColor;
4265 setupLight = &mut (*(*slot).data).color;
4266 setupDark = (*(*slot).data).darkColor;
4267 match blend as c_uint {
4268 0 => {
4269 spColor_setFromColor(light, setupLight);
4270 spColor_setFromFloats3(dark, (*setupDark).r, (*setupDark).g, (*setupDark).b);
4271 return;
4272 }
4273 1 => {
4274 spColor_addFloats(
4275 light,
4276 ((*setupLight).r - (*light).r) * alpha,
4277 ((*setupLight).g - (*light).g) * alpha,
4278 ((*setupLight).b - (*light).b) * alpha,
4279 ((*setupLight).a - (*light).a) * alpha,
4280 );
4281 (*dark).r += ((*setupDark).r - (*dark).r) * alpha;
4282 (*dark).g += ((*setupDark).g - (*dark).g) * alpha;
4283 (*dark).b += ((*setupDark).b - (*dark).b) * alpha;
4284 }
4285 _ => {}
4286 }
4287 return;
4288 }
4289 r = 0 as c_int as c_float;
4290 g = 0 as c_int as c_float;
4291 b = 0 as c_int as c_float;
4292 a = 0 as c_int as c_float;
4293 r2 = 0 as c_int as c_float;
4294 g2 = 0 as c_int as c_float;
4295 b2 = 0 as c_int as c_float;
4296 i = search2((*self_0).super_0.super_0.frames, time, RGBA2_ENTRIES);
4297 curveType = *curves.offset((i / RGBA2_ENTRIES) as isize) as c_int;
4298 match curveType {
4299 0 => {
4300 let mut before: c_float = *frames.offset(i as isize);
4301 r = *frames.offset((i + COLOR_R) as isize);
4302 g = *frames.offset((i + COLOR_G) as isize);
4303 b = *frames.offset((i + COLOR_B) as isize);
4304 a = *frames.offset((i + COLOR_A) as isize);
4305 r2 = *frames.offset((i + COLOR_R2) as isize);
4306 g2 = *frames.offset((i + COLOR_G2) as isize);
4307 b2 = *frames.offset((i + COLOR_B2) as isize);
4308 t = (time - before) / (*frames.offset((i + RGBA2_ENTRIES) as isize) - before);
4309 r += (*frames.offset((i + RGBA2_ENTRIES + COLOR_R) as isize) - r) * t;
4310 g += (*frames.offset((i + RGBA2_ENTRIES + COLOR_G) as isize) - g) * t;
4311 b += (*frames.offset((i + RGBA2_ENTRIES + COLOR_B) as isize) - b) * t;
4312 a += (*frames.offset((i + RGBA2_ENTRIES + COLOR_A) as isize) - a) * t;
4313 r2 += (*frames.offset((i + RGBA2_ENTRIES + COLOR_R2) as isize) - r2) * t;
4314 g2 += (*frames.offset((i + RGBA2_ENTRIES + COLOR_G2) as isize) - g2) * t;
4315 b2 += (*frames.offset((i + RGBA2_ENTRIES + COLOR_B2) as isize) - b2) * t;
4316 }
4317 1 => {
4318 r = *frames.offset((i + COLOR_R) as isize);
4319 g = *frames.offset((i + COLOR_G) as isize);
4320 b = *frames.offset((i + COLOR_B) as isize);
4321 a = *frames.offset((i + COLOR_A) as isize);
4322 r2 = *frames.offset((i + COLOR_R2) as isize);
4323 g2 = *frames.offset((i + COLOR_G2) as isize);
4324 b2 = *frames.offset((i + COLOR_B2) as isize);
4325 }
4326 _ => {
4327 r = _spCurveTimeline_getBezierValue(
4328 &mut (*self_0).super_0,
4329 time,
4330 i,
4331 COLOR_R,
4332 curveType - 2 as c_int,
4333 );
4334 g = _spCurveTimeline_getBezierValue(
4335 &mut (*self_0).super_0,
4336 time,
4337 i,
4338 COLOR_G,
4339 curveType + 18 as c_int - 2 as c_int,
4340 );
4341 b = _spCurveTimeline_getBezierValue(
4342 &mut (*self_0).super_0,
4343 time,
4344 i,
4345 COLOR_B,
4346 curveType + 18 as c_int * 2 as c_int - 2 as c_int,
4347 );
4348 a = _spCurveTimeline_getBezierValue(
4349 &mut (*self_0).super_0,
4350 time,
4351 i,
4352 COLOR_A,
4353 curveType + 18 as c_int * 3 as c_int - 2 as c_int,
4354 );
4355 r2 = _spCurveTimeline_getBezierValue(
4356 &mut (*self_0).super_0,
4357 time,
4358 i,
4359 COLOR_R2,
4360 curveType + 18 as c_int * 4 as c_int - 2 as c_int,
4361 );
4362 g2 = _spCurveTimeline_getBezierValue(
4363 &mut (*self_0).super_0,
4364 time,
4365 i,
4366 COLOR_G2,
4367 curveType + 18 as c_int * 5 as c_int - 2 as c_int,
4368 );
4369 b2 = _spCurveTimeline_getBezierValue(
4370 &mut (*self_0).super_0,
4371 time,
4372 i,
4373 COLOR_B2,
4374 curveType + 18 as c_int * 6 as c_int - 2 as c_int,
4375 );
4376 }
4377 }
4378 light = &mut (*slot).color;
4379 dark = (*slot).darkColor;
4380 if alpha == 1 as c_int as c_float {
4381 spColor_setFromFloats(light, r, g, b, a);
4382 spColor_setFromFloats3(dark, r2, g2, b2);
4383 } else {
4384 if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint {
4385 spColor_setFromColor(light, &mut (*(*slot).data).color);
4386 spColor_setFromColor(dark, (*(*slot).data).darkColor);
4387 }
4388 spColor_addFloats(
4389 light,
4390 (r - (*light).r) * alpha,
4391 (g - (*light).g) * alpha,
4392 (b - (*light).b) * alpha,
4393 (a - (*light).a) * alpha,
4394 );
4395 (*dark).r += (r2 - (*dark).r) * alpha;
4396 (*dark).g += (g2 - (*dark).g) * alpha;
4397 (*dark).b += (b2 - (*dark).b) * alpha;
4398 };
4399}
4400#[no_mangle]
4401pub unsafe extern "C" fn spRGBA2Timeline_create(
4402 mut framesCount: c_int,
4403 mut bezierCount: c_int,
4404 mut slotIndex: c_int,
4405) -> *mut spRGBA2Timeline {
4406 let mut timeline: *mut spRGBA2Timeline = _spCalloc(
4407 1 as c_int as size_t,
4408 ::core::mem::size_of::<spRGBA2Timeline>() as c_ulong,
4409 (b"spine.c\0" as *const u8).cast::<c_char>(),
4410 1371 as c_int,
4411 )
4412 .cast::<spRGBA2Timeline>();
4413 let mut ids: [spPropertyId; 3] = [0; 3];
4414 ids[0 as c_int as usize] =
4415 (SP_PROPERTY_RGB as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong;
4416 ids[1 as c_int as usize] =
4417 (SP_PROPERTY_ALPHA as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong;
4418 ids[2 as c_int as usize] =
4419 (SP_PROPERTY_RGB2 as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong;
4420 _spCurveTimeline_init(
4421 &mut (*timeline).super_0,
4422 framesCount,
4423 RGBA2_ENTRIES,
4424 bezierCount,
4425 ids.as_mut_ptr(),
4426 3 as c_int,
4427 SP_TIMELINE_RGBA2,
4428 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
4429 Some(
4430 _spRGBA2Timeline_apply
4431 as unsafe extern "C" fn(
4432 *mut spTimeline,
4433 *mut spSkeleton,
4434 c_float,
4435 c_float,
4436 *mut *mut spEvent,
4437 *mut c_int,
4438 c_float,
4439 spMixBlend,
4440 spMixDirection,
4441 ) -> (),
4442 ),
4443 Some(
4444 _spCurveTimeline_setBezier
4445 as unsafe extern "C" fn(
4446 *mut spTimeline,
4447 c_int,
4448 c_int,
4449 c_float,
4450 c_float,
4451 c_float,
4452 c_float,
4453 c_float,
4454 c_float,
4455 c_float,
4456 c_float,
4457 c_float,
4458 ) -> (),
4459 ),
4460 );
4461 (*timeline).slotIndex = slotIndex;
4462 timeline
4463}
4464#[no_mangle]
4465pub unsafe extern "C" fn spRGBA2Timeline_setFrame(
4466 mut self_0: *mut spRGBA2Timeline,
4467 mut frame: c_int,
4468 mut time: c_float,
4469 mut r: c_float,
4470 mut g: c_float,
4471 mut b: c_float,
4472 mut a: c_float,
4473 mut r2: c_float,
4474 mut g2: c_float,
4475 mut b2: c_float,
4476) {
4477 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
4478 frame *= RGBA2_ENTRIES;
4479 *frames.offset(frame as isize) = time;
4480 *frames.offset((frame + COLOR_R) as isize) = r;
4481 *frames.offset((frame + COLOR_G) as isize) = g;
4482 *frames.offset((frame + COLOR_B) as isize) = b;
4483 *frames.offset((frame + COLOR_A) as isize) = a;
4484 *frames.offset((frame + COLOR_R2) as isize) = r2;
4485 *frames.offset((frame + COLOR_G2) as isize) = g2;
4486 *frames.offset((frame + COLOR_B2) as isize) = b2;
4487}
4488static mut RGB2_ENTRIES: c_int = 7 as c_int;
4489static mut COLOR2_R2: c_int = 5 as c_int;
4490static mut COLOR2_G2: c_int = 6 as c_int;
4491static mut COLOR2_B2: c_int = 7 as c_int;
4492#[no_mangle]
4493pub unsafe extern "C" fn _spRGB2Timeline_apply(
4494 mut timeline: *mut spTimeline,
4495 mut skeleton: *mut spSkeleton,
4496 mut _lastTime: c_float,
4497 mut time: c_float,
4498 mut _firedEvents: *mut *mut spEvent,
4499 mut _eventsCount: *mut c_int,
4500 mut alpha: c_float,
4501 mut blend: spMixBlend,
4502 mut _direction: spMixDirection,
4503) {
4504 let mut slot: *mut spSlot = std::ptr::null_mut::<spSlot>();
4505 let mut i: c_int = 0;
4506 let mut curveType: c_int = 0;
4507 let mut r: c_float = 0.;
4508 let mut g: c_float = 0.;
4509 let mut b: c_float = 0.;
4510 let mut r2: c_float = 0.;
4511 let mut g2: c_float = 0.;
4512 let mut b2: c_float = 0.;
4513 let mut t: c_float = 0.;
4514 let mut light: *mut spColor = std::ptr::null_mut::<spColor>();
4515 let mut setupLight: *mut spColor = std::ptr::null_mut::<spColor>();
4516 let mut dark: *mut spColor = std::ptr::null_mut::<spColor>();
4517 let mut setupDark: *mut spColor = std::ptr::null_mut::<spColor>();
4518 let mut self_0: *mut spRGB2Timeline = timeline.cast::<spRGB2Timeline>();
4519 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
4520 let mut curves: *mut c_float = (*(*self_0).super_0.curves).items;
4521 slot = *((*skeleton).slots).offset((*self_0).slotIndex as isize);
4522 if (*(*slot).bone).active == 0 {
4523 return;
4524 }
4525 if time < *frames.offset(0 as c_int as isize) {
4526 light = &mut (*slot).color;
4527 dark = (*slot).darkColor;
4528 setupLight = &mut (*(*slot).data).color;
4529 setupDark = (*(*slot).data).darkColor;
4530 match blend as c_uint {
4531 0 => {
4532 spColor_setFromColor3(light, setupLight);
4533 spColor_setFromColor3(dark, setupDark);
4534 return;
4535 }
4536 1 => {
4537 spColor_addFloats3(
4538 light,
4539 ((*setupLight).r - (*light).r) * alpha,
4540 ((*setupLight).g - (*light).g) * alpha,
4541 ((*setupLight).b - (*light).b) * alpha,
4542 );
4543 (*dark).r += ((*setupDark).r - (*dark).r) * alpha;
4544 (*dark).g += ((*setupDark).g - (*dark).g) * alpha;
4545 (*dark).b += ((*setupDark).b - (*dark).b) * alpha;
4546 }
4547 _ => {}
4548 }
4549 return;
4550 }
4551 r = 0 as c_int as c_float;
4552 g = 0 as c_int as c_float;
4553 b = 0 as c_int as c_float;
4554 r2 = 0 as c_int as c_float;
4555 g2 = 0 as c_int as c_float;
4556 b2 = 0 as c_int as c_float;
4557 i = search2((*self_0).super_0.super_0.frames, time, RGB2_ENTRIES);
4558 curveType = *curves.offset((i / RGB2_ENTRIES) as isize) as c_int;
4559 match curveType {
4560 0 => {
4561 let mut before: c_float = *frames.offset(i as isize);
4562 r = *frames.offset((i + COLOR_R) as isize);
4563 g = *frames.offset((i + COLOR_G) as isize);
4564 b = *frames.offset((i + COLOR_B) as isize);
4565 r2 = *frames.offset((i + COLOR2_R2) as isize);
4566 g2 = *frames.offset((i + COLOR2_G2) as isize);
4567 b2 = *frames.offset((i + COLOR2_B2) as isize);
4568 t = (time - before) / (*frames.offset((i + RGB2_ENTRIES) as isize) - before);
4569 r += (*frames.offset((i + RGB2_ENTRIES + COLOR_R) as isize) - r) * t;
4570 g += (*frames.offset((i + RGB2_ENTRIES + COLOR_G) as isize) - g) * t;
4571 b += (*frames.offset((i + RGB2_ENTRIES + COLOR_B) as isize) - b) * t;
4572 r2 += (*frames.offset((i + RGB2_ENTRIES + COLOR2_R2) as isize) - r2) * t;
4573 g2 += (*frames.offset((i + RGB2_ENTRIES + COLOR2_G2) as isize) - g2) * t;
4574 b2 += (*frames.offset((i + RGB2_ENTRIES + COLOR2_B2) as isize) - b2) * t;
4575 }
4576 1 => {
4577 r = *frames.offset((i + COLOR_R) as isize);
4578 g = *frames.offset((i + COLOR_G) as isize);
4579 b = *frames.offset((i + COLOR_B) as isize);
4580 r2 = *frames.offset((i + COLOR2_R2) as isize);
4581 g2 = *frames.offset((i + COLOR2_G2) as isize);
4582 b2 = *frames.offset((i + COLOR2_B2) as isize);
4583 }
4584 _ => {
4585 r = _spCurveTimeline_getBezierValue(
4586 &mut (*self_0).super_0,
4587 time,
4588 i,
4589 COLOR_R,
4590 curveType - 2 as c_int,
4591 );
4592 g = _spCurveTimeline_getBezierValue(
4593 &mut (*self_0).super_0,
4594 time,
4595 i,
4596 COLOR_G,
4597 curveType + 18 as c_int - 2 as c_int,
4598 );
4599 b = _spCurveTimeline_getBezierValue(
4600 &mut (*self_0).super_0,
4601 time,
4602 i,
4603 COLOR_B,
4604 curveType + 18 as c_int * 2 as c_int - 2 as c_int,
4605 );
4606 r2 = _spCurveTimeline_getBezierValue(
4607 &mut (*self_0).super_0,
4608 time,
4609 i,
4610 COLOR2_R2,
4611 curveType + 18 as c_int * 3 as c_int - 2 as c_int,
4612 );
4613 g2 = _spCurveTimeline_getBezierValue(
4614 &mut (*self_0).super_0,
4615 time,
4616 i,
4617 COLOR2_G2,
4618 curveType + 18 as c_int * 4 as c_int - 2 as c_int,
4619 );
4620 b2 = _spCurveTimeline_getBezierValue(
4621 &mut (*self_0).super_0,
4622 time,
4623 i,
4624 COLOR2_B2,
4625 curveType + 18 as c_int * 5 as c_int - 2 as c_int,
4626 );
4627 }
4628 }
4629 light = &mut (*slot).color;
4630 dark = (*slot).darkColor;
4631 if alpha == 1 as c_int as c_float {
4632 spColor_setFromFloats3(light, r, g, b);
4633 spColor_setFromFloats3(dark, r2, g2, b2);
4634 } else {
4635 if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint {
4636 spColor_setFromColor3(light, &mut (*(*slot).data).color);
4637 spColor_setFromColor3(dark, (*(*slot).data).darkColor);
4638 }
4639 spColor_addFloats3(
4640 light,
4641 (r - (*light).r) * alpha,
4642 (g - (*light).g) * alpha,
4643 (b - (*light).b) * alpha,
4644 );
4645 (*dark).r += (r2 - (*dark).r) * alpha;
4646 (*dark).g += (g2 - (*dark).g) * alpha;
4647 (*dark).b += (b2 - (*dark).b) * alpha;
4648 };
4649}
4650#[no_mangle]
4651pub unsafe extern "C" fn spRGB2Timeline_create(
4652 mut framesCount: c_int,
4653 mut bezierCount: c_int,
4654 mut slotIndex: c_int,
4655) -> *mut spRGB2Timeline {
4656 let mut timeline: *mut spRGB2Timeline = _spCalloc(
4657 1 as c_int as size_t,
4658 ::core::mem::size_of::<spRGB2Timeline>() as c_ulong,
4659 (b"spine.c\0" as *const u8).cast::<c_char>(),
4660 1504 as c_int,
4661 )
4662 .cast::<spRGB2Timeline>();
4663 let mut ids: [spPropertyId; 2] = [0; 2];
4664 ids[0 as c_int as usize] =
4665 (SP_PROPERTY_RGB as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong;
4666 ids[1 as c_int as usize] =
4667 (SP_PROPERTY_RGB2 as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong;
4668 _spCurveTimeline_init(
4669 &mut (*timeline).super_0,
4670 framesCount,
4671 RGB2_ENTRIES,
4672 bezierCount,
4673 ids.as_mut_ptr(),
4674 2 as c_int,
4675 SP_TIMELINE_RGB2,
4676 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
4677 Some(
4678 _spRGB2Timeline_apply
4679 as unsafe extern "C" fn(
4680 *mut spTimeline,
4681 *mut spSkeleton,
4682 c_float,
4683 c_float,
4684 *mut *mut spEvent,
4685 *mut c_int,
4686 c_float,
4687 spMixBlend,
4688 spMixDirection,
4689 ) -> (),
4690 ),
4691 Some(
4692 _spCurveTimeline_setBezier
4693 as unsafe extern "C" fn(
4694 *mut spTimeline,
4695 c_int,
4696 c_int,
4697 c_float,
4698 c_float,
4699 c_float,
4700 c_float,
4701 c_float,
4702 c_float,
4703 c_float,
4704 c_float,
4705 c_float,
4706 ) -> (),
4707 ),
4708 );
4709 (*timeline).slotIndex = slotIndex;
4710 timeline
4711}
4712#[no_mangle]
4713pub unsafe extern "C" fn spRGB2Timeline_setFrame(
4714 mut self_0: *mut spRGB2Timeline,
4715 mut frame: c_int,
4716 mut time: c_float,
4717 mut r: c_float,
4718 mut g: c_float,
4719 mut b: c_float,
4720 mut r2: c_float,
4721 mut g2: c_float,
4722 mut b2: c_float,
4723) {
4724 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
4725 frame *= RGB2_ENTRIES;
4726 *frames.offset(frame as isize) = time;
4727 *frames.offset((frame + COLOR_R) as isize) = r;
4728 *frames.offset((frame + COLOR_G) as isize) = g;
4729 *frames.offset((frame + COLOR_B) as isize) = b;
4730 *frames.offset((frame + COLOR2_R2) as isize) = r2;
4731 *frames.offset((frame + COLOR2_G2) as isize) = g2;
4732 *frames.offset((frame + COLOR2_B2) as isize) = b2;
4733}
4734unsafe extern "C" fn _spSetAttachment(
4735 mut timeline: *mut spAttachmentTimeline,
4736 mut skeleton: *mut spSkeleton,
4737 mut slot: *mut spSlot,
4738 mut attachmentName: *const c_char,
4739) {
4740 spSlot_setAttachment(
4741 slot,
4742 if attachmentName.is_null() {
4743 std::ptr::null_mut::<spAttachment>()
4744 } else {
4745 spSkeleton_getAttachmentForSlotIndex(skeleton, (*timeline).slotIndex, attachmentName)
4746 },
4747 );
4748}
4749#[no_mangle]
4750pub unsafe extern "C" fn _spAttachmentTimeline_apply(
4751 mut timeline: *mut spTimeline,
4752 mut skeleton: *mut spSkeleton,
4753 mut _lastTime: c_float,
4754 mut time: c_float,
4755 mut _firedEvents: *mut *mut spEvent,
4756 mut _eventsCount: *mut c_int,
4757 mut _alpha: c_float,
4758 mut blend: spMixBlend,
4759 mut direction: spMixDirection,
4760) {
4761 let mut attachmentName: *const c_char = std::ptr::null::<c_char>();
4762 let mut self_0: *mut spAttachmentTimeline = timeline.cast::<spAttachmentTimeline>();
4763 let mut frames: *mut c_float = (*(*self_0).super_0.frames).items;
4764 let mut slot: *mut spSlot = *((*skeleton).slots).offset((*self_0).slotIndex as isize);
4765 if (*(*slot).bone).active == 0 {
4766 return;
4767 }
4768 if direction as c_uint == SP_MIX_DIRECTION_OUT as c_int as c_uint {
4769 if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint {
4770 _spSetAttachment(self_0, skeleton, slot, (*(*slot).data).attachmentName);
4771 }
4772 return;
4773 }
4774 if time < *frames.offset(0 as c_int as isize) {
4775 if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint
4776 || blend as c_uint == SP_MIX_BLEND_FIRST as c_int as c_uint
4777 {
4778 _spSetAttachment(self_0, skeleton, slot, (*(*slot).data).attachmentName);
4779 }
4780 return;
4781 }
4782 if time < *frames.offset(0 as c_int as isize) {
4783 if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint
4784 || blend as c_uint == SP_MIX_BLEND_FIRST as c_int as c_uint
4785 {
4786 _spSetAttachment(self_0, skeleton, slot, (*(*slot).data).attachmentName);
4787 }
4788 return;
4789 }
4790 attachmentName =
4791 *((*self_0).attachmentNames).offset(search((*self_0).super_0.frames, time) as isize);
4792 _spSetAttachment(self_0, skeleton, slot, attachmentName);
4793}
4794#[no_mangle]
4795pub unsafe extern "C" fn _spAttachmentTimeline_dispose(mut timeline: *mut spTimeline) {
4796 let mut self_0: *mut spAttachmentTimeline = timeline.cast::<spAttachmentTimeline>();
4797 let mut i: c_int = 0;
4798 i = 0 as c_int;
4799 while i < (*(*self_0).super_0.frames).size {
4800 _spFree((*((*self_0).attachmentNames).offset(i as isize)).cast::<c_void>());
4801 i += 1;
4802 }
4803 _spFree((*self_0).attachmentNames.cast::<c_void>());
4804}
4805#[no_mangle]
4806pub unsafe extern "C" fn spAttachmentTimeline_create(
4807 mut framesCount: c_int,
4808 mut slotIndex: c_int,
4809) -> *mut spAttachmentTimeline {
4810 let mut self_0: *mut spAttachmentTimeline = _spCalloc(
4811 1 as c_int as size_t,
4812 ::core::mem::size_of::<spAttachmentTimeline>() as c_ulong,
4813 (b"spine.c\0" as *const u8).cast::<c_char>(),
4814 1581 as c_int,
4815 )
4816 .cast::<spAttachmentTimeline>();
4817 let mut ids: [spPropertyId; 1] = [0; 1];
4818 ids[0 as c_int as usize] =
4819 (SP_PROPERTY_ATTACHMENT as c_int as spPropertyId) << 32 as c_int | slotIndex as c_ulong;
4820 _spTimeline_init(
4821 &mut (*self_0).super_0,
4822 framesCount,
4823 1 as c_int,
4824 ids.as_mut_ptr(),
4825 1 as c_int,
4826 SP_TIMELINE_ATTACHMENT,
4827 Some(_spAttachmentTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
4828 Some(
4829 _spAttachmentTimeline_apply
4830 as unsafe extern "C" fn(
4831 *mut spTimeline,
4832 *mut spSkeleton,
4833 c_float,
4834 c_float,
4835 *mut *mut spEvent,
4836 *mut c_int,
4837 c_float,
4838 spMixBlend,
4839 spMixDirection,
4840 ) -> (),
4841 ),
4842 None,
4843 );
4844 (*self_0).attachmentNames = _spCalloc(
4845 framesCount as size_t,
4846 ::core::mem::size_of::<*mut c_char>() as c_ulong,
4847 (b"spine.c\0" as *const u8).cast::<c_char>(),
4848 1586 as c_int,
4849 )
4850 .cast::<*mut c_char>();
4851 (*self_0).slotIndex = slotIndex;
4852 self_0
4853}
4854#[no_mangle]
4855pub unsafe extern "C" fn spAttachmentTimeline_setFrame(
4856 mut self_0: *mut spAttachmentTimeline,
4857 mut frame: c_int,
4858 mut time: c_float,
4859 mut attachmentName: *const c_char,
4860) {
4861 *((*(*self_0).super_0.frames).items).offset(frame as isize) = time;
4862 _spFree((*((*self_0).attachmentNames).offset(frame as isize)).cast::<c_void>());
4863 if !attachmentName.is_null() {
4864 let fresh3 = &mut (*((*self_0).attachmentNames).offset(frame as isize));
4865 *fresh3 = _spMalloc(
4866 (::core::mem::size_of::<c_char>() as c_ulong)
4867 .wrapping_mul((spine_strlen(attachmentName)).wrapping_add(1 as c_int as c_ulong)),
4868 (b"spine.c\0" as *const u8).cast::<c_char>(),
4869 1596 as c_int,
4870 )
4871 .cast::<c_char>();
4872 spine_strcpy(*fresh3, attachmentName);
4873 } else {
4874 let fresh4 = &mut (*((*self_0).attachmentNames).offset(frame as isize));
4875 *fresh4 = std::ptr::null_mut::<c_char>();
4876 };
4877}
4878#[no_mangle]
4879pub unsafe extern "C" fn _spDeformTimeline_setBezier(
4880 mut timeline: *mut spTimeline,
4881 mut bezier: c_int,
4882 mut frame: c_int,
4883 mut value: c_float,
4884 mut time1: c_float,
4885 mut _value1: c_float,
4886 mut cx1: c_float,
4887 mut cy1: c_float,
4888 mut cx2: c_float,
4889 mut cy2: c_float,
4890 mut time2: c_float,
4891 mut _value2: c_float,
4892) {
4893 let mut self_0: *mut spDeformTimeline = timeline.cast::<spDeformTimeline>();
4894 let mut n: c_int = 0;
4895 let mut i: c_int = (*self_0).super_0.super_0.frameCount + bezier * 18 as c_int;
4896 let mut curves: *mut c_float = (*(*self_0).super_0.curves).items;
4897 let mut tmpx: c_float =
4898 ((time1 - cx1 * 2 as c_int as c_float + cx2) as c_double * 0.03f64) as c_float;
4899 let mut tmpy: c_float = (cy2 as c_double * 0.03f64 - cy1 as c_double * 0.06f64) as c_float;
4900 let mut dddx: c_float =
4901 (((cx1 - cx2) * 3 as c_int as c_float - time1 + time2) as c_double * 0.006f64) as c_float;
4902 let mut dddy: c_float = (((cy1 - cy2) as c_double + 0.33333333f64) * 0.018f64) as c_float;
4903 let mut ddx: c_float = tmpx * 2 as c_int as c_float + dddx;
4904 let mut ddy: c_float = tmpy * 2 as c_int as c_float + dddy;
4905 let mut dx: c_float = ((cx1 - time1) as c_double * 0.3f64
4906 + tmpx as c_double
4907 + dddx as c_double * 0.16666667f64) as c_float;
4908 let mut dy: c_float =
4909 (cy1 as c_double * 0.3f64 + tmpy as c_double + dddy as c_double * 0.16666667f64) as c_float;
4910 let mut x: c_float = time1 + dx;
4911 let mut y: c_float = dy;
4912 if value == 0 as c_int as c_float {
4913 *curves.offset(frame as isize) = (2 as c_int + i) as c_float;
4914 }
4915 n = i + 18 as c_int;
4916 while i < n {
4917 *curves.offset(i as isize) = x;
4918 *curves.offset((i + 1 as c_int) as isize) = y;
4919 dx += ddx;
4920 dy += ddy;
4921 ddx += dddx;
4922 ddy += dddy;
4923 x += dx;
4924 y += dy;
4925 i += 2 as c_int;
4926 }
4927}
4928#[no_mangle]
4929pub unsafe extern "C" fn _spDeformTimeline_getCurvePercent(
4930 mut self_0: *mut spDeformTimeline,
4931 mut time: c_float,
4932 mut frame: c_int,
4933) -> c_float {
4934 let mut curves: *mut c_float = (*(*self_0).super_0.curves).items;
4935 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
4936 let mut n: c_int = 0;
4937 let mut i: c_int = *curves.offset(frame as isize) as c_int;
4938 let mut frameEntries: c_int = (*self_0).super_0.super_0.frameEntries;
4939 let mut x: c_float = 0.;
4940 let mut y: c_float = 0.;
4941 match i {
4942 0 => {
4943 x = *frames.offset(frame as isize);
4944 return (time - x) / (*frames.offset((frame + frameEntries) as isize) - x);
4945 }
4946 1 => return 0 as c_int as c_float,
4947 _ => {}
4948 }
4949 i -= 2 as c_int;
4950 if *curves.offset(i as isize) > time {
4951 x = *frames.offset(frame as isize);
4952 return *curves.offset((i + 1 as c_int) as isize) * (time - x)
4953 / (*curves.offset(i as isize) - x);
4954 }
4955 n = i + 18 as c_int;
4956 i += 2 as c_int;
4957 while i < n {
4958 if *curves.offset(i as isize) >= time {
4959 x = *curves.offset((i - 2 as c_int) as isize);
4960 y = *curves.offset((i - 1 as c_int) as isize);
4961 return y
4962 + (time - x) / (*curves.offset(i as isize) - x)
4963 * (*curves.offset((i + 1 as c_int) as isize) - y);
4964 }
4965 i += 2 as c_int;
4966 }
4967 x = *curves.offset((n - 2 as c_int) as isize);
4968 y = *curves.offset((n - 1 as c_int) as isize);
4969 y + (1 as c_int as c_float - y) * (time - x)
4970 / (*frames.offset((frame + frameEntries) as isize) - x)
4971}
4972#[no_mangle]
4973pub unsafe extern "C" fn _spDeformTimeline_apply(
4974 mut timeline: *mut spTimeline,
4975 mut skeleton: *mut spSkeleton,
4976 mut _lastTime: c_float,
4977 mut time: c_float,
4978 mut _firedEvents: *mut *mut spEvent,
4979 mut _eventsCount: *mut c_int,
4980 mut alpha: c_float,
4981 mut blend: spMixBlend,
4982 mut _direction: spMixDirection,
4983) {
4984 let mut frame: c_int = 0;
4985 let mut i: c_int = 0;
4986 let mut vertexCount: c_int = 0;
4987 let mut percent: c_float = 0.;
4988 let mut prevVertices: *const c_float = std::ptr::null::<c_float>();
4989 let mut nextVertices: *const c_float = std::ptr::null::<c_float>();
4990 let mut frames: *mut c_float = std::ptr::null_mut::<c_float>();
4991 let mut framesCount: c_int = 0;
4992 let mut frameVertices: *mut *mut c_float = std::ptr::null_mut::<*mut c_float>();
4993 let mut deformArray: *mut c_float = std::ptr::null_mut::<c_float>();
4994 let mut self_0: *mut spDeformTimeline = timeline.cast::<spDeformTimeline>();
4995 let mut slot: *mut spSlot = *((*skeleton).slots).offset((*self_0).slotIndex as isize);
4996 if (*(*slot).bone).active == 0 {
4997 return;
4998 }
4999 if ((*slot).attachment).is_null() {
5000 return;
5001 }
5002 match (*(*slot).attachment).type_0 as c_uint {
5003 1 | 6 | 2 | 4 => {
5004 let mut vertexAttachment: *mut spVertexAttachment =
5005 (*slot).attachment.cast::<spVertexAttachment>();
5006 if (*vertexAttachment).timelineAttachment != (*self_0).attachment {
5007 return;
5008 }
5009 }
5010 _ => return,
5011 }
5012 frames = (*(*self_0).super_0.super_0.frames).items;
5013 framesCount = (*(*self_0).super_0.super_0.frames).size;
5014 vertexCount = (*self_0).frameVerticesCount;
5015 if (*slot).deformCount < vertexCount && (*slot).deformCapacity < vertexCount {
5016 _spFree((*slot).deform.cast::<c_void>());
5017 (*slot).deform = _spMalloc(
5018 (::core::mem::size_of::<c_float>() as c_ulong).wrapping_mul(vertexCount as c_ulong),
5019 (b"spine.c\0" as *const u8).cast::<c_char>(),
5020 1699 as c_int,
5021 )
5022 .cast::<c_float>();
5023 (*slot).deformCapacity = vertexCount;
5024 }
5025 if (*slot).deformCount == 0 as c_int {
5026 blend = SP_MIX_BLEND_SETUP;
5027 }
5028 frameVertices = (*self_0).frameVertices;
5029 deformArray = (*slot).deform;
5030 if time < *frames.offset(0 as c_int as isize) {
5031 let mut vertexAttachment_0: *mut spVertexAttachment =
5032 (*slot).attachment.cast::<spVertexAttachment>();
5033 match blend as c_uint {
5034 0 => {
5035 (*slot).deformCount = 0 as c_int;
5036 return;
5037 }
5038 1 => {
5039 if alpha == 1 as c_int as c_float {
5040 (*slot).deformCount = 0 as c_int;
5041 return;
5042 }
5043 (*slot).deformCount = vertexCount;
5044 if ((*vertexAttachment_0).bones).is_null() {
5045 let mut setupVertices: *mut c_float = (*vertexAttachment_0).vertices;
5046 i = 0 as c_int;
5047 while i < vertexCount {
5048 *deformArray.offset(i as isize) += (*setupVertices.offset(i as isize)
5049 - *deformArray.offset(i as isize))
5050 * alpha;
5051 i += 1;
5052 }
5053 } else {
5054 alpha = 1 as c_int as c_float - alpha;
5055 i = 0 as c_int;
5056 while i < vertexCount {
5057 *deformArray.offset(i as isize) *= alpha;
5058 i += 1;
5059 }
5060 }
5061 }
5062 2 | 3 | _ => {}
5063 }
5064 return;
5065 }
5066 (*slot).deformCount = vertexCount;
5067 if time >= *frames.offset((framesCount - 1 as c_int) as isize) {
5068 let mut lastVertices: *const c_float =
5069 *((*self_0).frameVertices).offset((framesCount - 1 as c_int) as isize);
5070 if alpha == 1 as c_int as c_float {
5071 if blend as c_uint == SP_MIX_BLEND_ADD as c_int as c_uint {
5072 let mut vertexAttachment_1: *mut spVertexAttachment =
5073 (*slot).attachment.cast::<spVertexAttachment>();
5074 if ((*vertexAttachment_1).bones).is_null() {
5075 let mut setupVertices_0: *mut c_float = (*vertexAttachment_1).vertices;
5076 i = 0 as c_int;
5077 while i < vertexCount {
5078 *deformArray.offset(i as isize) +=
5079 *lastVertices.offset(i as isize) - *setupVertices_0.offset(i as isize);
5080 i += 1;
5081 }
5082 } else {
5083 i = 0 as c_int;
5084 while i < vertexCount {
5085 *deformArray.offset(i as isize) += *lastVertices.offset(i as isize);
5086 i += 1;
5087 }
5088 }
5089 } else {
5090 spine_memcpy(
5091 deformArray.cast::<c_void>(),
5092 lastVertices.cast::<c_void>(),
5093 (vertexCount as c_ulong)
5094 .wrapping_mul(::core::mem::size_of::<c_float>() as c_ulong),
5095 );
5096 }
5097 } else {
5098 let mut vertexAttachment_2: *mut spVertexAttachment =
5099 std::ptr::null_mut::<spVertexAttachment>();
5100 match blend as c_uint {
5101 0 => {
5102 vertexAttachment_2 = (*slot).attachment.cast::<spVertexAttachment>();
5103 if ((*vertexAttachment_2).bones).is_null() {
5104 let mut setupVertices_1: *mut c_float = (*vertexAttachment_2).vertices;
5105 i = 0 as c_int;
5106 while i < vertexCount {
5107 let mut setup: c_float = *setupVertices_1.offset(i as isize);
5108 *deformArray.offset(i as isize) =
5109 setup + (*lastVertices.offset(i as isize) - setup) * alpha;
5110 i += 1;
5111 }
5112 } else {
5113 i = 0 as c_int;
5114 while i < vertexCount {
5115 *deformArray.offset(i as isize) =
5116 *lastVertices.offset(i as isize) * alpha;
5117 i += 1;
5118 }
5119 }
5120 }
5121 1 | 2 => {
5122 i = 0 as c_int;
5123 while i < vertexCount {
5124 *deformArray.offset(i as isize) += (*lastVertices.offset(i as isize)
5125 - *deformArray.offset(i as isize))
5126 * alpha;
5127 i += 1;
5128 }
5129 }
5130 3 => {
5131 vertexAttachment_2 = (*slot).attachment.cast::<spVertexAttachment>();
5132 if ((*vertexAttachment_2).bones).is_null() {
5133 let mut setupVertices_2: *mut c_float = (*vertexAttachment_2).vertices;
5134 i = 0 as c_int;
5135 while i < vertexCount {
5136 *deformArray.offset(i as isize) += (*lastVertices.offset(i as isize)
5137 - *setupVertices_2.offset(i as isize))
5138 * alpha;
5139 i += 1;
5140 }
5141 } else {
5142 i = 0 as c_int;
5143 while i < vertexCount {
5144 *deformArray.offset(i as isize) +=
5145 *lastVertices.offset(i as isize) * alpha;
5146 i += 1;
5147 }
5148 }
5149 }
5150 _ => {}
5151 }
5152 }
5153 return;
5154 }
5155 frame = search((*self_0).super_0.super_0.frames, time);
5156 percent = _spDeformTimeline_getCurvePercent(self_0, time, frame);
5157 prevVertices = *frameVertices.offset(frame as isize);
5158 nextVertices = *frameVertices.offset((frame + 1 as c_int) as isize);
5159 if alpha == 1 as c_int as c_float {
5160 if blend as c_uint == SP_MIX_BLEND_ADD as c_int as c_uint {
5161 let mut vertexAttachment_3: *mut spVertexAttachment =
5162 (*slot).attachment.cast::<spVertexAttachment>();
5163 if ((*vertexAttachment_3).bones).is_null() {
5164 let mut setupVertices_3: *mut c_float = (*vertexAttachment_3).vertices;
5165 i = 0 as c_int;
5166 while i < vertexCount {
5167 let mut prev: c_float = *prevVertices.offset(i as isize);
5168 *deformArray.offset(i as isize) += prev
5169 + (*nextVertices.offset(i as isize) - prev) * percent
5170 - *setupVertices_3.offset(i as isize);
5171 i += 1;
5172 }
5173 } else {
5174 i = 0 as c_int;
5175 while i < vertexCount {
5176 let mut prev_0: c_float = *prevVertices.offset(i as isize);
5177 *deformArray.offset(i as isize) +=
5178 prev_0 + (*nextVertices.offset(i as isize) - prev_0) * percent;
5179 i += 1;
5180 }
5181 }
5182 } else {
5183 i = 0 as c_int;
5184 while i < vertexCount {
5185 let mut prev_1: c_float = *prevVertices.offset(i as isize);
5186 *deformArray.offset(i as isize) =
5187 prev_1 + (*nextVertices.offset(i as isize) - prev_1) * percent;
5188 i += 1;
5189 }
5190 }
5191 } else {
5192 let mut vertexAttachment_4: *mut spVertexAttachment =
5193 std::ptr::null_mut::<spVertexAttachment>();
5194 match blend as c_uint {
5195 0 => {
5196 vertexAttachment_4 = (*slot).attachment.cast::<spVertexAttachment>();
5197 if ((*vertexAttachment_4).bones).is_null() {
5198 let mut setupVertices_4: *mut c_float = (*vertexAttachment_4).vertices;
5199 i = 0 as c_int;
5200 while i < vertexCount {
5201 let mut prev_2: c_float = *prevVertices.offset(i as isize);
5202 let mut setup_0: c_float = *setupVertices_4.offset(i as isize);
5203 *deformArray.offset(i as isize) = setup_0
5204 + (prev_2 + (*nextVertices.offset(i as isize) - prev_2) * percent
5205 - setup_0)
5206 * alpha;
5207 i += 1;
5208 }
5209 } else {
5210 i = 0 as c_int;
5211 while i < vertexCount {
5212 let mut prev_3: c_float = *prevVertices.offset(i as isize);
5213 *deformArray.offset(i as isize) = (prev_3
5214 + (*nextVertices.offset(i as isize) - prev_3) * percent)
5215 * alpha;
5216 i += 1;
5217 }
5218 }
5219 }
5220 1 | 2 => {
5221 i = 0 as c_int;
5222 while i < vertexCount {
5223 let mut prev_4: c_float = *prevVertices.offset(i as isize);
5224 *deformArray.offset(i as isize) += (prev_4
5225 + (*nextVertices.offset(i as isize) - prev_4) * percent
5226 - *deformArray.offset(i as isize))
5227 * alpha;
5228 i += 1;
5229 }
5230 }
5231 3 => {
5232 vertexAttachment_4 = (*slot).attachment.cast::<spVertexAttachment>();
5233 if ((*vertexAttachment_4).bones).is_null() {
5234 let mut setupVertices_5: *mut c_float = (*vertexAttachment_4).vertices;
5235 i = 0 as c_int;
5236 while i < vertexCount {
5237 let mut prev_5: c_float = *prevVertices.offset(i as isize);
5238 *deformArray.offset(i as isize) += (prev_5
5239 + (*nextVertices.offset(i as isize) - prev_5) * percent
5240 - *setupVertices_5.offset(i as isize))
5241 * alpha;
5242 i += 1;
5243 }
5244 } else {
5245 i = 0 as c_int;
5246 while i < vertexCount {
5247 let mut prev_6: c_float = *prevVertices.offset(i as isize);
5248 *deformArray.offset(i as isize) += (prev_6
5249 + (*nextVertices.offset(i as isize) - prev_6) * percent)
5250 * alpha;
5251 i += 1;
5252 }
5253 }
5254 }
5255 _ => {}
5256 }
5257 };
5258}
5259#[no_mangle]
5260pub unsafe extern "C" fn _spDeformTimeline_dispose(mut timeline: *mut spTimeline) {
5261 let mut self_0: *mut spDeformTimeline = timeline.cast::<spDeformTimeline>();
5262 let mut i: c_int = 0;
5263 i = 0 as c_int;
5264 while i < (*(*self_0).super_0.super_0.frames).size {
5265 _spFree((*((*self_0).frameVertices).offset(i as isize)).cast::<c_void>());
5266 i += 1;
5267 }
5268 _spFree((*self_0).frameVertices.cast::<c_void>());
5269 _spCurveTimeline_dispose(timeline);
5270}
5271#[no_mangle]
5272pub unsafe extern "C" fn spDeformTimeline_create(
5273 mut framesCount: c_int,
5274 mut frameVerticesCount: c_int,
5275 mut bezierCount: c_int,
5276 mut slotIndex: c_int,
5277 mut attachment: *mut spVertexAttachment,
5278) -> *mut spDeformTimeline {
5279 let mut self_0: *mut spDeformTimeline = _spCalloc(
5280 1 as c_int as size_t,
5281 ::core::mem::size_of::<spDeformTimeline>() as c_ulong,
5282 (b"spine.c\0" as *const u8).cast::<c_char>(),
5283 1885 as c_int,
5284 )
5285 .cast::<spDeformTimeline>();
5286 let mut ids: [spPropertyId; 1] = [0; 1];
5287 ids[0 as c_int as usize] = (SP_PROPERTY_DEFORM as c_int as spPropertyId) << 32 as c_int
5288 | ((slotIndex << 16 as c_int | (*attachment).id) as c_uint & 0xffffffff as c_uint)
5289 as c_ulong;
5290 _spCurveTimeline_init(
5291 &mut (*self_0).super_0,
5292 framesCount,
5293 1 as c_int,
5294 bezierCount,
5295 ids.as_mut_ptr(),
5296 1 as c_int,
5297 SP_TIMELINE_DEFORM,
5298 Some(_spDeformTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
5299 Some(
5300 _spDeformTimeline_apply
5301 as unsafe extern "C" fn(
5302 *mut spTimeline,
5303 *mut spSkeleton,
5304 c_float,
5305 c_float,
5306 *mut *mut spEvent,
5307 *mut c_int,
5308 c_float,
5309 spMixBlend,
5310 spMixDirection,
5311 ) -> (),
5312 ),
5313 Some(
5314 _spDeformTimeline_setBezier
5315 as unsafe extern "C" fn(
5316 *mut spTimeline,
5317 c_int,
5318 c_int,
5319 c_float,
5320 c_float,
5321 c_float,
5322 c_float,
5323 c_float,
5324 c_float,
5325 c_float,
5326 c_float,
5327 c_float,
5328 ) -> (),
5329 ),
5330 );
5331 (*self_0).frameVertices = _spCalloc(
5332 framesCount as size_t,
5333 ::core::mem::size_of::<*mut c_float>() as c_ulong,
5334 (b"spine.c\0" as *const u8).cast::<c_char>(),
5335 1890 as c_int,
5336 )
5337 .cast::<*mut c_float>();
5338 (*self_0).frameVerticesCount = frameVerticesCount;
5339 (*self_0).slotIndex = slotIndex;
5340 (*self_0).attachment = &mut (*attachment).super_0;
5341 self_0
5342}
5343#[no_mangle]
5344pub unsafe extern "C" fn spDeformTimeline_setFrame(
5345 mut self_0: *mut spDeformTimeline,
5346 mut frame: c_int,
5347 mut time: c_float,
5348 mut vertices: *mut c_float,
5349) {
5350 *((*(*self_0).super_0.super_0.frames).items).offset(frame as isize) = time;
5351 _spFree((*((*self_0).frameVertices).offset(frame as isize)).cast::<c_void>());
5352 if vertices.is_null() {
5353 let fresh5 = &mut (*((*self_0).frameVertices).offset(frame as isize));
5354 *fresh5 = std::ptr::null_mut::<c_float>();
5355 } else {
5356 let fresh6 = &mut (*((*self_0).frameVertices).offset(frame as isize));
5357 *fresh6 = _spMalloc(
5358 (::core::mem::size_of::<c_float>() as c_ulong)
5359 .wrapping_mul((*self_0).frameVerticesCount as c_ulong),
5360 (b"spine.c\0" as *const u8).cast::<c_char>(),
5361 1904 as c_int,
5362 )
5363 .cast::<c_float>();
5364 spine_memcpy(
5365 (*((*self_0).frameVertices).offset(frame as isize)).cast::<c_void>(),
5366 vertices as *const c_void,
5367 ((*self_0).frameVerticesCount as c_ulong)
5368 .wrapping_mul(::core::mem::size_of::<c_float>() as c_ulong),
5369 );
5370 };
5371}
5372static mut SEQUENCE_ENTRIES: c_int = 3 as c_int;
5373static mut MODE: c_int = 1 as c_int;
5374static mut DELAY: c_int = 2 as c_int;
5375#[no_mangle]
5376pub unsafe extern "C" fn _spSequenceTimeline_apply(
5377 mut timeline: *mut spTimeline,
5378 mut skeleton: *mut spSkeleton,
5379 mut _lastTime: c_float,
5380 mut time: c_float,
5381 mut _firedEvents: *mut *mut spEvent,
5382 mut _eventsCount: *mut c_int,
5383 mut _alpha: c_float,
5384 mut blend: spMixBlend,
5385 mut _direction: spMixDirection,
5386) {
5387 let mut self_0: *mut spSequenceTimeline = timeline.cast::<spSequenceTimeline>();
5388 let mut slot: *mut spSlot = *((*skeleton).slots).offset((*self_0).slotIndex as isize);
5389 let mut slotAttachment: *mut spAttachment = std::ptr::null_mut::<spAttachment>();
5390 let mut frames: *mut c_float = std::ptr::null_mut::<c_float>();
5391 let mut i: c_int = 0;
5392 let mut modeAndIndex: c_int = 0;
5393 let mut count: c_int = 0;
5394 let mut index: c_int = 0;
5395 let mut mode: c_int = 0;
5396 let mut before: c_float = 0.;
5397 let mut delay: c_float = 0.;
5398 let mut sequence: *mut spSequence = std::ptr::null_mut::<spSequence>();
5399 if (*(*slot).bone).active == 0 {
5400 return;
5401 }
5402 slotAttachment = (*slot).attachment;
5403 if slotAttachment != (*self_0).attachment {
5404 if slotAttachment.is_null() {
5405 return;
5406 }
5407 match (*slotAttachment).type_0 as c_uint {
5408 1 | 6 | 2 | 4 => {
5409 let mut vertexAttachment: *mut spVertexAttachment =
5410 (*slot).attachment.cast::<spVertexAttachment>();
5411 if (*vertexAttachment).timelineAttachment != (*self_0).attachment {
5412 return;
5413 }
5414 }
5415 _ => return,
5416 }
5417 }
5418 frames = (*(*self_0).super_0.frames).items;
5419 if time < *frames.offset(0 as c_int as isize) {
5420 if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint
5421 || blend as c_uint == SP_MIX_BLEND_FIRST as c_int as c_uint
5422 {
5423 (*slot).sequenceIndex = -(1 as c_int);
5424 }
5425 return;
5426 }
5427 i = search2((*self_0).super_0.frames, time, SEQUENCE_ENTRIES);
5428 before = *frames.offset(i as isize);
5429 modeAndIndex = *frames.offset((i + MODE) as isize) as c_int;
5430 delay = *frames.offset((i + DELAY) as isize);
5431 if (*(*self_0).attachment).type_0 as c_uint == SP_ATTACHMENT_REGION as c_int as c_uint {
5432 sequence = (*(*self_0).attachment.cast::<spRegionAttachment>()).sequence;
5433 }
5434 if (*(*self_0).attachment).type_0 as c_uint == SP_ATTACHMENT_MESH as c_int as c_uint {
5435 sequence = (*(*self_0).attachment.cast::<spMeshAttachment>()).sequence;
5436 }
5437 if sequence.is_null() {
5438 return;
5439 }
5440 index = modeAndIndex >> 4 as c_int;
5441 count = (*(*sequence).regions).size;
5442 mode = modeAndIndex & 0xf as c_int;
5443 if mode != 0 as c_int {
5444 index += (((time - before) / delay) as c_double + 0.0001f64) as c_int;
5445 match mode {
5446 1 => {
5447 index = if (count - 1 as c_int) < index {
5448 count - 1 as c_int
5449 } else {
5450 index
5451 };
5452 }
5453 2 => {
5454 index %= count;
5455 }
5456 3 => {
5457 let mut n: c_int = (count << 1 as c_int) - 2 as c_int;
5458 index = if n == 0 as c_int {
5459 0 as c_int
5460 } else {
5461 index % n
5462 };
5463 if index >= count {
5464 index = n - index;
5465 }
5466 }
5467 4 => {
5468 index = if count - 1 as c_int - index > 0 as c_int {
5469 count - 1 as c_int - index
5470 } else {
5471 0 as c_int
5472 };
5473 }
5474 5 => {
5475 index = count - 1 as c_int - index % count;
5476 }
5477 6 => {
5478 let mut n_0: c_int = (count << 1 as c_int) - 2 as c_int;
5479 index = if n_0 == 0 as c_int {
5480 0 as c_int
5481 } else {
5482 (index + count - 1 as c_int) % n_0
5483 };
5484 if index >= count {
5485 index = n_0 - index;
5486 }
5487 }
5488 _ => {}
5489 }
5490 }
5491 (*slot).sequenceIndex = index;
5492}
5493#[no_mangle]
5494pub unsafe extern "C" fn _spSequenceTimeline_dispose(mut _timeline: *mut spTimeline) {}
5495#[no_mangle]
5496pub unsafe extern "C" fn spSequenceTimeline_create(
5497 mut framesCount: c_int,
5498 mut slotIndex: c_int,
5499 mut attachment: *mut spAttachment,
5500) -> *mut spSequenceTimeline {
5501 let mut sequenceId: c_int = 0 as c_int;
5502 let mut self_0: *mut spSequenceTimeline = _spCalloc(
5503 1 as c_int as size_t,
5504 ::core::mem::size_of::<spSequenceTimeline>() as c_ulong,
5505 (b"spine.c\0" as *const u8).cast::<c_char>(),
5506 2003 as c_int,
5507 )
5508 .cast::<spSequenceTimeline>();
5509 let mut ids: [spPropertyId; 1] = [0; 1];
5510 if (*attachment).type_0 as c_uint == SP_ATTACHMENT_REGION as c_int as c_uint {
5511 sequenceId = (*(*attachment.cast::<spRegionAttachment>()).sequence).id;
5512 }
5513 if (*attachment).type_0 as c_uint == SP_ATTACHMENT_MESH as c_int as c_uint {
5514 sequenceId = (*(*attachment.cast::<spMeshAttachment>()).sequence).id;
5515 }
5516 ids[0 as c_int as usize] = (SP_PROPERTY_SEQUENCE as c_int as spPropertyId) << 32 as c_int
5517 | ((slotIndex << 16 as c_int | sequenceId) as c_uint & 0xffffffff as c_uint) as c_ulong;
5518 _spTimeline_init(
5519 &mut (*self_0).super_0,
5520 framesCount,
5521 SEQUENCE_ENTRIES,
5522 ids.as_mut_ptr(),
5523 1 as c_int,
5524 SP_TIMELINE_SEQUENCE,
5525 Some(_spSequenceTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
5526 Some(
5527 _spSequenceTimeline_apply
5528 as unsafe extern "C" fn(
5529 *mut spTimeline,
5530 *mut spSkeleton,
5531 c_float,
5532 c_float,
5533 *mut *mut spEvent,
5534 *mut c_int,
5535 c_float,
5536 spMixBlend,
5537 spMixDirection,
5538 ) -> (),
5539 ),
5540 None,
5541 );
5542 (*self_0).slotIndex = slotIndex;
5543 (*self_0).attachment = attachment;
5544 self_0
5545}
5546#[no_mangle]
5547pub unsafe extern "C" fn spSequenceTimeline_setFrame(
5548 mut self_0: *mut spSequenceTimeline,
5549 mut frame: c_int,
5550 mut time: c_float,
5551 mut mode: c_int,
5552 mut index: c_int,
5553 mut delay: c_float,
5554) {
5555 let mut frames: *mut c_float = (*(*self_0).super_0.frames).items;
5556 frame *= SEQUENCE_ENTRIES;
5557 *frames.offset(frame as isize) = time;
5558 *frames.offset((frame + MODE) as isize) = (mode | index << 4 as c_int) as c_float;
5559 *frames.offset((frame + DELAY) as isize) = delay;
5560}
5561#[no_mangle]
5562pub unsafe extern "C" fn _spEventTimeline_apply(
5563 mut timeline: *mut spTimeline,
5564 mut skeleton: *mut spSkeleton,
5565 mut lastTime: c_float,
5566 mut time: c_float,
5567 mut firedEvents: *mut *mut spEvent,
5568 mut eventsCount: *mut c_int,
5569 mut alpha: c_float,
5570 mut blend: spMixBlend,
5571 mut direction: spMixDirection,
5572) {
5573 let mut self_0: *mut spEventTimeline = timeline.cast::<spEventTimeline>();
5574 let mut frames: *mut c_float = (*(*self_0).super_0.frames).items;
5575 let mut framesCount: c_int = (*(*self_0).super_0.frames).size;
5576 let mut i: c_int = 0;
5577 if firedEvents.is_null() {
5578 return;
5579 }
5580 if lastTime > time {
5581 _spEventTimeline_apply(
5582 timeline,
5583 skeleton,
5584 lastTime,
5585 0x7fffffff as c_int as c_float,
5586 firedEvents,
5587 eventsCount,
5588 alpha,
5589 blend,
5590 direction,
5591 );
5592 lastTime = -(1 as c_int) as c_float;
5593 } else if lastTime >= *frames.offset((framesCount - 1 as c_int) as isize) {
5594 return;
5595 }
5596 if time < *frames.offset(0 as c_int as isize) {
5597 return;
5598 }
5599 if lastTime < *frames.offset(0 as c_int as isize) {
5600 i = 0 as c_int;
5601 } else {
5602 let mut frameTime: c_float = 0.;
5603 i = search((*self_0).super_0.frames, lastTime) + 1 as c_int;
5604 frameTime = *frames.offset(i as isize);
5605 while i > 0 as c_int {
5606 if *frames.offset((i - 1 as c_int) as isize) != frameTime {
5607 break;
5608 }
5609 i -= 1;
5610 }
5611 }
5612 while i < framesCount && time >= *frames.offset(i as isize) {
5613 let fresh7 = &mut (*firedEvents.offset(*eventsCount as isize));
5614 *fresh7 = *((*self_0).events).offset(i as isize);
5615 *eventsCount += 1;
5616 i += 1;
5617 }
5618}
5619#[no_mangle]
5620pub unsafe extern "C" fn _spEventTimeline_dispose(mut timeline: *mut spTimeline) {
5621 let mut self_0: *mut spEventTimeline = timeline.cast::<spEventTimeline>();
5622 let mut i: c_int = 0;
5623 i = 0 as c_int;
5624 while i < (*(*self_0).super_0.frames).size {
5625 spEvent_dispose(*((*self_0).events).offset(i as isize));
5626 i += 1;
5627 }
5628 _spFree((*self_0).events.cast::<c_void>());
5629}
5630#[no_mangle]
5631pub unsafe extern "C" fn spEventTimeline_create(mut framesCount: c_int) -> *mut spEventTimeline {
5632 let mut self_0: *mut spEventTimeline = _spCalloc(
5633 1 as c_int as size_t,
5634 ::core::mem::size_of::<spEventTimeline>() as c_ulong,
5635 (b"spine.c\0" as *const u8).cast::<c_char>(),
5636 2073 as c_int,
5637 )
5638 .cast::<spEventTimeline>();
5639 let mut ids: [spPropertyId; 1] = [0; 1];
5640 ids[0 as c_int as usize] = (SP_PROPERTY_EVENT as c_int as spPropertyId) << 32 as c_int;
5641 _spTimeline_init(
5642 &mut (*self_0).super_0,
5643 framesCount,
5644 1 as c_int,
5645 ids.as_mut_ptr(),
5646 1 as c_int,
5647 SP_TIMELINE_EVENT,
5648 Some(_spEventTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
5649 Some(
5650 _spEventTimeline_apply
5651 as unsafe extern "C" fn(
5652 *mut spTimeline,
5653 *mut spSkeleton,
5654 c_float,
5655 c_float,
5656 *mut *mut spEvent,
5657 *mut c_int,
5658 c_float,
5659 spMixBlend,
5660 spMixDirection,
5661 ) -> (),
5662 ),
5663 None,
5664 );
5665 (*self_0).events = _spCalloc(
5666 framesCount as size_t,
5667 ::core::mem::size_of::<*mut spEvent>() as c_ulong,
5668 (b"spine.c\0" as *const u8).cast::<c_char>(),
5669 2078 as c_int,
5670 )
5671 .cast::<*mut spEvent>();
5672 self_0
5673}
5674#[no_mangle]
5675pub unsafe extern "C" fn spEventTimeline_setFrame(
5676 mut self_0: *mut spEventTimeline,
5677 mut frame: c_int,
5678 mut event: *mut spEvent,
5679) {
5680 *((*(*self_0).super_0.frames).items).offset(frame as isize) = (*event).time;
5681 _spFree((*((*self_0).events).offset(frame as isize)).cast::<c_void>());
5682 let fresh8 = &mut (*((*self_0).events).offset(frame as isize));
5683 *fresh8 = event;
5684}
5685#[no_mangle]
5686pub unsafe extern "C" fn _spDrawOrderTimeline_apply(
5687 mut timeline: *mut spTimeline,
5688 mut skeleton: *mut spSkeleton,
5689 mut _lastTime: c_float,
5690 mut time: c_float,
5691 mut _firedEvents: *mut *mut spEvent,
5692 mut _eventsCount: *mut c_int,
5693 mut _alpha: c_float,
5694 mut blend: spMixBlend,
5695 mut direction: spMixDirection,
5696) {
5697 let mut i: c_int = 0;
5698 let mut drawOrderToSetupIndex: *const c_int = std::ptr::null::<c_int>();
5699 let mut self_0: *mut spDrawOrderTimeline = timeline.cast::<spDrawOrderTimeline>();
5700 let mut frames: *mut c_float = (*(*self_0).super_0.frames).items;
5701 if direction as c_uint == SP_MIX_DIRECTION_OUT as c_int as c_uint {
5702 if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint {
5703 spine_memcpy(
5704 (*skeleton).drawOrder.cast::<c_void>(),
5705 (*skeleton).slots as *const c_void,
5706 ((*self_0).slotsCount as c_ulong)
5707 .wrapping_mul(::core::mem::size_of::<*mut spSlot>() as c_ulong),
5708 );
5709 }
5710 return;
5711 }
5712 if time < *frames.offset(0 as c_int as isize) {
5713 if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint
5714 || blend as c_uint == SP_MIX_BLEND_FIRST as c_int as c_uint
5715 {
5716 spine_memcpy(
5717 (*skeleton).drawOrder.cast::<c_void>(),
5718 (*skeleton).slots as *const c_void,
5719 ((*self_0).slotsCount as c_ulong)
5720 .wrapping_mul(::core::mem::size_of::<*mut spSlot>() as c_ulong),
5721 );
5722 }
5723 return;
5724 }
5725 drawOrderToSetupIndex =
5726 *((*self_0).drawOrders).offset(search((*self_0).super_0.frames, time) as isize);
5727 if drawOrderToSetupIndex.is_null() {
5728 spine_memcpy(
5729 (*skeleton).drawOrder.cast::<c_void>(),
5730 (*skeleton).slots as *const c_void,
5731 ((*self_0).slotsCount as c_ulong)
5732 .wrapping_mul(::core::mem::size_of::<*mut spSlot>() as c_ulong),
5733 );
5734 } else {
5735 i = 0 as c_int;
5736 while i < (*self_0).slotsCount {
5737 let fresh9 = &mut (*((*skeleton).drawOrder).offset(i as isize));
5738 *fresh9 =
5739 *((*skeleton).slots).offset(*drawOrderToSetupIndex.offset(i as isize) as isize);
5740 i += 1;
5741 }
5742 };
5743}
5744#[no_mangle]
5745pub unsafe extern "C" fn _spDrawOrderTimeline_dispose(mut timeline: *mut spTimeline) {
5746 let mut self_0: *mut spDrawOrderTimeline = timeline.cast::<spDrawOrderTimeline>();
5747 let mut i: c_int = 0;
5748 i = 0 as c_int;
5749 while i < (*(*self_0).super_0.frames).size {
5750 _spFree((*((*self_0).drawOrders).offset(i as isize)).cast::<c_void>());
5751 i += 1;
5752 }
5753 _spFree((*self_0).drawOrders.cast::<c_void>());
5754}
5755#[no_mangle]
5756pub unsafe extern "C" fn spDrawOrderTimeline_create(
5757 mut framesCount: c_int,
5758 mut slotsCount: c_int,
5759) -> *mut spDrawOrderTimeline {
5760 let mut self_0: *mut spDrawOrderTimeline = _spCalloc(
5761 1 as c_int as size_t,
5762 ::core::mem::size_of::<spDrawOrderTimeline>() as c_ulong,
5763 (b"spine.c\0" as *const u8).cast::<c_char>(),
5764 2135 as c_int,
5765 )
5766 .cast::<spDrawOrderTimeline>();
5767 let mut ids: [spPropertyId; 1] = [0; 1];
5768 ids[0 as c_int as usize] = (SP_PROPERTY_DRAWORDER as c_int as spPropertyId) << 32 as c_int;
5769 _spTimeline_init(
5770 &mut (*self_0).super_0,
5771 framesCount,
5772 1 as c_int,
5773 ids.as_mut_ptr(),
5774 1 as c_int,
5775 SP_TIMELINE_DRAWORDER,
5776 Some(_spDrawOrderTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
5777 Some(
5778 _spDrawOrderTimeline_apply
5779 as unsafe extern "C" fn(
5780 *mut spTimeline,
5781 *mut spSkeleton,
5782 c_float,
5783 c_float,
5784 *mut *mut spEvent,
5785 *mut c_int,
5786 c_float,
5787 spMixBlend,
5788 spMixDirection,
5789 ) -> (),
5790 ),
5791 None,
5792 );
5793 (*self_0).drawOrders = _spCalloc(
5794 framesCount as size_t,
5795 ::core::mem::size_of::<*mut c_int>() as c_ulong,
5796 (b"spine.c\0" as *const u8).cast::<c_char>(),
5797 2141 as c_int,
5798 )
5799 .cast::<*mut c_int>();
5800 (*self_0).slotsCount = slotsCount;
5801 self_0
5802}
5803#[no_mangle]
5804pub unsafe extern "C" fn spDrawOrderTimeline_setFrame(
5805 mut self_0: *mut spDrawOrderTimeline,
5806 mut frame: c_int,
5807 mut time: c_float,
5808 mut drawOrder: *const c_int,
5809) {
5810 *((*(*self_0).super_0.frames).items).offset(frame as isize) = time;
5811 _spFree((*((*self_0).drawOrders).offset(frame as isize)).cast::<c_void>());
5812 if drawOrder.is_null() {
5813 let fresh10 = &mut (*((*self_0).drawOrders).offset(frame as isize));
5814 *fresh10 = std::ptr::null_mut::<c_int>();
5815 } else {
5816 let fresh11 = &mut (*((*self_0).drawOrders).offset(frame as isize));
5817 *fresh11 = _spMalloc(
5818 (::core::mem::size_of::<c_int>() as c_ulong)
5819 .wrapping_mul((*self_0).slotsCount as c_ulong),
5820 (b"spine.c\0" as *const u8).cast::<c_char>(),
5821 2154 as c_int,
5822 )
5823 .cast::<c_int>();
5824 spine_memcpy(
5825 (*((*self_0).drawOrders).offset(frame as isize)).cast::<c_void>(),
5826 drawOrder.cast::<c_void>(),
5827 ((*self_0).slotsCount as c_ulong)
5828 .wrapping_mul(::core::mem::size_of::<c_int>() as c_ulong),
5829 );
5830 };
5831}
5832#[no_mangle]
5833pub unsafe extern "C" fn _spInheritTimeline_apply(
5834 mut timeline: *mut spTimeline,
5835 mut skeleton: *mut spSkeleton,
5836 mut _lastTime: c_float,
5837 mut time: c_float,
5838 mut _firedEvents: *mut *mut spEvent,
5839 mut _eventsCount: *mut c_int,
5840 mut _alpha: c_float,
5841 mut blend: spMixBlend,
5842 mut _direction: spMixDirection,
5843) {
5844 let mut self_0: *mut spInheritTimeline = timeline.cast::<spInheritTimeline>();
5845 let mut bone: *mut spBone = *((*skeleton).bones).offset((*self_0).boneIndex as isize);
5846 let mut frames: *mut c_float = (*(*self_0).super_0.frames).items;
5847 if (*bone).active == 0 {
5848 return;
5849 }
5850 if time < *frames.offset(0 as c_int as isize) {
5851 if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint
5852 || blend as c_uint == SP_MIX_BLEND_FIRST as c_int as c_uint
5853 {
5854 (*bone).inherit = (*(*bone).data).inherit;
5855 }
5856 return;
5857 }
5858 let mut idx: c_int = search2((*self_0).super_0.frames, time, 2 as c_int) + 1 as c_int;
5859 (*bone).inherit = *frames.offset(idx as isize) as spInherit;
5860}
5861#[no_mangle]
5862pub unsafe extern "C" fn _spInheritTimeline_dispose(mut _timeline: *mut spTimeline) {}
5863#[no_mangle]
5864pub unsafe extern "C" fn spInheritTimeline_create(
5865 mut framesCount: c_int,
5866 mut boneIndex: c_int,
5867) -> *mut spInheritTimeline {
5868 let mut self_0: *mut spInheritTimeline = _spCalloc(
5869 1 as c_int as size_t,
5870 ::core::mem::size_of::<spInheritTimeline>() as c_ulong,
5871 (b"spine.c\0" as *const u8).cast::<c_char>(),
5872 2188 as c_int,
5873 )
5874 .cast::<spInheritTimeline>();
5875 let mut ids: [spPropertyId; 1] = [0; 1];
5876 ids[0 as c_int as usize] = (SP_PROPERTY_INHERIT as c_int as spPropertyId) << 32 as c_int;
5877 _spTimeline_init(
5878 &mut (*self_0).super_0,
5879 framesCount,
5880 2 as c_int,
5881 ids.as_mut_ptr(),
5882 1 as c_int,
5883 SP_TIMELINE_INHERIT,
5884 Some(_spInheritTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
5885 Some(
5886 _spInheritTimeline_apply
5887 as unsafe extern "C" fn(
5888 *mut spTimeline,
5889 *mut spSkeleton,
5890 c_float,
5891 c_float,
5892 *mut *mut spEvent,
5893 *mut c_int,
5894 c_float,
5895 spMixBlend,
5896 spMixDirection,
5897 ) -> (),
5898 ),
5899 None,
5900 );
5901 (*self_0).boneIndex = boneIndex;
5902 self_0
5903}
5904#[no_mangle]
5905pub unsafe extern "C" fn spInheritTimeline_setFrame(
5906 mut self_0: *mut spInheritTimeline,
5907 mut frame: c_int,
5908 mut time: c_float,
5909 mut inherit: spInherit,
5910) {
5911 frame *= 2 as c_int;
5912 *((*(*self_0).super_0.frames).items).offset(frame as isize) = time;
5913 *((*(*self_0).super_0.frames).items).offset((frame + 1 as c_int) as isize) = inherit as c_float;
5914}
5915static mut IKCONSTRAINT_ENTRIES: c_int = 6 as c_int;
5916static mut IKCONSTRAINT_MIX: c_int = 1 as c_int;
5917static mut IKCONSTRAINT_SOFTNESS: c_int = 2 as c_int;
5918static mut IKCONSTRAINT_BEND_DIRECTION: c_int = 3 as c_int;
5919static mut IKCONSTRAINT_COMPRESS: c_int = 4 as c_int;
5920static mut IKCONSTRAINT_STRETCH: c_int = 5 as c_int;
5921#[no_mangle]
5922pub unsafe extern "C" fn _spIkConstraintTimeline_apply(
5923 mut timeline: *mut spTimeline,
5924 mut skeleton: *mut spSkeleton,
5925 mut _lastTime: c_float,
5926 mut time: c_float,
5927 mut _firedEvents: *mut *mut spEvent,
5928 mut _eventsCount: *mut c_int,
5929 mut alpha: c_float,
5930 mut blend: spMixBlend,
5931 mut direction: spMixDirection,
5932) {
5933 let mut i: c_int = 0;
5934 let mut curveType: c_int = 0;
5935 let mut mix: c_float = 0.;
5936 let mut softness: c_float = 0.;
5937 let mut t: c_float = 0.;
5938 let mut constraint: *mut spIkConstraint = std::ptr::null_mut::<spIkConstraint>();
5939 let mut self_0: *mut spIkConstraintTimeline = timeline.cast::<spIkConstraintTimeline>();
5940 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
5941 let mut curves: *mut c_float = (*(*self_0).super_0.curves).items;
5942 constraint = *((*skeleton).ikConstraints).offset((*self_0).ikConstraintIndex as isize);
5943 if (*constraint).active == 0 {
5944 return;
5945 }
5946 if time < *frames.offset(0 as c_int as isize) {
5947 match blend as c_uint {
5948 0 => {
5949 (*constraint).mix = (*(*constraint).data).mix;
5950 (*constraint).softness = (*(*constraint).data).softness;
5951 (*constraint).bendDirection = (*(*constraint).data).bendDirection;
5952 (*constraint).compress = (*(*constraint).data).compress;
5953 (*constraint).stretch = (*(*constraint).data).stretch;
5954 return;
5955 }
5956 1 => {
5957 (*constraint).mix += ((*(*constraint).data).mix - (*constraint).mix) * alpha;
5958 (*constraint).softness +=
5959 ((*(*constraint).data).softness - (*constraint).softness) * alpha;
5960 (*constraint).bendDirection = (*(*constraint).data).bendDirection;
5961 (*constraint).compress = (*(*constraint).data).compress;
5962 (*constraint).stretch = (*(*constraint).data).stretch;
5963 return;
5964 }
5965 _ => return,
5966 }
5967 }
5968 i = search2((*self_0).super_0.super_0.frames, time, IKCONSTRAINT_ENTRIES);
5969 curveType = *curves.offset((i / IKCONSTRAINT_ENTRIES) as isize) as c_int;
5970 match curveType {
5971 0 => {
5972 let mut before: c_float = *frames.offset(i as isize);
5973 mix = *frames.offset((i + IKCONSTRAINT_MIX) as isize);
5974 softness = *frames.offset((i + IKCONSTRAINT_SOFTNESS) as isize);
5975 t = (time - before) / (*frames.offset((i + IKCONSTRAINT_ENTRIES) as isize) - before);
5976 mix +=
5977 (*frames.offset((i + IKCONSTRAINT_ENTRIES + IKCONSTRAINT_MIX) as isize) - mix) * t;
5978 softness += (*frames
5979 .offset((i + IKCONSTRAINT_ENTRIES + IKCONSTRAINT_SOFTNESS) as isize)
5980 - softness)
5981 * t;
5982 }
5983 1 => {
5984 mix = *frames.offset((i + IKCONSTRAINT_MIX) as isize);
5985 softness = *frames.offset((i + IKCONSTRAINT_SOFTNESS) as isize);
5986 }
5987 _ => {
5988 mix = _spCurveTimeline_getBezierValue(
5989 &mut (*self_0).super_0,
5990 time,
5991 i,
5992 IKCONSTRAINT_MIX,
5993 curveType - 2 as c_int,
5994 );
5995 softness = _spCurveTimeline_getBezierValue(
5996 &mut (*self_0).super_0,
5997 time,
5998 i,
5999 IKCONSTRAINT_SOFTNESS,
6000 curveType + 18 as c_int - 2 as c_int,
6001 );
6002 }
6003 }
6004 if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint {
6005 (*constraint).mix = (*(*constraint).data).mix + (mix - (*(*constraint).data).mix) * alpha;
6006 (*constraint).softness =
6007 (*(*constraint).data).softness + (softness - (*(*constraint).data).softness) * alpha;
6008 if direction as c_uint == SP_MIX_DIRECTION_OUT as c_int as c_uint {
6009 (*constraint).bendDirection = (*(*constraint).data).bendDirection;
6010 (*constraint).compress = (*(*constraint).data).compress;
6011 (*constraint).stretch = (*(*constraint).data).stretch;
6012 } else {
6013 (*constraint).bendDirection =
6014 *frames.offset((i + IKCONSTRAINT_BEND_DIRECTION) as isize) as c_int;
6015 (*constraint).compress = (*frames.offset((i + IKCONSTRAINT_COMPRESS) as isize)
6016 != 0 as c_int as c_float) as c_int;
6017 (*constraint).stretch = (*frames.offset((i + IKCONSTRAINT_STRETCH) as isize)
6018 != 0 as c_int as c_float) as c_int;
6019 }
6020 } else {
6021 (*constraint).mix += (mix - (*constraint).mix) * alpha;
6022 (*constraint).softness += (softness - (*constraint).softness) * alpha;
6023 if direction as c_uint == SP_MIX_DIRECTION_IN as c_int as c_uint {
6024 (*constraint).bendDirection =
6025 *frames.offset((i + IKCONSTRAINT_BEND_DIRECTION) as isize) as c_int;
6026 (*constraint).compress = (*frames.offset((i + IKCONSTRAINT_COMPRESS) as isize)
6027 != 0 as c_int as c_float) as c_int;
6028 (*constraint).stretch = (*frames.offset((i + IKCONSTRAINT_STRETCH) as isize)
6029 != 0 as c_int as c_float) as c_int;
6030 }
6031 };
6032}
6033#[no_mangle]
6034pub unsafe extern "C" fn spIkConstraintTimeline_create(
6035 mut framesCount: c_int,
6036 mut bezierCount: c_int,
6037 mut ikConstraintIndex: c_int,
6038) -> *mut spIkConstraintTimeline {
6039 let mut timeline: *mut spIkConstraintTimeline = _spCalloc(
6040 1 as c_int as size_t,
6041 ::core::mem::size_of::<spIkConstraintTimeline>() as c_ulong,
6042 (b"spine.c\0" as *const u8).cast::<c_char>(),
6043 2298 as c_int,
6044 )
6045 .cast::<spIkConstraintTimeline>();
6046 let mut ids: [spPropertyId; 1] = [0; 1];
6047 ids[0 as c_int as usize] = (SP_PROPERTY_IKCONSTRAINT as c_int as spPropertyId) << 32 as c_int
6048 | ikConstraintIndex as c_ulong;
6049 _spCurveTimeline_init(
6050 &mut (*timeline).super_0,
6051 framesCount,
6052 IKCONSTRAINT_ENTRIES,
6053 bezierCount,
6054 ids.as_mut_ptr(),
6055 1 as c_int,
6056 SP_TIMELINE_IKCONSTRAINT,
6057 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
6058 Some(
6059 _spIkConstraintTimeline_apply
6060 as unsafe extern "C" fn(
6061 *mut spTimeline,
6062 *mut spSkeleton,
6063 c_float,
6064 c_float,
6065 *mut *mut spEvent,
6066 *mut c_int,
6067 c_float,
6068 spMixBlend,
6069 spMixDirection,
6070 ) -> (),
6071 ),
6072 Some(
6073 _spCurveTimeline_setBezier
6074 as unsafe extern "C" fn(
6075 *mut spTimeline,
6076 c_int,
6077 c_int,
6078 c_float,
6079 c_float,
6080 c_float,
6081 c_float,
6082 c_float,
6083 c_float,
6084 c_float,
6085 c_float,
6086 c_float,
6087 ) -> (),
6088 ),
6089 );
6090 (*timeline).ikConstraintIndex = ikConstraintIndex;
6091 timeline
6092}
6093#[no_mangle]
6094pub unsafe extern "C" fn spIkConstraintTimeline_setFrame(
6095 mut self_0: *mut spIkConstraintTimeline,
6096 mut frame: c_int,
6097 mut time: c_float,
6098 mut mix: c_float,
6099 mut softness: c_float,
6100 mut bendDirection: c_int,
6101 mut compress: c_int,
6102 mut stretch: c_int,
6103) {
6104 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
6105 frame *= IKCONSTRAINT_ENTRIES;
6106 *frames.offset(frame as isize) = time;
6107 *frames.offset((frame + IKCONSTRAINT_MIX) as isize) = mix;
6108 *frames.offset((frame + IKCONSTRAINT_SOFTNESS) as isize) = softness;
6109 *frames.offset((frame + IKCONSTRAINT_BEND_DIRECTION) as isize) = bendDirection as c_float;
6110 *frames.offset((frame + IKCONSTRAINT_COMPRESS) as isize) = (if compress != 0 {
6111 1 as c_int
6112 } else {
6113 0 as c_int
6114 }) as c_float;
6115 *frames.offset((frame + IKCONSTRAINT_STRETCH) as isize) =
6116 (if stretch != 0 { 1 as c_int } else { 0 as c_int }) as c_float;
6117}
6118static mut TRANSFORMCONSTRAINT_ENTRIES: c_int = 7 as c_int;
6119static mut TRANSFORMCONSTRAINT_ROTATE: c_int = 1 as c_int;
6120static mut TRANSFORMCONSTRAINT_X: c_int = 2 as c_int;
6121static mut TRANSFORMCONSTRAINT_Y: c_int = 3 as c_int;
6122static mut TRANSFORMCONSTRAINT_SCALEX: c_int = 4 as c_int;
6123static mut TRANSFORMCONSTRAINT_SCALEY: c_int = 5 as c_int;
6124static mut TRANSFORMCONSTRAINT_SHEARY: c_int = 6 as c_int;
6125#[no_mangle]
6126pub unsafe extern "C" fn _spTransformConstraintTimeline_apply(
6127 mut timeline: *mut spTimeline,
6128 mut skeleton: *mut spSkeleton,
6129 mut _lastTime: c_float,
6130 mut time: c_float,
6131 mut _firedEvents: *mut *mut spEvent,
6132 mut _eventsCount: *mut c_int,
6133 mut alpha: c_float,
6134 mut blend: spMixBlend,
6135 mut _direction: spMixDirection,
6136) {
6137 let mut i: c_int = 0;
6138 let mut curveType: c_int = 0;
6139 let mut rotate: c_float = 0.;
6140 let mut x: c_float = 0.;
6141 let mut y: c_float = 0.;
6142 let mut scaleX: c_float = 0.;
6143 let mut scaleY: c_float = 0.;
6144 let mut shearY: c_float = 0.;
6145 let mut t: c_float = 0.;
6146 let mut constraint: *mut spTransformConstraint = std::ptr::null_mut::<spTransformConstraint>();
6147 let mut self_0: *mut spTransformConstraintTimeline =
6148 timeline.cast::<spTransformConstraintTimeline>();
6149 let mut frames: *mut c_float = std::ptr::null_mut::<c_float>();
6150 let mut curves: *mut c_float = std::ptr::null_mut::<c_float>();
6151 let mut data: *mut spTransformConstraintData =
6152 std::ptr::null_mut::<spTransformConstraintData>();
6153 constraint =
6154 *((*skeleton).transformConstraints).offset((*self_0).transformConstraintIndex as isize);
6155 if (*constraint).active == 0 {
6156 return;
6157 }
6158 frames = (*(*self_0).super_0.super_0.frames).items;
6159 curves = (*(*self_0).super_0.curves).items;
6160 data = (*constraint).data;
6161 if time < *frames.offset(0 as c_int as isize) {
6162 match blend as c_uint {
6163 0 => {
6164 (*constraint).mixRotate = (*data).mixRotate;
6165 (*constraint).mixX = (*data).mixX;
6166 (*constraint).mixY = (*data).mixY;
6167 (*constraint).mixScaleX = (*data).mixScaleX;
6168 (*constraint).mixScaleY = (*data).mixScaleY;
6169 (*constraint).mixShearY = (*data).mixShearY;
6170 return;
6171 }
6172 1 => {
6173 (*constraint).mixRotate += ((*data).mixRotate - (*constraint).mixRotate) * alpha;
6174 (*constraint).mixX += ((*data).mixX - (*constraint).mixX) * alpha;
6175 (*constraint).mixY += ((*data).mixY - (*constraint).mixY) * alpha;
6176 (*constraint).mixScaleX += ((*data).mixScaleX - (*constraint).mixScaleX) * alpha;
6177 (*constraint).mixScaleY += ((*data).mixScaleY - (*constraint).mixScaleY) * alpha;
6178 (*constraint).mixShearY += ((*data).mixShearY - (*constraint).mixShearY) * alpha;
6179 return;
6180 }
6181 _ => return,
6182 }
6183 }
6184 i = search2(
6185 (*self_0).super_0.super_0.frames,
6186 time,
6187 TRANSFORMCONSTRAINT_ENTRIES,
6188 );
6189 curveType = *curves.offset((i / TRANSFORMCONSTRAINT_ENTRIES) as isize) as c_int;
6190 match curveType {
6191 0 => {
6192 let mut before: c_float = *frames.offset(i as isize);
6193 rotate = *frames.offset((i + TRANSFORMCONSTRAINT_ROTATE) as isize);
6194 x = *frames.offset((i + TRANSFORMCONSTRAINT_X) as isize);
6195 y = *frames.offset((i + TRANSFORMCONSTRAINT_Y) as isize);
6196 scaleX = *frames.offset((i + TRANSFORMCONSTRAINT_SCALEX) as isize);
6197 scaleY = *frames.offset((i + TRANSFORMCONSTRAINT_SCALEY) as isize);
6198 shearY = *frames.offset((i + TRANSFORMCONSTRAINT_SHEARY) as isize);
6199 t = (time - before)
6200 / (*frames.offset((i + TRANSFORMCONSTRAINT_ENTRIES) as isize) - before);
6201 rotate += (*frames
6202 .offset((i + TRANSFORMCONSTRAINT_ENTRIES + TRANSFORMCONSTRAINT_ROTATE) as isize)
6203 - rotate)
6204 * t;
6205 x += (*frames
6206 .offset((i + TRANSFORMCONSTRAINT_ENTRIES + TRANSFORMCONSTRAINT_X) as isize)
6207 - x)
6208 * t;
6209 y += (*frames
6210 .offset((i + TRANSFORMCONSTRAINT_ENTRIES + TRANSFORMCONSTRAINT_Y) as isize)
6211 - y)
6212 * t;
6213 scaleX += (*frames
6214 .offset((i + TRANSFORMCONSTRAINT_ENTRIES + TRANSFORMCONSTRAINT_SCALEX) as isize)
6215 - scaleX)
6216 * t;
6217 scaleY += (*frames
6218 .offset((i + TRANSFORMCONSTRAINT_ENTRIES + TRANSFORMCONSTRAINT_SCALEY) as isize)
6219 - scaleY)
6220 * t;
6221 shearY += (*frames
6222 .offset((i + TRANSFORMCONSTRAINT_ENTRIES + TRANSFORMCONSTRAINT_SHEARY) as isize)
6223 - shearY)
6224 * t;
6225 }
6226 1 => {
6227 rotate = *frames.offset((i + TRANSFORMCONSTRAINT_ROTATE) as isize);
6228 x = *frames.offset((i + TRANSFORMCONSTRAINT_X) as isize);
6229 y = *frames.offset((i + TRANSFORMCONSTRAINT_Y) as isize);
6230 scaleX = *frames.offset((i + TRANSFORMCONSTRAINT_SCALEX) as isize);
6231 scaleY = *frames.offset((i + TRANSFORMCONSTRAINT_SCALEY) as isize);
6232 shearY = *frames.offset((i + TRANSFORMCONSTRAINT_SHEARY) as isize);
6233 }
6234 _ => {
6235 rotate = _spCurveTimeline_getBezierValue(
6236 &mut (*self_0).super_0,
6237 time,
6238 i,
6239 TRANSFORMCONSTRAINT_ROTATE,
6240 curveType - 2 as c_int,
6241 );
6242 x = _spCurveTimeline_getBezierValue(
6243 &mut (*self_0).super_0,
6244 time,
6245 i,
6246 TRANSFORMCONSTRAINT_X,
6247 curveType + 18 as c_int - 2 as c_int,
6248 );
6249 y = _spCurveTimeline_getBezierValue(
6250 &mut (*self_0).super_0,
6251 time,
6252 i,
6253 TRANSFORMCONSTRAINT_Y,
6254 curveType + 18 as c_int * 2 as c_int - 2 as c_int,
6255 );
6256 scaleX = _spCurveTimeline_getBezierValue(
6257 &mut (*self_0).super_0,
6258 time,
6259 i,
6260 TRANSFORMCONSTRAINT_SCALEX,
6261 curveType + 18 as c_int * 3 as c_int - 2 as c_int,
6262 );
6263 scaleY = _spCurveTimeline_getBezierValue(
6264 &mut (*self_0).super_0,
6265 time,
6266 i,
6267 TRANSFORMCONSTRAINT_SCALEY,
6268 curveType + 18 as c_int * 4 as c_int - 2 as c_int,
6269 );
6270 shearY = _spCurveTimeline_getBezierValue(
6271 &mut (*self_0).super_0,
6272 time,
6273 i,
6274 TRANSFORMCONSTRAINT_SHEARY,
6275 curveType + 18 as c_int * 5 as c_int - 2 as c_int,
6276 );
6277 }
6278 }
6279 if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint {
6280 (*constraint).mixRotate = (*data).mixRotate + (rotate - (*data).mixRotate) * alpha;
6281 (*constraint).mixX = (*data).mixX + (x - (*data).mixX) * alpha;
6282 (*constraint).mixY = (*data).mixY + (y - (*data).mixY) * alpha;
6283 (*constraint).mixScaleX = (*data).mixScaleX + (scaleX - (*data).mixScaleX) * alpha;
6284 (*constraint).mixScaleY = (*data).mixScaleY + (scaleY - (*data).mixScaleY) * alpha;
6285 (*constraint).mixShearY = (*data).mixShearY + (shearY - (*data).mixShearY) * alpha;
6286 } else {
6287 (*constraint).mixRotate += (rotate - (*constraint).mixRotate) * alpha;
6288 (*constraint).mixX += (x - (*constraint).mixX) * alpha;
6289 (*constraint).mixY += (y - (*constraint).mixY) * alpha;
6290 (*constraint).mixScaleX += (scaleX - (*constraint).mixScaleX) * alpha;
6291 (*constraint).mixScaleY += (scaleY - (*constraint).mixScaleY) * alpha;
6292 (*constraint).mixShearY += (shearY - (*constraint).mixShearY) * alpha;
6293 };
6294}
6295#[no_mangle]
6296pub unsafe extern "C" fn spTransformConstraintTimeline_create(
6297 mut framesCount: c_int,
6298 mut bezierCount: c_int,
6299 mut transformConstraintIndex: c_int,
6300) -> *mut spTransformConstraintTimeline {
6301 let mut timeline: *mut spTransformConstraintTimeline = _spCalloc(
6302 1 as c_int as size_t,
6303 ::core::mem::size_of::<spTransformConstraintTimeline>() as c_ulong,
6304 (b"spine.c\0" as *const u8).cast::<c_char>(),
6305 2439 as c_int,
6306 )
6307 .cast::<spTransformConstraintTimeline>();
6308 let mut ids: [spPropertyId; 1] = [0; 1];
6309 ids[0 as c_int as usize] = (SP_PROPERTY_TRANSFORMCONSTRAINT as c_int as spPropertyId)
6310 << 32 as c_int
6311 | transformConstraintIndex as c_ulong;
6312 _spCurveTimeline_init(
6313 &mut (*timeline).super_0,
6314 framesCount,
6315 TRANSFORMCONSTRAINT_ENTRIES,
6316 bezierCount,
6317 ids.as_mut_ptr(),
6318 1 as c_int,
6319 SP_TIMELINE_TRANSFORMCONSTRAINT,
6320 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
6321 Some(
6322 _spTransformConstraintTimeline_apply
6323 as unsafe extern "C" fn(
6324 *mut spTimeline,
6325 *mut spSkeleton,
6326 c_float,
6327 c_float,
6328 *mut *mut spEvent,
6329 *mut c_int,
6330 c_float,
6331 spMixBlend,
6332 spMixDirection,
6333 ) -> (),
6334 ),
6335 Some(
6336 _spCurveTimeline_setBezier
6337 as unsafe extern "C" fn(
6338 *mut spTimeline,
6339 c_int,
6340 c_int,
6341 c_float,
6342 c_float,
6343 c_float,
6344 c_float,
6345 c_float,
6346 c_float,
6347 c_float,
6348 c_float,
6349 c_float,
6350 ) -> (),
6351 ),
6352 );
6353 (*timeline).transformConstraintIndex = transformConstraintIndex;
6354 timeline
6355}
6356#[no_mangle]
6357pub unsafe extern "C" fn spTransformConstraintTimeline_setFrame(
6358 mut self_0: *mut spTransformConstraintTimeline,
6359 mut frame: c_int,
6360 mut time: c_float,
6361 mut mixRotate: c_float,
6362 mut mixX: c_float,
6363 mut mixY: c_float,
6364 mut mixScaleX: c_float,
6365 mut mixScaleY: c_float,
6366 mut mixShearY: c_float,
6367) {
6368 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
6369 frame *= TRANSFORMCONSTRAINT_ENTRIES;
6370 *frames.offset(frame as isize) = time;
6371 *frames.offset((frame + TRANSFORMCONSTRAINT_ROTATE) as isize) = mixRotate;
6372 *frames.offset((frame + TRANSFORMCONSTRAINT_X) as isize) = mixX;
6373 *frames.offset((frame + TRANSFORMCONSTRAINT_Y) as isize) = mixY;
6374 *frames.offset((frame + TRANSFORMCONSTRAINT_SCALEX) as isize) = mixScaleX;
6375 *frames.offset((frame + TRANSFORMCONSTRAINT_SCALEY) as isize) = mixScaleY;
6376 *frames.offset((frame + TRANSFORMCONSTRAINT_SHEARY) as isize) = mixShearY;
6377}
6378static mut PATHCONSTRAINTPOSITION_ENTRIES: c_int = 2 as c_int;
6379static mut PATHCONSTRAINTPOSITION_VALUE: c_int = 1 as c_int;
6380#[no_mangle]
6381pub unsafe extern "C" fn _spPathConstraintPositionTimeline_apply(
6382 mut timeline: *mut spTimeline,
6383 mut skeleton: *mut spSkeleton,
6384 mut _lastTime: c_float,
6385 mut time: c_float,
6386 mut _firedEvents: *mut *mut spEvent,
6387 mut _eventsCount: *mut c_int,
6388 mut alpha: c_float,
6389 mut blend: spMixBlend,
6390 mut _direction: spMixDirection,
6391) {
6392 let mut self_0: *mut spPathConstraintPositionTimeline =
6393 timeline.cast::<spPathConstraintPositionTimeline>();
6394 let mut constraint: *mut spPathConstraint =
6395 *((*skeleton).pathConstraints).offset((*self_0).pathConstraintIndex as isize);
6396 if (*constraint).active != 0 {
6397 (*constraint).position = spCurveTimeline1_getAbsoluteValue(
6398 &mut (*self_0).super_0,
6399 time,
6400 alpha,
6401 blend,
6402 (*constraint).position,
6403 (*(*constraint).data).position,
6404 );
6405 }
6406}
6407#[no_mangle]
6408pub unsafe extern "C" fn spPathConstraintPositionTimeline_create(
6409 mut framesCount: c_int,
6410 mut bezierCount: c_int,
6411 mut pathConstraintIndex: c_int,
6412) -> *mut spPathConstraintPositionTimeline {
6413 let mut timeline: *mut spPathConstraintPositionTimeline = _spCalloc(
6414 1 as c_int as size_t,
6415 ::core::mem::size_of::<spPathConstraintPositionTimeline>() as c_ulong,
6416 (b"spine.c\0" as *const u8).cast::<c_char>(),
6417 2481 as c_int,
6418 )
6419 .cast::<spPathConstraintPositionTimeline>();
6420 let mut ids: [spPropertyId; 1] = [0; 1];
6421 ids[0 as c_int as usize] = (SP_PROPERTY_PATHCONSTRAINT_POSITION as c_int as spPropertyId)
6422 << 32 as c_int
6423 | pathConstraintIndex as c_ulong;
6424 _spCurveTimeline_init(
6425 &mut (*timeline).super_0,
6426 framesCount,
6427 PATHCONSTRAINTPOSITION_ENTRIES,
6428 bezierCount,
6429 ids.as_mut_ptr(),
6430 1 as c_int,
6431 SP_TIMELINE_PATHCONSTRAINTPOSITION,
6432 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
6433 Some(
6434 _spPathConstraintPositionTimeline_apply
6435 as unsafe extern "C" fn(
6436 *mut spTimeline,
6437 *mut spSkeleton,
6438 c_float,
6439 c_float,
6440 *mut *mut spEvent,
6441 *mut c_int,
6442 c_float,
6443 spMixBlend,
6444 spMixDirection,
6445 ) -> (),
6446 ),
6447 Some(
6448 _spCurveTimeline_setBezier
6449 as unsafe extern "C" fn(
6450 *mut spTimeline,
6451 c_int,
6452 c_int,
6453 c_float,
6454 c_float,
6455 c_float,
6456 c_float,
6457 c_float,
6458 c_float,
6459 c_float,
6460 c_float,
6461 c_float,
6462 ) -> (),
6463 ),
6464 );
6465 (*timeline).pathConstraintIndex = pathConstraintIndex;
6466 timeline
6467}
6468#[no_mangle]
6469pub unsafe extern "C" fn spPathConstraintPositionTimeline_setFrame(
6470 mut self_0: *mut spPathConstraintPositionTimeline,
6471 mut frame: c_int,
6472 mut time: c_float,
6473 mut value: c_float,
6474) {
6475 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
6476 frame *= PATHCONSTRAINTPOSITION_ENTRIES;
6477 *frames.offset(frame as isize) = time;
6478 *frames.offset((frame + PATHCONSTRAINTPOSITION_VALUE) as isize) = value;
6479}
6480static mut PATHCONSTRAINTSPACING_ENTRIES: c_int = 2 as c_int;
6481static mut PATHCONSTRAINTSPACING_VALUE: c_int = 1 as c_int;
6482#[no_mangle]
6483pub unsafe extern "C" fn _spPathConstraintSpacingTimeline_apply(
6484 mut timeline: *mut spTimeline,
6485 mut skeleton: *mut spSkeleton,
6486 mut _lastTime: c_float,
6487 mut time: c_float,
6488 mut _firedEvents: *mut *mut spEvent,
6489 mut _eventsCount: *mut c_int,
6490 mut alpha: c_float,
6491 mut blend: spMixBlend,
6492 mut _direction: spMixDirection,
6493) {
6494 let mut self_0: *mut spPathConstraintSpacingTimeline =
6495 timeline.cast::<spPathConstraintSpacingTimeline>();
6496 let mut constraint: *mut spPathConstraint =
6497 *((*skeleton).pathConstraints).offset((*self_0).pathConstraintIndex as isize);
6498 if (*constraint).active != 0 {
6499 (*constraint).spacing = spCurveTimeline1_getAbsoluteValue(
6500 &mut (*self_0).super_0,
6501 time,
6502 alpha,
6503 blend,
6504 (*constraint).spacing,
6505 (*(*constraint).data).spacing,
6506 );
6507 }
6508}
6509#[no_mangle]
6510pub unsafe extern "C" fn spPathConstraintSpacingTimeline_create(
6511 mut framesCount: c_int,
6512 mut bezierCount: c_int,
6513 mut pathConstraintIndex: c_int,
6514) -> *mut spPathConstraintSpacingTimeline {
6515 let mut timeline: *mut spPathConstraintSpacingTimeline = _spCalloc(
6516 1 as c_int as size_t,
6517 ::core::mem::size_of::<spPathConstraintSpacingTimeline>() as c_ulong,
6518 (b"spine.c\0" as *const u8).cast::<c_char>(),
6519 2517 as c_int,
6520 )
6521 .cast::<spPathConstraintSpacingTimeline>();
6522 let mut ids: [spPropertyId; 1] = [0; 1];
6523 ids[0 as c_int as usize] = (SP_PROPERTY_PATHCONSTRAINT_SPACING as c_int as spPropertyId)
6524 << 32 as c_int
6525 | pathConstraintIndex as c_ulong;
6526 _spCurveTimeline_init(
6527 &mut (*timeline).super_0,
6528 framesCount,
6529 PATHCONSTRAINTSPACING_ENTRIES,
6530 bezierCount,
6531 ids.as_mut_ptr(),
6532 1 as c_int,
6533 SP_TIMELINE_PATHCONSTRAINTSPACING,
6534 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
6535 Some(
6536 _spPathConstraintSpacingTimeline_apply
6537 as unsafe extern "C" fn(
6538 *mut spTimeline,
6539 *mut spSkeleton,
6540 c_float,
6541 c_float,
6542 *mut *mut spEvent,
6543 *mut c_int,
6544 c_float,
6545 spMixBlend,
6546 spMixDirection,
6547 ) -> (),
6548 ),
6549 Some(
6550 _spCurveTimeline_setBezier
6551 as unsafe extern "C" fn(
6552 *mut spTimeline,
6553 c_int,
6554 c_int,
6555 c_float,
6556 c_float,
6557 c_float,
6558 c_float,
6559 c_float,
6560 c_float,
6561 c_float,
6562 c_float,
6563 c_float,
6564 ) -> (),
6565 ),
6566 );
6567 (*timeline).pathConstraintIndex = pathConstraintIndex;
6568 timeline
6569}
6570#[no_mangle]
6571pub unsafe extern "C" fn spPathConstraintSpacingTimeline_setFrame(
6572 mut self_0: *mut spPathConstraintSpacingTimeline,
6573 mut frame: c_int,
6574 mut time: c_float,
6575 mut value: c_float,
6576) {
6577 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
6578 frame *= PATHCONSTRAINTSPACING_ENTRIES;
6579 *frames.offset(frame as isize) = time;
6580 *frames.offset((frame + PATHCONSTRAINTSPACING_VALUE) as isize) = value;
6581}
6582static mut PATHCONSTRAINTMIX_ENTRIES: c_int = 4 as c_int;
6583static mut PATHCONSTRAINTMIX_ROTATE: c_int = 1 as c_int;
6584static mut PATHCONSTRAINTMIX_X: c_int = 2 as c_int;
6585static mut PATHCONSTRAINTMIX_Y: c_int = 3 as c_int;
6586#[no_mangle]
6587pub unsafe extern "C" fn _spPathConstraintMixTimeline_apply(
6588 mut timeline: *mut spTimeline,
6589 mut skeleton: *mut spSkeleton,
6590 mut _lastTime: c_float,
6591 mut time: c_float,
6592 mut _firedEvents: *mut *mut spEvent,
6593 mut _eventsCount: *mut c_int,
6594 mut alpha: c_float,
6595 mut blend: spMixBlend,
6596 mut _direction: spMixDirection,
6597) {
6598 let mut i: c_int = 0;
6599 let mut curveType: c_int = 0;
6600 let mut rotate: c_float = 0.;
6601 let mut x: c_float = 0.;
6602 let mut y: c_float = 0.;
6603 let mut t: c_float = 0.;
6604 let mut constraint: *mut spPathConstraint = std::ptr::null_mut::<spPathConstraint>();
6605 let mut self_0: *mut spPathConstraintMixTimeline =
6606 timeline.cast::<spPathConstraintMixTimeline>();
6607 let mut frames: *mut c_float = std::ptr::null_mut::<c_float>();
6608 let mut curves: *mut c_float = std::ptr::null_mut::<c_float>();
6609 constraint = *((*skeleton).pathConstraints).offset((*self_0).pathConstraintIndex as isize);
6610 if (*constraint).active == 0 {
6611 return;
6612 }
6613 frames = (*(*self_0).super_0.super_0.frames).items;
6614 curves = (*(*self_0).super_0.curves).items;
6615 if time < *frames.offset(0 as c_int as isize) {
6616 match blend as c_uint {
6617 0 => {
6618 (*constraint).mixRotate = (*(*constraint).data).mixRotate;
6619 (*constraint).mixX = (*(*constraint).data).mixX;
6620 (*constraint).mixY = (*(*constraint).data).mixY;
6621 return;
6622 }
6623 1 => {
6624 (*constraint).mixRotate +=
6625 ((*(*constraint).data).mixRotate - (*constraint).mixRotate) * alpha;
6626 (*constraint).mixX += ((*(*constraint).data).mixX - (*constraint).mixX) * alpha;
6627 (*constraint).mixY += ((*(*constraint).data).mixY - (*constraint).mixY) * alpha;
6628 }
6629 _ => {}
6630 }
6631 return;
6632 }
6633 i = search2(
6634 (*self_0).super_0.super_0.frames,
6635 time,
6636 PATHCONSTRAINTMIX_ENTRIES,
6637 );
6638 curveType = *curves.offset((i >> 2 as c_int) as isize) as c_int;
6639 match curveType {
6640 0 => {
6641 let mut before: c_float = *frames.offset(i as isize);
6642 rotate = *frames.offset((i + PATHCONSTRAINTMIX_ROTATE) as isize);
6643 x = *frames.offset((i + PATHCONSTRAINTMIX_X) as isize);
6644 y = *frames.offset((i + PATHCONSTRAINTMIX_Y) as isize);
6645 t = (time - before)
6646 / (*frames.offset((i + PATHCONSTRAINTMIX_ENTRIES) as isize) - before);
6647 rotate += (*frames
6648 .offset((i + PATHCONSTRAINTMIX_ENTRIES + PATHCONSTRAINTMIX_ROTATE) as isize)
6649 - rotate)
6650 * t;
6651 x += (*frames.offset((i + PATHCONSTRAINTMIX_ENTRIES + PATHCONSTRAINTMIX_X) as isize)
6652 - x)
6653 * t;
6654 y += (*frames.offset((i + PATHCONSTRAINTMIX_ENTRIES + PATHCONSTRAINTMIX_Y) as isize)
6655 - y)
6656 * t;
6657 }
6658 1 => {
6659 rotate = *frames.offset((i + PATHCONSTRAINTMIX_ROTATE) as isize);
6660 x = *frames.offset((i + PATHCONSTRAINTMIX_X) as isize);
6661 y = *frames.offset((i + PATHCONSTRAINTMIX_Y) as isize);
6662 }
6663 _ => {
6664 rotate = _spCurveTimeline_getBezierValue(
6665 &mut (*self_0).super_0,
6666 time,
6667 i,
6668 PATHCONSTRAINTMIX_ROTATE,
6669 curveType - 2 as c_int,
6670 );
6671 x = _spCurveTimeline_getBezierValue(
6672 &mut (*self_0).super_0,
6673 time,
6674 i,
6675 PATHCONSTRAINTMIX_X,
6676 curveType + 18 as c_int - 2 as c_int,
6677 );
6678 y = _spCurveTimeline_getBezierValue(
6679 &mut (*self_0).super_0,
6680 time,
6681 i,
6682 PATHCONSTRAINTMIX_Y,
6683 curveType + 18 as c_int * 2 as c_int - 2 as c_int,
6684 );
6685 }
6686 }
6687 if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint {
6688 let mut data: *mut spPathConstraintData = (*constraint).data;
6689 (*constraint).mixRotate = (*data).mixRotate + (rotate - (*data).mixRotate) * alpha;
6690 (*constraint).mixX = (*data).mixX + (x - (*data).mixX) * alpha;
6691 (*constraint).mixY = (*data).mixY + (y - (*data).mixY) * alpha;
6692 } else {
6693 (*constraint).mixRotate += (rotate - (*constraint).mixRotate) * alpha;
6694 (*constraint).mixX += (x - (*constraint).mixX) * alpha;
6695 (*constraint).mixY += (y - (*constraint).mixY) * alpha;
6696 };
6697}
6698#[no_mangle]
6699pub unsafe extern "C" fn spPathConstraintMixTimeline_create(
6700 mut framesCount: c_int,
6701 mut bezierCount: c_int,
6702 mut pathConstraintIndex: c_int,
6703) -> *mut spPathConstraintMixTimeline {
6704 let mut timeline: *mut spPathConstraintMixTimeline = _spCalloc(
6705 1 as c_int as size_t,
6706 ::core::mem::size_of::<spPathConstraintMixTimeline>() as c_ulong,
6707 (b"spine.c\0" as *const u8).cast::<c_char>(),
6708 2623 as c_int,
6709 )
6710 .cast::<spPathConstraintMixTimeline>();
6711 let mut ids: [spPropertyId; 1] = [0; 1];
6712 ids[0 as c_int as usize] = (SP_PROPERTY_PATHCONSTRAINT_MIX as c_int as spPropertyId)
6713 << 32 as c_int
6714 | pathConstraintIndex as c_ulong;
6715 _spCurveTimeline_init(
6716 &mut (*timeline).super_0,
6717 framesCount,
6718 PATHCONSTRAINTMIX_ENTRIES,
6719 bezierCount,
6720 ids.as_mut_ptr(),
6721 1 as c_int,
6722 SP_TIMELINE_PATHCONSTRAINTMIX,
6723 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
6724 Some(
6725 _spPathConstraintMixTimeline_apply
6726 as unsafe extern "C" fn(
6727 *mut spTimeline,
6728 *mut spSkeleton,
6729 c_float,
6730 c_float,
6731 *mut *mut spEvent,
6732 *mut c_int,
6733 c_float,
6734 spMixBlend,
6735 spMixDirection,
6736 ) -> (),
6737 ),
6738 Some(
6739 _spCurveTimeline_setBezier
6740 as unsafe extern "C" fn(
6741 *mut spTimeline,
6742 c_int,
6743 c_int,
6744 c_float,
6745 c_float,
6746 c_float,
6747 c_float,
6748 c_float,
6749 c_float,
6750 c_float,
6751 c_float,
6752 c_float,
6753 ) -> (),
6754 ),
6755 );
6756 (*timeline).pathConstraintIndex = pathConstraintIndex;
6757 timeline
6758}
6759#[no_mangle]
6760pub unsafe extern "C" fn spPathConstraintMixTimeline_setFrame(
6761 mut self_0: *mut spPathConstraintMixTimeline,
6762 mut frame: c_int,
6763 mut time: c_float,
6764 mut mixRotate: c_float,
6765 mut mixX: c_float,
6766 mut mixY: c_float,
6767) {
6768 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
6769 frame *= PATHCONSTRAINTMIX_ENTRIES;
6770 *frames.offset(frame as isize) = time;
6771 *frames.offset((frame + PATHCONSTRAINTMIX_ROTATE) as isize) = mixRotate;
6772 *frames.offset((frame + PATHCONSTRAINTMIX_X) as isize) = mixX;
6773 *frames.offset((frame + PATHCONSTRAINTMIX_Y) as isize) = mixY;
6774}
6775#[no_mangle]
6776pub unsafe extern "C" fn _spPhysicsConstraintTimeline_global(
6777 mut data: *mut spPhysicsConstraintData,
6778 mut type_0: spTimelineType,
6779) -> c_int {
6780 match type_0 as c_uint {
6781 19 => (*data).inertiaGlobal,
6782 20 => (*data).strengthGlobal,
6783 21 => (*data).dampingGlobal,
6784 22 => (*data).massGlobal,
6785 23 => (*data).windGlobal,
6786 24 => (*data).gravityGlobal,
6787 25 => (*data).mixGlobal,
6788 _ => 0 as c_int,
6789 }
6790}
6791#[no_mangle]
6792pub unsafe extern "C" fn _spPhysicsConstraintTimeline_set(
6793 mut constraint: *mut spPhysicsConstraint,
6794 mut type_0: spTimelineType,
6795 mut value: c_float,
6796) {
6797 match type_0 as c_uint {
6798 19 => {
6799 (*constraint).inertia = value;
6800 }
6801 20 => {
6802 (*constraint).strength = value;
6803 }
6804 21 => {
6805 (*constraint).damping = value;
6806 }
6807 22 => {
6808 (*constraint).massInverse = value;
6809 }
6810 23 => {
6811 (*constraint).wind = value;
6812 }
6813 24 => {
6814 (*constraint).gravity = value;
6815 }
6816 25 => {
6817 (*constraint).mix = value;
6818 }
6819 _ => {}
6820 };
6821}
6822#[no_mangle]
6823pub unsafe extern "C" fn _spPhysicsConstraintTimeline_get(
6824 mut constraint: *mut spPhysicsConstraint,
6825 mut type_0: spTimelineType,
6826) -> c_float {
6827 match type_0 as c_uint {
6828 19 => (*constraint).inertia,
6829 20 => (*constraint).strength,
6830 21 => (*constraint).damping,
6831 22 => (*constraint).massInverse,
6832 23 => (*constraint).wind,
6833 24 => (*constraint).gravity,
6834 25 => (*constraint).mix,
6835 _ => 0 as c_int as c_float,
6836 }
6837}
6838#[no_mangle]
6839pub unsafe extern "C" fn _spPhysicsConstraintTimeline_setup(
6840 mut constraint: *mut spPhysicsConstraint,
6841 mut type_0: spTimelineType,
6842) -> c_float {
6843 match type_0 as c_uint {
6844 19 => (*(*constraint).data).inertia,
6845 20 => (*(*constraint).data).strength,
6846 21 => (*(*constraint).data).damping,
6847 22 => (*(*constraint).data).massInverse,
6848 23 => (*(*constraint).data).wind,
6849 24 => (*(*constraint).data).gravity,
6850 25 => (*(*constraint).data).mix,
6851 _ => 0 as c_int as c_float,
6852 }
6853}
6854#[no_mangle]
6855pub unsafe extern "C" fn _spPhysicsConstraintTimeline_apply(
6856 mut timeline: *mut spTimeline,
6857 mut skeleton: *mut spSkeleton,
6858 mut _lastTime: c_float,
6859 mut time: c_float,
6860 mut _firedEvents: *mut *mut spEvent,
6861 mut _eventsCount: *mut c_int,
6862 mut alpha: c_float,
6863 mut blend: spMixBlend,
6864 mut _direction: spMixDirection,
6865) {
6866 let mut self_0: *mut spPhysicsConstraintTimeline =
6867 timeline.cast::<spPhysicsConstraintTimeline>();
6868 let mut type_0: spTimelineType = (*self_0).super_0.super_0.type_0;
6869 let mut frames: *mut c_float = (*(*self_0).super_0.super_0.frames).items;
6870 if (*self_0).physicsConstraintIndex == -(1 as c_int) {
6871 let mut value: c_float = if time >= *frames.offset(0 as c_int as isize) {
6872 spCurveTimeline1_getCurveValue(&mut (*self_0).super_0, time)
6873 } else {
6874 0 as c_int as c_float
6875 };
6876 let mut physicsConstraints: *mut *mut spPhysicsConstraint = (*skeleton).physicsConstraints;
6877 let mut i: c_int = 0 as c_int;
6878 while i < (*skeleton).physicsConstraintsCount {
6879 let mut constraint: *mut spPhysicsConstraint = *physicsConstraints.offset(i as isize);
6880 if (*constraint).active != 0
6881 && _spPhysicsConstraintTimeline_global((*constraint).data, type_0) != 0
6882 {
6883 _spPhysicsConstraintTimeline_set(
6884 constraint,
6885 type_0,
6886 spCurveTimeline1_getAbsoluteValue2(
6887 &mut (*self_0).super_0,
6888 time,
6889 alpha,
6890 blend,
6891 _spPhysicsConstraintTimeline_get(constraint, type_0),
6892 _spPhysicsConstraintTimeline_setup(constraint, type_0),
6893 value,
6894 ),
6895 );
6896 }
6897 i += 1;
6898 }
6899 } else {
6900 let mut constraint_0: *mut spPhysicsConstraint =
6901 *((*skeleton).physicsConstraints).offset((*self_0).physicsConstraintIndex as isize);
6902 if (*constraint_0).active != 0 {
6903 _spPhysicsConstraintTimeline_set(
6904 constraint_0,
6905 type_0,
6906 spCurveTimeline1_getAbsoluteValue(
6907 &mut (*self_0).super_0,
6908 time,
6909 alpha,
6910 blend,
6911 _spPhysicsConstraintTimeline_get(constraint_0, type_0),
6912 _spPhysicsConstraintTimeline_setup(constraint_0, type_0),
6913 ),
6914 );
6915 }
6916 };
6917}
6918#[no_mangle]
6919pub unsafe extern "C" fn spPhysicsConstraintTimeline_create(
6920 mut frameCount: c_int,
6921 mut bezierCount: c_int,
6922 mut physicsConstraintIndex: c_int,
6923 mut type_0: spTimelineType,
6924) -> *mut spPhysicsConstraintTimeline {
6925 let mut timeline: *mut spPhysicsConstraintTimeline = _spCalloc(
6926 1 as c_int as size_t,
6927 ::core::mem::size_of::<spPhysicsConstraintTimeline>() as c_ulong,
6928 (b"spine.c\0" as *const u8).cast::<c_char>(),
6929 2767 as c_int,
6930 )
6931 .cast::<spPhysicsConstraintTimeline>();
6932 let mut ids: [spPropertyId; 1] = [0; 1];
6933 let mut id: spPropertyId = 0;
6934 match type_0 as c_uint {
6935 19 => {
6936 id = SP_PROPERTY_PHYSICSCONSTRAINT_INERTIA as c_int as spPropertyId;
6937 }
6938 20 => {
6939 id = SP_PROPERTY_PHYSICSCONSTRAINT_STRENGTH as c_int as spPropertyId;
6940 }
6941 21 => {
6942 id = SP_PROPERTY_PHYSICSCONSTRAINT_DAMPING as c_int as spPropertyId;
6943 }
6944 22 => {
6945 id = SP_PROPERTY_PHYSICSCONSTRAINT_MASS as c_int as spPropertyId;
6946 }
6947 23 => {
6948 id = SP_PROPERTY_PHYSICSCONSTRAINT_WIND as c_int as spPropertyId;
6949 }
6950 24 => {
6951 id = SP_PROPERTY_PHYSICSCONSTRAINT_GRAVITY as c_int as spPropertyId;
6952 }
6953 25 => {
6954 id = SP_PROPERTY_PHYSICSCONSTRAINT_MIX as c_int as spPropertyId;
6955 }
6956 _ => {
6957 id = SP_PROPERTY_PHYSICSCONSTRAINT_INERTIA as c_int as spPropertyId;
6958 }
6959 }
6960 ids[0 as c_int as usize] = id << 32 as c_int | physicsConstraintIndex as c_ulong;
6961 _spCurveTimeline_init(
6962 &mut (*timeline).super_0,
6963 frameCount,
6964 2 as c_int,
6965 bezierCount,
6966 ids.as_mut_ptr(),
6967 1 as c_int,
6968 type_0,
6969 Some(_spCurveTimeline_dispose as unsafe extern "C" fn(*mut spTimeline) -> ()),
6970 Some(
6971 _spPhysicsConstraintTimeline_apply
6972 as unsafe extern "C" fn(
6973 *mut spTimeline,
6974 *mut spSkeleton,
6975 c_float,
6976 c_float,
6977 *mut *mut spEvent,
6978 *mut c_int,
6979 c_float,
6980 spMixBlend,
6981 spMixDirection,
6982 ) -> (),
6983 ),
6984 Some(
6985 _spCurveTimeline_setBezier
6986 as unsafe extern "C" fn(
6987 *mut spTimeline,
6988 c_int,
6989 c_int,
6990 c_float,
6991 c_float,
6992 c_float,
6993 c_float,
6994 c_float,
6995 c_float,
6996 c_float,
6997 c_float,
6998 c_float,
6999 ) -> (),
7000 ),
7001 );
7002 (*timeline).physicsConstraintIndex = physicsConstraintIndex;
7003 timeline
7004}
7005#[no_mangle]
7006pub unsafe extern "C" fn spPhysicsConstraintTimeline_setFrame(
7007 mut self_0: *mut spPhysicsConstraintTimeline,
7008 mut frame: c_int,
7009 mut time: c_float,
7010 mut value: c_float,
7011) {
7012 spCurveTimeline1_setFrame(&mut (*self_0).super_0, frame, time, value);
7013}
7014#[no_mangle]
7015pub unsafe extern "C" fn _spPhysicsConstraintResetTimeline_apply(
7016 mut timeline: *mut spTimeline,
7017 mut skeleton: *mut spSkeleton,
7018 mut lastTime: c_float,
7019 mut time: c_float,
7020 mut _firedEvents: *mut *mut spEvent,
7021 mut _eventsCount: *mut c_int,
7022 mut alpha: c_float,
7023 mut blend: spMixBlend,
7024 mut direction: spMixDirection,
7025) {
7026 let mut self_0: *mut spPhysicsConstraintResetTimeline =
7027 timeline.cast::<spPhysicsConstraintResetTimeline>();
7028 let mut constraint: *mut spPhysicsConstraint = std::ptr::null_mut::<spPhysicsConstraint>();
7029 if (*self_0).physicsConstraintIndex != -(1 as c_int) {
7030 constraint =
7031 *((*skeleton).physicsConstraints).offset((*self_0).physicsConstraintIndex as isize);
7032 if (*constraint).active == 0 {
7033 return;
7034 }
7035 }
7036 let mut frames: *mut c_float = (*(*self_0).super_0.frames).items;
7037 if lastTime > time {
7038 _spPhysicsConstraintResetTimeline_apply(
7039 &mut (*self_0).super_0,
7040 skeleton,
7041 lastTime,
7042 0x7fffffff as c_int as c_float,
7043 std::ptr::null_mut::<*mut spEvent>(),
7044 std::ptr::null_mut::<c_int>(),
7045 alpha,
7046 blend,
7047 direction,
7048 );
7049 lastTime = -(1 as c_int) as c_float;
7050 } else if lastTime >= *frames.offset(((*self_0).super_0.frameCount - 1 as c_int) as isize) {
7051 return;
7052 }
7053 if time < *frames.offset(0 as c_int as isize) {
7054 return;
7055 }
7056 if lastTime < *frames.offset(0 as c_int as isize)
7057 || time
7058 >= *frames.offset((search((*self_0).super_0.frames, lastTime) + 1 as c_int) as isize)
7059 {
7060 if !constraint.is_null() {
7061 spPhysicsConstraint_reset(constraint);
7062 } else {
7063 let mut physicsConstraints: *mut *mut spPhysicsConstraint =
7064 (*skeleton).physicsConstraints;
7065 let mut i: c_int = 0 as c_int;
7066 while i < (*skeleton).physicsConstraintsCount {
7067 constraint = *physicsConstraints.offset(i as isize);
7068 if (*constraint).active != 0 {
7069 spPhysicsConstraint_reset(constraint);
7070 }
7071 i += 1;
7072 }
7073 }
7074 }
7075}
7076#[no_mangle]
7077pub unsafe extern "C" fn _spPhysicsConstraintResetTimeline_dispose(mut _timeline: *mut spTimeline) {
7078}
7079#[no_mangle]
7080pub unsafe extern "C" fn spPhysicsConstraintResetTimeline_create(
7081 mut framesCount: c_int,
7082 mut physicsConstraintIndex: c_int,
7083) -> *mut spPhysicsConstraintResetTimeline {
7084 let mut self_0: *mut spPhysicsConstraintResetTimeline = _spCalloc(
7085 1 as c_int as size_t,
7086 ::core::mem::size_of::<spPhysicsConstraintResetTimeline>() as c_ulong,
7087 (b"spine.c\0" as *const u8).cast::<c_char>(),
7088 2851 as c_int,
7089 )
7090 .cast::<spPhysicsConstraintResetTimeline>();
7091 let mut ids: [spPropertyId; 1] = [0; 1];
7092 ids[0 as c_int as usize] =
7093 (SP_PROPERTY_PHYSICSCONSTRAINT_RESET as c_int as spPropertyId) << 32 as c_int;
7094 _spTimeline_init(
7095 &mut (*self_0).super_0,
7096 framesCount,
7097 1 as c_int,
7098 ids.as_mut_ptr(),
7099 1 as c_int,
7100 SP_TIMELINE_PHYSICSCONSTRAINT_RESET,
7101 Some(
7102 _spPhysicsConstraintResetTimeline_dispose
7103 as unsafe extern "C" fn(*mut spTimeline) -> (),
7104 ),
7105 Some(
7106 _spPhysicsConstraintResetTimeline_apply
7107 as unsafe extern "C" fn(
7108 *mut spTimeline,
7109 *mut spSkeleton,
7110 c_float,
7111 c_float,
7112 *mut *mut spEvent,
7113 *mut c_int,
7114 c_float,
7115 spMixBlend,
7116 spMixDirection,
7117 ) -> (),
7118 ),
7119 None,
7120 );
7121 (*self_0).physicsConstraintIndex = physicsConstraintIndex;
7122 self_0
7123}
7124#[no_mangle]
7125pub unsafe extern "C" fn spPhysicsConstraintResetTimeline_setFrame(
7126 mut self_0: *mut spPhysicsConstraintResetTimeline,
7127 mut frame: c_int,
7128 mut time: c_float,
7129) {
7130 *((*(*self_0).super_0.frames).items).offset(frame as isize) = time;
7131}
7132#[no_mangle]
7133pub unsafe extern "C" fn spTrackEntryArray_create(
7134 mut initialCapacity: c_int,
7135) -> *mut spTrackEntryArray {
7136 let mut array: *mut spTrackEntryArray = _spCalloc(
7137 1 as c_int as size_t,
7138 ::core::mem::size_of::<spTrackEntryArray>() as c_ulong,
7139 (b"spine.c\0" as *const u8).cast::<c_char>(),
7140 2907 as c_int,
7141 )
7142 .cast::<spTrackEntryArray>();
7143 (*array).size = 0 as c_int;
7144 (*array).capacity = initialCapacity;
7145 (*array).items = _spCalloc(
7146 initialCapacity as size_t,
7147 ::core::mem::size_of::<*mut spTrackEntry>() as c_ulong,
7148 (b"spine.c\0" as *const u8).cast::<c_char>(),
7149 2907 as c_int,
7150 )
7151 .cast::<*mut spTrackEntry>();
7152 array
7153}
7154#[no_mangle]
7155pub unsafe extern "C" fn spTrackEntryArray_dispose(mut self_0: *mut spTrackEntryArray) {
7156 _spFree((*self_0).items.cast::<c_void>());
7157 _spFree(self_0.cast::<c_void>());
7158}
7159#[no_mangle]
7160pub unsafe extern "C" fn spTrackEntryArray_clear(mut self_0: *mut spTrackEntryArray) {
7161 (*self_0).size = 0 as c_int;
7162}
7163#[no_mangle]
7164pub unsafe extern "C" fn spTrackEntryArray_setSize(
7165 mut self_0: *mut spTrackEntryArray,
7166 mut newSize: c_int,
7167) -> *mut spTrackEntryArray {
7168 (*self_0).size = newSize;
7169 if (*self_0).capacity < newSize {
7170 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
7171 8 as c_int
7172 } else {
7173 ((*self_0).size as c_float * 1.75f32) as c_int
7174 };
7175 (*self_0).items = _spRealloc(
7176 (*self_0).items.cast::<c_void>(),
7177 (::core::mem::size_of::<*mut spTrackEntry>() as c_ulong)
7178 .wrapping_mul((*self_0).capacity as c_ulong),
7179 )
7180 .cast::<*mut spTrackEntry>();
7181 }
7182 self_0
7183}
7184#[no_mangle]
7185pub unsafe extern "C" fn spTrackEntryArray_ensureCapacity(
7186 mut self_0: *mut spTrackEntryArray,
7187 mut newCapacity: c_int,
7188) {
7189 if (*self_0).capacity >= newCapacity {
7190 return;
7191 }
7192 (*self_0).capacity = newCapacity;
7193 (*self_0).items = _spRealloc(
7194 (*self_0).items.cast::<c_void>(),
7195 (::core::mem::size_of::<*mut spTrackEntry>() as c_ulong)
7196 .wrapping_mul((*self_0).capacity as c_ulong),
7197 )
7198 .cast::<*mut spTrackEntry>();
7199}
7200#[no_mangle]
7201pub unsafe extern "C" fn spTrackEntryArray_add(
7202 mut self_0: *mut spTrackEntryArray,
7203 mut value: *mut spTrackEntry,
7204) {
7205 if (*self_0).size == (*self_0).capacity {
7206 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
7207 8 as c_int
7208 } else {
7209 ((*self_0).size as c_float * 1.75f32) as c_int
7210 };
7211 (*self_0).items = _spRealloc(
7212 (*self_0).items.cast::<c_void>(),
7213 (::core::mem::size_of::<*mut spTrackEntry>() as c_ulong)
7214 .wrapping_mul((*self_0).capacity as c_ulong),
7215 )
7216 .cast::<*mut spTrackEntry>();
7217 }
7218 let fresh12 = (*self_0).size;
7219 (*self_0).size += 1;
7220 let fresh13 = &mut (*((*self_0).items).offset(fresh12 as isize));
7221 *fresh13 = value;
7222}
7223#[no_mangle]
7224pub unsafe extern "C" fn spTrackEntryArray_addAll(
7225 mut self_0: *mut spTrackEntryArray,
7226 mut other: *mut spTrackEntryArray,
7227) {
7228 let mut i: c_int = 0 as c_int;
7229 while i < (*other).size {
7230 spTrackEntryArray_add(self_0, *((*other).items).offset(i as isize));
7231 i += 1;
7232 }
7233}
7234#[no_mangle]
7235pub unsafe extern "C" fn spTrackEntryArray_addAllValues(
7236 mut self_0: *mut spTrackEntryArray,
7237 mut values: *mut *mut spTrackEntry,
7238 mut offset: c_int,
7239 mut count: c_int,
7240) {
7241 let mut i: c_int = offset;
7242 let mut n: c_int = offset + count;
7243 while i < n {
7244 spTrackEntryArray_add(self_0, *values.offset(i as isize));
7245 i += 1;
7246 }
7247}
7248#[no_mangle]
7249pub unsafe extern "C" fn spTrackEntryArray_removeAt(
7250 mut self_0: *mut spTrackEntryArray,
7251 mut index: c_int,
7252) {
7253 (*self_0).size -= 1;
7254 spine_memmove(
7255 ((*self_0).items).offset(index as isize).cast::<c_void>(),
7256 ((*self_0).items)
7257 .offset(index as isize)
7258 .offset(1 as c_int as isize) as *const c_void,
7259 (::core::mem::size_of::<*mut spTrackEntry>() as c_ulong)
7260 .wrapping_mul(((*self_0).size - index) as c_ulong),
7261 );
7262}
7263#[no_mangle]
7264pub unsafe extern "C" fn spTrackEntryArray_contains(
7265 mut self_0: *mut spTrackEntryArray,
7266 mut value: *mut spTrackEntry,
7267) -> c_int {
7268 let mut items: *mut *mut spTrackEntry = (*self_0).items;
7269 let mut i: c_int = 0;
7270 let mut n: c_int = 0;
7271 i = 0 as c_int;
7272 n = (*self_0).size;
7273 while i < n {
7274 if *items.offset(i as isize) == value {
7275 return -(1 as c_int);
7276 }
7277 i += 1;
7278 }
7279 0 as c_int
7280}
7281#[no_mangle]
7282pub unsafe extern "C" fn spTrackEntryArray_pop(
7283 mut self_0: *mut spTrackEntryArray,
7284) -> *mut spTrackEntry {
7285 (*self_0).size -= 1;
7286 let mut item: *mut spTrackEntry = *((*self_0).items).offset((*self_0).size as isize);
7287 item
7288}
7289#[no_mangle]
7290pub unsafe extern "C" fn spTrackEntryArray_peek(
7291 mut self_0: *mut spTrackEntryArray,
7292) -> *mut spTrackEntry {
7293 *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize)
7294}
7295static mut SP_EMPTY_ANIMATION: *mut spAnimation = (0 as *const spAnimation).cast_mut();
7296#[no_mangle]
7297pub unsafe extern "C" fn spAnimationState_disposeStatics() {
7298 if !SP_EMPTY_ANIMATION.is_null() {
7299 spAnimation_dispose(SP_EMPTY_ANIMATION);
7300 }
7301 SP_EMPTY_ANIMATION = std::ptr::null_mut::<spAnimation>();
7302}
7303#[no_mangle]
7304pub unsafe extern "C" fn _spEventQueue_create(
7305 mut state: *mut _spAnimationState,
7306) -> *mut _spEventQueue {
7307 let mut self_0: *mut _spEventQueue = _spCalloc(
7308 1 as c_int as size_t,
7309 ::core::mem::size_of::<_spEventQueue>() as c_ulong,
7310 (b"spine.c\0" as *const u8).cast::<c_char>(),
7311 2955 as c_int,
7312 )
7313 .cast::<_spEventQueue>();
7314 (*self_0).state = state;
7315 (*self_0).objectsCount = 0 as c_int;
7316 (*self_0).objectsCapacity = 16 as c_int;
7317 (*self_0).objects = _spCalloc(
7318 (*self_0).objectsCapacity as size_t,
7319 ::core::mem::size_of::<_spEventQueueItem>() as c_ulong,
7320 (b"spine.c\0" as *const u8).cast::<c_char>(),
7321 2959 as c_int,
7322 )
7323 .cast::<_spEventQueueItem>();
7324 (*self_0).drainDisabled = 0 as c_int;
7325 self_0
7326}
7327#[no_mangle]
7328pub unsafe extern "C" fn _spEventQueue_free(mut self_0: *mut _spEventQueue) {
7329 _spFree((*self_0).objects.cast::<c_void>());
7330 _spFree(self_0.cast::<c_void>());
7331}
7332#[no_mangle]
7333pub unsafe extern "C" fn _spEventQueue_ensureCapacity(
7334 mut self_0: *mut _spEventQueue,
7335 mut newElements: c_int,
7336) {
7337 if (*self_0).objectsCount + newElements > (*self_0).objectsCapacity {
7338 let mut newObjects: *mut _spEventQueueItem = std::ptr::null_mut::<_spEventQueueItem>();
7339 (*self_0).objectsCapacity <<= 1 as c_int;
7340 newObjects = _spCalloc(
7341 (*self_0).objectsCapacity as size_t,
7342 ::core::mem::size_of::<_spEventQueueItem>() as c_ulong,
7343 (b"spine.c\0" as *const u8).cast::<c_char>(),
7344 2973 as c_int,
7345 )
7346 .cast::<_spEventQueueItem>();
7347 spine_memcpy(
7348 newObjects.cast::<c_void>(),
7349 (*self_0).objects as *const c_void,
7350 (::core::mem::size_of::<_spEventQueueItem>() as c_ulong)
7351 .wrapping_mul((*self_0).objectsCount as c_ulong),
7352 );
7353 _spFree((*self_0).objects.cast::<c_void>());
7354 (*self_0).objects = newObjects;
7355 }
7356}
7357#[no_mangle]
7358pub unsafe extern "C" fn _spEventQueue_addType(
7359 mut self_0: *mut _spEventQueue,
7360 mut type_0: spEventType,
7361) {
7362 _spEventQueue_ensureCapacity(self_0, 1 as c_int);
7363 let fresh14 = (*self_0).objectsCount;
7364 (*self_0).objectsCount += 1;
7365 (*((*self_0).objects).offset(fresh14 as isize)).type_0 = type_0 as c_int;
7366}
7367#[no_mangle]
7368pub unsafe extern "C" fn _spEventQueue_addEntry(
7369 mut self_0: *mut _spEventQueue,
7370 mut entry: *mut spTrackEntry,
7371) {
7372 _spEventQueue_ensureCapacity(self_0, 1 as c_int);
7373 let fresh15 = (*self_0).objectsCount;
7374 (*self_0).objectsCount += 1;
7375 let fresh16 = &mut (*((*self_0).objects).offset(fresh15 as isize)).entry;
7376 *fresh16 = entry;
7377}
7378#[no_mangle]
7379pub unsafe extern "C" fn _spEventQueue_addEvent(
7380 mut self_0: *mut _spEventQueue,
7381 mut event: *mut spEvent,
7382) {
7383 _spEventQueue_ensureCapacity(self_0, 1 as c_int);
7384 let fresh17 = (*self_0).objectsCount;
7385 (*self_0).objectsCount += 1;
7386 let fresh18 = &mut (*((*self_0).objects).offset(fresh17 as isize)).event;
7387 *fresh18 = event;
7388}
7389#[no_mangle]
7390pub unsafe extern "C" fn _spEventQueue_start(
7391 mut self_0: *mut _spEventQueue,
7392 mut entry: *mut spTrackEntry,
7393) {
7394 _spEventQueue_addType(self_0, SP_ANIMATION_START);
7395 _spEventQueue_addEntry(self_0, entry);
7396 (*(*self_0).state).animationsChanged = 1 as c_int;
7397}
7398#[no_mangle]
7399pub unsafe extern "C" fn _spEventQueue_interrupt(
7400 mut self_0: *mut _spEventQueue,
7401 mut entry: *mut spTrackEntry,
7402) {
7403 _spEventQueue_addType(self_0, SP_ANIMATION_INTERRUPT);
7404 _spEventQueue_addEntry(self_0, entry);
7405}
7406#[no_mangle]
7407pub unsafe extern "C" fn _spEventQueue_end(
7408 mut self_0: *mut _spEventQueue,
7409 mut entry: *mut spTrackEntry,
7410) {
7411 _spEventQueue_addType(self_0, SP_ANIMATION_END);
7412 _spEventQueue_addEntry(self_0, entry);
7413 (*(*self_0).state).animationsChanged = 1 as c_int;
7414}
7415#[no_mangle]
7416pub unsafe extern "C" fn _spEventQueue_dispose(
7417 mut self_0: *mut _spEventQueue,
7418 mut entry: *mut spTrackEntry,
7419) {
7420 _spEventQueue_addType(self_0, SP_ANIMATION_DISPOSE);
7421 _spEventQueue_addEntry(self_0, entry);
7422}
7423#[no_mangle]
7424pub unsafe extern "C" fn _spEventQueue_complete(
7425 mut self_0: *mut _spEventQueue,
7426 mut entry: *mut spTrackEntry,
7427) {
7428 _spEventQueue_addType(self_0, SP_ANIMATION_COMPLETE);
7429 _spEventQueue_addEntry(self_0, entry);
7430}
7431#[no_mangle]
7432pub unsafe extern "C" fn _spEventQueue_event(
7433 mut self_0: *mut _spEventQueue,
7434 mut entry: *mut spTrackEntry,
7435 mut event: *mut spEvent,
7436) {
7437 _spEventQueue_addType(self_0, SP_ANIMATION_EVENT);
7438 _spEventQueue_addEntry(self_0, entry);
7439 _spEventQueue_addEvent(self_0, event);
7440}
7441#[no_mangle]
7442pub unsafe extern "C" fn _spEventQueue_clear(mut self_0: *mut _spEventQueue) {
7443 (*self_0).objectsCount = 0 as c_int;
7444}
7445#[no_mangle]
7446pub unsafe extern "C" fn _spEventQueue_drain(mut self_0: *mut _spEventQueue) {
7447 let mut i: c_int = 0;
7448 if (*self_0).drainDisabled != 0 {
7449 return;
7450 }
7451 (*self_0).drainDisabled = 1 as c_int;
7452 i = 0 as c_int;
7453 while i < (*self_0).objectsCount {
7454 let mut type_0: spEventType =
7455 (*((*self_0).objects).offset(i as isize)).type_0 as spEventType;
7456 let mut entry: *mut spTrackEntry =
7457 (*((*self_0).objects).offset((i + 1 as c_int) as isize)).entry;
7458 let mut event: *mut spEvent = std::ptr::null_mut::<spEvent>();
7459 let mut current_block_22: u64;
7460 match type_0 as c_uint {
7461 0 | 1 | 3 => {
7462 if ((*entry).listener).is_some() {
7463 ((*entry).listener).expect("non-null function pointer")(
7464 &mut (*(*self_0).state).super_0,
7465 type_0,
7466 entry,
7467 std::ptr::null_mut::<spEvent>(),
7468 );
7469 }
7470 if ((*(*self_0).state).super_0.listener).is_some() {
7471 ((*(*self_0).state).super_0.listener).expect("non-null function pointer")(
7472 &mut (*(*self_0).state).super_0,
7473 type_0,
7474 entry,
7475 std::ptr::null_mut::<spEvent>(),
7476 );
7477 }
7478 current_block_22 = 10043043949733653460;
7479 }
7480 2 => {
7481 if ((*entry).listener).is_some() {
7482 ((*entry).listener).expect("non-null function pointer")(
7483 &mut (*(*self_0).state).super_0,
7484 type_0,
7485 entry,
7486 std::ptr::null_mut::<spEvent>(),
7487 );
7488 }
7489 if ((*(*self_0).state).super_0.listener).is_some() {
7490 ((*(*self_0).state).super_0.listener).expect("non-null function pointer")(
7491 &mut (*(*self_0).state).super_0,
7492 type_0,
7493 entry,
7494 std::ptr::null_mut::<spEvent>(),
7495 );
7496 }
7497 current_block_22 = 8217970944285102440;
7498 }
7499 4 => {
7500 current_block_22 = 8217970944285102440;
7501 }
7502 5 => {
7503 event = (*((*self_0).objects).offset((i + 2 as c_int) as isize)).event;
7504 if ((*entry).listener).is_some() {
7505 ((*entry).listener).expect("non-null function pointer")(
7506 &mut (*(*self_0).state).super_0,
7507 type_0,
7508 entry,
7509 event,
7510 );
7511 }
7512 if ((*(*self_0).state).super_0.listener).is_some() {
7513 ((*(*self_0).state).super_0.listener).expect("non-null function pointer")(
7514 &mut (*(*self_0).state).super_0,
7515 type_0,
7516 entry,
7517 event,
7518 );
7519 }
7520 i += 1;
7521 current_block_22 = 10043043949733653460;
7522 }
7523 _ => {
7524 current_block_22 = 10043043949733653460;
7525 }
7526 }
7527 match current_block_22 {
7528 8217970944285102440 => {
7529 if ((*entry).listener).is_some() {
7530 ((*entry).listener).expect("non-null function pointer")(
7531 &mut (*(*self_0).state).super_0,
7532 SP_ANIMATION_DISPOSE,
7533 entry,
7534 std::ptr::null_mut::<spEvent>(),
7535 );
7536 }
7537 if ((*(*self_0).state).super_0.listener).is_some() {
7538 ((*(*self_0).state).super_0.listener).expect("non-null function pointer")(
7539 &mut (*(*self_0).state).super_0,
7540 SP_ANIMATION_DISPOSE,
7541 entry,
7542 std::ptr::null_mut::<spEvent>(),
7543 );
7544 }
7545 _spAnimationState_disposeTrackEntry(entry);
7546 }
7547 _ => {}
7548 }
7549 i += 2 as c_int;
7550 }
7551 _spEventQueue_clear(self_0);
7552 (*self_0).drainDisabled = 0 as c_int;
7553}
7554#[no_mangle]
7555pub unsafe extern "C" fn _spAnimationState_enableQueue(mut self_0: *mut spAnimationState) {
7556 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
7557 (*(*internal).queue).drainDisabled = 0 as c_int;
7558}
7559#[no_mangle]
7560pub unsafe extern "C" fn _spAnimationState_disableQueue(mut self_0: *mut spAnimationState) {
7561 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
7562 (*(*internal).queue).drainDisabled = 1 as c_int;
7563}
7564#[no_mangle]
7565pub unsafe extern "C" fn _spAnimationState_disposeTrackEntry(mut entry: *mut spTrackEntry) {
7566 spIntArray_dispose((*entry).timelineMode);
7567 spTrackEntryArray_dispose((*entry).timelineHoldMix);
7568 _spFree((*entry).timelinesRotation.cast::<c_void>());
7569 _spFree(entry.cast::<c_void>());
7570}
7571#[no_mangle]
7572pub unsafe extern "C" fn _spAnimationState_disposeTrackEntries(
7573 mut state: *mut spAnimationState,
7574 mut entry: *mut spTrackEntry,
7575) {
7576 while !entry.is_null() {
7577 let mut next: *mut spTrackEntry = (*entry).next;
7578 let mut from: *mut spTrackEntry = (*entry).mixingFrom;
7579 while !from.is_null() {
7580 let mut nextFrom: *mut spTrackEntry = (*from).mixingFrom;
7581 if ((*entry).listener).is_some() {
7582 ((*entry).listener).expect("non-null function pointer")(
7583 state,
7584 SP_ANIMATION_DISPOSE,
7585 from,
7586 std::ptr::null_mut::<spEvent>(),
7587 );
7588 }
7589 if ((*state).listener).is_some() {
7590 ((*state).listener).expect("non-null function pointer")(
7591 state,
7592 SP_ANIMATION_DISPOSE,
7593 from,
7594 std::ptr::null_mut::<spEvent>(),
7595 );
7596 }
7597 _spAnimationState_disposeTrackEntry(from);
7598 from = nextFrom;
7599 }
7600 if ((*entry).listener).is_some() {
7601 ((*entry).listener).expect("non-null function pointer")(
7602 state,
7603 SP_ANIMATION_DISPOSE,
7604 entry,
7605 std::ptr::null_mut::<spEvent>(),
7606 );
7607 }
7608 if ((*state).listener).is_some() {
7609 ((*state).listener).expect("non-null function pointer")(
7610 state,
7611 SP_ANIMATION_DISPOSE,
7612 entry,
7613 std::ptr::null_mut::<spEvent>(),
7614 );
7615 }
7616 _spAnimationState_disposeTrackEntry(entry);
7617 entry = next;
7618 }
7619}
7620#[no_mangle]
7621pub unsafe extern "C" fn spAnimationState_create(
7622 mut data: *mut spAnimationStateData,
7623) -> *mut spAnimationState {
7624 let mut internal: *mut _spAnimationState = std::ptr::null_mut::<_spAnimationState>();
7625 let mut self_0: *mut spAnimationState = std::ptr::null_mut::<spAnimationState>();
7626 if SP_EMPTY_ANIMATION.is_null() {
7627 SP_EMPTY_ANIMATION = 1 as c_int as *mut spAnimation;
7628 SP_EMPTY_ANIMATION = spAnimation_create(
7629 (b"<empty>\0" as *const u8).cast::<c_char>(),
7630 std::ptr::null_mut::<spTimelineArray>(),
7631 0 as c_int as c_float,
7632 );
7633 }
7634 internal = _spCalloc(
7635 1 as c_int as size_t,
7636 ::core::mem::size_of::<_spAnimationState>() as c_ulong,
7637 (b"spine.c\0" as *const u8).cast::<c_char>(),
7638 3115 as c_int,
7639 )
7640 .cast::<_spAnimationState>();
7641 self_0 = &mut (*internal).super_0;
7642 (*self_0).data = data;
7643 (*self_0).timeScale = 1 as c_int as c_float;
7644 (*internal).queue = _spEventQueue_create(internal);
7645 (*internal).events = _spCalloc(
7646 128 as c_int as size_t,
7647 ::core::mem::size_of::<*mut spEvent>() as c_ulong,
7648 (b"spine.c\0" as *const u8).cast::<c_char>(),
7649 3122 as c_int,
7650 )
7651 .cast::<*mut spEvent>();
7652 (*internal).propertyIDs = _spCalloc(
7653 128 as c_int as size_t,
7654 ::core::mem::size_of::<spPropertyId>() as c_ulong,
7655 (b"spine.c\0" as *const u8).cast::<c_char>(),
7656 3124 as c_int,
7657 )
7658 .cast::<spPropertyId>();
7659 (*internal).propertyIDsCapacity = 128 as c_int;
7660 self_0
7661}
7662#[no_mangle]
7663pub unsafe extern "C" fn spAnimationState_dispose(mut self_0: *mut spAnimationState) {
7664 let mut i: c_int = 0;
7665 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
7666 i = 0 as c_int;
7667 while i < (*self_0).tracksCount {
7668 _spAnimationState_disposeTrackEntries(self_0, *((*self_0).tracks).offset(i as isize));
7669 i += 1;
7670 }
7671 _spFree((*self_0).tracks.cast::<c_void>());
7672 _spEventQueue_free((*internal).queue);
7673 _spFree((*internal).events.cast::<c_void>());
7674 _spFree((*internal).propertyIDs.cast::<c_void>());
7675 _spFree(internal.cast::<c_void>());
7676}
7677#[no_mangle]
7678pub unsafe extern "C" fn spAnimationState_update(
7679 mut self_0: *mut spAnimationState,
7680 mut delta: c_float,
7681) {
7682 let mut i: c_int = 0;
7683 let mut n: c_int = 0;
7684 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
7685 delta *= (*self_0).timeScale;
7686 let mut current_block_29: u64;
7687 i = 0 as c_int;
7688 n = (*self_0).tracksCount;
7689 while i < n {
7690 let mut currentDelta: c_float = 0.;
7691 let mut current: *mut spTrackEntry = *((*self_0).tracks).offset(i as isize);
7692 let mut next: *mut spTrackEntry = std::ptr::null_mut::<spTrackEntry>();
7693 if !current.is_null() {
7694 (*current).animationLast = (*current).nextAnimationLast;
7695 (*current).trackLast = (*current).nextTrackLast;
7696 currentDelta = delta * (*current).timeScale;
7697 if (*current).delay > 0 as c_int as c_float {
7698 (*current).delay -= currentDelta;
7699 if (*current).delay > 0 as c_int as c_float {
7700 current_block_29 = 16559507199688588974;
7701 } else {
7702 currentDelta = -(*current).delay;
7703 (*current).delay = 0 as c_int as c_float;
7704 current_block_29 = 17965632435239708295;
7705 }
7706 } else {
7707 current_block_29 = 17965632435239708295;
7708 }
7709 match current_block_29 {
7710 16559507199688588974 => {}
7711 _ => {
7712 next = (*current).next;
7713 if !next.is_null() {
7714 let mut nextTime: c_float = (*current).trackLast - (*next).delay;
7715 if nextTime >= 0 as c_int as c_float {
7716 (*next).delay = 0 as c_int as c_float;
7717 (*next).trackTime += if (*current).timeScale == 0 as c_int as c_float {
7718 0 as c_int as c_float
7719 } else {
7720 (nextTime / (*current).timeScale + delta) * (*next).timeScale
7721 };
7722 (*current).trackTime += currentDelta;
7723 _spAnimationState_setCurrent(self_0, i, next, 1 as c_int);
7724 while !((*next).mixingFrom).is_null() {
7725 (*next).mixTime += delta;
7726 next = (*next).mixingFrom;
7727 }
7728 current_block_29 = 16559507199688588974;
7729 } else {
7730 current_block_29 = 17478428563724192186;
7731 }
7732 } else if (*current).trackLast >= (*current).trackEnd
7733 && ((*current).mixingFrom).is_null()
7734 {
7735 let fresh19 = &mut (*((*self_0).tracks).offset(i as isize));
7736 *fresh19 = std::ptr::null_mut::<spTrackEntry>();
7737 _spEventQueue_end((*internal).queue, current);
7738 spAnimationState_clearNext(self_0, current);
7739 current_block_29 = 16559507199688588974;
7740 } else {
7741 current_block_29 = 17478428563724192186;
7742 }
7743 match current_block_29 {
7744 16559507199688588974 => {}
7745 _ => {
7746 if !((*current).mixingFrom).is_null()
7747 && _spAnimationState_updateMixingFrom(self_0, current, delta) != 0
7748 {
7749 let mut from: *mut spTrackEntry = (*current).mixingFrom;
7750 (*current).mixingFrom = std::ptr::null_mut::<spTrackEntry>();
7751 if !from.is_null() {
7752 (*from).mixingTo = std::ptr::null_mut::<spTrackEntry>();
7753 }
7754 while !from.is_null() {
7755 _spEventQueue_end((*internal).queue, from);
7756 from = (*from).mixingFrom;
7757 }
7758 }
7759 (*current).trackTime += currentDelta;
7760 }
7761 }
7762 }
7763 }
7764 }
7765 i += 1;
7766 }
7767 _spEventQueue_drain((*internal).queue);
7768}
7769#[no_mangle]
7770pub unsafe extern "C" fn _spAnimationState_updateMixingFrom(
7771 mut self_0: *mut spAnimationState,
7772 mut to: *mut spTrackEntry,
7773 mut delta: c_float,
7774) -> c_int {
7775 let mut from: *mut spTrackEntry = (*to).mixingFrom;
7776 let mut finished: c_int = 0;
7777 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
7778 if from.is_null() {
7779 return -(1 as c_int);
7780 }
7781 finished = _spAnimationState_updateMixingFrom(self_0, from, delta);
7782 (*from).animationLast = (*from).nextAnimationLast;
7783 (*from).trackLast = (*from).nextTrackLast;
7784 if (*to).mixTime > 0 as c_int as c_float && (*to).mixTime >= (*to).mixDuration {
7785 if (*from).totalAlpha == 0 as c_int as c_float || (*to).mixDuration == 0 as c_int as c_float
7786 {
7787 (*to).mixingFrom = (*from).mixingFrom;
7788 if !((*from).mixingFrom).is_null() {
7789 (*(*from).mixingFrom).mixingTo = to;
7790 }
7791 (*to).interruptAlpha = (*from).interruptAlpha;
7792 _spEventQueue_end((*internal).queue, from);
7793 }
7794 return finished;
7795 }
7796 (*from).trackTime += delta * (*from).timeScale;
7797 (*to).mixTime += delta;
7798 0 as c_int
7799}
7800#[no_mangle]
7801pub unsafe extern "C" fn spAnimationState_apply(
7802 mut self_0: *mut spAnimationState,
7803 mut skeleton: *mut spSkeleton,
7804) -> c_int {
7805 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
7806 let mut current: *mut spTrackEntry = std::ptr::null_mut::<spTrackEntry>();
7807 let mut i: c_int = 0;
7808 let mut ii: c_int = 0;
7809 let mut n: c_int = 0;
7810 let mut animationLast: c_float = 0.;
7811 let mut animationTime: c_float = 0.;
7812 let mut timelineCount: c_int = 0;
7813 let mut timelines: *mut *mut spTimeline = std::ptr::null_mut::<*mut spTimeline>();
7814 let mut firstFrame: c_int = 0;
7815 let mut shortestRotation: c_int = 0;
7816 let mut timelinesRotation: *mut c_float = std::ptr::null_mut::<c_float>();
7817 let mut timeline: *mut spTimeline = std::ptr::null_mut::<spTimeline>();
7818 let mut applied: c_int = 0 as c_int;
7819 let mut blend: spMixBlend = SP_MIX_BLEND_SETUP;
7820 let mut timelineBlend: spMixBlend = SP_MIX_BLEND_SETUP;
7821 let mut setupState: c_int = 0 as c_int;
7822 let mut slots: *mut *mut spSlot = std::ptr::null_mut::<*mut spSlot>();
7823 let mut slot: *mut spSlot = std::ptr::null_mut::<spSlot>();
7824 let mut attachmentName: *const c_char = std::ptr::null::<c_char>();
7825 let mut applyEvents: *mut *mut spEvent = std::ptr::null_mut::<*mut spEvent>();
7826 let mut applyTime: c_float = 0.;
7827 if (*internal).animationsChanged != 0 {
7828 _spAnimationState_animationsChanged(self_0);
7829 }
7830 i = 0 as c_int;
7831 n = (*self_0).tracksCount;
7832 while i < n {
7833 let mut alpha: c_float = 0.;
7834 current = *((*self_0).tracks).offset(i as isize);
7835 if !(current.is_null() || (*current).delay > 0 as c_int as c_float) {
7836 applied = -(1 as c_int);
7837 blend = (if i == 0 as c_int {
7838 SP_MIX_BLEND_FIRST as c_int as c_uint
7839 } else {
7840 (*current).mixBlend as c_uint
7841 }) as spMixBlend;
7842 alpha = (*current).alpha;
7843 if !((*current).mixingFrom).is_null() {
7844 alpha *= _spAnimationState_applyMixingFrom(self_0, current, skeleton, blend);
7845 } else if (*current).trackTime >= (*current).trackEnd && ((*current).next).is_null() {
7846 alpha = 0 as c_int as c_float;
7847 }
7848 let mut attachments: c_int = (alpha >= (*current).alphaAttachmentThreshold) as c_int;
7849 animationLast = (*current).animationLast;
7850 animationTime = spTrackEntry_getAnimationTime(current);
7851 timelineCount = (*(*(*current).animation).timelines).size;
7852 applyEvents = (*internal).events;
7853 applyTime = animationTime;
7854 if (*current).reverse != 0 {
7855 applyTime = (*(*current).animation).duration - applyTime;
7856 applyEvents = std::ptr::null_mut::<*mut spEvent>();
7857 }
7858 timelines = (*(*(*current).animation).timelines).items;
7859 if i == 0 as c_int && alpha == 1 as c_int as c_float
7860 || blend as c_uint == SP_MIX_BLEND_ADD as c_int as c_uint
7861 {
7862 ii = 0 as c_int;
7863 while ii < timelineCount {
7864 timeline = *timelines.offset(ii as isize);
7865 if (*timeline).type_0 as c_uint == SP_TIMELINE_ATTACHMENT as c_int as c_uint {
7866 _spAnimationState_applyAttachmentTimeline(
7867 self_0,
7868 timeline,
7869 skeleton,
7870 applyTime,
7871 blend,
7872 attachments,
7873 );
7874 } else {
7875 spTimeline_apply(
7876 *timelines.offset(ii as isize),
7877 skeleton,
7878 animationLast,
7879 applyTime,
7880 applyEvents,
7881 &mut (*internal).eventsCount,
7882 alpha,
7883 blend,
7884 SP_MIX_DIRECTION_IN,
7885 );
7886 }
7887 ii += 1;
7888 }
7889 } else {
7890 let mut timelineMode: *mut spIntArray = (*current).timelineMode;
7891 shortestRotation = (*current).shortestRotation;
7892 firstFrame = (shortestRotation == 0
7893 && (*current).timelinesRotationCount != timelineCount << 1 as c_int)
7894 as c_int;
7895 if firstFrame != 0 {
7896 _spAnimationState_resizeTimelinesRotation(current, timelineCount << 1 as c_int);
7897 }
7898 timelinesRotation = (*current).timelinesRotation;
7899 ii = 0 as c_int;
7900 while ii < timelineCount {
7901 timeline = *timelines.offset(ii as isize);
7902 timelineBlend = (if *((*timelineMode).items).offset(ii as isize) == 0 as c_int {
7903 blend as c_uint
7904 } else {
7905 SP_MIX_BLEND_SETUP as c_int as c_uint
7906 }) as spMixBlend;
7907 if shortestRotation == 0
7908 && (*timeline).type_0 as c_uint == SP_TIMELINE_ROTATE as c_int as c_uint
7909 {
7910 _spAnimationState_applyRotateTimeline(
7911 self_0,
7912 timeline,
7913 skeleton,
7914 applyTime,
7915 alpha,
7916 timelineBlend,
7917 timelinesRotation,
7918 ii << 1 as c_int,
7919 firstFrame,
7920 );
7921 } else if (*timeline).type_0 as c_uint
7922 == SP_TIMELINE_ATTACHMENT as c_int as c_uint
7923 {
7924 _spAnimationState_applyAttachmentTimeline(
7925 self_0,
7926 timeline,
7927 skeleton,
7928 applyTime,
7929 timelineBlend,
7930 attachments,
7931 );
7932 } else {
7933 spTimeline_apply(
7934 timeline,
7935 skeleton,
7936 animationLast,
7937 applyTime,
7938 applyEvents,
7939 &mut (*internal).eventsCount,
7940 alpha,
7941 timelineBlend,
7942 SP_MIX_DIRECTION_IN,
7943 );
7944 }
7945 ii += 1;
7946 }
7947 }
7948 _spAnimationState_queueEvents(self_0, current, animationTime);
7949 (*internal).eventsCount = 0 as c_int;
7950 (*current).nextAnimationLast = animationTime;
7951 (*current).nextTrackLast = (*current).trackTime;
7952 }
7953 i += 1;
7954 }
7955 setupState = (*self_0).unkeyedState + 1 as c_int;
7956 slots = (*skeleton).slots;
7957 i = 0 as c_int;
7958 n = (*skeleton).slotsCount;
7959 while i < n {
7960 slot = *slots.offset(i as isize);
7961 if (*slot).attachmentState == setupState {
7962 attachmentName = (*(*slot).data).attachmentName;
7963 spSlot_setAttachment(
7964 slot,
7965 if attachmentName.is_null() {
7966 std::ptr::null_mut::<spAttachment>()
7967 } else {
7968 spSkeleton_getAttachmentForSlotIndex(
7969 skeleton,
7970 (*(*slot).data).index,
7971 attachmentName,
7972 )
7973 },
7974 );
7975 }
7976 i += 1;
7977 }
7978 (*self_0).unkeyedState += 2 as c_int;
7979 _spEventQueue_drain((*internal).queue);
7980 applied
7981}
7982#[no_mangle]
7983pub unsafe extern "C" fn _spAnimationState_applyMixingFrom(
7984 mut self_0: *mut spAnimationState,
7985 mut to: *mut spTrackEntry,
7986 mut skeleton: *mut spSkeleton,
7987 mut blend: spMixBlend,
7988) -> c_float {
7989 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
7990 let mut mix: c_float = 0.;
7991 let mut events: *mut *mut spEvent = std::ptr::null_mut::<*mut spEvent>();
7992 let mut attachments: c_int = 0;
7993 let mut drawOrder: c_int = 0;
7994 let mut animationLast: c_float = 0.;
7995 let mut animationTime: c_float = 0.;
7996 let mut timelineCount: c_int = 0;
7997 let mut timelines: *mut *mut spTimeline = std::ptr::null_mut::<*mut spTimeline>();
7998 let mut timelineMode: *mut spIntArray = std::ptr::null_mut::<spIntArray>();
7999 let mut timelineHoldMix: *mut spTrackEntryArray = std::ptr::null_mut::<spTrackEntryArray>();
8000 let mut timelineBlend: spMixBlend = SP_MIX_BLEND_SETUP;
8001 let mut alphaHold: c_float = 0.;
8002 let mut alphaMix: c_float = 0.;
8003 let mut alpha: c_float = 0.;
8004 let mut firstFrame: c_int = 0;
8005 let mut shortestRotation: c_int = 0;
8006 let mut timelinesRotation: *mut c_float = std::ptr::null_mut::<c_float>();
8007 let mut i: c_int = 0;
8008 let mut holdMix: *mut spTrackEntry = std::ptr::null_mut::<spTrackEntry>();
8009 let mut applyTime: c_float = 0.;
8010 let mut from: *mut spTrackEntry = (*to).mixingFrom;
8011 if !((*from).mixingFrom).is_null() {
8012 _spAnimationState_applyMixingFrom(self_0, from, skeleton, blend);
8013 }
8014 if (*to).mixDuration == 0 as c_int as c_float {
8015 mix = 1 as c_int as c_float;
8016 if blend as c_uint == SP_MIX_BLEND_FIRST as c_int as c_uint {
8017 blend = SP_MIX_BLEND_SETUP;
8018 }
8019 } else {
8020 mix = (*to).mixTime / (*to).mixDuration;
8021 if mix > 1 as c_int as c_float {
8022 mix = 1 as c_int as c_float;
8023 }
8024 if blend as c_uint != SP_MIX_BLEND_FIRST as c_int as c_uint {
8025 blend = (*from).mixBlend;
8026 }
8027 }
8028 attachments = (mix < (*from).mixAttachmentThreshold) as c_int;
8029 drawOrder = (mix < (*from).mixDrawOrderThreshold) as c_int;
8030 timelineCount = (*(*(*from).animation).timelines).size;
8031 timelines = (*(*(*from).animation).timelines).items;
8032 alphaHold = (*from).alpha * (*to).interruptAlpha;
8033 alphaMix = alphaHold * (1 as c_int as c_float - mix);
8034 animationLast = (*from).animationLast;
8035 animationTime = spTrackEntry_getAnimationTime(from);
8036 applyTime = animationTime;
8037 events = std::ptr::null_mut::<*mut spEvent>();
8038 if (*from).reverse != 0 {
8039 applyTime = (*(*from).animation).duration - applyTime;
8040 } else if mix < (*from).eventThreshold {
8041 events = (*internal).events;
8042 }
8043 if blend as c_uint == SP_MIX_BLEND_ADD as c_int as c_uint {
8044 i = 0 as c_int;
8045 while i < timelineCount {
8046 let mut timeline: *mut spTimeline = *timelines.offset(i as isize);
8047 spTimeline_apply(
8048 timeline,
8049 skeleton,
8050 animationLast,
8051 applyTime,
8052 events,
8053 &mut (*internal).eventsCount,
8054 alphaMix,
8055 blend,
8056 SP_MIX_DIRECTION_OUT,
8057 );
8058 i += 1;
8059 }
8060 } else {
8061 timelineMode = (*from).timelineMode;
8062 timelineHoldMix = (*from).timelineHoldMix;
8063 shortestRotation = (*from).shortestRotation;
8064 firstFrame = (shortestRotation == 0
8065 && (*from).timelinesRotationCount != timelineCount << 1 as c_int)
8066 as c_int;
8067 if firstFrame != 0 {
8068 _spAnimationState_resizeTimelinesRotation(from, timelineCount << 1 as c_int);
8069 }
8070 timelinesRotation = (*from).timelinesRotation;
8071 (*from).totalAlpha = 0 as c_int as c_float;
8072 let mut current_block_62: u64;
8073 i = 0 as c_int;
8074 while i < timelineCount {
8075 let mut direction: spMixDirection = SP_MIX_DIRECTION_OUT;
8076 let mut timeline_0: *mut spTimeline = *timelines.offset(i as isize);
8077 match *((*timelineMode).items).offset(i as isize) {
8078 0 => {
8079 if drawOrder == 0
8080 && (*timeline_0).type_0 as c_uint
8081 == SP_TIMELINE_DRAWORDER as c_int as c_uint
8082 {
8083 current_block_62 = 572715077006366937;
8084 } else {
8085 timelineBlend = blend;
8086 alpha = alphaMix;
8087 current_block_62 = 12829669402821218572;
8088 }
8089 }
8090 1 => {
8091 timelineBlend = SP_MIX_BLEND_SETUP;
8092 alpha = alphaMix;
8093 current_block_62 = 12829669402821218572;
8094 }
8095 2 => {
8096 timelineBlend = blend;
8097 alpha = alphaHold;
8098 current_block_62 = 12829669402821218572;
8099 }
8100 3 => {
8101 timelineBlend = SP_MIX_BLEND_SETUP;
8102 alpha = alphaHold;
8103 current_block_62 = 12829669402821218572;
8104 }
8105 _ => {
8106 timelineBlend = SP_MIX_BLEND_SETUP;
8107 holdMix = *((*timelineHoldMix).items).offset(i as isize);
8108 alpha = alphaHold
8109 * (if 0 as c_int as c_float
8110 > 1 as c_int as c_float - (*holdMix).mixTime / (*holdMix).mixDuration
8111 {
8112 0 as c_int as c_float
8113 } else {
8114 1 as c_int as c_float - (*holdMix).mixTime / (*holdMix).mixDuration
8115 });
8116 current_block_62 = 12829669402821218572;
8117 }
8118 }
8119 match current_block_62 {
8120 12829669402821218572 => {
8121 (*from).totalAlpha += alpha;
8122 if shortestRotation == 0
8123 && (*timeline_0).type_0 as c_uint == SP_TIMELINE_ROTATE as c_int as c_uint
8124 {
8125 _spAnimationState_applyRotateTimeline(
8126 self_0,
8127 timeline_0,
8128 skeleton,
8129 applyTime,
8130 alpha,
8131 timelineBlend,
8132 timelinesRotation,
8133 i << 1 as c_int,
8134 firstFrame,
8135 );
8136 } else if (*timeline_0).type_0 as c_uint
8137 == SP_TIMELINE_ATTACHMENT as c_int as c_uint
8138 {
8139 _spAnimationState_applyAttachmentTimeline(
8140 self_0,
8141 timeline_0,
8142 skeleton,
8143 applyTime,
8144 timelineBlend,
8145 (attachments != 0 && alpha >= (*from).alphaAttachmentThreshold)
8146 as c_int,
8147 );
8148 } else {
8149 if drawOrder != 0
8150 && (*timeline_0).type_0 as c_uint
8151 == SP_TIMELINE_DRAWORDER as c_int as c_uint
8152 && timelineBlend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint
8153 {
8154 direction = SP_MIX_DIRECTION_IN;
8155 }
8156 spTimeline_apply(
8157 timeline_0,
8158 skeleton,
8159 animationLast,
8160 applyTime,
8161 events,
8162 &mut (*internal).eventsCount,
8163 alpha,
8164 timelineBlend,
8165 direction,
8166 );
8167 }
8168 }
8169 _ => {}
8170 }
8171 i += 1;
8172 }
8173 }
8174 if (*to).mixDuration > 0 as c_int as c_float {
8175 _spAnimationState_queueEvents(self_0, from, animationTime);
8176 }
8177 (*internal).eventsCount = 0 as c_int;
8178 (*from).nextAnimationLast = animationTime;
8179 (*from).nextTrackLast = (*from).trackTime;
8180 mix
8181}
8182unsafe extern "C" fn _spAnimationState_setAttachment(
8183 mut self_0: *mut spAnimationState,
8184 mut skeleton: *mut spSkeleton,
8185 mut slot: *mut spSlot,
8186 mut attachmentName: *const c_char,
8187 mut attachments: c_int,
8188) {
8189 spSlot_setAttachment(
8190 slot,
8191 if attachmentName.is_null() {
8192 std::ptr::null_mut::<spAttachment>()
8193 } else {
8194 spSkeleton_getAttachmentForSlotIndex(skeleton, (*(*slot).data).index, attachmentName)
8195 },
8196 );
8197 if attachments != 0 {
8198 (*slot).attachmentState = (*self_0).unkeyedState + 2 as c_int;
8199 }
8200}
8201unsafe extern "C" fn binarySearch1(
8202 mut values: *mut c_float,
8203 mut valuesLength: c_int,
8204 mut target: c_float,
8205) -> c_int {
8206 let mut i: c_int = 0;
8207 i = 1 as c_int;
8208 while i < valuesLength {
8209 if *values.offset(i as isize) > target {
8210 return i - 1 as c_int;
8211 }
8212 i += 1;
8213 }
8214 valuesLength - 1 as c_int
8215}
8216#[no_mangle]
8217pub unsafe extern "C" fn _spAnimationState_applyAttachmentTimeline(
8218 mut self_0: *mut spAnimationState,
8219 mut timeline: *mut spTimeline,
8220 mut skeleton: *mut spSkeleton,
8221 mut time: c_float,
8222 mut blend: spMixBlend,
8223 mut attachments: c_int,
8224) {
8225 let mut attachmentTimeline: *mut spAttachmentTimeline =
8226 std::ptr::null_mut::<spAttachmentTimeline>();
8227 let mut slot: *mut spSlot = std::ptr::null_mut::<spSlot>();
8228 let mut frames: *mut c_float = std::ptr::null_mut::<c_float>();
8229 attachmentTimeline = timeline.cast::<spAttachmentTimeline>();
8230 slot = *((*skeleton).slots).offset((*attachmentTimeline).slotIndex as isize);
8231 if (*(*slot).bone).active == 0 {
8232 return;
8233 }
8234 frames = (*(*attachmentTimeline).super_0.frames).items;
8235 if time < *frames.offset(0 as c_int as isize) {
8236 if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint
8237 || blend as c_uint == SP_MIX_BLEND_FIRST as c_int as c_uint
8238 {
8239 _spAnimationState_setAttachment(
8240 self_0,
8241 skeleton,
8242 slot,
8243 (*(*slot).data).attachmentName,
8244 attachments,
8245 );
8246 }
8247 } else {
8248 _spAnimationState_setAttachment(
8249 self_0,
8250 skeleton,
8251 slot,
8252 *((*attachmentTimeline).attachmentNames).offset(binarySearch1(
8253 frames,
8254 (*(*attachmentTimeline).super_0.frames).size,
8255 time,
8256 ) as isize),
8257 attachments,
8258 );
8259 }
8260 if (*slot).attachmentState <= (*self_0).unkeyedState {
8261 (*slot).attachmentState = (*self_0).unkeyedState + 1 as c_int;
8262 }
8263}
8264#[no_mangle]
8265pub unsafe extern "C" fn _spAnimationState_applyRotateTimeline(
8266 mut _self_0: *mut spAnimationState,
8267 mut timeline: *mut spTimeline,
8268 mut skeleton: *mut spSkeleton,
8269 mut time: c_float,
8270 mut alpha: c_float,
8271 mut blend: spMixBlend,
8272 mut timelinesRotation: *mut c_float,
8273 mut i: c_int,
8274 mut firstFrame: c_int,
8275) {
8276 let mut rotateTimeline: *mut spRotateTimeline = std::ptr::null_mut::<spRotateTimeline>();
8277 let mut frames: *mut c_float = std::ptr::null_mut::<c_float>();
8278 let mut bone: *mut spBone = std::ptr::null_mut::<spBone>();
8279 let mut r1: c_float = 0.;
8280 let mut r2: c_float = 0.;
8281 let mut total: c_float = 0.;
8282 let mut diff: c_float = 0.;
8283 let mut current: c_int = 0;
8284 let mut dir: c_int = 0;
8285 if firstFrame != 0 {
8286 *timelinesRotation.offset(i as isize) = 0 as c_int as c_float;
8287 }
8288 if alpha == 1 as c_int as c_float {
8289 spTimeline_apply(
8290 timeline,
8291 skeleton,
8292 0 as c_int as c_float,
8293 time,
8294 std::ptr::null_mut::<*mut spEvent>(),
8295 std::ptr::null_mut::<c_int>(),
8296 1 as c_int as c_float,
8297 blend,
8298 SP_MIX_DIRECTION_IN,
8299 );
8300 return;
8301 }
8302 rotateTimeline = timeline.cast::<spRotateTimeline>();
8303 frames = (*(*rotateTimeline).super_0.super_0.frames).items;
8304 bone = *((*skeleton).bones).offset((*rotateTimeline).boneIndex as isize);
8305 if (*bone).active == 0 {
8306 return;
8307 }
8308 if time < *frames.offset(0 as c_int as isize) {
8309 's_80: {
8310 match blend as c_uint {
8311 0 => {
8312 (*bone).rotation = (*(*bone).data).rotation;
8313 }
8314 1 => {
8315 r1 = (*bone).rotation;
8316 r2 = (*(*bone).data).rotation;
8317 break 's_80;
8318 }
8319 _ => {}
8320 }
8321 return;
8322 }
8323 } else {
8324 r1 = if blend as c_uint == SP_MIX_BLEND_SETUP as c_int as c_uint {
8325 (*(*bone).data).rotation
8326 } else {
8327 (*bone).rotation
8328 };
8329 r2 = (*(*bone).data).rotation
8330 + spCurveTimeline1_getCurveValue(&mut (*rotateTimeline).super_0, time);
8331 }
8332 diff = r2 - r1;
8333 diff -= spine_ceil((diff / 360 as c_int as c_float) as c_double - 0.5f64) as c_float
8334 * 360 as c_int as c_float;
8335 if diff == 0 as c_int as c_float {
8336 total = *timelinesRotation.offset(i as isize);
8337 } else {
8338 let mut lastTotal: c_float = 0.;
8339 let mut lastDiff: c_float = 0.;
8340 let mut loops: c_float = 0.;
8341 if firstFrame != 0 {
8342 lastTotal = 0 as c_int as c_float;
8343 lastDiff = diff;
8344 } else {
8345 lastTotal = *timelinesRotation.offset(i as isize);
8346 lastDiff = *timelinesRotation.offset((i + 1 as c_int) as isize);
8347 }
8348 loops = lastTotal - spine_fmodf(lastTotal, 360 as c_int as c_float);
8349 total = diff + loops;
8350 current = (diff >= 0 as c_int as c_float) as c_int;
8351 dir = (lastTotal >= 0 as c_int as c_float) as c_int;
8352 if (if lastDiff < 0 as c_int as c_float {
8353 -lastDiff
8354 } else {
8355 lastDiff
8356 }) <= 90 as c_int as c_float
8357 && (if lastDiff < 0 as c_int as c_float {
8358 -1.0f32
8359 } else if lastDiff > 0 as c_int as c_float {
8360 1.0f32
8361 } else {
8362 0.0f32
8363 }) != (if diff < 0 as c_int as c_float {
8364 -1.0f32
8365 } else if diff > 0 as c_int as c_float {
8366 1.0f32
8367 } else {
8368 0.0f32
8369 })
8370 {
8371 if (if lastTotal - loops < 0 as c_int as c_float {
8372 -(lastTotal - loops)
8373 } else {
8374 lastTotal - loops
8375 }) > 180 as c_int as c_float
8376 {
8377 total += 360 as c_int as c_float
8378 * (if lastTotal < 0 as c_int as c_float {
8379 -1.0f32
8380 } else if lastTotal > 0 as c_int as c_float {
8381 1.0f32
8382 } else {
8383 0.0f32
8384 });
8385 dir = current;
8386 } else if loops != 0 as c_int as c_float {
8387 total -= 360 as c_int as c_float
8388 * (if lastTotal < 0 as c_int as c_float {
8389 -1.0f32
8390 } else if lastTotal > 0 as c_int as c_float {
8391 1.0f32
8392 } else {
8393 0.0f32
8394 });
8395 } else {
8396 dir = current;
8397 }
8398 }
8399 if dir != current {
8400 total += 360 as c_int as c_float
8401 * (if lastTotal < 0 as c_int as c_float {
8402 -1.0f32
8403 } else if lastTotal > 0 as c_int as c_float {
8404 1.0f32
8405 } else {
8406 0.0f32
8407 });
8408 }
8409 *timelinesRotation.offset(i as isize) = total;
8410 }
8411 *timelinesRotation.offset((i + 1 as c_int) as isize) = diff;
8412 (*bone).rotation = r1 + total * alpha;
8413}
8414#[no_mangle]
8415pub unsafe extern "C" fn _spAnimationState_queueEvents(
8416 mut self_0: *mut spAnimationState,
8417 mut entry: *mut spTrackEntry,
8418 mut animationTime: c_float,
8419) {
8420 let mut events: *mut *mut spEvent = std::ptr::null_mut::<*mut spEvent>();
8421 let mut event: *mut spEvent = std::ptr::null_mut::<spEvent>();
8422 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
8423 let mut i: c_int = 0;
8424 let mut n: c_int = 0;
8425 let mut complete: c_int = 0;
8426 let mut animationStart: c_float = (*entry).animationStart;
8427 let mut animationEnd: c_float = (*entry).animationEnd;
8428 let mut duration: c_float = animationEnd - animationStart;
8429 let mut trackLastWrapped: c_float = spine_fmodf((*entry).trackLast, duration);
8430 events = (*internal).events;
8431 i = 0 as c_int;
8432 n = (*internal).eventsCount;
8433 while i < n {
8434 event = *events.offset(i as isize);
8435 if (*event).time < trackLastWrapped {
8436 break;
8437 }
8438 if !((*event).time > animationEnd) {
8439 _spEventQueue_event((*internal).queue, entry, event);
8440 }
8441 i += 1;
8442 }
8443 if (*entry).loop_0 != 0 {
8444 if duration == 0 as c_int as c_float {
8445 complete = -(1 as c_int);
8446 } else {
8447 let mut cycles: c_int = ((*entry).trackTime / duration) as c_int;
8448 complete =
8449 (cycles > 0 as c_int && cycles > ((*entry).trackLast / duration) as c_int) as c_int;
8450 }
8451 } else {
8452 complete =
8453 (animationTime >= animationEnd && (*entry).animationLast < animationEnd) as c_int;
8454 }
8455 if complete != 0 {
8456 _spEventQueue_complete((*internal).queue, entry);
8457 }
8458 while i < n {
8459 event = *events.offset(i as isize);
8460 if !((*event).time < animationStart) {
8461 _spEventQueue_event((*internal).queue, entry, event);
8462 }
8463 i += 1;
8464 }
8465}
8466#[no_mangle]
8467pub unsafe extern "C" fn spAnimationState_clearTracks(mut self_0: *mut spAnimationState) {
8468 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
8469 let mut i: c_int = 0;
8470 let mut n: c_int = 0;
8471 let mut oldDrainDisabled: c_int = 0;
8472 oldDrainDisabled = (*(*internal).queue).drainDisabled;
8473 (*(*internal).queue).drainDisabled = 1 as c_int;
8474 i = 0 as c_int;
8475 n = (*self_0).tracksCount;
8476 while i < n {
8477 spAnimationState_clearTrack(self_0, i);
8478 i += 1;
8479 }
8480 (*self_0).tracksCount = 0 as c_int;
8481 (*(*internal).queue).drainDisabled = oldDrainDisabled;
8482 _spEventQueue_drain((*internal).queue);
8483}
8484#[no_mangle]
8485pub unsafe extern "C" fn spAnimationState_clearTrack(
8486 mut self_0: *mut spAnimationState,
8487 mut trackIndex: c_int,
8488) {
8489 let mut current: *mut spTrackEntry = std::ptr::null_mut::<spTrackEntry>();
8490 let mut entry: *mut spTrackEntry = std::ptr::null_mut::<spTrackEntry>();
8491 let mut from: *mut spTrackEntry = std::ptr::null_mut::<spTrackEntry>();
8492 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
8493 if trackIndex >= (*self_0).tracksCount {
8494 return;
8495 }
8496 current = *((*self_0).tracks).offset(trackIndex as isize);
8497 if current.is_null() {
8498 return;
8499 }
8500 _spEventQueue_end((*internal).queue, current);
8501 spAnimationState_clearNext(self_0, current);
8502 entry = current;
8503 loop {
8504 from = (*entry).mixingFrom;
8505 if from.is_null() {
8506 break;
8507 }
8508 _spEventQueue_end((*internal).queue, from);
8509 (*entry).mixingFrom = std::ptr::null_mut::<spTrackEntry>();
8510 (*entry).mixingTo = std::ptr::null_mut::<spTrackEntry>();
8511 entry = from;
8512 }
8513 let fresh20 = &mut (*((*self_0).tracks).offset((*current).trackIndex as isize));
8514 *fresh20 = std::ptr::null_mut::<spTrackEntry>();
8515 _spEventQueue_drain((*internal).queue);
8516}
8517#[no_mangle]
8518pub unsafe extern "C" fn _spAnimationState_setCurrent(
8519 mut self_0: *mut spAnimationState,
8520 mut index: c_int,
8521 mut current: *mut spTrackEntry,
8522 mut interrupt: c_int,
8523) {
8524 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
8525 let mut from: *mut spTrackEntry = _spAnimationState_expandToIndex(self_0, index);
8526 let fresh21 = &mut (*((*self_0).tracks).offset(index as isize));
8527 *fresh21 = current;
8528 (*current).previous = std::ptr::null_mut::<spTrackEntry>();
8529 if !from.is_null() {
8530 if interrupt != 0 {
8531 _spEventQueue_interrupt((*internal).queue, from);
8532 }
8533 (*current).mixingFrom = from;
8534 (*from).mixingTo = current;
8535 (*current).mixTime = 0 as c_int as c_float;
8536 if !((*from).mixingFrom).is_null() && (*from).mixDuration > 0 as c_int as c_float {
8537 (*current).interruptAlpha *=
8538 if (1 as c_int as c_float) < (*from).mixTime / (*from).mixDuration {
8539 1 as c_int as c_float
8540 } else {
8541 (*from).mixTime / (*from).mixDuration
8542 };
8543 }
8544 (*from).timelinesRotationCount = 0 as c_int;
8545 }
8546 _spEventQueue_start((*internal).queue, current);
8547}
8548#[no_mangle]
8549pub unsafe extern "C" fn spAnimationState_setAnimationByName(
8550 mut self_0: *mut spAnimationState,
8551 mut trackIndex: c_int,
8552 mut animationName: *const c_char,
8553 mut loop_0: c_int,
8554) -> *mut spTrackEntry {
8555 let mut animation: *mut spAnimation =
8556 spSkeletonData_findAnimation((*(*self_0).data).skeletonData, animationName);
8557 spAnimationState_setAnimation(self_0, trackIndex, animation, loop_0)
8558}
8559#[no_mangle]
8560pub unsafe extern "C" fn spAnimationState_setAnimation(
8561 mut self_0: *mut spAnimationState,
8562 mut trackIndex: c_int,
8563 mut animation: *mut spAnimation,
8564 mut loop_0: c_int,
8565) -> *mut spTrackEntry {
8566 let mut entry: *mut spTrackEntry = std::ptr::null_mut::<spTrackEntry>();
8567 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
8568 let mut interrupt: c_int = 1 as c_int;
8569 let mut current: *mut spTrackEntry = _spAnimationState_expandToIndex(self_0, trackIndex);
8570 if !current.is_null() {
8571 if (*current).nextTrackLast == -(1 as c_int) as c_float {
8572 let fresh22 = &mut (*((*self_0).tracks).offset(trackIndex as isize));
8573 *fresh22 = (*current).mixingFrom;
8574 _spEventQueue_interrupt((*internal).queue, current);
8575 _spEventQueue_end((*internal).queue, current);
8576 spAnimationState_clearNext(self_0, current);
8577 current = (*current).mixingFrom;
8578 interrupt = 0 as c_int;
8579 } else {
8580 spAnimationState_clearNext(self_0, current);
8581 }
8582 }
8583 entry = _spAnimationState_trackEntry(self_0, trackIndex, animation, loop_0, current);
8584 _spAnimationState_setCurrent(self_0, trackIndex, entry, interrupt);
8585 _spEventQueue_drain((*internal).queue);
8586 entry
8587}
8588#[no_mangle]
8589pub unsafe extern "C" fn spAnimationState_addAnimationByName(
8590 mut self_0: *mut spAnimationState,
8591 mut trackIndex: c_int,
8592 mut animationName: *const c_char,
8593 mut loop_0: c_int,
8594 mut delay: c_float,
8595) -> *mut spTrackEntry {
8596 let mut animation: *mut spAnimation =
8597 spSkeletonData_findAnimation((*(*self_0).data).skeletonData, animationName);
8598 spAnimationState_addAnimation(self_0, trackIndex, animation, loop_0, delay)
8599}
8600#[no_mangle]
8601pub unsafe extern "C" fn spAnimationState_addAnimation(
8602 mut self_0: *mut spAnimationState,
8603 mut trackIndex: c_int,
8604 mut animation: *mut spAnimation,
8605 mut loop_0: c_int,
8606 mut delay: c_float,
8607) -> *mut spTrackEntry {
8608 let mut entry: *mut spTrackEntry = std::ptr::null_mut::<spTrackEntry>();
8609 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
8610 let mut last: *mut spTrackEntry = _spAnimationState_expandToIndex(self_0, trackIndex);
8611 if !last.is_null() {
8612 while !((*last).next).is_null() {
8613 last = (*last).next;
8614 }
8615 }
8616 entry = _spAnimationState_trackEntry(self_0, trackIndex, animation, loop_0, last);
8617 if last.is_null() {
8618 _spAnimationState_setCurrent(self_0, trackIndex, entry, 1 as c_int);
8619 _spEventQueue_drain((*internal).queue);
8620 } else {
8621 (*last).next = entry;
8622 (*entry).previous = last;
8623 if delay <= 0 as c_int as c_float {
8624 delay += spTrackEntry_getTrackComplete(last) - (*entry).mixDuration;
8625 }
8626 }
8627 (*entry).delay = delay;
8628 entry
8629}
8630#[no_mangle]
8631pub unsafe extern "C" fn spAnimationState_setEmptyAnimation(
8632 mut self_0: *mut spAnimationState,
8633 mut trackIndex: c_int,
8634 mut mixDuration: c_float,
8635) -> *mut spTrackEntry {
8636 let mut entry: *mut spTrackEntry =
8637 spAnimationState_setAnimation(self_0, trackIndex, SP_EMPTY_ANIMATION, 0 as c_int);
8638 (*entry).mixDuration = mixDuration;
8639 (*entry).trackEnd = mixDuration;
8640 entry
8641}
8642#[no_mangle]
8643pub unsafe extern "C" fn spAnimationState_addEmptyAnimation(
8644 mut self_0: *mut spAnimationState,
8645 mut trackIndex: c_int,
8646 mut mixDuration: c_float,
8647 mut delay: c_float,
8648) -> *mut spTrackEntry {
8649 let mut entry: *mut spTrackEntry =
8650 spAnimationState_addAnimation(self_0, trackIndex, SP_EMPTY_ANIMATION, 0 as c_int, delay);
8651 if delay <= 0 as c_int as c_float {
8652 (*entry).delay += (*entry).mixDuration - mixDuration;
8653 }
8654 (*entry).mixDuration = mixDuration;
8655 (*entry).trackEnd = mixDuration;
8656 entry
8657}
8658#[no_mangle]
8659pub unsafe extern "C" fn spAnimationState_setEmptyAnimations(
8660 mut self_0: *mut spAnimationState,
8661 mut mixDuration: c_float,
8662) {
8663 let mut i: c_int = 0;
8664 let mut n: c_int = 0;
8665 let mut oldDrainDisabled: c_int = 0;
8666 let mut current: *mut spTrackEntry = std::ptr::null_mut::<spTrackEntry>();
8667 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
8668 oldDrainDisabled = (*(*internal).queue).drainDisabled;
8669 (*(*internal).queue).drainDisabled = 1 as c_int;
8670 i = 0 as c_int;
8671 n = (*self_0).tracksCount;
8672 while i < n {
8673 current = *((*self_0).tracks).offset(i as isize);
8674 if !current.is_null() {
8675 spAnimationState_setEmptyAnimation(self_0, (*current).trackIndex, mixDuration);
8676 }
8677 i += 1;
8678 }
8679 (*(*internal).queue).drainDisabled = oldDrainDisabled;
8680 _spEventQueue_drain((*internal).queue);
8681}
8682#[no_mangle]
8683pub unsafe extern "C" fn _spAnimationState_expandToIndex(
8684 mut self_0: *mut spAnimationState,
8685 mut index: c_int,
8686) -> *mut spTrackEntry {
8687 let mut newTracks: *mut *mut spTrackEntry = std::ptr::null_mut::<*mut spTrackEntry>();
8688 if index < (*self_0).tracksCount {
8689 return *((*self_0).tracks).offset(index as isize);
8690 }
8691 newTracks = _spCalloc(
8692 (index + 1 as c_int) as size_t,
8693 ::core::mem::size_of::<*mut spTrackEntry>() as c_ulong,
8694 (b"spine.c\0" as *const u8).cast::<c_char>(),
8695 3762 as c_int,
8696 )
8697 .cast::<*mut spTrackEntry>();
8698 spine_memcpy(
8699 newTracks.cast::<c_void>(),
8700 (*self_0).tracks as *const c_void,
8701 ((*self_0).tracksCount as c_ulong)
8702 .wrapping_mul(::core::mem::size_of::<*mut spTrackEntry>() as c_ulong),
8703 );
8704 _spFree((*self_0).tracks.cast::<c_void>());
8705 (*self_0).tracks = newTracks;
8706 (*self_0).tracksCount = index + 1 as c_int;
8707 std::ptr::null_mut::<spTrackEntry>()
8708}
8709#[no_mangle]
8710pub unsafe extern "C" fn _spAnimationState_trackEntry(
8711 mut self_0: *mut spAnimationState,
8712 mut trackIndex: c_int,
8713 mut animation: *mut spAnimation,
8714 mut loop_0: c_int,
8715 mut last: *mut spTrackEntry,
8716) -> *mut spTrackEntry {
8717 let mut entry: *mut spTrackEntry = _spCalloc(
8718 1 as c_int as size_t,
8719 ::core::mem::size_of::<spTrackEntry>() as c_ulong,
8720 (b"spine.c\0" as *const u8).cast::<c_char>(),
8721 3773 as c_int,
8722 )
8723 .cast::<spTrackEntry>();
8724 (*entry).trackIndex = trackIndex;
8725 (*entry).animation = animation;
8726 (*entry).loop_0 = loop_0;
8727 (*entry).holdPrevious = 0 as c_int;
8728 (*entry).reverse = 0 as c_int;
8729 (*entry).shortestRotation = 0 as c_int;
8730 (*entry).previous = std::ptr::null_mut::<spTrackEntry>();
8731 (*entry).next = std::ptr::null_mut::<spTrackEntry>();
8732 (*entry).eventThreshold = 0 as c_int as c_float;
8733 (*entry).mixAttachmentThreshold = 0 as c_int as c_float;
8734 (*entry).alphaAttachmentThreshold = 0 as c_int as c_float;
8735 (*entry).mixDrawOrderThreshold = 0 as c_int as c_float;
8736 (*entry).animationStart = 0 as c_int as c_float;
8737 (*entry).animationEnd = (*animation).duration;
8738 (*entry).animationLast = -(1 as c_int) as c_float;
8739 (*entry).nextAnimationLast = -(1 as c_int) as c_float;
8740 (*entry).delay = 0 as c_int as c_float;
8741 (*entry).trackTime = 0 as c_int as c_float;
8742 (*entry).trackLast = -(1 as c_int) as c_float;
8743 (*entry).nextTrackLast = -(1 as c_int) as c_float;
8744 (*entry).trackEnd = 0x7fffffff as c_int as c_float;
8745 (*entry).timeScale = 1 as c_int as c_float;
8746 (*entry).alpha = 1 as c_int as c_float;
8747 (*entry).mixTime = 0 as c_int as c_float;
8748 (*entry).mixDuration = if last.is_null() {
8749 0 as c_int as c_float
8750 } else {
8751 spAnimationStateData_getMix((*self_0).data, (*last).animation, animation)
8752 };
8753 (*entry).interruptAlpha = 1 as c_int as c_float;
8754 (*entry).totalAlpha = 0 as c_int as c_float;
8755 (*entry).mixBlend = SP_MIX_BLEND_REPLACE;
8756 (*entry).timelineMode = spIntArray_create(16 as c_int);
8757 (*entry).timelineHoldMix = spTrackEntryArray_create(16 as c_int);
8758 entry
8759}
8760#[no_mangle]
8761pub unsafe extern "C" fn spAnimationState_clearNext(
8762 mut self_0: *mut spAnimationState,
8763 mut entry: *mut spTrackEntry,
8764) {
8765 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
8766 let mut next: *mut spTrackEntry = (*entry).next;
8767 while !next.is_null() {
8768 _spEventQueue_dispose((*internal).queue, next);
8769 next = (*next).next;
8770 }
8771 (*entry).next = std::ptr::null_mut::<spTrackEntry>();
8772}
8773#[no_mangle]
8774pub unsafe extern "C" fn _spAnimationState_animationsChanged(mut self_0: *mut spAnimationState) {
8775 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
8776 let mut i: c_int = 0;
8777 let mut n: c_int = 0;
8778 let mut entry: *mut spTrackEntry = std::ptr::null_mut::<spTrackEntry>();
8779 (*internal).animationsChanged = 0 as c_int;
8780 (*internal).propertyIDsCount = 0 as c_int;
8781 i = 0 as c_int;
8782 n = (*self_0).tracksCount;
8783 while i < n {
8784 entry = *((*self_0).tracks).offset(i as isize);
8785 if !entry.is_null() {
8786 while !((*entry).mixingFrom).is_null() {
8787 entry = (*entry).mixingFrom;
8788 }
8789 loop {
8790 if ((*entry).mixingTo).is_null()
8791 || (*entry).mixBlend as c_uint != SP_MIX_BLEND_ADD as c_int as c_uint
8792 {
8793 _spTrackEntry_computeHold(entry, self_0);
8794 }
8795 entry = (*entry).mixingTo;
8796 if entry.is_null() {
8797 break;
8798 }
8799 }
8800 }
8801 i += 1;
8802 }
8803}
8804#[no_mangle]
8805pub unsafe extern "C" fn _spAnimationState_resizeTimelinesRotation(
8806 mut entry: *mut spTrackEntry,
8807 mut newSize: c_int,
8808) -> *mut c_float {
8809 if (*entry).timelinesRotationCount != newSize {
8810 let mut newTimelinesRotation: *mut c_float = _spCalloc(
8811 newSize as size_t,
8812 ::core::mem::size_of::<c_float>() as c_ulong,
8813 (b"spine.c\0" as *const u8).cast::<c_char>(),
8814 3847 as c_int,
8815 )
8816 .cast::<c_float>();
8817 _spFree((*entry).timelinesRotation.cast::<c_void>());
8818 (*entry).timelinesRotation = newTimelinesRotation;
8819 (*entry).timelinesRotationCount = newSize;
8820 }
8821 (*entry).timelinesRotation
8822}
8823#[no_mangle]
8824pub unsafe extern "C" fn _spAnimationState_ensureCapacityPropertyIDs(
8825 mut self_0: *mut spAnimationState,
8826 mut capacity: c_int,
8827) {
8828 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
8829 if (*internal).propertyIDsCapacity < capacity {
8830 let mut newPropertyIDs: *mut spPropertyId = _spCalloc(
8831 (capacity << 1 as c_int) as size_t,
8832 ::core::mem::size_of::<spPropertyId>() as c_ulong,
8833 (b"spine.c\0" as *const u8).cast::<c_char>(),
8834 3858 as c_int,
8835 )
8836 .cast::<spPropertyId>();
8837 spine_memcpy(
8838 newPropertyIDs.cast::<c_void>(),
8839 (*internal).propertyIDs as *const c_void,
8840 (::core::mem::size_of::<spPropertyId>() as c_ulong)
8841 .wrapping_mul((*internal).propertyIDsCount as c_ulong),
8842 );
8843 _spFree((*internal).propertyIDs.cast::<c_void>());
8844 (*internal).propertyIDs = newPropertyIDs;
8845 (*internal).propertyIDsCapacity = capacity << 1 as c_int;
8846 }
8847}
8848#[no_mangle]
8849pub unsafe extern "C" fn _spAnimationState_addPropertyID(
8850 mut self_0: *mut spAnimationState,
8851 mut id: spPropertyId,
8852) -> c_int {
8853 let mut i: c_int = 0;
8854 let mut n: c_int = 0;
8855 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
8856 i = 0 as c_int;
8857 n = (*internal).propertyIDsCount;
8858 while i < n {
8859 if *((*internal).propertyIDs).offset(i as isize) == id {
8860 return 0 as c_int;
8861 }
8862 i += 1;
8863 }
8864 _spAnimationState_ensureCapacityPropertyIDs(self_0, (*internal).propertyIDsCount + 1 as c_int);
8865 *((*internal).propertyIDs).offset((*internal).propertyIDsCount as isize) = id;
8866 (*internal).propertyIDsCount += 1;
8867 1 as c_int
8868}
8869#[no_mangle]
8870pub unsafe extern "C" fn _spAnimationState_addPropertyIDs(
8871 mut self_0: *mut spAnimationState,
8872 mut ids: *mut spPropertyId,
8873 mut numIds: c_int,
8874) -> c_int {
8875 let mut i: c_int = 0;
8876 let mut n: c_int = 0;
8877 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
8878 let mut oldSize: c_int = (*internal).propertyIDsCount;
8879 i = 0 as c_int;
8880 n = numIds;
8881 while i < n {
8882 _spAnimationState_addPropertyID(self_0, *ids.offset(i as isize));
8883 i += 1;
8884 }
8885 ((*internal).propertyIDsCount != oldSize) as c_int
8886}
8887#[no_mangle]
8888pub unsafe extern "C" fn spAnimationState_getCurrent(
8889 mut self_0: *mut spAnimationState,
8890 mut trackIndex: c_int,
8891) -> *mut spTrackEntry {
8892 if trackIndex >= (*self_0).tracksCount {
8893 return std::ptr::null_mut::<spTrackEntry>();
8894 }
8895 *((*self_0).tracks).offset(trackIndex as isize)
8896}
8897#[no_mangle]
8898pub unsafe extern "C" fn spAnimationState_clearListenerNotifications(
8899 mut self_0: *mut spAnimationState,
8900) {
8901 let mut internal: *mut _spAnimationState = self_0.cast::<_spAnimationState>();
8902 _spEventQueue_clear((*internal).queue);
8903}
8904#[no_mangle]
8905pub unsafe extern "C" fn spTrackEntry_getAnimationTime(mut entry: *mut spTrackEntry) -> c_float {
8906 if (*entry).loop_0 != 0 {
8907 let mut duration: c_float = (*entry).animationEnd - (*entry).animationStart;
8908 if duration == 0 as c_int as c_float {
8909 return (*entry).animationStart;
8910 }
8911 return spine_fmodf((*entry).trackTime, duration) + (*entry).animationStart;
8912 }
8913 if (*entry).trackTime + (*entry).animationStart < (*entry).animationEnd {
8914 (*entry).trackTime + (*entry).animationStart
8915 } else {
8916 (*entry).animationEnd
8917 }
8918}
8919#[no_mangle]
8920pub unsafe extern "C" fn spTrackEntry_resetRotationDirections(mut entry: *mut spTrackEntry) {
8921 _spFree((*entry).timelinesRotation.cast::<c_void>());
8922 (*entry).timelinesRotation = std::ptr::null_mut::<c_float>();
8923 (*entry).timelinesRotationCount = 0 as c_int;
8924}
8925#[no_mangle]
8926pub unsafe extern "C" fn spTrackEntry_getTrackComplete(mut entry: *mut spTrackEntry) -> c_float {
8927 let mut duration: c_float = (*entry).animationEnd - (*entry).animationStart;
8928 if duration != 0 as c_int as c_float {
8929 if (*entry).loop_0 != 0 {
8930 return duration * (1 as c_int + ((*entry).trackTime / duration) as c_int) as c_float;
8931 }
8932 if (*entry).trackTime < duration {
8933 return duration;
8934 }
8935 }
8936 (*entry).trackTime
8937}
8938#[no_mangle]
8939pub unsafe extern "C" fn spTrackEntry_setMixDuration(
8940 mut entry: *mut spTrackEntry,
8941 mut mixDuration: c_float,
8942 mut delay: c_float,
8943) {
8944 (*entry).mixDuration = mixDuration;
8945 if !((*entry).previous).is_null() && delay <= 0 as c_int as c_float {
8946 delay += spTrackEntry_getTrackComplete(entry) - mixDuration;
8947 }
8948 (*entry).delay = delay;
8949}
8950#[no_mangle]
8951pub unsafe extern "C" fn spTrackEntry_wasApplied(mut entry: *mut spTrackEntry) -> c_int {
8952 ((*entry).nextTrackLast != -(1 as c_int) as c_float) as c_int
8953}
8954#[no_mangle]
8955pub unsafe extern "C" fn _spTrackEntry_computeHold(
8956 mut entry: *mut spTrackEntry,
8957 mut state: *mut spAnimationState,
8958) {
8959 let mut to: *mut spTrackEntry = std::ptr::null_mut::<spTrackEntry>();
8960 let mut timelines: *mut *mut spTimeline = std::ptr::null_mut::<*mut spTimeline>();
8961 let mut timelinesCount: c_int = 0;
8962 let mut timelineMode: *mut c_int = std::ptr::null_mut::<c_int>();
8963 let mut timelineHoldMix: *mut *mut spTrackEntry = std::ptr::null_mut::<*mut spTrackEntry>();
8964 let mut next: *mut spTrackEntry = std::ptr::null_mut::<spTrackEntry>();
8965 let mut i: c_int = 0;
8966 to = (*entry).mixingTo;
8967 timelines = (*(*(*entry).animation).timelines).items;
8968 timelinesCount = (*(*(*entry).animation).timelines).size;
8969 timelineMode = (*spIntArray_setSize((*entry).timelineMode, timelinesCount)).items;
8970 spTrackEntryArray_clear((*entry).timelineHoldMix);
8971 timelineHoldMix = (*spTrackEntryArray_setSize((*entry).timelineHoldMix, timelinesCount)).items;
8972 if !to.is_null() && (*to).holdPrevious != 0 {
8973 i = 0 as c_int;
8974 while i < timelinesCount {
8975 let mut ids: *mut spPropertyId =
8976 ((**timelines.offset(i as isize)).propertyIds).as_mut_ptr();
8977 let mut numIds: c_int = (**timelines.offset(i as isize)).propertyIdsCount;
8978 *timelineMode.offset(i as isize) =
8979 if _spAnimationState_addPropertyIDs(state, ids, numIds) != 0 {
8980 3 as c_int
8981 } else {
8982 2 as c_int
8983 };
8984 i += 1;
8985 }
8986 return;
8987 }
8988 i = 0 as c_int;
8989 's_69: while i < timelinesCount {
8990 let mut timeline: *mut spTimeline = *timelines.offset(i as isize);
8991 let mut ids_0: *mut spPropertyId = ((*timeline).propertyIds).as_mut_ptr();
8992 let mut numIds_0: c_int = (*timeline).propertyIdsCount;
8993 if _spAnimationState_addPropertyIDs(state, ids_0, numIds_0) == 0 {
8994 *timelineMode.offset(i as isize) = 0 as c_int;
8995 } else if to.is_null()
8996 || (*timeline).type_0 as c_uint == SP_TIMELINE_ATTACHMENT as c_int as c_uint
8997 || (*timeline).type_0 as c_uint == SP_TIMELINE_DRAWORDER as c_int as c_uint
8998 || (*timeline).type_0 as c_uint == SP_TIMELINE_EVENT as c_int as c_uint
8999 || spAnimation_hasTimeline((*to).animation, ids_0, numIds_0) == 0
9000 {
9001 *timelineMode.offset(i as isize) = 1 as c_int;
9002 } else {
9003 next = (*to).mixingTo;
9004 while !next.is_null() {
9005 if spAnimation_hasTimeline((*next).animation, ids_0, numIds_0) != 0 {
9006 next = (*next).mixingTo;
9007 } else {
9008 if !((*next).mixDuration > 0 as c_int as c_float) {
9009 break;
9010 }
9011 *timelineMode.offset(i as isize) = 4 as c_int;
9012 let fresh23 = &mut (*timelineHoldMix.offset(i as isize));
9013 *fresh23 = next;
9014 i += 1;
9015 continue 's_69;
9016 }
9017 }
9018 *timelineMode.offset(i as isize) = 3 as c_int;
9019 }
9020 i += 1;
9021 }
9022}
9023#[no_mangle]
9024pub unsafe extern "C" fn _ToEntry_create(
9025 mut to: *mut spAnimation,
9026 mut duration: c_float,
9027) -> *mut _ToEntry {
9028 let mut self_0: *mut _ToEntry = _spCalloc(
9029 1 as c_int as size_t,
9030 ::core::mem::size_of::<_ToEntry>() as c_ulong,
9031 (b"spine.c\0" as *const u8).cast::<c_char>(),
9032 4029 as c_int,
9033 )
9034 .cast::<_ToEntry>();
9035 (*self_0).animation = to;
9036 (*self_0).duration = duration;
9037 self_0
9038}
9039#[no_mangle]
9040pub unsafe extern "C" fn _ToEntry_dispose(mut self_0: *mut _ToEntry) {
9041 _spFree(self_0.cast::<c_void>());
9042}
9043#[no_mangle]
9044pub unsafe extern "C" fn _FromEntry_create(mut from: *mut spAnimation) -> *mut _FromEntry {
9045 let mut self_0: *mut _FromEntry = _spCalloc(
9046 1 as c_int as size_t,
9047 ::core::mem::size_of::<_FromEntry>() as c_ulong,
9048 (b"spine.c\0" as *const u8).cast::<c_char>(),
9049 4049 as c_int,
9050 )
9051 .cast::<_FromEntry>();
9052 (*self_0).animation = from;
9053 self_0
9054}
9055#[no_mangle]
9056pub unsafe extern "C" fn _FromEntry_dispose(mut self_0: *mut _FromEntry) {
9057 _spFree(self_0.cast::<c_void>());
9058}
9059#[no_mangle]
9060pub unsafe extern "C" fn spAnimationStateData_create(
9061 mut skeletonData: *mut spSkeletonData,
9062) -> *mut spAnimationStateData {
9063 let mut self_0: *mut spAnimationStateData = _spCalloc(
9064 1 as c_int as size_t,
9065 ::core::mem::size_of::<spAnimationStateData>() as c_ulong,
9066 (b"spine.c\0" as *const u8).cast::<c_char>(),
9067 4061 as c_int,
9068 )
9069 .cast::<spAnimationStateData>();
9070 (*self_0).skeletonData = skeletonData;
9071 self_0
9072}
9073#[no_mangle]
9074pub unsafe extern "C" fn spAnimationStateData_dispose(mut self_0: *mut spAnimationStateData) {
9075 let mut toEntry: *mut _ToEntry = std::ptr::null_mut::<_ToEntry>();
9076 let mut nextToEntry: *mut _ToEntry = std::ptr::null_mut::<_ToEntry>();
9077 let mut nextFromEntry: *mut _FromEntry = std::ptr::null_mut::<_FromEntry>();
9078 let mut fromEntry: *mut _FromEntry = (*self_0).entries as *mut _FromEntry;
9079 while !fromEntry.is_null() {
9080 toEntry = (*fromEntry).toEntries;
9081 while !toEntry.is_null() {
9082 nextToEntry = (*toEntry).next;
9083 _ToEntry_dispose(toEntry);
9084 toEntry = nextToEntry;
9085 }
9086 nextFromEntry = (*fromEntry).next;
9087 _FromEntry_dispose(fromEntry);
9088 fromEntry = nextFromEntry;
9089 }
9090 _spFree(self_0.cast::<c_void>());
9091}
9092#[no_mangle]
9093pub unsafe extern "C" fn spAnimationStateData_setMixByName(
9094 mut self_0: *mut spAnimationStateData,
9095 mut fromName: *const c_char,
9096 mut toName: *const c_char,
9097 mut duration: c_float,
9098) {
9099 let mut to: *mut spAnimation = std::ptr::null_mut::<spAnimation>();
9100 let mut from: *mut spAnimation = spSkeletonData_findAnimation((*self_0).skeletonData, fromName);
9101 if from.is_null() {
9102 return;
9103 }
9104 to = spSkeletonData_findAnimation((*self_0).skeletonData, toName);
9105 if to.is_null() {
9106 return;
9107 }
9108 spAnimationStateData_setMix(self_0, from, to, duration);
9109}
9110#[no_mangle]
9111pub unsafe extern "C" fn spAnimationStateData_setMix(
9112 mut self_0: *mut spAnimationStateData,
9113 mut from: *mut spAnimation,
9114 mut to: *mut spAnimation,
9115 mut duration: c_float,
9116) {
9117 let mut toEntry: *mut _ToEntry = std::ptr::null_mut::<_ToEntry>();
9118 let mut fromEntry: *mut _FromEntry = (*self_0).entries as *mut _FromEntry;
9119 while !fromEntry.is_null() {
9120 if (*fromEntry).animation == from {
9121 toEntry = (*fromEntry).toEntries;
9122 while !toEntry.is_null() {
9123 if (*toEntry).animation == to {
9124 (*toEntry).duration = duration;
9125 return;
9126 }
9127 toEntry = (*toEntry).next;
9128 }
9129 break;
9130 } else {
9131 fromEntry = (*fromEntry).next;
9132 }
9133 }
9134 if fromEntry.is_null() {
9135 fromEntry = _FromEntry_create(from);
9136 (*fromEntry).next = (*self_0).entries as *mut _FromEntry;
9137 (*self_0).entries = fromEntry as *const c_void;
9138 }
9139 toEntry = _ToEntry_create(to, duration);
9140 (*toEntry).next = (*fromEntry).toEntries;
9141 (*fromEntry).toEntries = toEntry;
9142}
9143#[no_mangle]
9144pub unsafe extern "C" fn spAnimationStateData_getMix(
9145 mut self_0: *mut spAnimationStateData,
9146 mut from: *mut spAnimation,
9147 mut to: *mut spAnimation,
9148) -> c_float {
9149 let mut fromEntry: *mut _FromEntry = (*self_0).entries as *mut _FromEntry;
9150 while !fromEntry.is_null() {
9151 if (*fromEntry).animation == from {
9152 let mut toEntry: *mut _ToEntry = (*fromEntry).toEntries;
9153 while !toEntry.is_null() {
9154 if (*toEntry).animation == to {
9155 return (*toEntry).duration;
9156 }
9157 toEntry = (*toEntry).next;
9158 }
9159 }
9160 fromEntry = (*fromEntry).next;
9161 }
9162 (*self_0).defaultMix
9163}
9164#[no_mangle]
9165pub unsafe extern "C" fn spFloatArray_create(mut initialCapacity: c_int) -> *mut spFloatArray {
9166 let mut array: *mut spFloatArray = _spCalloc(
9167 1 as c_int as size_t,
9168 ::core::mem::size_of::<spFloatArray>() as c_ulong,
9169 (b"spine.c\0" as *const u8).cast::<c_char>(),
9170 4172 as c_int,
9171 )
9172 .cast::<spFloatArray>();
9173 (*array).size = 0 as c_int;
9174 (*array).capacity = initialCapacity;
9175 (*array).items = _spCalloc(
9176 initialCapacity as size_t,
9177 ::core::mem::size_of::<c_float>() as c_ulong,
9178 (b"spine.c\0" as *const u8).cast::<c_char>(),
9179 4172 as c_int,
9180 )
9181 .cast::<c_float>();
9182 array
9183}
9184#[no_mangle]
9185pub unsafe extern "C" fn spFloatArray_dispose(mut self_0: *mut spFloatArray) {
9186 _spFree((*self_0).items.cast::<c_void>());
9187 _spFree(self_0.cast::<c_void>());
9188}
9189#[no_mangle]
9190pub unsafe extern "C" fn spFloatArray_clear(mut self_0: *mut spFloatArray) {
9191 (*self_0).size = 0 as c_int;
9192}
9193#[no_mangle]
9194pub unsafe extern "C" fn spFloatArray_setSize(
9195 mut self_0: *mut spFloatArray,
9196 mut newSize: c_int,
9197) -> *mut spFloatArray {
9198 (*self_0).size = newSize;
9199 if (*self_0).capacity < newSize {
9200 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
9201 8 as c_int
9202 } else {
9203 ((*self_0).size as c_float * 1.75f32) as c_int
9204 };
9205 (*self_0).items = _spRealloc(
9206 (*self_0).items.cast::<c_void>(),
9207 (::core::mem::size_of::<c_float>() as c_ulong)
9208 .wrapping_mul((*self_0).capacity as c_ulong),
9209 )
9210 .cast::<c_float>();
9211 }
9212 self_0
9213}
9214#[no_mangle]
9215pub unsafe extern "C" fn spFloatArray_ensureCapacity(
9216 mut self_0: *mut spFloatArray,
9217 mut newCapacity: c_int,
9218) {
9219 if (*self_0).capacity >= newCapacity {
9220 return;
9221 }
9222 (*self_0).capacity = newCapacity;
9223 (*self_0).items = _spRealloc(
9224 (*self_0).items.cast::<c_void>(),
9225 (::core::mem::size_of::<c_float>() as c_ulong).wrapping_mul((*self_0).capacity as c_ulong),
9226 )
9227 .cast::<c_float>();
9228}
9229#[no_mangle]
9230pub unsafe extern "C" fn spFloatArray_add(mut self_0: *mut spFloatArray, mut value: c_float) {
9231 if (*self_0).size == (*self_0).capacity {
9232 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
9233 8 as c_int
9234 } else {
9235 ((*self_0).size as c_float * 1.75f32) as c_int
9236 };
9237 (*self_0).items = _spRealloc(
9238 (*self_0).items.cast::<c_void>(),
9239 (::core::mem::size_of::<c_float>() as c_ulong)
9240 .wrapping_mul((*self_0).capacity as c_ulong),
9241 )
9242 .cast::<c_float>();
9243 }
9244 let fresh24 = (*self_0).size;
9245 (*self_0).size += 1;
9246 *((*self_0).items).offset(fresh24 as isize) = value;
9247}
9248#[no_mangle]
9249pub unsafe extern "C" fn spFloatArray_addAll(
9250 mut self_0: *mut spFloatArray,
9251 mut other: *mut spFloatArray,
9252) {
9253 let mut i: c_int = 0 as c_int;
9254 while i < (*other).size {
9255 spFloatArray_add(self_0, *((*other).items).offset(i as isize));
9256 i += 1;
9257 }
9258}
9259#[no_mangle]
9260pub unsafe extern "C" fn spFloatArray_addAllValues(
9261 mut self_0: *mut spFloatArray,
9262 mut values: *mut c_float,
9263 mut offset: c_int,
9264 mut count: c_int,
9265) {
9266 let mut i: c_int = offset;
9267 let mut n: c_int = offset + count;
9268 while i < n {
9269 spFloatArray_add(self_0, *values.offset(i as isize));
9270 i += 1;
9271 }
9272}
9273#[no_mangle]
9274pub unsafe extern "C" fn spFloatArray_removeAt(mut self_0: *mut spFloatArray, mut index: c_int) {
9275 (*self_0).size -= 1;
9276 spine_memmove(
9277 ((*self_0).items).offset(index as isize).cast::<c_void>(),
9278 ((*self_0).items)
9279 .offset(index as isize)
9280 .offset(1 as c_int as isize) as *const c_void,
9281 (::core::mem::size_of::<c_float>() as c_ulong)
9282 .wrapping_mul(((*self_0).size - index) as c_ulong),
9283 );
9284}
9285#[no_mangle]
9286pub unsafe extern "C" fn spFloatArray_contains(
9287 mut self_0: *mut spFloatArray,
9288 mut value: c_float,
9289) -> c_int {
9290 let mut items: *mut c_float = (*self_0).items;
9291 let mut i: c_int = 0;
9292 let mut n: c_int = 0;
9293 i = 0 as c_int;
9294 n = (*self_0).size;
9295 while i < n {
9296 if *items.offset(i as isize) == value {
9297 return -(1 as c_int);
9298 }
9299 i += 1;
9300 }
9301 0 as c_int
9302}
9303#[no_mangle]
9304pub unsafe extern "C" fn spFloatArray_pop(mut self_0: *mut spFloatArray) -> c_float {
9305 (*self_0).size -= 1;
9306 let mut item: c_float = *((*self_0).items).offset((*self_0).size as isize);
9307 item
9308}
9309#[no_mangle]
9310pub unsafe extern "C" fn spFloatArray_peek(mut self_0: *mut spFloatArray) -> c_float {
9311 *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize)
9312}
9313#[no_mangle]
9314pub unsafe extern "C" fn spIntArray_create(mut initialCapacity: c_int) -> *mut spIntArray {
9315 let mut array: *mut spIntArray = _spCalloc(
9316 1 as c_int as size_t,
9317 ::core::mem::size_of::<spIntArray>() as c_ulong,
9318 (b"spine.c\0" as *const u8).cast::<c_char>(),
9319 4174 as c_int,
9320 )
9321 .cast::<spIntArray>();
9322 (*array).size = 0 as c_int;
9323 (*array).capacity = initialCapacity;
9324 (*array).items = _spCalloc(
9325 initialCapacity as size_t,
9326 ::core::mem::size_of::<c_int>() as c_ulong,
9327 (b"spine.c\0" as *const u8).cast::<c_char>(),
9328 4174 as c_int,
9329 )
9330 .cast::<c_int>();
9331 array
9332}
9333#[no_mangle]
9334pub unsafe extern "C" fn spIntArray_dispose(mut self_0: *mut spIntArray) {
9335 _spFree((*self_0).items.cast::<c_void>());
9336 _spFree(self_0.cast::<c_void>());
9337}
9338#[no_mangle]
9339pub unsafe extern "C" fn spIntArray_clear(mut self_0: *mut spIntArray) {
9340 (*self_0).size = 0 as c_int;
9341}
9342#[no_mangle]
9343pub unsafe extern "C" fn spIntArray_setSize(
9344 mut self_0: *mut spIntArray,
9345 mut newSize: c_int,
9346) -> *mut spIntArray {
9347 (*self_0).size = newSize;
9348 if (*self_0).capacity < newSize {
9349 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
9350 8 as c_int
9351 } else {
9352 ((*self_0).size as c_float * 1.75f32) as c_int
9353 };
9354 (*self_0).items = _spRealloc(
9355 (*self_0).items.cast::<c_void>(),
9356 (::core::mem::size_of::<c_int>() as c_ulong)
9357 .wrapping_mul((*self_0).capacity as c_ulong),
9358 )
9359 .cast::<c_int>();
9360 }
9361 self_0
9362}
9363#[no_mangle]
9364pub unsafe extern "C" fn spIntArray_ensureCapacity(
9365 mut self_0: *mut spIntArray,
9366 mut newCapacity: c_int,
9367) {
9368 if (*self_0).capacity >= newCapacity {
9369 return;
9370 }
9371 (*self_0).capacity = newCapacity;
9372 (*self_0).items = _spRealloc(
9373 (*self_0).items.cast::<c_void>(),
9374 (::core::mem::size_of::<c_int>() as c_ulong).wrapping_mul((*self_0).capacity as c_ulong),
9375 )
9376 .cast::<c_int>();
9377}
9378#[no_mangle]
9379pub unsafe extern "C" fn spIntArray_add(mut self_0: *mut spIntArray, mut value: c_int) {
9380 if (*self_0).size == (*self_0).capacity {
9381 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
9382 8 as c_int
9383 } else {
9384 ((*self_0).size as c_float * 1.75f32) as c_int
9385 };
9386 (*self_0).items = _spRealloc(
9387 (*self_0).items.cast::<c_void>(),
9388 (::core::mem::size_of::<c_int>() as c_ulong)
9389 .wrapping_mul((*self_0).capacity as c_ulong),
9390 )
9391 .cast::<c_int>();
9392 }
9393 let fresh25 = (*self_0).size;
9394 (*self_0).size += 1;
9395 *((*self_0).items).offset(fresh25 as isize) = value;
9396}
9397#[no_mangle]
9398pub unsafe extern "C" fn spIntArray_addAll(
9399 mut self_0: *mut spIntArray,
9400 mut other: *mut spIntArray,
9401) {
9402 let mut i: c_int = 0 as c_int;
9403 while i < (*other).size {
9404 spIntArray_add(self_0, *((*other).items).offset(i as isize));
9405 i += 1;
9406 }
9407}
9408#[no_mangle]
9409pub unsafe extern "C" fn spIntArray_addAllValues(
9410 mut self_0: *mut spIntArray,
9411 mut values: *mut c_int,
9412 mut offset: c_int,
9413 mut count: c_int,
9414) {
9415 let mut i: c_int = offset;
9416 let mut n: c_int = offset + count;
9417 while i < n {
9418 spIntArray_add(self_0, *values.offset(i as isize));
9419 i += 1;
9420 }
9421}
9422#[no_mangle]
9423pub unsafe extern "C" fn spIntArray_removeAt(mut self_0: *mut spIntArray, mut index: c_int) {
9424 (*self_0).size -= 1;
9425 spine_memmove(
9426 ((*self_0).items).offset(index as isize).cast::<c_void>(),
9427 ((*self_0).items)
9428 .offset(index as isize)
9429 .offset(1 as c_int as isize) as *const c_void,
9430 (::core::mem::size_of::<c_int>() as c_ulong)
9431 .wrapping_mul(((*self_0).size - index) as c_ulong),
9432 );
9433}
9434#[no_mangle]
9435pub unsafe extern "C" fn spIntArray_contains(
9436 mut self_0: *mut spIntArray,
9437 mut value: c_int,
9438) -> c_int {
9439 let mut items: *mut c_int = (*self_0).items;
9440 let mut i: c_int = 0;
9441 let mut n: c_int = 0;
9442 i = 0 as c_int;
9443 n = (*self_0).size;
9444 while i < n {
9445 if *items.offset(i as isize) == value {
9446 return -(1 as c_int);
9447 }
9448 i += 1;
9449 }
9450 0 as c_int
9451}
9452#[no_mangle]
9453pub unsafe extern "C" fn spIntArray_pop(mut self_0: *mut spIntArray) -> c_int {
9454 (*self_0).size -= 1;
9455 let mut item: c_int = *((*self_0).items).offset((*self_0).size as isize);
9456 item
9457}
9458#[no_mangle]
9459pub unsafe extern "C" fn spIntArray_peek(mut self_0: *mut spIntArray) -> c_int {
9460 *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize)
9461}
9462#[no_mangle]
9463pub unsafe extern "C" fn spShortArray_create(mut initialCapacity: c_int) -> *mut spShortArray {
9464 let mut array: *mut spShortArray = _spCalloc(
9465 1 as c_int as size_t,
9466 ::core::mem::size_of::<spShortArray>() as c_ulong,
9467 (b"spine.c\0" as *const u8).cast::<c_char>(),
9468 4176 as c_int,
9469 )
9470 .cast::<spShortArray>();
9471 (*array).size = 0 as c_int;
9472 (*array).capacity = initialCapacity;
9473 (*array).items = _spCalloc(
9474 initialCapacity as size_t,
9475 ::core::mem::size_of::<c_short>() as c_ulong,
9476 (b"spine.c\0" as *const u8).cast::<c_char>(),
9477 4176 as c_int,
9478 )
9479 .cast::<c_short>();
9480 array
9481}
9482#[no_mangle]
9483pub unsafe extern "C" fn spShortArray_dispose(mut self_0: *mut spShortArray) {
9484 _spFree((*self_0).items.cast::<c_void>());
9485 _spFree(self_0.cast::<c_void>());
9486}
9487#[no_mangle]
9488pub unsafe extern "C" fn spShortArray_clear(mut self_0: *mut spShortArray) {
9489 (*self_0).size = 0 as c_int;
9490}
9491#[no_mangle]
9492pub unsafe extern "C" fn spShortArray_setSize(
9493 mut self_0: *mut spShortArray,
9494 mut newSize: c_int,
9495) -> *mut spShortArray {
9496 (*self_0).size = newSize;
9497 if (*self_0).capacity < newSize {
9498 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
9499 8 as c_int
9500 } else {
9501 ((*self_0).size as c_float * 1.75f32) as c_int
9502 };
9503 (*self_0).items = _spRealloc(
9504 (*self_0).items.cast::<c_void>(),
9505 (::core::mem::size_of::<c_short>() as c_ulong)
9506 .wrapping_mul((*self_0).capacity as c_ulong),
9507 )
9508 .cast::<c_short>();
9509 }
9510 self_0
9511}
9512#[no_mangle]
9513pub unsafe extern "C" fn spShortArray_ensureCapacity(
9514 mut self_0: *mut spShortArray,
9515 mut newCapacity: c_int,
9516) {
9517 if (*self_0).capacity >= newCapacity {
9518 return;
9519 }
9520 (*self_0).capacity = newCapacity;
9521 (*self_0).items = _spRealloc(
9522 (*self_0).items.cast::<c_void>(),
9523 (::core::mem::size_of::<c_short>() as c_ulong).wrapping_mul((*self_0).capacity as c_ulong),
9524 )
9525 .cast::<c_short>();
9526}
9527#[no_mangle]
9528pub unsafe extern "C" fn spShortArray_add(mut self_0: *mut spShortArray, mut value: c_short) {
9529 if (*self_0).size == (*self_0).capacity {
9530 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
9531 8 as c_int
9532 } else {
9533 ((*self_0).size as c_float * 1.75f32) as c_int
9534 };
9535 (*self_0).items = _spRealloc(
9536 (*self_0).items.cast::<c_void>(),
9537 (::core::mem::size_of::<c_short>() as c_ulong)
9538 .wrapping_mul((*self_0).capacity as c_ulong),
9539 )
9540 .cast::<c_short>();
9541 }
9542 let fresh26 = (*self_0).size;
9543 (*self_0).size += 1;
9544 *((*self_0).items).offset(fresh26 as isize) = value;
9545}
9546#[no_mangle]
9547pub unsafe extern "C" fn spShortArray_addAll(
9548 mut self_0: *mut spShortArray,
9549 mut other: *mut spShortArray,
9550) {
9551 let mut i: c_int = 0 as c_int;
9552 while i < (*other).size {
9553 spShortArray_add(self_0, *((*other).items).offset(i as isize));
9554 i += 1;
9555 }
9556}
9557#[no_mangle]
9558pub unsafe extern "C" fn spShortArray_addAllValues(
9559 mut self_0: *mut spShortArray,
9560 mut values: *mut c_short,
9561 mut offset: c_int,
9562 mut count: c_int,
9563) {
9564 let mut i: c_int = offset;
9565 let mut n: c_int = offset + count;
9566 while i < n {
9567 spShortArray_add(self_0, *values.offset(i as isize));
9568 i += 1;
9569 }
9570}
9571#[no_mangle]
9572pub unsafe extern "C" fn spShortArray_removeAt(mut self_0: *mut spShortArray, mut index: c_int) {
9573 (*self_0).size -= 1;
9574 spine_memmove(
9575 ((*self_0).items).offset(index as isize).cast::<c_void>(),
9576 ((*self_0).items)
9577 .offset(index as isize)
9578 .offset(1 as c_int as isize) as *const c_void,
9579 (::core::mem::size_of::<c_short>() as c_ulong)
9580 .wrapping_mul(((*self_0).size - index) as c_ulong),
9581 );
9582}
9583#[no_mangle]
9584pub unsafe extern "C" fn spShortArray_contains(
9585 mut self_0: *mut spShortArray,
9586 mut value: c_short,
9587) -> c_int {
9588 let mut items: *mut c_short = (*self_0).items;
9589 let mut i: c_int = 0;
9590 let mut n: c_int = 0;
9591 i = 0 as c_int;
9592 n = (*self_0).size;
9593 while i < n {
9594 if *items.offset(i as isize) as c_int == value as c_int {
9595 return -(1 as c_int);
9596 }
9597 i += 1;
9598 }
9599 0 as c_int
9600}
9601#[no_mangle]
9602pub unsafe extern "C" fn spShortArray_pop(mut self_0: *mut spShortArray) -> c_short {
9603 (*self_0).size -= 1;
9604 let mut item: c_short = *((*self_0).items).offset((*self_0).size as isize);
9605 item
9606}
9607#[no_mangle]
9608pub unsafe extern "C" fn spShortArray_peek(mut self_0: *mut spShortArray) -> c_short {
9609 *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize)
9610}
9611#[no_mangle]
9612pub unsafe extern "C" fn spUnsignedShortArray_create(
9613 mut initialCapacity: c_int,
9614) -> *mut spUnsignedShortArray {
9615 let mut array: *mut spUnsignedShortArray = _spCalloc(
9616 1 as c_int as size_t,
9617 ::core::mem::size_of::<spUnsignedShortArray>() as c_ulong,
9618 (b"spine.c\0" as *const u8).cast::<c_char>(),
9619 4178 as c_int,
9620 )
9621 .cast::<spUnsignedShortArray>();
9622 (*array).size = 0 as c_int;
9623 (*array).capacity = initialCapacity;
9624 (*array).items = _spCalloc(
9625 initialCapacity as size_t,
9626 ::core::mem::size_of::<c_ushort>() as c_ulong,
9627 (b"spine.c\0" as *const u8).cast::<c_char>(),
9628 4178 as c_int,
9629 )
9630 .cast::<c_ushort>();
9631 array
9632}
9633#[no_mangle]
9634pub unsafe extern "C" fn spUnsignedShortArray_dispose(mut self_0: *mut spUnsignedShortArray) {
9635 _spFree((*self_0).items.cast::<c_void>());
9636 _spFree(self_0.cast::<c_void>());
9637}
9638#[no_mangle]
9639pub unsafe extern "C" fn spUnsignedShortArray_clear(mut self_0: *mut spUnsignedShortArray) {
9640 (*self_0).size = 0 as c_int;
9641}
9642#[no_mangle]
9643pub unsafe extern "C" fn spUnsignedShortArray_setSize(
9644 mut self_0: *mut spUnsignedShortArray,
9645 mut newSize: c_int,
9646) -> *mut spUnsignedShortArray {
9647 (*self_0).size = newSize;
9648 if (*self_0).capacity < newSize {
9649 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
9650 8 as c_int
9651 } else {
9652 ((*self_0).size as c_float * 1.75f32) as c_int
9653 };
9654 (*self_0).items = _spRealloc(
9655 (*self_0).items.cast::<c_void>(),
9656 (::core::mem::size_of::<c_ushort>() as c_ulong)
9657 .wrapping_mul((*self_0).capacity as c_ulong),
9658 )
9659 .cast::<c_ushort>();
9660 }
9661 self_0
9662}
9663#[no_mangle]
9664pub unsafe extern "C" fn spUnsignedShortArray_ensureCapacity(
9665 mut self_0: *mut spUnsignedShortArray,
9666 mut newCapacity: c_int,
9667) {
9668 if (*self_0).capacity >= newCapacity {
9669 return;
9670 }
9671 (*self_0).capacity = newCapacity;
9672 (*self_0).items = _spRealloc(
9673 (*self_0).items.cast::<c_void>(),
9674 (::core::mem::size_of::<c_ushort>() as c_ulong).wrapping_mul((*self_0).capacity as c_ulong),
9675 )
9676 .cast::<c_ushort>();
9677}
9678#[no_mangle]
9679pub unsafe extern "C" fn spUnsignedShortArray_add(
9680 mut self_0: *mut spUnsignedShortArray,
9681 mut value: c_ushort,
9682) {
9683 if (*self_0).size == (*self_0).capacity {
9684 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
9685 8 as c_int
9686 } else {
9687 ((*self_0).size as c_float * 1.75f32) as c_int
9688 };
9689 (*self_0).items = _spRealloc(
9690 (*self_0).items.cast::<c_void>(),
9691 (::core::mem::size_of::<c_ushort>() as c_ulong)
9692 .wrapping_mul((*self_0).capacity as c_ulong),
9693 )
9694 .cast::<c_ushort>();
9695 }
9696 let fresh27 = (*self_0).size;
9697 (*self_0).size += 1;
9698 *((*self_0).items).offset(fresh27 as isize) = value;
9699}
9700#[no_mangle]
9701pub unsafe extern "C" fn spUnsignedShortArray_addAll(
9702 mut self_0: *mut spUnsignedShortArray,
9703 mut other: *mut spUnsignedShortArray,
9704) {
9705 let mut i: c_int = 0 as c_int;
9706 while i < (*other).size {
9707 spUnsignedShortArray_add(self_0, *((*other).items).offset(i as isize));
9708 i += 1;
9709 }
9710}
9711#[no_mangle]
9712pub unsafe extern "C" fn spUnsignedShortArray_addAllValues(
9713 mut self_0: *mut spUnsignedShortArray,
9714 mut values: *mut c_ushort,
9715 mut offset: c_int,
9716 mut count: c_int,
9717) {
9718 let mut i: c_int = offset;
9719 let mut n: c_int = offset + count;
9720 while i < n {
9721 spUnsignedShortArray_add(self_0, *values.offset(i as isize));
9722 i += 1;
9723 }
9724}
9725#[no_mangle]
9726pub unsafe extern "C" fn spUnsignedShortArray_removeAt(
9727 mut self_0: *mut spUnsignedShortArray,
9728 mut index: c_int,
9729) {
9730 (*self_0).size -= 1;
9731 spine_memmove(
9732 ((*self_0).items).offset(index as isize).cast::<c_void>(),
9733 ((*self_0).items)
9734 .offset(index as isize)
9735 .offset(1 as c_int as isize) as *const c_void,
9736 (::core::mem::size_of::<c_ushort>() as c_ulong)
9737 .wrapping_mul(((*self_0).size - index) as c_ulong),
9738 );
9739}
9740#[no_mangle]
9741pub unsafe extern "C" fn spUnsignedShortArray_contains(
9742 mut self_0: *mut spUnsignedShortArray,
9743 mut value: c_ushort,
9744) -> c_int {
9745 let mut items: *mut c_ushort = (*self_0).items;
9746 let mut i: c_int = 0;
9747 let mut n: c_int = 0;
9748 i = 0 as c_int;
9749 n = (*self_0).size;
9750 while i < n {
9751 if *items.offset(i as isize) as c_int == value as c_int {
9752 return -(1 as c_int);
9753 }
9754 i += 1;
9755 }
9756 0 as c_int
9757}
9758#[no_mangle]
9759pub unsafe extern "C" fn spUnsignedShortArray_pop(
9760 mut self_0: *mut spUnsignedShortArray,
9761) -> c_ushort {
9762 (*self_0).size -= 1;
9763 let mut item: c_ushort = *((*self_0).items).offset((*self_0).size as isize);
9764 item
9765}
9766#[no_mangle]
9767pub unsafe extern "C" fn spUnsignedShortArray_peek(
9768 mut self_0: *mut spUnsignedShortArray,
9769) -> c_ushort {
9770 *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize)
9771}
9772#[no_mangle]
9773pub unsafe extern "C" fn spArrayFloatArray_create(
9774 mut initialCapacity: c_int,
9775) -> *mut spArrayFloatArray {
9776 let mut array: *mut spArrayFloatArray = _spCalloc(
9777 1 as c_int as size_t,
9778 ::core::mem::size_of::<spArrayFloatArray>() as c_ulong,
9779 (b"spine.c\0" as *const u8).cast::<c_char>(),
9780 4180 as c_int,
9781 )
9782 .cast::<spArrayFloatArray>();
9783 (*array).size = 0 as c_int;
9784 (*array).capacity = initialCapacity;
9785 (*array).items = _spCalloc(
9786 initialCapacity as size_t,
9787 ::core::mem::size_of::<*mut spFloatArray>() as c_ulong,
9788 (b"spine.c\0" as *const u8).cast::<c_char>(),
9789 4180 as c_int,
9790 )
9791 .cast::<*mut spFloatArray>();
9792 array
9793}
9794#[no_mangle]
9795pub unsafe extern "C" fn spArrayFloatArray_dispose(mut self_0: *mut spArrayFloatArray) {
9796 _spFree((*self_0).items.cast::<c_void>());
9797 _spFree(self_0.cast::<c_void>());
9798}
9799#[no_mangle]
9800pub unsafe extern "C" fn spArrayFloatArray_clear(mut self_0: *mut spArrayFloatArray) {
9801 (*self_0).size = 0 as c_int;
9802}
9803#[no_mangle]
9804pub unsafe extern "C" fn spArrayFloatArray_setSize(
9805 mut self_0: *mut spArrayFloatArray,
9806 mut newSize: c_int,
9807) -> *mut spArrayFloatArray {
9808 (*self_0).size = newSize;
9809 if (*self_0).capacity < newSize {
9810 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
9811 8 as c_int
9812 } else {
9813 ((*self_0).size as c_float * 1.75f32) as c_int
9814 };
9815 (*self_0).items = _spRealloc(
9816 (*self_0).items.cast::<c_void>(),
9817 (::core::mem::size_of::<*mut spFloatArray>() as c_ulong)
9818 .wrapping_mul((*self_0).capacity as c_ulong),
9819 )
9820 .cast::<*mut spFloatArray>();
9821 }
9822 self_0
9823}
9824#[no_mangle]
9825pub unsafe extern "C" fn spArrayFloatArray_ensureCapacity(
9826 mut self_0: *mut spArrayFloatArray,
9827 mut newCapacity: c_int,
9828) {
9829 if (*self_0).capacity >= newCapacity {
9830 return;
9831 }
9832 (*self_0).capacity = newCapacity;
9833 (*self_0).items = _spRealloc(
9834 (*self_0).items.cast::<c_void>(),
9835 (::core::mem::size_of::<*mut spFloatArray>() as c_ulong)
9836 .wrapping_mul((*self_0).capacity as c_ulong),
9837 )
9838 .cast::<*mut spFloatArray>();
9839}
9840#[no_mangle]
9841pub unsafe extern "C" fn spArrayFloatArray_add(
9842 mut self_0: *mut spArrayFloatArray,
9843 mut value: *mut spFloatArray,
9844) {
9845 if (*self_0).size == (*self_0).capacity {
9846 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
9847 8 as c_int
9848 } else {
9849 ((*self_0).size as c_float * 1.75f32) as c_int
9850 };
9851 (*self_0).items = _spRealloc(
9852 (*self_0).items.cast::<c_void>(),
9853 (::core::mem::size_of::<*mut spFloatArray>() as c_ulong)
9854 .wrapping_mul((*self_0).capacity as c_ulong),
9855 )
9856 .cast::<*mut spFloatArray>();
9857 }
9858 let fresh28 = (*self_0).size;
9859 (*self_0).size += 1;
9860 let fresh29 = &mut (*((*self_0).items).offset(fresh28 as isize));
9861 *fresh29 = value;
9862}
9863#[no_mangle]
9864pub unsafe extern "C" fn spArrayFloatArray_addAll(
9865 mut self_0: *mut spArrayFloatArray,
9866 mut other: *mut spArrayFloatArray,
9867) {
9868 let mut i: c_int = 0 as c_int;
9869 while i < (*other).size {
9870 spArrayFloatArray_add(self_0, *((*other).items).offset(i as isize));
9871 i += 1;
9872 }
9873}
9874#[no_mangle]
9875pub unsafe extern "C" fn spArrayFloatArray_addAllValues(
9876 mut self_0: *mut spArrayFloatArray,
9877 mut values: *mut *mut spFloatArray,
9878 mut offset: c_int,
9879 mut count: c_int,
9880) {
9881 let mut i: c_int = offset;
9882 let mut n: c_int = offset + count;
9883 while i < n {
9884 spArrayFloatArray_add(self_0, *values.offset(i as isize));
9885 i += 1;
9886 }
9887}
9888#[no_mangle]
9889pub unsafe extern "C" fn spArrayFloatArray_removeAt(
9890 mut self_0: *mut spArrayFloatArray,
9891 mut index: c_int,
9892) {
9893 (*self_0).size -= 1;
9894 spine_memmove(
9895 ((*self_0).items).offset(index as isize).cast::<c_void>(),
9896 ((*self_0).items)
9897 .offset(index as isize)
9898 .offset(1 as c_int as isize) as *const c_void,
9899 (::core::mem::size_of::<*mut spFloatArray>() as c_ulong)
9900 .wrapping_mul(((*self_0).size - index) as c_ulong),
9901 );
9902}
9903#[no_mangle]
9904pub unsafe extern "C" fn spArrayFloatArray_contains(
9905 mut self_0: *mut spArrayFloatArray,
9906 mut value: *mut spFloatArray,
9907) -> c_int {
9908 let mut items: *mut *mut spFloatArray = (*self_0).items;
9909 let mut i: c_int = 0;
9910 let mut n: c_int = 0;
9911 i = 0 as c_int;
9912 n = (*self_0).size;
9913 while i < n {
9914 if *items.offset(i as isize) == value {
9915 return -(1 as c_int);
9916 }
9917 i += 1;
9918 }
9919 0 as c_int
9920}
9921#[no_mangle]
9922pub unsafe extern "C" fn spArrayFloatArray_pop(
9923 mut self_0: *mut spArrayFloatArray,
9924) -> *mut spFloatArray {
9925 (*self_0).size -= 1;
9926 let mut item: *mut spFloatArray = *((*self_0).items).offset((*self_0).size as isize);
9927 item
9928}
9929#[no_mangle]
9930pub unsafe extern "C" fn spArrayFloatArray_peek(
9931 mut self_0: *mut spArrayFloatArray,
9932) -> *mut spFloatArray {
9933 *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize)
9934}
9935#[no_mangle]
9936pub unsafe extern "C" fn spArrayShortArray_create(
9937 mut initialCapacity: c_int,
9938) -> *mut spArrayShortArray {
9939 let mut array: *mut spArrayShortArray = _spCalloc(
9940 1 as c_int as size_t,
9941 ::core::mem::size_of::<spArrayShortArray>() as c_ulong,
9942 (b"spine.c\0" as *const u8).cast::<c_char>(),
9943 4182 as c_int,
9944 )
9945 .cast::<spArrayShortArray>();
9946 (*array).size = 0 as c_int;
9947 (*array).capacity = initialCapacity;
9948 (*array).items = _spCalloc(
9949 initialCapacity as size_t,
9950 ::core::mem::size_of::<*mut spShortArray>() as c_ulong,
9951 (b"spine.c\0" as *const u8).cast::<c_char>(),
9952 4182 as c_int,
9953 )
9954 .cast::<*mut spShortArray>();
9955 array
9956}
9957#[no_mangle]
9958pub unsafe extern "C" fn spArrayShortArray_dispose(mut self_0: *mut spArrayShortArray) {
9959 _spFree((*self_0).items.cast::<c_void>());
9960 _spFree(self_0.cast::<c_void>());
9961}
9962#[no_mangle]
9963pub unsafe extern "C" fn spArrayShortArray_clear(mut self_0: *mut spArrayShortArray) {
9964 (*self_0).size = 0 as c_int;
9965}
9966#[no_mangle]
9967pub unsafe extern "C" fn spArrayShortArray_setSize(
9968 mut self_0: *mut spArrayShortArray,
9969 mut newSize: c_int,
9970) -> *mut spArrayShortArray {
9971 (*self_0).size = newSize;
9972 if (*self_0).capacity < newSize {
9973 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
9974 8 as c_int
9975 } else {
9976 ((*self_0).size as c_float * 1.75f32) as c_int
9977 };
9978 (*self_0).items = _spRealloc(
9979 (*self_0).items.cast::<c_void>(),
9980 (::core::mem::size_of::<*mut spShortArray>() as c_ulong)
9981 .wrapping_mul((*self_0).capacity as c_ulong),
9982 )
9983 .cast::<*mut spShortArray>();
9984 }
9985 self_0
9986}
9987#[no_mangle]
9988pub unsafe extern "C" fn spArrayShortArray_ensureCapacity(
9989 mut self_0: *mut spArrayShortArray,
9990 mut newCapacity: c_int,
9991) {
9992 if (*self_0).capacity >= newCapacity {
9993 return;
9994 }
9995 (*self_0).capacity = newCapacity;
9996 (*self_0).items = _spRealloc(
9997 (*self_0).items.cast::<c_void>(),
9998 (::core::mem::size_of::<*mut spShortArray>() as c_ulong)
9999 .wrapping_mul((*self_0).capacity as c_ulong),
10000 )
10001 .cast::<*mut spShortArray>();
10002}
10003#[no_mangle]
10004pub unsafe extern "C" fn spArrayShortArray_add(
10005 mut self_0: *mut spArrayShortArray,
10006 mut value: *mut spShortArray,
10007) {
10008 if (*self_0).size == (*self_0).capacity {
10009 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
10010 8 as c_int
10011 } else {
10012 ((*self_0).size as c_float * 1.75f32) as c_int
10013 };
10014 (*self_0).items = _spRealloc(
10015 (*self_0).items.cast::<c_void>(),
10016 (::core::mem::size_of::<*mut spShortArray>() as c_ulong)
10017 .wrapping_mul((*self_0).capacity as c_ulong),
10018 )
10019 .cast::<*mut spShortArray>();
10020 }
10021 let fresh30 = (*self_0).size;
10022 (*self_0).size += 1;
10023 let fresh31 = &mut (*((*self_0).items).offset(fresh30 as isize));
10024 *fresh31 = value;
10025}
10026#[no_mangle]
10027pub unsafe extern "C" fn spArrayShortArray_addAll(
10028 mut self_0: *mut spArrayShortArray,
10029 mut other: *mut spArrayShortArray,
10030) {
10031 let mut i: c_int = 0 as c_int;
10032 while i < (*other).size {
10033 spArrayShortArray_add(self_0, *((*other).items).offset(i as isize));
10034 i += 1;
10035 }
10036}
10037#[no_mangle]
10038pub unsafe extern "C" fn spArrayShortArray_addAllValues(
10039 mut self_0: *mut spArrayShortArray,
10040 mut values: *mut *mut spShortArray,
10041 mut offset: c_int,
10042 mut count: c_int,
10043) {
10044 let mut i: c_int = offset;
10045 let mut n: c_int = offset + count;
10046 while i < n {
10047 spArrayShortArray_add(self_0, *values.offset(i as isize));
10048 i += 1;
10049 }
10050}
10051#[no_mangle]
10052pub unsafe extern "C" fn spArrayShortArray_removeAt(
10053 mut self_0: *mut spArrayShortArray,
10054 mut index: c_int,
10055) {
10056 (*self_0).size -= 1;
10057 spine_memmove(
10058 ((*self_0).items).offset(index as isize).cast::<c_void>(),
10059 ((*self_0).items)
10060 .offset(index as isize)
10061 .offset(1 as c_int as isize) as *const c_void,
10062 (::core::mem::size_of::<*mut spShortArray>() as c_ulong)
10063 .wrapping_mul(((*self_0).size - index) as c_ulong),
10064 );
10065}
10066#[no_mangle]
10067pub unsafe extern "C" fn spArrayShortArray_contains(
10068 mut self_0: *mut spArrayShortArray,
10069 mut value: *mut spShortArray,
10070) -> c_int {
10071 let mut items: *mut *mut spShortArray = (*self_0).items;
10072 let mut i: c_int = 0;
10073 let mut n: c_int = 0;
10074 i = 0 as c_int;
10075 n = (*self_0).size;
10076 while i < n {
10077 if *items.offset(i as isize) == value {
10078 return -(1 as c_int);
10079 }
10080 i += 1;
10081 }
10082 0 as c_int
10083}
10084#[no_mangle]
10085pub unsafe extern "C" fn spArrayShortArray_pop(
10086 mut self_0: *mut spArrayShortArray,
10087) -> *mut spShortArray {
10088 (*self_0).size -= 1;
10089 let mut item: *mut spShortArray = *((*self_0).items).offset((*self_0).size as isize);
10090 item
10091}
10092#[no_mangle]
10093pub unsafe extern "C" fn spArrayShortArray_peek(
10094 mut self_0: *mut spArrayShortArray,
10095) -> *mut spShortArray {
10096 *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize)
10097}
10098#[no_mangle]
10099pub unsafe extern "C" fn spKeyValueArray_create(
10100 mut initialCapacity: c_int,
10101) -> *mut spKeyValueArray {
10102 let mut array: *mut spKeyValueArray = _spCalloc(
10103 1 as c_int as size_t,
10104 ::core::mem::size_of::<spKeyValueArray>() as c_ulong,
10105 (b"_file_name_\0" as *const u8).cast::<c_char>(),
10106 39 as c_int,
10107 )
10108 .cast::<spKeyValueArray>();
10109 (*array).size = 0 as c_int;
10110 (*array).capacity = initialCapacity;
10111 (*array).items = _spCalloc(
10112 initialCapacity as size_t,
10113 ::core::mem::size_of::<spKeyValue>() as c_ulong,
10114 (b"_file_name_\0" as *const u8).cast::<c_char>(),
10115 39 as c_int,
10116 )
10117 .cast::<spKeyValue>();
10118 array
10119}
10120#[no_mangle]
10121pub unsafe extern "C" fn spKeyValueArray_dispose(mut self_0: *mut spKeyValueArray) {
10122 _spFree((*self_0).items.cast::<c_void>());
10123 _spFree(self_0.cast::<c_void>());
10124}
10125#[no_mangle]
10126pub unsafe extern "C" fn spKeyValueArray_clear(mut self_0: *mut spKeyValueArray) {
10127 (*self_0).size = 0 as c_int;
10128}
10129#[no_mangle]
10130pub unsafe extern "C" fn spKeyValueArray_setSize(
10131 mut self_0: *mut spKeyValueArray,
10132 mut newSize: c_int,
10133) -> *mut spKeyValueArray {
10134 (*self_0).size = newSize;
10135 if (*self_0).capacity < newSize {
10136 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
10137 8 as c_int
10138 } else {
10139 ((*self_0).size as c_float * 1.75f32) as c_int
10140 };
10141 (*self_0).items = _spRealloc(
10142 (*self_0).items.cast::<c_void>(),
10143 (::core::mem::size_of::<spKeyValue>() as c_ulong)
10144 .wrapping_mul((*self_0).capacity as c_ulong),
10145 )
10146 .cast::<spKeyValue>();
10147 }
10148 self_0
10149}
10150#[no_mangle]
10151pub unsafe extern "C" fn spKeyValueArray_ensureCapacity(
10152 mut self_0: *mut spKeyValueArray,
10153 mut newCapacity: c_int,
10154) {
10155 if (*self_0).capacity >= newCapacity {
10156 return;
10157 }
10158 (*self_0).capacity = newCapacity;
10159 (*self_0).items = _spRealloc(
10160 (*self_0).items.cast::<c_void>(),
10161 (::core::mem::size_of::<spKeyValue>() as c_ulong)
10162 .wrapping_mul((*self_0).capacity as c_ulong),
10163 )
10164 .cast::<spKeyValue>();
10165}
10166#[no_mangle]
10167pub unsafe extern "C" fn spKeyValueArray_add(
10168 mut self_0: *mut spKeyValueArray,
10169 mut value: spKeyValue,
10170) {
10171 if (*self_0).size == (*self_0).capacity {
10172 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
10173 8 as c_int
10174 } else {
10175 ((*self_0).size as c_float * 1.75f32) as c_int
10176 };
10177 (*self_0).items = _spRealloc(
10178 (*self_0).items.cast::<c_void>(),
10179 (::core::mem::size_of::<spKeyValue>() as c_ulong)
10180 .wrapping_mul((*self_0).capacity as c_ulong),
10181 )
10182 .cast::<spKeyValue>();
10183 }
10184 let fresh32 = (*self_0).size;
10185 (*self_0).size += 1;
10186 *((*self_0).items).offset(fresh32 as isize) = value;
10187}
10188#[no_mangle]
10189pub unsafe extern "C" fn spKeyValueArray_addAll(
10190 mut self_0: *mut spKeyValueArray,
10191 mut other: *mut spKeyValueArray,
10192) {
10193 let mut i: c_int = 0 as c_int;
10194 while i < (*other).size {
10195 spKeyValueArray_add(self_0, *((*other).items).offset(i as isize));
10196 i += 1;
10197 }
10198}
10199#[no_mangle]
10200pub unsafe extern "C" fn spKeyValueArray_addAllValues(
10201 mut self_0: *mut spKeyValueArray,
10202 mut values: *mut spKeyValue,
10203 mut offset: c_int,
10204 mut count: c_int,
10205) {
10206 let mut i: c_int = offset;
10207 let mut n: c_int = offset + count;
10208 while i < n {
10209 spKeyValueArray_add(self_0, *values.offset(i as isize));
10210 i += 1;
10211 }
10212}
10213#[no_mangle]
10214pub unsafe extern "C" fn spKeyValueArray_contains(
10215 mut self_0: *mut spKeyValueArray,
10216 mut value: spKeyValue,
10217) -> c_int {
10218 let mut items: *mut spKeyValue = (*self_0).items;
10219 let mut i: c_int = 0;
10220 let mut n: c_int = 0;
10221 i = 0 as c_int;
10222 n = (*self_0).size;
10223 while i < n {
10224 if spine_strcmp((*items.offset(i as isize)).name, value.name) == 0 {
10225 return -(1 as c_int);
10226 }
10227 i += 1;
10228 }
10229 0 as c_int
10230}
10231#[no_mangle]
10232pub unsafe extern "C" fn spKeyValueArray_pop(mut self_0: *mut spKeyValueArray) -> spKeyValue {
10233 (*self_0).size -= 1;
10234 let mut item: spKeyValue = *((*self_0).items).offset((*self_0).size as isize);
10235 item
10236}
10237#[no_mangle]
10238pub unsafe extern "C" fn spKeyValueArray_peek(mut self_0: *mut spKeyValueArray) -> spKeyValue {
10239 *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize)
10240}
10241#[no_mangle]
10242pub unsafe extern "C" fn spAtlasPage_create(
10243 mut atlas: *mut spAtlas,
10244 mut name: *const c_char,
10245) -> *mut spAtlasPage {
10246 let mut self_0: *mut spAtlasPage = _spCalloc(
10247 1 as c_int as size_t,
10248 ::core::mem::size_of::<spAtlasPage>() as c_ulong,
10249 (b"spine.c\0" as *const u8).cast::<c_char>(),
10250 4281 as c_int,
10251 )
10252 .cast::<spAtlasPage>();
10253 (*self_0).atlas = atlas;
10254 (*self_0).name = _spMalloc(
10255 (::core::mem::size_of::<c_char>() as c_ulong)
10256 .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)),
10257 (b"spine.c\0" as *const u8).cast::<c_char>(),
10258 4283 as c_int,
10259 )
10260 .cast::<c_char>();
10261 spine_strcpy((*self_0).name, name);
10262 (*self_0).minFilter = SP_ATLAS_NEAREST;
10263 (*self_0).magFilter = SP_ATLAS_NEAREST;
10264 (*self_0).format = SP_ATLAS_RGBA8888;
10265 (*self_0).uWrap = SP_ATLAS_CLAMPTOEDGE;
10266 (*self_0).vWrap = SP_ATLAS_CLAMPTOEDGE;
10267 self_0
10268}
10269#[no_mangle]
10270pub unsafe extern "C" fn spAtlasPage_dispose(mut self_0: *mut spAtlasPage) {
10271 _spAtlasPage_disposeTexture(self_0);
10272 _spFree((*self_0).name.cast::<c_void>());
10273 _spFree(self_0.cast::<c_void>());
10274}
10275#[no_mangle]
10276pub unsafe extern "C" fn spAtlasRegion_create() -> *mut spAtlasRegion {
10277 let mut region: *mut spAtlasRegion = _spCalloc(
10278 1 as c_int as size_t,
10279 ::core::mem::size_of::<spAtlasRegion>() as c_ulong,
10280 (b"spine.c\0" as *const u8).cast::<c_char>(),
10281 4301 as c_int,
10282 )
10283 .cast::<spAtlasRegion>();
10284 (*region).keyValues = spKeyValueArray_create(2 as c_int);
10285 region
10286}
10287#[no_mangle]
10288pub unsafe extern "C" fn spAtlasRegion_dispose(mut self_0: *mut spAtlasRegion) {
10289 let mut i: c_int = 0;
10290 let mut n: c_int = 0;
10291 _spFree((*self_0).name as *mut c_void);
10292 _spFree((*self_0).splits.cast::<c_void>());
10293 _spFree((*self_0).pads.cast::<c_void>());
10294 i = 0 as c_int;
10295 n = (*(*self_0).keyValues).size;
10296 while i < n {
10297 _spFree(
10298 (*((*(*self_0).keyValues).items).offset(i as isize))
10299 .name
10300 .cast::<c_void>(),
10301 );
10302 i += 1;
10303 }
10304 spKeyValueArray_dispose((*self_0).keyValues);
10305 _spFree(self_0.cast::<c_void>());
10306}
10307unsafe extern "C" fn ss_trim(mut self_0: *mut SimpleString) -> *mut SimpleString {
10308 while isspace_(*(*self_0).start as c_uchar as c_int) != 0 && (*self_0).start < (*self_0).end {
10309 (*self_0).start = ((*self_0).start).offset(1);
10310 }
10311 if (*self_0).start == (*self_0).end {
10312 (*self_0).length = ((*self_0).end).offset_from((*self_0).start) as c_long as c_int;
10313 return self_0;
10314 }
10315 (*self_0).end = ((*self_0).end).offset(-1);
10316 while *(*self_0).end as c_uchar as c_int == '\r' as i32 && (*self_0).end >= (*self_0).start {
10317 (*self_0).end = ((*self_0).end).offset(-1);
10318 }
10319 (*self_0).end = ((*self_0).end).offset(1);
10320 (*self_0).length = ((*self_0).end).offset_from((*self_0).start) as c_long as c_int;
10321 self_0
10322}
10323unsafe extern "C" fn ss_indexOf(mut self_0: *mut SimpleString, mut needle: c_char) -> c_int {
10324 let mut c: *mut c_char = (*self_0).start;
10325 while c < (*self_0).end {
10326 if *c as c_int == needle as c_int {
10327 return c.offset_from((*self_0).start) as c_long as c_int;
10328 }
10329 c = c.offset(1);
10330 }
10331 -(1 as c_int)
10332}
10333unsafe extern "C" fn ss_indexOf2(
10334 mut self_0: *mut SimpleString,
10335 mut needle: c_char,
10336 mut at: c_int,
10337) -> c_int {
10338 let mut c: *mut c_char = ((*self_0).start).offset(at as isize);
10339 while c < (*self_0).end {
10340 if *c as c_int == needle as c_int {
10341 return c.offset_from((*self_0).start) as c_long as c_int;
10342 }
10343 c = c.offset(1);
10344 }
10345 -(1 as c_int)
10346}
10347unsafe extern "C" fn ss_substr(
10348 mut self_0: *mut SimpleString,
10349 mut s: c_int,
10350 mut e: c_int,
10351) -> SimpleString {
10352 let mut result: SimpleString = SimpleString {
10353 start: std::ptr::null_mut::<c_char>(),
10354 end: std::ptr::null_mut::<c_char>(),
10355 length: 0,
10356 };
10357 e += s;
10358 result.start = ((*self_0).start).offset(s as isize);
10359 result.end = ((*self_0).start).offset(e as isize);
10360 result.length = e - s;
10361 result
10362}
10363unsafe extern "C" fn ss_substr2(mut self_0: *mut SimpleString, mut s: c_int) -> SimpleString {
10364 let mut result: SimpleString = SimpleString {
10365 start: std::ptr::null_mut::<c_char>(),
10366 end: std::ptr::null_mut::<c_char>(),
10367 length: 0,
10368 };
10369 result.start = ((*self_0).start).offset(s as isize);
10370 result.end = (*self_0).end;
10371 result.length = (result.end).offset_from(result.start) as c_long as c_int;
10372 result
10373}
10374unsafe extern "C" fn ss_equals(mut self_0: *mut SimpleString, mut str: *const c_char) -> c_int {
10375 let mut i: c_int = 0;
10376 let mut otherLen: c_int = spine_strlen(str) as c_int;
10377 if (*self_0).length != otherLen {
10378 return 0 as c_int;
10379 }
10380 i = 0 as c_int;
10381 while i < (*self_0).length {
10382 if *((*self_0).start).offset(i as isize) as c_int != *str.offset(i as isize) as c_int {
10383 return 0 as c_int;
10384 }
10385 i += 1;
10386 }
10387 -(1 as c_int)
10388}
10389unsafe extern "C" fn ss_copy(mut self_0: *mut SimpleString) -> *mut c_char {
10390 let mut string: *mut c_char = _spCalloc(
10391 ((*self_0).length + 1 as c_int) as size_t,
10392 ::core::mem::size_of::<c_char>() as c_ulong,
10393 (b"spine.c\0" as *const u8).cast::<c_char>(),
10394 4387 as c_int,
10395 )
10396 .cast::<c_char>();
10397 spine_memcpy(
10398 string.cast::<c_void>(),
10399 (*self_0).start as *const c_void,
10400 (*self_0).length as size_t,
10401 );
10402 *string.offset((*self_0).length as isize) = '\0' as i32 as c_char;
10403 string
10404}
10405unsafe extern "C" fn ss_toInt(mut self_0: *mut SimpleString) -> c_int {
10406 spine_strtol((*self_0).start, &mut (*self_0).end, 10 as c_int) as c_int
10407}
10408unsafe extern "C" fn ai_readLine(mut self_0: *mut AtlasInput) -> *mut SimpleString {
10409 if (*self_0).index >= (*self_0).end.cast_mut() {
10410 return std::ptr::null_mut::<SimpleString>();
10411 }
10412 (*self_0).line.start = (*self_0).index;
10413 while (*self_0).index < (*self_0).end.cast_mut() && *(*self_0).index as c_int != '\n' as i32 {
10414 (*self_0).index = ((*self_0).index).offset(1);
10415 }
10416 (*self_0).line.end = (*self_0).index;
10417 if (*self_0).index != (*self_0).end.cast_mut() {
10418 (*self_0).index = ((*self_0).index).offset(1);
10419 }
10420 (*self_0).line = *ss_trim(&mut (*self_0).line);
10421 (*self_0).line.length =
10422 ((*self_0).line.end).offset_from((*self_0).line.start) as c_long as c_int;
10423 &mut (*self_0).line
10424}
10425unsafe extern "C" fn ai_readEntry(
10426 mut entry: *mut SimpleString,
10427 mut line: *mut SimpleString,
10428) -> c_int {
10429 let mut colon: c_int = 0;
10430 let mut i: c_int = 0;
10431 let mut lastMatch: c_int = 0;
10432 let mut substr: SimpleString = SimpleString {
10433 start: std::ptr::null_mut::<c_char>(),
10434 end: std::ptr::null_mut::<c_char>(),
10435 length: 0,
10436 };
10437 if line.is_null() {
10438 return 0 as c_int;
10439 }
10440 ss_trim(line);
10441 if (*line).length == 0 as c_int {
10442 return 0 as c_int;
10443 }
10444 colon = ss_indexOf(line, ':' as i32 as c_char);
10445 if colon == -(1 as c_int) {
10446 return 0 as c_int;
10447 }
10448 substr = ss_substr(line, 0 as c_int, colon);
10449 *entry.offset(0 as c_int as isize) = *ss_trim(&mut substr);
10450 i = 1 as c_int;
10451 lastMatch = colon + 1 as c_int;
10452 loop {
10453 let mut comma: c_int = ss_indexOf2(line, ',' as i32 as c_char, lastMatch);
10454 if comma == -(1 as c_int) {
10455 substr = ss_substr2(line, lastMatch);
10456 *entry.offset(i as isize) = *ss_trim(&mut substr);
10457 return i;
10458 }
10459 substr = ss_substr(line, lastMatch, comma - lastMatch);
10460 *entry.offset(i as isize) = *ss_trim(&mut substr);
10461 lastMatch = comma + 1 as c_int;
10462 if i == 4 as c_int {
10463 return 4 as c_int;
10464 }
10465 i += 1;
10466 }
10467}
10468static mut formatNames: [*const c_char; 8] = [
10469 (b"\0" as *const u8).cast::<c_char>(),
10470 (b"Alpha\0" as *const u8).cast::<c_char>(),
10471 (b"Intensity\0" as *const u8).cast::<c_char>(),
10472 (b"LuminanceAlpha\0" as *const u8).cast::<c_char>(),
10473 (b"RGB565\0" as *const u8).cast::<c_char>(),
10474 (b"RGBA4444\0" as *const u8).cast::<c_char>(),
10475 (b"RGB888\0" as *const u8).cast::<c_char>(),
10476 (b"RGBA8888\0" as *const u8).cast::<c_char>(),
10477];
10478static mut textureFilterNames: [*const c_char; 8] = [
10479 (b"\0" as *const u8).cast::<c_char>(),
10480 (b"Nearest\0" as *const u8).cast::<c_char>(),
10481 (b"Linear\0" as *const u8).cast::<c_char>(),
10482 (b"MipMap\0" as *const u8).cast::<c_char>(),
10483 (b"MipMapNearestNearest\0" as *const u8).cast::<c_char>(),
10484 (b"MipMapLinearNearest\0" as *const u8).cast::<c_char>(),
10485 (b"MipMapNearestLinear\0" as *const u8).cast::<c_char>(),
10486 (b"MipMapLinearLinear\0" as *const u8).cast::<c_char>(),
10487];
10488#[no_mangle]
10489pub unsafe extern "C" fn indexOf(
10490 mut array: *mut *const c_char,
10491 mut count: c_int,
10492 mut str: *mut SimpleString,
10493) -> c_int {
10494 let mut i: c_int = 0;
10495 i = 0 as c_int;
10496 while i < count {
10497 if ss_equals(str, *array.offset(i as isize)) != 0 {
10498 return i;
10499 }
10500 i += 1;
10501 }
10502 0 as c_int
10503}
10504#[no_mangle]
10505pub unsafe extern "C" fn spAtlas_create(
10506 mut begin: *const c_char,
10507 mut length: c_int,
10508 mut dir: *const c_char,
10509 mut rendererObject: *mut c_void,
10510) -> *mut spAtlas {
10511 let mut self_0: *mut spAtlas = std::ptr::null_mut::<spAtlas>();
10512 let mut reader: AtlasInput = AtlasInput {
10513 start: std::ptr::null::<c_char>(),
10514 end: std::ptr::null::<c_char>(),
10515 index: std::ptr::null_mut::<c_char>(),
10516 length: 0,
10517 line: SimpleString {
10518 start: std::ptr::null_mut::<c_char>(),
10519 end: std::ptr::null_mut::<c_char>(),
10520 length: 0,
10521 },
10522 };
10523 let mut line: *mut SimpleString = std::ptr::null_mut::<SimpleString>();
10524 let mut entry: [SimpleString; 5] = [SimpleString {
10525 start: std::ptr::null_mut::<c_char>(),
10526 end: std::ptr::null_mut::<c_char>(),
10527 length: 0,
10528 }; 5];
10529 let mut page: *mut spAtlasPage = std::ptr::null_mut::<spAtlasPage>();
10530 let mut lastPage: *mut spAtlasPage = std::ptr::null_mut::<spAtlasPage>();
10531 let mut lastRegion: *mut spAtlasRegion = std::ptr::null_mut::<spAtlasRegion>();
10532 let mut count: c_int = 0;
10533 let mut dirLength: c_int = spine_strlen(dir) as c_int;
10534 let mut needsSlash: c_int = (dirLength > 0 as c_int
10535 && *dir.offset((dirLength - 1 as c_int) as isize) as c_int != '/' as i32
10536 && *dir.offset((dirLength - 1 as c_int) as isize) as c_int != '\\' as i32)
10537 as c_int;
10538 self_0 = _spCalloc(
10539 1 as c_int as size_t,
10540 ::core::mem::size_of::<spAtlas>() as c_ulong,
10541 (b"spine.c\0" as *const u8).cast::<c_char>(),
10542 4468 as c_int,
10543 )
10544 .cast::<spAtlas>();
10545 (*self_0).rendererObject = rendererObject;
10546 reader.start = begin;
10547 reader.end = begin.offset(length as isize);
10548 reader.index = begin.cast_mut();
10549 reader.length = length;
10550 line = ai_readLine(&mut reader);
10551 while !line.is_null() && (*line).length == 0 as c_int {
10552 line = ai_readLine(&mut reader);
10553 }
10554 while -(1 as c_int) != 0 {
10555 if line.is_null() || (*line).length == 0 as c_int {
10556 break;
10557 }
10558 if ai_readEntry(entry.as_mut_ptr(), line) == 0 as c_int {
10559 break;
10560 }
10561 line = ai_readLine(&mut reader);
10562 }
10563 while -(1 as c_int) != 0 {
10564 if line.is_null() {
10565 break;
10566 }
10567 if (*ss_trim(line)).length == 0 as c_int {
10568 page = std::ptr::null_mut::<spAtlasPage>();
10569 line = ai_readLine(&mut reader);
10570 } else if page.is_null() {
10571 let mut name: *mut c_char = ss_copy(line);
10572 let mut path: *mut c_char = _spCalloc(
10573 ((dirLength + needsSlash) as c_ulong)
10574 .wrapping_add(spine_strlen(name))
10575 .wrapping_add(1 as c_int as c_ulong),
10576 ::core::mem::size_of::<c_char>() as c_ulong,
10577 (b"spine.c\0" as *const u8).cast::<c_char>(),
10578 4493 as c_int,
10579 )
10580 .cast::<c_char>();
10581 spine_memcpy(
10582 path.cast::<c_void>(),
10583 dir.cast::<c_void>(),
10584 dirLength as size_t,
10585 );
10586 if needsSlash != 0 {
10587 *path.offset(dirLength as isize) = '/' as i32 as c_char;
10588 }
10589 spine_strcpy(
10590 path.offset(dirLength as isize).offset(needsSlash as isize),
10591 name,
10592 );
10593 page = spAtlasPage_create(self_0, name);
10594 _spFree(name.cast::<c_void>());
10595 if !lastPage.is_null() {
10596 (*lastPage).next = page;
10597 } else {
10598 (*self_0).pages = page;
10599 }
10600 lastPage = page;
10601 while -(1 as c_int) != 0 {
10602 line = ai_readLine(&mut reader);
10603 if ai_readEntry(entry.as_mut_ptr(), line) == 0 as c_int {
10604 break;
10605 }
10606 if ss_equals(
10607 &mut *entry.as_mut_ptr().offset(0 as c_int as isize),
10608 (b"size\0" as *const u8).cast::<c_char>(),
10609 ) != 0
10610 {
10611 (*page).width = ss_toInt(&mut *entry.as_mut_ptr().offset(1 as c_int as isize));
10612 (*page).height = ss_toInt(&mut *entry.as_mut_ptr().offset(2 as c_int as isize));
10613 } else if ss_equals(
10614 &mut *entry.as_mut_ptr().offset(0 as c_int as isize),
10615 (b"format\0" as *const u8).cast::<c_char>(),
10616 ) != 0
10617 {
10618 (*page).format = indexOf(
10619 formatNames.as_mut_ptr(),
10620 8 as c_int,
10621 &mut *entry.as_mut_ptr().offset(1 as c_int as isize),
10622 ) as spAtlasFormat;
10623 } else if ss_equals(
10624 &mut *entry.as_mut_ptr().offset(0 as c_int as isize),
10625 (b"filter\0" as *const u8).cast::<c_char>(),
10626 ) != 0
10627 {
10628 (*page).minFilter = indexOf(
10629 textureFilterNames.as_mut_ptr(),
10630 8 as c_int,
10631 &mut *entry.as_mut_ptr().offset(1 as c_int as isize),
10632 ) as spAtlasFilter;
10633 (*page).magFilter = indexOf(
10634 textureFilterNames.as_mut_ptr(),
10635 8 as c_int,
10636 &mut *entry.as_mut_ptr().offset(2 as c_int as isize),
10637 ) as spAtlasFilter;
10638 } else if ss_equals(
10639 &mut *entry.as_mut_ptr().offset(0 as c_int as isize),
10640 (b"repeat\0" as *const u8).cast::<c_char>(),
10641 ) != 0
10642 {
10643 (*page).uWrap = SP_ATLAS_CLAMPTOEDGE;
10644 (*page).vWrap = SP_ATLAS_CLAMPTOEDGE;
10645 if ss_indexOf(
10646 &mut *entry.as_mut_ptr().offset(1 as c_int as isize),
10647 'x' as i32 as c_char,
10648 ) != -(1 as c_int)
10649 {
10650 (*page).uWrap = SP_ATLAS_REPEAT;
10651 }
10652 if ss_indexOf(
10653 &mut *entry.as_mut_ptr().offset(1 as c_int as isize),
10654 'y' as i32 as c_char,
10655 ) != -(1 as c_int)
10656 {
10657 (*page).vWrap = SP_ATLAS_REPEAT;
10658 }
10659 } else if ss_equals(
10660 &mut *entry.as_mut_ptr().offset(0 as c_int as isize),
10661 (b"pma\0" as *const u8).cast::<c_char>(),
10662 ) != 0
10663 {
10664 (*page).pma = ss_equals(
10665 &mut *entry.as_mut_ptr().offset(1 as c_int as isize),
10666 (b"true\0" as *const u8).cast::<c_char>(),
10667 );
10668 }
10669 }
10670 _spAtlasPage_createTexture(page, path);
10671 _spFree(path.cast::<c_void>());
10672 } else {
10673 let mut region: *mut spAtlasRegion = spAtlasRegion_create();
10674 if !lastRegion.is_null() {
10675 (*lastRegion).next = region;
10676 } else {
10677 (*self_0).regions = region;
10678 }
10679 lastRegion = region;
10680 (*region).page = page;
10681 (*region).name = ss_copy(line);
10682 while -(1 as c_int) != 0 {
10683 line = ai_readLine(&mut reader);
10684 count = ai_readEntry(entry.as_mut_ptr(), line);
10685 if count == 0 as c_int {
10686 break;
10687 }
10688 if ss_equals(
10689 &mut *entry.as_mut_ptr().offset(0 as c_int as isize),
10690 (b"xy\0" as *const u8).cast::<c_char>(),
10691 ) != 0
10692 {
10693 (*region).x = ss_toInt(&mut *entry.as_mut_ptr().offset(1 as c_int as isize));
10694 (*region).y = ss_toInt(&mut *entry.as_mut_ptr().offset(2 as c_int as isize));
10695 } else if ss_equals(
10696 &mut *entry.as_mut_ptr().offset(0 as c_int as isize),
10697 (b"size\0" as *const u8).cast::<c_char>(),
10698 ) != 0
10699 {
10700 (*region).super_0.width =
10701 ss_toInt(&mut *entry.as_mut_ptr().offset(1 as c_int as isize));
10702 (*region).super_0.height =
10703 ss_toInt(&mut *entry.as_mut_ptr().offset(2 as c_int as isize));
10704 } else if ss_equals(
10705 &mut *entry.as_mut_ptr().offset(0 as c_int as isize),
10706 (b"bounds\0" as *const u8).cast::<c_char>(),
10707 ) != 0
10708 {
10709 (*region).x = ss_toInt(&mut *entry.as_mut_ptr().offset(1 as c_int as isize));
10710 (*region).y = ss_toInt(&mut *entry.as_mut_ptr().offset(2 as c_int as isize));
10711 (*region).super_0.width =
10712 ss_toInt(&mut *entry.as_mut_ptr().offset(3 as c_int as isize));
10713 (*region).super_0.height =
10714 ss_toInt(&mut *entry.as_mut_ptr().offset(4 as c_int as isize));
10715 } else if ss_equals(
10716 &mut *entry.as_mut_ptr().offset(0 as c_int as isize),
10717 (b"offset\0" as *const u8).cast::<c_char>(),
10718 ) != 0
10719 {
10720 (*region).super_0.offsetX =
10721 ss_toInt(&mut *entry.as_mut_ptr().offset(1 as c_int as isize)) as c_float;
10722 (*region).super_0.offsetY =
10723 ss_toInt(&mut *entry.as_mut_ptr().offset(2 as c_int as isize)) as c_float;
10724 } else if ss_equals(
10725 &mut *entry.as_mut_ptr().offset(0 as c_int as isize),
10726 (b"orig\0" as *const u8).cast::<c_char>(),
10727 ) != 0
10728 {
10729 (*region).super_0.originalWidth =
10730 ss_toInt(&mut *entry.as_mut_ptr().offset(1 as c_int as isize));
10731 (*region).super_0.originalHeight =
10732 ss_toInt(&mut *entry.as_mut_ptr().offset(2 as c_int as isize));
10733 } else if ss_equals(
10734 &mut *entry.as_mut_ptr().offset(0 as c_int as isize),
10735 (b"offsets\0" as *const u8).cast::<c_char>(),
10736 ) != 0
10737 {
10738 (*region).super_0.offsetX =
10739 ss_toInt(&mut *entry.as_mut_ptr().offset(1 as c_int as isize)) as c_float;
10740 (*region).super_0.offsetY =
10741 ss_toInt(&mut *entry.as_mut_ptr().offset(2 as c_int as isize)) as c_float;
10742 (*region).super_0.originalWidth =
10743 ss_toInt(&mut *entry.as_mut_ptr().offset(3 as c_int as isize));
10744 (*region).super_0.originalHeight =
10745 ss_toInt(&mut *entry.as_mut_ptr().offset(4 as c_int as isize));
10746 } else if ss_equals(
10747 &mut *entry.as_mut_ptr().offset(0 as c_int as isize),
10748 (b"rotate\0" as *const u8).cast::<c_char>(),
10749 ) != 0
10750 {
10751 if ss_equals(
10752 &mut *entry.as_mut_ptr().offset(1 as c_int as isize),
10753 (b"true\0" as *const u8).cast::<c_char>(),
10754 ) != 0
10755 {
10756 (*region).super_0.degrees = 90 as c_int;
10757 } else if ss_equals(
10758 &mut *entry.as_mut_ptr().offset(1 as c_int as isize),
10759 (b"false\0" as *const u8).cast::<c_char>(),
10760 ) == 0
10761 {
10762 (*region).super_0.degrees =
10763 ss_toInt(&mut *entry.as_mut_ptr().offset(1 as c_int as isize));
10764 }
10765 } else if ss_equals(
10766 &mut *entry.as_mut_ptr().offset(0 as c_int as isize),
10767 (b"index\0" as *const u8).cast::<c_char>(),
10768 ) != 0
10769 {
10770 (*region).index =
10771 ss_toInt(&mut *entry.as_mut_ptr().offset(1 as c_int as isize));
10772 } else {
10773 let mut i: c_int = 0 as c_int;
10774 let mut keyValue: spKeyValue = spKeyValue {
10775 name: std::ptr::null_mut::<c_char>(),
10776 values: [0.; 5],
10777 };
10778 keyValue.name = ss_copy(&mut *entry.as_mut_ptr().offset(0 as c_int as isize));
10779 i = 0 as c_int;
10780 while i < count {
10781 keyValue.values[i as usize] =
10782 ss_toInt(&mut *entry.as_mut_ptr().offset((i + 1 as c_int) as isize))
10783 as c_float;
10784 i += 1;
10785 }
10786 spKeyValueArray_add((*region).keyValues, keyValue);
10787 }
10788 }
10789 if (*region).super_0.originalWidth == 0 as c_int
10790 && (*region).super_0.originalHeight == 0 as c_int
10791 {
10792 (*region).super_0.originalWidth = (*region).super_0.width;
10793 (*region).super_0.originalHeight = (*region).super_0.height;
10794 }
10795 (*region).super_0.u = (*region).x as c_float / (*page).width as c_float;
10796 (*region).super_0.v = (*region).y as c_float / (*page).height as c_float;
10797 if (*region).super_0.degrees == 90 as c_int {
10798 (*region).super_0.u2 =
10799 ((*region).x + (*region).super_0.height) as c_float / (*page).width as c_float;
10800 (*region).super_0.v2 =
10801 ((*region).y + (*region).super_0.width) as c_float / (*page).height as c_float;
10802 } else {
10803 (*region).super_0.u2 =
10804 ((*region).x + (*region).super_0.width) as c_float / (*page).width as c_float;
10805 (*region).super_0.v2 =
10806 ((*region).y + (*region).super_0.height) as c_float / (*page).height as c_float;
10807 }
10808 }
10809 }
10810 self_0
10811}
10812#[no_mangle]
10813pub unsafe extern "C" fn spAtlas_createFromFile(
10814 mut path: *const c_char,
10815 mut rendererObject: *mut c_void,
10816) -> *mut spAtlas {
10817 let mut dirLength: c_int = 0;
10818 let mut dir: *mut c_char = std::ptr::null_mut::<c_char>();
10819 let mut length: c_int = 0;
10820 let mut data: *const c_char = std::ptr::null::<c_char>();
10821 let mut atlas: *mut spAtlas = std::ptr::null_mut::<spAtlas>();
10822 let mut lastForwardSlash: *const c_char = spine_strrchr(path, '/' as i32);
10823 let mut lastBackwardSlash: *const c_char = spine_strrchr(path, '\\' as i32);
10824 let mut lastSlash: *const c_char = if lastForwardSlash > lastBackwardSlash {
10825 lastForwardSlash
10826 } else {
10827 lastBackwardSlash
10828 };
10829 if lastSlash == path {
10830 lastSlash = lastSlash.offset(1);
10831 }
10832 dirLength = (if !lastSlash.is_null() {
10833 lastSlash.offset_from(path) as c_long
10834 } else {
10835 0 as c_int as c_long
10836 }) as c_int;
10837 dir = _spMalloc(
10838 (::core::mem::size_of::<c_char>() as c_ulong)
10839 .wrapping_mul((dirLength + 1 as c_int) as c_ulong),
10840 (b"spine.c\0" as *const u8).cast::<c_char>(),
10841 4616 as c_int,
10842 )
10843 .cast::<c_char>();
10844 spine_memcpy(
10845 dir.cast::<c_void>(),
10846 path.cast::<c_void>(),
10847 dirLength as size_t,
10848 );
10849 *dir.offset(dirLength as isize) = '\0' as i32 as c_char;
10850 data = _spUtil_readFile(path, &mut length);
10851 if !data.is_null() {
10852 atlas = spAtlas_create(data, length, dir, rendererObject);
10853 }
10854 _spFree(data as *mut c_void);
10855 _spFree(dir.cast::<c_void>());
10856 atlas
10857}
10858#[no_mangle]
10859pub unsafe extern "C" fn spAtlas_dispose(mut self_0: *mut spAtlas) {
10860 let mut region: *mut spAtlasRegion = std::ptr::null_mut::<spAtlasRegion>();
10861 let mut nextRegion: *mut spAtlasRegion = std::ptr::null_mut::<spAtlasRegion>();
10862 let mut page: *mut spAtlasPage = (*self_0).pages;
10863 while !page.is_null() {
10864 let mut nextPage: *mut spAtlasPage = (*page).next;
10865 spAtlasPage_dispose(page);
10866 page = nextPage;
10867 }
10868 region = (*self_0).regions;
10869 while !region.is_null() {
10870 nextRegion = (*region).next;
10871 spAtlasRegion_dispose(region);
10872 region = nextRegion;
10873 }
10874 _spFree(self_0.cast::<c_void>());
10875}
10876#[no_mangle]
10877pub unsafe extern "C" fn spAtlas_findRegion(
10878 mut self_0: *const spAtlas,
10879 mut name: *const c_char,
10880) -> *mut spAtlasRegion {
10881 let mut region: *mut spAtlasRegion = (*self_0).regions;
10882 while !region.is_null() {
10883 if spine_strcmp((*region).name, name) == 0 as c_int {
10884 return region;
10885 }
10886 region = (*region).next;
10887 }
10888 std::ptr::null_mut::<spAtlasRegion>()
10889}
10890unsafe extern "C" fn loadSequence(
10891 mut atlas: *mut spAtlas,
10892 mut basePath: *const c_char,
10893 mut sequence: *mut spSequence,
10894) -> c_int {
10895 let mut regions: *mut spTextureRegionArray = (*sequence).regions;
10896 let mut path: *mut c_char = _spCalloc(
10897 (spine_strlen(basePath))
10898 .wrapping_add((*sequence).digits as c_ulong)
10899 .wrapping_add(2 as c_int as c_ulong),
10900 ::core::mem::size_of::<c_char>() as c_ulong,
10901 (b"spine.c\0" as *const u8).cast::<c_char>(),
10902 4690 as c_int,
10903 )
10904 .cast::<c_char>();
10905 let mut i: c_int = 0;
10906 i = 0 as c_int;
10907 while i < (*regions).size {
10908 spSequence_getPath(sequence, basePath, i, path);
10909 let fresh33 = &mut (*((*regions).items).offset(i as isize));
10910 *fresh33 = &mut (*(spAtlas_findRegion
10911 as unsafe extern "C" fn(*const spAtlas, *const c_char) -> *mut spAtlasRegion)(
10912 atlas, path,
10913 ))
10914 .super_0;
10915 if (*((*regions).items).offset(i as isize)).is_null() {
10916 _spFree(path.cast::<c_void>());
10917 return 0 as c_int;
10918 }
10919 let fresh34 = &mut (**((*regions).items).offset(i as isize)).rendererObject;
10920 *fresh34 = (*((*regions).items).offset(i as isize)).cast::<c_void>();
10921 i += 1;
10922 }
10923 _spFree(path.cast::<c_void>());
10924 -(1 as c_int)
10925}
10926#[no_mangle]
10927pub unsafe extern "C" fn _spAtlasAttachmentLoader_createAttachment(
10928 mut loader: *mut spAttachmentLoader,
10929 mut _skin: *mut spSkin,
10930 mut type_0: spAttachmentType,
10931 mut name: *const c_char,
10932 mut path: *const c_char,
10933 mut sequence: *mut spSequence,
10934) -> *mut spAttachment {
10935 let mut self_0: *mut spAtlasAttachmentLoader = loader.cast::<spAtlasAttachmentLoader>();
10936 match type_0 as c_uint {
10937 0 => {
10938 let mut attachment: *mut spRegionAttachment = spRegionAttachment_create(name);
10939 if !sequence.is_null() {
10940 if loadSequence((*self_0).atlas, path, sequence) == 0 {
10941 spAttachment_dispose(&mut (*attachment).super_0);
10942 _spAttachmentLoader_setError(
10943 loader,
10944 (b"Couldn't load sequence for region attachment: \0" as *const u8)
10945 .cast::<c_char>(),
10946 path,
10947 );
10948 return std::ptr::null_mut::<spAttachment>();
10949 }
10950 } else {
10951 let mut region: *mut spAtlasRegion = spAtlas_findRegion((*self_0).atlas, path);
10952 if region.is_null() {
10953 spAttachment_dispose(&mut (*attachment).super_0);
10954 _spAttachmentLoader_setError(
10955 loader,
10956 (b"Region not found: \0" as *const u8).cast::<c_char>(),
10957 path,
10958 );
10959 return std::ptr::null_mut::<spAttachment>();
10960 }
10961 (*attachment).rendererObject = region.cast::<c_void>();
10962 (*attachment).region = &mut (*region).super_0;
10963 }
10964 &mut (*attachment).super_0
10965 }
10966 2 | 3 => {
10967 let mut attachment_0: *mut spMeshAttachment = spMeshAttachment_create(name);
10968 if !sequence.is_null() {
10969 if loadSequence((*self_0).atlas, path, sequence) == 0 {
10970 spAttachment_dispose(&mut (*attachment_0).super_0.super_0);
10971 _spAttachmentLoader_setError(
10972 loader,
10973 (b"Couldn't load sequence for mesh attachment: \0" as *const u8)
10974 .cast::<c_char>(),
10975 path,
10976 );
10977 return std::ptr::null_mut::<spAttachment>();
10978 }
10979 } else {
10980 let mut region_0: *mut spAtlasRegion = spAtlas_findRegion((*self_0).atlas, path);
10981 if region_0.is_null() {
10982 _spAttachmentLoader_setError(
10983 loader,
10984 (b"Region not found: \0" as *const u8).cast::<c_char>(),
10985 path,
10986 );
10987 return std::ptr::null_mut::<spAttachment>();
10988 }
10989 (*attachment_0).rendererObject = region_0.cast::<c_void>();
10990 (*attachment_0).region = &mut (*region_0).super_0;
10991 }
10992 &mut (*attachment_0).super_0.super_0
10993 }
10994 1 => {
10995 &mut (*(spBoundingBoxAttachment_create
10996 as unsafe extern "C" fn(*const c_char) -> *mut spBoundingBoxAttachment)(
10997 name
10998 ))
10999 .super_0
11000 .super_0
11001 }
11002 4 => {
11003 &mut (*(spPathAttachment_create
11004 as unsafe extern "C" fn(*const c_char) -> *mut spPathAttachment)(
11005 name
11006 ))
11007 .super_0
11008 .super_0
11009 }
11010 5 => {
11011 &mut (*(spPointAttachment_create
11012 as unsafe extern "C" fn(*const c_char) -> *mut spPointAttachment)(
11013 name
11014 ))
11015 .super_0
11016 }
11017 6 => {
11018 &mut (*(spClippingAttachment_create
11019 as unsafe extern "C" fn(*const c_char) -> *mut spClippingAttachment)(
11020 name
11021 ))
11022 .super_0
11023 .super_0
11024 }
11025 _ => {
11026 _spAttachmentLoader_setUnknownTypeError(loader, type_0);
11027 std::ptr::null_mut::<spAttachment>()
11028 }
11029 }
11030}
11031#[no_mangle]
11032pub unsafe extern "C" fn spAtlasAttachmentLoader_create(
11033 mut atlas: *mut spAtlas,
11034) -> *mut spAtlasAttachmentLoader {
11035 let mut self_0: *mut spAtlasAttachmentLoader = _spCalloc(
11036 1 as c_int as size_t,
11037 ::core::mem::size_of::<spAtlasAttachmentLoader>() as c_ulong,
11038 (b"spine.c\0" as *const u8).cast::<c_char>(),
11039 4767 as c_int,
11040 )
11041 .cast::<spAtlasAttachmentLoader>();
11042 _spAttachmentLoader_init(
11043 &mut (*self_0).super_0,
11044 Some(_spAttachmentLoader_deinit as unsafe extern "C" fn(*mut spAttachmentLoader) -> ()),
11045 Some(
11046 _spAtlasAttachmentLoader_createAttachment
11047 as unsafe extern "C" fn(
11048 *mut spAttachmentLoader,
11049 *mut spSkin,
11050 spAttachmentType,
11051 *const c_char,
11052 *const c_char,
11053 *mut spSequence,
11054 ) -> *mut spAttachment,
11055 ),
11056 None,
11057 None,
11058 );
11059 (*self_0).atlas = atlas;
11060 self_0
11061}
11062#[no_mangle]
11063pub unsafe extern "C" fn _spAttachment_init(
11064 mut self_0: *mut spAttachment,
11065 mut name: *const c_char,
11066 mut type_0: spAttachmentType,
11067 mut dispose: Option<unsafe extern "C" fn(*mut spAttachment) -> ()>,
11068 mut copy: Option<unsafe extern "C" fn(*mut spAttachment) -> *mut spAttachment>,
11069) {
11070 (*self_0).vtable = _spCalloc(
11071 1 as c_int as size_t,
11072 ::core::mem::size_of::<_spAttachmentVtable>() as c_ulong,
11073 (b"spine.c\0" as *const u8).cast::<c_char>(),
11074 4814 as c_int,
11075 )
11076 .cast::<_spAttachmentVtable>() as *const c_void;
11077 let fresh35 = &mut (*((*self_0).vtable as *mut _spAttachmentVtable)).dispose;
11078 *fresh35 = dispose;
11079 let fresh36 = &mut (*((*self_0).vtable as *mut _spAttachmentVtable)).copy;
11080 *fresh36 = copy;
11081 (*self_0).name = _spMalloc(
11082 (::core::mem::size_of::<c_char>() as c_ulong)
11083 .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)),
11084 (b"spine.c\0" as *const u8).cast::<c_char>(),
11085 4818 as c_int,
11086 )
11087 .cast::<c_char>();
11088 spine_strcpy((*self_0).name, name);
11089 (*self_0).type_0 = type_0;
11090}
11091#[no_mangle]
11092pub unsafe extern "C" fn _spAttachment_deinit(mut self_0: *mut spAttachment) {
11093 if !((*self_0).attachmentLoader).is_null() {
11094 spAttachmentLoader_disposeAttachment((*self_0).attachmentLoader, self_0);
11095 }
11096 _spFree((*self_0).vtable.cast_mut());
11097 _spFree((*self_0).name.cast::<c_void>());
11098}
11099#[no_mangle]
11100pub unsafe extern "C" fn spAttachment_copy(mut self_0: *mut spAttachment) -> *mut spAttachment {
11101 ((*((*self_0).vtable as *mut _spAttachmentVtable)).copy).expect("non-null function pointer")(
11102 self_0,
11103 )
11104}
11105#[no_mangle]
11106pub unsafe extern "C" fn spAttachment_dispose(mut self_0: *mut spAttachment) {
11107 (*self_0).refCount -= 1;
11108 if (*self_0).refCount <= 0 as c_int {
11109 ((*((*self_0).vtable as *mut _spAttachmentVtable)).dispose)
11110 .expect("non-null function pointer")(self_0);
11111 }
11112}
11113#[no_mangle]
11114pub unsafe extern "C" fn _spAttachmentLoader_init(
11115 mut self_0: *mut spAttachmentLoader,
11116 mut dispose: Option<unsafe extern "C" fn(*mut spAttachmentLoader) -> ()>,
11117 mut createAttachment: Option<
11118 unsafe extern "C" fn(
11119 *mut spAttachmentLoader,
11120 *mut spSkin,
11121 spAttachmentType,
11122 *const c_char,
11123 *const c_char,
11124 *mut spSequence,
11125 ) -> *mut spAttachment,
11126 >,
11127 mut configureAttachment: Option<
11128 unsafe extern "C" fn(*mut spAttachmentLoader, *mut spAttachment) -> (),
11129 >,
11130 mut disposeAttachment: Option<
11131 unsafe extern "C" fn(*mut spAttachmentLoader, *mut spAttachment) -> (),
11132 >,
11133) {
11134 (*self_0).vtable = _spCalloc(
11135 1 as c_int as size_t,
11136 ::core::mem::size_of::<_spAttachmentLoaderVtable>() as c_ulong,
11137 (b"spine.c\0" as *const u8).cast::<c_char>(),
11138 4888 as c_int,
11139 )
11140 .cast::<_spAttachmentLoaderVtable>() as *const c_void;
11141 let fresh37 = &mut (*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).dispose;
11142 *fresh37 = dispose;
11143 let fresh38 = &mut (*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).createAttachment;
11144 *fresh38 = createAttachment;
11145 let fresh39 = &mut (*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).configureAttachment;
11146 *fresh39 = configureAttachment;
11147 let fresh40 = &mut (*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).disposeAttachment;
11148 *fresh40 = disposeAttachment;
11149}
11150#[no_mangle]
11151pub unsafe extern "C" fn _spAttachmentLoader_deinit(mut self_0: *mut spAttachmentLoader) {
11152 _spFree((*self_0).vtable.cast_mut());
11153 _spFree((*self_0).error1.cast::<c_void>());
11154 _spFree((*self_0).error2.cast::<c_void>());
11155}
11156#[no_mangle]
11157pub unsafe extern "C" fn spAttachmentLoader_dispose(mut self_0: *mut spAttachmentLoader) {
11158 ((*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).dispose)
11159 .expect("non-null function pointer")(self_0);
11160 _spFree(self_0.cast::<c_void>());
11161}
11162#[no_mangle]
11163pub unsafe extern "C" fn spAttachmentLoader_createAttachment(
11164 mut self_0: *mut spAttachmentLoader,
11165 mut skin: *mut spSkin,
11166 mut type_0: spAttachmentType,
11167 mut name: *const c_char,
11168 mut path: *const c_char,
11169 mut sequence: *mut spSequence,
11170) -> *mut spAttachment {
11171 _spFree((*self_0).error1.cast::<c_void>());
11172 _spFree((*self_0).error2.cast::<c_void>());
11173 (*self_0).error1 = std::ptr::null_mut::<c_char>();
11174 (*self_0).error2 = std::ptr::null_mut::<c_char>();
11175 ((*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).createAttachment)
11176 .expect("non-null function pointer")(self_0, skin, type_0, name, path, sequence)
11177}
11178#[no_mangle]
11179pub unsafe extern "C" fn spAttachmentLoader_configureAttachment(
11180 mut self_0: *mut spAttachmentLoader,
11181 mut attachment: *mut spAttachment,
11182) {
11183 if ((*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).configureAttachment).is_none() {
11184 return;
11185 }
11186 ((*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).configureAttachment)
11187 .expect("non-null function pointer")(self_0, attachment);
11188}
11189#[no_mangle]
11190pub unsafe extern "C" fn spAttachmentLoader_disposeAttachment(
11191 mut self_0: *mut spAttachmentLoader,
11192 mut attachment: *mut spAttachment,
11193) {
11194 if ((*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).disposeAttachment).is_none() {
11195 return;
11196 }
11197 ((*((*self_0).vtable as *mut _spAttachmentLoaderVtable)).disposeAttachment)
11198 .expect("non-null function pointer")(self_0, attachment);
11199}
11200#[no_mangle]
11201pub unsafe extern "C" fn _spAttachmentLoader_setError(
11202 mut self_0: *mut spAttachmentLoader,
11203 mut error1: *const c_char,
11204 mut error2: *const c_char,
11205) {
11206 _spFree((*self_0).error1.cast::<c_void>());
11207 _spFree((*self_0).error2.cast::<c_void>());
11208 (*self_0).error1 = _spMalloc(
11209 (::core::mem::size_of::<c_char>() as c_ulong)
11210 .wrapping_mul((spine_strlen(error1)).wrapping_add(1 as c_int as c_ulong)),
11211 (b"spine.c\0" as *const u8).cast::<c_char>(),
11212 4929 as c_int,
11213 )
11214 .cast::<c_char>();
11215 spine_strcpy((*self_0).error1, error1);
11216 (*self_0).error2 = _spMalloc(
11217 (::core::mem::size_of::<c_char>() as c_ulong)
11218 .wrapping_mul((spine_strlen(error2)).wrapping_add(1 as c_int as c_ulong)),
11219 (b"spine.c\0" as *const u8).cast::<c_char>(),
11220 4930 as c_int,
11221 )
11222 .cast::<c_char>();
11223 spine_strcpy((*self_0).error2, error2);
11224}
11225#[no_mangle]
11226pub unsafe extern "C" fn _spAttachmentLoader_setUnknownTypeError(
11227 mut self_0: *mut spAttachmentLoader,
11228 mut type_0: spAttachmentType,
11229) {
11230 let mut buffer: [c_char; 16] = [0; 16];
11231 spine_snprintf!(
11232 buffer.as_mut_ptr(),
11233 16 as c_int as size_t,
11234 (b"%d\0" as *const u8).cast::<c_char>(),
11235 type_0 as c_uint,
11236 );
11237 _spAttachmentLoader_setError(
11238 self_0,
11239 (b"Unknown attachment type: \0" as *const u8).cast::<c_char>(),
11240 buffer.as_mut_ptr(),
11241 );
11242}
11243static mut yDown: c_int = 0;
11244#[no_mangle]
11245pub unsafe extern "C" fn spBone_setYDown(mut value: c_int) {
11246 yDown = value;
11247}
11248#[no_mangle]
11249pub unsafe extern "C" fn spBone_isYDown() -> c_int {
11250 yDown
11251}
11252#[no_mangle]
11253pub unsafe extern "C" fn spBone_create(
11254 mut data: *mut spBoneData,
11255 mut skeleton: *mut spSkeleton,
11256 mut parent: *mut spBone,
11257) -> *mut spBone {
11258 let mut self_0: *mut spBone = _spCalloc(
11259 1 as c_int as size_t,
11260 ::core::mem::size_of::<spBone>() as c_ulong,
11261 (b"spine.c\0" as *const u8).cast::<c_char>(),
11262 4982 as c_int,
11263 )
11264 .cast::<spBone>();
11265 (*self_0).data = data;
11266 (*self_0).skeleton = skeleton;
11267 (*self_0).parent = parent;
11268 (*self_0).a = 1.0f32;
11269 (*self_0).d = 1.0f32;
11270 (*self_0).active = -(1 as c_int);
11271 (*self_0).inherit = SP_INHERIT_NORMAL;
11272 spBone_setToSetupPose(self_0);
11273 self_0
11274}
11275#[no_mangle]
11276pub unsafe extern "C" fn spBone_dispose(mut self_0: *mut spBone) {
11277 _spFree((*self_0).children.cast::<c_void>());
11278 _spFree(self_0.cast::<c_void>());
11279}
11280#[no_mangle]
11281pub unsafe extern "C" fn spBone_update(mut self_0: *mut spBone) {
11282 spBone_updateWorldTransformWith(
11283 self_0,
11284 (*self_0).ax,
11285 (*self_0).ay,
11286 (*self_0).arotation,
11287 (*self_0).ascaleX,
11288 (*self_0).ascaleY,
11289 (*self_0).ashearX,
11290 (*self_0).ashearY,
11291 );
11292}
11293#[no_mangle]
11294pub unsafe extern "C" fn spBone_updateWorldTransform(mut self_0: *mut spBone) {
11295 spBone_updateWorldTransformWith(
11296 self_0,
11297 (*self_0).x,
11298 (*self_0).y,
11299 (*self_0).rotation,
11300 (*self_0).scaleX,
11301 (*self_0).scaleY,
11302 (*self_0).shearX,
11303 (*self_0).shearY,
11304 );
11305}
11306#[no_mangle]
11307pub unsafe extern "C" fn spBone_updateWorldTransformWith(
11308 mut self_0: *mut spBone,
11309 mut x: c_float,
11310 mut y: c_float,
11311 mut rotation: c_float,
11312 mut scaleX: c_float,
11313 mut scaleY: c_float,
11314 mut shearX: c_float,
11315 mut shearY: c_float,
11316) {
11317 let mut pa: c_float = 0.;
11318 let mut pb: c_float = 0.;
11319 let mut pc: c_float = 0.;
11320 let mut pd: c_float = 0.;
11321 let mut sx: c_float = (*(*self_0).skeleton).scaleX;
11322 let mut sy: c_float = (*(*self_0).skeleton).scaleY
11323 * (if spBone_isYDown() != 0 {
11324 -(1 as c_int)
11325 } else {
11326 1 as c_int
11327 }) as c_float;
11328 let mut parent: *mut spBone = (*self_0).parent;
11329 (*self_0).ax = x;
11330 (*self_0).ay = y;
11331 (*self_0).arotation = rotation;
11332 (*self_0).ascaleX = scaleX;
11333 (*self_0).ascaleY = scaleY;
11334 (*self_0).ashearX = shearX;
11335 (*self_0).ashearY = shearY;
11336 if parent.is_null() {
11337 let mut rx: c_float = (rotation + shearX) * (3.141_592_7_f32 / 180 as c_int as c_float);
11338 let mut ry: c_float = (rotation + 90 as c_int as c_float + shearY)
11339 * (3.141_592_7_f32 / 180 as c_int as c_float);
11340 (*self_0).a = spine_cosf(rx) * scaleX * sx;
11341 (*self_0).b = spine_cosf(ry) * scaleY * sx;
11342 (*self_0).c = spine_sinf(rx) * scaleX * sy;
11343 (*self_0).d = spine_sinf(ry) * scaleY * sy;
11344 (*self_0).worldX = x * sx + (*(*self_0).skeleton).x;
11345 (*self_0).worldY = y * sy + (*(*self_0).skeleton).y;
11346 return;
11347 }
11348 pa = (*parent).a;
11349 pb = (*parent).b;
11350 pc = (*parent).c;
11351 pd = (*parent).d;
11352 (*self_0).worldX = pa * x + pb * y + (*parent).worldX;
11353 (*self_0).worldY = pc * x + pd * y + (*parent).worldY;
11354 match (*self_0).inherit as c_uint {
11355 0 => {
11356 let mut rx_0: c_float =
11357 (rotation + shearX) * (3.141_592_7_f32 / 180 as c_int as c_float);
11358 let mut ry_0: c_float = (rotation + 90 as c_int as c_float + shearY)
11359 * (3.141_592_7_f32 / 180 as c_int as c_float);
11360 let mut la: c_float = spine_cosf(rx_0) * scaleX;
11361 let mut lb: c_float = spine_cosf(ry_0) * scaleY;
11362 let mut lc: c_float = spine_sinf(rx_0) * scaleX;
11363 let mut ld: c_float = spine_sinf(ry_0) * scaleY;
11364 (*self_0).a = pa * la + pb * lc;
11365 (*self_0).b = pa * lb + pb * ld;
11366 (*self_0).c = pc * la + pd * lc;
11367 (*self_0).d = pc * lb + pd * ld;
11368 return;
11369 }
11370 1 => {
11371 let mut rx_1: c_float =
11372 (rotation + shearX) * (3.141_592_7_f32 / 180 as c_int as c_float);
11373 let mut ry_1: c_float = (rotation + 90 as c_int as c_float + shearY)
11374 * (3.141_592_7_f32 / 180 as c_int as c_float);
11375 (*self_0).a = spine_cosf(rx_1) * scaleX;
11376 (*self_0).b = spine_cosf(ry_1) * scaleY;
11377 (*self_0).c = spine_sinf(rx_1) * scaleX;
11378 (*self_0).d = spine_sinf(ry_1) * scaleY;
11379 }
11380 2 => {
11381 let mut s: c_float = pa * pa + pc * pc;
11382 let mut prx: c_float = 0.;
11383 if s > 0.0001f32 {
11384 s = (if pa * pd - pb * pc < 0 as c_int as c_float {
11385 -(pa * pd - pb * pc)
11386 } else {
11387 pa * pd - pb * pc
11388 }) / s;
11389 pa /= sx;
11390 pc /= sy;
11391 pb = pc * s;
11392 pd = pa * s;
11393 prx = spine_atan2f(pc, pa) * (180 as c_int as c_float / 3.141_592_7_f32);
11394 } else {
11395 pa = 0 as c_int as c_float;
11396 pc = 0 as c_int as c_float;
11397 prx = 90 as c_int as c_float
11398 - spine_atan2f(pd, pb) * (180 as c_int as c_float / 3.141_592_7_f32);
11399 }
11400 let mut rx_2: c_float =
11401 (rotation + shearX - prx) * (3.141_592_7_f32 / 180 as c_int as c_float);
11402 let mut ry_2: c_float = (rotation + shearY - prx + 90 as c_int as c_float)
11403 * (3.141_592_7_f32 / 180 as c_int as c_float);
11404 let mut la_0: c_float = spine_cosf(rx_2) * scaleX;
11405 let mut lb_0: c_float = spine_cosf(ry_2) * scaleY;
11406 let mut lc_0: c_float = spine_sinf(rx_2) * scaleX;
11407 let mut ld_0: c_float = spine_sinf(ry_2) * scaleY;
11408 (*self_0).a = pa * la_0 - pb * lc_0;
11409 (*self_0).b = pa * lb_0 - pb * ld_0;
11410 (*self_0).c = pc * la_0 + pd * lc_0;
11411 (*self_0).d = pc * lb_0 + pd * ld_0;
11412 }
11413 3 | 4 => {
11414 rotation *= 3.141_592_7_f32 / 180 as c_int as c_float;
11415 let mut cosine: c_float = spine_cosf(rotation);
11416 let mut sine: c_float = spine_sinf(rotation);
11417 let mut za: c_float = (pa * cosine + pb * sine) / sx;
11418 let mut zc: c_float = (pc * cosine + pd * sine) / sy;
11419 let mut s_0: c_float = spine_sqrtf(za * za + zc * zc);
11420 if (*(*self_0).data).inherit as c_uint == SP_INHERIT_NOSCALE as c_int as c_uint
11421 && (pa * pd - pb * pc < 0 as c_int as c_float) as c_int
11422 != ((sx < 0 as c_int as c_float) as c_int
11423 != (sy < 0 as c_int as c_float) as c_int) as c_int
11424 {
11425 s_0 = -s_0;
11426 }
11427 rotation = 3.141_592_7_f32 / 2 as c_int as c_float + spine_atan2f(zc, za);
11428 let mut zb: c_float = spine_cosf(rotation) * s_0;
11429 let mut zd: c_float = spine_sinf(rotation) * s_0;
11430 shearX *= 3.141_592_7_f32 / 180 as c_int as c_float;
11431 shearY =
11432 (90 as c_int as c_float + shearY) * (3.141_592_7_f32 / 180 as c_int as c_float);
11433 let mut la_1: c_float = spine_cosf(shearX) * scaleX;
11434 let mut lb_1: c_float = spine_cosf(shearY) * scaleY;
11435 let mut lc_1: c_float = spine_sinf(shearX) * scaleX;
11436 let mut ld_1: c_float = spine_sinf(shearY) * scaleY;
11437 (*self_0).a = za * la_1 + zb * lc_1;
11438 (*self_0).b = za * lb_1 + zb * ld_1;
11439 (*self_0).c = zc * la_1 + zd * lc_1;
11440 (*self_0).d = zc * lb_1 + zd * ld_1;
11441 }
11442 _ => {}
11443 }
11444 (*self_0).a *= sx;
11445 (*self_0).b *= sx;
11446 (*self_0).c *= sy;
11447 (*self_0).d *= sy;
11448}
11449#[no_mangle]
11450pub unsafe extern "C" fn spBone_setToSetupPose(mut self_0: *mut spBone) {
11451 (*self_0).x = (*(*self_0).data).x;
11452 (*self_0).y = (*(*self_0).data).y;
11453 (*self_0).rotation = (*(*self_0).data).rotation;
11454 (*self_0).scaleX = (*(*self_0).data).scaleX;
11455 (*self_0).scaleY = (*(*self_0).data).scaleY;
11456 (*self_0).shearX = (*(*self_0).data).shearX;
11457 (*self_0).shearY = (*(*self_0).data).shearY;
11458 (*self_0).inherit = (*(*self_0).data).inherit;
11459}
11460#[no_mangle]
11461pub unsafe extern "C" fn spBone_getWorldRotationX(mut self_0: *mut spBone) -> c_float {
11462 spine_atan2f((*self_0).c, (*self_0).a) * (180 as c_int as c_float / 3.141_592_7_f32)
11463}
11464#[no_mangle]
11465pub unsafe extern "C" fn spBone_getWorldRotationY(mut self_0: *mut spBone) -> c_float {
11466 spine_atan2f((*self_0).d, (*self_0).b) * (180 as c_int as c_float / 3.141_592_7_f32)
11467}
11468#[no_mangle]
11469pub unsafe extern "C" fn spBone_getWorldScaleX(mut self_0: *mut spBone) -> c_float {
11470 spine_sqrtf((*self_0).a * (*self_0).a + (*self_0).c * (*self_0).c)
11471}
11472#[no_mangle]
11473pub unsafe extern "C" fn spBone_getWorldScaleY(mut self_0: *mut spBone) -> c_float {
11474 spine_sqrtf((*self_0).b * (*self_0).b + (*self_0).d * (*self_0).d)
11475}
11476#[no_mangle]
11477pub unsafe extern "C" fn spBone_updateAppliedTransform(mut self_0: *mut spBone) {
11478 let mut pa: c_float = 0.;
11479 let mut pb: c_float = 0.;
11480 let mut pc: c_float = 0.;
11481 let mut pd: c_float = 0.;
11482 let mut pid: c_float = 0.;
11483 let mut ia: c_float = 0.;
11484 let mut ib: c_float = 0.;
11485 let mut ic: c_float = 0.;
11486 let mut id: c_float = 0.;
11487 let mut dx: c_float = 0.;
11488 let mut dy: c_float = 0.;
11489 let mut ra: c_float = 0.;
11490 let mut rb: c_float = 0.;
11491 let mut rc: c_float = 0.;
11492 let mut rd: c_float = 0.;
11493 let mut s: c_float = 0.;
11494 let mut sa: c_float = 0.;
11495 let mut sc: c_float = 0.;
11496 let mut cosine: c_float = 0.;
11497 let mut sine: c_float = 0.;
11498 let mut yDownScale: c_float = (if spBone_isYDown() != 0 {
11499 -(1 as c_int)
11500 } else {
11501 1 as c_int
11502 }) as c_float;
11503 let mut parent: *mut spBone = (*self_0).parent;
11504 if parent.is_null() {
11505 (*self_0).ax = (*self_0).worldX - (*(*self_0).skeleton).x;
11506 (*self_0).ay = (*self_0).worldY - (*(*self_0).skeleton).y;
11507 (*self_0).arotation =
11508 spine_atan2f((*self_0).c, (*self_0).a) * (180 as c_int as c_float / 3.141_592_7_f32);
11509 (*self_0).ascaleX = spine_sqrtf((*self_0).a * (*self_0).a + (*self_0).c * (*self_0).c);
11510 (*self_0).ascaleY = spine_sqrtf((*self_0).b * (*self_0).b + (*self_0).d * (*self_0).d);
11511 (*self_0).ashearX = 0 as c_int as c_float;
11512 (*self_0).ashearY = spine_atan2f(
11513 (*self_0).a * (*self_0).b + (*self_0).c * (*self_0).d,
11514 (*self_0).a * (*self_0).d - (*self_0).b * (*self_0).c,
11515 ) * (180 as c_int as c_float / 3.141_592_7_f32);
11516 return;
11517 }
11518 pa = (*parent).a;
11519 pb = (*parent).b;
11520 pc = (*parent).c;
11521 pd = (*parent).d;
11522 pid = 1 as c_int as c_float / (pa * pd - pb * pc);
11523 ia = pd * pid;
11524 ib = pb * pid;
11525 ic = pc * pid;
11526 id = pa * pid;
11527 dx = (*self_0).worldX - (*parent).worldX;
11528 dy = (*self_0).worldY - (*parent).worldY;
11529 (*self_0).ax = dx * ia - dy * ib;
11530 (*self_0).ay = dy * id - dx * ic;
11531 if (*self_0).inherit as c_uint == SP_INHERIT_ONLYTRANSLATION as c_int as c_uint {
11532 ra = (*self_0).a;
11533 rb = (*self_0).b;
11534 rc = (*self_0).c;
11535 rd = (*self_0).d;
11536 } else {
11537 match (*self_0).inherit as c_uint {
11538 2 => {
11539 s = (if pa * pd - pb * pc < 0 as c_int as c_float {
11540 -(pa * pd - pb * pc)
11541 } else {
11542 pa * pd - pb * pc
11543 }) / (pa * pa + pc * pc);
11544 sa = pa / (*(*self_0).skeleton).scaleX;
11545 sc = pc / (*(*self_0).skeleton).scaleY * yDownScale;
11546 pb = -sc * s * (*(*self_0).skeleton).scaleX;
11547 pd = sa * s * (*(*self_0).skeleton).scaleY * yDownScale;
11548 pid = 1 as c_int as c_float / (pa * pd - pb * pc);
11549 ia = pd * pid;
11550 ib = pb * pid;
11551 }
11552 3 | 4 => {
11553 let mut r: c_float =
11554 (*self_0).rotation * (3.141_592_7_f32 / 180 as c_int as c_float);
11555 cosine = spine_cosf(r);
11556 sine = spine_sinf(r);
11557 pa = (pa * cosine + pb * sine) / (*(*self_0).skeleton).scaleX;
11558 pc = (pc * cosine + pd * sine) / (*(*self_0).skeleton).scaleY * yDownScale;
11559 s = spine_sqrtf(pa * pa + pc * pc);
11560 if s as c_double > 0.00001f64 {
11561 s = 1 as c_int as c_float / s;
11562 }
11563 pa *= s;
11564 pc *= s;
11565 s = spine_sqrtf(pa * pa + pc * pc);
11566 if (*self_0).inherit as c_uint == SP_INHERIT_NOSCALE as c_int as c_uint
11567 && (pid < 0 as c_int as c_float) as c_int
11568 != (((*(*self_0).skeleton).scaleX < 0 as c_int as c_float) as c_int
11569 != ((*(*self_0).skeleton).scaleY * yDownScale < 0 as c_int as c_float)
11570 as c_int) as c_int
11571 {
11572 s = -s;
11573 }
11574 r = 3.141_592_7_f32 / 2 as c_int as c_float + spine_atan2f(pc, pa);
11575 pb = spine_cosf(r) * s;
11576 pd = spine_sinf(r) * s;
11577 pid = 1 as c_int as c_float / (pa * pd - pb * pc);
11578 ia = pd * pid;
11579 ib = pb * pid;
11580 ic = pc * pid;
11581 id = pa * pid;
11582 }
11583 1 | 0 | _ => {}
11584 }
11585 ra = ia * (*self_0).a - ib * (*self_0).c;
11586 rb = ia * (*self_0).b - ib * (*self_0).d;
11587 rc = id * (*self_0).c - ic * (*self_0).a;
11588 rd = id * (*self_0).d - ic * (*self_0).b;
11589 }
11590 (*self_0).ashearX = 0 as c_int as c_float;
11591 (*self_0).ascaleX = spine_sqrtf(ra * ra + rc * rc);
11592 if (*self_0).ascaleX > 0.0001f32 {
11593 let mut det: c_float = ra * rd - rb * rc;
11594 (*self_0).ascaleY = det / (*self_0).ascaleX;
11595 (*self_0).ashearY =
11596 -(spine_atan2f(ra * rb + rc * rd, det) * (180 as c_int as c_float / 3.141_592_7_f32));
11597 (*self_0).arotation = spine_atan2f(rc, ra) * (180 as c_int as c_float / 3.141_592_7_f32);
11598 } else {
11599 (*self_0).ascaleX = 0 as c_int as c_float;
11600 (*self_0).ascaleY = spine_sqrtf(rb * rb + rd * rd);
11601 (*self_0).ashearY = 0 as c_int as c_float;
11602 (*self_0).arotation = 90 as c_int as c_float
11603 - spine_atan2f(rd, rb) * (180 as c_int as c_float / 3.141_592_7_f32);
11604 };
11605}
11606#[no_mangle]
11607pub unsafe extern "C" fn spBone_worldToLocal(
11608 mut self_0: *mut spBone,
11609 mut worldX: c_float,
11610 mut worldY: c_float,
11611 mut localX: *mut c_float,
11612 mut localY: *mut c_float,
11613) {
11614 let mut invDet: c_float =
11615 1 as c_int as c_float / ((*self_0).a * (*self_0).d - (*self_0).b * (*self_0).c);
11616 let mut x: c_float = worldX - (*self_0).worldX;
11617 let mut y: c_float = worldY - (*self_0).worldY;
11618 *localX = x * (*self_0).d * invDet - y * (*self_0).b * invDet;
11619 *localY = y * (*self_0).a * invDet - x * (*self_0).c * invDet;
11620}
11621#[no_mangle]
11622pub unsafe extern "C" fn spBone_worldToParent(
11623 mut self_0: *mut spBone,
11624 mut worldX: c_float,
11625 mut worldY: c_float,
11626 mut localX: *mut c_float,
11627 mut localY: *mut c_float,
11628) {
11629 if ((*self_0).parent).is_null() {
11630 *localX = worldX;
11631 *localY = worldY;
11632 } else {
11633 spBone_worldToLocal((*self_0).parent, worldX, worldY, localX, localY);
11634 };
11635}
11636#[no_mangle]
11637pub unsafe extern "C" fn spBone_localToWorld(
11638 mut self_0: *mut spBone,
11639 mut localX: c_float,
11640 mut localY: c_float,
11641 mut worldX: *mut c_float,
11642 mut worldY: *mut c_float,
11643) {
11644 let mut x: c_float = localX;
11645 let mut y: c_float = localY;
11646 *worldX = x * (*self_0).a + y * (*self_0).b + (*self_0).worldX;
11647 *worldY = x * (*self_0).c + y * (*self_0).d + (*self_0).worldY;
11648}
11649#[no_mangle]
11650pub unsafe extern "C" fn spBone_parentToWorld(
11651 mut self_0: *mut spBone,
11652 mut localX: c_float,
11653 mut localY: c_float,
11654 mut worldX: *mut c_float,
11655 mut worldY: *mut c_float,
11656) {
11657 if !((*self_0).parent).is_null() {
11658 *worldX = localX;
11659 *worldY = localY;
11660 } else {
11661 spBone_localToWorld((*self_0).parent, localX, localY, worldX, worldY);
11662 };
11663}
11664#[no_mangle]
11665pub unsafe extern "C" fn spBone_worldToLocalRotation(
11666 mut self_0: *mut spBone,
11667 mut worldRotation: c_float,
11668) -> c_float {
11669 worldRotation *= 3.141_592_7_f32 / 180 as c_int as c_float;
11670 let mut sine: c_float = spine_sinf(worldRotation);
11671 let mut cosine: c_float = spine_cosf(worldRotation);
11672 spine_atan2f(
11673 (*self_0).a * sine - (*self_0).c * cosine,
11674 (*self_0).d * cosine - (*self_0).b * sine,
11675 ) * (180 as c_int as c_float / 3.141_592_7_f32)
11676 + (*self_0).rotation
11677 - (*self_0).shearX
11678}
11679#[no_mangle]
11680pub unsafe extern "C" fn spBone_localToWorldRotation(
11681 mut self_0: *mut spBone,
11682 mut localRotation: c_float,
11683) -> c_float {
11684 localRotation = (localRotation - (*self_0).rotation - (*self_0).shearX)
11685 * (3.141_592_7_f32 / 180 as c_int as c_float);
11686 let mut sine: c_float = spine_sinf(localRotation);
11687 let mut cosine: c_float = spine_cosf(localRotation);
11688 spine_atan2f(
11689 cosine * (*self_0).c + sine * (*self_0).d,
11690 cosine * (*self_0).a + sine * (*self_0).b,
11691 ) * (180 as c_int as c_float / 3.141_592_7_f32)
11692}
11693#[no_mangle]
11694pub unsafe extern "C" fn spBone_rotateWorld(mut self_0: *mut spBone, mut degrees: c_float) {
11695 degrees *= 3.141_592_7_f32 / 180 as c_int as c_float;
11696 let mut sine: c_float = spine_sinf(degrees);
11697 let mut cosine: c_float = spine_cosf(degrees);
11698 let mut ra: c_float = (*self_0).a;
11699 let mut rb: c_float = (*self_0).b;
11700 (*self_0).a = cosine * ra - sine * (*self_0).c;
11701 (*self_0).b = cosine * rb - sine * (*self_0).d;
11702 (*self_0).c = sine * ra + cosine * (*self_0).c;
11703 (*self_0).d = sine * rb + cosine * (*self_0).d;
11704}
11705#[no_mangle]
11706pub unsafe extern "C" fn spBoneData_create(
11707 mut index: c_int,
11708 mut name: *const c_char,
11709 mut parent: *mut spBoneData,
11710) -> *mut spBoneData {
11711 let mut self_0: *mut spBoneData = _spCalloc(
11712 1 as c_int as size_t,
11713 ::core::mem::size_of::<spBoneData>() as c_ulong,
11714 (b"spine.c\0" as *const u8).cast::<c_char>(),
11715 5338 as c_int,
11716 )
11717 .cast::<spBoneData>();
11718 (*self_0).index = index;
11719 (*self_0).name = _spMalloc(
11720 (::core::mem::size_of::<c_char>() as c_ulong)
11721 .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)),
11722 (b"spine.c\0" as *const u8).cast::<c_char>(),
11723 5340 as c_int,
11724 )
11725 .cast::<c_char>();
11726 spine_strcpy((*self_0).name, name);
11727 (*self_0).parent = parent;
11728 (*self_0).scaleX = 1 as c_int as c_float;
11729 (*self_0).scaleY = 1 as c_int as c_float;
11730 (*self_0).inherit = SP_INHERIT_NORMAL;
11731 (*self_0).icon = std::ptr::null::<c_char>();
11732 (*self_0).visible = -(1 as c_int);
11733 self_0
11734}
11735#[no_mangle]
11736pub unsafe extern "C" fn spBoneData_dispose(mut self_0: *mut spBoneData) {
11737 _spFree((*self_0).name.cast::<c_void>());
11738 _spFree((*self_0).icon as *mut c_void);
11739 _spFree(self_0.cast::<c_void>());
11740}
11741#[no_mangle]
11742pub unsafe extern "C" fn _spBoundingBoxAttachment_dispose(mut attachment: *mut spAttachment) {
11743 let mut self_0: *mut spBoundingBoxAttachment = attachment.cast::<spBoundingBoxAttachment>();
11744 _spVertexAttachment_deinit(&mut (*self_0).super_0);
11745 _spFree(self_0.cast::<c_void>());
11746}
11747#[no_mangle]
11748pub unsafe extern "C" fn _spBoundingBoxAttachment_copy(
11749 mut attachment: *mut spAttachment,
11750) -> *mut spAttachment {
11751 let mut copy: *mut spBoundingBoxAttachment = spBoundingBoxAttachment_create((*attachment).name);
11752 let mut self_0: *mut spBoundingBoxAttachment = attachment.cast::<spBoundingBoxAttachment>();
11753 spVertexAttachment_copyTo(&mut (*self_0).super_0, &mut (*copy).super_0);
11754 &mut (*copy).super_0.super_0
11755}
11756#[no_mangle]
11757pub unsafe extern "C" fn spBoundingBoxAttachment_create(
11758 mut name: *const c_char,
11759) -> *mut spBoundingBoxAttachment {
11760 let mut self_0: *mut spBoundingBoxAttachment = _spCalloc(
11761 1 as c_int as size_t,
11762 ::core::mem::size_of::<spBoundingBoxAttachment>() as c_ulong,
11763 (b"spine.c\0" as *const u8).cast::<c_char>(),
11764 5403 as c_int,
11765 )
11766 .cast::<spBoundingBoxAttachment>();
11767 _spVertexAttachment_init(&mut (*self_0).super_0);
11768 _spAttachment_init(
11769 &mut (*self_0).super_0.super_0,
11770 name,
11771 SP_ATTACHMENT_BOUNDING_BOX,
11772 Some(_spBoundingBoxAttachment_dispose as unsafe extern "C" fn(*mut spAttachment) -> ()),
11773 Some(
11774 _spBoundingBoxAttachment_copy
11775 as unsafe extern "C" fn(*mut spAttachment) -> *mut spAttachment,
11776 ),
11777 );
11778 self_0
11779}
11780#[no_mangle]
11781pub unsafe extern "C" fn _spClippingAttachment_dispose(mut attachment: *mut spAttachment) {
11782 let mut self_0: *mut spClippingAttachment = attachment.cast::<spClippingAttachment>();
11783 _spVertexAttachment_deinit(&mut (*self_0).super_0);
11784 _spFree(self_0.cast::<c_void>());
11785}
11786#[no_mangle]
11787pub unsafe extern "C" fn _spClippingAttachment_copy(
11788 mut attachment: *mut spAttachment,
11789) -> *mut spAttachment {
11790 let mut copy: *mut spClippingAttachment = spClippingAttachment_create((*attachment).name);
11791 let mut self_0: *mut spClippingAttachment = attachment.cast::<spClippingAttachment>();
11792 spVertexAttachment_copyTo(&mut (*self_0).super_0, &mut (*copy).super_0);
11793 (*copy).endSlot = (*self_0).endSlot;
11794 &mut (*copy).super_0.super_0
11795}
11796#[no_mangle]
11797pub unsafe extern "C" fn spClippingAttachment_create(
11798 mut name: *const c_char,
11799) -> *mut spClippingAttachment {
11800 let mut self_0: *mut spClippingAttachment = _spCalloc(
11801 1 as c_int as size_t,
11802 ::core::mem::size_of::<spClippingAttachment>() as c_ulong,
11803 (b"spine.c\0" as *const u8).cast::<c_char>(),
11804 5458 as c_int,
11805 )
11806 .cast::<spClippingAttachment>();
11807 _spVertexAttachment_init(&mut (*self_0).super_0);
11808 _spAttachment_init(
11809 &mut (*self_0).super_0.super_0,
11810 name,
11811 SP_ATTACHMENT_CLIPPING,
11812 Some(_spClippingAttachment_dispose as unsafe extern "C" fn(*mut spAttachment) -> ()),
11813 Some(
11814 _spClippingAttachment_copy
11815 as unsafe extern "C" fn(*mut spAttachment) -> *mut spAttachment,
11816 ),
11817 );
11818 (*self_0).endSlot = std::ptr::null_mut::<spSlotData>();
11819 self_0
11820}
11821#[no_mangle]
11822pub unsafe extern "C" fn spColor_create() -> *mut spColor {
11823 _spMalloc(
11824 (::core::mem::size_of::<spColor>() as c_ulong).wrapping_mul(1 as c_int as c_ulong),
11825 (b"spine.c\0" as *const u8).cast::<c_char>(),
11826 5498 as c_int,
11827 )
11828 .cast::<spColor>()
11829}
11830#[no_mangle]
11831pub unsafe extern "C" fn spColor_dispose(mut self_0: *mut spColor) {
11832 if !self_0.is_null() {
11833 _spFree(self_0.cast::<c_void>());
11834 }
11835}
11836#[no_mangle]
11837pub unsafe extern "C" fn spColor_setFromFloats(
11838 mut self_0: *mut spColor,
11839 mut r: c_float,
11840 mut g: c_float,
11841 mut b: c_float,
11842 mut a: c_float,
11843) {
11844 (*self_0).r = r;
11845 (*self_0).g = g;
11846 (*self_0).b = b;
11847 (*self_0).a = a;
11848 spColor_clamp(self_0);
11849}
11850#[no_mangle]
11851pub unsafe extern "C" fn spColor_setFromFloats3(
11852 mut self_0: *mut spColor,
11853 mut r: c_float,
11854 mut g: c_float,
11855 mut b: c_float,
11856) {
11857 (*self_0).r = r;
11858 (*self_0).g = g;
11859 (*self_0).b = b;
11860 spColor_clamp(self_0);
11861}
11862#[no_mangle]
11863pub unsafe extern "C" fn spColor_setFromColor(
11864 mut self_0: *mut spColor,
11865 mut otherColor: *mut spColor,
11866) {
11867 (*self_0).r = (*otherColor).r;
11868 (*self_0).g = (*otherColor).g;
11869 (*self_0).b = (*otherColor).b;
11870 (*self_0).a = (*otherColor).a;
11871}
11872#[no_mangle]
11873pub unsafe extern "C" fn spColor_setFromColor3(
11874 mut self_0: *mut spColor,
11875 mut otherColor: *mut spColor,
11876) {
11877 (*self_0).r = (*otherColor).r;
11878 (*self_0).g = (*otherColor).g;
11879 (*self_0).b = (*otherColor).b;
11880}
11881#[no_mangle]
11882pub unsafe extern "C" fn spColor_addColor(mut self_0: *mut spColor, mut otherColor: *mut spColor) {
11883 (*self_0).r += (*otherColor).r;
11884 (*self_0).g += (*otherColor).g;
11885 (*self_0).b += (*otherColor).b;
11886 (*self_0).a += (*otherColor).a;
11887 spColor_clamp(self_0);
11888}
11889#[no_mangle]
11890pub unsafe extern "C" fn spColor_addFloats(
11891 mut self_0: *mut spColor,
11892 mut r: c_float,
11893 mut g: c_float,
11894 mut b: c_float,
11895 mut a: c_float,
11896) {
11897 (*self_0).r += r;
11898 (*self_0).g += g;
11899 (*self_0).b += b;
11900 (*self_0).a += a;
11901 spColor_clamp(self_0);
11902}
11903#[no_mangle]
11904pub unsafe extern "C" fn spColor_addFloats3(
11905 mut self_0: *mut spColor,
11906 mut r: c_float,
11907 mut g: c_float,
11908 mut b: c_float,
11909) {
11910 (*self_0).r += r;
11911 (*self_0).g += g;
11912 (*self_0).b += b;
11913 spColor_clamp(self_0);
11914}
11915#[no_mangle]
11916pub unsafe extern "C" fn spColor_clamp(mut self_0: *mut spColor) {
11917 if (*self_0).r < 0 as c_int as c_float {
11918 (*self_0).r = 0 as c_int as c_float;
11919 } else if (*self_0).r > 1 as c_int as c_float {
11920 (*self_0).r = 1 as c_int as c_float;
11921 }
11922 if (*self_0).g < 0 as c_int as c_float {
11923 (*self_0).g = 0 as c_int as c_float;
11924 } else if (*self_0).g > 1 as c_int as c_float {
11925 (*self_0).g = 1 as c_int as c_float;
11926 }
11927 if (*self_0).b < 0 as c_int as c_float {
11928 (*self_0).b = 0 as c_int as c_float;
11929 } else if (*self_0).b > 1 as c_int as c_float {
11930 (*self_0).b = 1 as c_int as c_float;
11931 }
11932 if (*self_0).a < 0 as c_int as c_float {
11933 (*self_0).a = 0 as c_int as c_float;
11934 } else if (*self_0).a > 1 as c_int as c_float {
11935 (*self_0).a = 1 as c_int as c_float;
11936 }
11937}
11938static mut _spTimelineTypeNames: [*const c_char; 24] = [
11939 (b"Attachment\0" as *const u8).cast::<c_char>(),
11940 (b"Alpha\0" as *const u8).cast::<c_char>(),
11941 (b"PathConstraintPosition\0" as *const u8).cast::<c_char>(),
11942 (b"PathConstraintSpace\0" as *const u8).cast::<c_char>(),
11943 (b"Rotate\0" as *const u8).cast::<c_char>(),
11944 (b"ScaleX\0" as *const u8).cast::<c_char>(),
11945 (b"ScaleY\0" as *const u8).cast::<c_char>(),
11946 (b"ShearX\0" as *const u8).cast::<c_char>(),
11947 (b"ShearY\0" as *const u8).cast::<c_char>(),
11948 (b"TranslateX\0" as *const u8).cast::<c_char>(),
11949 (b"TranslateY\0" as *const u8).cast::<c_char>(),
11950 (b"Scale\0" as *const u8).cast::<c_char>(),
11951 (b"Shear\0" as *const u8).cast::<c_char>(),
11952 (b"Translate\0" as *const u8).cast::<c_char>(),
11953 (b"Deform\0" as *const u8).cast::<c_char>(),
11954 (b"IkConstraint\0" as *const u8).cast::<c_char>(),
11955 (b"PathConstraintMix\0" as *const u8).cast::<c_char>(),
11956 (b"Rgb2\0" as *const u8).cast::<c_char>(),
11957 (b"Rgba2\0" as *const u8).cast::<c_char>(),
11958 (b"Rgba\0" as *const u8).cast::<c_char>(),
11959 (b"Rgb\0" as *const u8).cast::<c_char>(),
11960 (b"TransformConstraint\0" as *const u8).cast::<c_char>(),
11961 (b"DrawOrder\0" as *const u8).cast::<c_char>(),
11962 (b"Event\0" as *const u8).cast::<c_char>(),
11963];
11964#[no_mangle]
11965pub unsafe extern "C" fn spDebug_printSkeletonData(mut skeletonData: *mut spSkeletonData) {
11966 let mut i: c_int = 0;
11967 let mut n: c_int = 0;
11968 spDebug_printBoneDatas((*skeletonData).bones, (*skeletonData).bonesCount);
11969 i = 0 as c_int;
11970 n = (*skeletonData).animationsCount;
11971 while i < n {
11972 spDebug_printAnimation(*((*skeletonData).animations).offset(i as isize));
11973 i += 1;
11974 }
11975}
11976#[no_mangle]
11977pub unsafe extern "C" fn _spDebug_printTimelineBase(mut timeline: *mut spTimeline) {
11978 spine_printf!(
11979 (b" Timeline %s:\n\0" as *const u8).cast::<c_char>(),
11980 _spTimelineTypeNames[(*timeline).type_0 as usize],
11981 );
11982 spine_printf!(
11983 (b" frame count: %i\n\0" as *const u8).cast::<c_char>(),
11984 (*timeline).frameCount,
11985 );
11986 spine_printf!(
11987 (b" frame entries: %i\n\0" as *const u8).cast::<c_char>(),
11988 (*timeline).frameEntries,
11989 );
11990 spine_printf!((b" frames: \0" as *const u8).cast::<c_char>());
11991 spDebug_printFloats((*(*timeline).frames).items, (*(*timeline).frames).size);
11992 spine_printf!((b"\n\0" as *const u8).cast::<c_char>());
11993}
11994#[no_mangle]
11995pub unsafe extern "C" fn _spDebug_printCurveTimeline(mut timeline: *mut spCurveTimeline) {
11996 _spDebug_printTimelineBase(&mut (*timeline).super_0);
11997 spine_printf!((b" curves: \0" as *const u8).cast::<c_char>());
11998 spDebug_printFloats((*(*timeline).curves).items, (*(*timeline).curves).size);
11999 spine_printf!((b"\n\0" as *const u8).cast::<c_char>());
12000}
12001#[no_mangle]
12002pub unsafe extern "C" fn spDebug_printTimeline(mut timeline: *mut spTimeline) {
12003 let mut current_block_29: u64;
12004 match (*timeline).type_0 as c_uint {
12005 0 => {
12006 let mut t: *mut spAttachmentTimeline = timeline.cast::<spAttachmentTimeline>();
12007 _spDebug_printTimelineBase(&mut (*t).super_0);
12008 current_block_29 = 17233182392562552756;
12009 }
12010 1 => {
12011 let mut t_0: *mut spAlphaTimeline = timeline.cast::<spAlphaTimeline>();
12012 _spDebug_printCurveTimeline(&mut (*t_0).super_0);
12013 current_block_29 = 17233182392562552756;
12014 }
12015 2 => {
12016 let mut t_1: *mut spPathConstraintPositionTimeline =
12017 timeline.cast::<spPathConstraintPositionTimeline>();
12018 _spDebug_printCurveTimeline(&mut (*t_1).super_0);
12019 current_block_29 = 17233182392562552756;
12020 }
12021 3 => {
12022 let mut t_2: *mut spPathConstraintMixTimeline =
12023 timeline.cast::<spPathConstraintMixTimeline>();
12024 _spDebug_printCurveTimeline(&mut (*t_2).super_0);
12025 current_block_29 = 17233182392562552756;
12026 }
12027 4 => {
12028 let mut t_3: *mut spRotateTimeline = timeline.cast::<spRotateTimeline>();
12029 _spDebug_printCurveTimeline(&mut (*t_3).super_0);
12030 current_block_29 = 17233182392562552756;
12031 }
12032 5 => {
12033 let mut t_4: *mut spScaleXTimeline = timeline.cast::<spScaleXTimeline>();
12034 _spDebug_printCurveTimeline(&mut (*t_4).super_0);
12035 current_block_29 = 17233182392562552756;
12036 }
12037 6 => {
12038 let mut t_5: *mut spScaleYTimeline = timeline.cast::<spScaleYTimeline>();
12039 _spDebug_printCurveTimeline(&mut (*t_5).super_0);
12040 current_block_29 = 17233182392562552756;
12041 }
12042 7 => {
12043 let mut t_6: *mut spShearXTimeline = timeline.cast::<spShearXTimeline>();
12044 _spDebug_printCurveTimeline(&mut (*t_6).super_0);
12045 current_block_29 = 17233182392562552756;
12046 }
12047 8 => {
12048 let mut t_7: *mut spShearYTimeline = timeline.cast::<spShearYTimeline>();
12049 _spDebug_printCurveTimeline(&mut (*t_7).super_0);
12050 current_block_29 = 17233182392562552756;
12051 }
12052 9 => {
12053 let mut t_8: *mut spTranslateXTimeline = timeline.cast::<spTranslateXTimeline>();
12054 _spDebug_printCurveTimeline(&mut (*t_8).super_0);
12055 current_block_29 = 17233182392562552756;
12056 }
12057 10 => {
12058 let mut t_9: *mut spTranslateYTimeline = timeline.cast::<spTranslateYTimeline>();
12059 _spDebug_printCurveTimeline(&mut (*t_9).super_0);
12060 current_block_29 = 17233182392562552756;
12061 }
12062 11 => {
12063 let mut t_10: *mut spScaleTimeline = timeline.cast::<spScaleTimeline>();
12064 _spDebug_printCurveTimeline(&mut (*t_10).super_0);
12065 current_block_29 = 17233182392562552756;
12066 }
12067 12 => {
12068 let mut t_11: *mut spShearTimeline = timeline.cast::<spShearTimeline>();
12069 _spDebug_printCurveTimeline(&mut (*t_11).super_0);
12070 current_block_29 = 17233182392562552756;
12071 }
12072 13 => {
12073 let mut t_12: *mut spTranslateTimeline = timeline.cast::<spTranslateTimeline>();
12074 _spDebug_printCurveTimeline(&mut (*t_12).super_0);
12075 current_block_29 = 17233182392562552756;
12076 }
12077 14 => {
12078 let mut t_13: *mut spDeformTimeline = timeline.cast::<spDeformTimeline>();
12079 _spDebug_printCurveTimeline(&mut (*t_13).super_0);
12080 current_block_29 = 17233182392562552756;
12081 }
12082 17 => {
12083 let mut t_14: *mut spIkConstraintTimeline = timeline.cast::<spIkConstraintTimeline>();
12084 _spDebug_printCurveTimeline(&mut (*t_14).super_0);
12085 current_block_29 = 17233182392562552756;
12086 }
12087 18 => {
12088 let mut t_15: *mut spPathConstraintMixTimeline =
12089 timeline.cast::<spPathConstraintMixTimeline>();
12090 _spDebug_printCurveTimeline(&mut (*t_15).super_0);
12091 current_block_29 = 17233182392562552756;
12092 }
12093 27 => {
12094 let mut t_16: *mut spRGB2Timeline = timeline.cast::<spRGB2Timeline>();
12095 _spDebug_printCurveTimeline(&mut (*t_16).super_0);
12096 current_block_29 = 17233182392562552756;
12097 }
12098 28 => {
12099 let mut t_17: *mut spRGBA2Timeline = timeline.cast::<spRGBA2Timeline>();
12100 _spDebug_printCurveTimeline(&mut (*t_17).super_0);
12101 current_block_29 = 17233182392562552756;
12102 }
12103 29 => {
12104 let mut t_18: *mut spRGBATimeline = timeline.cast::<spRGBATimeline>();
12105 _spDebug_printCurveTimeline(&mut (*t_18).super_0);
12106 current_block_29 = 17233182392562552756;
12107 }
12108 30 => {
12109 let mut t_19: *mut spRGBTimeline = timeline.cast::<spRGBTimeline>();
12110 _spDebug_printCurveTimeline(&mut (*t_19).super_0);
12111 current_block_29 = 17233182392562552756;
12112 }
12113 31 => {
12114 let mut t_20: *mut spTransformConstraintTimeline =
12115 timeline.cast::<spTransformConstraintTimeline>();
12116 _spDebug_printCurveTimeline(&mut (*t_20).super_0);
12117 current_block_29 = 17233182392562552756;
12118 }
12119 32 => {
12120 let mut t_21: *mut spDrawOrderTimeline = timeline.cast::<spDrawOrderTimeline>();
12121 _spDebug_printTimelineBase(&mut (*t_21).super_0);
12122 current_block_29 = 17233182392562552756;
12123 }
12124 33 => {
12125 let mut t_22: *mut spEventTimeline = timeline.cast::<spEventTimeline>();
12126 _spDebug_printTimelineBase(&mut (*t_22).super_0);
12127 current_block_29 = 17233182392562552756;
12128 }
12129 15 => {
12130 let mut t_23: *mut spSequenceTimeline = timeline.cast::<spSequenceTimeline>();
12131 _spDebug_printTimelineBase(&mut (*t_23).super_0);
12132 current_block_29 = 4691093862513791344;
12133 }
12134 16 => {
12135 current_block_29 = 4691093862513791344;
12136 }
12137 _ => {
12138 current_block_29 = 2300254789029439552;
12139 }
12140 }
12141 match current_block_29 {
12142 4691093862513791344 => {
12143 let mut t_24: *mut spInheritTimeline = timeline.cast::<spInheritTimeline>();
12144 _spDebug_printTimelineBase(&mut (*t_24).super_0);
12145 current_block_29 = 2300254789029439552;
12146 }
12147 _ => {}
12148 }
12149 match current_block_29 {
12150 2300254789029439552 => {
12151 _spDebug_printTimelineBase(timeline);
12152 }
12153 _ => {}
12154 };
12155}
12156#[no_mangle]
12157pub unsafe extern "C" fn spDebug_printAnimation(mut animation: *mut spAnimation) {
12158 let mut i: c_int = 0;
12159 let mut n: c_int = 0;
12160 spine_printf!(
12161 (b"Animation %s: %i timelines\n\0" as *const u8).cast::<c_char>(),
12162 (*animation).name,
12163 (*(*animation).timelines).size,
12164 );
12165 i = 0 as c_int;
12166 n = (*(*animation).timelines).size;
12167 while i < n {
12168 spDebug_printTimeline(*((*(*animation).timelines).items).offset(i as isize));
12169 i += 1;
12170 }
12171}
12172#[no_mangle]
12173pub unsafe extern "C" fn spDebug_printBoneDatas(
12174 mut boneDatas: *mut *mut spBoneData,
12175 mut numBoneDatas: c_int,
12176) {
12177 let mut i: c_int = 0;
12178 i = 0 as c_int;
12179 while i < numBoneDatas {
12180 spDebug_printBoneData(*boneDatas.offset(i as isize));
12181 i += 1;
12182 }
12183}
12184#[no_mangle]
12185pub unsafe extern "C" fn spDebug_printBoneData(mut boneData: *mut spBoneData) {
12186 spine_printf!(
12187 (b"Bone data %s: %f, %f, %f, %f, %f, %f %f\n\0" as *const u8).cast::<c_char>(),
12188 (*boneData).name,
12189 (*boneData).rotation as c_double,
12190 (*boneData).scaleX as c_double,
12191 (*boneData).scaleY as c_double,
12192 (*boneData).x as c_double,
12193 (*boneData).y as c_double,
12194 (*boneData).shearX as c_double,
12195 (*boneData).shearY as c_double,
12196 );
12197}
12198#[no_mangle]
12199pub unsafe extern "C" fn spDebug_printSkeleton(mut skeleton: *mut spSkeleton) {
12200 spDebug_printBones((*skeleton).bones, (*skeleton).bonesCount);
12201}
12202#[no_mangle]
12203pub unsafe extern "C" fn spDebug_printBones(mut bones: *mut *mut spBone, mut numBones: c_int) {
12204 let mut i: c_int = 0;
12205 i = 0 as c_int;
12206 while i < numBones {
12207 spDebug_printBone(*bones.offset(i as isize));
12208 i += 1;
12209 }
12210}
12211#[no_mangle]
12212pub unsafe extern "C" fn spDebug_printBone(mut bone: *mut spBone) {
12213 spine_printf!(
12214 (b"Bone %s: %f, %f, %f, %f, %f, %f\n\0" as *const u8).cast::<c_char>(),
12215 (*(*bone).data).name,
12216 (*bone).a as c_double,
12217 (*bone).b as c_double,
12218 (*bone).c as c_double,
12219 (*bone).d as c_double,
12220 (*bone).worldX as c_double,
12221 (*bone).worldY as c_double,
12222 );
12223}
12224#[no_mangle]
12225pub unsafe extern "C" fn spDebug_printFloats(mut values: *mut c_float, mut numFloats: c_int) {
12226 let mut i: c_int = 0;
12227 spine_printf!((b"(%i) [\0" as *const u8).cast::<c_char>(), numFloats);
12228 i = 0 as c_int;
12229 while i < numFloats {
12230 spine_printf!(
12231 (b"%f, \0" as *const u8).cast::<c_char>(),
12232 *values.offset(i as isize) as c_double,
12233 );
12234 i += 1;
12235 }
12236 spine_printf!((b"]\0" as *const u8).cast::<c_char>());
12237}
12238#[no_mangle]
12239pub unsafe extern "C" fn spEvent_create(
12240 mut time: c_float,
12241 mut data: *mut spEventData,
12242) -> *mut spEvent {
12243 let mut self_0: *mut spEvent = _spCalloc(
12244 1 as c_int as size_t,
12245 ::core::mem::size_of::<spEvent>() as c_ulong,
12246 (b"spine.c\0" as *const u8).cast::<c_char>(),
12247 5872 as c_int,
12248 )
12249 .cast::<spEvent>();
12250 (*self_0).data = data;
12251 (*self_0).time = time;
12252 self_0
12253}
12254#[no_mangle]
12255pub unsafe extern "C" fn spEvent_dispose(mut self_0: *mut spEvent) {
12256 _spFree((*self_0).stringValue.cast::<c_void>());
12257 _spFree(self_0.cast::<c_void>());
12258}
12259#[no_mangle]
12260pub unsafe extern "C" fn spEventData_create(mut name: *const c_char) -> *mut spEventData {
12261 let mut self_0: *mut spEventData = _spCalloc(
12262 1 as c_int as size_t,
12263 ::core::mem::size_of::<spEventData>() as c_ulong,
12264 (b"spine.c\0" as *const u8).cast::<c_char>(),
12265 5915 as c_int,
12266 )
12267 .cast::<spEventData>();
12268 (*self_0).name = _spMalloc(
12269 (::core::mem::size_of::<c_char>() as c_ulong)
12270 .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)),
12271 (b"spine.c\0" as *const u8).cast::<c_char>(),
12272 5916 as c_int,
12273 )
12274 .cast::<c_char>();
12275 spine_strcpy((*self_0).name, name);
12276 self_0
12277}
12278#[no_mangle]
12279pub unsafe extern "C" fn spEventData_dispose(mut self_0: *mut spEventData) {
12280 _spFree((*self_0).audioPath.cast::<c_void>());
12281 _spFree((*self_0).stringValue.cast::<c_void>());
12282 _spFree((*self_0).name.cast::<c_void>());
12283 _spFree(self_0.cast::<c_void>());
12284}
12285#[no_mangle]
12286pub unsafe extern "C" fn spIkConstraint_create(
12287 mut data: *mut spIkConstraintData,
12288 mut skeleton: *const spSkeleton,
12289) -> *mut spIkConstraint {
12290 let mut i: c_int = 0;
12291 let mut self_0: *mut spIkConstraint = _spCalloc(
12292 1 as c_int as size_t,
12293 ::core::mem::size_of::<spIkConstraint>() as c_ulong,
12294 (b"spine.c\0" as *const u8).cast::<c_char>(),
12295 5963 as c_int,
12296 )
12297 .cast::<spIkConstraint>();
12298 (*self_0).data = data;
12299 (*self_0).bendDirection = (*data).bendDirection;
12300 (*self_0).compress = (*data).compress;
12301 (*self_0).stretch = (*data).stretch;
12302 (*self_0).mix = (*data).mix;
12303 (*self_0).softness = (*data).softness;
12304 (*self_0).bonesCount = (*(*self_0).data).bonesCount;
12305 (*self_0).bones = _spMalloc(
12306 (::core::mem::size_of::<*mut spBone>() as c_ulong)
12307 .wrapping_mul((*self_0).bonesCount as c_ulong),
12308 (b"spine.c\0" as *const u8).cast::<c_char>(),
12309 5972 as c_int,
12310 )
12311 .cast::<*mut spBone>();
12312 i = 0 as c_int;
12313 while i < (*self_0).bonesCount {
12314 let fresh41 = &mut (*((*self_0).bones).offset(i as isize));
12315 *fresh41 = spSkeleton_findBone(
12316 skeleton,
12317 (**((*(*self_0).data).bones).offset(i as isize)).name,
12318 );
12319 i += 1;
12320 }
12321 (*self_0).target = spSkeleton_findBone(skeleton, (*(*(*self_0).data).target).name);
12322 self_0
12323}
12324#[no_mangle]
12325pub unsafe extern "C" fn spIkConstraint_dispose(mut self_0: *mut spIkConstraint) {
12326 _spFree((*self_0).bones.cast::<c_void>());
12327 _spFree(self_0.cast::<c_void>());
12328}
12329#[no_mangle]
12330pub unsafe extern "C" fn spIkConstraint_update(mut self_0: *mut spIkConstraint) {
12331 if (*self_0).mix == 0 as c_int as c_float {
12332 return;
12333 }
12334 match (*self_0).bonesCount {
12335 1 => {
12336 spIkConstraint_apply1(
12337 *((*self_0).bones).offset(0 as c_int as isize),
12338 (*(*self_0).target).worldX,
12339 (*(*self_0).target).worldY,
12340 (*self_0).compress,
12341 (*self_0).stretch,
12342 (*(*self_0).data).uniform,
12343 (*self_0).mix,
12344 );
12345 }
12346 2 => {
12347 spIkConstraint_apply2(
12348 *((*self_0).bones).offset(0 as c_int as isize),
12349 *((*self_0).bones).offset(1 as c_int as isize),
12350 (*(*self_0).target).worldX,
12351 (*(*self_0).target).worldY,
12352 (*self_0).bendDirection,
12353 (*self_0).stretch,
12354 (*(*self_0).data).uniform,
12355 (*self_0).softness,
12356 (*self_0).mix,
12357 );
12358 }
12359 _ => {}
12360 };
12361}
12362#[no_mangle]
12363pub unsafe extern "C" fn spIkConstraint_setToSetupPose(mut self_0: *mut spIkConstraint) {
12364 (*self_0).bendDirection = (*(*self_0).data).bendDirection;
12365 (*self_0).compress = (*(*self_0).data).compress;
12366 (*self_0).stretch = (*(*self_0).data).stretch;
12367 (*self_0).softness = (*(*self_0).data).softness;
12368 (*self_0).mix = (*(*self_0).data).mix;
12369}
12370#[no_mangle]
12371pub unsafe extern "C" fn spIkConstraint_apply1(
12372 mut bone: *mut spBone,
12373 mut targetX: c_float,
12374 mut targetY: c_float,
12375 mut compress: c_int,
12376 mut stretch: c_int,
12377 mut uniform: c_int,
12378 mut alpha: c_float,
12379) {
12380 let mut p: *mut spBone = (*bone).parent;
12381 let mut pa: c_float = (*p).a;
12382 let mut pb: c_float = (*p).b;
12383 let mut pc: c_float = (*p).c;
12384 let mut pd: c_float = (*p).d;
12385 let mut rotationIK: c_float = -(*bone).ashearX - (*bone).arotation;
12386 let mut tx: c_float = 0 as c_int as c_float;
12387 let mut ty: c_float = 0 as c_int as c_float;
12388 let mut sx: c_float = 0 as c_int as c_float;
12389 let mut sy: c_float = 0 as c_int as c_float;
12390 let mut s: c_float = 0 as c_int as c_float;
12391 let mut sa: c_float = 0 as c_int as c_float;
12392 let mut sc: c_float = 0 as c_int as c_float;
12393 let mut current_block_16: u64;
12394 match (*(*bone).data).inherit as c_uint {
12395 1 => {
12396 tx = (targetX - (*bone).worldX)
12397 * (if (*(*bone).skeleton).scaleX < 0 as c_int as c_float {
12398 -1.0f32
12399 } else if (*(*bone).skeleton).scaleX > 0 as c_int as c_float {
12400 1.0f32
12401 } else {
12402 0.0f32
12403 });
12404 ty = (targetY - (*bone).worldY)
12405 * (if (*(*bone).skeleton).scaleY < 0 as c_int as c_float {
12406 -1.0f32
12407 } else if (*(*bone).skeleton).scaleY > 0 as c_int as c_float {
12408 1.0f32
12409 } else {
12410 0.0f32
12411 });
12412 current_block_16 = 7149356873433890176;
12413 }
12414 2 => {
12415 s = (if pa * pd - pb * pc < 0 as c_int as c_float {
12416 -(pa * pd - pb * pc)
12417 } else {
12418 pa * pd - pb * pc
12419 }) / (if 0.0001f32 > pa * pa + pc * pc {
12420 0.0001f32
12421 } else {
12422 pa * pa + pc * pc
12423 });
12424 sa = pa / (*(*bone).skeleton).scaleX;
12425 sc = pc / (*(*bone).skeleton).scaleY;
12426 pb = -sc * s * (*(*bone).skeleton).scaleX;
12427 pd = sa * s * (*(*bone).skeleton).scaleY;
12428 rotationIK += spine_atan2f(sc, sa) * (180 as c_int as c_float / 3.141_592_7_f32);
12429 current_block_16 = 9103302926275267051;
12430 }
12431 _ => {
12432 current_block_16 = 9103302926275267051;
12433 }
12434 }
12435 match current_block_16 {
12436 9103302926275267051 => {
12437 let mut x: c_float = targetX - (*p).worldX;
12438 let mut y: c_float = targetY - (*p).worldY;
12439 let mut d: c_float = pa * pd - pb * pc;
12440 if (if d < 0 as c_int as c_float { -d } else { d }) <= 0.0001f32 {
12441 tx = 0 as c_int as c_float;
12442 ty = 0 as c_int as c_float;
12443 } else {
12444 tx = (x * pd - y * pb) / d - (*bone).ax;
12445 ty = (y * pa - x * pc) / d - (*bone).ay;
12446 }
12447 }
12448 _ => {}
12449 }
12450 rotationIK += spine_atan2f(ty, tx) * (180 as c_int as c_float / 3.141_592_7_f32);
12451 if (*bone).ascaleX < 0 as c_int as c_float {
12452 rotationIK += 180 as c_int as c_float;
12453 }
12454 if rotationIK > 180 as c_int as c_float {
12455 rotationIK -= 360 as c_int as c_float;
12456 } else if rotationIK < -(180 as c_int) as c_float {
12457 rotationIK += 360 as c_int as c_float;
12458 }
12459 sx = (*bone).ascaleX;
12460 sy = (*bone).ascaleY;
12461 if compress != 0 || stretch != 0 {
12462 let mut b: c_float = 0.;
12463 let mut dd: c_float = 0.;
12464 match (*(*bone).data).inherit as c_uint {
12465 3 | 4 => {
12466 tx = targetX - (*bone).worldX;
12467 ty = targetY - (*bone).worldY;
12468 }
12469 _ => {}
12470 }
12471 b = (*(*bone).data).length * sx;
12472 dd = spine_sqrtf(tx * tx + ty * ty);
12473 if compress != 0 && dd < b || stretch != 0 && dd > b && b > 0.0001f32 {
12474 s = (dd / b - 1 as c_int as c_float) * alpha + 1 as c_int as c_float;
12475 sx *= s;
12476 if uniform != 0 {
12477 sy *= s;
12478 }
12479 }
12480 }
12481 spBone_updateWorldTransformWith(
12482 bone,
12483 (*bone).ax,
12484 (*bone).ay,
12485 (*bone).arotation + rotationIK * alpha,
12486 sx,
12487 sy,
12488 (*bone).ashearX,
12489 (*bone).ashearY,
12490 );
12491}
12492#[no_mangle]
12493pub unsafe extern "C" fn spIkConstraint_apply2(
12494 mut parent: *mut spBone,
12495 mut child: *mut spBone,
12496 mut targetX: c_float,
12497 mut targetY: c_float,
12498 mut bendDir: c_int,
12499 mut stretch: c_int,
12500 mut uniform: c_int,
12501 mut softness: c_float,
12502 mut alpha: c_float,
12503) {
12504 let mut current_block: u64;
12505 let mut a: c_float = 0.;
12506 let mut b: c_float = 0.;
12507 let mut c: c_float = 0.;
12508 let mut d: c_float = 0.;
12509 let mut px: c_float = 0.;
12510 let mut py: c_float = 0.;
12511 let mut psx: c_float = 0.;
12512 let mut psy: c_float = 0.;
12513 let mut sx: c_float = 0.;
12514 let mut sy: c_float = 0.;
12515 let mut cx: c_float = 0.;
12516 let mut cy: c_float = 0.;
12517 let mut csx: c_float = 0.;
12518 let mut cwx: c_float = 0.;
12519 let mut cwy: c_float = 0.;
12520 let mut o1: c_int = 0;
12521 let mut o2: c_int = 0;
12522 let mut s2: c_int = 0;
12523 let mut u: c_int = 0;
12524 let mut pp: *mut spBone = (*parent).parent;
12525 let mut tx: c_float = 0.;
12526 let mut ty: c_float = 0.;
12527 let mut dd: c_float = 0.;
12528 let mut dx: c_float = 0.;
12529 let mut dy: c_float = 0.;
12530 let mut l1: c_float = 0.;
12531 let mut l2: c_float = 0.;
12532 let mut a1: c_float = 0.;
12533 let mut a2: c_float = 0.;
12534 let mut r: c_float = 0.;
12535 let mut td: c_float = 0.;
12536 let mut sd: c_float = 0.;
12537 let mut p: c_float = 0.;
12538 let mut id: c_float = 0.;
12539 let mut x: c_float = 0.;
12540 let mut y: c_float = 0.;
12541 let mut aa: c_float = 0.;
12542 let mut bb: c_float = 0.;
12543 let mut ll: c_float = 0.;
12544 let mut ta: c_float = 0.;
12545 let mut c0: c_float = 0.;
12546 let mut c1: c_float = 0.;
12547 let mut c2: c_float = 0.;
12548 px = (*parent).ax;
12549 py = (*parent).ay;
12550 psx = (*parent).ascaleX;
12551 psy = (*parent).ascaleY;
12552 sx = psx;
12553 sy = psy;
12554 csx = (*child).ascaleX;
12555 if psx < 0 as c_int as c_float {
12556 psx = -psx;
12557 o1 = 180 as c_int;
12558 s2 = -(1 as c_int);
12559 } else {
12560 o1 = 0 as c_int;
12561 s2 = 1 as c_int;
12562 }
12563 if psy < 0 as c_int as c_float {
12564 psy = -psy;
12565 s2 = -s2;
12566 }
12567 if csx < 0 as c_int as c_float {
12568 csx = -csx;
12569 o2 = 180 as c_int;
12570 } else {
12571 o2 = 0 as c_int;
12572 }
12573 r = psx - psy;
12574 cx = (*child).ax;
12575 u = ((if r < 0 as c_int as c_float { -r } else { r }) <= 0.0001f32) as c_int;
12576 if u == 0 || stretch != 0 {
12577 cy = 0 as c_int as c_float;
12578 cwx = (*parent).a * cx + (*parent).worldX;
12579 cwy = (*parent).c * cx + (*parent).worldY;
12580 } else {
12581 cy = (*child).ay;
12582 cwx = (*parent).a * cx + (*parent).b * cy + (*parent).worldX;
12583 cwy = (*parent).c * cx + (*parent).d * cy + (*parent).worldY;
12584 }
12585 a = (*pp).a;
12586 b = (*pp).b;
12587 c = (*pp).c;
12588 d = (*pp).d;
12589 id = a * d - b * c;
12590 id = if (if id < 0 as c_int as c_float { -id } else { id }) <= 0.0001f32 {
12591 0 as c_int as c_float
12592 } else {
12593 1 as c_int as c_float / id
12594 };
12595 x = cwx - (*pp).worldX;
12596 y = cwy - (*pp).worldY;
12597 dx = (x * d - y * b) * id - px;
12598 dy = (y * a - x * c) * id - py;
12599 l1 = spine_sqrtf(dx * dx + dy * dy);
12600 l2 = (*(*child).data).length * csx;
12601 if (l1 as c_double) < 0.0001f64 {
12602 spIkConstraint_apply1(
12603 parent, targetX, targetY, 0 as c_int, stretch, 0 as c_int, alpha,
12604 );
12605 spBone_updateWorldTransformWith(
12606 child,
12607 cx,
12608 cy,
12609 0 as c_int as c_float,
12610 (*child).ascaleX,
12611 (*child).ascaleY,
12612 (*child).ashearX,
12613 (*child).ashearY,
12614 );
12615 return;
12616 }
12617 x = targetX - (*pp).worldX;
12618 y = targetY - (*pp).worldY;
12619 tx = (x * d - y * b) * id - px;
12620 ty = (y * a - x * c) * id - py;
12621 dd = tx * tx + ty * ty;
12622 if softness != 0 as c_int as c_float {
12623 softness *= psx * (csx + 1 as c_int as c_float) * 0.5f32;
12624 td = spine_sqrtf(dd);
12625 sd = td - l1 - l2 * psx + softness;
12626 if sd > 0 as c_int as c_float {
12627 p = (if (1 as c_int as c_float) < sd / (softness * 2 as c_int as c_float) {
12628 1 as c_int as c_float
12629 } else {
12630 sd / (softness * 2 as c_int as c_float)
12631 }) - 1 as c_int as c_float;
12632 p = (sd - softness * (1 as c_int as c_float - p * p)) / td;
12633 tx -= p * tx;
12634 ty -= p * ty;
12635 dd = tx * tx + ty * ty;
12636 }
12637 }
12638 if u != 0 {
12639 let mut cosine: c_float = 0.;
12640 l2 *= psx;
12641 cosine = (dd - l1 * l1 - l2 * l2) / (2 as c_int as c_float * l1 * l2);
12642 if cosine < -(1 as c_int) as c_float {
12643 cosine = -(1 as c_int) as c_float;
12644 a2 = 3.141_592_7_f32 * bendDir as c_float;
12645 } else if cosine > 1 as c_int as c_float {
12646 cosine = 1 as c_int as c_float;
12647 a2 = 0 as c_int as c_float;
12648 if stretch != 0 {
12649 a = (spine_sqrtf(dd) / (l1 + l2) - 1 as c_int as c_float) * alpha
12650 + 1 as c_int as c_float;
12651 sx *= a;
12652 if uniform != 0 {
12653 sy *= a;
12654 }
12655 }
12656 } else {
12657 a2 = spine_acosf(cosine) * bendDir as c_float;
12658 }
12659 a = l1 + l2 * cosine;
12660 b = l2 * spine_sinf(a2);
12661 a1 = spine_atan2f(ty * a - tx * b, tx * a + ty * b);
12662 } else {
12663 a = psx * l2;
12664 b = psy * l2;
12665 aa = a * a;
12666 bb = b * b;
12667 ll = l1 * l1;
12668 ta = spine_atan2f(ty, tx);
12669 c0 = bb * ll + aa * dd - aa * bb;
12670 c1 = -(2 as c_int) as c_float * bb * l1;
12671 c2 = bb - aa;
12672 d = c1 * c1 - 4 as c_int as c_float * c2 * c0;
12673 if d >= 0 as c_int as c_float {
12674 let mut q: c_float = spine_sqrtf(d);
12675 let mut r0: c_float = 0.;
12676 let mut r1: c_float = 0.;
12677 if c1 < 0 as c_int as c_float {
12678 q = -q;
12679 }
12680 q = -(c1 + q) * 0.5f32;
12681 r0 = q / c2;
12682 r1 = c0 / q;
12683 r = if (if r0 < 0 as c_int as c_float { -r0 } else { r0 })
12684 < (if r1 < 0 as c_int as c_float { -r1 } else { r1 })
12685 {
12686 r0
12687 } else {
12688 r1
12689 };
12690 y = dd - r * r;
12691 if y > 0 as c_int as c_float {
12692 y = spine_sqrtf(y) * bendDir as c_float;
12693 a1 = ta - spine_atan2f(y, r);
12694 a2 = spine_atan2f(y / psy, (r - l1) / psx);
12695 current_block = 8807035328252033190;
12696 } else {
12697 current_block = 6033931424626438518;
12698 }
12699 } else {
12700 current_block = 6033931424626438518;
12701 }
12702 match current_block {
12703 8807035328252033190 => {}
12704 _ => {
12705 let mut minAngle: c_float = 3.141_592_7_f32;
12706 let mut minX: c_float = l1 - a;
12707 let mut minDist: c_float = minX * minX;
12708 let mut minY: c_float = 0 as c_int as c_float;
12709 let mut maxAngle: c_float = 0 as c_int as c_float;
12710 let mut maxX: c_float = l1 + a;
12711 let mut maxDist: c_float = maxX * maxX;
12712 let mut maxY: c_float = 0 as c_int as c_float;
12713 c0 = -a * l1 / (aa - bb);
12714 if c0 >= -(1 as c_int) as c_float && c0 <= 1 as c_int as c_float {
12715 c0 = spine_acosf(c0);
12716 x = a * spine_cosf(c0) + l1;
12717 y = b * spine_sinf(c0);
12718 d = x * x + y * y;
12719 if d < minDist {
12720 minAngle = c0;
12721 minDist = d;
12722 minX = x;
12723 minY = y;
12724 }
12725 if d > maxDist {
12726 maxAngle = c0;
12727 maxDist = d;
12728 maxX = x;
12729 maxY = y;
12730 }
12731 }
12732 if dd <= (minDist + maxDist) * 0.5f32 {
12733 a1 = ta - spine_atan2f(minY * bendDir as c_float, minX);
12734 a2 = minAngle * bendDir as c_float;
12735 } else {
12736 a1 = ta - spine_atan2f(maxY * bendDir as c_float, maxX);
12737 a2 = maxAngle * bendDir as c_float;
12738 }
12739 }
12740 }
12741 }
12742 let mut os: c_float = spine_atan2f(cy, cx) * s2 as c_float;
12743 let mut rotation: c_float = (*parent).arotation;
12744 a1 = (a1 - os) * (180 as c_int as c_float / 3.141_592_7_f32) + o1 as c_float - rotation;
12745 if a1 > 180 as c_int as c_float {
12746 a1 -= 360 as c_int as c_float;
12747 } else if a1 < -(180 as c_int) as c_float {
12748 a1 += 360 as c_int as c_float;
12749 }
12750 spBone_updateWorldTransformWith(
12751 parent,
12752 px,
12753 py,
12754 rotation + a1 * alpha,
12755 sx,
12756 sy,
12757 0 as c_int as c_float,
12758 0 as c_int as c_float,
12759 );
12760 rotation = (*child).arotation;
12761 a2 = ((a2 + os) * (180 as c_int as c_float / 3.141_592_7_f32) - (*child).ashearX)
12762 * s2 as c_float
12763 + o2 as c_float
12764 - rotation;
12765 if a2 > 180 as c_int as c_float {
12766 a2 -= 360 as c_int as c_float;
12767 } else if a2 < -(180 as c_int) as c_float {
12768 a2 += 360 as c_int as c_float;
12769 }
12770 spBone_updateWorldTransformWith(
12771 child,
12772 cx,
12773 cy,
12774 rotation + a2 * alpha,
12775 (*child).ascaleX,
12776 (*child).ascaleY,
12777 (*child).ashearX,
12778 (*child).ashearY,
12779 );
12780}
12781#[no_mangle]
12782pub unsafe extern "C" fn spIkConstraintData_create(
12783 mut name: *const c_char,
12784) -> *mut spIkConstraintData {
12785 let mut self_0: *mut spIkConstraintData = _spCalloc(
12786 1 as c_int as size_t,
12787 ::core::mem::size_of::<spIkConstraintData>() as c_ulong,
12788 (b"spine.c\0" as *const u8).cast::<c_char>(),
12789 6271 as c_int,
12790 )
12791 .cast::<spIkConstraintData>();
12792 (*self_0).name = _spMalloc(
12793 (::core::mem::size_of::<c_char>() as c_ulong)
12794 .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)),
12795 (b"spine.c\0" as *const u8).cast::<c_char>(),
12796 6272 as c_int,
12797 )
12798 .cast::<c_char>();
12799 spine_strcpy((*self_0).name, name);
12800 (*self_0).bendDirection = 0 as c_int;
12801 (*self_0).compress = 0 as c_int;
12802 (*self_0).stretch = 0 as c_int;
12803 (*self_0).uniform = 0 as c_int;
12804 (*self_0).mix = 0 as c_int as c_float;
12805 self_0
12806}
12807#[no_mangle]
12808pub unsafe extern "C" fn spIkConstraintData_dispose(mut self_0: *mut spIkConstraintData) {
12809 _spFree((*self_0).name.cast::<c_void>());
12810 _spFree((*self_0).bones.cast::<c_void>());
12811 _spFree(self_0.cast::<c_void>());
12812}
12813static mut ep: *const c_char = 0 as *const c_char;
12814#[no_mangle]
12815pub unsafe extern "C" fn Json_getError() -> *const c_char {
12816 ep
12817}
12818unsafe extern "C" fn Json_strcasecmp(mut s1: *const c_char, mut s2: *const c_char) -> c_int {
12819 if !s1.is_null() && !s2.is_null() {
12820 spine_strcasecmp(s1, s2)
12821 } else if s1 < s2 {
12822 return -(1 as c_int);
12823 } else if s1 == s2 {
12824 return 0 as c_int;
12825 } else {
12826 return 1 as c_int;
12827 }
12828}
12829unsafe extern "C" fn Json_new() -> *mut Json {
12830 _spCalloc(
12831 1 as c_int as size_t,
12832 ::core::mem::size_of::<Json>() as c_ulong,
12833 (b"spine.c\0" as *const u8).cast::<c_char>(),
12834 6361 as c_int,
12835 )
12836 .cast::<Json>()
12837}
12838#[no_mangle]
12839pub unsafe extern "C" fn Json_dispose(mut c: *mut Json) {
12840 let mut next: *mut Json = std::ptr::null_mut::<Json>();
12841 while !c.is_null() {
12842 next = (*c).next;
12843 if !((*c).child).is_null() {
12844 Json_dispose((*c).child);
12845 }
12846 if !((*c).valueString).is_null() {
12847 _spFree((*c).valueString as *mut c_void);
12848 }
12849 if !((*c).name).is_null() {
12850 _spFree((*c).name as *mut c_void);
12851 }
12852 _spFree(c.cast::<c_void>());
12853 c = next;
12854 }
12855}
12856unsafe extern "C" fn parse_number(mut item: *mut Json, mut num: *const c_char) -> *const c_char {
12857 let mut result: c_double = 0.0f64;
12858 let mut negative: c_int = 0 as c_int;
12859 let mut ptr: *mut c_char = num.cast_mut();
12860 if *ptr as c_int == '-' as i32 {
12861 negative = -(1 as c_int);
12862 ptr = ptr.offset(1);
12863 }
12864 while *ptr as c_int >= '0' as i32 && *ptr as c_int <= '9' as i32 {
12865 result = result * 10.0f64 + (*ptr as c_int - '0' as i32) as c_double;
12866 ptr = ptr.offset(1);
12867 }
12868 if *ptr as c_int == '.' as i32 {
12869 let mut fraction: c_double = 0.0f64;
12870 let mut n: c_int = 0 as c_int;
12871 ptr = ptr.offset(1);
12872 while *ptr as c_int >= '0' as i32 && *ptr as c_int <= '9' as i32 {
12873 fraction = fraction * 10.0f64 + (*ptr as c_int - '0' as i32) as c_double;
12874 ptr = ptr.offset(1);
12875 n += 1;
12876 }
12877 result += fraction / spine_pow(10.0f64, n as c_double);
12878 }
12879 if negative != 0 {
12880 result = -result;
12881 }
12882 if *ptr as c_int == 'e' as i32 || *ptr as c_int == 'E' as i32 {
12883 let mut exponent: c_double = 0 as c_int as c_double;
12884 let mut expNegative: c_int = 0 as c_int;
12885 ptr = ptr.offset(1);
12886 if *ptr as c_int == '-' as i32 {
12887 expNegative = -(1 as c_int);
12888 ptr = ptr.offset(1);
12889 } else if *ptr as c_int == '+' as i32 {
12890 ptr = ptr.offset(1);
12891 }
12892 while *ptr as c_int >= '0' as i32 && *ptr as c_int <= '9' as i32 {
12893 exponent = exponent * 10.0f64 + (*ptr as c_int - '0' as i32) as c_double;
12894 ptr = ptr.offset(1);
12895 }
12896 if expNegative != 0 {
12897 result /= spine_pow(10 as c_int as c_double, exponent);
12898 } else {
12899 result *= spine_pow(10 as c_int as c_double, exponent);
12900 }
12901 }
12902 if ptr != num.cast_mut() {
12903 (*item).valueFloat = result as c_float;
12904 (*item).valueInt = result as c_int;
12905 (*item).type_0 = 3 as c_int;
12906 ptr
12907 } else {
12908 ep = num;
12909 std::ptr::null::<c_char>()
12910 }
12911}
12912static mut firstByteMark: [c_uchar; 7] = [
12913 0 as c_int as c_uchar,
12914 0 as c_int as c_uchar,
12915 0xc0 as c_int as c_uchar,
12916 0xe0 as c_int as c_uchar,
12917 0xf0 as c_int as c_uchar,
12918 0xf8 as c_int as c_uchar,
12919 0xfc as c_int as c_uchar,
12920];
12921unsafe extern "C" fn parse_string(mut item: *mut Json, mut str: *const c_char) -> *const c_char {
12922 let mut ptr: *const c_char = str.offset(1 as c_int as isize);
12923 let mut ptr2: *mut c_char = std::ptr::null_mut::<c_char>();
12924 let mut out: *mut c_char = std::ptr::null_mut::<c_char>();
12925 let mut len: c_int = 0 as c_int;
12926 let mut uc: c_uint = 0;
12927 let mut uc2: c_uint = 0;
12928 if *str as c_int != '"' as i32 {
12929 ep = str;
12930 return std::ptr::null::<c_char>();
12931 }
12932 while *ptr as c_int != '"' as i32 && *ptr as c_int != 0 && {
12933 len += 1;
12934 len != 0
12935 } {
12936 let fresh42 = ptr;
12937 ptr = ptr.offset(1);
12938 if *fresh42 as c_int == '\\' as i32 {
12939 ptr = ptr.offset(1);
12940 }
12941 }
12942 out = _spMalloc(
12943 (::core::mem::size_of::<c_char>() as c_ulong).wrapping_mul((len + 1 as c_int) as c_ulong),
12944 (b"spine.c\0" as *const u8).cast::<c_char>(),
12945 6460 as c_int,
12946 )
12947 .cast::<c_char>();
12948 if out.is_null() {
12949 return std::ptr::null::<c_char>();
12950 }
12951 ptr = str.offset(1 as c_int as isize);
12952 ptr2 = out;
12953 while *ptr as c_int != '"' as i32 && *ptr as c_int != 0 {
12954 if *ptr as c_int != '\\' as i32 {
12955 let fresh43 = ptr;
12956 ptr = ptr.offset(1);
12957 let fresh44 = ptr2;
12958 ptr2 = ptr2.offset(1);
12959 *fresh44 = *fresh43;
12960 } else {
12961 ptr = ptr.offset(1);
12962 let mut current_block_41: u64;
12963 match *ptr as c_int {
12964 98 => {
12965 let fresh45 = ptr2;
12966 ptr2 = ptr2.offset(1);
12967 *fresh45 = '\u{8}' as i32 as c_char;
12968 }
12969 102 => {
12970 let fresh46 = ptr2;
12971 ptr2 = ptr2.offset(1);
12972 *fresh46 = '\u{c}' as i32 as c_char;
12973 }
12974 110 => {
12975 let fresh47 = ptr2;
12976 ptr2 = ptr2.offset(1);
12977 *fresh47 = '\n' as i32 as c_char;
12978 }
12979 114 => {
12980 let fresh48 = ptr2;
12981 ptr2 = ptr2.offset(1);
12982 *fresh48 = '\r' as i32 as c_char;
12983 }
12984 116 => {
12985 let fresh49 = ptr2;
12986 ptr2 = ptr2.offset(1);
12987 *fresh49 = '\t' as i32 as c_char;
12988 }
12989 117 => {
12990 spine_sscanf!(
12991 ptr.offset(1 as c_int as isize),
12992 (b"%4x\0" as *const u8).cast::<c_char>(),
12993 &mut uc as *mut c_uint,
12994 );
12995 ptr = ptr.offset(4 as c_int as isize);
12996 if !(uc >= 0xdc00 as c_int as c_uint && uc <= 0xdfff as c_int as c_uint
12997 || uc == 0 as c_int as c_uint)
12998 {
12999 if uc >= 0xd800 as c_int as c_uint && uc <= 0xdbff as c_int as c_uint {
13000 if *ptr.offset(1 as c_int as isize) as c_int != '\\' as i32
13001 || *ptr.offset(2 as c_int as isize) as c_int != 'u' as i32
13002 {
13003 current_block_41 = 9441801433784995173;
13004 } else {
13005 spine_sscanf!(
13006 ptr.offset(3 as c_int as isize),
13007 (b"%4x\0" as *const u8).cast::<c_char>(),
13008 &mut uc2 as *mut c_uint,
13009 );
13010 ptr = ptr.offset(6 as c_int as isize);
13011 if uc2 < 0xdc00 as c_int as c_uint
13012 || uc2 > 0xdfff as c_int as c_uint
13013 {
13014 current_block_41 = 9441801433784995173;
13015 } else {
13016 uc = (0x10000 as c_int as c_uint).wrapping_add(
13017 (uc & 0x3ff as c_int as c_uint) << 10 as c_int
13018 | uc2 & 0x3ff as c_int as c_uint,
13019 );
13020 current_block_41 = 1608152415753874203;
13021 }
13022 }
13023 } else {
13024 current_block_41 = 1608152415753874203;
13025 }
13026 match current_block_41 {
13027 9441801433784995173 => {}
13028 _ => {
13029 len = 4 as c_int;
13030 if uc < 0x80 as c_int as c_uint {
13031 len = 1 as c_int;
13032 } else if uc < 0x800 as c_int as c_uint {
13033 len = 2 as c_int;
13034 } else if uc < 0x10000 as c_int as c_uint {
13035 len = 3 as c_int;
13036 }
13037 ptr2 = ptr2.offset(len as isize);
13038 let mut current_block_38: u64;
13039 match len {
13040 4 => {
13041 ptr2 = ptr2.offset(-1);
13042 *ptr2 = ((uc | 0x80 as c_int as c_uint)
13043 & 0xbf as c_int as c_uint)
13044 as c_char;
13045 uc >>= 6 as c_int;
13046 current_block_38 = 18358745234530413803;
13047 }
13048 3 => {
13049 current_block_38 = 18358745234530413803;
13050 }
13051 2 => {
13052 current_block_38 = 8206681848427200715;
13053 }
13054 1 => {
13055 current_block_38 = 2481446828879050954;
13056 }
13057 _ => {
13058 current_block_38 = 4567019141635105728;
13059 }
13060 }
13061 match current_block_38 {
13062 18358745234530413803 => {
13063 ptr2 = ptr2.offset(-1);
13064 *ptr2 = ((uc | 0x80 as c_int as c_uint)
13065 & 0xbf as c_int as c_uint)
13066 as c_char;
13067 uc >>= 6 as c_int;
13068 current_block_38 = 8206681848427200715;
13069 }
13070 _ => {}
13071 }
13072 match current_block_38 {
13073 8206681848427200715 => {
13074 ptr2 = ptr2.offset(-1);
13075 *ptr2 = ((uc | 0x80 as c_int as c_uint)
13076 & 0xbf as c_int as c_uint)
13077 as c_char;
13078 uc >>= 6 as c_int;
13079 current_block_38 = 2481446828879050954;
13080 }
13081 _ => {}
13082 }
13083 match current_block_38 {
13084 2481446828879050954 => {
13085 ptr2 = ptr2.offset(-1);
13086 *ptr2 =
13087 (uc | firstByteMark[len as usize] as c_uint) as c_char;
13088 }
13089 _ => {}
13090 }
13091 ptr2 = ptr2.offset(len as isize);
13092 }
13093 }
13094 }
13095 }
13096 _ => {
13097 let fresh50 = ptr2;
13098 ptr2 = ptr2.offset(1);
13099 *fresh50 = *ptr;
13100 }
13101 }
13102 ptr = ptr.offset(1);
13103 }
13104 }
13105 *ptr2 = 0 as c_int as c_char;
13106 if *ptr as c_int == '"' as i32 {
13107 ptr = ptr.offset(1);
13108 }
13109 (*item).valueString = out;
13110 (*item).type_0 = 4 as c_int;
13111 ptr
13112}
13113unsafe extern "C" fn skip(mut in_0: *const c_char) -> *const c_char {
13114 if in_0.is_null() {
13115 return std::ptr::null::<c_char>();
13116 }
13117 while *in_0 as c_int != 0 && *in_0 as c_uchar as c_int <= 32 as c_int {
13118 in_0 = in_0.offset(1);
13119 }
13120 in_0
13121}
13122#[no_mangle]
13123pub unsafe extern "C" fn Json_create(mut value: *const c_char) -> *mut Json {
13124 let mut c: *mut Json = std::ptr::null_mut::<Json>();
13125 ep = std::ptr::null::<c_char>();
13126 if value.is_null() {
13127 return std::ptr::null_mut::<Json>();
13128 }
13129 c = Json_new();
13130 if c.is_null() {
13131 return std::ptr::null_mut::<Json>();
13132 }
13133 value = parse_value(c, skip(value));
13134 if value.is_null() {
13135 Json_dispose(c);
13136 return std::ptr::null_mut::<Json>();
13137 }
13138 c
13139}
13140unsafe extern "C" fn parse_value(mut item: *mut Json, mut value: *const c_char) -> *const c_char {
13141 match *value as c_int {
13142 110 => {
13143 if spine_strncmp(
13144 value.offset(1 as c_int as isize),
13145 (b"ull\0" as *const u8).cast::<c_char>(),
13146 3 as c_int as size_t,
13147 ) == 0
13148 {
13149 (*item).type_0 = 2 as c_int;
13150 return value.offset(4 as c_int as isize);
13151 }
13152 }
13153 102 => {
13154 if spine_strncmp(
13155 value.offset(1 as c_int as isize),
13156 (b"alse\0" as *const u8).cast::<c_char>(),
13157 4 as c_int as size_t,
13158 ) == 0
13159 {
13160 (*item).type_0 = 0 as c_int;
13161 return value.offset(5 as c_int as isize);
13162 }
13163 }
13164 116 => {
13165 if spine_strncmp(
13166 value.offset(1 as c_int as isize),
13167 (b"rue\0" as *const u8).cast::<c_char>(),
13168 3 as c_int as size_t,
13169 ) == 0
13170 {
13171 (*item).type_0 = 1 as c_int;
13172 (*item).valueInt = 1 as c_int;
13173 return value.offset(4 as c_int as isize);
13174 }
13175 }
13176 34 => return parse_string(item, value),
13177 91 => return parse_array(item, value),
13178 123 => return parse_object(item, value),
13179 45 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 => {
13180 return parse_number(item, value);
13181 }
13182 _ => {}
13183 }
13184 ep = value;
13185 std::ptr::null::<c_char>()
13186}
13187unsafe extern "C" fn parse_array(mut item: *mut Json, mut value: *const c_char) -> *const c_char {
13188 let mut child: *mut Json = std::ptr::null_mut::<Json>();
13189 (*item).type_0 = 5 as c_int;
13190 value = skip(value.offset(1 as c_int as isize));
13191 if *value as c_int == ']' as i32 {
13192 return value.offset(1 as c_int as isize);
13193 }
13194 child = Json_new();
13195 (*item).child = child;
13196 if ((*item).child).is_null() {
13197 return std::ptr::null::<c_char>();
13198 }
13199 value = skip(parse_value(child, skip(value)));
13200 if value.is_null() {
13201 return std::ptr::null::<c_char>();
13202 }
13203 (*item).size = 1 as c_int;
13204 while *value as c_int == ',' as i32 {
13205 let mut new_item: *mut Json = Json_new();
13206 if new_item.is_null() {
13207 return std::ptr::null::<c_char>();
13208 }
13209 (*child).next = new_item;
13210 child = new_item;
13211 value = skip(parse_value(child, skip(value.offset(1 as c_int as isize))));
13212 if value.is_null() {
13213 return std::ptr::null::<c_char>();
13214 }
13215 (*item).size += 1;
13216 }
13217 if *value as c_int == ']' as i32 {
13218 return value.offset(1 as c_int as isize);
13219 }
13220 ep = value;
13221 std::ptr::null::<c_char>()
13222}
13223unsafe extern "C" fn parse_object(mut item: *mut Json, mut value: *const c_char) -> *const c_char {
13224 let mut child: *mut Json = std::ptr::null_mut::<Json>();
13225 (*item).type_0 = 6 as c_int;
13226 value = skip(value.offset(1 as c_int as isize));
13227 if *value as c_int == '}' as i32 {
13228 return value.offset(1 as c_int as isize);
13229 }
13230 child = Json_new();
13231 (*item).child = child;
13232 if ((*item).child).is_null() {
13233 return std::ptr::null::<c_char>();
13234 }
13235 value = skip(parse_string(child, skip(value)));
13236 if value.is_null() {
13237 return std::ptr::null::<c_char>();
13238 }
13239 (*child).name = (*child).valueString;
13240 (*child).valueString = std::ptr::null::<c_char>();
13241 if *value as c_int != ':' as i32 {
13242 ep = value;
13243 return std::ptr::null::<c_char>();
13244 }
13245 value = skip(parse_value(child, skip(value.offset(1 as c_int as isize))));
13246 if value.is_null() {
13247 return std::ptr::null::<c_char>();
13248 }
13249 (*item).size = 1 as c_int;
13250 while *value as c_int == ',' as i32 {
13251 let mut new_item: *mut Json = Json_new();
13252 if new_item.is_null() {
13253 return std::ptr::null::<c_char>();
13254 }
13255 (*child).next = new_item;
13256 child = new_item;
13257 value = skip(parse_string(child, skip(value.offset(1 as c_int as isize))));
13258 if value.is_null() {
13259 return std::ptr::null::<c_char>();
13260 }
13261 (*child).name = (*child).valueString;
13262 (*child).valueString = std::ptr::null::<c_char>();
13263 if *value as c_int != ':' as i32 {
13264 ep = value;
13265 return std::ptr::null::<c_char>();
13266 }
13267 value = skip(parse_value(child, skip(value.offset(1 as c_int as isize))));
13268 if value.is_null() {
13269 return std::ptr::null::<c_char>();
13270 }
13271 (*item).size += 1;
13272 }
13273 if *value as c_int == '}' as i32 {
13274 return value.offset(1 as c_int as isize);
13275 }
13276 ep = value;
13277 std::ptr::null::<c_char>()
13278}
13279#[no_mangle]
13280pub unsafe extern "C" fn Json_getItem(
13281 mut object: *mut Json,
13282 mut string: *const c_char,
13283) -> *mut Json {
13284 let mut c: *mut Json = (*object).child;
13285 while !c.is_null() && Json_strcasecmp((*c).name, string) != 0 {
13286 c = (*c).next;
13287 }
13288 c
13289}
13290#[no_mangle]
13291pub unsafe extern "C" fn Json_getItemAtIndex(
13292 mut object: *mut Json,
13293 mut childIndex: c_int,
13294) -> *mut Json {
13295 let mut current: *mut Json = (*object).child;
13296 while !current.is_null() && childIndex > 0 as c_int {
13297 childIndex -= 1;
13298 current = (*current).next;
13299 }
13300 current
13301}
13302#[no_mangle]
13303pub unsafe extern "C" fn Json_getString(
13304 mut object: *mut Json,
13305 mut name: *const c_char,
13306 mut defaultValue: *const c_char,
13307) -> *const c_char {
13308 object = Json_getItem(object, name);
13309 if !object.is_null() {
13310 return (*object).valueString;
13311 }
13312 defaultValue
13313}
13314#[no_mangle]
13315pub unsafe extern "C" fn Json_getFloat(
13316 mut value: *mut Json,
13317 mut name: *const c_char,
13318 mut defaultValue: c_float,
13319) -> c_float {
13320 value = Json_getItem(value, name);
13321 if !value.is_null() {
13322 (*value).valueFloat
13323 } else {
13324 defaultValue
13325 }
13326}
13327#[no_mangle]
13328pub unsafe extern "C" fn Json_getInt(
13329 mut value: *mut Json,
13330 mut name: *const c_char,
13331 mut defaultValue: c_int,
13332) -> c_int {
13333 value = Json_getItem(value, name);
13334 if !value.is_null() {
13335 (*value).valueInt
13336 } else {
13337 defaultValue
13338 }
13339}
13340#[no_mangle]
13341pub unsafe extern "C" fn _spMeshAttachment_dispose(mut attachment: *mut spAttachment) {
13342 let mut self_0: *mut spMeshAttachment = attachment.cast::<spMeshAttachment>();
13343 if !((*self_0).sequence).is_null() {
13344 spSequence_dispose((*self_0).sequence);
13345 }
13346 _spFree((*self_0).path.cast::<c_void>());
13347 _spFree((*self_0).uvs.cast::<c_void>());
13348 if ((*self_0).parentMesh).is_null() {
13349 _spVertexAttachment_deinit(&mut (*self_0).super_0);
13350 _spFree((*self_0).regionUVs.cast::<c_void>());
13351 _spFree((*self_0).triangles.cast::<c_void>());
13352 _spFree((*self_0).edges.cast::<c_void>());
13353 } else {
13354 _spAttachment_deinit(attachment);
13355 }
13356 _spFree(self_0.cast::<c_void>());
13357}
13358#[no_mangle]
13359pub unsafe extern "C" fn _spMeshAttachment_copy(
13360 mut attachment: *mut spAttachment,
13361) -> *mut spAttachment {
13362 let mut copy: *mut spMeshAttachment = std::ptr::null_mut::<spMeshAttachment>();
13363 let mut self_0: *mut spMeshAttachment = attachment.cast::<spMeshAttachment>();
13364 if !((*self_0).parentMesh).is_null() {
13365 return &mut (*(spMeshAttachment_newLinkedMesh
13366 as unsafe extern "C" fn(*mut spMeshAttachment) -> *mut spMeshAttachment)(
13367 self_0
13368 ))
13369 .super_0
13370 .super_0;
13371 }
13372 copy = spMeshAttachment_create((*attachment).name);
13373 (*copy).rendererObject = (*self_0).rendererObject;
13374 (*copy).region = (*self_0).region;
13375 (*copy).sequence = if !((*self_0).sequence).is_null() {
13376 spSequence_copy((*self_0).sequence)
13377 } else {
13378 std::ptr::null_mut::<spSequence>()
13379 };
13380 (*copy).path = _spMalloc(
13381 (::core::mem::size_of::<c_char>() as c_ulong)
13382 .wrapping_mul((spine_strlen((*self_0).path)).wrapping_add(1 as c_int as c_ulong)),
13383 (b"spine.c\0" as *const u8).cast::<c_char>(),
13384 6815 as c_int,
13385 )
13386 .cast::<c_char>();
13387 spine_strcpy((*copy).path, (*self_0).path);
13388 spColor_setFromColor(&mut (*copy).color, &mut (*self_0).color);
13389 spVertexAttachment_copyTo(&mut (*self_0).super_0, &mut (*copy).super_0);
13390 (*copy).regionUVs = _spMalloc(
13391 (::core::mem::size_of::<c_float>() as c_ulong)
13392 .wrapping_mul((*self_0).super_0.worldVerticesLength as c_ulong),
13393 (b"spine.c\0" as *const u8).cast::<c_char>(),
13394 6819 as c_int,
13395 )
13396 .cast::<c_float>();
13397 spine_memcpy(
13398 (*copy).regionUVs.cast::<c_void>(),
13399 (*self_0).regionUVs as *const c_void,
13400 ((*self_0).super_0.worldVerticesLength as c_ulong)
13401 .wrapping_mul(::core::mem::size_of::<c_float>() as c_ulong),
13402 );
13403 (*copy).uvs = _spMalloc(
13404 (::core::mem::size_of::<c_float>() as c_ulong)
13405 .wrapping_mul((*self_0).super_0.worldVerticesLength as c_ulong),
13406 (b"spine.c\0" as *const u8).cast::<c_char>(),
13407 6821 as c_int,
13408 )
13409 .cast::<c_float>();
13410 spine_memcpy(
13411 (*copy).uvs.cast::<c_void>(),
13412 (*self_0).uvs as *const c_void,
13413 ((*self_0).super_0.worldVerticesLength as c_ulong)
13414 .wrapping_mul(::core::mem::size_of::<c_float>() as c_ulong),
13415 );
13416 (*copy).trianglesCount = (*self_0).trianglesCount;
13417 (*copy).triangles = _spMalloc(
13418 (::core::mem::size_of::<c_ushort>() as c_ulong)
13419 .wrapping_mul((*self_0).trianglesCount as c_ulong),
13420 (b"spine.c\0" as *const u8).cast::<c_char>(),
13421 6824 as c_int,
13422 )
13423 .cast::<c_ushort>();
13424 spine_memcpy(
13425 (*copy).triangles.cast::<c_void>(),
13426 (*self_0).triangles as *const c_void,
13427 ((*self_0).trianglesCount as c_ulong)
13428 .wrapping_mul(::core::mem::size_of::<c_short>() as c_ulong),
13429 );
13430 (*copy).hullLength = (*self_0).hullLength;
13431 if (*self_0).edgesCount > 0 as c_int {
13432 (*copy).edgesCount = (*self_0).edgesCount;
13433 (*copy).edges = _spMalloc(
13434 (::core::mem::size_of::<c_ushort>() as c_ulong)
13435 .wrapping_mul((*self_0).edgesCount as c_ulong),
13436 (b"spine.c\0" as *const u8).cast::<c_char>(),
13437 6829 as c_int,
13438 )
13439 .cast::<c_ushort>();
13440 spine_memcpy(
13441 (*copy).edges.cast::<c_void>(),
13442 (*self_0).edges as *const c_void,
13443 ((*self_0).edgesCount as c_ulong)
13444 .wrapping_mul(::core::mem::size_of::<c_int>() as c_ulong),
13445 );
13446 }
13447 (*copy).width = (*self_0).width;
13448 (*copy).height = (*self_0).height;
13449 &mut (*copy).super_0.super_0
13450}
13451#[no_mangle]
13452pub unsafe extern "C" fn spMeshAttachment_newLinkedMesh(
13453 mut self_0: *mut spMeshAttachment,
13454) -> *mut spMeshAttachment {
13455 let mut copy: *mut spMeshAttachment = spMeshAttachment_create((*self_0).super_0.super_0.name);
13456 (*copy).rendererObject = (*self_0).rendererObject;
13457 (*copy).region = (*self_0).region;
13458 (*copy).path = _spMalloc(
13459 (::core::mem::size_of::<c_char>() as c_ulong)
13460 .wrapping_mul((spine_strlen((*self_0).path)).wrapping_add(1 as c_int as c_ulong)),
13461 (b"spine.c\0" as *const u8).cast::<c_char>(),
13462 6843 as c_int,
13463 )
13464 .cast::<c_char>();
13465 spine_strcpy((*copy).path, (*self_0).path);
13466 spColor_setFromColor(&mut (*copy).color, &mut (*self_0).color);
13467 (*copy).super_0.timelineAttachment = (*self_0).super_0.timelineAttachment;
13468 spMeshAttachment_setParentMesh(
13469 copy,
13470 if !((*self_0).parentMesh).is_null() {
13471 (*self_0).parentMesh
13472 } else {
13473 self_0
13474 },
13475 );
13476 if !((*copy).region).is_null() {
13477 spMeshAttachment_updateRegion(copy);
13478 }
13479 copy
13480}
13481#[no_mangle]
13482pub unsafe extern "C" fn spMeshAttachment_create(mut name: *const c_char) -> *mut spMeshAttachment {
13483 let mut self_0: *mut spMeshAttachment = _spCalloc(
13484 1 as c_int as size_t,
13485 ::core::mem::size_of::<spMeshAttachment>() as c_ulong,
13486 (b"spine.c\0" as *const u8).cast::<c_char>(),
13487 6852 as c_int,
13488 )
13489 .cast::<spMeshAttachment>();
13490 _spVertexAttachment_init(&mut (*self_0).super_0);
13491 spColor_setFromFloats(
13492 &mut (*self_0).color,
13493 1 as c_int as c_float,
13494 1 as c_int as c_float,
13495 1 as c_int as c_float,
13496 1 as c_int as c_float,
13497 );
13498 _spAttachment_init(
13499 &mut (*self_0).super_0.super_0,
13500 name,
13501 SP_ATTACHMENT_MESH,
13502 Some(_spMeshAttachment_dispose as unsafe extern "C" fn(*mut spAttachment) -> ()),
13503 Some(
13504 _spMeshAttachment_copy as unsafe extern "C" fn(*mut spAttachment) -> *mut spAttachment,
13505 ),
13506 );
13507 self_0
13508}
13509#[no_mangle]
13510pub unsafe extern "C" fn spMeshAttachment_updateRegion(mut self_0: *mut spMeshAttachment) {
13511 let mut i: c_int = 0;
13512 let mut n: c_int = 0;
13513 let mut uvs: *mut c_float = std::ptr::null_mut::<c_float>();
13514 let mut u: c_float = 0.;
13515 let mut v: c_float = 0.;
13516 let mut width: c_float = 0.;
13517 let mut height: c_float = 0.;
13518 let mut verticesLength: c_int = (*self_0).super_0.worldVerticesLength;
13519 _spFree((*self_0).uvs.cast::<c_void>());
13520 (*self_0).uvs = _spMalloc(
13521 (::core::mem::size_of::<c_float>() as c_ulong).wrapping_mul(verticesLength as c_ulong),
13522 (b"spine.c\0" as *const u8).cast::<c_char>(),
13523 6865 as c_int,
13524 )
13525 .cast::<c_float>();
13526 uvs = (*self_0).uvs;
13527 n = verticesLength;
13528 u = (*(*self_0).region).u;
13529 v = (*(*self_0).region).v;
13530 match (*(*self_0).region).degrees {
13531 90 => {
13532 let mut textureWidth: c_float = (*(*self_0).region).height as c_float
13533 / ((*(*self_0).region).u2 - (*(*self_0).region).u);
13534 let mut textureHeight: c_float = (*(*self_0).region).width as c_float
13535 / ((*(*self_0).region).v2 - (*(*self_0).region).v);
13536 u -= ((*(*self_0).region).originalHeight as c_float
13537 - (*(*self_0).region).offsetY
13538 - (*(*self_0).region).height as c_float)
13539 / textureWidth;
13540 v -= ((*(*self_0).region).originalWidth as c_float
13541 - (*(*self_0).region).offsetX
13542 - (*(*self_0).region).width as c_float)
13543 / textureHeight;
13544 width = (*(*self_0).region).originalHeight as c_float / textureWidth;
13545 height = (*(*self_0).region).originalWidth as c_float / textureHeight;
13546 i = 0 as c_int;
13547 while i < n {
13548 *uvs.offset(i as isize) =
13549 u + *((*self_0).regionUVs).offset((i + 1 as c_int) as isize) * width;
13550 *uvs.offset((i + 1 as c_int) as isize) = v
13551 + (1 as c_int as c_float - *((*self_0).regionUVs).offset(i as isize)) * height;
13552 i += 2 as c_int;
13553 }
13554 }
13555 180 => {
13556 let mut textureWidth_0: c_float = (*(*self_0).region).width as c_float
13557 / ((*(*self_0).region).u2 - (*(*self_0).region).u);
13558 let mut textureHeight_0: c_float = (*(*self_0).region).height as c_float
13559 / ((*(*self_0).region).v2 - (*(*self_0).region).v);
13560 u -= ((*(*self_0).region).originalWidth as c_float
13561 - (*(*self_0).region).offsetX
13562 - (*(*self_0).region).width as c_float)
13563 / textureWidth_0;
13564 v -= (*(*self_0).region).offsetY / textureHeight_0;
13565 width = (*(*self_0).region).originalWidth as c_float / textureWidth_0;
13566 height = (*(*self_0).region).originalHeight as c_float / textureHeight_0;
13567 i = 0 as c_int;
13568 while i < n {
13569 *uvs.offset(i as isize) =
13570 u + (1 as c_int as c_float - *((*self_0).regionUVs).offset(i as isize)) * width;
13571 *uvs.offset((i + 1 as c_int) as isize) = v
13572 + (1 as c_int as c_float
13573 - *((*self_0).regionUVs).offset((i + 1 as c_int) as isize))
13574 * height;
13575 i += 2 as c_int;
13576 }
13577 }
13578 270 => {
13579 let mut textureHeight_1: c_float = (*(*self_0).region).height as c_float
13580 / ((*(*self_0).region).v2 - (*(*self_0).region).v);
13581 let mut textureWidth_1: c_float = (*(*self_0).region).width as c_float
13582 / ((*(*self_0).region).u2 - (*(*self_0).region).u);
13583 u -= (*(*self_0).region).offsetY / textureWidth_1;
13584 v -= (*(*self_0).region).offsetX / textureHeight_1;
13585 width = (*(*self_0).region).originalHeight as c_float / textureWidth_1;
13586 height = (*(*self_0).region).originalWidth as c_float / textureHeight_1;
13587 i = 0 as c_int;
13588 while i < n {
13589 *uvs.offset(i as isize) = u
13590 + (1 as c_int as c_float
13591 - *((*self_0).regionUVs).offset((i + 1 as c_int) as isize))
13592 * width;
13593 *uvs.offset((i + 1 as c_int) as isize) =
13594 v + *((*self_0).regionUVs).offset(i as isize) * height;
13595 i += 2 as c_int;
13596 }
13597 }
13598 _ => {
13599 let mut textureWidth_2: c_float = (*(*self_0).region).width as c_float
13600 / ((*(*self_0).region).u2 - (*(*self_0).region).u);
13601 let mut textureHeight_2: c_float = (*(*self_0).region).height as c_float
13602 / ((*(*self_0).region).v2 - (*(*self_0).region).v);
13603 u -= (*(*self_0).region).offsetX / textureWidth_2;
13604 v -= ((*(*self_0).region).originalHeight as c_float
13605 - (*(*self_0).region).offsetY
13606 - (*(*self_0).region).height as c_float)
13607 / textureHeight_2;
13608 width = (*(*self_0).region).originalWidth as c_float / textureWidth_2;
13609 height = (*(*self_0).region).originalHeight as c_float / textureHeight_2;
13610 i = 0 as c_int;
13611 while i < n {
13612 *uvs.offset(i as isize) = u + *((*self_0).regionUVs).offset(i as isize) * width;
13613 *uvs.offset((i + 1 as c_int) as isize) =
13614 v + *((*self_0).regionUVs).offset((i + 1 as c_int) as isize) * height;
13615 i += 2 as c_int;
13616 }
13617 }
13618 }
13619}
13620#[no_mangle]
13621pub unsafe extern "C" fn spMeshAttachment_setParentMesh(
13622 mut self_0: *mut spMeshAttachment,
13623 mut parentMesh: *mut spMeshAttachment,
13624) {
13625 (*self_0).parentMesh = parentMesh;
13626 if !parentMesh.is_null() {
13627 (*self_0).super_0.bones = (*parentMesh).super_0.bones;
13628 (*self_0).super_0.bonesCount = (*parentMesh).super_0.bonesCount;
13629 (*self_0).super_0.vertices = (*parentMesh).super_0.vertices;
13630 (*self_0).super_0.verticesCount = (*parentMesh).super_0.verticesCount;
13631 (*self_0).regionUVs = (*parentMesh).regionUVs;
13632 (*self_0).triangles = (*parentMesh).triangles;
13633 (*self_0).trianglesCount = (*parentMesh).trianglesCount;
13634 (*self_0).hullLength = (*parentMesh).hullLength;
13635 (*self_0).super_0.worldVerticesLength = (*parentMesh).super_0.worldVerticesLength;
13636 (*self_0).edges = (*parentMesh).edges;
13637 (*self_0).edgesCount = (*parentMesh).edgesCount;
13638 (*self_0).width = (*parentMesh).width;
13639 (*self_0).height = (*parentMesh).height;
13640 }
13641}
13642#[no_mangle]
13643pub unsafe extern "C" fn _spPathAttachment_dispose(mut attachment: *mut spAttachment) {
13644 let mut self_0: *mut spPathAttachment = attachment.cast::<spPathAttachment>();
13645 _spVertexAttachment_deinit(&mut (*self_0).super_0);
13646 _spFree((*self_0).lengths.cast::<c_void>());
13647 _spFree(self_0.cast::<c_void>());
13648}
13649#[no_mangle]
13650pub unsafe extern "C" fn _spPathAttachment_copy(
13651 mut attachment: *mut spAttachment,
13652) -> *mut spAttachment {
13653 let mut copy: *mut spPathAttachment = spPathAttachment_create((*attachment).name);
13654 let mut self_0: *mut spPathAttachment = attachment.cast::<spPathAttachment>();
13655 spVertexAttachment_copyTo(&mut (*self_0).super_0, &mut (*copy).super_0);
13656 (*copy).lengthsLength = (*self_0).lengthsLength;
13657 (*copy).lengths = _spMalloc(
13658 (::core::mem::size_of::<c_float>() as c_ulong)
13659 .wrapping_mul((*self_0).lengthsLength as c_ulong),
13660 (b"spine.c\0" as *const u8).cast::<c_char>(),
13661 6996 as c_int,
13662 )
13663 .cast::<c_float>();
13664 spine_memcpy(
13665 (*copy).lengths.cast::<c_void>(),
13666 (*self_0).lengths as *const c_void,
13667 ((*self_0).lengthsLength as c_ulong)
13668 .wrapping_mul(::core::mem::size_of::<c_float>() as c_ulong),
13669 );
13670 (*copy).closed = (*self_0).closed;
13671 (*copy).constantSpeed = (*self_0).constantSpeed;
13672 &mut (*copy).super_0.super_0
13673}
13674#[no_mangle]
13675pub unsafe extern "C" fn spPathAttachment_create(mut name: *const c_char) -> *mut spPathAttachment {
13676 let mut self_0: *mut spPathAttachment = _spCalloc(
13677 1 as c_int as size_t,
13678 ::core::mem::size_of::<spPathAttachment>() as c_ulong,
13679 (b"spine.c\0" as *const u8).cast::<c_char>(),
13680 7004 as c_int,
13681 )
13682 .cast::<spPathAttachment>();
13683 _spVertexAttachment_init(&mut (*self_0).super_0);
13684 _spAttachment_init(
13685 &mut (*self_0).super_0.super_0,
13686 name,
13687 SP_ATTACHMENT_PATH,
13688 Some(_spPathAttachment_dispose as unsafe extern "C" fn(*mut spAttachment) -> ()),
13689 Some(
13690 _spPathAttachment_copy as unsafe extern "C" fn(*mut spAttachment) -> *mut spAttachment,
13691 ),
13692 );
13693 self_0
13694}
13695#[no_mangle]
13696pub unsafe extern "C" fn spPathConstraint_create(
13697 mut data: *mut spPathConstraintData,
13698 mut skeleton: *const spSkeleton,
13699) -> *mut spPathConstraint {
13700 let mut i: c_int = 0;
13701 let mut self_0: *mut spPathConstraint = _spCalloc(
13702 1 as c_int as size_t,
13703 ::core::mem::size_of::<spPathConstraint>() as c_ulong,
13704 (b"spine.c\0" as *const u8).cast::<c_char>(),
13705 7049 as c_int,
13706 )
13707 .cast::<spPathConstraint>();
13708 (*self_0).data = data;
13709 (*self_0).bonesCount = (*data).bonesCount;
13710 (*self_0).bones = _spMalloc(
13711 (::core::mem::size_of::<*mut spBone>() as c_ulong)
13712 .wrapping_mul((*self_0).bonesCount as c_ulong),
13713 (b"spine.c\0" as *const u8).cast::<c_char>(),
13714 7052 as c_int,
13715 )
13716 .cast::<*mut spBone>();
13717 i = 0 as c_int;
13718 while i < (*self_0).bonesCount {
13719 let fresh51 = &mut (*((*self_0).bones).offset(i as isize));
13720 *fresh51 = spSkeleton_findBone(
13721 skeleton,
13722 (**((*(*self_0).data).bones).offset(i as isize)).name,
13723 );
13724 i += 1;
13725 }
13726 (*self_0).target = spSkeleton_findSlot(skeleton, (*(*(*self_0).data).target).name);
13727 (*self_0).position = (*data).position;
13728 (*self_0).spacing = (*data).spacing;
13729 (*self_0).mixRotate = (*data).mixRotate;
13730 (*self_0).mixX = (*data).mixX;
13731 (*self_0).mixY = (*data).mixY;
13732 (*self_0).spacesCount = 0 as c_int;
13733 (*self_0).spaces = std::ptr::null_mut::<c_float>();
13734 (*self_0).positionsCount = 0 as c_int;
13735 (*self_0).positions = std::ptr::null_mut::<c_float>();
13736 (*self_0).worldCount = 0 as c_int;
13737 (*self_0).world = std::ptr::null_mut::<c_float>();
13738 (*self_0).curvesCount = 0 as c_int;
13739 (*self_0).curves = std::ptr::null_mut::<c_float>();
13740 (*self_0).lengthsCount = 0 as c_int;
13741 (*self_0).lengths = std::ptr::null_mut::<c_float>();
13742 self_0
13743}
13744#[no_mangle]
13745pub unsafe extern "C" fn spPathConstraint_dispose(mut self_0: *mut spPathConstraint) {
13746 _spFree((*self_0).bones.cast::<c_void>());
13747 _spFree((*self_0).spaces.cast::<c_void>());
13748 if !((*self_0).positions).is_null() {
13749 _spFree((*self_0).positions.cast::<c_void>());
13750 }
13751 if !((*self_0).world).is_null() {
13752 _spFree((*self_0).world.cast::<c_void>());
13753 }
13754 if !((*self_0).curves).is_null() {
13755 _spFree((*self_0).curves.cast::<c_void>());
13756 }
13757 if !((*self_0).lengths).is_null() {
13758 _spFree((*self_0).lengths.cast::<c_void>());
13759 }
13760 _spFree(self_0.cast::<c_void>());
13761}
13762#[no_mangle]
13763pub unsafe extern "C" fn spPathConstraint_update(mut self_0: *mut spPathConstraint) {
13764 let mut i: c_int = 0;
13765 let mut p: c_int = 0;
13766 let mut n: c_int = 0;
13767 let mut length: c_float = 0.;
13768 let mut setupLength: c_float = 0.;
13769 let mut x: c_float = 0.;
13770 let mut y: c_float = 0.;
13771 let mut dx: c_float = 0.;
13772 let mut dy: c_float = 0.;
13773 let mut s: c_float = 0.;
13774 let mut sum: c_float = 0.;
13775 let mut spaces: *mut c_float = std::ptr::null_mut::<c_float>();
13776 let mut lengths: *mut c_float = std::ptr::null_mut::<c_float>();
13777 let mut positions: *mut c_float = std::ptr::null_mut::<c_float>();
13778 let mut spacing: c_float = 0.;
13779 let mut boneX: c_float = 0.;
13780 let mut boneY: c_float = 0.;
13781 let mut offsetRotation: c_float = 0.;
13782 let mut tip: c_int = 0;
13783 let mut mixRotate: c_float = (*self_0).mixRotate;
13784 let mut mixX: c_float = (*self_0).mixX;
13785 let mut mixY: c_float = (*self_0).mixY;
13786 let mut lengthSpacing: c_int = 0;
13787 let mut attachment: *mut spPathAttachment =
13788 (*(*self_0).target).attachment.cast::<spPathAttachment>();
13789 let mut data: *mut spPathConstraintData = (*self_0).data;
13790 let mut tangents: c_int =
13791 ((*data).rotateMode as c_uint == SP_ROTATE_MODE_TANGENT as c_int as c_uint) as c_int;
13792 let mut scale: c_int =
13793 ((*data).rotateMode as c_uint == SP_ROTATE_MODE_CHAIN_SCALE as c_int as c_uint) as c_int;
13794 let mut boneCount: c_int = (*self_0).bonesCount;
13795 let mut spacesCount: c_int = if tangents != 0 {
13796 boneCount
13797 } else {
13798 boneCount + 1 as c_int
13799 };
13800 let mut bones: *mut *mut spBone = (*self_0).bones;
13801 let mut pa: *mut spBone = std::ptr::null_mut::<spBone>();
13802 if mixRotate == 0 as c_int as c_float
13803 && mixX == 0 as c_int as c_float
13804 && mixY == 0 as c_int as c_float
13805 {
13806 return;
13807 }
13808 if attachment.is_null()
13809 || (*attachment).super_0.super_0.type_0 as c_uint != SP_ATTACHMENT_PATH as c_int as c_uint
13810 {
13811 return;
13812 }
13813 if (*self_0).spacesCount != spacesCount {
13814 if !((*self_0).spaces).is_null() {
13815 _spFree((*self_0).spaces.cast::<c_void>());
13816 }
13817 (*self_0).spaces = _spMalloc(
13818 (::core::mem::size_of::<c_float>() as c_ulong).wrapping_mul(spacesCount as c_ulong),
13819 (b"spine.c\0" as *const u8).cast::<c_char>(),
13820 7105 as c_int,
13821 )
13822 .cast::<c_float>();
13823 (*self_0).spacesCount = spacesCount;
13824 }
13825 spaces = (*self_0).spaces;
13826 *spaces.offset(0 as c_int as isize) = 0 as c_int as c_float;
13827 lengths = std::ptr::null_mut::<c_float>();
13828 spacing = (*self_0).spacing;
13829 if scale != 0 {
13830 if (*self_0).lengthsCount != boneCount {
13831 if !((*self_0).lengths).is_null() {
13832 _spFree((*self_0).lengths.cast::<c_void>());
13833 }
13834 (*self_0).lengths = _spMalloc(
13835 (::core::mem::size_of::<c_float>() as c_ulong).wrapping_mul(boneCount as c_ulong),
13836 (b"spine.c\0" as *const u8).cast::<c_char>(),
13837 7116 as c_int,
13838 )
13839 .cast::<c_float>();
13840 (*self_0).lengthsCount = boneCount;
13841 }
13842 lengths = (*self_0).lengths;
13843 }
13844 match (*data).spacingMode as c_uint {
13845 2 => {
13846 if scale != 0 {
13847 i = 0 as c_int;
13848 n = spacesCount - 1 as c_int;
13849 while i < n {
13850 let mut bone: *mut spBone = *bones.offset(i as isize);
13851 setupLength = (*(*bone).data).length;
13852 x = setupLength * (*bone).a;
13853 y = setupLength * (*bone).c;
13854 *lengths.offset(i as isize) = spine_sqrtf(x * x + y * y);
13855 i += 1;
13856 }
13857 }
13858 i = 1 as c_int;
13859 n = spacesCount;
13860 while i < n {
13861 *spaces.offset(i as isize) = spacing;
13862 i += 1;
13863 }
13864 }
13865 3 => {
13866 sum = 0 as c_int as c_float;
13867 i = 0 as c_int;
13868 n = spacesCount - 1 as c_int;
13869 while i < n {
13870 let mut bone_0: *mut spBone = *bones.offset(i as isize);
13871 setupLength = (*(*bone_0).data).length;
13872 if setupLength < 0.00001f32 {
13873 if scale != 0 {
13874 *lengths.offset(i as isize) = 0 as c_int as c_float;
13875 }
13876 i += 1;
13877 *spaces.offset(i as isize) = spacing;
13878 } else {
13879 x = setupLength * (*bone_0).a;
13880 y = setupLength * (*bone_0).c;
13881 length = spine_sqrtf(x * x + y * y);
13882 if scale != 0 {
13883 *lengths.offset(i as isize) = length;
13884 }
13885 i += 1;
13886 *spaces.offset(i as isize) = length;
13887 sum += length;
13888 }
13889 }
13890 if sum > 0 as c_int as c_float {
13891 sum = spacesCount as c_float / sum * spacing;
13892 i = 1 as c_int;
13893 while i < spacesCount {
13894 *spaces.offset(i as isize) *= sum;
13895 i += 1;
13896 }
13897 }
13898 }
13899 _ => {
13900 lengthSpacing = ((*data).spacingMode as c_uint
13901 == SP_SPACING_MODE_LENGTH as c_int as c_uint) as c_int;
13902 i = 0 as c_int;
13903 n = spacesCount - 1 as c_int;
13904 while i < n {
13905 let mut bone_1: *mut spBone = *bones.offset(i as isize);
13906 setupLength = (*(*bone_1).data).length;
13907 if setupLength < 0.00001f32 {
13908 if scale != 0 {
13909 *lengths.offset(i as isize) = 0 as c_int as c_float;
13910 }
13911 i += 1;
13912 *spaces.offset(i as isize) = spacing;
13913 } else {
13914 x = setupLength * (*bone_1).a;
13915 y = setupLength * (*bone_1).c;
13916 length = spine_sqrtf(x * x + y * y);
13917 if scale != 0 {
13918 *lengths.offset(i as isize) = length;
13919 }
13920 i += 1;
13921 *spaces.offset(i as isize) = (if lengthSpacing != 0 {
13922 setupLength + spacing
13923 } else {
13924 spacing
13925 }) * length
13926 / setupLength;
13927 }
13928 }
13929 }
13930 }
13931 positions = spPathConstraint_computeWorldPositions(self_0, attachment, spacesCount, tangents);
13932 boneX = *positions.offset(0 as c_int as isize);
13933 boneY = *positions.offset(1 as c_int as isize);
13934 offsetRotation = (*(*self_0).data).offsetRotation;
13935 tip = 0 as c_int;
13936 if offsetRotation == 0 as c_int as c_float {
13937 tip = ((*data).rotateMode as c_uint == SP_ROTATE_MODE_CHAIN as c_int as c_uint) as c_int;
13938 } else {
13939 tip = 0 as c_int;
13940 pa = (*(*self_0).target).bone;
13941 offsetRotation *= if (*pa).a * (*pa).d - (*pa).b * (*pa).c > 0 as c_int as c_float {
13942 3.141_592_7_f32 / 180 as c_int as c_float
13943 } else {
13944 -(3.141_592_7_f32 / 180 as c_int as c_float)
13945 };
13946 }
13947 i = 0 as c_int;
13948 p = 3 as c_int;
13949 while i < boneCount {
13950 let mut bone_2: *mut spBone = *bones.offset(i as isize);
13951 (*bone_2).worldX += (boneX - (*bone_2).worldX) * mixX;
13952 (*bone_2).worldY += (boneY - (*bone_2).worldY) * mixY;
13953 x = *positions.offset(p as isize);
13954 y = *positions.offset((p + 1 as c_int) as isize);
13955 dx = x - boneX;
13956 dy = y - boneY;
13957 if scale != 0 {
13958 length = *lengths.offset(i as isize);
13959 if length != 0 as c_int as c_float {
13960 s = (spine_sqrtf(dx * dx + dy * dy) / length - 1 as c_int as c_float) * mixRotate
13961 + 1 as c_int as c_float;
13962 (*bone_2).a *= s;
13963 (*bone_2).c *= s;
13964 }
13965 }
13966 boneX = x;
13967 boneY = y;
13968 if mixRotate > 0 as c_int as c_float {
13969 let mut a: c_float = (*bone_2).a;
13970 let mut b: c_float = (*bone_2).b;
13971 let mut c: c_float = (*bone_2).c;
13972 let mut d: c_float = (*bone_2).d;
13973 let mut r: c_float = 0.;
13974 let mut cosine: c_float = 0.;
13975 let mut sine: c_float = 0.;
13976 if tangents != 0 {
13977 r = *positions.offset((p - 1 as c_int) as isize);
13978 } else if *spaces.offset((i + 1 as c_int) as isize) == 0 as c_int as c_float {
13979 r = *positions.offset((p + 2 as c_int) as isize);
13980 } else {
13981 r = spine_atan2f(dy, dx);
13982 }
13983 r -= spine_atan2f(c, a) - offsetRotation * (3.141_592_7_f32 / 180 as c_int as c_float);
13984 if tip != 0 {
13985 cosine = spine_cosf(r);
13986 sine = spine_sinf(r);
13987 length = (*(*bone_2).data).length;
13988 boneX += (length * (cosine * a - sine * c) - dx) * mixRotate;
13989 boneY += (length * (sine * a + cosine * c) - dy) * mixRotate;
13990 } else {
13991 r += offsetRotation;
13992 }
13993 if r > 3.141_592_7_f32 {
13994 r -= 3.141_592_7_f32 * 2 as c_int as c_float;
13995 } else if r < -3.141_592_7_f32 {
13996 r += 3.141_592_7_f32 * 2 as c_int as c_float;
13997 }
13998 r *= mixRotate;
13999 cosine = spine_cosf(r);
14000 sine = spine_sinf(r);
14001 (*bone_2).a = cosine * a - sine * c;
14002 (*bone_2).b = cosine * b - sine * d;
14003 (*bone_2).c = sine * a + cosine * c;
14004 (*bone_2).d = sine * b + cosine * d;
14005 }
14006 spBone_updateAppliedTransform(bone_2);
14007 i += 1;
14008 p += 3 as c_int;
14009 }
14010}
14011#[no_mangle]
14012pub unsafe extern "C" fn spPathConstraint_setToSetupPose(mut self_0: *mut spPathConstraint) {
14013 let mut data: *mut spPathConstraintData = (*self_0).data;
14014 (*self_0).position = (*data).position;
14015 (*self_0).spacing = (*data).spacing;
14016 (*self_0).mixRotate = (*data).mixRotate;
14017 (*self_0).mixX = (*data).mixX;
14018 (*self_0).mixY = (*data).mixY;
14019}
14020unsafe extern "C" fn _addBeforePosition(
14021 mut p: c_float,
14022 mut temp: *mut c_float,
14023 mut i: c_int,
14024 mut out: *mut c_float,
14025 mut o: c_int,
14026) {
14027 let mut x1: c_float = *temp.offset(i as isize);
14028 let mut y1: c_float = *temp.offset((i + 1 as c_int) as isize);
14029 let mut dx: c_float = *temp.offset((i + 2 as c_int) as isize) - x1;
14030 let mut dy: c_float = *temp.offset((i + 3 as c_int) as isize) - y1;
14031 let mut r: c_float = spine_atan2f(dy, dx);
14032 *out.offset(o as isize) = x1 + p * spine_cosf(r);
14033 *out.offset((o + 1 as c_int) as isize) = y1 + p * spine_sinf(r);
14034 *out.offset((o + 2 as c_int) as isize) = r;
14035}
14036unsafe extern "C" fn _addAfterPosition(
14037 mut p: c_float,
14038 mut temp: *mut c_float,
14039 mut i: c_int,
14040 mut out: *mut c_float,
14041 mut o: c_int,
14042) {
14043 let mut x1: c_float = *temp.offset((i + 2 as c_int) as isize);
14044 let mut y1: c_float = *temp.offset((i + 3 as c_int) as isize);
14045 let mut dx: c_float = x1 - *temp.offset(i as isize);
14046 let mut dy: c_float = y1 - *temp.offset((i + 1 as c_int) as isize);
14047 let mut r: c_float = spine_atan2f(dy, dx);
14048 *out.offset(o as isize) = x1 + p * spine_cosf(r);
14049 *out.offset((o + 1 as c_int) as isize) = y1 + p * spine_sinf(r);
14050 *out.offset((o + 2 as c_int) as isize) = r;
14051}
14052unsafe extern "C" fn _addCurvePosition(
14053 mut p: c_float,
14054 mut x1: c_float,
14055 mut y1: c_float,
14056 mut cx1: c_float,
14057 mut cy1: c_float,
14058 mut cx2: c_float,
14059 mut cy2: c_float,
14060 mut x2: c_float,
14061 mut y2: c_float,
14062 mut out: *mut c_float,
14063 mut o: c_int,
14064 mut tangents: c_int,
14065) {
14066 let mut tt: c_float = 0.;
14067 let mut ttt: c_float = 0.;
14068 let mut u: c_float = 0.;
14069 let mut uu: c_float = 0.;
14070 let mut uuu: c_float = 0.;
14071 let mut ut: c_float = 0.;
14072 let mut ut3: c_float = 0.;
14073 let mut uut3: c_float = 0.;
14074 let mut utt3: c_float = 0.;
14075 let mut x: c_float = 0.;
14076 let mut y: c_float = 0.;
14077 if p == 0 as c_int as c_float || p.is_nan() as i32 != 0 {
14078 *out.offset(o as isize) = x1;
14079 *out.offset((o + 1 as c_int) as isize) = y1;
14080 *out.offset((o + 2 as c_int) as isize) = spine_atan2f(cy1 - y1, cx1 - x1);
14081 return;
14082 }
14083 tt = p * p;
14084 ttt = tt * p;
14085 u = 1 as c_int as c_float - p;
14086 uu = u * u;
14087 uuu = uu * u;
14088 ut = u * p;
14089 ut3 = ut * 3 as c_int as c_float;
14090 uut3 = u * ut3;
14091 utt3 = ut3 * p;
14092 x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt;
14093 y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;
14094 *out.offset(o as isize) = x;
14095 *out.offset((o + 1 as c_int) as isize) = y;
14096 if tangents != 0 {
14097 if (p as c_double) < 0.001f64 {
14098 *out.offset((o + 2 as c_int) as isize) = spine_atan2f(cy1 - y1, cx1 - x1);
14099 } else {
14100 *out.offset((o + 2 as c_int) as isize) = spine_atan2f(
14101 y - (y1 * uu + cy1 * ut * 2 as c_int as c_float + cy2 * tt),
14102 x - (x1 * uu + cx1 * ut * 2 as c_int as c_float + cx2 * tt),
14103 );
14104 }
14105 }
14106}
14107#[no_mangle]
14108pub unsafe extern "C" fn spPathConstraint_computeWorldPositions(
14109 mut self_0: *mut spPathConstraint,
14110 mut path: *mut spPathAttachment,
14111 mut spacesCount: c_int,
14112 mut tangents: c_int,
14113) -> *mut c_float {
14114 let mut i: c_int = 0;
14115 let mut o: c_int = 0;
14116 let mut w: c_int = 0;
14117 let mut curve: c_int = 0;
14118 let mut segment: c_int = 0;
14119 let mut closed: c_int = 0;
14120 let mut verticesLength: c_int = 0;
14121 let mut curveCount: c_int = 0;
14122 let mut prevCurve: c_int = 0;
14123 let mut out: *mut c_float = std::ptr::null_mut::<c_float>();
14124 let mut curves: *mut c_float = std::ptr::null_mut::<c_float>();
14125 let mut segments: *mut c_float = std::ptr::null_mut::<c_float>();
14126 let mut tmpx: c_float = 0.;
14127 let mut tmpy: c_float = 0.;
14128 let mut dddfx: c_float = 0.;
14129 let mut dddfy: c_float = 0.;
14130 let mut ddfx: c_float = 0.;
14131 let mut ddfy: c_float = 0.;
14132 let mut dfx: c_float = 0.;
14133 let mut dfy: c_float = 0.;
14134 let mut pathLength: c_float = 0.;
14135 let mut curveLength: c_float = 0.;
14136 let mut p: c_float = 0.;
14137 let mut x1: c_float = 0.;
14138 let mut y1: c_float = 0.;
14139 let mut cx1: c_float = 0.;
14140 let mut cy1: c_float = 0.;
14141 let mut cx2: c_float = 0.;
14142 let mut cy2: c_float = 0.;
14143 let mut x2: c_float = 0.;
14144 let mut y2: c_float = 0.;
14145 let mut multiplier: c_float = 0.;
14146 let mut target: *mut spSlot = (*self_0).target;
14147 let mut position: c_float = (*self_0).position;
14148 let mut spaces: *mut c_float = (*self_0).spaces;
14149 let mut world: *mut c_float = std::ptr::null_mut::<c_float>();
14150 if (*self_0).positionsCount != spacesCount * 3 as c_int + 2 as c_int {
14151 if !((*self_0).positions).is_null() {
14152 _spFree((*self_0).positions.cast::<c_void>());
14153 }
14154 (*self_0).positions = _spMalloc(
14155 (::core::mem::size_of::<c_float>() as c_ulong)
14156 .wrapping_mul((spacesCount * 3 as c_int + 2 as c_int) as c_ulong),
14157 (b"spine.c\0" as *const u8).cast::<c_char>(),
14158 7291 as c_int,
14159 )
14160 .cast::<c_float>();
14161 (*self_0).positionsCount = spacesCount * 3 as c_int + 2 as c_int;
14162 }
14163 out = (*self_0).positions;
14164 closed = (*path).closed;
14165 verticesLength = (*path).super_0.worldVerticesLength;
14166 curveCount = verticesLength / 6 as c_int;
14167 prevCurve = -(1 as c_int);
14168 if (*path).constantSpeed == 0 {
14169 let mut lengths: *mut c_float = (*path).lengths;
14170 curveCount -= if closed != 0 { 1 as c_int } else { 2 as c_int };
14171 pathLength = *lengths.offset(curveCount as isize);
14172 if (*(*self_0).data).positionMode as c_uint == SP_POSITION_MODE_PERCENT as c_int as c_uint {
14173 position *= pathLength;
14174 }
14175 match (*(*self_0).data).spacingMode as c_uint {
14176 2 => {
14177 multiplier = pathLength;
14178 }
14179 3 => {
14180 multiplier = pathLength / spacesCount as c_float;
14181 }
14182 _ => {
14183 multiplier = 1 as c_int as c_float;
14184 }
14185 }
14186 if (*self_0).worldCount != 8 as c_int {
14187 if !((*self_0).world).is_null() {
14188 _spFree((*self_0).world.cast::<c_void>());
14189 }
14190 (*self_0).world = _spMalloc(
14191 (::core::mem::size_of::<c_float>() as c_ulong).wrapping_mul(8 as c_int as c_ulong),
14192 (b"spine.c\0" as *const u8).cast::<c_char>(),
14193 7316 as c_int,
14194 )
14195 .cast::<c_float>();
14196 (*self_0).worldCount = 8 as c_int;
14197 }
14198 world = (*self_0).world;
14199 let mut current_block_55: u64;
14200 i = 0 as c_int;
14201 o = 0 as c_int;
14202 curve = 0 as c_int;
14203 while i < spacesCount {
14204 let mut space: c_float = *spaces.offset(i as isize) * multiplier;
14205 position += space;
14206 p = position;
14207 if closed != 0 {
14208 p = spine_fmodf(p, pathLength);
14209 if p < 0 as c_int as c_float {
14210 p += pathLength;
14211 }
14212 curve = 0 as c_int;
14213 current_block_55 = 18435049525520518667;
14214 } else if p < 0 as c_int as c_float {
14215 if prevCurve != -(2 as c_int) {
14216 prevCurve = -(2 as c_int);
14217 spVertexAttachment_computeWorldVertices(
14218 &mut (*path).super_0,
14219 target,
14220 2 as c_int,
14221 4 as c_int,
14222 world,
14223 0 as c_int,
14224 2 as c_int,
14225 );
14226 }
14227 _addBeforePosition(p, world, 0 as c_int, out, o);
14228 current_block_55 = 10043043949733653460;
14229 } else if p > pathLength {
14230 if prevCurve != -(3 as c_int) {
14231 prevCurve = -(3 as c_int);
14232 spVertexAttachment_computeWorldVertices(
14233 &mut (*path).super_0,
14234 target,
14235 verticesLength - 6 as c_int,
14236 4 as c_int,
14237 world,
14238 0 as c_int,
14239 2 as c_int,
14240 );
14241 }
14242 _addAfterPosition(p - pathLength, world, 0 as c_int, out, o);
14243 current_block_55 = 10043043949733653460;
14244 } else {
14245 current_block_55 = 18435049525520518667;
14246 }
14247 match current_block_55 {
14248 18435049525520518667 => {
14249 loop {
14250 let mut length: c_float = *lengths.offset(curve as isize);
14251 if p > length {
14252 curve += 1;
14253 } else {
14254 if curve == 0 as c_int {
14255 p /= length;
14256 } else {
14257 let mut prev: c_float =
14258 *lengths.offset((curve - 1 as c_int) as isize);
14259 p = (p - prev) / (length - prev);
14260 }
14261 break;
14262 }
14263 }
14264 if curve != prevCurve {
14265 prevCurve = curve;
14266 if closed != 0 && curve == curveCount {
14267 spVertexAttachment_computeWorldVertices(
14268 &mut (*path).super_0,
14269 target,
14270 verticesLength - 4 as c_int,
14271 4 as c_int,
14272 world,
14273 0 as c_int,
14274 2 as c_int,
14275 );
14276 spVertexAttachment_computeWorldVertices(
14277 &mut (*path).super_0,
14278 target,
14279 0 as c_int,
14280 4 as c_int,
14281 world,
14282 4 as c_int,
14283 2 as c_int,
14284 );
14285 } else {
14286 spVertexAttachment_computeWorldVertices(
14287 &mut (*path).super_0,
14288 target,
14289 curve * 6 as c_int + 2 as c_int,
14290 8 as c_int,
14291 world,
14292 0 as c_int,
14293 2 as c_int,
14294 );
14295 }
14296 }
14297 _addCurvePosition(
14298 p,
14299 *world.offset(0 as c_int as isize),
14300 *world.offset(1 as c_int as isize),
14301 *world.offset(2 as c_int as isize),
14302 *world.offset(3 as c_int as isize),
14303 *world.offset(4 as c_int as isize),
14304 *world.offset(5 as c_int as isize),
14305 *world.offset(6 as c_int as isize),
14306 *world.offset(7 as c_int as isize),
14307 out,
14308 o,
14309 (tangents != 0 || i > 0 as c_int && space == 0 as c_int as c_float)
14310 as c_int,
14311 );
14312 }
14313 _ => {}
14314 }
14315 i += 1;
14316 o += 3 as c_int;
14317 }
14318 return out;
14319 }
14320 if closed != 0 {
14321 verticesLength += 2 as c_int;
14322 if (*self_0).worldCount != verticesLength {
14323 if !((*self_0).world).is_null() {
14324 _spFree((*self_0).world.cast::<c_void>());
14325 }
14326 (*self_0).world = _spMalloc(
14327 (::core::mem::size_of::<c_float>() as c_ulong)
14328 .wrapping_mul(verticesLength as c_ulong),
14329 (b"spine.c\0" as *const u8).cast::<c_char>(),
14330 7376 as c_int,
14331 )
14332 .cast::<c_float>();
14333 (*self_0).worldCount = verticesLength;
14334 }
14335 world = (*self_0).world;
14336 spVertexAttachment_computeWorldVertices(
14337 &mut (*path).super_0,
14338 target,
14339 2 as c_int,
14340 verticesLength - 4 as c_int,
14341 world,
14342 0 as c_int,
14343 2 as c_int,
14344 );
14345 spVertexAttachment_computeWorldVertices(
14346 &mut (*path).super_0,
14347 target,
14348 0 as c_int,
14349 2 as c_int,
14350 world,
14351 verticesLength - 4 as c_int,
14352 2 as c_int,
14353 );
14354 *world.offset((verticesLength - 2 as c_int) as isize) = *world.offset(0 as c_int as isize);
14355 *world.offset((verticesLength - 1 as c_int) as isize) = *world.offset(1 as c_int as isize);
14356 } else {
14357 curveCount -= 1;
14358 verticesLength -= 4 as c_int;
14359 if (*self_0).worldCount != verticesLength {
14360 if !((*self_0).world).is_null() {
14361 _spFree((*self_0).world.cast::<c_void>());
14362 }
14363 (*self_0).world = _spMalloc(
14364 (::core::mem::size_of::<c_float>() as c_ulong)
14365 .wrapping_mul(verticesLength as c_ulong),
14366 (b"spine.c\0" as *const u8).cast::<c_char>(),
14367 7389 as c_int,
14368 )
14369 .cast::<c_float>();
14370 (*self_0).worldCount = verticesLength;
14371 }
14372 world = (*self_0).world;
14373 spVertexAttachment_computeWorldVertices(
14374 &mut (*path).super_0,
14375 target,
14376 2 as c_int,
14377 verticesLength,
14378 world,
14379 0 as c_int,
14380 2 as c_int,
14381 );
14382 }
14383 if (*self_0).curvesCount != curveCount {
14384 if !((*self_0).curves).is_null() {
14385 _spFree((*self_0).curves.cast::<c_void>());
14386 }
14387 (*self_0).curves = _spMalloc(
14388 (::core::mem::size_of::<c_float>() as c_ulong).wrapping_mul(curveCount as c_ulong),
14389 (b"spine.c\0" as *const u8).cast::<c_char>(),
14390 7399 as c_int,
14391 )
14392 .cast::<c_float>();
14393 (*self_0).curvesCount = curveCount;
14394 }
14395 curves = (*self_0).curves;
14396 pathLength = 0 as c_int as c_float;
14397 x1 = *world.offset(0 as c_int as isize);
14398 y1 = *world.offset(1 as c_int as isize);
14399 cx1 = 0 as c_int as c_float;
14400 cy1 = 0 as c_int as c_float;
14401 cx2 = 0 as c_int as c_float;
14402 cy2 = 0 as c_int as c_float;
14403 x2 = 0 as c_int as c_float;
14404 y2 = 0 as c_int as c_float;
14405 i = 0 as c_int;
14406 w = 2 as c_int;
14407 while i < curveCount {
14408 cx1 = *world.offset(w as isize);
14409 cy1 = *world.offset((w + 1 as c_int) as isize);
14410 cx2 = *world.offset((w + 2 as c_int) as isize);
14411 cy2 = *world.offset((w + 3 as c_int) as isize);
14412 x2 = *world.offset((w + 4 as c_int) as isize);
14413 y2 = *world.offset((w + 5 as c_int) as isize);
14414 tmpx = (x1 - cx1 * 2 as c_int as c_float + cx2) * 0.1875f32;
14415 tmpy = (y1 - cy1 * 2 as c_int as c_float + cy2) * 0.1875f32;
14416 dddfx = ((cx1 - cx2) * 3 as c_int as c_float - x1 + x2) * 0.09375f32;
14417 dddfy = ((cy1 - cy2) * 3 as c_int as c_float - y1 + y2) * 0.09375f32;
14418 ddfx = tmpx * 2 as c_int as c_float + dddfx;
14419 ddfy = tmpy * 2 as c_int as c_float + dddfy;
14420 dfx = (cx1 - x1) * 0.75f32 + tmpx + dddfx * 0.16666667f32;
14421 dfy = (cy1 - y1) * 0.75f32 + tmpy + dddfy * 0.16666667f32;
14422 pathLength += spine_sqrtf(dfx * dfx + dfy * dfy);
14423 dfx += ddfx;
14424 dfy += ddfy;
14425 ddfx += dddfx;
14426 ddfy += dddfy;
14427 pathLength += spine_sqrtf(dfx * dfx + dfy * dfy);
14428 dfx += ddfx;
14429 dfy += ddfy;
14430 pathLength += spine_sqrtf(dfx * dfx + dfy * dfy);
14431 dfx += ddfx + dddfx;
14432 dfy += ddfy + dddfy;
14433 pathLength += spine_sqrtf(dfx * dfx + dfy * dfy);
14434 *curves.offset(i as isize) = pathLength;
14435 x1 = x2;
14436 y1 = y2;
14437 i += 1;
14438 w += 6 as c_int;
14439 }
14440 if (*(*self_0).data).positionMode as c_uint == SP_POSITION_MODE_PERCENT as c_int as c_uint {
14441 position *= pathLength;
14442 }
14443 match (*(*self_0).data).spacingMode as c_uint {
14444 2 => {
14445 multiplier = pathLength;
14446 }
14447 3 => {
14448 multiplier = pathLength / spacesCount as c_float;
14449 }
14450 _ => {
14451 multiplier = 1 as c_int as c_float;
14452 }
14453 }
14454 segments = ((*self_0).segments).as_mut_ptr();
14455 curveLength = 0 as c_int as c_float;
14456 let mut current_block_195: u64;
14457 i = 0 as c_int;
14458 o = 0 as c_int;
14459 curve = 0 as c_int;
14460 segment = 0 as c_int;
14461 while i < spacesCount {
14462 let mut space_0: c_float = *spaces.offset(i as isize) * multiplier;
14463 position += space_0;
14464 p = position;
14465 if closed != 0 {
14466 p = spine_fmodf(p, pathLength);
14467 if p < 0 as c_int as c_float {
14468 p += pathLength;
14469 }
14470 curve = 0 as c_int;
14471 current_block_195 = 15456862084301247793;
14472 } else if p < 0 as c_int as c_float {
14473 _addBeforePosition(p, world, 0 as c_int, out, o);
14474 current_block_195 = 5404178929002277151;
14475 } else if p > pathLength {
14476 _addAfterPosition(p - pathLength, world, verticesLength - 4 as c_int, out, o);
14477 current_block_195 = 5404178929002277151;
14478 } else {
14479 current_block_195 = 15456862084301247793;
14480 }
14481 match current_block_195 {
14482 15456862084301247793 => {
14483 loop {
14484 let mut length_0: c_float = *curves.offset(curve as isize);
14485 if p > length_0 {
14486 curve += 1;
14487 } else {
14488 if curve == 0 as c_int {
14489 p /= length_0;
14490 } else {
14491 let mut prev_0: c_float = *curves.offset((curve - 1 as c_int) as isize);
14492 p = (p - prev_0) / (length_0 - prev_0);
14493 }
14494 break;
14495 }
14496 }
14497 if curve != prevCurve {
14498 let mut ii: c_int = 0;
14499 prevCurve = curve;
14500 ii = curve * 6 as c_int;
14501 x1 = *world.offset(ii as isize);
14502 y1 = *world.offset((ii + 1 as c_int) as isize);
14503 cx1 = *world.offset((ii + 2 as c_int) as isize);
14504 cy1 = *world.offset((ii + 3 as c_int) as isize);
14505 cx2 = *world.offset((ii + 4 as c_int) as isize);
14506 cy2 = *world.offset((ii + 5 as c_int) as isize);
14507 x2 = *world.offset((ii + 6 as c_int) as isize);
14508 y2 = *world.offset((ii + 7 as c_int) as isize);
14509 tmpx = (x1 - cx1 * 2 as c_int as c_float + cx2) * 0.03f32;
14510 tmpy = (y1 - cy1 * 2 as c_int as c_float + cy2) * 0.03f32;
14511 dddfx = ((cx1 - cx2) * 3 as c_int as c_float - x1 + x2) * 0.006f32;
14512 dddfy = ((cy1 - cy2) * 3 as c_int as c_float - y1 + y2) * 0.006f32;
14513 ddfx = tmpx * 2 as c_int as c_float + dddfx;
14514 ddfy = tmpy * 2 as c_int as c_float + dddfy;
14515 dfx = (cx1 - x1) * 0.3f32 + tmpx + dddfx * 0.16666667f32;
14516 dfy = (cy1 - y1) * 0.3f32 + tmpy + dddfy * 0.16666667f32;
14517 curveLength = spine_sqrtf(dfx * dfx + dfy * dfy);
14518 *segments.offset(0 as c_int as isize) = curveLength;
14519 ii = 1 as c_int;
14520 while ii < 8 as c_int {
14521 dfx += ddfx;
14522 dfy += ddfy;
14523 ddfx += dddfx;
14524 ddfy += dddfy;
14525 curveLength += spine_sqrtf(dfx * dfx + dfy * dfy);
14526 *segments.offset(ii as isize) = curveLength;
14527 ii += 1;
14528 }
14529 dfx += ddfx;
14530 dfy += ddfy;
14531 curveLength += spine_sqrtf(dfx * dfx + dfy * dfy);
14532 *segments.offset(8 as c_int as isize) = curveLength;
14533 dfx += ddfx + dddfx;
14534 dfy += ddfy + dddfy;
14535 curveLength += spine_sqrtf(dfx * dfx + dfy * dfy);
14536 *segments.offset(9 as c_int as isize) = curveLength;
14537 segment = 0 as c_int;
14538 }
14539 p *= curveLength;
14540 loop {
14541 let mut length_1: c_float = *segments.offset(segment as isize);
14542 if p > length_1 {
14543 segment += 1;
14544 } else {
14545 if segment == 0 as c_int {
14546 p /= length_1;
14547 } else {
14548 let mut prev_1: c_float =
14549 *segments.offset((segment - 1 as c_int) as isize);
14550 p = segment as c_float + (p - prev_1) / (length_1 - prev_1);
14551 }
14552 break;
14553 }
14554 }
14555 _addCurvePosition(
14556 p * 0.1f32,
14557 x1,
14558 y1,
14559 cx1,
14560 cy1,
14561 cx2,
14562 cy2,
14563 x2,
14564 y2,
14565 out,
14566 o,
14567 (tangents != 0 || i > 0 as c_int && space_0 == 0 as c_int as c_float) as c_int,
14568 );
14569 }
14570 _ => {}
14571 }
14572 i += 1;
14573 o += 3 as c_int;
14574 }
14575 out
14576}
14577#[no_mangle]
14578pub unsafe extern "C" fn spPathConstraintData_create(
14579 mut name: *const c_char,
14580) -> *mut spPathConstraintData {
14581 let mut self_0: *mut spPathConstraintData = _spCalloc(
14582 1 as c_int as size_t,
14583 ::core::mem::size_of::<spPathConstraintData>() as c_ulong,
14584 (b"spine.c\0" as *const u8).cast::<c_char>(),
14585 7574 as c_int,
14586 )
14587 .cast::<spPathConstraintData>();
14588 (*self_0).name = _spMalloc(
14589 (::core::mem::size_of::<c_char>() as c_ulong)
14590 .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)),
14591 (b"spine.c\0" as *const u8).cast::<c_char>(),
14592 7575 as c_int,
14593 )
14594 .cast::<c_char>();
14595 spine_strcpy((*self_0).name, name);
14596 self_0
14597}
14598#[no_mangle]
14599pub unsafe extern "C" fn spPathConstraintData_dispose(mut self_0: *mut spPathConstraintData) {
14600 _spFree((*self_0).name.cast::<c_void>());
14601 _spFree((*self_0).bones.cast::<c_void>());
14602 _spFree(self_0.cast::<c_void>());
14603}
14604#[no_mangle]
14605pub unsafe extern "C" fn spPhysicsConstraint_create(
14606 mut data: *mut spPhysicsConstraintData,
14607 mut skeleton: *mut spSkeleton,
14608) -> *mut spPhysicsConstraint {
14609 let mut self_0: *mut spPhysicsConstraint = _spCalloc(
14610 1 as c_int as size_t,
14611 ::core::mem::size_of::<spPhysicsConstraint>() as c_ulong,
14612 (b"spine.c\0" as *const u8).cast::<c_char>(),
14613 7618 as c_int,
14614 )
14615 .cast::<spPhysicsConstraint>();
14616 (*self_0).data = data;
14617 (*self_0).skeleton = skeleton;
14618 (*self_0).bone = *((*skeleton).bones).offset((*(*data).bone).index as isize);
14619 (*self_0).inertia = (*data).inertia;
14620 (*self_0).strength = (*data).strength;
14621 (*self_0).damping = (*data).damping;
14622 (*self_0).massInverse = (*data).massInverse;
14623 (*self_0).wind = (*data).wind;
14624 (*self_0).gravity = (*data).gravity;
14625 (*self_0).mix = (*data).mix;
14626 (*self_0).reset = -(1 as c_int);
14627 (*self_0).ux = 0 as c_int as c_float;
14628 (*self_0).uy = 0 as c_int as c_float;
14629 (*self_0).cx = 0 as c_int as c_float;
14630 (*self_0).tx = 0 as c_int as c_float;
14631 (*self_0).ty = 0 as c_int as c_float;
14632 (*self_0).xOffset = 0 as c_int as c_float;
14633 (*self_0).xVelocity = 0 as c_int as c_float;
14634 (*self_0).yOffset = 0 as c_int as c_float;
14635 (*self_0).yVelocity = 0 as c_int as c_float;
14636 (*self_0).rotateOffset = 0 as c_int as c_float;
14637 (*self_0).rotateVelocity = 0 as c_int as c_float;
14638 (*self_0).scaleOffset = 0 as c_int as c_float;
14639 (*self_0).scaleVelocity = 0 as c_int as c_float;
14640 (*self_0).active = 0 as c_int;
14641 (*self_0).remaining = 0 as c_int as c_float;
14642 (*self_0).lastTime = 0 as c_int as c_float;
14643 self_0
14644}
14645#[no_mangle]
14646pub unsafe extern "C" fn spPhysicsConstraint_dispose(mut self_0: *mut spPhysicsConstraint) {
14647 _spFree(self_0.cast::<c_void>());
14648}
14649#[no_mangle]
14650pub unsafe extern "C" fn spPhysicsConstraint_reset(mut self_0: *mut spPhysicsConstraint) {
14651 (*self_0).remaining = 0 as c_int as c_float;
14652 (*self_0).lastTime = (*(*self_0).skeleton).time;
14653 (*self_0).reset = -(1 as c_int);
14654 (*self_0).xOffset = 0 as c_int as c_float;
14655 (*self_0).xVelocity = 0 as c_int as c_float;
14656 (*self_0).yOffset = 0 as c_int as c_float;
14657 (*self_0).yVelocity = 0 as c_int as c_float;
14658 (*self_0).rotateOffset = 0 as c_int as c_float;
14659 (*self_0).rotateVelocity = 0 as c_int as c_float;
14660 (*self_0).scaleOffset = 0 as c_int as c_float;
14661 (*self_0).scaleVelocity = 0 as c_int as c_float;
14662}
14663#[no_mangle]
14664pub unsafe extern "C" fn spPhysicsConstraint_setToSetupPose(mut self_0: *mut spPhysicsConstraint) {
14665 (*self_0).inertia = (*(*self_0).data).inertia;
14666 (*self_0).strength = (*(*self_0).data).strength;
14667 (*self_0).damping = (*(*self_0).data).damping;
14668 (*self_0).massInverse = (*(*self_0).data).massInverse;
14669 (*self_0).wind = (*(*self_0).data).wind;
14670 (*self_0).gravity = (*(*self_0).data).gravity;
14671 (*self_0).mix = (*(*self_0).data).mix;
14672}
14673#[no_mangle]
14674pub unsafe extern "C" fn spPhysicsConstraint_update(
14675 mut self_0: *mut spPhysicsConstraint,
14676 mut physics: spPhysics,
14677) {
14678 let mut mix: c_float = (*self_0).mix;
14679 if mix == 0 as c_int as c_float {
14680 return;
14681 }
14682 let mut x: c_int = ((*(*self_0).data).x > 0 as c_int as c_float) as c_int;
14683 let mut y: c_int = ((*(*self_0).data).y > 0 as c_int as c_float) as c_int;
14684 let mut rotateOrShearX: c_int = ((*(*self_0).data).rotate > 0 as c_int as c_float
14685 || (*(*self_0).data).shearX > 0 as c_int as c_float)
14686 as c_int;
14687 let mut scaleX: c_int = ((*(*self_0).data).scaleX > 0 as c_int as c_float) as c_int;
14688 let mut bone: *mut spBone = (*self_0).bone;
14689 let mut l: c_float = (*(*bone).data).length;
14690 let mut current_block_92: u64;
14691 match physics as c_uint {
14692 0 => return,
14693 1 => {
14694 spPhysicsConstraint_reset(self_0);
14695 current_block_92 = 2473556513754201174;
14696 }
14697 2 => {
14698 current_block_92 = 2473556513754201174;
14699 }
14700 3 => {
14701 if x != 0 {
14702 (*bone).worldX += (*self_0).xOffset * mix * (*(*self_0).data).x;
14703 }
14704 if y != 0 {
14705 (*bone).worldY += (*self_0).yOffset * mix * (*(*self_0).data).y;
14706 }
14707 current_block_92 = 5207889489643863322;
14708 }
14709 _ => {
14710 current_block_92 = 5207889489643863322;
14711 }
14712 }
14713 match current_block_92 {
14714 2473556513754201174 => {
14715 let mut delta: c_float = if (*(*self_0).skeleton).time - (*self_0).lastTime > 0.0f32 {
14716 (*(*self_0).skeleton).time - (*self_0).lastTime
14717 } else {
14718 0.0f32
14719 };
14720 (*self_0).remaining += delta;
14721 (*self_0).lastTime = (*(*self_0).skeleton).time;
14722 let mut bx: c_float = (*bone).worldX;
14723 let mut by: c_float = (*bone).worldY;
14724 if (*self_0).reset != 0 {
14725 (*self_0).reset = 0 as c_int;
14726 (*self_0).ux = bx;
14727 (*self_0).uy = by;
14728 } else {
14729 let mut a: c_float = (*self_0).remaining;
14730 let mut i: c_float = (*self_0).inertia;
14731 let mut q: c_float = (*(*self_0).data).limit * delta;
14732 let mut t: c_float = (*(*self_0).data).step;
14733 let mut f: c_float = (*(*(*self_0).skeleton).data).referenceScale;
14734 let mut d: c_float = -(1 as c_int) as c_float;
14735 if x != 0 || y != 0 {
14736 if x != 0 {
14737 let mut u: c_float = ((*self_0).ux - bx) * i;
14738 (*self_0).xOffset += if u > q {
14739 q
14740 } else if u < -q {
14741 -q
14742 } else {
14743 u
14744 };
14745 (*self_0).ux = bx;
14746 }
14747 if y != 0 {
14748 let mut u_0: c_float = ((*self_0).uy - by) * i;
14749 (*self_0).yOffset += if u_0 > q {
14750 q
14751 } else if u_0 < -q {
14752 -q
14753 } else {
14754 u_0
14755 };
14756 (*self_0).uy = by;
14757 }
14758 if a >= t {
14759 d = spine_pow(
14760 (*self_0).damping as c_double,
14761 (60 as c_int as c_float * t) as c_double,
14762 ) as c_float;
14763 let mut m: c_float = (*self_0).massInverse * t;
14764 let mut e: c_float = (*self_0).strength;
14765 let mut w: c_float = (*self_0).wind * f;
14766 let mut g: c_float = (*self_0).gravity
14767 * f
14768 * (if spBone_isYDown() != 0 {
14769 -(1 as c_int)
14770 } else {
14771 1 as c_int
14772 }) as c_float;
14773 loop {
14774 if x != 0 {
14775 (*self_0).xVelocity += (w - (*self_0).xOffset * e) * m;
14776 (*self_0).xOffset += (*self_0).xVelocity * t;
14777 (*self_0).xVelocity *= d;
14778 }
14779 if y != 0 {
14780 (*self_0).yVelocity -= (g + (*self_0).yOffset * e) * m;
14781 (*self_0).yOffset += (*self_0).yVelocity * t;
14782 (*self_0).yVelocity *= d;
14783 }
14784 a -= t;
14785 if !(a >= t) {
14786 break;
14787 }
14788 }
14789 }
14790 if x != 0 {
14791 (*bone).worldX += (*self_0).xOffset * mix * (*(*self_0).data).x;
14792 }
14793 if y != 0 {
14794 (*bone).worldY += (*self_0).yOffset * mix * (*(*self_0).data).y;
14795 }
14796 }
14797 if rotateOrShearX != 0 || scaleX != 0 {
14798 let mut ca: c_float = spine_atan2f((*bone).c, (*bone).a);
14799 let mut c: c_float = 0.;
14800 let mut s: c_float = 0.;
14801 let mut mr: c_float = 0 as c_int as c_float;
14802 let mut dx: c_float = (*self_0).cx - (*bone).worldX;
14803 let mut dy: c_float = (*self_0).cy - (*bone).worldY;
14804 if dx > q {
14805 dx = q;
14806 } else if dx < -q {
14807 dx = -q;
14808 }
14809 if dy > q {
14810 dy = q;
14811 } else if dy < -q {
14812 dy = -q;
14813 }
14814 if rotateOrShearX != 0 {
14815 mr = ((*(*self_0).data).rotate + (*(*self_0).data).shearX) * mix;
14816 let mut r: c_float = spine_atan2f(dy + (*self_0).ty, dx + (*self_0).tx)
14817 - ca
14818 - (*self_0).rotateOffset * mr;
14819 (*self_0).rotateOffset += (r - spine_ceil(
14820 (r * (1 as c_int as c_float
14821 / (3.141_592_7_f32 * 2 as c_int as c_float))
14822 - 0.5f32) as c_double,
14823 ) as c_float
14824 * (3.141_592_7_f32 * 2 as c_int as c_float))
14825 * i;
14826 r = (*self_0).rotateOffset * mr + ca;
14827 c = spine_cosf(r);
14828 s = spine_sinf(r);
14829 if scaleX != 0 {
14830 r = l * spBone_getWorldScaleX(bone);
14831 if r > 0 as c_int as c_float {
14832 (*self_0).scaleOffset += (dx * c + dy * s) * i / r;
14833 }
14834 }
14835 } else {
14836 c = spine_cosf(ca);
14837 s = spine_sinf(ca);
14838 let mut r_0: c_float = l * spBone_getWorldScaleX(bone);
14839 if r_0 > 0 as c_int as c_float {
14840 (*self_0).scaleOffset += (dx * c + dy * s) * i / r_0;
14841 }
14842 }
14843 a = (*self_0).remaining;
14844 if a >= t {
14845 if d == -(1 as c_int) as c_float {
14846 d = spine_pow(
14847 (*self_0).damping as c_double,
14848 (60 as c_int as c_float * t) as c_double,
14849 ) as c_float;
14850 }
14851 let mut m_0: c_float = (*self_0).massInverse * t;
14852 let mut e_0: c_float = (*self_0).strength;
14853 let mut w_0: c_float = (*self_0).wind;
14854 let mut g_0: c_float = (*self_0).gravity;
14855 let mut h: c_float = l / f;
14856 while -(1 as c_int) != 0 {
14857 a -= t;
14858 if scaleX != 0 {
14859 (*self_0).scaleVelocity +=
14860 (w_0 * c - g_0 * s - (*self_0).scaleOffset * e_0) * m_0;
14861 (*self_0).scaleOffset += (*self_0).scaleVelocity * t;
14862 (*self_0).scaleVelocity *= d;
14863 }
14864 if rotateOrShearX != 0 {
14865 (*self_0).rotateVelocity -=
14866 ((w_0 * s + g_0 * c) * h + (*self_0).rotateOffset * e_0) * m_0;
14867 (*self_0).rotateOffset += (*self_0).rotateVelocity * t;
14868 (*self_0).rotateVelocity *= d;
14869 if a < t {
14870 break;
14871 }
14872 let mut r_1: c_float = (*self_0).rotateOffset * mr + ca;
14873 c = spine_cosf(r_1);
14874 s = spine_sinf(r_1);
14875 } else if a < t {
14876 break;
14877 }
14878 }
14879 }
14880 }
14881 (*self_0).remaining = a;
14882 }
14883 (*self_0).cx = (*bone).worldX;
14884 (*self_0).cy = (*bone).worldY;
14885 }
14886 _ => {}
14887 }
14888 if rotateOrShearX != 0 {
14889 let mut o: c_float = (*self_0).rotateOffset * mix;
14890 let mut s_0: c_float = 0 as c_int as c_float;
14891 let mut c_0: c_float = 0 as c_int as c_float;
14892 let mut a_0: c_float = 0 as c_int as c_float;
14893 if (*(*self_0).data).shearX > 0 as c_int as c_float {
14894 let mut r_2: c_float = 0 as c_int as c_float;
14895 if (*(*self_0).data).rotate > 0 as c_int as c_float {
14896 r_2 = o * (*(*self_0).data).rotate;
14897 s_0 = spine_sinf(r_2);
14898 c_0 = spine_cosf(r_2);
14899 a_0 = (*bone).b;
14900 (*bone).b = c_0 * a_0 - s_0 * (*bone).d;
14901 (*bone).d = s_0 * a_0 + c_0 * (*bone).d;
14902 }
14903 r_2 += o * (*(*self_0).data).shearX;
14904 s_0 = spine_sinf(r_2);
14905 c_0 = spine_cosf(r_2);
14906 a_0 = (*bone).a;
14907 (*bone).a = c_0 * a_0 - s_0 * (*bone).c;
14908 (*bone).c = s_0 * a_0 + c_0 * (*bone).c;
14909 } else {
14910 o *= (*(*self_0).data).rotate;
14911 s_0 = spine_sinf(o);
14912 c_0 = spine_cosf(o);
14913 a_0 = (*bone).a;
14914 (*bone).a = c_0 * a_0 - s_0 * (*bone).c;
14915 (*bone).c = s_0 * a_0 + c_0 * (*bone).c;
14916 a_0 = (*bone).b;
14917 (*bone).b = c_0 * a_0 - s_0 * (*bone).d;
14918 (*bone).d = s_0 * a_0 + c_0 * (*bone).d;
14919 }
14920 }
14921 if scaleX != 0 {
14922 let mut s_1: c_float =
14923 1 as c_int as c_float + (*self_0).scaleOffset * mix * (*(*self_0).data).scaleX;
14924 (*bone).a *= s_1;
14925 (*bone).c *= s_1;
14926 }
14927 if physics as c_uint != SP_PHYSICS_POSE as c_int as c_uint {
14928 (*self_0).tx = l * (*bone).a;
14929 (*self_0).ty = l * (*bone).c;
14930 }
14931 spBone_updateAppliedTransform(bone);
14932}
14933#[no_mangle]
14934pub unsafe extern "C" fn spPhysicsConstraint_rotate(
14935 mut self_0: *mut spPhysicsConstraint,
14936 mut x: c_float,
14937 mut y: c_float,
14938 mut degrees: c_float,
14939) {
14940 let mut r: c_float = degrees * (3.141_592_7_f32 / 180 as c_int as c_float);
14941 let mut cosine: c_float = spine_cosf(r);
14942 let mut sine: c_float = spine_sinf(r);
14943 let mut dx: c_float = (*self_0).cx - x;
14944 let mut dy: c_float = (*self_0).cy - y;
14945 spPhysicsConstraint_translate(
14946 self_0,
14947 dx * cosine - dy * sine - dx,
14948 dx * sine + dy * cosine - dy,
14949 );
14950}
14951#[no_mangle]
14952pub unsafe extern "C" fn spPhysicsConstraint_translate(
14953 mut self_0: *mut spPhysicsConstraint,
14954 mut x: c_float,
14955 mut y: c_float,
14956) {
14957 (*self_0).ux -= x;
14958 (*self_0).uy -= y;
14959 (*self_0).cx -= x;
14960 (*self_0).cy -= y;
14961}
14962#[no_mangle]
14963pub unsafe extern "C" fn spPhysicsConstraintData_create(
14964 mut name: *const c_char,
14965) -> *mut spPhysicsConstraintData {
14966 let mut self_0: *mut spPhysicsConstraintData = _spCalloc(
14967 1 as c_int as size_t,
14968 ::core::mem::size_of::<spPhysicsConstraintData>() as c_ulong,
14969 (b"spine.c\0" as *const u8).cast::<c_char>(),
14970 7895 as c_int,
14971 )
14972 .cast::<spPhysicsConstraintData>();
14973 (*self_0).name = _spMalloc(
14974 (::core::mem::size_of::<c_char>() as c_ulong)
14975 .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)),
14976 (b"spine.c\0" as *const u8).cast::<c_char>(),
14977 7896 as c_int,
14978 )
14979 .cast::<c_char>();
14980 spine_strcpy((*self_0).name, name);
14981 (*self_0).bone = std::ptr::null_mut::<spBoneData>();
14982 (*self_0).x = 0 as c_int as c_float;
14983 (*self_0).y = 0 as c_int as c_float;
14984 (*self_0).rotate = 0 as c_int as c_float;
14985 (*self_0).scaleX = 0 as c_int as c_float;
14986 (*self_0).shearX = 0 as c_int as c_float;
14987 (*self_0).limit = 0 as c_int as c_float;
14988 (*self_0).step = 0 as c_int as c_float;
14989 (*self_0).inertia = 0 as c_int as c_float;
14990 (*self_0).strength = 0 as c_int as c_float;
14991 (*self_0).damping = 0 as c_int as c_float;
14992 (*self_0).massInverse = 0 as c_int as c_float;
14993 (*self_0).wind = 0 as c_int as c_float;
14994 (*self_0).gravity = 0 as c_int as c_float;
14995 (*self_0).mix = 0 as c_int as c_float;
14996 (*self_0).inertiaGlobal = 0 as c_int;
14997 (*self_0).strengthGlobal = 0 as c_int;
14998 (*self_0).dampingGlobal = 0 as c_int;
14999 (*self_0).massGlobal = 0 as c_int;
15000 (*self_0).windGlobal = 0 as c_int;
15001 (*self_0).gravityGlobal = 0 as c_int;
15002 (*self_0).mixGlobal = 0 as c_int;
15003 self_0
15004}
15005#[no_mangle]
15006pub unsafe extern "C" fn spPhysicsConstraintData_dispose(mut self_0: *mut spPhysicsConstraintData) {
15007 _spFree((*self_0).name.cast::<c_void>());
15008 _spFree(self_0.cast::<c_void>());
15009}
15010#[no_mangle]
15011pub unsafe extern "C" fn _spPointAttachment_dispose(mut attachment: *mut spAttachment) {
15012 let mut self_0: *mut spPointAttachment = attachment.cast::<spPointAttachment>();
15013 _spAttachment_deinit(attachment);
15014 _spFree(self_0.cast::<c_void>());
15015}
15016#[no_mangle]
15017pub unsafe extern "C" fn _spPointAttachment_copy(
15018 mut attachment: *mut spAttachment,
15019) -> *mut spAttachment {
15020 let mut self_0: *mut spPointAttachment = attachment.cast::<spPointAttachment>();
15021 let mut copy: *mut spPointAttachment = spPointAttachment_create((*attachment).name);
15022 (*copy).x = (*self_0).x;
15023 (*copy).y = (*self_0).y;
15024 (*copy).rotation = (*self_0).rotation;
15025 spColor_setFromColor(&mut (*copy).color, &mut (*self_0).color);
15026 &mut (*copy).super_0
15027}
15028#[no_mangle]
15029pub unsafe extern "C" fn spPointAttachment_create(
15030 mut name: *const c_char,
15031) -> *mut spPointAttachment {
15032 let mut self_0: *mut spPointAttachment = _spCalloc(
15033 1 as c_int as size_t,
15034 ::core::mem::size_of::<spPointAttachment>() as c_ulong,
15035 (b"spine.c\0" as *const u8).cast::<c_char>(),
15036 7975 as c_int,
15037 )
15038 .cast::<spPointAttachment>();
15039 _spAttachment_init(
15040 &mut (*self_0).super_0,
15041 name,
15042 SP_ATTACHMENT_POINT,
15043 Some(_spPointAttachment_dispose as unsafe extern "C" fn(*mut spAttachment) -> ()),
15044 Some(
15045 _spPointAttachment_copy as unsafe extern "C" fn(*mut spAttachment) -> *mut spAttachment,
15046 ),
15047 );
15048 self_0
15049}
15050#[no_mangle]
15051pub unsafe extern "C" fn spPointAttachment_computeWorldPosition(
15052 mut self_0: *mut spPointAttachment,
15053 mut bone: *mut spBone,
15054 mut x: *mut c_float,
15055 mut y: *mut c_float,
15056) {
15057 *x = (*self_0).x * (*bone).a + (*self_0).y * (*bone).b + (*bone).worldX;
15058 *y = (*self_0).x * (*bone).c + (*self_0).y * (*bone).d + (*bone).worldY;
15059}
15060#[no_mangle]
15061pub unsafe extern "C" fn spPointAttachment_computeWorldRotation(
15062 mut self_0: *mut spPointAttachment,
15063 mut bone: *mut spBone,
15064) -> c_float {
15065 let mut r: c_float = (*self_0).rotation * (3.141_592_7_f32 / 180 as c_int as c_float);
15066 let mut cosine: c_float = spine_cosf(r);
15067 let mut sine: c_float = spine_sinf(r);
15068 let mut x: c_float = cosine * (*bone).a + sine * (*bone).b;
15069 let mut y: c_float = cosine * (*bone).c + sine * (*bone).d;
15070 spine_atan2f(y, x) * (180 as c_int as c_float / 3.141_592_7_f32)
15071}
15072#[no_mangle]
15073pub unsafe extern "C" fn _spRegionAttachment_dispose(mut attachment: *mut spAttachment) {
15074 let mut self_0: *mut spRegionAttachment = attachment.cast::<spRegionAttachment>();
15075 if !((*self_0).sequence).is_null() {
15076 spSequence_dispose((*self_0).sequence);
15077 }
15078 _spAttachment_deinit(attachment);
15079 _spFree((*self_0).path.cast::<c_void>());
15080 _spFree(self_0.cast::<c_void>());
15081}
15082#[no_mangle]
15083pub unsafe extern "C" fn _spRegionAttachment_copy(
15084 mut attachment: *mut spAttachment,
15085) -> *mut spAttachment {
15086 let mut self_0: *mut spRegionAttachment = attachment.cast::<spRegionAttachment>();
15087 let mut copy: *mut spRegionAttachment = spRegionAttachment_create((*attachment).name);
15088 (*copy).region = (*self_0).region;
15089 (*copy).rendererObject = (*self_0).rendererObject;
15090 (*copy).path = _spMalloc(
15091 (::core::mem::size_of::<c_char>() as c_ulong)
15092 .wrapping_mul((spine_strlen((*self_0).path)).wrapping_add(1 as c_int as c_ulong)),
15093 (b"spine.c\0" as *const u8).cast::<c_char>(),
15094 8047 as c_int,
15095 )
15096 .cast::<c_char>();
15097 spine_strcpy((*copy).path, (*self_0).path);
15098 (*copy).x = (*self_0).x;
15099 (*copy).y = (*self_0).y;
15100 (*copy).scaleX = (*self_0).scaleX;
15101 (*copy).scaleY = (*self_0).scaleY;
15102 (*copy).rotation = (*self_0).rotation;
15103 (*copy).width = (*self_0).width;
15104 (*copy).height = (*self_0).height;
15105 spine_memcpy(
15106 ((*copy).uvs).as_mut_ptr().cast::<c_void>(),
15107 ((*self_0).uvs).as_mut_ptr() as *const c_void,
15108 (::core::mem::size_of::<c_float>() as c_ulong).wrapping_mul(8 as c_int as c_ulong),
15109 );
15110 spine_memcpy(
15111 ((*copy).offset).as_mut_ptr().cast::<c_void>(),
15112 ((*self_0).offset).as_mut_ptr() as *const c_void,
15113 (::core::mem::size_of::<c_float>() as c_ulong).wrapping_mul(8 as c_int as c_ulong),
15114 );
15115 spColor_setFromColor(&mut (*copy).color, &mut (*self_0).color);
15116 (*copy).sequence = if !((*self_0).sequence).is_null() {
15117 spSequence_copy((*self_0).sequence)
15118 } else {
15119 std::ptr::null_mut::<spSequence>()
15120 };
15121 &mut (*copy).super_0
15122}
15123#[no_mangle]
15124pub unsafe extern "C" fn spRegionAttachment_create(
15125 mut name: *const c_char,
15126) -> *mut spRegionAttachment {
15127 let mut self_0: *mut spRegionAttachment = _spCalloc(
15128 1 as c_int as size_t,
15129 ::core::mem::size_of::<spRegionAttachment>() as c_ulong,
15130 (b"spine.c\0" as *const u8).cast::<c_char>(),
15131 8063 as c_int,
15132 )
15133 .cast::<spRegionAttachment>();
15134 (*self_0).scaleX = 1 as c_int as c_float;
15135 (*self_0).scaleY = 1 as c_int as c_float;
15136 spColor_setFromFloats(
15137 &mut (*self_0).color,
15138 1 as c_int as c_float,
15139 1 as c_int as c_float,
15140 1 as c_int as c_float,
15141 1 as c_int as c_float,
15142 );
15143 _spAttachment_init(
15144 &mut (*self_0).super_0,
15145 name,
15146 SP_ATTACHMENT_REGION,
15147 Some(_spRegionAttachment_dispose as unsafe extern "C" fn(*mut spAttachment) -> ()),
15148 Some(
15149 _spRegionAttachment_copy
15150 as unsafe extern "C" fn(*mut spAttachment) -> *mut spAttachment,
15151 ),
15152 );
15153 self_0
15154}
15155#[no_mangle]
15156pub unsafe extern "C" fn spRegionAttachment_updateRegion(mut self_0: *mut spRegionAttachment) {
15157 let mut regionScaleX: c_float = 0.;
15158 let mut regionScaleY: c_float = 0.;
15159 let mut localX: c_float = 0.;
15160 let mut localY: c_float = 0.;
15161 let mut localX2: c_float = 0.;
15162 let mut localY2: c_float = 0.;
15163 let mut radians: c_float = 0.;
15164 let mut cosine: c_float = 0.;
15165 let mut sine: c_float = 0.;
15166 let mut localXCos: c_float = 0.;
15167 let mut localXSin: c_float = 0.;
15168 let mut localYCos: c_float = 0.;
15169 let mut localYSin: c_float = 0.;
15170 let mut localX2Cos: c_float = 0.;
15171 let mut localX2Sin: c_float = 0.;
15172 let mut localY2Cos: c_float = 0.;
15173 let mut localY2Sin: c_float = 0.;
15174 if ((*self_0).region).is_null() {
15175 (*self_0).uvs[0 as c_int as usize] = 0 as c_int as c_float;
15176 (*self_0).uvs[1 as c_int as usize] = 0 as c_int as c_float;
15177 (*self_0).uvs[2 as c_int as usize] = 1 as c_int as c_float;
15178 (*self_0).uvs[3 as c_int as usize] = 1 as c_int as c_float;
15179 (*self_0).uvs[4 as c_int as usize] = 1 as c_int as c_float;
15180 (*self_0).uvs[5 as c_int as usize] = 0 as c_int as c_float;
15181 (*self_0).uvs[6 as c_int as usize] = 0 as c_int as c_float;
15182 (*self_0).uvs[7 as c_int as usize] = 0 as c_int as c_float;
15183 return;
15184 }
15185 regionScaleX =
15186 (*self_0).width / (*(*self_0).region).originalWidth as c_float * (*self_0).scaleX;
15187 regionScaleY =
15188 (*self_0).height / (*(*self_0).region).originalHeight as c_float * (*self_0).scaleY;
15189 localX = -(*self_0).width / 2 as c_int as c_float * (*self_0).scaleX
15190 + (*(*self_0).region).offsetX * regionScaleX;
15191 localY = -(*self_0).height / 2 as c_int as c_float * (*self_0).scaleY
15192 + (*(*self_0).region).offsetY * regionScaleY;
15193 localX2 = localX + (*(*self_0).region).width as c_float * regionScaleX;
15194 localY2 = localY + (*(*self_0).region).height as c_float * regionScaleY;
15195 radians = (*self_0).rotation * (3.141_592_7_f32 / 180 as c_int as c_float);
15196 cosine = spine_cosf(radians);
15197 sine = spine_sinf(radians);
15198 localXCos = localX * cosine + (*self_0).x;
15199 localXSin = localX * sine;
15200 localYCos = localY * cosine + (*self_0).y;
15201 localYSin = localY * sine;
15202 localX2Cos = localX2 * cosine + (*self_0).x;
15203 localX2Sin = localX2 * sine;
15204 localY2Cos = localY2 * cosine + (*self_0).y;
15205 localY2Sin = localY2 * sine;
15206 (*self_0).offset[BLX as c_int as usize] = localXCos - localYSin;
15207 (*self_0).offset[BLY as c_int as usize] = localYCos + localXSin;
15208 (*self_0).offset[ULX as c_int as usize] = localXCos - localY2Sin;
15209 (*self_0).offset[ULY as c_int as usize] = localY2Cos + localXSin;
15210 (*self_0).offset[URX as c_int as usize] = localX2Cos - localY2Sin;
15211 (*self_0).offset[URY as c_int as usize] = localY2Cos + localX2Sin;
15212 (*self_0).offset[BRX as c_int as usize] = localX2Cos - localYSin;
15213 (*self_0).offset[BRY as c_int as usize] = localYCos + localX2Sin;
15214 if (*(*self_0).region).degrees == 90 as c_int {
15215 (*self_0).uvs[URX as c_int as usize] = (*(*self_0).region).u;
15216 (*self_0).uvs[URY as c_int as usize] = (*(*self_0).region).v2;
15217 (*self_0).uvs[BRX as c_int as usize] = (*(*self_0).region).u;
15218 (*self_0).uvs[BRY as c_int as usize] = (*(*self_0).region).v;
15219 (*self_0).uvs[BLX as c_int as usize] = (*(*self_0).region).u2;
15220 (*self_0).uvs[BLY as c_int as usize] = (*(*self_0).region).v;
15221 (*self_0).uvs[ULX as c_int as usize] = (*(*self_0).region).u2;
15222 (*self_0).uvs[ULY as c_int as usize] = (*(*self_0).region).v2;
15223 } else {
15224 (*self_0).uvs[ULX as c_int as usize] = (*(*self_0).region).u;
15225 (*self_0).uvs[ULY as c_int as usize] = (*(*self_0).region).v2;
15226 (*self_0).uvs[URX as c_int as usize] = (*(*self_0).region).u;
15227 (*self_0).uvs[URY as c_int as usize] = (*(*self_0).region).v;
15228 (*self_0).uvs[BRX as c_int as usize] = (*(*self_0).region).u2;
15229 (*self_0).uvs[BRY as c_int as usize] = (*(*self_0).region).v;
15230 (*self_0).uvs[BLX as c_int as usize] = (*(*self_0).region).u2;
15231 (*self_0).uvs[BLY as c_int as usize] = (*(*self_0).region).v2;
15232 };
15233}
15234#[no_mangle]
15235pub unsafe extern "C" fn spRegionAttachment_computeWorldVertices(
15236 mut self_0: *mut spRegionAttachment,
15237 mut slot: *mut spSlot,
15238 mut vertices: *mut c_float,
15239 mut offset: c_int,
15240 mut stride: c_int,
15241) {
15242 let mut offsets: *const c_float = ((*self_0).offset).as_mut_ptr();
15243 let mut bone: *mut spBone = (*slot).bone;
15244 let mut x: c_float = (*bone).worldX;
15245 let mut y: c_float = (*bone).worldY;
15246 let mut offsetX: c_float = 0.;
15247 let mut offsetY: c_float = 0.;
15248 if !((*self_0).sequence).is_null() {
15249 spSequence_apply((*self_0).sequence, slot, &mut (*self_0).super_0);
15250 }
15251 offsetX = *offsets.offset(BRX as c_int as isize);
15252 offsetY = *offsets.offset(BRY as c_int as isize);
15253 *vertices.offset(offset as isize) = offsetX * (*bone).a + offsetY * (*bone).b + x;
15254 *vertices.offset((offset + 1 as c_int) as isize) =
15255 offsetX * (*bone).c + offsetY * (*bone).d + y;
15256 offset += stride;
15257 offsetX = *offsets.offset(BLX as c_int as isize);
15258 offsetY = *offsets.offset(BLY as c_int as isize);
15259 *vertices.offset(offset as isize) = offsetX * (*bone).a + offsetY * (*bone).b + x;
15260 *vertices.offset((offset + 1 as c_int) as isize) =
15261 offsetX * (*bone).c + offsetY * (*bone).d + y;
15262 offset += stride;
15263 offsetX = *offsets.offset(ULX as c_int as isize);
15264 offsetY = *offsets.offset(ULY as c_int as isize);
15265 *vertices.offset(offset as isize) = offsetX * (*bone).a + offsetY * (*bone).b + x;
15266 *vertices.offset((offset + 1 as c_int) as isize) =
15267 offsetX * (*bone).c + offsetY * (*bone).d + y;
15268 offset += stride;
15269 offsetX = *offsets.offset(URX as c_int as isize);
15270 offsetY = *offsets.offset(URY as c_int as isize);
15271 *vertices.offset(offset as isize) = offsetX * (*bone).a + offsetY * (*bone).b + x;
15272 *vertices.offset((offset + 1 as c_int) as isize) =
15273 offsetX * (*bone).c + offsetY * (*bone).d + y;
15274}
15275#[no_mangle]
15276pub unsafe extern "C" fn spTextureRegionArray_create(
15277 mut initialCapacity: c_int,
15278) -> *mut spTextureRegionArray {
15279 let mut array: *mut spTextureRegionArray = _spCalloc(
15280 1 as c_int as size_t,
15281 ::core::mem::size_of::<spTextureRegionArray>() as c_ulong,
15282 (b"spine.c\0" as *const u8).cast::<c_char>(),
15283 8200 as c_int,
15284 )
15285 .cast::<spTextureRegionArray>();
15286 (*array).size = 0 as c_int;
15287 (*array).capacity = initialCapacity;
15288 (*array).items = _spCalloc(
15289 initialCapacity as size_t,
15290 ::core::mem::size_of::<*mut spTextureRegion>() as c_ulong,
15291 (b"spine.c\0" as *const u8).cast::<c_char>(),
15292 8200 as c_int,
15293 )
15294 .cast::<*mut spTextureRegion>();
15295 array
15296}
15297#[no_mangle]
15298pub unsafe extern "C" fn spTextureRegionArray_dispose(mut self_0: *mut spTextureRegionArray) {
15299 _spFree((*self_0).items.cast::<c_void>());
15300 _spFree(self_0.cast::<c_void>());
15301}
15302#[no_mangle]
15303pub unsafe extern "C" fn spTextureRegionArray_clear(mut self_0: *mut spTextureRegionArray) {
15304 (*self_0).size = 0 as c_int;
15305}
15306#[no_mangle]
15307pub unsafe extern "C" fn spTextureRegionArray_setSize(
15308 mut self_0: *mut spTextureRegionArray,
15309 mut newSize: c_int,
15310) -> *mut spTextureRegionArray {
15311 (*self_0).size = newSize;
15312 if (*self_0).capacity < newSize {
15313 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
15314 8 as c_int
15315 } else {
15316 ((*self_0).size as c_float * 1.75f32) as c_int
15317 };
15318 (*self_0).items = _spRealloc(
15319 (*self_0).items.cast::<c_void>(),
15320 (::core::mem::size_of::<*mut spTextureRegion>() as c_ulong)
15321 .wrapping_mul((*self_0).capacity as c_ulong),
15322 )
15323 .cast::<*mut spTextureRegion>();
15324 }
15325 self_0
15326}
15327#[no_mangle]
15328pub unsafe extern "C" fn spTextureRegionArray_ensureCapacity(
15329 mut self_0: *mut spTextureRegionArray,
15330 mut newCapacity: c_int,
15331) {
15332 if (*self_0).capacity >= newCapacity {
15333 return;
15334 }
15335 (*self_0).capacity = newCapacity;
15336 (*self_0).items = _spRealloc(
15337 (*self_0).items.cast::<c_void>(),
15338 (::core::mem::size_of::<*mut spTextureRegion>() as c_ulong)
15339 .wrapping_mul((*self_0).capacity as c_ulong),
15340 )
15341 .cast::<*mut spTextureRegion>();
15342}
15343#[no_mangle]
15344pub unsafe extern "C" fn spTextureRegionArray_add(
15345 mut self_0: *mut spTextureRegionArray,
15346 mut value: *mut spTextureRegion,
15347) {
15348 if (*self_0).size == (*self_0).capacity {
15349 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
15350 8 as c_int
15351 } else {
15352 ((*self_0).size as c_float * 1.75f32) as c_int
15353 };
15354 (*self_0).items = _spRealloc(
15355 (*self_0).items.cast::<c_void>(),
15356 (::core::mem::size_of::<*mut spTextureRegion>() as c_ulong)
15357 .wrapping_mul((*self_0).capacity as c_ulong),
15358 )
15359 .cast::<*mut spTextureRegion>();
15360 }
15361 let fresh52 = (*self_0).size;
15362 (*self_0).size += 1;
15363 let fresh53 = &mut (*((*self_0).items).offset(fresh52 as isize));
15364 *fresh53 = value;
15365}
15366#[no_mangle]
15367pub unsafe extern "C" fn spTextureRegionArray_addAll(
15368 mut self_0: *mut spTextureRegionArray,
15369 mut other: *mut spTextureRegionArray,
15370) {
15371 let mut i: c_int = 0 as c_int;
15372 while i < (*other).size {
15373 spTextureRegionArray_add(self_0, *((*other).items).offset(i as isize));
15374 i += 1;
15375 }
15376}
15377#[no_mangle]
15378pub unsafe extern "C" fn spTextureRegionArray_addAllValues(
15379 mut self_0: *mut spTextureRegionArray,
15380 mut values: *mut *mut spTextureRegion,
15381 mut offset: c_int,
15382 mut count: c_int,
15383) {
15384 let mut i: c_int = offset;
15385 let mut n: c_int = offset + count;
15386 while i < n {
15387 spTextureRegionArray_add(self_0, *values.offset(i as isize));
15388 i += 1;
15389 }
15390}
15391#[no_mangle]
15392pub unsafe extern "C" fn spTextureRegionArray_removeAt(
15393 mut self_0: *mut spTextureRegionArray,
15394 mut index: c_int,
15395) {
15396 (*self_0).size -= 1;
15397 spine_memmove(
15398 ((*self_0).items).offset(index as isize).cast::<c_void>(),
15399 ((*self_0).items)
15400 .offset(index as isize)
15401 .offset(1 as c_int as isize) as *const c_void,
15402 (::core::mem::size_of::<*mut spTextureRegion>() as c_ulong)
15403 .wrapping_mul(((*self_0).size - index) as c_ulong),
15404 );
15405}
15406#[no_mangle]
15407pub unsafe extern "C" fn spTextureRegionArray_contains(
15408 mut self_0: *mut spTextureRegionArray,
15409 mut value: *mut spTextureRegion,
15410) -> c_int {
15411 let mut items: *mut *mut spTextureRegion = (*self_0).items;
15412 let mut i: c_int = 0;
15413 let mut n: c_int = 0;
15414 i = 0 as c_int;
15415 n = (*self_0).size;
15416 while i < n {
15417 if *items.offset(i as isize) == value {
15418 return -(1 as c_int);
15419 }
15420 i += 1;
15421 }
15422 0 as c_int
15423}
15424#[no_mangle]
15425pub unsafe extern "C" fn spTextureRegionArray_pop(
15426 mut self_0: *mut spTextureRegionArray,
15427) -> *mut spTextureRegion {
15428 (*self_0).size -= 1;
15429 let mut item: *mut spTextureRegion = *((*self_0).items).offset((*self_0).size as isize);
15430 item
15431}
15432#[no_mangle]
15433pub unsafe extern "C" fn spTextureRegionArray_peek(
15434 mut self_0: *mut spTextureRegionArray,
15435) -> *mut spTextureRegion {
15436 *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize)
15437}
15438static mut nextSequenceId: c_int = 0 as c_int;
15439#[no_mangle]
15440pub unsafe extern "C" fn spSequence_create(mut numRegions: c_int) -> *mut spSequence {
15441 let mut self_0: *mut spSequence = _spCalloc(
15442 1 as c_int as size_t,
15443 ::core::mem::size_of::<spSequence>() as c_ulong,
15444 (b"spine.c\0" as *const u8).cast::<c_char>(),
15445 8205 as c_int,
15446 )
15447 .cast::<spSequence>();
15448 let fresh54 = nextSequenceId;
15449 nextSequenceId += 1;
15450 (*self_0).id = fresh54;
15451 (*self_0).regions = spTextureRegionArray_create(numRegions);
15452 spTextureRegionArray_setSize((*self_0).regions, numRegions);
15453 self_0
15454}
15455#[no_mangle]
15456pub unsafe extern "C" fn spSequence_dispose(mut self_0: *mut spSequence) {
15457 _spFree((*self_0).regions.cast::<c_void>());
15458 _spFree(self_0.cast::<c_void>());
15459}
15460#[no_mangle]
15461pub unsafe extern "C" fn spSequence_copy(mut self_0: *mut spSequence) -> *mut spSequence {
15462 let mut i: c_int = 0 as c_int;
15463 let mut copy: *mut spSequence = spSequence_create((*(*self_0).regions).size);
15464 while i < (*(*self_0).regions).size {
15465 let fresh55 = &mut (*((*(*copy).regions).items).offset(i as isize));
15466 *fresh55 = *((*(*self_0).regions).items).offset(i as isize);
15467 i += 1;
15468 }
15469 (*copy).start = (*self_0).start;
15470 (*copy).digits = (*self_0).digits;
15471 (*copy).setupIndex = (*self_0).setupIndex;
15472 copy
15473}
15474#[no_mangle]
15475pub unsafe extern "C" fn spSequence_apply(
15476 mut self_0: *mut spSequence,
15477 mut slot: *mut spSlot,
15478 mut attachment: *mut spAttachment,
15479) {
15480 let mut index: c_int = (*slot).sequenceIndex;
15481 let mut region: *mut spTextureRegion = std::ptr::null_mut::<spTextureRegion>();
15482 if index == -(1 as c_int) {
15483 index = (*self_0).setupIndex;
15484 }
15485 if index >= (*(*self_0).regions).size {
15486 index = (*(*self_0).regions).size - 1 as c_int;
15487 }
15488 region = *((*(*self_0).regions).items).offset(index as isize);
15489 if (*attachment).type_0 as c_uint == SP_ATTACHMENT_REGION as c_int as c_uint {
15490 let mut regionAttachment: *mut spRegionAttachment = attachment.cast::<spRegionAttachment>();
15491 if (*regionAttachment).region != region {
15492 (*regionAttachment).rendererObject = region.cast::<c_void>();
15493 (*regionAttachment).region = region;
15494 spRegionAttachment_updateRegion(regionAttachment);
15495 }
15496 }
15497 if (*attachment).type_0 as c_uint == SP_ATTACHMENT_MESH as c_int as c_uint {
15498 let mut meshAttachment: *mut spMeshAttachment = attachment.cast::<spMeshAttachment>();
15499 if (*meshAttachment).region != region {
15500 (*meshAttachment).rendererObject = region.cast::<c_void>();
15501 (*meshAttachment).region = region;
15502 spMeshAttachment_updateRegion(meshAttachment);
15503 }
15504 }
15505}
15506unsafe extern "C" fn num_digits(mut value: c_int) -> c_int {
15507 let mut count: c_int = if value < 0 as c_int {
15508 1 as c_int
15509 } else {
15510 0 as c_int
15511 };
15512 loop {
15513 value /= 10 as c_int;
15514 count += 1;
15515 if value == 0 as c_int {
15516 break;
15517 }
15518 }
15519 count
15520}
15521unsafe extern "C" fn string_append(mut str: *mut c_char, mut b: *const c_char) -> *mut c_char {
15522 let mut lenB: c_int = spine_strlen(b) as c_int;
15523 spine_memcpy(
15524 str.cast::<c_void>(),
15525 b.cast::<c_void>(),
15526 (lenB + 1 as c_int) as size_t,
15527 );
15528 str.offset(lenB as isize)
15529}
15530unsafe extern "C" fn string_append_int(mut str: *mut c_char, mut value: c_int) -> *mut c_char {
15531 let mut intStr: [c_char; 20] = [0; 20];
15532 spine_snprintf!(
15533 intStr.as_mut_ptr(),
15534 20 as c_int as size_t,
15535 (b"%i\0" as *const u8).cast::<c_char>(),
15536 value,
15537 );
15538 string_append(str, intStr.as_mut_ptr())
15539}
15540#[no_mangle]
15541pub unsafe extern "C" fn spSequence_getPath(
15542 mut self_0: *mut spSequence,
15543 mut basePath: *const c_char,
15544 mut index: c_int,
15545 mut path: *mut c_char,
15546) {
15547 let mut i: c_int = 0;
15548 path = string_append(path, basePath);
15549 i = (*self_0).digits - num_digits((*self_0).start + index);
15550 while i > 0 as c_int {
15551 path = string_append(path, (b"0\0" as *const u8).cast::<c_char>());
15552 i -= 1;
15553 }
15554 path = string_append_int(path, (*self_0).start + index);
15555}
15556#[no_mangle]
15557pub unsafe extern "C" fn spSkeleton_create(mut data: *mut spSkeletonData) -> *mut spSkeleton {
15558 let mut i: c_int = 0;
15559 let mut childrenCounts: *mut c_int = std::ptr::null_mut::<c_int>();
15560 let mut internal: *mut _spSkeleton = _spCalloc(
15561 1 as c_int as size_t,
15562 ::core::mem::size_of::<_spSkeleton>() as c_ulong,
15563 (b"spine.c\0" as *const u8).cast::<c_char>(),
15564 8341 as c_int,
15565 )
15566 .cast::<_spSkeleton>();
15567 let mut self_0: *mut spSkeleton = &mut (*internal).super_0;
15568 (*self_0).data = data;
15569 (*self_0).skin = std::ptr::null_mut::<spSkin>();
15570 spColor_setFromFloats(
15571 &mut (*self_0).color,
15572 1 as c_int as c_float,
15573 1 as c_int as c_float,
15574 1 as c_int as c_float,
15575 1 as c_int as c_float,
15576 );
15577 (*self_0).scaleX = 1 as c_int as c_float;
15578 (*self_0).scaleY = 1 as c_int as c_float;
15579 (*self_0).time = 0 as c_int as c_float;
15580 (*self_0).bonesCount = (*(*self_0).data).bonesCount;
15581 (*self_0).bones = _spMalloc(
15582 (::core::mem::size_of::<*mut spBone>() as c_ulong)
15583 .wrapping_mul((*self_0).bonesCount as c_ulong),
15584 (b"spine.c\0" as *const u8).cast::<c_char>(),
15585 8351 as c_int,
15586 )
15587 .cast::<*mut spBone>();
15588 childrenCounts = _spCalloc(
15589 (*self_0).bonesCount as size_t,
15590 ::core::mem::size_of::<c_int>() as c_ulong,
15591 (b"spine.c\0" as *const u8).cast::<c_char>(),
15592 8352 as c_int,
15593 )
15594 .cast::<c_int>();
15595 i = 0 as c_int;
15596 while i < (*self_0).bonesCount {
15597 let mut boneData: *mut spBoneData = *((*(*self_0).data).bones).offset(i as isize);
15598 let mut newBone: *mut spBone = std::ptr::null_mut::<spBone>();
15599 if ((*boneData).parent).is_null() {
15600 newBone = spBone_create(boneData, self_0, std::ptr::null_mut::<spBone>());
15601 } else {
15602 let mut parent: *mut spBone =
15603 *((*self_0).bones).offset((*(*boneData).parent).index as isize);
15604 newBone = spBone_create(boneData, self_0, parent);
15605 let fresh56 = &mut (*childrenCounts.offset((*(*boneData).parent).index as isize));
15606 *fresh56 += 1;
15607 }
15608 let fresh57 = &mut (*((*self_0).bones).offset(i as isize));
15609 *fresh57 = newBone;
15610 i += 1;
15611 }
15612 i = 0 as c_int;
15613 while i < (*self_0).bonesCount {
15614 let mut boneData_0: *mut spBoneData = *((*(*self_0).data).bones).offset(i as isize);
15615 let mut bone: *mut spBone = *((*self_0).bones).offset(i as isize);
15616 (*bone).children = _spMalloc(
15617 (::core::mem::size_of::<*mut spBone>() as c_ulong)
15618 .wrapping_mul(*childrenCounts.offset((*boneData_0).index as isize) as c_ulong),
15619 (b"spine.c\0" as *const u8).cast::<c_char>(),
15620 8369 as c_int,
15621 )
15622 .cast::<*mut spBone>();
15623 i += 1;
15624 }
15625 i = 0 as c_int;
15626 while i < (*self_0).bonesCount {
15627 let mut bone_0: *mut spBone = *((*self_0).bones).offset(i as isize);
15628 let mut parent_0: *mut spBone = (*bone_0).parent;
15629 if !parent_0.is_null() {
15630 let fresh58 = (*parent_0).childrenCount;
15631 (*parent_0).childrenCount += 1;
15632 let fresh59 = &mut (*((*parent_0).children).offset(fresh58 as isize));
15633 *fresh59 = bone_0;
15634 }
15635 i += 1;
15636 }
15637 (*self_0).root = if (*self_0).bonesCount > 0 as c_int {
15638 *((*self_0).bones).offset(0 as c_int as isize)
15639 } else {
15640 std::ptr::null_mut::<spBone>()
15641 };
15642 (*self_0).slotsCount = (*data).slotsCount;
15643 (*self_0).slots = _spMalloc(
15644 (::core::mem::size_of::<*mut spSlot>() as c_ulong)
15645 .wrapping_mul((*self_0).slotsCount as c_ulong),
15646 (b"spine.c\0" as *const u8).cast::<c_char>(),
15647 8380 as c_int,
15648 )
15649 .cast::<*mut spSlot>();
15650 i = 0 as c_int;
15651 while i < (*self_0).slotsCount {
15652 let mut slotData: *mut spSlotData = *((*data).slots).offset(i as isize);
15653 let mut bone_1: *mut spBone =
15654 *((*self_0).bones).offset((*(*slotData).boneData).index as isize);
15655 let fresh60 = &mut (*((*self_0).slots).offset(i as isize));
15656 *fresh60 = spSlot_create(slotData, bone_1);
15657 i += 1;
15658 }
15659 (*self_0).drawOrder = _spMalloc(
15660 (::core::mem::size_of::<*mut spSlot>() as c_ulong)
15661 .wrapping_mul((*self_0).slotsCount as c_ulong),
15662 (b"spine.c\0" as *const u8).cast::<c_char>(),
15663 8387 as c_int,
15664 )
15665 .cast::<*mut spSlot>();
15666 spine_memcpy(
15667 (*self_0).drawOrder.cast::<c_void>(),
15668 (*self_0).slots as *const c_void,
15669 (::core::mem::size_of::<*mut spSlot>() as c_ulong)
15670 .wrapping_mul((*self_0).slotsCount as c_ulong),
15671 );
15672 (*self_0).ikConstraintsCount = (*data).ikConstraintsCount;
15673 (*self_0).ikConstraints = _spMalloc(
15674 (::core::mem::size_of::<*mut spIkConstraint>() as c_ulong)
15675 .wrapping_mul((*self_0).ikConstraintsCount as c_ulong),
15676 (b"spine.c\0" as *const u8).cast::<c_char>(),
15677 8391 as c_int,
15678 )
15679 .cast::<*mut spIkConstraint>();
15680 i = 0 as c_int;
15681 while i < (*(*self_0).data).ikConstraintsCount {
15682 let fresh61 = &mut (*((*self_0).ikConstraints).offset(i as isize));
15683 *fresh61 = spIkConstraint_create(
15684 *((*(*self_0).data).ikConstraints).offset(i as isize),
15685 self_0,
15686 );
15687 i += 1;
15688 }
15689 (*self_0).transformConstraintsCount = (*data).transformConstraintsCount;
15690 (*self_0).transformConstraints = _spMalloc(
15691 (::core::mem::size_of::<*mut spTransformConstraint>() as c_ulong)
15692 .wrapping_mul((*self_0).transformConstraintsCount as c_ulong),
15693 (b"spine.c\0" as *const u8).cast::<c_char>(),
15694 8396 as c_int,
15695 )
15696 .cast::<*mut spTransformConstraint>();
15697 i = 0 as c_int;
15698 while i < (*(*self_0).data).transformConstraintsCount {
15699 let fresh62 = &mut (*((*self_0).transformConstraints).offset(i as isize));
15700 *fresh62 = spTransformConstraint_create(
15701 *((*(*self_0).data).transformConstraints).offset(i as isize),
15702 self_0,
15703 );
15704 i += 1;
15705 }
15706 (*self_0).pathConstraintsCount = (*data).pathConstraintsCount;
15707 (*self_0).pathConstraints = _spMalloc(
15708 (::core::mem::size_of::<*mut spPathConstraint>() as c_ulong)
15709 .wrapping_mul((*self_0).pathConstraintsCount as c_ulong),
15710 (b"spine.c\0" as *const u8).cast::<c_char>(),
15711 8401 as c_int,
15712 )
15713 .cast::<*mut spPathConstraint>();
15714 i = 0 as c_int;
15715 while i < (*(*self_0).data).pathConstraintsCount {
15716 let fresh63 = &mut (*((*self_0).pathConstraints).offset(i as isize));
15717 *fresh63 = spPathConstraint_create(
15718 *((*(*self_0).data).pathConstraints).offset(i as isize),
15719 self_0,
15720 );
15721 i += 1;
15722 }
15723 (*self_0).physicsConstraintsCount = (*data).physicsConstraintsCount;
15724 (*self_0).physicsConstraints = _spMalloc(
15725 (::core::mem::size_of::<*mut spPhysicsConstraint>() as c_ulong)
15726 .wrapping_mul((*self_0).physicsConstraintsCount as c_ulong),
15727 (b"spine.c\0" as *const u8).cast::<c_char>(),
15728 8406 as c_int,
15729 )
15730 .cast::<*mut spPhysicsConstraint>();
15731 i = 0 as c_int;
15732 while i < (*(*self_0).data).physicsConstraintsCount {
15733 let fresh64 = &mut (*((*self_0).physicsConstraints).offset(i as isize));
15734 *fresh64 = spPhysicsConstraint_create(
15735 *((*(*self_0).data).physicsConstraints).offset(i as isize),
15736 self_0,
15737 );
15738 i += 1;
15739 }
15740 spColor_setFromFloats(
15741 &mut (*self_0).color,
15742 1 as c_int as c_float,
15743 1 as c_int as c_float,
15744 1 as c_int as c_float,
15745 1 as c_int as c_float,
15746 );
15747 (*self_0).scaleX = 1 as c_int as c_float;
15748 (*self_0).scaleY = 1 as c_int as c_float;
15749 (*self_0).time = 0 as c_int as c_float;
15750 spSkeleton_updateCache(self_0);
15751 _spFree(childrenCounts.cast::<c_void>());
15752 self_0
15753}
15754#[no_mangle]
15755pub unsafe extern "C" fn spSkeleton_dispose(mut self_0: *mut spSkeleton) {
15756 let mut i: c_int = 0;
15757 let mut internal: *mut _spSkeleton = self_0.cast::<_spSkeleton>();
15758 _spFree((*internal).updateCache.cast::<c_void>());
15759 i = 0 as c_int;
15760 while i < (*self_0).bonesCount {
15761 spBone_dispose(*((*self_0).bones).offset(i as isize));
15762 i += 1;
15763 }
15764 _spFree((*self_0).bones.cast::<c_void>());
15765 i = 0 as c_int;
15766 while i < (*self_0).slotsCount {
15767 spSlot_dispose(*((*self_0).slots).offset(i as isize));
15768 i += 1;
15769 }
15770 _spFree((*self_0).slots.cast::<c_void>());
15771 i = 0 as c_int;
15772 while i < (*self_0).ikConstraintsCount {
15773 spIkConstraint_dispose(*((*self_0).ikConstraints).offset(i as isize));
15774 i += 1;
15775 }
15776 _spFree((*self_0).ikConstraints.cast::<c_void>());
15777 i = 0 as c_int;
15778 while i < (*self_0).transformConstraintsCount {
15779 spTransformConstraint_dispose(*((*self_0).transformConstraints).offset(i as isize));
15780 i += 1;
15781 }
15782 _spFree((*self_0).transformConstraints.cast::<c_void>());
15783 i = 0 as c_int;
15784 while i < (*self_0).pathConstraintsCount {
15785 spPathConstraint_dispose(*((*self_0).pathConstraints).offset(i as isize));
15786 i += 1;
15787 }
15788 _spFree((*self_0).pathConstraints.cast::<c_void>());
15789 i = 0 as c_int;
15790 while i < (*self_0).physicsConstraintsCount {
15791 spPhysicsConstraint_dispose(*((*self_0).physicsConstraints).offset(i as isize));
15792 i += 1;
15793 }
15794 _spFree((*self_0).physicsConstraints.cast::<c_void>());
15795 _spFree((*self_0).drawOrder.cast::<c_void>());
15796 _spFree(self_0.cast::<c_void>());
15797}
15798unsafe extern "C" fn _addToUpdateCache(
15799 internal: *mut _spSkeleton,
15800 mut type_0: _spUpdateType,
15801 mut object: *mut c_void,
15802) {
15803 let mut update: *mut _spUpdate = std::ptr::null_mut::<_spUpdate>();
15804 if (*internal).updateCacheCount == (*internal).updateCacheCapacity {
15805 (*internal).updateCacheCapacity *= 2 as c_int;
15806 (*internal).updateCache = _spRealloc(
15807 (*internal).updateCache.cast::<c_void>(),
15808 (::core::mem::size_of::<_spUpdate>() as c_ulong)
15809 .wrapping_mul((*internal).updateCacheCapacity as c_ulong),
15810 )
15811 .cast::<_spUpdate>();
15812 }
15813 update = ((*internal).updateCache).offset((*internal).updateCacheCount as isize);
15814 (*update).type_0 = type_0;
15815 (*update).object = object;
15816 (*internal).updateCacheCount += 1;
15817}
15818unsafe extern "C" fn _sortBone(internal: *mut _spSkeleton, mut bone: *mut spBone) {
15819 if (*bone).sorted != 0 {
15820 return;
15821 }
15822 if !((*bone).parent).is_null() {
15823 _sortBone(internal, (*bone).parent);
15824 }
15825 (*bone).sorted = 1 as c_int;
15826 _addToUpdateCache(internal, SP_UPDATE_BONE, bone.cast::<c_void>());
15827}
15828unsafe extern "C" fn _sortPathConstraintAttachmentBones(
15829 internal: *mut _spSkeleton,
15830 mut attachment: *mut spAttachment,
15831 mut slotBone: *mut spBone,
15832) {
15833 let mut pathAttachment: *mut spPathAttachment = attachment.cast::<spPathAttachment>();
15834 let mut pathBones: *mut c_int = std::ptr::null_mut::<c_int>();
15835 let mut pathBonesCount: c_int = 0;
15836 if (*pathAttachment).super_0.super_0.type_0 as c_uint != SP_ATTACHMENT_PATH as c_int as c_uint {
15837 return;
15838 }
15839 pathBones = (*pathAttachment).super_0.bones;
15840 pathBonesCount = (*pathAttachment).super_0.bonesCount;
15841 if pathBones.is_null() {
15842 _sortBone(internal, slotBone);
15843 } else {
15844 let mut bones: *mut *mut spBone = (*internal).super_0.bones;
15845 let mut i: c_int = 0 as c_int;
15846 let mut n: c_int = 0;
15847 i = 0 as c_int;
15848 n = pathBonesCount;
15849 while i < n {
15850 let fresh65 = i;
15851 i += 1;
15852 let mut nn: c_int = *pathBones.offset(fresh65 as isize);
15853 nn += i;
15854 while i < nn {
15855 let fresh66 = i;
15856 i += 1;
15857 _sortBone(
15858 internal,
15859 *bones.offset(*pathBones.offset(fresh66 as isize) as isize),
15860 );
15861 }
15862 }
15863 };
15864}
15865unsafe extern "C" fn _sortPathConstraintAttachment(
15866 internal: *mut _spSkeleton,
15867 mut skin: *mut spSkin,
15868 mut slotIndex: c_int,
15869 mut slotBone: *mut spBone,
15870) {
15871 let mut entry: *mut _Entry = (*skin.cast::<_spSkin>()).entries;
15872 while !entry.is_null() {
15873 if (*entry).slotIndex == slotIndex {
15874 _sortPathConstraintAttachmentBones(internal, (*entry).attachment, slotBone);
15875 }
15876 entry = (*entry).next;
15877 }
15878}
15879unsafe extern "C" fn _sortReset(mut bones: *mut *mut spBone, mut bonesCount: c_int) {
15880 let mut i: c_int = 0;
15881 i = 0 as c_int;
15882 while i < bonesCount {
15883 let mut bone: *mut spBone = *bones.offset(i as isize);
15884 if (*bone).active != 0 {
15885 if (*bone).sorted != 0 {
15886 _sortReset((*bone).children, (*bone).childrenCount);
15887 }
15888 (*bone).sorted = 0 as c_int;
15889 }
15890 i += 1;
15891 }
15892}
15893unsafe extern "C" fn _sortIkConstraint(
15894 internal: *mut _spSkeleton,
15895 mut constraint: *mut spIkConstraint,
15896) {
15897 let mut target: *mut spBone = (*constraint).target;
15898 let mut constrained: *mut *mut spBone = std::ptr::null_mut::<*mut spBone>();
15899 let mut parent: *mut spBone = std::ptr::null_mut::<spBone>();
15900 (*constraint).active = ((*(*constraint).target).active != 0
15901 && ((*(*constraint).data).skinRequired == 0
15902 || !((*internal).super_0.skin).is_null()
15903 && spIkConstraintDataArray_contains(
15904 (*(*internal).super_0.skin).ikConstraints,
15905 (*constraint).data,
15906 ) != 0)) as c_int;
15907 if (*constraint).active == 0 {
15908 return;
15909 }
15910 _sortBone(internal, target);
15911 constrained = (*constraint).bones;
15912 parent = *constrained.offset(0 as c_int as isize);
15913 _sortBone(internal, parent);
15914 if (*constraint).bonesCount == 1 as c_int {
15915 _addToUpdateCache(
15916 internal,
15917 SP_UPDATE_IK_CONSTRAINT,
15918 constraint.cast::<c_void>(),
15919 );
15920 _sortReset((*parent).children, (*parent).childrenCount);
15921 } else {
15922 let mut child: *mut spBone =
15923 *constrained.offset(((*constraint).bonesCount - 1 as c_int) as isize);
15924 _sortBone(internal, child);
15925 _addToUpdateCache(
15926 internal,
15927 SP_UPDATE_IK_CONSTRAINT,
15928 constraint.cast::<c_void>(),
15929 );
15930 _sortReset((*parent).children, (*parent).childrenCount);
15931 (*child).sorted = 1 as c_int;
15932 };
15933}
15934unsafe extern "C" fn _sortPathConstraint(
15935 internal: *mut _spSkeleton,
15936 mut constraint: *mut spPathConstraint,
15937) {
15938 let mut slot: *mut spSlot = (*constraint).target;
15939 let mut slotIndex: c_int = (*(*slot).data).index;
15940 let mut slotBone: *mut spBone = (*slot).bone;
15941 let mut i: c_int = 0;
15942 let mut n: c_int = 0;
15943 let mut boneCount: c_int = 0;
15944 let mut attachment: *mut spAttachment = std::ptr::null_mut::<spAttachment>();
15945 let mut constrained: *mut *mut spBone = std::ptr::null_mut::<*mut spBone>();
15946 let mut skeleton: *mut spSkeleton = internal.cast::<spSkeleton>();
15947 (*constraint).active = ((*(*(*constraint).target).bone).active != 0
15948 && ((*(*constraint).data).skinRequired == 0
15949 || !((*internal).super_0.skin).is_null()
15950 && spPathConstraintDataArray_contains(
15951 (*(*internal).super_0.skin).pathConstraints,
15952 (*constraint).data,
15953 ) != 0)) as c_int;
15954 if (*constraint).active == 0 {
15955 return;
15956 }
15957 if !((*skeleton).skin).is_null() {
15958 _sortPathConstraintAttachment(internal, (*skeleton).skin, slotIndex, slotBone);
15959 }
15960 if !((*(*skeleton).data).defaultSkin).is_null()
15961 && (*(*skeleton).data).defaultSkin != (*skeleton).skin
15962 {
15963 _sortPathConstraintAttachment(
15964 internal,
15965 (*(*skeleton).data).defaultSkin,
15966 slotIndex,
15967 slotBone,
15968 );
15969 }
15970 i = 0 as c_int;
15971 n = (*(*skeleton).data).skinsCount;
15972 while i < n {
15973 _sortPathConstraintAttachment(
15974 internal,
15975 *((*(*skeleton).data).skins).offset(i as isize),
15976 slotIndex,
15977 slotBone,
15978 );
15979 i += 1;
15980 }
15981 attachment = (*slot).attachment;
15982 if !attachment.is_null()
15983 && (*attachment).type_0 as c_uint == SP_ATTACHMENT_PATH as c_int as c_uint
15984 {
15985 _sortPathConstraintAttachmentBones(internal, attachment, slotBone);
15986 }
15987 constrained = (*constraint).bones;
15988 boneCount = (*constraint).bonesCount;
15989 i = 0 as c_int;
15990 while i < boneCount {
15991 _sortBone(internal, *constrained.offset(i as isize));
15992 i += 1;
15993 }
15994 _addToUpdateCache(
15995 internal,
15996 SP_UPDATE_PATH_CONSTRAINT,
15997 constraint.cast::<c_void>(),
15998 );
15999 i = 0 as c_int;
16000 while i < boneCount {
16001 _sortReset(
16002 (**constrained.offset(i as isize)).children,
16003 (**constrained.offset(i as isize)).childrenCount,
16004 );
16005 i += 1;
16006 }
16007 i = 0 as c_int;
16008 while i < boneCount {
16009 (**constrained.offset(i as isize)).sorted = 1 as c_int;
16010 i += 1;
16011 }
16012}
16013unsafe extern "C" fn _sortTransformConstraint(
16014 internal: *mut _spSkeleton,
16015 mut constraint: *mut spTransformConstraint,
16016) {
16017 let mut i: c_int = 0;
16018 let mut boneCount: c_int = 0;
16019 let mut constrained: *mut *mut spBone = std::ptr::null_mut::<*mut spBone>();
16020 let mut child: *mut spBone = std::ptr::null_mut::<spBone>();
16021 (*constraint).active = ((*(*constraint).target).active != 0
16022 && ((*(*constraint).data).skinRequired == 0
16023 || !((*internal).super_0.skin).is_null()
16024 && spTransformConstraintDataArray_contains(
16025 (*(*internal).super_0.skin).transformConstraints,
16026 (*constraint).data,
16027 ) != 0)) as c_int;
16028 if (*constraint).active == 0 {
16029 return;
16030 }
16031 _sortBone(internal, (*constraint).target);
16032 constrained = (*constraint).bones;
16033 boneCount = (*constraint).bonesCount;
16034 if (*(*constraint).data).local != 0 {
16035 i = 0 as c_int;
16036 while i < boneCount {
16037 child = *constrained.offset(i as isize);
16038 _sortBone(internal, (*child).parent);
16039 _sortBone(internal, child);
16040 i += 1;
16041 }
16042 } else {
16043 i = 0 as c_int;
16044 while i < boneCount {
16045 _sortBone(internal, *constrained.offset(i as isize));
16046 i += 1;
16047 }
16048 }
16049 _addToUpdateCache(
16050 internal,
16051 SP_UPDATE_TRANSFORM_CONSTRAINT,
16052 constraint.cast::<c_void>(),
16053 );
16054 i = 0 as c_int;
16055 while i < boneCount {
16056 _sortReset(
16057 (**constrained.offset(i as isize)).children,
16058 (**constrained.offset(i as isize)).childrenCount,
16059 );
16060 i += 1;
16061 }
16062 i = 0 as c_int;
16063 while i < boneCount {
16064 (**constrained.offset(i as isize)).sorted = 1 as c_int;
16065 i += 1;
16066 }
16067}
16068unsafe extern "C" fn _sortPhysicsConstraint(
16069 internal: *mut _spSkeleton,
16070 mut constraint: *mut spPhysicsConstraint,
16071) {
16072 let mut bone: *mut spBone = (*constraint).bone;
16073 (*constraint).active = ((*(*constraint).bone).active != 0
16074 && ((*(*constraint).data).skinRequired == 0
16075 || !((*internal).super_0.skin).is_null()
16076 && spPhysicsConstraintDataArray_contains(
16077 (*(*internal).super_0.skin).physicsConstraints,
16078 (*constraint).data,
16079 ) != 0)) as c_int;
16080 if (*constraint).active == 0 {
16081 return;
16082 }
16083 _sortBone(internal, bone);
16084 _addToUpdateCache(
16085 internal,
16086 SP_UPDATE_PHYSICS_CONSTRAINT,
16087 constraint.cast::<c_void>(),
16088 );
16089 _sortReset((*bone).children, (*bone).childrenCount);
16090 (*bone).sorted = -(1 as c_int);
16091}
16092#[no_mangle]
16093pub unsafe extern "C" fn spSkeleton_updateCache(mut self_0: *mut spSkeleton) {
16094 let mut i: c_int = 0;
16095 let mut ii: c_int = 0;
16096 let mut bones: *mut *mut spBone = std::ptr::null_mut::<*mut spBone>();
16097 let mut ikConstraints: *mut *mut spIkConstraint = std::ptr::null_mut::<*mut spIkConstraint>();
16098 let mut pathConstraints: *mut *mut spPathConstraint =
16099 std::ptr::null_mut::<*mut spPathConstraint>();
16100 let mut transformConstraints: *mut *mut spTransformConstraint =
16101 std::ptr::null_mut::<*mut spTransformConstraint>();
16102 let mut physicsConstraints: *mut *mut spPhysicsConstraint =
16103 std::ptr::null_mut::<*mut spPhysicsConstraint>();
16104 let mut ikCount: c_int = 0;
16105 let mut transformCount: c_int = 0;
16106 let mut pathCount: c_int = 0;
16107 let mut physicsCount: c_int = 0;
16108 let mut constraintCount: c_int = 0;
16109 let mut internal: *mut _spSkeleton = self_0.cast::<_spSkeleton>();
16110 (*internal).updateCacheCapacity = (*self_0).bonesCount
16111 + (*self_0).ikConstraintsCount
16112 + (*self_0).transformConstraintsCount
16113 + (*self_0).pathConstraintsCount
16114 + (*self_0).physicsConstraintsCount;
16115 _spFree((*internal).updateCache.cast::<c_void>());
16116 (*internal).updateCache = _spMalloc(
16117 (::core::mem::size_of::<_spUpdate>() as c_ulong)
16118 .wrapping_mul((*internal).updateCacheCapacity as c_ulong),
16119 (b"spine.c\0" as *const u8).cast::<c_char>(),
16120 8653 as c_int,
16121 )
16122 .cast::<_spUpdate>();
16123 (*internal).updateCacheCount = 0 as c_int;
16124 bones = (*self_0).bones;
16125 i = 0 as c_int;
16126 while i < (*self_0).bonesCount {
16127 let mut bone: *mut spBone = *bones.offset(i as isize);
16128 (*bone).sorted = (*(*bone).data).skinRequired;
16129 (*bone).active = ((*bone).sorted == 0) as c_int;
16130 i += 1;
16131 }
16132 if !((*self_0).skin).is_null() {
16133 let mut skinBones: *mut spBoneDataArray = (*(*self_0).skin).bones;
16134 i = 0 as c_int;
16135 while i < (*skinBones).size {
16136 let mut bone_0: *mut spBone = *((*self_0).bones)
16137 .offset((**((*skinBones).items).offset(i as isize)).index as isize);
16138 loop {
16139 (*bone_0).sorted = 0 as c_int;
16140 (*bone_0).active = -(1 as c_int);
16141 bone_0 = (*bone_0).parent;
16142 if bone_0.is_null() {
16143 break;
16144 }
16145 }
16146 i += 1;
16147 }
16148 }
16149 ikConstraints = (*self_0).ikConstraints;
16150 transformConstraints = (*self_0).transformConstraints;
16151 pathConstraints = (*self_0).pathConstraints;
16152 physicsConstraints = (*self_0).physicsConstraints;
16153 ikCount = (*self_0).ikConstraintsCount;
16154 transformCount = (*self_0).transformConstraintsCount;
16155 pathCount = (*self_0).pathConstraintsCount;
16156 physicsCount = (*self_0).physicsConstraintsCount;
16157 constraintCount = ikCount + transformCount + pathCount + physicsCount;
16158 i = 0 as c_int;
16159 's_133: while i < constraintCount {
16160 ii = 0 as c_int;
16161 while ii < ikCount {
16162 let mut ikConstraint: *mut spIkConstraint = *ikConstraints.offset(ii as isize);
16163 if (*(*ikConstraint).data).order == i {
16164 _sortIkConstraint(internal, ikConstraint);
16165 i += 1;
16166 continue 's_133;
16167 } else {
16168 ii += 1;
16169 }
16170 }
16171 ii = 0 as c_int;
16172 while ii < transformCount {
16173 let mut transformConstraint: *mut spTransformConstraint =
16174 *transformConstraints.offset(ii as isize);
16175 if (*(*transformConstraint).data).order == i {
16176 _sortTransformConstraint(internal, transformConstraint);
16177 i += 1;
16178 continue 's_133;
16179 } else {
16180 ii += 1;
16181 }
16182 }
16183 ii = 0 as c_int;
16184 while ii < pathCount {
16185 let mut pathConstraint: *mut spPathConstraint = *pathConstraints.offset(ii as isize);
16186 if (*(*pathConstraint).data).order == i {
16187 _sortPathConstraint(internal, pathConstraint);
16188 i += 1;
16189 continue 's_133;
16190 } else {
16191 ii += 1;
16192 }
16193 }
16194 ii = 0 as c_int;
16195 while ii < physicsCount {
16196 let mut physicsConstraint: *mut spPhysicsConstraint =
16197 *physicsConstraints.offset(ii as isize);
16198 if (*(*physicsConstraint).data).order == i {
16199 _sortPhysicsConstraint(internal, physicsConstraint);
16200 i += 1;
16201 continue 's_133;
16202 } else {
16203 ii += 1;
16204 }
16205 }
16206 i += 1;
16207 }
16208 i = 0 as c_int;
16209 while i < (*self_0).bonesCount {
16210 _sortBone(internal, *((*self_0).bones).offset(i as isize));
16211 i += 1;
16212 }
16213}
16214#[no_mangle]
16215pub unsafe extern "C" fn spSkeleton_updateWorldTransform(
16216 mut self_0: *const spSkeleton,
16217 mut physics: spPhysics,
16218) {
16219 let mut i: c_int = 0;
16220 let mut n: c_int = 0;
16221 let mut internal: *mut _spSkeleton = self_0 as *mut _spSkeleton;
16222 i = 0 as c_int;
16223 n = (*self_0).bonesCount;
16224 while i < n {
16225 let mut bone: *mut spBone = *((*self_0).bones).offset(i as isize);
16226 (*bone).ax = (*bone).x;
16227 (*bone).ay = (*bone).y;
16228 (*bone).arotation = (*bone).rotation;
16229 (*bone).ascaleX = (*bone).scaleX;
16230 (*bone).ascaleY = (*bone).scaleY;
16231 (*bone).ashearX = (*bone).shearX;
16232 (*bone).ashearY = (*bone).shearY;
16233 i += 1;
16234 }
16235 i = 0 as c_int;
16236 while i < (*internal).updateCacheCount {
16237 let mut update: *mut _spUpdate = ((*internal).updateCache).offset(i as isize);
16238 match (*update).type_0 as c_uint {
16239 0 => {
16240 spBone_update((*update).object.cast::<spBone>());
16241 }
16242 1 => {
16243 spIkConstraint_update((*update).object.cast::<spIkConstraint>());
16244 }
16245 3 => {
16246 spTransformConstraint_update((*update).object.cast::<spTransformConstraint>());
16247 }
16248 2 => {
16249 spPathConstraint_update((*update).object.cast::<spPathConstraint>());
16250 }
16251 4 => {
16252 spPhysicsConstraint_update((*update).object.cast::<spPhysicsConstraint>(), physics);
16253 }
16254 _ => {}
16255 }
16256 i += 1;
16257 }
16258}
16259#[no_mangle]
16260pub unsafe extern "C" fn spSkeleton_update(mut self_0: *mut spSkeleton, mut delta: c_float) {
16261 (*self_0).time += delta;
16262}
16263#[no_mangle]
16264pub unsafe extern "C" fn spSkeleton_updateWorldTransformWith(
16265 mut self_0: *const spSkeleton,
16266 mut parent: *const spBone,
16267 mut physics: spPhysics,
16268) {
16269 let mut i: c_int = 0;
16270 let mut rotationY: c_float = 0.;
16271 let mut la: c_float = 0.;
16272 let mut lb: c_float = 0.;
16273 let mut lc: c_float = 0.;
16274 let mut ld: c_float = 0.;
16275 let mut internal: *mut _spSkeleton = self_0 as *mut _spSkeleton;
16276 let mut rootBone: *mut spBone = (*self_0).root;
16277 let mut pa: c_float = (*parent).a;
16278 let mut pb: c_float = (*parent).b;
16279 let mut pc: c_float = (*parent).c;
16280 let mut pd: c_float = (*parent).d;
16281 (*rootBone).worldX = pa * (*self_0).x + pb * (*self_0).y + (*parent).worldX;
16282 (*rootBone).worldY = pc * (*self_0).x + pd * (*self_0).y + (*parent).worldY;
16283 rotationY = (*rootBone).rotation + 90 as c_int as c_float + (*rootBone).shearY;
16284 la = spine_cosf(
16285 ((*rootBone).rotation + (*rootBone).shearX) * (3.141_592_7_f32 / 180 as c_int as c_float),
16286 ) * (*rootBone).scaleX;
16287 lb = spine_cosf(rotationY * (3.141_592_7_f32 / 180 as c_int as c_float)) * (*rootBone).scaleY;
16288 lc = spine_sinf(
16289 ((*rootBone).rotation + (*rootBone).shearX) * (3.141_592_7_f32 / 180 as c_int as c_float),
16290 ) * (*rootBone).scaleX;
16291 ld = spine_sinf(rotationY * (3.141_592_7_f32 / 180 as c_int as c_float)) * (*rootBone).scaleY;
16292 (*rootBone).a = (pa * la + pb * lc) * (*self_0).scaleX;
16293 (*rootBone).b = (pa * lb + pb * ld) * (*self_0).scaleX;
16294 (*rootBone).c = (pc * la + pd * lc) * (*self_0).scaleY;
16295 (*rootBone).d = (pc * lb + pd * ld) * (*self_0).scaleY;
16296 i = 0 as c_int;
16297 while i < (*internal).updateCacheCount {
16298 let mut update: *mut _spUpdate = ((*internal).updateCache).offset(i as isize);
16299 match (*update).type_0 as c_uint {
16300 0 => {
16301 if (*update).object.cast::<spBone>() != rootBone {
16302 spBone_updateWorldTransform((*update).object.cast::<spBone>());
16303 }
16304 }
16305 1 => {
16306 spIkConstraint_update((*update).object.cast::<spIkConstraint>());
16307 }
16308 3 => {
16309 spTransformConstraint_update((*update).object.cast::<spTransformConstraint>());
16310 }
16311 2 => {
16312 spPathConstraint_update((*update).object.cast::<spPathConstraint>());
16313 }
16314 4 => {
16315 spPhysicsConstraint_update((*update).object.cast::<spPhysicsConstraint>(), physics);
16316 }
16317 _ => {}
16318 }
16319 i += 1;
16320 }
16321}
16322#[no_mangle]
16323pub unsafe extern "C" fn spSkeleton_setToSetupPose(mut self_0: *const spSkeleton) {
16324 spSkeleton_setBonesToSetupPose(self_0);
16325 spSkeleton_setSlotsToSetupPose(self_0);
16326}
16327#[no_mangle]
16328pub unsafe extern "C" fn spSkeleton_setBonesToSetupPose(mut self_0: *const spSkeleton) {
16329 let mut i: c_int = 0;
16330 i = 0 as c_int;
16331 while i < (*self_0).bonesCount {
16332 spBone_setToSetupPose(*((*self_0).bones).offset(i as isize));
16333 i += 1;
16334 }
16335 i = 0 as c_int;
16336 while i < (*self_0).ikConstraintsCount {
16337 spIkConstraint_setToSetupPose(*((*self_0).ikConstraints).offset(i as isize));
16338 i += 1;
16339 }
16340 i = 0 as c_int;
16341 while i < (*self_0).transformConstraintsCount {
16342 spTransformConstraint_setToSetupPose(*((*self_0).transformConstraints).offset(i as isize));
16343 i += 1;
16344 }
16345 i = 0 as c_int;
16346 while i < (*self_0).pathConstraintsCount {
16347 spPathConstraint_setToSetupPose(*((*self_0).pathConstraints).offset(i as isize));
16348 i += 1;
16349 }
16350 i = 0 as c_int;
16351 while i < (*self_0).physicsConstraintsCount {
16352 spPhysicsConstraint_setToSetupPose(*((*self_0).physicsConstraints).offset(i as isize));
16353 i += 1;
16354 }
16355}
16356#[no_mangle]
16357pub unsafe extern "C" fn spSkeleton_setSlotsToSetupPose(mut self_0: *const spSkeleton) {
16358 let mut i: c_int = 0;
16359 spine_memcpy(
16360 (*self_0).drawOrder.cast::<c_void>(),
16361 (*self_0).slots as *const c_void,
16362 ((*self_0).slotsCount as c_ulong)
16363 .wrapping_mul(::core::mem::size_of::<*mut spSlot>() as c_ulong),
16364 );
16365 i = 0 as c_int;
16366 while i < (*self_0).slotsCount {
16367 spSlot_setToSetupPose(*((*self_0).slots).offset(i as isize));
16368 i += 1;
16369 }
16370}
16371#[no_mangle]
16372pub unsafe extern "C" fn spSkeleton_findBone(
16373 mut self_0: *const spSkeleton,
16374 mut boneName: *const c_char,
16375) -> *mut spBone {
16376 let mut i: c_int = 0;
16377 i = 0 as c_int;
16378 while i < (*self_0).bonesCount {
16379 if spine_strcmp(
16380 (**((*(*self_0).data).bones).offset(i as isize)).name,
16381 boneName,
16382 ) == 0 as c_int
16383 {
16384 return *((*self_0).bones).offset(i as isize);
16385 }
16386 i += 1;
16387 }
16388 std::ptr::null_mut::<spBone>()
16389}
16390#[no_mangle]
16391pub unsafe extern "C" fn spSkeleton_findSlot(
16392 mut self_0: *const spSkeleton,
16393 mut slotName: *const c_char,
16394) -> *mut spSlot {
16395 let mut i: c_int = 0;
16396 i = 0 as c_int;
16397 while i < (*self_0).slotsCount {
16398 if spine_strcmp(
16399 (**((*(*self_0).data).slots).offset(i as isize)).name,
16400 slotName,
16401 ) == 0 as c_int
16402 {
16403 return *((*self_0).slots).offset(i as isize);
16404 }
16405 i += 1;
16406 }
16407 std::ptr::null_mut::<spSlot>()
16408}
16409#[no_mangle]
16410pub unsafe extern "C" fn spSkeleton_setSkinByName(
16411 mut self_0: *mut spSkeleton,
16412 mut skinName: *const c_char,
16413) -> c_int {
16414 let mut skin: *mut spSkin = std::ptr::null_mut::<spSkin>();
16415 if skinName.is_null() {
16416 spSkeleton_setSkin(self_0, std::ptr::null_mut::<spSkin>());
16417 return 1 as c_int;
16418 }
16419 skin = spSkeletonData_findSkin((*self_0).data, skinName);
16420 if skin.is_null() {
16421 return 0 as c_int;
16422 }
16423 spSkeleton_setSkin(self_0, skin);
16424 1 as c_int
16425}
16426#[no_mangle]
16427pub unsafe extern "C" fn spSkeleton_setSkin(mut self_0: *mut spSkeleton, mut newSkin: *mut spSkin) {
16428 if (*self_0).skin == newSkin {
16429 return;
16430 }
16431 if !newSkin.is_null() {
16432 if !((*self_0).skin).is_null() {
16433 spSkin_attachAll(newSkin, self_0, (*self_0).skin);
16434 } else {
16435 let mut i: c_int = 0;
16436 i = 0 as c_int;
16437 while i < (*self_0).slotsCount {
16438 let mut slot: *mut spSlot = *((*self_0).slots).offset(i as isize);
16439 if !((*(*slot).data).attachmentName).is_null() {
16440 let mut attachment: *mut spAttachment =
16441 spSkin_getAttachment(newSkin, i, (*(*slot).data).attachmentName);
16442 if !attachment.is_null() {
16443 spSlot_setAttachment(slot, attachment);
16444 }
16445 }
16446 i += 1;
16447 }
16448 }
16449 }
16450 (*self_0).skin = newSkin;
16451 spSkeleton_updateCache(self_0);
16452}
16453#[no_mangle]
16454pub unsafe extern "C" fn spSkeleton_getAttachmentForSlotName(
16455 mut self_0: *const spSkeleton,
16456 mut slotName: *const c_char,
16457 mut attachmentName: *const c_char,
16458) -> *mut spAttachment {
16459 let mut slotIndex: c_int = (*spSkeletonData_findSlot((*self_0).data, slotName)).index;
16460 spSkeleton_getAttachmentForSlotIndex(self_0, slotIndex, attachmentName)
16461}
16462#[no_mangle]
16463pub unsafe extern "C" fn spSkeleton_getAttachmentForSlotIndex(
16464 mut self_0: *const spSkeleton,
16465 mut slotIndex: c_int,
16466 mut attachmentName: *const c_char,
16467) -> *mut spAttachment {
16468 if slotIndex == -(1 as c_int) {
16469 return std::ptr::null_mut::<spAttachment>();
16470 }
16471 if !((*self_0).skin).is_null() {
16472 let mut attachment: *mut spAttachment =
16473 spSkin_getAttachment((*self_0).skin, slotIndex, attachmentName);
16474 if !attachment.is_null() {
16475 return attachment;
16476 }
16477 }
16478 if !((*(*self_0).data).defaultSkin).is_null() {
16479 let mut attachment_0: *mut spAttachment =
16480 spSkin_getAttachment((*(*self_0).data).defaultSkin, slotIndex, attachmentName);
16481 if !attachment_0.is_null() {
16482 return attachment_0;
16483 }
16484 }
16485 std::ptr::null_mut::<spAttachment>()
16486}
16487#[no_mangle]
16488pub unsafe extern "C" fn spSkeleton_setAttachment(
16489 mut self_0: *mut spSkeleton,
16490 mut slotName: *const c_char,
16491 mut attachmentName: *const c_char,
16492) -> c_int {
16493 let mut i: c_int = 0;
16494 i = 0 as c_int;
16495 while i < (*self_0).slotsCount {
16496 let mut slot: *mut spSlot = *((*self_0).slots).offset(i as isize);
16497 if spine_strcmp((*(*slot).data).name, slotName) == 0 as c_int {
16498 if attachmentName.is_null() {
16499 spSlot_setAttachment(slot, std::ptr::null_mut::<spAttachment>());
16500 } else {
16501 let mut attachment: *mut spAttachment =
16502 spSkeleton_getAttachmentForSlotIndex(self_0, i, attachmentName);
16503 if attachment.is_null() {
16504 return 0 as c_int;
16505 }
16506 spSlot_setAttachment(slot, attachment);
16507 }
16508 return 1 as c_int;
16509 }
16510 i += 1;
16511 }
16512 0 as c_int
16513}
16514#[no_mangle]
16515pub unsafe extern "C" fn spSkeleton_findIkConstraint(
16516 mut self_0: *const spSkeleton,
16517 mut constraintName: *const c_char,
16518) -> *mut spIkConstraint {
16519 let mut i: c_int = 0;
16520 i = 0 as c_int;
16521 while i < (*self_0).ikConstraintsCount {
16522 if spine_strcmp(
16523 (*(**((*self_0).ikConstraints).offset(i as isize)).data).name,
16524 constraintName,
16525 ) == 0 as c_int
16526 {
16527 return *((*self_0).ikConstraints).offset(i as isize);
16528 }
16529 i += 1;
16530 }
16531 std::ptr::null_mut::<spIkConstraint>()
16532}
16533#[no_mangle]
16534pub unsafe extern "C" fn spSkeleton_findTransformConstraint(
16535 mut self_0: *const spSkeleton,
16536 mut constraintName: *const c_char,
16537) -> *mut spTransformConstraint {
16538 let mut i: c_int = 0;
16539 i = 0 as c_int;
16540 while i < (*self_0).transformConstraintsCount {
16541 if spine_strcmp(
16542 (*(**((*self_0).transformConstraints).offset(i as isize)).data).name,
16543 constraintName,
16544 ) == 0 as c_int
16545 {
16546 return *((*self_0).transformConstraints).offset(i as isize);
16547 }
16548 i += 1;
16549 }
16550 std::ptr::null_mut::<spTransformConstraint>()
16551}
16552#[no_mangle]
16553pub unsafe extern "C" fn spSkeleton_findPathConstraint(
16554 mut self_0: *const spSkeleton,
16555 mut constraintName: *const c_char,
16556) -> *mut spPathConstraint {
16557 let mut i: c_int = 0;
16558 i = 0 as c_int;
16559 while i < (*self_0).pathConstraintsCount {
16560 if spine_strcmp(
16561 (*(**((*self_0).pathConstraints).offset(i as isize)).data).name,
16562 constraintName,
16563 ) == 0 as c_int
16564 {
16565 return *((*self_0).pathConstraints).offset(i as isize);
16566 }
16567 i += 1;
16568 }
16569 std::ptr::null_mut::<spPathConstraint>()
16570}
16571#[no_mangle]
16572pub unsafe extern "C" fn spSkeleton_findPhysicsConstraint(
16573 mut self_0: *const spSkeleton,
16574 mut constraintName: *const c_char,
16575) -> *mut spPhysicsConstraint {
16576 let mut i: c_int = 0;
16577 i = 0 as c_int;
16578 while i < (*self_0).physicsConstraintsCount {
16579 if spine_strcmp(
16580 (*(**((*self_0).physicsConstraints).offset(i as isize)).data).name,
16581 constraintName,
16582 ) == 0 as c_int
16583 {
16584 return *((*self_0).physicsConstraints).offset(i as isize);
16585 }
16586 i += 1;
16587 }
16588 std::ptr::null_mut::<spPhysicsConstraint>()
16589}
16590#[no_mangle]
16591pub unsafe extern "C" fn spSkeleton_physicsTranslate(
16592 mut self_0: *mut spSkeleton,
16593 mut x: c_float,
16594 mut y: c_float,
16595) {
16596 let mut i: c_int = 0 as c_int;
16597 while i < (*self_0).physicsConstraintsCount {
16598 spPhysicsConstraint_translate(*((*self_0).physicsConstraints).offset(i as isize), x, y);
16599 i += 1;
16600 }
16601}
16602#[no_mangle]
16603pub unsafe extern "C" fn spSkeleton_physicsRotate(
16604 mut self_0: *mut spSkeleton,
16605 mut x: c_float,
16606 mut y: c_float,
16607 mut degrees: c_float,
16608) {
16609 let mut i: c_int = 0 as c_int;
16610 while i < (*self_0).physicsConstraintsCount {
16611 spPhysicsConstraint_rotate(
16612 *((*self_0).physicsConstraints).offset(i as isize),
16613 x,
16614 y,
16615 degrees,
16616 );
16617 i += 1;
16618 }
16619}
16620unsafe extern "C" fn string_lastIndexOf(mut str: *const c_char, mut needle: c_char) -> c_int {
16621 if str.is_null() {
16622 return -(1 as c_int);
16623 }
16624 let mut lastIndex: c_int = -(1 as c_int);
16625 let mut i: c_int = 0 as c_int;
16626 while *str.offset(i as isize) as c_int != '\0' as i32 {
16627 if *str.offset(i as isize) as c_int == needle as c_int {
16628 lastIndex = i;
16629 }
16630 i += 1;
16631 }
16632 lastIndex
16633}
16634unsafe extern "C" fn string_substring(
16635 mut str: *const c_char,
16636 mut start: c_int,
16637 mut end: c_int,
16638) -> *mut c_char {
16639 if str.is_null() || start > end || start < 0 as c_int {
16640 return std::ptr::null_mut::<c_char>();
16641 }
16642 let mut len: c_int = end - start;
16643 let mut substr: *mut c_char = _spMalloc(
16644 (::core::mem::size_of::<c_char>() as c_ulong).wrapping_mul((len + 1 as c_int) as c_ulong),
16645 (b"spine.c\0" as *const u8).cast::<c_char>(),
16646 9047 as c_int,
16647 )
16648 .cast::<c_char>();
16649 if substr.is_null() {
16650 return std::ptr::null_mut::<c_char>();
16651 }
16652 spine_strncpy(substr, str.offset(start as isize), len as size_t);
16653 *substr.offset(len as isize) = '\0' as i32 as c_char;
16654 substr
16655}
16656unsafe extern "C" fn string_starts_with_binary(
16657 mut str: *const c_char,
16658 mut needle: *const c_char,
16659) -> c_int {
16660 let mut lenStr: c_int = 0;
16661 let mut lenNeedle: c_int = 0;
16662 let mut i: c_int = 0;
16663 if str.is_null() {
16664 return 0 as c_int;
16665 }
16666 lenStr = spine_strlen(str) as c_int;
16667 lenNeedle = spine_strlen(needle) as c_int;
16668 if lenStr < lenNeedle {
16669 return 0 as c_int;
16670 }
16671 i = 0 as c_int;
16672 while i < lenNeedle {
16673 if *str.offset(i as isize) as c_int != *needle.offset(i as isize) as c_int {
16674 return 0 as c_int;
16675 }
16676 i += 1;
16677 }
16678 -(1 as c_int)
16679}
16680unsafe extern "C" fn string_copy(mut str: *const c_char) -> *mut c_char {
16681 if str.is_null() {
16682 return std::ptr::null_mut::<c_char>();
16683 }
16684 let mut len: c_int = spine_strlen(str) as c_int;
16685 let mut tmp: *mut c_char = spine_malloc((len + 1 as c_int) as size_t).cast::<c_char>();
16686 spine_strncpy(tmp, str, len as size_t);
16687 *tmp.offset(len as isize) = '\0' as i32 as c_char;
16688 tmp
16689}
16690#[no_mangle]
16691pub unsafe extern "C" fn spSkeletonBinary_createWithLoader(
16692 mut attachmentLoader: *mut spAttachmentLoader,
16693) -> *mut spSkeletonBinary {
16694 let mut self_0: *mut spSkeletonBinary = &mut (*(_spCalloc
16695 as unsafe extern "C" fn(size_t, size_t, *const c_char, c_int) -> *mut c_void)(
16696 1 as c_int as size_t,
16697 ::core::mem::size_of::<_spSkeletonBinary>() as c_ulong,
16698 (b"spine.c\0" as *const u8).cast::<c_char>(),
16699 9081 as c_int,
16700 )
16701 .cast::<_spSkeletonBinary>())
16702 .super_0;
16703 (*self_0).scale = 1 as c_int as c_float;
16704 (*self_0).attachmentLoader = attachmentLoader;
16705 self_0
16706}
16707#[no_mangle]
16708pub unsafe extern "C" fn spSkeletonBinary_create(mut atlas: *mut spAtlas) -> *mut spSkeletonBinary {
16709 let mut attachmentLoader: *mut spAtlasAttachmentLoader = spAtlasAttachmentLoader_create(atlas);
16710 let mut self_0: *mut spSkeletonBinary =
16711 spSkeletonBinary_createWithLoader(&mut (*attachmentLoader).super_0);
16712 (*self_0.cast::<_spSkeletonBinary>()).ownsLoader = 1 as c_int;
16713 self_0
16714}
16715#[no_mangle]
16716pub unsafe extern "C" fn spSkeletonBinary_dispose(mut self_0: *mut spSkeletonBinary) {
16717 let mut internal: *mut _spSkeletonBinary = self_0.cast::<_spSkeletonBinary>();
16718 if (*internal).ownsLoader != 0 {
16719 spAttachmentLoader_dispose((*self_0).attachmentLoader);
16720 }
16721 _spFree((*internal).linkedMeshes.cast::<c_void>());
16722 _spFree((*self_0).error.cast::<c_void>());
16723 _spFree(self_0.cast::<c_void>());
16724}
16725#[no_mangle]
16726pub unsafe extern "C" fn _spSkeletonBinary_setError(
16727 mut self_0: *mut spSkeletonBinary,
16728 mut value1: *const c_char,
16729 mut value2: *const c_char,
16730) {
16731 let mut message: [c_char; 256] = [0; 256];
16732 let mut length: c_int = 0;
16733 _spFree((*self_0).error.cast::<c_void>());
16734 spine_strcpy(message.as_mut_ptr(), value1);
16735 length = spine_strlen(value1) as c_int;
16736 if !value2.is_null() {
16737 spine_strncat(
16738 message.as_mut_ptr().offset(length as isize),
16739 value2,
16740 (255 as c_int - length) as size_t,
16741 );
16742 }
16743 (*self_0).error = _spMalloc(
16744 (::core::mem::size_of::<c_char>() as c_ulong)
16745 .wrapping_mul((spine_strlen(message.as_mut_ptr())).wrapping_add(1 as c_int as c_ulong)),
16746 (b"spine.c\0" as *const u8).cast::<c_char>(),
16747 9109 as c_int,
16748 )
16749 .cast::<c_char>();
16750 spine_strcpy((*self_0).error, message.as_mut_ptr());
16751}
16752unsafe extern "C" fn readByte(mut input: *mut _dataInput) -> c_uchar {
16753 let fresh67 = (*input).cursor;
16754 (*input).cursor = ((*input).cursor).offset(1);
16755 *fresh67
16756}
16757unsafe extern "C" fn readSByte(mut input: *mut _dataInput) -> c_schar {
16758 readByte(input) as c_schar
16759}
16760unsafe extern "C" fn readBoolean(mut input: *mut _dataInput) -> c_int {
16761 (readByte(input) as c_int != 0 as c_int) as c_int
16762}
16763unsafe extern "C" fn readInt(mut input: *mut _dataInput) -> c_int {
16764 let mut result: uint32_t = readByte(input) as uint32_t;
16765 result <<= 8 as c_int;
16766 result |= readByte(input) as c_uint;
16767 result <<= 8 as c_int;
16768 result |= readByte(input) as c_uint;
16769 result <<= 8 as c_int;
16770 result |= readByte(input) as c_uint;
16771 result as c_int
16772}
16773unsafe extern "C" fn readVarint(mut input: *mut _dataInput, mut optimizePositive: c_int) -> c_int {
16774 let mut b: c_uchar = readByte(input);
16775 let mut value: int32_t = b as c_int & 0x7f as c_int;
16776 if b as c_int & 0x80 as c_int != 0 {
16777 b = readByte(input);
16778 value |= (b as c_int & 0x7f as c_int) << 7 as c_int;
16779 if b as c_int & 0x80 as c_int != 0 {
16780 b = readByte(input);
16781 value |= (b as c_int & 0x7f as c_int) << 14 as c_int;
16782 if b as c_int & 0x80 as c_int != 0 {
16783 b = readByte(input);
16784 value |= (b as c_int & 0x7f as c_int) << 21 as c_int;
16785 if b as c_int & 0x80 as c_int != 0 {
16786 value |= (readByte(input) as c_int & 0x7f as c_int) << 28 as c_int;
16787 }
16788 }
16789 }
16790 }
16791 if optimizePositive == 0 {
16792 value = (value as c_uint >> 1 as c_int ^ -(value & 1 as c_int) as c_uint) as int32_t;
16793 }
16794 value
16795}
16796#[no_mangle]
16797pub unsafe extern "C" fn readFloat(mut input: *mut _dataInput) -> c_float {
16798 let mut intToFloat: C2RustUnnamed_0 = C2RustUnnamed_0 { intValue: 0 };
16799 intToFloat.intValue = readInt(input);
16800 intToFloat.floatValue
16801}
16802#[no_mangle]
16803pub unsafe extern "C" fn readString(mut input: *mut _dataInput) -> *mut c_char {
16804 let mut length: c_int = readVarint(input, 1 as c_int);
16805 let mut string: *mut c_char = std::ptr::null_mut::<c_char>();
16806 if length == 0 as c_int {
16807 return std::ptr::null_mut::<c_char>();
16808 }
16809 string = _spMalloc(
16810 (::core::mem::size_of::<c_char>() as c_ulong).wrapping_mul(length as c_ulong),
16811 (b"spine.c\0" as *const u8).cast::<c_char>(),
16812 9168 as c_int,
16813 )
16814 .cast::<c_char>();
16815 spine_memcpy(
16816 string.cast::<c_void>(),
16817 (*input).cursor.cast::<c_void>(),
16818 (length - 1 as c_int) as size_t,
16819 );
16820 (*input).cursor = ((*input).cursor).offset((length - 1 as c_int) as isize);
16821 *string.offset((length - 1 as c_int) as isize) = '\0' as i32 as c_char;
16822 string
16823}
16824unsafe extern "C" fn readStringRef(
16825 mut input: *mut _dataInput,
16826 mut skeletonData: *mut spSkeletonData,
16827) -> *mut c_char {
16828 let mut index: c_int = readVarint(input, 1 as c_int);
16829 if index == 0 as c_int {
16830 std::ptr::null_mut::<c_char>()
16831 } else {
16832 *((*skeletonData).strings).offset((index - 1 as c_int) as isize)
16833 }
16834}
16835unsafe extern "C" fn readColor(
16836 mut input: *mut _dataInput,
16837 mut r: *mut c_float,
16838 mut g: *mut c_float,
16839 mut b: *mut c_float,
16840 mut a: *mut c_float,
16841) {
16842 *r = readByte(input) as c_int as c_float / 255.0f32;
16843 *g = readByte(input) as c_int as c_float / 255.0f32;
16844 *b = readByte(input) as c_int as c_float / 255.0f32;
16845 *a = readByte(input) as c_int as c_float / 255.0f32;
16846}
16847unsafe extern "C" fn readSequenceBinary(mut input: *mut _dataInput) -> *mut spSequence {
16848 let mut sequence: *mut spSequence = spSequence_create(readVarint(input, -(1 as c_int)));
16849 (*sequence).start = readVarint(input, -(1 as c_int));
16850 (*sequence).digits = readVarint(input, -(1 as c_int));
16851 (*sequence).setupIndex = readVarint(input, -(1 as c_int));
16852 sequence
16853}
16854unsafe extern "C" fn setBezierBinary(
16855 mut input: *mut _dataInput,
16856 mut timeline: *mut spTimeline,
16857 mut bezier: c_int,
16858 mut frame: c_int,
16859 mut value: c_int,
16860 mut time1: c_float,
16861 mut time2: c_float,
16862 mut value1: c_float,
16863 mut value2: c_float,
16864 mut scale: c_float,
16865) {
16866 let mut cx1: c_float = readFloat(input);
16867 let mut cy1: c_float = readFloat(input);
16868 let mut cx2: c_float = readFloat(input);
16869 let mut cy2: c_float = readFloat(input);
16870 spTimeline_setBezier(
16871 timeline,
16872 bezier,
16873 frame,
16874 value as c_float,
16875 time1,
16876 value1,
16877 cx1,
16878 cy1 * scale,
16879 cx2,
16880 cy2 * scale,
16881 time2,
16882 value2,
16883 );
16884}
16885unsafe extern "C" fn readTimelineBinary(
16886 mut input: *mut _dataInput,
16887 mut timelines: *mut spTimelineArray,
16888 mut timeline: *mut spCurveTimeline1,
16889 mut scale: c_float,
16890) {
16891 let mut frame: c_int = 0;
16892 let mut bezier: c_int = 0;
16893 let mut frameLast: c_int = 0;
16894 let mut time2: c_float = 0.;
16895 let mut value2: c_float = 0.;
16896 let mut time: c_float = readFloat(input);
16897 let mut value: c_float = readFloat(input) * scale;
16898 frame = 0 as c_int;
16899 bezier = 0 as c_int;
16900 frameLast = (*timeline).super_0.frameCount - 1 as c_int;
16901 loop {
16902 spCurveTimeline1_setFrame(timeline, frame, time, value);
16903 if frame == frameLast {
16904 break;
16905 }
16906 time2 = readFloat(input);
16907 value2 = readFloat(input) * scale;
16908 match readSByte(input) as c_int {
16909 1 => {
16910 spCurveTimeline_setStepped(timeline, frame);
16911 }
16912 2 => {
16913 let fresh68 = bezier;
16914 bezier += 1;
16915 setBezierBinary(
16916 input,
16917 &mut (*timeline).super_0,
16918 fresh68,
16919 frame,
16920 0 as c_int,
16921 time,
16922 time2,
16923 value,
16924 value2,
16925 scale,
16926 );
16927 }
16928 _ => {}
16929 }
16930 time = time2;
16931 value = value2;
16932 frame += 1;
16933 }
16934 spTimelineArray_add(timelines, &mut (*timeline).super_0);
16935}
16936unsafe extern "C" fn readTimeline2Binary(
16937 mut input: *mut _dataInput,
16938 mut timelines: *mut spTimelineArray,
16939 mut timeline: *mut spCurveTimeline2,
16940 mut scale: c_float,
16941) {
16942 let mut frame: c_int = 0;
16943 let mut bezier: c_int = 0;
16944 let mut frameLast: c_int = 0;
16945 let mut time2: c_float = 0.;
16946 let mut nvalue1: c_float = 0.;
16947 let mut nvalue2: c_float = 0.;
16948 let mut time: c_float = readFloat(input);
16949 let mut value1: c_float = readFloat(input) * scale;
16950 let mut value2: c_float = readFloat(input) * scale;
16951 frame = 0 as c_int;
16952 bezier = 0 as c_int;
16953 frameLast = (*timeline).super_0.frameCount - 1 as c_int;
16954 loop {
16955 spCurveTimeline2_setFrame(timeline, frame, time, value1, value2);
16956 if frame == frameLast {
16957 break;
16958 }
16959 time2 = readFloat(input);
16960 nvalue1 = readFloat(input) * scale;
16961 nvalue2 = readFloat(input) * scale;
16962 match readSByte(input) as c_int {
16963 1 => {
16964 spCurveTimeline_setStepped(timeline, frame);
16965 }
16966 2 => {
16967 let fresh69 = bezier;
16968 bezier += 1;
16969 setBezierBinary(
16970 input,
16971 &mut (*timeline).super_0,
16972 fresh69,
16973 frame,
16974 0 as c_int,
16975 time,
16976 time2,
16977 value1,
16978 nvalue1,
16979 scale,
16980 );
16981 let fresh70 = bezier;
16982 bezier += 1;
16983 setBezierBinary(
16984 input,
16985 &mut (*timeline).super_0,
16986 fresh70,
16987 frame,
16988 1 as c_int,
16989 time,
16990 time2,
16991 value2,
16992 nvalue2,
16993 scale,
16994 );
16995 }
16996 _ => {}
16997 }
16998 time = time2;
16999 value1 = nvalue1;
17000 value2 = nvalue2;
17001 frame += 1;
17002 }
17003 spTimelineArray_add(timelines, &mut (*timeline).super_0);
17004}
17005unsafe extern "C" fn _spSkeletonBinary_addLinkedMesh(
17006 mut self_0: *mut spSkeletonBinary,
17007 mut mesh: *mut spMeshAttachment,
17008 mut skinIndex: c_int,
17009 mut slotIndex: c_int,
17010 mut parent: *const c_char,
17011 mut inheritDeform: c_int,
17012) {
17013 let mut linkedMesh: *mut _spLinkedMeshBinary = std::ptr::null_mut::<_spLinkedMeshBinary>();
17014 let mut internal: *mut _spSkeletonBinary = self_0.cast::<_spSkeletonBinary>();
17015 if (*internal).linkedMeshCount == (*internal).linkedMeshCapacity {
17016 let mut linkedMeshes: *mut _spLinkedMeshBinary =
17017 std::ptr::null_mut::<_spLinkedMeshBinary>();
17018 (*internal).linkedMeshCapacity *= 2 as c_int;
17019 if (*internal).linkedMeshCapacity < 8 as c_int {
17020 (*internal).linkedMeshCapacity = 8 as c_int;
17021 }
17022 linkedMeshes = _spMalloc(
17023 (::core::mem::size_of::<_spLinkedMeshBinary>() as c_ulong)
17024 .wrapping_mul((*internal).linkedMeshCapacity as c_ulong),
17025 (b"spine.c\0" as *const u8).cast::<c_char>(),
17026 9327 as c_int,
17027 )
17028 .cast::<_spLinkedMeshBinary>();
17029 spine_memcpy(
17030 linkedMeshes.cast::<c_void>(),
17031 (*internal).linkedMeshes as *const c_void,
17032 (::core::mem::size_of::<_spLinkedMeshBinary>() as c_ulong)
17033 .wrapping_mul((*internal).linkedMeshCount as c_ulong),
17034 );
17035 _spFree((*internal).linkedMeshes.cast::<c_void>());
17036 (*internal).linkedMeshes = linkedMeshes;
17037 }
17038 let fresh71 = (*internal).linkedMeshCount;
17039 (*internal).linkedMeshCount += 1;
17040 linkedMesh = ((*internal).linkedMeshes).offset(fresh71 as isize);
17041 (*linkedMesh).mesh = mesh;
17042 (*linkedMesh).skinIndex = skinIndex;
17043 (*linkedMesh).slotIndex = slotIndex;
17044 (*linkedMesh).parent = parent;
17045 (*linkedMesh).inheritTimeline = inheritDeform;
17046}
17047unsafe extern "C" fn _spSkeletonBinary_readAnimation(
17048 mut self_0: *mut spSkeletonBinary,
17049 mut name: *const c_char,
17050 mut input: *mut _dataInput,
17051 mut skeletonData: *mut spSkeletonData,
17052) -> *mut spAnimation {
17053 let mut timelines: *mut spTimelineArray = spTimelineArray_create(18 as c_int);
17054 let mut duration: c_float = 0 as c_int as c_float;
17055 let mut i: c_int = 0;
17056 let mut n: c_int = 0;
17057 let mut ii: c_int = 0;
17058 let mut nn: c_int = 0;
17059 let mut iii: c_int = 0;
17060 let mut nnn: c_int = 0;
17061 let mut frame: c_int = 0;
17062 let mut bezier: c_int = 0;
17063 let mut drawOrderCount: c_int = 0;
17064 let mut eventCount: c_int = 0;
17065 let mut animation: *mut spAnimation = std::ptr::null_mut::<spAnimation>();
17066 let mut scale: c_float = (*self_0).scale;
17067 let mut _numTimelines: c_int = readVarint(input, 1 as c_int);
17068 i = 0 as c_int;
17069 n = readVarint(input, 1 as c_int);
17070 while i < n {
17071 let mut slotIndex: c_int = readVarint(input, 1 as c_int);
17072 ii = 0 as c_int;
17073 nn = readVarint(input, 1 as c_int);
17074 while ii < nn {
17075 let mut timelineType: c_uchar = readByte(input);
17076 let mut frameCount: c_int = readVarint(input, 1 as c_int);
17077 let mut frameLast: c_int = frameCount - 1 as c_int;
17078 match timelineType as c_int {
17079 0 => {
17080 let mut timeline: *mut spAttachmentTimeline =
17081 spAttachmentTimeline_create(frameCount, slotIndex);
17082 frame = 0 as c_int;
17083 while frame < frameCount {
17084 let mut time: c_float = readFloat(input);
17085 let mut attachmentName: *const c_char = readStringRef(input, skeletonData);
17086 spAttachmentTimeline_setFrame(timeline, frame, time, attachmentName);
17087 frame += 1;
17088 }
17089 spTimelineArray_add(timelines, &mut (*timeline).super_0);
17090 }
17091 1 => {
17092 let mut bezierCount: c_int = readVarint(input, 1 as c_int);
17093 let mut timeline_0: *mut spRGBATimeline =
17094 spRGBATimeline_create(frameCount, bezierCount, slotIndex);
17095 let mut time_0: c_float = readFloat(input);
17096 let mut r: c_float =
17097 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17098 let mut g: c_float =
17099 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17100 let mut b: c_float =
17101 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17102 let mut a: c_float =
17103 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17104 frame = 0 as c_int;
17105 bezier = 0 as c_int;
17106 loop {
17107 let mut time2: c_float = 0.;
17108 let mut r2: c_float = 0.;
17109 let mut g2: c_float = 0.;
17110 let mut b2: c_float = 0.;
17111 let mut a2: c_float = 0.;
17112 spRGBATimeline_setFrame(timeline_0, frame, time_0, r, g, b, a);
17113 if frame == frameLast {
17114 break;
17115 }
17116 time2 = readFloat(input);
17117 r2 = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17118 g2 = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17119 b2 = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17120 a2 = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17121 match readSByte(input) as c_int {
17122 1 => {
17123 spCurveTimeline_setStepped(&mut (*timeline_0).super_0, frame);
17124 }
17125 2 => {
17126 let fresh72 = bezier;
17127 bezier += 1;
17128 setBezierBinary(
17129 input,
17130 &mut (*timeline_0).super_0.super_0,
17131 fresh72,
17132 frame,
17133 0 as c_int,
17134 time_0,
17135 time2,
17136 r,
17137 r2,
17138 1 as c_int as c_float,
17139 );
17140 let fresh73 = bezier;
17141 bezier += 1;
17142 setBezierBinary(
17143 input,
17144 &mut (*timeline_0).super_0.super_0,
17145 fresh73,
17146 frame,
17147 1 as c_int,
17148 time_0,
17149 time2,
17150 g,
17151 g2,
17152 1 as c_int as c_float,
17153 );
17154 let fresh74 = bezier;
17155 bezier += 1;
17156 setBezierBinary(
17157 input,
17158 &mut (*timeline_0).super_0.super_0,
17159 fresh74,
17160 frame,
17161 2 as c_int,
17162 time_0,
17163 time2,
17164 b,
17165 b2,
17166 1 as c_int as c_float,
17167 );
17168 let fresh75 = bezier;
17169 bezier += 1;
17170 setBezierBinary(
17171 input,
17172 &mut (*timeline_0).super_0.super_0,
17173 fresh75,
17174 frame,
17175 3 as c_int,
17176 time_0,
17177 time2,
17178 a,
17179 a2,
17180 1 as c_int as c_float,
17181 );
17182 }
17183 _ => {}
17184 }
17185 time_0 = time2;
17186 r = r2;
17187 g = g2;
17188 b = b2;
17189 a = a2;
17190 frame += 1;
17191 }
17192 spTimelineArray_add(timelines, &mut (*timeline_0).super_0.super_0);
17193 }
17194 2 => {
17195 let mut bezierCount_0: c_int = readVarint(input, 1 as c_int);
17196 let mut timeline_1: *mut spRGBTimeline =
17197 spRGBTimeline_create(frameCount, bezierCount_0, slotIndex);
17198 let mut time_1: c_float = readFloat(input);
17199 let mut r_0: c_float =
17200 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17201 let mut g_0: c_float =
17202 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17203 let mut b_0: c_float =
17204 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17205 frame = 0 as c_int;
17206 bezier = 0 as c_int;
17207 loop {
17208 let mut time2_0: c_float = 0.;
17209 let mut r2_0: c_float = 0.;
17210 let mut g2_0: c_float = 0.;
17211 let mut b2_0: c_float = 0.;
17212 spRGBTimeline_setFrame(timeline_1, frame, time_1, r_0, g_0, b_0);
17213 if frame == frameLast {
17214 break;
17215 }
17216 time2_0 = readFloat(input);
17217 r2_0 = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17218 g2_0 = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17219 b2_0 = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17220 match readSByte(input) as c_int {
17221 1 => {
17222 spCurveTimeline_setStepped(&mut (*timeline_1).super_0, frame);
17223 }
17224 2 => {
17225 let fresh76 = bezier;
17226 bezier += 1;
17227 setBezierBinary(
17228 input,
17229 &mut (*timeline_1).super_0.super_0,
17230 fresh76,
17231 frame,
17232 0 as c_int,
17233 time_1,
17234 time2_0,
17235 r_0,
17236 r2_0,
17237 1 as c_int as c_float,
17238 );
17239 let fresh77 = bezier;
17240 bezier += 1;
17241 setBezierBinary(
17242 input,
17243 &mut (*timeline_1).super_0.super_0,
17244 fresh77,
17245 frame,
17246 1 as c_int,
17247 time_1,
17248 time2_0,
17249 g_0,
17250 g2_0,
17251 1 as c_int as c_float,
17252 );
17253 let fresh78 = bezier;
17254 bezier += 1;
17255 setBezierBinary(
17256 input,
17257 &mut (*timeline_1).super_0.super_0,
17258 fresh78,
17259 frame,
17260 2 as c_int,
17261 time_1,
17262 time2_0,
17263 b_0,
17264 b2_0,
17265 1 as c_int as c_float,
17266 );
17267 }
17268 _ => {}
17269 }
17270 time_1 = time2_0;
17271 r_0 = r2_0;
17272 g_0 = g2_0;
17273 b_0 = b2_0;
17274 frame += 1;
17275 }
17276 spTimelineArray_add(timelines, &mut (*timeline_1).super_0.super_0);
17277 }
17278 3 => {
17279 let mut bezierCount_1: c_int = readVarint(input, 1 as c_int);
17280 let mut timeline_2: *mut spRGBA2Timeline =
17281 spRGBA2Timeline_create(frameCount, bezierCount_1, slotIndex);
17282 let mut time_2: c_float = readFloat(input);
17283 let mut r_1: c_float =
17284 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17285 let mut g_1: c_float =
17286 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17287 let mut b_1: c_float =
17288 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17289 let mut a_0: c_float =
17290 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17291 let mut r2_1: c_float =
17292 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17293 let mut g2_1: c_float =
17294 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17295 let mut b2_1: c_float =
17296 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17297 frame = 0 as c_int;
17298 bezier = 0 as c_int;
17299 loop {
17300 let mut time2_1: c_float = 0.;
17301 let mut nr: c_float = 0.;
17302 let mut ng: c_float = 0.;
17303 let mut nb: c_float = 0.;
17304 let mut na: c_float = 0.;
17305 let mut nr2: c_float = 0.;
17306 let mut ng2: c_float = 0.;
17307 let mut nb2: c_float = 0.;
17308 spRGBA2Timeline_setFrame(
17309 timeline_2, frame, time_2, r_1, g_1, b_1, a_0, r2_1, g2_1, b2_1,
17310 );
17311 if frame == frameLast {
17312 break;
17313 }
17314 time2_1 = readFloat(input);
17315 nr = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17316 ng = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17317 nb = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17318 na = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17319 nr2 = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17320 ng2 = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17321 nb2 = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17322 match readSByte(input) as c_int {
17323 1 => {
17324 spCurveTimeline_setStepped(&mut (*timeline_2).super_0, frame);
17325 }
17326 2 => {
17327 let fresh79 = bezier;
17328 bezier += 1;
17329 setBezierBinary(
17330 input,
17331 &mut (*timeline_2).super_0.super_0,
17332 fresh79,
17333 frame,
17334 0 as c_int,
17335 time_2,
17336 time2_1,
17337 r_1,
17338 nr,
17339 1 as c_int as c_float,
17340 );
17341 let fresh80 = bezier;
17342 bezier += 1;
17343 setBezierBinary(
17344 input,
17345 &mut (*timeline_2).super_0.super_0,
17346 fresh80,
17347 frame,
17348 1 as c_int,
17349 time_2,
17350 time2_1,
17351 g_1,
17352 ng,
17353 1 as c_int as c_float,
17354 );
17355 let fresh81 = bezier;
17356 bezier += 1;
17357 setBezierBinary(
17358 input,
17359 &mut (*timeline_2).super_0.super_0,
17360 fresh81,
17361 frame,
17362 2 as c_int,
17363 time_2,
17364 time2_1,
17365 b_1,
17366 nb,
17367 1 as c_int as c_float,
17368 );
17369 let fresh82 = bezier;
17370 bezier += 1;
17371 setBezierBinary(
17372 input,
17373 &mut (*timeline_2).super_0.super_0,
17374 fresh82,
17375 frame,
17376 3 as c_int,
17377 time_2,
17378 time2_1,
17379 a_0,
17380 na,
17381 1 as c_int as c_float,
17382 );
17383 let fresh83 = bezier;
17384 bezier += 1;
17385 setBezierBinary(
17386 input,
17387 &mut (*timeline_2).super_0.super_0,
17388 fresh83,
17389 frame,
17390 4 as c_int,
17391 time_2,
17392 time2_1,
17393 r2_1,
17394 nr2,
17395 1 as c_int as c_float,
17396 );
17397 let fresh84 = bezier;
17398 bezier += 1;
17399 setBezierBinary(
17400 input,
17401 &mut (*timeline_2).super_0.super_0,
17402 fresh84,
17403 frame,
17404 5 as c_int,
17405 time_2,
17406 time2_1,
17407 g2_1,
17408 ng2,
17409 1 as c_int as c_float,
17410 );
17411 let fresh85 = bezier;
17412 bezier += 1;
17413 setBezierBinary(
17414 input,
17415 &mut (*timeline_2).super_0.super_0,
17416 fresh85,
17417 frame,
17418 6 as c_int,
17419 time_2,
17420 time2_1,
17421 b2_1,
17422 nb2,
17423 1 as c_int as c_float,
17424 );
17425 }
17426 _ => {}
17427 }
17428 time_2 = time2_1;
17429 r_1 = nr;
17430 g_1 = ng;
17431 b_1 = nb;
17432 a_0 = na;
17433 r2_1 = nr2;
17434 g2_1 = ng2;
17435 b2_1 = nb2;
17436 frame += 1;
17437 }
17438 spTimelineArray_add(timelines, &mut (*timeline_2).super_0.super_0);
17439 }
17440 4 => {
17441 let mut bezierCount_2: c_int = readVarint(input, 1 as c_int);
17442 let mut timeline_3: *mut spRGB2Timeline =
17443 spRGB2Timeline_create(frameCount, bezierCount_2, slotIndex);
17444 let mut time_3: c_float = readFloat(input);
17445 let mut r_2: c_float =
17446 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17447 let mut g_2: c_float =
17448 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17449 let mut b_2: c_float =
17450 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17451 let mut r2_2: c_float =
17452 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17453 let mut g2_2: c_float =
17454 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17455 let mut b2_2: c_float =
17456 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17457 frame = 0 as c_int;
17458 bezier = 0 as c_int;
17459 loop {
17460 let mut time2_2: c_float = 0.;
17461 let mut nr_0: c_float = 0.;
17462 let mut ng_0: c_float = 0.;
17463 let mut nb_0: c_float = 0.;
17464 let mut nr2_0: c_float = 0.;
17465 let mut ng2_0: c_float = 0.;
17466 let mut nb2_0: c_float = 0.;
17467 spRGB2Timeline_setFrame(
17468 timeline_3, frame, time_3, r_2, g_2, b_2, r2_2, g2_2, b2_2,
17469 );
17470 if frame == frameLast {
17471 break;
17472 }
17473 time2_2 = readFloat(input);
17474 nr_0 = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17475 ng_0 = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17476 nb_0 = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17477 nr2_0 = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17478 ng2_0 = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17479 nb2_0 = (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17480 match readSByte(input) as c_int {
17481 1 => {
17482 spCurveTimeline_setStepped(&mut (*timeline_3).super_0, frame);
17483 }
17484 2 => {
17485 let fresh86 = bezier;
17486 bezier += 1;
17487 setBezierBinary(
17488 input,
17489 &mut (*timeline_3).super_0.super_0,
17490 fresh86,
17491 frame,
17492 0 as c_int,
17493 time_3,
17494 time2_2,
17495 r_2,
17496 nr_0,
17497 1 as c_int as c_float,
17498 );
17499 let fresh87 = bezier;
17500 bezier += 1;
17501 setBezierBinary(
17502 input,
17503 &mut (*timeline_3).super_0.super_0,
17504 fresh87,
17505 frame,
17506 1 as c_int,
17507 time_3,
17508 time2_2,
17509 g_2,
17510 ng_0,
17511 1 as c_int as c_float,
17512 );
17513 let fresh88 = bezier;
17514 bezier += 1;
17515 setBezierBinary(
17516 input,
17517 &mut (*timeline_3).super_0.super_0,
17518 fresh88,
17519 frame,
17520 2 as c_int,
17521 time_3,
17522 time2_2,
17523 b_2,
17524 nb_0,
17525 1 as c_int as c_float,
17526 );
17527 let fresh89 = bezier;
17528 bezier += 1;
17529 setBezierBinary(
17530 input,
17531 &mut (*timeline_3).super_0.super_0,
17532 fresh89,
17533 frame,
17534 3 as c_int,
17535 time_3,
17536 time2_2,
17537 r2_2,
17538 nr2_0,
17539 1 as c_int as c_float,
17540 );
17541 let fresh90 = bezier;
17542 bezier += 1;
17543 setBezierBinary(
17544 input,
17545 &mut (*timeline_3).super_0.super_0,
17546 fresh90,
17547 frame,
17548 4 as c_int,
17549 time_3,
17550 time2_2,
17551 g2_2,
17552 ng2_0,
17553 1 as c_int as c_float,
17554 );
17555 let fresh91 = bezier;
17556 bezier += 1;
17557 setBezierBinary(
17558 input,
17559 &mut (*timeline_3).super_0.super_0,
17560 fresh91,
17561 frame,
17562 5 as c_int,
17563 time_3,
17564 time2_2,
17565 b2_2,
17566 nb2_0,
17567 1 as c_int as c_float,
17568 );
17569 }
17570 _ => {}
17571 }
17572 time_3 = time2_2;
17573 r_2 = nr_0;
17574 g_2 = ng_0;
17575 b_2 = nb_0;
17576 r2_2 = nr2_0;
17577 g2_2 = ng2_0;
17578 b2_2 = nb2_0;
17579 frame += 1;
17580 }
17581 spTimelineArray_add(timelines, &mut (*timeline_3).super_0.super_0);
17582 }
17583 5 => {
17584 let mut bezierCount_3: c_int = readVarint(input, 1 as c_int);
17585 let mut timeline_4: *mut spAlphaTimeline =
17586 spAlphaTimeline_create(frameCount, bezierCount_3, slotIndex);
17587 let mut time_4: c_float = readFloat(input);
17588 let mut a_1: c_float =
17589 (readByte(input) as c_int as c_double / 255.0f64) as c_float;
17590 frame = 0 as c_int;
17591 bezier = 0 as c_int;
17592 loop {
17593 let mut time2_3: c_float = 0.;
17594 let mut a2_0: c_float = 0.;
17595 spAlphaTimeline_setFrame(timeline_4, frame, time_4, a_1);
17596 if frame == frameLast {
17597 break;
17598 }
17599 time2_3 = readFloat(input);
17600 a2_0 = (readByte(input) as c_int / 255 as c_int) as c_float;
17601 match readSByte(input) as c_int {
17602 1 => {
17603 spCurveTimeline_setStepped(&mut (*timeline_4).super_0, frame);
17604 }
17605 2 => {
17606 let fresh92 = bezier;
17607 bezier += 1;
17608 setBezierBinary(
17609 input,
17610 &mut (*timeline_4).super_0.super_0,
17611 fresh92,
17612 frame,
17613 0 as c_int,
17614 time_4,
17615 time2_3,
17616 a_1,
17617 a2_0,
17618 1 as c_int as c_float,
17619 );
17620 }
17621 _ => {}
17622 }
17623 time_4 = time2_3;
17624 a_1 = a2_0;
17625 frame += 1;
17626 }
17627 spTimelineArray_add(timelines, &mut (*timeline_4).super_0.super_0);
17628 }
17629 _ => return std::ptr::null_mut::<spAnimation>(),
17630 }
17631 ii += 1;
17632 }
17633 i += 1;
17634 }
17635 i = 0 as c_int;
17636 n = readVarint(input, 1 as c_int);
17637 while i < n {
17638 let mut boneIndex: c_int = readVarint(input, 1 as c_int);
17639 ii = 0 as c_int;
17640 nn = readVarint(input, 1 as c_int);
17641 while ii < nn {
17642 let mut timelineType_0: c_uchar = readByte(input);
17643 let mut frameCount_0: c_int = readVarint(input, 1 as c_int);
17644 if timelineType_0 as c_int == 10 as c_int {
17645 let mut timeline_5: *mut spInheritTimeline =
17646 spInheritTimeline_create(frameCount_0, boneIndex);
17647 frame = 0 as c_int;
17648 while frame < frameCount_0 {
17649 let mut time_5: c_float = readFloat(input);
17650 let mut inherit: spInherit = readByte(input) as spInherit;
17651 spInheritTimeline_setFrame(timeline_5, frame, time_5, inherit);
17652 frame += 1;
17653 }
17654 spTimelineArray_add(timelines, &mut (*timeline_5).super_0);
17655 } else {
17656 let mut bezierCount_4: c_int = readVarint(input, 1 as c_int);
17657 match timelineType_0 as c_int {
17658 0 => {
17659 readTimelineBinary(
17660 input,
17661 timelines,
17662 &mut (*(spRotateTimeline_create
17663 as unsafe extern "C" fn(
17664 c_int,
17665 c_int,
17666 c_int,
17667 )
17668 -> *mut spRotateTimeline)(
17669 frameCount_0,
17670 bezierCount_4,
17671 boneIndex,
17672 ))
17673 .super_0,
17674 1 as c_int as c_float,
17675 );
17676 }
17677 1 => {
17678 readTimeline2Binary(
17679 input,
17680 timelines,
17681 &mut (*(spTranslateTimeline_create
17682 as unsafe extern "C" fn(
17683 c_int,
17684 c_int,
17685 c_int,
17686 )
17687 -> *mut spTranslateTimeline)(
17688 frameCount_0,
17689 bezierCount_4,
17690 boneIndex,
17691 ))
17692 .super_0,
17693 scale,
17694 );
17695 }
17696 2 => {
17697 readTimelineBinary(
17698 input,
17699 timelines,
17700 &mut (*(spTranslateXTimeline_create
17701 as unsafe extern "C" fn(
17702 c_int,
17703 c_int,
17704 c_int,
17705 )
17706 -> *mut spTranslateXTimeline)(
17707 frameCount_0,
17708 bezierCount_4,
17709 boneIndex,
17710 ))
17711 .super_0,
17712 scale,
17713 );
17714 }
17715 3 => {
17716 readTimelineBinary(
17717 input,
17718 timelines,
17719 &mut (*(spTranslateYTimeline_create
17720 as unsafe extern "C" fn(
17721 c_int,
17722 c_int,
17723 c_int,
17724 )
17725 -> *mut spTranslateYTimeline)(
17726 frameCount_0,
17727 bezierCount_4,
17728 boneIndex,
17729 ))
17730 .super_0,
17731 scale,
17732 );
17733 }
17734 4 => {
17735 readTimeline2Binary(
17736 input,
17737 timelines,
17738 &mut (*(spScaleTimeline_create
17739 as unsafe extern "C" fn(
17740 c_int,
17741 c_int,
17742 c_int,
17743 )
17744 -> *mut spScaleTimeline)(
17745 frameCount_0,
17746 bezierCount_4,
17747 boneIndex,
17748 ))
17749 .super_0,
17750 1 as c_int as c_float,
17751 );
17752 }
17753 5 => {
17754 readTimelineBinary(
17755 input,
17756 timelines,
17757 &mut (*(spScaleXTimeline_create
17758 as unsafe extern "C" fn(
17759 c_int,
17760 c_int,
17761 c_int,
17762 )
17763 -> *mut spScaleXTimeline)(
17764 frameCount_0,
17765 bezierCount_4,
17766 boneIndex,
17767 ))
17768 .super_0,
17769 1 as c_int as c_float,
17770 );
17771 }
17772 6 => {
17773 readTimelineBinary(
17774 input,
17775 timelines,
17776 &mut (*(spScaleYTimeline_create
17777 as unsafe extern "C" fn(
17778 c_int,
17779 c_int,
17780 c_int,
17781 )
17782 -> *mut spScaleYTimeline)(
17783 frameCount_0,
17784 bezierCount_4,
17785 boneIndex,
17786 ))
17787 .super_0,
17788 1 as c_int as c_float,
17789 );
17790 }
17791 7 => {
17792 readTimeline2Binary(
17793 input,
17794 timelines,
17795 &mut (*(spShearTimeline_create
17796 as unsafe extern "C" fn(
17797 c_int,
17798 c_int,
17799 c_int,
17800 )
17801 -> *mut spShearTimeline)(
17802 frameCount_0,
17803 bezierCount_4,
17804 boneIndex,
17805 ))
17806 .super_0,
17807 1 as c_int as c_float,
17808 );
17809 }
17810 8 => {
17811 readTimelineBinary(
17812 input,
17813 timelines,
17814 &mut (*(spShearXTimeline_create
17815 as unsafe extern "C" fn(
17816 c_int,
17817 c_int,
17818 c_int,
17819 )
17820 -> *mut spShearXTimeline)(
17821 frameCount_0,
17822 bezierCount_4,
17823 boneIndex,
17824 ))
17825 .super_0,
17826 1 as c_int as c_float,
17827 );
17828 }
17829 9 => {
17830 readTimelineBinary(
17831 input,
17832 timelines,
17833 &mut (*(spShearYTimeline_create
17834 as unsafe extern "C" fn(
17835 c_int,
17836 c_int,
17837 c_int,
17838 )
17839 -> *mut spShearYTimeline)(
17840 frameCount_0,
17841 bezierCount_4,
17842 boneIndex,
17843 ))
17844 .super_0,
17845 1 as c_int as c_float,
17846 );
17847 }
17848 _ => {
17849 iii = 0 as c_int;
17850 while iii < (*timelines).size {
17851 spTimeline_dispose(*((*timelines).items).offset(iii as isize));
17852 iii += 1;
17853 }
17854 spTimelineArray_dispose(timelines);
17855 _spSkeletonBinary_setError(
17856 self_0,
17857 (b"Invalid timeline type for a bone: \0" as *const u8).cast::<c_char>(),
17858 (**((*skeletonData).bones).offset(boneIndex as isize)).name,
17859 );
17860 return std::ptr::null_mut::<spAnimation>();
17861 }
17862 }
17863 }
17864 ii += 1;
17865 }
17866 i += 1;
17867 }
17868 i = 0 as c_int;
17869 n = readVarint(input, 1 as c_int);
17870 while i < n {
17871 let mut index: c_int = readVarint(input, 1 as c_int);
17872 let mut frameCount_1: c_int = readVarint(input, 1 as c_int);
17873 let mut frameLast_0: c_int = frameCount_1 - 1 as c_int;
17874 let mut bezierCount_5: c_int = readVarint(input, 1 as c_int);
17875 let mut timeline_6: *mut spIkConstraintTimeline =
17876 spIkConstraintTimeline_create(frameCount_1, bezierCount_5, index);
17877 let mut flags: c_int = readByte(input) as c_int;
17878 let mut time_6: c_float = readFloat(input);
17879 let mut mix: c_float = if flags & 1 as c_int != 0 as c_int {
17880 if flags & 2 as c_int != 0 as c_int {
17881 readFloat(input)
17882 } else {
17883 1 as c_int as c_float
17884 }
17885 } else {
17886 0 as c_int as c_float
17887 };
17888 let mut softness: c_float = if flags & 4 as c_int != 0 as c_int {
17889 readFloat(input) * scale
17890 } else {
17891 0 as c_int as c_float
17892 };
17893 frame = 0 as c_int;
17894 bezier = 0 as c_int;
17895 loop {
17896 spIkConstraintTimeline_setFrame(
17897 timeline_6,
17898 frame,
17899 time_6,
17900 mix,
17901 softness,
17902 if flags & 8 as c_int != 0 as c_int {
17903 1 as c_int
17904 } else {
17905 -(1 as c_int)
17906 },
17907 (flags & 16 as c_int != 0 as c_int) as c_int,
17908 (flags & 32 as c_int != 0 as c_int) as c_int,
17909 );
17910 if frame == frameLast_0 {
17911 break;
17912 }
17913 flags = readByte(input) as c_int;
17914 let mut time2_4: c_float = readFloat(input);
17915 let mut mix2: c_float = if flags & 1 as c_int != 0 as c_int {
17916 if flags & 2 as c_int != 0 as c_int {
17917 readFloat(input)
17918 } else {
17919 1 as c_int as c_float
17920 }
17921 } else {
17922 0 as c_int as c_float
17923 };
17924 let mut softness2: c_float = if flags & 4 as c_int != 0 as c_int {
17925 readFloat(input) * scale
17926 } else {
17927 0 as c_int as c_float
17928 };
17929 if flags & 64 as c_int != 0 as c_int {
17930 spCurveTimeline_setStepped(&mut (*timeline_6).super_0, frame);
17931 } else if flags & 128 as c_int != 0 as c_int {
17932 let fresh93 = bezier;
17933 bezier += 1;
17934 setBezierBinary(
17935 input,
17936 &mut (*timeline_6).super_0.super_0,
17937 fresh93,
17938 frame,
17939 0 as c_int,
17940 time_6,
17941 time2_4,
17942 mix,
17943 mix2,
17944 1 as c_int as c_float,
17945 );
17946 let fresh94 = bezier;
17947 bezier += 1;
17948 setBezierBinary(
17949 input,
17950 &mut (*timeline_6).super_0.super_0,
17951 fresh94,
17952 frame,
17953 1 as c_int,
17954 time_6,
17955 time2_4,
17956 softness,
17957 softness2,
17958 scale,
17959 );
17960 }
17961 time_6 = time2_4;
17962 mix = mix2;
17963 softness = softness2;
17964 frame += 1;
17965 }
17966 spTimelineArray_add(timelines, &mut (*timeline_6).super_0.super_0);
17967 i += 1;
17968 }
17969 i = 0 as c_int;
17970 n = readVarint(input, 1 as c_int);
17971 while i < n {
17972 let mut index_0: c_int = readVarint(input, 1 as c_int);
17973 let mut frameCount_2: c_int = readVarint(input, 1 as c_int);
17974 let mut frameLast_1: c_int = frameCount_2 - 1 as c_int;
17975 let mut bezierCount_6: c_int = readVarint(input, 1 as c_int);
17976 let mut timeline_7: *mut spTransformConstraintTimeline =
17977 spTransformConstraintTimeline_create(frameCount_2, bezierCount_6, index_0);
17978 let mut time_7: c_float = readFloat(input);
17979 let mut mixRotate: c_float = readFloat(input);
17980 let mut mixX: c_float = readFloat(input);
17981 let mut mixY: c_float = readFloat(input);
17982 let mut mixScaleX: c_float = readFloat(input);
17983 let mut mixScaleY: c_float = readFloat(input);
17984 let mut mixShearY: c_float = readFloat(input);
17985 frame = 0 as c_int;
17986 bezier = 0 as c_int;
17987 loop {
17988 let mut time2_5: c_float = 0.;
17989 let mut mixRotate2: c_float = 0.;
17990 let mut mixX2: c_float = 0.;
17991 let mut mixY2: c_float = 0.;
17992 let mut mixScaleX2: c_float = 0.;
17993 let mut mixScaleY2: c_float = 0.;
17994 let mut mixShearY2: c_float = 0.;
17995 spTransformConstraintTimeline_setFrame(
17996 timeline_7, frame, time_7, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY,
17997 );
17998 if frame == frameLast_1 {
17999 break;
18000 }
18001 time2_5 = readFloat(input);
18002 mixRotate2 = readFloat(input);
18003 mixX2 = readFloat(input);
18004 mixY2 = readFloat(input);
18005 mixScaleX2 = readFloat(input);
18006 mixScaleY2 = readFloat(input);
18007 mixShearY2 = readFloat(input);
18008 match readSByte(input) as c_int {
18009 1 => {
18010 spCurveTimeline_setStepped(&mut (*timeline_7).super_0, frame);
18011 }
18012 2 => {
18013 let fresh95 = bezier;
18014 bezier += 1;
18015 setBezierBinary(
18016 input,
18017 &mut (*timeline_7).super_0.super_0,
18018 fresh95,
18019 frame,
18020 0 as c_int,
18021 time_7,
18022 time2_5,
18023 mixRotate,
18024 mixRotate2,
18025 1 as c_int as c_float,
18026 );
18027 let fresh96 = bezier;
18028 bezier += 1;
18029 setBezierBinary(
18030 input,
18031 &mut (*timeline_7).super_0.super_0,
18032 fresh96,
18033 frame,
18034 1 as c_int,
18035 time_7,
18036 time2_5,
18037 mixX,
18038 mixX2,
18039 1 as c_int as c_float,
18040 );
18041 let fresh97 = bezier;
18042 bezier += 1;
18043 setBezierBinary(
18044 input,
18045 &mut (*timeline_7).super_0.super_0,
18046 fresh97,
18047 frame,
18048 2 as c_int,
18049 time_7,
18050 time2_5,
18051 mixY,
18052 mixY2,
18053 1 as c_int as c_float,
18054 );
18055 let fresh98 = bezier;
18056 bezier += 1;
18057 setBezierBinary(
18058 input,
18059 &mut (*timeline_7).super_0.super_0,
18060 fresh98,
18061 frame,
18062 3 as c_int,
18063 time_7,
18064 time2_5,
18065 mixScaleX,
18066 mixScaleX2,
18067 1 as c_int as c_float,
18068 );
18069 let fresh99 = bezier;
18070 bezier += 1;
18071 setBezierBinary(
18072 input,
18073 &mut (*timeline_7).super_0.super_0,
18074 fresh99,
18075 frame,
18076 4 as c_int,
18077 time_7,
18078 time2_5,
18079 mixScaleY,
18080 mixScaleY2,
18081 1 as c_int as c_float,
18082 );
18083 let fresh100 = bezier;
18084 bezier += 1;
18085 setBezierBinary(
18086 input,
18087 &mut (*timeline_7).super_0.super_0,
18088 fresh100,
18089 frame,
18090 5 as c_int,
18091 time_7,
18092 time2_5,
18093 mixShearY,
18094 mixShearY2,
18095 1 as c_int as c_float,
18096 );
18097 }
18098 _ => {}
18099 }
18100 time_7 = time2_5;
18101 mixRotate = mixRotate2;
18102 mixX = mixX2;
18103 mixY = mixY2;
18104 mixScaleX = mixScaleX2;
18105 mixScaleY = mixScaleY2;
18106 mixShearY = mixShearY2;
18107 frame += 1;
18108 }
18109 spTimelineArray_add(timelines, &mut (*timeline_7).super_0.super_0);
18110 i += 1;
18111 }
18112 i = 0 as c_int;
18113 n = readVarint(input, 1 as c_int);
18114 while i < n {
18115 let mut index_1: c_int = readVarint(input, 1 as c_int);
18116 let mut data: *mut spPathConstraintData =
18117 *((*skeletonData).pathConstraints).offset(index_1 as isize);
18118 ii = 0 as c_int;
18119 nn = readVarint(input, 1 as c_int);
18120 while ii < nn {
18121 let mut type_0: c_int = readByte(input) as c_int;
18122 let mut frameCount_3: c_int = readVarint(input, 1 as c_int);
18123 let mut bezierCount_7: c_int = readVarint(input, 1 as c_int);
18124 match type_0 {
18125 0 => {
18126 readTimelineBinary(
18127 input,
18128 timelines,
18129 &mut (*(spPathConstraintPositionTimeline_create
18130 as unsafe extern "C" fn(
18131 c_int,
18132 c_int,
18133 c_int,
18134 )
18135 -> *mut spPathConstraintPositionTimeline)(
18136 frameCount_3,
18137 bezierCount_7,
18138 index_1,
18139 ))
18140 .super_0,
18141 if (*data).positionMode as c_uint
18142 == SP_POSITION_MODE_FIXED as c_int as c_uint
18143 {
18144 scale
18145 } else {
18146 1 as c_int as c_float
18147 },
18148 );
18149 }
18150 1 => {
18151 readTimelineBinary(
18152 input,
18153 timelines,
18154 &mut (*(spPathConstraintSpacingTimeline_create
18155 as unsafe extern "C" fn(
18156 c_int,
18157 c_int,
18158 c_int,
18159 )
18160 -> *mut spPathConstraintSpacingTimeline)(
18161 frameCount_3,
18162 bezierCount_7,
18163 index_1,
18164 ))
18165 .super_0,
18166 if (*data).spacingMode as c_uint
18167 == SP_SPACING_MODE_LENGTH as c_int as c_uint
18168 || (*data).spacingMode as c_uint
18169 == SP_SPACING_MODE_FIXED as c_int as c_uint
18170 {
18171 scale
18172 } else {
18173 1 as c_int as c_float
18174 },
18175 );
18176 }
18177 2 => {
18178 let mut time_8: c_float = 0.;
18179 let mut mixRotate_0: c_float = 0.;
18180 let mut mixX_0: c_float = 0.;
18181 let mut mixY_0: c_float = 0.;
18182 let mut frameLast_2: c_int = 0;
18183 let mut timeline_8: *mut spPathConstraintMixTimeline =
18184 spPathConstraintMixTimeline_create(frameCount_3, bezierCount_7, index_1);
18185 time_8 = readFloat(input);
18186 mixRotate_0 = readFloat(input);
18187 mixX_0 = readFloat(input);
18188 mixY_0 = readFloat(input);
18189 frame = 0 as c_int;
18190 bezier = 0 as c_int;
18191 frameLast_2 = (*timeline_8).super_0.super_0.frameCount - 1 as c_int;
18192 loop {
18193 let mut time2_6: c_float = 0.;
18194 let mut mixRotate2_0: c_float = 0.;
18195 let mut mixX2_0: c_float = 0.;
18196 let mut mixY2_0: c_float = 0.;
18197 spPathConstraintMixTimeline_setFrame(
18198 timeline_8,
18199 frame,
18200 time_8,
18201 mixRotate_0,
18202 mixX_0,
18203 mixY_0,
18204 );
18205 if frame == frameLast_2 {
18206 break;
18207 }
18208 time2_6 = readFloat(input);
18209 mixRotate2_0 = readFloat(input);
18210 mixX2_0 = readFloat(input);
18211 mixY2_0 = readFloat(input);
18212 match readSByte(input) as c_int {
18213 1 => {
18214 spCurveTimeline_setStepped(&mut (*timeline_8).super_0, frame);
18215 }
18216 2 => {
18217 let fresh101 = bezier;
18218 bezier += 1;
18219 setBezierBinary(
18220 input,
18221 &mut (*timeline_8).super_0.super_0,
18222 fresh101,
18223 frame,
18224 0 as c_int,
18225 time_8,
18226 time2_6,
18227 mixRotate_0,
18228 mixRotate2_0,
18229 1 as c_int as c_float,
18230 );
18231 let fresh102 = bezier;
18232 bezier += 1;
18233 setBezierBinary(
18234 input,
18235 &mut (*timeline_8).super_0.super_0,
18236 fresh102,
18237 frame,
18238 1 as c_int,
18239 time_8,
18240 time2_6,
18241 mixX_0,
18242 mixX2_0,
18243 1 as c_int as c_float,
18244 );
18245 let fresh103 = bezier;
18246 bezier += 1;
18247 setBezierBinary(
18248 input,
18249 &mut (*timeline_8).super_0.super_0,
18250 fresh103,
18251 frame,
18252 2 as c_int,
18253 time_8,
18254 time2_6,
18255 mixY_0,
18256 mixY2_0,
18257 1 as c_int as c_float,
18258 );
18259 }
18260 _ => {}
18261 }
18262 time_8 = time2_6;
18263 mixRotate_0 = mixRotate2_0;
18264 mixX_0 = mixX2_0;
18265 mixY_0 = mixY2_0;
18266 frame += 1;
18267 }
18268 spTimelineArray_add(timelines, &mut (*timeline_8).super_0.super_0);
18269 }
18270 _ => {}
18271 }
18272 ii += 1;
18273 }
18274 i += 1;
18275 }
18276 i = 0 as c_int;
18277 n = readVarint(input, 1 as c_int);
18278 while i < n {
18279 let mut index_2: c_int = readVarint(input, 1 as c_int) - 1 as c_int;
18280 ii = 0 as c_int;
18281 nn = readVarint(input, 1 as c_int);
18282 while ii < nn {
18283 let mut type_1: c_int = readByte(input) as c_int;
18284 let mut frameCount_4: c_int = readVarint(input, 1 as c_int);
18285 if type_1 == 8 as c_int {
18286 let mut timeline_9: *mut spPhysicsConstraintResetTimeline =
18287 spPhysicsConstraintResetTimeline_create(frameCount_4, index_2);
18288 frame = 0 as c_int;
18289 while frame < frameCount_4 {
18290 spPhysicsConstraintResetTimeline_setFrame(timeline_9, frame, readFloat(input));
18291 frame += 1;
18292 }
18293 spTimelineArray_add(timelines, &mut (*timeline_9).super_0);
18294 } else {
18295 let mut bezierCount_8: c_int = readVarint(input, 1 as c_int);
18296 match type_1 {
18297 0 => {
18298 readTimelineBinary(
18299 input,
18300 timelines,
18301 &mut (*(spPhysicsConstraintTimeline_create
18302 as unsafe extern "C" fn(
18303 c_int,
18304 c_int,
18305 c_int,
18306 spTimelineType,
18307 )
18308 -> *mut spPhysicsConstraintTimeline)(
18309 frameCount_4,
18310 bezierCount_8,
18311 index_2,
18312 SP_TIMELINE_PHYSICSCONSTRAINT_INERTIA,
18313 ))
18314 .super_0,
18315 1 as c_int as c_float,
18316 );
18317 }
18318 1 => {
18319 readTimelineBinary(
18320 input,
18321 timelines,
18322 &mut (*(spPhysicsConstraintTimeline_create
18323 as unsafe extern "C" fn(
18324 c_int,
18325 c_int,
18326 c_int,
18327 spTimelineType,
18328 )
18329 -> *mut spPhysicsConstraintTimeline)(
18330 frameCount_4,
18331 bezierCount_8,
18332 index_2,
18333 SP_TIMELINE_PHYSICSCONSTRAINT_STRENGTH,
18334 ))
18335 .super_0,
18336 1 as c_int as c_float,
18337 );
18338 }
18339 2 => {
18340 readTimelineBinary(
18341 input,
18342 timelines,
18343 &mut (*(spPhysicsConstraintTimeline_create
18344 as unsafe extern "C" fn(
18345 c_int,
18346 c_int,
18347 c_int,
18348 spTimelineType,
18349 )
18350 -> *mut spPhysicsConstraintTimeline)(
18351 frameCount_4,
18352 bezierCount_8,
18353 index_2,
18354 SP_TIMELINE_PHYSICSCONSTRAINT_DAMPING,
18355 ))
18356 .super_0,
18357 1 as c_int as c_float,
18358 );
18359 }
18360 4 => {
18361 readTimelineBinary(
18362 input,
18363 timelines,
18364 &mut (*(spPhysicsConstraintTimeline_create
18365 as unsafe extern "C" fn(
18366 c_int,
18367 c_int,
18368 c_int,
18369 spTimelineType,
18370 )
18371 -> *mut spPhysicsConstraintTimeline)(
18372 frameCount_4,
18373 bezierCount_8,
18374 index_2,
18375 SP_TIMELINE_PHYSICSCONSTRAINT_MASS,
18376 ))
18377 .super_0,
18378 1 as c_int as c_float,
18379 );
18380 }
18381 5 => {
18382 readTimelineBinary(
18383 input,
18384 timelines,
18385 &mut (*(spPhysicsConstraintTimeline_create
18386 as unsafe extern "C" fn(
18387 c_int,
18388 c_int,
18389 c_int,
18390 spTimelineType,
18391 )
18392 -> *mut spPhysicsConstraintTimeline)(
18393 frameCount_4,
18394 bezierCount_8,
18395 index_2,
18396 SP_TIMELINE_PHYSICSCONSTRAINT_WIND,
18397 ))
18398 .super_0,
18399 1 as c_int as c_float,
18400 );
18401 }
18402 6 => {
18403 readTimelineBinary(
18404 input,
18405 timelines,
18406 &mut (*(spPhysicsConstraintTimeline_create
18407 as unsafe extern "C" fn(
18408 c_int,
18409 c_int,
18410 c_int,
18411 spTimelineType,
18412 )
18413 -> *mut spPhysicsConstraintTimeline)(
18414 frameCount_4,
18415 bezierCount_8,
18416 index_2,
18417 SP_TIMELINE_PHYSICSCONSTRAINT_GRAVITY,
18418 ))
18419 .super_0,
18420 1 as c_int as c_float,
18421 );
18422 }
18423 7 => {
18424 readTimelineBinary(
18425 input,
18426 timelines,
18427 &mut (*(spPhysicsConstraintTimeline_create
18428 as unsafe extern "C" fn(
18429 c_int,
18430 c_int,
18431 c_int,
18432 spTimelineType,
18433 )
18434 -> *mut spPhysicsConstraintTimeline)(
18435 frameCount_4,
18436 bezierCount_8,
18437 index_2,
18438 SP_TIMELINE_PHYSICSCONSTRAINT_MIX,
18439 ))
18440 .super_0,
18441 1 as c_int as c_float,
18442 );
18443 }
18444 _ => {}
18445 }
18446 }
18447 ii += 1;
18448 }
18449 i += 1;
18450 }
18451 i = 0 as c_int;
18452 n = readVarint(input, 1 as c_int);
18453 while i < n {
18454 let mut skin: *mut spSkin =
18455 *((*skeletonData).skins).offset(readVarint(input, 1 as c_int) as isize);
18456 ii = 0 as c_int;
18457 nn = readVarint(input, 1 as c_int);
18458 while ii < nn {
18459 let mut slotIndex_0: c_int = readVarint(input, 1 as c_int);
18460 iii = 0 as c_int;
18461 nnn = readVarint(input, 1 as c_int);
18462 while iii < nnn {
18463 let mut frameCount_5: c_int = 0;
18464 let mut frameLast_3: c_int = 0;
18465 let mut bezierCount_9: c_int = 0;
18466 let mut time_9: c_float = 0.;
18467 let mut time2_7: c_float = 0.;
18468 let mut timelineType_1: c_uint = 0;
18469 let mut attachmentName_0: *const c_char = readStringRef(input, skeletonData);
18470 let mut attachment: *mut spVertexAttachment =
18471 spSkin_getAttachment(skin, slotIndex_0, attachmentName_0)
18472 .cast::<spVertexAttachment>();
18473 if attachment.is_null() {
18474 i = 0 as c_int;
18475 while i < (*timelines).size {
18476 spTimeline_dispose(*((*timelines).items).offset(i as isize));
18477 i += 1;
18478 }
18479 spTimelineArray_dispose(timelines);
18480 _spSkeletonBinary_setError(
18481 self_0,
18482 (b"Attachment not found: \0" as *const u8).cast::<c_char>(),
18483 attachmentName_0,
18484 );
18485 return std::ptr::null_mut::<spAnimation>();
18486 }
18487 timelineType_1 = readByte(input) as c_uint;
18488 frameCount_5 = readVarint(input, 1 as c_int);
18489 frameLast_3 = frameCount_5 - 1 as c_int;
18490 match timelineType_1 {
18491 0 => {
18492 let mut tempDeform: *mut c_float = std::ptr::null_mut::<c_float>();
18493 let mut weighted: c_int = 0;
18494 let mut deformLength: c_int = 0;
18495 let mut timeline_10: *mut spDeformTimeline =
18496 std::ptr::null_mut::<spDeformTimeline>();
18497 weighted = ((*attachment).bones != std::ptr::null_mut::<c_int>()) as c_int;
18498 deformLength = if weighted != 0 {
18499 (*attachment).verticesCount / 3 as c_int * 2 as c_int
18500 } else {
18501 (*attachment).verticesCount
18502 };
18503 tempDeform = _spMalloc(
18504 (::core::mem::size_of::<c_float>() as c_ulong)
18505 .wrapping_mul(deformLength as c_ulong),
18506 (b"spine.c\0" as *const u8).cast::<c_char>(),
18507 9864 as c_int,
18508 )
18509 .cast::<c_float>();
18510 bezierCount_9 = readVarint(input, 1 as c_int);
18511 timeline_10 = spDeformTimeline_create(
18512 frameCount_5,
18513 deformLength,
18514 bezierCount_9,
18515 slotIndex_0,
18516 attachment,
18517 );
18518 time_9 = readFloat(input);
18519 frame = 0 as c_int;
18520 bezier = 0 as c_int;
18521 loop {
18522 let mut deform: *mut c_float = std::ptr::null_mut::<c_float>();
18523 let mut end: c_int = readVarint(input, 1 as c_int);
18524 if end == 0 {
18525 if weighted != 0 {
18526 deform = tempDeform;
18527 spine_memset(
18528 deform.cast::<c_void>(),
18529 0 as c_int,
18530 (::core::mem::size_of::<c_float>() as c_ulong)
18531 .wrapping_mul(deformLength as c_ulong),
18532 );
18533 } else {
18534 deform = (*attachment).vertices;
18535 }
18536 } else {
18537 let mut v: c_int = 0;
18538 let mut start: c_int = readVarint(input, 1 as c_int);
18539 deform = tempDeform;
18540 spine_memset(
18541 deform.cast::<c_void>(),
18542 0 as c_int,
18543 (::core::mem::size_of::<c_float>() as c_ulong)
18544 .wrapping_mul(start as c_ulong),
18545 );
18546 end += start;
18547 if (*self_0).scale == 1 as c_int as c_float {
18548 v = start;
18549 while v < end {
18550 *deform.offset(v as isize) = readFloat(input);
18551 v += 1;
18552 }
18553 } else {
18554 v = start;
18555 while v < end {
18556 *deform.offset(v as isize) =
18557 readFloat(input) * (*self_0).scale;
18558 v += 1;
18559 }
18560 }
18561 spine_memset(
18562 deform.offset(v as isize).cast::<c_void>(),
18563 0 as c_int,
18564 (::core::mem::size_of::<c_float>() as c_ulong)
18565 .wrapping_mul((deformLength - v) as c_ulong),
18566 );
18567 if weighted == 0 {
18568 let mut vertices: *mut c_float = (*attachment).vertices;
18569 v = 0 as c_int;
18570 while v < deformLength {
18571 *deform.offset(v as isize) += *vertices.offset(v as isize);
18572 v += 1;
18573 }
18574 }
18575 }
18576 spDeformTimeline_setFrame(timeline_10, frame, time_9, deform);
18577 if frame == frameLast_3 {
18578 break;
18579 }
18580 time2_7 = readFloat(input);
18581 match readSByte(input) as c_int {
18582 1 => {
18583 spCurveTimeline_setStepped(&mut (*timeline_10).super_0, frame);
18584 }
18585 2 => {
18586 let fresh104 = bezier;
18587 bezier += 1;
18588 setBezierBinary(
18589 input,
18590 &mut (*timeline_10).super_0.super_0,
18591 fresh104,
18592 frame,
18593 0 as c_int,
18594 time_9,
18595 time2_7,
18596 0 as c_int as c_float,
18597 1 as c_int as c_float,
18598 1 as c_int as c_float,
18599 );
18600 }
18601 _ => {}
18602 }
18603 time_9 = time2_7;
18604 frame += 1;
18605 }
18606 _spFree(tempDeform.cast::<c_void>());
18607 spTimelineArray_add(timelines, timeline_10.cast::<spTimeline>());
18608 }
18609 1 => {
18610 let mut modeAndIndex: c_int = 0;
18611 let mut delay: c_float = 0.;
18612 let mut timeline_11: *mut spSequenceTimeline = spSequenceTimeline_create(
18613 frameCount_5,
18614 slotIndex_0,
18615 attachment.cast::<spAttachment>(),
18616 );
18617 frame = 0 as c_int;
18618 while frame < frameCount_5 {
18619 time_9 = readFloat(input);
18620 modeAndIndex = readInt(input);
18621 delay = readFloat(input);
18622 spSequenceTimeline_setFrame(
18623 timeline_11,
18624 frame,
18625 time_9,
18626 modeAndIndex & 0xf as c_int,
18627 modeAndIndex >> 4 as c_int,
18628 delay,
18629 );
18630 frame += 1;
18631 }
18632 spTimelineArray_add(timelines, timeline_11.cast::<spTimeline>());
18633 }
18634 _ => {}
18635 }
18636 iii += 1;
18637 }
18638 ii += 1;
18639 }
18640 i += 1;
18641 }
18642 drawOrderCount = readVarint(input, 1 as c_int);
18643 if drawOrderCount != 0 {
18644 let mut timeline_12: *mut spDrawOrderTimeline =
18645 spDrawOrderTimeline_create(drawOrderCount, (*skeletonData).slotsCount);
18646 i = 0 as c_int;
18647 while i < drawOrderCount {
18648 let mut time_10: c_float = readFloat(input);
18649 let mut offsetCount: c_int = readVarint(input, 1 as c_int);
18650 let mut drawOrder: *mut c_int = _spMalloc(
18651 (::core::mem::size_of::<c_int>() as c_ulong)
18652 .wrapping_mul((*skeletonData).slotsCount as c_ulong),
18653 (b"spine.c\0" as *const u8).cast::<c_char>(),
18654 9941 as c_int,
18655 )
18656 .cast::<c_int>();
18657 let mut unchanged: *mut c_int = _spMalloc(
18658 (::core::mem::size_of::<c_int>() as c_ulong)
18659 .wrapping_mul(((*skeletonData).slotsCount - offsetCount) as c_ulong),
18660 (b"spine.c\0" as *const u8).cast::<c_char>(),
18661 9942 as c_int,
18662 )
18663 .cast::<c_int>();
18664 let mut originalIndex: c_int = 0 as c_int;
18665 let mut unchangedIndex: c_int = 0 as c_int;
18666 spine_memset(
18667 drawOrder.cast::<c_void>(),
18668 -(1 as c_int),
18669 (::core::mem::size_of::<c_int>() as c_ulong)
18670 .wrapping_mul((*skeletonData).slotsCount as c_ulong),
18671 );
18672 ii = 0 as c_int;
18673 while ii < offsetCount {
18674 let mut slotIndex_1: c_int = readVarint(input, 1 as c_int);
18675 while originalIndex != slotIndex_1 {
18676 let fresh105 = originalIndex;
18677 originalIndex += 1;
18678 let fresh106 = unchangedIndex;
18679 unchangedIndex += 1;
18680 *unchanged.offset(fresh106 as isize) = fresh105;
18681 }
18682 *drawOrder.offset((originalIndex + readVarint(input, 1 as c_int)) as isize) =
18683 originalIndex;
18684 originalIndex += 1;
18685 ii += 1;
18686 }
18687 while originalIndex < (*skeletonData).slotsCount {
18688 let fresh107 = originalIndex;
18689 originalIndex += 1;
18690 let fresh108 = unchangedIndex;
18691 unchangedIndex += 1;
18692 *unchanged.offset(fresh108 as isize) = fresh107;
18693 }
18694 ii = (*skeletonData).slotsCount - 1 as c_int;
18695 while ii >= 0 as c_int {
18696 if *drawOrder.offset(ii as isize) == -(1 as c_int) {
18697 unchangedIndex -= 1;
18698 *drawOrder.offset(ii as isize) = *unchanged.offset(unchangedIndex as isize);
18699 }
18700 ii -= 1;
18701 }
18702 _spFree(unchanged.cast::<c_void>());
18703 spDrawOrderTimeline_setFrame(timeline_12, i, time_10, drawOrder);
18704 _spFree(drawOrder.cast::<c_void>());
18705 i += 1;
18706 }
18707 spTimelineArray_add(timelines, timeline_12.cast::<spTimeline>());
18708 }
18709 eventCount = readVarint(input, 1 as c_int);
18710 if eventCount != 0 {
18711 let mut timeline_13: *mut spEventTimeline = spEventTimeline_create(eventCount);
18712 i = 0 as c_int;
18713 while i < eventCount {
18714 let mut time_11: c_float = readFloat(input);
18715 let mut eventData: *mut spEventData =
18716 *((*skeletonData).events).offset(readVarint(input, 1 as c_int) as isize);
18717 let mut event: *mut spEvent = spEvent_create(time_11, eventData);
18718 (*event).intValue = readVarint(input, 0 as c_int);
18719 (*event).floatValue = readFloat(input);
18720 let mut event_stringValue: *const c_char = readString(input);
18721 if event_stringValue.is_null() {
18722 (*event).stringValue = string_copy((*eventData).stringValue);
18723 } else {
18724 (*event).stringValue = string_copy(event_stringValue);
18725 _spFree(event_stringValue as *mut c_void);
18726 }
18727 if !((*eventData).audioPath).is_null() {
18728 (*event).volume = readFloat(input);
18729 (*event).balance = readFloat(input);
18730 }
18731 spEventTimeline_setFrame(timeline_13, i, event);
18732 i += 1;
18733 }
18734 spTimelineArray_add(timelines, timeline_13.cast::<spTimeline>());
18735 }
18736 duration = 0 as c_int as c_float;
18737 i = 0 as c_int;
18738 n = (*timelines).size;
18739 while i < n {
18740 duration = if duration > spTimeline_getDuration(*((*timelines).items).offset(i as isize)) {
18741 duration
18742 } else {
18743 spTimeline_getDuration(*((*timelines).items).offset(i as isize))
18744 };
18745 i += 1;
18746 }
18747 animation = spAnimation_create(name, timelines, duration);
18748 animation
18749}
18750unsafe extern "C" fn _readFloatArray(
18751 mut input: *mut _dataInput,
18752 mut n: c_int,
18753 mut scale: c_float,
18754) -> *mut c_float {
18755 let mut array: *mut c_float = _spMalloc(
18756 (::core::mem::size_of::<c_float>() as c_ulong).wrapping_mul(n as c_ulong),
18757 (b"spine.c\0" as *const u8).cast::<c_char>(),
18758 9999 as c_int,
18759 )
18760 .cast::<c_float>();
18761 let mut i: c_int = 0;
18762 if scale == 1 as c_int as c_float {
18763 i = 0 as c_int;
18764 while i < n {
18765 *array.offset(i as isize) = readFloat(input);
18766 i += 1;
18767 }
18768 } else {
18769 i = 0 as c_int;
18770 while i < n {
18771 *array.offset(i as isize) = readFloat(input) * scale;
18772 i += 1;
18773 }
18774 }
18775 array
18776}
18777unsafe extern "C" fn _readShortArray(mut input: *mut _dataInput, mut n: c_int) -> *mut c_ushort {
18778 let mut array: *mut c_ushort = _spMalloc(
18779 (::core::mem::size_of::<c_ushort>() as c_ulong).wrapping_mul(n as c_ulong),
18780 (b"spine.c\0" as *const u8).cast::<c_char>(),
18781 10011 as c_int,
18782 )
18783 .cast::<c_ushort>();
18784 let mut i: c_int = 0;
18785 i = 0 as c_int;
18786 while i < n {
18787 *array.offset(i as isize) = readVarint(input, 1 as c_int) as c_ushort;
18788 i += 1;
18789 }
18790 array
18791}
18792unsafe extern "C" fn _readVerticesBinary(
18793 mut input: *mut _dataInput,
18794 mut vertices: *mut *mut c_float,
18795 mut verticesLength: *mut c_int,
18796 mut bones: *mut *mut c_int,
18797 mut bonesCount: *mut c_int,
18798 mut weighted: c_int,
18799 mut scale: c_float,
18800) -> c_int {
18801 let mut vertexCount: c_int = readVarint(input, 1 as c_int);
18802 *verticesLength = vertexCount << 1 as c_int;
18803 if weighted == 0 {
18804 *vertices = _readFloatArray(input, *verticesLength, scale);
18805 *bones = std::ptr::null_mut::<c_int>();
18806 *bonesCount = 0 as c_int;
18807 return *verticesLength;
18808 }
18809 let mut v: *mut c_float = _spMalloc(
18810 (::core::mem::size_of::<c_float>() as c_ulong)
18811 .wrapping_mul((*verticesLength * 3 as c_int * 3 as c_int) as c_ulong),
18812 (b"spine.c\0" as *const u8).cast::<c_char>(),
18813 10029 as c_int,
18814 )
18815 .cast::<c_float>();
18816 let mut b: *mut c_int = _spMalloc(
18817 (::core::mem::size_of::<c_int>() as c_ulong)
18818 .wrapping_mul((*verticesLength * 3 as c_int) as c_ulong),
18819 (b"spine.c\0" as *const u8).cast::<c_char>(),
18820 10030 as c_int,
18821 )
18822 .cast::<c_int>();
18823 let mut boneIdx: c_int = 0 as c_int;
18824 let mut vertexIdx: c_int = 0 as c_int;
18825 let mut i: c_int = 0 as c_int;
18826 while i < vertexCount {
18827 let mut boneCount: c_int = readVarint(input, 1 as c_int);
18828 let fresh109 = boneIdx;
18829 boneIdx += 1;
18830 *b.offset(fresh109 as isize) = boneCount;
18831 let mut ii: c_int = 0 as c_int;
18832 while ii < boneCount {
18833 let fresh110 = boneIdx;
18834 boneIdx += 1;
18835 *b.offset(fresh110 as isize) = readVarint(input, 1 as c_int);
18836 let fresh111 = vertexIdx;
18837 vertexIdx += 1;
18838 *v.offset(fresh111 as isize) = readFloat(input) * scale;
18839 let fresh112 = vertexIdx;
18840 vertexIdx += 1;
18841 *v.offset(fresh112 as isize) = readFloat(input) * scale;
18842 let fresh113 = vertexIdx;
18843 vertexIdx += 1;
18844 *v.offset(fresh113 as isize) = readFloat(input);
18845 ii += 1;
18846 }
18847 i += 1;
18848 }
18849 *vertices = v;
18850 *bones = b;
18851 *bonesCount = boneIdx;
18852 *verticesLength = vertexIdx;
18853 vertexCount << 1 as c_int
18854}
18855#[no_mangle]
18856pub unsafe extern "C" fn spSkeletonBinary_readAttachment(
18857 mut self_0: *mut spSkeletonBinary,
18858 mut input: *mut _dataInput,
18859 mut skin: *mut spSkin,
18860 mut slotIndex: c_int,
18861 mut attachmentName: *const c_char,
18862 mut skeletonData: *mut spSkeletonData,
18863 mut nonessential: c_int,
18864) -> *mut spAttachment {
18865 let mut flags: c_int = readByte(input) as c_int;
18866 let mut name: *const c_char = if flags & 8 as c_int != 0 as c_int {
18867 readStringRef(input, skeletonData).cast_const()
18868 } else {
18869 attachmentName
18870 };
18871 let mut type_0: spAttachmentType = (flags & 0x7 as c_int) as spAttachmentType;
18872 match type_0 as c_uint {
18873 0 => {
18874 let mut path: *mut c_char = if flags & 16 as c_int != 0 as c_int {
18875 readStringRef(input, skeletonData)
18876 } else {
18877 name.cast_mut()
18878 };
18879 path = string_copy(path);
18880 let mut color: spColor = spColor {
18881 r: 0.,
18882 g: 0.,
18883 b: 0.,
18884 a: 0.,
18885 };
18886 spColor_setFromFloats(
18887 &mut color,
18888 1 as c_int as c_float,
18889 1 as c_int as c_float,
18890 1 as c_int as c_float,
18891 1 as c_int as c_float,
18892 );
18893 if flags & 32 as c_int != 0 as c_int {
18894 readColor(
18895 input,
18896 &mut color.r,
18897 &mut color.g,
18898 &mut color.b,
18899 &mut color.a,
18900 );
18901 }
18902 let mut sequence: *mut spSequence = if flags & 64 as c_int != 0 as c_int {
18903 readSequenceBinary(input)
18904 } else {
18905 std::ptr::null_mut::<spSequence>()
18906 };
18907 let mut rotation: c_float = if flags & 128 as c_int != 0 as c_int {
18908 readFloat(input)
18909 } else {
18910 0 as c_int as c_float
18911 };
18912 let mut x: c_float = readFloat(input) * (*self_0).scale;
18913 let mut y: c_float = readFloat(input) * (*self_0).scale;
18914 let mut scaleX: c_float = readFloat(input);
18915 let mut scaleY: c_float = readFloat(input);
18916 let mut width: c_float = readFloat(input) * (*self_0).scale;
18917 let mut height: c_float = readFloat(input) * (*self_0).scale;
18918 let mut region: *mut spRegionAttachment = spAttachmentLoader_createAttachment(
18919 (*self_0).attachmentLoader,
18920 skin,
18921 type_0,
18922 name,
18923 path,
18924 sequence,
18925 )
18926 .cast::<spRegionAttachment>();
18927 (*region).path = path;
18928 (*region).rotation = rotation;
18929 (*region).x = x;
18930 (*region).y = y;
18931 (*region).scaleX = scaleX;
18932 (*region).scaleY = scaleY;
18933 (*region).width = width;
18934 (*region).height = height;
18935 spColor_setFromColor(&mut (*region).color, &mut color);
18936 (*region).sequence = sequence;
18937 if sequence.is_null() {
18938 spRegionAttachment_updateRegion(region);
18939 }
18940 spAttachmentLoader_configureAttachment(
18941 (*self_0).attachmentLoader,
18942 &mut (*region).super_0,
18943 );
18944 return &mut (*region).super_0;
18945 }
18946 1 => {
18947 let mut box_0: *mut spBoundingBoxAttachment = spAttachmentLoader_createAttachment(
18948 (*self_0).attachmentLoader,
18949 skin,
18950 type_0,
18951 name,
18952 std::ptr::null::<c_char>(),
18953 std::ptr::null_mut::<spSequence>(),
18954 )
18955 .cast::<spBoundingBoxAttachment>();
18956 if box_0.is_null() {
18957 return std::ptr::null_mut::<spAttachment>();
18958 }
18959 _readVerticesBinary(
18960 input,
18961 &mut (*box_0).super_0.vertices,
18962 &mut (*box_0).super_0.verticesCount,
18963 &mut (*box_0).super_0.bones,
18964 &mut (*box_0).super_0.bonesCount,
18965 (flags & 16 as c_int != 0 as c_int) as c_int,
18966 (*self_0).scale,
18967 );
18968 (*box_0).super_0.worldVerticesLength = (*box_0).super_0.verticesCount;
18969 if nonessential != 0 {
18970 readColor(
18971 input,
18972 &mut (*box_0).color.r,
18973 &mut (*box_0).color.g,
18974 &mut (*box_0).color.b,
18975 &mut (*box_0).color.a,
18976 );
18977 }
18978 spAttachmentLoader_configureAttachment(
18979 (*self_0).attachmentLoader,
18980 &mut (*box_0).super_0.super_0,
18981 );
18982 return &mut (*box_0).super_0.super_0;
18983 }
18984 2 => {
18985 let mut uvs: *mut c_float = std::ptr::null_mut::<c_float>();
18986 let mut uvsCount: c_int = 0 as c_int;
18987 let mut triangles: *mut c_ushort = std::ptr::null_mut::<c_ushort>();
18988 let mut trianglesCount: c_int = 0 as c_int;
18989 let mut vertices: *mut c_float = std::ptr::null_mut::<c_float>();
18990 let mut verticesCount: c_int = 0 as c_int;
18991 let mut bones: *mut c_int = std::ptr::null_mut::<c_int>();
18992 let mut bonesCount: c_int = 0 as c_int;
18993 let mut hullLength: c_int = 0 as c_int;
18994 let mut width_0: c_float = 0 as c_int as c_float;
18995 let mut height_0: c_float = 0 as c_int as c_float;
18996 let mut edges: *mut c_ushort = std::ptr::null_mut::<c_ushort>();
18997 let mut edgesCount: c_int = 0 as c_int;
18998 let mut path_0: *mut c_char = if flags & 16 as c_int != 0 as c_int {
18999 readStringRef(input, skeletonData)
19000 } else {
19001 name.cast_mut()
19002 };
19003 path_0 = string_copy(path_0);
19004 let mut color_0: spColor = spColor {
19005 r: 0.,
19006 g: 0.,
19007 b: 0.,
19008 a: 0.,
19009 };
19010 spColor_setFromFloats(
19011 &mut color_0,
19012 1 as c_int as c_float,
19013 1 as c_int as c_float,
19014 1 as c_int as c_float,
19015 1 as c_int as c_float,
19016 );
19017 if flags & 32 as c_int != 0 as c_int {
19018 readColor(
19019 input,
19020 &mut color_0.r,
19021 &mut color_0.g,
19022 &mut color_0.b,
19023 &mut color_0.a,
19024 );
19025 }
19026 let mut sequence_0: *mut spSequence = if flags & 64 as c_int != 0 as c_int {
19027 readSequenceBinary(input)
19028 } else {
19029 std::ptr::null_mut::<spSequence>()
19030 };
19031 hullLength = readVarint(input, 1 as c_int);
19032 let mut verticesLength: c_int = _readVerticesBinary(
19033 input,
19034 &mut vertices,
19035 &mut verticesCount,
19036 &mut bones,
19037 &mut bonesCount,
19038 (flags & 128 as c_int != 0 as c_int) as c_int,
19039 (*self_0).scale,
19040 );
19041 uvsCount = verticesLength;
19042 uvs = _readFloatArray(input, uvsCount, 1 as c_int as c_float);
19043 trianglesCount = (verticesLength - hullLength - 2 as c_int) * 3 as c_int;
19044 triangles = _readShortArray(input, trianglesCount);
19045 if nonessential != 0 {
19046 edgesCount = readVarint(input, 1 as c_int);
19047 edges = _readShortArray(input, edgesCount);
19048 width_0 = readFloat(input);
19049 height_0 = readFloat(input);
19050 }
19051 let mut attachment: *mut spAttachment = spAttachmentLoader_createAttachment(
19052 (*self_0).attachmentLoader,
19053 skin,
19054 type_0,
19055 name,
19056 path_0,
19057 sequence_0,
19058 );
19059 if attachment.is_null() {
19060 return std::ptr::null_mut::<spAttachment>();
19061 }
19062 let mut mesh: *mut spMeshAttachment = attachment.cast::<spMeshAttachment>();
19063 (*mesh).path = path_0;
19064 spColor_setFromColor(&mut (*mesh).color, &mut color_0);
19065 (*mesh).regionUVs = uvs;
19066 (*mesh).triangles = triangles;
19067 (*mesh).trianglesCount = trianglesCount;
19068 (*mesh).super_0.vertices = vertices;
19069 (*mesh).super_0.verticesCount = verticesCount;
19070 (*mesh).super_0.bones = bones;
19071 (*mesh).super_0.bonesCount = bonesCount;
19072 (*mesh).super_0.worldVerticesLength = verticesLength;
19073 (*mesh).hullLength = hullLength;
19074 (*mesh).edges = edges;
19075 (*mesh).edgesCount = edgesCount;
19076 (*mesh).width = width_0;
19077 (*mesh).height = height_0;
19078 (*mesh).sequence = sequence_0;
19079 if sequence_0.is_null() {
19080 spMeshAttachment_updateRegion(mesh);
19081 }
19082 spAttachmentLoader_configureAttachment((*self_0).attachmentLoader, attachment);
19083 return attachment;
19084 }
19085 3 => {
19086 let mut path_1: *mut c_char = if flags & 16 as c_int != 0 as c_int {
19087 readStringRef(input, skeletonData)
19088 } else {
19089 name.cast_mut()
19090 };
19091 path_1 = string_copy(path_1);
19092 let mut color_1: spColor = spColor {
19093 r: 0.,
19094 g: 0.,
19095 b: 0.,
19096 a: 0.,
19097 };
19098 spColor_setFromFloats(
19099 &mut color_1,
19100 1 as c_int as c_float,
19101 1 as c_int as c_float,
19102 1 as c_int as c_float,
19103 1 as c_int as c_float,
19104 );
19105 if flags & 32 as c_int != 0 as c_int {
19106 readColor(
19107 input,
19108 &mut color_1.r,
19109 &mut color_1.g,
19110 &mut color_1.b,
19111 &mut color_1.a,
19112 );
19113 }
19114 let mut sequence_1: *mut spSequence = if flags & 64 as c_int != 0 as c_int {
19115 readSequenceBinary(input)
19116 } else {
19117 std::ptr::null_mut::<spSequence>()
19118 };
19119 let mut inheritTimelines: c_int = (flags & 128 as c_int != 0 as c_int) as c_int;
19120 let mut skinIndex: c_int = readVarint(input, 1 as c_int);
19121 let mut parent: *mut c_char = readStringRef(input, skeletonData);
19122 let mut width_1: c_float = 0 as c_int as c_float;
19123 let mut height_1: c_float = 0 as c_int as c_float;
19124 if nonessential != 0 {
19125 width_1 = readFloat(input) * (*self_0).scale;
19126 height_1 = readFloat(input) * (*self_0).scale;
19127 }
19128 let mut attachment_0: *mut spAttachment = spAttachmentLoader_createAttachment(
19129 (*self_0).attachmentLoader,
19130 skin,
19131 type_0,
19132 name,
19133 path_1,
19134 sequence_1,
19135 );
19136 let mut mesh_0: *mut spMeshAttachment = std::ptr::null_mut::<spMeshAttachment>();
19137 if attachment_0.is_null() {
19138 return std::ptr::null_mut::<spAttachment>();
19139 }
19140 mesh_0 = attachment_0.cast::<spMeshAttachment>();
19141 (*mesh_0).path = path_1;
19142 if !((*mesh_0).path).is_null() {
19143 let mut tmp: *mut c_char = std::ptr::null_mut::<c_char>();
19144 tmp = _spMalloc(
19145 (::core::mem::size_of::<c_char>() as c_ulong).wrapping_mul(
19146 (spine_strlen((*mesh_0).path)).wrapping_add(1 as c_int as c_ulong),
19147 ),
19148 (b"spine.c\0" as *const u8).cast::<c_char>(),
19149 10182 as c_int,
19150 )
19151 .cast::<c_char>();
19152 spine_strcpy(tmp, (*mesh_0).path);
19153 (*mesh_0).path = tmp;
19154 }
19155 spColor_setFromColor(&mut (*mesh_0).color, &mut color_1);
19156 (*mesh_0).sequence = sequence_1;
19157 (*mesh_0).width = width_1;
19158 (*mesh_0).height = height_1;
19159 _spSkeletonBinary_addLinkedMesh(
19160 self_0,
19161 mesh_0,
19162 skinIndex,
19163 slotIndex,
19164 parent,
19165 inheritTimelines,
19166 );
19167 return attachment_0;
19168 }
19169 4 => {
19170 let mut attachment_1: *mut spAttachment = spAttachmentLoader_createAttachment(
19171 (*self_0).attachmentLoader,
19172 skin,
19173 type_0,
19174 name,
19175 std::ptr::null::<c_char>(),
19176 std::ptr::null_mut::<spSequence>(),
19177 );
19178 let mut path_2: *mut spPathAttachment = std::ptr::null_mut::<spPathAttachment>();
19179 if attachment_1.is_null() {
19180 return std::ptr::null_mut::<spAttachment>();
19181 }
19182 path_2 = attachment_1.cast::<spPathAttachment>();
19183 (*path_2).closed = (flags & 16 as c_int != 0 as c_int) as c_int;
19184 (*path_2).constantSpeed = (flags & 32 as c_int != 0 as c_int) as c_int;
19185 let mut verticesLength_0: c_int = _readVerticesBinary(
19186 input,
19187 &mut (*path_2).super_0.vertices,
19188 &mut (*path_2).super_0.verticesCount,
19189 &mut (*path_2).super_0.bones,
19190 &mut (*path_2).super_0.bonesCount,
19191 (flags & 64 as c_int != 0 as c_int) as c_int,
19192 (*self_0).scale,
19193 );
19194 (*path_2).super_0.worldVerticesLength = verticesLength_0;
19195 (*path_2).lengthsLength = verticesLength_0 / 6 as c_int;
19196 (*path_2).lengths = _spMalloc(
19197 (::core::mem::size_of::<c_float>() as c_ulong)
19198 .wrapping_mul((*path_2).lengthsLength as c_ulong),
19199 (b"spine.c\0" as *const u8).cast::<c_char>(),
19200 10204 as c_int,
19201 )
19202 .cast::<c_float>();
19203 let mut i: c_int = 0 as c_int;
19204 while i < (*path_2).lengthsLength {
19205 *((*path_2).lengths).offset(i as isize) = readFloat(input) * (*self_0).scale;
19206 i += 1;
19207 }
19208 if nonessential != 0 {
19209 readColor(
19210 input,
19211 &mut (*path_2).color.r,
19212 &mut (*path_2).color.g,
19213 &mut (*path_2).color.b,
19214 &mut (*path_2).color.a,
19215 );
19216 }
19217 spAttachmentLoader_configureAttachment((*self_0).attachmentLoader, attachment_1);
19218 return attachment_1;
19219 }
19220 5 => {
19221 let mut attachment_2: *mut spAttachment = spAttachmentLoader_createAttachment(
19222 (*self_0).attachmentLoader,
19223 skin,
19224 type_0,
19225 name,
19226 std::ptr::null::<c_char>(),
19227 std::ptr::null_mut::<spSequence>(),
19228 );
19229 let mut point: *mut spPointAttachment = std::ptr::null_mut::<spPointAttachment>();
19230 if attachment_2.is_null() {
19231 return std::ptr::null_mut::<spAttachment>();
19232 }
19233 point = attachment_2.cast::<spPointAttachment>();
19234 (*point).rotation = readFloat(input);
19235 (*point).x = readFloat(input) * (*self_0).scale;
19236 (*point).y = readFloat(input) * (*self_0).scale;
19237 if nonessential != 0 {
19238 readColor(
19239 input,
19240 &mut (*point).color.r,
19241 &mut (*point).color.g,
19242 &mut (*point).color.b,
19243 &mut (*point).color.a,
19244 );
19245 }
19246 spAttachmentLoader_configureAttachment((*self_0).attachmentLoader, attachment_2);
19247 return attachment_2;
19248 }
19249 6 => {
19250 let mut endSlotIndex: c_int = readVarint(input, 1 as c_int);
19251 let mut attachment_3: *mut spAttachment = spAttachmentLoader_createAttachment(
19252 (*self_0).attachmentLoader,
19253 skin,
19254 type_0,
19255 name,
19256 std::ptr::null::<c_char>(),
19257 std::ptr::null_mut::<spSequence>(),
19258 );
19259 let mut clip: *mut spClippingAttachment = std::ptr::null_mut::<spClippingAttachment>();
19260 if attachment_3.is_null() {
19261 return std::ptr::null_mut::<spAttachment>();
19262 }
19263 clip = attachment_3.cast::<spClippingAttachment>();
19264 let mut verticesLength_1: c_int = _readVerticesBinary(
19265 input,
19266 &mut (*clip).super_0.vertices,
19267 &mut (*clip).super_0.verticesCount,
19268 &mut (*clip).super_0.bones,
19269 &mut (*clip).super_0.bonesCount,
19270 (flags & 16 as c_int != 0 as c_int) as c_int,
19271 (*self_0).scale,
19272 );
19273 (*clip).super_0.worldVerticesLength = verticesLength_1;
19274 if nonessential != 0 {
19275 readColor(
19276 input,
19277 &mut (*clip).color.r,
19278 &mut (*clip).color.g,
19279 &mut (*clip).color.b,
19280 &mut (*clip).color.a,
19281 );
19282 }
19283 (*clip).endSlot = *((*skeletonData).slots).offset(endSlotIndex as isize);
19284 spAttachmentLoader_configureAttachment((*self_0).attachmentLoader, attachment_3);
19285 return attachment_3;
19286 }
19287 _ => {}
19288 }
19289 std::ptr::null_mut::<spAttachment>()
19290}
19291#[no_mangle]
19292pub unsafe extern "C" fn spSkeletonBinary_readSkin(
19293 mut self_0: *mut spSkeletonBinary,
19294 mut input: *mut _dataInput,
19295 mut defaultSkin: c_int,
19296 mut skeletonData: *mut spSkeletonData,
19297 mut nonessential: c_int,
19298) -> *mut spSkin {
19299 let mut skin: *mut spSkin = std::ptr::null_mut::<spSkin>();
19300 let mut i: c_int = 0;
19301 let mut n: c_int = 0;
19302 let mut ii: c_int = 0;
19303 let mut nn: c_int = 0;
19304 let mut slotCount: c_int = 0;
19305 if defaultSkin != 0 {
19306 slotCount = readVarint(input, 1 as c_int);
19307 if slotCount == 0 as c_int {
19308 return std::ptr::null_mut::<spSkin>();
19309 }
19310 skin = spSkin_create((b"default\0" as *const u8).cast::<c_char>());
19311 } else {
19312 let mut name: *mut c_char = readString(input);
19313 skin = spSkin_create(name);
19314 _spFree(name.cast::<c_void>());
19315 if nonessential != 0 {
19316 readColor(
19317 input,
19318 &mut (*skin).color.r,
19319 &mut (*skin).color.g,
19320 &mut (*skin).color.b,
19321 &mut (*skin).color.a,
19322 );
19323 }
19324 i = 0 as c_int;
19325 n = readVarint(input, 1 as c_int);
19326 while i < n {
19327 spBoneDataArray_add(
19328 (*skin).bones,
19329 *((*skeletonData).bones).offset(readVarint(input, 1 as c_int) as isize),
19330 );
19331 i += 1;
19332 }
19333 i = 0 as c_int;
19334 n = readVarint(input, 1 as c_int);
19335 while i < n {
19336 spIkConstraintDataArray_add(
19337 (*skin).ikConstraints,
19338 *((*skeletonData).ikConstraints).offset(readVarint(input, 1 as c_int) as isize),
19339 );
19340 i += 1;
19341 }
19342 i = 0 as c_int;
19343 n = readVarint(input, 1 as c_int);
19344 while i < n {
19345 spTransformConstraintDataArray_add(
19346 (*skin).transformConstraints,
19347 *((*skeletonData).transformConstraints)
19348 .offset(readVarint(input, 1 as c_int) as isize),
19349 );
19350 i += 1;
19351 }
19352 i = 0 as c_int;
19353 n = readVarint(input, 1 as c_int);
19354 while i < n {
19355 spPathConstraintDataArray_add(
19356 (*skin).pathConstraints,
19357 *((*skeletonData).pathConstraints).offset(readVarint(input, 1 as c_int) as isize),
19358 );
19359 i += 1;
19360 }
19361 i = 0 as c_int;
19362 n = readVarint(input, 1 as c_int);
19363 while i < n {
19364 spPhysicsConstraintDataArray_add(
19365 (*skin).physicsConstraints,
19366 *((*skeletonData).physicsConstraints)
19367 .offset(readVarint(input, 1 as c_int) as isize),
19368 );
19369 i += 1;
19370 }
19371 slotCount = readVarint(input, 1 as c_int);
19372 }
19373 i = 0 as c_int;
19374 while i < slotCount {
19375 let mut slotIndex: c_int = readVarint(input, 1 as c_int);
19376 ii = 0 as c_int;
19377 nn = readVarint(input, 1 as c_int);
19378 while ii < nn {
19379 let mut name_0: *const c_char = readStringRef(input, skeletonData);
19380 let mut attachment: *mut spAttachment = spSkeletonBinary_readAttachment(
19381 self_0,
19382 input,
19383 skin,
19384 slotIndex,
19385 name_0,
19386 skeletonData,
19387 nonessential,
19388 );
19389 if attachment.is_null() {
19390 return std::ptr::null_mut::<spSkin>();
19391 }
19392 spSkin_setAttachment(skin, slotIndex, name_0, attachment);
19393 ii += 1;
19394 }
19395 i += 1;
19396 }
19397 skin
19398}
19399#[no_mangle]
19400pub unsafe extern "C" fn spSkeletonBinary_readSkeletonDataFile(
19401 mut self_0: *mut spSkeletonBinary,
19402 mut path: *const c_char,
19403) -> *mut spSkeletonData {
19404 let mut length: c_int = 0;
19405 let mut skeletonData: *mut spSkeletonData = std::ptr::null_mut::<spSkeletonData>();
19406 let mut binary: *const c_char = _spUtil_readFile(path, &mut length);
19407 if length == 0 as c_int || binary.is_null() {
19408 _spSkeletonBinary_setError(
19409 self_0,
19410 (b"Unable to read skeleton file: \0" as *const u8).cast::<c_char>(),
19411 path,
19412 );
19413 return std::ptr::null_mut::<spSkeletonData>();
19414 }
19415 skeletonData = spSkeletonBinary_readSkeletonData(self_0, binary as *mut c_uchar, length);
19416 _spFree(binary as *mut c_void);
19417 skeletonData
19418}
19419#[no_mangle]
19420pub unsafe extern "C" fn spSkeletonBinary_readSkeletonData(
19421 mut self_0: *mut spSkeletonBinary,
19422 mut binary: *const c_uchar,
19423 length: c_int,
19424) -> *mut spSkeletonData {
19425 let mut i: c_int = 0;
19426 let mut n: c_int = 0;
19427 let mut ii: c_int = 0;
19428 let mut nonessential: c_int = 0;
19429 let mut buffer: [c_char; 32] = [0; 32];
19430 let mut lowHash: c_int = 0;
19431 let mut highHash: c_int = 0;
19432 let mut skeletonData: *mut spSkeletonData = std::ptr::null_mut::<spSkeletonData>();
19433 let mut internal: *mut _spSkeletonBinary = self_0.cast::<_spSkeletonBinary>();
19434 let mut input: *mut _dataInput = _spCalloc(
19435 1 as c_int as size_t,
19436 ::core::mem::size_of::<_dataInput>() as c_ulong,
19437 (b"spine.c\0" as *const u8).cast::<c_char>(),
19438 10321 as c_int,
19439 )
19440 .cast::<_dataInput>();
19441 (*input).cursor = binary;
19442 (*input).end = binary.offset(length as isize);
19443 _spFree((*self_0).error.cast::<c_void>());
19444 (*self_0).error = std::ptr::null_mut::<c_char>();
19445 (*internal).linkedMeshCount = 0 as c_int;
19446 skeletonData = spSkeletonData_create();
19447 lowHash = readInt(input);
19448 highHash = readInt(input);
19449 spine_snprintf!(
19450 buffer.as_mut_ptr(),
19451 32 as c_int as size_t,
19452 (b"%x%x\0" as *const u8).cast::<c_char>(),
19453 highHash,
19454 lowHash,
19455 );
19456 buffer[31 as c_int as usize] = 0 as c_int as c_char;
19457 (*skeletonData).hash = _spMalloc(
19458 (::core::mem::size_of::<c_char>() as c_ulong)
19459 .wrapping_mul((spine_strlen(buffer.as_mut_ptr())).wrapping_add(1 as c_int as c_ulong)),
19460 (b"spine.c\0" as *const u8).cast::<c_char>(),
19461 10334 as c_int,
19462 )
19463 .cast::<c_char>();
19464 spine_strcpy((*skeletonData).hash, buffer.as_mut_ptr());
19465 (*skeletonData).version = readString(input);
19466 if spine_strlen((*skeletonData).version) == 0 {
19467 _spFree((*skeletonData).version.cast::<c_void>());
19468 (*skeletonData).version = std::ptr::null_mut::<c_char>();
19469 } else if string_starts_with_binary(
19470 (*skeletonData).version,
19471 (b"4.2\0" as *const u8).cast::<c_char>(),
19472 ) == 0
19473 {
19474 let mut errorMsg: [c_char; 255] = [0; 255];
19475 spine_snprintf!(
19476 errorMsg.as_mut_ptr(),
19477 255 as c_int as size_t,
19478 (b"Skeleton version %s does not match runtime version %s\0" as *const u8)
19479 .cast::<c_char>(),
19480 (*skeletonData).version,
19481 (b"4.2\0" as *const u8).cast::<c_char>(),
19482 );
19483 _spSkeletonBinary_setError(self_0, errorMsg.as_mut_ptr(), std::ptr::null::<c_char>());
19484 return std::ptr::null_mut::<spSkeletonData>();
19485 }
19486 (*skeletonData).x = readFloat(input);
19487 (*skeletonData).y = readFloat(input);
19488 (*skeletonData).width = readFloat(input);
19489 (*skeletonData).height = readFloat(input);
19490 (*skeletonData).referenceScale = readFloat(input);
19491 nonessential = readBoolean(input);
19492 if nonessential != 0 {
19493 (*skeletonData).fps = readFloat(input);
19494 (*skeletonData).imagesPath = readString(input);
19495 if spine_strlen((*skeletonData).imagesPath) == 0 {
19496 _spFree((*skeletonData).imagesPath as *mut c_void);
19497 (*skeletonData).imagesPath = std::ptr::null::<c_char>();
19498 }
19499 (*skeletonData).audioPath = readString(input);
19500 if spine_strlen((*skeletonData).audioPath) == 0 {
19501 _spFree((*skeletonData).audioPath as *mut c_void);
19502 (*skeletonData).audioPath = std::ptr::null::<c_char>();
19503 }
19504 }
19505 n = readVarint(input, 1 as c_int);
19506 (*skeletonData).stringsCount = n;
19507 (*skeletonData).strings = _spMalloc(
19508 (::core::mem::size_of::<*mut c_char>() as c_ulong)
19509 .wrapping_mul((*skeletonData).stringsCount as c_ulong),
19510 (b"spine.c\0" as *const u8).cast::<c_char>(),
19511 10372 as c_int,
19512 )
19513 .cast::<*mut c_char>();
19514 i = 0 as c_int;
19515 while i < n {
19516 let fresh114 = &mut (*((*skeletonData).strings).offset(i as isize));
19517 *fresh114 = readString(input);
19518 i += 1;
19519 }
19520 (*skeletonData).bonesCount = readVarint(input, 1 as c_int);
19521 (*skeletonData).bones = _spMalloc(
19522 (::core::mem::size_of::<*mut spBoneData>() as c_ulong)
19523 .wrapping_mul((*skeletonData).bonesCount as c_ulong),
19524 (b"spine.c\0" as *const u8).cast::<c_char>(),
19525 10379 as c_int,
19526 )
19527 .cast::<*mut spBoneData>();
19528 i = 0 as c_int;
19529 while i < (*skeletonData).bonesCount {
19530 let mut name: *const c_char = readString(input);
19531 let mut parent: *mut spBoneData = if i == 0 as c_int {
19532 std::ptr::null_mut::<spBoneData>()
19533 } else {
19534 *((*skeletonData).bones).offset(readVarint(input, 1 as c_int) as isize)
19535 };
19536 let mut data: *mut spBoneData = spBoneData_create(i, name, parent);
19537 _spFree(name as *mut c_void);
19538 (*data).rotation = readFloat(input);
19539 (*data).x = readFloat(input) * (*self_0).scale;
19540 (*data).y = readFloat(input) * (*self_0).scale;
19541 (*data).scaleX = readFloat(input);
19542 (*data).scaleY = readFloat(input);
19543 (*data).shearX = readFloat(input);
19544 (*data).shearY = readFloat(input);
19545 (*data).length = readFloat(input) * (*self_0).scale;
19546 (*data).inherit = readVarint(input, 1 as c_int) as spInherit;
19547 (*data).skinRequired = readBoolean(input);
19548 if nonessential != 0 {
19549 readColor(
19550 input,
19551 &mut (*data).color.r,
19552 &mut (*data).color.g,
19553 &mut (*data).color.b,
19554 &mut (*data).color.a,
19555 );
19556 (*data).icon = readString(input);
19557 (*data).visible = readBoolean(input);
19558 }
19559 let fresh115 = &mut (*((*skeletonData).bones).offset(i as isize));
19560 *fresh115 = data;
19561 i += 1;
19562 }
19563 (*skeletonData).slotsCount = readVarint(input, 1 as c_int);
19564 (*skeletonData).slots = _spMalloc(
19565 (::core::mem::size_of::<*mut spSlotData>() as c_ulong)
19566 .wrapping_mul((*skeletonData).slotsCount as c_ulong),
19567 (b"spine.c\0" as *const u8).cast::<c_char>(),
19568 10405 as c_int,
19569 )
19570 .cast::<*mut spSlotData>();
19571 i = 0 as c_int;
19572 while i < (*skeletonData).slotsCount {
19573 let mut slotName: *mut c_char = readString(input);
19574 let mut pathName: *mut c_char = std::ptr::null_mut::<c_char>();
19575 if nonessential != 0 {
19576 let mut slash: c_int = string_lastIndexOf(slotName, '/' as i32 as c_char);
19577 if slash != -(1 as c_int) {
19578 pathName = string_substring(slotName, 0 as c_int, slash);
19579 slotName = string_substring(
19580 slotName,
19581 slash + 1 as c_int,
19582 spine_strlen(slotName) as c_int,
19583 );
19584 }
19585 }
19586 let mut boneData: *mut spBoneData =
19587 *((*skeletonData).bones).offset(readVarint(input, 1 as c_int) as isize);
19588 let mut slotData: *mut spSlotData = spSlotData_create(i, slotName, boneData);
19589 _spFree(slotName.cast::<c_void>());
19590 readColor(
19591 input,
19592 &mut (*slotData).color.r,
19593 &mut (*slotData).color.g,
19594 &mut (*slotData).color.b,
19595 &mut (*slotData).color.a,
19596 );
19597 let mut a: c_int = readByte(input) as c_int;
19598 let mut r: c_int = readByte(input) as c_int;
19599 let mut g: c_int = readByte(input) as c_int;
19600 let mut b: c_int = readByte(input) as c_int;
19601 if !(r == 0xff as c_int && g == 0xff as c_int && b == 0xff as c_int && a == 0xff as c_int) {
19602 (*slotData).darkColor = spColor_create();
19603 spColor_setFromFloats(
19604 (*slotData).darkColor,
19605 r as c_float / 255.0f32,
19606 g as c_float / 255.0f32,
19607 b as c_float / 255.0f32,
19608 1 as c_int as c_float,
19609 );
19610 }
19611 let mut attachmentName: *mut c_char = readStringRef(input, skeletonData);
19612 if !attachmentName.is_null() {
19613 (*slotData).attachmentName = _spMalloc(
19614 (::core::mem::size_of::<c_char>() as c_ulong).wrapping_mul(
19615 (spine_strlen(attachmentName)).wrapping_add(1 as c_int as c_ulong),
19616 ),
19617 (b"spine.c\0" as *const u8).cast::<c_char>(),
19618 10429 as c_int,
19619 )
19620 .cast::<c_char>();
19621 spine_strcpy((*slotData).attachmentName, attachmentName);
19622 } else {
19623 (*slotData).attachmentName = std::ptr::null_mut::<c_char>();
19624 }
19625 (*slotData).blendMode = readVarint(input, 1 as c_int) as spBlendMode;
19626 if nonessential != 0 {
19627 (*slotData).visible = readBoolean(input);
19628 (*slotData).path = pathName;
19629 }
19630 let fresh116 = &mut (*((*skeletonData).slots).offset(i as isize));
19631 *fresh116 = slotData;
19632 i += 1;
19633 }
19634 (*skeletonData).ikConstraintsCount = readVarint(input, 1 as c_int);
19635 (*skeletonData).ikConstraints = _spMalloc(
19636 (::core::mem::size_of::<*mut spIkConstraintData>() as c_ulong)
19637 .wrapping_mul((*skeletonData).ikConstraintsCount as c_ulong),
19638 (b"spine.c\0" as *const u8).cast::<c_char>(),
19639 10442 as c_int,
19640 )
19641 .cast::<*mut spIkConstraintData>();
19642 i = 0 as c_int;
19643 while i < (*skeletonData).ikConstraintsCount {
19644 let mut name_0: *const c_char = readString(input);
19645 let mut data_0: *mut spIkConstraintData = spIkConstraintData_create(name_0);
19646 _spFree(name_0 as *mut c_void);
19647 (*data_0).order = readVarint(input, 1 as c_int);
19648 (*data_0).bonesCount = readVarint(input, 1 as c_int);
19649 (*data_0).bones = _spMalloc(
19650 (::core::mem::size_of::<*mut spBoneData>() as c_ulong)
19651 .wrapping_mul((*data_0).bonesCount as c_ulong),
19652 (b"spine.c\0" as *const u8).cast::<c_char>(),
19653 10449 as c_int,
19654 )
19655 .cast::<*mut spBoneData>();
19656 ii = 0 as c_int;
19657 while ii < (*data_0).bonesCount {
19658 let fresh117 = &mut (*((*data_0).bones).offset(ii as isize));
19659 *fresh117 = *((*skeletonData).bones).offset(readVarint(input, 1 as c_int) as isize);
19660 ii += 1;
19661 }
19662 (*data_0).target = *((*skeletonData).bones).offset(readVarint(input, 1 as c_int) as isize);
19663 let mut flags: c_int = readByte(input) as c_int;
19664 (*data_0).skinRequired = (flags & 1 as c_int != 0 as c_int) as c_int;
19665 (*data_0).bendDirection = if flags & 2 as c_int != 0 as c_int {
19666 1 as c_int
19667 } else {
19668 -(1 as c_int)
19669 };
19670 (*data_0).compress = (flags & 4 as c_int != 0 as c_int) as c_int;
19671 (*data_0).stretch = (flags & 8 as c_int != 0 as c_int) as c_int;
19672 (*data_0).uniform = (flags & 16 as c_int != 0 as c_int) as c_int;
19673 if flags & 32 as c_int != 0 as c_int {
19674 (*data_0).mix = if flags & 64 as c_int != 0 as c_int {
19675 readFloat(input)
19676 } else {
19677 1 as c_int as c_float
19678 };
19679 }
19680 if flags & 128 as c_int != 0 as c_int {
19681 (*data_0).softness = readFloat(input) * (*self_0).scale;
19682 }
19683 let fresh118 = &mut (*((*skeletonData).ikConstraints).offset(i as isize));
19684 *fresh118 = data_0;
19685 i += 1;
19686 }
19687 (*skeletonData).transformConstraintsCount = readVarint(input, 1 as c_int);
19688 (*skeletonData).transformConstraints = _spMalloc(
19689 (::core::mem::size_of::<*mut spTransformConstraintData>() as c_ulong)
19690 .wrapping_mul((*skeletonData).transformConstraintsCount as c_ulong),
19691 (b"spine.c\0" as *const u8).cast::<c_char>(),
19692 10467 as c_int,
19693 )
19694 .cast::<*mut spTransformConstraintData>();
19695 i = 0 as c_int;
19696 while i < (*skeletonData).transformConstraintsCount {
19697 let mut name_1: *const c_char = readString(input);
19698 let mut data_1: *mut spTransformConstraintData = spTransformConstraintData_create(name_1);
19699 _spFree(name_1 as *mut c_void);
19700 (*data_1).order = readVarint(input, 1 as c_int);
19701 (*data_1).bonesCount = readVarint(input, 1 as c_int);
19702 (*data_1).bones = _spMalloc(
19703 (::core::mem::size_of::<*mut spBoneData>() as c_ulong)
19704 .wrapping_mul((*data_1).bonesCount as c_ulong),
19705 (b"spine.c\0" as *const u8).cast::<c_char>(),
19706 10475 as c_int,
19707 )
19708 .cast::<*mut spBoneData>();
19709 ii = 0 as c_int;
19710 while ii < (*data_1).bonesCount {
19711 let fresh119 = &mut (*((*data_1).bones).offset(ii as isize));
19712 *fresh119 = *((*skeletonData).bones).offset(readVarint(input, 1 as c_int) as isize);
19713 ii += 1;
19714 }
19715 (*data_1).target = *((*skeletonData).bones).offset(readVarint(input, 1 as c_int) as isize);
19716 let mut flags_0: c_int = readByte(input) as c_int;
19717 (*data_1).skinRequired = (flags_0 & 1 as c_int != 0 as c_int) as c_int;
19718 (*data_1).local = (flags_0 & 2 as c_int != 0 as c_int) as c_int;
19719 (*data_1).relative = (flags_0 & 4 as c_int != 0 as c_int) as c_int;
19720 if flags_0 & 8 as c_int != 0 as c_int {
19721 (*data_1).offsetRotation = readFloat(input);
19722 }
19723 if flags_0 & 16 as c_int != 0 as c_int {
19724 (*data_1).offsetX = readFloat(input) * (*self_0).scale;
19725 }
19726 if flags_0 & 32 as c_int != 0 as c_int {
19727 (*data_1).offsetY = readFloat(input) * (*self_0).scale;
19728 }
19729 if flags_0 & 64 as c_int != 0 as c_int {
19730 (*data_1).offsetScaleX = readFloat(input);
19731 }
19732 if flags_0 & 128 as c_int != 0 as c_int {
19733 (*data_1).offsetScaleY = readFloat(input);
19734 }
19735 flags_0 = readByte(input) as c_int;
19736 if flags_0 & 1 as c_int != 0 as c_int {
19737 (*data_1).offsetShearY = readFloat(input);
19738 }
19739 if flags_0 & 2 as c_int != 0 as c_int {
19740 (*data_1).mixRotate = readFloat(input);
19741 }
19742 if flags_0 & 4 as c_int != 0 as c_int {
19743 (*data_1).mixX = readFloat(input);
19744 }
19745 if flags_0 & 8 as c_int != 0 as c_int {
19746 (*data_1).mixY = readFloat(input);
19747 }
19748 if flags_0 & 16 as c_int != 0 as c_int {
19749 (*data_1).mixScaleX = readFloat(input);
19750 }
19751 if flags_0 & 32 as c_int != 0 as c_int {
19752 (*data_1).mixScaleY = readFloat(input);
19753 }
19754 if flags_0 & 64 as c_int != 0 as c_int {
19755 (*data_1).mixShearY = readFloat(input);
19756 }
19757 let fresh120 = &mut (*((*skeletonData).transformConstraints).offset(i as isize));
19758 *fresh120 = data_1;
19759 i += 1;
19760 }
19761 (*skeletonData).pathConstraintsCount = readVarint(input, 1 as c_int);
19762 (*skeletonData).pathConstraints = _spMalloc(
19763 (::core::mem::size_of::<*mut spPathConstraintData>() as c_ulong)
19764 .wrapping_mul((*skeletonData).pathConstraintsCount as c_ulong),
19765 (b"spine.c\0" as *const u8).cast::<c_char>(),
19766 10502 as c_int,
19767 )
19768 .cast::<*mut spPathConstraintData>();
19769 i = 0 as c_int;
19770 while i < (*skeletonData).pathConstraintsCount {
19771 let mut name_2: *const c_char = readString(input);
19772 let mut data_2: *mut spPathConstraintData = spPathConstraintData_create(name_2);
19773 _spFree(name_2 as *mut c_void);
19774 (*data_2).order = readVarint(input, 1 as c_int);
19775 (*data_2).skinRequired = readBoolean(input);
19776 (*data_2).bonesCount = readVarint(input, 1 as c_int);
19777 (*data_2).bones = _spMalloc(
19778 (::core::mem::size_of::<*mut spBoneData>() as c_ulong)
19779 .wrapping_mul((*data_2).bonesCount as c_ulong),
19780 (b"spine.c\0" as *const u8).cast::<c_char>(),
19781 10510 as c_int,
19782 )
19783 .cast::<*mut spBoneData>();
19784 ii = 0 as c_int;
19785 while ii < (*data_2).bonesCount {
19786 let fresh121 = &mut (*((*data_2).bones).offset(ii as isize));
19787 *fresh121 = *((*skeletonData).bones).offset(readVarint(input, 1 as c_int) as isize);
19788 ii += 1;
19789 }
19790 (*data_2).target = *((*skeletonData).slots).offset(readVarint(input, 1 as c_int) as isize);
19791 let mut flags_1: c_int = readByte(input) as c_int;
19792 (*data_2).positionMode = (flags_1 & 1 as c_int) as spPositionMode;
19793 (*data_2).spacingMode = (flags_1 >> 1 as c_int & 3 as c_int) as spSpacingMode;
19794 (*data_2).rotateMode = (flags_1 >> 3 as c_int & 3 as c_int) as spRotateMode;
19795 if flags_1 & 128 as c_int != 0 as c_int {
19796 (*data_2).offsetRotation = readFloat(input);
19797 }
19798 (*data_2).position = readFloat(input);
19799 if (*data_2).positionMode as c_uint == SP_POSITION_MODE_FIXED as c_int as c_uint {
19800 (*data_2).position *= (*self_0).scale;
19801 }
19802 (*data_2).spacing = readFloat(input);
19803 if (*data_2).spacingMode as c_uint == SP_SPACING_MODE_LENGTH as c_int as c_uint
19804 || (*data_2).spacingMode as c_uint == SP_SPACING_MODE_FIXED as c_int as c_uint
19805 {
19806 (*data_2).spacing *= (*self_0).scale;
19807 }
19808 (*data_2).mixRotate = readFloat(input);
19809 (*data_2).mixX = readFloat(input);
19810 (*data_2).mixY = readFloat(input);
19811 let fresh122 = &mut (*((*skeletonData).pathConstraints).offset(i as isize));
19812 *fresh122 = data_2;
19813 i += 1;
19814 }
19815 (*skeletonData).physicsConstraintsCount = readVarint(input, 1 as c_int);
19816 (*skeletonData).physicsConstraints = _spMalloc(
19817 (::core::mem::size_of::<*mut spPhysicsConstraintData>() as c_ulong)
19818 .wrapping_mul((*skeletonData).physicsConstraintsCount as c_ulong),
19819 (b"spine.c\0" as *const u8).cast::<c_char>(),
19820 10532 as c_int,
19821 )
19822 .cast::<*mut spPhysicsConstraintData>();
19823 i = 0 as c_int;
19824 while i < (*skeletonData).physicsConstraintsCount {
19825 let mut name_3: *const c_char = readString(input);
19826 let mut data_3: *mut spPhysicsConstraintData = spPhysicsConstraintData_create(name_3);
19827 _spFree(name_3 as *mut c_void);
19828 (*data_3).order = readVarint(input, 1 as c_int);
19829 (*data_3).bone = *((*skeletonData).bones).offset(readVarint(input, 1 as c_int) as isize);
19830 let mut flags_2: c_int = readByte(input) as c_int;
19831 (*data_3).skinRequired = (flags_2 & 1 as c_int != 0 as c_int) as c_int;
19832 if flags_2 & 2 as c_int != 0 as c_int {
19833 (*data_3).x = readFloat(input);
19834 }
19835 if flags_2 & 4 as c_int != 0 as c_int {
19836 (*data_3).y = readFloat(input);
19837 }
19838 if flags_2 & 8 as c_int != 0 as c_int {
19839 (*data_3).rotate = readFloat(input);
19840 }
19841 if flags_2 & 16 as c_int != 0 as c_int {
19842 (*data_3).scaleX = readFloat(input);
19843 }
19844 if flags_2 & 32 as c_int != 0 as c_int {
19845 (*data_3).shearX = readFloat(input);
19846 }
19847 (*data_3).limit = (if flags_2 & 64 as c_int != 0 as c_int {
19848 readFloat(input)
19849 } else {
19850 5000 as c_int as c_float
19851 }) * (*self_0).scale;
19852 (*data_3).step = 1.0f32 / readByte(input) as c_int as c_float;
19853 (*data_3).inertia = readFloat(input);
19854 (*data_3).strength = readFloat(input);
19855 (*data_3).damping = readFloat(input);
19856 (*data_3).massInverse = if flags_2 & 128 as c_int != 0 as c_int {
19857 readFloat(input)
19858 } else {
19859 1 as c_int as c_float
19860 };
19861 (*data_3).wind = readFloat(input);
19862 (*data_3).gravity = readFloat(input);
19863 flags_2 = readByte(input) as c_int;
19864 if flags_2 & 1 as c_int != 0 as c_int {
19865 (*data_3).inertiaGlobal = -(1 as c_int);
19866 }
19867 if flags_2 & 2 as c_int != 0 as c_int {
19868 (*data_3).strengthGlobal = -(1 as c_int);
19869 }
19870 if flags_2 & 4 as c_int != 0 as c_int {
19871 (*data_3).dampingGlobal = -(1 as c_int);
19872 }
19873 if flags_2 & 8 as c_int != 0 as c_int {
19874 (*data_3).massGlobal = -(1 as c_int);
19875 }
19876 if flags_2 & 16 as c_int != 0 as c_int {
19877 (*data_3).windGlobal = -(1 as c_int);
19878 }
19879 if flags_2 & 32 as c_int != 0 as c_int {
19880 (*data_3).gravityGlobal = -(1 as c_int);
19881 }
19882 if flags_2 & 64 as c_int != 0 as c_int {
19883 (*data_3).mixGlobal = -(1 as c_int);
19884 }
19885 (*data_3).mix = if flags_2 & 128 as c_int != 0 as c_int {
19886 readFloat(input)
19887 } else {
19888 1 as c_int as c_float
19889 };
19890 let fresh123 = &mut (*((*skeletonData).physicsConstraints).offset(i as isize));
19891 *fresh123 = data_3;
19892 i += 1;
19893 }
19894 (*skeletonData).defaultSkin =
19895 spSkeletonBinary_readSkin(self_0, input, -(1 as c_int), skeletonData, nonessential);
19896 if !((*(*self_0).attachmentLoader).error1).is_null() {
19897 spSkeletonData_dispose(skeletonData);
19898 _spSkeletonBinary_setError(
19899 self_0,
19900 (*(*self_0).attachmentLoader).error1,
19901 (*(*self_0).attachmentLoader).error2,
19902 );
19903 return std::ptr::null_mut::<spSkeletonData>();
19904 }
19905 (*skeletonData).skinsCount = readVarint(input, 1 as c_int);
19906 if !((*skeletonData).defaultSkin).is_null() {
19907 (*skeletonData).skinsCount += 1;
19908 }
19909 (*skeletonData).skins = _spMalloc(
19910 (::core::mem::size_of::<*mut spSkin>() as c_ulong)
19911 .wrapping_mul((*skeletonData).skinsCount as c_ulong),
19912 (b"spine.c\0" as *const u8).cast::<c_char>(),
19913 10578 as c_int,
19914 )
19915 .cast::<*mut spSkin>();
19916 if !((*skeletonData).defaultSkin).is_null() {
19917 let fresh124 = &mut (*((*skeletonData).skins).offset(0 as c_int as isize));
19918 *fresh124 = (*skeletonData).defaultSkin;
19919 }
19920 i = if !((*skeletonData).defaultSkin).is_null() {
19921 1 as c_int
19922 } else {
19923 0 as c_int
19924 };
19925 while i < (*skeletonData).skinsCount {
19926 let mut skin: *mut spSkin =
19927 spSkeletonBinary_readSkin(self_0, input, 0 as c_int, skeletonData, nonessential);
19928 if !((*(*self_0).attachmentLoader).error1).is_null() {
19929 spSkeletonData_dispose(skeletonData);
19930 _spSkeletonBinary_setError(
19931 self_0,
19932 (*(*self_0).attachmentLoader).error1,
19933 (*(*self_0).attachmentLoader).error2,
19934 );
19935 return std::ptr::null_mut::<spSkeletonData>();
19936 }
19937 let fresh125 = &mut (*((*skeletonData).skins).offset(i as isize));
19938 *fresh125 = skin;
19939 i += 1;
19940 }
19941 i = 0 as c_int;
19942 while i < (*internal).linkedMeshCount {
19943 let mut linkedMesh: *mut _spLinkedMeshBinary =
19944 ((*internal).linkedMeshes).offset(i as isize);
19945 let mut skin_0: *mut spSkin =
19946 *((*skeletonData).skins).offset((*linkedMesh).skinIndex as isize);
19947 if skin_0.is_null() {
19948 _spFree(input.cast::<c_void>());
19949 spSkeletonData_dispose(skeletonData);
19950 _spSkeletonBinary_setError(
19951 self_0,
19952 (b"Skin not found\0" as *const u8).cast::<c_char>(),
19953 (b"\0" as *const u8).cast::<c_char>(),
19954 );
19955 return std::ptr::null_mut::<spSkeletonData>();
19956 }
19957 let mut parent_0: *mut spAttachment =
19958 spSkin_getAttachment(skin_0, (*linkedMesh).slotIndex, (*linkedMesh).parent);
19959 if parent_0.is_null() {
19960 _spFree(input.cast::<c_void>());
19961 spSkeletonData_dispose(skeletonData);
19962 _spSkeletonBinary_setError(
19963 self_0,
19964 (b"Parent mesh not found: \0" as *const u8).cast::<c_char>(),
19965 (*linkedMesh).parent,
19966 );
19967 return std::ptr::null_mut::<spSkeletonData>();
19968 }
19969 (*(*linkedMesh).mesh).super_0.timelineAttachment = if (*linkedMesh).inheritTimeline != 0 {
19970 parent_0
19971 } else {
19972 &mut (*(*linkedMesh).mesh).super_0.super_0
19973 };
19974 spMeshAttachment_setParentMesh((*linkedMesh).mesh, parent_0.cast::<spMeshAttachment>());
19975 if !((*(*linkedMesh).mesh).region).is_null() {
19976 spMeshAttachment_updateRegion((*linkedMesh).mesh);
19977 }
19978 spAttachmentLoader_configureAttachment(
19979 (*self_0).attachmentLoader,
19980 &mut (*(*linkedMesh).mesh).super_0.super_0,
19981 );
19982 i += 1;
19983 }
19984 (*skeletonData).eventsCount = readVarint(input, 1 as c_int);
19985 (*skeletonData).events = _spMalloc(
19986 (::core::mem::size_of::<*mut spEventData>() as c_ulong)
19987 .wrapping_mul((*skeletonData).eventsCount as c_ulong),
19988 (b"spine.c\0" as *const u8).cast::<c_char>(),
19989 10620 as c_int,
19990 )
19991 .cast::<*mut spEventData>();
19992 i = 0 as c_int;
19993 while i < (*skeletonData).eventsCount {
19994 let mut name_4: *const c_char = readString(input);
19995 let mut eventData: *mut spEventData = spEventData_create(name_4);
19996 _spFree(name_4 as *mut c_void);
19997 (*eventData).intValue = readVarint(input, 0 as c_int);
19998 (*eventData).floatValue = readFloat(input);
19999 (*eventData).stringValue = readString(input);
20000 (*eventData).audioPath = readString(input);
20001 if !((*eventData).audioPath).is_null() {
20002 (*eventData).volume = readFloat(input);
20003 (*eventData).balance = readFloat(input);
20004 }
20005 let fresh126 = &mut (*((*skeletonData).events).offset(i as isize));
20006 *fresh126 = eventData;
20007 i += 1;
20008 }
20009 (*skeletonData).animationsCount = readVarint(input, 1 as c_int);
20010 (*skeletonData).animations = _spMalloc(
20011 (::core::mem::size_of::<*mut spAnimation>() as c_ulong)
20012 .wrapping_mul((*skeletonData).animationsCount as c_ulong),
20013 (b"spine.c\0" as *const u8).cast::<c_char>(),
20014 10638 as c_int,
20015 )
20016 .cast::<*mut spAnimation>();
20017 i = 0 as c_int;
20018 while i < (*skeletonData).animationsCount {
20019 let mut name_5: *const c_char = readString(input);
20020 let mut animation: *mut spAnimation =
20021 _spSkeletonBinary_readAnimation(self_0, name_5, input, skeletonData);
20022 _spFree(name_5 as *mut c_void);
20023 if animation.is_null() {
20024 _spFree(input.cast::<c_void>());
20025 spSkeletonData_dispose(skeletonData);
20026 _spSkeletonBinary_setError(
20027 self_0,
20028 (b"Animation corrupted: \0" as *const u8).cast::<c_char>(),
20029 name_5,
20030 );
20031 return std::ptr::null_mut::<spSkeletonData>();
20032 }
20033 let fresh127 = &mut (*((*skeletonData).animations).offset(i as isize));
20034 *fresh127 = animation;
20035 i += 1;
20036 }
20037 _spFree(input.cast::<c_void>());
20038 skeletonData
20039}
20040#[no_mangle]
20041pub unsafe extern "C" fn spPolygon_create(mut capacity: c_int) -> *mut spPolygon {
20042 let mut self_0: *mut spPolygon = _spCalloc(
20043 1 as c_int as size_t,
20044 ::core::mem::size_of::<spPolygon>() as c_ulong,
20045 (b"spine.c\0" as *const u8).cast::<c_char>(),
20046 10689 as c_int,
20047 )
20048 .cast::<spPolygon>();
20049 (*self_0).capacity = capacity;
20050 (*self_0).vertices = _spMalloc(
20051 (::core::mem::size_of::<c_float>() as c_ulong).wrapping_mul(capacity as c_ulong),
20052 (b"spine.c\0" as *const u8).cast::<c_char>(),
20053 10691 as c_int,
20054 )
20055 .cast::<c_float>();
20056 self_0
20057}
20058#[no_mangle]
20059pub unsafe extern "C" fn spPolygon_dispose(mut self_0: *mut spPolygon) {
20060 _spFree((*self_0).vertices.cast::<c_void>());
20061 _spFree(self_0.cast::<c_void>());
20062}
20063#[no_mangle]
20064pub unsafe extern "C" fn spPolygon_containsPoint(
20065 mut self_0: *mut spPolygon,
20066 mut x: c_float,
20067 mut y: c_float,
20068) -> c_int {
20069 let mut prevIndex: c_int = (*self_0).count - 2 as c_int;
20070 let mut inside: c_int = 0 as c_int;
20071 let mut i: c_int = 0;
20072 i = 0 as c_int;
20073 while i < (*self_0).count {
20074 let mut vertexY: c_float = *((*self_0).vertices).offset((i + 1 as c_int) as isize);
20075 let mut prevY: c_float = *((*self_0).vertices).offset((prevIndex + 1 as c_int) as isize);
20076 if vertexY < y && prevY >= y || prevY < y && vertexY >= y {
20077 let mut vertexX: c_float = *((*self_0).vertices).offset(i as isize);
20078 if vertexX
20079 + (y - vertexY) / (prevY - vertexY)
20080 * (*((*self_0).vertices).offset(prevIndex as isize) - vertexX)
20081 < x
20082 {
20083 inside = (inside == 0) as c_int;
20084 }
20085 }
20086 prevIndex = i;
20087 i += 2 as c_int;
20088 }
20089 inside
20090}
20091#[no_mangle]
20092pub unsafe extern "C" fn spPolygon_intersectsSegment(
20093 mut self_0: *mut spPolygon,
20094 mut x1: c_float,
20095 mut y1: c_float,
20096 mut x2: c_float,
20097 mut y2: c_float,
20098) -> c_int {
20099 let mut width12: c_float = x1 - x2;
20100 let mut height12: c_float = y1 - y2;
20101 let mut det1: c_float = x1 * y2 - y1 * x2;
20102 let mut x3: c_float = *((*self_0).vertices).offset(((*self_0).count - 2 as c_int) as isize);
20103 let mut y3: c_float = *((*self_0).vertices).offset(((*self_0).count - 1 as c_int) as isize);
20104 let mut i: c_int = 0;
20105 i = 0 as c_int;
20106 while i < (*self_0).count {
20107 let mut x4: c_float = *((*self_0).vertices).offset(i as isize);
20108 let mut y4: c_float = *((*self_0).vertices).offset((i + 1 as c_int) as isize);
20109 let mut det2: c_float = x3 * y4 - y3 * x4;
20110 let mut width34: c_float = x3 - x4;
20111 let mut height34: c_float = y3 - y4;
20112 let mut det3: c_float = width12 * height34 - height12 * width34;
20113 let mut x: c_float = (det1 * width34 - width12 * det2) / det3;
20114 if (x >= x3 && x <= x4 || x >= x4 && x <= x3) && (x >= x1 && x <= x2 || x >= x2 && x <= x1)
20115 {
20116 let mut y: c_float = (det1 * height34 - height12 * det2) / det3;
20117 if (y >= y3 && y <= y4 || y >= y4 && y <= y3)
20118 && (y >= y1 && y <= y2 || y >= y2 && y <= y1)
20119 {
20120 return 1 as c_int;
20121 }
20122 }
20123 x3 = x4;
20124 y3 = y4;
20125 i += 2 as c_int;
20126 }
20127 0 as c_int
20128}
20129#[no_mangle]
20130pub unsafe extern "C" fn spSkeletonBounds_create() -> *mut spSkeletonBounds {
20131 &mut (*(_spCalloc
20132 as unsafe extern "C" fn(size_t, size_t, *const c_char, c_int) -> *mut c_void)(
20133 1 as c_int as size_t,
20134 ::core::mem::size_of::<_spSkeletonBounds>() as c_ulong,
20135 (b"spine.c\0" as *const u8).cast::<c_char>(),
20136 10747 as c_int,
20137 ).cast::<_spSkeletonBounds>())
20138 .super_0
20139}
20140#[no_mangle]
20141pub unsafe extern "C" fn spSkeletonBounds_dispose(mut self_0: *mut spSkeletonBounds) {
20142 let mut i: c_int = 0;
20143 i = 0 as c_int;
20144 while i < (*self_0.cast::<_spSkeletonBounds>()).capacity {
20145 if !(*((*self_0).polygons).offset(i as isize)).is_null() {
20146 spPolygon_dispose(*((*self_0).polygons).offset(i as isize));
20147 }
20148 i += 1;
20149 }
20150 _spFree((*self_0).polygons.cast::<c_void>());
20151 _spFree((*self_0).boundingBoxes.cast::<c_void>());
20152 _spFree(self_0.cast::<c_void>());
20153}
20154#[no_mangle]
20155pub unsafe extern "C" fn spSkeletonBounds_update(
20156 mut self_0: *mut spSkeletonBounds,
20157 mut skeleton: *mut spSkeleton,
20158 mut updateAabb: c_int,
20159) {
20160 let mut i: c_int = 0;
20161 let mut internal: *mut _spSkeletonBounds = self_0.cast::<_spSkeletonBounds>();
20162 if (*internal).capacity < (*skeleton).slotsCount {
20163 let mut newPolygons: *mut *mut spPolygon = std::ptr::null_mut::<*mut spPolygon>();
20164 _spFree((*self_0).boundingBoxes.cast::<c_void>());
20165 (*self_0).boundingBoxes = _spMalloc(
20166 (::core::mem::size_of::<*mut spBoundingBoxAttachment>() as c_ulong)
20167 .wrapping_mul((*skeleton).slotsCount as c_ulong),
20168 (b"spine.c\0" as *const u8).cast::<c_char>(),
20169 10767 as c_int,
20170 )
20171 .cast::<*mut spBoundingBoxAttachment>();
20172 newPolygons = _spCalloc(
20173 (*skeleton).slotsCount as size_t,
20174 ::core::mem::size_of::<*mut spPolygon>() as c_ulong,
20175 (b"spine.c\0" as *const u8).cast::<c_char>(),
20176 10769 as c_int,
20177 )
20178 .cast::<*mut spPolygon>();
20179 spine_memcpy(
20180 newPolygons.cast::<c_void>(),
20181 (*self_0).polygons as *const c_void,
20182 (::core::mem::size_of::<*mut spPolygon>() as c_ulong)
20183 .wrapping_mul((*internal).capacity as c_ulong),
20184 );
20185 _spFree((*self_0).polygons.cast::<c_void>());
20186 (*self_0).polygons = newPolygons;
20187 (*internal).capacity = (*skeleton).slotsCount;
20188 }
20189 (*self_0).minX = 0x7fffffff as c_int as c_float;
20190 (*self_0).minY = 0x7fffffff as c_int as c_float;
20191 (*self_0).maxX = (-(0x7fffffff as c_int) - 1 as c_int) as c_float;
20192 (*self_0).maxY = (-(0x7fffffff as c_int) - 1 as c_int) as c_float;
20193 (*self_0).count = 0 as c_int;
20194 i = 0 as c_int;
20195 while i < (*skeleton).slotsCount {
20196 let mut polygon: *mut spPolygon = std::ptr::null_mut::<spPolygon>();
20197 let mut boundingBox: *mut spBoundingBoxAttachment =
20198 std::ptr::null_mut::<spBoundingBoxAttachment>();
20199 let mut attachment: *mut spAttachment = std::ptr::null_mut::<spAttachment>();
20200 let mut slot: *mut spSlot = *((*skeleton).slots).offset(i as isize);
20201 if (*(*slot).bone).active != 0 {
20202 attachment = (*slot).attachment;
20203 if !(attachment.is_null()
20204 || (*attachment).type_0 as c_uint != SP_ATTACHMENT_BOUNDING_BOX as c_int as c_uint)
20205 {
20206 boundingBox = attachment.cast::<spBoundingBoxAttachment>();
20207 let fresh128 = &mut (*((*self_0).boundingBoxes).offset((*self_0).count as isize));
20208 *fresh128 = boundingBox;
20209 polygon = *((*self_0).polygons).offset((*self_0).count as isize);
20210 if polygon.is_null()
20211 || (*polygon).capacity < (*boundingBox).super_0.worldVerticesLength
20212 {
20213 if !polygon.is_null() {
20214 spPolygon_dispose(polygon);
20215 }
20216 polygon = spPolygon_create((*boundingBox).super_0.worldVerticesLength);
20217 let fresh129 = &mut (*((*self_0).polygons).offset((*self_0).count as isize));
20218 *fresh129 = polygon;
20219 }
20220 (*polygon).count = (*boundingBox).super_0.worldVerticesLength;
20221 spVertexAttachment_computeWorldVertices(
20222 &mut (*boundingBox).super_0,
20223 slot,
20224 0 as c_int,
20225 (*polygon).count,
20226 (*polygon).vertices,
20227 0 as c_int,
20228 2 as c_int,
20229 );
20230 if updateAabb != 0 {
20231 let mut ii: c_int = 0 as c_int;
20232 while ii < (*polygon).count {
20233 let mut x: c_float = *((*polygon).vertices).offset(ii as isize);
20234 let mut y: c_float =
20235 *((*polygon).vertices).offset((ii + 1 as c_int) as isize);
20236 if x < (*self_0).minX {
20237 (*self_0).minX = x;
20238 }
20239 if y < (*self_0).minY {
20240 (*self_0).minY = y;
20241 }
20242 if x > (*self_0).maxX {
20243 (*self_0).maxX = x;
20244 }
20245 if y > (*self_0).maxY {
20246 (*self_0).maxY = y;
20247 }
20248 ii += 2 as c_int;
20249 }
20250 }
20251 (*self_0).count += 1;
20252 }
20253 }
20254 i += 1;
20255 }
20256}
20257#[no_mangle]
20258pub unsafe extern "C" fn spSkeletonBounds_aabbContainsPoint(
20259 mut self_0: *mut spSkeletonBounds,
20260 mut x: c_float,
20261 mut y: c_float,
20262) -> c_int {
20263 (x >= (*self_0).minX && x <= (*self_0).maxX && y >= (*self_0).minY && y <= (*self_0).maxY)
20264 as c_int
20265}
20266#[no_mangle]
20267pub unsafe extern "C" fn spSkeletonBounds_aabbIntersectsSegment(
20268 mut self_0: *mut spSkeletonBounds,
20269 mut x1: c_float,
20270 mut y1: c_float,
20271 mut x2: c_float,
20272 mut y2: c_float,
20273) -> c_int {
20274 let mut m: c_float = 0.;
20275 let mut x: c_float = 0.;
20276 let mut y: c_float = 0.;
20277 if x1 <= (*self_0).minX && x2 <= (*self_0).minX
20278 || y1 <= (*self_0).minY && y2 <= (*self_0).minY
20279 || x1 >= (*self_0).maxX && x2 >= (*self_0).maxX
20280 || y1 >= (*self_0).maxY && y2 >= (*self_0).maxY
20281 {
20282 return 0 as c_int;
20283 }
20284 m = (y2 - y1) / (x2 - x1);
20285 y = m * ((*self_0).minX - x1) + y1;
20286 if y > (*self_0).minY && y < (*self_0).maxY {
20287 return 1 as c_int;
20288 }
20289 y = m * ((*self_0).maxX - x1) + y1;
20290 if y > (*self_0).minY && y < (*self_0).maxY {
20291 return 1 as c_int;
20292 }
20293 x = ((*self_0).minY - y1) / m + x1;
20294 if x > (*self_0).minX && x < (*self_0).maxX {
20295 return 1 as c_int;
20296 }
20297 x = ((*self_0).maxY - y1) / m + x1;
20298 if x > (*self_0).minX && x < (*self_0).maxX {
20299 return 1 as c_int;
20300 }
20301 0 as c_int
20302}
20303#[no_mangle]
20304pub unsafe extern "C" fn spSkeletonBounds_aabbIntersectsSkeleton(
20305 mut self_0: *mut spSkeletonBounds,
20306 mut bounds: *mut spSkeletonBounds,
20307) -> c_int {
20308 ((*self_0).minX < (*bounds).maxX
20309 && (*self_0).maxX > (*bounds).minX
20310 && (*self_0).minY < (*bounds).maxY
20311 && (*self_0).maxY > (*bounds).minY) as c_int
20312}
20313#[no_mangle]
20314pub unsafe extern "C" fn spSkeletonBounds_containsPoint(
20315 mut self_0: *mut spSkeletonBounds,
20316 mut x: c_float,
20317 mut y: c_float,
20318) -> *mut spBoundingBoxAttachment {
20319 let mut i: c_int = 0;
20320 i = 0 as c_int;
20321 while i < (*self_0).count {
20322 if spPolygon_containsPoint(*((*self_0).polygons).offset(i as isize), x, y) != 0 {
20323 return *((*self_0).boundingBoxes).offset(i as isize);
20324 }
20325 i += 1;
20326 }
20327 std::ptr::null_mut::<spBoundingBoxAttachment>()
20328}
20329#[no_mangle]
20330pub unsafe extern "C" fn spSkeletonBounds_intersectsSegment(
20331 mut self_0: *mut spSkeletonBounds,
20332 mut x1: c_float,
20333 mut y1: c_float,
20334 mut x2: c_float,
20335 mut y2: c_float,
20336) -> *mut spBoundingBoxAttachment {
20337 let mut i: c_int = 0;
20338 i = 0 as c_int;
20339 while i < (*self_0).count {
20340 if spPolygon_intersectsSegment(*((*self_0).polygons).offset(i as isize), x1, y1, x2, y2)
20341 != 0
20342 {
20343 return *((*self_0).boundingBoxes).offset(i as isize);
20344 }
20345 i += 1;
20346 }
20347 std::ptr::null_mut::<spBoundingBoxAttachment>()
20348}
20349#[no_mangle]
20350pub unsafe extern "C" fn spSkeletonBounds_getPolygon(
20351 mut self_0: *mut spSkeletonBounds,
20352 mut boundingBox: *mut spBoundingBoxAttachment,
20353) -> *mut spPolygon {
20354 let mut i: c_int = 0;
20355 i = 0 as c_int;
20356 while i < (*self_0).count {
20357 if *((*self_0).boundingBoxes).offset(i as isize) == boundingBox {
20358 return *((*self_0).polygons).offset(i as isize);
20359 }
20360 i += 1;
20361 }
20362 std::ptr::null_mut::<spPolygon>()
20363}
20364#[no_mangle]
20365pub unsafe extern "C" fn spSkeletonClipping_create() -> *mut spSkeletonClipping {
20366 let mut clipping: *mut spSkeletonClipping = _spCalloc(
20367 1 as c_int as size_t,
20368 ::core::mem::size_of::<spSkeletonClipping>() as c_ulong,
20369 (b"spine.c\0" as *const u8).cast::<c_char>(),
20370 10898 as c_int,
20371 )
20372 .cast::<spSkeletonClipping>();
20373 (*clipping).triangulator = spTriangulator_create();
20374 (*clipping).clippingPolygon = spFloatArray_create(128 as c_int);
20375 (*clipping).clipOutput = spFloatArray_create(128 as c_int);
20376 (*clipping).clippedVertices = spFloatArray_create(128 as c_int);
20377 (*clipping).clippedUVs = spFloatArray_create(128 as c_int);
20378 (*clipping).clippedTriangles = spUnsignedShortArray_create(128 as c_int);
20379 (*clipping).scratch = spFloatArray_create(128 as c_int);
20380 clipping
20381}
20382#[no_mangle]
20383pub unsafe extern "C" fn spSkeletonClipping_dispose(mut self_0: *mut spSkeletonClipping) {
20384 spTriangulator_dispose((*self_0).triangulator);
20385 spFloatArray_dispose((*self_0).clippingPolygon);
20386 spFloatArray_dispose((*self_0).clipOutput);
20387 spFloatArray_dispose((*self_0).clippedVertices);
20388 spFloatArray_dispose((*self_0).clippedUVs);
20389 spUnsignedShortArray_dispose((*self_0).clippedTriangles);
20390 spFloatArray_dispose((*self_0).scratch);
20391 _spFree(self_0.cast::<c_void>());
20392}
20393unsafe extern "C" fn _makeClockwise(mut polygon: *mut spFloatArray) {
20394 let mut i: c_int = 0;
20395 let mut n: c_int = 0;
20396 let mut lastX: c_int = 0;
20397 let mut vertices: *mut c_float = (*polygon).items;
20398 let mut verticeslength: c_int = (*polygon).size;
20399 let mut area: c_float = *vertices.offset((verticeslength - 2 as c_int) as isize)
20400 * *vertices.offset(1 as c_int as isize)
20401 - *vertices.offset(0 as c_int as isize)
20402 * *vertices.offset((verticeslength - 1 as c_int) as isize);
20403 let mut p1x: c_float = 0.;
20404 let mut p1y: c_float = 0.;
20405 let mut p2x: c_float = 0.;
20406 let mut p2y: c_float = 0.;
20407 i = 0 as c_int;
20408 n = verticeslength - 3 as c_int;
20409 while i < n {
20410 p1x = *vertices.offset(i as isize);
20411 p1y = *vertices.offset((i + 1 as c_int) as isize);
20412 p2x = *vertices.offset((i + 2 as c_int) as isize);
20413 p2y = *vertices.offset((i + 3 as c_int) as isize);
20414 area += p1x * p2y - p2x * p1y;
20415 i += 2 as c_int;
20416 }
20417 if area < 0 as c_int as c_float {
20418 return;
20419 }
20420 i = 0 as c_int;
20421 lastX = verticeslength - 2 as c_int;
20422 n = verticeslength >> 1 as c_int;
20423 while i < n {
20424 let mut x: c_float = *vertices.offset(i as isize);
20425 let mut y: c_float = *vertices.offset((i + 1 as c_int) as isize);
20426 let mut other: c_int = lastX - i;
20427 *vertices.offset(i as isize) = *vertices.offset(other as isize);
20428 *vertices.offset((i + 1 as c_int) as isize) =
20429 *vertices.offset((other + 1 as c_int) as isize);
20430 *vertices.offset(other as isize) = x;
20431 *vertices.offset((other + 1 as c_int) as isize) = y;
20432 i += 2 as c_int;
20433 }
20434}
20435#[no_mangle]
20436pub unsafe extern "C" fn spSkeletonClipping_clipStart(
20437 mut self_0: *mut spSkeletonClipping,
20438 mut slot: *mut spSlot,
20439 mut clip: *mut spClippingAttachment,
20440) -> c_int {
20441 let mut i: c_int = 0;
20442 let mut n: c_int = 0;
20443 let mut vertices: *mut c_float = std::ptr::null_mut::<c_float>();
20444 if !((*self_0).clipAttachment).is_null() {
20445 return 0 as c_int;
20446 }
20447 (*self_0).clipAttachment = clip;
20448 n = (*clip).super_0.worldVerticesLength;
20449 vertices = (*spFloatArray_setSize((*self_0).clippingPolygon, n)).items;
20450 spVertexAttachment_computeWorldVertices(
20451 &mut (*clip).super_0,
20452 slot,
20453 0 as c_int,
20454 n,
20455 vertices,
20456 0 as c_int,
20457 2 as c_int,
20458 );
20459 _makeClockwise((*self_0).clippingPolygon);
20460 (*self_0).clippingPolygons = spTriangulator_decompose(
20461 (*self_0).triangulator,
20462 (*self_0).clippingPolygon,
20463 spTriangulator_triangulate((*self_0).triangulator, (*self_0).clippingPolygon),
20464 );
20465 i = 0 as c_int;
20466 n = (*(*self_0).clippingPolygons).size;
20467 while i < n {
20468 let mut polygon: *mut spFloatArray =
20469 *((*(*self_0).clippingPolygons).items).offset(i as isize);
20470 _makeClockwise(polygon);
20471 spFloatArray_add(polygon, *((*polygon).items).offset(0 as c_int as isize));
20472 spFloatArray_add(polygon, *((*polygon).items).offset(1 as c_int as isize));
20473 i += 1;
20474 }
20475 (*(*self_0).clippingPolygons).size
20476}
20477#[no_mangle]
20478pub unsafe extern "C" fn spSkeletonClipping_clipEnd(
20479 mut self_0: *mut spSkeletonClipping,
20480 mut slot: *mut spSlot,
20481) {
20482 if !((*self_0).clipAttachment).is_null() && (*(*self_0).clipAttachment).endSlot == (*slot).data
20483 {
20484 spSkeletonClipping_clipEnd2(self_0);
20485 }
20486}
20487#[no_mangle]
20488pub unsafe extern "C" fn spSkeletonClipping_clipEnd2(mut self_0: *mut spSkeletonClipping) {
20489 if ((*self_0).clipAttachment).is_null() {
20490 return;
20491 }
20492 (*self_0).clipAttachment = std::ptr::null_mut::<spClippingAttachment>();
20493 (*self_0).clippingPolygons = std::ptr::null_mut::<spArrayFloatArray>();
20494 spFloatArray_clear((*self_0).clippedVertices);
20495 spFloatArray_clear((*self_0).clippedUVs);
20496 spUnsignedShortArray_clear((*self_0).clippedTriangles);
20497 spFloatArray_clear((*self_0).clippingPolygon);
20498}
20499#[no_mangle]
20500pub unsafe extern "C" fn spSkeletonClipping_isClipping(
20501 mut self_0: *mut spSkeletonClipping,
20502) -> c_int {
20503 ((*self_0).clipAttachment != std::ptr::null_mut::<spClippingAttachment>()) as c_int
20504}
20505#[no_mangle]
20506pub unsafe extern "C" fn _clip(
20507 mut self_0: *mut spSkeletonClipping,
20508 mut x1: c_float,
20509 mut y1: c_float,
20510 mut x2: c_float,
20511 mut y2: c_float,
20512 mut x3: c_float,
20513 mut y3: c_float,
20514 mut clippingArea: *mut spFloatArray,
20515 mut output: *mut spFloatArray,
20516) -> c_int {
20517 let mut i: c_int = 0;
20518 let mut originalOutput: *mut spFloatArray = output;
20519 let mut clipped: c_int = 0 as c_int;
20520 let mut clippingVertices: *mut c_float = std::ptr::null_mut::<c_float>();
20521 let mut clippingVerticesLast: c_int = 0;
20522 let mut input: *mut spFloatArray = std::ptr::null_mut::<spFloatArray>();
20523 if (*clippingArea).size % 4 as c_int >= 2 as c_int {
20524 input = output;
20525 output = (*self_0).scratch;
20526 } else {
20527 input = (*self_0).scratch;
20528 }
20529 spFloatArray_clear(input);
20530 spFloatArray_add(input, x1);
20531 spFloatArray_add(input, y1);
20532 spFloatArray_add(input, x2);
20533 spFloatArray_add(input, y2);
20534 spFloatArray_add(input, x3);
20535 spFloatArray_add(input, y3);
20536 spFloatArray_add(input, x1);
20537 spFloatArray_add(input, y1);
20538 spFloatArray_clear(output);
20539 clippingVertices = (*clippingArea).items;
20540 clippingVerticesLast = (*clippingArea).size - 4 as c_int;
20541 i = 0 as c_int;
20542 loop {
20543 let mut ii: c_int = 0;
20544 let mut temp: *mut spFloatArray = std::ptr::null_mut::<spFloatArray>();
20545 let mut edgeX: c_float = *clippingVertices.offset(i as isize);
20546 let mut edgeY: c_float = *clippingVertices.offset((i + 1 as c_int) as isize);
20547 let mut edgeX2: c_float = *clippingVertices.offset((i + 2 as c_int) as isize);
20548 let mut edgeY2: c_float = *clippingVertices.offset((i + 3 as c_int) as isize);
20549 let mut deltaX: c_float = edgeX - edgeX2;
20550 let mut deltaY: c_float = edgeY - edgeY2;
20551 let mut inputVertices: *mut c_float = (*input).items;
20552 let mut inputVerticesLength: c_int = (*input).size - 2 as c_int;
20553 let mut outputStart: c_int = (*output).size;
20554 let mut current_block_42: u64;
20555 ii = 0 as c_int;
20556 while ii < inputVerticesLength {
20557 let mut inputX: c_float = *inputVertices.offset(ii as isize);
20558 let mut inputY: c_float = *inputVertices.offset((ii + 1 as c_int) as isize);
20559 let mut inputX2: c_float = *inputVertices.offset((ii + 2 as c_int) as isize);
20560 let mut inputY2: c_float = *inputVertices.offset((ii + 3 as c_int) as isize);
20561 let mut side2: c_int = (deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2)
20562 > 0 as c_int as c_float) as c_int;
20563 if deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0 as c_int as c_float {
20564 let mut c0: c_float = 0.;
20565 let mut c2: c_float = 0.;
20566 let mut s: c_float = 0.;
20567 let mut ua: c_float = 0.;
20568 if side2 != 0 {
20569 spFloatArray_add(output, inputX2);
20570 spFloatArray_add(output, inputY2);
20571 current_block_42 = 15904375183555213903;
20572 } else {
20573 c0 = inputY2 - inputY;
20574 c2 = inputX2 - inputX;
20575 s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY);
20576 if (if s < 0 as c_int as c_float { -s } else { s }) > 0.000001f32 {
20577 ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s;
20578 spFloatArray_add(output, edgeX + (edgeX2 - edgeX) * ua);
20579 spFloatArray_add(output, edgeY + (edgeY2 - edgeY) * ua);
20580 } else {
20581 spFloatArray_add(output, edgeX);
20582 spFloatArray_add(output, edgeY);
20583 }
20584 current_block_42 = 5330834795799507926;
20585 }
20586 } else {
20587 if side2 != 0 {
20588 let mut c0_0: c_float = inputY2 - inputY;
20589 let mut c2_0: c_float = inputX2 - inputX;
20590 let mut s_0: c_float = c0_0 * (edgeX2 - edgeX) - c2_0 * (edgeY2 - edgeY);
20591 if (if s_0 < 0 as c_int as c_float {
20592 -s_0
20593 } else {
20594 s_0
20595 }) > 0.000001f32
20596 {
20597 let mut ua_0: c_float =
20598 (c2_0 * (edgeY - inputY) - c0_0 * (edgeX - inputX)) / s_0;
20599 spFloatArray_add(output, edgeX + (edgeX2 - edgeX) * ua_0);
20600 spFloatArray_add(output, edgeY + (edgeY2 - edgeY) * ua_0);
20601 } else {
20602 spFloatArray_add(output, edgeX);
20603 spFloatArray_add(output, edgeY);
20604 }
20605 spFloatArray_add(output, inputX2);
20606 spFloatArray_add(output, inputY2);
20607 }
20608 current_block_42 = 5330834795799507926;
20609 }
20610 match current_block_42 {
20611 5330834795799507926 => {
20612 clipped = 1 as c_int;
20613 }
20614 _ => {}
20615 }
20616 ii += 2 as c_int;
20617 }
20618 if outputStart == (*output).size {
20619 spFloatArray_clear(originalOutput);
20620 return 1 as c_int;
20621 }
20622 spFloatArray_add(output, *((*output).items).offset(0 as c_int as isize));
20623 spFloatArray_add(output, *((*output).items).offset(1 as c_int as isize));
20624 if i == clippingVerticesLast {
20625 break;
20626 }
20627 temp = output;
20628 output = input;
20629 spFloatArray_clear(output);
20630 input = temp;
20631 i += 2 as c_int;
20632 }
20633 if originalOutput != output {
20634 spFloatArray_clear(originalOutput);
20635 spFloatArray_addAllValues(
20636 originalOutput,
20637 (*output).items,
20638 0 as c_int,
20639 (*output).size - 2 as c_int,
20640 );
20641 } else {
20642 spFloatArray_setSize(originalOutput, (*originalOutput).size - 2 as c_int);
20643 }
20644 clipped
20645}
20646#[no_mangle]
20647pub unsafe extern "C" fn spSkeletonClipping_clipTriangles(
20648 mut self_0: *mut spSkeletonClipping,
20649 mut vertices: *mut c_float,
20650 mut _verticesLength: c_int,
20651 mut triangles: *mut c_ushort,
20652 mut trianglesLength: c_int,
20653 mut uvs: *mut c_float,
20654 mut stride: c_int,
20655) {
20656 let mut i: c_int = 0;
20657 let mut clipOutput: *mut spFloatArray = (*self_0).clipOutput;
20658 let mut clippedVertices: *mut spFloatArray = (*self_0).clippedVertices;
20659 let mut clippedUVs: *mut spFloatArray = (*self_0).clippedUVs;
20660 let mut clippedTriangles: *mut spUnsignedShortArray = (*self_0).clippedTriangles;
20661 let mut polygons: *mut *mut spFloatArray = (*(*self_0).clippingPolygons).items;
20662 let mut polygonsCount: c_int = (*(*self_0).clippingPolygons).size;
20663 let mut index: c_short = 0 as c_int as c_short;
20664 spFloatArray_clear(clippedVertices);
20665 spFloatArray_clear(clippedUVs);
20666 spUnsignedShortArray_clear(clippedTriangles);
20667 i = 0 as c_int;
20668 's_30: while i < trianglesLength {
20669 let mut p: c_int = 0;
20670 let mut vertexOffset: c_int = *triangles.offset(i as isize) as c_int * stride;
20671 let mut x2: c_float = 0.;
20672 let mut y2: c_float = 0.;
20673 let mut u2: c_float = 0.;
20674 let mut v2: c_float = 0.;
20675 let mut x3: c_float = 0.;
20676 let mut y3: c_float = 0.;
20677 let mut u3: c_float = 0.;
20678 let mut v3: c_float = 0.;
20679 let mut x1: c_float = *vertices.offset(vertexOffset as isize);
20680 let mut y1: c_float = *vertices.offset((vertexOffset + 1 as c_int) as isize);
20681 let mut u1: c_float = *uvs.offset(vertexOffset as isize);
20682 let mut v1: c_float = *uvs.offset((vertexOffset + 1 as c_int) as isize);
20683 vertexOffset = *triangles.offset((i + 1 as c_int) as isize) as c_int * stride;
20684 x2 = *vertices.offset(vertexOffset as isize);
20685 y2 = *vertices.offset((vertexOffset + 1 as c_int) as isize);
20686 u2 = *uvs.offset(vertexOffset as isize);
20687 v2 = *uvs.offset((vertexOffset + 1 as c_int) as isize);
20688 vertexOffset = *triangles.offset((i + 2 as c_int) as isize) as c_int * stride;
20689 x3 = *vertices.offset(vertexOffset as isize);
20690 y3 = *vertices.offset((vertexOffset + 1 as c_int) as isize);
20691 u3 = *uvs.offset(vertexOffset as isize);
20692 v3 = *uvs.offset((vertexOffset + 1 as c_int) as isize);
20693 p = 0 as c_int;
20694 while p < polygonsCount {
20695 let mut s: c_int = (*clippedVertices).size;
20696 if _clip(
20697 self_0,
20698 x1,
20699 y1,
20700 x2,
20701 y2,
20702 x3,
20703 y3,
20704 *polygons.offset(p as isize),
20705 clipOutput,
20706 ) != 0
20707 {
20708 let mut ii: c_int = 0;
20709 let mut d0: c_float = 0.;
20710 let mut d1: c_float = 0.;
20711 let mut d2: c_float = 0.;
20712 let mut d4: c_float = 0.;
20713 let mut d: c_float = 0.;
20714 let mut clippedTrianglesItems: *mut c_ushort = std::ptr::null_mut::<c_ushort>();
20715 let mut clipOutputCount: c_int = 0;
20716 let mut clipOutputItems: *mut c_float = std::ptr::null_mut::<c_float>();
20717 let mut clippedVerticesItems: *mut c_float = std::ptr::null_mut::<c_float>();
20718 let mut clippedUVsItems: *mut c_float = std::ptr::null_mut::<c_float>();
20719 let mut clipOutputLength: c_int = (*clipOutput).size;
20720 if clipOutputLength != 0 as c_int {
20721 d0 = y2 - y3;
20722 d1 = x3 - x2;
20723 d2 = x1 - x3;
20724 d4 = y3 - y1;
20725 d = 1 as c_int as c_float / (d0 * d2 + d1 * (y1 - y3));
20726 clipOutputCount = clipOutputLength >> 1 as c_int;
20727 clipOutputItems = (*clipOutput).items;
20728 clippedVerticesItems = (*spFloatArray_setSize(
20729 clippedVertices,
20730 s + (clipOutputCount << 1 as c_int),
20731 ))
20732 .items;
20733 clippedUVsItems =
20734 (*spFloatArray_setSize(clippedUVs, s + (clipOutputCount << 1 as c_int)))
20735 .items;
20736 ii = 0 as c_int;
20737 while ii < clipOutputLength {
20738 let mut c0: c_float = 0.;
20739 let mut c1: c_float = 0.;
20740 let mut a: c_float = 0.;
20741 let mut b: c_float = 0.;
20742 let mut c: c_float = 0.;
20743 let mut x: c_float = *clipOutputItems.offset(ii as isize);
20744 let mut y: c_float = *clipOutputItems.offset((ii + 1 as c_int) as isize);
20745 *clippedVerticesItems.offset(s as isize) = x;
20746 *clippedVerticesItems.offset((s + 1 as c_int) as isize) = y;
20747 c0 = x - x3;
20748 c1 = y - y3;
20749 a = (d0 * c0 + d1 * c1) * d;
20750 b = (d4 * c0 + d2 * c1) * d;
20751 c = 1 as c_int as c_float - a - b;
20752 *clippedUVsItems.offset(s as isize) = u1 * a + u2 * b + u3 * c;
20753 *clippedUVsItems.offset((s + 1 as c_int) as isize) =
20754 v1 * a + v2 * b + v3 * c;
20755 s += 2 as c_int;
20756 ii += 2 as c_int;
20757 }
20758 s = (*clippedTriangles).size;
20759 clippedTrianglesItems = (*spUnsignedShortArray_setSize(
20760 clippedTriangles,
20761 s + 3 as c_int * (clipOutputCount - 2 as c_int),
20762 ))
20763 .items;
20764 clipOutputCount -= 1;
20765 ii = 1 as c_int;
20766 while ii < clipOutputCount {
20767 *clippedTrianglesItems.offset(s as isize) = index as c_ushort;
20768 *clippedTrianglesItems.offset((s + 1 as c_int) as isize) =
20769 (index as c_int + ii) as c_ushort;
20770 *clippedTrianglesItems.offset((s + 2 as c_int) as isize) =
20771 (index as c_int + ii + 1 as c_int) as c_ushort;
20772 s += 3 as c_int;
20773 ii += 1;
20774 }
20775 index = (index as c_int + (clipOutputCount + 1 as c_int)) as c_short;
20776 }
20777 p += 1;
20778 } else {
20779 let mut clippedTrianglesItems_0: *mut c_ushort = std::ptr::null_mut::<c_ushort>();
20780 let mut clippedVerticesItems_0: *mut c_float =
20781 (*spFloatArray_setSize(clippedVertices, s + ((3 as c_int) << 1 as c_int)))
20782 .items;
20783 let mut clippedUVsItems_0: *mut c_float =
20784 (*spFloatArray_setSize(clippedUVs, s + ((3 as c_int) << 1 as c_int))).items;
20785 *clippedVerticesItems_0.offset(s as isize) = x1;
20786 *clippedVerticesItems_0.offset((s + 1 as c_int) as isize) = y1;
20787 *clippedVerticesItems_0.offset((s + 2 as c_int) as isize) = x2;
20788 *clippedVerticesItems_0.offset((s + 3 as c_int) as isize) = y2;
20789 *clippedVerticesItems_0.offset((s + 4 as c_int) as isize) = x3;
20790 *clippedVerticesItems_0.offset((s + 5 as c_int) as isize) = y3;
20791 *clippedUVsItems_0.offset(s as isize) = u1;
20792 *clippedUVsItems_0.offset((s + 1 as c_int) as isize) = v1;
20793 *clippedUVsItems_0.offset((s + 2 as c_int) as isize) = u2;
20794 *clippedUVsItems_0.offset((s + 3 as c_int) as isize) = v2;
20795 *clippedUVsItems_0.offset((s + 4 as c_int) as isize) = u3;
20796 *clippedUVsItems_0.offset((s + 5 as c_int) as isize) = v3;
20797 s = (*clippedTriangles).size;
20798 clippedTrianglesItems_0 =
20799 (*spUnsignedShortArray_setSize(clippedTriangles, s + 3 as c_int)).items;
20800 *clippedTrianglesItems_0.offset(s as isize) = index as c_ushort;
20801 *clippedTrianglesItems_0.offset((s + 1 as c_int) as isize) =
20802 (index as c_int + 1 as c_int) as c_ushort;
20803 *clippedTrianglesItems_0.offset((s + 2 as c_int) as isize) =
20804 (index as c_int + 2 as c_int) as c_ushort;
20805 index = (index as c_int + 3 as c_int) as c_short;
20806 i += 3 as c_int;
20807 continue 's_30;
20808 }
20809 }
20810 i += 3 as c_int;
20811 }
20812}
20813#[no_mangle]
20814pub unsafe extern "C" fn spSkeletonData_create() -> *mut spSkeletonData {
20815 _spCalloc(
20816 1 as c_int as size_t,
20817 ::core::mem::size_of::<spSkeletonData>() as c_ulong,
20818 (b"spine.c\0" as *const u8).cast::<c_char>(),
20819 11241 as c_int,
20820 )
20821 .cast::<spSkeletonData>()
20822}
20823#[no_mangle]
20824pub unsafe extern "C" fn spSkeletonData_dispose(mut self_0: *mut spSkeletonData) {
20825 let mut i: c_int = 0;
20826 i = 0 as c_int;
20827 while i < (*self_0).stringsCount {
20828 _spFree((*((*self_0).strings).offset(i as isize)).cast::<c_void>());
20829 i += 1;
20830 }
20831 _spFree((*self_0).strings.cast::<c_void>());
20832 i = 0 as c_int;
20833 while i < (*self_0).bonesCount {
20834 spBoneData_dispose(*((*self_0).bones).offset(i as isize));
20835 i += 1;
20836 }
20837 _spFree((*self_0).bones.cast::<c_void>());
20838 i = 0 as c_int;
20839 while i < (*self_0).slotsCount {
20840 spSlotData_dispose(*((*self_0).slots).offset(i as isize));
20841 i += 1;
20842 }
20843 _spFree((*self_0).slots.cast::<c_void>());
20844 i = 0 as c_int;
20845 while i < (*self_0).skinsCount {
20846 spSkin_dispose(*((*self_0).skins).offset(i as isize));
20847 i += 1;
20848 }
20849 _spFree((*self_0).skins.cast::<c_void>());
20850 i = 0 as c_int;
20851 while i < (*self_0).eventsCount {
20852 spEventData_dispose(*((*self_0).events).offset(i as isize));
20853 i += 1;
20854 }
20855 _spFree((*self_0).events.cast::<c_void>());
20856 i = 0 as c_int;
20857 while i < (*self_0).animationsCount {
20858 spAnimation_dispose(*((*self_0).animations).offset(i as isize));
20859 i += 1;
20860 }
20861 _spFree((*self_0).animations.cast::<c_void>());
20862 i = 0 as c_int;
20863 while i < (*self_0).ikConstraintsCount {
20864 spIkConstraintData_dispose(*((*self_0).ikConstraints).offset(i as isize));
20865 i += 1;
20866 }
20867 _spFree((*self_0).ikConstraints.cast::<c_void>());
20868 i = 0 as c_int;
20869 while i < (*self_0).transformConstraintsCount {
20870 spTransformConstraintData_dispose(*((*self_0).transformConstraints).offset(i as isize));
20871 i += 1;
20872 }
20873 _spFree((*self_0).transformConstraints.cast::<c_void>());
20874 i = 0 as c_int;
20875 while i < (*self_0).pathConstraintsCount {
20876 spPathConstraintData_dispose(*((*self_0).pathConstraints).offset(i as isize));
20877 i += 1;
20878 }
20879 _spFree((*self_0).pathConstraints.cast::<c_void>());
20880 i = 0 as c_int;
20881 while i < (*self_0).physicsConstraintsCount {
20882 spPhysicsConstraintData_dispose(*((*self_0).physicsConstraints).offset(i as isize));
20883 i += 1;
20884 }
20885 _spFree((*self_0).physicsConstraints.cast::<c_void>());
20886 _spFree((*self_0).hash.cast::<c_void>());
20887 _spFree((*self_0).version.cast::<c_void>());
20888 _spFree((*self_0).imagesPath as *mut c_void);
20889 _spFree((*self_0).audioPath as *mut c_void);
20890 _spFree(self_0.cast::<c_void>());
20891}
20892#[no_mangle]
20893pub unsafe extern "C" fn spSkeletonData_findBone(
20894 mut self_0: *const spSkeletonData,
20895 mut boneName: *const c_char,
20896) -> *mut spBoneData {
20897 let mut i: c_int = 0;
20898 i = 0 as c_int;
20899 while i < (*self_0).bonesCount {
20900 if spine_strcmp((**((*self_0).bones).offset(i as isize)).name, boneName) == 0 as c_int {
20901 return *((*self_0).bones).offset(i as isize);
20902 }
20903 i += 1;
20904 }
20905 std::ptr::null_mut::<spBoneData>()
20906}
20907#[no_mangle]
20908pub unsafe extern "C" fn spSkeletonData_findSlot(
20909 mut self_0: *const spSkeletonData,
20910 mut slotName: *const c_char,
20911) -> *mut spSlotData {
20912 let mut i: c_int = 0;
20913 i = 0 as c_int;
20914 while i < (*self_0).slotsCount {
20915 if spine_strcmp((**((*self_0).slots).offset(i as isize)).name, slotName) == 0 as c_int {
20916 return *((*self_0).slots).offset(i as isize);
20917 }
20918 i += 1;
20919 }
20920 std::ptr::null_mut::<spSlotData>()
20921}
20922#[no_mangle]
20923pub unsafe extern "C" fn spSkeletonData_findSkin(
20924 mut self_0: *const spSkeletonData,
20925 mut skinName: *const c_char,
20926) -> *mut spSkin {
20927 let mut i: c_int = 0;
20928 i = 0 as c_int;
20929 while i < (*self_0).skinsCount {
20930 if spine_strcmp((**((*self_0).skins).offset(i as isize)).name, skinName) == 0 as c_int {
20931 return *((*self_0).skins).offset(i as isize);
20932 }
20933 i += 1;
20934 }
20935 std::ptr::null_mut::<spSkin>()
20936}
20937#[no_mangle]
20938pub unsafe extern "C" fn spSkeletonData_findEvent(
20939 mut self_0: *const spSkeletonData,
20940 mut eventName: *const c_char,
20941) -> *mut spEventData {
20942 let mut i: c_int = 0;
20943 i = 0 as c_int;
20944 while i < (*self_0).eventsCount {
20945 if spine_strcmp((**((*self_0).events).offset(i as isize)).name, eventName) == 0 as c_int {
20946 return *((*self_0).events).offset(i as isize);
20947 }
20948 i += 1;
20949 }
20950 std::ptr::null_mut::<spEventData>()
20951}
20952#[no_mangle]
20953pub unsafe extern "C" fn spSkeletonData_findAnimation(
20954 mut self_0: *const spSkeletonData,
20955 mut animationName: *const c_char,
20956) -> *mut spAnimation {
20957 let mut i: c_int = 0;
20958 i = 0 as c_int;
20959 while i < (*self_0).animationsCount {
20960 if spine_strcmp(
20961 (**((*self_0).animations).offset(i as isize)).name,
20962 animationName,
20963 ) == 0 as c_int
20964 {
20965 return *((*self_0).animations).offset(i as isize);
20966 }
20967 i += 1;
20968 }
20969 std::ptr::null_mut::<spAnimation>()
20970}
20971#[no_mangle]
20972pub unsafe extern "C" fn spSkeletonData_findIkConstraint(
20973 mut self_0: *const spSkeletonData,
20974 mut constraintName: *const c_char,
20975) -> *mut spIkConstraintData {
20976 let mut i: c_int = 0;
20977 i = 0 as c_int;
20978 while i < (*self_0).ikConstraintsCount {
20979 if spine_strcmp(
20980 (**((*self_0).ikConstraints).offset(i as isize)).name,
20981 constraintName,
20982 ) == 0 as c_int
20983 {
20984 return *((*self_0).ikConstraints).offset(i as isize);
20985 }
20986 i += 1;
20987 }
20988 std::ptr::null_mut::<spIkConstraintData>()
20989}
20990#[no_mangle]
20991pub unsafe extern "C" fn spSkeletonData_findTransformConstraint(
20992 mut self_0: *const spSkeletonData,
20993 mut constraintName: *const c_char,
20994) -> *mut spTransformConstraintData {
20995 let mut i: c_int = 0;
20996 i = 0 as c_int;
20997 while i < (*self_0).transformConstraintsCount {
20998 if spine_strcmp(
20999 (**((*self_0).transformConstraints).offset(i as isize)).name,
21000 constraintName,
21001 ) == 0 as c_int
21002 {
21003 return *((*self_0).transformConstraints).offset(i as isize);
21004 }
21005 i += 1;
21006 }
21007 std::ptr::null_mut::<spTransformConstraintData>()
21008}
21009#[no_mangle]
21010pub unsafe extern "C" fn spSkeletonData_findPathConstraint(
21011 mut self_0: *const spSkeletonData,
21012 mut constraintName: *const c_char,
21013) -> *mut spPathConstraintData {
21014 let mut i: c_int = 0;
21015 i = 0 as c_int;
21016 while i < (*self_0).pathConstraintsCount {
21017 if spine_strcmp(
21018 (**((*self_0).pathConstraints).offset(i as isize)).name,
21019 constraintName,
21020 ) == 0 as c_int
21021 {
21022 return *((*self_0).pathConstraints).offset(i as isize);
21023 }
21024 i += 1;
21025 }
21026 std::ptr::null_mut::<spPathConstraintData>()
21027}
21028#[no_mangle]
21029pub unsafe extern "C" fn spSkeletonData_findPhysicsConstraint(
21030 mut self_0: *const spSkeletonData,
21031 mut constraintName: *const c_char,
21032) -> *mut spPhysicsConstraintData {
21033 let mut i: c_int = 0;
21034 i = 0 as c_int;
21035 while i < (*self_0).physicsConstraintsCount {
21036 if spine_strcmp(
21037 (**((*self_0).physicsConstraints).offset(i as isize)).name,
21038 constraintName,
21039 ) == 0 as c_int
21040 {
21041 return *((*self_0).physicsConstraints).offset(i as isize);
21042 }
21043 i += 1;
21044 }
21045 std::ptr::null_mut::<spPhysicsConstraintData>()
21046}
21047#[no_mangle]
21048pub unsafe extern "C" fn spSkeletonJson_createWithLoader(
21049 mut attachmentLoader: *mut spAttachmentLoader,
21050) -> *mut spSkeletonJson {
21051 let mut self_0: *mut spSkeletonJson = &mut (*(_spCalloc
21052 as unsafe extern "C" fn(size_t, size_t, *const c_char, c_int) -> *mut c_void)(
21053 1 as c_int as size_t,
21054 ::core::mem::size_of::<_spSkeletonJson>() as c_ulong,
21055 (b"spine.c\0" as *const u8).cast::<c_char>(),
21056 11413 as c_int,
21057 )
21058 .cast::<_spSkeletonJson>())
21059 .super_0;
21060 (*self_0).scale = 1 as c_int as c_float;
21061 (*self_0).attachmentLoader = attachmentLoader;
21062 self_0
21063}
21064#[no_mangle]
21065pub unsafe extern "C" fn spSkeletonJson_create(mut atlas: *mut spAtlas) -> *mut spSkeletonJson {
21066 let mut attachmentLoader: *mut spAtlasAttachmentLoader = spAtlasAttachmentLoader_create(atlas);
21067 let mut self_0: *mut spSkeletonJson =
21068 spSkeletonJson_createWithLoader(&mut (*attachmentLoader).super_0);
21069 (*self_0.cast::<_spSkeletonJson>()).ownsLoader = 1 as c_int;
21070 self_0
21071}
21072#[no_mangle]
21073pub unsafe extern "C" fn spSkeletonJson_dispose(mut self_0: *mut spSkeletonJson) {
21074 let mut internal: *mut _spSkeletonJson = self_0.cast::<_spSkeletonJson>();
21075 if (*internal).ownsLoader != 0 {
21076 spAttachmentLoader_dispose((*self_0).attachmentLoader);
21077 }
21078 _spFree((*internal).linkedMeshes.cast::<c_void>());
21079 _spFree((*self_0).error.cast::<c_void>());
21080 _spFree(self_0.cast::<c_void>());
21081}
21082#[no_mangle]
21083pub unsafe extern "C" fn _spSkeletonJson_setError(
21084 mut self_0: *mut spSkeletonJson,
21085 mut root: *mut Json,
21086 mut value1: *const c_char,
21087 mut value2: *const c_char,
21088) {
21089 let mut message: [c_char; 256] = [0; 256];
21090 let mut length: c_int = 0;
21091 _spFree((*self_0).error.cast::<c_void>());
21092 spine_strcpy(message.as_mut_ptr(), value1);
21093 length = spine_strlen(value1) as c_int;
21094 if !value2.is_null() {
21095 spine_strncat(
21096 message.as_mut_ptr().offset(length as isize),
21097 value2,
21098 (255 as c_int - length) as size_t,
21099 );
21100 }
21101 (*self_0).error = _spMalloc(
21102 (::core::mem::size_of::<c_char>() as c_ulong)
21103 .wrapping_mul((spine_strlen(message.as_mut_ptr())).wrapping_add(1 as c_int as c_ulong)),
21104 (b"spine.c\0" as *const u8).cast::<c_char>(),
21105 11441 as c_int,
21106 )
21107 .cast::<c_char>();
21108 spine_strcpy((*self_0).error, message.as_mut_ptr());
21109 if !root.is_null() {
21110 Json_dispose(root);
21111 }
21112}
21113unsafe extern "C" fn toColor(mut value: *const c_char, mut index: c_int) -> c_float {
21114 let mut digits: [c_char; 3] = [0; 3];
21115 let mut error: *mut c_char = std::ptr::null_mut::<c_char>();
21116 let mut color: c_int = 0;
21117 if index as size_t >= (spine_strlen(value)).wrapping_div(2 as c_int as c_ulong) {
21118 return -(1 as c_int) as c_float;
21119 }
21120 value = value.offset((index * 2 as c_int) as isize);
21121 digits[0 as c_int as usize] = *value;
21122 digits[1 as c_int as usize] = *value.offset(1 as c_int as isize);
21123 digits[2 as c_int as usize] = '\0' as i32 as c_char;
21124 color = spine_strtoul(digits.as_mut_ptr(), &mut error, 16 as c_int) as c_int;
21125 if *error as c_int != 0 as c_int {
21126 return -(1 as c_int) as c_float;
21127 }
21128 color as c_float / 255 as c_int as c_float
21129}
21130unsafe extern "C" fn toColor2(
21131 mut color: *mut spColor,
21132 mut value: *const c_char,
21133 mut hasAlpha: c_int,
21134) {
21135 (*color).r = toColor(value, 0 as c_int);
21136 (*color).g = toColor(value, 1 as c_int);
21137 (*color).b = toColor(value, 2 as c_int);
21138 if hasAlpha != 0 {
21139 (*color).a = toColor(value, 3 as c_int);
21140 } else {
21141 (*color).a = 1.0f32;
21142 };
21143}
21144unsafe extern "C" fn setBezierJson(
21145 mut timeline: *mut spCurveTimeline,
21146 mut frame: c_int,
21147 mut value: c_int,
21148 mut bezier: c_int,
21149 mut time1: c_float,
21150 mut value1: c_float,
21151 mut cx1: c_float,
21152 mut cy1: c_float,
21153 mut cx2: c_float,
21154 mut cy2: c_float,
21155 mut time2: c_float,
21156 mut value2: c_float,
21157) {
21158 spTimeline_setBezier(
21159 &mut (*timeline).super_0,
21160 bezier,
21161 frame,
21162 value as c_float,
21163 time1,
21164 value1,
21165 cx1,
21166 cy1,
21167 cx2,
21168 cy2,
21169 time2,
21170 value2,
21171 );
21172}
21173unsafe extern "C" fn readCurve(
21174 mut curve: *mut Json,
21175 mut timeline: *mut spCurveTimeline,
21176 mut bezier: c_int,
21177 mut frame: c_int,
21178 mut value: c_int,
21179 mut time1: c_float,
21180 mut time2: c_float,
21181 mut value1: c_float,
21182 mut value2: c_float,
21183 mut scale: c_float,
21184) -> c_int {
21185 let mut cx1: c_float = 0.;
21186 let mut cy1: c_float = 0.;
21187 let mut cx2: c_float = 0.;
21188 let mut cy2: c_float = 0.;
21189 if (*curve).type_0 == 4 as c_int
21190 && spine_strcmp(
21191 (*curve).valueString,
21192 (b"stepped\0" as *const u8).cast::<c_char>(),
21193 ) == 0 as c_int
21194 {
21195 spCurveTimeline_setStepped(timeline, frame);
21196 return bezier;
21197 }
21198 curve = Json_getItemAtIndex(curve, value << 2 as c_int);
21199 cx1 = (*curve).valueFloat;
21200 curve = (*curve).next;
21201 cy1 = (*curve).valueFloat * scale;
21202 curve = (*curve).next;
21203 cx2 = (*curve).valueFloat;
21204 curve = (*curve).next;
21205 cy2 = (*curve).valueFloat * scale;
21206 setBezierJson(
21207 timeline, frame, value, bezier, time1, value1, cx1, cy1, cx2, cy2, time2, value2,
21208 );
21209 bezier + 1 as c_int
21210}
21211unsafe extern "C" fn readTimelineJson(
21212 mut keyMap: *mut Json,
21213 mut timeline: *mut spCurveTimeline1,
21214 mut defaultValue: c_float,
21215 mut scale: c_float,
21216) -> *mut spTimeline {
21217 let mut time: c_float = Json_getFloat(
21218 keyMap,
21219 (b"time\0" as *const u8).cast::<c_char>(),
21220 0 as c_int as c_float,
21221 );
21222 let mut value: c_float = Json_getFloat(
21223 keyMap,
21224 (b"value\0" as *const u8).cast::<c_char>(),
21225 defaultValue,
21226 ) * scale;
21227 let mut frame: c_int = 0;
21228 let mut bezier: c_int = 0 as c_int;
21229 frame = 0 as c_int;
21230 loop {
21231 let mut nextMap: *mut Json = std::ptr::null_mut::<Json>();
21232 let mut curve: *mut Json = std::ptr::null_mut::<Json>();
21233 let mut time2: c_float = 0.;
21234 let mut value2: c_float = 0.;
21235 spCurveTimeline1_setFrame(timeline, frame, time, value);
21236 nextMap = (*keyMap).next;
21237 if nextMap.is_null() {
21238 break;
21239 }
21240 time2 = Json_getFloat(
21241 nextMap,
21242 (b"time\0" as *const u8).cast::<c_char>(),
21243 0 as c_int as c_float,
21244 );
21245 value2 = Json_getFloat(
21246 nextMap,
21247 (b"value\0" as *const u8).cast::<c_char>(),
21248 defaultValue,
21249 ) * scale;
21250 curve = Json_getItem(keyMap, (b"curve\0" as *const u8).cast::<c_char>());
21251 if !curve.is_null() {
21252 bezier = readCurve(
21253 curve, timeline, bezier, frame, 0 as c_int, time, time2, value, value2, scale,
21254 );
21255 }
21256 time = time2;
21257 value = value2;
21258 keyMap = nextMap;
21259 frame += 1;
21260 }
21261 &mut (*timeline).super_0
21262}
21263unsafe extern "C" fn readTimeline2Json(
21264 mut keyMap: *mut Json,
21265 mut timeline: *mut spCurveTimeline2,
21266 mut name1: *const c_char,
21267 mut name2: *const c_char,
21268 mut defaultValue: c_float,
21269 mut scale: c_float,
21270) -> *mut spTimeline {
21271 let mut time: c_float = Json_getFloat(
21272 keyMap,
21273 (b"time\0" as *const u8).cast::<c_char>(),
21274 0 as c_int as c_float,
21275 );
21276 let mut value1: c_float = Json_getFloat(keyMap, name1, defaultValue) * scale;
21277 let mut value2: c_float = Json_getFloat(keyMap, name2, defaultValue) * scale;
21278 let mut frame: c_int = 0;
21279 let mut bezier: c_int = 0 as c_int;
21280 frame = 0 as c_int;
21281 loop {
21282 let mut nextMap: *mut Json = std::ptr::null_mut::<Json>();
21283 let mut curve: *mut Json = std::ptr::null_mut::<Json>();
21284 let mut time2: c_float = 0.;
21285 let mut nvalue1: c_float = 0.;
21286 let mut nvalue2: c_float = 0.;
21287 spCurveTimeline2_setFrame(timeline, frame, time, value1, value2);
21288 nextMap = (*keyMap).next;
21289 if nextMap.is_null() {
21290 break;
21291 }
21292 time2 = Json_getFloat(
21293 nextMap,
21294 (b"time\0" as *const u8).cast::<c_char>(),
21295 0 as c_int as c_float,
21296 );
21297 nvalue1 = Json_getFloat(nextMap, name1, defaultValue) * scale;
21298 nvalue2 = Json_getFloat(nextMap, name2, defaultValue) * scale;
21299 curve = Json_getItem(keyMap, (b"curve\0" as *const u8).cast::<c_char>());
21300 if !curve.is_null() {
21301 bezier = readCurve(
21302 curve, timeline, bezier, frame, 0 as c_int, time, time2, value1, nvalue1, scale,
21303 );
21304 bezier = readCurve(
21305 curve, timeline, bezier, frame, 1 as c_int, time, time2, value2, nvalue2, scale,
21306 );
21307 }
21308 time = time2;
21309 value1 = nvalue1;
21310 value2 = nvalue2;
21311 keyMap = nextMap;
21312 frame += 1;
21313 }
21314 &mut (*timeline).super_0
21315}
21316unsafe extern "C" fn readSequenceJson(mut item: *mut Json) -> *mut spSequence {
21317 let mut sequence: *mut spSequence = std::ptr::null_mut::<spSequence>();
21318 if item.is_null() {
21319 return std::ptr::null_mut::<spSequence>();
21320 }
21321 sequence = spSequence_create(Json_getInt(
21322 item,
21323 (b"count\0" as *const u8).cast::<c_char>(),
21324 0 as c_int,
21325 ));
21326 (*sequence).start = Json_getInt(item, (b"start\0" as *const u8).cast::<c_char>(), 1 as c_int);
21327 (*sequence).digits = Json_getInt(
21328 item,
21329 (b"digits\0" as *const u8).cast::<c_char>(),
21330 0 as c_int,
21331 );
21332 (*sequence).setupIndex = Json_getInt(
21333 item,
21334 (b"setupIndex\0" as *const u8).cast::<c_char>(),
21335 0 as c_int,
21336 );
21337 sequence
21338}
21339unsafe extern "C" fn _spSkeletonJson_addLinkedMesh(
21340 mut self_0: *mut spSkeletonJson,
21341 mut mesh: *mut spMeshAttachment,
21342 mut skin: *const c_char,
21343 mut slotIndex: c_int,
21344 mut parent: *const c_char,
21345 mut inheritDeform: c_int,
21346) {
21347 let mut linkedMesh: *mut _spLinkedMeshJson = std::ptr::null_mut::<_spLinkedMeshJson>();
21348 let mut internal: *mut _spSkeletonJson = self_0.cast::<_spSkeletonJson>();
21349 if (*internal).linkedMeshCount == (*internal).linkedMeshCapacity {
21350 let mut linkedMeshes: *mut _spLinkedMeshJson = std::ptr::null_mut::<_spLinkedMeshJson>();
21351 (*internal).linkedMeshCapacity *= 2 as c_int;
21352 if (*internal).linkedMeshCapacity < 8 as c_int {
21353 (*internal).linkedMeshCapacity = 8 as c_int;
21354 }
21355 linkedMeshes = _spMalloc(
21356 (::core::mem::size_of::<_spLinkedMeshJson>() as c_ulong)
21357 .wrapping_mul((*internal).linkedMeshCapacity as c_ulong),
21358 (b"spine.c\0" as *const u8).cast::<c_char>(),
21359 11566 as c_int,
21360 )
21361 .cast::<_spLinkedMeshJson>();
21362 spine_memcpy(
21363 linkedMeshes.cast::<c_void>(),
21364 (*internal).linkedMeshes as *const c_void,
21365 (::core::mem::size_of::<_spLinkedMeshJson>() as c_ulong)
21366 .wrapping_mul((*internal).linkedMeshCount as c_ulong),
21367 );
21368 _spFree((*internal).linkedMeshes.cast::<c_void>());
21369 (*internal).linkedMeshes = linkedMeshes;
21370 }
21371 let fresh130 = (*internal).linkedMeshCount;
21372 (*internal).linkedMeshCount += 1;
21373 linkedMesh = ((*internal).linkedMeshes).offset(fresh130 as isize);
21374 (*linkedMesh).mesh = mesh;
21375 (*linkedMesh).skin = skin;
21376 (*linkedMesh).slotIndex = slotIndex;
21377 (*linkedMesh).parent = parent;
21378 (*linkedMesh).inheritTimeline = inheritDeform;
21379}
21380unsafe extern "C" fn cleanUpTimelines(mut timelines: *mut spTimelineArray) {
21381 let mut i: c_int = 0;
21382 let mut n: c_int = 0;
21383 i = 0 as c_int;
21384 n = (*timelines).size;
21385 while i < n {
21386 spTimeline_dispose(*((*timelines).items).offset(i as isize));
21387 i += 1;
21388 }
21389 spTimelineArray_dispose(timelines);
21390}
21391unsafe extern "C" fn findSlotIndex(
21392 mut json: *mut spSkeletonJson,
21393 mut skeletonData: *const spSkeletonData,
21394 mut slotName: *const c_char,
21395 mut timelines: *mut spTimelineArray,
21396) -> c_int {
21397 let mut slot: *mut spSlotData = spSkeletonData_findSlot(skeletonData, slotName);
21398 if !slot.is_null() {
21399 return (*slot).index;
21400 }
21401 cleanUpTimelines(timelines);
21402 _spSkeletonJson_setError(
21403 json,
21404 std::ptr::null_mut::<Json>(),
21405 (b"Slot not found: \0" as *const u8).cast::<c_char>(),
21406 slotName,
21407 );
21408 -(1 as c_int)
21409}
21410#[no_mangle]
21411pub unsafe extern "C" fn findIkConstraintIndex(
21412 mut json: *mut spSkeletonJson,
21413 mut skeletonData: *const spSkeletonData,
21414 mut constraint: *const spIkConstraintData,
21415 mut timelines: *mut spTimelineArray,
21416) -> c_int {
21417 if !constraint.is_null() {
21418 let mut i: c_int = 0;
21419 i = 0 as c_int;
21420 while i < (*skeletonData).ikConstraintsCount {
21421 if *((*skeletonData).ikConstraints).offset(i as isize) == constraint.cast_mut() {
21422 return i;
21423 }
21424 i += 1;
21425 }
21426 }
21427 cleanUpTimelines(timelines);
21428 _spSkeletonJson_setError(
21429 json,
21430 std::ptr::null_mut::<Json>(),
21431 (b"IK constraint not found: \0" as *const u8).cast::<c_char>(),
21432 (*constraint).name,
21433 );
21434 -(1 as c_int)
21435}
21436#[no_mangle]
21437pub unsafe extern "C" fn findTransformConstraintIndex(
21438 mut json: *mut spSkeletonJson,
21439 mut skeletonData: *const spSkeletonData,
21440 mut constraint: *const spTransformConstraintData,
21441 mut timelines: *mut spTimelineArray,
21442) -> c_int {
21443 if !constraint.is_null() {
21444 let mut i: c_int = 0;
21445 i = 0 as c_int;
21446 while i < (*skeletonData).transformConstraintsCount {
21447 if *((*skeletonData).transformConstraints).offset(i as isize) == constraint.cast_mut() {
21448 return i;
21449 }
21450 i += 1;
21451 }
21452 }
21453 cleanUpTimelines(timelines);
21454 _spSkeletonJson_setError(
21455 json,
21456 std::ptr::null_mut::<Json>(),
21457 (b"Transform constraint not found: \0" as *const u8).cast::<c_char>(),
21458 (*constraint).name,
21459 );
21460 -(1 as c_int)
21461}
21462#[no_mangle]
21463pub unsafe extern "C" fn findPathConstraintIndex(
21464 mut json: *mut spSkeletonJson,
21465 mut skeletonData: *const spSkeletonData,
21466 mut constraint: *const spPathConstraintData,
21467 mut timelines: *mut spTimelineArray,
21468) -> c_int {
21469 if !constraint.is_null() {
21470 let mut i: c_int = 0;
21471 i = 0 as c_int;
21472 while i < (*skeletonData).pathConstraintsCount {
21473 if *((*skeletonData).pathConstraints).offset(i as isize) == constraint.cast_mut() {
21474 return i;
21475 }
21476 i += 1;
21477 }
21478 }
21479 cleanUpTimelines(timelines);
21480 _spSkeletonJson_setError(
21481 json,
21482 std::ptr::null_mut::<Json>(),
21483 (b"Path constraint not found: \0" as *const u8).cast::<c_char>(),
21484 (*constraint).name,
21485 );
21486 -(1 as c_int)
21487}
21488#[no_mangle]
21489pub unsafe extern "C" fn findPhysicsConstraintIndex(
21490 mut json: *mut spSkeletonJson,
21491 mut skeletonData: *const spSkeletonData,
21492 mut constraint: *const spPhysicsConstraintData,
21493 mut timelines: *mut spTimelineArray,
21494) -> c_int {
21495 if !constraint.is_null() {
21496 let mut i: c_int = 0;
21497 i = 0 as c_int;
21498 while i < (*skeletonData).physicsConstraintsCount {
21499 if *((*skeletonData).physicsConstraints).offset(i as isize) == constraint.cast_mut() {
21500 return i;
21501 }
21502 i += 1;
21503 }
21504 }
21505 cleanUpTimelines(timelines);
21506 _spSkeletonJson_setError(
21507 json,
21508 std::ptr::null_mut::<Json>(),
21509 (b"Physics constraint not found: \0" as *const u8).cast::<c_char>(),
21510 (*constraint).name,
21511 );
21512 -(1 as c_int)
21513}
21514unsafe extern "C" fn _spSkeletonJson_readAnimation(
21515 mut self_0: *mut spSkeletonJson,
21516 mut root: *mut Json,
21517 mut skeletonData: *mut spSkeletonData,
21518) -> *mut spAnimation {
21519 let mut timelines: *mut spTimelineArray = spTimelineArray_create(8 as c_int);
21520 let mut scale: c_float = (*self_0).scale;
21521 let mut duration: c_float = 0.;
21522 let mut bones: *mut Json = Json_getItem(root, (b"bones\0" as *const u8).cast::<c_char>());
21523 let mut slots: *mut Json = Json_getItem(root, (b"slots\0" as *const u8).cast::<c_char>());
21524 let mut ik: *mut Json = Json_getItem(root, (b"ik\0" as *const u8).cast::<c_char>());
21525 let mut transform: *mut Json =
21526 Json_getItem(root, (b"transform\0" as *const u8).cast::<c_char>());
21527 let mut paths: *mut Json = Json_getItem(root, (b"path\0" as *const u8).cast::<c_char>());
21528 let mut physics: *mut Json = Json_getItem(root, (b"physics\0" as *const u8).cast::<c_char>());
21529 let mut attachmentsJson: *mut Json =
21530 Json_getItem(root, (b"attachments\0" as *const u8).cast::<c_char>());
21531 let mut drawOrderJson: *mut Json =
21532 Json_getItem(root, (b"drawOrder\0" as *const u8).cast::<c_char>());
21533 let mut events: *mut Json = Json_getItem(root, (b"events\0" as *const u8).cast::<c_char>());
21534 let mut boneMap: *mut Json = std::ptr::null_mut::<Json>();
21535 let mut slotMap: *mut Json = std::ptr::null_mut::<Json>();
21536 let mut keyMap: *mut Json = std::ptr::null_mut::<Json>();
21537 let mut nextMap: *mut Json = std::ptr::null_mut::<Json>();
21538 let mut curve: *mut Json = std::ptr::null_mut::<Json>();
21539 let mut timelineMap: *mut Json = std::ptr::null_mut::<Json>();
21540 let mut attachmentsMap: *mut Json = std::ptr::null_mut::<Json>();
21541 let mut constraintMap: *mut Json = std::ptr::null_mut::<Json>();
21542 let mut frame: c_int = 0;
21543 let mut bezier: c_int = 0;
21544 let mut i: c_int = 0;
21545 let mut n: c_int = 0;
21546 let mut color: spColor = spColor {
21547 r: 0.,
21548 g: 0.,
21549 b: 0.,
21550 a: 0.,
21551 };
21552 let mut color2: spColor = spColor {
21553 r: 0.,
21554 g: 0.,
21555 b: 0.,
21556 a: 0.,
21557 };
21558 let mut newColor: spColor = spColor {
21559 r: 0.,
21560 g: 0.,
21561 b: 0.,
21562 a: 0.,
21563 };
21564 let mut newColor2: spColor = spColor {
21565 r: 0.,
21566 g: 0.,
21567 b: 0.,
21568 a: 0.,
21569 };
21570 slotMap = if !slots.is_null() {
21571 (*slots).child
21572 } else {
21573 std::ptr::null_mut::<Json>()
21574 };
21575 while !slotMap.is_null() {
21576 let mut slotIndex: c_int = findSlotIndex(self_0, skeletonData, (*slotMap).name, timelines);
21577 if slotIndex == -(1 as c_int) {
21578 return std::ptr::null_mut::<spAnimation>();
21579 }
21580 timelineMap = (*slotMap).child;
21581 while !timelineMap.is_null() {
21582 let mut frames: c_int = (*timelineMap).size;
21583 if spine_strcmp(
21584 (*timelineMap).name,
21585 (b"attachment\0" as *const u8).cast::<c_char>(),
21586 ) == 0 as c_int
21587 {
21588 let mut timeline: *mut spAttachmentTimeline =
21589 spAttachmentTimeline_create(frames, slotIndex);
21590 keyMap = (*timelineMap).child;
21591 frame = 0 as c_int;
21592 while !keyMap.is_null() {
21593 spAttachmentTimeline_setFrame(
21594 timeline,
21595 frame,
21596 Json_getFloat(
21597 keyMap,
21598 (b"time\0" as *const u8).cast::<c_char>(),
21599 0 as c_int as c_float,
21600 ),
21601 if !(Json_getItem(keyMap, (b"name\0" as *const u8).cast::<c_char>()))
21602 .is_null()
21603 {
21604 (*Json_getItem(keyMap, (b"name\0" as *const u8).cast::<c_char>()))
21605 .valueString
21606 } else {
21607 std::ptr::null::<c_char>()
21608 },
21609 );
21610 keyMap = (*keyMap).next;
21611 frame += 1;
21612 }
21613 spTimelineArray_add(timelines, &mut (*timeline).super_0);
21614 } else if spine_strcmp(
21615 (*timelineMap).name,
21616 (b"rgba\0" as *const u8).cast::<c_char>(),
21617 ) == 0 as c_int
21618 {
21619 let mut time: c_float = 0.;
21620 let mut timeline_0: *mut spRGBATimeline =
21621 spRGBATimeline_create(frames, frames << 2 as c_int, slotIndex);
21622 keyMap = (*timelineMap).child;
21623 time = Json_getFloat(
21624 keyMap,
21625 (b"time\0" as *const u8).cast::<c_char>(),
21626 0 as c_int as c_float,
21627 );
21628 toColor2(
21629 &mut color,
21630 Json_getString(
21631 keyMap,
21632 (b"color\0" as *const u8).cast::<c_char>(),
21633 std::ptr::null::<c_char>(),
21634 ),
21635 1 as c_int,
21636 );
21637 frame = 0 as c_int;
21638 bezier = 0 as c_int;
21639 loop {
21640 let mut time2: c_float = 0.;
21641 spRGBATimeline_setFrame(
21642 timeline_0, frame, time, color.r, color.g, color.b, color.a,
21643 );
21644 nextMap = (*keyMap).next;
21645 if nextMap.is_null() {
21646 break;
21647 }
21648 time2 = Json_getFloat(
21649 nextMap,
21650 (b"time\0" as *const u8).cast::<c_char>(),
21651 0 as c_int as c_float,
21652 );
21653 toColor2(
21654 &mut newColor,
21655 Json_getString(
21656 nextMap,
21657 (b"color\0" as *const u8).cast::<c_char>(),
21658 std::ptr::null::<c_char>(),
21659 ),
21660 1 as c_int,
21661 );
21662 curve = Json_getItem(keyMap, (b"curve\0" as *const u8).cast::<c_char>());
21663 if !curve.is_null() {
21664 bezier = readCurve(
21665 curve,
21666 &mut (*timeline_0).super_0,
21667 bezier,
21668 frame,
21669 0 as c_int,
21670 time,
21671 time2,
21672 color.r,
21673 newColor.r,
21674 1 as c_int as c_float,
21675 );
21676 bezier = readCurve(
21677 curve,
21678 &mut (*timeline_0).super_0,
21679 bezier,
21680 frame,
21681 1 as c_int,
21682 time,
21683 time2,
21684 color.g,
21685 newColor.g,
21686 1 as c_int as c_float,
21687 );
21688 bezier = readCurve(
21689 curve,
21690 &mut (*timeline_0).super_0,
21691 bezier,
21692 frame,
21693 2 as c_int,
21694 time,
21695 time2,
21696 color.b,
21697 newColor.b,
21698 1 as c_int as c_float,
21699 );
21700 bezier = readCurve(
21701 curve,
21702 &mut (*timeline_0).super_0,
21703 bezier,
21704 frame,
21705 3 as c_int,
21706 time,
21707 time2,
21708 color.a,
21709 newColor.a,
21710 1 as c_int as c_float,
21711 );
21712 }
21713 time = time2;
21714 color = newColor;
21715 keyMap = nextMap;
21716 frame += 1;
21717 }
21718 spTimelineArray_add(timelines, &mut (*timeline_0).super_0.super_0);
21719 } else if spine_strcmp(
21720 (*timelineMap).name,
21721 (b"rgb\0" as *const u8).cast::<c_char>(),
21722 ) == 0 as c_int
21723 {
21724 let mut time_0: c_float = 0.;
21725 let mut timeline_1: *mut spRGBTimeline =
21726 spRGBTimeline_create(frames, frames * 3 as c_int, slotIndex);
21727 keyMap = (*timelineMap).child;
21728 time_0 = Json_getFloat(
21729 keyMap,
21730 (b"time\0" as *const u8).cast::<c_char>(),
21731 0 as c_int as c_float,
21732 );
21733 toColor2(
21734 &mut color,
21735 Json_getString(
21736 keyMap,
21737 (b"color\0" as *const u8).cast::<c_char>(),
21738 std::ptr::null::<c_char>(),
21739 ),
21740 1 as c_int,
21741 );
21742 frame = 0 as c_int;
21743 bezier = 0 as c_int;
21744 loop {
21745 let mut time2_0: c_float = 0.;
21746 spRGBTimeline_setFrame(timeline_1, frame, time_0, color.r, color.g, color.b);
21747 nextMap = (*keyMap).next;
21748 if nextMap.is_null() {
21749 break;
21750 }
21751 time2_0 = Json_getFloat(
21752 nextMap,
21753 (b"time\0" as *const u8).cast::<c_char>(),
21754 0 as c_int as c_float,
21755 );
21756 toColor2(
21757 &mut newColor,
21758 Json_getString(
21759 nextMap,
21760 (b"color\0" as *const u8).cast::<c_char>(),
21761 std::ptr::null::<c_char>(),
21762 ),
21763 1 as c_int,
21764 );
21765 curve = Json_getItem(keyMap, (b"curve\0" as *const u8).cast::<c_char>());
21766 if !curve.is_null() {
21767 bezier = readCurve(
21768 curve,
21769 &mut (*timeline_1).super_0,
21770 bezier,
21771 frame,
21772 0 as c_int,
21773 time_0,
21774 time2_0,
21775 color.r,
21776 newColor.r,
21777 1 as c_int as c_float,
21778 );
21779 bezier = readCurve(
21780 curve,
21781 &mut (*timeline_1).super_0,
21782 bezier,
21783 frame,
21784 1 as c_int,
21785 time_0,
21786 time2_0,
21787 color.g,
21788 newColor.g,
21789 1 as c_int as c_float,
21790 );
21791 bezier = readCurve(
21792 curve,
21793 &mut (*timeline_1).super_0,
21794 bezier,
21795 frame,
21796 2 as c_int,
21797 time_0,
21798 time2_0,
21799 color.b,
21800 newColor.b,
21801 1 as c_int as c_float,
21802 );
21803 }
21804 time_0 = time2_0;
21805 color = newColor;
21806 keyMap = nextMap;
21807 frame += 1;
21808 }
21809 spTimelineArray_add(timelines, &mut (*timeline_1).super_0.super_0);
21810 } else if spine_strcmp(
21811 (*timelineMap).name,
21812 (b"alpha\0" as *const u8).cast::<c_char>(),
21813 ) == 0 as c_int
21814 {
21815 spTimelineArray_add(
21816 timelines,
21817 readTimelineJson(
21818 (*timelineMap).child,
21819 &mut (*(spAlphaTimeline_create
21820 as unsafe extern "C" fn(c_int, c_int, c_int) -> *mut spAlphaTimeline)(
21821 frames, frames, slotIndex,
21822 ))
21823 .super_0,
21824 0 as c_int as c_float,
21825 1 as c_int as c_float,
21826 ),
21827 );
21828 } else if spine_strcmp(
21829 (*timelineMap).name,
21830 (b"rgba2\0" as *const u8).cast::<c_char>(),
21831 ) == 0 as c_int
21832 {
21833 let mut time_1: c_float = 0.;
21834 let mut timeline_2: *mut spRGBA2Timeline =
21835 spRGBA2Timeline_create(frames, frames * 7 as c_int, slotIndex);
21836 keyMap = (*timelineMap).child;
21837 time_1 = Json_getFloat(
21838 keyMap,
21839 (b"time\0" as *const u8).cast::<c_char>(),
21840 0 as c_int as c_float,
21841 );
21842 toColor2(
21843 &mut color,
21844 Json_getString(
21845 keyMap,
21846 (b"light\0" as *const u8).cast::<c_char>(),
21847 std::ptr::null::<c_char>(),
21848 ),
21849 1 as c_int,
21850 );
21851 toColor2(
21852 &mut color2,
21853 Json_getString(
21854 keyMap,
21855 (b"dark\0" as *const u8).cast::<c_char>(),
21856 std::ptr::null::<c_char>(),
21857 ),
21858 0 as c_int,
21859 );
21860 frame = 0 as c_int;
21861 bezier = 0 as c_int;
21862 loop {
21863 let mut time2_1: c_float = 0.;
21864 spRGBA2Timeline_setFrame(
21865 timeline_2, frame, time_1, color.r, color.g, color.b, color.a, color2.g,
21866 color2.g, color2.b,
21867 );
21868 nextMap = (*keyMap).next;
21869 if nextMap.is_null() {
21870 break;
21871 }
21872 time2_1 = Json_getFloat(
21873 nextMap,
21874 (b"time\0" as *const u8).cast::<c_char>(),
21875 0 as c_int as c_float,
21876 );
21877 toColor2(
21878 &mut newColor,
21879 Json_getString(
21880 nextMap,
21881 (b"light\0" as *const u8).cast::<c_char>(),
21882 std::ptr::null::<c_char>(),
21883 ),
21884 1 as c_int,
21885 );
21886 toColor2(
21887 &mut newColor2,
21888 Json_getString(
21889 nextMap,
21890 (b"dark\0" as *const u8).cast::<c_char>(),
21891 std::ptr::null::<c_char>(),
21892 ),
21893 0 as c_int,
21894 );
21895 curve = Json_getItem(keyMap, (b"curve\0" as *const u8).cast::<c_char>());
21896 if !curve.is_null() {
21897 bezier = readCurve(
21898 curve,
21899 &mut (*timeline_2).super_0,
21900 bezier,
21901 frame,
21902 0 as c_int,
21903 time_1,
21904 time2_1,
21905 color.r,
21906 newColor.r,
21907 1 as c_int as c_float,
21908 );
21909 bezier = readCurve(
21910 curve,
21911 &mut (*timeline_2).super_0,
21912 bezier,
21913 frame,
21914 1 as c_int,
21915 time_1,
21916 time2_1,
21917 color.g,
21918 newColor.g,
21919 1 as c_int as c_float,
21920 );
21921 bezier = readCurve(
21922 curve,
21923 &mut (*timeline_2).super_0,
21924 bezier,
21925 frame,
21926 2 as c_int,
21927 time_1,
21928 time2_1,
21929 color.b,
21930 newColor.b,
21931 1 as c_int as c_float,
21932 );
21933 bezier = readCurve(
21934 curve,
21935 &mut (*timeline_2).super_0,
21936 bezier,
21937 frame,
21938 3 as c_int,
21939 time_1,
21940 time2_1,
21941 color.a,
21942 newColor.a,
21943 1 as c_int as c_float,
21944 );
21945 bezier = readCurve(
21946 curve,
21947 &mut (*timeline_2).super_0,
21948 bezier,
21949 frame,
21950 4 as c_int,
21951 time_1,
21952 time2_1,
21953 color2.r,
21954 newColor2.r,
21955 1 as c_int as c_float,
21956 );
21957 bezier = readCurve(
21958 curve,
21959 &mut (*timeline_2).super_0,
21960 bezier,
21961 frame,
21962 5 as c_int,
21963 time_1,
21964 time2_1,
21965 color2.g,
21966 newColor2.g,
21967 1 as c_int as c_float,
21968 );
21969 bezier = readCurve(
21970 curve,
21971 &mut (*timeline_2).super_0,
21972 bezier,
21973 frame,
21974 6 as c_int,
21975 time_1,
21976 time2_1,
21977 color2.b,
21978 newColor2.b,
21979 1 as c_int as c_float,
21980 );
21981 }
21982 time_1 = time2_1;
21983 color = newColor;
21984 color2 = newColor2;
21985 keyMap = nextMap;
21986 frame += 1;
21987 }
21988 spTimelineArray_add(timelines, &mut (*timeline_2).super_0.super_0);
21989 } else if spine_strcmp(
21990 (*timelineMap).name,
21991 (b"rgb2\0" as *const u8).cast::<c_char>(),
21992 ) == 0 as c_int
21993 {
21994 let mut time_2: c_float = 0.;
21995 let mut timeline_3: *mut spRGBA2Timeline =
21996 spRGBA2Timeline_create(frames, frames * 6 as c_int, slotIndex);
21997 keyMap = (*timelineMap).child;
21998 time_2 = Json_getFloat(
21999 keyMap,
22000 (b"time\0" as *const u8).cast::<c_char>(),
22001 0 as c_int as c_float,
22002 );
22003 toColor2(
22004 &mut color,
22005 Json_getString(
22006 keyMap,
22007 (b"light\0" as *const u8).cast::<c_char>(),
22008 std::ptr::null::<c_char>(),
22009 ),
22010 0 as c_int,
22011 );
22012 toColor2(
22013 &mut color2,
22014 Json_getString(
22015 keyMap,
22016 (b"dark\0" as *const u8).cast::<c_char>(),
22017 std::ptr::null::<c_char>(),
22018 ),
22019 0 as c_int,
22020 );
22021 frame = 0 as c_int;
22022 bezier = 0 as c_int;
22023 loop {
22024 let mut time2_2: c_float = 0.;
22025 spRGBA2Timeline_setFrame(
22026 timeline_3, frame, time_2, color.r, color.g, color.b, color.a, color2.r,
22027 color2.g, color2.b,
22028 );
22029 nextMap = (*keyMap).next;
22030 if nextMap.is_null() {
22031 break;
22032 }
22033 time2_2 = Json_getFloat(
22034 nextMap,
22035 (b"time\0" as *const u8).cast::<c_char>(),
22036 0 as c_int as c_float,
22037 );
22038 toColor2(
22039 &mut newColor,
22040 Json_getString(
22041 nextMap,
22042 (b"light\0" as *const u8).cast::<c_char>(),
22043 std::ptr::null::<c_char>(),
22044 ),
22045 0 as c_int,
22046 );
22047 toColor2(
22048 &mut newColor2,
22049 Json_getString(
22050 nextMap,
22051 (b"dark\0" as *const u8).cast::<c_char>(),
22052 std::ptr::null::<c_char>(),
22053 ),
22054 0 as c_int,
22055 );
22056 curve = Json_getItem(keyMap, (b"curve\0" as *const u8).cast::<c_char>());
22057 if !curve.is_null() {
22058 bezier = readCurve(
22059 curve,
22060 &mut (*timeline_3).super_0,
22061 bezier,
22062 frame,
22063 0 as c_int,
22064 time_2,
22065 time2_2,
22066 color.r,
22067 newColor.r,
22068 1 as c_int as c_float,
22069 );
22070 bezier = readCurve(
22071 curve,
22072 &mut (*timeline_3).super_0,
22073 bezier,
22074 frame,
22075 1 as c_int,
22076 time_2,
22077 time2_2,
22078 color.g,
22079 newColor.g,
22080 1 as c_int as c_float,
22081 );
22082 bezier = readCurve(
22083 curve,
22084 &mut (*timeline_3).super_0,
22085 bezier,
22086 frame,
22087 2 as c_int,
22088 time_2,
22089 time2_2,
22090 color.b,
22091 newColor.b,
22092 1 as c_int as c_float,
22093 );
22094 bezier = readCurve(
22095 curve,
22096 &mut (*timeline_3).super_0,
22097 bezier,
22098 frame,
22099 3 as c_int,
22100 time_2,
22101 time2_2,
22102 color2.r,
22103 newColor2.r,
22104 1 as c_int as c_float,
22105 );
22106 bezier = readCurve(
22107 curve,
22108 &mut (*timeline_3).super_0,
22109 bezier,
22110 frame,
22111 4 as c_int,
22112 time_2,
22113 time2_2,
22114 color2.g,
22115 newColor2.g,
22116 1 as c_int as c_float,
22117 );
22118 bezier = readCurve(
22119 curve,
22120 &mut (*timeline_3).super_0,
22121 bezier,
22122 frame,
22123 5 as c_int,
22124 time_2,
22125 time2_2,
22126 color2.b,
22127 newColor2.b,
22128 1 as c_int as c_float,
22129 );
22130 }
22131 time_2 = time2_2;
22132 color = newColor;
22133 color2 = newColor2;
22134 keyMap = nextMap;
22135 frame += 1;
22136 }
22137 spTimelineArray_add(timelines, &mut (*timeline_3).super_0.super_0);
22138 } else {
22139 cleanUpTimelines(timelines);
22140 _spSkeletonJson_setError(
22141 self_0,
22142 std::ptr::null_mut::<Json>(),
22143 (b"Invalid timeline type for a slot: \0" as *const u8).cast::<c_char>(),
22144 (*timelineMap).name,
22145 );
22146 return std::ptr::null_mut::<spAnimation>();
22147 }
22148 timelineMap = (*timelineMap).next;
22149 }
22150 slotMap = (*slotMap).next;
22151 }
22152 boneMap = if !bones.is_null() {
22153 (*bones).child
22154 } else {
22155 std::ptr::null_mut::<Json>()
22156 };
22157 while !boneMap.is_null() {
22158 let mut boneIndex: c_int = -(1 as c_int);
22159 i = 0 as c_int;
22160 while i < (*skeletonData).bonesCount {
22161 if spine_strcmp(
22162 (**((*skeletonData).bones).offset(i as isize)).name,
22163 (*boneMap).name,
22164 ) == 0 as c_int
22165 {
22166 boneIndex = i;
22167 break;
22168 } else {
22169 i += 1;
22170 }
22171 }
22172 if boneIndex == -(1 as c_int) {
22173 cleanUpTimelines(timelines);
22174 _spSkeletonJson_setError(
22175 self_0,
22176 std::ptr::null_mut::<Json>(),
22177 (b"Bone not found: \0" as *const u8).cast::<c_char>(),
22178 (*boneMap).name,
22179 );
22180 return std::ptr::null_mut::<spAnimation>();
22181 }
22182 timelineMap = (*boneMap).child;
22183 while !timelineMap.is_null() {
22184 let mut frames_0: c_int = (*timelineMap).size;
22185 if frames_0 != 0 as c_int {
22186 if spine_strcmp(
22187 (*timelineMap).name,
22188 (b"rotate\0" as *const u8).cast::<c_char>(),
22189 ) == 0 as c_int
22190 {
22191 spTimelineArray_add(
22192 timelines,
22193 readTimelineJson(
22194 (*timelineMap).child,
22195 &mut (*(spRotateTimeline_create
22196 as unsafe extern "C" fn(
22197 c_int,
22198 c_int,
22199 c_int,
22200 )
22201 -> *mut spRotateTimeline)(
22202 frames_0, frames_0, boneIndex
22203 ))
22204 .super_0,
22205 0 as c_int as c_float,
22206 1 as c_int as c_float,
22207 ),
22208 );
22209 } else if spine_strcmp(
22210 (*timelineMap).name,
22211 (b"translate\0" as *const u8).cast::<c_char>(),
22212 ) == 0 as c_int
22213 {
22214 let mut timeline_4: *mut spTranslateTimeline =
22215 spTranslateTimeline_create(frames_0, frames_0 << 1 as c_int, boneIndex);
22216 spTimelineArray_add(
22217 timelines,
22218 readTimeline2Json(
22219 (*timelineMap).child,
22220 &mut (*timeline_4).super_0,
22221 (b"x\0" as *const u8).cast::<c_char>(),
22222 (b"y\0" as *const u8).cast::<c_char>(),
22223 0 as c_int as c_float,
22224 scale,
22225 ),
22226 );
22227 } else if spine_strcmp(
22228 (*timelineMap).name,
22229 (b"translatex\0" as *const u8).cast::<c_char>(),
22230 ) == 0 as c_int
22231 {
22232 let mut timeline_5: *mut spTranslateXTimeline =
22233 spTranslateXTimeline_create(frames_0, frames_0, boneIndex);
22234 spTimelineArray_add(
22235 timelines,
22236 readTimelineJson(
22237 (*timelineMap).child,
22238 &mut (*timeline_5).super_0,
22239 0 as c_int as c_float,
22240 scale,
22241 ),
22242 );
22243 } else if spine_strcmp(
22244 (*timelineMap).name,
22245 (b"translatey\0" as *const u8).cast::<c_char>(),
22246 ) == 0 as c_int
22247 {
22248 let mut timeline_6: *mut spTranslateYTimeline =
22249 spTranslateYTimeline_create(frames_0, frames_0, boneIndex);
22250 spTimelineArray_add(
22251 timelines,
22252 readTimelineJson(
22253 (*timelineMap).child,
22254 &mut (*timeline_6).super_0,
22255 0 as c_int as c_float,
22256 scale,
22257 ),
22258 );
22259 } else if spine_strcmp(
22260 (*timelineMap).name,
22261 (b"scale\0" as *const u8).cast::<c_char>(),
22262 ) == 0 as c_int
22263 {
22264 let mut timeline_7: *mut spScaleTimeline =
22265 spScaleTimeline_create(frames_0, frames_0 << 1 as c_int, boneIndex);
22266 spTimelineArray_add(
22267 timelines,
22268 readTimeline2Json(
22269 (*timelineMap).child,
22270 &mut (*timeline_7).super_0,
22271 (b"x\0" as *const u8).cast::<c_char>(),
22272 (b"y\0" as *const u8).cast::<c_char>(),
22273 1 as c_int as c_float,
22274 1 as c_int as c_float,
22275 ),
22276 );
22277 } else if spine_strcmp(
22278 (*timelineMap).name,
22279 (b"scalex\0" as *const u8).cast::<c_char>(),
22280 ) == 0 as c_int
22281 {
22282 let mut timeline_8: *mut spScaleXTimeline =
22283 spScaleXTimeline_create(frames_0, frames_0, boneIndex);
22284 spTimelineArray_add(
22285 timelines,
22286 readTimelineJson(
22287 (*timelineMap).child,
22288 &mut (*timeline_8).super_0,
22289 1 as c_int as c_float,
22290 1 as c_int as c_float,
22291 ),
22292 );
22293 } else if spine_strcmp(
22294 (*timelineMap).name,
22295 (b"scaley\0" as *const u8).cast::<c_char>(),
22296 ) == 0 as c_int
22297 {
22298 let mut timeline_9: *mut spScaleYTimeline =
22299 spScaleYTimeline_create(frames_0, frames_0, boneIndex);
22300 spTimelineArray_add(
22301 timelines,
22302 readTimelineJson(
22303 (*timelineMap).child,
22304 &mut (*timeline_9).super_0,
22305 1 as c_int as c_float,
22306 1 as c_int as c_float,
22307 ),
22308 );
22309 } else if spine_strcmp(
22310 (*timelineMap).name,
22311 (b"shear\0" as *const u8).cast::<c_char>(),
22312 ) == 0 as c_int
22313 {
22314 let mut timeline_10: *mut spShearTimeline =
22315 spShearTimeline_create(frames_0, frames_0 << 1 as c_int, boneIndex);
22316 spTimelineArray_add(
22317 timelines,
22318 readTimeline2Json(
22319 (*timelineMap).child,
22320 &mut (*timeline_10).super_0,
22321 (b"x\0" as *const u8).cast::<c_char>(),
22322 (b"y\0" as *const u8).cast::<c_char>(),
22323 0 as c_int as c_float,
22324 1 as c_int as c_float,
22325 ),
22326 );
22327 } else if spine_strcmp(
22328 (*timelineMap).name,
22329 (b"shearx\0" as *const u8).cast::<c_char>(),
22330 ) == 0 as c_int
22331 {
22332 let mut timeline_11: *mut spShearXTimeline =
22333 spShearXTimeline_create(frames_0, frames_0, boneIndex);
22334 spTimelineArray_add(
22335 timelines,
22336 readTimelineJson(
22337 (*timelineMap).child,
22338 &mut (*timeline_11).super_0,
22339 0 as c_int as c_float,
22340 1 as c_int as c_float,
22341 ),
22342 );
22343 } else if spine_strcmp(
22344 (*timelineMap).name,
22345 (b"sheary\0" as *const u8).cast::<c_char>(),
22346 ) == 0 as c_int
22347 {
22348 let mut timeline_12: *mut spShearYTimeline =
22349 spShearYTimeline_create(frames_0, frames_0, boneIndex);
22350 spTimelineArray_add(
22351 timelines,
22352 readTimelineJson(
22353 (*timelineMap).child,
22354 &mut (*timeline_12).super_0,
22355 0 as c_int as c_float,
22356 1 as c_int as c_float,
22357 ),
22358 );
22359 } else if spine_strcmp(
22360 (*timelineMap).name,
22361 (b"inherit\0" as *const u8).cast::<c_char>(),
22362 ) == 0 as c_int
22363 {
22364 let mut timeline_13: *mut spInheritTimeline =
22365 spInheritTimeline_create(frames_0, boneIndex);
22366 keyMap = (*timelineMap).child;
22367 frame = 0 as c_int;
22368 loop {
22369 let mut time_3: c_float = Json_getFloat(
22370 keyMap,
22371 (b"time\0" as *const u8).cast::<c_char>(),
22372 0 as c_int as c_float,
22373 );
22374 let mut value: *const c_char = Json_getString(
22375 keyMap,
22376 (b"value\0" as *const u8).cast::<c_char>(),
22377 (b"normal\0" as *const u8).cast::<c_char>(),
22378 );
22379 let mut inherit: spInherit = SP_INHERIT_NORMAL;
22380 if spine_strcmp(value, (b"normal\0" as *const u8).cast::<c_char>())
22381 == 0 as c_int
22382 {
22383 inherit = SP_INHERIT_NORMAL;
22384 } else if spine_strcmp(
22385 value,
22386 (b"onlyTranslation\0" as *const u8).cast::<c_char>(),
22387 ) == 0 as c_int
22388 {
22389 inherit = SP_INHERIT_ONLYTRANSLATION;
22390 } else if spine_strcmp(
22391 value,
22392 (b"noRotationOrReflection\0" as *const u8).cast::<c_char>(),
22393 ) == 0 as c_int
22394 {
22395 inherit = SP_INHERIT_NOROTATIONORREFLECTION;
22396 } else if spine_strcmp(value, (b"noScale\0" as *const u8).cast::<c_char>())
22397 == 0 as c_int
22398 {
22399 inherit = SP_INHERIT_NOSCALE;
22400 } else if spine_strcmp(
22401 value,
22402 (b"noScaleOrReflection\0" as *const u8).cast::<c_char>(),
22403 ) == 0 as c_int
22404 {
22405 inherit = SP_INHERIT_NOSCALEORREFLECTION;
22406 }
22407 spInheritTimeline_setFrame(timeline_13, frame, time_3, inherit);
22408 nextMap = (*keyMap).next;
22409 if nextMap.is_null() {
22410 break;
22411 }
22412 frame += 1;
22413 }
22414 spTimelineArray_add(timelines, &mut (*timeline_13).super_0);
22415 } else {
22416 cleanUpTimelines(timelines);
22417 _spSkeletonJson_setError(
22418 self_0,
22419 std::ptr::null_mut::<Json>(),
22420 (b"Invalid timeline type for a bone: \0" as *const u8).cast::<c_char>(),
22421 (*timelineMap).name,
22422 );
22423 return std::ptr::null_mut::<spAnimation>();
22424 }
22425 }
22426 timelineMap = (*timelineMap).next;
22427 }
22428 boneMap = (*boneMap).next;
22429 }
22430 constraintMap = if !ik.is_null() {
22431 (*ik).child
22432 } else {
22433 std::ptr::null_mut::<Json>()
22434 };
22435 while !constraintMap.is_null() {
22436 let mut constraint: *mut spIkConstraintData = std::ptr::null_mut::<spIkConstraintData>();
22437 let mut timeline_14: *mut spIkConstraintTimeline =
22438 std::ptr::null_mut::<spIkConstraintTimeline>();
22439 let mut constraintIndex: c_int = 0;
22440 let mut time_4: c_float = 0.;
22441 let mut mix: c_float = 0.;
22442 let mut softness: c_float = 0.;
22443 keyMap = (*constraintMap).child;
22444 if !keyMap.is_null() {
22445 constraint = spSkeletonData_findIkConstraint(skeletonData, (*constraintMap).name);
22446 constraintIndex = findIkConstraintIndex(self_0, skeletonData, constraint, timelines);
22447 if constraintIndex == -(1 as c_int) {
22448 return std::ptr::null_mut::<spAnimation>();
22449 }
22450 timeline_14 = spIkConstraintTimeline_create(
22451 (*constraintMap).size,
22452 (*constraintMap).size << 1 as c_int,
22453 constraintIndex,
22454 );
22455 time_4 = Json_getFloat(
22456 keyMap,
22457 (b"time\0" as *const u8).cast::<c_char>(),
22458 0 as c_int as c_float,
22459 );
22460 mix = Json_getFloat(
22461 keyMap,
22462 (b"mix\0" as *const u8).cast::<c_char>(),
22463 1 as c_int as c_float,
22464 );
22465 softness = Json_getFloat(
22466 keyMap,
22467 (b"softness\0" as *const u8).cast::<c_char>(),
22468 0 as c_int as c_float,
22469 ) * scale;
22470 frame = 0 as c_int;
22471 bezier = 0 as c_int;
22472 loop {
22473 let mut time2_3: c_float = 0.;
22474 let mut mix2: c_float = 0.;
22475 let mut softness2: c_float = 0.;
22476 let mut bendDirection: c_int = if Json_getInt(
22477 keyMap,
22478 (b"bendPositive\0" as *const u8).cast::<c_char>(),
22479 1 as c_int,
22480 ) != 0
22481 {
22482 1 as c_int
22483 } else {
22484 -(1 as c_int)
22485 };
22486 spIkConstraintTimeline_setFrame(
22487 timeline_14,
22488 frame,
22489 time_4,
22490 mix,
22491 softness,
22492 bendDirection,
22493 if Json_getInt(
22494 keyMap,
22495 (b"compress\0" as *const u8).cast::<c_char>(),
22496 0 as c_int,
22497 ) != 0
22498 {
22499 1 as c_int
22500 } else {
22501 0 as c_int
22502 },
22503 if Json_getInt(
22504 keyMap,
22505 (b"stretch\0" as *const u8).cast::<c_char>(),
22506 0 as c_int,
22507 ) != 0
22508 {
22509 1 as c_int
22510 } else {
22511 0 as c_int
22512 },
22513 );
22514 nextMap = (*keyMap).next;
22515 if nextMap.is_null() {
22516 break;
22517 }
22518 time2_3 = Json_getFloat(
22519 nextMap,
22520 (b"time\0" as *const u8).cast::<c_char>(),
22521 0 as c_int as c_float,
22522 );
22523 mix2 = Json_getFloat(
22524 nextMap,
22525 (b"mix\0" as *const u8).cast::<c_char>(),
22526 1 as c_int as c_float,
22527 );
22528 softness2 = Json_getFloat(
22529 nextMap,
22530 (b"softness\0" as *const u8).cast::<c_char>(),
22531 0 as c_int as c_float,
22532 ) * scale;
22533 curve = Json_getItem(keyMap, (b"curve\0" as *const u8).cast::<c_char>());
22534 if !curve.is_null() {
22535 bezier = readCurve(
22536 curve,
22537 &mut (*timeline_14).super_0,
22538 bezier,
22539 frame,
22540 0 as c_int,
22541 time_4,
22542 time2_3,
22543 mix,
22544 mix2,
22545 1 as c_int as c_float,
22546 );
22547 bezier = readCurve(
22548 curve,
22549 &mut (*timeline_14).super_0,
22550 bezier,
22551 frame,
22552 1 as c_int,
22553 time_4,
22554 time2_3,
22555 softness,
22556 softness2,
22557 scale,
22558 );
22559 }
22560 time_4 = time2_3;
22561 mix = mix2;
22562 softness = softness2;
22563 keyMap = nextMap;
22564 frame += 1;
22565 }
22566 spTimelineArray_add(timelines, &mut (*timeline_14).super_0.super_0);
22567 }
22568 constraintMap = (*constraintMap).next;
22569 }
22570 constraintMap = if !transform.is_null() {
22571 (*transform).child
22572 } else {
22573 std::ptr::null_mut::<Json>()
22574 };
22575 while !constraintMap.is_null() {
22576 let mut constraint_0: *mut spTransformConstraintData =
22577 std::ptr::null_mut::<spTransformConstraintData>();
22578 let mut timeline_15: *mut spTransformConstraintTimeline =
22579 std::ptr::null_mut::<spTransformConstraintTimeline>();
22580 let mut constraintIndex_0: c_int = 0;
22581 let mut time_5: c_float = 0.;
22582 let mut mixRotate: c_float = 0.;
22583 let mut mixShearY: c_float = 0.;
22584 let mut mixX: c_float = 0.;
22585 let mut mixY: c_float = 0.;
22586 let mut mixScaleX: c_float = 0.;
22587 let mut mixScaleY: c_float = 0.;
22588 keyMap = (*constraintMap).child;
22589 if !keyMap.is_null() {
22590 constraint_0 =
22591 spSkeletonData_findTransformConstraint(skeletonData, (*constraintMap).name);
22592 constraintIndex_0 =
22593 findTransformConstraintIndex(self_0, skeletonData, constraint_0, timelines);
22594 if constraintIndex_0 == -(1 as c_int) {
22595 return std::ptr::null_mut::<spAnimation>();
22596 }
22597 timeline_15 = spTransformConstraintTimeline_create(
22598 (*constraintMap).size,
22599 (*constraintMap).size * 6 as c_int,
22600 constraintIndex_0,
22601 );
22602 time_5 = Json_getFloat(
22603 keyMap,
22604 (b"time\0" as *const u8).cast::<c_char>(),
22605 0 as c_int as c_float,
22606 );
22607 mixRotate = Json_getFloat(
22608 keyMap,
22609 (b"mixRotate\0" as *const u8).cast::<c_char>(),
22610 1 as c_int as c_float,
22611 );
22612 mixShearY = Json_getFloat(
22613 keyMap,
22614 (b"mixShearY\0" as *const u8).cast::<c_char>(),
22615 1 as c_int as c_float,
22616 );
22617 mixX = Json_getFloat(
22618 keyMap,
22619 (b"mixX\0" as *const u8).cast::<c_char>(),
22620 1 as c_int as c_float,
22621 );
22622 mixY = Json_getFloat(keyMap, (b"mixY\0" as *const u8).cast::<c_char>(), mixX);
22623 mixScaleX = Json_getFloat(
22624 keyMap,
22625 (b"mixScaleX\0" as *const u8).cast::<c_char>(),
22626 1 as c_int as c_float,
22627 );
22628 mixScaleY = Json_getFloat(
22629 keyMap,
22630 (b"mixScaleY\0" as *const u8).cast::<c_char>(),
22631 mixScaleX,
22632 );
22633 frame = 0 as c_int;
22634 bezier = 0 as c_int;
22635 loop {
22636 let mut time2_4: c_float = 0.;
22637 let mut mixRotate2: c_float = 0.;
22638 let mut mixShearY2: c_float = 0.;
22639 let mut mixX2: c_float = 0.;
22640 let mut mixY2: c_float = 0.;
22641 let mut mixScaleX2: c_float = 0.;
22642 let mut mixScaleY2: c_float = 0.;
22643 spTransformConstraintTimeline_setFrame(
22644 timeline_15,
22645 frame,
22646 time_5,
22647 mixRotate,
22648 mixX,
22649 mixY,
22650 mixScaleX,
22651 mixScaleY,
22652 mixShearY,
22653 );
22654 nextMap = (*keyMap).next;
22655 if nextMap.is_null() {
22656 break;
22657 }
22658 time2_4 = Json_getFloat(
22659 nextMap,
22660 (b"time\0" as *const u8).cast::<c_char>(),
22661 0 as c_int as c_float,
22662 );
22663 mixRotate2 = Json_getFloat(
22664 nextMap,
22665 (b"mixRotate\0" as *const u8).cast::<c_char>(),
22666 1 as c_int as c_float,
22667 );
22668 mixShearY2 = Json_getFloat(
22669 nextMap,
22670 (b"mixShearY\0" as *const u8).cast::<c_char>(),
22671 1 as c_int as c_float,
22672 );
22673 mixX2 = Json_getFloat(
22674 nextMap,
22675 (b"mixX\0" as *const u8).cast::<c_char>(),
22676 1 as c_int as c_float,
22677 );
22678 mixY2 = Json_getFloat(nextMap, (b"mixY\0" as *const u8).cast::<c_char>(), mixX2);
22679 mixScaleX2 = Json_getFloat(
22680 nextMap,
22681 (b"mixScaleX\0" as *const u8).cast::<c_char>(),
22682 1 as c_int as c_float,
22683 );
22684 mixScaleY2 = Json_getFloat(
22685 nextMap,
22686 (b"mixScaleY\0" as *const u8).cast::<c_char>(),
22687 mixScaleX2,
22688 );
22689 curve = Json_getItem(keyMap, (b"curve\0" as *const u8).cast::<c_char>());
22690 if !curve.is_null() {
22691 bezier = readCurve(
22692 curve,
22693 &mut (*timeline_15).super_0,
22694 bezier,
22695 frame,
22696 0 as c_int,
22697 time_5,
22698 time2_4,
22699 mixRotate,
22700 mixRotate2,
22701 1 as c_int as c_float,
22702 );
22703 bezier = readCurve(
22704 curve,
22705 &mut (*timeline_15).super_0,
22706 bezier,
22707 frame,
22708 1 as c_int,
22709 time_5,
22710 time2_4,
22711 mixX,
22712 mixX2,
22713 1 as c_int as c_float,
22714 );
22715 bezier = readCurve(
22716 curve,
22717 &mut (*timeline_15).super_0,
22718 bezier,
22719 frame,
22720 2 as c_int,
22721 time_5,
22722 time2_4,
22723 mixY,
22724 mixY2,
22725 1 as c_int as c_float,
22726 );
22727 bezier = readCurve(
22728 curve,
22729 &mut (*timeline_15).super_0,
22730 bezier,
22731 frame,
22732 3 as c_int,
22733 time_5,
22734 time2_4,
22735 mixScaleX,
22736 mixScaleX2,
22737 1 as c_int as c_float,
22738 );
22739 bezier = readCurve(
22740 curve,
22741 &mut (*timeline_15).super_0,
22742 bezier,
22743 frame,
22744 4 as c_int,
22745 time_5,
22746 time2_4,
22747 mixScaleY,
22748 mixScaleY2,
22749 1 as c_int as c_float,
22750 );
22751 bezier = readCurve(
22752 curve,
22753 &mut (*timeline_15).super_0,
22754 bezier,
22755 frame,
22756 5 as c_int,
22757 time_5,
22758 time2_4,
22759 mixShearY,
22760 mixShearY2,
22761 1 as c_int as c_float,
22762 );
22763 }
22764 time_5 = time2_4;
22765 mixRotate = mixRotate2;
22766 mixX = mixX2;
22767 mixY = mixY2;
22768 mixScaleX = mixScaleX2;
22769 mixScaleY = mixScaleY2;
22770 mixScaleX = mixScaleX2;
22771 keyMap = nextMap;
22772 frame += 1;
22773 }
22774 spTimelineArray_add(timelines, &mut (*timeline_15).super_0.super_0);
22775 }
22776 constraintMap = (*constraintMap).next;
22777 }
22778 constraintMap = if !paths.is_null() {
22779 (*paths).child
22780 } else {
22781 std::ptr::null_mut::<Json>()
22782 };
22783 while !constraintMap.is_null() {
22784 let mut constraint_1: *mut spPathConstraintData =
22785 spSkeletonData_findPathConstraint(skeletonData, (*constraintMap).name);
22786 let mut constraintIndex_1: c_int =
22787 findPathConstraintIndex(self_0, skeletonData, constraint_1, timelines);
22788 if constraintIndex_1 == -(1 as c_int) {
22789 return std::ptr::null_mut::<spAnimation>();
22790 }
22791 timelineMap = (*constraintMap).child;
22792 while !timelineMap.is_null() {
22793 let mut timelineName: *const c_char = std::ptr::null::<c_char>();
22794 let mut frames_1: c_int = 0;
22795 keyMap = (*timelineMap).child;
22796 if !keyMap.is_null() {
22797 frames_1 = (*timelineMap).size;
22798 timelineName = (*timelineMap).name;
22799 if spine_strcmp(timelineName, (b"position\0" as *const u8).cast::<c_char>())
22800 == 0 as c_int
22801 {
22802 let mut timeline_16: *mut spPathConstraintPositionTimeline =
22803 spPathConstraintPositionTimeline_create(
22804 frames_1,
22805 frames_1,
22806 constraintIndex_1,
22807 );
22808 spTimelineArray_add(
22809 timelines,
22810 readTimelineJson(
22811 keyMap,
22812 &mut (*timeline_16).super_0,
22813 0 as c_int as c_float,
22814 if (*constraint_1).positionMode as c_uint
22815 == SP_POSITION_MODE_FIXED as c_int as c_uint
22816 {
22817 scale
22818 } else {
22819 1 as c_int as c_float
22820 },
22821 ),
22822 );
22823 } else if spine_strcmp(timelineName, (b"spacing\0" as *const u8).cast::<c_char>())
22824 == 0 as c_int
22825 {
22826 let mut timeline_17: *mut spCurveTimeline1 =
22827 &mut (*(spPathConstraintSpacingTimeline_create
22828 as unsafe extern "C" fn(
22829 c_int,
22830 c_int,
22831 c_int,
22832 )
22833 -> *mut spPathConstraintSpacingTimeline)(
22834 frames_1,
22835 frames_1,
22836 constraintIndex_1,
22837 ))
22838 .super_0;
22839 spTimelineArray_add(
22840 timelines,
22841 readTimelineJson(
22842 keyMap,
22843 timeline_17,
22844 0 as c_int as c_float,
22845 if (*constraint_1).spacingMode as c_uint
22846 == SP_SPACING_MODE_LENGTH as c_int as c_uint
22847 || (*constraint_1).spacingMode as c_uint
22848 == SP_SPACING_MODE_FIXED as c_int as c_uint
22849 {
22850 scale
22851 } else {
22852 1 as c_int as c_float
22853 },
22854 ),
22855 );
22856 } else if spine_strcmp(timelineName, (b"mix\0" as *const u8).cast::<c_char>())
22857 == 0 as c_int
22858 {
22859 let mut timeline_18: *mut spPathConstraintMixTimeline =
22860 spPathConstraintMixTimeline_create(
22861 frames_1,
22862 frames_1 * 3 as c_int,
22863 constraintIndex_1,
22864 );
22865 let mut time_6: c_float = Json_getFloat(
22866 keyMap,
22867 (b"time\0" as *const u8).cast::<c_char>(),
22868 0 as c_int as c_float,
22869 );
22870 let mut mixRotate_0: c_float = Json_getFloat(
22871 keyMap,
22872 (b"mixRotate\0" as *const u8).cast::<c_char>(),
22873 1 as c_int as c_float,
22874 );
22875 let mut mixX_0: c_float = Json_getFloat(
22876 keyMap,
22877 (b"mixX\0" as *const u8).cast::<c_char>(),
22878 1 as c_int as c_float,
22879 );
22880 let mut mixY_0: c_float =
22881 Json_getFloat(keyMap, (b"mixY\0" as *const u8).cast::<c_char>(), mixX_0);
22882 frame = 0 as c_int;
22883 bezier = 0 as c_int;
22884 loop {
22885 let mut time2_5: c_float = 0.;
22886 let mut mixRotate2_0: c_float = 0.;
22887 let mut mixX2_0: c_float = 0.;
22888 let mut mixY2_0: c_float = 0.;
22889 spPathConstraintMixTimeline_setFrame(
22890 timeline_18,
22891 frame,
22892 time_6,
22893 mixRotate_0,
22894 mixX_0,
22895 mixY_0,
22896 );
22897 nextMap = (*keyMap).next;
22898 if nextMap.is_null() {
22899 break;
22900 }
22901 time2_5 = Json_getFloat(
22902 nextMap,
22903 (b"time\0" as *const u8).cast::<c_char>(),
22904 0 as c_int as c_float,
22905 );
22906 mixRotate2_0 = Json_getFloat(
22907 nextMap,
22908 (b"mixRotate\0" as *const u8).cast::<c_char>(),
22909 1 as c_int as c_float,
22910 );
22911 mixX2_0 = Json_getFloat(
22912 nextMap,
22913 (b"mixX\0" as *const u8).cast::<c_char>(),
22914 1 as c_int as c_float,
22915 );
22916 mixY2_0 = Json_getFloat(
22917 nextMap,
22918 (b"mixY\0" as *const u8).cast::<c_char>(),
22919 mixX2_0,
22920 );
22921 curve = Json_getItem(keyMap, (b"curve\0" as *const u8).cast::<c_char>());
22922 if !curve.is_null() {
22923 bezier = readCurve(
22924 curve,
22925 &mut (*timeline_18).super_0,
22926 bezier,
22927 frame,
22928 0 as c_int,
22929 time_6,
22930 time2_5,
22931 mixRotate_0,
22932 mixRotate2_0,
22933 1 as c_int as c_float,
22934 );
22935 bezier = readCurve(
22936 curve,
22937 &mut (*timeline_18).super_0,
22938 bezier,
22939 frame,
22940 1 as c_int,
22941 time_6,
22942 time2_5,
22943 mixX_0,
22944 mixX2_0,
22945 1 as c_int as c_float,
22946 );
22947 bezier = readCurve(
22948 curve,
22949 &mut (*timeline_18).super_0,
22950 bezier,
22951 frame,
22952 2 as c_int,
22953 time_6,
22954 time2_5,
22955 mixY_0,
22956 mixY2_0,
22957 1 as c_int as c_float,
22958 );
22959 }
22960 time_6 = time2_5;
22961 mixRotate_0 = mixRotate2_0;
22962 mixX_0 = mixX2_0;
22963 mixY_0 = mixY2_0;
22964 keyMap = nextMap;
22965 frame += 1;
22966 }
22967 spTimelineArray_add(timelines, &mut (*timeline_18).super_0.super_0);
22968 }
22969 }
22970 timelineMap = (*timelineMap).next;
22971 }
22972 constraintMap = (*constraintMap).next;
22973 }
22974 constraintMap = if !physics.is_null() {
22975 (*physics).child
22976 } else {
22977 std::ptr::null_mut::<Json>()
22978 };
22979 while !constraintMap.is_null() {
22980 let mut index: c_int = -(1 as c_int);
22981 if !((*constraintMap).name).is_null()
22982 && spine_strlen((*constraintMap).name) > 0 as c_int as c_ulong
22983 {
22984 let mut constraint_2: *mut spPhysicsConstraintData =
22985 spSkeletonData_findPhysicsConstraint(skeletonData, (*constraintMap).name);
22986 index = findPhysicsConstraintIndex(self_0, skeletonData, constraint_2, timelines);
22987 if index == -(1 as c_int) {
22988 return std::ptr::null_mut::<spAnimation>();
22989 }
22990 }
22991 let mut current_block_322: u64;
22992 timelineMap = (*constraintMap).child;
22993 while !timelineMap.is_null() {
22994 keyMap = (*timelineMap).child;
22995 if !keyMap.is_null() {
22996 let mut timelineName_0: *const c_char = (*timelineMap).name;
22997 let mut frames_2: c_int = (*timelineMap).size;
22998 if spine_strcmp(timelineName_0, (b"reset\0" as *const u8).cast::<c_char>())
22999 == 0 as c_int
23000 {
23001 let mut timeline_19: *mut spPhysicsConstraintResetTimeline =
23002 spPhysicsConstraintResetTimeline_create(frames_2, index);
23003 frame = 0 as c_int;
23004 while !keyMap.is_null() {
23005 spPhysicsConstraintResetTimeline_setFrame(
23006 timeline_19,
23007 frame,
23008 Json_getFloat(
23009 keyMap,
23010 (b"time\0" as *const u8).cast::<c_char>(),
23011 0 as c_int as c_float,
23012 ),
23013 );
23014 keyMap = (*keyMap).next;
23015 frame += 1;
23016 }
23017 spTimelineArray_add(timelines, &mut (*timeline_19).super_0);
23018 } else {
23019 let mut timeline_20: *mut spPhysicsConstraintTimeline =
23020 std::ptr::null_mut::<spPhysicsConstraintTimeline>();
23021 if spine_strcmp(timelineName_0, (b"inertia\0" as *const u8).cast::<c_char>())
23022 == 0 as c_int
23023 {
23024 timeline_20 = spPhysicsConstraintTimeline_create(
23025 frames_2,
23026 frames_2,
23027 index,
23028 SP_TIMELINE_PHYSICSCONSTRAINT_INERTIA,
23029 );
23030 current_block_322 = 2197125908392311113;
23031 } else if spine_strcmp(
23032 timelineName_0,
23033 (b"strength\0" as *const u8).cast::<c_char>(),
23034 ) == 0 as c_int
23035 {
23036 timeline_20 = spPhysicsConstraintTimeline_create(
23037 frames_2,
23038 frames_2,
23039 index,
23040 SP_TIMELINE_PHYSICSCONSTRAINT_STRENGTH,
23041 );
23042 current_block_322 = 2197125908392311113;
23043 } else if spine_strcmp(
23044 timelineName_0,
23045 (b"damping\0" as *const u8).cast::<c_char>(),
23046 ) == 0 as c_int
23047 {
23048 timeline_20 = spPhysicsConstraintTimeline_create(
23049 frames_2,
23050 frames_2,
23051 index,
23052 SP_TIMELINE_PHYSICSCONSTRAINT_DAMPING,
23053 );
23054 current_block_322 = 2197125908392311113;
23055 } else if spine_strcmp(
23056 timelineName_0,
23057 (b"mass\0" as *const u8).cast::<c_char>(),
23058 ) == 0 as c_int
23059 {
23060 timeline_20 = spPhysicsConstraintTimeline_create(
23061 frames_2,
23062 frames_2,
23063 index,
23064 SP_TIMELINE_PHYSICSCONSTRAINT_MASS,
23065 );
23066 current_block_322 = 2197125908392311113;
23067 } else if spine_strcmp(
23068 timelineName_0,
23069 (b"wind\0" as *const u8).cast::<c_char>(),
23070 ) == 0 as c_int
23071 {
23072 timeline_20 = spPhysicsConstraintTimeline_create(
23073 frames_2,
23074 frames_2,
23075 index,
23076 SP_TIMELINE_PHYSICSCONSTRAINT_WIND,
23077 );
23078 current_block_322 = 2197125908392311113;
23079 } else if spine_strcmp(
23080 timelineName_0,
23081 (b"gravity\0" as *const u8).cast::<c_char>(),
23082 ) == 0 as c_int
23083 {
23084 timeline_20 = spPhysicsConstraintTimeline_create(
23085 frames_2,
23086 frames_2,
23087 index,
23088 SP_TIMELINE_PHYSICSCONSTRAINT_GRAVITY,
23089 );
23090 current_block_322 = 2197125908392311113;
23091 } else if spine_strcmp(timelineName_0, (b"mix\0" as *const u8).cast::<c_char>())
23092 == 0 as c_int
23093 {
23094 timeline_20 = spPhysicsConstraintTimeline_create(
23095 frames_2,
23096 frames_2,
23097 index,
23098 SP_TIMELINE_PHYSICSCONSTRAINT_MIX,
23099 );
23100 current_block_322 = 2197125908392311113;
23101 } else {
23102 current_block_322 = 2014163327383235100;
23103 }
23104 match current_block_322 {
23105 2014163327383235100 => {}
23106 _ => {
23107 spTimelineArray_add(
23108 timelines,
23109 readTimelineJson(
23110 keyMap,
23111 &mut (*timeline_20).super_0,
23112 0 as c_int as c_float,
23113 1 as c_int as c_float,
23114 ),
23115 );
23116 }
23117 }
23118 }
23119 }
23120 timelineMap = (*timelineMap).next;
23121 }
23122 constraintMap = (*constraintMap).next;
23123 }
23124 attachmentsMap = if !attachmentsJson.is_null() {
23125 (*attachmentsJson).child
23126 } else {
23127 std::ptr::null_mut::<Json>()
23128 };
23129 while !attachmentsMap.is_null() {
23130 let mut skin: *mut spSkin = spSkeletonData_findSkin(skeletonData, (*attachmentsMap).name);
23131 slotMap = (*attachmentsMap).child;
23132 while !slotMap.is_null() {
23133 let mut attachmentMap: *mut Json = std::ptr::null_mut::<Json>();
23134 let mut slotIndex_0: c_int =
23135 findSlotIndex(self_0, skeletonData, (*slotMap).name, timelines);
23136 if slotIndex_0 == -(1 as c_int) {
23137 return std::ptr::null_mut::<spAnimation>();
23138 }
23139 attachmentMap = (*slotMap).child;
23140 while !attachmentMap.is_null() {
23141 let mut baseAttachment: *mut spAttachment =
23142 spSkin_getAttachment(skin, slotIndex_0, (*attachmentMap).name);
23143 if baseAttachment.is_null() {
23144 cleanUpTimelines(timelines);
23145 _spSkeletonJson_setError(
23146 self_0,
23147 std::ptr::null_mut::<Json>(),
23148 (b"Attachment not found: \0" as *const u8).cast::<c_char>(),
23149 (*attachmentMap).name,
23150 );
23151 return std::ptr::null_mut::<spAnimation>();
23152 }
23153 timelineMap = (*attachmentMap).child;
23154 while !timelineMap.is_null() {
23155 let mut frames_3: c_int = 0;
23156 let mut timelineName_1: *const c_char = std::ptr::null::<c_char>();
23157 keyMap = (*timelineMap).child;
23158 if !keyMap.is_null() {
23159 frames_3 = (*timelineMap).size;
23160 timelineName_1 = (*timelineMap).name;
23161 if spine_strcmp((b"deform\0" as *const u8).cast::<c_char>(), timelineName_1)
23162 == 0
23163 {
23164 let mut tempDeform: *mut c_float = std::ptr::null_mut::<c_float>();
23165 let mut vertexAttachment: *mut spVertexAttachment =
23166 std::ptr::null_mut::<spVertexAttachment>();
23167 let mut weighted: c_int = 0;
23168 let mut deformLength: c_int = 0;
23169 let mut timeline_21: *mut spDeformTimeline =
23170 std::ptr::null_mut::<spDeformTimeline>();
23171 let mut time_7: c_float = 0.;
23172 vertexAttachment = baseAttachment.cast::<spVertexAttachment>();
23173 weighted = ((*vertexAttachment).bones != std::ptr::null_mut::<c_int>())
23174 as c_int;
23175 deformLength = if weighted != 0 {
23176 (*vertexAttachment).verticesCount / 3 as c_int * 2 as c_int
23177 } else {
23178 (*vertexAttachment).verticesCount
23179 };
23180 tempDeform = _spMalloc(
23181 (::core::mem::size_of::<c_float>() as c_ulong)
23182 .wrapping_mul(deformLength as c_ulong),
23183 (b"spine.c\0" as *const u8).cast::<c_char>(),
23184 12171 as c_int,
23185 )
23186 .cast::<c_float>();
23187 timeline_21 = spDeformTimeline_create(
23188 (*timelineMap).size,
23189 deformLength,
23190 (*timelineMap).size,
23191 slotIndex_0,
23192 vertexAttachment,
23193 );
23194 time_7 = Json_getFloat(
23195 keyMap,
23196 (b"time\0" as *const u8).cast::<c_char>(),
23197 0 as c_int as c_float,
23198 );
23199 frame = 0 as c_int;
23200 bezier = 0 as c_int;
23201 loop {
23202 let mut vertices: *mut Json = Json_getItem(
23203 keyMap,
23204 (b"vertices\0" as *const u8).cast::<c_char>(),
23205 );
23206 let mut deform: *mut c_float = std::ptr::null_mut::<c_float>();
23207 let mut time2_6: c_float = 0.;
23208 if vertices.is_null() {
23209 if weighted != 0 {
23210 deform = tempDeform;
23211 spine_memset(
23212 deform.cast::<c_void>(),
23213 0 as c_int,
23214 (::core::mem::size_of::<c_float>() as c_ulong)
23215 .wrapping_mul(deformLength as c_ulong),
23216 );
23217 } else {
23218 deform = (*vertexAttachment).vertices;
23219 }
23220 } else {
23221 let mut v: c_int = 0;
23222 let mut start: c_int = Json_getInt(
23223 keyMap,
23224 (b"offset\0" as *const u8).cast::<c_char>(),
23225 0 as c_int,
23226 );
23227 let mut vertex: *mut Json = std::ptr::null_mut::<Json>();
23228 deform = tempDeform;
23229 spine_memset(
23230 deform.cast::<c_void>(),
23231 0 as c_int,
23232 (::core::mem::size_of::<c_float>() as c_ulong)
23233 .wrapping_mul(start as c_ulong),
23234 );
23235 if (*self_0).scale == 1 as c_int as c_float {
23236 vertex = (*vertices).child;
23237 v = start;
23238 while !vertex.is_null() {
23239 *deform.offset(v as isize) = (*vertex).valueFloat;
23240 vertex = (*vertex).next;
23241 v += 1;
23242 }
23243 } else {
23244 vertex = (*vertices).child;
23245 v = start;
23246 while !vertex.is_null() {
23247 *deform.offset(v as isize) =
23248 (*vertex).valueFloat * (*self_0).scale;
23249 vertex = (*vertex).next;
23250 v += 1;
23251 }
23252 }
23253 spine_memset(
23254 deform.offset(v as isize).cast::<c_void>(),
23255 0 as c_int,
23256 (::core::mem::size_of::<c_float>() as c_ulong)
23257 .wrapping_mul((deformLength - v) as c_ulong),
23258 );
23259 if weighted == 0 {
23260 let mut verticesValues: *mut c_float =
23261 (*vertexAttachment).vertices;
23262 v = 0 as c_int;
23263 while v < deformLength {
23264 *deform.offset(v as isize) +=
23265 *verticesValues.offset(v as isize);
23266 v += 1;
23267 }
23268 }
23269 }
23270 spDeformTimeline_setFrame(timeline_21, frame, time_7, deform);
23271 nextMap = (*keyMap).next;
23272 if nextMap.is_null() {
23273 break;
23274 }
23275 time2_6 = Json_getFloat(
23276 nextMap,
23277 (b"time\0" as *const u8).cast::<c_char>(),
23278 0 as c_int as c_float,
23279 );
23280 curve = Json_getItem(
23281 keyMap,
23282 (b"curve\0" as *const u8).cast::<c_char>(),
23283 );
23284 if !curve.is_null() {
23285 bezier = readCurve(
23286 curve,
23287 &mut (*timeline_21).super_0,
23288 bezier,
23289 frame,
23290 0 as c_int,
23291 time_7,
23292 time2_6,
23293 0 as c_int as c_float,
23294 1 as c_int as c_float,
23295 1 as c_int as c_float,
23296 );
23297 }
23298 time_7 = time2_6;
23299 keyMap = nextMap;
23300 frame += 1;
23301 }
23302 _spFree(tempDeform.cast::<c_void>());
23303 spTimelineArray_add(timelines, &mut (*timeline_21).super_0.super_0);
23304 } else if spine_strcmp(
23305 timelineName_1,
23306 (b"sequence\0" as *const u8).cast::<c_char>(),
23307 ) == 0
23308 {
23309 let mut timeline_22: *mut spSequenceTimeline =
23310 spSequenceTimeline_create(frames_3, slotIndex_0, baseAttachment);
23311 let mut lastDelay: c_float = 0 as c_int as c_float;
23312 frame = 0 as c_int;
23313 while !keyMap.is_null() {
23314 let mut delay: c_float = Json_getFloat(
23315 keyMap,
23316 (b"delay\0" as *const u8).cast::<c_char>(),
23317 lastDelay,
23318 );
23319 let mut time_8: c_float = Json_getFloat(
23320 keyMap,
23321 (b"time\0" as *const u8).cast::<c_char>(),
23322 0 as c_int as c_float,
23323 );
23324 let mut modeString: *const c_char = Json_getString(
23325 keyMap,
23326 (b"mode\0" as *const u8).cast::<c_char>(),
23327 (b"hold\0" as *const u8).cast::<c_char>(),
23328 );
23329 let mut index_0: c_int = Json_getInt(
23330 keyMap,
23331 (b"index\0" as *const u8).cast::<c_char>(),
23332 0 as c_int,
23333 );
23334 let mut mode: c_int = 0 as c_int;
23335 if spine_strcmp(
23336 modeString,
23337 (b"once\0" as *const u8).cast::<c_char>(),
23338 ) == 0
23339 {
23340 mode = 1 as c_int;
23341 }
23342 if spine_strcmp(
23343 modeString,
23344 (b"loop\0" as *const u8).cast::<c_char>(),
23345 ) == 0
23346 {
23347 mode = 2 as c_int;
23348 }
23349 if spine_strcmp(
23350 modeString,
23351 (b"pingpong\0" as *const u8).cast::<c_char>(),
23352 ) == 0
23353 {
23354 mode = 3 as c_int;
23355 }
23356 if spine_strcmp(
23357 modeString,
23358 (b"onceReverse\0" as *const u8).cast::<c_char>(),
23359 ) == 0
23360 {
23361 mode = 4 as c_int;
23362 }
23363 if spine_strcmp(
23364 modeString,
23365 (b"loopReverse\0" as *const u8).cast::<c_char>(),
23366 ) == 0
23367 {
23368 mode = 5 as c_int;
23369 }
23370 if spine_strcmp(
23371 modeString,
23372 (b"pingpongReverse\0" as *const u8).cast::<c_char>(),
23373 ) == 0
23374 {
23375 mode = 6 as c_int;
23376 }
23377 spSequenceTimeline_setFrame(
23378 timeline_22,
23379 frame,
23380 time_8,
23381 mode,
23382 index_0,
23383 delay,
23384 );
23385 lastDelay = delay;
23386 keyMap = (*keyMap).next;
23387 frame += 1;
23388 }
23389 spTimelineArray_add(timelines, &mut (*timeline_22).super_0);
23390 }
23391 }
23392 timelineMap = (*timelineMap).next;
23393 }
23394 attachmentMap = (*attachmentMap).next;
23395 }
23396 slotMap = (*slotMap).next;
23397 }
23398 attachmentsMap = (*attachmentsMap).next;
23399 }
23400 if !drawOrderJson.is_null() {
23401 let mut timeline_23: *mut spDrawOrderTimeline =
23402 spDrawOrderTimeline_create((*drawOrderJson).size, (*skeletonData).slotsCount);
23403 keyMap = (*drawOrderJson).child;
23404 frame = 0 as c_int;
23405 while !keyMap.is_null() {
23406 let mut ii: c_int = 0;
23407 let mut drawOrder: *mut c_int = std::ptr::null_mut::<c_int>();
23408 let mut offsets: *mut Json =
23409 Json_getItem(keyMap, (b"offsets\0" as *const u8).cast::<c_char>());
23410 if !offsets.is_null() {
23411 let mut offsetMap: *mut Json = std::ptr::null_mut::<Json>();
23412 let mut unchanged: *mut c_int = _spMalloc(
23413 (::core::mem::size_of::<c_int>() as c_ulong)
23414 .wrapping_mul(((*skeletonData).slotsCount - (*offsets).size) as c_ulong),
23415 (b"spine.c\0" as *const u8).cast::<c_char>(),
23416 12259 as c_int,
23417 )
23418 .cast::<c_int>();
23419 let mut originalIndex: c_int = 0 as c_int;
23420 let mut unchangedIndex: c_int = 0 as c_int;
23421 drawOrder = _spMalloc(
23422 (::core::mem::size_of::<c_int>() as c_ulong)
23423 .wrapping_mul((*skeletonData).slotsCount as c_ulong),
23424 (b"spine.c\0" as *const u8).cast::<c_char>(),
23425 12262 as c_int,
23426 )
23427 .cast::<c_int>();
23428 ii = (*skeletonData).slotsCount - 1 as c_int;
23429 while ii >= 0 as c_int {
23430 *drawOrder.offset(ii as isize) = -(1 as c_int);
23431 ii -= 1;
23432 }
23433 offsetMap = (*offsets).child;
23434 while !offsetMap.is_null() {
23435 let mut slotIndex_1: c_int = findSlotIndex(
23436 self_0,
23437 skeletonData,
23438 Json_getString(
23439 offsetMap,
23440 (b"slot\0" as *const u8).cast::<c_char>(),
23441 std::ptr::null::<c_char>(),
23442 ),
23443 timelines,
23444 );
23445 if slotIndex_1 == -(1 as c_int) {
23446 return std::ptr::null_mut::<spAnimation>();
23447 }
23448 while originalIndex != slotIndex_1 {
23449 let fresh131 = originalIndex;
23450 originalIndex += 1;
23451 let fresh132 = unchangedIndex;
23452 unchangedIndex += 1;
23453 *unchanged.offset(fresh132 as isize) = fresh131;
23454 }
23455 *drawOrder.offset(
23456 (originalIndex
23457 + Json_getInt(
23458 offsetMap,
23459 (b"offset\0" as *const u8).cast::<c_char>(),
23460 0 as c_int,
23461 )) as isize,
23462 ) = originalIndex;
23463 originalIndex += 1;
23464 offsetMap = (*offsetMap).next;
23465 }
23466 while originalIndex < (*skeletonData).slotsCount {
23467 let fresh133 = originalIndex;
23468 originalIndex += 1;
23469 let fresh134 = unchangedIndex;
23470 unchangedIndex += 1;
23471 *unchanged.offset(fresh134 as isize) = fresh133;
23472 }
23473 ii = (*skeletonData).slotsCount - 1 as c_int;
23474 while ii >= 0 as c_int {
23475 if *drawOrder.offset(ii as isize) == -(1 as c_int) {
23476 unchangedIndex -= 1;
23477 *drawOrder.offset(ii as isize) = *unchanged.offset(unchangedIndex as isize);
23478 }
23479 ii -= 1;
23480 }
23481 _spFree(unchanged.cast::<c_void>());
23482 }
23483 spDrawOrderTimeline_setFrame(
23484 timeline_23,
23485 frame,
23486 Json_getFloat(
23487 keyMap,
23488 (b"time\0" as *const u8).cast::<c_char>(),
23489 0 as c_int as c_float,
23490 ),
23491 drawOrder,
23492 );
23493 _spFree(drawOrder.cast::<c_void>());
23494 keyMap = (*keyMap).next;
23495 frame += 1;
23496 }
23497 spTimelineArray_add(timelines, &mut (*timeline_23).super_0);
23498 }
23499 if !events.is_null() {
23500 let mut timeline_24: *mut spEventTimeline = spEventTimeline_create((*events).size);
23501 keyMap = (*events).child;
23502 frame = 0 as c_int;
23503 while !keyMap.is_null() {
23504 let mut event: *mut spEvent = std::ptr::null_mut::<spEvent>();
23505 let mut stringValue: *const c_char = std::ptr::null::<c_char>();
23506 let mut eventData: *mut spEventData = spSkeletonData_findEvent(
23507 skeletonData,
23508 Json_getString(
23509 keyMap,
23510 (b"name\0" as *const u8).cast::<c_char>(),
23511 std::ptr::null::<c_char>(),
23512 ),
23513 );
23514 if eventData.is_null() {
23515 cleanUpTimelines(timelines);
23516 _spSkeletonJson_setError(
23517 self_0,
23518 std::ptr::null_mut::<Json>(),
23519 (b"Event not found: \0" as *const u8).cast::<c_char>(),
23520 Json_getString(
23521 keyMap,
23522 (b"name\0" as *const u8).cast::<c_char>(),
23523 std::ptr::null::<c_char>(),
23524 ),
23525 );
23526 return std::ptr::null_mut::<spAnimation>();
23527 }
23528 event = spEvent_create(
23529 Json_getFloat(
23530 keyMap,
23531 (b"time\0" as *const u8).cast::<c_char>(),
23532 0 as c_int as c_float,
23533 ),
23534 eventData,
23535 );
23536 (*event).intValue = Json_getInt(
23537 keyMap,
23538 (b"int\0" as *const u8).cast::<c_char>(),
23539 (*eventData).intValue,
23540 );
23541 (*event).floatValue = Json_getFloat(
23542 keyMap,
23543 (b"float\0" as *const u8).cast::<c_char>(),
23544 (*eventData).floatValue,
23545 );
23546 stringValue = Json_getString(
23547 keyMap,
23548 (b"string\0" as *const u8).cast::<c_char>(),
23549 (*eventData).stringValue,
23550 );
23551 if !stringValue.is_null() {
23552 (*event).stringValue = _spMalloc(
23553 (::core::mem::size_of::<c_char>() as c_ulong).wrapping_mul(
23554 (spine_strlen(stringValue)).wrapping_add(1 as c_int as c_ulong),
23555 ),
23556 (b"spine.c\0" as *const u8).cast::<c_char>(),
23557 12308 as c_int,
23558 )
23559 .cast::<c_char>();
23560 spine_strcpy((*event).stringValue, stringValue);
23561 }
23562 if !((*eventData).audioPath).is_null() {
23563 (*event).volume = Json_getFloat(
23564 keyMap,
23565 (b"volume\0" as *const u8).cast::<c_char>(),
23566 1 as c_int as c_float,
23567 );
23568 (*event).balance = Json_getFloat(
23569 keyMap,
23570 (b"volume\0" as *const u8).cast::<c_char>(),
23571 0 as c_int as c_float,
23572 );
23573 }
23574 spEventTimeline_setFrame(timeline_24, frame, event);
23575 keyMap = (*keyMap).next;
23576 frame += 1;
23577 }
23578 spTimelineArray_add(timelines, &mut (*timeline_24).super_0);
23579 }
23580 duration = 0 as c_int as c_float;
23581 i = 0 as c_int;
23582 n = (*timelines).size;
23583 while i < n {
23584 duration = if duration > spTimeline_getDuration(*((*timelines).items).offset(i as isize)) {
23585 duration
23586 } else {
23587 spTimeline_getDuration(*((*timelines).items).offset(i as isize))
23588 };
23589 i += 1;
23590 }
23591 spAnimation_create((*root).name, timelines, duration)
23592}
23593unsafe extern "C" fn _readVerticesJson(
23594 mut self_0: *mut spSkeletonJson,
23595 mut attachmentMap: *mut Json,
23596 mut attachment: *mut spVertexAttachment,
23597 mut verticesLength: c_int,
23598) {
23599 let mut entry: *mut Json = std::ptr::null_mut::<Json>();
23600 let mut vertices: *mut c_float = std::ptr::null_mut::<c_float>();
23601 let mut i: c_int = 0;
23602 let mut n: c_int = 0;
23603 let mut nn: c_int = 0;
23604 let mut entrySize: c_int = 0;
23605 let mut weights: *mut spFloatArray = std::ptr::null_mut::<spFloatArray>();
23606 let mut bones: *mut spIntArray = std::ptr::null_mut::<spIntArray>();
23607 (*attachment).worldVerticesLength = verticesLength;
23608 entry = Json_getItem(attachmentMap, (b"vertices\0" as *const u8).cast::<c_char>());
23609 entrySize = (*entry).size;
23610 vertices = _spMalloc(
23611 (::core::mem::size_of::<c_float>() as c_ulong).wrapping_mul(entrySize as c_ulong),
23612 (b"spine.c\0" as *const u8).cast::<c_char>(),
23613 12336 as c_int,
23614 )
23615 .cast::<c_float>();
23616 entry = (*entry).child;
23617 i = 0 as c_int;
23618 while !entry.is_null() {
23619 *vertices.offset(i as isize) = (*entry).valueFloat;
23620 entry = (*entry).next;
23621 i += 1;
23622 }
23623 if verticesLength == entrySize {
23624 if (*self_0).scale != 1 as c_int as c_float {
23625 i = 0 as c_int;
23626 while i < entrySize {
23627 *vertices.offset(i as isize) *= (*self_0).scale;
23628 i += 1;
23629 }
23630 }
23631 (*attachment).verticesCount = verticesLength;
23632 (*attachment).vertices = vertices;
23633 (*attachment).bonesCount = 0 as c_int;
23634 (*attachment).bones = std::ptr::null_mut::<c_int>();
23635 return;
23636 }
23637 weights = spFloatArray_create(verticesLength * 3 as c_int * 3 as c_int);
23638 bones = spIntArray_create(verticesLength * 3 as c_int);
23639 i = 0 as c_int;
23640 n = entrySize;
23641 while i < n {
23642 let fresh135 = i;
23643 i += 1;
23644 let mut boneCount: c_int = *vertices.offset(fresh135 as isize) as c_int;
23645 spIntArray_add(bones, boneCount);
23646 nn = i + boneCount * 4 as c_int;
23647 while i < nn {
23648 spIntArray_add(bones, *vertices.offset(i as isize) as c_int);
23649 spFloatArray_add(
23650 weights,
23651 *vertices.offset((i + 1 as c_int) as isize) * (*self_0).scale,
23652 );
23653 spFloatArray_add(
23654 weights,
23655 *vertices.offset((i + 2 as c_int) as isize) * (*self_0).scale,
23656 );
23657 spFloatArray_add(weights, *vertices.offset((i + 3 as c_int) as isize));
23658 i += 4 as c_int;
23659 }
23660 }
23661 (*attachment).verticesCount = (*weights).size;
23662 (*attachment).vertices = (*weights).items;
23663 _spFree(weights.cast::<c_void>());
23664 (*attachment).bonesCount = (*bones).size;
23665 (*attachment).bones = (*bones).items;
23666 _spFree(bones.cast::<c_void>());
23667 _spFree(vertices.cast::<c_void>());
23668}
23669#[no_mangle]
23670pub unsafe extern "C" fn spSkeletonJson_readSkeletonDataFile(
23671 mut self_0: *mut spSkeletonJson,
23672 mut path: *const c_char,
23673) -> *mut spSkeletonData {
23674 let mut length: c_int = 0;
23675 let mut skeletonData: *mut spSkeletonData = std::ptr::null_mut::<spSkeletonData>();
23676 let mut json: *const c_char = _spUtil_readFile(path, &mut length);
23677 if length == 0 as c_int || json.is_null() {
23678 _spSkeletonJson_setError(
23679 self_0,
23680 std::ptr::null_mut::<Json>(),
23681 (b"Unable to read skeleton file: \0" as *const u8).cast::<c_char>(),
23682 path,
23683 );
23684 return std::ptr::null_mut::<spSkeletonData>();
23685 }
23686 skeletonData = spSkeletonJson_readSkeletonData(self_0, json);
23687 _spFree(json as *mut c_void);
23688 skeletonData
23689}
23690unsafe extern "C" fn string_starts_with_json(
23691 mut str: *const c_char,
23692 mut needle: *const c_char,
23693) -> c_int {
23694 let mut lenStr: c_int = 0;
23695 let mut lenNeedle: c_int = 0;
23696 let mut i: c_int = 0;
23697 if str.is_null() {
23698 return 0 as c_int;
23699 }
23700 lenStr = spine_strlen(str) as c_int;
23701 lenNeedle = spine_strlen(needle) as c_int;
23702 if lenStr < lenNeedle {
23703 return 0 as c_int;
23704 }
23705 i = 0 as c_int;
23706 while i < lenNeedle {
23707 if *str.offset(i as isize) as c_int != *needle.offset(i as isize) as c_int {
23708 return 0 as c_int;
23709 }
23710 i += 1;
23711 }
23712 -(1 as c_int)
23713}
23714#[no_mangle]
23715pub unsafe extern "C" fn spSkeletonJson_readSkeletonData(
23716 mut self_0: *mut spSkeletonJson,
23717 mut json: *const c_char,
23718) -> *mut spSkeletonData {
23719 let mut i: c_int = 0;
23720 let mut ii: c_int = 0;
23721 let mut skeletonData: *mut spSkeletonData = std::ptr::null_mut::<spSkeletonData>();
23722 let mut root: *mut Json = std::ptr::null_mut::<Json>();
23723 let mut skeleton: *mut Json = std::ptr::null_mut::<Json>();
23724 let mut bones: *mut Json = std::ptr::null_mut::<Json>();
23725 let mut boneMap: *mut Json = std::ptr::null_mut::<Json>();
23726 let mut ik: *mut Json = std::ptr::null_mut::<Json>();
23727 let mut transform: *mut Json = std::ptr::null_mut::<Json>();
23728 let mut pathJson: *mut Json = std::ptr::null_mut::<Json>();
23729 let mut physics: *mut Json = std::ptr::null_mut::<Json>();
23730 let mut slots: *mut Json = std::ptr::null_mut::<Json>();
23731 let mut skins: *mut Json = std::ptr::null_mut::<Json>();
23732 let mut animations: *mut Json = std::ptr::null_mut::<Json>();
23733 let mut events: *mut Json = std::ptr::null_mut::<Json>();
23734 let mut internal: *mut _spSkeletonJson = self_0.cast::<_spSkeletonJson>();
23735 _spFree((*self_0).error.cast::<c_void>());
23736 (*self_0).error = std::ptr::null_mut::<c_char>();
23737 (*internal).linkedMeshCount = 0 as c_int;
23738 root = Json_create(json);
23739 if root.is_null() {
23740 _spSkeletonJson_setError(
23741 self_0,
23742 std::ptr::null_mut::<Json>(),
23743 (b"Invalid skeleton JSON: \0" as *const u8).cast::<c_char>(),
23744 Json_getError(),
23745 );
23746 return std::ptr::null_mut::<spSkeletonData>();
23747 }
23748 skeletonData = spSkeletonData_create();
23749 skeleton = Json_getItem(root, (b"skeleton\0" as *const u8).cast::<c_char>());
23750 if !skeleton.is_null() {
23751 (*skeletonData).hash = _spMalloc(
23752 (::core::mem::size_of::<c_char>() as c_ulong).wrapping_mul(
23753 (spine_strlen(Json_getString(
23754 skeleton,
23755 (b"hash\0" as *const u8).cast::<c_char>(),
23756 (b"0\0" as *const u8).cast::<c_char>(),
23757 )))
23758 .wrapping_add(1 as c_int as c_ulong),
23759 ),
23760 (b"spine.c\0" as *const u8).cast::<c_char>(),
23761 12449 as c_int,
23762 )
23763 .cast::<c_char>();
23764 spine_strcpy(
23765 (*skeletonData).hash,
23766 Json_getString(
23767 skeleton,
23768 (b"hash\0" as *const u8).cast::<c_char>(),
23769 (b"0\0" as *const u8).cast::<c_char>(),
23770 ),
23771 );
23772 (*skeletonData).version = _spMalloc(
23773 (::core::mem::size_of::<c_char>() as c_ulong).wrapping_mul(
23774 (spine_strlen(Json_getString(
23775 skeleton,
23776 (b"spine\0" as *const u8).cast::<c_char>(),
23777 (b"0\0" as *const u8).cast::<c_char>(),
23778 )))
23779 .wrapping_add(1 as c_int as c_ulong),
23780 ),
23781 (b"spine.c\0" as *const u8).cast::<c_char>(),
23782 12450 as c_int,
23783 )
23784 .cast::<c_char>();
23785 spine_strcpy(
23786 (*skeletonData).version,
23787 Json_getString(
23788 skeleton,
23789 (b"spine\0" as *const u8).cast::<c_char>(),
23790 (b"0\0" as *const u8).cast::<c_char>(),
23791 ),
23792 );
23793 if string_starts_with_json(
23794 (*skeletonData).version,
23795 (b"4.2\0" as *const u8).cast::<c_char>(),
23796 ) == 0
23797 {
23798 let mut errorMsg: [c_char; 255] = [0; 255];
23799 spine_snprintf!(
23800 errorMsg.as_mut_ptr(),
23801 255 as c_int as size_t,
23802 (b"Skeleton version %s does not match runtime version %s\0" as *const u8)
23803 .cast::<c_char>(),
23804 (*skeletonData).version,
23805 (b"4.2\0" as *const u8).cast::<c_char>(),
23806 );
23807 _spSkeletonJson_setError(
23808 self_0,
23809 std::ptr::null_mut::<Json>(),
23810 errorMsg.as_mut_ptr(),
23811 std::ptr::null::<c_char>(),
23812 );
23813 return std::ptr::null_mut::<spSkeletonData>();
23814 }
23815 (*skeletonData).x = Json_getFloat(
23816 skeleton,
23817 (b"x\0" as *const u8).cast::<c_char>(),
23818 0 as c_int as c_float,
23819 );
23820 (*skeletonData).y = Json_getFloat(
23821 skeleton,
23822 (b"y\0" as *const u8).cast::<c_char>(),
23823 0 as c_int as c_float,
23824 );
23825 (*skeletonData).width = Json_getFloat(
23826 skeleton,
23827 (b"width\0" as *const u8).cast::<c_char>(),
23828 0 as c_int as c_float,
23829 );
23830 (*skeletonData).height = Json_getFloat(
23831 skeleton,
23832 (b"height\0" as *const u8).cast::<c_char>(),
23833 0 as c_int as c_float,
23834 );
23835 (*skeletonData).referenceScale = Json_getFloat(
23836 skeleton,
23837 (b"referenceScale\0" as *const u8).cast::<c_char>(),
23838 100 as c_int as c_float,
23839 ) * (*self_0).scale;
23840 (*skeletonData).fps = Json_getFloat(
23841 skeleton,
23842 (b"fps\0" as *const u8).cast::<c_char>(),
23843 30 as c_int as c_float,
23844 );
23845 (*skeletonData).imagesPath = Json_getString(
23846 skeleton,
23847 (b"images\0" as *const u8).cast::<c_char>(),
23848 std::ptr::null::<c_char>(),
23849 );
23850 if !((*skeletonData).imagesPath).is_null() {
23851 let mut tmp: *mut c_char = std::ptr::null_mut::<c_char>();
23852 tmp = _spMalloc(
23853 (::core::mem::size_of::<c_char>() as c_ulong).wrapping_mul(
23854 (spine_strlen((*skeletonData).imagesPath)).wrapping_add(1 as c_int as c_ulong),
23855 ),
23856 (b"spine.c\0" as *const u8).cast::<c_char>(),
23857 12466 as c_int,
23858 )
23859 .cast::<c_char>();
23860 spine_strcpy(tmp, (*skeletonData).imagesPath);
23861 (*skeletonData).imagesPath = tmp;
23862 }
23863 (*skeletonData).audioPath = Json_getString(
23864 skeleton,
23865 (b"audio\0" as *const u8).cast::<c_char>(),
23866 std::ptr::null::<c_char>(),
23867 );
23868 if !((*skeletonData).audioPath).is_null() {
23869 let mut tmp_0: *mut c_char = std::ptr::null_mut::<c_char>();
23870 tmp_0 = _spMalloc(
23871 (::core::mem::size_of::<c_char>() as c_ulong).wrapping_mul(
23872 (spine_strlen((*skeletonData).audioPath)).wrapping_add(1 as c_int as c_ulong),
23873 ),
23874 (b"spine.c\0" as *const u8).cast::<c_char>(),
23875 12472 as c_int,
23876 )
23877 .cast::<c_char>();
23878 spine_strcpy(tmp_0, (*skeletonData).audioPath);
23879 (*skeletonData).audioPath = tmp_0;
23880 }
23881 }
23882 bones = Json_getItem(root, (b"bones\0" as *const u8).cast::<c_char>());
23883 (*skeletonData).bones = _spMalloc(
23884 (::core::mem::size_of::<*mut spBoneData>() as c_ulong)
23885 .wrapping_mul((*bones).size as c_ulong),
23886 (b"spine.c\0" as *const u8).cast::<c_char>(),
23887 12479 as c_int,
23888 )
23889 .cast::<*mut spBoneData>();
23890 boneMap = (*bones).child;
23891 i = 0 as c_int;
23892 while !boneMap.is_null() {
23893 let mut data: *mut spBoneData = std::ptr::null_mut::<spBoneData>();
23894 let mut inherit: *const c_char = std::ptr::null::<c_char>();
23895 let mut color: *const c_char = std::ptr::null::<c_char>();
23896 let mut parent: *mut spBoneData = std::ptr::null_mut::<spBoneData>();
23897 let mut parentName: *const c_char = Json_getString(
23898 boneMap,
23899 (b"parent\0" as *const u8).cast::<c_char>(),
23900 std::ptr::null::<c_char>(),
23901 );
23902 if !parentName.is_null() {
23903 parent = spSkeletonData_findBone(skeletonData, parentName);
23904 if parent.is_null() {
23905 spSkeletonData_dispose(skeletonData);
23906 _spSkeletonJson_setError(
23907 self_0,
23908 root,
23909 (b"Parent bone not found: \0" as *const u8).cast::<c_char>(),
23910 parentName,
23911 );
23912 return std::ptr::null_mut::<spSkeletonData>();
23913 }
23914 }
23915 data = spBoneData_create(
23916 (*skeletonData).bonesCount,
23917 Json_getString(
23918 boneMap,
23919 (b"name\0" as *const u8).cast::<c_char>(),
23920 std::ptr::null::<c_char>(),
23921 ),
23922 parent,
23923 );
23924 (*data).length = Json_getFloat(
23925 boneMap,
23926 (b"length\0" as *const u8).cast::<c_char>(),
23927 0 as c_int as c_float,
23928 ) * (*self_0).scale;
23929 (*data).x = Json_getFloat(
23930 boneMap,
23931 (b"x\0" as *const u8).cast::<c_char>(),
23932 0 as c_int as c_float,
23933 ) * (*self_0).scale;
23934 (*data).y = Json_getFloat(
23935 boneMap,
23936 (b"y\0" as *const u8).cast::<c_char>(),
23937 0 as c_int as c_float,
23938 ) * (*self_0).scale;
23939 (*data).rotation = Json_getFloat(
23940 boneMap,
23941 (b"rotation\0" as *const u8).cast::<c_char>(),
23942 0 as c_int as c_float,
23943 );
23944 (*data).scaleX = Json_getFloat(
23945 boneMap,
23946 (b"scaleX\0" as *const u8).cast::<c_char>(),
23947 1 as c_int as c_float,
23948 );
23949 (*data).scaleY = Json_getFloat(
23950 boneMap,
23951 (b"scaleY\0" as *const u8).cast::<c_char>(),
23952 1 as c_int as c_float,
23953 );
23954 (*data).shearX = Json_getFloat(
23955 boneMap,
23956 (b"shearX\0" as *const u8).cast::<c_char>(),
23957 0 as c_int as c_float,
23958 );
23959 (*data).shearY = Json_getFloat(
23960 boneMap,
23961 (b"shearY\0" as *const u8).cast::<c_char>(),
23962 0 as c_int as c_float,
23963 );
23964 inherit = Json_getString(
23965 boneMap,
23966 (b"inherit\0" as *const u8).cast::<c_char>(),
23967 (b"normal\0" as *const u8).cast::<c_char>(),
23968 );
23969 (*data).inherit = SP_INHERIT_NORMAL;
23970 if spine_strcmp(inherit, (b"normal\0" as *const u8).cast::<c_char>()) == 0 as c_int {
23971 (*data).inherit = SP_INHERIT_NORMAL;
23972 } else if spine_strcmp(
23973 inherit,
23974 (b"onlyTranslation\0" as *const u8).cast::<c_char>(),
23975 ) == 0 as c_int
23976 {
23977 (*data).inherit = SP_INHERIT_ONLYTRANSLATION;
23978 } else if spine_strcmp(
23979 inherit,
23980 (b"noRotationOrReflection\0" as *const u8).cast::<c_char>(),
23981 ) == 0 as c_int
23982 {
23983 (*data).inherit = SP_INHERIT_NOROTATIONORREFLECTION;
23984 } else if spine_strcmp(inherit, (b"noScale\0" as *const u8).cast::<c_char>()) == 0 as c_int
23985 {
23986 (*data).inherit = SP_INHERIT_NOSCALE;
23987 } else if spine_strcmp(
23988 inherit,
23989 (b"noScaleOrReflection\0" as *const u8).cast::<c_char>(),
23990 ) == 0 as c_int
23991 {
23992 (*data).inherit = SP_INHERIT_NOSCALEORREFLECTION;
23993 }
23994 (*data).skinRequired = if Json_getInt(
23995 boneMap,
23996 (b"skin\0" as *const u8).cast::<c_char>(),
23997 0 as c_int,
23998 ) != 0
23999 {
24000 1 as c_int
24001 } else {
24002 0 as c_int
24003 };
24004 color = Json_getString(
24005 boneMap,
24006 (b"color\0" as *const u8).cast::<c_char>(),
24007 std::ptr::null::<c_char>(),
24008 );
24009 if !color.is_null() {
24010 toColor2(&mut (*data).color, color, -(1 as c_int));
24011 }
24012 (*data).icon = Json_getString(
24013 boneMap,
24014 (b"icon\0" as *const u8).cast::<c_char>(),
24015 (b"\0" as *const u8).cast::<c_char>(),
24016 );
24017 if !((*data).icon).is_null() {
24018 let mut tmp_1: *mut c_char = std::ptr::null_mut::<c_char>();
24019 tmp_1 = _spMalloc(
24020 (::core::mem::size_of::<c_char>() as c_ulong)
24021 .wrapping_mul((spine_strlen((*data).icon)).wrapping_add(1 as c_int as c_ulong)),
24022 (b"spine.c\0" as *const u8).cast::<c_char>(),
24023 12524 as c_int,
24024 )
24025 .cast::<c_char>();
24026 spine_strcpy(tmp_1, (*data).icon);
24027 (*data).icon = tmp_1;
24028 }
24029 (*data).visible = if Json_getInt(
24030 boneMap,
24031 (b"visible\0" as *const u8).cast::<c_char>(),
24032 -(1 as c_int),
24033 ) != 0
24034 {
24035 -(1 as c_int)
24036 } else {
24037 0 as c_int
24038 };
24039 let fresh136 = &mut (*((*skeletonData).bones).offset(i as isize));
24040 *fresh136 = data;
24041 (*skeletonData).bonesCount += 1;
24042 boneMap = (*boneMap).next;
24043 i += 1;
24044 }
24045 slots = Json_getItem(root, (b"slots\0" as *const u8).cast::<c_char>());
24046 if !slots.is_null() {
24047 let mut slotMap: *mut Json = std::ptr::null_mut::<Json>();
24048 (*skeletonData).slotsCount = (*slots).size;
24049 (*skeletonData).slots = _spMalloc(
24050 (::core::mem::size_of::<*mut spSlotData>() as c_ulong)
24051 .wrapping_mul((*slots).size as c_ulong),
24052 (b"spine.c\0" as *const u8).cast::<c_char>(),
24053 12538 as c_int,
24054 )
24055 .cast::<*mut spSlotData>();
24056 slotMap = (*slots).child;
24057 i = 0 as c_int;
24058 while !slotMap.is_null() {
24059 let mut data_0: *mut spSlotData = std::ptr::null_mut::<spSlotData>();
24060 let mut color_0: *const c_char = std::ptr::null::<c_char>();
24061 let mut dark: *const c_char = std::ptr::null::<c_char>();
24062 let mut item: *mut Json = std::ptr::null_mut::<Json>();
24063 let mut boneName: *const c_char = Json_getString(
24064 slotMap,
24065 (b"bone\0" as *const u8).cast::<c_char>(),
24066 std::ptr::null::<c_char>(),
24067 );
24068 let mut boneData: *mut spBoneData = spSkeletonData_findBone(skeletonData, boneName);
24069 if boneData.is_null() {
24070 spSkeletonData_dispose(skeletonData);
24071 _spSkeletonJson_setError(
24072 self_0,
24073 root,
24074 (b"Slot bone not found: \0" as *const u8).cast::<c_char>(),
24075 boneName,
24076 );
24077 return std::ptr::null_mut::<spSkeletonData>();
24078 }
24079 let mut pathName: *mut c_char = std::ptr::null_mut::<c_char>();
24080 let mut slotName: *mut c_char = Json_getString(
24081 slotMap,
24082 (b"name\0" as *const u8).cast::<c_char>(),
24083 std::ptr::null::<c_char>(),
24084 )
24085 .cast_mut();
24086 let slash: c_int = string_lastIndexOf(slotName, '/' as i32 as c_char);
24087 if slash != -1 {
24088 pathName = string_substring(slotName, 0 as c_int, slash);
24089 slotName = string_substring(
24090 slotName,
24091 slash + 1 as c_int,
24092 spine_strlen(slotName) as c_int,
24093 );
24094 }
24095 data_0 = spSlotData_create(i, slotName, boneData);
24096 color_0 = Json_getString(
24097 slotMap,
24098 (b"color\0" as *const u8).cast::<c_char>(),
24099 std::ptr::null::<c_char>(),
24100 );
24101 if !color_0.is_null() {
24102 spColor_setFromFloats(
24103 &mut (*data_0).color,
24104 toColor(color_0, 0 as c_int),
24105 toColor(color_0, 1 as c_int),
24106 toColor(color_0, 2 as c_int),
24107 toColor(color_0, 3 as c_int),
24108 );
24109 }
24110 dark = Json_getString(
24111 slotMap,
24112 (b"dark\0" as *const u8).cast::<c_char>(),
24113 std::ptr::null::<c_char>(),
24114 );
24115 if !dark.is_null() {
24116 (*data_0).darkColor = spColor_create();
24117 spColor_setFromFloats(
24118 (*data_0).darkColor,
24119 toColor(dark, 0 as c_int),
24120 toColor(dark, 1 as c_int),
24121 toColor(dark, 2 as c_int),
24122 1.0f32,
24123 );
24124 }
24125 item = Json_getItem(slotMap, (b"attachment\0" as *const u8).cast::<c_char>());
24126 if !item.is_null() {
24127 spSlotData_setAttachmentName(data_0, (*item).valueString);
24128 }
24129 item = Json_getItem(slotMap, (b"blend\0" as *const u8).cast::<c_char>());
24130 if !item.is_null() {
24131 if spine_strcmp(
24132 (*item).valueString,
24133 (b"additive\0" as *const u8).cast::<c_char>(),
24134 ) == 0 as c_int
24135 {
24136 (*data_0).blendMode = SP_BLEND_MODE_ADDITIVE;
24137 } else if spine_strcmp(
24138 (*item).valueString,
24139 (b"multiply\0" as *const u8).cast::<c_char>(),
24140 ) == 0 as c_int
24141 {
24142 (*data_0).blendMode = SP_BLEND_MODE_MULTIPLY;
24143 } else if spine_strcmp(
24144 (*item).valueString,
24145 (b"screen\0" as *const u8).cast::<c_char>(),
24146 ) == 0 as c_int
24147 {
24148 (*data_0).blendMode = SP_BLEND_MODE_SCREEN;
24149 }
24150 }
24151 (*data_0).visible = Json_getInt(
24152 slotMap,
24153 (b"visible\0" as *const u8).cast::<c_char>(),
24154 -(1 as c_int),
24155 );
24156 (*data_0).path = pathName;
24157 let fresh137 = &mut (*((*skeletonData).slots).offset(i as isize));
24158 *fresh137 = data_0;
24159 slotMap = (*slotMap).next;
24160 i += 1;
24161 }
24162 }
24163 ik = Json_getItem(root, (b"ik\0" as *const u8).cast::<c_char>());
24164 if !ik.is_null() {
24165 let mut constraintMap: *mut Json = std::ptr::null_mut::<Json>();
24166 (*skeletonData).ikConstraintsCount = (*ik).size;
24167 (*skeletonData).ikConstraints = _spMalloc(
24168 (::core::mem::size_of::<*mut spIkConstraintData>() as c_ulong)
24169 .wrapping_mul((*ik).size as c_ulong),
24170 (b"spine.c\0" as *const u8).cast::<c_char>(),
24171 12605 as c_int,
24172 )
24173 .cast::<*mut spIkConstraintData>();
24174 constraintMap = (*ik).child;
24175 i = 0 as c_int;
24176 while !constraintMap.is_null() {
24177 let mut targetName: *const c_char = std::ptr::null::<c_char>();
24178 let mut data_1: *mut spIkConstraintData = spIkConstraintData_create(Json_getString(
24179 constraintMap,
24180 (b"name\0" as *const u8).cast::<c_char>(),
24181 std::ptr::null::<c_char>(),
24182 ));
24183 (*data_1).order = Json_getInt(
24184 constraintMap,
24185 (b"order\0" as *const u8).cast::<c_char>(),
24186 0 as c_int,
24187 );
24188 (*data_1).skinRequired = if Json_getInt(
24189 constraintMap,
24190 (b"skin\0" as *const u8).cast::<c_char>(),
24191 0 as c_int,
24192 ) != 0
24193 {
24194 1 as c_int
24195 } else {
24196 0 as c_int
24197 };
24198 boneMap = Json_getItem(constraintMap, (b"bones\0" as *const u8).cast::<c_char>());
24199 (*data_1).bonesCount = (*boneMap).size;
24200 (*data_1).bones = _spMalloc(
24201 (::core::mem::size_of::<*mut spBoneData>() as c_ulong)
24202 .wrapping_mul((*boneMap).size as c_ulong),
24203 (b"spine.c\0" as *const u8).cast::<c_char>(),
24204 12615 as c_int,
24205 )
24206 .cast::<*mut spBoneData>();
24207 boneMap = (*boneMap).child;
24208 ii = 0 as c_int;
24209 while !boneMap.is_null() {
24210 let fresh138 = &mut (*((*data_1).bones).offset(ii as isize));
24211 *fresh138 = spSkeletonData_findBone(skeletonData, (*boneMap).valueString);
24212 if (*((*data_1).bones).offset(ii as isize)).is_null() {
24213 spSkeletonData_dispose(skeletonData);
24214 _spSkeletonJson_setError(
24215 self_0,
24216 root,
24217 (b"IK bone not found: \0" as *const u8).cast::<c_char>(),
24218 (*boneMap).valueString,
24219 );
24220 return std::ptr::null_mut::<spSkeletonData>();
24221 }
24222 boneMap = (*boneMap).next;
24223 ii += 1;
24224 }
24225 targetName = Json_getString(
24226 constraintMap,
24227 (b"target\0" as *const u8).cast::<c_char>(),
24228 std::ptr::null::<c_char>(),
24229 );
24230 (*data_1).target = spSkeletonData_findBone(skeletonData, targetName);
24231 if ((*data_1).target).is_null() {
24232 spSkeletonData_dispose(skeletonData);
24233 _spSkeletonJson_setError(
24234 self_0,
24235 root,
24236 (b"Target bone not found: \0" as *const u8).cast::<c_char>(),
24237 targetName,
24238 );
24239 return std::ptr::null_mut::<spSkeletonData>();
24240 }
24241 (*data_1).bendDirection = if Json_getInt(
24242 constraintMap,
24243 (b"bendPositive\0" as *const u8).cast::<c_char>(),
24244 1 as c_int,
24245 ) != 0
24246 {
24247 1 as c_int
24248 } else {
24249 -(1 as c_int)
24250 };
24251 (*data_1).compress = if Json_getInt(
24252 constraintMap,
24253 (b"compress\0" as *const u8).cast::<c_char>(),
24254 0 as c_int,
24255 ) != 0
24256 {
24257 1 as c_int
24258 } else {
24259 0 as c_int
24260 };
24261 (*data_1).stretch = if Json_getInt(
24262 constraintMap,
24263 (b"stretch\0" as *const u8).cast::<c_char>(),
24264 0 as c_int,
24265 ) != 0
24266 {
24267 1 as c_int
24268 } else {
24269 0 as c_int
24270 };
24271 (*data_1).uniform = if Json_getInt(
24272 constraintMap,
24273 (b"uniform\0" as *const u8).cast::<c_char>(),
24274 0 as c_int,
24275 ) != 0
24276 {
24277 1 as c_int
24278 } else {
24279 0 as c_int
24280 };
24281 (*data_1).mix = Json_getFloat(
24282 constraintMap,
24283 (b"mix\0" as *const u8).cast::<c_char>(),
24284 1 as c_int as c_float,
24285 );
24286 (*data_1).softness = Json_getFloat(
24287 constraintMap,
24288 (b"softness\0" as *const u8).cast::<c_char>(),
24289 0 as c_int as c_float,
24290 ) * (*self_0).scale;
24291 let fresh139 = &mut (*((*skeletonData).ikConstraints).offset(i as isize));
24292 *fresh139 = data_1;
24293 constraintMap = (*constraintMap).next;
24294 i += 1;
24295 }
24296 }
24297 transform = Json_getItem(root, (b"transform\0" as *const u8).cast::<c_char>());
24298 if !transform.is_null() {
24299 let mut constraintMap_0: *mut Json = std::ptr::null_mut::<Json>();
24300 (*skeletonData).transformConstraintsCount = (*transform).size;
24301 (*skeletonData).transformConstraints = _spMalloc(
24302 (::core::mem::size_of::<*mut spTransformConstraintData>() as c_ulong)
24303 .wrapping_mul((*transform).size as c_ulong),
24304 (b"spine.c\0" as *const u8).cast::<c_char>(),
24305 12649 as c_int,
24306 )
24307 .cast::<*mut spTransformConstraintData>();
24308 constraintMap_0 = (*transform).child;
24309 i = 0 as c_int;
24310 while !constraintMap_0.is_null() {
24311 let mut name: *const c_char = std::ptr::null::<c_char>();
24312 let mut data_2: *mut spTransformConstraintData =
24313 spTransformConstraintData_create(Json_getString(
24314 constraintMap_0,
24315 (b"name\0" as *const u8).cast::<c_char>(),
24316 std::ptr::null::<c_char>(),
24317 ));
24318 (*data_2).order = Json_getInt(
24319 constraintMap_0,
24320 (b"order\0" as *const u8).cast::<c_char>(),
24321 0 as c_int,
24322 );
24323 (*data_2).skinRequired = if Json_getInt(
24324 constraintMap_0,
24325 (b"skin\0" as *const u8).cast::<c_char>(),
24326 0 as c_int,
24327 ) != 0
24328 {
24329 1 as c_int
24330 } else {
24331 0 as c_int
24332 };
24333 boneMap = Json_getItem(constraintMap_0, (b"bones\0" as *const u8).cast::<c_char>());
24334 (*data_2).bonesCount = (*boneMap).size;
24335 (*data_2).bones = _spMalloc(
24336 (::core::mem::size_of::<*mut spBoneData>() as c_ulong)
24337 .wrapping_mul((*boneMap).size as c_ulong),
24338 (b"spine.c\0" as *const u8).cast::<c_char>(),
24339 12660 as c_int,
24340 )
24341 .cast::<*mut spBoneData>();
24342 boneMap = (*boneMap).child;
24343 ii = 0 as c_int;
24344 while !boneMap.is_null() {
24345 let fresh140 = &mut (*((*data_2).bones).offset(ii as isize));
24346 *fresh140 = spSkeletonData_findBone(skeletonData, (*boneMap).valueString);
24347 if (*((*data_2).bones).offset(ii as isize)).is_null() {
24348 spSkeletonData_dispose(skeletonData);
24349 _spSkeletonJson_setError(
24350 self_0,
24351 root,
24352 (b"Transform bone not found: \0" as *const u8).cast::<c_char>(),
24353 (*boneMap).valueString,
24354 );
24355 return std::ptr::null_mut::<spSkeletonData>();
24356 }
24357 boneMap = (*boneMap).next;
24358 ii += 1;
24359 }
24360 name = Json_getString(
24361 constraintMap_0,
24362 (b"target\0" as *const u8).cast::<c_char>(),
24363 std::ptr::null::<c_char>(),
24364 );
24365 (*data_2).target = spSkeletonData_findBone(skeletonData, name);
24366 if ((*data_2).target).is_null() {
24367 spSkeletonData_dispose(skeletonData);
24368 _spSkeletonJson_setError(
24369 self_0,
24370 root,
24371 (b"Target bone not found: \0" as *const u8).cast::<c_char>(),
24372 name,
24373 );
24374 return std::ptr::null_mut::<spSkeletonData>();
24375 }
24376 (*data_2).local = Json_getInt(
24377 constraintMap_0,
24378 (b"local\0" as *const u8).cast::<c_char>(),
24379 0 as c_int,
24380 );
24381 (*data_2).relative = Json_getInt(
24382 constraintMap_0,
24383 (b"relative\0" as *const u8).cast::<c_char>(),
24384 0 as c_int,
24385 );
24386 (*data_2).offsetRotation = Json_getFloat(
24387 constraintMap_0,
24388 (b"rotation\0" as *const u8).cast::<c_char>(),
24389 0 as c_int as c_float,
24390 );
24391 (*data_2).offsetX = Json_getFloat(
24392 constraintMap_0,
24393 (b"x\0" as *const u8).cast::<c_char>(),
24394 0 as c_int as c_float,
24395 ) * (*self_0).scale;
24396 (*data_2).offsetY = Json_getFloat(
24397 constraintMap_0,
24398 (b"y\0" as *const u8).cast::<c_char>(),
24399 0 as c_int as c_float,
24400 ) * (*self_0).scale;
24401 (*data_2).offsetScaleX = Json_getFloat(
24402 constraintMap_0,
24403 (b"scaleX\0" as *const u8).cast::<c_char>(),
24404 0 as c_int as c_float,
24405 );
24406 (*data_2).offsetScaleY = Json_getFloat(
24407 constraintMap_0,
24408 (b"scaleY\0" as *const u8).cast::<c_char>(),
24409 0 as c_int as c_float,
24410 );
24411 (*data_2).offsetShearY = Json_getFloat(
24412 constraintMap_0,
24413 (b"shearY\0" as *const u8).cast::<c_char>(),
24414 0 as c_int as c_float,
24415 );
24416 (*data_2).mixRotate = Json_getFloat(
24417 constraintMap_0,
24418 (b"mixRotate\0" as *const u8).cast::<c_char>(),
24419 1 as c_int as c_float,
24420 );
24421 (*data_2).mixX = Json_getFloat(
24422 constraintMap_0,
24423 (b"mixX\0" as *const u8).cast::<c_char>(),
24424 1 as c_int as c_float,
24425 );
24426 (*data_2).mixY = Json_getFloat(
24427 constraintMap_0,
24428 (b"mixY\0" as *const u8).cast::<c_char>(),
24429 (*data_2).mixX,
24430 );
24431 (*data_2).mixScaleX = Json_getFloat(
24432 constraintMap_0,
24433 (b"mixScaleX\0" as *const u8).cast::<c_char>(),
24434 1 as c_int as c_float,
24435 );
24436 (*data_2).mixScaleY = Json_getFloat(
24437 constraintMap_0,
24438 (b"mixScaleY\0" as *const u8).cast::<c_char>(),
24439 (*data_2).mixScaleX,
24440 );
24441 (*data_2).mixShearY = Json_getFloat(
24442 constraintMap_0,
24443 (b"mixShearY\0" as *const u8).cast::<c_char>(),
24444 1 as c_int as c_float,
24445 );
24446 let fresh141 = &mut (*((*skeletonData).transformConstraints).offset(i as isize));
24447 *fresh141 = data_2;
24448 constraintMap_0 = (*constraintMap_0).next;
24449 i += 1;
24450 }
24451 }
24452 pathJson = Json_getItem(root, (b"path\0" as *const u8).cast::<c_char>());
24453 if !pathJson.is_null() {
24454 let mut constraintMap_1: *mut Json = std::ptr::null_mut::<Json>();
24455 (*skeletonData).pathConstraintsCount = (*pathJson).size;
24456 (*skeletonData).pathConstraints = _spMalloc(
24457 (::core::mem::size_of::<*mut spPathConstraintData>() as c_ulong)
24458 .wrapping_mul((*pathJson).size as c_ulong),
24459 (b"spine.c\0" as *const u8).cast::<c_char>(),
24460 12703 as c_int,
24461 )
24462 .cast::<*mut spPathConstraintData>();
24463 constraintMap_1 = (*pathJson).child;
24464 i = 0 as c_int;
24465 while !constraintMap_1.is_null() {
24466 let mut name_0: *const c_char = std::ptr::null::<c_char>();
24467 let mut item_0: *const c_char = std::ptr::null::<c_char>();
24468 let mut data_3: *mut spPathConstraintData =
24469 spPathConstraintData_create(Json_getString(
24470 constraintMap_1,
24471 (b"name\0" as *const u8).cast::<c_char>(),
24472 std::ptr::null::<c_char>(),
24473 ));
24474 (*data_3).order = Json_getInt(
24475 constraintMap_1,
24476 (b"order\0" as *const u8).cast::<c_char>(),
24477 0 as c_int,
24478 );
24479 (*data_3).skinRequired = if Json_getInt(
24480 constraintMap_1,
24481 (b"skin\0" as *const u8).cast::<c_char>(),
24482 0 as c_int,
24483 ) != 0
24484 {
24485 1 as c_int
24486 } else {
24487 0 as c_int
24488 };
24489 boneMap = Json_getItem(constraintMap_1, (b"bones\0" as *const u8).cast::<c_char>());
24490 (*data_3).bonesCount = (*boneMap).size;
24491 (*data_3).bones = _spMalloc(
24492 (::core::mem::size_of::<*mut spBoneData>() as c_ulong)
24493 .wrapping_mul((*boneMap).size as c_ulong),
24494 (b"spine.c\0" as *const u8).cast::<c_char>(),
24495 12714 as c_int,
24496 )
24497 .cast::<*mut spBoneData>();
24498 boneMap = (*boneMap).child;
24499 ii = 0 as c_int;
24500 while !boneMap.is_null() {
24501 let fresh142 = &mut (*((*data_3).bones).offset(ii as isize));
24502 *fresh142 = spSkeletonData_findBone(skeletonData, (*boneMap).valueString);
24503 if (*((*data_3).bones).offset(ii as isize)).is_null() {
24504 spSkeletonData_dispose(skeletonData);
24505 _spSkeletonJson_setError(
24506 self_0,
24507 root,
24508 (b"Path bone not found: \0" as *const u8).cast::<c_char>(),
24509 (*boneMap).valueString,
24510 );
24511 return std::ptr::null_mut::<spSkeletonData>();
24512 }
24513 boneMap = (*boneMap).next;
24514 ii += 1;
24515 }
24516 name_0 = Json_getString(
24517 constraintMap_1,
24518 (b"target\0" as *const u8).cast::<c_char>(),
24519 std::ptr::null::<c_char>(),
24520 );
24521 (*data_3).target = spSkeletonData_findSlot(skeletonData, name_0);
24522 if ((*data_3).target).is_null() {
24523 spSkeletonData_dispose(skeletonData);
24524 _spSkeletonJson_setError(
24525 self_0,
24526 root,
24527 (b"Target slot not found: \0" as *const u8).cast::<c_char>(),
24528 name_0,
24529 );
24530 return std::ptr::null_mut::<spSkeletonData>();
24531 }
24532 item_0 = Json_getString(
24533 constraintMap_1,
24534 (b"positionMode\0" as *const u8).cast::<c_char>(),
24535 (b"percent\0" as *const u8).cast::<c_char>(),
24536 );
24537 if spine_strcmp(item_0, (b"fixed\0" as *const u8).cast::<c_char>()) == 0 as c_int {
24538 (*data_3).positionMode = SP_POSITION_MODE_FIXED;
24539 } else if spine_strcmp(item_0, (b"percent\0" as *const u8).cast::<c_char>())
24540 == 0 as c_int
24541 {
24542 (*data_3).positionMode = SP_POSITION_MODE_PERCENT;
24543 }
24544 item_0 = Json_getString(
24545 constraintMap_1,
24546 (b"spacingMode\0" as *const u8).cast::<c_char>(),
24547 (b"length\0" as *const u8).cast::<c_char>(),
24548 );
24549 if spine_strcmp(item_0, (b"length\0" as *const u8).cast::<c_char>()) == 0 as c_int {
24550 (*data_3).spacingMode = SP_SPACING_MODE_LENGTH;
24551 } else if spine_strcmp(item_0, (b"fixed\0" as *const u8).cast::<c_char>()) == 0 as c_int
24552 {
24553 (*data_3).spacingMode = SP_SPACING_MODE_FIXED;
24554 } else if spine_strcmp(item_0, (b"percent\0" as *const u8).cast::<c_char>())
24555 == 0 as c_int
24556 {
24557 (*data_3).spacingMode = SP_SPACING_MODE_PERCENT;
24558 } else {
24559 (*data_3).spacingMode = SP_SPACING_MODE_PROPORTIONAL;
24560 }
24561 item_0 = Json_getString(
24562 constraintMap_1,
24563 (b"rotateMode\0" as *const u8).cast::<c_char>(),
24564 (b"tangent\0" as *const u8).cast::<c_char>(),
24565 );
24566 if spine_strcmp(item_0, (b"tangent\0" as *const u8).cast::<c_char>()) == 0 as c_int {
24567 (*data_3).rotateMode = SP_ROTATE_MODE_TANGENT;
24568 } else if spine_strcmp(item_0, (b"chain\0" as *const u8).cast::<c_char>()) == 0 as c_int
24569 {
24570 (*data_3).rotateMode = SP_ROTATE_MODE_CHAIN;
24571 } else if spine_strcmp(item_0, (b"chainScale\0" as *const u8).cast::<c_char>())
24572 == 0 as c_int
24573 {
24574 (*data_3).rotateMode = SP_ROTATE_MODE_CHAIN_SCALE;
24575 }
24576 (*data_3).offsetRotation = Json_getFloat(
24577 constraintMap_1,
24578 (b"rotation\0" as *const u8).cast::<c_char>(),
24579 0 as c_int as c_float,
24580 );
24581 (*data_3).position = Json_getFloat(
24582 constraintMap_1,
24583 (b"position\0" as *const u8).cast::<c_char>(),
24584 0 as c_int as c_float,
24585 );
24586 if (*data_3).positionMode as c_uint == SP_POSITION_MODE_FIXED as c_int as c_uint {
24587 (*data_3).position *= (*self_0).scale;
24588 }
24589 (*data_3).spacing = Json_getFloat(
24590 constraintMap_1,
24591 (b"spacing\0" as *const u8).cast::<c_char>(),
24592 0 as c_int as c_float,
24593 );
24594 if (*data_3).spacingMode as c_uint == SP_SPACING_MODE_LENGTH as c_int as c_uint
24595 || (*data_3).spacingMode as c_uint == SP_SPACING_MODE_FIXED as c_int as c_uint
24596 {
24597 (*data_3).spacing *= (*self_0).scale;
24598 }
24599 (*data_3).mixRotate = Json_getFloat(
24600 constraintMap_1,
24601 (b"mixRotate\0" as *const u8).cast::<c_char>(),
24602 1 as c_int as c_float,
24603 );
24604 (*data_3).mixX = Json_getFloat(
24605 constraintMap_1,
24606 (b"mixX\0" as *const u8).cast::<c_char>(),
24607 1 as c_int as c_float,
24608 );
24609 (*data_3).mixY = Json_getFloat(
24610 constraintMap_1,
24611 (b"mixY\0" as *const u8).cast::<c_char>(),
24612 (*data_3).mixX,
24613 );
24614 let fresh143 = &mut (*((*skeletonData).pathConstraints).offset(i as isize));
24615 *fresh143 = data_3;
24616 constraintMap_1 = (*constraintMap_1).next;
24617 i += 1;
24618 }
24619 }
24620 physics = Json_getItem(root, (b"physics\0" as *const u8).cast::<c_char>());
24621 if !physics.is_null() {
24622 let mut constraintMap_2: *mut Json = std::ptr::null_mut::<Json>();
24623 (*skeletonData).physicsConstraintsCount = (*physics).size;
24624 (*skeletonData).physicsConstraints = _spMalloc(
24625 (::core::mem::size_of::<*mut spPhysicsConstraintData>() as c_ulong)
24626 .wrapping_mul((*physics).size as c_ulong),
24627 (b"spine.c\0" as *const u8).cast::<c_char>(),
24628 12772 as c_int,
24629 )
24630 .cast::<*mut spPhysicsConstraintData>();
24631 constraintMap_2 = (*physics).child;
24632 i = 0 as c_int;
24633 while !constraintMap_2.is_null() {
24634 let mut name_1: *const c_char = std::ptr::null::<c_char>();
24635 let mut data_4: *mut spPhysicsConstraintData =
24636 spPhysicsConstraintData_create(Json_getString(
24637 constraintMap_2,
24638 (b"name\0" as *const u8).cast::<c_char>(),
24639 std::ptr::null::<c_char>(),
24640 ));
24641 (*data_4).order = Json_getInt(
24642 constraintMap_2,
24643 (b"order\0" as *const u8).cast::<c_char>(),
24644 0 as c_int,
24645 );
24646 (*data_4).skinRequired = Json_getInt(
24647 constraintMap_2,
24648 (b"skin\0" as *const u8).cast::<c_char>(),
24649 0 as c_int,
24650 );
24651 name_1 = Json_getString(
24652 constraintMap_2,
24653 (b"bone\0" as *const u8).cast::<c_char>(),
24654 std::ptr::null::<c_char>(),
24655 );
24656 (*data_4).bone = spSkeletonData_findBone(skeletonData, name_1);
24657 if ((*data_4).bone).is_null() {
24658 spSkeletonData_dispose(skeletonData);
24659 _spSkeletonJson_setError(
24660 self_0,
24661 root,
24662 (b"Physics bone not found: \0" as *const u8).cast::<c_char>(),
24663 name_1,
24664 );
24665 return std::ptr::null_mut::<spSkeletonData>();
24666 }
24667 (*data_4).x = Json_getFloat(
24668 constraintMap_2,
24669 (b"x\0" as *const u8).cast::<c_char>(),
24670 0 as c_int as c_float,
24671 );
24672 (*data_4).y = Json_getFloat(
24673 constraintMap_2,
24674 (b"y\0" as *const u8).cast::<c_char>(),
24675 0 as c_int as c_float,
24676 );
24677 (*data_4).rotate = Json_getFloat(
24678 constraintMap_2,
24679 (b"rotate\0" as *const u8).cast::<c_char>(),
24680 0 as c_int as c_float,
24681 );
24682 (*data_4).scaleX = Json_getFloat(
24683 constraintMap_2,
24684 (b"scaleX\0" as *const u8).cast::<c_char>(),
24685 0 as c_int as c_float,
24686 );
24687 (*data_4).shearX = Json_getFloat(
24688 constraintMap_2,
24689 (b"shearX\0" as *const u8).cast::<c_char>(),
24690 0 as c_int as c_float,
24691 );
24692 (*data_4).limit = Json_getFloat(
24693 constraintMap_2,
24694 (b"limit\0" as *const u8).cast::<c_char>(),
24695 5000 as c_int as c_float,
24696 ) * (*self_0).scale;
24697 (*data_4).step = 1.0f32
24698 / Json_getInt(
24699 constraintMap_2,
24700 (b"fps\0" as *const u8).cast::<c_char>(),
24701 60 as c_int,
24702 ) as c_float;
24703 (*data_4).inertia = Json_getFloat(
24704 constraintMap_2,
24705 (b"inertia\0" as *const u8).cast::<c_char>(),
24706 1 as c_int as c_float,
24707 );
24708 (*data_4).strength = Json_getFloat(
24709 constraintMap_2,
24710 (b"strength\0" as *const u8).cast::<c_char>(),
24711 100 as c_int as c_float,
24712 );
24713 (*data_4).damping = Json_getFloat(
24714 constraintMap_2,
24715 (b"damping\0" as *const u8).cast::<c_char>(),
24716 1 as c_int as c_float,
24717 );
24718 (*data_4).massInverse = 1.0f32
24719 / Json_getFloat(
24720 constraintMap_2,
24721 (b"mass\0" as *const u8).cast::<c_char>(),
24722 1 as c_int as c_float,
24723 );
24724 (*data_4).wind = Json_getFloat(
24725 constraintMap_2,
24726 (b"wind\0" as *const u8).cast::<c_char>(),
24727 0 as c_int as c_float,
24728 );
24729 (*data_4).gravity = Json_getFloat(
24730 constraintMap_2,
24731 (b"gravity\0" as *const u8).cast::<c_char>(),
24732 0 as c_int as c_float,
24733 );
24734 (*data_4).mix = Json_getFloat(
24735 constraintMap_2,
24736 (b"mix\0" as *const u8).cast::<c_char>(),
24737 1 as c_int as c_float,
24738 );
24739 (*data_4).inertiaGlobal = Json_getInt(
24740 constraintMap_2,
24741 (b"inertiaGlobal\0" as *const u8).cast::<c_char>(),
24742 0 as c_int,
24743 );
24744 (*data_4).strengthGlobal = Json_getInt(
24745 constraintMap_2,
24746 (b"strengthGlobal\0" as *const u8).cast::<c_char>(),
24747 0 as c_int,
24748 );
24749 (*data_4).dampingGlobal = Json_getInt(
24750 constraintMap_2,
24751 (b"dampingGlobal\0" as *const u8).cast::<c_char>(),
24752 0 as c_int,
24753 );
24754 (*data_4).massGlobal = Json_getInt(
24755 constraintMap_2,
24756 (b"massGlobal\0" as *const u8).cast::<c_char>(),
24757 0 as c_int,
24758 );
24759 (*data_4).windGlobal = Json_getInt(
24760 constraintMap_2,
24761 (b"windGlobal\0" as *const u8).cast::<c_char>(),
24762 0 as c_int,
24763 );
24764 (*data_4).gravityGlobal = Json_getInt(
24765 constraintMap_2,
24766 (b"gravityGlobal\0" as *const u8).cast::<c_char>(),
24767 0 as c_int,
24768 );
24769 (*data_4).mixGlobal = Json_getInt(
24770 constraintMap_2,
24771 (b"mixGlobal\0" as *const u8).cast::<c_char>(),
24772 0 as c_int,
24773 );
24774 let fresh144 = &mut (*((*skeletonData).physicsConstraints).offset(i as isize));
24775 *fresh144 = data_4;
24776 constraintMap_2 = (*constraintMap_2).next;
24777 i += 1;
24778 }
24779 }
24780 skins = Json_getItem(root, (b"skins\0" as *const u8).cast::<c_char>());
24781 if !skins.is_null() {
24782 let mut skinMap: *mut Json = std::ptr::null_mut::<Json>();
24783 (*skeletonData).skins = _spMalloc(
24784 (::core::mem::size_of::<*mut spSkin>() as c_ulong)
24785 .wrapping_mul((*skins).size as c_ulong),
24786 (b"spine.c\0" as *const u8).cast::<c_char>(),
24787 12819 as c_int,
24788 )
24789 .cast::<*mut spSkin>();
24790 skinMap = (*skins).child;
24791 i = 0 as c_int;
24792 while !skinMap.is_null() {
24793 let mut attachmentsMap: *mut Json = std::ptr::null_mut::<Json>();
24794 let mut curves: *mut Json = std::ptr::null_mut::<Json>();
24795 let mut skinPart: *mut Json = std::ptr::null_mut::<Json>();
24796 let mut skin: *mut spSkin = spSkin_create(Json_getString(
24797 skinMap,
24798 (b"name\0" as *const u8).cast::<c_char>(),
24799 (b"\0" as *const u8).cast::<c_char>(),
24800 ));
24801 skinPart = Json_getItem(skinMap, (b"bones\0" as *const u8).cast::<c_char>());
24802 if !skinPart.is_null() {
24803 skinPart = (*skinPart).child;
24804 while !skinPart.is_null() {
24805 let mut bone: *mut spBoneData =
24806 spSkeletonData_findBone(skeletonData, (*skinPart).valueString);
24807 if bone.is_null() {
24808 spSkeletonData_dispose(skeletonData);
24809 _spSkeletonJson_setError(
24810 self_0,
24811 root,
24812 (b"Skin bone constraint not found: \0" as *const u8).cast::<c_char>(),
24813 (*skinPart).valueString,
24814 );
24815 return std::ptr::null_mut::<spSkeletonData>();
24816 }
24817 spBoneDataArray_add((*skin).bones, bone);
24818 skinPart = (*skinPart).next;
24819 }
24820 }
24821 skinPart = Json_getItem(skinMap, (b"ik\0" as *const u8).cast::<c_char>());
24822 if !skinPart.is_null() {
24823 skinPart = (*skinPart).child;
24824 while !skinPart.is_null() {
24825 let mut constraint: *mut spIkConstraintData =
24826 spSkeletonData_findIkConstraint(skeletonData, (*skinPart).valueString);
24827 if constraint.is_null() {
24828 spSkeletonData_dispose(skeletonData);
24829 _spSkeletonJson_setError(
24830 self_0,
24831 root,
24832 (b"Skin IK constraint not found: \0" as *const u8).cast::<c_char>(),
24833 (*skinPart).valueString,
24834 );
24835 return std::ptr::null_mut::<spSkeletonData>();
24836 }
24837 spIkConstraintDataArray_add((*skin).ikConstraints, constraint);
24838 skinPart = (*skinPart).next;
24839 }
24840 }
24841 skinPart = Json_getItem(skinMap, (b"path\0" as *const u8).cast::<c_char>());
24842 if !skinPart.is_null() {
24843 skinPart = (*skinPart).child;
24844 while !skinPart.is_null() {
24845 let mut constraint_0: *mut spPathConstraintData =
24846 spSkeletonData_findPathConstraint(skeletonData, (*skinPart).valueString);
24847 if constraint_0.is_null() {
24848 spSkeletonData_dispose(skeletonData);
24849 _spSkeletonJson_setError(
24850 self_0,
24851 root,
24852 (b"Skin path constraint not found: \0" as *const u8).cast::<c_char>(),
24853 (*skinPart).valueString,
24854 );
24855 return std::ptr::null_mut::<spSkeletonData>();
24856 }
24857 spPathConstraintDataArray_add((*skin).pathConstraints, constraint_0);
24858 skinPart = (*skinPart).next;
24859 }
24860 }
24861 skinPart = Json_getItem(skinMap, (b"transform\0" as *const u8).cast::<c_char>());
24862 if !skinPart.is_null() {
24863 skinPart = (*skinPart).child;
24864 while !skinPart.is_null() {
24865 let mut constraint_1: *mut spTransformConstraintData =
24866 spSkeletonData_findTransformConstraint(
24867 skeletonData,
24868 (*skinPart).valueString,
24869 );
24870 if constraint_1.is_null() {
24871 spSkeletonData_dispose(skeletonData);
24872 _spSkeletonJson_setError(
24873 self_0,
24874 root,
24875 (b"Skin transform constraint not found: \0" as *const u8)
24876 .cast::<c_char>(),
24877 (*skinPart).valueString,
24878 );
24879 return std::ptr::null_mut::<spSkeletonData>();
24880 }
24881 spTransformConstraintDataArray_add((*skin).transformConstraints, constraint_1);
24882 skinPart = (*skinPart).next;
24883 }
24884 }
24885 skinPart = Json_getItem(skinMap, (b"physics\0" as *const u8).cast::<c_char>());
24886 if !skinPart.is_null() {
24887 skinPart = (*skinPart).child;
24888 while !skinPart.is_null() {
24889 let mut constraint_2: *mut spPhysicsConstraintData =
24890 spSkeletonData_findPhysicsConstraint(skeletonData, (*skinPart).valueString);
24891 if constraint_2.is_null() {
24892 spSkeletonData_dispose(skeletonData);
24893 _spSkeletonJson_setError(
24894 self_0,
24895 root,
24896 (b"Skin physics constraint not found: \0" as *const u8)
24897 .cast::<c_char>(),
24898 (*skinPart).valueString,
24899 );
24900 return std::ptr::null_mut::<spSkeletonData>();
24901 }
24902 spPhysicsConstraintDataArray_add((*skin).physicsConstraints, constraint_2);
24903 skinPart = (*skinPart).next;
24904 }
24905 }
24906 let fresh145 = (*skeletonData).skinsCount;
24907 (*skeletonData).skinsCount += 1;
24908 let fresh146 = &mut (*((*skeletonData).skins).offset(fresh145 as isize));
24909 *fresh146 = skin;
24910 if spine_strcmp((*skin).name, (b"default\0" as *const u8).cast::<c_char>())
24911 == 0 as c_int
24912 {
24913 (*skeletonData).defaultSkin = skin;
24914 }
24915 skinPart = Json_getItem(skinMap, (b"attachments\0" as *const u8).cast::<c_char>());
24916 if !skinPart.is_null() {
24917 attachmentsMap = (*skinPart).child;
24918 while !attachmentsMap.is_null() {
24919 let mut slot: *mut spSlotData =
24920 spSkeletonData_findSlot(skeletonData, (*attachmentsMap).name);
24921 let mut attachmentMap: *mut Json = std::ptr::null_mut::<Json>();
24922 attachmentMap = (*attachmentsMap).child;
24923 while !attachmentMap.is_null() {
24924 let mut attachment: *mut spAttachment =
24925 std::ptr::null_mut::<spAttachment>();
24926 let mut skinAttachmentName: *const c_char = (*attachmentMap).name;
24927 let mut attachmentName: *const c_char = Json_getString(
24928 attachmentMap,
24929 (b"name\0" as *const u8).cast::<c_char>(),
24930 skinAttachmentName,
24931 );
24932 let mut path: *const c_char = Json_getString(
24933 attachmentMap,
24934 (b"path\0" as *const u8).cast::<c_char>(),
24935 attachmentName,
24936 );
24937 let mut color_1: *const c_char = std::ptr::null::<c_char>();
24938 let mut entry: *mut Json = std::ptr::null_mut::<Json>();
24939 let mut sequence: *mut spSequence = std::ptr::null_mut::<spSequence>();
24940 let mut typeString: *const c_char = Json_getString(
24941 attachmentMap,
24942 (b"type\0" as *const u8).cast::<c_char>(),
24943 (b"region\0" as *const u8).cast::<c_char>(),
24944 );
24945 let mut type_0: spAttachmentType = SP_ATTACHMENT_REGION;
24946 if spine_strcmp(typeString, (b"region\0" as *const u8).cast::<c_char>())
24947 == 0 as c_int
24948 {
24949 type_0 = SP_ATTACHMENT_REGION;
24950 } else if spine_strcmp(
24951 typeString,
24952 (b"mesh\0" as *const u8).cast::<c_char>(),
24953 ) == 0 as c_int
24954 {
24955 type_0 = SP_ATTACHMENT_MESH;
24956 } else if spine_strcmp(
24957 typeString,
24958 (b"linkedmesh\0" as *const u8).cast::<c_char>(),
24959 ) == 0 as c_int
24960 {
24961 type_0 = SP_ATTACHMENT_LINKED_MESH;
24962 } else if spine_strcmp(
24963 typeString,
24964 (b"boundingbox\0" as *const u8).cast::<c_char>(),
24965 ) == 0 as c_int
24966 {
24967 type_0 = SP_ATTACHMENT_BOUNDING_BOX;
24968 } else if spine_strcmp(
24969 typeString,
24970 (b"path\0" as *const u8).cast::<c_char>(),
24971 ) == 0 as c_int
24972 {
24973 type_0 = SP_ATTACHMENT_PATH;
24974 } else if spine_strcmp(
24975 typeString,
24976 (b"clipping\0" as *const u8).cast::<c_char>(),
24977 ) == 0 as c_int
24978 {
24979 type_0 = SP_ATTACHMENT_CLIPPING;
24980 } else if spine_strcmp(
24981 typeString,
24982 (b"point\0" as *const u8).cast::<c_char>(),
24983 ) == 0 as c_int
24984 {
24985 type_0 = SP_ATTACHMENT_POINT;
24986 } else {
24987 spSkeletonData_dispose(skeletonData);
24988 _spSkeletonJson_setError(
24989 self_0,
24990 root,
24991 (b"Unknown attachment type: \0" as *const u8).cast::<c_char>(),
24992 typeString,
24993 );
24994 return std::ptr::null_mut::<spSkeletonData>();
24995 }
24996 sequence = readSequenceJson(Json_getItem(
24997 attachmentMap,
24998 (b"sequence\0" as *const u8).cast::<c_char>(),
24999 ));
25000 attachment = spAttachmentLoader_createAttachment(
25001 (*self_0).attachmentLoader,
25002 skin,
25003 type_0,
25004 attachmentName,
25005 path,
25006 sequence,
25007 );
25008 if attachment.is_null() {
25009 if !((*(*self_0).attachmentLoader).error1).is_null() {
25010 spSkeletonData_dispose(skeletonData);
25011 _spSkeletonJson_setError(
25012 self_0,
25013 root,
25014 (*(*self_0).attachmentLoader).error1,
25015 (*(*self_0).attachmentLoader).error2,
25016 );
25017 return std::ptr::null_mut::<spSkeletonData>();
25018 }
25019 } else {
25020 match (*attachment).type_0 as c_uint {
25021 0 => {
25022 let mut region: *mut spRegionAttachment =
25023 attachment.cast::<spRegionAttachment>();
25024 if !path.is_null() {
25025 (*region).path = _spMalloc(
25026 (::core::mem::size_of::<c_char>() as c_ulong)
25027 .wrapping_mul(
25028 (spine_strlen(path))
25029 .wrapping_add(1 as c_int as c_ulong),
25030 ),
25031 (b"spine.c\0" as *const u8).cast::<c_char>(),
25032 12952 as c_int,
25033 )
25034 .cast::<c_char>();
25035 spine_strcpy((*region).path, path);
25036 }
25037 (*region).x = Json_getFloat(
25038 attachmentMap,
25039 (b"x\0" as *const u8).cast::<c_char>(),
25040 0 as c_int as c_float,
25041 ) * (*self_0).scale;
25042 (*region).y = Json_getFloat(
25043 attachmentMap,
25044 (b"y\0" as *const u8).cast::<c_char>(),
25045 0 as c_int as c_float,
25046 ) * (*self_0).scale;
25047 (*region).scaleX = Json_getFloat(
25048 attachmentMap,
25049 (b"scaleX\0" as *const u8).cast::<c_char>(),
25050 1 as c_int as c_float,
25051 );
25052 (*region).scaleY = Json_getFloat(
25053 attachmentMap,
25054 (b"scaleY\0" as *const u8).cast::<c_char>(),
25055 1 as c_int as c_float,
25056 );
25057 (*region).rotation = Json_getFloat(
25058 attachmentMap,
25059 (b"rotation\0" as *const u8).cast::<c_char>(),
25060 0 as c_int as c_float,
25061 );
25062 (*region).width = Json_getFloat(
25063 attachmentMap,
25064 (b"width\0" as *const u8).cast::<c_char>(),
25065 32 as c_int as c_float,
25066 ) * (*self_0).scale;
25067 (*region).height = Json_getFloat(
25068 attachmentMap,
25069 (b"height\0" as *const u8).cast::<c_char>(),
25070 32 as c_int as c_float,
25071 ) * (*self_0).scale;
25072 (*region).sequence = sequence;
25073 color_1 = Json_getString(
25074 attachmentMap,
25075 (b"color\0" as *const u8).cast::<c_char>(),
25076 std::ptr::null::<c_char>(),
25077 );
25078 if !color_1.is_null() {
25079 spColor_setFromFloats(
25080 &mut (*region).color,
25081 toColor(color_1, 0 as c_int),
25082 toColor(color_1, 1 as c_int),
25083 toColor(color_1, 2 as c_int),
25084 toColor(color_1, 3 as c_int),
25085 );
25086 }
25087 if !((*region).region).is_null() {
25088 spRegionAttachment_updateRegion(region);
25089 }
25090 spAttachmentLoader_configureAttachment(
25091 (*self_0).attachmentLoader,
25092 attachment,
25093 );
25094 }
25095 2 | 3 => {
25096 let mut mesh: *mut spMeshAttachment =
25097 attachment.cast::<spMeshAttachment>();
25098 (*mesh).path = _spMalloc(
25099 (::core::mem::size_of::<c_char>() as c_ulong).wrapping_mul(
25100 (spine_strlen(path))
25101 .wrapping_add(1 as c_int as c_ulong),
25102 ),
25103 (b"spine.c\0" as *const u8).cast::<c_char>(),
25104 12980 as c_int,
25105 )
25106 .cast::<c_char>();
25107 spine_strcpy((*mesh).path, path);
25108 color_1 = Json_getString(
25109 attachmentMap,
25110 (b"color\0" as *const u8).cast::<c_char>(),
25111 std::ptr::null::<c_char>(),
25112 );
25113 if !color_1.is_null() {
25114 spColor_setFromFloats(
25115 &mut (*mesh).color,
25116 toColor(color_1, 0 as c_int),
25117 toColor(color_1, 1 as c_int),
25118 toColor(color_1, 2 as c_int),
25119 toColor(color_1, 3 as c_int),
25120 );
25121 }
25122 (*mesh).width = Json_getFloat(
25123 attachmentMap,
25124 (b"width\0" as *const u8).cast::<c_char>(),
25125 32 as c_int as c_float,
25126 ) * (*self_0).scale;
25127 (*mesh).height = Json_getFloat(
25128 attachmentMap,
25129 (b"height\0" as *const u8).cast::<c_char>(),
25130 32 as c_int as c_float,
25131 ) * (*self_0).scale;
25132 (*mesh).sequence = sequence;
25133 entry = Json_getItem(
25134 attachmentMap,
25135 (b"parent\0" as *const u8).cast::<c_char>(),
25136 );
25137 if entry.is_null() {
25138 let mut verticesLength: c_int = 0;
25139 entry = Json_getItem(
25140 attachmentMap,
25141 (b"triangles\0" as *const u8).cast::<c_char>(),
25142 );
25143 (*mesh).trianglesCount = (*entry).size;
25144 (*mesh).triangles = _spMalloc(
25145 (::core::mem::size_of::<c_ushort>() as c_ulong)
25146 .wrapping_mul((*entry).size as c_ulong),
25147 (b"spine.c\0" as *const u8).cast::<c_char>(),
25148 13000 as c_int,
25149 )
25150 .cast::<c_ushort>();
25151 entry = (*entry).child;
25152 ii = 0 as c_int;
25153 while !entry.is_null() {
25154 *((*mesh).triangles).offset(ii as isize) =
25155 (*entry).valueInt as c_ushort;
25156 entry = (*entry).next;
25157 ii += 1;
25158 }
25159 entry = Json_getItem(
25160 attachmentMap,
25161 (b"uvs\0" as *const u8).cast::<c_char>(),
25162 );
25163 verticesLength = (*entry).size;
25164 (*mesh).regionUVs = _spMalloc(
25165 (::core::mem::size_of::<c_float>() as c_ulong)
25166 .wrapping_mul(verticesLength as c_ulong),
25167 (b"spine.c\0" as *const u8).cast::<c_char>(),
25168 13006 as c_int,
25169 )
25170 .cast::<c_float>();
25171 entry = (*entry).child;
25172 ii = 0 as c_int;
25173 while !entry.is_null() {
25174 *((*mesh).regionUVs).offset(ii as isize) =
25175 (*entry).valueFloat;
25176 entry = (*entry).next;
25177 ii += 1;
25178 }
25179 _readVerticesJson(
25180 self_0,
25181 attachmentMap,
25182 &mut (*mesh).super_0,
25183 verticesLength,
25184 );
25185 if !((*mesh).region).is_null() {
25186 spMeshAttachment_updateRegion(mesh);
25187 }
25188 (*mesh).hullLength = Json_getInt(
25189 attachmentMap,
25190 (b"hull\0" as *const u8).cast::<c_char>(),
25191 0 as c_int,
25192 );
25193 entry = Json_getItem(
25194 attachmentMap,
25195 (b"edges\0" as *const u8).cast::<c_char>(),
25196 );
25197 if !entry.is_null() {
25198 (*mesh).edgesCount = (*entry).size;
25199 (*mesh).edges = _spMalloc(
25200 (::core::mem::size_of::<c_ushort>() as c_ulong)
25201 .wrapping_mul((*entry).size as c_ulong),
25202 (b"spine.c\0" as *const u8).cast::<c_char>(),
25203 13019 as c_int,
25204 )
25205 .cast::<c_ushort>();
25206 entry = (*entry).child;
25207 ii = 0 as c_int;
25208 while !entry.is_null() {
25209 *((*mesh).edges).offset(ii as isize) =
25210 (*entry).valueInt as c_ushort;
25211 entry = (*entry).next;
25212 ii += 1;
25213 }
25214 }
25215 spAttachmentLoader_configureAttachment(
25216 (*self_0).attachmentLoader,
25217 attachment,
25218 );
25219 } else {
25220 let mut inheritTimelines: c_int = Json_getInt(
25221 attachmentMap,
25222 (b"timelines\0" as *const u8).cast::<c_char>(),
25223 1 as c_int,
25224 );
25225 _spSkeletonJson_addLinkedMesh(
25226 self_0,
25227 attachment.cast::<spMeshAttachment>(),
25228 Json_getString(
25229 attachmentMap,
25230 (b"skin\0" as *const u8).cast::<c_char>(),
25231 std::ptr::null::<c_char>(),
25232 ),
25233 (*slot).index,
25234 (*entry).valueString,
25235 inheritTimelines,
25236 );
25237 }
25238 }
25239 1 => {
25240 let mut box_0: *mut spBoundingBoxAttachment =
25241 attachment.cast::<spBoundingBoxAttachment>();
25242 let mut vertexCount: c_int = Json_getInt(
25243 attachmentMap,
25244 (b"vertexCount\0" as *const u8).cast::<c_char>(),
25245 0 as c_int,
25246 ) << 1 as c_int;
25247 _readVerticesJson(
25248 self_0,
25249 attachmentMap,
25250 &mut (*box_0).super_0,
25251 vertexCount,
25252 );
25253 (*box_0).super_0.verticesCount = vertexCount;
25254 color_1 = Json_getString(
25255 attachmentMap,
25256 (b"color\0" as *const u8).cast::<c_char>(),
25257 std::ptr::null::<c_char>(),
25258 );
25259 if !color_1.is_null() {
25260 spColor_setFromFloats(
25261 &mut (*box_0).color,
25262 toColor(color_1, 0 as c_int),
25263 toColor(color_1, 1 as c_int),
25264 toColor(color_1, 2 as c_int),
25265 toColor(color_1, 3 as c_int),
25266 );
25267 }
25268 spAttachmentLoader_configureAttachment(
25269 (*self_0).attachmentLoader,
25270 attachment,
25271 );
25272 }
25273 4 => {
25274 let mut pathAttachment: *mut spPathAttachment =
25275 attachment.cast::<spPathAttachment>();
25276 let mut vertexCount_0: c_int = 0 as c_int;
25277 (*pathAttachment).closed = Json_getInt(
25278 attachmentMap,
25279 (b"closed\0" as *const u8).cast::<c_char>(),
25280 0 as c_int,
25281 );
25282 (*pathAttachment).constantSpeed = Json_getInt(
25283 attachmentMap,
25284 (b"constantSpeed\0" as *const u8).cast::<c_char>(),
25285 1 as c_int,
25286 );
25287 vertexCount_0 = Json_getInt(
25288 attachmentMap,
25289 (b"vertexCount\0" as *const u8).cast::<c_char>(),
25290 0 as c_int,
25291 );
25292 _readVerticesJson(
25293 self_0,
25294 attachmentMap,
25295 &mut (*pathAttachment).super_0,
25296 vertexCount_0 << 1 as c_int,
25297 );
25298 (*pathAttachment).lengthsLength = vertexCount_0 / 3 as c_int;
25299 (*pathAttachment).lengths = _spMalloc(
25300 (::core::mem::size_of::<c_float>() as c_ulong)
25301 .wrapping_mul(
25302 (*pathAttachment).lengthsLength as c_ulong,
25303 ),
25304 (b"spine.c\0" as *const u8).cast::<c_char>(),
25305 13058 as c_int,
25306 )
25307 .cast::<c_float>();
25308 curves = Json_getItem(
25309 attachmentMap,
25310 (b"lengths\0" as *const u8).cast::<c_char>(),
25311 );
25312 curves = (*curves).child;
25313 ii = 0 as c_int;
25314 while !curves.is_null() {
25315 *((*pathAttachment).lengths).offset(ii as isize) =
25316 (*curves).valueFloat * (*self_0).scale;
25317 curves = (*curves).next;
25318 ii += 1;
25319 }
25320 color_1 = Json_getString(
25321 attachmentMap,
25322 (b"color\0" as *const u8).cast::<c_char>(),
25323 std::ptr::null::<c_char>(),
25324 );
25325 if !color_1.is_null() {
25326 spColor_setFromFloats(
25327 &mut (*pathAttachment).color,
25328 toColor(color_1, 0 as c_int),
25329 toColor(color_1, 1 as c_int),
25330 toColor(color_1, 2 as c_int),
25331 toColor(color_1, 3 as c_int),
25332 );
25333 }
25334 }
25335 5 => {
25336 let mut point: *mut spPointAttachment =
25337 attachment.cast::<spPointAttachment>();
25338 (*point).x = Json_getFloat(
25339 attachmentMap,
25340 (b"x\0" as *const u8).cast::<c_char>(),
25341 0 as c_int as c_float,
25342 ) * (*self_0).scale;
25343 (*point).y = Json_getFloat(
25344 attachmentMap,
25345 (b"y\0" as *const u8).cast::<c_char>(),
25346 0 as c_int as c_float,
25347 ) * (*self_0).scale;
25348 (*point).rotation = Json_getFloat(
25349 attachmentMap,
25350 (b"rotation\0" as *const u8).cast::<c_char>(),
25351 0 as c_int as c_float,
25352 );
25353 color_1 = Json_getString(
25354 attachmentMap,
25355 (b"color\0" as *const u8).cast::<c_char>(),
25356 std::ptr::null::<c_char>(),
25357 );
25358 if !color_1.is_null() {
25359 spColor_setFromFloats(
25360 &mut (*point).color,
25361 toColor(color_1, 0 as c_int),
25362 toColor(color_1, 1 as c_int),
25363 toColor(color_1, 2 as c_int),
25364 toColor(color_1, 3 as c_int),
25365 );
25366 }
25367 }
25368 6 => {
25369 let mut clip: *mut spClippingAttachment =
25370 attachment.cast::<spClippingAttachment>();
25371 let mut vertexCount_1: c_int = 0 as c_int;
25372 let mut end: *const c_char = Json_getString(
25373 attachmentMap,
25374 (b"end\0" as *const u8).cast::<c_char>(),
25375 std::ptr::null::<c_char>(),
25376 );
25377 if !end.is_null() {
25378 let mut endSlot: *mut spSlotData =
25379 spSkeletonData_findSlot(skeletonData, end);
25380 (*clip).endSlot = endSlot;
25381 }
25382 vertexCount_1 = Json_getInt(
25383 attachmentMap,
25384 (b"vertexCount\0" as *const u8).cast::<c_char>(),
25385 0 as c_int,
25386 ) << 1 as c_int;
25387 _readVerticesJson(
25388 self_0,
25389 attachmentMap,
25390 &mut (*clip).super_0,
25391 vertexCount_1,
25392 );
25393 color_1 = Json_getString(
25394 attachmentMap,
25395 (b"color\0" as *const u8).cast::<c_char>(),
25396 std::ptr::null::<c_char>(),
25397 );
25398 if !color_1.is_null() {
25399 spColor_setFromFloats(
25400 &mut (*clip).color,
25401 toColor(color_1, 0 as c_int),
25402 toColor(color_1, 1 as c_int),
25403 toColor(color_1, 2 as c_int),
25404 toColor(color_1, 3 as c_int),
25405 );
25406 }
25407 spAttachmentLoader_configureAttachment(
25408 (*self_0).attachmentLoader,
25409 attachment,
25410 );
25411 }
25412 _ => {}
25413 }
25414 spSkin_setAttachment(
25415 skin,
25416 (*slot).index,
25417 skinAttachmentName,
25418 attachment,
25419 );
25420 }
25421 attachmentMap = (*attachmentMap).next;
25422 }
25423 attachmentsMap = (*attachmentsMap).next;
25424 }
25425 }
25426 skinMap = (*skinMap).next;
25427 i += 1;
25428 }
25429 }
25430 i = 0 as c_int;
25431 while i < (*internal).linkedMeshCount {
25432 let mut parent_0: *mut spAttachment = std::ptr::null_mut::<spAttachment>();
25433 let mut linkedMesh: *mut _spLinkedMeshJson = ((*internal).linkedMeshes).offset(i as isize);
25434 let mut skin_0: *mut spSkin = if ((*linkedMesh).skin).is_null() {
25435 (*skeletonData).defaultSkin
25436 } else {
25437 spSkeletonData_findSkin(skeletonData, (*linkedMesh).skin)
25438 };
25439 if skin_0.is_null() {
25440 spSkeletonData_dispose(skeletonData);
25441 _spSkeletonJson_setError(
25442 self_0,
25443 std::ptr::null_mut::<Json>(),
25444 (b"Skin not found: \0" as *const u8).cast::<c_char>(),
25445 (*linkedMesh).skin,
25446 );
25447 return std::ptr::null_mut::<spSkeletonData>();
25448 }
25449 parent_0 = spSkin_getAttachment(skin_0, (*linkedMesh).slotIndex, (*linkedMesh).parent);
25450 if parent_0.is_null() {
25451 spSkeletonData_dispose(skeletonData);
25452 _spSkeletonJson_setError(
25453 self_0,
25454 std::ptr::null_mut::<Json>(),
25455 (b"Parent mesh not found: \0" as *const u8).cast::<c_char>(),
25456 (*linkedMesh).parent,
25457 );
25458 return std::ptr::null_mut::<spSkeletonData>();
25459 }
25460 (*(*linkedMesh).mesh).super_0.timelineAttachment = if (*linkedMesh).inheritTimeline != 0 {
25461 parent_0
25462 } else {
25463 &mut (*(*linkedMesh).mesh).super_0.super_0
25464 };
25465 spMeshAttachment_setParentMesh((*linkedMesh).mesh, parent_0.cast::<spMeshAttachment>());
25466 if !((*(*linkedMesh).mesh).region).is_null() {
25467 spMeshAttachment_updateRegion((*linkedMesh).mesh);
25468 }
25469 spAttachmentLoader_configureAttachment(
25470 (*self_0).attachmentLoader,
25471 &mut (*(*linkedMesh).mesh).super_0.super_0,
25472 );
25473 i += 1;
25474 }
25475 events = Json_getItem(root, (b"events\0" as *const u8).cast::<c_char>());
25476 if !events.is_null() {
25477 let mut eventMap: *mut Json = std::ptr::null_mut::<Json>();
25478 let mut stringValue: *const c_char = std::ptr::null::<c_char>();
25479 let mut audioPath: *const c_char = std::ptr::null::<c_char>();
25480 (*skeletonData).eventsCount = (*events).size;
25481 (*skeletonData).events = _spMalloc(
25482 (::core::mem::size_of::<*mut spEventData>() as c_ulong)
25483 .wrapping_mul((*events).size as c_ulong),
25484 (b"spine.c\0" as *const u8).cast::<c_char>(),
25485 13149 as c_int,
25486 )
25487 .cast::<*mut spEventData>();
25488 eventMap = (*events).child;
25489 i = 0 as c_int;
25490 while !eventMap.is_null() {
25491 let mut eventData: *mut spEventData = spEventData_create((*eventMap).name);
25492 (*eventData).intValue = Json_getInt(
25493 eventMap,
25494 (b"int\0" as *const u8).cast::<c_char>(),
25495 0 as c_int,
25496 );
25497 (*eventData).floatValue = Json_getFloat(
25498 eventMap,
25499 (b"float\0" as *const u8).cast::<c_char>(),
25500 0 as c_int as c_float,
25501 );
25502 stringValue = Json_getString(
25503 eventMap,
25504 (b"string\0" as *const u8).cast::<c_char>(),
25505 std::ptr::null::<c_char>(),
25506 );
25507 if !stringValue.is_null() {
25508 (*eventData).stringValue = _spMalloc(
25509 (::core::mem::size_of::<c_char>() as c_ulong).wrapping_mul(
25510 (spine_strlen(stringValue)).wrapping_add(1 as c_int as c_ulong),
25511 ),
25512 (b"spine.c\0" as *const u8).cast::<c_char>(),
25513 13155 as c_int,
25514 )
25515 .cast::<c_char>();
25516 spine_strcpy((*eventData).stringValue, stringValue);
25517 }
25518 audioPath = Json_getString(
25519 eventMap,
25520 (b"audio\0" as *const u8).cast::<c_char>(),
25521 std::ptr::null::<c_char>(),
25522 );
25523 if !audioPath.is_null() {
25524 (*eventData).audioPath = _spMalloc(
25525 (::core::mem::size_of::<c_char>() as c_ulong).wrapping_mul(
25526 (spine_strlen(audioPath)).wrapping_add(1 as c_int as c_ulong),
25527 ),
25528 (b"spine.c\0" as *const u8).cast::<c_char>(),
25529 13158 as c_int,
25530 )
25531 .cast::<c_char>();
25532 spine_strcpy((*eventData).audioPath, audioPath);
25533 (*eventData).volume = Json_getFloat(
25534 eventMap,
25535 (b"volume\0" as *const u8).cast::<c_char>(),
25536 1 as c_int as c_float,
25537 );
25538 (*eventData).balance = Json_getFloat(
25539 eventMap,
25540 (b"balance\0" as *const u8).cast::<c_char>(),
25541 0 as c_int as c_float,
25542 );
25543 }
25544 let fresh147 = &mut (*((*skeletonData).events).offset(i as isize));
25545 *fresh147 = eventData;
25546 eventMap = (*eventMap).next;
25547 i += 1;
25548 }
25549 }
25550 animations = Json_getItem(root, (b"animations\0" as *const u8).cast::<c_char>());
25551 if !animations.is_null() {
25552 let mut animationMap: *mut Json = std::ptr::null_mut::<Json>();
25553 (*skeletonData).animations = _spMalloc(
25554 (::core::mem::size_of::<*mut spAnimation>() as c_ulong)
25555 .wrapping_mul((*animations).size as c_ulong),
25556 (b"spine.c\0" as *const u8).cast::<c_char>(),
25557 13170 as c_int,
25558 )
25559 .cast::<*mut spAnimation>();
25560 animationMap = (*animations).child;
25561 while !animationMap.is_null() {
25562 let mut animation: *mut spAnimation =
25563 _spSkeletonJson_readAnimation(self_0, animationMap, skeletonData);
25564 if animation.is_null() {
25565 spSkeletonData_dispose(skeletonData);
25566 return std::ptr::null_mut::<spSkeletonData>();
25567 }
25568 let fresh148 = (*skeletonData).animationsCount;
25569 (*skeletonData).animationsCount += 1;
25570 let fresh149 = &mut (*((*skeletonData).animations).offset(fresh148 as isize));
25571 *fresh149 = animation;
25572 animationMap = (*animationMap).next;
25573 }
25574 }
25575 Json_dispose(root);
25576 skeletonData
25577}
25578#[no_mangle]
25579pub unsafe extern "C" fn spBoneDataArray_create(
25580 mut initialCapacity: c_int,
25581) -> *mut spBoneDataArray {
25582 let mut array: *mut spBoneDataArray = _spCalloc(
25583 1 as c_int as size_t,
25584 ::core::mem::size_of::<spBoneDataArray>() as c_ulong,
25585 (b"spine.c\0" as *const u8).cast::<c_char>(),
25586 13217 as c_int,
25587 )
25588 .cast::<spBoneDataArray>();
25589 (*array).size = 0 as c_int;
25590 (*array).capacity = initialCapacity;
25591 (*array).items = _spCalloc(
25592 initialCapacity as size_t,
25593 ::core::mem::size_of::<*mut spBoneData>() as c_ulong,
25594 (b"spine.c\0" as *const u8).cast::<c_char>(),
25595 13217 as c_int,
25596 )
25597 .cast::<*mut spBoneData>();
25598 array
25599}
25600#[no_mangle]
25601pub unsafe extern "C" fn spBoneDataArray_dispose(mut self_0: *mut spBoneDataArray) {
25602 _spFree((*self_0).items.cast::<c_void>());
25603 _spFree(self_0.cast::<c_void>());
25604}
25605#[no_mangle]
25606pub unsafe extern "C" fn spBoneDataArray_clear(mut self_0: *mut spBoneDataArray) {
25607 (*self_0).size = 0 as c_int;
25608}
25609#[no_mangle]
25610pub unsafe extern "C" fn spBoneDataArray_setSize(
25611 mut self_0: *mut spBoneDataArray,
25612 mut newSize: c_int,
25613) -> *mut spBoneDataArray {
25614 (*self_0).size = newSize;
25615 if (*self_0).capacity < newSize {
25616 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
25617 8 as c_int
25618 } else {
25619 ((*self_0).size as c_float * 1.75f32) as c_int
25620 };
25621 (*self_0).items = _spRealloc(
25622 (*self_0).items.cast::<c_void>(),
25623 (::core::mem::size_of::<*mut spBoneData>() as c_ulong)
25624 .wrapping_mul((*self_0).capacity as c_ulong),
25625 )
25626 .cast::<*mut spBoneData>();
25627 }
25628 self_0
25629}
25630#[no_mangle]
25631pub unsafe extern "C" fn spBoneDataArray_ensureCapacity(
25632 mut self_0: *mut spBoneDataArray,
25633 mut newCapacity: c_int,
25634) {
25635 if (*self_0).capacity >= newCapacity {
25636 return;
25637 }
25638 (*self_0).capacity = newCapacity;
25639 (*self_0).items = _spRealloc(
25640 (*self_0).items.cast::<c_void>(),
25641 (::core::mem::size_of::<*mut spBoneData>() as c_ulong)
25642 .wrapping_mul((*self_0).capacity as c_ulong),
25643 )
25644 .cast::<*mut spBoneData>();
25645}
25646#[no_mangle]
25647pub unsafe extern "C" fn spBoneDataArray_add(
25648 mut self_0: *mut spBoneDataArray,
25649 mut value: *mut spBoneData,
25650) {
25651 if (*self_0).size == (*self_0).capacity {
25652 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
25653 8 as c_int
25654 } else {
25655 ((*self_0).size as c_float * 1.75f32) as c_int
25656 };
25657 (*self_0).items = _spRealloc(
25658 (*self_0).items.cast::<c_void>(),
25659 (::core::mem::size_of::<*mut spBoneData>() as c_ulong)
25660 .wrapping_mul((*self_0).capacity as c_ulong),
25661 )
25662 .cast::<*mut spBoneData>();
25663 }
25664 let fresh150 = (*self_0).size;
25665 (*self_0).size += 1;
25666 let fresh151 = &mut (*((*self_0).items).offset(fresh150 as isize));
25667 *fresh151 = value;
25668}
25669#[no_mangle]
25670pub unsafe extern "C" fn spBoneDataArray_addAll(
25671 mut self_0: *mut spBoneDataArray,
25672 mut other: *mut spBoneDataArray,
25673) {
25674 let mut i: c_int = 0 as c_int;
25675 while i < (*other).size {
25676 spBoneDataArray_add(self_0, *((*other).items).offset(i as isize));
25677 i += 1;
25678 }
25679}
25680#[no_mangle]
25681pub unsafe extern "C" fn spBoneDataArray_addAllValues(
25682 mut self_0: *mut spBoneDataArray,
25683 mut values: *mut *mut spBoneData,
25684 mut offset: c_int,
25685 mut count: c_int,
25686) {
25687 let mut i: c_int = offset;
25688 let mut n: c_int = offset + count;
25689 while i < n {
25690 spBoneDataArray_add(self_0, *values.offset(i as isize));
25691 i += 1;
25692 }
25693}
25694#[no_mangle]
25695pub unsafe extern "C" fn spBoneDataArray_removeAt(
25696 mut self_0: *mut spBoneDataArray,
25697 mut index: c_int,
25698) {
25699 (*self_0).size -= 1;
25700 spine_memmove(
25701 ((*self_0).items).offset(index as isize).cast::<c_void>(),
25702 ((*self_0).items)
25703 .offset(index as isize)
25704 .offset(1 as c_int as isize) as *const c_void,
25705 (::core::mem::size_of::<*mut spBoneData>() as c_ulong)
25706 .wrapping_mul(((*self_0).size - index) as c_ulong),
25707 );
25708}
25709#[no_mangle]
25710pub unsafe extern "C" fn spBoneDataArray_contains(
25711 mut self_0: *mut spBoneDataArray,
25712 mut value: *mut spBoneData,
25713) -> c_int {
25714 let mut items: *mut *mut spBoneData = (*self_0).items;
25715 let mut i: c_int = 0;
25716 let mut n: c_int = 0;
25717 i = 0 as c_int;
25718 n = (*self_0).size;
25719 while i < n {
25720 if *items.offset(i as isize) == value {
25721 return -(1 as c_int);
25722 }
25723 i += 1;
25724 }
25725 0 as c_int
25726}
25727#[no_mangle]
25728pub unsafe extern "C" fn spBoneDataArray_pop(mut self_0: *mut spBoneDataArray) -> *mut spBoneData {
25729 (*self_0).size -= 1;
25730 let mut item: *mut spBoneData = *((*self_0).items).offset((*self_0).size as isize);
25731 item
25732}
25733#[no_mangle]
25734pub unsafe extern "C" fn spBoneDataArray_peek(mut self_0: *mut spBoneDataArray) -> *mut spBoneData {
25735 *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize)
25736}
25737#[no_mangle]
25738pub unsafe extern "C" fn spIkConstraintDataArray_create(
25739 mut initialCapacity: c_int,
25740) -> *mut spIkConstraintDataArray {
25741 let mut array: *mut spIkConstraintDataArray = _spCalloc(
25742 1 as c_int as size_t,
25743 ::core::mem::size_of::<spIkConstraintDataArray>() as c_ulong,
25744 (b"spine.c\0" as *const u8).cast::<c_char>(),
25745 13219 as c_int,
25746 )
25747 .cast::<spIkConstraintDataArray>();
25748 (*array).size = 0 as c_int;
25749 (*array).capacity = initialCapacity;
25750 (*array).items = _spCalloc(
25751 initialCapacity as size_t,
25752 ::core::mem::size_of::<*mut spIkConstraintData>() as c_ulong,
25753 (b"spine.c\0" as *const u8).cast::<c_char>(),
25754 13219 as c_int,
25755 )
25756 .cast::<*mut spIkConstraintData>();
25757 array
25758}
25759#[no_mangle]
25760pub unsafe extern "C" fn spIkConstraintDataArray_dispose(mut self_0: *mut spIkConstraintDataArray) {
25761 _spFree((*self_0).items.cast::<c_void>());
25762 _spFree(self_0.cast::<c_void>());
25763}
25764#[no_mangle]
25765pub unsafe extern "C" fn spIkConstraintDataArray_clear(mut self_0: *mut spIkConstraintDataArray) {
25766 (*self_0).size = 0 as c_int;
25767}
25768#[no_mangle]
25769pub unsafe extern "C" fn spIkConstraintDataArray_setSize(
25770 mut self_0: *mut spIkConstraintDataArray,
25771 mut newSize: c_int,
25772) -> *mut spIkConstraintDataArray {
25773 (*self_0).size = newSize;
25774 if (*self_0).capacity < newSize {
25775 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
25776 8 as c_int
25777 } else {
25778 ((*self_0).size as c_float * 1.75f32) as c_int
25779 };
25780 (*self_0).items = _spRealloc(
25781 (*self_0).items.cast::<c_void>(),
25782 (::core::mem::size_of::<*mut spIkConstraintData>() as c_ulong)
25783 .wrapping_mul((*self_0).capacity as c_ulong),
25784 )
25785 .cast::<*mut spIkConstraintData>();
25786 }
25787 self_0
25788}
25789#[no_mangle]
25790pub unsafe extern "C" fn spIkConstraintDataArray_ensureCapacity(
25791 mut self_0: *mut spIkConstraintDataArray,
25792 mut newCapacity: c_int,
25793) {
25794 if (*self_0).capacity >= newCapacity {
25795 return;
25796 }
25797 (*self_0).capacity = newCapacity;
25798 (*self_0).items = _spRealloc(
25799 (*self_0).items.cast::<c_void>(),
25800 (::core::mem::size_of::<*mut spIkConstraintData>() as c_ulong)
25801 .wrapping_mul((*self_0).capacity as c_ulong),
25802 )
25803 .cast::<*mut spIkConstraintData>();
25804}
25805#[no_mangle]
25806pub unsafe extern "C" fn spIkConstraintDataArray_add(
25807 mut self_0: *mut spIkConstraintDataArray,
25808 mut value: *mut spIkConstraintData,
25809) {
25810 if (*self_0).size == (*self_0).capacity {
25811 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
25812 8 as c_int
25813 } else {
25814 ((*self_0).size as c_float * 1.75f32) as c_int
25815 };
25816 (*self_0).items = _spRealloc(
25817 (*self_0).items.cast::<c_void>(),
25818 (::core::mem::size_of::<*mut spIkConstraintData>() as c_ulong)
25819 .wrapping_mul((*self_0).capacity as c_ulong),
25820 )
25821 .cast::<*mut spIkConstraintData>();
25822 }
25823 let fresh152 = (*self_0).size;
25824 (*self_0).size += 1;
25825 let fresh153 = &mut (*((*self_0).items).offset(fresh152 as isize));
25826 *fresh153 = value;
25827}
25828#[no_mangle]
25829pub unsafe extern "C" fn spIkConstraintDataArray_addAll(
25830 mut self_0: *mut spIkConstraintDataArray,
25831 mut other: *mut spIkConstraintDataArray,
25832) {
25833 let mut i: c_int = 0 as c_int;
25834 while i < (*other).size {
25835 spIkConstraintDataArray_add(self_0, *((*other).items).offset(i as isize));
25836 i += 1;
25837 }
25838}
25839#[no_mangle]
25840pub unsafe extern "C" fn spIkConstraintDataArray_addAllValues(
25841 mut self_0: *mut spIkConstraintDataArray,
25842 mut values: *mut *mut spIkConstraintData,
25843 mut offset: c_int,
25844 mut count: c_int,
25845) {
25846 let mut i: c_int = offset;
25847 let mut n: c_int = offset + count;
25848 while i < n {
25849 spIkConstraintDataArray_add(self_0, *values.offset(i as isize));
25850 i += 1;
25851 }
25852}
25853#[no_mangle]
25854pub unsafe extern "C" fn spIkConstraintDataArray_removeAt(
25855 mut self_0: *mut spIkConstraintDataArray,
25856 mut index: c_int,
25857) {
25858 (*self_0).size -= 1;
25859 spine_memmove(
25860 ((*self_0).items).offset(index as isize).cast::<c_void>(),
25861 ((*self_0).items)
25862 .offset(index as isize)
25863 .offset(1 as c_int as isize) as *const c_void,
25864 (::core::mem::size_of::<*mut spIkConstraintData>() as c_ulong)
25865 .wrapping_mul(((*self_0).size - index) as c_ulong),
25866 );
25867}
25868#[no_mangle]
25869pub unsafe extern "C" fn spIkConstraintDataArray_contains(
25870 mut self_0: *mut spIkConstraintDataArray,
25871 mut value: *mut spIkConstraintData,
25872) -> c_int {
25873 let mut items: *mut *mut spIkConstraintData = (*self_0).items;
25874 let mut i: c_int = 0;
25875 let mut n: c_int = 0;
25876 i = 0 as c_int;
25877 n = (*self_0).size;
25878 while i < n {
25879 if *items.offset(i as isize) == value {
25880 return -(1 as c_int);
25881 }
25882 i += 1;
25883 }
25884 0 as c_int
25885}
25886#[no_mangle]
25887pub unsafe extern "C" fn spIkConstraintDataArray_pop(
25888 mut self_0: *mut spIkConstraintDataArray,
25889) -> *mut spIkConstraintData {
25890 (*self_0).size -= 1;
25891 let mut item: *mut spIkConstraintData = *((*self_0).items).offset((*self_0).size as isize);
25892 item
25893}
25894#[no_mangle]
25895pub unsafe extern "C" fn spIkConstraintDataArray_peek(
25896 mut self_0: *mut spIkConstraintDataArray,
25897) -> *mut spIkConstraintData {
25898 *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize)
25899}
25900#[no_mangle]
25901pub unsafe extern "C" fn spTransformConstraintDataArray_create(
25902 mut initialCapacity: c_int,
25903) -> *mut spTransformConstraintDataArray {
25904 let mut array: *mut spTransformConstraintDataArray = _spCalloc(
25905 1 as c_int as size_t,
25906 ::core::mem::size_of::<spTransformConstraintDataArray>() as c_ulong,
25907 (b"spine.c\0" as *const u8).cast::<c_char>(),
25908 13221 as c_int,
25909 )
25910 .cast::<spTransformConstraintDataArray>();
25911 (*array).size = 0 as c_int;
25912 (*array).capacity = initialCapacity;
25913 (*array).items = _spCalloc(
25914 initialCapacity as size_t,
25915 ::core::mem::size_of::<*mut spTransformConstraintData>() as c_ulong,
25916 (b"spine.c\0" as *const u8).cast::<c_char>(),
25917 13221 as c_int,
25918 )
25919 .cast::<*mut spTransformConstraintData>();
25920 array
25921}
25922#[no_mangle]
25923pub unsafe extern "C" fn spTransformConstraintDataArray_dispose(
25924 mut self_0: *mut spTransformConstraintDataArray,
25925) {
25926 _spFree((*self_0).items.cast::<c_void>());
25927 _spFree(self_0.cast::<c_void>());
25928}
25929#[no_mangle]
25930pub unsafe extern "C" fn spTransformConstraintDataArray_clear(
25931 mut self_0: *mut spTransformConstraintDataArray,
25932) {
25933 (*self_0).size = 0 as c_int;
25934}
25935#[no_mangle]
25936pub unsafe extern "C" fn spTransformConstraintDataArray_setSize(
25937 mut self_0: *mut spTransformConstraintDataArray,
25938 mut newSize: c_int,
25939) -> *mut spTransformConstraintDataArray {
25940 (*self_0).size = newSize;
25941 if (*self_0).capacity < newSize {
25942 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
25943 8 as c_int
25944 } else {
25945 ((*self_0).size as c_float * 1.75f32) as c_int
25946 };
25947 (*self_0).items = _spRealloc(
25948 (*self_0).items.cast::<c_void>(),
25949 (::core::mem::size_of::<*mut spTransformConstraintData>() as c_ulong)
25950 .wrapping_mul((*self_0).capacity as c_ulong),
25951 )
25952 .cast::<*mut spTransformConstraintData>();
25953 }
25954 self_0
25955}
25956#[no_mangle]
25957pub unsafe extern "C" fn spTransformConstraintDataArray_ensureCapacity(
25958 mut self_0: *mut spTransformConstraintDataArray,
25959 mut newCapacity: c_int,
25960) {
25961 if (*self_0).capacity >= newCapacity {
25962 return;
25963 }
25964 (*self_0).capacity = newCapacity;
25965 (*self_0).items = _spRealloc(
25966 (*self_0).items.cast::<c_void>(),
25967 (::core::mem::size_of::<*mut spTransformConstraintData>() as c_ulong)
25968 .wrapping_mul((*self_0).capacity as c_ulong),
25969 )
25970 .cast::<*mut spTransformConstraintData>();
25971}
25972#[no_mangle]
25973pub unsafe extern "C" fn spTransformConstraintDataArray_add(
25974 mut self_0: *mut spTransformConstraintDataArray,
25975 mut value: *mut spTransformConstraintData,
25976) {
25977 if (*self_0).size == (*self_0).capacity {
25978 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
25979 8 as c_int
25980 } else {
25981 ((*self_0).size as c_float * 1.75f32) as c_int
25982 };
25983 (*self_0).items = _spRealloc(
25984 (*self_0).items.cast::<c_void>(),
25985 (::core::mem::size_of::<*mut spTransformConstraintData>() as c_ulong)
25986 .wrapping_mul((*self_0).capacity as c_ulong),
25987 )
25988 .cast::<*mut spTransformConstraintData>();
25989 }
25990 let fresh154 = (*self_0).size;
25991 (*self_0).size += 1;
25992 let fresh155 = &mut (*((*self_0).items).offset(fresh154 as isize));
25993 *fresh155 = value;
25994}
25995#[no_mangle]
25996pub unsafe extern "C" fn spTransformConstraintDataArray_addAll(
25997 mut self_0: *mut spTransformConstraintDataArray,
25998 mut other: *mut spTransformConstraintDataArray,
25999) {
26000 let mut i: c_int = 0 as c_int;
26001 while i < (*other).size {
26002 spTransformConstraintDataArray_add(self_0, *((*other).items).offset(i as isize));
26003 i += 1;
26004 }
26005}
26006#[no_mangle]
26007pub unsafe extern "C" fn spTransformConstraintDataArray_addAllValues(
26008 mut self_0: *mut spTransformConstraintDataArray,
26009 mut values: *mut *mut spTransformConstraintData,
26010 mut offset: c_int,
26011 mut count: c_int,
26012) {
26013 let mut i: c_int = offset;
26014 let mut n: c_int = offset + count;
26015 while i < n {
26016 spTransformConstraintDataArray_add(self_0, *values.offset(i as isize));
26017 i += 1;
26018 }
26019}
26020#[no_mangle]
26021pub unsafe extern "C" fn spTransformConstraintDataArray_removeAt(
26022 mut self_0: *mut spTransformConstraintDataArray,
26023 mut index: c_int,
26024) {
26025 (*self_0).size -= 1;
26026 spine_memmove(
26027 ((*self_0).items).offset(index as isize).cast::<c_void>(),
26028 ((*self_0).items)
26029 .offset(index as isize)
26030 .offset(1 as c_int as isize) as *const c_void,
26031 (::core::mem::size_of::<*mut spTransformConstraintData>() as c_ulong)
26032 .wrapping_mul(((*self_0).size - index) as c_ulong),
26033 );
26034}
26035#[no_mangle]
26036pub unsafe extern "C" fn spTransformConstraintDataArray_contains(
26037 mut self_0: *mut spTransformConstraintDataArray,
26038 mut value: *mut spTransformConstraintData,
26039) -> c_int {
26040 let mut items: *mut *mut spTransformConstraintData = (*self_0).items;
26041 let mut i: c_int = 0;
26042 let mut n: c_int = 0;
26043 i = 0 as c_int;
26044 n = (*self_0).size;
26045 while i < n {
26046 if *items.offset(i as isize) == value {
26047 return -(1 as c_int);
26048 }
26049 i += 1;
26050 }
26051 0 as c_int
26052}
26053#[no_mangle]
26054pub unsafe extern "C" fn spTransformConstraintDataArray_pop(
26055 mut self_0: *mut spTransformConstraintDataArray,
26056) -> *mut spTransformConstraintData {
26057 (*self_0).size -= 1;
26058 let mut item: *mut spTransformConstraintData =
26059 *((*self_0).items).offset((*self_0).size as isize);
26060 item
26061}
26062#[no_mangle]
26063pub unsafe extern "C" fn spTransformConstraintDataArray_peek(
26064 mut self_0: *mut spTransformConstraintDataArray,
26065) -> *mut spTransformConstraintData {
26066 *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize)
26067}
26068#[no_mangle]
26069pub unsafe extern "C" fn spPathConstraintDataArray_create(
26070 mut initialCapacity: c_int,
26071) -> *mut spPathConstraintDataArray {
26072 let mut array: *mut spPathConstraintDataArray = _spCalloc(
26073 1 as c_int as size_t,
26074 ::core::mem::size_of::<spPathConstraintDataArray>() as c_ulong,
26075 (b"spine.c\0" as *const u8).cast::<c_char>(),
26076 13223 as c_int,
26077 )
26078 .cast::<spPathConstraintDataArray>();
26079 (*array).size = 0 as c_int;
26080 (*array).capacity = initialCapacity;
26081 (*array).items = _spCalloc(
26082 initialCapacity as size_t,
26083 ::core::mem::size_of::<*mut spPathConstraintData>() as c_ulong,
26084 (b"spine.c\0" as *const u8).cast::<c_char>(),
26085 13223 as c_int,
26086 )
26087 .cast::<*mut spPathConstraintData>();
26088 array
26089}
26090#[no_mangle]
26091pub unsafe extern "C" fn spPathConstraintDataArray_dispose(
26092 mut self_0: *mut spPathConstraintDataArray,
26093) {
26094 _spFree((*self_0).items.cast::<c_void>());
26095 _spFree(self_0.cast::<c_void>());
26096}
26097#[no_mangle]
26098pub unsafe extern "C" fn spPathConstraintDataArray_clear(
26099 mut self_0: *mut spPathConstraintDataArray,
26100) {
26101 (*self_0).size = 0 as c_int;
26102}
26103#[no_mangle]
26104pub unsafe extern "C" fn spPathConstraintDataArray_setSize(
26105 mut self_0: *mut spPathConstraintDataArray,
26106 mut newSize: c_int,
26107) -> *mut spPathConstraintDataArray {
26108 (*self_0).size = newSize;
26109 if (*self_0).capacity < newSize {
26110 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
26111 8 as c_int
26112 } else {
26113 ((*self_0).size as c_float * 1.75f32) as c_int
26114 };
26115 (*self_0).items = _spRealloc(
26116 (*self_0).items.cast::<c_void>(),
26117 (::core::mem::size_of::<*mut spPathConstraintData>() as c_ulong)
26118 .wrapping_mul((*self_0).capacity as c_ulong),
26119 )
26120 .cast::<*mut spPathConstraintData>();
26121 }
26122 self_0
26123}
26124#[no_mangle]
26125pub unsafe extern "C" fn spPathConstraintDataArray_ensureCapacity(
26126 mut self_0: *mut spPathConstraintDataArray,
26127 mut newCapacity: c_int,
26128) {
26129 if (*self_0).capacity >= newCapacity {
26130 return;
26131 }
26132 (*self_0).capacity = newCapacity;
26133 (*self_0).items = _spRealloc(
26134 (*self_0).items.cast::<c_void>(),
26135 (::core::mem::size_of::<*mut spPathConstraintData>() as c_ulong)
26136 .wrapping_mul((*self_0).capacity as c_ulong),
26137 )
26138 .cast::<*mut spPathConstraintData>();
26139}
26140#[no_mangle]
26141pub unsafe extern "C" fn spPathConstraintDataArray_add(
26142 mut self_0: *mut spPathConstraintDataArray,
26143 mut value: *mut spPathConstraintData,
26144) {
26145 if (*self_0).size == (*self_0).capacity {
26146 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
26147 8 as c_int
26148 } else {
26149 ((*self_0).size as c_float * 1.75f32) as c_int
26150 };
26151 (*self_0).items = _spRealloc(
26152 (*self_0).items.cast::<c_void>(),
26153 (::core::mem::size_of::<*mut spPathConstraintData>() as c_ulong)
26154 .wrapping_mul((*self_0).capacity as c_ulong),
26155 )
26156 .cast::<*mut spPathConstraintData>();
26157 }
26158 let fresh156 = (*self_0).size;
26159 (*self_0).size += 1;
26160 let fresh157 = &mut (*((*self_0).items).offset(fresh156 as isize));
26161 *fresh157 = value;
26162}
26163#[no_mangle]
26164pub unsafe extern "C" fn spPathConstraintDataArray_addAll(
26165 mut self_0: *mut spPathConstraintDataArray,
26166 mut other: *mut spPathConstraintDataArray,
26167) {
26168 let mut i: c_int = 0 as c_int;
26169 while i < (*other).size {
26170 spPathConstraintDataArray_add(self_0, *((*other).items).offset(i as isize));
26171 i += 1;
26172 }
26173}
26174#[no_mangle]
26175pub unsafe extern "C" fn spPathConstraintDataArray_addAllValues(
26176 mut self_0: *mut spPathConstraintDataArray,
26177 mut values: *mut *mut spPathConstraintData,
26178 mut offset: c_int,
26179 mut count: c_int,
26180) {
26181 let mut i: c_int = offset;
26182 let mut n: c_int = offset + count;
26183 while i < n {
26184 spPathConstraintDataArray_add(self_0, *values.offset(i as isize));
26185 i += 1;
26186 }
26187}
26188#[no_mangle]
26189pub unsafe extern "C" fn spPathConstraintDataArray_removeAt(
26190 mut self_0: *mut spPathConstraintDataArray,
26191 mut index: c_int,
26192) {
26193 (*self_0).size -= 1;
26194 spine_memmove(
26195 ((*self_0).items).offset(index as isize).cast::<c_void>(),
26196 ((*self_0).items)
26197 .offset(index as isize)
26198 .offset(1 as c_int as isize) as *const c_void,
26199 (::core::mem::size_of::<*mut spPathConstraintData>() as c_ulong)
26200 .wrapping_mul(((*self_0).size - index) as c_ulong),
26201 );
26202}
26203#[no_mangle]
26204pub unsafe extern "C" fn spPathConstraintDataArray_contains(
26205 mut self_0: *mut spPathConstraintDataArray,
26206 mut value: *mut spPathConstraintData,
26207) -> c_int {
26208 let mut items: *mut *mut spPathConstraintData = (*self_0).items;
26209 let mut i: c_int = 0;
26210 let mut n: c_int = 0;
26211 i = 0 as c_int;
26212 n = (*self_0).size;
26213 while i < n {
26214 if *items.offset(i as isize) == value {
26215 return -(1 as c_int);
26216 }
26217 i += 1;
26218 }
26219 0 as c_int
26220}
26221#[no_mangle]
26222pub unsafe extern "C" fn spPathConstraintDataArray_pop(
26223 mut self_0: *mut spPathConstraintDataArray,
26224) -> *mut spPathConstraintData {
26225 (*self_0).size -= 1;
26226 let mut item: *mut spPathConstraintData = *((*self_0).items).offset((*self_0).size as isize);
26227 item
26228}
26229#[no_mangle]
26230pub unsafe extern "C" fn spPathConstraintDataArray_peek(
26231 mut self_0: *mut spPathConstraintDataArray,
26232) -> *mut spPathConstraintData {
26233 *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize)
26234}
26235#[no_mangle]
26236pub unsafe extern "C" fn spPhysicsConstraintDataArray_create(
26237 mut initialCapacity: c_int,
26238) -> *mut spPhysicsConstraintDataArray {
26239 let mut array: *mut spPhysicsConstraintDataArray = _spCalloc(
26240 1 as c_int as size_t,
26241 ::core::mem::size_of::<spPhysicsConstraintDataArray>() as c_ulong,
26242 (b"spine.c\0" as *const u8).cast::<c_char>(),
26243 13225 as c_int,
26244 )
26245 .cast::<spPhysicsConstraintDataArray>();
26246 (*array).size = 0 as c_int;
26247 (*array).capacity = initialCapacity;
26248 (*array).items = _spCalloc(
26249 initialCapacity as size_t,
26250 ::core::mem::size_of::<*mut spPhysicsConstraintData>() as c_ulong,
26251 (b"spine.c\0" as *const u8).cast::<c_char>(),
26252 13225 as c_int,
26253 )
26254 .cast::<*mut spPhysicsConstraintData>();
26255 array
26256}
26257#[no_mangle]
26258pub unsafe extern "C" fn spPhysicsConstraintDataArray_dispose(
26259 mut self_0: *mut spPhysicsConstraintDataArray,
26260) {
26261 _spFree((*self_0).items.cast::<c_void>());
26262 _spFree(self_0.cast::<c_void>());
26263}
26264#[no_mangle]
26265pub unsafe extern "C" fn spPhysicsConstraintDataArray_clear(
26266 mut self_0: *mut spPhysicsConstraintDataArray,
26267) {
26268 (*self_0).size = 0 as c_int;
26269}
26270#[no_mangle]
26271pub unsafe extern "C" fn spPhysicsConstraintDataArray_setSize(
26272 mut self_0: *mut spPhysicsConstraintDataArray,
26273 mut newSize: c_int,
26274) -> *mut spPhysicsConstraintDataArray {
26275 (*self_0).size = newSize;
26276 if (*self_0).capacity < newSize {
26277 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
26278 8 as c_int
26279 } else {
26280 ((*self_0).size as c_float * 1.75f32) as c_int
26281 };
26282 (*self_0).items = _spRealloc(
26283 (*self_0).items.cast::<c_void>(),
26284 (::core::mem::size_of::<*mut spPhysicsConstraintData>() as c_ulong)
26285 .wrapping_mul((*self_0).capacity as c_ulong),
26286 )
26287 .cast::<*mut spPhysicsConstraintData>();
26288 }
26289 self_0
26290}
26291#[no_mangle]
26292pub unsafe extern "C" fn spPhysicsConstraintDataArray_ensureCapacity(
26293 mut self_0: *mut spPhysicsConstraintDataArray,
26294 mut newCapacity: c_int,
26295) {
26296 if (*self_0).capacity >= newCapacity {
26297 return;
26298 }
26299 (*self_0).capacity = newCapacity;
26300 (*self_0).items = _spRealloc(
26301 (*self_0).items.cast::<c_void>(),
26302 (::core::mem::size_of::<*mut spPhysicsConstraintData>() as c_ulong)
26303 .wrapping_mul((*self_0).capacity as c_ulong),
26304 )
26305 .cast::<*mut spPhysicsConstraintData>();
26306}
26307#[no_mangle]
26308pub unsafe extern "C" fn spPhysicsConstraintDataArray_add(
26309 mut self_0: *mut spPhysicsConstraintDataArray,
26310 mut value: *mut spPhysicsConstraintData,
26311) {
26312 if (*self_0).size == (*self_0).capacity {
26313 (*self_0).capacity = if 8 as c_int > ((*self_0).size as c_float * 1.75f32) as c_int {
26314 8 as c_int
26315 } else {
26316 ((*self_0).size as c_float * 1.75f32) as c_int
26317 };
26318 (*self_0).items = _spRealloc(
26319 (*self_0).items.cast::<c_void>(),
26320 (::core::mem::size_of::<*mut spPhysicsConstraintData>() as c_ulong)
26321 .wrapping_mul((*self_0).capacity as c_ulong),
26322 )
26323 .cast::<*mut spPhysicsConstraintData>();
26324 }
26325 let fresh158 = (*self_0).size;
26326 (*self_0).size += 1;
26327 let fresh159 = &mut (*((*self_0).items).offset(fresh158 as isize));
26328 *fresh159 = value;
26329}
26330#[no_mangle]
26331pub unsafe extern "C" fn spPhysicsConstraintDataArray_addAll(
26332 mut self_0: *mut spPhysicsConstraintDataArray,
26333 mut other: *mut spPhysicsConstraintDataArray,
26334) {
26335 let mut i: c_int = 0 as c_int;
26336 while i < (*other).size {
26337 spPhysicsConstraintDataArray_add(self_0, *((*other).items).offset(i as isize));
26338 i += 1;
26339 }
26340}
26341#[no_mangle]
26342pub unsafe extern "C" fn spPhysicsConstraintDataArray_addAllValues(
26343 mut self_0: *mut spPhysicsConstraintDataArray,
26344 mut values: *mut *mut spPhysicsConstraintData,
26345 mut offset: c_int,
26346 mut count: c_int,
26347) {
26348 let mut i: c_int = offset;
26349 let mut n: c_int = offset + count;
26350 while i < n {
26351 spPhysicsConstraintDataArray_add(self_0, *values.offset(i as isize));
26352 i += 1;
26353 }
26354}
26355#[no_mangle]
26356pub unsafe extern "C" fn spPhysicsConstraintDataArray_removeAt(
26357 mut self_0: *mut spPhysicsConstraintDataArray,
26358 mut index: c_int,
26359) {
26360 (*self_0).size -= 1;
26361 spine_memmove(
26362 ((*self_0).items).offset(index as isize).cast::<c_void>(),
26363 ((*self_0).items)
26364 .offset(index as isize)
26365 .offset(1 as c_int as isize) as *const c_void,
26366 (::core::mem::size_of::<*mut spPhysicsConstraintData>() as c_ulong)
26367 .wrapping_mul(((*self_0).size - index) as c_ulong),
26368 );
26369}
26370#[no_mangle]
26371pub unsafe extern "C" fn spPhysicsConstraintDataArray_contains(
26372 mut self_0: *mut spPhysicsConstraintDataArray,
26373 mut value: *mut spPhysicsConstraintData,
26374) -> c_int {
26375 let mut items: *mut *mut spPhysicsConstraintData = (*self_0).items;
26376 let mut i: c_int = 0;
26377 let mut n: c_int = 0;
26378 i = 0 as c_int;
26379 n = (*self_0).size;
26380 while i < n {
26381 if *items.offset(i as isize) == value {
26382 return -(1 as c_int);
26383 }
26384 i += 1;
26385 }
26386 0 as c_int
26387}
26388#[no_mangle]
26389pub unsafe extern "C" fn spPhysicsConstraintDataArray_pop(
26390 mut self_0: *mut spPhysicsConstraintDataArray,
26391) -> *mut spPhysicsConstraintData {
26392 (*self_0).size -= 1;
26393 let mut item: *mut spPhysicsConstraintData = *((*self_0).items).offset((*self_0).size as isize);
26394 item
26395}
26396#[no_mangle]
26397pub unsafe extern "C" fn spPhysicsConstraintDataArray_peek(
26398 mut self_0: *mut spPhysicsConstraintDataArray,
26399) -> *mut spPhysicsConstraintData {
26400 *((*self_0).items).offset(((*self_0).size - 1 as c_int) as isize)
26401}
26402#[no_mangle]
26403pub unsafe extern "C" fn _Entry_create(
26404 mut slotIndex: c_int,
26405 mut name: *const c_char,
26406 mut attachment: *mut spAttachment,
26407) -> *mut _Entry {
26408 let mut self_0: *mut _Entry = _spCalloc(
26409 1 as c_int as size_t,
26410 ::core::mem::size_of::<_Entry>() as c_ulong,
26411 (b"spine.c\0" as *const u8).cast::<c_char>(),
26412 13228 as c_int,
26413 )
26414 .cast::<_Entry>();
26415 (*self_0).slotIndex = slotIndex;
26416 (*self_0).name = _spMalloc(
26417 (::core::mem::size_of::<c_char>() as c_ulong)
26418 .wrapping_mul((spine_strlen(name.cast_mut())).wrapping_add(1 as c_int as c_ulong)),
26419 (b"spine.c\0" as *const u8).cast::<c_char>(),
26420 13230 as c_int,
26421 )
26422 .cast::<c_char>();
26423 spine_strcpy((*self_0).name, name.cast_mut());
26424 (*self_0).attachment = attachment;
26425 self_0
26426}
26427#[no_mangle]
26428pub unsafe extern "C" fn _Entry_dispose(mut self_0: *mut _Entry) {
26429 spAttachment_dispose((*self_0).attachment);
26430 _spFree((*self_0).name.cast::<c_void>());
26431 _spFree(self_0.cast::<c_void>());
26432}
26433unsafe extern "C" fn _SkinHashTableEntry_create(
26434 mut entry: *mut _Entry,
26435) -> *mut _SkinHashTableEntry {
26436 let mut self_0: *mut _SkinHashTableEntry = _spCalloc(
26437 1 as c_int as size_t,
26438 ::core::mem::size_of::<_SkinHashTableEntry>() as c_ulong,
26439 (b"spine.c\0" as *const u8).cast::<c_char>(),
26440 13242 as c_int,
26441 )
26442 .cast::<_SkinHashTableEntry>();
26443 (*self_0).entry = entry;
26444 self_0
26445}
26446unsafe extern "C" fn _SkinHashTableEntry_dispose(mut self_0: *mut _SkinHashTableEntry) {
26447 _spFree(self_0.cast::<c_void>());
26448}
26449#[no_mangle]
26450pub unsafe extern "C" fn spSkin_create(mut name: *const c_char) -> *mut spSkin {
26451 let mut self_0: *mut spSkin = &mut (*(_spCalloc
26452 as unsafe extern "C" fn(size_t, size_t, *const c_char, c_int) -> *mut c_void)(
26453 1 as c_int as size_t,
26454 ::core::mem::size_of::<_spSkin>() as c_ulong,
26455 (b"spine.c\0" as *const u8).cast::<c_char>(),
26456 13254 as c_int,
26457 )
26458 .cast::<_spSkin>())
26459 .super_0;
26460 (*self_0).name = _spMalloc(
26461 (::core::mem::size_of::<c_char>() as c_ulong)
26462 .wrapping_mul((spine_strlen(name.cast_mut())).wrapping_add(1 as c_int as c_ulong)),
26463 (b"spine.c\0" as *const u8).cast::<c_char>(),
26464 13255 as c_int,
26465 )
26466 .cast::<c_char>();
26467 spine_strcpy((*self_0).name, name.cast_mut());
26468 (*self_0).bones = spBoneDataArray_create(4 as c_int);
26469 (*self_0).ikConstraints = spIkConstraintDataArray_create(4 as c_int);
26470 (*self_0).transformConstraints = spTransformConstraintDataArray_create(4 as c_int);
26471 (*self_0).pathConstraints = spPathConstraintDataArray_create(4 as c_int);
26472 (*self_0).physicsConstraints = spPhysicsConstraintDataArray_create(4 as c_int);
26473 spColor_setFromFloats(
26474 &mut (*self_0).color,
26475 0.99607843f32,
26476 0.61960787f32,
26477 0.30980393f32,
26478 1 as c_int as c_float,
26479 );
26480 self_0
26481}
26482#[no_mangle]
26483pub unsafe extern "C" fn spSkin_dispose(mut self_0: *mut spSkin) {
26484 let mut entry: *mut _Entry = (*self_0.cast::<_spSkin>()).entries;
26485 while !entry.is_null() {
26486 let mut nextEntry: *mut _Entry = (*entry).next;
26487 _Entry_dispose(entry);
26488 entry = nextEntry;
26489 }
26490 let mut currentHashtableEntry: *mut *mut _SkinHashTableEntry =
26491 ((*self_0.cast::<_spSkin>()).entriesHashTable).as_mut_ptr();
26492 let mut i: c_int = 0;
26493 i = 0 as c_int;
26494 while i < 100 as c_int {
26495 let mut hashtableEntry: *mut _SkinHashTableEntry = *currentHashtableEntry;
26496 while !hashtableEntry.is_null() {
26497 let mut nextEntry_0: *mut _SkinHashTableEntry = (*hashtableEntry).next;
26498 _SkinHashTableEntry_dispose(hashtableEntry);
26499 hashtableEntry = nextEntry_0;
26500 }
26501 i += 1;
26502 currentHashtableEntry = currentHashtableEntry.offset(1);
26503 }
26504 spBoneDataArray_dispose((*self_0).bones);
26505 spIkConstraintDataArray_dispose((*self_0).ikConstraints);
26506 spTransformConstraintDataArray_dispose((*self_0).transformConstraints);
26507 spPathConstraintDataArray_dispose((*self_0).pathConstraints);
26508 spPhysicsConstraintDataArray_dispose((*self_0).physicsConstraints);
26509 _spFree((*self_0).name.cast::<c_void>());
26510 _spFree(self_0.cast::<c_void>());
26511}
26512#[no_mangle]
26513pub unsafe extern "C" fn spSkin_setAttachment(
26514 mut self_0: *mut spSkin,
26515 mut slotIndex: c_int,
26516 mut name: *const c_char,
26517 mut attachment: *mut spAttachment,
26518) {
26519 let mut existingEntry: *mut _SkinHashTableEntry = std::ptr::null_mut::<_SkinHashTableEntry>();
26520 let mut hashEntry: *mut _SkinHashTableEntry = (*self_0.cast::<_spSkin>()).entriesHashTable
26521 [(slotIndex as c_uint).wrapping_rem(100 as c_int as c_uint) as usize];
26522 while !hashEntry.is_null() {
26523 if (*(*hashEntry).entry).slotIndex == slotIndex
26524 && spine_strcmp((*(*hashEntry).entry).name, name) == 0 as c_int
26525 {
26526 existingEntry = hashEntry;
26527 break;
26528 } else {
26529 hashEntry = (*hashEntry).next;
26530 }
26531 }
26532 if !attachment.is_null() {
26533 (*attachment).refCount += 1;
26534 }
26535 if !existingEntry.is_null() {
26536 if !((*(*hashEntry).entry).attachment).is_null() {
26537 spAttachment_dispose((*(*hashEntry).entry).attachment);
26538 }
26539 (*(*hashEntry).entry).attachment = attachment;
26540 } else {
26541 let mut newEntry: *mut _Entry = _Entry_create(slotIndex, name, attachment);
26542 (*newEntry).next = (*self_0.cast::<_spSkin>()).entries;
26543 let fresh160 = &mut (*self_0.cast::<_spSkin>()).entries;
26544 *fresh160 = newEntry;
26545 let mut hashTableIndex: c_uint = (slotIndex as c_uint).wrapping_rem(100 as c_int as c_uint);
26546 let mut hashTable: *mut *mut _SkinHashTableEntry =
26547 ((*self_0.cast::<_spSkin>()).entriesHashTable).as_mut_ptr();
26548 let mut newHashEntry: *mut _SkinHashTableEntry = _SkinHashTableEntry_create(newEntry);
26549 (*newHashEntry).next = *hashTable.offset(hashTableIndex as isize);
26550 let fresh161 = &mut (*self_0.cast::<_spSkin>()).entriesHashTable[hashTableIndex as usize];
26551 *fresh161 = newHashEntry;
26552 };
26553}
26554#[no_mangle]
26555pub unsafe extern "C" fn spSkin_getAttachment(
26556 mut self_0: *const spSkin,
26557 mut slotIndex: c_int,
26558 mut name: *const c_char,
26559) -> *mut spAttachment {
26560 let mut hashEntry: *const _SkinHashTableEntry = (*(self_0 as *mut _spSkin)).entriesHashTable
26561 [(slotIndex as c_uint).wrapping_rem(100 as c_int as c_uint) as usize];
26562 while !hashEntry.is_null() {
26563 if (*(*hashEntry).entry).slotIndex == slotIndex
26564 && spine_strcmp((*(*hashEntry).entry).name, name) == 0 as c_int
26565 {
26566 return (*(*hashEntry).entry).attachment;
26567 }
26568 hashEntry = (*hashEntry).next;
26569 }
26570 std::ptr::null_mut::<spAttachment>()
26571}
26572#[no_mangle]
26573pub unsafe extern "C" fn spSkin_getAttachmentName(
26574 mut self_0: *const spSkin,
26575 mut slotIndex: c_int,
26576 mut attachmentIndex: c_int,
26577) -> *const c_char {
26578 let mut entry: *const _Entry = (*(self_0 as *mut _spSkin)).entries;
26579 let mut i: c_int = 0 as c_int;
26580 while !entry.is_null() {
26581 if (*entry).slotIndex == slotIndex {
26582 if i == attachmentIndex {
26583 return (*entry).name;
26584 }
26585 i += 1;
26586 }
26587 entry = (*entry).next;
26588 }
26589 std::ptr::null::<c_char>()
26590}
26591#[no_mangle]
26592pub unsafe extern "C" fn spSkin_attachAll(
26593 mut self_0: *const spSkin,
26594 mut skeleton: *mut spSkeleton,
26595 mut oldSkin: *const spSkin,
26596) {
26597 let mut entry: *const _Entry = (*(oldSkin as *mut _spSkin)).entries;
26598 while !entry.is_null() {
26599 let mut slot: *mut spSlot = *((*skeleton).slots).offset((*entry).slotIndex as isize);
26600 if (*slot).attachment == (*entry).attachment {
26601 let mut attachment: *mut spAttachment =
26602 spSkin_getAttachment(self_0, (*entry).slotIndex, (*entry).name);
26603 if !attachment.is_null() {
26604 spSlot_setAttachment(slot, attachment);
26605 }
26606 }
26607 entry = (*entry).next;
26608 }
26609}
26610#[no_mangle]
26611pub unsafe extern "C" fn spSkin_addSkin(mut self_0: *mut spSkin, mut other: *const spSkin) {
26612 let mut i: c_int = 0 as c_int;
26613 let mut entry: *mut spSkinEntry = std::ptr::null_mut::<spSkinEntry>();
26614 i = 0 as c_int;
26615 while i < (*(*other).bones).size {
26616 if spBoneDataArray_contains(
26617 (*self_0).bones,
26618 *((*(*other).bones).items).offset(i as isize),
26619 ) == 0
26620 {
26621 spBoneDataArray_add(
26622 (*self_0).bones,
26623 *((*(*other).bones).items).offset(i as isize),
26624 );
26625 }
26626 i += 1;
26627 }
26628 i = 0 as c_int;
26629 while i < (*(*other).ikConstraints).size {
26630 if spIkConstraintDataArray_contains(
26631 (*self_0).ikConstraints,
26632 *((*(*other).ikConstraints).items).offset(i as isize),
26633 ) == 0
26634 {
26635 spIkConstraintDataArray_add(
26636 (*self_0).ikConstraints,
26637 *((*(*other).ikConstraints).items).offset(i as isize),
26638 );
26639 }
26640 i += 1;
26641 }
26642 i = 0 as c_int;
26643 while i < (*(*other).transformConstraints).size {
26644 if spTransformConstraintDataArray_contains(
26645 (*self_0).transformConstraints,
26646 *((*(*other).transformConstraints).items).offset(i as isize),
26647 ) == 0
26648 {
26649 spTransformConstraintDataArray_add(
26650 (*self_0).transformConstraints,
26651 *((*(*other).transformConstraints).items).offset(i as isize),
26652 );
26653 }
26654 i += 1;
26655 }
26656 i = 0 as c_int;
26657 while i < (*(*other).pathConstraints).size {
26658 if spPathConstraintDataArray_contains(
26659 (*self_0).pathConstraints,
26660 *((*(*other).pathConstraints).items).offset(i as isize),
26661 ) == 0
26662 {
26663 spPathConstraintDataArray_add(
26664 (*self_0).pathConstraints,
26665 *((*(*other).pathConstraints).items).offset(i as isize),
26666 );
26667 }
26668 i += 1;
26669 }
26670 i = 0 as c_int;
26671 while i < (*(*other).physicsConstraints).size {
26672 if spPhysicsConstraintDataArray_contains(
26673 (*self_0).physicsConstraints,
26674 *((*(*other).physicsConstraints).items).offset(i as isize),
26675 ) == 0
26676 {
26677 spPhysicsConstraintDataArray_add(
26678 (*self_0).physicsConstraints,
26679 *((*(*other).physicsConstraints).items).offset(i as isize),
26680 );
26681 }
26682 i += 1;
26683 }
26684 entry = spSkin_getAttachments(other);
26685 while !entry.is_null() {
26686 spSkin_setAttachment(
26687 self_0,
26688 (*entry).slotIndex,
26689 (*entry).name,
26690 (*entry).attachment,
26691 );
26692 entry = (*entry).next;
26693 }
26694}
26695#[no_mangle]
26696pub unsafe extern "C" fn spSkin_copySkin(mut self_0: *mut spSkin, mut other: *const spSkin) {
26697 let mut i: c_int = 0 as c_int;
26698 let mut entry: *mut spSkinEntry = std::ptr::null_mut::<spSkinEntry>();
26699 i = 0 as c_int;
26700 while i < (*(*other).bones).size {
26701 if spBoneDataArray_contains(
26702 (*self_0).bones,
26703 *((*(*other).bones).items).offset(i as isize),
26704 ) == 0
26705 {
26706 spBoneDataArray_add(
26707 (*self_0).bones,
26708 *((*(*other).bones).items).offset(i as isize),
26709 );
26710 }
26711 i += 1;
26712 }
26713 i = 0 as c_int;
26714 while i < (*(*other).ikConstraints).size {
26715 if spIkConstraintDataArray_contains(
26716 (*self_0).ikConstraints,
26717 *((*(*other).ikConstraints).items).offset(i as isize),
26718 ) == 0
26719 {
26720 spIkConstraintDataArray_add(
26721 (*self_0).ikConstraints,
26722 *((*(*other).ikConstraints).items).offset(i as isize),
26723 );
26724 }
26725 i += 1;
26726 }
26727 i = 0 as c_int;
26728 while i < (*(*other).transformConstraints).size {
26729 if spTransformConstraintDataArray_contains(
26730 (*self_0).transformConstraints,
26731 *((*(*other).transformConstraints).items).offset(i as isize),
26732 ) == 0
26733 {
26734 spTransformConstraintDataArray_add(
26735 (*self_0).transformConstraints,
26736 *((*(*other).transformConstraints).items).offset(i as isize),
26737 );
26738 }
26739 i += 1;
26740 }
26741 i = 0 as c_int;
26742 while i < (*(*other).pathConstraints).size {
26743 if spPathConstraintDataArray_contains(
26744 (*self_0).pathConstraints,
26745 *((*(*other).pathConstraints).items).offset(i as isize),
26746 ) == 0
26747 {
26748 spPathConstraintDataArray_add(
26749 (*self_0).pathConstraints,
26750 *((*(*other).pathConstraints).items).offset(i as isize),
26751 );
26752 }
26753 i += 1;
26754 }
26755 i = 0 as c_int;
26756 while i < (*(*other).physicsConstraints).size {
26757 if spPhysicsConstraintDataArray_contains(
26758 (*self_0).physicsConstraints,
26759 *((*(*other).physicsConstraints).items).offset(i as isize),
26760 ) == 0
26761 {
26762 spPhysicsConstraintDataArray_add(
26763 (*self_0).physicsConstraints,
26764 *((*(*other).physicsConstraints).items).offset(i as isize),
26765 );
26766 }
26767 i += 1;
26768 }
26769 entry = spSkin_getAttachments(other);
26770 while !entry.is_null() {
26771 if (*(*entry).attachment).type_0 as c_uint == SP_ATTACHMENT_MESH as c_int as c_uint {
26772 let mut attachment: *mut spMeshAttachment =
26773 spMeshAttachment_newLinkedMesh((*entry).attachment.cast::<spMeshAttachment>());
26774 spSkin_setAttachment(
26775 self_0,
26776 (*entry).slotIndex,
26777 (*entry).name,
26778 &mut (*attachment).super_0.super_0,
26779 );
26780 } else {
26781 let mut attachment_0: *mut spAttachment = if !((*entry).attachment).is_null() {
26782 spAttachment_copy((*entry).attachment)
26783 } else {
26784 std::ptr::null_mut::<spAttachment>()
26785 };
26786 spSkin_setAttachment(self_0, (*entry).slotIndex, (*entry).name, attachment_0);
26787 }
26788 entry = (*entry).next;
26789 }
26790}
26791#[no_mangle]
26792pub unsafe extern "C" fn spSkin_getAttachments(mut self_0: *const spSkin) -> *mut spSkinEntry {
26793 (*(self_0 as *mut _spSkin)).entries
26794}
26795#[no_mangle]
26796pub unsafe extern "C" fn spSkin_clear(mut self_0: *mut spSkin) {
26797 let mut entry: *mut _Entry = (*self_0.cast::<_spSkin>()).entries;
26798 while !entry.is_null() {
26799 let mut nextEntry: *mut _Entry = (*entry).next;
26800 _Entry_dispose(entry);
26801 entry = nextEntry;
26802 }
26803 let fresh162 = &mut (*self_0.cast::<_spSkin>()).entries;
26804 *fresh162 = std::ptr::null_mut::<_Entry>();
26805 let mut currentHashtableEntry: *mut *mut _SkinHashTableEntry =
26806 ((*self_0.cast::<_spSkin>()).entriesHashTable).as_mut_ptr();
26807 let mut i: c_int = 0;
26808 i = 0 as c_int;
26809 while i < 100 as c_int {
26810 let mut hashtableEntry: *mut _SkinHashTableEntry = *currentHashtableEntry;
26811 while !hashtableEntry.is_null() {
26812 let mut nextEntry_0: *mut _SkinHashTableEntry = (*hashtableEntry).next;
26813 _SkinHashTableEntry_dispose(hashtableEntry);
26814 hashtableEntry = nextEntry_0;
26815 }
26816 let fresh163 = &mut (*self_0.cast::<_spSkin>()).entriesHashTable[i as usize];
26817 *fresh163 = std::ptr::null_mut::<_SkinHashTableEntry>();
26818 i += 1;
26819 currentHashtableEntry = currentHashtableEntry.offset(1);
26820 }
26821 spBoneDataArray_clear((*self_0).bones);
26822 spIkConstraintDataArray_clear((*self_0).ikConstraints);
26823 spTransformConstraintDataArray_clear((*self_0).transformConstraints);
26824 spPathConstraintDataArray_clear((*self_0).pathConstraints);
26825 spPhysicsConstraintDataArray_clear((*self_0).physicsConstraints);
26826}
26827#[no_mangle]
26828pub unsafe extern "C" fn spSlot_create(
26829 mut data: *mut spSlotData,
26830 mut bone: *mut spBone,
26831) -> *mut spSlot {
26832 let mut self_0: *mut spSlot = _spCalloc(
26833 1 as c_int as size_t,
26834 ::core::mem::size_of::<spSlot>() as c_ulong,
26835 (b"spine.c\0" as *const u8).cast::<c_char>(),
26836 13514 as c_int,
26837 )
26838 .cast::<spSlot>();
26839 (*self_0).data = data;
26840 (*self_0).bone = bone;
26841 spColor_setFromFloats(
26842 &mut (*self_0).color,
26843 1 as c_int as c_float,
26844 1 as c_int as c_float,
26845 1 as c_int as c_float,
26846 1 as c_int as c_float,
26847 );
26848 (*self_0).darkColor = if ((*data).darkColor).is_null() {
26849 std::ptr::null_mut::<spColor>()
26850 } else {
26851 spColor_create()
26852 };
26853 spSlot_setToSetupPose(self_0);
26854 self_0
26855}
26856#[no_mangle]
26857pub unsafe extern "C" fn spSlot_dispose(mut self_0: *mut spSlot) {
26858 _spFree((*self_0).deform.cast::<c_void>());
26859 _spFree((*self_0).darkColor.cast::<c_void>());
26860 _spFree(self_0.cast::<c_void>());
26861}
26862unsafe extern "C" fn isVertexAttachment(mut attachment: *mut spAttachment) -> c_int {
26863 if attachment.is_null() {
26864 return 0 as c_int;
26865 }
26866 match (*attachment).type_0 as c_uint {
26867 1 | 6 | 2 | 4 => -(1 as c_int),
26868 _ => 0 as c_int,
26869 }
26870}
26871#[no_mangle]
26872pub unsafe extern "C" fn spSlot_setAttachment(
26873 mut self_0: *mut spSlot,
26874 mut attachment: *mut spAttachment,
26875) {
26876 if attachment == (*self_0).attachment {
26877 return;
26878 }
26879 if isVertexAttachment(attachment) == 0
26880 || isVertexAttachment((*self_0).attachment) == 0
26881 || (*attachment.cast::<spVertexAttachment>()).timelineAttachment
26882 != (*(*self_0).attachment.cast::<spVertexAttachment>()).timelineAttachment
26883 {
26884 (*self_0).deformCount = 0 as c_int;
26885 }
26886 (*self_0).attachment = attachment;
26887 (*self_0).sequenceIndex = -(1 as c_int);
26888}
26889#[no_mangle]
26890pub unsafe extern "C" fn spSlot_setToSetupPose(mut self_0: *mut spSlot) {
26891 spColor_setFromColor(&mut (*self_0).color, &mut (*(*self_0).data).color);
26892 if !((*self_0).darkColor).is_null() {
26893 spColor_setFromColor((*self_0).darkColor, (*(*self_0).data).darkColor);
26894 }
26895 if ((*(*self_0).data).attachmentName).is_null() {
26896 spSlot_setAttachment(self_0, std::ptr::null_mut::<spAttachment>());
26897 } else {
26898 let mut attachment: *mut spAttachment = spSkeleton_getAttachmentForSlotIndex(
26899 (*(*self_0).bone).skeleton,
26900 (*(*self_0).data).index,
26901 (*(*self_0).data).attachmentName,
26902 );
26903 (*self_0).attachment = std::ptr::null_mut::<spAttachment>();
26904 spSlot_setAttachment(self_0, attachment);
26905 };
26906}
26907#[no_mangle]
26908pub unsafe extern "C" fn spSlotData_create(
26909 index: c_int,
26910 mut name: *const c_char,
26911 mut boneData: *mut spBoneData,
26912) -> *mut spSlotData {
26913 let mut self_0: *mut spSlotData = _spCalloc(
26914 1 as c_int as size_t,
26915 ::core::mem::size_of::<spSlotData>() as c_ulong,
26916 (b"spine.c\0" as *const u8).cast::<c_char>(),
26917 13600 as c_int,
26918 )
26919 .cast::<spSlotData>();
26920 (*self_0).index = index;
26921 (*self_0).name = _spMalloc(
26922 (::core::mem::size_of::<c_char>() as c_ulong)
26923 .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)),
26924 (b"spine.c\0" as *const u8).cast::<c_char>(),
26925 13602 as c_int,
26926 )
26927 .cast::<c_char>();
26928 spine_strcpy((*self_0).name, name);
26929 (*self_0).boneData = boneData;
26930 spColor_setFromFloats(
26931 &mut (*self_0).color,
26932 1 as c_int as c_float,
26933 1 as c_int as c_float,
26934 1 as c_int as c_float,
26935 1 as c_int as c_float,
26936 );
26937 (*self_0).visible = -(1 as c_int);
26938 self_0
26939}
26940#[no_mangle]
26941pub unsafe extern "C" fn spSlotData_dispose(mut self_0: *mut spSlotData) {
26942 _spFree((*self_0).name.cast::<c_void>());
26943 _spFree((*self_0).attachmentName.cast::<c_void>());
26944 _spFree((*self_0).darkColor.cast::<c_void>());
26945 _spFree(self_0.cast::<c_void>());
26946}
26947#[no_mangle]
26948pub unsafe extern "C" fn spSlotData_setAttachmentName(
26949 mut self_0: *mut spSlotData,
26950 mut attachmentName: *const c_char,
26951) {
26952 _spFree((*self_0).attachmentName.cast::<c_void>());
26953 if !attachmentName.is_null() {
26954 (*self_0).attachmentName = _spMalloc(
26955 (::core::mem::size_of::<c_char>() as c_ulong)
26956 .wrapping_mul((spine_strlen(attachmentName)).wrapping_add(1 as c_int as c_ulong)),
26957 (b"spine.c\0" as *const u8).cast::<c_char>(),
26958 13619 as c_int,
26959 )
26960 .cast::<c_char>();
26961 spine_strcpy((*self_0).attachmentName, attachmentName);
26962 } else {
26963 (*self_0).attachmentName = std::ptr::null_mut::<c_char>();
26964 };
26965}
26966#[no_mangle]
26967pub unsafe extern "C" fn spTransformConstraint_create(
26968 mut data: *mut spTransformConstraintData,
26969 mut skeleton: *const spSkeleton,
26970) -> *mut spTransformConstraint {
26971 let mut i: c_int = 0;
26972 let mut self_0: *mut spTransformConstraint = _spCalloc(
26973 1 as c_int as size_t,
26974 ::core::mem::size_of::<spTransformConstraint>() as c_ulong,
26975 (b"spine.c\0" as *const u8).cast::<c_char>(),
26976 13658 as c_int,
26977 )
26978 .cast::<spTransformConstraint>();
26979 (*self_0).data = data;
26980 (*self_0).mixRotate = (*data).mixRotate;
26981 (*self_0).mixX = (*data).mixX;
26982 (*self_0).mixY = (*data).mixY;
26983 (*self_0).mixScaleX = (*data).mixScaleX;
26984 (*self_0).mixScaleY = (*data).mixScaleY;
26985 (*self_0).mixShearY = (*data).mixShearY;
26986 (*self_0).bonesCount = (*data).bonesCount;
26987 (*self_0).bones = _spMalloc(
26988 (::core::mem::size_of::<*mut spBone>() as c_ulong)
26989 .wrapping_mul((*self_0).bonesCount as c_ulong),
26990 (b"spine.c\0" as *const u8).cast::<c_char>(),
26991 13667 as c_int,
26992 )
26993 .cast::<*mut spBone>();
26994 i = 0 as c_int;
26995 while i < (*self_0).bonesCount {
26996 let fresh164 = &mut (*((*self_0).bones).offset(i as isize));
26997 *fresh164 = spSkeleton_findBone(
26998 skeleton,
26999 (**((*(*self_0).data).bones).offset(i as isize)).name,
27000 );
27001 i += 1;
27002 }
27003 (*self_0).target = spSkeleton_findBone(skeleton, (*(*(*self_0).data).target).name);
27004 self_0
27005}
27006#[no_mangle]
27007pub unsafe extern "C" fn spTransformConstraint_dispose(mut self_0: *mut spTransformConstraint) {
27008 _spFree((*self_0).bones.cast::<c_void>());
27009 _spFree(self_0.cast::<c_void>());
27010}
27011#[no_mangle]
27012pub unsafe extern "C" fn _spTransformConstraint_applyAbsoluteWorld(
27013 mut self_0: *mut spTransformConstraint,
27014) {
27015 let mut mixRotate: c_float = (*self_0).mixRotate;
27016 let mut mixX: c_float = (*self_0).mixX;
27017 let mut mixY: c_float = (*self_0).mixY;
27018 let mut mixScaleX: c_float = (*self_0).mixScaleX;
27019 let mut mixScaleY: c_float = (*self_0).mixScaleY;
27020 let mut mixShearY: c_float = (*self_0).mixShearY;
27021 let mut translate: c_int =
27022 (mixX != 0 as c_int as c_float || mixY != 0 as c_int as c_float) as c_int;
27023 let mut target: *mut spBone = (*self_0).target;
27024 let mut ta: c_float = (*target).a;
27025 let mut tb: c_float = (*target).b;
27026 let mut tc: c_float = (*target).c;
27027 let mut td: c_float = (*target).d;
27028 let mut degRadReflect: c_float = if ta * td - tb * tc > 0 as c_int as c_float {
27029 3.141_592_7_f32 / 180 as c_int as c_float
27030 } else {
27031 -(3.141_592_7_f32 / 180 as c_int as c_float)
27032 };
27033 let mut offsetRotation: c_float = (*(*self_0).data).offsetRotation * degRadReflect;
27034 let mut offsetShearY: c_float = (*(*self_0).data).offsetShearY * degRadReflect;
27035 let mut i: c_int = 0;
27036 let mut a: c_float = 0.;
27037 let mut b: c_float = 0.;
27038 let mut c: c_float = 0.;
27039 let mut d: c_float = 0.;
27040 let mut r: c_float = 0.;
27041 let mut cosine: c_float = 0.;
27042 let mut sine: c_float = 0.;
27043 let mut x: c_float = 0.;
27044 let mut y: c_float = 0.;
27045 let mut s: c_float = 0.;
27046 let mut by: c_float = 0.;
27047 i = 0 as c_int;
27048 while i < (*self_0).bonesCount {
27049 let mut bone: *mut spBone = *((*self_0).bones).offset(i as isize);
27050 if mixRotate != 0 as c_int as c_float {
27051 a = (*bone).a;
27052 b = (*bone).b;
27053 c = (*bone).c;
27054 d = (*bone).d;
27055 r = spine_atan2f(tc, ta) - spine_atan2f(c, a) + offsetRotation;
27056 if r > 3.141_592_7_f32 {
27057 r -= 3.141_592_7_f32 * 2 as c_int as c_float;
27058 } else if r < -3.141_592_7_f32 {
27059 r += 3.141_592_7_f32 * 2 as c_int as c_float;
27060 }
27061 r *= mixRotate;
27062 cosine = spine_cosf(r);
27063 sine = spine_sinf(r);
27064 (*bone).a = cosine * a - sine * c;
27065 (*bone).b = cosine * b - sine * d;
27066 (*bone).c = sine * a + cosine * c;
27067 (*bone).d = sine * b + cosine * d;
27068 }
27069 if translate != 0 {
27070 spBone_localToWorld(
27071 target,
27072 (*(*self_0).data).offsetX,
27073 (*(*self_0).data).offsetY,
27074 &mut x,
27075 &mut y,
27076 );
27077 (*bone).worldX += (x - (*bone).worldX) * mixX;
27078 (*bone).worldY += (y - (*bone).worldY) * mixY;
27079 }
27080 if mixScaleX > 0 as c_int as c_float {
27081 s = spine_sqrtf((*bone).a * (*bone).a + (*bone).c * (*bone).c);
27082 if s != 0 as c_int as c_float {
27083 s = (s
27084 + (spine_sqrtf(ta * ta + tc * tc) - s + (*(*self_0).data).offsetScaleX)
27085 * mixScaleX)
27086 / s;
27087 }
27088 (*bone).a *= s;
27089 (*bone).c *= s;
27090 }
27091 if mixScaleY != 0 as c_int as c_float {
27092 s = spine_sqrtf((*bone).b * (*bone).b + (*bone).d * (*bone).d);
27093 if s != 0 as c_int as c_float {
27094 s = (s
27095 + (spine_sqrtf(tb * tb + td * td) - s + (*(*self_0).data).offsetScaleY)
27096 * mixScaleY)
27097 / s;
27098 }
27099 (*bone).b *= s;
27100 (*bone).d *= s;
27101 }
27102 if mixShearY > 0 as c_int as c_float {
27103 b = (*bone).b;
27104 d = (*bone).d;
27105 by = spine_atan2f(d, b);
27106 r = spine_atan2f(td, tb)
27107 - spine_atan2f(tc, ta)
27108 - (by - spine_atan2f((*bone).c, (*bone).a));
27109 s = spine_sqrtf(b * b + d * d);
27110 if r > 3.141_592_7_f32 {
27111 r -= 3.141_592_7_f32 * 2 as c_int as c_float;
27112 } else if r < -3.141_592_7_f32 {
27113 r += 3.141_592_7_f32 * 2 as c_int as c_float;
27114 }
27115 r = by + (r + offsetShearY) * mixShearY;
27116 (*bone).b = spine_cosf(r) * s;
27117 (*bone).d = spine_sinf(r) * s;
27118 }
27119 spBone_updateAppliedTransform(bone);
27120 i += 1;
27121 }
27122}
27123#[no_mangle]
27124pub unsafe extern "C" fn _spTransformConstraint_applyRelativeWorld(
27125 mut self_0: *mut spTransformConstraint,
27126) {
27127 let mut mixRotate: c_float = (*self_0).mixRotate;
27128 let mut mixX: c_float = (*self_0).mixX;
27129 let mut mixY: c_float = (*self_0).mixY;
27130 let mut mixScaleX: c_float = (*self_0).mixScaleX;
27131 let mut mixScaleY: c_float = (*self_0).mixScaleY;
27132 let mut mixShearY: c_float = (*self_0).mixShearY;
27133 let mut translate: c_int =
27134 (mixX != 0 as c_int as c_float || mixY != 0 as c_int as c_float) as c_int;
27135 let mut target: *mut spBone = (*self_0).target;
27136 let mut ta: c_float = (*target).a;
27137 let mut tb: c_float = (*target).b;
27138 let mut tc: c_float = (*target).c;
27139 let mut td: c_float = (*target).d;
27140 let mut degRadReflect: c_float = if ta * td - tb * tc > 0 as c_int as c_float {
27141 3.141_592_7_f32 / 180 as c_int as c_float
27142 } else {
27143 -(3.141_592_7_f32 / 180 as c_int as c_float)
27144 };
27145 let mut offsetRotation: c_float = (*(*self_0).data).offsetRotation * degRadReflect;
27146 let mut offsetShearY: c_float = (*(*self_0).data).offsetShearY * degRadReflect;
27147 let mut i: c_int = 0;
27148 let mut a: c_float = 0.;
27149 let mut b: c_float = 0.;
27150 let mut c: c_float = 0.;
27151 let mut d: c_float = 0.;
27152 let mut r: c_float = 0.;
27153 let mut cosine: c_float = 0.;
27154 let mut sine: c_float = 0.;
27155 let mut x: c_float = 0.;
27156 let mut y: c_float = 0.;
27157 let mut s: c_float = 0.;
27158 i = 0 as c_int;
27159 while i < (*self_0).bonesCount {
27160 let mut bone: *mut spBone = *((*self_0).bones).offset(i as isize);
27161 if mixRotate != 0 as c_int as c_float {
27162 a = (*bone).a;
27163 b = (*bone).b;
27164 c = (*bone).c;
27165 d = (*bone).d;
27166 r = spine_atan2f(tc, ta) + offsetRotation;
27167 if r > 3.141_592_7_f32 {
27168 r -= 3.141_592_7_f32 * 2 as c_int as c_float;
27169 } else if r < -3.141_592_7_f32 {
27170 r += 3.141_592_7_f32 * 2 as c_int as c_float;
27171 }
27172 r *= mixRotate;
27173 cosine = spine_cosf(r);
27174 sine = spine_sinf(r);
27175 (*bone).a = cosine * a - sine * c;
27176 (*bone).b = cosine * b - sine * d;
27177 (*bone).c = sine * a + cosine * c;
27178 (*bone).d = sine * b + cosine * d;
27179 }
27180 if translate != 0 as c_int {
27181 spBone_localToWorld(
27182 target,
27183 (*(*self_0).data).offsetX,
27184 (*(*self_0).data).offsetY,
27185 &mut x,
27186 &mut y,
27187 );
27188 (*bone).worldX += x * mixX;
27189 (*bone).worldY += y * mixY;
27190 }
27191 if mixScaleX != 0 as c_int as c_float {
27192 s = (spine_sqrtf(ta * ta + tc * tc) - 1 as c_int as c_float
27193 + (*(*self_0).data).offsetScaleX)
27194 * mixScaleX
27195 + 1 as c_int as c_float;
27196 (*bone).a *= s;
27197 (*bone).c *= s;
27198 }
27199 if mixScaleY > 0 as c_int as c_float {
27200 s = (spine_sqrtf(tb * tb + td * td) - 1 as c_int as c_float
27201 + (*(*self_0).data).offsetScaleY)
27202 * mixScaleY
27203 + 1 as c_int as c_float;
27204 (*bone).b *= s;
27205 (*bone).d *= s;
27206 }
27207 if mixShearY > 0 as c_int as c_float {
27208 r = spine_atan2f(td, tb) - spine_atan2f(tc, ta);
27209 if r > 3.141_592_7_f32 {
27210 r -= 3.141_592_7_f32 * 2 as c_int as c_float;
27211 } else if r < -3.141_592_7_f32 {
27212 r += 3.141_592_7_f32 * 2 as c_int as c_float;
27213 }
27214 b = (*bone).b;
27215 d = (*bone).d;
27216 r = spine_atan2f(d, b)
27217 + (r - 3.141_592_7_f32 / 2 as c_int as c_float + offsetShearY) * mixShearY;
27218 s = spine_sqrtf(b * b + d * d);
27219 (*bone).b = spine_cosf(r) * s;
27220 (*bone).d = spine_sinf(r) * s;
27221 }
27222 spBone_updateAppliedTransform(bone);
27223 i += 1;
27224 }
27225}
27226#[no_mangle]
27227pub unsafe extern "C" fn _spTransformConstraint_applyAbsoluteLocal(
27228 mut self_0: *mut spTransformConstraint,
27229) {
27230 let mut mixRotate: c_float = (*self_0).mixRotate;
27231 let mut mixX: c_float = (*self_0).mixX;
27232 let mut mixY: c_float = (*self_0).mixY;
27233 let mut mixScaleX: c_float = (*self_0).mixScaleX;
27234 let mut mixScaleY: c_float = (*self_0).mixScaleY;
27235 let mut mixShearY: c_float = (*self_0).mixShearY;
27236 let mut target: *mut spBone = (*self_0).target;
27237 let mut i: c_int = 0;
27238 let mut rotation: c_float = 0.;
27239 let mut r: c_float = 0.;
27240 let mut x: c_float = 0.;
27241 let mut y: c_float = 0.;
27242 let mut scaleX: c_float = 0.;
27243 let mut scaleY: c_float = 0.;
27244 let mut shearY: c_float = 0.;
27245 i = 0 as c_int;
27246 while i < (*self_0).bonesCount {
27247 let mut bone: *mut spBone = *((*self_0).bones).offset(i as isize);
27248 rotation = (*bone).arotation;
27249 if mixRotate != 0 as c_int as c_float {
27250 r = (*target).arotation - rotation + (*(*self_0).data).offsetRotation;
27251 r -= spine_ceil((r / 360 as c_int as c_float) as c_double - 0.5f64) as c_float
27252 * 360 as c_int as c_float;
27253 rotation += r * mixRotate;
27254 }
27255 x = (*bone).ax;
27256 y = (*bone).ay;
27257 x += ((*target).ax - x + (*(*self_0).data).offsetX) * mixX;
27258 y += ((*target).ay - y + (*(*self_0).data).offsetY) * mixY;
27259 scaleX = (*bone).ascaleX;
27260 scaleY = (*bone).ascaleY;
27261 if mixScaleX != 0 as c_int as c_float && scaleX != 0 as c_int as c_float {
27262 scaleX = (scaleX
27263 + ((*target).ascaleX - scaleX + (*(*self_0).data).offsetScaleX) * mixScaleX)
27264 / scaleX;
27265 }
27266 if mixScaleY != 0 as c_int as c_float && scaleY != 0 as c_int as c_float {
27267 scaleY = (scaleY
27268 + ((*target).ascaleY - scaleY + (*(*self_0).data).offsetScaleY) * mixScaleY)
27269 / scaleY;
27270 }
27271 shearY = (*bone).ashearY;
27272 if mixShearY != 0 as c_int as c_float {
27273 r = (*target).ashearY - shearY + (*(*self_0).data).offsetShearY;
27274 r -= spine_ceil((r / 360 as c_int as c_float) as c_double - 0.5f64) as c_float
27275 * 360 as c_int as c_float;
27276 shearY += r * mixShearY;
27277 }
27278 spBone_updateWorldTransformWith(
27279 bone,
27280 x,
27281 y,
27282 rotation,
27283 scaleX,
27284 scaleY,
27285 (*bone).ashearX,
27286 shearY,
27287 );
27288 i += 1;
27289 }
27290}
27291#[no_mangle]
27292pub unsafe extern "C" fn _spTransformConstraint_applyRelativeLocal(
27293 mut self_0: *mut spTransformConstraint,
27294) {
27295 let mut mixRotate: c_float = (*self_0).mixRotate;
27296 let mut mixX: c_float = (*self_0).mixX;
27297 let mut mixY: c_float = (*self_0).mixY;
27298 let mut mixScaleX: c_float = (*self_0).mixScaleX;
27299 let mut mixScaleY: c_float = (*self_0).mixScaleY;
27300 let mut mixShearY: c_float = (*self_0).mixShearY;
27301 let mut target: *mut spBone = (*self_0).target;
27302 let mut i: c_int = 0;
27303 let mut rotation: c_float = 0.;
27304 let mut x: c_float = 0.;
27305 let mut y: c_float = 0.;
27306 let mut scaleX: c_float = 0.;
27307 let mut scaleY: c_float = 0.;
27308 let mut shearY: c_float = 0.;
27309 i = 0 as c_int;
27310 while i < (*self_0).bonesCount {
27311 let mut bone: *mut spBone = *((*self_0).bones).offset(i as isize);
27312 rotation = (*bone).arotation
27313 + ((*target).arotation + (*(*self_0).data).offsetRotation) * mixRotate;
27314 x = (*bone).ax + ((*target).ax + (*(*self_0).data).offsetX) * mixX;
27315 y = (*bone).ay + ((*target).ay + (*(*self_0).data).offsetY) * mixY;
27316 scaleX = (*bone).ascaleX
27317 * (((*target).ascaleX - 1 as c_int as c_float + (*(*self_0).data).offsetScaleX)
27318 * mixScaleX
27319 + 1 as c_int as c_float);
27320 scaleY = (*bone).ascaleY
27321 * (((*target).ascaleY - 1 as c_int as c_float + (*(*self_0).data).offsetScaleY)
27322 * mixScaleY
27323 + 1 as c_int as c_float);
27324 shearY = (*bone).ashearY + ((*target).ashearY + (*(*self_0).data).offsetShearY) * mixShearY;
27325 spBone_updateWorldTransformWith(
27326 bone,
27327 x,
27328 y,
27329 rotation,
27330 scaleX,
27331 scaleY,
27332 (*bone).ashearX,
27333 shearY,
27334 );
27335 i += 1;
27336 }
27337}
27338#[no_mangle]
27339pub unsafe extern "C" fn spTransformConstraint_update(mut self_0: *mut spTransformConstraint) {
27340 if (*self_0).mixRotate == 0 as c_int as c_float
27341 && (*self_0).mixX == 0 as c_int as c_float
27342 && (*self_0).mixY == 0 as c_int as c_float
27343 && (*self_0).mixScaleX == 0 as c_int as c_float
27344 && (*self_0).mixScaleY == 0 as c_int as c_float
27345 && (*self_0).mixShearY == 0 as c_int as c_float
27346 {
27347 return;
27348 }
27349 if (*(*self_0).data).local != 0 {
27350 if (*(*self_0).data).relative != 0 {
27351 _spTransformConstraint_applyRelativeLocal(self_0);
27352 } else {
27353 _spTransformConstraint_applyAbsoluteLocal(self_0);
27354 }
27355 } else if (*(*self_0).data).relative != 0 {
27356 _spTransformConstraint_applyRelativeWorld(self_0);
27357 } else {
27358 _spTransformConstraint_applyAbsoluteWorld(self_0);
27359 };
27360}
27361#[no_mangle]
27362pub unsafe extern "C" fn spTransformConstraint_setToSetupPose(
27363 mut self_0: *mut spTransformConstraint,
27364) {
27365 let mut data: *mut spTransformConstraintData = (*self_0).data;
27366 (*self_0).mixRotate = (*data).mixRotate;
27367 (*self_0).mixX = (*data).mixX;
27368 (*self_0).mixY = (*data).mixY;
27369 (*self_0).mixScaleX = (*data).mixScaleX;
27370 (*self_0).mixScaleY = (*data).mixScaleY;
27371 (*self_0).mixShearY = (*data).mixShearY;
27372}
27373#[no_mangle]
27374pub unsafe extern "C" fn spTransformConstraintData_create(
27375 mut name: *const c_char,
27376) -> *mut spTransformConstraintData {
27377 let mut self_0: *mut spTransformConstraintData = _spCalloc(
27378 1 as c_int as size_t,
27379 ::core::mem::size_of::<spTransformConstraintData>() as c_ulong,
27380 (b"spine.c\0" as *const u8).cast::<c_char>(),
27381 13925 as c_int,
27382 )
27383 .cast::<spTransformConstraintData>();
27384 (*self_0).name = _spMalloc(
27385 (::core::mem::size_of::<c_char>() as c_ulong)
27386 .wrapping_mul((spine_strlen(name)).wrapping_add(1 as c_int as c_ulong)),
27387 (b"spine.c\0" as *const u8).cast::<c_char>(),
27388 13926 as c_int,
27389 )
27390 .cast::<c_char>();
27391 spine_strcpy((*self_0).name, name);
27392 self_0
27393}
27394#[no_mangle]
27395pub unsafe extern "C" fn spTransformConstraintData_dispose(
27396 mut self_0: *mut spTransformConstraintData,
27397) {
27398 _spFree((*self_0).name.cast::<c_void>());
27399 _spFree((*self_0).bones.cast::<c_void>());
27400 _spFree(self_0.cast::<c_void>());
27401}
27402#[no_mangle]
27403pub unsafe extern "C" fn spTriangulator_create() -> *mut spTriangulator {
27404 let mut triangulator: *mut spTriangulator = _spCalloc(
27405 1 as c_int as size_t,
27406 ::core::mem::size_of::<spTriangulator>() as c_ulong,
27407 (b"spine.c\0" as *const u8).cast::<c_char>(),
27408 13969 as c_int,
27409 )
27410 .cast::<spTriangulator>();
27411 (*triangulator).convexPolygons = spArrayFloatArray_create(16 as c_int);
27412 (*triangulator).convexPolygonsIndices = spArrayShortArray_create(16 as c_int);
27413 (*triangulator).indicesArray = spShortArray_create(128 as c_int);
27414 (*triangulator).isConcaveArray = spIntArray_create(128 as c_int);
27415 (*triangulator).triangles = spShortArray_create(128 as c_int);
27416 (*triangulator).polygonPool = spArrayFloatArray_create(16 as c_int);
27417 (*triangulator).polygonIndicesPool = spArrayShortArray_create(128 as c_int);
27418 triangulator
27419}
27420#[no_mangle]
27421pub unsafe extern "C" fn spTriangulator_dispose(mut self_0: *mut spTriangulator) {
27422 let mut i: c_int = 0;
27423 i = 0 as c_int;
27424 while i < (*(*self_0).convexPolygons).size {
27425 spFloatArray_dispose(*((*(*self_0).convexPolygons).items).offset(i as isize));
27426 i += 1;
27427 }
27428 spArrayFloatArray_dispose((*self_0).convexPolygons);
27429 i = 0 as c_int;
27430 while i < (*(*self_0).convexPolygonsIndices).size {
27431 spShortArray_dispose(*((*(*self_0).convexPolygonsIndices).items).offset(i as isize));
27432 i += 1;
27433 }
27434 spArrayShortArray_dispose((*self_0).convexPolygonsIndices);
27435 spShortArray_dispose((*self_0).indicesArray);
27436 spIntArray_dispose((*self_0).isConcaveArray);
27437 spShortArray_dispose((*self_0).triangles);
27438 i = 0 as c_int;
27439 while i < (*(*self_0).polygonPool).size {
27440 spFloatArray_dispose(*((*(*self_0).polygonPool).items).offset(i as isize));
27441 i += 1;
27442 }
27443 spArrayFloatArray_dispose((*self_0).polygonPool);
27444 i = 0 as c_int;
27445 while i < (*(*self_0).polygonIndicesPool).size {
27446 spShortArray_dispose(*((*(*self_0).polygonIndicesPool).items).offset(i as isize));
27447 i += 1;
27448 }
27449 spArrayShortArray_dispose((*self_0).polygonIndicesPool);
27450 _spFree(self_0.cast::<c_void>());
27451}
27452unsafe extern "C" fn _obtainPolygon(mut self_0: *mut spTriangulator) -> *mut spFloatArray {
27453 if (*(*self_0).polygonPool).size == 0 as c_int {
27454 spFloatArray_create(16 as c_int)
27455 } else {
27456 spArrayFloatArray_pop((*self_0).polygonPool)
27457 }
27458}
27459unsafe extern "C" fn _freePolygon(mut self_0: *mut spTriangulator, mut polygon: *mut spFloatArray) {
27460 spArrayFloatArray_add((*self_0).polygonPool, polygon);
27461}
27462unsafe extern "C" fn _freeAllPolygons(
27463 mut self_0: *mut spTriangulator,
27464 mut polygons: *mut spArrayFloatArray,
27465) {
27466 let mut i: c_int = 0;
27467 i = 0 as c_int;
27468 while i < (*polygons).size {
27469 _freePolygon(self_0, *((*polygons).items).offset(i as isize));
27470 i += 1;
27471 }
27472}
27473unsafe extern "C" fn _obtainPolygonIndices(mut self_0: *mut spTriangulator) -> *mut spShortArray {
27474 if (*(*self_0).polygonIndicesPool).size == 0 as c_int {
27475 spShortArray_create(16 as c_int)
27476 } else {
27477 spArrayShortArray_pop((*self_0).polygonIndicesPool)
27478 }
27479}
27480unsafe extern "C" fn _freePolygonIndices(
27481 mut self_0: *mut spTriangulator,
27482 mut indices: *mut spShortArray,
27483) {
27484 spArrayShortArray_add((*self_0).polygonIndicesPool, indices);
27485}
27486unsafe extern "C" fn _freeAllPolygonIndices(
27487 mut self_0: *mut spTriangulator,
27488 mut polygonIndices: *mut spArrayShortArray,
27489) {
27490 let mut i: c_int = 0;
27491 i = 0 as c_int;
27492 while i < (*polygonIndices).size {
27493 _freePolygonIndices(self_0, *((*polygonIndices).items).offset(i as isize));
27494 i += 1;
27495 }
27496}
27497unsafe extern "C" fn _positiveArea(
27498 mut p1x: c_float,
27499 mut p1y: c_float,
27500 mut p2x: c_float,
27501 mut p2y: c_float,
27502 mut p3x: c_float,
27503 mut p3y: c_float,
27504) -> c_int {
27505 (p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0 as c_int as c_float) as c_int
27506}
27507unsafe extern "C" fn _isConcave(
27508 mut index: c_int,
27509 mut vertexCount: c_int,
27510 mut vertices: *mut c_float,
27511 mut indices: *mut c_short,
27512) -> c_int {
27513 let mut previous: c_int =
27514 (*indices.offset(((vertexCount + index - 1 as c_int) % vertexCount) as isize) as c_int)
27515 << 1 as c_int;
27516 let mut current: c_int = (*indices.offset(index as isize) as c_int) << 1 as c_int;
27517 let mut next: c_int =
27518 (*indices.offset(((index + 1 as c_int) % vertexCount) as isize) as c_int) << 1 as c_int;
27519 (_positiveArea(
27520 *vertices.offset(previous as isize),
27521 *vertices.offset((previous + 1 as c_int) as isize),
27522 *vertices.offset(current as isize),
27523 *vertices.offset((current + 1 as c_int) as isize),
27524 *vertices.offset(next as isize),
27525 *vertices.offset((next + 1 as c_int) as isize),
27526 ) == 0) as c_int
27527}
27528unsafe extern "C" fn _winding(
27529 mut p1x: c_float,
27530 mut p1y: c_float,
27531 mut p2x: c_float,
27532 mut p2y: c_float,
27533 mut p3x: c_float,
27534 mut p3y: c_float,
27535) -> c_int {
27536 let mut px: c_float = p2x - p1x;
27537 let mut py: c_float = p2y - p1y;
27538 if p3x * py - p3y * px + px * p1y - p1x * py >= 0 as c_int as c_float {
27539 1 as c_int
27540 } else {
27541 -(1 as c_int)
27542 }
27543}
27544#[no_mangle]
27545pub unsafe extern "C" fn spTriangulator_triangulate(
27546 mut self_0: *mut spTriangulator,
27547 mut verticesArray: *mut spFloatArray,
27548) -> *mut spShortArray {
27549 let mut vertices: *mut c_float = (*verticesArray).items;
27550 let mut vertexCount: c_int = (*verticesArray).size >> 1 as c_int;
27551 let mut i: c_int = 0;
27552 let mut n: c_int = 0;
27553 let mut ii: c_int = 0;
27554 let mut indicesArray: *mut spShortArray = (*self_0).indicesArray;
27555 let mut indices: *mut c_short = std::ptr::null_mut::<c_short>();
27556 let mut isConcaveArray: *mut spIntArray = std::ptr::null_mut::<spIntArray>();
27557 let mut isConcave: *mut c_int = std::ptr::null_mut::<c_int>();
27558 let mut triangles: *mut spShortArray = std::ptr::null_mut::<spShortArray>();
27559 spShortArray_clear(indicesArray);
27560 indices = (*spShortArray_setSize(indicesArray, vertexCount)).items;
27561 i = 0 as c_int;
27562 while i < vertexCount {
27563 *indices.offset(i as isize) = i as c_short;
27564 i += 1;
27565 }
27566 isConcaveArray = (*self_0).isConcaveArray;
27567 isConcave = (*spIntArray_setSize(isConcaveArray, vertexCount)).items;
27568 i = 0 as c_int;
27569 n = vertexCount;
27570 while i < n {
27571 *isConcave.offset(i as isize) = _isConcave(i, vertexCount, vertices, indices);
27572 i += 1;
27573 }
27574 triangles = (*self_0).triangles;
27575 spShortArray_clear(triangles);
27576 spShortArray_ensureCapacity(
27577 triangles,
27578 (if 0 as c_int > vertexCount - 2 as c_int {
27579 0 as c_int
27580 } else {
27581 vertexCount - 2 as c_int
27582 }) << 2 as c_int,
27583 );
27584 while vertexCount > 3 as c_int {
27585 let mut previous: c_int = vertexCount - 1 as c_int;
27586 let mut next: c_int = 1 as c_int;
27587 let mut previousIndex: c_int = 0;
27588 let mut nextIndex: c_int = 0;
27589 i = 0 as c_int;
27590 's_80: loop {
27591 if *isConcave.offset(i as isize) == 0 {
27592 let mut p1: c_int = (*indices.offset(previous as isize) as c_int) << 1 as c_int;
27593 let mut p2: c_int = (*indices.offset(i as isize) as c_int) << 1 as c_int;
27594 let mut p3: c_int = (*indices.offset(next as isize) as c_int) << 1 as c_int;
27595 let mut p1x: c_float = *vertices.offset(p1 as isize);
27596 let mut p1y: c_float = *vertices.offset((p1 + 1 as c_int) as isize);
27597 let mut p2x: c_float = *vertices.offset(p2 as isize);
27598 let mut p2y: c_float = *vertices.offset((p2 + 1 as c_int) as isize);
27599 let mut p3x: c_float = *vertices.offset(p3 as isize);
27600 let mut p3y: c_float = *vertices.offset((p3 + 1 as c_int) as isize);
27601 ii = (next + 1 as c_int) % vertexCount;
27602 loop {
27603 if ii == previous {
27604 break 's_80;
27605 }
27606 let mut v: c_int = 0;
27607 let mut vx: c_float = 0.;
27608 let mut vy: c_float = 0.;
27609 if *isConcave.offset(ii as isize) != 0 {
27610 v = (*indices.offset(ii as isize) as c_int) << 1 as c_int;
27611 vx = *vertices.offset(v as isize);
27612 vy = *vertices.offset((v + 1 as c_int) as isize);
27613 if _positiveArea(p3x, p3y, p1x, p1y, vx, vy) != 0
27614 && _positiveArea(p1x, p1y, p2x, p2y, vx, vy) != 0
27615 && _positiveArea(p2x, p2y, p3x, p3y, vx, vy) != 0
27616 {
27617 break;
27618 }
27619 }
27620 ii = (ii + 1 as c_int) % vertexCount;
27621 }
27622 }
27623 if next == 0 as c_int {
27624 while *isConcave.offset(i as isize) != 0 {
27625 i -= 1;
27626 if i <= 0 as c_int {
27627 break;
27628 }
27629 }
27630 break;
27631 } else {
27632 previous = i;
27633 i = next;
27634 next = (next + 1 as c_int) % vertexCount;
27635 }
27636 }
27637 spShortArray_add(
27638 triangles,
27639 *indices.offset(((vertexCount + i - 1 as c_int) % vertexCount) as isize),
27640 );
27641 spShortArray_add(triangles, *indices.offset(i as isize));
27642 spShortArray_add(
27643 triangles,
27644 *indices.offset(((i + 1 as c_int) % vertexCount) as isize),
27645 );
27646 spShortArray_removeAt(indicesArray, i);
27647 spIntArray_removeAt(isConcaveArray, i);
27648 vertexCount -= 1;
27649 previousIndex = (vertexCount + i - 1 as c_int) % vertexCount;
27650 nextIndex = if i == vertexCount { 0 as c_int } else { i };
27651 *isConcave.offset(previousIndex as isize) =
27652 _isConcave(previousIndex, vertexCount, vertices, indices);
27653 *isConcave.offset(nextIndex as isize) =
27654 _isConcave(nextIndex, vertexCount, vertices, indices);
27655 }
27656 if vertexCount == 3 as c_int {
27657 spShortArray_add(triangles, *indices.offset(2 as c_int as isize));
27658 spShortArray_add(triangles, *indices.offset(0 as c_int as isize));
27659 spShortArray_add(triangles, *indices.offset(1 as c_int as isize));
27660 }
27661 triangles
27662}
27663#[no_mangle]
27664pub unsafe extern "C" fn spTriangulator_decompose(
27665 mut self_0: *mut spTriangulator,
27666 mut verticesArray: *mut spFloatArray,
27667 mut triangles: *mut spShortArray,
27668) -> *mut spArrayFloatArray {
27669 let mut vertices: *mut c_float = (*verticesArray).items;
27670 let mut convexPolygons: *mut spArrayFloatArray = (*self_0).convexPolygons;
27671 let mut convexPolygonsIndices: *mut spArrayShortArray =
27672 std::ptr::null_mut::<spArrayShortArray>();
27673 let mut polygonIndices: *mut spShortArray = std::ptr::null_mut::<spShortArray>();
27674 let mut polygon: *mut spFloatArray = std::ptr::null_mut::<spFloatArray>();
27675 let mut fanBaseIndex: c_int = 0;
27676 let mut lastWinding: c_int = 0;
27677 let mut trianglesItems: *mut c_short = std::ptr::null_mut::<c_short>();
27678 let mut i: c_int = 0;
27679 let mut n: c_int = 0;
27680 _freeAllPolygons(self_0, convexPolygons);
27681 spArrayFloatArray_clear(convexPolygons);
27682 convexPolygonsIndices = (*self_0).convexPolygonsIndices;
27683 _freeAllPolygonIndices(self_0, convexPolygonsIndices);
27684 spArrayShortArray_clear(convexPolygonsIndices);
27685 polygonIndices = _obtainPolygonIndices(self_0);
27686 spShortArray_clear(polygonIndices);
27687 polygon = _obtainPolygon(self_0);
27688 spFloatArray_clear(polygon);
27689 fanBaseIndex = -(1 as c_int);
27690 lastWinding = 0 as c_int;
27691 trianglesItems = (*triangles).items;
27692 i = 0 as c_int;
27693 n = (*triangles).size;
27694 while i < n {
27695 let mut t1: c_int = (*trianglesItems.offset(i as isize) as c_int) << 1 as c_int;
27696 let mut t2: c_int =
27697 (*trianglesItems.offset((i + 1 as c_int) as isize) as c_int) << 1 as c_int;
27698 let mut t3: c_int =
27699 (*trianglesItems.offset((i + 2 as c_int) as isize) as c_int) << 1 as c_int;
27700 let mut x1: c_float = *vertices.offset(t1 as isize);
27701 let mut y1: c_float = *vertices.offset((t1 + 1 as c_int) as isize);
27702 let mut x2: c_float = *vertices.offset(t2 as isize);
27703 let mut y2: c_float = *vertices.offset((t2 + 1 as c_int) as isize);
27704 let mut x3: c_float = *vertices.offset(t3 as isize);
27705 let mut y3: c_float = *vertices.offset((t3 + 1 as c_int) as isize);
27706 let mut merged: c_int = 0 as c_int;
27707 if fanBaseIndex == t1 {
27708 let mut o: c_int = (*polygon).size - 4 as c_int;
27709 let mut p: *mut c_float = (*polygon).items;
27710 let mut winding1: c_int = _winding(
27711 *p.offset(o as isize),
27712 *p.offset((o + 1 as c_int) as isize),
27713 *p.offset((o + 2 as c_int) as isize),
27714 *p.offset((o + 3 as c_int) as isize),
27715 x3,
27716 y3,
27717 );
27718 let mut winding2: c_int = _winding(
27719 x3,
27720 y3,
27721 *p.offset(0 as c_int as isize),
27722 *p.offset(1 as c_int as isize),
27723 *p.offset(2 as c_int as isize),
27724 *p.offset(3 as c_int as isize),
27725 );
27726 if winding1 == lastWinding && winding2 == lastWinding {
27727 spFloatArray_add(polygon, x3);
27728 spFloatArray_add(polygon, y3);
27729 spShortArray_add(polygonIndices, t3 as c_short);
27730 merged = 1 as c_int;
27731 }
27732 }
27733 if merged == 0 {
27734 if (*polygon).size > 0 as c_int {
27735 spArrayFloatArray_add(convexPolygons, polygon);
27736 spArrayShortArray_add(convexPolygonsIndices, polygonIndices);
27737 } else {
27738 _freePolygon(self_0, polygon);
27739 _freePolygonIndices(self_0, polygonIndices);
27740 }
27741 polygon = _obtainPolygon(self_0);
27742 spFloatArray_clear(polygon);
27743 spFloatArray_add(polygon, x1);
27744 spFloatArray_add(polygon, y1);
27745 spFloatArray_add(polygon, x2);
27746 spFloatArray_add(polygon, y2);
27747 spFloatArray_add(polygon, x3);
27748 spFloatArray_add(polygon, y3);
27749 polygonIndices = _obtainPolygonIndices(self_0);
27750 spShortArray_clear(polygonIndices);
27751 spShortArray_add(polygonIndices, t1 as c_short);
27752 spShortArray_add(polygonIndices, t2 as c_short);
27753 spShortArray_add(polygonIndices, t3 as c_short);
27754 lastWinding = _winding(x1, y1, x2, y2, x3, y3);
27755 fanBaseIndex = t1;
27756 }
27757 i += 3 as c_int;
27758 }
27759 if (*polygon).size > 0 as c_int {
27760 spArrayFloatArray_add(convexPolygons, polygon);
27761 spArrayShortArray_add(convexPolygonsIndices, polygonIndices);
27762 }
27763 i = 0 as c_int;
27764 n = (*convexPolygons).size;
27765 while i < n {
27766 let mut firstIndex: c_int = 0;
27767 let mut lastIndex: c_int = 0;
27768 let mut o_0: c_int = 0;
27769 let mut p_0: *mut c_float = std::ptr::null_mut::<c_float>();
27770 let mut prevPrevX: c_float = 0.;
27771 let mut prevPrevY: c_float = 0.;
27772 let mut prevX: c_float = 0.;
27773 let mut prevY: c_float = 0.;
27774 let mut firstX: c_float = 0.;
27775 let mut firstY: c_float = 0.;
27776 let mut secondX: c_float = 0.;
27777 let mut secondY: c_float = 0.;
27778 let mut winding: c_int = 0;
27779 let mut ii: c_int = 0;
27780 polygonIndices = *((*convexPolygonsIndices).items).offset(i as isize);
27781 if (*polygonIndices).size != 0 as c_int {
27782 firstIndex = *((*polygonIndices).items).offset(0 as c_int as isize) as c_int;
27783 lastIndex = *((*polygonIndices).items)
27784 .offset(((*polygonIndices).size - 1 as c_int) as isize)
27785 as c_int;
27786 polygon = *((*convexPolygons).items).offset(i as isize);
27787 o_0 = (*polygon).size - 4 as c_int;
27788 p_0 = (*polygon).items;
27789 prevPrevX = *p_0.offset(o_0 as isize);
27790 prevPrevY = *p_0.offset((o_0 + 1 as c_int) as isize);
27791 prevX = *p_0.offset((o_0 + 2 as c_int) as isize);
27792 prevY = *p_0.offset((o_0 + 3 as c_int) as isize);
27793 firstX = *p_0.offset(0 as c_int as isize);
27794 firstY = *p_0.offset(1 as c_int as isize);
27795 secondX = *p_0.offset(2 as c_int as isize);
27796 secondY = *p_0.offset(3 as c_int as isize);
27797 winding = _winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY);
27798 ii = 0 as c_int;
27799 while ii < n {
27800 let mut otherIndices: *mut spShortArray = std::ptr::null_mut::<spShortArray>();
27801 let mut otherFirstIndex: c_int = 0;
27802 let mut otherSecondIndex: c_int = 0;
27803 let mut otherLastIndex: c_int = 0;
27804 let mut otherPoly: *mut spFloatArray = std::ptr::null_mut::<spFloatArray>();
27805 let mut x3_0: c_float = 0.;
27806 let mut y3_0: c_float = 0.;
27807 let mut winding1_0: c_int = 0;
27808 let mut winding2_0: c_int = 0;
27809 if ii != i {
27810 otherIndices = *((*convexPolygonsIndices).items).offset(ii as isize);
27811 if (*otherIndices).size == 3 as c_int {
27812 otherFirstIndex =
27813 *((*otherIndices).items).offset(0 as c_int as isize) as c_int;
27814 otherSecondIndex =
27815 *((*otherIndices).items).offset(1 as c_int as isize) as c_int;
27816 otherLastIndex =
27817 *((*otherIndices).items).offset(2 as c_int as isize) as c_int;
27818 otherPoly = *((*convexPolygons).items).offset(ii as isize);
27819 x3_0 =
27820 *((*otherPoly).items).offset(((*otherPoly).size - 2 as c_int) as isize);
27821 y3_0 =
27822 *((*otherPoly).items).offset(((*otherPoly).size - 1 as c_int) as isize);
27823 if !(otherFirstIndex != firstIndex || otherSecondIndex != lastIndex) {
27824 winding1_0 = _winding(prevPrevX, prevPrevY, prevX, prevY, x3_0, y3_0);
27825 winding2_0 = _winding(x3_0, y3_0, firstX, firstY, secondX, secondY);
27826 if winding1_0 == winding && winding2_0 == winding {
27827 spFloatArray_clear(otherPoly);
27828 spShortArray_clear(otherIndices);
27829 spFloatArray_add(polygon, x3_0);
27830 spFloatArray_add(polygon, y3_0);
27831 spShortArray_add(polygonIndices, otherLastIndex as c_short);
27832 prevPrevX = prevX;
27833 prevPrevY = prevY;
27834 prevX = x3_0;
27835 prevY = y3_0;
27836 ii = 0 as c_int;
27837 }
27838 }
27839 }
27840 }
27841 ii += 1;
27842 }
27843 }
27844 i += 1;
27845 }
27846 i = (*convexPolygons).size - 1 as c_int;
27847 while i >= 0 as c_int {
27848 polygon = *((*convexPolygons).items).offset(i as isize);
27849 if (*polygon).size == 0 as c_int {
27850 spArrayFloatArray_removeAt(convexPolygons, i);
27851 _freePolygon(self_0, polygon);
27852 polygonIndices = *((*convexPolygonsIndices).items).offset(i as isize);
27853 spArrayShortArray_removeAt(convexPolygonsIndices, i);
27854 _freePolygonIndices(self_0, polygonIndices);
27855 }
27856 i -= 1;
27857 }
27858 convexPolygons
27859}
27860static mut nextID: c_int = 0 as c_int;
27861#[no_mangle]
27862pub unsafe extern "C" fn _spVertexAttachment_init(mut attachment: *mut spVertexAttachment) {
27863 let fresh165 = nextID;
27864 nextID += 1;
27865 (*attachment).id = fresh165;
27866 (*attachment).timelineAttachment = &mut (*attachment).super_0;
27867}
27868#[no_mangle]
27869pub unsafe extern "C" fn _spVertexAttachment_deinit(mut attachment: *mut spVertexAttachment) {
27870 _spAttachment_deinit(&mut (*attachment).super_0);
27871 _spFree((*attachment).bones.cast::<c_void>());
27872 _spFree((*attachment).vertices.cast::<c_void>());
27873}
27874#[no_mangle]
27875pub unsafe extern "C" fn spVertexAttachment_computeWorldVertices(
27876 mut self_0: *mut spVertexAttachment,
27877 mut slot: *mut spSlot,
27878 mut start: c_int,
27879 mut count: c_int,
27880 mut worldVertices: *mut c_float,
27881 mut offset: c_int,
27882 mut stride: c_int,
27883) {
27884 let mut skeleton: *mut spSkeleton = std::ptr::null_mut::<spSkeleton>();
27885 let mut deformLength: c_int = 0;
27886 let mut deformArray: *mut c_float = std::ptr::null_mut::<c_float>();
27887 let mut vertices: *mut c_float = std::ptr::null_mut::<c_float>();
27888 let mut bones: *mut c_int = std::ptr::null_mut::<c_int>();
27889 if (*self_0).super_0.type_0 as c_uint == SP_ATTACHMENT_MESH as c_int as c_uint
27890 || (*self_0).super_0.type_0 as c_uint == SP_ATTACHMENT_LINKED_MESH as c_int as c_uint
27891 {
27892 let mut mesh: *mut spMeshAttachment = self_0.cast::<spMeshAttachment>();
27893 if !((*mesh).sequence).is_null() {
27894 spSequence_apply((*mesh).sequence, slot, &mut (*self_0).super_0);
27895 }
27896 }
27897 count = offset + (count >> 1 as c_int) * stride;
27898 skeleton = (*(*slot).bone).skeleton;
27899 deformLength = (*slot).deformCount;
27900 deformArray = (*slot).deform;
27901 vertices = (*self_0).vertices;
27902 bones = (*self_0).bones;
27903 if bones.is_null() {
27904 let mut bone: *mut spBone = std::ptr::null_mut::<spBone>();
27905 let mut v: c_int = 0;
27906 let mut w: c_int = 0;
27907 let mut x: c_float = 0.;
27908 let mut y: c_float = 0.;
27909 if deformLength > 0 as c_int {
27910 vertices = deformArray;
27911 }
27912 bone = (*slot).bone;
27913 x = (*bone).worldX;
27914 y = (*bone).worldY;
27915 v = start;
27916 w = offset;
27917 while w < count {
27918 let mut vx: c_float = *vertices.offset(v as isize);
27919 let mut vy: c_float = *vertices.offset((v + 1 as c_int) as isize);
27920 *worldVertices.offset(w as isize) = vx * (*bone).a + vy * (*bone).b + x;
27921 *worldVertices.offset((w + 1 as c_int) as isize) = vx * (*bone).c + vy * (*bone).d + y;
27922 v += 2 as c_int;
27923 w += stride;
27924 }
27925 } else {
27926 let mut v_0: c_int = 0 as c_int;
27927 let mut skip_0: c_int = 0 as c_int;
27928 let mut i: c_int = 0;
27929 let mut skeletonBones: *mut *mut spBone = std::ptr::null_mut::<*mut spBone>();
27930 i = 0 as c_int;
27931 while i < start {
27932 let mut n: c_int = *bones.offset(v_0 as isize);
27933 v_0 += n + 1 as c_int;
27934 skip_0 += n;
27935 i += 2 as c_int;
27936 }
27937 skeletonBones = (*skeleton).bones;
27938 if deformLength == 0 as c_int {
27939 let mut w_0: c_int = 0;
27940 let mut b: c_int = 0;
27941 w_0 = offset;
27942 b = skip_0 * 3 as c_int;
27943 while w_0 < count {
27944 let mut wx: c_float = 0 as c_int as c_float;
27945 let mut wy: c_float = 0 as c_int as c_float;
27946 let fresh166 = v_0;
27947 v_0 += 1;
27948 let mut n_0: c_int = *bones.offset(fresh166 as isize);
27949 n_0 += v_0;
27950 while v_0 < n_0 {
27951 let mut bone_0: *mut spBone =
27952 *skeletonBones.offset(*bones.offset(v_0 as isize) as isize);
27953 let mut vx_0: c_float = *vertices.offset(b as isize);
27954 let mut vy_0: c_float = *vertices.offset((b + 1 as c_int) as isize);
27955 let mut weight: c_float = *vertices.offset((b + 2 as c_int) as isize);
27956 wx += (vx_0 * (*bone_0).a + vy_0 * (*bone_0).b + (*bone_0).worldX) * weight;
27957 wy += (vx_0 * (*bone_0).c + vy_0 * (*bone_0).d + (*bone_0).worldY) * weight;
27958 v_0 += 1;
27959 b += 3 as c_int;
27960 }
27961 *worldVertices.offset(w_0 as isize) = wx;
27962 *worldVertices.offset((w_0 + 1 as c_int) as isize) = wy;
27963 w_0 += stride;
27964 }
27965 } else {
27966 let mut w_1: c_int = 0;
27967 let mut b_0: c_int = 0;
27968 let mut f: c_int = 0;
27969 w_1 = offset;
27970 b_0 = skip_0 * 3 as c_int;
27971 f = skip_0 << 1 as c_int;
27972 while w_1 < count {
27973 let mut wx_0: c_float = 0 as c_int as c_float;
27974 let mut wy_0: c_float = 0 as c_int as c_float;
27975 let fresh167 = v_0;
27976 v_0 += 1;
27977 let mut n_1: c_int = *bones.offset(fresh167 as isize);
27978 n_1 += v_0;
27979 while v_0 < n_1 {
27980 let mut bone_1: *mut spBone =
27981 *skeletonBones.offset(*bones.offset(v_0 as isize) as isize);
27982 let mut vx_1: c_float =
27983 *vertices.offset(b_0 as isize) + *deformArray.offset(f as isize);
27984 let mut vy_1: c_float = *vertices.offset((b_0 + 1 as c_int) as isize)
27985 + *deformArray.offset((f + 1 as c_int) as isize);
27986 let mut weight_0: c_float = *vertices.offset((b_0 + 2 as c_int) as isize);
27987 wx_0 += (vx_1 * (*bone_1).a + vy_1 * (*bone_1).b + (*bone_1).worldX) * weight_0;
27988 wy_0 += (vx_1 * (*bone_1).c + vy_1 * (*bone_1).d + (*bone_1).worldY) * weight_0;
27989 v_0 += 1;
27990 b_0 += 3 as c_int;
27991 f += 2 as c_int;
27992 }
27993 *worldVertices.offset(w_1 as isize) = wx_0;
27994 *worldVertices.offset((w_1 + 1 as c_int) as isize) = wy_0;
27995 w_1 += stride;
27996 }
27997 }
27998 };
27999}
28000#[no_mangle]
28001pub unsafe extern "C" fn spVertexAttachment_copyTo(
28002 mut from: *mut spVertexAttachment,
28003 mut to: *mut spVertexAttachment,
28004) {
28005 if (*from).bonesCount != 0 {
28006 (*to).bonesCount = (*from).bonesCount;
28007 (*to).bones = _spMalloc(
28008 (::core::mem::size_of::<c_int>() as c_ulong)
28009 .wrapping_mul((*from).bonesCount as c_ulong),
28010 (b"spine.c\0" as *const u8).cast::<c_char>(),
28011 14430 as c_int,
28012 )
28013 .cast::<c_int>();
28014 spine_memcpy(
28015 (*to).bones.cast::<c_void>(),
28016 (*from).bones as *const c_void,
28017 ((*from).bonesCount as c_ulong)
28018 .wrapping_mul(::core::mem::size_of::<c_int>() as c_ulong),
28019 );
28020 } else {
28021 (*to).bonesCount = 0 as c_int;
28022 if !((*to).bones).is_null() {
28023 _spFree((*to).bones.cast::<c_void>());
28024 (*to).bones = std::ptr::null_mut::<c_int>();
28025 }
28026 }
28027 if (*from).verticesCount != 0 {
28028 (*to).verticesCount = (*from).verticesCount;
28029 (*to).vertices = _spMalloc(
28030 (::core::mem::size_of::<c_float>() as c_ulong)
28031 .wrapping_mul((*from).verticesCount as c_ulong),
28032 (b"spine.c\0" as *const u8).cast::<c_char>(),
28033 14442 as c_int,
28034 )
28035 .cast::<c_float>();
28036 spine_memcpy(
28037 (*to).vertices.cast::<c_void>(),
28038 (*from).vertices as *const c_void,
28039 ((*from).verticesCount as c_ulong)
28040 .wrapping_mul(::core::mem::size_of::<c_float>() as c_ulong),
28041 );
28042 } else {
28043 (*to).verticesCount = 0 as c_int;
28044 if !((*to).vertices).is_null() {
28045 _spFree((*to).vertices.cast::<c_void>());
28046 (*to).vertices = std::ptr::null_mut::<c_float>();
28047 }
28048 }
28049 (*to).worldVerticesLength = (*from).worldVerticesLength;
28050}
28051#[no_mangle]
28052pub unsafe extern "C" fn _spInternalRandom() -> c_float {
28053 spine_rand() as c_float / 2147483647 as c_int as c_float
28054}
28055static mut mallocFunc: Option<unsafe extern "C" fn(size_t) -> *mut c_void> =
28056 Some(spine_malloc as unsafe extern "C" fn(size_t) -> *mut c_void);
28057static mut reallocFunc: Option<unsafe extern "C" fn(*mut c_void, size_t) -> *mut c_void> =
28058 Some(spine_realloc as unsafe extern "C" fn(*mut c_void, size_t) -> *mut c_void);
28059static mut debugMallocFunc: Option<
28060 unsafe extern "C" fn(size_t, *const c_char, c_int) -> *mut c_void,
28061> = None;
28062static mut freeFunc: Option<unsafe extern "C" fn(*mut c_void) -> ()> =
28063 Some(spine_free as unsafe extern "C" fn(*mut c_void) -> ());
28064static mut randomFunc: Option<unsafe extern "C" fn() -> c_float> =
28065 Some(_spInternalRandom as unsafe extern "C" fn() -> c_float);
28066#[no_mangle]
28067pub unsafe extern "C" fn _spMalloc(
28068 mut size: size_t,
28069 mut file: *const c_char,
28070 mut line: c_int,
28071) -> *mut c_void {
28072 if debugMallocFunc.is_some() {
28073 return debugMallocFunc.expect("non-null function pointer")(size, file, line);
28074 }
28075 mallocFunc.expect("non-null function pointer")(size)
28076}
28077#[no_mangle]
28078pub unsafe extern "C" fn _spCalloc(
28079 mut num: size_t,
28080 mut size: size_t,
28081 mut file: *const c_char,
28082 mut line: c_int,
28083) -> *mut c_void {
28084 let mut ptr: *mut c_void = _spMalloc(num.wrapping_mul(size), file, line);
28085 if !ptr.is_null() {
28086 spine_memset(ptr, 0 as c_int, num.wrapping_mul(size));
28087 }
28088 ptr
28089}
28090#[no_mangle]
28091pub unsafe extern "C" fn _spRealloc(mut ptr: *mut c_void, mut size: size_t) -> *mut c_void {
28092 reallocFunc.expect("non-null function pointer")(ptr, size)
28093}
28094#[no_mangle]
28095pub unsafe extern "C" fn _spFree(mut ptr: *mut c_void) {
28096 freeFunc.expect("non-null function pointer")(ptr);
28097}
28098#[no_mangle]
28099pub unsafe extern "C" fn _spRandom() -> c_float {
28100 randomFunc.expect("non-null function pointer")()
28101}
28102#[no_mangle]
28103pub unsafe extern "C" fn _spSetDebugMalloc(
28104 mut spine_malloc_0: Option<unsafe extern "C" fn(size_t, *const c_char, c_int) -> *mut c_void>,
28105) {
28106 debugMallocFunc = spine_malloc_0;
28107}
28108#[no_mangle]
28109pub unsafe extern "C" fn _spSetMalloc(
28110 mut spine_malloc_0: Option<unsafe extern "C" fn(size_t) -> *mut c_void>,
28111) {
28112 mallocFunc = spine_malloc_0;
28113}
28114#[no_mangle]
28115pub unsafe extern "C" fn _spSetRealloc(
28116 mut spine_realloc_0: Option<unsafe extern "C" fn(*mut c_void, size_t) -> *mut c_void>,
28117) {
28118 reallocFunc = spine_realloc_0;
28119}
28120#[no_mangle]
28121pub unsafe extern "C" fn _spSetFree(
28122 mut spine_free_0: Option<unsafe extern "C" fn(*mut c_void) -> ()>,
28123) {
28124 freeFunc = spine_free_0;
28125}
28126#[no_mangle]
28127pub unsafe extern "C" fn _spSetRandom(mut random: Option<unsafe extern "C" fn() -> c_float>) {
28128 randomFunc = random;
28129}
28130#[no_mangle]
28131pub unsafe extern "C" fn _spReadFile(
28132 mut path: *const c_char,
28133 mut length: *mut c_int,
28134) -> *mut c_char {
28135 let mut data: *mut c_char = std::ptr::null_mut::<c_char>();
28136 let mut file: *mut FILE = spine_fopen(path, (b"rb\0" as *const u8).cast::<c_char>());
28137 if file.is_null() {
28138 return std::ptr::null_mut::<c_char>();
28139 }
28140 spine_fseek(file, 0 as c_int as c_long, 2 as c_int);
28141 *length = spine_ftell(file) as c_int;
28142 spine_fseek(file, 0 as c_int as c_long, 0 as c_int);
28143 data = _spMalloc(
28144 (::core::mem::size_of::<c_char>() as c_ulong).wrapping_mul(*length as c_ulong),
28145 (b"spine.c\0" as *const u8).cast::<c_char>(),
28146 14554 as c_int,
28147 )
28148 .cast::<c_char>();
28149 spine_fread(
28150 data.cast::<c_void>(),
28151 1 as c_int as size_t,
28152 *length as size_t,
28153 file,
28154 );
28155 spine_fclose(file);
28156 data
28157}
28158#[no_mangle]
28159pub unsafe extern "C" fn _spMath_random(mut min: c_float, mut max: c_float) -> c_float {
28160 min + (max - min) * _spRandom()
28161}
28162#[no_mangle]
28163pub unsafe extern "C" fn _spMath_randomTriangular(mut min: c_float, mut max: c_float) -> c_float {
28164 _spMath_randomTriangularWith(min, max, (min + max) * 0.5f32)
28165}
28166#[no_mangle]
28167pub unsafe extern "C" fn _spMath_randomTriangularWith(
28168 mut min: c_float,
28169 mut max: c_float,
28170 mut mode: c_float,
28171) -> c_float {
28172 let mut u: c_float = _spRandom();
28173 let mut d: c_float = max - min;
28174 if u <= (mode - min) / d {
28175 return min + spine_sqrtf(u * d * (mode - min));
28176 }
28177 max - spine_sqrtf((1 as c_int as c_float - u) * d * (max - mode))
28178}
28179#[no_mangle]
28180pub unsafe extern "C" fn _spMath_interpolate(
28181 mut apply: Option<unsafe extern "C" fn(c_float) -> c_float>,
28182 mut start: c_float,
28183 mut end: c_float,
28184 mut a: c_float,
28185) -> c_float {
28186 start + (end - start) * apply.expect("non-null function pointer")(a)
28187}
28188#[no_mangle]
28189pub unsafe extern "C" fn _spMath_pow2_apply(mut a: c_float) -> c_float {
28190 if a as c_double <= 0.5f64 {
28191 return (spine_pow(
28192 (a * 2 as c_int as c_float) as c_double,
28193 2 as c_int as c_double,
28194 ) / 2 as c_int as c_double) as c_float;
28195 }
28196 (spine_pow(
28197 ((a - 1 as c_int as c_float) * 2 as c_int as c_float) as c_double,
28198 2 as c_int as c_double,
28199 ) / -(2 as c_int) as c_double
28200 + 1 as c_int as c_double) as c_float
28201}
28202#[no_mangle]
28203pub unsafe extern "C" fn _spMath_pow2out_apply(mut a: c_float) -> c_float {
28204 (spine_pow(
28205 (a - 1 as c_int as c_float) as c_double,
28206 2 as c_int as c_double,
28207 ) * -(1 as c_int) as c_double
28208 + 1 as c_int as c_double) as c_float
28209}
28210
28211type _IO_wide_data = u8;
28212type _IO_codecvt = u8;
28213type _IO_marker = u8;
28214pub use crate::c::environment::types::*;