From b544dd99ed6e1a9abdbe8bc464473440e0a5f149 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Tue, 15 Jul 2025 22:56:12 +0200 Subject: [PATCH] [formatters] C/C++ formatting --- formatters/.clang-format | 10 +- spine-c/include/spine-c.h | 2 +- spine-c/src/base.h | 12 +- spine-c/src/extensions.cpp | 518 +- spine-c/src/extensions.h | 16 +- spine-c/src/generated/alpha_timeline.cpp | 82 +- spine-c/src/generated/alpha_timeline.h | 18 +- spine-c/src/generated/animation.cpp | 40 +- spine-c/src/generated/animation.h | 8 +- spine-c/src/generated/animation_state.cpp | 80 +- spine-c/src/generated/animation_state.h | 17 +- .../src/generated/animation_state_data.cpp | 27 +- spine-c/src/generated/animation_state_data.h | 2 +- spine-c/src/generated/arrays.cpp | 1195 ++- spine-c/src/generated/arrays.h | 77 +- spine-c/src/generated/atlas.cpp | 16 +- spine-c/src/generated/atlas.h | 2 +- .../src/generated/atlas_attachment_loader.cpp | 43 +- .../src/generated/atlas_attachment_loader.h | 20 +- spine-c/src/generated/atlas_page.cpp | 90 +- spine-c/src/generated/atlas_page.h | 14 +- spine-c/src/generated/atlas_region.cpp | 140 +- spine-c/src/generated/atlas_region.h | 2 +- spine-c/src/generated/attachment.cpp | 24 +- spine-c/src/generated/attachment.h | 2 +- spine-c/src/generated/attachment_loader.cpp | 34 +- spine-c/src/generated/attachment_loader.h | 16 +- spine-c/src/generated/attachment_timeline.cpp | 42 +- spine-c/src/generated/attachment_timeline.h | 6 +- spine-c/src/generated/attachment_type.h | 14 +- spine-c/src/generated/blend_mode.h | 8 +- spine-c/src/generated/bone.cpp | 48 +- spine-c/src/generated/bone_data.cpp | 51 +- spine-c/src/generated/bone_data.h | 8 +- spine-c/src/generated/bone_local.cpp | 64 +- spine-c/src/generated/bone_pose.cpp | 167 +- spine-c/src/generated/bone_pose.h | 8 +- spine-c/src/generated/bone_timeline.cpp | 13 +- spine-c/src/generated/bone_timeline1.cpp | 80 +- spine-c/src/generated/bone_timeline1.h | 18 +- spine-c/src/generated/bone_timeline2.cpp | 59 +- spine-c/src/generated/bone_timeline2.h | 6 +- .../src/generated/bounding_box_attachment.cpp | 74 +- .../src/generated/bounding_box_attachment.h | 12 +- spine-c/src/generated/clipping_attachment.cpp | 79 +- spine-c/src/generated/clipping_attachment.h | 11 +- spine-c/src/generated/color.cpp | 59 +- spine-c/src/generated/color.h | 2 +- spine-c/src/generated/constraint.cpp | 19 +- spine-c/src/generated/constraint_data.cpp | 18 +- spine-c/src/generated/constraint_data.h | 2 +- spine-c/src/generated/constraint_timeline.cpp | 13 +- .../src/generated/constraint_timeline1.cpp | 83 +- spine-c/src/generated/constraint_timeline1.h | 22 +- spine-c/src/generated/curve_timeline.cpp | 47 +- spine-c/src/generated/curve_timeline.h | 6 +- spine-c/src/generated/curve_timeline1.cpp | 77 +- spine-c/src/generated/curve_timeline1.h | 19 +- spine-c/src/generated/curve_timeline2.cpp | 53 +- spine-c/src/generated/curve_timeline2.h | 7 +- spine-c/src/generated/deform_timeline.cpp | 67 +- spine-c/src/generated/deform_timeline.h | 10 +- spine-c/src/generated/draw_order_timeline.cpp | 34 +- spine-c/src/generated/draw_order_timeline.h | 4 +- spine-c/src/generated/event.cpp | 44 +- spine-c/src/generated/event.h | 4 +- spine-c/src/generated/event_data.cpp | 55 +- spine-c/src/generated/event_data.h | 12 +- spine-c/src/generated/event_queue_entry.cpp | 22 +- spine-c/src/generated/event_timeline.cpp | 37 +- spine-c/src/generated/event_timeline.h | 3 +- spine-c/src/generated/event_type.h | 12 +- spine-c/src/generated/format.h | 14 +- spine-c/src/generated/from_property.cpp | 24 +- spine-c/src/generated/from_property.h | 2 +- spine-c/src/generated/from_rotate.cpp | 14 +- spine-c/src/generated/from_rotate.h | 2 +- spine-c/src/generated/from_scale_x.cpp | 14 +- spine-c/src/generated/from_scale_x.h | 2 +- spine-c/src/generated/from_scale_y.cpp | 14 +- spine-c/src/generated/from_scale_y.h | 2 +- spine-c/src/generated/from_shear_y.cpp | 14 +- spine-c/src/generated/from_shear_y.h | 2 +- spine-c/src/generated/from_x.cpp | 14 +- spine-c/src/generated/from_x.h | 2 +- spine-c/src/generated/from_y.cpp | 14 +- spine-c/src/generated/from_y.h | 2 +- spine-c/src/generated/ik_constraint.cpp | 72 +- spine-c/src/generated/ik_constraint.h | 6 +- spine-c/src/generated/ik_constraint_data.cpp | 47 +- spine-c/src/generated/ik_constraint_data.h | 4 +- spine-c/src/generated/ik_constraint_pose.cpp | 37 +- .../src/generated/ik_constraint_timeline.cpp | 62 +- .../src/generated/ik_constraint_timeline.h | 13 +- spine-c/src/generated/inherit.h | 10 +- spine-c/src/generated/inherit_timeline.cpp | 40 +- spine-c/src/generated/inherit_timeline.h | 4 +- spine-c/src/generated/linked_mesh.cpp | 13 +- spine-c/src/generated/linked_mesh.h | 6 +- spine-c/src/generated/mesh_attachment.cpp | 146 +- spine-c/src/generated/mesh_attachment.h | 14 +- spine-c/src/generated/mix_blend.h | 8 +- spine-c/src/generated/mix_direction.h | 4 +- spine-c/src/generated/path_attachment.cpp | 91 +- spine-c/src/generated/path_attachment.h | 10 +- spine-c/src/generated/path_constraint.cpp | 61 +- .../src/generated/path_constraint_data.cpp | 65 +- spine-c/src/generated/path_constraint_data.h | 4 +- .../path_constraint_mix_timeline.cpp | 65 +- .../generated/path_constraint_mix_timeline.h | 14 +- .../src/generated/path_constraint_pose.cpp | 37 +- .../path_constraint_position_timeline.cpp | 91 +- .../path_constraint_position_timeline.h | 30 +- .../path_constraint_spacing_timeline.cpp | 90 +- .../path_constraint_spacing_timeline.h | 27 +- spine-c/src/generated/physics.h | 8 +- spine-c/src/generated/physics_constraint.cpp | 68 +- .../physics_constraint_damping_timeline.cpp | 94 +- .../physics_constraint_damping_timeline.h | 31 +- .../src/generated/physics_constraint_data.cpp | 122 +- .../src/generated/physics_constraint_data.h | 4 +- .../physics_constraint_gravity_timeline.cpp | 94 +- .../physics_constraint_gravity_timeline.h | 31 +- .../physics_constraint_inertia_timeline.cpp | 94 +- .../physics_constraint_inertia_timeline.h | 31 +- .../physics_constraint_mass_timeline.cpp | 94 +- .../physics_constraint_mass_timeline.h | 27 +- .../physics_constraint_mix_timeline.cpp | 94 +- .../physics_constraint_mix_timeline.h | 27 +- .../src/generated/physics_constraint_pose.cpp | 49 +- .../physics_constraint_reset_timeline.cpp | 41 +- .../physics_constraint_reset_timeline.h | 4 +- .../physics_constraint_strength_timeline.cpp | 94 +- .../physics_constraint_strength_timeline.h | 31 +- .../generated/physics_constraint_timeline.cpp | 87 +- .../generated/physics_constraint_timeline.h | 23 +- .../physics_constraint_wind_timeline.cpp | 94 +- .../physics_constraint_wind_timeline.h | 27 +- spine-c/src/generated/point_attachment.cpp | 57 +- spine-c/src/generated/point_attachment.h | 6 +- spine-c/src/generated/polygon.cpp | 16 +- spine-c/src/generated/posed.cpp | 11 +- spine-c/src/generated/posed_active.cpp | 8 +- spine-c/src/generated/posed_data.cpp | 17 +- spine-c/src/generated/posed_data.h | 4 +- spine-c/src/generated/position_mode.h | 4 +- spine-c/src/generated/property.h | 62 +- spine-c/src/generated/region_attachment.cpp | 116 +- spine-c/src/generated/region_attachment.h | 14 +- spine-c/src/generated/render_command.cpp | 44 +- spine-c/src/generated/render_command.h | 12 +- spine-c/src/generated/rgb2_timeline.cpp | 58 +- spine-c/src/generated/rgb2_timeline.h | 9 +- spine-c/src/generated/rgb_timeline.cpp | 58 +- spine-c/src/generated/rgb_timeline.h | 6 +- spine-c/src/generated/rgba2_timeline.cpp | 61 +- spine-c/src/generated/rgba2_timeline.h | 9 +- spine-c/src/generated/rgba_timeline.cpp | 58 +- spine-c/src/generated/rgba_timeline.h | 6 +- spine-c/src/generated/rotate_mode.h | 6 +- spine-c/src/generated/rotate_timeline.cpp | 85 +- spine-c/src/generated/rotate_timeline.h | 19 +- spine-c/src/generated/rtti.cpp | 13 +- spine-c/src/generated/rtti.h | 2 +- spine-c/src/generated/scale_timeline.cpp | 61 +- spine-c/src/generated/scale_timeline.h | 6 +- spine-c/src/generated/scale_x_timeline.cpp | 85 +- spine-c/src/generated/scale_x_timeline.h | 19 +- spine-c/src/generated/scale_y_timeline.cpp | 85 +- spine-c/src/generated/scale_y_timeline.h | 19 +- spine-c/src/generated/sequence.cpp | 42 +- spine-c/src/generated/sequence.h | 2 +- spine-c/src/generated/sequence_mode.h | 14 +- spine-c/src/generated/sequence_timeline.cpp | 43 +- spine-c/src/generated/sequence_timeline.h | 7 +- spine-c/src/generated/shear_timeline.cpp | 61 +- spine-c/src/generated/shear_timeline.h | 6 +- spine-c/src/generated/shear_x_timeline.cpp | 85 +- spine-c/src/generated/shear_x_timeline.h | 19 +- spine-c/src/generated/shear_y_timeline.cpp | 85 +- spine-c/src/generated/shear_y_timeline.h | 19 +- spine-c/src/generated/skeleton.cpp | 183 +- spine-c/src/generated/skeleton.h | 18 +- spine-c/src/generated/skeleton_binary.cpp | 24 +- spine-c/src/generated/skeleton_binary.h | 6 +- spine-c/src/generated/skeleton_bounds.cpp | 58 +- spine-c/src/generated/skeleton_bounds.h | 6 +- spine-c/src/generated/skeleton_clipping.cpp | 42 +- spine-c/src/generated/skeleton_clipping.h | 12 +- spine-c/src/generated/skeleton_data.cpp | 139 +- spine-c/src/generated/skeleton_data.h | 30 +- spine-c/src/generated/skeleton_json.cpp | 24 +- spine-c/src/generated/skeleton_json.h | 6 +- spine-c/src/generated/skeleton_renderer.cpp | 7 +- spine-c/src/generated/skin.cpp | 44 +- spine-c/src/generated/skin.h | 10 +- spine-c/src/generated/slider.cpp | 51 +- spine-c/src/generated/slider_data.cpp | 76 +- spine-c/src/generated/slider_data.h | 4 +- spine-c/src/generated/slider_mix_timeline.cpp | 85 +- spine-c/src/generated/slider_mix_timeline.h | 19 +- spine-c/src/generated/slider_pose.cpp | 19 +- spine-c/src/generated/slider_timeline.cpp | 85 +- spine-c/src/generated/slider_timeline.h | 19 +- spine-c/src/generated/slot.cpp | 28 +- spine-c/src/generated/slot_curve_timeline.cpp | 53 +- spine-c/src/generated/slot_curve_timeline.h | 7 +- spine-c/src/generated/slot_data.cpp | 48 +- spine-c/src/generated/slot_data.h | 8 +- spine-c/src/generated/slot_pose.cpp | 34 +- spine-c/src/generated/slot_timeline.cpp | 13 +- spine-c/src/generated/spacing_mode.h | 8 +- spine-c/src/generated/texture_filter.h | 16 +- spine-c/src/generated/texture_region.cpp | 45 +- spine-c/src/generated/texture_wrap.h | 6 +- spine-c/src/generated/timeline.cpp | 29 +- spine-c/src/generated/timeline.h | 3 +- spine-c/src/generated/to_property.cpp | 34 +- spine-c/src/generated/to_property.h | 3 +- spine-c/src/generated/to_rotate.cpp | 18 +- spine-c/src/generated/to_rotate.h | 3 +- spine-c/src/generated/to_scale_x.cpp | 18 +- spine-c/src/generated/to_scale_x.h | 3 +- spine-c/src/generated/to_scale_y.cpp | 18 +- spine-c/src/generated/to_scale_y.h | 3 +- spine-c/src/generated/to_shear_y.cpp | 18 +- spine-c/src/generated/to_shear_y.h | 3 +- spine-c/src/generated/to_x.cpp | 18 +- spine-c/src/generated/to_x.h | 3 +- spine-c/src/generated/to_y.cpp | 18 +- spine-c/src/generated/to_y.h | 3 +- spine-c/src/generated/track_entry.cpp | 168 +- spine-c/src/generated/track_entry.h | 2 +- .../src/generated/transform_constraint.cpp | 62 +- .../generated/transform_constraint_data.cpp | 104 +- .../src/generated/transform_constraint_data.h | 4 +- .../generated/transform_constraint_pose.cpp | 43 +- .../transform_constraint_timeline.cpp | 66 +- .../generated/transform_constraint_timeline.h | 17 +- spine-c/src/generated/translate_timeline.cpp | 61 +- spine-c/src/generated/translate_timeline.h | 7 +- .../src/generated/translate_x_timeline.cpp | 85 +- spine-c/src/generated/translate_x_timeline.h | 22 +- .../src/generated/translate_y_timeline.cpp | 85 +- spine-c/src/generated/translate_y_timeline.h | 22 +- spine-c/src/generated/types.h | 2 +- spine-c/src/generated/update.cpp | 10 +- spine-c/src/generated/vertex_attachment.cpp | 66 +- spine-c/src/generated/vertex_attachment.h | 9 +- spine-c/tests/headless-test.c | 3 +- .../example/Classes/AppDelegate.cpp | 9 +- .../example/Classes/BatchingExample.cpp | 4 +- .../example/Classes/SpineboyExample.cpp | 27 +- .../src/spine/SkeletonAnimation.cpp | 5 +- .../src/spine/SkeletonAnimation.h | 3 +- .../src/spine/SkeletonRendererCocos2dX.cpp | 258 +- .../src/spine/SkeletonRendererCocos2dX.h | 2 +- .../src/spine/spine-cocos2dx.cpp | 15 +- .../src/spine/v3/SkeletonBatch.cpp | 10 +- .../src/spine/v3/SkeletonBatch.h | 4 +- .../src/spine/v3/SkeletonTwoColorBatch.cpp | 85 +- .../src/spine/v3/SkeletonTwoColorBatch.h | 63 +- .../src/spine/v4/SkeletonBatch.cpp | 25 +- .../src/spine/v4/SkeletonBatch.h | 4 +- .../src/spine/v4/SkeletonTwoColorBatch.cpp | 94 +- .../src/spine/v4/SkeletonTwoColorBatch.h | 55 +- spine-cpp/include/spine/Animation.h | 5 +- spine-cpp/include/spine/AnimationState.h | 54 +- spine-cpp/include/spine/Array.h | 6 +- spine-cpp/include/spine/Atlas.h | 156 +- spine-cpp/include/spine/Attachment.h | 2 +- spine-cpp/include/spine/AttachmentTimeline.h | 7 +- spine-cpp/include/spine/AttachmentType.h | 28 +- spine-cpp/include/spine/BlendMode.h | 19 +- spine-cpp/include/spine/BlockAllocator.h | 124 +- spine-cpp/include/spine/Bone.h | 22 +- spine-cpp/include/spine/BoneLocal.h | 2 +- spine-cpp/include/spine/BoneTimeline.h | 45 +- .../include/spine/BoundingBoxAttachment.h | 2 +- spine-cpp/include/spine/ClippingAttachment.h | 2 +- spine-cpp/include/spine/Color.h | 16 +- spine-cpp/include/spine/ColorTimeline.h | 23 +- spine-cpp/include/spine/ConstraintData.h | 26 +- spine-cpp/include/spine/ConstraintTimeline.h | 29 +- spine-cpp/include/spine/ConstraintTimeline1.h | 3 +- spine-cpp/include/spine/CurveTimeline.h | 21 +- spine-cpp/include/spine/Debug.h | 46 +- spine-cpp/include/spine/DeformTimeline.h | 15 +- spine-cpp/include/spine/DrawOrderTimeline.h | 11 +- spine-cpp/include/spine/EventData.h | 2 +- spine-cpp/include/spine/EventTimeline.h | 7 +- spine-cpp/include/spine/Extension.h | 14 +- spine-cpp/include/spine/HasRendererObject.h | 10 +- spine-cpp/include/spine/HashMap.h | 30 +- spine-cpp/include/spine/IkConstraint.h | 16 +- spine-cpp/include/spine/IkConstraintData.h | 2 +- spine-cpp/include/spine/IkConstraintPose.h | 2 +- .../include/spine/IkConstraintTimeline.h | 7 +- spine-cpp/include/spine/Inherit.h | 22 +- spine-cpp/include/spine/InheritTimeline.h | 13 +- spine-cpp/include/spine/Json.h | 15 +- spine-cpp/include/spine/LinkedMesh.h | 8 +- spine-cpp/include/spine/MathUtil.h | 16 +- spine-cpp/include/spine/MeshAttachment.h | 4 +- spine-cpp/include/spine/MixBlend.h | 12 +- spine-cpp/include/spine/MixDirection.h | 2 +- spine-cpp/include/spine/PathAttachment.h | 2 +- spine-cpp/include/spine/PathConstraint.h | 17 +- spine-cpp/include/spine/PathConstraintData.h | 3 +- .../include/spine/PathConstraintMixTimeline.h | 7 +- spine-cpp/include/spine/PathConstraintPose.h | 68 +- .../spine/PathConstraintPositionTimeline.h | 7 +- .../spine/PathConstraintSpacingTimeline.h | 7 +- spine-cpp/include/spine/Physics.h | 22 +- spine-cpp/include/spine/PhysicsConstraint.h | 16 +- .../include/spine/PhysicsConstraintData.h | 10 +- .../include/spine/PhysicsConstraintPose.h | 68 +- .../include/spine/PhysicsConstraintTimeline.h | 329 +- spine-cpp/include/spine/PointAttachment.h | 2 +- spine-cpp/include/spine/Pool.h | 2 +- spine-cpp/include/spine/Pose.h | 16 +- spine-cpp/include/spine/Posed.h | 6 +- spine-cpp/include/spine/PosedActive.h | 14 +- spine-cpp/include/spine/PosedData.h | 182 +- spine-cpp/include/spine/PositionMode.h | 15 +- spine-cpp/include/spine/Property.h | 18 +- spine-cpp/include/spine/RTTI.h | 47 +- spine-cpp/include/spine/RegionAttachment.h | 2 +- spine-cpp/include/spine/RotateMode.h | 18 +- spine-cpp/include/spine/RotateTimeline.h | 5 +- spine-cpp/include/spine/ScaleTimeline.h | 15 +- spine-cpp/include/spine/Sequence.h | 41 +- spine-cpp/include/spine/SequenceTimeline.h | 11 +- spine-cpp/include/spine/ShearTimeline.h | 15 +- spine-cpp/include/spine/SkeletonBinary.h | 21 +- spine-cpp/include/spine/SkeletonBounds.h | 18 +- spine-cpp/include/spine/SkeletonClipping.h | 12 +- spine-cpp/include/spine/SkeletonData.h | 28 +- spine-cpp/include/spine/SkeletonJson.h | 24 +- spine-cpp/include/spine/SkeletonRenderer.h | 51 +- spine-cpp/include/spine/Skin.h | 28 +- spine-cpp/include/spine/Slider.h | 14 +- spine-cpp/include/spine/SliderData.h | 20 +- spine-cpp/include/spine/SliderMixTimeline.h | 7 +- spine-cpp/include/spine/SliderPose.h | 38 +- spine-cpp/include/spine/SliderTimeline.h | 7 +- spine-cpp/include/spine/SlotCurveTimeline.h | 8 +- spine-cpp/include/spine/SlotData.h | 10 +- spine-cpp/include/spine/SlotPose.h | 14 +- spine-cpp/include/spine/SpacingMode.h | 21 +- spine-cpp/include/spine/SpineString.h | 54 +- spine-cpp/include/spine/TextureRegion.h | 52 +- spine-cpp/include/spine/Timeline.h | 11 +- spine-cpp/include/spine/TransformConstraint.h | 20 +- .../include/spine/TransformConstraintData.h | 136 +- .../include/spine/TransformConstraintPose.h | 90 +- .../spine/TransformConstraintTimeline.h | 10 +- spine-cpp/include/spine/TranslateTimeline.h | 15 +- spine-cpp/include/spine/Triangulator.h | 16 +- spine-cpp/include/spine/Update.h | 2 +- spine-cpp/include/spine/VertexAttachment.h | 10 +- spine-cpp/spine-cpp-lite/spine-cpp-lite.cpp | 23 +- spine-cpp/spine-cpp-lite/spine-cpp-lite.h | 47 +- spine-cpp/src/spine/Animation.cpp | 11 +- spine-cpp/src/spine/AnimationState.cpp | 274 +- spine-cpp/src/spine/Atlas.cpp | 27 +- spine-cpp/src/spine/AttachmentTimeline.cpp | 10 +- spine-cpp/src/spine/Bone.cpp | 14 +- spine-cpp/src/spine/BoneData.cpp | 9 +- spine-cpp/src/spine/BoneTimeline.cpp | 14 +- spine-cpp/src/spine/ColorTimeline.cpp | 38 +- spine-cpp/src/spine/ConstraintTimeline.cpp | 3 +- spine-cpp/src/spine/CurveTimeline.cpp | 23 +- spine-cpp/src/spine/DeformTimeline.cpp | 28 +- spine-cpp/src/spine/DrawOrderTimeline.cpp | 16 +- spine-cpp/src/spine/Event.cpp | 10 +- spine-cpp/src/spine/EventData.cpp | 8 +- spine-cpp/src/spine/EventTimeline.cpp | 7 +- spine-cpp/src/spine/Extension.cpp | 9 +- spine-cpp/src/spine/IkConstraint.cpp | 12 +- spine-cpp/src/spine/IkConstraintData.cpp | 4 +- spine-cpp/src/spine/IkConstraintTimeline.cpp | 11 +- spine-cpp/src/spine/InheritTimeline.cpp | 7 +- spine-cpp/src/spine/Json.cpp | 13 +- spine-cpp/src/spine/LinkedMesh.cpp | 18 +- spine-cpp/src/spine/MathUtil.cpp | 3 +- spine-cpp/src/spine/MeshAttachment.cpp | 12 +- spine-cpp/src/spine/PathAttachment.cpp | 3 +- spine-cpp/src/spine/PathConstraint.cpp | 29 +- spine-cpp/src/spine/PathConstraintData.cpp | 9 +- .../src/spine/PathConstraintMixTimeline.cpp | 7 +- .../spine/PathConstraintPositionTimeline.cpp | 11 +- .../spine/PathConstraintSpacingTimeline.cpp | 11 +- spine-cpp/src/spine/PhysicsConstraint.cpp | 15 +- spine-cpp/src/spine/PhysicsConstraintData.cpp | 9 +- spine-cpp/src/spine/PhysicsConstraintPose.cpp | 3 +- .../src/spine/PhysicsConstraintTimeline.cpp | 12 +- spine-cpp/src/spine/RegionAttachment.cpp | 15 +- spine-cpp/src/spine/RotateTimeline.cpp | 6 +- spine-cpp/src/spine/ScaleTimeline.cpp | 21 +- spine-cpp/src/spine/Sequence.cpp | 9 +- spine-cpp/src/spine/SequenceTimeline.cpp | 11 +- spine-cpp/src/spine/ShearTimeline.cpp | 21 +- spine-cpp/src/spine/Skeleton.cpp | 22 +- spine-cpp/src/spine/SkeletonBinary.cpp | 86 +- spine-cpp/src/spine/SkeletonBounds.cpp | 6 +- spine-cpp/src/spine/SkeletonClipping.cpp | 15 +- spine-cpp/src/spine/SkeletonData.cpp | 15 +- spine-cpp/src/spine/SkeletonJson.cpp | 121 +- spine-cpp/src/spine/SkeletonRenderer.cpp | 16 +- spine-cpp/src/spine/Skin.cpp | 6 +- spine-cpp/src/spine/Slider.cpp | 12 +- spine-cpp/src/spine/SliderData.cpp | 12 +- spine-cpp/src/spine/SliderMixTimeline.cpp | 11 +- spine-cpp/src/spine/SliderTimeline.cpp | 11 +- spine-cpp/src/spine/Slot.cpp | 6 +- spine-cpp/src/spine/SlotCurveTimeline.cpp | 4 +- spine-cpp/src/spine/SlotData.cpp | 8 +- spine-cpp/src/spine/SlotPose.cpp | 6 +- spine-cpp/src/spine/Timeline.cpp | 3 +- spine-cpp/src/spine/TransformConstraint.cpp | 9 +- .../src/spine/TransformConstraintData.cpp | 24 +- .../src/spine/TransformConstraintTimeline.cpp | 15 +- spine-cpp/src/spine/TranslateTimeline.cpp | 21 +- spine-cpp/src/spine/Triangulator.cpp | 10 +- spine-cpp/src/spine/VertexAttachment.cpp | 7 +- spine-cpp/tests/JsonWriter.h | 327 +- spine-cpp/tests/SkeletonSerializer.h | 8265 +++++++++-------- spine-glfw/src/spine-glfw.cpp | 14 +- spine-glfw/src/stb_image.h | 1161 ++- spine-godot/spine_godot/SpineAnimation.cpp | 8 +- spine-godot/spine_godot/SpineAnimation.h | 3 +- .../spine_godot/SpineAnimationState.cpp | 6 +- spine-godot/spine_godot/SpineAnimationState.h | 4 +- .../spine_godot/SpineAnimationTrack.cpp | 54 +- .../spine_godot/SpineAtlasResource.cpp | 14 +- spine-godot/spine_godot/SpineAtlasResource.h | 16 +- spine-godot/spine_godot/SpineBoneNode.cpp | 3 +- spine-godot/spine_godot/SpineBoneNode.h | 3 +- spine-godot/spine_godot/SpineCommon.h | 22 +- spine-godot/spine_godot/SpineEditorPlugin.cpp | 55 +- spine-godot/spine_godot/SpineEditorPlugin.h | 322 +- .../spine_godot/SpineIkConstraintData.h | 4 +- .../spine_godot/SpinePathConstraintData.h | 4 +- .../spine_godot/SpinePhysicsConstraintData.h | 4 +- spine-godot/spine_godot/SpineSkeleton.h | 8 +- .../spine_godot/SpineSkeletonDataResource.cpp | 347 +- .../spine_godot/SpineSkeletonDataResource.h | 25 +- .../spine_godot/SpineSkeletonFileResource.cpp | 7 +- .../spine_godot/SpineSkeletonFileResource.h | 20 +- spine-godot/spine_godot/SpineSkin.cpp | 3 +- spine-godot/spine_godot/SpineSlotNode.cpp | 15 +- spine-godot/spine_godot/SpineSlotNode.h | 4 +- spine-godot/spine_godot/SpineSprite.cpp | 179 +- spine-godot/spine_godot/SpineSprite.h | 145 +- spine-godot/spine_godot/SpineTimeline.cpp | 7 +- spine-godot/spine_godot/SpineTimeline.h | 3 +- .../SpineTransformConstraintData.h | 4 +- spine-godot/spine_godot/register_types.cpp | 3 +- .../SpineShadersStructs/SpineShadersStructs.h | 20 +- spine-sdl/example/main.cpp | 3 +- spine-sdl/src/spine-sdl-c.c | 15 +- spine-sdl/src/spine-sdl-cpp.cpp | 18 +- spine-sdl/src/stb_image.h | 1161 ++- spine-sfml/c/example/main.cpp | 7 +- spine-sfml/c/src/spine/spine-sfml.cpp | 21 +- spine-sfml/c/src/spine/spine-sfml.h | 8 +- spine-sfml/cpp/example/main.cpp | 16 +- spine-sfml/cpp/example/testbed.cpp | 6 +- spine-sfml/cpp/src/spine/spine-sfml.cpp | 22 +- spine-sfml/cpp/src/spine/spine-sfml.h | 8 +- .../Private/SpineAtlasImportFactory.cpp | 12 +- .../Private/SpineEditorPlugin.cpp | 32 +- .../Private/SpineSkeletonImportFactory.cpp | 12 +- .../Public/SpineAtlasImportFactory.h | 3 +- .../Public/SpineSkeletonImportFactory.h | 3 +- .../SpinePlugin/Private/SSpineWidget.cpp | 20 +- .../SpinePlugin/Private/SpineAtlasAsset.cpp | 12 +- .../Private/SpineBoneDriverComponent.cpp | 3 +- .../Private/SpineBoneFollowerComponent.cpp | 3 +- .../SpinePlugin/Private/SpinePlugin.cpp | 9 +- .../SpineSkeletonAnimationComponent.cpp | 6 +- .../Private/SpineSkeletonComponent.cpp | 15 +- .../Private/SpineSkeletonDataAsset.cpp | 162 +- .../SpineSkeletonRendererComponent.cpp | 20 +- .../SpinePlugin/Private/SpineWidget.cpp | 3 +- .../Source/SpinePlugin/Public/SSpineWidget.h | 10 +- .../Public/SpineSkeletonAnimationComponent.h | 94 +- .../Public/SpineSkeletonRendererComponent.h | 3 +- .../Source/SpinePlugin/Public/SpineWidget.h | 4 +- spine-ue/Source/SpineUE/MySceneComponent.cpp | 8 +- spine-ue/Source/SpineUE/MySceneComponent.h | 4 +- spine-ue/Source/SpineUE/SpineboyCppPawn.cpp | 13 +- spine-ue/Source/SpineUE/SpineboyCppPawn.h | 3 +- 494 files changed, 15243 insertions(+), 12242 deletions(-) mode change 100755 => 100644 spine-cpp/include/spine/HashMap.h diff --git a/formatters/.clang-format b/formatters/.clang-format index aa7be9bc6..4edd46c68 100644 --- a/formatters/.clang-format +++ b/formatters/.clang-format @@ -8,11 +8,11 @@ AlignOperands: DontAlign AllowAllArgumentsOnNextLine: true AllowAllConstructorInitializersOnNextLine: false AllowAllParametersOfDeclarationOnNextLine: true -AllowShortBlocksOnASingleLine: Always +AllowShortBlocksOnASingleLine: Never AllowShortCaseLabelsOnASingleLine: false AllowShortEnumsOnASingleLine: false -AllowShortFunctionsOnASingleLine: All -AllowShortIfStatementsOnASingleLine: Always +AllowShortFunctionsOnASingleLine: None +AllowShortIfStatementsOnASingleLine: WithoutElse AllowShortLambdasOnASingleLine: All AllowShortLoopsOnASingleLine: true AlwaysBreakAfterReturnType: None @@ -39,13 +39,13 @@ BreakBeforeTernaryOperators: true BreakAfterJavaFieldAnnotations: false PenaltyBreakBeforeFirstCallParameter: 200 PenaltyBreakAssignment: 1000 -PenaltyBreakFirstLessLess: 120 +PenaltyBreakFirstLessLess: 150 PenaltyExcessCharacter: 1000000 PenaltyBreakString: 1000 PenaltyReturnTypeOnItsOwnLine: 1000000 BreakConstructorInitializers: BeforeColon BreakInheritanceList: BeforeColon -ColumnLimit: 120 +ColumnLimit: 150 CompactNamespaces: false ContinuationIndentWidth: 4 DerivePointerAlignment: false diff --git a/spine-c/include/spine-c.h b/spine-c/include/spine-c.h index cbc4a99d1..f4b2aa0c5 100644 --- a/spine-c/include/spine-c.h +++ b/spine-c/include/spine-c.h @@ -166,4 +166,4 @@ #include "../src/generated/update.h" #include "../src/generated/vertex_attachment.h" -#endif // SPINE_C_H +#endif// SPINE_C_H diff --git a/spine-c/src/base.h b/spine-c/src/base.h index 3c68e1029..13005ecd8 100644 --- a/spine-c/src/base.h +++ b/spine-c/src/base.h @@ -56,12 +56,12 @@ #endif #endif -#define SPINE_OPAQUE_TYPE(name) \ - typedef struct name##_wrapper { \ - char _dummy; \ - } name##_wrapper; \ - typedef name##_wrapper *name; +#define SPINE_OPAQUE_TYPE(name) \ + typedef struct name##_wrapper { \ + char _dummy; \ + } name##_wrapper; \ + typedef name##_wrapper *name; typedef long long spine_property_id; -#endif // SPINE_C_BASE_H +#endif// SPINE_C_BASE_H diff --git a/spine-c/src/extensions.cpp b/spine-c/src/extensions.cpp index 34e1c818f..6ae705987 100644 --- a/spine-c/src/extensions.cpp +++ b/spine-c/src/extensions.cpp @@ -41,60 +41,60 @@ using namespace spine; // Internal structures struct _spine_atlas { - void *atlas; - const char **imagePaths; - int32_t numImagePaths; - const char *error; + void *atlas; + const char **imagePaths; + int32_t numImagePaths; + const char *error; }; struct _spine_skeleton_data_result { - spine_skeleton_data skeletonData; - const char *error; + spine_skeleton_data skeletonData; + const char *error; }; struct _spine_bounds { - float x, y, width, height; + float x, y, width, height; }; struct _spine_vector { - float x, y; + float x, y; }; struct _spine_skeleton_drawable : public SpineObject { - spine_skeleton skeleton; - spine_animation_state animationState; - spine_animation_state_data animationStateData; - spine_animation_state_events animationStateEvents; - SkeletonRenderer *renderer; + spine_skeleton skeleton; + spine_animation_state animationState; + spine_animation_state_data animationStateData; + spine_animation_state_events animationStateEvents; + SkeletonRenderer *renderer; }; struct _spine_skin_entry { - int32_t slotIndex; - const char *name; - spine_attachment attachment; + int32_t slotIndex; + const char *name; + spine_attachment attachment; }; struct _spine_skin_entries { - int32_t numEntries; - _spine_skin_entry *entries; + int32_t numEntries; + _spine_skin_entry *entries; }; // Animation state event tracking struct AnimationStateEvent { - EventType type; - TrackEntry *entry; - Event *event; - AnimationStateEvent(EventType type, TrackEntry *entry, Event *event) : type(type), entry(entry), event(event){}; + EventType type; + TrackEntry *entry; + Event *event; + AnimationStateEvent(EventType type, TrackEntry *entry, Event *event) : type(type), entry(entry), event(event) {}; }; class EventListener : public AnimationStateListenerObject, public SpineObject { public: - Array events; + Array events; - void callback(AnimationState *state, EventType type, TrackEntry *entry, Event *event) override { - events.add(AnimationStateEvent(type, entry, event)); - SP_UNUSED(state); - } + void callback(AnimationState *state, EventType type, TrackEntry *entry, Event *event) override { + events.add(AnimationStateEvent(type, entry, event)); + SP_UNUSED(state); + } }; // Static variables @@ -103,385 +103,385 @@ static SpineExtension *defaultExtension = nullptr; static DebugExtension *debugExtension = nullptr; static void initExtensions() { - if (defaultExtension == nullptr) { - defaultExtension = new DefaultSpineExtension(); - debugExtension = new DebugExtension(defaultExtension); - } + if (defaultExtension == nullptr) { + defaultExtension = new DefaultSpineExtension(); + debugExtension = new DebugExtension(defaultExtension); + } } namespace spine { - SpineExtension *getDefaultExtension() { - initExtensions(); - return defaultExtension; - } + SpineExtension *getDefaultExtension() { + initExtensions(); + return defaultExtension; + } } // Version functions int32_t spine_major_version() { - return SPINE_MAJOR_VERSION; + return SPINE_MAJOR_VERSION; } int32_t spine_minor_version() { - return SPINE_MINOR_VERSION; + return SPINE_MINOR_VERSION; } void spine_enable_debug_extension(bool enable) { - initExtensions(); - SpineExtension::setInstance(enable ? debugExtension : defaultExtension); + initExtensions(); + SpineExtension::setInstance(enable ? debugExtension : defaultExtension); } void spine_report_leaks() { - initExtensions(); - debugExtension->reportLeaks(); - fflush(stdout); + initExtensions(); + debugExtension->reportLeaks(); + fflush(stdout); } // Bounds functions float spine_bounds_get_x(spine_bounds bounds) { - if (!bounds) return 0; - return ((_spine_bounds *) bounds)->x; + if (!bounds) return 0; + return ((_spine_bounds *) bounds)->x; } float spine_bounds_get_y(spine_bounds bounds) { - if (!bounds) return 0; - return ((_spine_bounds *) bounds)->y; + if (!bounds) return 0; + return ((_spine_bounds *) bounds)->y; } float spine_bounds_get_width(spine_bounds bounds) { - if (!bounds) return 0; - return ((_spine_bounds *) bounds)->width; + if (!bounds) return 0; + return ((_spine_bounds *) bounds)->width; } float spine_bounds_get_height(spine_bounds bounds) { - if (!bounds) return 0; - return ((_spine_bounds *) bounds)->height; + if (!bounds) return 0; + return ((_spine_bounds *) bounds)->height; } // Vector functions float spine_vector_get_x(spine_vector vector) { - if (!vector) return 0; - return ((_spine_vector *) vector)->x; + if (!vector) return 0; + return ((_spine_vector *) vector)->x; } float spine_vector_get_y(spine_vector vector) { - if (!vector) return 0; - return ((_spine_vector *) vector)->y; + if (!vector) return 0; + return ((_spine_vector *) vector)->y; } // Atlas functions class LiteTextureLoad : public TextureLoader { - void load(AtlasPage &page, const String &path) { - page.texture = (void *) (intptr_t) page.index; - } + void load(AtlasPage &page, const String &path) { + page.texture = (void *) (intptr_t) page.index; + } - void unload(void *texture) { - } + void unload(void *texture) { + } }; static LiteTextureLoad liteLoader; spine_atlas spine_atlas_load(const char *atlasData) { - if (!atlasData) return nullptr; - int32_t length = (int32_t) strlen(atlasData); - auto atlas = new (__FILE__, __LINE__) Atlas(atlasData, length, "", &liteLoader, true); - _spine_atlas *result = SpineExtension::calloc<_spine_atlas>(1, __FILE__, __LINE__); - result->atlas = atlas; - result->numImagePaths = (int32_t) atlas->getPages().size(); - result->imagePaths = SpineExtension::calloc(result->numImagePaths, __FILE__, __LINE__); - for (int i = 0; i < result->numImagePaths; i++) { - result->imagePaths[i] = atlas->getPages()[i]->texturePath.buffer(); - } - return (spine_atlas) result; + if (!atlasData) return nullptr; + int32_t length = (int32_t) strlen(atlasData); + auto atlas = new (__FILE__, __LINE__) Atlas(atlasData, length, "", &liteLoader, true); + _spine_atlas *result = SpineExtension::calloc<_spine_atlas>(1, __FILE__, __LINE__); + result->atlas = atlas; + result->numImagePaths = (int32_t) atlas->getPages().size(); + result->imagePaths = SpineExtension::calloc(result->numImagePaths, __FILE__, __LINE__); + for (int i = 0; i < result->numImagePaths; i++) { + result->imagePaths[i] = atlas->getPages()[i]->texturePath.buffer(); + } + return (spine_atlas) result; } class CallbackTextureLoad : public TextureLoader { - spine_texture_loader_load_func loadCb; - spine_texture_loader_unload_func unloadCb; + spine_texture_loader_load_func loadCb; + spine_texture_loader_unload_func unloadCb; public: - CallbackTextureLoad() : loadCb(nullptr), unloadCb(nullptr) {} + CallbackTextureLoad() : loadCb(nullptr), unloadCb(nullptr) { + } - void setCallbacks(spine_texture_loader_load_func load, spine_texture_loader_unload_func unload) { - loadCb = load; - unloadCb = unload; - } + void setCallbacks(spine_texture_loader_load_func load, spine_texture_loader_unload_func unload) { + loadCb = load; + unloadCb = unload; + } - void load(AtlasPage &page, const String &path) { - page.texture = this->loadCb(path.buffer()); - } + void load(AtlasPage &page, const String &path) { + page.texture = this->loadCb(path.buffer()); + } - void unload(void *texture) { - this->unloadCb(texture); - } + void unload(void *texture) { + this->unloadCb(texture); + } }; static CallbackTextureLoad callbackLoader; -spine_atlas spine_atlas_load_callback(const char *atlasData, const char *atlasDir, - spine_texture_loader_load_func load, - spine_texture_loader_unload_func unload) { - if (!atlasData) return nullptr; - int32_t length = (int32_t) strlen(atlasData); - callbackLoader.setCallbacks(load, unload); - auto atlas = new (__FILE__, __LINE__) Atlas(atlasData, length, (const char *) atlasDir, &callbackLoader, true); - _spine_atlas *result = SpineExtension::calloc<_spine_atlas>(1, __FILE__, __LINE__); - result->atlas = atlas; - result->numImagePaths = (int32_t) atlas->getPages().size(); - result->imagePaths = SpineExtension::calloc(result->numImagePaths, __FILE__, __LINE__); - for (int i = 0; i < result->numImagePaths; i++) { - result->imagePaths[i] = atlas->getPages()[i]->texturePath.buffer(); - } - return (spine_atlas) result; +spine_atlas spine_atlas_load_callback(const char *atlasData, const char *atlasDir, spine_texture_loader_load_func load, + spine_texture_loader_unload_func unload) { + if (!atlasData) return nullptr; + int32_t length = (int32_t) strlen(atlasData); + callbackLoader.setCallbacks(load, unload); + auto atlas = new (__FILE__, __LINE__) Atlas(atlasData, length, (const char *) atlasDir, &callbackLoader, true); + _spine_atlas *result = SpineExtension::calloc<_spine_atlas>(1, __FILE__, __LINE__); + result->atlas = atlas; + result->numImagePaths = (int32_t) atlas->getPages().size(); + result->imagePaths = SpineExtension::calloc(result->numImagePaths, __FILE__, __LINE__); + for (int i = 0; i < result->numImagePaths; i++) { + result->imagePaths[i] = atlas->getPages()[i]->texturePath.buffer(); + } + return (spine_atlas) result; } int32_t spine_atlas_get_num_image_paths(spine_atlas atlas) { - if (!atlas) return 0; - return ((_spine_atlas *) atlas)->numImagePaths; + if (!atlas) return 0; + return ((_spine_atlas *) atlas)->numImagePaths; } const char *spine_atlas_get_image_path(spine_atlas atlas, int32_t index) { - if (!atlas) return nullptr; - _spine_atlas *_atlas = (_spine_atlas *) atlas; - if (index < 0 || index >= _atlas->numImagePaths) return nullptr; - return _atlas->imagePaths[index]; + if (!atlas) return nullptr; + _spine_atlas *_atlas = (_spine_atlas *) atlas; + if (index < 0 || index >= _atlas->numImagePaths) return nullptr; + return _atlas->imagePaths[index]; } bool spine_atlas_is_pma(spine_atlas atlas) { - if (!atlas) return false; - Atlas *_atlas = (Atlas *) ((_spine_atlas *) atlas)->atlas; - for (size_t i = 0; i < _atlas->getPages().size(); i++) { - AtlasPage *page = _atlas->getPages()[i]; - if (page->pma) return true; - } - return false; + if (!atlas) return false; + Atlas *_atlas = (Atlas *) ((_spine_atlas *) atlas)->atlas; + for (size_t i = 0; i < _atlas->getPages().size(); i++) { + AtlasPage *page = _atlas->getPages()[i]; + if (page->pma) return true; + } + return false; } const char *spine_atlas_get_error(spine_atlas atlas) { - if (!atlas) return nullptr; - return ((_spine_atlas *) atlas)->error; + if (!atlas) return nullptr; + return ((_spine_atlas *) atlas)->error; } void spine_atlas_dispose(spine_atlas atlas) { - if (!atlas) return; - _spine_atlas *_atlas = (_spine_atlas *) atlas; - if (_atlas->atlas) { - delete (Atlas *) _atlas->atlas; - } - if (_atlas->imagePaths) { - SpineExtension::free(_atlas->imagePaths, __FILE__, __LINE__); - } - if (_atlas->error) { - SpineExtension::free(_atlas->error, __FILE__, __LINE__); - } - SpineExtension::free(_atlas, __FILE__, __LINE__); + if (!atlas) return; + _spine_atlas *_atlas = (_spine_atlas *) atlas; + if (_atlas->atlas) { + delete (Atlas *) _atlas->atlas; + } + if (_atlas->imagePaths) { + SpineExtension::free(_atlas->imagePaths, __FILE__, __LINE__); + } + if (_atlas->error) { + SpineExtension::free(_atlas->error, __FILE__, __LINE__); + } + SpineExtension::free(_atlas, __FILE__, __LINE__); } // Skeleton data loading spine_skeleton_data_result spine_skeleton_data_load_json(spine_atlas atlas, const char *skeletonData, const char *path) { - if (!atlas || !skeletonData) return nullptr; - _spine_skeleton_data_result *result = SpineExtension::calloc<_spine_skeleton_data_result>(1, __FILE__, __LINE__); - SkeletonJson json((Atlas *) ((_spine_atlas *) atlas)->atlas); - json.setScale(1); + if (!atlas || !skeletonData) return nullptr; + _spine_skeleton_data_result *result = SpineExtension::calloc<_spine_skeleton_data_result>(1, __FILE__, __LINE__); + SkeletonJson json((Atlas *) ((_spine_atlas *) atlas)->atlas); + json.setScale(1); - SkeletonData *data = json.readSkeletonData(skeletonData); - if (!data) { - result->error = (const char *) strdup("Failed to load skeleton data"); - return (spine_skeleton_data_result) result; - } + SkeletonData *data = json.readSkeletonData(skeletonData); + if (!data) { + result->error = (const char *) strdup("Failed to load skeleton data"); + return (spine_skeleton_data_result) result; + } - // Set name from path if provided - if (path != nullptr && data != nullptr) { - String pathStr(path); + // Set name from path if provided + if (path != nullptr && data != nullptr) { + String pathStr(path); - // Extract filename without extension from path - int lastSlash = pathStr.lastIndexOf('/'); - int lastBackslash = pathStr.lastIndexOf('\\'); - int start = 0; + // Extract filename without extension from path + int lastSlash = pathStr.lastIndexOf('/'); + int lastBackslash = pathStr.lastIndexOf('\\'); + int start = 0; - if (lastSlash != -1) start = lastSlash + 1; - if (lastBackslash != -1 && lastBackslash > start) start = lastBackslash + 1; + if (lastSlash != -1) start = lastSlash + 1; + if (lastBackslash != -1 && lastBackslash > start) start = lastBackslash + 1; - int lastDot = pathStr.lastIndexOf('.'); - if (lastDot != -1 && lastDot > start) { - data->setName(pathStr.substring(start, lastDot - start)); - } else { - data->setName(pathStr.substring(start)); - } - } + int lastDot = pathStr.lastIndexOf('.'); + if (lastDot != -1 && lastDot > start) { + data->setName(pathStr.substring(start, lastDot - start)); + } else { + data->setName(pathStr.substring(start)); + } + } - result->skeletonData = (spine_skeleton_data) data; - return (spine_skeleton_data_result) result; + result->skeletonData = (spine_skeleton_data) data; + return (spine_skeleton_data_result) result; } spine_skeleton_data_result spine_skeleton_data_load_binary(spine_atlas atlas, const uint8_t *skeletonData, int32_t length, const char *path) { - if (!atlas || !skeletonData) return nullptr; - _spine_skeleton_data_result *result = SpineExtension::calloc<_spine_skeleton_data_result>(1, __FILE__, __LINE__); - SkeletonBinary binary((Atlas *) ((_spine_atlas *) atlas)->atlas); - binary.setScale(1); + if (!atlas || !skeletonData) return nullptr; + _spine_skeleton_data_result *result = SpineExtension::calloc<_spine_skeleton_data_result>(1, __FILE__, __LINE__); + SkeletonBinary binary((Atlas *) ((_spine_atlas *) atlas)->atlas); + binary.setScale(1); - SkeletonData *data = binary.readSkeletonData((const unsigned char *) skeletonData, length); - if (!data) { - result->error = (const char *) strdup("Failed to load skeleton data"); - return (spine_skeleton_data_result) result; - } + SkeletonData *data = binary.readSkeletonData((const unsigned char *) skeletonData, length); + if (!data) { + result->error = (const char *) strdup("Failed to load skeleton data"); + return (spine_skeleton_data_result) result; + } - // Set name from path if provided - if (path != nullptr && data != nullptr) { - String pathStr(path); + // Set name from path if provided + if (path != nullptr && data != nullptr) { + String pathStr(path); - // Extract filename without extension from path - int lastSlash = pathStr.lastIndexOf('/'); - int lastBackslash = pathStr.lastIndexOf('\\'); - int start = 0; + // Extract filename without extension from path + int lastSlash = pathStr.lastIndexOf('/'); + int lastBackslash = pathStr.lastIndexOf('\\'); + int start = 0; - if (lastSlash != -1) start = lastSlash + 1; - if (lastBackslash != -1 && lastBackslash > start) start = lastBackslash + 1; + if (lastSlash != -1) start = lastSlash + 1; + if (lastBackslash != -1 && lastBackslash > start) start = lastBackslash + 1; - int lastDot = pathStr.lastIndexOf('.'); - if (lastDot != -1 && lastDot > start) { - data->setName(pathStr.substring(start, lastDot - start)); - } else { - data->setName(pathStr.substring(start)); - } - } + int lastDot = pathStr.lastIndexOf('.'); + if (lastDot != -1 && lastDot > start) { + data->setName(pathStr.substring(start, lastDot - start)); + } else { + data->setName(pathStr.substring(start)); + } + } - result->skeletonData = (spine_skeleton_data) data; - return (spine_skeleton_data_result) result; + result->skeletonData = (spine_skeleton_data) data; + return (spine_skeleton_data_result) result; } const char *spine_skeleton_data_result_get_error(spine_skeleton_data_result result) { - if (!result) return nullptr; - return ((_spine_skeleton_data_result *) result)->error; + if (!result) return nullptr; + return ((_spine_skeleton_data_result *) result)->error; } spine_skeleton_data spine_skeleton_data_result_get_data(spine_skeleton_data_result result) { - if (!result) return nullptr; - return ((_spine_skeleton_data_result *) result)->skeletonData; + if (!result) return nullptr; + return ((_spine_skeleton_data_result *) result)->skeletonData; } void spine_skeleton_data_result_dispose(spine_skeleton_data_result result) { - if (!result) return; - _spine_skeleton_data_result *_result = (_spine_skeleton_data_result *) result; - if (_result->error) { - SpineExtension::free(_result->error, __FILE__, __LINE__); - } - SpineExtension::free(_result, __FILE__, __LINE__); + if (!result) return; + _spine_skeleton_data_result *_result = (_spine_skeleton_data_result *) result; + if (_result->error) { + SpineExtension::free(_result->error, __FILE__, __LINE__); + } + SpineExtension::free(_result, __FILE__, __LINE__); } // Skeleton drawable spine_skeleton_drawable spine_skeleton_drawable_create(spine_skeleton_data skeletonData) { - if (!skeletonData) return nullptr; - _spine_skeleton_drawable *drawable = new (__FILE__, __LINE__) _spine_skeleton_drawable(); + if (!skeletonData) return nullptr; + _spine_skeleton_drawable *drawable = new (__FILE__, __LINE__) _spine_skeleton_drawable(); - Skeleton *skeleton = new (__FILE__, __LINE__) Skeleton(*((SkeletonData *) skeletonData)); - AnimationStateData *stateData = new (__FILE__, __LINE__) AnimationStateData((SkeletonData *) skeletonData); - AnimationState *state = new (__FILE__, __LINE__) AnimationState(stateData); - EventListener *listener = new (__FILE__, __LINE__) EventListener(); - state->setListener(listener); + Skeleton *skeleton = new (__FILE__, __LINE__) Skeleton(*((SkeletonData *) skeletonData)); + AnimationStateData *stateData = new (__FILE__, __LINE__) AnimationStateData((SkeletonData *) skeletonData); + AnimationState *state = new (__FILE__, __LINE__) AnimationState(stateData); + EventListener *listener = new (__FILE__, __LINE__) EventListener(); + state->setListener(listener); - drawable->skeleton = (spine_skeleton) skeleton; - drawable->animationStateData = (spine_animation_state_data) stateData; - drawable->animationState = (spine_animation_state) state; - drawable->animationStateEvents = (spine_animation_state_events) listener; - drawable->renderer = new (__FILE__, __LINE__) SkeletonRenderer(); + drawable->skeleton = (spine_skeleton) skeleton; + drawable->animationStateData = (spine_animation_state_data) stateData; + drawable->animationState = (spine_animation_state) state; + drawable->animationStateEvents = (spine_animation_state_events) listener; + drawable->renderer = new (__FILE__, __LINE__) SkeletonRenderer(); - return (spine_skeleton_drawable) drawable; + return (spine_skeleton_drawable) drawable; } spine_render_command spine_skeleton_drawable_render(spine_skeleton_drawable drawable) { - if (!drawable) return nullptr; - _spine_skeleton_drawable *_drawable = (_spine_skeleton_drawable *) drawable; - Skeleton *skeleton = (Skeleton *) _drawable->skeleton; - SkeletonRenderer *renderer = _drawable->renderer; + if (!drawable) return nullptr; + _spine_skeleton_drawable *_drawable = (_spine_skeleton_drawable *) drawable; + Skeleton *skeleton = (Skeleton *) _drawable->skeleton; + SkeletonRenderer *renderer = _drawable->renderer; - RenderCommand *commands = renderer->render(*skeleton); - return (spine_render_command) commands; + RenderCommand *commands = renderer->render(*skeleton); + return (spine_render_command) commands; } void spine_skeleton_drawable_dispose(spine_skeleton_drawable drawable) { - if (!drawable) return; - _spine_skeleton_drawable *_drawable = (_spine_skeleton_drawable *) drawable; + if (!drawable) return; + _spine_skeleton_drawable *_drawable = (_spine_skeleton_drawable *) drawable; - if (_drawable->renderer) { - delete _drawable->renderer; - } - if (_drawable->animationState) { - delete (AnimationState *) _drawable->animationState; - } - if (_drawable->animationStateData) { - delete (AnimationStateData *) _drawable->animationStateData; - } - if (_drawable->skeleton) { - delete (Skeleton *) _drawable->skeleton; - } - if (_drawable->animationStateEvents) { - delete (EventListener *) _drawable->animationStateEvents; - } + if (_drawable->renderer) { + delete _drawable->renderer; + } + if (_drawable->animationState) { + delete (AnimationState *) _drawable->animationState; + } + if (_drawable->animationStateData) { + delete (AnimationStateData *) _drawable->animationStateData; + } + if (_drawable->skeleton) { + delete (Skeleton *) _drawable->skeleton; + } + if (_drawable->animationStateEvents) { + delete (EventListener *) _drawable->animationStateEvents; + } - delete _drawable; + delete _drawable; } spine_skeleton spine_skeleton_drawable_get_skeleton(spine_skeleton_drawable drawable) { - if (!drawable) return nullptr; - return ((_spine_skeleton_drawable *) drawable)->skeleton; + if (!drawable) return nullptr; + return ((_spine_skeleton_drawable *) drawable)->skeleton; } spine_animation_state spine_skeleton_drawable_get_animation_state(spine_skeleton_drawable drawable) { - if (!drawable) return nullptr; - return ((_spine_skeleton_drawable *) drawable)->animationState; + if (!drawable) return nullptr; + return ((_spine_skeleton_drawable *) drawable)->animationState; } spine_animation_state_data spine_skeleton_drawable_get_animation_state_data(spine_skeleton_drawable drawable) { - if (!drawable) return nullptr; - return ((_spine_skeleton_drawable *) drawable)->animationStateData; + if (!drawable) return nullptr; + return ((_spine_skeleton_drawable *) drawable)->animationStateData; } spine_animation_state_events spine_skeleton_drawable_get_animation_state_events(spine_skeleton_drawable drawable) { - if (!drawable) return nullptr; - return ((_spine_skeleton_drawable *) drawable)->animationStateEvents; + if (!drawable) return nullptr; + return ((_spine_skeleton_drawable *) drawable)->animationStateEvents; } // Skin entries spine_skin_entries spine_skin_entries_create() { - _spine_skin_entries *entries = SpineExtension::calloc<_spine_skin_entries>(1, __FILE__, __LINE__); - return (spine_skin_entries) entries; + _spine_skin_entries *entries = SpineExtension::calloc<_spine_skin_entries>(1, __FILE__, __LINE__); + return (spine_skin_entries) entries; } void spine_skin_entries_dispose(spine_skin_entries entries) { - if (!entries) return; - _spine_skin_entries *_entries = (_spine_skin_entries *) entries; - if (_entries->entries) { - for (int i = 0; i < _entries->numEntries; i++) { - if (_entries->entries[i].name) { - SpineExtension::free(_entries->entries[i].name, __FILE__, __LINE__); - } - } - SpineExtension::free(_entries->entries, __FILE__, __LINE__); - } - SpineExtension::free(_entries, __FILE__, __LINE__); + if (!entries) return; + _spine_skin_entries *_entries = (_spine_skin_entries *) entries; + if (_entries->entries) { + for (int i = 0; i < _entries->numEntries; i++) { + if (_entries->entries[i].name) { + SpineExtension::free(_entries->entries[i].name, __FILE__, __LINE__); + } + } + SpineExtension::free(_entries->entries, __FILE__, __LINE__); + } + SpineExtension::free(_entries, __FILE__, __LINE__); } int32_t spine_skin_entries_get_num_entries(spine_skin_entries entries) { - if (!entries) return 0; - return ((_spine_skin_entries *) entries)->numEntries; + if (!entries) return 0; + return ((_spine_skin_entries *) entries)->numEntries; } spine_skin_entry spine_skin_entries_get_entry(spine_skin_entries entries, int32_t index) { - if (!entries) return nullptr; - _spine_skin_entries *_entries = (_spine_skin_entries *) entries; - if (index < 0 || index >= _entries->numEntries) return nullptr; - return (spine_skin_entry) &_entries->entries[index]; + if (!entries) return nullptr; + _spine_skin_entries *_entries = (_spine_skin_entries *) entries; + if (index < 0 || index >= _entries->numEntries) return nullptr; + return (spine_skin_entry) &_entries->entries[index]; } int32_t spine_skin_entry_get_slot_index(spine_skin_entry entry) { - if (!entry) return 0; - return ((_spine_skin_entry *) entry)->slotIndex; + if (!entry) return 0; + return ((_spine_skin_entry *) entry)->slotIndex; } const char *spine_skin_entry_get_name(spine_skin_entry entry) { - if (!entry) return nullptr; - return ((_spine_skin_entry *) entry)->name; + if (!entry) return nullptr; + return ((_spine_skin_entry *) entry)->name; } spine_attachment spine_skin_entry_get_attachment(spine_skin_entry entry) { - if (!entry) return nullptr; - return ((_spine_skin_entry *) entry)->attachment; + if (!entry) return nullptr; + return ((_spine_skin_entry *) entry)->attachment; } \ No newline at end of file diff --git a/spine-c/src/extensions.h b/spine-c/src/extensions.h index 324b3e821..fb504fb96 100644 --- a/spine-c/src/extensions.h +++ b/spine-c/src/extensions.h @@ -47,11 +47,11 @@ SPINE_OPAQUE_TYPE(spine_skin_entries) SPINE_OPAQUE_TYPE(spine_texture_loader) // Additional types -typedef void* spine_void; -typedef void (*spine_dispose_renderer_object)(void*); +typedef void *spine_void; +typedef void (*spine_dispose_renderer_object)(void *); // Texture loader callbacks -typedef void* (*spine_texture_loader_load_func)(const char *path); +typedef void *(*spine_texture_loader_load_func)(const char *path); typedef void (*spine_texture_loader_unload_func)(void *texture); // Version functions @@ -72,9 +72,8 @@ SPINE_C_API float spine_vector_get_y(spine_vector vector); // Atlas functions SPINE_C_API spine_atlas spine_atlas_load(const char *atlasData); -SPINE_C_API spine_atlas spine_atlas_load_callback(const char *atlasData, const char *atlasDir, - spine_texture_loader_load_func load, - spine_texture_loader_unload_func unload); +SPINE_C_API spine_atlas spine_atlas_load_callback(const char *atlasData, const char *atlasDir, spine_texture_loader_load_func load, + spine_texture_loader_unload_func unload); SPINE_C_API int32_t spine_atlas_get_num_image_paths(spine_atlas atlas); SPINE_C_API const char *spine_atlas_get_image_path(spine_atlas atlas, int32_t index); SPINE_C_API bool spine_atlas_is_pma(spine_atlas atlas); @@ -83,7 +82,8 @@ SPINE_C_API void spine_atlas_dispose(spine_atlas atlas); // Skeleton data functions SPINE_C_API spine_skeleton_data_result spine_skeleton_data_load_json(spine_atlas atlas, const char *skeletonData, const char *path); -SPINE_C_API spine_skeleton_data_result spine_skeleton_data_load_binary(spine_atlas atlas, const uint8_t *skeletonData, int32_t length, const char *path); +SPINE_C_API spine_skeleton_data_result spine_skeleton_data_load_binary(spine_atlas atlas, const uint8_t *skeletonData, int32_t length, + const char *path); SPINE_C_API const char *spine_skeleton_data_result_get_error(spine_skeleton_data_result result); SPINE_C_API spine_skeleton_data spine_skeleton_data_result_get_data(spine_skeleton_data_result result); SPINE_C_API void spine_skeleton_data_result_dispose(spine_skeleton_data_result result); @@ -112,4 +112,4 @@ SPINE_C_API spine_attachment spine_skin_entry_get_attachment(spine_skin_entry en } #endif -#endif // SPINE_C_EXTENSIONS_H +#endif// SPINE_C_EXTENSIONS_H diff --git a/spine-c/src/generated/alpha_timeline.cpp b/spine-c/src/generated/alpha_timeline.cpp index e3d261dec..3dbe38304 100644 --- a/spine-c/src/generated/alpha_timeline.cpp +++ b/spine-c/src/generated/alpha_timeline.cpp @@ -4,93 +4,119 @@ using namespace spine; spine_alpha_timeline spine_alpha_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex) { - return (spine_alpha_timeline) new (__FILE__, __LINE__) AlphaTimeline(frameCount, bezierCount, slotIndex); + return (spine_alpha_timeline) new (__FILE__, __LINE__) AlphaTimeline(frameCount, bezierCount, slotIndex); } void spine_alpha_timeline_dispose(spine_alpha_timeline self) { - delete (AlphaTimeline*)self; + delete (AlphaTimeline *) self; } spine_rtti spine_alpha_timeline_get_rtti(spine_alpha_timeline self) { - return (spine_rtti)&((AlphaTimeline*)self)->getRTTI(); + AlphaTimeline *_self = (AlphaTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_alpha_timeline_apply(spine_alpha_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((AlphaTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_alpha_timeline_apply(spine_alpha_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + AlphaTimeline *_self = (AlphaTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_alpha_timeline_set_frame(spine_alpha_timeline self, size_t frame, float time, float value) { - ((CurveTimeline1*)(AlphaTimeline*)self)->setFrame(frame, time, value); + CurveTimeline1 *_self = (CurveTimeline1 *) (AlphaTimeline *) self; + _self->setFrame(frame, time, value); } float spine_alpha_timeline_get_curve_value(spine_alpha_timeline self, float time) { - return ((CurveTimeline1*)(AlphaTimeline*)self)->getCurveValue(time); + CurveTimeline1 *_self = (CurveTimeline1 *) (AlphaTimeline *) self; + return _self->getCurveValue(time); } float spine_alpha_timeline_get_relative_value(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((CurveTimeline1*)(AlphaTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); + CurveTimeline1 *_self = (CurveTimeline1 *) (AlphaTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_alpha_timeline_get_absolute_value_1(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((CurveTimeline1*)(AlphaTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_alpha_timeline_get_absolute_value_1(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + CurveTimeline1 *_self = (CurveTimeline1 *) (AlphaTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_alpha_timeline_get_absolute_value_2(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((CurveTimeline1*)(AlphaTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_alpha_timeline_get_absolute_value_2(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, + float value) { + CurveTimeline1 *_self = (CurveTimeline1 *) (AlphaTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_alpha_timeline_get_scale_value(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((CurveTimeline1*)(AlphaTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_alpha_timeline_get_scale_value(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, + float current, float setup) { + CurveTimeline1 *_self = (CurveTimeline1 *) (AlphaTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_alpha_timeline_set_linear(spine_alpha_timeline self, size_t frame) { - ((CurveTimeline1*)(AlphaTimeline*)self)->setLinear(frame); + CurveTimeline1 *_self = (CurveTimeline1 *) (AlphaTimeline *) self; + _self->setLinear(frame); } void spine_alpha_timeline_set_stepped(spine_alpha_timeline self, size_t frame) { - ((CurveTimeline1*)(AlphaTimeline*)self)->setStepped(frame); + CurveTimeline1 *_self = (CurveTimeline1 *) (AlphaTimeline *) self; + _self->setStepped(frame); } -void spine_alpha_timeline_set_bezier(spine_alpha_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((CurveTimeline1*)(AlphaTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_alpha_timeline_set_bezier(spine_alpha_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, + float cy1, float cx2, float cy2, float time2, float value2) { + CurveTimeline1 *_self = (CurveTimeline1 *) (AlphaTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_alpha_timeline_get_bezier_value(spine_alpha_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((CurveTimeline1*)(AlphaTimeline*)self)->getBezierValue(time, frame, valueOffset, i); + CurveTimeline1 *_self = (CurveTimeline1 *) (AlphaTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_alpha_timeline_get_curves(spine_alpha_timeline self) { - return (spine_array_float)&((CurveTimeline1*)(AlphaTimeline*)self)->getCurves(); + CurveTimeline1 *_self = (CurveTimeline1 *) (AlphaTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_alpha_timeline_get_frame_entries(spine_alpha_timeline self) { - return ((CurveTimeline1*)(AlphaTimeline*)self)->getFrameEntries(); + CurveTimeline1 *_self = (CurveTimeline1 *) (AlphaTimeline *) self; + return _self->getFrameEntries(); } size_t spine_alpha_timeline_get_frame_count(spine_alpha_timeline self) { - return ((CurveTimeline1*)(AlphaTimeline*)self)->getFrameCount(); + CurveTimeline1 *_self = (CurveTimeline1 *) (AlphaTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_alpha_timeline_get_frames(spine_alpha_timeline self) { - return (spine_array_float)&((CurveTimeline1*)(AlphaTimeline*)self)->getFrames(); + CurveTimeline1 *_self = (CurveTimeline1 *) (AlphaTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_alpha_timeline_get_duration(spine_alpha_timeline self) { - return ((CurveTimeline1*)(AlphaTimeline*)self)->getDuration(); + CurveTimeline1 *_self = (CurveTimeline1 *) (AlphaTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_alpha_timeline_get_property_ids(spine_alpha_timeline self) { - return (spine_array_property_id)&((CurveTimeline1*)(AlphaTimeline*)self)->getPropertyIds(); + CurveTimeline1 *_self = (CurveTimeline1 *) (AlphaTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_alpha_timeline_get_slot_index(spine_alpha_timeline self) { - return ((SlotTimeline*)(AlphaTimeline*)self)->getSlotIndex(); + SlotTimeline *_self = (SlotTimeline *) (AlphaTimeline *) self; + return _self->getSlotIndex(); } void spine_alpha_timeline_set_slot_index(spine_alpha_timeline self, int inValue) { - ((SlotTimeline*)(AlphaTimeline*)self)->setSlotIndex(inValue); + SlotTimeline *_self = (SlotTimeline *) (AlphaTimeline *) self; + _self->setSlotIndex(inValue); } spine_rtti spine_alpha_timeline_rtti(void) { - return (spine_rtti)&AlphaTimeline::rtti; + return (spine_rtti) &AlphaTimeline::rtti; } diff --git a/spine-c/src/generated/alpha_timeline.h b/spine-c/src/generated/alpha_timeline.h index 60e05ce25..bf07301b3 100644 --- a/spine-c/src/generated/alpha_timeline.h +++ b/spine-c/src/generated/alpha_timeline.h @@ -13,16 +13,22 @@ SPINE_C_API spine_alpha_timeline spine_alpha_timeline_create(size_t frameCount, SPINE_C_API void spine_alpha_timeline_dispose(spine_alpha_timeline self); SPINE_C_API spine_rtti spine_alpha_timeline_get_rtti(spine_alpha_timeline self); -SPINE_C_API void spine_alpha_timeline_apply(spine_alpha_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_alpha_timeline_apply(spine_alpha_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); SPINE_C_API void spine_alpha_timeline_set_frame(spine_alpha_timeline self, size_t frame, float time, float value); SPINE_C_API float spine_alpha_timeline_get_curve_value(spine_alpha_timeline self, float time); -SPINE_C_API float spine_alpha_timeline_get_relative_value(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_alpha_timeline_get_absolute_value_1(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_alpha_timeline_get_absolute_value_2(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_alpha_timeline_get_scale_value(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_alpha_timeline_get_relative_value(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup); +SPINE_C_API float spine_alpha_timeline_get_absolute_value_1(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup); +SPINE_C_API float spine_alpha_timeline_get_absolute_value_2(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup, float value); +SPINE_C_API float spine_alpha_timeline_get_scale_value(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup); SPINE_C_API void spine_alpha_timeline_set_linear(spine_alpha_timeline self, size_t frame); SPINE_C_API void spine_alpha_timeline_set_stepped(spine_alpha_timeline self, size_t frame); -SPINE_C_API void spine_alpha_timeline_set_bezier(spine_alpha_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_alpha_timeline_set_bezier(spine_alpha_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_alpha_timeline_get_bezier_value(spine_alpha_timeline self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_alpha_timeline_get_curves(spine_alpha_timeline self); SPINE_C_API size_t spine_alpha_timeline_get_frame_entries(spine_alpha_timeline self); diff --git a/spine-c/src/generated/animation.cpp b/spine-c/src/generated/animation.cpp index 2b662a422..8b5fdcee4 100644 --- a/spine-c/src/generated/animation.cpp +++ b/spine-c/src/generated/animation.cpp @@ -3,50 +3,60 @@ using namespace spine; -spine_animation spine_animation_create(const char * name, spine_array_timeline timelines, float duration) { - return (spine_animation) new (__FILE__, __LINE__) Animation(String(name), *((Array*)timelines), duration); +spine_animation spine_animation_create(const char *name, spine_array_timeline timelines, float duration) { + return (spine_animation) new (__FILE__, __LINE__) Animation(String(name), *((Array *) timelines), duration); } void spine_animation_dispose(spine_animation self) { - delete (Animation*)self; + delete (Animation *) self; } spine_array_timeline spine_animation_get_timelines(spine_animation self) { - return (spine_array_timeline)&((Animation*)self)->getTimelines(); + Animation *_self = (Animation *) self; + return (spine_array_timeline) &_self->getTimelines(); } void spine_animation_set_timelines(spine_animation self, spine_array_timeline timelines) { - ((Animation*)self)->setTimelines(*((Array*)timelines)); + Animation *_self = (Animation *) self; + _self->setTimelines(*((Array *) timelines)); } bool spine_animation_has_timeline(spine_animation self, spine_array_property_id ids) { - return ((Animation*)self)->hasTimeline(*((Array*)ids)); + Animation *_self = (Animation *) self; + return _self->hasTimeline(*((Array *) ids)); } float spine_animation_get_duration(spine_animation self) { - return ((Animation*)self)->getDuration(); + Animation *_self = (Animation *) self; + return _self->getDuration(); } void spine_animation_set_duration(spine_animation self, float inValue) { - ((Animation*)self)->setDuration(inValue); + Animation *_self = (Animation *) self; + _self->setDuration(inValue); } -void spine_animation_apply(spine_animation self, spine_skeleton skeleton, float lastTime, float time, bool loop, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((Animation*)self)->apply(*((Skeleton*)skeleton), lastTime, time, loop, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_animation_apply(spine_animation self, spine_skeleton skeleton, float lastTime, float time, bool loop, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + Animation *_self = (Animation *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, loop, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } -const char * spine_animation_get_name(spine_animation self) { - return ((Animation*)self)->getName().buffer(); +const char *spine_animation_get_name(spine_animation self) { + Animation *_self = (Animation *) self; + return _self->getName().buffer(); } spine_array_int spine_animation_get_bones(spine_animation self) { - return (spine_array_int)&((Animation*)self)->getBones(); + Animation *_self = (Animation *) self; + return (spine_array_int) &_self->getBones(); } int spine_animation_search_1(spine_array_float values, float target) { - return Animation::search(*((Array*)values), target); + return Animation::search(*((Array *) values), target); } int spine_animation_search_2(spine_array_float values, float target, int step) { - return Animation::search(*((Array*)values), target, step); + return Animation::search(*((Array *) values), target, step); } diff --git a/spine-c/src/generated/animation.h b/spine-c/src/generated/animation.h index 96eaf2e27..02c24ad7f 100644 --- a/spine-c/src/generated/animation.h +++ b/spine-c/src/generated/animation.h @@ -8,7 +8,7 @@ extern "C" { #endif -SPINE_C_API spine_animation spine_animation_create(const char * name, spine_array_timeline timelines, float duration); +SPINE_C_API spine_animation spine_animation_create(const char *name, spine_array_timeline timelines, float duration); SPINE_C_API void spine_animation_dispose(spine_animation self); @@ -17,8 +17,10 @@ SPINE_C_API void spine_animation_set_timelines(spine_animation self, spine_array SPINE_C_API bool spine_animation_has_timeline(spine_animation self, spine_array_property_id ids); SPINE_C_API float spine_animation_get_duration(spine_animation self); SPINE_C_API void spine_animation_set_duration(spine_animation self, float inValue); -SPINE_C_API void spine_animation_apply(spine_animation self, spine_skeleton skeleton, float lastTime, float time, bool loop, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); -SPINE_C_API const char * spine_animation_get_name(spine_animation self); +SPINE_C_API void spine_animation_apply(spine_animation self, spine_skeleton skeleton, float lastTime, float time, bool loop, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); +SPINE_C_API const char *spine_animation_get_name(spine_animation self); SPINE_C_API spine_array_int spine_animation_get_bones(spine_animation self); SPINE_C_API int spine_animation_search_1(spine_array_float values, float target); SPINE_C_API int spine_animation_search_2(spine_array_float values, float target, int step); diff --git a/spine-c/src/generated/animation_state.cpp b/spine-c/src/generated/animation_state.cpp index d3a998470..b4a7a9d8f 100644 --- a/spine-c/src/generated/animation_state.cpp +++ b/spine-c/src/generated/animation_state.cpp @@ -4,97 +4,121 @@ using namespace spine; spine_animation_state spine_animation_state_create(spine_animation_state_data data) { - return (spine_animation_state) new (__FILE__, __LINE__) AnimationState((AnimationStateData *)data); + return (spine_animation_state) new (__FILE__, __LINE__) AnimationState((AnimationStateData *) data); } void spine_animation_state_dispose(spine_animation_state self) { - delete (AnimationState*)self; + delete (AnimationState *) self; } void spine_animation_state_update(spine_animation_state self, float delta) { - ((AnimationState*)self)->update(delta); + AnimationState *_self = (AnimationState *) self; + _self->update(delta); } bool spine_animation_state_apply(spine_animation_state self, spine_skeleton skeleton) { - return ((AnimationState*)self)->apply(*((Skeleton*)skeleton)); + AnimationState *_self = (AnimationState *) self; + return _self->apply(*((Skeleton *) skeleton)); } void spine_animation_state_clear_tracks(spine_animation_state self) { - ((AnimationState*)self)->clearTracks(); + AnimationState *_self = (AnimationState *) self; + _self->clearTracks(); } void spine_animation_state_clear_track(spine_animation_state self, size_t trackIndex) { - ((AnimationState*)self)->clearTrack(trackIndex); + AnimationState *_self = (AnimationState *) self; + _self->clearTrack(trackIndex); } -spine_track_entry spine_animation_state_set_animation_1(spine_animation_state self, size_t trackIndex, const char * animationName, bool loop) { - return (spine_track_entry)((AnimationState*)self)->setAnimation(trackIndex, String(animationName), loop); +spine_track_entry spine_animation_state_set_animation_1(spine_animation_state self, size_t trackIndex, const char *animationName, bool loop) { + AnimationState *_self = (AnimationState *) self; + return (spine_track_entry) _self->setAnimation(trackIndex, String(animationName), loop); } spine_track_entry spine_animation_state_set_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation, bool loop) { - return (spine_track_entry)((AnimationState*)self)->setAnimation(trackIndex, (Animation *)animation, loop); + AnimationState *_self = (AnimationState *) self; + return (spine_track_entry) _self->setAnimation(trackIndex, (Animation *) animation, loop); } -spine_track_entry spine_animation_state_add_animation_1(spine_animation_state self, size_t trackIndex, const char * animationName, bool loop, float delay) { - return (spine_track_entry)((AnimationState*)self)->addAnimation(trackIndex, String(animationName), loop, delay); +spine_track_entry spine_animation_state_add_animation_1(spine_animation_state self, size_t trackIndex, const char *animationName, bool loop, + float delay) { + AnimationState *_self = (AnimationState *) self; + return (spine_track_entry) _self->addAnimation(trackIndex, String(animationName), loop, delay); } -spine_track_entry spine_animation_state_add_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation, bool loop, float delay) { - return (spine_track_entry)((AnimationState*)self)->addAnimation(trackIndex, (Animation *)animation, loop, delay); +spine_track_entry spine_animation_state_add_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation, bool loop, + float delay) { + AnimationState *_self = (AnimationState *) self; + return (spine_track_entry) _self->addAnimation(trackIndex, (Animation *) animation, loop, delay); } spine_track_entry spine_animation_state_set_empty_animation(spine_animation_state self, size_t trackIndex, float mixDuration) { - return (spine_track_entry)((AnimationState*)self)->setEmptyAnimation(trackIndex, mixDuration); + AnimationState *_self = (AnimationState *) self; + return (spine_track_entry) _self->setEmptyAnimation(trackIndex, mixDuration); } spine_track_entry spine_animation_state_add_empty_animation(spine_animation_state self, size_t trackIndex, float mixDuration, float delay) { - return (spine_track_entry)((AnimationState*)self)->addEmptyAnimation(trackIndex, mixDuration, delay); + AnimationState *_self = (AnimationState *) self; + return (spine_track_entry) _self->addEmptyAnimation(trackIndex, mixDuration, delay); } void spine_animation_state_set_empty_animations(spine_animation_state self, float mixDuration) { - ((AnimationState*)self)->setEmptyAnimations(mixDuration); + AnimationState *_self = (AnimationState *) self; + _self->setEmptyAnimations(mixDuration); } spine_track_entry spine_animation_state_get_current(spine_animation_state self, size_t trackIndex) { - return (spine_track_entry)((AnimationState*)self)->getCurrent(trackIndex); + AnimationState *_self = (AnimationState *) self; + return (spine_track_entry) _self->getCurrent(trackIndex); } spine_animation_state_data spine_animation_state_get_data(spine_animation_state self) { - return (spine_animation_state_data)&((AnimationState*)self)->getData(); + AnimationState *_self = (AnimationState *) self; + return (spine_animation_state_data) &_self->getData(); } spine_array_track_entry spine_animation_state_get_tracks(spine_animation_state self) { - return (spine_array_track_entry)&((AnimationState*)self)->getTracks(); + AnimationState *_self = (AnimationState *) self; + return (spine_array_track_entry) &_self->getTracks(); } float spine_animation_state_get_time_scale(spine_animation_state self) { - return ((AnimationState*)self)->getTimeScale(); + AnimationState *_self = (AnimationState *) self; + return _self->getTimeScale(); } void spine_animation_state_set_time_scale(spine_animation_state self, float inValue) { - ((AnimationState*)self)->setTimeScale(inValue); + AnimationState *_self = (AnimationState *) self; + _self->setTimeScale(inValue); } void spine_animation_state_disable_queue(spine_animation_state self) { - ((AnimationState*)self)->disableQueue(); + AnimationState *_self = (AnimationState *) self; + _self->disableQueue(); } void spine_animation_state_enable_queue(spine_animation_state self) { - ((AnimationState*)self)->enableQueue(); + AnimationState *_self = (AnimationState *) self; + _self->enableQueue(); } void spine_animation_state_set_manual_track_entry_disposal(spine_animation_state self, bool inValue) { - ((AnimationState*)self)->setManualTrackEntryDisposal(inValue); + AnimationState *_self = (AnimationState *) self; + _self->setManualTrackEntryDisposal(inValue); } bool spine_animation_state_get_manual_track_entry_disposal(spine_animation_state self) { - return ((AnimationState*)self)->getManualTrackEntryDisposal(); + AnimationState *_self = (AnimationState *) self; + return _self->getManualTrackEntryDisposal(); } void spine_animation_state_dispose_track_entry(spine_animation_state self, spine_track_entry entry) { - ((AnimationState*)self)->disposeTrackEntry((TrackEntry *)entry); + AnimationState *_self = (AnimationState *) self; + _self->disposeTrackEntry((TrackEntry *) entry); } -void * spine_animation_state_get_renderer_object(spine_animation_state self) { - return ((HasRendererObject*)(AnimationState*)self)->getRendererObject(); +void *spine_animation_state_get_renderer_object(spine_animation_state self) { + HasRendererObject *_self = (HasRendererObject *) (AnimationState *) self; + return _self->getRendererObject(); } diff --git a/spine-c/src/generated/animation_state.h b/spine-c/src/generated/animation_state.h index bf3db0ecb..279e13188 100644 --- a/spine-c/src/generated/animation_state.h +++ b/spine-c/src/generated/animation_state.h @@ -16,12 +16,17 @@ SPINE_C_API void spine_animation_state_update(spine_animation_state self, float SPINE_C_API bool spine_animation_state_apply(spine_animation_state self, spine_skeleton skeleton); SPINE_C_API void spine_animation_state_clear_tracks(spine_animation_state self); SPINE_C_API void spine_animation_state_clear_track(spine_animation_state self, size_t trackIndex); -SPINE_C_API spine_track_entry spine_animation_state_set_animation_1(spine_animation_state self, size_t trackIndex, const char * animationName, bool loop); -SPINE_C_API spine_track_entry spine_animation_state_set_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation, bool loop); -SPINE_C_API spine_track_entry spine_animation_state_add_animation_1(spine_animation_state self, size_t trackIndex, const char * animationName, bool loop, float delay); -SPINE_C_API spine_track_entry spine_animation_state_add_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation, bool loop, float delay); +SPINE_C_API spine_track_entry spine_animation_state_set_animation_1(spine_animation_state self, size_t trackIndex, const char *animationName, + bool loop); +SPINE_C_API spine_track_entry spine_animation_state_set_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation, + bool loop); +SPINE_C_API spine_track_entry spine_animation_state_add_animation_1(spine_animation_state self, size_t trackIndex, const char *animationName, + bool loop, float delay); +SPINE_C_API spine_track_entry spine_animation_state_add_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation, + bool loop, float delay); SPINE_C_API spine_track_entry spine_animation_state_set_empty_animation(spine_animation_state self, size_t trackIndex, float mixDuration); -SPINE_C_API spine_track_entry spine_animation_state_add_empty_animation(spine_animation_state self, size_t trackIndex, float mixDuration, float delay); +SPINE_C_API spine_track_entry spine_animation_state_add_empty_animation(spine_animation_state self, size_t trackIndex, float mixDuration, + float delay); SPINE_C_API void spine_animation_state_set_empty_animations(spine_animation_state self, float mixDuration); SPINE_C_API spine_track_entry spine_animation_state_get_current(spine_animation_state self, size_t trackIndex); SPINE_C_API spine_animation_state_data spine_animation_state_get_data(spine_animation_state self); @@ -33,7 +38,7 @@ SPINE_C_API void spine_animation_state_enable_queue(spine_animation_state self); SPINE_C_API void spine_animation_state_set_manual_track_entry_disposal(spine_animation_state self, bool inValue); SPINE_C_API bool spine_animation_state_get_manual_track_entry_disposal(spine_animation_state self); SPINE_C_API void spine_animation_state_dispose_track_entry(spine_animation_state self, spine_track_entry entry); -SPINE_C_API void * spine_animation_state_get_renderer_object(spine_animation_state self); +SPINE_C_API void *spine_animation_state_get_renderer_object(spine_animation_state self); #ifdef __cplusplus } diff --git a/spine-c/src/generated/animation_state_data.cpp b/spine-c/src/generated/animation_state_data.cpp index 6ba4e3d83..b10cb54ed 100644 --- a/spine-c/src/generated/animation_state_data.cpp +++ b/spine-c/src/generated/animation_state_data.cpp @@ -4,37 +4,44 @@ using namespace spine; spine_animation_state_data spine_animation_state_data_create(spine_skeleton_data skeletonData) { - return (spine_animation_state_data) new (__FILE__, __LINE__) AnimationStateData((SkeletonData *)skeletonData); + return (spine_animation_state_data) new (__FILE__, __LINE__) AnimationStateData((SkeletonData *) skeletonData); } void spine_animation_state_data_dispose(spine_animation_state_data self) { - delete (AnimationStateData*)self; + delete (AnimationStateData *) self; } spine_skeleton_data spine_animation_state_data_get_skeleton_data(spine_animation_state_data self) { - return (spine_skeleton_data)((AnimationStateData*)self)->getSkeletonData(); + AnimationStateData *_self = (AnimationStateData *) self; + return (spine_skeleton_data) _self->getSkeletonData(); } float spine_animation_state_data_get_default_mix(spine_animation_state_data self) { - return ((AnimationStateData*)self)->getDefaultMix(); + AnimationStateData *_self = (AnimationStateData *) self; + return _self->getDefaultMix(); } void spine_animation_state_data_set_default_mix(spine_animation_state_data self, float inValue) { - ((AnimationStateData*)self)->setDefaultMix(inValue); + AnimationStateData *_self = (AnimationStateData *) self; + _self->setDefaultMix(inValue); } -void spine_animation_state_data_set_mix_1(spine_animation_state_data self, const char * fromName, const char * toName, float duration) { - ((AnimationStateData*)self)->setMix(String(fromName), String(toName), duration); +void spine_animation_state_data_set_mix_1(spine_animation_state_data self, const char *fromName, const char *toName, float duration) { + AnimationStateData *_self = (AnimationStateData *) self; + _self->setMix(String(fromName), String(toName), duration); } void spine_animation_state_data_set_mix_2(spine_animation_state_data self, spine_animation from, spine_animation to, float duration) { - ((AnimationStateData*)self)->setMix((Animation *)from, (Animation *)to, duration); + AnimationStateData *_self = (AnimationStateData *) self; + _self->setMix((Animation *) from, (Animation *) to, duration); } float spine_animation_state_data_get_mix(spine_animation_state_data self, spine_animation from, spine_animation to) { - return ((AnimationStateData*)self)->getMix((Animation *)from, (Animation *)to); + AnimationStateData *_self = (AnimationStateData *) self; + return _self->getMix((Animation *) from, (Animation *) to); } void spine_animation_state_data_clear(spine_animation_state_data self) { - ((AnimationStateData*)self)->clear(); + AnimationStateData *_self = (AnimationStateData *) self; + _self->clear(); } diff --git a/spine-c/src/generated/animation_state_data.h b/spine-c/src/generated/animation_state_data.h index 73dde1a0c..5f24857e2 100644 --- a/spine-c/src/generated/animation_state_data.h +++ b/spine-c/src/generated/animation_state_data.h @@ -15,7 +15,7 @@ SPINE_C_API void spine_animation_state_data_dispose(spine_animation_state_data s SPINE_C_API spine_skeleton_data spine_animation_state_data_get_skeleton_data(spine_animation_state_data self); SPINE_C_API float spine_animation_state_data_get_default_mix(spine_animation_state_data self); SPINE_C_API void spine_animation_state_data_set_default_mix(spine_animation_state_data self, float inValue); -SPINE_C_API void spine_animation_state_data_set_mix_1(spine_animation_state_data self, const char * fromName, const char * toName, float duration); +SPINE_C_API void spine_animation_state_data_set_mix_1(spine_animation_state_data self, const char *fromName, const char *toName, float duration); SPINE_C_API void spine_animation_state_data_set_mix_2(spine_animation_state_data self, spine_animation from, spine_animation to, float duration); SPINE_C_API float spine_animation_state_data_get_mix(spine_animation_state_data self, spine_animation from, spine_animation to); SPINE_C_API void spine_animation_state_data_clear(spine_animation_state_data self); diff --git a/spine-c/src/generated/arrays.cpp b/spine-c/src/generated/arrays.cpp index 9a2fb9373..4d8026413 100644 --- a/spine-c/src/generated/arrays.cpp +++ b/spine-c/src/generated/arrays.cpp @@ -33,1567 +33,1894 @@ using namespace spine; spine_array_float spine_array_float_create(void) { - return (spine_array_float) new (__FILE__, __LINE__) Array(); + return (spine_array_float) new (__FILE__, __LINE__) Array(); } spine_array_float spine_array_float_create_with_capacity(size_t initialCapacity) { - return (spine_array_float) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_float) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_float_dispose(spine_array_float array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_float_clear(spine_array_float array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_float_get_capacity(spine_array_float array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_float_size(spine_array_float array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_float spine_array_float_set_size(spine_array_float array, size_t newSize, float defaultValue) { - return (spine_array_float)&((Array*)array)->setSize(newSize, defaultValue); + Array *_array = (Array *) array; + return (spine_array_float) &_array->setSize(newSize, defaultValue); } void spine_array_float_ensure_capacity(spine_array_float array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_float_add(spine_array_float array, float inValue) { - ((Array*)array)->add(inValue); + Array *_array = (Array *) array; + _array->add(inValue); } void spine_array_float_add_all(spine_array_float array, spine_array_float inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_float_clear_and_add_all(spine_array_float array, spine_array_float inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_float_remove_at(spine_array_float array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_float_contains(spine_array_float array, float inValue) { - return ((Array*)array)->contains(inValue); + Array *_array = (Array *) array; + return _array->contains(inValue); } int spine_array_float_index_of(spine_array_float array, float inValue) { - return ((Array*)array)->indexOf(inValue); + Array *_array = (Array *) array; + return _array->indexOf(inValue); } -float * spine_array_float_buffer(spine_array_float array) { - return ((Array*)array)->buffer(); +float *spine_array_float_buffer(spine_array_float array) { + Array *_array = (Array *) array; + return _array->buffer(); } spine_array_int spine_array_int_create(void) { - return (spine_array_int) new (__FILE__, __LINE__) Array(); + return (spine_array_int) new (__FILE__, __LINE__) Array(); } spine_array_int spine_array_int_create_with_capacity(size_t initialCapacity) { - return (spine_array_int) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_int) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_int_dispose(spine_array_int array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_int_clear(spine_array_int array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_int_get_capacity(spine_array_int array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_int_size(spine_array_int array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_int spine_array_int_set_size(spine_array_int array, size_t newSize, int defaultValue) { - return (spine_array_int)&((Array*)array)->setSize(newSize, defaultValue); + Array *_array = (Array *) array; + return (spine_array_int) &_array->setSize(newSize, defaultValue); } void spine_array_int_ensure_capacity(spine_array_int array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_int_add(spine_array_int array, int inValue) { - ((Array*)array)->add(inValue); + Array *_array = (Array *) array; + _array->add(inValue); } void spine_array_int_add_all(spine_array_int array, spine_array_int inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_int_clear_and_add_all(spine_array_int array, spine_array_int inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_int_remove_at(spine_array_int array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_int_contains(spine_array_int array, int inValue) { - return ((Array*)array)->contains(inValue); + Array *_array = (Array *) array; + return _array->contains(inValue); } int spine_array_int_index_of(spine_array_int array, int inValue) { - return ((Array*)array)->indexOf(inValue); + Array *_array = (Array *) array; + return _array->indexOf(inValue); } -int * spine_array_int_buffer(spine_array_int array) { - return ((Array*)array)->buffer(); +int *spine_array_int_buffer(spine_array_int array) { + Array *_array = (Array *) array; + return _array->buffer(); } spine_array_unsigned_short spine_array_unsigned_short_create(void) { - return (spine_array_unsigned_short) new (__FILE__, __LINE__) Array(); + return (spine_array_unsigned_short) new (__FILE__, __LINE__) Array(); } spine_array_unsigned_short spine_array_unsigned_short_create_with_capacity(size_t initialCapacity) { - return (spine_array_unsigned_short) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_unsigned_short) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_unsigned_short_dispose(spine_array_unsigned_short array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_unsigned_short_clear(spine_array_unsigned_short array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_unsigned_short_get_capacity(spine_array_unsigned_short array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_unsigned_short_size(spine_array_unsigned_short array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_unsigned_short spine_array_unsigned_short_set_size(spine_array_unsigned_short array, size_t newSize, unsigned short defaultValue) { - return (spine_array_unsigned_short)&((Array*)array)->setSize(newSize, defaultValue); + Array *_array = (Array *) array; + return (spine_array_unsigned_short) &_array->setSize(newSize, defaultValue); } void spine_array_unsigned_short_ensure_capacity(spine_array_unsigned_short array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_unsigned_short_add(spine_array_unsigned_short array, unsigned short inValue) { - ((Array*)array)->add(inValue); + Array *_array = (Array *) array; + _array->add(inValue); } void spine_array_unsigned_short_add_all(spine_array_unsigned_short array, spine_array_unsigned_short inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_unsigned_short_clear_and_add_all(spine_array_unsigned_short array, spine_array_unsigned_short inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_unsigned_short_remove_at(spine_array_unsigned_short array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_unsigned_short_contains(spine_array_unsigned_short array, unsigned short inValue) { - return ((Array*)array)->contains(inValue); + Array *_array = (Array *) array; + return _array->contains(inValue); } int spine_array_unsigned_short_index_of(spine_array_unsigned_short array, unsigned short inValue) { - return ((Array*)array)->indexOf(inValue); + Array *_array = (Array *) array; + return _array->indexOf(inValue); } -unsigned short * spine_array_unsigned_short_buffer(spine_array_unsigned_short array) { - return ((Array*)array)->buffer(); +unsigned short *spine_array_unsigned_short_buffer(spine_array_unsigned_short array) { + Array *_array = (Array *) array; + return _array->buffer(); } spine_array_property_id spine_array_property_id_create(void) { - return (spine_array_property_id) new (__FILE__, __LINE__) Array(); + return (spine_array_property_id) new (__FILE__, __LINE__) Array(); } spine_array_property_id spine_array_property_id_create_with_capacity(size_t initialCapacity) { - return (spine_array_property_id) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_property_id) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_property_id_dispose(spine_array_property_id array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_property_id_clear(spine_array_property_id array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_property_id_get_capacity(spine_array_property_id array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_property_id_size(spine_array_property_id array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_property_id spine_array_property_id_set_size(spine_array_property_id array, size_t newSize, int64_t defaultValue) { - return (spine_array_property_id)&((Array*)array)->setSize(newSize, *((const PropertyId*)defaultValue)); + Array *_array = (Array *) array; + return (spine_array_property_id) &_array->setSize(newSize, *((const PropertyId *) defaultValue)); } void spine_array_property_id_ensure_capacity(spine_array_property_id array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_property_id_add(spine_array_property_id array, int64_t inValue) { - ((Array*)array)->add(*((const PropertyId*)inValue)); + Array *_array = (Array *) array; + _array->add(*((const PropertyId *) inValue)); } void spine_array_property_id_add_all(spine_array_property_id array, spine_array_property_id inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_property_id_clear_and_add_all(spine_array_property_id array, spine_array_property_id inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_property_id_remove_at(spine_array_property_id array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_property_id_contains(spine_array_property_id array, int64_t inValue) { - return ((Array*)array)->contains(*((const PropertyId*)inValue)); + Array *_array = (Array *) array; + return _array->contains(*((const PropertyId *) inValue)); } int spine_array_property_id_index_of(spine_array_property_id array, int64_t inValue) { - return ((Array*)array)->indexOf(*((const PropertyId*)inValue)); + Array *_array = (Array *) array; + return _array->indexOf(*((const PropertyId *) inValue)); } spine_property_id spine_array_property_id_buffer(spine_array_property_id array) { - return (spine_property_id)((Array*)array)->buffer(); + Array *_array = (Array *) array; + return (spine_property_id) _array->buffer(); } spine_array_animation spine_array_animation_create(void) { - return (spine_array_animation) new (__FILE__, __LINE__) Array(); + return (spine_array_animation) new (__FILE__, __LINE__) Array(); } spine_array_animation spine_array_animation_create_with_capacity(size_t initialCapacity) { - return (spine_array_animation) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_animation) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_animation_dispose(spine_array_animation array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_animation_clear(spine_array_animation array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_animation_get_capacity(spine_array_animation array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_animation_size(spine_array_animation array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_animation spine_array_animation_set_size(spine_array_animation array, size_t newSize, spine_animation defaultValue) { - return (spine_array_animation)&((Array*)array)->setSize(newSize, (Animation *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_animation) &_array->setSize(newSize, (Animation *) defaultValue); } void spine_array_animation_ensure_capacity(spine_array_animation array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_animation_add(spine_array_animation array, spine_animation inValue) { - ((Array*)array)->add((Animation *)inValue); + Array *_array = (Array *) array; + _array->add((Animation *) inValue); } void spine_array_animation_add_all(spine_array_animation array, spine_array_animation inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_animation_clear_and_add_all(spine_array_animation array, spine_array_animation inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_animation_remove_at(spine_array_animation array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_animation_contains(spine_array_animation array, spine_animation inValue) { - return ((Array*)array)->contains((Animation *)inValue); + Array *_array = (Array *) array; + return _array->contains((Animation *) inValue); } int spine_array_animation_index_of(spine_array_animation array, spine_animation inValue) { - return ((Array*)array)->indexOf((Animation *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((Animation *) inValue); } -spine_animation * spine_array_animation_buffer(spine_array_animation array) { - return (spine_animation *)((Array*)array)->buffer(); +spine_animation *spine_array_animation_buffer(spine_array_animation array) { + Array *_array = (Array *) array; + return (spine_animation *) _array->buffer(); } spine_array_atlas_page spine_array_atlas_page_create(void) { - return (spine_array_atlas_page) new (__FILE__, __LINE__) Array(); + return (spine_array_atlas_page) new (__FILE__, __LINE__) Array(); } spine_array_atlas_page spine_array_atlas_page_create_with_capacity(size_t initialCapacity) { - return (spine_array_atlas_page) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_atlas_page) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_atlas_page_dispose(spine_array_atlas_page array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_atlas_page_clear(spine_array_atlas_page array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_atlas_page_get_capacity(spine_array_atlas_page array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_atlas_page_size(spine_array_atlas_page array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_atlas_page spine_array_atlas_page_set_size(spine_array_atlas_page array, size_t newSize, spine_atlas_page defaultValue) { - return (spine_array_atlas_page)&((Array*)array)->setSize(newSize, (AtlasPage *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_atlas_page) &_array->setSize(newSize, (AtlasPage *) defaultValue); } void spine_array_atlas_page_ensure_capacity(spine_array_atlas_page array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_atlas_page_add(spine_array_atlas_page array, spine_atlas_page inValue) { - ((Array*)array)->add((AtlasPage *)inValue); + Array *_array = (Array *) array; + _array->add((AtlasPage *) inValue); } void spine_array_atlas_page_add_all(spine_array_atlas_page array, spine_array_atlas_page inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_atlas_page_clear_and_add_all(spine_array_atlas_page array, spine_array_atlas_page inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_atlas_page_remove_at(spine_array_atlas_page array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_atlas_page_contains(spine_array_atlas_page array, spine_atlas_page inValue) { - return ((Array*)array)->contains((AtlasPage *)inValue); + Array *_array = (Array *) array; + return _array->contains((AtlasPage *) inValue); } int spine_array_atlas_page_index_of(spine_array_atlas_page array, spine_atlas_page inValue) { - return ((Array*)array)->indexOf((AtlasPage *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((AtlasPage *) inValue); } -spine_atlas_page * spine_array_atlas_page_buffer(spine_array_atlas_page array) { - return (spine_atlas_page *)((Array*)array)->buffer(); +spine_atlas_page *spine_array_atlas_page_buffer(spine_array_atlas_page array) { + Array *_array = (Array *) array; + return (spine_atlas_page *) _array->buffer(); } spine_array_atlas_region spine_array_atlas_region_create(void) { - return (spine_array_atlas_region) new (__FILE__, __LINE__) Array(); + return (spine_array_atlas_region) new (__FILE__, __LINE__) Array(); } spine_array_atlas_region spine_array_atlas_region_create_with_capacity(size_t initialCapacity) { - return (spine_array_atlas_region) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_atlas_region) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_atlas_region_dispose(spine_array_atlas_region array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_atlas_region_clear(spine_array_atlas_region array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_atlas_region_get_capacity(spine_array_atlas_region array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_atlas_region_size(spine_array_atlas_region array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_atlas_region spine_array_atlas_region_set_size(spine_array_atlas_region array, size_t newSize, spine_atlas_region defaultValue) { - return (spine_array_atlas_region)&((Array*)array)->setSize(newSize, (AtlasRegion *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_atlas_region) &_array->setSize(newSize, (AtlasRegion *) defaultValue); } void spine_array_atlas_region_ensure_capacity(spine_array_atlas_region array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_atlas_region_add(spine_array_atlas_region array, spine_atlas_region inValue) { - ((Array*)array)->add((AtlasRegion *)inValue); + Array *_array = (Array *) array; + _array->add((AtlasRegion *) inValue); } void spine_array_atlas_region_add_all(spine_array_atlas_region array, spine_array_atlas_region inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_atlas_region_clear_and_add_all(spine_array_atlas_region array, spine_array_atlas_region inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_atlas_region_remove_at(spine_array_atlas_region array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_atlas_region_contains(spine_array_atlas_region array, spine_atlas_region inValue) { - return ((Array*)array)->contains((AtlasRegion *)inValue); + Array *_array = (Array *) array; + return _array->contains((AtlasRegion *) inValue); } int spine_array_atlas_region_index_of(spine_array_atlas_region array, spine_atlas_region inValue) { - return ((Array*)array)->indexOf((AtlasRegion *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((AtlasRegion *) inValue); } -spine_atlas_region * spine_array_atlas_region_buffer(spine_array_atlas_region array) { - return (spine_atlas_region *)((Array*)array)->buffer(); +spine_atlas_region *spine_array_atlas_region_buffer(spine_array_atlas_region array) { + Array *_array = (Array *) array; + return (spine_atlas_region *) _array->buffer(); } spine_array_attachment spine_array_attachment_create(void) { - return (spine_array_attachment) new (__FILE__, __LINE__) Array(); + return (spine_array_attachment) new (__FILE__, __LINE__) Array(); } spine_array_attachment spine_array_attachment_create_with_capacity(size_t initialCapacity) { - return (spine_array_attachment) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_attachment) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_attachment_dispose(spine_array_attachment array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_attachment_clear(spine_array_attachment array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_attachment_get_capacity(spine_array_attachment array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_attachment_size(spine_array_attachment array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_attachment spine_array_attachment_set_size(spine_array_attachment array, size_t newSize, spine_attachment defaultValue) { - return (spine_array_attachment)&((Array*)array)->setSize(newSize, (Attachment *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_attachment) &_array->setSize(newSize, (Attachment *) defaultValue); } void spine_array_attachment_ensure_capacity(spine_array_attachment array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_attachment_add(spine_array_attachment array, spine_attachment inValue) { - ((Array*)array)->add((Attachment *)inValue); + Array *_array = (Array *) array; + _array->add((Attachment *) inValue); } void spine_array_attachment_add_all(spine_array_attachment array, spine_array_attachment inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_attachment_clear_and_add_all(spine_array_attachment array, spine_array_attachment inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_attachment_remove_at(spine_array_attachment array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_attachment_contains(spine_array_attachment array, spine_attachment inValue) { - return ((Array*)array)->contains((Attachment *)inValue); + Array *_array = (Array *) array; + return _array->contains((Attachment *) inValue); } int spine_array_attachment_index_of(spine_array_attachment array, spine_attachment inValue) { - return ((Array*)array)->indexOf((Attachment *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((Attachment *) inValue); } -spine_attachment * spine_array_attachment_buffer(spine_array_attachment array) { - return (spine_attachment *)((Array*)array)->buffer(); +spine_attachment *spine_array_attachment_buffer(spine_array_attachment array) { + Array *_array = (Array *) array; + return (spine_attachment *) _array->buffer(); } spine_array_bone spine_array_bone_create(void) { - return (spine_array_bone) new (__FILE__, __LINE__) Array(); + return (spine_array_bone) new (__FILE__, __LINE__) Array(); } spine_array_bone spine_array_bone_create_with_capacity(size_t initialCapacity) { - return (spine_array_bone) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_bone) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_bone_dispose(spine_array_bone array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_bone_clear(spine_array_bone array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_bone_get_capacity(spine_array_bone array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_bone_size(spine_array_bone array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_bone spine_array_bone_set_size(spine_array_bone array, size_t newSize, spine_bone defaultValue) { - return (spine_array_bone)&((Array*)array)->setSize(newSize, (Bone *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_bone) &_array->setSize(newSize, (Bone *) defaultValue); } void spine_array_bone_ensure_capacity(spine_array_bone array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_bone_add(spine_array_bone array, spine_bone inValue) { - ((Array*)array)->add((Bone *)inValue); + Array *_array = (Array *) array; + _array->add((Bone *) inValue); } void spine_array_bone_add_all(spine_array_bone array, spine_array_bone inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_bone_clear_and_add_all(spine_array_bone array, spine_array_bone inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_bone_remove_at(spine_array_bone array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_bone_contains(spine_array_bone array, spine_bone inValue) { - return ((Array*)array)->contains((Bone *)inValue); + Array *_array = (Array *) array; + return _array->contains((Bone *) inValue); } int spine_array_bone_index_of(spine_array_bone array, spine_bone inValue) { - return ((Array*)array)->indexOf((Bone *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((Bone *) inValue); } -spine_bone * spine_array_bone_buffer(spine_array_bone array) { - return (spine_bone *)((Array*)array)->buffer(); +spine_bone *spine_array_bone_buffer(spine_array_bone array) { + Array *_array = (Array *) array; + return (spine_bone *) _array->buffer(); } spine_array_bone_data spine_array_bone_data_create(void) { - return (spine_array_bone_data) new (__FILE__, __LINE__) Array(); + return (spine_array_bone_data) new (__FILE__, __LINE__) Array(); } spine_array_bone_data spine_array_bone_data_create_with_capacity(size_t initialCapacity) { - return (spine_array_bone_data) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_bone_data) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_bone_data_dispose(spine_array_bone_data array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_bone_data_clear(spine_array_bone_data array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_bone_data_get_capacity(spine_array_bone_data array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_bone_data_size(spine_array_bone_data array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_bone_data spine_array_bone_data_set_size(spine_array_bone_data array, size_t newSize, spine_bone_data defaultValue) { - return (spine_array_bone_data)&((Array*)array)->setSize(newSize, (BoneData *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_bone_data) &_array->setSize(newSize, (BoneData *) defaultValue); } void spine_array_bone_data_ensure_capacity(spine_array_bone_data array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_bone_data_add(spine_array_bone_data array, spine_bone_data inValue) { - ((Array*)array)->add((BoneData *)inValue); + Array *_array = (Array *) array; + _array->add((BoneData *) inValue); } void spine_array_bone_data_add_all(spine_array_bone_data array, spine_array_bone_data inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_bone_data_clear_and_add_all(spine_array_bone_data array, spine_array_bone_data inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_bone_data_remove_at(spine_array_bone_data array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_bone_data_contains(spine_array_bone_data array, spine_bone_data inValue) { - return ((Array*)array)->contains((BoneData *)inValue); + Array *_array = (Array *) array; + return _array->contains((BoneData *) inValue); } int spine_array_bone_data_index_of(spine_array_bone_data array, spine_bone_data inValue) { - return ((Array*)array)->indexOf((BoneData *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((BoneData *) inValue); } -spine_bone_data * spine_array_bone_data_buffer(spine_array_bone_data array) { - return (spine_bone_data *)((Array*)array)->buffer(); +spine_bone_data *spine_array_bone_data_buffer(spine_array_bone_data array) { + Array *_array = (Array *) array; + return (spine_bone_data *) _array->buffer(); } spine_array_bone_pose spine_array_bone_pose_create(void) { - return (spine_array_bone_pose) new (__FILE__, __LINE__) Array(); + return (spine_array_bone_pose) new (__FILE__, __LINE__) Array(); } spine_array_bone_pose spine_array_bone_pose_create_with_capacity(size_t initialCapacity) { - return (spine_array_bone_pose) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_bone_pose) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_bone_pose_dispose(spine_array_bone_pose array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_bone_pose_clear(spine_array_bone_pose array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_bone_pose_get_capacity(spine_array_bone_pose array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_bone_pose_size(spine_array_bone_pose array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_bone_pose spine_array_bone_pose_set_size(spine_array_bone_pose array, size_t newSize, spine_bone_pose defaultValue) { - return (spine_array_bone_pose)&((Array*)array)->setSize(newSize, (BonePose *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_bone_pose) &_array->setSize(newSize, (BonePose *) defaultValue); } void spine_array_bone_pose_ensure_capacity(spine_array_bone_pose array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_bone_pose_add(spine_array_bone_pose array, spine_bone_pose inValue) { - ((Array*)array)->add((BonePose *)inValue); + Array *_array = (Array *) array; + _array->add((BonePose *) inValue); } void spine_array_bone_pose_add_all(spine_array_bone_pose array, spine_array_bone_pose inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_bone_pose_clear_and_add_all(spine_array_bone_pose array, spine_array_bone_pose inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_bone_pose_remove_at(spine_array_bone_pose array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_bone_pose_contains(spine_array_bone_pose array, spine_bone_pose inValue) { - return ((Array*)array)->contains((BonePose *)inValue); + Array *_array = (Array *) array; + return _array->contains((BonePose *) inValue); } int spine_array_bone_pose_index_of(spine_array_bone_pose array, spine_bone_pose inValue) { - return ((Array*)array)->indexOf((BonePose *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((BonePose *) inValue); } -spine_bone_pose * spine_array_bone_pose_buffer(spine_array_bone_pose array) { - return (spine_bone_pose *)((Array*)array)->buffer(); +spine_bone_pose *spine_array_bone_pose_buffer(spine_array_bone_pose array) { + Array *_array = (Array *) array; + return (spine_bone_pose *) _array->buffer(); } spine_array_bounding_box_attachment spine_array_bounding_box_attachment_create(void) { - return (spine_array_bounding_box_attachment) new (__FILE__, __LINE__) Array(); + return (spine_array_bounding_box_attachment) new (__FILE__, __LINE__) Array(); } spine_array_bounding_box_attachment spine_array_bounding_box_attachment_create_with_capacity(size_t initialCapacity) { - return (spine_array_bounding_box_attachment) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_bounding_box_attachment) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_bounding_box_attachment_dispose(spine_array_bounding_box_attachment array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_bounding_box_attachment_clear(spine_array_bounding_box_attachment array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_bounding_box_attachment_get_capacity(spine_array_bounding_box_attachment array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_bounding_box_attachment_size(spine_array_bounding_box_attachment array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } -spine_array_bounding_box_attachment spine_array_bounding_box_attachment_set_size(spine_array_bounding_box_attachment array, size_t newSize, spine_bounding_box_attachment defaultValue) { - return (spine_array_bounding_box_attachment)&((Array*)array)->setSize(newSize, (BoundingBoxAttachment *)defaultValue); +spine_array_bounding_box_attachment spine_array_bounding_box_attachment_set_size(spine_array_bounding_box_attachment array, size_t newSize, + spine_bounding_box_attachment defaultValue) { + Array *_array = (Array *) array; + return (spine_array_bounding_box_attachment) &_array->setSize(newSize, (BoundingBoxAttachment *) defaultValue); } void spine_array_bounding_box_attachment_ensure_capacity(spine_array_bounding_box_attachment array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_bounding_box_attachment_add(spine_array_bounding_box_attachment array, spine_bounding_box_attachment inValue) { - ((Array*)array)->add((BoundingBoxAttachment *)inValue); + Array *_array = (Array *) array; + _array->add((BoundingBoxAttachment *) inValue); } void spine_array_bounding_box_attachment_add_all(spine_array_bounding_box_attachment array, spine_array_bounding_box_attachment inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_bounding_box_attachment_clear_and_add_all(spine_array_bounding_box_attachment array, spine_array_bounding_box_attachment inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_bounding_box_attachment_remove_at(spine_array_bounding_box_attachment array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_bounding_box_attachment_contains(spine_array_bounding_box_attachment array, spine_bounding_box_attachment inValue) { - return ((Array*)array)->contains((BoundingBoxAttachment *)inValue); + Array *_array = (Array *) array; + return _array->contains((BoundingBoxAttachment *) inValue); } int spine_array_bounding_box_attachment_index_of(spine_array_bounding_box_attachment array, spine_bounding_box_attachment inValue) { - return ((Array*)array)->indexOf((BoundingBoxAttachment *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((BoundingBoxAttachment *) inValue); } -spine_bounding_box_attachment * spine_array_bounding_box_attachment_buffer(spine_array_bounding_box_attachment array) { - return (spine_bounding_box_attachment *)((Array*)array)->buffer(); +spine_bounding_box_attachment *spine_array_bounding_box_attachment_buffer(spine_array_bounding_box_attachment array) { + Array *_array = (Array *) array; + return (spine_bounding_box_attachment *) _array->buffer(); } spine_array_constraint spine_array_constraint_create(void) { - return (spine_array_constraint) new (__FILE__, __LINE__) Array(); + return (spine_array_constraint) new (__FILE__, __LINE__) Array(); } spine_array_constraint spine_array_constraint_create_with_capacity(size_t initialCapacity) { - return (spine_array_constraint) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_constraint) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_constraint_dispose(spine_array_constraint array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_constraint_clear(spine_array_constraint array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_constraint_get_capacity(spine_array_constraint array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_constraint_size(spine_array_constraint array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_constraint spine_array_constraint_set_size(spine_array_constraint array, size_t newSize, spine_constraint defaultValue) { - return (spine_array_constraint)&((Array*)array)->setSize(newSize, (Constraint *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_constraint) &_array->setSize(newSize, (Constraint *) defaultValue); } void spine_array_constraint_ensure_capacity(spine_array_constraint array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_constraint_add(spine_array_constraint array, spine_constraint inValue) { - ((Array*)array)->add((Constraint *)inValue); + Array *_array = (Array *) array; + _array->add((Constraint *) inValue); } void spine_array_constraint_add_all(spine_array_constraint array, spine_array_constraint inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_constraint_clear_and_add_all(spine_array_constraint array, spine_array_constraint inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_constraint_remove_at(spine_array_constraint array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_constraint_contains(spine_array_constraint array, spine_constraint inValue) { - return ((Array*)array)->contains((Constraint *)inValue); + Array *_array = (Array *) array; + return _array->contains((Constraint *) inValue); } int spine_array_constraint_index_of(spine_array_constraint array, spine_constraint inValue) { - return ((Array*)array)->indexOf((Constraint *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((Constraint *) inValue); } -spine_constraint * spine_array_constraint_buffer(spine_array_constraint array) { - return (spine_constraint *)((Array*)array)->buffer(); +spine_constraint *spine_array_constraint_buffer(spine_array_constraint array) { + Array *_array = (Array *) array; + return (spine_constraint *) _array->buffer(); } spine_array_constraint_data spine_array_constraint_data_create(void) { - return (spine_array_constraint_data) new (__FILE__, __LINE__) Array(); + return (spine_array_constraint_data) new (__FILE__, __LINE__) Array(); } spine_array_constraint_data spine_array_constraint_data_create_with_capacity(size_t initialCapacity) { - return (spine_array_constraint_data) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_constraint_data) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_constraint_data_dispose(spine_array_constraint_data array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_constraint_data_clear(spine_array_constraint_data array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_constraint_data_get_capacity(spine_array_constraint_data array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_constraint_data_size(spine_array_constraint_data array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } -spine_array_constraint_data spine_array_constraint_data_set_size(spine_array_constraint_data array, size_t newSize, spine_constraint_data defaultValue) { - return (spine_array_constraint_data)&((Array*)array)->setSize(newSize, (ConstraintData *)defaultValue); +spine_array_constraint_data spine_array_constraint_data_set_size(spine_array_constraint_data array, size_t newSize, + spine_constraint_data defaultValue) { + Array *_array = (Array *) array; + return (spine_array_constraint_data) &_array->setSize(newSize, (ConstraintData *) defaultValue); } void spine_array_constraint_data_ensure_capacity(spine_array_constraint_data array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_constraint_data_add(spine_array_constraint_data array, spine_constraint_data inValue) { - ((Array*)array)->add((ConstraintData *)inValue); + Array *_array = (Array *) array; + _array->add((ConstraintData *) inValue); } void spine_array_constraint_data_add_all(spine_array_constraint_data array, spine_array_constraint_data inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_constraint_data_clear_and_add_all(spine_array_constraint_data array, spine_array_constraint_data inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_constraint_data_remove_at(spine_array_constraint_data array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_constraint_data_contains(spine_array_constraint_data array, spine_constraint_data inValue) { - return ((Array*)array)->contains((ConstraintData *)inValue); + Array *_array = (Array *) array; + return _array->contains((ConstraintData *) inValue); } int spine_array_constraint_data_index_of(spine_array_constraint_data array, spine_constraint_data inValue) { - return ((Array*)array)->indexOf((ConstraintData *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((ConstraintData *) inValue); } -spine_constraint_data * spine_array_constraint_data_buffer(spine_array_constraint_data array) { - return (spine_constraint_data *)((Array*)array)->buffer(); +spine_constraint_data *spine_array_constraint_data_buffer(spine_array_constraint_data array) { + Array *_array = (Array *) array; + return (spine_constraint_data *) _array->buffer(); } spine_array_event spine_array_event_create(void) { - return (spine_array_event) new (__FILE__, __LINE__) Array(); + return (spine_array_event) new (__FILE__, __LINE__) Array(); } spine_array_event spine_array_event_create_with_capacity(size_t initialCapacity) { - return (spine_array_event) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_event) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_event_dispose(spine_array_event array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_event_clear(spine_array_event array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_event_get_capacity(spine_array_event array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_event_size(spine_array_event array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_event spine_array_event_set_size(spine_array_event array, size_t newSize, spine_event defaultValue) { - return (spine_array_event)&((Array*)array)->setSize(newSize, (Event *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_event) &_array->setSize(newSize, (Event *) defaultValue); } void spine_array_event_ensure_capacity(spine_array_event array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_event_add(spine_array_event array, spine_event inValue) { - ((Array*)array)->add((Event *)inValue); + Array *_array = (Array *) array; + _array->add((Event *) inValue); } void spine_array_event_add_all(spine_array_event array, spine_array_event inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_event_clear_and_add_all(spine_array_event array, spine_array_event inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_event_remove_at(spine_array_event array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_event_contains(spine_array_event array, spine_event inValue) { - return ((Array*)array)->contains((Event *)inValue); + Array *_array = (Array *) array; + return _array->contains((Event *) inValue); } int spine_array_event_index_of(spine_array_event array, spine_event inValue) { - return ((Array*)array)->indexOf((Event *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((Event *) inValue); } -spine_event * spine_array_event_buffer(spine_array_event array) { - return (spine_event *)((Array*)array)->buffer(); +spine_event *spine_array_event_buffer(spine_array_event array) { + Array *_array = (Array *) array; + return (spine_event *) _array->buffer(); } spine_array_event_data spine_array_event_data_create(void) { - return (spine_array_event_data) new (__FILE__, __LINE__) Array(); + return (spine_array_event_data) new (__FILE__, __LINE__) Array(); } spine_array_event_data spine_array_event_data_create_with_capacity(size_t initialCapacity) { - return (spine_array_event_data) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_event_data) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_event_data_dispose(spine_array_event_data array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_event_data_clear(spine_array_event_data array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_event_data_get_capacity(spine_array_event_data array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_event_data_size(spine_array_event_data array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_event_data spine_array_event_data_set_size(spine_array_event_data array, size_t newSize, spine_event_data defaultValue) { - return (spine_array_event_data)&((Array*)array)->setSize(newSize, (EventData *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_event_data) &_array->setSize(newSize, (EventData *) defaultValue); } void spine_array_event_data_ensure_capacity(spine_array_event_data array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_event_data_add(spine_array_event_data array, spine_event_data inValue) { - ((Array*)array)->add((EventData *)inValue); + Array *_array = (Array *) array; + _array->add((EventData *) inValue); } void spine_array_event_data_add_all(spine_array_event_data array, spine_array_event_data inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_event_data_clear_and_add_all(spine_array_event_data array, spine_array_event_data inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_event_data_remove_at(spine_array_event_data array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_event_data_contains(spine_array_event_data array, spine_event_data inValue) { - return ((Array*)array)->contains((EventData *)inValue); + Array *_array = (Array *) array; + return _array->contains((EventData *) inValue); } int spine_array_event_data_index_of(spine_array_event_data array, spine_event_data inValue) { - return ((Array*)array)->indexOf((EventData *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((EventData *) inValue); } -spine_event_data * spine_array_event_data_buffer(spine_array_event_data array) { - return (spine_event_data *)((Array*)array)->buffer(); +spine_event_data *spine_array_event_data_buffer(spine_array_event_data array) { + Array *_array = (Array *) array; + return (spine_event_data *) _array->buffer(); } spine_array_from_property spine_array_from_property_create(void) { - return (spine_array_from_property) new (__FILE__, __LINE__) Array(); + return (spine_array_from_property) new (__FILE__, __LINE__) Array(); } spine_array_from_property spine_array_from_property_create_with_capacity(size_t initialCapacity) { - return (spine_array_from_property) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_from_property) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_from_property_dispose(spine_array_from_property array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_from_property_clear(spine_array_from_property array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_from_property_get_capacity(spine_array_from_property array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_from_property_size(spine_array_from_property array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_from_property spine_array_from_property_set_size(spine_array_from_property array, size_t newSize, spine_from_property defaultValue) { - return (spine_array_from_property)&((Array*)array)->setSize(newSize, (FromProperty *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_from_property) &_array->setSize(newSize, (FromProperty *) defaultValue); } void spine_array_from_property_ensure_capacity(spine_array_from_property array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_from_property_add(spine_array_from_property array, spine_from_property inValue) { - ((Array*)array)->add((FromProperty *)inValue); + Array *_array = (Array *) array; + _array->add((FromProperty *) inValue); } void spine_array_from_property_add_all(spine_array_from_property array, spine_array_from_property inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_from_property_clear_and_add_all(spine_array_from_property array, spine_array_from_property inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_from_property_remove_at(spine_array_from_property array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_from_property_contains(spine_array_from_property array, spine_from_property inValue) { - return ((Array*)array)->contains((FromProperty *)inValue); + Array *_array = (Array *) array; + return _array->contains((FromProperty *) inValue); } int spine_array_from_property_index_of(spine_array_from_property array, spine_from_property inValue) { - return ((Array*)array)->indexOf((FromProperty *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((FromProperty *) inValue); } -spine_from_property * spine_array_from_property_buffer(spine_array_from_property array) { - return (spine_from_property *)((Array*)array)->buffer(); +spine_from_property *spine_array_from_property_buffer(spine_array_from_property array) { + Array *_array = (Array *) array; + return (spine_from_property *) _array->buffer(); } spine_array_physics_constraint spine_array_physics_constraint_create(void) { - return (spine_array_physics_constraint) new (__FILE__, __LINE__) Array(); + return (spine_array_physics_constraint) new (__FILE__, __LINE__) Array(); } spine_array_physics_constraint spine_array_physics_constraint_create_with_capacity(size_t initialCapacity) { - return (spine_array_physics_constraint) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_physics_constraint) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_physics_constraint_dispose(spine_array_physics_constraint array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_physics_constraint_clear(spine_array_physics_constraint array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_physics_constraint_get_capacity(spine_array_physics_constraint array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_physics_constraint_size(spine_array_physics_constraint array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } -spine_array_physics_constraint spine_array_physics_constraint_set_size(spine_array_physics_constraint array, size_t newSize, spine_physics_constraint defaultValue) { - return (spine_array_physics_constraint)&((Array*)array)->setSize(newSize, (PhysicsConstraint *)defaultValue); +spine_array_physics_constraint spine_array_physics_constraint_set_size(spine_array_physics_constraint array, size_t newSize, + spine_physics_constraint defaultValue) { + Array *_array = (Array *) array; + return (spine_array_physics_constraint) &_array->setSize(newSize, (PhysicsConstraint *) defaultValue); } void spine_array_physics_constraint_ensure_capacity(spine_array_physics_constraint array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_physics_constraint_add(spine_array_physics_constraint array, spine_physics_constraint inValue) { - ((Array*)array)->add((PhysicsConstraint *)inValue); + Array *_array = (Array *) array; + _array->add((PhysicsConstraint *) inValue); } void spine_array_physics_constraint_add_all(spine_array_physics_constraint array, spine_array_physics_constraint inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_physics_constraint_clear_and_add_all(spine_array_physics_constraint array, spine_array_physics_constraint inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_physics_constraint_remove_at(spine_array_physics_constraint array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_physics_constraint_contains(spine_array_physics_constraint array, spine_physics_constraint inValue) { - return ((Array*)array)->contains((PhysicsConstraint *)inValue); + Array *_array = (Array *) array; + return _array->contains((PhysicsConstraint *) inValue); } int spine_array_physics_constraint_index_of(spine_array_physics_constraint array, spine_physics_constraint inValue) { - return ((Array*)array)->indexOf((PhysicsConstraint *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((PhysicsConstraint *) inValue); } -spine_physics_constraint * spine_array_physics_constraint_buffer(spine_array_physics_constraint array) { - return (spine_physics_constraint *)((Array*)array)->buffer(); +spine_physics_constraint *spine_array_physics_constraint_buffer(spine_array_physics_constraint array) { + Array *_array = (Array *) array; + return (spine_physics_constraint *) _array->buffer(); } spine_array_polygon spine_array_polygon_create(void) { - return (spine_array_polygon) new (__FILE__, __LINE__) Array(); + return (spine_array_polygon) new (__FILE__, __LINE__) Array(); } spine_array_polygon spine_array_polygon_create_with_capacity(size_t initialCapacity) { - return (spine_array_polygon) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_polygon) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_polygon_dispose(spine_array_polygon array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_polygon_clear(spine_array_polygon array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_polygon_get_capacity(spine_array_polygon array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_polygon_size(spine_array_polygon array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_polygon spine_array_polygon_set_size(spine_array_polygon array, size_t newSize, spine_polygon defaultValue) { - return (spine_array_polygon)&((Array*)array)->setSize(newSize, (Polygon *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_polygon) &_array->setSize(newSize, (Polygon *) defaultValue); } void spine_array_polygon_ensure_capacity(spine_array_polygon array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_polygon_add(spine_array_polygon array, spine_polygon inValue) { - ((Array*)array)->add((Polygon *)inValue); + Array *_array = (Array *) array; + _array->add((Polygon *) inValue); } void spine_array_polygon_add_all(spine_array_polygon array, spine_array_polygon inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_polygon_clear_and_add_all(spine_array_polygon array, spine_array_polygon inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_polygon_remove_at(spine_array_polygon array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_polygon_contains(spine_array_polygon array, spine_polygon inValue) { - return ((Array*)array)->contains((Polygon *)inValue); + Array *_array = (Array *) array; + return _array->contains((Polygon *) inValue); } int spine_array_polygon_index_of(spine_array_polygon array, spine_polygon inValue) { - return ((Array*)array)->indexOf((Polygon *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((Polygon *) inValue); } -spine_polygon * spine_array_polygon_buffer(spine_array_polygon array) { - return (spine_polygon *)((Array*)array)->buffer(); +spine_polygon *spine_array_polygon_buffer(spine_array_polygon array) { + Array *_array = (Array *) array; + return (spine_polygon *) _array->buffer(); } spine_array_skin spine_array_skin_create(void) { - return (spine_array_skin) new (__FILE__, __LINE__) Array(); + return (spine_array_skin) new (__FILE__, __LINE__) Array(); } spine_array_skin spine_array_skin_create_with_capacity(size_t initialCapacity) { - return (spine_array_skin) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_skin) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_skin_dispose(spine_array_skin array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_skin_clear(spine_array_skin array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_skin_get_capacity(spine_array_skin array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_skin_size(spine_array_skin array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_skin spine_array_skin_set_size(spine_array_skin array, size_t newSize, spine_skin defaultValue) { - return (spine_array_skin)&((Array*)array)->setSize(newSize, (Skin *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_skin) &_array->setSize(newSize, (Skin *) defaultValue); } void spine_array_skin_ensure_capacity(spine_array_skin array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_skin_add(spine_array_skin array, spine_skin inValue) { - ((Array*)array)->add((Skin *)inValue); + Array *_array = (Array *) array; + _array->add((Skin *) inValue); } void spine_array_skin_add_all(spine_array_skin array, spine_array_skin inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_skin_clear_and_add_all(spine_array_skin array, spine_array_skin inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_skin_remove_at(spine_array_skin array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_skin_contains(spine_array_skin array, spine_skin inValue) { - return ((Array*)array)->contains((Skin *)inValue); + Array *_array = (Array *) array; + return _array->contains((Skin *) inValue); } int spine_array_skin_index_of(spine_array_skin array, spine_skin inValue) { - return ((Array*)array)->indexOf((Skin *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((Skin *) inValue); } -spine_skin * spine_array_skin_buffer(spine_array_skin array) { - return (spine_skin *)((Array*)array)->buffer(); +spine_skin *spine_array_skin_buffer(spine_array_skin array) { + Array *_array = (Array *) array; + return (spine_skin *) _array->buffer(); } spine_array_slot spine_array_slot_create(void) { - return (spine_array_slot) new (__FILE__, __LINE__) Array(); + return (spine_array_slot) new (__FILE__, __LINE__) Array(); } spine_array_slot spine_array_slot_create_with_capacity(size_t initialCapacity) { - return (spine_array_slot) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_slot) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_slot_dispose(spine_array_slot array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_slot_clear(spine_array_slot array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_slot_get_capacity(spine_array_slot array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_slot_size(spine_array_slot array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_slot spine_array_slot_set_size(spine_array_slot array, size_t newSize, spine_slot defaultValue) { - return (spine_array_slot)&((Array*)array)->setSize(newSize, (Slot *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_slot) &_array->setSize(newSize, (Slot *) defaultValue); } void spine_array_slot_ensure_capacity(spine_array_slot array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_slot_add(spine_array_slot array, spine_slot inValue) { - ((Array*)array)->add((Slot *)inValue); + Array *_array = (Array *) array; + _array->add((Slot *) inValue); } void spine_array_slot_add_all(spine_array_slot array, spine_array_slot inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_slot_clear_and_add_all(spine_array_slot array, spine_array_slot inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_slot_remove_at(spine_array_slot array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_slot_contains(spine_array_slot array, spine_slot inValue) { - return ((Array*)array)->contains((Slot *)inValue); + Array *_array = (Array *) array; + return _array->contains((Slot *) inValue); } int spine_array_slot_index_of(spine_array_slot array, spine_slot inValue) { - return ((Array*)array)->indexOf((Slot *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((Slot *) inValue); } -spine_slot * spine_array_slot_buffer(spine_array_slot array) { - return (spine_slot *)((Array*)array)->buffer(); +spine_slot *spine_array_slot_buffer(spine_array_slot array) { + Array *_array = (Array *) array; + return (spine_slot *) _array->buffer(); } spine_array_slot_data spine_array_slot_data_create(void) { - return (spine_array_slot_data) new (__FILE__, __LINE__) Array(); + return (spine_array_slot_data) new (__FILE__, __LINE__) Array(); } spine_array_slot_data spine_array_slot_data_create_with_capacity(size_t initialCapacity) { - return (spine_array_slot_data) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_slot_data) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_slot_data_dispose(spine_array_slot_data array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_slot_data_clear(spine_array_slot_data array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_slot_data_get_capacity(spine_array_slot_data array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_slot_data_size(spine_array_slot_data array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_slot_data spine_array_slot_data_set_size(spine_array_slot_data array, size_t newSize, spine_slot_data defaultValue) { - return (spine_array_slot_data)&((Array*)array)->setSize(newSize, (SlotData *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_slot_data) &_array->setSize(newSize, (SlotData *) defaultValue); } void spine_array_slot_data_ensure_capacity(spine_array_slot_data array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_slot_data_add(spine_array_slot_data array, spine_slot_data inValue) { - ((Array*)array)->add((SlotData *)inValue); + Array *_array = (Array *) array; + _array->add((SlotData *) inValue); } void spine_array_slot_data_add_all(spine_array_slot_data array, spine_array_slot_data inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_slot_data_clear_and_add_all(spine_array_slot_data array, spine_array_slot_data inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_slot_data_remove_at(spine_array_slot_data array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_slot_data_contains(spine_array_slot_data array, spine_slot_data inValue) { - return ((Array*)array)->contains((SlotData *)inValue); + Array *_array = (Array *) array; + return _array->contains((SlotData *) inValue); } int spine_array_slot_data_index_of(spine_array_slot_data array, spine_slot_data inValue) { - return ((Array*)array)->indexOf((SlotData *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((SlotData *) inValue); } -spine_slot_data * spine_array_slot_data_buffer(spine_array_slot_data array) { - return (spine_slot_data *)((Array*)array)->buffer(); +spine_slot_data *spine_array_slot_data_buffer(spine_array_slot_data array) { + Array *_array = (Array *) array; + return (spine_slot_data *) _array->buffer(); } spine_array_texture_region spine_array_texture_region_create(void) { - return (spine_array_texture_region) new (__FILE__, __LINE__) Array(); + return (spine_array_texture_region) new (__FILE__, __LINE__) Array(); } spine_array_texture_region spine_array_texture_region_create_with_capacity(size_t initialCapacity) { - return (spine_array_texture_region) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_texture_region) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_texture_region_dispose(spine_array_texture_region array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_texture_region_clear(spine_array_texture_region array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_texture_region_get_capacity(spine_array_texture_region array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_texture_region_size(spine_array_texture_region array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_texture_region spine_array_texture_region_set_size(spine_array_texture_region array, size_t newSize, spine_texture_region defaultValue) { - return (spine_array_texture_region)&((Array*)array)->setSize(newSize, (TextureRegion *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_texture_region) &_array->setSize(newSize, (TextureRegion *) defaultValue); } void spine_array_texture_region_ensure_capacity(spine_array_texture_region array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_texture_region_add(spine_array_texture_region array, spine_texture_region inValue) { - ((Array*)array)->add((TextureRegion *)inValue); + Array *_array = (Array *) array; + _array->add((TextureRegion *) inValue); } void spine_array_texture_region_add_all(spine_array_texture_region array, spine_array_texture_region inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_texture_region_clear_and_add_all(spine_array_texture_region array, spine_array_texture_region inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_texture_region_remove_at(spine_array_texture_region array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_texture_region_contains(spine_array_texture_region array, spine_texture_region inValue) { - return ((Array*)array)->contains((TextureRegion *)inValue); + Array *_array = (Array *) array; + return _array->contains((TextureRegion *) inValue); } int spine_array_texture_region_index_of(spine_array_texture_region array, spine_texture_region inValue) { - return ((Array*)array)->indexOf((TextureRegion *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((TextureRegion *) inValue); } -spine_texture_region * spine_array_texture_region_buffer(spine_array_texture_region array) { - return (spine_texture_region *)((Array*)array)->buffer(); +spine_texture_region *spine_array_texture_region_buffer(spine_array_texture_region array) { + Array *_array = (Array *) array; + return (spine_texture_region *) _array->buffer(); } spine_array_timeline spine_array_timeline_create(void) { - return (spine_array_timeline) new (__FILE__, __LINE__) Array(); + return (spine_array_timeline) new (__FILE__, __LINE__) Array(); } spine_array_timeline spine_array_timeline_create_with_capacity(size_t initialCapacity) { - return (spine_array_timeline) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_timeline) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_timeline_dispose(spine_array_timeline array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_timeline_clear(spine_array_timeline array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_timeline_get_capacity(spine_array_timeline array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_timeline_size(spine_array_timeline array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_timeline spine_array_timeline_set_size(spine_array_timeline array, size_t newSize, spine_timeline defaultValue) { - return (spine_array_timeline)&((Array*)array)->setSize(newSize, (Timeline *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_timeline) &_array->setSize(newSize, (Timeline *) defaultValue); } void spine_array_timeline_ensure_capacity(spine_array_timeline array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_timeline_add(spine_array_timeline array, spine_timeline inValue) { - ((Array*)array)->add((Timeline *)inValue); + Array *_array = (Array *) array; + _array->add((Timeline *) inValue); } void spine_array_timeline_add_all(spine_array_timeline array, spine_array_timeline inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_timeline_clear_and_add_all(spine_array_timeline array, spine_array_timeline inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_timeline_remove_at(spine_array_timeline array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_timeline_contains(spine_array_timeline array, spine_timeline inValue) { - return ((Array*)array)->contains((Timeline *)inValue); + Array *_array = (Array *) array; + return _array->contains((Timeline *) inValue); } int spine_array_timeline_index_of(spine_array_timeline array, spine_timeline inValue) { - return ((Array*)array)->indexOf((Timeline *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((Timeline *) inValue); } -spine_timeline * spine_array_timeline_buffer(spine_array_timeline array) { - return (spine_timeline *)((Array*)array)->buffer(); +spine_timeline *spine_array_timeline_buffer(spine_array_timeline array) { + Array *_array = (Array *) array; + return (spine_timeline *) _array->buffer(); } spine_array_to_property spine_array_to_property_create(void) { - return (spine_array_to_property) new (__FILE__, __LINE__) Array(); + return (spine_array_to_property) new (__FILE__, __LINE__) Array(); } spine_array_to_property spine_array_to_property_create_with_capacity(size_t initialCapacity) { - return (spine_array_to_property) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_to_property) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_to_property_dispose(spine_array_to_property array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_to_property_clear(spine_array_to_property array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_to_property_get_capacity(spine_array_to_property array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_to_property_size(spine_array_to_property array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_to_property spine_array_to_property_set_size(spine_array_to_property array, size_t newSize, spine_to_property defaultValue) { - return (spine_array_to_property)&((Array*)array)->setSize(newSize, (ToProperty *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_to_property) &_array->setSize(newSize, (ToProperty *) defaultValue); } void spine_array_to_property_ensure_capacity(spine_array_to_property array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_to_property_add(spine_array_to_property array, spine_to_property inValue) { - ((Array*)array)->add((ToProperty *)inValue); + Array *_array = (Array *) array; + _array->add((ToProperty *) inValue); } void spine_array_to_property_add_all(spine_array_to_property array, spine_array_to_property inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_to_property_clear_and_add_all(spine_array_to_property array, spine_array_to_property inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_to_property_remove_at(spine_array_to_property array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_to_property_contains(spine_array_to_property array, spine_to_property inValue) { - return ((Array*)array)->contains((ToProperty *)inValue); + Array *_array = (Array *) array; + return _array->contains((ToProperty *) inValue); } int spine_array_to_property_index_of(spine_array_to_property array, spine_to_property inValue) { - return ((Array*)array)->indexOf((ToProperty *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((ToProperty *) inValue); } -spine_to_property * spine_array_to_property_buffer(spine_array_to_property array) { - return (spine_to_property *)((Array*)array)->buffer(); +spine_to_property *spine_array_to_property_buffer(spine_array_to_property array) { + Array *_array = (Array *) array; + return (spine_to_property *) _array->buffer(); } spine_array_track_entry spine_array_track_entry_create(void) { - return (spine_array_track_entry) new (__FILE__, __LINE__) Array(); + return (spine_array_track_entry) new (__FILE__, __LINE__) Array(); } spine_array_track_entry spine_array_track_entry_create_with_capacity(size_t initialCapacity) { - return (spine_array_track_entry) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_track_entry) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_track_entry_dispose(spine_array_track_entry array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_track_entry_clear(spine_array_track_entry array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_track_entry_get_capacity(spine_array_track_entry array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_track_entry_size(spine_array_track_entry array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_track_entry spine_array_track_entry_set_size(spine_array_track_entry array, size_t newSize, spine_track_entry defaultValue) { - return (spine_array_track_entry)&((Array*)array)->setSize(newSize, (TrackEntry *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_track_entry) &_array->setSize(newSize, (TrackEntry *) defaultValue); } void spine_array_track_entry_ensure_capacity(spine_array_track_entry array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_track_entry_add(spine_array_track_entry array, spine_track_entry inValue) { - ((Array*)array)->add((TrackEntry *)inValue); + Array *_array = (Array *) array; + _array->add((TrackEntry *) inValue); } void spine_array_track_entry_add_all(spine_array_track_entry array, spine_array_track_entry inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_track_entry_clear_and_add_all(spine_array_track_entry array, spine_array_track_entry inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_track_entry_remove_at(spine_array_track_entry array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_track_entry_contains(spine_array_track_entry array, spine_track_entry inValue) { - return ((Array*)array)->contains((TrackEntry *)inValue); + Array *_array = (Array *) array; + return _array->contains((TrackEntry *) inValue); } int spine_array_track_entry_index_of(spine_array_track_entry array, spine_track_entry inValue) { - return ((Array*)array)->indexOf((TrackEntry *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((TrackEntry *) inValue); } -spine_track_entry * spine_array_track_entry_buffer(spine_array_track_entry array) { - return (spine_track_entry *)((Array*)array)->buffer(); +spine_track_entry *spine_array_track_entry_buffer(spine_array_track_entry array) { + Array *_array = (Array *) array; + return (spine_track_entry *) _array->buffer(); } spine_array_update spine_array_update_create(void) { - return (spine_array_update) new (__FILE__, __LINE__) Array(); + return (spine_array_update) new (__FILE__, __LINE__) Array(); } spine_array_update spine_array_update_create_with_capacity(size_t initialCapacity) { - return (spine_array_update) new (__FILE__, __LINE__) Array(initialCapacity); + return (spine_array_update) new (__FILE__, __LINE__) Array(initialCapacity); } void spine_array_update_dispose(spine_array_update array) { - delete (Array*)array; + delete (Array *) array; } void spine_array_update_clear(spine_array_update array) { - ((Array*)array)->clear(); + Array *_array = (Array *) array; + _array->clear(); } size_t spine_array_update_get_capacity(spine_array_update array) { - return ((Array*)array)->getCapacity(); + Array *_array = (Array *) array; + return _array->getCapacity(); } size_t spine_array_update_size(spine_array_update array) { - return ((Array*)array)->size(); + Array *_array = (Array *) array; + return _array->size(); } spine_array_update spine_array_update_set_size(spine_array_update array, size_t newSize, spine_update defaultValue) { - return (spine_array_update)&((Array*)array)->setSize(newSize, (Update *)defaultValue); + Array *_array = (Array *) array; + return (spine_array_update) &_array->setSize(newSize, (Update *) defaultValue); } void spine_array_update_ensure_capacity(spine_array_update array, size_t newCapacity) { - ((Array*)array)->ensureCapacity(newCapacity); + Array *_array = (Array *) array; + _array->ensureCapacity(newCapacity); } void spine_array_update_add(spine_array_update array, spine_update inValue) { - ((Array*)array)->add((Update *)inValue); + Array *_array = (Array *) array; + _array->add((Update *) inValue); } void spine_array_update_add_all(spine_array_update array, spine_array_update inValue) { - ((Array*)array)->addAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->addAll(*((const Array *) inValue)); } void spine_array_update_clear_and_add_all(spine_array_update array, spine_array_update inValue) { - ((Array*)array)->clearAndAddAll(*((const Array*)inValue)); + Array *_array = (Array *) array; + _array->clearAndAddAll(*((const Array *) inValue)); } void spine_array_update_remove_at(spine_array_update array, size_t inIndex) { - ((Array*)array)->removeAt(inIndex); + Array *_array = (Array *) array; + _array->removeAt(inIndex); } bool spine_array_update_contains(spine_array_update array, spine_update inValue) { - return ((Array*)array)->contains((Update *)inValue); + Array *_array = (Array *) array; + return _array->contains((Update *) inValue); } int spine_array_update_index_of(spine_array_update array, spine_update inValue) { - return ((Array*)array)->indexOf((Update *)inValue); + Array *_array = (Array *) array; + return _array->indexOf((Update *) inValue); } -spine_update * spine_array_update_buffer(spine_array_update array) { - return (spine_update *)((Array*)array)->buffer(); +spine_update *spine_array_update_buffer(spine_array_update array) { + Array *_array = (Array *) array; + return (spine_update *) _array->buffer(); } diff --git a/spine-c/src/generated/arrays.h b/spine-c/src/generated/arrays.h index 454671c00..aba91fb9b 100644 --- a/spine-c/src/generated/arrays.h +++ b/spine-c/src/generated/arrays.h @@ -91,7 +91,7 @@ SPINE_C_API bool spine_array_float_contains(spine_array_float array, float inVal SPINE_C_API int spine_array_float_index_of(spine_array_float array, float inValue); -SPINE_C_API float * spine_array_float_buffer(spine_array_float array); +SPINE_C_API float *spine_array_float_buffer(spine_array_float array); SPINE_C_API spine_array_int spine_array_int_create(void); @@ -119,7 +119,7 @@ SPINE_C_API bool spine_array_int_contains(spine_array_int array, int inValue); SPINE_C_API int spine_array_int_index_of(spine_array_int array, int inValue); -SPINE_C_API int * spine_array_int_buffer(spine_array_int array); +SPINE_C_API int *spine_array_int_buffer(spine_array_int array); SPINE_C_API spine_array_unsigned_short spine_array_unsigned_short_create(void); @@ -131,7 +131,8 @@ SPINE_C_API size_t spine_array_unsigned_short_get_capacity(spine_array_unsigned_ SPINE_C_API size_t spine_array_unsigned_short_size(spine_array_unsigned_short array); -SPINE_C_API spine_array_unsigned_short spine_array_unsigned_short_set_size(spine_array_unsigned_short array, size_t newSize, unsigned short defaultValue); +SPINE_C_API spine_array_unsigned_short spine_array_unsigned_short_set_size(spine_array_unsigned_short array, size_t newSize, + unsigned short defaultValue); SPINE_C_API void spine_array_unsigned_short_ensure_capacity(spine_array_unsigned_short array, size_t newCapacity); @@ -147,7 +148,7 @@ SPINE_C_API bool spine_array_unsigned_short_contains(spine_array_unsigned_short SPINE_C_API int spine_array_unsigned_short_index_of(spine_array_unsigned_short array, unsigned short inValue); -SPINE_C_API unsigned short * spine_array_unsigned_short_buffer(spine_array_unsigned_short array); +SPINE_C_API unsigned short *spine_array_unsigned_short_buffer(spine_array_unsigned_short array); SPINE_C_API spine_array_property_id spine_array_property_id_create(void); @@ -203,7 +204,7 @@ SPINE_C_API bool spine_array_animation_contains(spine_array_animation array, spi SPINE_C_API int spine_array_animation_index_of(spine_array_animation array, spine_animation inValue); -SPINE_C_API spine_animation * spine_array_animation_buffer(spine_array_animation array); +SPINE_C_API spine_animation *spine_array_animation_buffer(spine_array_animation array); SPINE_C_API spine_array_atlas_page spine_array_atlas_page_create(void); @@ -231,7 +232,7 @@ SPINE_C_API bool spine_array_atlas_page_contains(spine_array_atlas_page array, s SPINE_C_API int spine_array_atlas_page_index_of(spine_array_atlas_page array, spine_atlas_page inValue); -SPINE_C_API spine_atlas_page * spine_array_atlas_page_buffer(spine_array_atlas_page array); +SPINE_C_API spine_atlas_page *spine_array_atlas_page_buffer(spine_array_atlas_page array); SPINE_C_API spine_array_atlas_region spine_array_atlas_region_create(void); @@ -243,7 +244,8 @@ SPINE_C_API size_t spine_array_atlas_region_get_capacity(spine_array_atlas_regio SPINE_C_API size_t spine_array_atlas_region_size(spine_array_atlas_region array); -SPINE_C_API spine_array_atlas_region spine_array_atlas_region_set_size(spine_array_atlas_region array, size_t newSize, spine_atlas_region defaultValue); +SPINE_C_API spine_array_atlas_region spine_array_atlas_region_set_size(spine_array_atlas_region array, size_t newSize, + spine_atlas_region defaultValue); SPINE_C_API void spine_array_atlas_region_ensure_capacity(spine_array_atlas_region array, size_t newCapacity); @@ -259,7 +261,7 @@ SPINE_C_API bool spine_array_atlas_region_contains(spine_array_atlas_region arra SPINE_C_API int spine_array_atlas_region_index_of(spine_array_atlas_region array, spine_atlas_region inValue); -SPINE_C_API spine_atlas_region * spine_array_atlas_region_buffer(spine_array_atlas_region array); +SPINE_C_API spine_atlas_region *spine_array_atlas_region_buffer(spine_array_atlas_region array); SPINE_C_API spine_array_attachment spine_array_attachment_create(void); @@ -287,7 +289,7 @@ SPINE_C_API bool spine_array_attachment_contains(spine_array_attachment array, s SPINE_C_API int spine_array_attachment_index_of(spine_array_attachment array, spine_attachment inValue); -SPINE_C_API spine_attachment * spine_array_attachment_buffer(spine_array_attachment array); +SPINE_C_API spine_attachment *spine_array_attachment_buffer(spine_array_attachment array); SPINE_C_API spine_array_bone spine_array_bone_create(void); @@ -315,7 +317,7 @@ SPINE_C_API bool spine_array_bone_contains(spine_array_bone array, spine_bone in SPINE_C_API int spine_array_bone_index_of(spine_array_bone array, spine_bone inValue); -SPINE_C_API spine_bone * spine_array_bone_buffer(spine_array_bone array); +SPINE_C_API spine_bone *spine_array_bone_buffer(spine_array_bone array); SPINE_C_API spine_array_bone_data spine_array_bone_data_create(void); @@ -343,7 +345,7 @@ SPINE_C_API bool spine_array_bone_data_contains(spine_array_bone_data array, spi SPINE_C_API int spine_array_bone_data_index_of(spine_array_bone_data array, spine_bone_data inValue); -SPINE_C_API spine_bone_data * spine_array_bone_data_buffer(spine_array_bone_data array); +SPINE_C_API spine_bone_data *spine_array_bone_data_buffer(spine_array_bone_data array); SPINE_C_API spine_array_bone_pose spine_array_bone_pose_create(void); @@ -371,7 +373,7 @@ SPINE_C_API bool spine_array_bone_pose_contains(spine_array_bone_pose array, spi SPINE_C_API int spine_array_bone_pose_index_of(spine_array_bone_pose array, spine_bone_pose inValue); -SPINE_C_API spine_bone_pose * spine_array_bone_pose_buffer(spine_array_bone_pose array); +SPINE_C_API spine_bone_pose *spine_array_bone_pose_buffer(spine_array_bone_pose array); SPINE_C_API spine_array_bounding_box_attachment spine_array_bounding_box_attachment_create(void); @@ -383,7 +385,9 @@ SPINE_C_API size_t spine_array_bounding_box_attachment_get_capacity(spine_array_ SPINE_C_API size_t spine_array_bounding_box_attachment_size(spine_array_bounding_box_attachment array); -SPINE_C_API spine_array_bounding_box_attachment spine_array_bounding_box_attachment_set_size(spine_array_bounding_box_attachment array, size_t newSize, spine_bounding_box_attachment defaultValue); +SPINE_C_API spine_array_bounding_box_attachment spine_array_bounding_box_attachment_set_size(spine_array_bounding_box_attachment array, + size_t newSize, + spine_bounding_box_attachment defaultValue); SPINE_C_API void spine_array_bounding_box_attachment_ensure_capacity(spine_array_bounding_box_attachment array, size_t newCapacity); @@ -391,7 +395,8 @@ SPINE_C_API void spine_array_bounding_box_attachment_add(spine_array_bounding_bo SPINE_C_API void spine_array_bounding_box_attachment_add_all(spine_array_bounding_box_attachment array, spine_array_bounding_box_attachment inValue); -SPINE_C_API void spine_array_bounding_box_attachment_clear_and_add_all(spine_array_bounding_box_attachment array, spine_array_bounding_box_attachment inValue); +SPINE_C_API void spine_array_bounding_box_attachment_clear_and_add_all(spine_array_bounding_box_attachment array, + spine_array_bounding_box_attachment inValue); SPINE_C_API void spine_array_bounding_box_attachment_remove_at(spine_array_bounding_box_attachment array, size_t inIndex); @@ -399,7 +404,7 @@ SPINE_C_API bool spine_array_bounding_box_attachment_contains(spine_array_boundi SPINE_C_API int spine_array_bounding_box_attachment_index_of(spine_array_bounding_box_attachment array, spine_bounding_box_attachment inValue); -SPINE_C_API spine_bounding_box_attachment * spine_array_bounding_box_attachment_buffer(spine_array_bounding_box_attachment array); +SPINE_C_API spine_bounding_box_attachment *spine_array_bounding_box_attachment_buffer(spine_array_bounding_box_attachment array); SPINE_C_API spine_array_constraint spine_array_constraint_create(void); @@ -427,7 +432,7 @@ SPINE_C_API bool spine_array_constraint_contains(spine_array_constraint array, s SPINE_C_API int spine_array_constraint_index_of(spine_array_constraint array, spine_constraint inValue); -SPINE_C_API spine_constraint * spine_array_constraint_buffer(spine_array_constraint array); +SPINE_C_API spine_constraint *spine_array_constraint_buffer(spine_array_constraint array); SPINE_C_API spine_array_constraint_data spine_array_constraint_data_create(void); @@ -439,7 +444,8 @@ SPINE_C_API size_t spine_array_constraint_data_get_capacity(spine_array_constrai SPINE_C_API size_t spine_array_constraint_data_size(spine_array_constraint_data array); -SPINE_C_API spine_array_constraint_data spine_array_constraint_data_set_size(spine_array_constraint_data array, size_t newSize, spine_constraint_data defaultValue); +SPINE_C_API spine_array_constraint_data spine_array_constraint_data_set_size(spine_array_constraint_data array, size_t newSize, + spine_constraint_data defaultValue); SPINE_C_API void spine_array_constraint_data_ensure_capacity(spine_array_constraint_data array, size_t newCapacity); @@ -455,7 +461,7 @@ SPINE_C_API bool spine_array_constraint_data_contains(spine_array_constraint_dat SPINE_C_API int spine_array_constraint_data_index_of(spine_array_constraint_data array, spine_constraint_data inValue); -SPINE_C_API spine_constraint_data * spine_array_constraint_data_buffer(spine_array_constraint_data array); +SPINE_C_API spine_constraint_data *spine_array_constraint_data_buffer(spine_array_constraint_data array); SPINE_C_API spine_array_event spine_array_event_create(void); @@ -483,7 +489,7 @@ SPINE_C_API bool spine_array_event_contains(spine_array_event array, spine_event SPINE_C_API int spine_array_event_index_of(spine_array_event array, spine_event inValue); -SPINE_C_API spine_event * spine_array_event_buffer(spine_array_event array); +SPINE_C_API spine_event *spine_array_event_buffer(spine_array_event array); SPINE_C_API spine_array_event_data spine_array_event_data_create(void); @@ -511,7 +517,7 @@ SPINE_C_API bool spine_array_event_data_contains(spine_array_event_data array, s SPINE_C_API int spine_array_event_data_index_of(spine_array_event_data array, spine_event_data inValue); -SPINE_C_API spine_event_data * spine_array_event_data_buffer(spine_array_event_data array); +SPINE_C_API spine_event_data *spine_array_event_data_buffer(spine_array_event_data array); SPINE_C_API spine_array_from_property spine_array_from_property_create(void); @@ -523,7 +529,8 @@ SPINE_C_API size_t spine_array_from_property_get_capacity(spine_array_from_prope SPINE_C_API size_t spine_array_from_property_size(spine_array_from_property array); -SPINE_C_API spine_array_from_property spine_array_from_property_set_size(spine_array_from_property array, size_t newSize, spine_from_property defaultValue); +SPINE_C_API spine_array_from_property spine_array_from_property_set_size(spine_array_from_property array, size_t newSize, + spine_from_property defaultValue); SPINE_C_API void spine_array_from_property_ensure_capacity(spine_array_from_property array, size_t newCapacity); @@ -539,7 +546,7 @@ SPINE_C_API bool spine_array_from_property_contains(spine_array_from_property ar SPINE_C_API int spine_array_from_property_index_of(spine_array_from_property array, spine_from_property inValue); -SPINE_C_API spine_from_property * spine_array_from_property_buffer(spine_array_from_property array); +SPINE_C_API spine_from_property *spine_array_from_property_buffer(spine_array_from_property array); SPINE_C_API spine_array_physics_constraint spine_array_physics_constraint_create(void); @@ -551,7 +558,8 @@ SPINE_C_API size_t spine_array_physics_constraint_get_capacity(spine_array_physi SPINE_C_API size_t spine_array_physics_constraint_size(spine_array_physics_constraint array); -SPINE_C_API spine_array_physics_constraint spine_array_physics_constraint_set_size(spine_array_physics_constraint array, size_t newSize, spine_physics_constraint defaultValue); +SPINE_C_API spine_array_physics_constraint spine_array_physics_constraint_set_size(spine_array_physics_constraint array, size_t newSize, + spine_physics_constraint defaultValue); SPINE_C_API void spine_array_physics_constraint_ensure_capacity(spine_array_physics_constraint array, size_t newCapacity); @@ -567,7 +575,7 @@ SPINE_C_API bool spine_array_physics_constraint_contains(spine_array_physics_con SPINE_C_API int spine_array_physics_constraint_index_of(spine_array_physics_constraint array, spine_physics_constraint inValue); -SPINE_C_API spine_physics_constraint * spine_array_physics_constraint_buffer(spine_array_physics_constraint array); +SPINE_C_API spine_physics_constraint *spine_array_physics_constraint_buffer(spine_array_physics_constraint array); SPINE_C_API spine_array_polygon spine_array_polygon_create(void); @@ -595,7 +603,7 @@ SPINE_C_API bool spine_array_polygon_contains(spine_array_polygon array, spine_p SPINE_C_API int spine_array_polygon_index_of(spine_array_polygon array, spine_polygon inValue); -SPINE_C_API spine_polygon * spine_array_polygon_buffer(spine_array_polygon array); +SPINE_C_API spine_polygon *spine_array_polygon_buffer(spine_array_polygon array); SPINE_C_API spine_array_skin spine_array_skin_create(void); @@ -623,7 +631,7 @@ SPINE_C_API bool spine_array_skin_contains(spine_array_skin array, spine_skin in SPINE_C_API int spine_array_skin_index_of(spine_array_skin array, spine_skin inValue); -SPINE_C_API spine_skin * spine_array_skin_buffer(spine_array_skin array); +SPINE_C_API spine_skin *spine_array_skin_buffer(spine_array_skin array); SPINE_C_API spine_array_slot spine_array_slot_create(void); @@ -651,7 +659,7 @@ SPINE_C_API bool spine_array_slot_contains(spine_array_slot array, spine_slot in SPINE_C_API int spine_array_slot_index_of(spine_array_slot array, spine_slot inValue); -SPINE_C_API spine_slot * spine_array_slot_buffer(spine_array_slot array); +SPINE_C_API spine_slot *spine_array_slot_buffer(spine_array_slot array); SPINE_C_API spine_array_slot_data spine_array_slot_data_create(void); @@ -679,7 +687,7 @@ SPINE_C_API bool spine_array_slot_data_contains(spine_array_slot_data array, spi SPINE_C_API int spine_array_slot_data_index_of(spine_array_slot_data array, spine_slot_data inValue); -SPINE_C_API spine_slot_data * spine_array_slot_data_buffer(spine_array_slot_data array); +SPINE_C_API spine_slot_data *spine_array_slot_data_buffer(spine_array_slot_data array); SPINE_C_API spine_array_texture_region spine_array_texture_region_create(void); @@ -691,7 +699,8 @@ SPINE_C_API size_t spine_array_texture_region_get_capacity(spine_array_texture_r SPINE_C_API size_t spine_array_texture_region_size(spine_array_texture_region array); -SPINE_C_API spine_array_texture_region spine_array_texture_region_set_size(spine_array_texture_region array, size_t newSize, spine_texture_region defaultValue); +SPINE_C_API spine_array_texture_region spine_array_texture_region_set_size(spine_array_texture_region array, size_t newSize, + spine_texture_region defaultValue); SPINE_C_API void spine_array_texture_region_ensure_capacity(spine_array_texture_region array, size_t newCapacity); @@ -707,7 +716,7 @@ SPINE_C_API bool spine_array_texture_region_contains(spine_array_texture_region SPINE_C_API int spine_array_texture_region_index_of(spine_array_texture_region array, spine_texture_region inValue); -SPINE_C_API spine_texture_region * spine_array_texture_region_buffer(spine_array_texture_region array); +SPINE_C_API spine_texture_region *spine_array_texture_region_buffer(spine_array_texture_region array); SPINE_C_API spine_array_timeline spine_array_timeline_create(void); @@ -735,7 +744,7 @@ SPINE_C_API bool spine_array_timeline_contains(spine_array_timeline array, spine SPINE_C_API int spine_array_timeline_index_of(spine_array_timeline array, spine_timeline inValue); -SPINE_C_API spine_timeline * spine_array_timeline_buffer(spine_array_timeline array); +SPINE_C_API spine_timeline *spine_array_timeline_buffer(spine_array_timeline array); SPINE_C_API spine_array_to_property spine_array_to_property_create(void); @@ -763,7 +772,7 @@ SPINE_C_API bool spine_array_to_property_contains(spine_array_to_property array, SPINE_C_API int spine_array_to_property_index_of(spine_array_to_property array, spine_to_property inValue); -SPINE_C_API spine_to_property * spine_array_to_property_buffer(spine_array_to_property array); +SPINE_C_API spine_to_property *spine_array_to_property_buffer(spine_array_to_property array); SPINE_C_API spine_array_track_entry spine_array_track_entry_create(void); @@ -791,7 +800,7 @@ SPINE_C_API bool spine_array_track_entry_contains(spine_array_track_entry array, SPINE_C_API int spine_array_track_entry_index_of(spine_array_track_entry array, spine_track_entry inValue); -SPINE_C_API spine_track_entry * spine_array_track_entry_buffer(spine_array_track_entry array); +SPINE_C_API spine_track_entry *spine_array_track_entry_buffer(spine_array_track_entry array); SPINE_C_API spine_array_update spine_array_update_create(void); @@ -819,7 +828,7 @@ SPINE_C_API bool spine_array_update_contains(spine_array_update array, spine_upd SPINE_C_API int spine_array_update_index_of(spine_array_update array, spine_update inValue); -SPINE_C_API spine_update * spine_array_update_buffer(spine_array_update array); +SPINE_C_API spine_update *spine_array_update_buffer(spine_array_update array); #ifdef __cplusplus } diff --git a/spine-c/src/generated/atlas.cpp b/spine-c/src/generated/atlas.cpp index d711e4395..f8dbcbe70 100644 --- a/spine-c/src/generated/atlas.cpp +++ b/spine-c/src/generated/atlas.cpp @@ -4,21 +4,25 @@ using namespace spine; void spine_atlas_dispose(spine_atlas self) { - delete (Atlas*)self; + delete (Atlas *) self; } void spine_atlas_flip_v(spine_atlas self) { - ((Atlas*)self)->flipV(); + Atlas *_self = (Atlas *) self; + _self->flipV(); } -spine_atlas_region spine_atlas_find_region(spine_atlas self, const char * name) { - return (spine_atlas_region)((Atlas*)self)->findRegion(String(name)); +spine_atlas_region spine_atlas_find_region(spine_atlas self, const char *name) { + Atlas *_self = (Atlas *) self; + return (spine_atlas_region) _self->findRegion(String(name)); } spine_array_atlas_page spine_atlas_get_pages(spine_atlas self) { - return (spine_array_atlas_page)&((Atlas*)self)->getPages(); + Atlas *_self = (Atlas *) self; + return (spine_array_atlas_page) &_self->getPages(); } spine_array_atlas_region spine_atlas_get_regions(spine_atlas self) { - return (spine_array_atlas_region)&((Atlas*)self)->getRegions(); + Atlas *_self = (Atlas *) self; + return (spine_array_atlas_region) &_self->getRegions(); } diff --git a/spine-c/src/generated/atlas.h b/spine-c/src/generated/atlas.h index a9cd92375..82a13b6ec 100644 --- a/spine-c/src/generated/atlas.h +++ b/spine-c/src/generated/atlas.h @@ -11,7 +11,7 @@ extern "C" { SPINE_C_API void spine_atlas_dispose(spine_atlas self); SPINE_C_API void spine_atlas_flip_v(spine_atlas self); -SPINE_C_API spine_atlas_region spine_atlas_find_region(spine_atlas self, const char * name); +SPINE_C_API spine_atlas_region spine_atlas_find_region(spine_atlas self, const char *name); SPINE_C_API spine_array_atlas_page spine_atlas_get_pages(spine_atlas self); SPINE_C_API spine_array_atlas_region spine_atlas_get_regions(spine_atlas self); diff --git a/spine-c/src/generated/atlas_attachment_loader.cpp b/spine-c/src/generated/atlas_attachment_loader.cpp index 761a66aa4..2f74ccbe8 100644 --- a/spine-c/src/generated/atlas_attachment_loader.cpp +++ b/spine-c/src/generated/atlas_attachment_loader.cpp @@ -4,37 +4,48 @@ using namespace spine; spine_atlas_attachment_loader spine_atlas_attachment_loader_create(spine_atlas atlas) { - return (spine_atlas_attachment_loader) new (__FILE__, __LINE__) AtlasAttachmentLoader((Atlas *)atlas); + return (spine_atlas_attachment_loader) new (__FILE__, __LINE__) AtlasAttachmentLoader((Atlas *) atlas); } void spine_atlas_attachment_loader_dispose(spine_atlas_attachment_loader self) { - delete (AtlasAttachmentLoader*)self; + delete (AtlasAttachmentLoader *) self; } -spine_region_attachment spine_atlas_attachment_loader_new_region_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char * name, const char * path, spine_sequence sequence) { - return (spine_region_attachment)((AtlasAttachmentLoader*)self)->newRegionAttachment(*((Skin*)skin), String(name), String(path), (Sequence *)sequence); +spine_region_attachment spine_atlas_attachment_loader_new_region_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char *name, + const char *path, spine_sequence sequence) { + AtlasAttachmentLoader *_self = (AtlasAttachmentLoader *) self; + return (spine_region_attachment) _self->newRegionAttachment(*((Skin *) skin), String(name), String(path), (Sequence *) sequence); } -spine_mesh_attachment spine_atlas_attachment_loader_new_mesh_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char * name, const char * path, spine_sequence sequence) { - return (spine_mesh_attachment)((AtlasAttachmentLoader*)self)->newMeshAttachment(*((Skin*)skin), String(name), String(path), (Sequence *)sequence); +spine_mesh_attachment spine_atlas_attachment_loader_new_mesh_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char *name, + const char *path, spine_sequence sequence) { + AtlasAttachmentLoader *_self = (AtlasAttachmentLoader *) self; + return (spine_mesh_attachment) _self->newMeshAttachment(*((Skin *) skin), String(name), String(path), (Sequence *) sequence); } -spine_bounding_box_attachment spine_atlas_attachment_loader_new_bounding_box_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char * name) { - return (spine_bounding_box_attachment)((AtlasAttachmentLoader*)self)->newBoundingBoxAttachment(*((Skin*)skin), String(name)); +spine_bounding_box_attachment spine_atlas_attachment_loader_new_bounding_box_attachment(spine_atlas_attachment_loader self, spine_skin skin, + const char *name) { + AtlasAttachmentLoader *_self = (AtlasAttachmentLoader *) self; + return (spine_bounding_box_attachment) _self->newBoundingBoxAttachment(*((Skin *) skin), String(name)); } -spine_path_attachment spine_atlas_attachment_loader_new_path_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char * name) { - return (spine_path_attachment)((AtlasAttachmentLoader*)self)->newPathAttachment(*((Skin*)skin), String(name)); +spine_path_attachment spine_atlas_attachment_loader_new_path_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char *name) { + AtlasAttachmentLoader *_self = (AtlasAttachmentLoader *) self; + return (spine_path_attachment) _self->newPathAttachment(*((Skin *) skin), String(name)); } -spine_point_attachment spine_atlas_attachment_loader_new_point_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char * name) { - return (spine_point_attachment)((AtlasAttachmentLoader*)self)->newPointAttachment(*((Skin*)skin), String(name)); +spine_point_attachment spine_atlas_attachment_loader_new_point_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char *name) { + AtlasAttachmentLoader *_self = (AtlasAttachmentLoader *) self; + return (spine_point_attachment) _self->newPointAttachment(*((Skin *) skin), String(name)); } -spine_clipping_attachment spine_atlas_attachment_loader_new_clipping_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char * name) { - return (spine_clipping_attachment)((AtlasAttachmentLoader*)self)->newClippingAttachment(*((Skin*)skin), String(name)); +spine_clipping_attachment spine_atlas_attachment_loader_new_clipping_attachment(spine_atlas_attachment_loader self, spine_skin skin, + const char *name) { + AtlasAttachmentLoader *_self = (AtlasAttachmentLoader *) self; + return (spine_clipping_attachment) _self->newClippingAttachment(*((Skin *) skin), String(name)); } -spine_atlas_region spine_atlas_attachment_loader_find_region(spine_atlas_attachment_loader self, const char * name) { - return (spine_atlas_region)((AtlasAttachmentLoader*)self)->findRegion(String(name)); +spine_atlas_region spine_atlas_attachment_loader_find_region(spine_atlas_attachment_loader self, const char *name) { + AtlasAttachmentLoader *_self = (AtlasAttachmentLoader *) self; + return (spine_atlas_region) _self->findRegion(String(name)); } diff --git a/spine-c/src/generated/atlas_attachment_loader.h b/spine-c/src/generated/atlas_attachment_loader.h index 7cc0bfb12..12cff3b45 100644 --- a/spine-c/src/generated/atlas_attachment_loader.h +++ b/spine-c/src/generated/atlas_attachment_loader.h @@ -12,13 +12,19 @@ SPINE_C_API spine_atlas_attachment_loader spine_atlas_attachment_loader_create(s SPINE_C_API void spine_atlas_attachment_loader_dispose(spine_atlas_attachment_loader self); -SPINE_C_API spine_region_attachment spine_atlas_attachment_loader_new_region_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char * name, const char * path, spine_sequence sequence); -SPINE_C_API spine_mesh_attachment spine_atlas_attachment_loader_new_mesh_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char * name, const char * path, spine_sequence sequence); -SPINE_C_API spine_bounding_box_attachment spine_atlas_attachment_loader_new_bounding_box_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char * name); -SPINE_C_API spine_path_attachment spine_atlas_attachment_loader_new_path_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char * name); -SPINE_C_API spine_point_attachment spine_atlas_attachment_loader_new_point_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char * name); -SPINE_C_API spine_clipping_attachment spine_atlas_attachment_loader_new_clipping_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char * name); -SPINE_C_API spine_atlas_region spine_atlas_attachment_loader_find_region(spine_atlas_attachment_loader self, const char * name); +SPINE_C_API spine_region_attachment spine_atlas_attachment_loader_new_region_attachment(spine_atlas_attachment_loader self, spine_skin skin, + const char *name, const char *path, spine_sequence sequence); +SPINE_C_API spine_mesh_attachment spine_atlas_attachment_loader_new_mesh_attachment(spine_atlas_attachment_loader self, spine_skin skin, + const char *name, const char *path, spine_sequence sequence); +SPINE_C_API spine_bounding_box_attachment spine_atlas_attachment_loader_new_bounding_box_attachment(spine_atlas_attachment_loader self, + spine_skin skin, const char *name); +SPINE_C_API spine_path_attachment spine_atlas_attachment_loader_new_path_attachment(spine_atlas_attachment_loader self, spine_skin skin, + const char *name); +SPINE_C_API spine_point_attachment spine_atlas_attachment_loader_new_point_attachment(spine_atlas_attachment_loader self, spine_skin skin, + const char *name); +SPINE_C_API spine_clipping_attachment spine_atlas_attachment_loader_new_clipping_attachment(spine_atlas_attachment_loader self, spine_skin skin, + const char *name); +SPINE_C_API spine_atlas_region spine_atlas_attachment_loader_find_region(spine_atlas_attachment_loader self, const char *name); #ifdef __cplusplus } diff --git a/spine-c/src/generated/atlas_page.cpp b/spine-c/src/generated/atlas_page.cpp index a70c59823..966b70b48 100644 --- a/spine-c/src/generated/atlas_page.cpp +++ b/spine-c/src/generated/atlas_page.cpp @@ -3,106 +3,130 @@ using namespace spine; -spine_atlas_page spine_atlas_page_create(const char * inName) { - return (spine_atlas_page) new (__FILE__, __LINE__) AtlasPage(String(inName)); +spine_atlas_page spine_atlas_page_create(const char *inName) { + return (spine_atlas_page) new (__FILE__, __LINE__) AtlasPage(String(inName)); } void spine_atlas_page_dispose(spine_atlas_page self) { - delete (AtlasPage*)self; + delete (AtlasPage *) self; } -const char * spine_atlas_page_get_name(spine_atlas_page self) { - return ((AtlasPage*)self)->name.buffer(); +const char *spine_atlas_page_get_name(spine_atlas_page self) { + AtlasPage *_self = (AtlasPage *) self; + return _self->name.buffer(); } -void spine_atlas_page_set_name(spine_atlas_page self, const char * value) { - ((AtlasPage*)self)->name = String(value); +void spine_atlas_page_set_name(spine_atlas_page self, const char *value) { + AtlasPage *_self = (AtlasPage *) self; + _self->name = String(value); } -const char * spine_atlas_page_get_texture_path(spine_atlas_page self) { - return ((AtlasPage*)self)->texturePath.buffer(); +const char *spine_atlas_page_get_texture_path(spine_atlas_page self) { + AtlasPage *_self = (AtlasPage *) self; + return _self->texturePath.buffer(); } -void spine_atlas_page_set_texture_path(spine_atlas_page self, const char * value) { - ((AtlasPage*)self)->texturePath = String(value); +void spine_atlas_page_set_texture_path(spine_atlas_page self, const char *value) { + AtlasPage *_self = (AtlasPage *) self; + _self->texturePath = String(value); } spine_format spine_atlas_page_get_format(spine_atlas_page self) { - return (spine_format)((AtlasPage*)self)->format; + AtlasPage *_self = (AtlasPage *) self; + return (spine_format) _self->format; } void spine_atlas_page_set_format(spine_atlas_page self, spine_format value) { - ((AtlasPage*)self)->format = (Format)value; + AtlasPage *_self = (AtlasPage *) self; + _self->format = (Format) value; } spine_texture_filter spine_atlas_page_get_min_filter(spine_atlas_page self) { - return (spine_texture_filter)((AtlasPage*)self)->minFilter; + AtlasPage *_self = (AtlasPage *) self; + return (spine_texture_filter) _self->minFilter; } void spine_atlas_page_set_min_filter(spine_atlas_page self, spine_texture_filter value) { - ((AtlasPage*)self)->minFilter = (TextureFilter)value; + AtlasPage *_self = (AtlasPage *) self; + _self->minFilter = (TextureFilter) value; } spine_texture_filter spine_atlas_page_get_mag_filter(spine_atlas_page self) { - return (spine_texture_filter)((AtlasPage*)self)->magFilter; + AtlasPage *_self = (AtlasPage *) self; + return (spine_texture_filter) _self->magFilter; } void spine_atlas_page_set_mag_filter(spine_atlas_page self, spine_texture_filter value) { - ((AtlasPage*)self)->magFilter = (TextureFilter)value; + AtlasPage *_self = (AtlasPage *) self; + _self->magFilter = (TextureFilter) value; } spine_texture_wrap spine_atlas_page_get_u_wrap(spine_atlas_page self) { - return (spine_texture_wrap)((AtlasPage*)self)->uWrap; + AtlasPage *_self = (AtlasPage *) self; + return (spine_texture_wrap) _self->uWrap; } void spine_atlas_page_set_u_wrap(spine_atlas_page self, spine_texture_wrap value) { - ((AtlasPage*)self)->uWrap = (TextureWrap)value; + AtlasPage *_self = (AtlasPage *) self; + _self->uWrap = (TextureWrap) value; } spine_texture_wrap spine_atlas_page_get_v_wrap(spine_atlas_page self) { - return (spine_texture_wrap)((AtlasPage*)self)->vWrap; + AtlasPage *_self = (AtlasPage *) self; + return (spine_texture_wrap) _self->vWrap; } void spine_atlas_page_set_v_wrap(spine_atlas_page self, spine_texture_wrap value) { - ((AtlasPage*)self)->vWrap = (TextureWrap)value; + AtlasPage *_self = (AtlasPage *) self; + _self->vWrap = (TextureWrap) value; } int spine_atlas_page_get_width(spine_atlas_page self) { - return ((AtlasPage*)self)->width; + AtlasPage *_self = (AtlasPage *) self; + return _self->width; } void spine_atlas_page_set_width(spine_atlas_page self, int value) { - ((AtlasPage*)self)->width = value; + AtlasPage *_self = (AtlasPage *) self; + _self->width = value; } int spine_atlas_page_get_height(spine_atlas_page self) { - return ((AtlasPage*)self)->height; + AtlasPage *_self = (AtlasPage *) self; + return _self->height; } void spine_atlas_page_set_height(spine_atlas_page self, int value) { - ((AtlasPage*)self)->height = value; + AtlasPage *_self = (AtlasPage *) self; + _self->height = value; } bool spine_atlas_page_get_pma(spine_atlas_page self) { - return ((AtlasPage*)self)->pma; + AtlasPage *_self = (AtlasPage *) self; + return _self->pma; } void spine_atlas_page_set_pma(spine_atlas_page self, bool value) { - ((AtlasPage*)self)->pma = value; + AtlasPage *_self = (AtlasPage *) self; + _self->pma = value; } int spine_atlas_page_get_index(spine_atlas_page self) { - return ((AtlasPage*)self)->index; + AtlasPage *_self = (AtlasPage *) self; + return _self->index; } void spine_atlas_page_set_index(spine_atlas_page self, int value) { - ((AtlasPage*)self)->index = value; + AtlasPage *_self = (AtlasPage *) self; + _self->index = value; } -void * spine_atlas_page_get_texture(spine_atlas_page self) { - return ((AtlasPage*)self)->texture; +void *spine_atlas_page_get_texture(spine_atlas_page self) { + AtlasPage *_self = (AtlasPage *) self; + return _self->texture; } -void spine_atlas_page_set_texture(spine_atlas_page self, void * value) { - ((AtlasPage*)self)->texture = (void*)value; +void spine_atlas_page_set_texture(spine_atlas_page self, void *value) { + AtlasPage *_self = (AtlasPage *) self; + _self->texture = (void *) value; } diff --git a/spine-c/src/generated/atlas_page.h b/spine-c/src/generated/atlas_page.h index 083e7b776..8c578eca3 100644 --- a/spine-c/src/generated/atlas_page.h +++ b/spine-c/src/generated/atlas_page.h @@ -8,14 +8,14 @@ extern "C" { #endif -SPINE_C_API spine_atlas_page spine_atlas_page_create(const char * inName); +SPINE_C_API spine_atlas_page spine_atlas_page_create(const char *inName); SPINE_C_API void spine_atlas_page_dispose(spine_atlas_page self); -SPINE_C_API const char * spine_atlas_page_get_name(spine_atlas_page self); -SPINE_C_API void spine_atlas_page_set_name(spine_atlas_page self, const char * value); -SPINE_C_API const char * spine_atlas_page_get_texture_path(spine_atlas_page self); -SPINE_C_API void spine_atlas_page_set_texture_path(spine_atlas_page self, const char * value); +SPINE_C_API const char *spine_atlas_page_get_name(spine_atlas_page self); +SPINE_C_API void spine_atlas_page_set_name(spine_atlas_page self, const char *value); +SPINE_C_API const char *spine_atlas_page_get_texture_path(spine_atlas_page self); +SPINE_C_API void spine_atlas_page_set_texture_path(spine_atlas_page self, const char *value); SPINE_C_API spine_format spine_atlas_page_get_format(spine_atlas_page self); SPINE_C_API void spine_atlas_page_set_format(spine_atlas_page self, spine_format value); SPINE_C_API spine_texture_filter spine_atlas_page_get_min_filter(spine_atlas_page self); @@ -34,8 +34,8 @@ SPINE_C_API bool spine_atlas_page_get_pma(spine_atlas_page self); SPINE_C_API void spine_atlas_page_set_pma(spine_atlas_page self, bool value); SPINE_C_API int spine_atlas_page_get_index(spine_atlas_page self); SPINE_C_API void spine_atlas_page_set_index(spine_atlas_page self, int value); -SPINE_C_API void * spine_atlas_page_get_texture(spine_atlas_page self); -SPINE_C_API void spine_atlas_page_set_texture(spine_atlas_page self, void * value); +SPINE_C_API void *spine_atlas_page_get_texture(spine_atlas_page self); +SPINE_C_API void spine_atlas_page_set_texture(spine_atlas_page self, void *value); #ifdef __cplusplus } diff --git a/spine-c/src/generated/atlas_region.cpp b/spine-c/src/generated/atlas_region.cpp index 27bb98ed7..a180348cb 100644 --- a/spine-c/src/generated/atlas_region.cpp +++ b/spine-c/src/generated/atlas_region.cpp @@ -4,189 +4,233 @@ using namespace spine; spine_atlas_region spine_atlas_region_create(void) { - return (spine_atlas_region) new (__FILE__, __LINE__) AtlasRegion(); + return (spine_atlas_region) new (__FILE__, __LINE__) AtlasRegion(); } void spine_atlas_region_dispose(spine_atlas_region self) { - delete (AtlasRegion*)self; + delete (AtlasRegion *) self; } spine_rtti spine_atlas_region_get_rtti(spine_atlas_region self) { - return (spine_rtti)&((AtlasRegion*)self)->getRTTI(); + AtlasRegion *_self = (AtlasRegion *) self; + return (spine_rtti) &_self->getRTTI(); } spine_atlas_page spine_atlas_region_get_page(spine_atlas_region self) { - return (spine_atlas_page)((AtlasRegion*)self)->getPage(); + AtlasRegion *_self = (AtlasRegion *) self; + return (spine_atlas_page) _self->getPage(); } int spine_atlas_region_get_index(spine_atlas_region self) { - return ((AtlasRegion*)self)->getIndex(); + AtlasRegion *_self = (AtlasRegion *) self; + return _self->getIndex(); } int spine_atlas_region_get_x(spine_atlas_region self) { - return ((AtlasRegion*)self)->getX(); + AtlasRegion *_self = (AtlasRegion *) self; + return _self->getX(); } int spine_atlas_region_get_y(spine_atlas_region self) { - return ((AtlasRegion*)self)->getY(); + AtlasRegion *_self = (AtlasRegion *) self; + return _self->getY(); } float spine_atlas_region_get_offset_x(spine_atlas_region self) { - return ((AtlasRegion*)self)->getOffsetX(); + AtlasRegion *_self = (AtlasRegion *) self; + return _self->getOffsetX(); } float spine_atlas_region_get_offset_y(spine_atlas_region self) { - return ((AtlasRegion*)self)->getOffsetY(); + AtlasRegion *_self = (AtlasRegion *) self; + return _self->getOffsetY(); } int spine_atlas_region_get_packed_width(spine_atlas_region self) { - return ((AtlasRegion*)self)->getPackedWidth(); + AtlasRegion *_self = (AtlasRegion *) self; + return _self->getPackedWidth(); } int spine_atlas_region_get_packed_height(spine_atlas_region self) { - return ((AtlasRegion*)self)->getPackedHeight(); + AtlasRegion *_self = (AtlasRegion *) self; + return _self->getPackedHeight(); } int spine_atlas_region_get_original_width(spine_atlas_region self) { - return ((AtlasRegion*)self)->getOriginalWidth(); + AtlasRegion *_self = (AtlasRegion *) self; + return _self->getOriginalWidth(); } int spine_atlas_region_get_original_height(spine_atlas_region self) { - return ((AtlasRegion*)self)->getOriginalHeight(); + AtlasRegion *_self = (AtlasRegion *) self; + return _self->getOriginalHeight(); } bool spine_atlas_region_get_rotate(spine_atlas_region self) { - return ((AtlasRegion*)self)->getRotate(); + AtlasRegion *_self = (AtlasRegion *) self; + return _self->getRotate(); } int spine_atlas_region_get_degrees(spine_atlas_region self) { - return ((AtlasRegion*)self)->getDegrees(); + AtlasRegion *_self = (AtlasRegion *) self; + return _self->getDegrees(); } spine_array_int spine_atlas_region_get_splits(spine_atlas_region self) { - return (spine_array_int)&((AtlasRegion*)self)->getSplits(); + AtlasRegion *_self = (AtlasRegion *) self; + return (spine_array_int) &_self->getSplits(); } spine_array_int spine_atlas_region_get_pads(spine_atlas_region self) { - return (spine_array_int)&((AtlasRegion*)self)->getPads(); + AtlasRegion *_self = (AtlasRegion *) self; + return (spine_array_int) &_self->getPads(); } spine_array_float spine_atlas_region_get_values(spine_atlas_region self) { - return (spine_array_float)&((AtlasRegion*)self)->getValues(); + AtlasRegion *_self = (AtlasRegion *) self; + return (spine_array_float) &_self->getValues(); } void spine_atlas_region_set_page(spine_atlas_region self, spine_atlas_page value) { - ((AtlasRegion*)self)->setPage((AtlasPage *)value); + AtlasRegion *_self = (AtlasRegion *) self; + _self->setPage((AtlasPage *) value); } -void spine_atlas_region_set_name(spine_atlas_region self, const char * value) { - ((AtlasRegion*)self)->setName(String(value)); +void spine_atlas_region_set_name(spine_atlas_region self, const char *value) { + AtlasRegion *_self = (AtlasRegion *) self; + _self->setName(String(value)); } void spine_atlas_region_set_index(spine_atlas_region self, int value) { - ((AtlasRegion*)self)->setIndex(value); + AtlasRegion *_self = (AtlasRegion *) self; + _self->setIndex(value); } void spine_atlas_region_set_x(spine_atlas_region self, int value) { - ((AtlasRegion*)self)->setX(value); + AtlasRegion *_self = (AtlasRegion *) self; + _self->setX(value); } void spine_atlas_region_set_y(spine_atlas_region self, int value) { - ((AtlasRegion*)self)->setY(value); + AtlasRegion *_self = (AtlasRegion *) self; + _self->setY(value); } void spine_atlas_region_set_offset_x(spine_atlas_region self, float value) { - ((AtlasRegion*)self)->setOffsetX(value); + AtlasRegion *_self = (AtlasRegion *) self; + _self->setOffsetX(value); } void spine_atlas_region_set_offset_y(spine_atlas_region self, float value) { - ((AtlasRegion*)self)->setOffsetY(value); + AtlasRegion *_self = (AtlasRegion *) self; + _self->setOffsetY(value); } void spine_atlas_region_set_packed_width(spine_atlas_region self, int value) { - ((AtlasRegion*)self)->setPackedWidth(value); + AtlasRegion *_self = (AtlasRegion *) self; + _self->setPackedWidth(value); } void spine_atlas_region_set_packed_height(spine_atlas_region self, int value) { - ((AtlasRegion*)self)->setPackedHeight(value); + AtlasRegion *_self = (AtlasRegion *) self; + _self->setPackedHeight(value); } void spine_atlas_region_set_original_width(spine_atlas_region self, int value) { - ((AtlasRegion*)self)->setOriginalWidth(value); + AtlasRegion *_self = (AtlasRegion *) self; + _self->setOriginalWidth(value); } void spine_atlas_region_set_original_height(spine_atlas_region self, int value) { - ((AtlasRegion*)self)->setOriginalHeight(value); + AtlasRegion *_self = (AtlasRegion *) self; + _self->setOriginalHeight(value); } void spine_atlas_region_set_rotate(spine_atlas_region self, bool value) { - ((AtlasRegion*)self)->setRotate(value); + AtlasRegion *_self = (AtlasRegion *) self; + _self->setRotate(value); } void spine_atlas_region_set_degrees(spine_atlas_region self, int value) { - ((AtlasRegion*)self)->setDegrees(value); + AtlasRegion *_self = (AtlasRegion *) self; + _self->setDegrees(value); } void spine_atlas_region_set_splits(spine_atlas_region self, spine_array_int value) { - ((AtlasRegion*)self)->setSplits(*((const Array*)value)); + AtlasRegion *_self = (AtlasRegion *) self; + _self->setSplits(*((const Array *) value)); } void spine_atlas_region_set_pads(spine_atlas_region self, spine_array_int value) { - ((AtlasRegion*)self)->setPads(*((const Array*)value)); + AtlasRegion *_self = (AtlasRegion *) self; + _self->setPads(*((const Array *) value)); } void spine_atlas_region_set_values(spine_atlas_region self, spine_array_float value) { - ((AtlasRegion*)self)->setValues(*((const Array*)value)); + AtlasRegion *_self = (AtlasRegion *) self; + _self->setValues(*((const Array *) value)); } float spine_atlas_region_get_u(spine_atlas_region self) { - return ((TextureRegion*)(AtlasRegion*)self)->getU(); + TextureRegion *_self = (TextureRegion *) (AtlasRegion *) self; + return _self->getU(); } void spine_atlas_region_set_u(spine_atlas_region self, float value) { - ((TextureRegion*)(AtlasRegion*)self)->setU(value); + TextureRegion *_self = (TextureRegion *) (AtlasRegion *) self; + _self->setU(value); } float spine_atlas_region_get_v(spine_atlas_region self) { - return ((TextureRegion*)(AtlasRegion*)self)->getV(); + TextureRegion *_self = (TextureRegion *) (AtlasRegion *) self; + return _self->getV(); } void spine_atlas_region_set_v(spine_atlas_region self, float value) { - ((TextureRegion*)(AtlasRegion*)self)->setV(value); + TextureRegion *_self = (TextureRegion *) (AtlasRegion *) self; + _self->setV(value); } float spine_atlas_region_get_u2(spine_atlas_region self) { - return ((TextureRegion*)(AtlasRegion*)self)->getU2(); + TextureRegion *_self = (TextureRegion *) (AtlasRegion *) self; + return _self->getU2(); } void spine_atlas_region_set_u2(spine_atlas_region self, float value) { - ((TextureRegion*)(AtlasRegion*)self)->setU2(value); + TextureRegion *_self = (TextureRegion *) (AtlasRegion *) self; + _self->setU2(value); } float spine_atlas_region_get_v2(spine_atlas_region self) { - return ((TextureRegion*)(AtlasRegion*)self)->getV2(); + TextureRegion *_self = (TextureRegion *) (AtlasRegion *) self; + return _self->getV2(); } void spine_atlas_region_set_v2(spine_atlas_region self, float value) { - ((TextureRegion*)(AtlasRegion*)self)->setV2(value); + TextureRegion *_self = (TextureRegion *) (AtlasRegion *) self; + _self->setV2(value); } int spine_atlas_region_get_region_width(spine_atlas_region self) { - return ((TextureRegion*)(AtlasRegion*)self)->getRegionWidth(); + TextureRegion *_self = (TextureRegion *) (AtlasRegion *) self; + return _self->getRegionWidth(); } void spine_atlas_region_set_region_width(spine_atlas_region self, int value) { - ((TextureRegion*)(AtlasRegion*)self)->setRegionWidth(value); + TextureRegion *_self = (TextureRegion *) (AtlasRegion *) self; + _self->setRegionWidth(value); } int spine_atlas_region_get_region_height(spine_atlas_region self) { - return ((TextureRegion*)(AtlasRegion*)self)->getRegionHeight(); + TextureRegion *_self = (TextureRegion *) (AtlasRegion *) self; + return _self->getRegionHeight(); } void spine_atlas_region_set_region_height(spine_atlas_region self, int value) { - ((TextureRegion*)(AtlasRegion*)self)->setRegionHeight(value); + TextureRegion *_self = (TextureRegion *) (AtlasRegion *) self; + _self->setRegionHeight(value); } spine_rtti spine_atlas_region_rtti(void) { - return (spine_rtti)&AtlasRegion::rtti; + return (spine_rtti) &AtlasRegion::rtti; } diff --git a/spine-c/src/generated/atlas_region.h b/spine-c/src/generated/atlas_region.h index c649601b4..f6b3bac50 100644 --- a/spine-c/src/generated/atlas_region.h +++ b/spine-c/src/generated/atlas_region.h @@ -29,7 +29,7 @@ SPINE_C_API spine_array_int spine_atlas_region_get_splits(spine_atlas_region sel SPINE_C_API spine_array_int spine_atlas_region_get_pads(spine_atlas_region self); SPINE_C_API spine_array_float spine_atlas_region_get_values(spine_atlas_region self); SPINE_C_API void spine_atlas_region_set_page(spine_atlas_region self, spine_atlas_page value); -SPINE_C_API void spine_atlas_region_set_name(spine_atlas_region self, const char * value); +SPINE_C_API void spine_atlas_region_set_name(spine_atlas_region self, const char *value); SPINE_C_API void spine_atlas_region_set_index(spine_atlas_region self, int value); SPINE_C_API void spine_atlas_region_set_x(spine_atlas_region self, int value); SPINE_C_API void spine_atlas_region_set_y(spine_atlas_region self, int value); diff --git a/spine-c/src/generated/attachment.cpp b/spine-c/src/generated/attachment.cpp index c417ad40d..cc2cdef1a 100644 --- a/spine-c/src/generated/attachment.cpp +++ b/spine-c/src/generated/attachment.cpp @@ -4,33 +4,39 @@ using namespace spine; void spine_attachment_dispose(spine_attachment self) { - delete (Attachment*)self; + delete (Attachment *) self; } spine_rtti spine_attachment_get_rtti(spine_attachment self) { - return (spine_rtti)&((Attachment*)self)->getRTTI(); + Attachment *_self = (Attachment *) self; + return (spine_rtti) &_self->getRTTI(); } -const char * spine_attachment_get_name(spine_attachment self) { - return ((Attachment*)self)->getName().buffer(); +const char *spine_attachment_get_name(spine_attachment self) { + Attachment *_self = (Attachment *) self; + return _self->getName().buffer(); } spine_attachment spine_attachment_copy(spine_attachment self) { - return (spine_attachment)((Attachment*)self)->copy(); + Attachment *_self = (Attachment *) self; + return (spine_attachment) _self->copy(); } int spine_attachment_get_ref_count(spine_attachment self) { - return ((Attachment*)self)->getRefCount(); + Attachment *_self = (Attachment *) self; + return _self->getRefCount(); } void spine_attachment_reference(spine_attachment self) { - ((Attachment*)self)->reference(); + Attachment *_self = (Attachment *) self; + _self->reference(); } void spine_attachment_dereference(spine_attachment self) { - ((Attachment*)self)->dereference(); + Attachment *_self = (Attachment *) self; + _self->dereference(); } spine_rtti spine_attachment_rtti(void) { - return (spine_rtti)&Attachment::rtti; + return (spine_rtti) &Attachment::rtti; } diff --git a/spine-c/src/generated/attachment.h b/spine-c/src/generated/attachment.h index dba12195c..c50673b87 100644 --- a/spine-c/src/generated/attachment.h +++ b/spine-c/src/generated/attachment.h @@ -11,7 +11,7 @@ extern "C" { SPINE_C_API void spine_attachment_dispose(spine_attachment self); SPINE_C_API spine_rtti spine_attachment_get_rtti(spine_attachment self); -SPINE_C_API const char * spine_attachment_get_name(spine_attachment self); +SPINE_C_API const char *spine_attachment_get_name(spine_attachment self); SPINE_C_API spine_attachment spine_attachment_copy(spine_attachment self); SPINE_C_API int spine_attachment_get_ref_count(spine_attachment self); SPINE_C_API void spine_attachment_reference(spine_attachment self); diff --git a/spine-c/src/generated/attachment_loader.cpp b/spine-c/src/generated/attachment_loader.cpp index d3c636ef9..2a475b2cb 100644 --- a/spine-c/src/generated/attachment_loader.cpp +++ b/spine-c/src/generated/attachment_loader.cpp @@ -4,29 +4,37 @@ using namespace spine; void spine_attachment_loader_dispose(spine_attachment_loader self) { - delete (AttachmentLoader*)self; + delete (AttachmentLoader *) self; } -spine_region_attachment spine_attachment_loader_new_region_attachment(spine_attachment_loader self, spine_skin skin, const char * name, const char * path, spine_sequence sequence) { - return (spine_region_attachment)((AttachmentLoader*)self)->newRegionAttachment(*((Skin*)skin), String(name), String(path), (Sequence *)sequence); +spine_region_attachment spine_attachment_loader_new_region_attachment(spine_attachment_loader self, spine_skin skin, const char *name, + const char *path, spine_sequence sequence) { + AttachmentLoader *_self = (AttachmentLoader *) self; + return (spine_region_attachment) _self->newRegionAttachment(*((Skin *) skin), String(name), String(path), (Sequence *) sequence); } -spine_mesh_attachment spine_attachment_loader_new_mesh_attachment(spine_attachment_loader self, spine_skin skin, const char * name, const char * path, spine_sequence sequence) { - return (spine_mesh_attachment)((AttachmentLoader*)self)->newMeshAttachment(*((Skin*)skin), String(name), String(path), (Sequence *)sequence); +spine_mesh_attachment spine_attachment_loader_new_mesh_attachment(spine_attachment_loader self, spine_skin skin, const char *name, const char *path, + spine_sequence sequence) { + AttachmentLoader *_self = (AttachmentLoader *) self; + return (spine_mesh_attachment) _self->newMeshAttachment(*((Skin *) skin), String(name), String(path), (Sequence *) sequence); } -spine_bounding_box_attachment spine_attachment_loader_new_bounding_box_attachment(spine_attachment_loader self, spine_skin skin, const char * name) { - return (spine_bounding_box_attachment)((AttachmentLoader*)self)->newBoundingBoxAttachment(*((Skin*)skin), String(name)); +spine_bounding_box_attachment spine_attachment_loader_new_bounding_box_attachment(spine_attachment_loader self, spine_skin skin, const char *name) { + AttachmentLoader *_self = (AttachmentLoader *) self; + return (spine_bounding_box_attachment) _self->newBoundingBoxAttachment(*((Skin *) skin), String(name)); } -spine_path_attachment spine_attachment_loader_new_path_attachment(spine_attachment_loader self, spine_skin skin, const char * name) { - return (spine_path_attachment)((AttachmentLoader*)self)->newPathAttachment(*((Skin*)skin), String(name)); +spine_path_attachment spine_attachment_loader_new_path_attachment(spine_attachment_loader self, spine_skin skin, const char *name) { + AttachmentLoader *_self = (AttachmentLoader *) self; + return (spine_path_attachment) _self->newPathAttachment(*((Skin *) skin), String(name)); } -spine_point_attachment spine_attachment_loader_new_point_attachment(spine_attachment_loader self, spine_skin skin, const char * name) { - return (spine_point_attachment)((AttachmentLoader*)self)->newPointAttachment(*((Skin*)skin), String(name)); +spine_point_attachment spine_attachment_loader_new_point_attachment(spine_attachment_loader self, spine_skin skin, const char *name) { + AttachmentLoader *_self = (AttachmentLoader *) self; + return (spine_point_attachment) _self->newPointAttachment(*((Skin *) skin), String(name)); } -spine_clipping_attachment spine_attachment_loader_new_clipping_attachment(spine_attachment_loader self, spine_skin skin, const char * name) { - return (spine_clipping_attachment)((AttachmentLoader*)self)->newClippingAttachment(*((Skin*)skin), String(name)); +spine_clipping_attachment spine_attachment_loader_new_clipping_attachment(spine_attachment_loader self, spine_skin skin, const char *name) { + AttachmentLoader *_self = (AttachmentLoader *) self; + return (spine_clipping_attachment) _self->newClippingAttachment(*((Skin *) skin), String(name)); } diff --git a/spine-c/src/generated/attachment_loader.h b/spine-c/src/generated/attachment_loader.h index 7b052dd94..0c5aff482 100644 --- a/spine-c/src/generated/attachment_loader.h +++ b/spine-c/src/generated/attachment_loader.h @@ -10,12 +10,16 @@ extern "C" { SPINE_C_API void spine_attachment_loader_dispose(spine_attachment_loader self); -SPINE_C_API spine_region_attachment spine_attachment_loader_new_region_attachment(spine_attachment_loader self, spine_skin skin, const char * name, const char * path, spine_sequence sequence); -SPINE_C_API spine_mesh_attachment spine_attachment_loader_new_mesh_attachment(spine_attachment_loader self, spine_skin skin, const char * name, const char * path, spine_sequence sequence); -SPINE_C_API spine_bounding_box_attachment spine_attachment_loader_new_bounding_box_attachment(spine_attachment_loader self, spine_skin skin, const char * name); -SPINE_C_API spine_path_attachment spine_attachment_loader_new_path_attachment(spine_attachment_loader self, spine_skin skin, const char * name); -SPINE_C_API spine_point_attachment spine_attachment_loader_new_point_attachment(spine_attachment_loader self, spine_skin skin, const char * name); -SPINE_C_API spine_clipping_attachment spine_attachment_loader_new_clipping_attachment(spine_attachment_loader self, spine_skin skin, const char * name); +SPINE_C_API spine_region_attachment spine_attachment_loader_new_region_attachment(spine_attachment_loader self, spine_skin skin, const char *name, + const char *path, spine_sequence sequence); +SPINE_C_API spine_mesh_attachment spine_attachment_loader_new_mesh_attachment(spine_attachment_loader self, spine_skin skin, const char *name, + const char *path, spine_sequence sequence); +SPINE_C_API spine_bounding_box_attachment spine_attachment_loader_new_bounding_box_attachment(spine_attachment_loader self, spine_skin skin, + const char *name); +SPINE_C_API spine_path_attachment spine_attachment_loader_new_path_attachment(spine_attachment_loader self, spine_skin skin, const char *name); +SPINE_C_API spine_point_attachment spine_attachment_loader_new_point_attachment(spine_attachment_loader self, spine_skin skin, const char *name); +SPINE_C_API spine_clipping_attachment spine_attachment_loader_new_clipping_attachment(spine_attachment_loader self, spine_skin skin, + const char *name); #ifdef __cplusplus } diff --git a/spine-c/src/generated/attachment_timeline.cpp b/spine-c/src/generated/attachment_timeline.cpp index cda6ae7ce..07a7c7b3b 100644 --- a/spine-c/src/generated/attachment_timeline.cpp +++ b/spine-c/src/generated/attachment_timeline.cpp @@ -4,53 +4,65 @@ using namespace spine; spine_attachment_timeline spine_attachment_timeline_create(size_t frameCount, int slotIndex) { - return (spine_attachment_timeline) new (__FILE__, __LINE__) AttachmentTimeline(frameCount, slotIndex); + return (spine_attachment_timeline) new (__FILE__, __LINE__) AttachmentTimeline(frameCount, slotIndex); } void spine_attachment_timeline_dispose(spine_attachment_timeline self) { - delete (AttachmentTimeline*)self; + delete (AttachmentTimeline *) self; } spine_rtti spine_attachment_timeline_get_rtti(spine_attachment_timeline self) { - return (spine_rtti)&((AttachmentTimeline*)self)->getRTTI(); + AttachmentTimeline *_self = (AttachmentTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_attachment_timeline_apply(spine_attachment_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((AttachmentTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_attachment_timeline_apply(spine_attachment_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + AttachmentTimeline *_self = (AttachmentTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } -void spine_attachment_timeline_set_frame(spine_attachment_timeline self, int frame, float time, const char * attachmentName) { - ((AttachmentTimeline*)self)->setFrame(frame, time, String(attachmentName)); +void spine_attachment_timeline_set_frame(spine_attachment_timeline self, int frame, float time, const char *attachmentName) { + AttachmentTimeline *_self = (AttachmentTimeline *) self; + _self->setFrame(frame, time, String(attachmentName)); } size_t spine_attachment_timeline_get_frame_entries(spine_attachment_timeline self) { - return ((Timeline*)(AttachmentTimeline*)self)->getFrameEntries(); + Timeline *_self = (Timeline *) (AttachmentTimeline *) self; + return _self->getFrameEntries(); } size_t spine_attachment_timeline_get_frame_count(spine_attachment_timeline self) { - return ((Timeline*)(AttachmentTimeline*)self)->getFrameCount(); + Timeline *_self = (Timeline *) (AttachmentTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_attachment_timeline_get_frames(spine_attachment_timeline self) { - return (spine_array_float)&((Timeline*)(AttachmentTimeline*)self)->getFrames(); + Timeline *_self = (Timeline *) (AttachmentTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_attachment_timeline_get_duration(spine_attachment_timeline self) { - return ((Timeline*)(AttachmentTimeline*)self)->getDuration(); + Timeline *_self = (Timeline *) (AttachmentTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_attachment_timeline_get_property_ids(spine_attachment_timeline self) { - return (spine_array_property_id)&((Timeline*)(AttachmentTimeline*)self)->getPropertyIds(); + Timeline *_self = (Timeline *) (AttachmentTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_attachment_timeline_get_slot_index(spine_attachment_timeline self) { - return ((SlotTimeline*)(AttachmentTimeline*)self)->getSlotIndex(); + SlotTimeline *_self = (SlotTimeline *) (AttachmentTimeline *) self; + return _self->getSlotIndex(); } void spine_attachment_timeline_set_slot_index(spine_attachment_timeline self, int inValue) { - ((SlotTimeline*)(AttachmentTimeline*)self)->setSlotIndex(inValue); + SlotTimeline *_self = (SlotTimeline *) (AttachmentTimeline *) self; + _self->setSlotIndex(inValue); } spine_rtti spine_attachment_timeline_rtti(void) { - return (spine_rtti)&AttachmentTimeline::rtti; + return (spine_rtti) &AttachmentTimeline::rtti; } diff --git a/spine-c/src/generated/attachment_timeline.h b/spine-c/src/generated/attachment_timeline.h index 18238dc7b..a4c69fc69 100644 --- a/spine-c/src/generated/attachment_timeline.h +++ b/spine-c/src/generated/attachment_timeline.h @@ -13,8 +13,10 @@ SPINE_C_API spine_attachment_timeline spine_attachment_timeline_create(size_t fr SPINE_C_API void spine_attachment_timeline_dispose(spine_attachment_timeline self); SPINE_C_API spine_rtti spine_attachment_timeline_get_rtti(spine_attachment_timeline self); -SPINE_C_API void spine_attachment_timeline_apply(spine_attachment_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); -SPINE_C_API void spine_attachment_timeline_set_frame(spine_attachment_timeline self, int frame, float time, const char * attachmentName); +SPINE_C_API void spine_attachment_timeline_apply(spine_attachment_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); +SPINE_C_API void spine_attachment_timeline_set_frame(spine_attachment_timeline self, int frame, float time, const char *attachmentName); SPINE_C_API size_t spine_attachment_timeline_get_frame_entries(spine_attachment_timeline self); SPINE_C_API size_t spine_attachment_timeline_get_frame_count(spine_attachment_timeline self); SPINE_C_API spine_array_float spine_attachment_timeline_get_frames(spine_attachment_timeline self); diff --git a/spine-c/src/generated/attachment_type.h b/spine-c/src/generated/attachment_type.h index 9f03b0f5c..e453cfcf8 100644 --- a/spine-c/src/generated/attachment_type.h +++ b/spine-c/src/generated/attachment_type.h @@ -6,13 +6,13 @@ extern "C" { #endif typedef enum spine_attachment_type { - SPINE_ATTACHMENT_TYPE_REGION, - SPINE_ATTACHMENT_TYPE_BOUNDINGBOX, - SPINE_ATTACHMENT_TYPE_MESH, - SPINE_ATTACHMENT_TYPE_LINKEDMESH, - SPINE_ATTACHMENT_TYPE_PATH, - SPINE_ATTACHMENT_TYPE_POINT, - SPINE_ATTACHMENT_TYPE_CLIPPING + SPINE_ATTACHMENT_TYPE_REGION, + SPINE_ATTACHMENT_TYPE_BOUNDINGBOX, + SPINE_ATTACHMENT_TYPE_MESH, + SPINE_ATTACHMENT_TYPE_LINKEDMESH, + SPINE_ATTACHMENT_TYPE_PATH, + SPINE_ATTACHMENT_TYPE_POINT, + SPINE_ATTACHMENT_TYPE_CLIPPING } spine_attachment_type; #ifdef __cplusplus diff --git a/spine-c/src/generated/blend_mode.h b/spine-c/src/generated/blend_mode.h index 302183888..6ff40f329 100644 --- a/spine-c/src/generated/blend_mode.h +++ b/spine-c/src/generated/blend_mode.h @@ -6,10 +6,10 @@ extern "C" { #endif typedef enum spine_blend_mode { - SPINE_BLEND_MODE_NORMAL = 0, - SPINE_BLEND_MODE_ADDITIVE, - SPINE_BLEND_MODE_MULTIPLY, - SPINE_BLEND_MODE_SCREEN + SPINE_BLEND_MODE_NORMAL = 0, + SPINE_BLEND_MODE_ADDITIVE, + SPINE_BLEND_MODE_MULTIPLY, + SPINE_BLEND_MODE_SCREEN } spine_blend_mode; #ifdef __cplusplus diff --git a/spine-c/src/generated/bone.cpp b/spine-c/src/generated/bone.cpp index 4d6c6eeee..6792b27a0 100644 --- a/spine-c/src/generated/bone.cpp +++ b/spine-c/src/generated/bone.cpp @@ -4,73 +4,85 @@ using namespace spine; spine_bone spine_bone_create(spine_bone_data data, spine_bone parent) { - return (spine_bone) new (__FILE__, __LINE__) Bone(*((BoneData*)data), (Bone *)parent); + return (spine_bone) new (__FILE__, __LINE__) Bone(*((BoneData *) data), (Bone *) parent); } spine_bone spine_bone_create2(spine_bone bone, spine_bone parent) { - return (spine_bone) new (__FILE__, __LINE__) Bone(*((Bone*)bone), (Bone *)parent); + return (spine_bone) new (__FILE__, __LINE__) Bone(*((Bone *) bone), (Bone *) parent); } void spine_bone_dispose(spine_bone self) { - delete (Bone*)self; + delete (Bone *) self; } spine_rtti spine_bone_get_rtti(spine_bone self) { - return (spine_rtti)&((Bone*)self)->getRTTI(); + Bone *_self = (Bone *) self; + return (spine_rtti) &_self->getRTTI(); } spine_bone spine_bone_get_parent(spine_bone self) { - return (spine_bone)((Bone*)self)->getParent(); + Bone *_self = (Bone *) self; + return (spine_bone) _self->getParent(); } spine_array_bone spine_bone_get_children(spine_bone self) { - return (spine_array_bone)&((Bone*)self)->getChildren(); + Bone *_self = (Bone *) self; + return (spine_array_bone) &_self->getChildren(); } bool spine_bone_is_y_down(void) { - return Bone::isYDown(); + return Bone::isYDown(); } void spine_bone_set_y_down(bool value) { - Bone::setYDown(value); + Bone::setYDown(value); } void spine_bone_update(spine_bone self, spine_skeleton skeleton, spine_physics physics) { - ((Bone*)self)->update(*((Skeleton*)skeleton), (Physics)physics); + Bone *_self = (Bone *) self; + _self->update(*((Skeleton *) skeleton), (Physics) physics); } spine_bone_data spine_bone_get_data(spine_bone self) { - return (spine_bone_data)&((PosedGeneric*)(Bone*)self)->getData(); + PosedGeneric *_self = (PosedGeneric *) (Bone *) self; + return (spine_bone_data) &_self->getData(); } spine_bone_local spine_bone_get_pose(spine_bone self) { - return (spine_bone_local)&((PosedGeneric*)(Bone*)self)->getPose(); + PosedGeneric *_self = (PosedGeneric *) (Bone *) self; + return (spine_bone_local) &_self->getPose(); } spine_bone_pose spine_bone_get_applied_pose(spine_bone self) { - return (spine_bone_pose)&((PosedGeneric*)(Bone*)self)->getAppliedPose(); + PosedGeneric *_self = (PosedGeneric *) (Bone *) self; + return (spine_bone_pose) &_self->getAppliedPose(); } void spine_bone_reset_constrained(spine_bone self) { - ((PosedGeneric*)(Bone*)self)->resetConstrained(); + PosedGeneric *_self = (PosedGeneric *) (Bone *) self; + _self->resetConstrained(); } void spine_bone_constrained(spine_bone self) { - ((PosedGeneric*)(Bone*)self)->constrained(); + PosedGeneric *_self = (PosedGeneric *) (Bone *) self; + _self->constrained(); } bool spine_bone_is_pose_equal_to_applied(spine_bone self) { - return ((PosedGeneric*)(Bone*)self)->isPoseEqualToApplied(); + PosedGeneric *_self = (PosedGeneric *) (Bone *) self; + return _self->isPoseEqualToApplied(); } bool spine_bone_is_active(spine_bone self) { - return ((PosedActive*)(Bone*)self)->isActive(); + PosedActive *_self = (PosedActive *) (Bone *) self; + return _self->isActive(); } void spine_bone_set_active(spine_bone self, bool active) { - ((PosedActive*)(Bone*)self)->setActive(active); + PosedActive *_self = (PosedActive *) (Bone *) self; + _self->setActive(active); } spine_rtti spine_bone_rtti(void) { - return (spine_rtti)&Bone::rtti; + return (spine_rtti) &Bone::rtti; } diff --git a/spine-c/src/generated/bone_data.cpp b/spine-c/src/generated/bone_data.cpp index d4f985769..849ea0663 100644 --- a/spine-c/src/generated/bone_data.cpp +++ b/spine-c/src/generated/bone_data.cpp @@ -3,62 +3,75 @@ using namespace spine; -spine_bone_data spine_bone_data_create(int index, const char * name, spine_bone_data parent) { - return (spine_bone_data) new (__FILE__, __LINE__) BoneData(index, String(name), (BoneData *)parent); +spine_bone_data spine_bone_data_create(int index, const char *name, spine_bone_data parent) { + return (spine_bone_data) new (__FILE__, __LINE__) BoneData(index, String(name), (BoneData *) parent); } void spine_bone_data_dispose(spine_bone_data self) { - delete (BoneData*)self; + delete (BoneData *) self; } int spine_bone_data_get_index(spine_bone_data self) { - return ((BoneData*)self)->getIndex(); + BoneData *_self = (BoneData *) self; + return _self->getIndex(); } spine_bone_data spine_bone_data_get_parent(spine_bone_data self) { - return (spine_bone_data)((BoneData*)self)->getParent(); + BoneData *_self = (BoneData *) self; + return (spine_bone_data) _self->getParent(); } float spine_bone_data_get_length(spine_bone_data self) { - return ((BoneData*)self)->getLength(); + BoneData *_self = (BoneData *) self; + return _self->getLength(); } void spine_bone_data_set_length(spine_bone_data self, float inValue) { - ((BoneData*)self)->setLength(inValue); + BoneData *_self = (BoneData *) self; + _self->setLength(inValue); } spine_color spine_bone_data_get_color(spine_bone_data self) { - return (spine_color)&((BoneData*)self)->getColor(); + BoneData *_self = (BoneData *) self; + return (spine_color) &_self->getColor(); } -const char * spine_bone_data_get_icon(spine_bone_data self) { - return ((BoneData*)self)->getIcon().buffer(); +const char *spine_bone_data_get_icon(spine_bone_data self) { + BoneData *_self = (BoneData *) self; + return _self->getIcon().buffer(); } -void spine_bone_data_set_icon(spine_bone_data self, const char * icon) { - ((BoneData*)self)->setIcon(String(icon)); +void spine_bone_data_set_icon(spine_bone_data self, const char *icon) { + BoneData *_self = (BoneData *) self; + _self->setIcon(String(icon)); } bool spine_bone_data_get_visible(spine_bone_data self) { - return ((BoneData*)self)->getVisible(); + BoneData *_self = (BoneData *) self; + return _self->getVisible(); } void spine_bone_data_set_visible(spine_bone_data self, bool inValue) { - ((BoneData*)self)->setVisible(inValue); + BoneData *_self = (BoneData *) self; + _self->setVisible(inValue); } spine_bone_local spine_bone_data_get_setup_pose(spine_bone_data self) { - return (spine_bone_local)&((PosedDataGeneric*)(BoneData*)self)->getSetupPose(); + PosedDataGeneric *_self = (PosedDataGeneric *) (BoneData *) self; + return (spine_bone_local) &_self->getSetupPose(); } -const char * spine_bone_data_get_name(spine_bone_data self) { - return ((PosedDataGeneric*)(BoneData*)self)->getName().buffer(); +const char *spine_bone_data_get_name(spine_bone_data self) { + PosedDataGeneric *_self = (PosedDataGeneric *) (BoneData *) self; + return _self->getName().buffer(); } bool spine_bone_data_get_skin_required(spine_bone_data self) { - return ((PosedDataGeneric*)(BoneData*)self)->getSkinRequired(); + PosedDataGeneric *_self = (PosedDataGeneric *) (BoneData *) self; + return _self->getSkinRequired(); } void spine_bone_data_set_skin_required(spine_bone_data self, bool skinRequired) { - ((PosedDataGeneric*)(BoneData*)self)->setSkinRequired(skinRequired); + PosedDataGeneric *_self = (PosedDataGeneric *) (BoneData *) self; + _self->setSkinRequired(skinRequired); } diff --git a/spine-c/src/generated/bone_data.h b/spine-c/src/generated/bone_data.h index 9120561c8..d70fca4c2 100644 --- a/spine-c/src/generated/bone_data.h +++ b/spine-c/src/generated/bone_data.h @@ -8,7 +8,7 @@ extern "C" { #endif -SPINE_C_API spine_bone_data spine_bone_data_create(int index, const char * name, spine_bone_data parent); +SPINE_C_API spine_bone_data spine_bone_data_create(int index, const char *name, spine_bone_data parent); SPINE_C_API void spine_bone_data_dispose(spine_bone_data self); @@ -17,12 +17,12 @@ SPINE_C_API spine_bone_data spine_bone_data_get_parent(spine_bone_data self); SPINE_C_API float spine_bone_data_get_length(spine_bone_data self); SPINE_C_API void spine_bone_data_set_length(spine_bone_data self, float inValue); SPINE_C_API spine_color spine_bone_data_get_color(spine_bone_data self); -SPINE_C_API const char * spine_bone_data_get_icon(spine_bone_data self); -SPINE_C_API void spine_bone_data_set_icon(spine_bone_data self, const char * icon); +SPINE_C_API const char *spine_bone_data_get_icon(spine_bone_data self); +SPINE_C_API void spine_bone_data_set_icon(spine_bone_data self, const char *icon); SPINE_C_API bool spine_bone_data_get_visible(spine_bone_data self); SPINE_C_API void spine_bone_data_set_visible(spine_bone_data self, bool inValue); SPINE_C_API spine_bone_local spine_bone_data_get_setup_pose(spine_bone_data self); -SPINE_C_API const char * spine_bone_data_get_name(spine_bone_data self); +SPINE_C_API const char *spine_bone_data_get_name(spine_bone_data self); SPINE_C_API bool spine_bone_data_get_skin_required(spine_bone_data self); SPINE_C_API void spine_bone_data_set_skin_required(spine_bone_data self, bool skinRequired); diff --git a/spine-c/src/generated/bone_local.cpp b/spine-c/src/generated/bone_local.cpp index 161a292bc..db5017004 100644 --- a/spine-c/src/generated/bone_local.cpp +++ b/spine-c/src/generated/bone_local.cpp @@ -4,89 +4,109 @@ using namespace spine; spine_bone_local spine_bone_local_create(void) { - return (spine_bone_local) new (__FILE__, __LINE__) BoneLocal(); + return (spine_bone_local) new (__FILE__, __LINE__) BoneLocal(); } void spine_bone_local_dispose(spine_bone_local self) { - delete (BoneLocal*)self; + delete (BoneLocal *) self; } void spine_bone_local_set(spine_bone_local self, spine_bone_local pose) { - ((BoneLocal*)self)->set(*((BoneLocal*)pose)); + BoneLocal *_self = (BoneLocal *) self; + _self->set(*((BoneLocal *) pose)); } float spine_bone_local_get_x(spine_bone_local self) { - return ((BoneLocal*)self)->getX(); + BoneLocal *_self = (BoneLocal *) self; + return _self->getX(); } void spine_bone_local_set_x(spine_bone_local self, float x) { - ((BoneLocal*)self)->setX(x); + BoneLocal *_self = (BoneLocal *) self; + _self->setX(x); } float spine_bone_local_get_y(spine_bone_local self) { - return ((BoneLocal*)self)->getY(); + BoneLocal *_self = (BoneLocal *) self; + return _self->getY(); } void spine_bone_local_set_y(spine_bone_local self, float y) { - ((BoneLocal*)self)->setY(y); + BoneLocal *_self = (BoneLocal *) self; + _self->setY(y); } void spine_bone_local_set_position(spine_bone_local self, float x, float y) { - ((BoneLocal*)self)->setPosition(x, y); + BoneLocal *_self = (BoneLocal *) self; + _self->setPosition(x, y); } float spine_bone_local_get_rotation(spine_bone_local self) { - return ((BoneLocal*)self)->getRotation(); + BoneLocal *_self = (BoneLocal *) self; + return _self->getRotation(); } void spine_bone_local_set_rotation(spine_bone_local self, float rotation) { - ((BoneLocal*)self)->setRotation(rotation); + BoneLocal *_self = (BoneLocal *) self; + _self->setRotation(rotation); } float spine_bone_local_get_scale_x(spine_bone_local self) { - return ((BoneLocal*)self)->getScaleX(); + BoneLocal *_self = (BoneLocal *) self; + return _self->getScaleX(); } void spine_bone_local_set_scale_x(spine_bone_local self, float scaleX) { - ((BoneLocal*)self)->setScaleX(scaleX); + BoneLocal *_self = (BoneLocal *) self; + _self->setScaleX(scaleX); } float spine_bone_local_get_scale_y(spine_bone_local self) { - return ((BoneLocal*)self)->getScaleY(); + BoneLocal *_self = (BoneLocal *) self; + return _self->getScaleY(); } void spine_bone_local_set_scale_y(spine_bone_local self, float scaleY) { - ((BoneLocal*)self)->setScaleY(scaleY); + BoneLocal *_self = (BoneLocal *) self; + _self->setScaleY(scaleY); } void spine_bone_local_set_scale_1(spine_bone_local self, float scaleX, float scaleY) { - ((BoneLocal*)self)->setScale(scaleX, scaleY); + BoneLocal *_self = (BoneLocal *) self; + _self->setScale(scaleX, scaleY); } void spine_bone_local_set_scale_2(spine_bone_local self, float scale) { - ((BoneLocal*)self)->setScale(scale); + BoneLocal *_self = (BoneLocal *) self; + _self->setScale(scale); } float spine_bone_local_get_shear_x(spine_bone_local self) { - return ((BoneLocal*)self)->getShearX(); + BoneLocal *_self = (BoneLocal *) self; + return _self->getShearX(); } void spine_bone_local_set_shear_x(spine_bone_local self, float shearX) { - ((BoneLocal*)self)->setShearX(shearX); + BoneLocal *_self = (BoneLocal *) self; + _self->setShearX(shearX); } float spine_bone_local_get_shear_y(spine_bone_local self) { - return ((BoneLocal*)self)->getShearY(); + BoneLocal *_self = (BoneLocal *) self; + return _self->getShearY(); } void spine_bone_local_set_shear_y(spine_bone_local self, float shearY) { - ((BoneLocal*)self)->setShearY(shearY); + BoneLocal *_self = (BoneLocal *) self; + _self->setShearY(shearY); } spine_inherit spine_bone_local_get_inherit(spine_bone_local self) { - return (spine_inherit)((BoneLocal*)self)->getInherit(); + BoneLocal *_self = (BoneLocal *) self; + return (spine_inherit) _self->getInherit(); } void spine_bone_local_set_inherit(spine_bone_local self, spine_inherit inherit) { - ((BoneLocal*)self)->setInherit((Inherit)inherit); + BoneLocal *_self = (BoneLocal *) self; + _self->setInherit((Inherit) inherit); } diff --git a/spine-c/src/generated/bone_pose.cpp b/spine-c/src/generated/bone_pose.cpp index e828ad8ea..ae13218b8 100644 --- a/spine-c/src/generated/bone_pose.cpp +++ b/spine-c/src/generated/bone_pose.cpp @@ -4,217 +4,268 @@ using namespace spine; spine_bone_pose spine_bone_pose_create(void) { - return (spine_bone_pose) new (__FILE__, __LINE__) BonePose(); + return (spine_bone_pose) new (__FILE__, __LINE__) BonePose(); } void spine_bone_pose_dispose(spine_bone_pose self) { - delete (BonePose*)self; + delete (BonePose *) self; } void spine_bone_pose_update(spine_bone_pose self, spine_skeleton skeleton, spine_physics physics) { - ((BonePose*)self)->update(*((Skeleton*)skeleton), (Physics)physics); + BonePose *_self = (BonePose *) self; + _self->update(*((Skeleton *) skeleton), (Physics) physics); } void spine_bone_pose_update_world_transform(spine_bone_pose self, spine_skeleton skeleton) { - ((BonePose*)self)->updateWorldTransform(*((Skeleton*)skeleton)); + BonePose *_self = (BonePose *) self; + _self->updateWorldTransform(*((Skeleton *) skeleton)); } void spine_bone_pose_update_local_transform(spine_bone_pose self, spine_skeleton skeleton) { - ((BonePose*)self)->updateLocalTransform(*((Skeleton*)skeleton)); + BonePose *_self = (BonePose *) self; + _self->updateLocalTransform(*((Skeleton *) skeleton)); } void spine_bone_pose_validate_local_transform(spine_bone_pose self, spine_skeleton skeleton) { - ((BonePose*)self)->validateLocalTransform(*((Skeleton*)skeleton)); + BonePose *_self = (BonePose *) self; + _self->validateLocalTransform(*((Skeleton *) skeleton)); } void spine_bone_pose_modify_local(spine_bone_pose self, spine_skeleton skeleton) { - ((BonePose*)self)->modifyLocal(*((Skeleton*)skeleton)); + BonePose *_self = (BonePose *) self; + _self->modifyLocal(*((Skeleton *) skeleton)); } void spine_bone_pose_modify_world(spine_bone_pose self, int update) { - ((BonePose*)self)->modifyWorld(update); + BonePose *_self = (BonePose *) self; + _self->modifyWorld(update); } void spine_bone_pose_reset_world(spine_bone_pose self, int update) { - ((BonePose*)self)->resetWorld(update); + BonePose *_self = (BonePose *) self; + _self->resetWorld(update); } float spine_bone_pose_get_a(spine_bone_pose self) { - return ((BonePose*)self)->getA(); + BonePose *_self = (BonePose *) self; + return _self->getA(); } void spine_bone_pose_set_a(spine_bone_pose self, float a) { - ((BonePose*)self)->setA(a); + BonePose *_self = (BonePose *) self; + _self->setA(a); } float spine_bone_pose_get_b(spine_bone_pose self) { - return ((BonePose*)self)->getB(); + BonePose *_self = (BonePose *) self; + return _self->getB(); } void spine_bone_pose_set_b(spine_bone_pose self, float b) { - ((BonePose*)self)->setB(b); + BonePose *_self = (BonePose *) self; + _self->setB(b); } float spine_bone_pose_get_c(spine_bone_pose self) { - return ((BonePose*)self)->getC(); + BonePose *_self = (BonePose *) self; + return _self->getC(); } void spine_bone_pose_set_c(spine_bone_pose self, float c) { - ((BonePose*)self)->setC(c); + BonePose *_self = (BonePose *) self; + _self->setC(c); } float spine_bone_pose_get_d(spine_bone_pose self) { - return ((BonePose*)self)->getD(); + BonePose *_self = (BonePose *) self; + return _self->getD(); } void spine_bone_pose_set_d(spine_bone_pose self, float d) { - ((BonePose*)self)->setD(d); + BonePose *_self = (BonePose *) self; + _self->setD(d); } float spine_bone_pose_get_world_x(spine_bone_pose self) { - return ((BonePose*)self)->getWorldX(); + BonePose *_self = (BonePose *) self; + return _self->getWorldX(); } void spine_bone_pose_set_world_x(spine_bone_pose self, float worldX) { - ((BonePose*)self)->setWorldX(worldX); + BonePose *_self = (BonePose *) self; + _self->setWorldX(worldX); } float spine_bone_pose_get_world_y(spine_bone_pose self) { - return ((BonePose*)self)->getWorldY(); + BonePose *_self = (BonePose *) self; + return _self->getWorldY(); } void spine_bone_pose_set_world_y(spine_bone_pose self, float worldY) { - ((BonePose*)self)->setWorldY(worldY); + BonePose *_self = (BonePose *) self; + _self->setWorldY(worldY); } float spine_bone_pose_get_world_rotation_x(spine_bone_pose self) { - return ((BonePose*)self)->getWorldRotationX(); + BonePose *_self = (BonePose *) self; + return _self->getWorldRotationX(); } float spine_bone_pose_get_world_rotation_y(spine_bone_pose self) { - return ((BonePose*)self)->getWorldRotationY(); + BonePose *_self = (BonePose *) self; + return _self->getWorldRotationY(); } float spine_bone_pose_get_world_scale_x(spine_bone_pose self) { - return ((BonePose*)self)->getWorldScaleX(); + BonePose *_self = (BonePose *) self; + return _self->getWorldScaleX(); } float spine_bone_pose_get_world_scale_y(spine_bone_pose self) { - return ((BonePose*)self)->getWorldScaleY(); + BonePose *_self = (BonePose *) self; + return _self->getWorldScaleY(); } -void spine_bone_pose_world_to_local(spine_bone_pose self, float worldX, float worldY, float * outLocalX, float * outLocalY) { - ((BonePose*)self)->worldToLocal(worldX, worldY, *outLocalX, *outLocalY); +void spine_bone_pose_world_to_local(spine_bone_pose self, float worldX, float worldY, float *outLocalX, float *outLocalY) { + BonePose *_self = (BonePose *) self; + _self->worldToLocal(worldX, worldY, *outLocalX, *outLocalY); } -void spine_bone_pose_local_to_world(spine_bone_pose self, float localX, float localY, float * outWorldX, float * outWorldY) { - ((BonePose*)self)->localToWorld(localX, localY, *outWorldX, *outWorldY); +void spine_bone_pose_local_to_world(spine_bone_pose self, float localX, float localY, float *outWorldX, float *outWorldY) { + BonePose *_self = (BonePose *) self; + _self->localToWorld(localX, localY, *outWorldX, *outWorldY); } -void spine_bone_pose_world_to_parent(spine_bone_pose self, float worldX, float worldY, float * outParentX, float * outParentY) { - ((BonePose*)self)->worldToParent(worldX, worldY, *outParentX, *outParentY); +void spine_bone_pose_world_to_parent(spine_bone_pose self, float worldX, float worldY, float *outParentX, float *outParentY) { + BonePose *_self = (BonePose *) self; + _self->worldToParent(worldX, worldY, *outParentX, *outParentY); } -void spine_bone_pose_parent_to_world(spine_bone_pose self, float parentX, float parentY, float * outWorldX, float * outWorldY) { - ((BonePose*)self)->parentToWorld(parentX, parentY, *outWorldX, *outWorldY); +void spine_bone_pose_parent_to_world(spine_bone_pose self, float parentX, float parentY, float *outWorldX, float *outWorldY) { + BonePose *_self = (BonePose *) self; + _self->parentToWorld(parentX, parentY, *outWorldX, *outWorldY); } float spine_bone_pose_world_to_local_rotation(spine_bone_pose self, float worldRotation) { - return ((BonePose*)self)->worldToLocalRotation(worldRotation); + BonePose *_self = (BonePose *) self; + return _self->worldToLocalRotation(worldRotation); } float spine_bone_pose_local_to_world_rotation(spine_bone_pose self, float localRotation) { - return ((BonePose*)self)->localToWorldRotation(localRotation); + BonePose *_self = (BonePose *) self; + return _self->localToWorldRotation(localRotation); } void spine_bone_pose_rotate_world(spine_bone_pose self, float degrees) { - ((BonePose*)self)->rotateWorld(degrees); + BonePose *_self = (BonePose *) self; + _self->rotateWorld(degrees); } void spine_bone_pose_set(spine_bone_pose self, spine_bone_local pose) { - ((BoneLocal*)(BonePose*)self)->set(*((BoneLocal*)pose)); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + _self->set(*((BoneLocal *) pose)); } float spine_bone_pose_get_x(spine_bone_pose self) { - return ((BoneLocal*)(BonePose*)self)->getX(); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + return _self->getX(); } void spine_bone_pose_set_x(spine_bone_pose self, float x) { - ((BoneLocal*)(BonePose*)self)->setX(x); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + _self->setX(x); } float spine_bone_pose_get_y(spine_bone_pose self) { - return ((BoneLocal*)(BonePose*)self)->getY(); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + return _self->getY(); } void spine_bone_pose_set_y(spine_bone_pose self, float y) { - ((BoneLocal*)(BonePose*)self)->setY(y); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + _self->setY(y); } void spine_bone_pose_set_position(spine_bone_pose self, float x, float y) { - ((BoneLocal*)(BonePose*)self)->setPosition(x, y); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + _self->setPosition(x, y); } float spine_bone_pose_get_rotation(spine_bone_pose self) { - return ((BoneLocal*)(BonePose*)self)->getRotation(); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + return _self->getRotation(); } void spine_bone_pose_set_rotation(spine_bone_pose self, float rotation) { - ((BoneLocal*)(BonePose*)self)->setRotation(rotation); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + _self->setRotation(rotation); } float spine_bone_pose_get_scale_x(spine_bone_pose self) { - return ((BoneLocal*)(BonePose*)self)->getScaleX(); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + return _self->getScaleX(); } void spine_bone_pose_set_scale_x(spine_bone_pose self, float scaleX) { - ((BoneLocal*)(BonePose*)self)->setScaleX(scaleX); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + _self->setScaleX(scaleX); } float spine_bone_pose_get_scale_y(spine_bone_pose self) { - return ((BoneLocal*)(BonePose*)self)->getScaleY(); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + return _self->getScaleY(); } void spine_bone_pose_set_scale_y(spine_bone_pose self, float scaleY) { - ((BoneLocal*)(BonePose*)self)->setScaleY(scaleY); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + _self->setScaleY(scaleY); } void spine_bone_pose_set_scale_1(spine_bone_pose self, float scaleX, float scaleY) { - ((BoneLocal*)(BonePose*)self)->setScale(scaleX, scaleY); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + _self->setScale(scaleX, scaleY); } void spine_bone_pose_set_scale_2(spine_bone_pose self, float scale) { - ((BoneLocal*)(BonePose*)self)->setScale(scale); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + _self->setScale(scale); } float spine_bone_pose_get_shear_x(spine_bone_pose self) { - return ((BoneLocal*)(BonePose*)self)->getShearX(); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + return _self->getShearX(); } void spine_bone_pose_set_shear_x(spine_bone_pose self, float shearX) { - ((BoneLocal*)(BonePose*)self)->setShearX(shearX); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + _self->setShearX(shearX); } float spine_bone_pose_get_shear_y(spine_bone_pose self) { - return ((BoneLocal*)(BonePose*)self)->getShearY(); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + return _self->getShearY(); } void spine_bone_pose_set_shear_y(spine_bone_pose self, float shearY) { - ((BoneLocal*)(BonePose*)self)->setShearY(shearY); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + _self->setShearY(shearY); } spine_inherit spine_bone_pose_get_inherit(spine_bone_pose self) { - return (spine_inherit)((BoneLocal*)(BonePose*)self)->getInherit(); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + return (spine_inherit) _self->getInherit(); } void spine_bone_pose_set_inherit(spine_bone_pose self, spine_inherit inherit) { - ((BoneLocal*)(BonePose*)self)->setInherit((Inherit)inherit); + BoneLocal *_self = (BoneLocal *) (BonePose *) self; + _self->setInherit((Inherit) inherit); } spine_rtti spine_bone_pose_get_rtti(spine_bone_pose self) { - return (spine_rtti)&((Update*)(BonePose*)self)->getRTTI(); + Update *_self = (Update *) (BonePose *) self; + return (spine_rtti) &_self->getRTTI(); } spine_rtti spine_bone_pose_rtti(void) { - return (spine_rtti)&BonePose::rtti; + return (spine_rtti) &BonePose::rtti; } diff --git a/spine-c/src/generated/bone_pose.h b/spine-c/src/generated/bone_pose.h index 833fb6a41..693b1b4ae 100644 --- a/spine-c/src/generated/bone_pose.h +++ b/spine-c/src/generated/bone_pose.h @@ -35,10 +35,10 @@ SPINE_C_API float spine_bone_pose_get_world_rotation_x(spine_bone_pose self); SPINE_C_API float spine_bone_pose_get_world_rotation_y(spine_bone_pose self); SPINE_C_API float spine_bone_pose_get_world_scale_x(spine_bone_pose self); SPINE_C_API float spine_bone_pose_get_world_scale_y(spine_bone_pose self); -SPINE_C_API void spine_bone_pose_world_to_local(spine_bone_pose self, float worldX, float worldY, float * outLocalX, float * outLocalY); -SPINE_C_API void spine_bone_pose_local_to_world(spine_bone_pose self, float localX, float localY, float * outWorldX, float * outWorldY); -SPINE_C_API void spine_bone_pose_world_to_parent(spine_bone_pose self, float worldX, float worldY, float * outParentX, float * outParentY); -SPINE_C_API void spine_bone_pose_parent_to_world(spine_bone_pose self, float parentX, float parentY, float * outWorldX, float * outWorldY); +SPINE_C_API void spine_bone_pose_world_to_local(spine_bone_pose self, float worldX, float worldY, float *outLocalX, float *outLocalY); +SPINE_C_API void spine_bone_pose_local_to_world(spine_bone_pose self, float localX, float localY, float *outWorldX, float *outWorldY); +SPINE_C_API void spine_bone_pose_world_to_parent(spine_bone_pose self, float worldX, float worldY, float *outParentX, float *outParentY); +SPINE_C_API void spine_bone_pose_parent_to_world(spine_bone_pose self, float parentX, float parentY, float *outWorldX, float *outWorldY); SPINE_C_API float spine_bone_pose_world_to_local_rotation(spine_bone_pose self, float worldRotation); SPINE_C_API float spine_bone_pose_local_to_world_rotation(spine_bone_pose self, float localRotation); SPINE_C_API void spine_bone_pose_rotate_world(spine_bone_pose self, float degrees); diff --git a/spine-c/src/generated/bone_timeline.cpp b/spine-c/src/generated/bone_timeline.cpp index 7b5506818..f7ec484f7 100644 --- a/spine-c/src/generated/bone_timeline.cpp +++ b/spine-c/src/generated/bone_timeline.cpp @@ -4,21 +4,24 @@ using namespace spine; void spine_bone_timeline_dispose(spine_bone_timeline self) { - delete (BoneTimeline*)self; + delete (BoneTimeline *) self; } spine_rtti spine_bone_timeline_get_rtti(spine_bone_timeline self) { - return (spine_rtti)&((BoneTimeline*)self)->getRTTI(); + BoneTimeline *_self = (BoneTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } int spine_bone_timeline_get_bone_index(spine_bone_timeline self) { - return ((BoneTimeline*)self)->getBoneIndex(); + BoneTimeline *_self = (BoneTimeline *) self; + return _self->getBoneIndex(); } void spine_bone_timeline_set_bone_index(spine_bone_timeline self, int inValue) { - ((BoneTimeline*)self)->setBoneIndex(inValue); + BoneTimeline *_self = (BoneTimeline *) self; + _self->setBoneIndex(inValue); } spine_rtti spine_bone_timeline_rtti(void) { - return (spine_rtti)&BoneTimeline::rtti; + return (spine_rtti) &BoneTimeline::rtti; } diff --git a/spine-c/src/generated/bone_timeline1.cpp b/spine-c/src/generated/bone_timeline1.cpp index 5d0f99a71..f4079a158 100644 --- a/spine-c/src/generated/bone_timeline1.cpp +++ b/spine-c/src/generated/bone_timeline1.cpp @@ -4,89 +4,115 @@ using namespace spine; void spine_bone_timeline1_dispose(spine_bone_timeline1 self) { - delete (BoneTimeline1*)self; + delete (BoneTimeline1 *) self; } spine_rtti spine_bone_timeline1_get_rtti(spine_bone_timeline1 self) { - return (spine_rtti)&((BoneTimeline1*)self)->getRTTI(); + BoneTimeline1 *_self = (BoneTimeline1 *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_bone_timeline1_apply(spine_bone_timeline1 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((BoneTimeline1*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_bone_timeline1_apply(spine_bone_timeline1 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + BoneTimeline1 *_self = (BoneTimeline1 *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_bone_timeline1_set_frame(spine_bone_timeline1 self, size_t frame, float time, float value) { - ((CurveTimeline1*)(BoneTimeline1*)self)->setFrame(frame, time, value); + CurveTimeline1 *_self = (CurveTimeline1 *) (BoneTimeline1 *) self; + _self->setFrame(frame, time, value); } float spine_bone_timeline1_get_curve_value(spine_bone_timeline1 self, float time) { - return ((CurveTimeline1*)(BoneTimeline1*)self)->getCurveValue(time); + CurveTimeline1 *_self = (CurveTimeline1 *) (BoneTimeline1 *) self; + return _self->getCurveValue(time); } float spine_bone_timeline1_get_relative_value(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((CurveTimeline1*)(BoneTimeline1*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); + CurveTimeline1 *_self = (CurveTimeline1 *) (BoneTimeline1 *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_bone_timeline1_get_absolute_value_1(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((CurveTimeline1*)(BoneTimeline1*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_bone_timeline1_get_absolute_value_1(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + CurveTimeline1 *_self = (CurveTimeline1 *) (BoneTimeline1 *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_bone_timeline1_get_absolute_value_2(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((CurveTimeline1*)(BoneTimeline1*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_bone_timeline1_get_absolute_value_2(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup, + float value) { + CurveTimeline1 *_self = (CurveTimeline1 *) (BoneTimeline1 *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_bone_timeline1_get_scale_value(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((CurveTimeline1*)(BoneTimeline1*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_bone_timeline1_get_scale_value(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, + float current, float setup) { + CurveTimeline1 *_self = (CurveTimeline1 *) (BoneTimeline1 *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_bone_timeline1_set_linear(spine_bone_timeline1 self, size_t frame) { - ((CurveTimeline1*)(BoneTimeline1*)self)->setLinear(frame); + CurveTimeline1 *_self = (CurveTimeline1 *) (BoneTimeline1 *) self; + _self->setLinear(frame); } void spine_bone_timeline1_set_stepped(spine_bone_timeline1 self, size_t frame) { - ((CurveTimeline1*)(BoneTimeline1*)self)->setStepped(frame); + CurveTimeline1 *_self = (CurveTimeline1 *) (BoneTimeline1 *) self; + _self->setStepped(frame); } -void spine_bone_timeline1_set_bezier(spine_bone_timeline1 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((CurveTimeline1*)(BoneTimeline1*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_bone_timeline1_set_bezier(spine_bone_timeline1 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, + float cy1, float cx2, float cy2, float time2, float value2) { + CurveTimeline1 *_self = (CurveTimeline1 *) (BoneTimeline1 *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_bone_timeline1_get_bezier_value(spine_bone_timeline1 self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((CurveTimeline1*)(BoneTimeline1*)self)->getBezierValue(time, frame, valueOffset, i); + CurveTimeline1 *_self = (CurveTimeline1 *) (BoneTimeline1 *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_bone_timeline1_get_curves(spine_bone_timeline1 self) { - return (spine_array_float)&((CurveTimeline1*)(BoneTimeline1*)self)->getCurves(); + CurveTimeline1 *_self = (CurveTimeline1 *) (BoneTimeline1 *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_bone_timeline1_get_frame_entries(spine_bone_timeline1 self) { - return ((CurveTimeline1*)(BoneTimeline1*)self)->getFrameEntries(); + CurveTimeline1 *_self = (CurveTimeline1 *) (BoneTimeline1 *) self; + return _self->getFrameEntries(); } size_t spine_bone_timeline1_get_frame_count(spine_bone_timeline1 self) { - return ((CurveTimeline1*)(BoneTimeline1*)self)->getFrameCount(); + CurveTimeline1 *_self = (CurveTimeline1 *) (BoneTimeline1 *) self; + return _self->getFrameCount(); } spine_array_float spine_bone_timeline1_get_frames(spine_bone_timeline1 self) { - return (spine_array_float)&((CurveTimeline1*)(BoneTimeline1*)self)->getFrames(); + CurveTimeline1 *_self = (CurveTimeline1 *) (BoneTimeline1 *) self; + return (spine_array_float) &_self->getFrames(); } float spine_bone_timeline1_get_duration(spine_bone_timeline1 self) { - return ((CurveTimeline1*)(BoneTimeline1*)self)->getDuration(); + CurveTimeline1 *_self = (CurveTimeline1 *) (BoneTimeline1 *) self; + return _self->getDuration(); } spine_array_property_id spine_bone_timeline1_get_property_ids(spine_bone_timeline1 self) { - return (spine_array_property_id)&((CurveTimeline1*)(BoneTimeline1*)self)->getPropertyIds(); + CurveTimeline1 *_self = (CurveTimeline1 *) (BoneTimeline1 *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_bone_timeline1_get_bone_index(spine_bone_timeline1 self) { - return ((BoneTimeline*)(BoneTimeline1*)self)->getBoneIndex(); + BoneTimeline *_self = (BoneTimeline *) (BoneTimeline1 *) self; + return _self->getBoneIndex(); } void spine_bone_timeline1_set_bone_index(spine_bone_timeline1 self, int inValue) { - ((BoneTimeline*)(BoneTimeline1*)self)->setBoneIndex(inValue); + BoneTimeline *_self = (BoneTimeline *) (BoneTimeline1 *) self; + _self->setBoneIndex(inValue); } spine_rtti spine_bone_timeline1_rtti(void) { - return (spine_rtti)&BoneTimeline1::rtti; + return (spine_rtti) &BoneTimeline1::rtti; } diff --git a/spine-c/src/generated/bone_timeline1.h b/spine-c/src/generated/bone_timeline1.h index c79ea4463..16675d0bb 100644 --- a/spine-c/src/generated/bone_timeline1.h +++ b/spine-c/src/generated/bone_timeline1.h @@ -11,16 +11,22 @@ extern "C" { SPINE_C_API void spine_bone_timeline1_dispose(spine_bone_timeline1 self); SPINE_C_API spine_rtti spine_bone_timeline1_get_rtti(spine_bone_timeline1 self); -SPINE_C_API void spine_bone_timeline1_apply(spine_bone_timeline1 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_bone_timeline1_apply(spine_bone_timeline1 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); SPINE_C_API void spine_bone_timeline1_set_frame(spine_bone_timeline1 self, size_t frame, float time, float value); SPINE_C_API float spine_bone_timeline1_get_curve_value(spine_bone_timeline1 self, float time); -SPINE_C_API float spine_bone_timeline1_get_relative_value(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_bone_timeline1_get_absolute_value_1(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_bone_timeline1_get_absolute_value_2(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_bone_timeline1_get_scale_value(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_bone_timeline1_get_relative_value(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, + float setup); +SPINE_C_API float spine_bone_timeline1_get_absolute_value_1(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, + float setup); +SPINE_C_API float spine_bone_timeline1_get_absolute_value_2(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, + float setup, float value); +SPINE_C_API float spine_bone_timeline1_get_scale_value(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup); SPINE_C_API void spine_bone_timeline1_set_linear(spine_bone_timeline1 self, size_t frame); SPINE_C_API void spine_bone_timeline1_set_stepped(spine_bone_timeline1 self, size_t frame); -SPINE_C_API void spine_bone_timeline1_set_bezier(spine_bone_timeline1 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_bone_timeline1_set_bezier(spine_bone_timeline1 self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_bone_timeline1_get_bezier_value(spine_bone_timeline1 self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_bone_timeline1_get_curves(spine_bone_timeline1 self); SPINE_C_API size_t spine_bone_timeline1_get_frame_entries(spine_bone_timeline1 self); diff --git a/spine-c/src/generated/bone_timeline2.cpp b/spine-c/src/generated/bone_timeline2.cpp index 5b2cb6123..e5042d0c4 100644 --- a/spine-c/src/generated/bone_timeline2.cpp +++ b/spine-c/src/generated/bone_timeline2.cpp @@ -4,73 +4,92 @@ using namespace spine; void spine_bone_timeline2_dispose(spine_bone_timeline2 self) { - delete (BoneTimeline2*)self; + delete (BoneTimeline2 *) self; } spine_rtti spine_bone_timeline2_get_rtti(spine_bone_timeline2 self) { - return (spine_rtti)&((BoneTimeline2*)self)->getRTTI(); + BoneTimeline2 *_self = (BoneTimeline2 *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_bone_timeline2_apply(spine_bone_timeline2 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((BoneTimeline2*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_bone_timeline2_apply(spine_bone_timeline2 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + BoneTimeline2 *_self = (BoneTimeline2 *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_bone_timeline2_set_frame(spine_bone_timeline2 self, size_t frame, float time, float value1, float value2) { - ((CurveTimeline2*)(BoneTimeline2*)self)->setFrame(frame, time, value1, value2); + CurveTimeline2 *_self = (CurveTimeline2 *) (BoneTimeline2 *) self; + _self->setFrame(frame, time, value1, value2); } float spine_bone_timeline2_get_curve_value(spine_bone_timeline2 self, float time) { - return ((CurveTimeline2*)(BoneTimeline2*)self)->getCurveValue(time); + CurveTimeline2 *_self = (CurveTimeline2 *) (BoneTimeline2 *) self; + return _self->getCurveValue(time); } void spine_bone_timeline2_set_linear(spine_bone_timeline2 self, size_t frame) { - ((CurveTimeline2*)(BoneTimeline2*)self)->setLinear(frame); + CurveTimeline2 *_self = (CurveTimeline2 *) (BoneTimeline2 *) self; + _self->setLinear(frame); } void spine_bone_timeline2_set_stepped(spine_bone_timeline2 self, size_t frame) { - ((CurveTimeline2*)(BoneTimeline2*)self)->setStepped(frame); + CurveTimeline2 *_self = (CurveTimeline2 *) (BoneTimeline2 *) self; + _self->setStepped(frame); } -void spine_bone_timeline2_set_bezier(spine_bone_timeline2 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((CurveTimeline2*)(BoneTimeline2*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_bone_timeline2_set_bezier(spine_bone_timeline2 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, + float cy1, float cx2, float cy2, float time2, float value2) { + CurveTimeline2 *_self = (CurveTimeline2 *) (BoneTimeline2 *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_bone_timeline2_get_bezier_value(spine_bone_timeline2 self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((CurveTimeline2*)(BoneTimeline2*)self)->getBezierValue(time, frame, valueOffset, i); + CurveTimeline2 *_self = (CurveTimeline2 *) (BoneTimeline2 *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_bone_timeline2_get_curves(spine_bone_timeline2 self) { - return (spine_array_float)&((CurveTimeline2*)(BoneTimeline2*)self)->getCurves(); + CurveTimeline2 *_self = (CurveTimeline2 *) (BoneTimeline2 *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_bone_timeline2_get_frame_entries(spine_bone_timeline2 self) { - return ((CurveTimeline2*)(BoneTimeline2*)self)->getFrameEntries(); + CurveTimeline2 *_self = (CurveTimeline2 *) (BoneTimeline2 *) self; + return _self->getFrameEntries(); } size_t spine_bone_timeline2_get_frame_count(spine_bone_timeline2 self) { - return ((CurveTimeline2*)(BoneTimeline2*)self)->getFrameCount(); + CurveTimeline2 *_self = (CurveTimeline2 *) (BoneTimeline2 *) self; + return _self->getFrameCount(); } spine_array_float spine_bone_timeline2_get_frames(spine_bone_timeline2 self) { - return (spine_array_float)&((CurveTimeline2*)(BoneTimeline2*)self)->getFrames(); + CurveTimeline2 *_self = (CurveTimeline2 *) (BoneTimeline2 *) self; + return (spine_array_float) &_self->getFrames(); } float spine_bone_timeline2_get_duration(spine_bone_timeline2 self) { - return ((CurveTimeline2*)(BoneTimeline2*)self)->getDuration(); + CurveTimeline2 *_self = (CurveTimeline2 *) (BoneTimeline2 *) self; + return _self->getDuration(); } spine_array_property_id spine_bone_timeline2_get_property_ids(spine_bone_timeline2 self) { - return (spine_array_property_id)&((CurveTimeline2*)(BoneTimeline2*)self)->getPropertyIds(); + CurveTimeline2 *_self = (CurveTimeline2 *) (BoneTimeline2 *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_bone_timeline2_get_bone_index(spine_bone_timeline2 self) { - return ((BoneTimeline*)(BoneTimeline2*)self)->getBoneIndex(); + BoneTimeline *_self = (BoneTimeline *) (BoneTimeline2 *) self; + return _self->getBoneIndex(); } void spine_bone_timeline2_set_bone_index(spine_bone_timeline2 self, int inValue) { - ((BoneTimeline*)(BoneTimeline2*)self)->setBoneIndex(inValue); + BoneTimeline *_self = (BoneTimeline *) (BoneTimeline2 *) self; + _self->setBoneIndex(inValue); } spine_rtti spine_bone_timeline2_rtti(void) { - return (spine_rtti)&BoneTimeline2::rtti; + return (spine_rtti) &BoneTimeline2::rtti; } diff --git a/spine-c/src/generated/bone_timeline2.h b/spine-c/src/generated/bone_timeline2.h index 56eb1ae8d..7f5b10bc5 100644 --- a/spine-c/src/generated/bone_timeline2.h +++ b/spine-c/src/generated/bone_timeline2.h @@ -11,12 +11,14 @@ extern "C" { SPINE_C_API void spine_bone_timeline2_dispose(spine_bone_timeline2 self); SPINE_C_API spine_rtti spine_bone_timeline2_get_rtti(spine_bone_timeline2 self); -SPINE_C_API void spine_bone_timeline2_apply(spine_bone_timeline2 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_bone_timeline2_apply(spine_bone_timeline2 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); SPINE_C_API void spine_bone_timeline2_set_frame(spine_bone_timeline2 self, size_t frame, float time, float value1, float value2); SPINE_C_API float spine_bone_timeline2_get_curve_value(spine_bone_timeline2 self, float time); SPINE_C_API void spine_bone_timeline2_set_linear(spine_bone_timeline2 self, size_t frame); SPINE_C_API void spine_bone_timeline2_set_stepped(spine_bone_timeline2 self, size_t frame); -SPINE_C_API void spine_bone_timeline2_set_bezier(spine_bone_timeline2 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_bone_timeline2_set_bezier(spine_bone_timeline2 self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_bone_timeline2_get_bezier_value(spine_bone_timeline2 self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_bone_timeline2_get_curves(spine_bone_timeline2 self); SPINE_C_API size_t spine_bone_timeline2_get_frame_entries(spine_bone_timeline2 self); diff --git a/spine-c/src/generated/bounding_box_attachment.cpp b/spine-c/src/generated/bounding_box_attachment.cpp index da314c9f1..f994d6d5c 100644 --- a/spine-c/src/generated/bounding_box_attachment.cpp +++ b/spine-c/src/generated/bounding_box_attachment.cpp @@ -3,90 +3,112 @@ using namespace spine; -spine_bounding_box_attachment spine_bounding_box_attachment_create(const char * name) { - return (spine_bounding_box_attachment) new (__FILE__, __LINE__) BoundingBoxAttachment(String(name)); +spine_bounding_box_attachment spine_bounding_box_attachment_create(const char *name) { + return (spine_bounding_box_attachment) new (__FILE__, __LINE__) BoundingBoxAttachment(String(name)); } void spine_bounding_box_attachment_dispose(spine_bounding_box_attachment self) { - delete (BoundingBoxAttachment*)self; + delete (BoundingBoxAttachment *) self; } spine_rtti spine_bounding_box_attachment_get_rtti(spine_bounding_box_attachment self) { - return (spine_rtti)&((BoundingBoxAttachment*)self)->getRTTI(); + BoundingBoxAttachment *_self = (BoundingBoxAttachment *) self; + return (spine_rtti) &_self->getRTTI(); } spine_color spine_bounding_box_attachment_get_color(spine_bounding_box_attachment self) { - return (spine_color)&((BoundingBoxAttachment*)self)->getColor(); + BoundingBoxAttachment *_self = (BoundingBoxAttachment *) self; + return (spine_color) &_self->getColor(); } spine_attachment spine_bounding_box_attachment_copy(spine_bounding_box_attachment self) { - return (spine_attachment)((BoundingBoxAttachment*)self)->copy(); + BoundingBoxAttachment *_self = (BoundingBoxAttachment *) self; + return (spine_attachment) _self->copy(); } -void spine_bounding_box_attachment_compute_world_vertices_1(spine_bounding_box_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, float * worldVertices, size_t offset, size_t stride) { - ((VertexAttachment*)(BoundingBoxAttachment*)self)->computeWorldVertices(*((Skeleton*)skeleton), *((Slot*)slot), start, count, worldVertices, offset, stride); +void spine_bounding_box_attachment_compute_world_vertices_1(spine_bounding_box_attachment self, spine_skeleton skeleton, spine_slot slot, + size_t start, size_t count, float *worldVertices, size_t offset, size_t stride) { + VertexAttachment *_self = (VertexAttachment *) (BoundingBoxAttachment *) self; + _self->computeWorldVertices(*((Skeleton *) skeleton), *((Slot *) slot), start, count, worldVertices, offset, stride); } -void spine_bounding_box_attachment_compute_world_vertices_2(spine_bounding_box_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, spine_array_float worldVertices, size_t offset, size_t stride) { - ((VertexAttachment*)(BoundingBoxAttachment*)self)->computeWorldVertices(*((Skeleton*)skeleton), *((Slot*)slot), start, count, *((Array*)worldVertices), offset, stride); +void spine_bounding_box_attachment_compute_world_vertices_2(spine_bounding_box_attachment self, spine_skeleton skeleton, spine_slot slot, + size_t start, size_t count, spine_array_float worldVertices, size_t offset, + size_t stride) { + VertexAttachment *_self = (VertexAttachment *) (BoundingBoxAttachment *) self; + _self->computeWorldVertices(*((Skeleton *) skeleton), *((Slot *) slot), start, count, *((Array *) worldVertices), offset, stride); } int spine_bounding_box_attachment_get_id(spine_bounding_box_attachment self) { - return ((VertexAttachment*)(BoundingBoxAttachment*)self)->getId(); + VertexAttachment *_self = (VertexAttachment *) (BoundingBoxAttachment *) self; + return _self->getId(); } spine_array_int spine_bounding_box_attachment_get_bones(spine_bounding_box_attachment self) { - return (spine_array_int)&((VertexAttachment*)(BoundingBoxAttachment*)self)->getBones(); + VertexAttachment *_self = (VertexAttachment *) (BoundingBoxAttachment *) self; + return (spine_array_int) &_self->getBones(); } void spine_bounding_box_attachment_set_bones(spine_bounding_box_attachment self, spine_array_int bones) { - ((VertexAttachment*)(BoundingBoxAttachment*)self)->setBones(*((Array*)bones)); + VertexAttachment *_self = (VertexAttachment *) (BoundingBoxAttachment *) self; + _self->setBones(*((Array *) bones)); } spine_array_float spine_bounding_box_attachment_get_vertices(spine_bounding_box_attachment self) { - return (spine_array_float)&((VertexAttachment*)(BoundingBoxAttachment*)self)->getVertices(); + VertexAttachment *_self = (VertexAttachment *) (BoundingBoxAttachment *) self; + return (spine_array_float) &_self->getVertices(); } void spine_bounding_box_attachment_set_vertices(spine_bounding_box_attachment self, spine_array_float vertices) { - ((VertexAttachment*)(BoundingBoxAttachment*)self)->setVertices(*((Array*)vertices)); + VertexAttachment *_self = (VertexAttachment *) (BoundingBoxAttachment *) self; + _self->setVertices(*((Array *) vertices)); } size_t spine_bounding_box_attachment_get_world_vertices_length(spine_bounding_box_attachment self) { - return ((VertexAttachment*)(BoundingBoxAttachment*)self)->getWorldVerticesLength(); + VertexAttachment *_self = (VertexAttachment *) (BoundingBoxAttachment *) self; + return _self->getWorldVerticesLength(); } void spine_bounding_box_attachment_set_world_vertices_length(spine_bounding_box_attachment self, size_t inValue) { - ((VertexAttachment*)(BoundingBoxAttachment*)self)->setWorldVerticesLength(inValue); + VertexAttachment *_self = (VertexAttachment *) (BoundingBoxAttachment *) self; + _self->setWorldVerticesLength(inValue); } spine_attachment spine_bounding_box_attachment_get_timeline_attachment(spine_bounding_box_attachment self) { - return (spine_attachment)((VertexAttachment*)(BoundingBoxAttachment*)self)->getTimelineAttachment(); + VertexAttachment *_self = (VertexAttachment *) (BoundingBoxAttachment *) self; + return (spine_attachment) _self->getTimelineAttachment(); } void spine_bounding_box_attachment_set_timeline_attachment(spine_bounding_box_attachment self, spine_attachment attachment) { - ((VertexAttachment*)(BoundingBoxAttachment*)self)->setTimelineAttachment((Attachment *)attachment); + VertexAttachment *_self = (VertexAttachment *) (BoundingBoxAttachment *) self; + _self->setTimelineAttachment((Attachment *) attachment); } void spine_bounding_box_attachment_copy_to(spine_bounding_box_attachment self, spine_vertex_attachment other) { - ((VertexAttachment*)(BoundingBoxAttachment*)self)->copyTo((VertexAttachment *)other); + VertexAttachment *_self = (VertexAttachment *) (BoundingBoxAttachment *) self; + _self->copyTo((VertexAttachment *) other); } -const char * spine_bounding_box_attachment_get_name(spine_bounding_box_attachment self) { - return ((VertexAttachment*)(BoundingBoxAttachment*)self)->getName().buffer(); +const char *spine_bounding_box_attachment_get_name(spine_bounding_box_attachment self) { + VertexAttachment *_self = (VertexAttachment *) (BoundingBoxAttachment *) self; + return _self->getName().buffer(); } int spine_bounding_box_attachment_get_ref_count(spine_bounding_box_attachment self) { - return ((VertexAttachment*)(BoundingBoxAttachment*)self)->getRefCount(); + VertexAttachment *_self = (VertexAttachment *) (BoundingBoxAttachment *) self; + return _self->getRefCount(); } void spine_bounding_box_attachment_reference(spine_bounding_box_attachment self) { - ((VertexAttachment*)(BoundingBoxAttachment*)self)->reference(); + VertexAttachment *_self = (VertexAttachment *) (BoundingBoxAttachment *) self; + _self->reference(); } void spine_bounding_box_attachment_dereference(spine_bounding_box_attachment self) { - ((VertexAttachment*)(BoundingBoxAttachment*)self)->dereference(); + VertexAttachment *_self = (VertexAttachment *) (BoundingBoxAttachment *) self; + _self->dereference(); } spine_rtti spine_bounding_box_attachment_rtti(void) { - return (spine_rtti)&BoundingBoxAttachment::rtti; + return (spine_rtti) &BoundingBoxAttachment::rtti; } diff --git a/spine-c/src/generated/bounding_box_attachment.h b/spine-c/src/generated/bounding_box_attachment.h index 89944d87a..7d75fd006 100644 --- a/spine-c/src/generated/bounding_box_attachment.h +++ b/spine-c/src/generated/bounding_box_attachment.h @@ -8,15 +8,19 @@ extern "C" { #endif -SPINE_C_API spine_bounding_box_attachment spine_bounding_box_attachment_create(const char * name); +SPINE_C_API spine_bounding_box_attachment spine_bounding_box_attachment_create(const char *name); SPINE_C_API void spine_bounding_box_attachment_dispose(spine_bounding_box_attachment self); SPINE_C_API spine_rtti spine_bounding_box_attachment_get_rtti(spine_bounding_box_attachment self); SPINE_C_API spine_color spine_bounding_box_attachment_get_color(spine_bounding_box_attachment self); SPINE_C_API spine_attachment spine_bounding_box_attachment_copy(spine_bounding_box_attachment self); -SPINE_C_API void spine_bounding_box_attachment_compute_world_vertices_1(spine_bounding_box_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, float * worldVertices, size_t offset, size_t stride); -SPINE_C_API void spine_bounding_box_attachment_compute_world_vertices_2(spine_bounding_box_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, spine_array_float worldVertices, size_t offset, size_t stride); +SPINE_C_API void spine_bounding_box_attachment_compute_world_vertices_1(spine_bounding_box_attachment self, spine_skeleton skeleton, spine_slot slot, + size_t start, size_t count, float *worldVertices, size_t offset, + size_t stride); +SPINE_C_API void spine_bounding_box_attachment_compute_world_vertices_2(spine_bounding_box_attachment self, spine_skeleton skeleton, spine_slot slot, + size_t start, size_t count, spine_array_float worldVertices, size_t offset, + size_t stride); SPINE_C_API int spine_bounding_box_attachment_get_id(spine_bounding_box_attachment self); SPINE_C_API spine_array_int spine_bounding_box_attachment_get_bones(spine_bounding_box_attachment self); SPINE_C_API void spine_bounding_box_attachment_set_bones(spine_bounding_box_attachment self, spine_array_int bones); @@ -27,7 +31,7 @@ SPINE_C_API void spine_bounding_box_attachment_set_world_vertices_length(spine_b SPINE_C_API spine_attachment spine_bounding_box_attachment_get_timeline_attachment(spine_bounding_box_attachment self); SPINE_C_API void spine_bounding_box_attachment_set_timeline_attachment(spine_bounding_box_attachment self, spine_attachment attachment); SPINE_C_API void spine_bounding_box_attachment_copy_to(spine_bounding_box_attachment self, spine_vertex_attachment other); -SPINE_C_API const char * spine_bounding_box_attachment_get_name(spine_bounding_box_attachment self); +SPINE_C_API const char *spine_bounding_box_attachment_get_name(spine_bounding_box_attachment self); SPINE_C_API int spine_bounding_box_attachment_get_ref_count(spine_bounding_box_attachment self); SPINE_C_API void spine_bounding_box_attachment_reference(spine_bounding_box_attachment self); SPINE_C_API void spine_bounding_box_attachment_dereference(spine_bounding_box_attachment self); diff --git a/spine-c/src/generated/clipping_attachment.cpp b/spine-c/src/generated/clipping_attachment.cpp index 762bf71a6..160af68e5 100644 --- a/spine-c/src/generated/clipping_attachment.cpp +++ b/spine-c/src/generated/clipping_attachment.cpp @@ -3,98 +3,121 @@ using namespace spine; -spine_clipping_attachment spine_clipping_attachment_create(const char * name) { - return (spine_clipping_attachment) new (__FILE__, __LINE__) ClippingAttachment(String(name)); +spine_clipping_attachment spine_clipping_attachment_create(const char *name) { + return (spine_clipping_attachment) new (__FILE__, __LINE__) ClippingAttachment(String(name)); } void spine_clipping_attachment_dispose(spine_clipping_attachment self) { - delete (ClippingAttachment*)self; + delete (ClippingAttachment *) self; } spine_rtti spine_clipping_attachment_get_rtti(spine_clipping_attachment self) { - return (spine_rtti)&((ClippingAttachment*)self)->getRTTI(); + ClippingAttachment *_self = (ClippingAttachment *) self; + return (spine_rtti) &_self->getRTTI(); } spine_slot_data spine_clipping_attachment_get_end_slot(spine_clipping_attachment self) { - return (spine_slot_data)((ClippingAttachment*)self)->getEndSlot(); + ClippingAttachment *_self = (ClippingAttachment *) self; + return (spine_slot_data) _self->getEndSlot(); } void spine_clipping_attachment_set_end_slot(spine_clipping_attachment self, spine_slot_data inValue) { - ((ClippingAttachment*)self)->setEndSlot((SlotData *)inValue); + ClippingAttachment *_self = (ClippingAttachment *) self; + _self->setEndSlot((SlotData *) inValue); } spine_color spine_clipping_attachment_get_color(spine_clipping_attachment self) { - return (spine_color)&((ClippingAttachment*)self)->getColor(); + ClippingAttachment *_self = (ClippingAttachment *) self; + return (spine_color) &_self->getColor(); } spine_attachment spine_clipping_attachment_copy(spine_clipping_attachment self) { - return (spine_attachment)((ClippingAttachment*)self)->copy(); + ClippingAttachment *_self = (ClippingAttachment *) self; + return (spine_attachment) _self->copy(); } -void spine_clipping_attachment_compute_world_vertices_1(spine_clipping_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, float * worldVertices, size_t offset, size_t stride) { - ((VertexAttachment*)(ClippingAttachment*)self)->computeWorldVertices(*((Skeleton*)skeleton), *((Slot*)slot), start, count, worldVertices, offset, stride); +void spine_clipping_attachment_compute_world_vertices_1(spine_clipping_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, + size_t count, float *worldVertices, size_t offset, size_t stride) { + VertexAttachment *_self = (VertexAttachment *) (ClippingAttachment *) self; + _self->computeWorldVertices(*((Skeleton *) skeleton), *((Slot *) slot), start, count, worldVertices, offset, stride); } -void spine_clipping_attachment_compute_world_vertices_2(spine_clipping_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, spine_array_float worldVertices, size_t offset, size_t stride) { - ((VertexAttachment*)(ClippingAttachment*)self)->computeWorldVertices(*((Skeleton*)skeleton), *((Slot*)slot), start, count, *((Array*)worldVertices), offset, stride); +void spine_clipping_attachment_compute_world_vertices_2(spine_clipping_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, + size_t count, spine_array_float worldVertices, size_t offset, size_t stride) { + VertexAttachment *_self = (VertexAttachment *) (ClippingAttachment *) self; + _self->computeWorldVertices(*((Skeleton *) skeleton), *((Slot *) slot), start, count, *((Array *) worldVertices), offset, stride); } int spine_clipping_attachment_get_id(spine_clipping_attachment self) { - return ((VertexAttachment*)(ClippingAttachment*)self)->getId(); + VertexAttachment *_self = (VertexAttachment *) (ClippingAttachment *) self; + return _self->getId(); } spine_array_int spine_clipping_attachment_get_bones(spine_clipping_attachment self) { - return (spine_array_int)&((VertexAttachment*)(ClippingAttachment*)self)->getBones(); + VertexAttachment *_self = (VertexAttachment *) (ClippingAttachment *) self; + return (spine_array_int) &_self->getBones(); } void spine_clipping_attachment_set_bones(spine_clipping_attachment self, spine_array_int bones) { - ((VertexAttachment*)(ClippingAttachment*)self)->setBones(*((Array*)bones)); + VertexAttachment *_self = (VertexAttachment *) (ClippingAttachment *) self; + _self->setBones(*((Array *) bones)); } spine_array_float spine_clipping_attachment_get_vertices(spine_clipping_attachment self) { - return (spine_array_float)&((VertexAttachment*)(ClippingAttachment*)self)->getVertices(); + VertexAttachment *_self = (VertexAttachment *) (ClippingAttachment *) self; + return (spine_array_float) &_self->getVertices(); } void spine_clipping_attachment_set_vertices(spine_clipping_attachment self, spine_array_float vertices) { - ((VertexAttachment*)(ClippingAttachment*)self)->setVertices(*((Array*)vertices)); + VertexAttachment *_self = (VertexAttachment *) (ClippingAttachment *) self; + _self->setVertices(*((Array *) vertices)); } size_t spine_clipping_attachment_get_world_vertices_length(spine_clipping_attachment self) { - return ((VertexAttachment*)(ClippingAttachment*)self)->getWorldVerticesLength(); + VertexAttachment *_self = (VertexAttachment *) (ClippingAttachment *) self; + return _self->getWorldVerticesLength(); } void spine_clipping_attachment_set_world_vertices_length(spine_clipping_attachment self, size_t inValue) { - ((VertexAttachment*)(ClippingAttachment*)self)->setWorldVerticesLength(inValue); + VertexAttachment *_self = (VertexAttachment *) (ClippingAttachment *) self; + _self->setWorldVerticesLength(inValue); } spine_attachment spine_clipping_attachment_get_timeline_attachment(spine_clipping_attachment self) { - return (spine_attachment)((VertexAttachment*)(ClippingAttachment*)self)->getTimelineAttachment(); + VertexAttachment *_self = (VertexAttachment *) (ClippingAttachment *) self; + return (spine_attachment) _self->getTimelineAttachment(); } void spine_clipping_attachment_set_timeline_attachment(spine_clipping_attachment self, spine_attachment attachment) { - ((VertexAttachment*)(ClippingAttachment*)self)->setTimelineAttachment((Attachment *)attachment); + VertexAttachment *_self = (VertexAttachment *) (ClippingAttachment *) self; + _self->setTimelineAttachment((Attachment *) attachment); } void spine_clipping_attachment_copy_to(spine_clipping_attachment self, spine_vertex_attachment other) { - ((VertexAttachment*)(ClippingAttachment*)self)->copyTo((VertexAttachment *)other); + VertexAttachment *_self = (VertexAttachment *) (ClippingAttachment *) self; + _self->copyTo((VertexAttachment *) other); } -const char * spine_clipping_attachment_get_name(spine_clipping_attachment self) { - return ((VertexAttachment*)(ClippingAttachment*)self)->getName().buffer(); +const char *spine_clipping_attachment_get_name(spine_clipping_attachment self) { + VertexAttachment *_self = (VertexAttachment *) (ClippingAttachment *) self; + return _self->getName().buffer(); } int spine_clipping_attachment_get_ref_count(spine_clipping_attachment self) { - return ((VertexAttachment*)(ClippingAttachment*)self)->getRefCount(); + VertexAttachment *_self = (VertexAttachment *) (ClippingAttachment *) self; + return _self->getRefCount(); } void spine_clipping_attachment_reference(spine_clipping_attachment self) { - ((VertexAttachment*)(ClippingAttachment*)self)->reference(); + VertexAttachment *_self = (VertexAttachment *) (ClippingAttachment *) self; + _self->reference(); } void spine_clipping_attachment_dereference(spine_clipping_attachment self) { - ((VertexAttachment*)(ClippingAttachment*)self)->dereference(); + VertexAttachment *_self = (VertexAttachment *) (ClippingAttachment *) self; + _self->dereference(); } spine_rtti spine_clipping_attachment_rtti(void) { - return (spine_rtti)&ClippingAttachment::rtti; + return (spine_rtti) &ClippingAttachment::rtti; } diff --git a/spine-c/src/generated/clipping_attachment.h b/spine-c/src/generated/clipping_attachment.h index bf618e69e..f1f9932e3 100644 --- a/spine-c/src/generated/clipping_attachment.h +++ b/spine-c/src/generated/clipping_attachment.h @@ -8,7 +8,7 @@ extern "C" { #endif -SPINE_C_API spine_clipping_attachment spine_clipping_attachment_create(const char * name); +SPINE_C_API spine_clipping_attachment spine_clipping_attachment_create(const char *name); SPINE_C_API void spine_clipping_attachment_dispose(spine_clipping_attachment self); @@ -17,8 +17,11 @@ SPINE_C_API spine_slot_data spine_clipping_attachment_get_end_slot(spine_clippin SPINE_C_API void spine_clipping_attachment_set_end_slot(spine_clipping_attachment self, spine_slot_data inValue); SPINE_C_API spine_color spine_clipping_attachment_get_color(spine_clipping_attachment self); SPINE_C_API spine_attachment spine_clipping_attachment_copy(spine_clipping_attachment self); -SPINE_C_API void spine_clipping_attachment_compute_world_vertices_1(spine_clipping_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, float * worldVertices, size_t offset, size_t stride); -SPINE_C_API void spine_clipping_attachment_compute_world_vertices_2(spine_clipping_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, spine_array_float worldVertices, size_t offset, size_t stride); +SPINE_C_API void spine_clipping_attachment_compute_world_vertices_1(spine_clipping_attachment self, spine_skeleton skeleton, spine_slot slot, + size_t start, size_t count, float *worldVertices, size_t offset, size_t stride); +SPINE_C_API void spine_clipping_attachment_compute_world_vertices_2(spine_clipping_attachment self, spine_skeleton skeleton, spine_slot slot, + size_t start, size_t count, spine_array_float worldVertices, size_t offset, + size_t stride); SPINE_C_API int spine_clipping_attachment_get_id(spine_clipping_attachment self); SPINE_C_API spine_array_int spine_clipping_attachment_get_bones(spine_clipping_attachment self); SPINE_C_API void spine_clipping_attachment_set_bones(spine_clipping_attachment self, spine_array_int bones); @@ -29,7 +32,7 @@ SPINE_C_API void spine_clipping_attachment_set_world_vertices_length(spine_clipp SPINE_C_API spine_attachment spine_clipping_attachment_get_timeline_attachment(spine_clipping_attachment self); SPINE_C_API void spine_clipping_attachment_set_timeline_attachment(spine_clipping_attachment self, spine_attachment attachment); SPINE_C_API void spine_clipping_attachment_copy_to(spine_clipping_attachment self, spine_vertex_attachment other); -SPINE_C_API const char * spine_clipping_attachment_get_name(spine_clipping_attachment self); +SPINE_C_API const char *spine_clipping_attachment_get_name(spine_clipping_attachment self); SPINE_C_API int spine_clipping_attachment_get_ref_count(spine_clipping_attachment self); SPINE_C_API void spine_clipping_attachment_reference(spine_clipping_attachment self); SPINE_C_API void spine_clipping_attachment_dereference(spine_clipping_attachment self); diff --git a/spine-c/src/generated/color.cpp b/spine-c/src/generated/color.cpp index 05991c520..ea1c4a503 100644 --- a/spine-c/src/generated/color.cpp +++ b/spine-c/src/generated/color.cpp @@ -4,85 +4,100 @@ using namespace spine; spine_color spine_color_create(void) { - return (spine_color) new (__FILE__, __LINE__) Color(); + return (spine_color) new (__FILE__, __LINE__) Color(); } spine_color spine_color_create2(float r, float g, float b, float a) { - return (spine_color) new (__FILE__, __LINE__) Color(r, g, b, a); + return (spine_color) new (__FILE__, __LINE__) Color(r, g, b, a); } void spine_color_dispose(spine_color self) { - delete (Color*)self; + delete (Color *) self; } spine_color spine_color_set_1(spine_color self, float _r, float _g, float _b, float _a) { - return (spine_color)&((Color*)self)->set(_r, _g, _b, _a); + Color *_self = (Color *) self; + return (spine_color) &_self->set(_r, _g, _b, _a); } spine_color spine_color_set_2(spine_color self, float _r, float _g, float _b) { - return (spine_color)&((Color*)self)->set(_r, _g, _b); + Color *_self = (Color *) self; + return (spine_color) &_self->set(_r, _g, _b); } spine_color spine_color_set_3(spine_color self, spine_color other) { - return (spine_color)&((Color*)self)->set(*((const Color*)other)); + Color *_self = (Color *) self; + return (spine_color) &_self->set(*((const Color *) other)); } spine_color spine_color_add_1(spine_color self, float _r, float _g, float _b, float _a) { - return (spine_color)&((Color*)self)->add(_r, _g, _b, _a); + Color *_self = (Color *) self; + return (spine_color) &_self->add(_r, _g, _b, _a); } spine_color spine_color_add_2(spine_color self, float _r, float _g, float _b) { - return (spine_color)&((Color*)self)->add(_r, _g, _b); + Color *_self = (Color *) self; + return (spine_color) &_self->add(_r, _g, _b); } spine_color spine_color_add_3(spine_color self, spine_color other) { - return (spine_color)&((Color*)self)->add(*((const Color*)other)); + Color *_self = (Color *) self; + return (spine_color) &_self->add(*((const Color *) other)); } spine_color spine_color_clamp(spine_color self) { - return (spine_color)&((Color*)self)->clamp(); + Color *_self = (Color *) self; + return (spine_color) &_self->clamp(); } -float spine_color_parse_hex(const char * value, size_t index) { - return Color::parseHex(value, index); +float spine_color_parse_hex(const char *value, size_t index) { + return Color::parseHex(value, index); } void spine_color_rgba8888_to_color(spine_color color, int value) { - Color::rgba8888ToColor(*((Color*)color), value); + Color::rgba8888ToColor(*((Color *) color), value); } void spine_color_rgb888_to_color(spine_color color, int value) { - Color::rgb888ToColor(*((Color*)color), value); + Color::rgb888ToColor(*((Color *) color), value); } float spine_color_get_r(spine_color self) { - return ((Color*)self)->r; + Color *_self = (Color *) self; + return _self->r; } void spine_color_set_r(spine_color self, float value) { - ((Color*)self)->r = value; + Color *_self = (Color *) self; + _self->r = value; } float spine_color_get_g(spine_color self) { - return ((Color*)self)->g; + Color *_self = (Color *) self; + return _self->g; } void spine_color_set_g(spine_color self, float value) { - ((Color*)self)->g = value; + Color *_self = (Color *) self; + _self->g = value; } float spine_color_get_b(spine_color self) { - return ((Color*)self)->b; + Color *_self = (Color *) self; + return _self->b; } void spine_color_set_b(spine_color self, float value) { - ((Color*)self)->b = value; + Color *_self = (Color *) self; + _self->b = value; } float spine_color_get_a(spine_color self) { - return ((Color*)self)->a; + Color *_self = (Color *) self; + return _self->a; } void spine_color_set_a(spine_color self, float value) { - ((Color*)self)->a = value; + Color *_self = (Color *) self; + _self->a = value; } diff --git a/spine-c/src/generated/color.h b/spine-c/src/generated/color.h index 40d4b2773..275d6332e 100644 --- a/spine-c/src/generated/color.h +++ b/spine-c/src/generated/color.h @@ -20,7 +20,7 @@ SPINE_C_API spine_color spine_color_add_1(spine_color self, float _r, float _g, SPINE_C_API spine_color spine_color_add_2(spine_color self, float _r, float _g, float _b); SPINE_C_API spine_color spine_color_add_3(spine_color self, spine_color other); SPINE_C_API spine_color spine_color_clamp(spine_color self); -SPINE_C_API float spine_color_parse_hex(const char * value, size_t index); +SPINE_C_API float spine_color_parse_hex(const char *value, size_t index); SPINE_C_API void spine_color_rgba8888_to_color(spine_color color, int value); SPINE_C_API void spine_color_rgb888_to_color(spine_color color, int value); SPINE_C_API float spine_color_get_r(spine_color self); diff --git a/spine-c/src/generated/constraint.cpp b/spine-c/src/generated/constraint.cpp index 0590b0603..7ed28e9f9 100644 --- a/spine-c/src/generated/constraint.cpp +++ b/spine-c/src/generated/constraint.cpp @@ -4,29 +4,34 @@ using namespace spine; void spine_constraint_dispose(spine_constraint self) { - delete (Constraint*)self; + delete (Constraint *) self; } spine_rtti spine_constraint_get_rtti(spine_constraint self) { - return (spine_rtti)&((Constraint*)self)->getRTTI(); + Constraint *_self = (Constraint *) self; + return (spine_rtti) &_self->getRTTI(); } spine_constraint_data spine_constraint_get_data(spine_constraint self) { - return (spine_constraint_data)&((Constraint*)self)->getData(); + Constraint *_self = (Constraint *) self; + return (spine_constraint_data) &_self->getData(); } void spine_constraint_sort(spine_constraint self, spine_skeleton skeleton) { - ((Constraint*)self)->sort(*((Skeleton*)skeleton)); + Constraint *_self = (Constraint *) self; + _self->sort(*((Skeleton *) skeleton)); } bool spine_constraint_is_source_active(spine_constraint self) { - return ((Constraint*)self)->isSourceActive(); + Constraint *_self = (Constraint *) self; + return _self->isSourceActive(); } void spine_constraint_update(spine_constraint self, spine_skeleton skeleton, spine_physics physics) { - ((Constraint*)self)->update(*((Skeleton*)skeleton), (Physics)physics); + Constraint *_self = (Constraint *) self; + _self->update(*((Skeleton *) skeleton), (Physics) physics); } spine_rtti spine_constraint_rtti(void) { - return (spine_rtti)&Constraint::rtti; + return (spine_rtti) &Constraint::rtti; } diff --git a/spine-c/src/generated/constraint_data.cpp b/spine-c/src/generated/constraint_data.cpp index 9d5dd56a0..6c8eb1900 100644 --- a/spine-c/src/generated/constraint_data.cpp +++ b/spine-c/src/generated/constraint_data.cpp @@ -4,25 +4,29 @@ using namespace spine; void spine_constraint_data_dispose(spine_constraint_data self) { - delete (ConstraintData*)self; + delete (ConstraintData *) self; } spine_rtti spine_constraint_data_get_rtti(spine_constraint_data self) { - return (spine_rtti)&((ConstraintData*)self)->getRTTI(); + ConstraintData *_self = (ConstraintData *) self; + return (spine_rtti) &_self->getRTTI(); } spine_constraint spine_constraint_data_create_method(spine_constraint_data self, spine_skeleton skeleton) { - return (spine_constraint)((ConstraintData*)self)->create(*((Skeleton*)skeleton)); + ConstraintData *_self = (ConstraintData *) self; + return (spine_constraint) _self->create(*((Skeleton *) skeleton)); } -const char * spine_constraint_data_get_name(spine_constraint_data self) { - return ((ConstraintData*)self)->getName().buffer(); +const char *spine_constraint_data_get_name(spine_constraint_data self) { + ConstraintData *_self = (ConstraintData *) self; + return _self->getName().buffer(); } bool spine_constraint_data_get_skin_required(spine_constraint_data self) { - return ((ConstraintData*)self)->getSkinRequired(); + ConstraintData *_self = (ConstraintData *) self; + return _self->getSkinRequired(); } spine_rtti spine_constraint_data_rtti(void) { - return (spine_rtti)&ConstraintData::rtti; + return (spine_rtti) &ConstraintData::rtti; } diff --git a/spine-c/src/generated/constraint_data.h b/spine-c/src/generated/constraint_data.h index 63b81f272..1fd6cae0c 100644 --- a/spine-c/src/generated/constraint_data.h +++ b/spine-c/src/generated/constraint_data.h @@ -12,7 +12,7 @@ SPINE_C_API void spine_constraint_data_dispose(spine_constraint_data self); SPINE_C_API spine_rtti spine_constraint_data_get_rtti(spine_constraint_data self); SPINE_C_API spine_constraint spine_constraint_data_create_method(spine_constraint_data self, spine_skeleton skeleton); -SPINE_C_API const char * spine_constraint_data_get_name(spine_constraint_data self); +SPINE_C_API const char *spine_constraint_data_get_name(spine_constraint_data self); SPINE_C_API bool spine_constraint_data_get_skin_required(spine_constraint_data self); SPINE_C_API spine_rtti spine_constraint_data_rtti(void); diff --git a/spine-c/src/generated/constraint_timeline.cpp b/spine-c/src/generated/constraint_timeline.cpp index 0b2dcb0f4..39b9f6dc5 100644 --- a/spine-c/src/generated/constraint_timeline.cpp +++ b/spine-c/src/generated/constraint_timeline.cpp @@ -4,21 +4,24 @@ using namespace spine; void spine_constraint_timeline_dispose(spine_constraint_timeline self) { - delete (ConstraintTimeline*)self; + delete (ConstraintTimeline *) self; } spine_rtti spine_constraint_timeline_get_rtti(spine_constraint_timeline self) { - return (spine_rtti)&((ConstraintTimeline*)self)->getRTTI(); + ConstraintTimeline *_self = (ConstraintTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } int spine_constraint_timeline_get_constraint_index(spine_constraint_timeline self) { - return ((ConstraintTimeline*)self)->getConstraintIndex(); + ConstraintTimeline *_self = (ConstraintTimeline *) self; + return _self->getConstraintIndex(); } void spine_constraint_timeline_set_constraint_index(spine_constraint_timeline self, int inValue) { - ((ConstraintTimeline*)self)->setConstraintIndex(inValue); + ConstraintTimeline *_self = (ConstraintTimeline *) self; + _self->setConstraintIndex(inValue); } spine_rtti spine_constraint_timeline_rtti(void) { - return (spine_rtti)&ConstraintTimeline::rtti; + return (spine_rtti) &ConstraintTimeline::rtti; } diff --git a/spine-c/src/generated/constraint_timeline1.cpp b/spine-c/src/generated/constraint_timeline1.cpp index d1e0158dc..0c09a4de0 100644 --- a/spine-c/src/generated/constraint_timeline1.cpp +++ b/spine-c/src/generated/constraint_timeline1.cpp @@ -4,89 +4,116 @@ using namespace spine; void spine_constraint_timeline1_dispose(spine_constraint_timeline1 self) { - delete (ConstraintTimeline1*)self; + delete (ConstraintTimeline1 *) self; } spine_rtti spine_constraint_timeline1_get_rtti(spine_constraint_timeline1 self) { - return (spine_rtti)&((ConstraintTimeline1*)self)->getRTTI(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) self; + return (spine_rtti) &_self->getRTTI(); } void spine_constraint_timeline1_set_frame(spine_constraint_timeline1 self, size_t frame, float time, float value) { - ((CurveTimeline1*)(ConstraintTimeline1*)self)->setFrame(frame, time, value); + CurveTimeline1 *_self = (CurveTimeline1 *) (ConstraintTimeline1 *) self; + _self->setFrame(frame, time, value); } float spine_constraint_timeline1_get_curve_value(spine_constraint_timeline1 self, float time) { - return ((CurveTimeline1*)(ConstraintTimeline1*)self)->getCurveValue(time); + CurveTimeline1 *_self = (CurveTimeline1 *) (ConstraintTimeline1 *) self; + return _self->getCurveValue(time); } -float spine_constraint_timeline1_get_relative_value(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((CurveTimeline1*)(ConstraintTimeline1*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_constraint_timeline1_get_relative_value(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + CurveTimeline1 *_self = (CurveTimeline1 *) (ConstraintTimeline1 *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_constraint_timeline1_get_absolute_value_1(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((CurveTimeline1*)(ConstraintTimeline1*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_constraint_timeline1_get_absolute_value_1(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + CurveTimeline1 *_self = (CurveTimeline1 *) (ConstraintTimeline1 *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_constraint_timeline1_get_absolute_value_2(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((CurveTimeline1*)(ConstraintTimeline1*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_constraint_timeline1_get_absolute_value_2(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, + float setup, float value) { + CurveTimeline1 *_self = (CurveTimeline1 *) (ConstraintTimeline1 *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_constraint_timeline1_get_scale_value(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((CurveTimeline1*)(ConstraintTimeline1*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_constraint_timeline1_get_scale_value(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup) { + CurveTimeline1 *_self = (CurveTimeline1 *) (ConstraintTimeline1 *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_constraint_timeline1_set_linear(spine_constraint_timeline1 self, size_t frame) { - ((CurveTimeline1*)(ConstraintTimeline1*)self)->setLinear(frame); + CurveTimeline1 *_self = (CurveTimeline1 *) (ConstraintTimeline1 *) self; + _self->setLinear(frame); } void spine_constraint_timeline1_set_stepped(spine_constraint_timeline1 self, size_t frame) { - ((CurveTimeline1*)(ConstraintTimeline1*)self)->setStepped(frame); + CurveTimeline1 *_self = (CurveTimeline1 *) (ConstraintTimeline1 *) self; + _self->setStepped(frame); } -void spine_constraint_timeline1_set_bezier(spine_constraint_timeline1 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((CurveTimeline1*)(ConstraintTimeline1*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_constraint_timeline1_set_bezier(spine_constraint_timeline1 self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2) { + CurveTimeline1 *_self = (CurveTimeline1 *) (ConstraintTimeline1 *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_constraint_timeline1_get_bezier_value(spine_constraint_timeline1 self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((CurveTimeline1*)(ConstraintTimeline1*)self)->getBezierValue(time, frame, valueOffset, i); + CurveTimeline1 *_self = (CurveTimeline1 *) (ConstraintTimeline1 *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_constraint_timeline1_get_curves(spine_constraint_timeline1 self) { - return (spine_array_float)&((CurveTimeline1*)(ConstraintTimeline1*)self)->getCurves(); + CurveTimeline1 *_self = (CurveTimeline1 *) (ConstraintTimeline1 *) self; + return (spine_array_float) &_self->getCurves(); } -void spine_constraint_timeline1_apply(spine_constraint_timeline1 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((CurveTimeline1*)(ConstraintTimeline1*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_constraint_timeline1_apply(spine_constraint_timeline1 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + CurveTimeline1 *_self = (CurveTimeline1 *) (ConstraintTimeline1 *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } size_t spine_constraint_timeline1_get_frame_entries(spine_constraint_timeline1 self) { - return ((CurveTimeline1*)(ConstraintTimeline1*)self)->getFrameEntries(); + CurveTimeline1 *_self = (CurveTimeline1 *) (ConstraintTimeline1 *) self; + return _self->getFrameEntries(); } size_t spine_constraint_timeline1_get_frame_count(spine_constraint_timeline1 self) { - return ((CurveTimeline1*)(ConstraintTimeline1*)self)->getFrameCount(); + CurveTimeline1 *_self = (CurveTimeline1 *) (ConstraintTimeline1 *) self; + return _self->getFrameCount(); } spine_array_float spine_constraint_timeline1_get_frames(spine_constraint_timeline1 self) { - return (spine_array_float)&((CurveTimeline1*)(ConstraintTimeline1*)self)->getFrames(); + CurveTimeline1 *_self = (CurveTimeline1 *) (ConstraintTimeline1 *) self; + return (spine_array_float) &_self->getFrames(); } float spine_constraint_timeline1_get_duration(spine_constraint_timeline1 self) { - return ((CurveTimeline1*)(ConstraintTimeline1*)self)->getDuration(); + CurveTimeline1 *_self = (CurveTimeline1 *) (ConstraintTimeline1 *) self; + return _self->getDuration(); } spine_array_property_id spine_constraint_timeline1_get_property_ids(spine_constraint_timeline1 self) { - return (spine_array_property_id)&((CurveTimeline1*)(ConstraintTimeline1*)self)->getPropertyIds(); + CurveTimeline1 *_self = (CurveTimeline1 *) (ConstraintTimeline1 *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_constraint_timeline1_get_constraint_index(spine_constraint_timeline1 self) { - return ((ConstraintTimeline*)(ConstraintTimeline1*)self)->getConstraintIndex(); + ConstraintTimeline *_self = (ConstraintTimeline *) (ConstraintTimeline1 *) self; + return _self->getConstraintIndex(); } void spine_constraint_timeline1_set_constraint_index(spine_constraint_timeline1 self, int inValue) { - ((ConstraintTimeline*)(ConstraintTimeline1*)self)->setConstraintIndex(inValue); + ConstraintTimeline *_self = (ConstraintTimeline *) (ConstraintTimeline1 *) self; + _self->setConstraintIndex(inValue); } spine_rtti spine_constraint_timeline1_rtti(void) { - return (spine_rtti)&ConstraintTimeline1::rtti; + return (spine_rtti) &ConstraintTimeline1::rtti; } diff --git a/spine-c/src/generated/constraint_timeline1.h b/spine-c/src/generated/constraint_timeline1.h index 266be1821..68639ae9a 100644 --- a/spine-c/src/generated/constraint_timeline1.h +++ b/spine-c/src/generated/constraint_timeline1.h @@ -13,16 +13,24 @@ SPINE_C_API void spine_constraint_timeline1_dispose(spine_constraint_timeline1 s SPINE_C_API spine_rtti spine_constraint_timeline1_get_rtti(spine_constraint_timeline1 self); SPINE_C_API void spine_constraint_timeline1_set_frame(spine_constraint_timeline1 self, size_t frame, float time, float value); SPINE_C_API float spine_constraint_timeline1_get_curve_value(spine_constraint_timeline1 self, float time); -SPINE_C_API float spine_constraint_timeline1_get_relative_value(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_constraint_timeline1_get_absolute_value_1(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_constraint_timeline1_get_absolute_value_2(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_constraint_timeline1_get_scale_value(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_constraint_timeline1_get_relative_value(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, + float current, float setup); +SPINE_C_API float spine_constraint_timeline1_get_absolute_value_1(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, + float current, float setup); +SPINE_C_API float spine_constraint_timeline1_get_absolute_value_2(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, + float current, float setup, float value); +SPINE_C_API float spine_constraint_timeline1_get_scale_value(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup); SPINE_C_API void spine_constraint_timeline1_set_linear(spine_constraint_timeline1 self, size_t frame); SPINE_C_API void spine_constraint_timeline1_set_stepped(spine_constraint_timeline1 self, size_t frame); -SPINE_C_API void spine_constraint_timeline1_set_bezier(spine_constraint_timeline1 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); -SPINE_C_API float spine_constraint_timeline1_get_bezier_value(spine_constraint_timeline1 self, float time, size_t frame, size_t valueOffset, size_t i); +SPINE_C_API void spine_constraint_timeline1_set_bezier(spine_constraint_timeline1 self, size_t bezier, size_t frame, float value, float time1, + float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API float spine_constraint_timeline1_get_bezier_value(spine_constraint_timeline1 self, float time, size_t frame, size_t valueOffset, + size_t i); SPINE_C_API spine_array_float spine_constraint_timeline1_get_curves(spine_constraint_timeline1 self); -SPINE_C_API void spine_constraint_timeline1_apply(spine_constraint_timeline1 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_constraint_timeline1_apply(spine_constraint_timeline1 self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); SPINE_C_API size_t spine_constraint_timeline1_get_frame_entries(spine_constraint_timeline1 self); SPINE_C_API size_t spine_constraint_timeline1_get_frame_count(spine_constraint_timeline1 self); SPINE_C_API spine_array_float spine_constraint_timeline1_get_frames(spine_constraint_timeline1 self); diff --git a/spine-c/src/generated/curve_timeline.cpp b/spine-c/src/generated/curve_timeline.cpp index 05f049040..bbcb0dfe8 100644 --- a/spine-c/src/generated/curve_timeline.cpp +++ b/spine-c/src/generated/curve_timeline.cpp @@ -4,57 +4,72 @@ using namespace spine; void spine_curve_timeline_dispose(spine_curve_timeline self) { - delete (CurveTimeline*)self; + delete (CurveTimeline *) self; } spine_rtti spine_curve_timeline_get_rtti(spine_curve_timeline self) { - return (spine_rtti)&((CurveTimeline*)self)->getRTTI(); + CurveTimeline *_self = (CurveTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } void spine_curve_timeline_set_linear(spine_curve_timeline self, size_t frame) { - ((CurveTimeline*)self)->setLinear(frame); + CurveTimeline *_self = (CurveTimeline *) self; + _self->setLinear(frame); } void spine_curve_timeline_set_stepped(spine_curve_timeline self, size_t frame) { - ((CurveTimeline*)self)->setStepped(frame); + CurveTimeline *_self = (CurveTimeline *) self; + _self->setStepped(frame); } -void spine_curve_timeline_set_bezier(spine_curve_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((CurveTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_curve_timeline_set_bezier(spine_curve_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, + float cy1, float cx2, float cy2, float time2, float value2) { + CurveTimeline *_self = (CurveTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_curve_timeline_get_bezier_value(spine_curve_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((CurveTimeline*)self)->getBezierValue(time, frame, valueOffset, i); + CurveTimeline *_self = (CurveTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_curve_timeline_get_curves(spine_curve_timeline self) { - return (spine_array_float)&((CurveTimeline*)self)->getCurves(); + CurveTimeline *_self = (CurveTimeline *) self; + return (spine_array_float) &_self->getCurves(); } -void spine_curve_timeline_apply(spine_curve_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((Timeline*)(CurveTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_curve_timeline_apply(spine_curve_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + Timeline *_self = (Timeline *) (CurveTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } size_t spine_curve_timeline_get_frame_entries(spine_curve_timeline self) { - return ((Timeline*)(CurveTimeline*)self)->getFrameEntries(); + Timeline *_self = (Timeline *) (CurveTimeline *) self; + return _self->getFrameEntries(); } size_t spine_curve_timeline_get_frame_count(spine_curve_timeline self) { - return ((Timeline*)(CurveTimeline*)self)->getFrameCount(); + Timeline *_self = (Timeline *) (CurveTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_curve_timeline_get_frames(spine_curve_timeline self) { - return (spine_array_float)&((Timeline*)(CurveTimeline*)self)->getFrames(); + Timeline *_self = (Timeline *) (CurveTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_curve_timeline_get_duration(spine_curve_timeline self) { - return ((Timeline*)(CurveTimeline*)self)->getDuration(); + Timeline *_self = (Timeline *) (CurveTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_curve_timeline_get_property_ids(spine_curve_timeline self) { - return (spine_array_property_id)&((Timeline*)(CurveTimeline*)self)->getPropertyIds(); + Timeline *_self = (Timeline *) (CurveTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } spine_rtti spine_curve_timeline_rtti(void) { - return (spine_rtti)&CurveTimeline::rtti; + return (spine_rtti) &CurveTimeline::rtti; } diff --git a/spine-c/src/generated/curve_timeline.h b/spine-c/src/generated/curve_timeline.h index 9b758991a..1200009c3 100644 --- a/spine-c/src/generated/curve_timeline.h +++ b/spine-c/src/generated/curve_timeline.h @@ -13,10 +13,12 @@ SPINE_C_API void spine_curve_timeline_dispose(spine_curve_timeline self); SPINE_C_API spine_rtti spine_curve_timeline_get_rtti(spine_curve_timeline self); SPINE_C_API void spine_curve_timeline_set_linear(spine_curve_timeline self, size_t frame); SPINE_C_API void spine_curve_timeline_set_stepped(spine_curve_timeline self, size_t frame); -SPINE_C_API void spine_curve_timeline_set_bezier(spine_curve_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_curve_timeline_set_bezier(spine_curve_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_curve_timeline_get_bezier_value(spine_curve_timeline self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_curve_timeline_get_curves(spine_curve_timeline self); -SPINE_C_API void spine_curve_timeline_apply(spine_curve_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_curve_timeline_apply(spine_curve_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); SPINE_C_API size_t spine_curve_timeline_get_frame_entries(spine_curve_timeline self); SPINE_C_API size_t spine_curve_timeline_get_frame_count(spine_curve_timeline self); SPINE_C_API spine_array_float spine_curve_timeline_get_frames(spine_curve_timeline self); diff --git a/spine-c/src/generated/curve_timeline1.cpp b/spine-c/src/generated/curve_timeline1.cpp index ac6f10b4a..38bbd480f 100644 --- a/spine-c/src/generated/curve_timeline1.cpp +++ b/spine-c/src/generated/curve_timeline1.cpp @@ -4,81 +4,106 @@ using namespace spine; void spine_curve_timeline1_dispose(spine_curve_timeline1 self) { - delete (CurveTimeline1*)self; + delete (CurveTimeline1 *) self; } spine_rtti spine_curve_timeline1_get_rtti(spine_curve_timeline1 self) { - return (spine_rtti)&((CurveTimeline1*)self)->getRTTI(); + CurveTimeline1 *_self = (CurveTimeline1 *) self; + return (spine_rtti) &_self->getRTTI(); } void spine_curve_timeline1_set_frame(spine_curve_timeline1 self, size_t frame, float time, float value) { - ((CurveTimeline1*)self)->setFrame(frame, time, value); + CurveTimeline1 *_self = (CurveTimeline1 *) self; + _self->setFrame(frame, time, value); } float spine_curve_timeline1_get_curve_value(spine_curve_timeline1 self, float time) { - return ((CurveTimeline1*)self)->getCurveValue(time); + CurveTimeline1 *_self = (CurveTimeline1 *) self; + return _self->getCurveValue(time); } -float spine_curve_timeline1_get_relative_value(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((CurveTimeline1*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_curve_timeline1_get_relative_value(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + CurveTimeline1 *_self = (CurveTimeline1 *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_curve_timeline1_get_absolute_value_1(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((CurveTimeline1*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_curve_timeline1_get_absolute_value_1(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + CurveTimeline1 *_self = (CurveTimeline1 *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_curve_timeline1_get_absolute_value_2(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((CurveTimeline1*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_curve_timeline1_get_absolute_value_2(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, + float setup, float value) { + CurveTimeline1 *_self = (CurveTimeline1 *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_curve_timeline1_get_scale_value(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((CurveTimeline1*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_curve_timeline1_get_scale_value(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, + float current, float setup) { + CurveTimeline1 *_self = (CurveTimeline1 *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_curve_timeline1_set_linear(spine_curve_timeline1 self, size_t frame) { - ((CurveTimeline*)(CurveTimeline1*)self)->setLinear(frame); + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline1 *) self; + _self->setLinear(frame); } void spine_curve_timeline1_set_stepped(spine_curve_timeline1 self, size_t frame) { - ((CurveTimeline*)(CurveTimeline1*)self)->setStepped(frame); + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline1 *) self; + _self->setStepped(frame); } -void spine_curve_timeline1_set_bezier(spine_curve_timeline1 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((CurveTimeline*)(CurveTimeline1*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_curve_timeline1_set_bezier(spine_curve_timeline1 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, + float cy1, float cx2, float cy2, float time2, float value2) { + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline1 *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_curve_timeline1_get_bezier_value(spine_curve_timeline1 self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((CurveTimeline*)(CurveTimeline1*)self)->getBezierValue(time, frame, valueOffset, i); + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline1 *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_curve_timeline1_get_curves(spine_curve_timeline1 self) { - return (spine_array_float)&((CurveTimeline*)(CurveTimeline1*)self)->getCurves(); + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline1 *) self; + return (spine_array_float) &_self->getCurves(); } -void spine_curve_timeline1_apply(spine_curve_timeline1 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((CurveTimeline*)(CurveTimeline1*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_curve_timeline1_apply(spine_curve_timeline1 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline1 *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } size_t spine_curve_timeline1_get_frame_entries(spine_curve_timeline1 self) { - return ((CurveTimeline*)(CurveTimeline1*)self)->getFrameEntries(); + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline1 *) self; + return _self->getFrameEntries(); } size_t spine_curve_timeline1_get_frame_count(spine_curve_timeline1 self) { - return ((CurveTimeline*)(CurveTimeline1*)self)->getFrameCount(); + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline1 *) self; + return _self->getFrameCount(); } spine_array_float spine_curve_timeline1_get_frames(spine_curve_timeline1 self) { - return (spine_array_float)&((CurveTimeline*)(CurveTimeline1*)self)->getFrames(); + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline1 *) self; + return (spine_array_float) &_self->getFrames(); } float spine_curve_timeline1_get_duration(spine_curve_timeline1 self) { - return ((CurveTimeline*)(CurveTimeline1*)self)->getDuration(); + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline1 *) self; + return _self->getDuration(); } spine_array_property_id spine_curve_timeline1_get_property_ids(spine_curve_timeline1 self) { - return (spine_array_property_id)&((CurveTimeline*)(CurveTimeline1*)self)->getPropertyIds(); + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline1 *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } spine_rtti spine_curve_timeline1_rtti(void) { - return (spine_rtti)&CurveTimeline1::rtti; + return (spine_rtti) &CurveTimeline1::rtti; } diff --git a/spine-c/src/generated/curve_timeline1.h b/spine-c/src/generated/curve_timeline1.h index 5fd606842..fde58dc75 100644 --- a/spine-c/src/generated/curve_timeline1.h +++ b/spine-c/src/generated/curve_timeline1.h @@ -13,16 +13,23 @@ SPINE_C_API void spine_curve_timeline1_dispose(spine_curve_timeline1 self); SPINE_C_API spine_rtti spine_curve_timeline1_get_rtti(spine_curve_timeline1 self); SPINE_C_API void spine_curve_timeline1_set_frame(spine_curve_timeline1 self, size_t frame, float time, float value); SPINE_C_API float spine_curve_timeline1_get_curve_value(spine_curve_timeline1 self, float time); -SPINE_C_API float spine_curve_timeline1_get_relative_value(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_curve_timeline1_get_absolute_value_1(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_curve_timeline1_get_absolute_value_2(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_curve_timeline1_get_scale_value(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_curve_timeline1_get_relative_value(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, + float setup); +SPINE_C_API float spine_curve_timeline1_get_absolute_value_1(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, + float current, float setup); +SPINE_C_API float spine_curve_timeline1_get_absolute_value_2(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, + float current, float setup, float value); +SPINE_C_API float spine_curve_timeline1_get_scale_value(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup); SPINE_C_API void spine_curve_timeline1_set_linear(spine_curve_timeline1 self, size_t frame); SPINE_C_API void spine_curve_timeline1_set_stepped(spine_curve_timeline1 self, size_t frame); -SPINE_C_API void spine_curve_timeline1_set_bezier(spine_curve_timeline1 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_curve_timeline1_set_bezier(spine_curve_timeline1 self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_curve_timeline1_get_bezier_value(spine_curve_timeline1 self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_curve_timeline1_get_curves(spine_curve_timeline1 self); -SPINE_C_API void spine_curve_timeline1_apply(spine_curve_timeline1 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_curve_timeline1_apply(spine_curve_timeline1 self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); SPINE_C_API size_t spine_curve_timeline1_get_frame_entries(spine_curve_timeline1 self); SPINE_C_API size_t spine_curve_timeline1_get_frame_count(spine_curve_timeline1 self); SPINE_C_API spine_array_float spine_curve_timeline1_get_frames(spine_curve_timeline1 self); diff --git a/spine-c/src/generated/curve_timeline2.cpp b/spine-c/src/generated/curve_timeline2.cpp index 530e5fa89..f0b587d2b 100644 --- a/spine-c/src/generated/curve_timeline2.cpp +++ b/spine-c/src/generated/curve_timeline2.cpp @@ -4,65 +4,82 @@ using namespace spine; void spine_curve_timeline2_dispose(spine_curve_timeline2 self) { - delete (CurveTimeline2*)self; + delete (CurveTimeline2 *) self; } spine_rtti spine_curve_timeline2_get_rtti(spine_curve_timeline2 self) { - return (spine_rtti)&((CurveTimeline2*)self)->getRTTI(); + CurveTimeline2 *_self = (CurveTimeline2 *) self; + return (spine_rtti) &_self->getRTTI(); } void spine_curve_timeline2_set_frame(spine_curve_timeline2 self, size_t frame, float time, float value1, float value2) { - ((CurveTimeline2*)self)->setFrame(frame, time, value1, value2); + CurveTimeline2 *_self = (CurveTimeline2 *) self; + _self->setFrame(frame, time, value1, value2); } float spine_curve_timeline2_get_curve_value(spine_curve_timeline2 self, float time) { - return ((CurveTimeline2*)self)->getCurveValue(time); + CurveTimeline2 *_self = (CurveTimeline2 *) self; + return _self->getCurveValue(time); } void spine_curve_timeline2_set_linear(spine_curve_timeline2 self, size_t frame) { - ((CurveTimeline*)(CurveTimeline2*)self)->setLinear(frame); + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline2 *) self; + _self->setLinear(frame); } void spine_curve_timeline2_set_stepped(spine_curve_timeline2 self, size_t frame) { - ((CurveTimeline*)(CurveTimeline2*)self)->setStepped(frame); + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline2 *) self; + _self->setStepped(frame); } -void spine_curve_timeline2_set_bezier(spine_curve_timeline2 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((CurveTimeline*)(CurveTimeline2*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_curve_timeline2_set_bezier(spine_curve_timeline2 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, + float cy1, float cx2, float cy2, float time2, float value2) { + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline2 *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_curve_timeline2_get_bezier_value(spine_curve_timeline2 self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((CurveTimeline*)(CurveTimeline2*)self)->getBezierValue(time, frame, valueOffset, i); + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline2 *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_curve_timeline2_get_curves(spine_curve_timeline2 self) { - return (spine_array_float)&((CurveTimeline*)(CurveTimeline2*)self)->getCurves(); + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline2 *) self; + return (spine_array_float) &_self->getCurves(); } -void spine_curve_timeline2_apply(spine_curve_timeline2 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((CurveTimeline*)(CurveTimeline2*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_curve_timeline2_apply(spine_curve_timeline2 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline2 *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } size_t spine_curve_timeline2_get_frame_entries(spine_curve_timeline2 self) { - return ((CurveTimeline*)(CurveTimeline2*)self)->getFrameEntries(); + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline2 *) self; + return _self->getFrameEntries(); } size_t spine_curve_timeline2_get_frame_count(spine_curve_timeline2 self) { - return ((CurveTimeline*)(CurveTimeline2*)self)->getFrameCount(); + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline2 *) self; + return _self->getFrameCount(); } spine_array_float spine_curve_timeline2_get_frames(spine_curve_timeline2 self) { - return (spine_array_float)&((CurveTimeline*)(CurveTimeline2*)self)->getFrames(); + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline2 *) self; + return (spine_array_float) &_self->getFrames(); } float spine_curve_timeline2_get_duration(spine_curve_timeline2 self) { - return ((CurveTimeline*)(CurveTimeline2*)self)->getDuration(); + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline2 *) self; + return _self->getDuration(); } spine_array_property_id spine_curve_timeline2_get_property_ids(spine_curve_timeline2 self) { - return (spine_array_property_id)&((CurveTimeline*)(CurveTimeline2*)self)->getPropertyIds(); + CurveTimeline *_self = (CurveTimeline *) (CurveTimeline2 *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } spine_rtti spine_curve_timeline2_rtti(void) { - return (spine_rtti)&CurveTimeline2::rtti; + return (spine_rtti) &CurveTimeline2::rtti; } diff --git a/spine-c/src/generated/curve_timeline2.h b/spine-c/src/generated/curve_timeline2.h index 9d52d24c1..ac380f9d8 100644 --- a/spine-c/src/generated/curve_timeline2.h +++ b/spine-c/src/generated/curve_timeline2.h @@ -15,10 +15,13 @@ SPINE_C_API void spine_curve_timeline2_set_frame(spine_curve_timeline2 self, siz SPINE_C_API float spine_curve_timeline2_get_curve_value(spine_curve_timeline2 self, float time); SPINE_C_API void spine_curve_timeline2_set_linear(spine_curve_timeline2 self, size_t frame); SPINE_C_API void spine_curve_timeline2_set_stepped(spine_curve_timeline2 self, size_t frame); -SPINE_C_API void spine_curve_timeline2_set_bezier(spine_curve_timeline2 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_curve_timeline2_set_bezier(spine_curve_timeline2 self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_curve_timeline2_get_bezier_value(spine_curve_timeline2 self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_curve_timeline2_get_curves(spine_curve_timeline2 self); -SPINE_C_API void spine_curve_timeline2_apply(spine_curve_timeline2 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_curve_timeline2_apply(spine_curve_timeline2 self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); SPINE_C_API size_t spine_curve_timeline2_get_frame_entries(spine_curve_timeline2 self); SPINE_C_API size_t spine_curve_timeline2_get_frame_count(spine_curve_timeline2 self); SPINE_C_API spine_array_float spine_curve_timeline2_get_frames(spine_curve_timeline2 self); diff --git a/spine-c/src/generated/deform_timeline.cpp b/spine-c/src/generated/deform_timeline.cpp index 6d292d959..0dc58a929 100644 --- a/spine-c/src/generated/deform_timeline.cpp +++ b/spine-c/src/generated/deform_timeline.cpp @@ -4,85 +4,106 @@ using namespace spine; spine_deform_timeline spine_deform_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex, spine_vertex_attachment attachment) { - return (spine_deform_timeline) new (__FILE__, __LINE__) DeformTimeline(frameCount, bezierCount, slotIndex, (VertexAttachment *)attachment); + return (spine_deform_timeline) new (__FILE__, __LINE__) DeformTimeline(frameCount, bezierCount, slotIndex, (VertexAttachment *) attachment); } void spine_deform_timeline_dispose(spine_deform_timeline self) { - delete (DeformTimeline*)self; + delete (DeformTimeline *) self; } spine_rtti spine_deform_timeline_get_rtti(spine_deform_timeline self) { - return (spine_rtti)&((DeformTimeline*)self)->getRTTI(); + DeformTimeline *_self = (DeformTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } void spine_deform_timeline_set_frame(spine_deform_timeline self, int frameIndex, float time, spine_array_float vertices) { - ((DeformTimeline*)self)->setFrame(frameIndex, time, *((Array*)vertices)); + DeformTimeline *_self = (DeformTimeline *) self; + _self->setFrame(frameIndex, time, *((Array *) vertices)); } spine_vertex_attachment spine_deform_timeline_get_attachment(spine_deform_timeline self) { - return (spine_vertex_attachment)((DeformTimeline*)self)->getAttachment(); + DeformTimeline *_self = (DeformTimeline *) self; + return (spine_vertex_attachment) _self->getAttachment(); } void spine_deform_timeline_set_attachment(spine_deform_timeline self, spine_vertex_attachment inValue) { - ((DeformTimeline*)self)->setAttachment((VertexAttachment *)inValue); + DeformTimeline *_self = (DeformTimeline *) self; + _self->setAttachment((VertexAttachment *) inValue); } -void spine_deform_timeline_set_bezier(spine_deform_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((DeformTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_deform_timeline_set_bezier(spine_deform_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, + float cy1, float cx2, float cy2, float time2, float value2) { + DeformTimeline *_self = (DeformTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_deform_timeline_get_curve_percent(spine_deform_timeline self, float time, int frame) { - return ((DeformTimeline*)self)->getCurvePercent(time, frame); + DeformTimeline *_self = (DeformTimeline *) self; + return _self->getCurvePercent(time, frame); } size_t spine_deform_timeline_get_frame_count(spine_deform_timeline self) { - return ((DeformTimeline*)self)->getFrameCount(); + DeformTimeline *_self = (DeformTimeline *) self; + return _self->getFrameCount(); } -void spine_deform_timeline_apply(spine_deform_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((SlotCurveTimeline*)(DeformTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_deform_timeline_apply(spine_deform_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + SlotCurveTimeline *_self = (SlotCurveTimeline *) (DeformTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_deform_timeline_set_linear(spine_deform_timeline self, size_t frame) { - ((SlotCurveTimeline*)(DeformTimeline*)self)->setLinear(frame); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (DeformTimeline *) self; + _self->setLinear(frame); } void spine_deform_timeline_set_stepped(spine_deform_timeline self, size_t frame) { - ((SlotCurveTimeline*)(DeformTimeline*)self)->setStepped(frame); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (DeformTimeline *) self; + _self->setStepped(frame); } float spine_deform_timeline_get_bezier_value(spine_deform_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((SlotCurveTimeline*)(DeformTimeline*)self)->getBezierValue(time, frame, valueOffset, i); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (DeformTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_deform_timeline_get_curves(spine_deform_timeline self) { - return (spine_array_float)&((SlotCurveTimeline*)(DeformTimeline*)self)->getCurves(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (DeformTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_deform_timeline_get_frame_entries(spine_deform_timeline self) { - return ((SlotCurveTimeline*)(DeformTimeline*)self)->getFrameEntries(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (DeformTimeline *) self; + return _self->getFrameEntries(); } spine_array_float spine_deform_timeline_get_frames(spine_deform_timeline self) { - return (spine_array_float)&((SlotCurveTimeline*)(DeformTimeline*)self)->getFrames(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (DeformTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_deform_timeline_get_duration(spine_deform_timeline self) { - return ((SlotCurveTimeline*)(DeformTimeline*)self)->getDuration(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (DeformTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_deform_timeline_get_property_ids(spine_deform_timeline self) { - return (spine_array_property_id)&((SlotCurveTimeline*)(DeformTimeline*)self)->getPropertyIds(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (DeformTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_deform_timeline_get_slot_index(spine_deform_timeline self) { - return ((SlotCurveTimeline*)(DeformTimeline*)self)->getSlotIndex(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (DeformTimeline *) self; + return _self->getSlotIndex(); } void spine_deform_timeline_set_slot_index(spine_deform_timeline self, int inValue) { - ((SlotCurveTimeline*)(DeformTimeline*)self)->setSlotIndex(inValue); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (DeformTimeline *) self; + _self->setSlotIndex(inValue); } spine_rtti spine_deform_timeline_rtti(void) { - return (spine_rtti)&DeformTimeline::rtti; + return (spine_rtti) &DeformTimeline::rtti; } diff --git a/spine-c/src/generated/deform_timeline.h b/spine-c/src/generated/deform_timeline.h index 7fa439fa0..1ec7daf88 100644 --- a/spine-c/src/generated/deform_timeline.h +++ b/spine-c/src/generated/deform_timeline.h @@ -8,7 +8,8 @@ extern "C" { #endif -SPINE_C_API spine_deform_timeline spine_deform_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex, spine_vertex_attachment attachment); +SPINE_C_API spine_deform_timeline spine_deform_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex, + spine_vertex_attachment attachment); SPINE_C_API void spine_deform_timeline_dispose(spine_deform_timeline self); @@ -16,10 +17,13 @@ SPINE_C_API spine_rtti spine_deform_timeline_get_rtti(spine_deform_timeline self SPINE_C_API void spine_deform_timeline_set_frame(spine_deform_timeline self, int frameIndex, float time, spine_array_float vertices); SPINE_C_API spine_vertex_attachment spine_deform_timeline_get_attachment(spine_deform_timeline self); SPINE_C_API void spine_deform_timeline_set_attachment(spine_deform_timeline self, spine_vertex_attachment inValue); -SPINE_C_API void spine_deform_timeline_set_bezier(spine_deform_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_deform_timeline_set_bezier(spine_deform_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_deform_timeline_get_curve_percent(spine_deform_timeline self, float time, int frame); SPINE_C_API size_t spine_deform_timeline_get_frame_count(spine_deform_timeline self); -SPINE_C_API void spine_deform_timeline_apply(spine_deform_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_deform_timeline_apply(spine_deform_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); SPINE_C_API void spine_deform_timeline_set_linear(spine_deform_timeline self, size_t frame); SPINE_C_API void spine_deform_timeline_set_stepped(spine_deform_timeline self, size_t frame); SPINE_C_API float spine_deform_timeline_get_bezier_value(spine_deform_timeline self, float time, size_t frame, size_t valueOffset, size_t i); diff --git a/spine-c/src/generated/draw_order_timeline.cpp b/spine-c/src/generated/draw_order_timeline.cpp index 28bb13b64..d9724d9ca 100644 --- a/spine-c/src/generated/draw_order_timeline.cpp +++ b/spine-c/src/generated/draw_order_timeline.cpp @@ -4,45 +4,55 @@ using namespace spine; spine_draw_order_timeline spine_draw_order_timeline_create(size_t frameCount) { - return (spine_draw_order_timeline) new (__FILE__, __LINE__) DrawOrderTimeline(frameCount); + return (spine_draw_order_timeline) new (__FILE__, __LINE__) DrawOrderTimeline(frameCount); } void spine_draw_order_timeline_dispose(spine_draw_order_timeline self) { - delete (DrawOrderTimeline*)self; + delete (DrawOrderTimeline *) self; } spine_rtti spine_draw_order_timeline_get_rtti(spine_draw_order_timeline self) { - return (spine_rtti)&((DrawOrderTimeline*)self)->getRTTI(); + DrawOrderTimeline *_self = (DrawOrderTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_draw_order_timeline_apply(spine_draw_order_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((DrawOrderTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_draw_order_timeline_apply(spine_draw_order_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + DrawOrderTimeline *_self = (DrawOrderTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } size_t spine_draw_order_timeline_get_frame_count(spine_draw_order_timeline self) { - return ((DrawOrderTimeline*)self)->getFrameCount(); + DrawOrderTimeline *_self = (DrawOrderTimeline *) self; + return _self->getFrameCount(); } void spine_draw_order_timeline_set_frame(spine_draw_order_timeline self, size_t frame, float time, spine_array_int drawOrder) { - ((DrawOrderTimeline*)self)->setFrame(frame, time, (Array *)drawOrder); + DrawOrderTimeline *_self = (DrawOrderTimeline *) self; + _self->setFrame(frame, time, (Array *) drawOrder); } size_t spine_draw_order_timeline_get_frame_entries(spine_draw_order_timeline self) { - return ((Timeline*)(DrawOrderTimeline*)self)->getFrameEntries(); + Timeline *_self = (Timeline *) (DrawOrderTimeline *) self; + return _self->getFrameEntries(); } spine_array_float spine_draw_order_timeline_get_frames(spine_draw_order_timeline self) { - return (spine_array_float)&((Timeline*)(DrawOrderTimeline*)self)->getFrames(); + Timeline *_self = (Timeline *) (DrawOrderTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_draw_order_timeline_get_duration(spine_draw_order_timeline self) { - return ((Timeline*)(DrawOrderTimeline*)self)->getDuration(); + Timeline *_self = (Timeline *) (DrawOrderTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_draw_order_timeline_get_property_ids(spine_draw_order_timeline self) { - return (spine_array_property_id)&((Timeline*)(DrawOrderTimeline*)self)->getPropertyIds(); + Timeline *_self = (Timeline *) (DrawOrderTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } spine_rtti spine_draw_order_timeline_rtti(void) { - return (spine_rtti)&DrawOrderTimeline::rtti; + return (spine_rtti) &DrawOrderTimeline::rtti; } diff --git a/spine-c/src/generated/draw_order_timeline.h b/spine-c/src/generated/draw_order_timeline.h index 3642d8a9b..330048462 100644 --- a/spine-c/src/generated/draw_order_timeline.h +++ b/spine-c/src/generated/draw_order_timeline.h @@ -13,7 +13,9 @@ SPINE_C_API spine_draw_order_timeline spine_draw_order_timeline_create(size_t fr SPINE_C_API void spine_draw_order_timeline_dispose(spine_draw_order_timeline self); SPINE_C_API spine_rtti spine_draw_order_timeline_get_rtti(spine_draw_order_timeline self); -SPINE_C_API void spine_draw_order_timeline_apply(spine_draw_order_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_draw_order_timeline_apply(spine_draw_order_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); SPINE_C_API size_t spine_draw_order_timeline_get_frame_count(spine_draw_order_timeline self); SPINE_C_API void spine_draw_order_timeline_set_frame(spine_draw_order_timeline self, size_t frame, float time, spine_array_int drawOrder); SPINE_C_API size_t spine_draw_order_timeline_get_frame_entries(spine_draw_order_timeline self); diff --git a/spine-c/src/generated/event.cpp b/spine-c/src/generated/event.cpp index 48d85b480..d39a470d5 100644 --- a/spine-c/src/generated/event.cpp +++ b/spine-c/src/generated/event.cpp @@ -4,57 +4,69 @@ using namespace spine; spine_event spine_event_create(float time, spine_event_data data) { - return (spine_event) new (__FILE__, __LINE__) Event(time, *((const EventData*)data)); + return (spine_event) new (__FILE__, __LINE__) Event(time, *((const EventData *) data)); } void spine_event_dispose(spine_event self) { - delete (Event*)self; + delete (Event *) self; } spine_event_data spine_event_get_data(spine_event self) { - return (spine_event_data)&((Event*)self)->getData(); + Event *_self = (Event *) self; + return (spine_event_data) &_self->getData(); } float spine_event_get_time(spine_event self) { - return ((Event*)self)->getTime(); + Event *_self = (Event *) self; + return _self->getTime(); } int spine_event_get_int(spine_event self) { - return ((Event*)self)->getInt(); + Event *_self = (Event *) self; + return _self->getInt(); } void spine_event_set_int(spine_event self, int inValue) { - ((Event*)self)->setInt(inValue); + Event *_self = (Event *) self; + _self->setInt(inValue); } float spine_event_get_float(spine_event self) { - return ((Event*)self)->getFloat(); + Event *_self = (Event *) self; + return _self->getFloat(); } void spine_event_set_float(spine_event self, float inValue) { - ((Event*)self)->setFloat(inValue); + Event *_self = (Event *) self; + _self->setFloat(inValue); } -const char * spine_event_get_string(spine_event self) { - return ((Event*)self)->getString().buffer(); +const char *spine_event_get_string(spine_event self) { + Event *_self = (Event *) self; + return _self->getString().buffer(); } -void spine_event_set_string(spine_event self, const char * inValue) { - ((Event*)self)->setString(String(inValue)); +void spine_event_set_string(spine_event self, const char *inValue) { + Event *_self = (Event *) self; + _self->setString(String(inValue)); } float spine_event_get_volume(spine_event self) { - return ((Event*)self)->getVolume(); + Event *_self = (Event *) self; + return _self->getVolume(); } void spine_event_set_volume(spine_event self, float inValue) { - ((Event*)self)->setVolume(inValue); + Event *_self = (Event *) self; + _self->setVolume(inValue); } float spine_event_get_balance(spine_event self) { - return ((Event*)self)->getBalance(); + Event *_self = (Event *) self; + return _self->getBalance(); } void spine_event_set_balance(spine_event self, float inValue) { - ((Event*)self)->setBalance(inValue); + Event *_self = (Event *) self; + _self->setBalance(inValue); } diff --git a/spine-c/src/generated/event.h b/spine-c/src/generated/event.h index 36c8d409b..2f9496032 100644 --- a/spine-c/src/generated/event.h +++ b/spine-c/src/generated/event.h @@ -18,8 +18,8 @@ SPINE_C_API int spine_event_get_int(spine_event self); SPINE_C_API void spine_event_set_int(spine_event self, int inValue); SPINE_C_API float spine_event_get_float(spine_event self); SPINE_C_API void spine_event_set_float(spine_event self, float inValue); -SPINE_C_API const char * spine_event_get_string(spine_event self); -SPINE_C_API void spine_event_set_string(spine_event self, const char * inValue); +SPINE_C_API const char *spine_event_get_string(spine_event self); +SPINE_C_API void spine_event_set_string(spine_event self, const char *inValue); SPINE_C_API float spine_event_get_volume(spine_event self); SPINE_C_API void spine_event_set_volume(spine_event self, float inValue); SPINE_C_API float spine_event_get_balance(spine_event self); diff --git a/spine-c/src/generated/event_data.cpp b/spine-c/src/generated/event_data.cpp index 96e1bf118..74338bd0a 100644 --- a/spine-c/src/generated/event_data.cpp +++ b/spine-c/src/generated/event_data.cpp @@ -3,62 +3,75 @@ using namespace spine; -spine_event_data spine_event_data_create(const char * name) { - return (spine_event_data) new (__FILE__, __LINE__) EventData(String(name)); +spine_event_data spine_event_data_create(const char *name) { + return (spine_event_data) new (__FILE__, __LINE__) EventData(String(name)); } void spine_event_data_dispose(spine_event_data self) { - delete (EventData*)self; + delete (EventData *) self; } -const char * spine_event_data_get_name(spine_event_data self) { - return ((EventData*)self)->getName().buffer(); +const char *spine_event_data_get_name(spine_event_data self) { + EventData *_self = (EventData *) self; + return _self->getName().buffer(); } int spine_event_data_get_int(spine_event_data self) { - return ((EventData*)self)->getInt(); + EventData *_self = (EventData *) self; + return _self->getInt(); } void spine_event_data_set_int(spine_event_data self, int inValue) { - ((EventData*)self)->setInt(inValue); + EventData *_self = (EventData *) self; + _self->setInt(inValue); } float spine_event_data_get_float(spine_event_data self) { - return ((EventData*)self)->getFloat(); + EventData *_self = (EventData *) self; + return _self->getFloat(); } void spine_event_data_set_float(spine_event_data self, float inValue) { - ((EventData*)self)->setFloat(inValue); + EventData *_self = (EventData *) self; + _self->setFloat(inValue); } -const char * spine_event_data_get_string(spine_event_data self) { - return ((EventData*)self)->getString().buffer(); +const char *spine_event_data_get_string(spine_event_data self) { + EventData *_self = (EventData *) self; + return _self->getString().buffer(); } -void spine_event_data_set_string(spine_event_data self, const char * inValue) { - ((EventData*)self)->setString(String(inValue)); +void spine_event_data_set_string(spine_event_data self, const char *inValue) { + EventData *_self = (EventData *) self; + _self->setString(String(inValue)); } -const char * spine_event_data_get_audio_path(spine_event_data self) { - return ((EventData*)self)->getAudioPath().buffer(); +const char *spine_event_data_get_audio_path(spine_event_data self) { + EventData *_self = (EventData *) self; + return _self->getAudioPath().buffer(); } -void spine_event_data_set_audio_path(spine_event_data self, const char * inValue) { - ((EventData*)self)->setAudioPath(String(inValue)); +void spine_event_data_set_audio_path(spine_event_data self, const char *inValue) { + EventData *_self = (EventData *) self; + _self->setAudioPath(String(inValue)); } float spine_event_data_get_volume(spine_event_data self) { - return ((EventData*)self)->getVolume(); + EventData *_self = (EventData *) self; + return _self->getVolume(); } void spine_event_data_set_volume(spine_event_data self, float inValue) { - ((EventData*)self)->setVolume(inValue); + EventData *_self = (EventData *) self; + _self->setVolume(inValue); } float spine_event_data_get_balance(spine_event_data self) { - return ((EventData*)self)->getBalance(); + EventData *_self = (EventData *) self; + return _self->getBalance(); } void spine_event_data_set_balance(spine_event_data self, float inValue) { - ((EventData*)self)->setBalance(inValue); + EventData *_self = (EventData *) self; + _self->setBalance(inValue); } diff --git a/spine-c/src/generated/event_data.h b/spine-c/src/generated/event_data.h index dfb6c29e7..d8a7701f9 100644 --- a/spine-c/src/generated/event_data.h +++ b/spine-c/src/generated/event_data.h @@ -8,19 +8,19 @@ extern "C" { #endif -SPINE_C_API spine_event_data spine_event_data_create(const char * name); +SPINE_C_API spine_event_data spine_event_data_create(const char *name); SPINE_C_API void spine_event_data_dispose(spine_event_data self); -SPINE_C_API const char * spine_event_data_get_name(spine_event_data self); +SPINE_C_API const char *spine_event_data_get_name(spine_event_data self); SPINE_C_API int spine_event_data_get_int(spine_event_data self); SPINE_C_API void spine_event_data_set_int(spine_event_data self, int inValue); SPINE_C_API float spine_event_data_get_float(spine_event_data self); SPINE_C_API void spine_event_data_set_float(spine_event_data self, float inValue); -SPINE_C_API const char * spine_event_data_get_string(spine_event_data self); -SPINE_C_API void spine_event_data_set_string(spine_event_data self, const char * inValue); -SPINE_C_API const char * spine_event_data_get_audio_path(spine_event_data self); -SPINE_C_API void spine_event_data_set_audio_path(spine_event_data self, const char * inValue); +SPINE_C_API const char *spine_event_data_get_string(spine_event_data self); +SPINE_C_API void spine_event_data_set_string(spine_event_data self, const char *inValue); +SPINE_C_API const char *spine_event_data_get_audio_path(spine_event_data self); +SPINE_C_API void spine_event_data_set_audio_path(spine_event_data self, const char *inValue); SPINE_C_API float spine_event_data_get_volume(spine_event_data self); SPINE_C_API void spine_event_data_set_volume(spine_event_data self, float inValue); SPINE_C_API float spine_event_data_get_balance(spine_event_data self); diff --git a/spine-c/src/generated/event_queue_entry.cpp b/spine-c/src/generated/event_queue_entry.cpp index af2078a43..c45bed591 100644 --- a/spine-c/src/generated/event_queue_entry.cpp +++ b/spine-c/src/generated/event_queue_entry.cpp @@ -4,33 +4,39 @@ using namespace spine; spine_event_queue_entry spine_event_queue_entry_create(spine_event_type eventType, spine_track_entry trackEntry, spine_event event) { - return (spine_event_queue_entry) new (__FILE__, __LINE__) EventQueueEntry((EventType)eventType, (TrackEntry *)trackEntry, (Event *)event); + return (spine_event_queue_entry) new (__FILE__, __LINE__) EventQueueEntry((EventType) eventType, (TrackEntry *) trackEntry, (Event *) event); } void spine_event_queue_entry_dispose(spine_event_queue_entry self) { - delete (EventQueueEntry*)self; + delete (EventQueueEntry *) self; } spine_event_type spine_event_queue_entry_get__type(spine_event_queue_entry self) { - return (spine_event_type)((EventQueueEntry*)self)->_type; + EventQueueEntry *_self = (EventQueueEntry *) self; + return (spine_event_type) _self->_type; } void spine_event_queue_entry_set__type(spine_event_queue_entry self, spine_event_type value) { - ((EventQueueEntry*)self)->_type = (EventType)value; + EventQueueEntry *_self = (EventQueueEntry *) self; + _self->_type = (EventType) value; } spine_track_entry spine_event_queue_entry_get__entry(spine_event_queue_entry self) { - return (spine_track_entry)((EventQueueEntry*)self)->_entry; + EventQueueEntry *_self = (EventQueueEntry *) self; + return (spine_track_entry) _self->_entry; } void spine_event_queue_entry_set__entry(spine_event_queue_entry self, spine_track_entry value) { - ((EventQueueEntry*)self)->_entry = (TrackEntry*)value; + EventQueueEntry *_self = (EventQueueEntry *) self; + _self->_entry = (TrackEntry *) value; } spine_event spine_event_queue_entry_get__event(spine_event_queue_entry self) { - return (spine_event)((EventQueueEntry*)self)->_event; + EventQueueEntry *_self = (EventQueueEntry *) self; + return (spine_event) _self->_event; } void spine_event_queue_entry_set__event(spine_event_queue_entry self, spine_event value) { - ((EventQueueEntry*)self)->_event = (Event*)value; + EventQueueEntry *_self = (EventQueueEntry *) self; + _self->_event = (Event *) value; } diff --git a/spine-c/src/generated/event_timeline.cpp b/spine-c/src/generated/event_timeline.cpp index e8f4e4309..6aa48f358 100644 --- a/spine-c/src/generated/event_timeline.cpp +++ b/spine-c/src/generated/event_timeline.cpp @@ -4,49 +4,60 @@ using namespace spine; spine_event_timeline spine_event_timeline_create(size_t frameCount) { - return (spine_event_timeline) new (__FILE__, __LINE__) EventTimeline(frameCount); + return (spine_event_timeline) new (__FILE__, __LINE__) EventTimeline(frameCount); } void spine_event_timeline_dispose(spine_event_timeline self) { - delete (EventTimeline*)self; + delete (EventTimeline *) self; } spine_rtti spine_event_timeline_get_rtti(spine_event_timeline self) { - return (spine_rtti)&((EventTimeline*)self)->getRTTI(); + EventTimeline *_self = (EventTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_event_timeline_apply(spine_event_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((EventTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_event_timeline_apply(spine_event_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + EventTimeline *_self = (EventTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } size_t spine_event_timeline_get_frame_count(spine_event_timeline self) { - return ((EventTimeline*)self)->getFrameCount(); + EventTimeline *_self = (EventTimeline *) self; + return _self->getFrameCount(); } spine_array_event spine_event_timeline_get_events(spine_event_timeline self) { - return (spine_array_event)&((EventTimeline*)self)->getEvents(); + EventTimeline *_self = (EventTimeline *) self; + return (spine_array_event) &_self->getEvents(); } void spine_event_timeline_set_frame(spine_event_timeline self, size_t frame, spine_event event) { - ((EventTimeline*)self)->setFrame(frame, (Event *)event); + EventTimeline *_self = (EventTimeline *) self; + _self->setFrame(frame, (Event *) event); } size_t spine_event_timeline_get_frame_entries(spine_event_timeline self) { - return ((Timeline*)(EventTimeline*)self)->getFrameEntries(); + Timeline *_self = (Timeline *) (EventTimeline *) self; + return _self->getFrameEntries(); } spine_array_float spine_event_timeline_get_frames(spine_event_timeline self) { - return (spine_array_float)&((Timeline*)(EventTimeline*)self)->getFrames(); + Timeline *_self = (Timeline *) (EventTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_event_timeline_get_duration(spine_event_timeline self) { - return ((Timeline*)(EventTimeline*)self)->getDuration(); + Timeline *_self = (Timeline *) (EventTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_event_timeline_get_property_ids(spine_event_timeline self) { - return (spine_array_property_id)&((Timeline*)(EventTimeline*)self)->getPropertyIds(); + Timeline *_self = (Timeline *) (EventTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } spine_rtti spine_event_timeline_rtti(void) { - return (spine_rtti)&EventTimeline::rtti; + return (spine_rtti) &EventTimeline::rtti; } diff --git a/spine-c/src/generated/event_timeline.h b/spine-c/src/generated/event_timeline.h index c1c2939c7..f698164a0 100644 --- a/spine-c/src/generated/event_timeline.h +++ b/spine-c/src/generated/event_timeline.h @@ -13,7 +13,8 @@ SPINE_C_API spine_event_timeline spine_event_timeline_create(size_t frameCount); SPINE_C_API void spine_event_timeline_dispose(spine_event_timeline self); SPINE_C_API spine_rtti spine_event_timeline_get_rtti(spine_event_timeline self); -SPINE_C_API void spine_event_timeline_apply(spine_event_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_event_timeline_apply(spine_event_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); SPINE_C_API size_t spine_event_timeline_get_frame_count(spine_event_timeline self); SPINE_C_API spine_array_event spine_event_timeline_get_events(spine_event_timeline self); SPINE_C_API void spine_event_timeline_set_frame(spine_event_timeline self, size_t frame, spine_event event); diff --git a/spine-c/src/generated/event_type.h b/spine-c/src/generated/event_type.h index a245662c7..c16e5edad 100644 --- a/spine-c/src/generated/event_type.h +++ b/spine-c/src/generated/event_type.h @@ -6,12 +6,12 @@ extern "C" { #endif typedef enum spine_event_type { - SPINE_EVENT_TYPE_START = 0, - SPINE_EVENT_TYPE_INTERRUPT, - SPINE_EVENT_TYPE_END, - SPINE_EVENT_TYPE_DISPOSE, - SPINE_EVENT_TYPE_COMPLETE, - SPINE_EVENT_TYPE_EVENT + SPINE_EVENT_TYPE_START = 0, + SPINE_EVENT_TYPE_INTERRUPT, + SPINE_EVENT_TYPE_END, + SPINE_EVENT_TYPE_DISPOSE, + SPINE_EVENT_TYPE_COMPLETE, + SPINE_EVENT_TYPE_EVENT } spine_event_type; #ifdef __cplusplus diff --git a/spine-c/src/generated/format.h b/spine-c/src/generated/format.h index eac86db5e..f443c71a9 100644 --- a/spine-c/src/generated/format.h +++ b/spine-c/src/generated/format.h @@ -6,13 +6,13 @@ extern "C" { #endif typedef enum spine_format { - SPINE_FORMAT_ALPHA, - SPINE_FORMAT_INTENSITY, - SPINE_FORMAT_LUMINANCE_ALPHA, - SPINE_FORMAT_RGB565, - SPINE_FORMAT_RGBA4444, - SPINE_FORMAT_RGB888, - SPINE_FORMAT_RGBA8888 + SPINE_FORMAT_ALPHA, + SPINE_FORMAT_INTENSITY, + SPINE_FORMAT_LUMINANCE_ALPHA, + SPINE_FORMAT_RGB565, + SPINE_FORMAT_RGBA4444, + SPINE_FORMAT_RGB888, + SPINE_FORMAT_RGBA8888 } spine_format; #ifdef __cplusplus diff --git a/spine-c/src/generated/from_property.cpp b/spine-c/src/generated/from_property.cpp index 93f18ac8c..6ac85cca3 100644 --- a/spine-c/src/generated/from_property.cpp +++ b/spine-c/src/generated/from_property.cpp @@ -4,33 +4,39 @@ using namespace spine; void spine_from_property_dispose(spine_from_property self) { - delete (FromProperty*)self; + delete (FromProperty *) self; } spine_rtti spine_from_property_get_rtti(spine_from_property self) { - return (spine_rtti)&((FromProperty*)self)->getRTTI(); + FromProperty *_self = (FromProperty *) self; + return (spine_rtti) &_self->getRTTI(); } -float spine_from_property_value(spine_from_property self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets) { - return ((FromProperty*)self)->value(*((Skeleton*)skeleton), *((BonePose*)source), local, offsets); +float spine_from_property_value(spine_from_property self, spine_skeleton skeleton, spine_bone_pose source, bool local, float *offsets) { + FromProperty *_self = (FromProperty *) self; + return _self->value(*((Skeleton *) skeleton), *((BonePose *) source), local, offsets); } spine_rtti spine_from_property_rtti(void) { - return (spine_rtti)&FromProperty::rtti; + return (spine_rtti) &FromProperty::rtti; } float spine_from_property_get__offset(spine_from_property self) { - return ((FromProperty*)self)->_offset; + FromProperty *_self = (FromProperty *) self; + return _self->_offset; } void spine_from_property_set__offset(spine_from_property self, float value) { - ((FromProperty*)self)->_offset = value; + FromProperty *_self = (FromProperty *) self; + _self->_offset = value; } spine_array_to_property spine_from_property_get__to(spine_from_property self) { - return (spine_array_to_property)&((FromProperty*)self)->_to; + FromProperty *_self = (FromProperty *) self; + return (spine_array_to_property) &_self->_to; } void spine_from_property_set__to(spine_from_property self, spine_array_to_property value) { - ((FromProperty*)self)->_to = *((Array*)value); + FromProperty *_self = (FromProperty *) self; + _self->_to = *((Array *) value); } diff --git a/spine-c/src/generated/from_property.h b/spine-c/src/generated/from_property.h index de8465667..301b2ab0a 100644 --- a/spine-c/src/generated/from_property.h +++ b/spine-c/src/generated/from_property.h @@ -11,7 +11,7 @@ extern "C" { SPINE_C_API void spine_from_property_dispose(spine_from_property self); SPINE_C_API spine_rtti spine_from_property_get_rtti(spine_from_property self); -SPINE_C_API float spine_from_property_value(spine_from_property self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets); +SPINE_C_API float spine_from_property_value(spine_from_property self, spine_skeleton skeleton, spine_bone_pose source, bool local, float *offsets); SPINE_C_API spine_rtti spine_from_property_rtti(void); SPINE_C_API float spine_from_property_get__offset(spine_from_property self); SPINE_C_API void spine_from_property_set__offset(spine_from_property self, float value); diff --git a/spine-c/src/generated/from_rotate.cpp b/spine-c/src/generated/from_rotate.cpp index d047f2291..1e49a5d59 100644 --- a/spine-c/src/generated/from_rotate.cpp +++ b/spine-c/src/generated/from_rotate.cpp @@ -4,21 +4,23 @@ using namespace spine; spine_from_rotate spine_from_rotate_create(void) { - return (spine_from_rotate) new (__FILE__, __LINE__) FromRotate(); + return (spine_from_rotate) new (__FILE__, __LINE__) FromRotate(); } void spine_from_rotate_dispose(spine_from_rotate self) { - delete (FromRotate*)self; + delete (FromRotate *) self; } spine_rtti spine_from_rotate_get_rtti(spine_from_rotate self) { - return (spine_rtti)&((FromRotate*)self)->getRTTI(); + FromRotate *_self = (FromRotate *) self; + return (spine_rtti) &_self->getRTTI(); } -float spine_from_rotate_value(spine_from_rotate self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets) { - return ((FromRotate*)self)->value(*((Skeleton*)skeleton), *((BonePose*)source), local, offsets); +float spine_from_rotate_value(spine_from_rotate self, spine_skeleton skeleton, spine_bone_pose source, bool local, float *offsets) { + FromRotate *_self = (FromRotate *) self; + return _self->value(*((Skeleton *) skeleton), *((BonePose *) source), local, offsets); } spine_rtti spine_from_rotate_rtti(void) { - return (spine_rtti)&FromRotate::rtti; + return (spine_rtti) &FromRotate::rtti; } diff --git a/spine-c/src/generated/from_rotate.h b/spine-c/src/generated/from_rotate.h index b7dcab8b3..19f05fb1b 100644 --- a/spine-c/src/generated/from_rotate.h +++ b/spine-c/src/generated/from_rotate.h @@ -13,7 +13,7 @@ SPINE_C_API spine_from_rotate spine_from_rotate_create(void); SPINE_C_API void spine_from_rotate_dispose(spine_from_rotate self); SPINE_C_API spine_rtti spine_from_rotate_get_rtti(spine_from_rotate self); -SPINE_C_API float spine_from_rotate_value(spine_from_rotate self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets); +SPINE_C_API float spine_from_rotate_value(spine_from_rotate self, spine_skeleton skeleton, spine_bone_pose source, bool local, float *offsets); SPINE_C_API spine_rtti spine_from_rotate_rtti(void); #ifdef __cplusplus diff --git a/spine-c/src/generated/from_scale_x.cpp b/spine-c/src/generated/from_scale_x.cpp index 06581595a..51a4ae5c8 100644 --- a/spine-c/src/generated/from_scale_x.cpp +++ b/spine-c/src/generated/from_scale_x.cpp @@ -4,21 +4,23 @@ using namespace spine; spine_from_scale_x spine_from_scale_x_create(void) { - return (spine_from_scale_x) new (__FILE__, __LINE__) FromScaleX(); + return (spine_from_scale_x) new (__FILE__, __LINE__) FromScaleX(); } void spine_from_scale_x_dispose(spine_from_scale_x self) { - delete (FromScaleX*)self; + delete (FromScaleX *) self; } spine_rtti spine_from_scale_x_get_rtti(spine_from_scale_x self) { - return (spine_rtti)&((FromScaleX*)self)->getRTTI(); + FromScaleX *_self = (FromScaleX *) self; + return (spine_rtti) &_self->getRTTI(); } -float spine_from_scale_x_value(spine_from_scale_x self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets) { - return ((FromScaleX*)self)->value(*((Skeleton*)skeleton), *((BonePose*)source), local, offsets); +float spine_from_scale_x_value(spine_from_scale_x self, spine_skeleton skeleton, spine_bone_pose source, bool local, float *offsets) { + FromScaleX *_self = (FromScaleX *) self; + return _self->value(*((Skeleton *) skeleton), *((BonePose *) source), local, offsets); } spine_rtti spine_from_scale_x_rtti(void) { - return (spine_rtti)&FromScaleX::rtti; + return (spine_rtti) &FromScaleX::rtti; } diff --git a/spine-c/src/generated/from_scale_x.h b/spine-c/src/generated/from_scale_x.h index 9fa705f99..9f9a93e94 100644 --- a/spine-c/src/generated/from_scale_x.h +++ b/spine-c/src/generated/from_scale_x.h @@ -13,7 +13,7 @@ SPINE_C_API spine_from_scale_x spine_from_scale_x_create(void); SPINE_C_API void spine_from_scale_x_dispose(spine_from_scale_x self); SPINE_C_API spine_rtti spine_from_scale_x_get_rtti(spine_from_scale_x self); -SPINE_C_API float spine_from_scale_x_value(spine_from_scale_x self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets); +SPINE_C_API float spine_from_scale_x_value(spine_from_scale_x self, spine_skeleton skeleton, spine_bone_pose source, bool local, float *offsets); SPINE_C_API spine_rtti spine_from_scale_x_rtti(void); #ifdef __cplusplus diff --git a/spine-c/src/generated/from_scale_y.cpp b/spine-c/src/generated/from_scale_y.cpp index e5e036dd7..9f19a8ccb 100644 --- a/spine-c/src/generated/from_scale_y.cpp +++ b/spine-c/src/generated/from_scale_y.cpp @@ -4,21 +4,23 @@ using namespace spine; spine_from_scale_y spine_from_scale_y_create(void) { - return (spine_from_scale_y) new (__FILE__, __LINE__) FromScaleY(); + return (spine_from_scale_y) new (__FILE__, __LINE__) FromScaleY(); } void spine_from_scale_y_dispose(spine_from_scale_y self) { - delete (FromScaleY*)self; + delete (FromScaleY *) self; } spine_rtti spine_from_scale_y_get_rtti(spine_from_scale_y self) { - return (spine_rtti)&((FromScaleY*)self)->getRTTI(); + FromScaleY *_self = (FromScaleY *) self; + return (spine_rtti) &_self->getRTTI(); } -float spine_from_scale_y_value(spine_from_scale_y self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets) { - return ((FromScaleY*)self)->value(*((Skeleton*)skeleton), *((BonePose*)source), local, offsets); +float spine_from_scale_y_value(spine_from_scale_y self, spine_skeleton skeleton, spine_bone_pose source, bool local, float *offsets) { + FromScaleY *_self = (FromScaleY *) self; + return _self->value(*((Skeleton *) skeleton), *((BonePose *) source), local, offsets); } spine_rtti spine_from_scale_y_rtti(void) { - return (spine_rtti)&FromScaleY::rtti; + return (spine_rtti) &FromScaleY::rtti; } diff --git a/spine-c/src/generated/from_scale_y.h b/spine-c/src/generated/from_scale_y.h index 354debef8..cb14c88ee 100644 --- a/spine-c/src/generated/from_scale_y.h +++ b/spine-c/src/generated/from_scale_y.h @@ -13,7 +13,7 @@ SPINE_C_API spine_from_scale_y spine_from_scale_y_create(void); SPINE_C_API void spine_from_scale_y_dispose(spine_from_scale_y self); SPINE_C_API spine_rtti spine_from_scale_y_get_rtti(spine_from_scale_y self); -SPINE_C_API float spine_from_scale_y_value(spine_from_scale_y self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets); +SPINE_C_API float spine_from_scale_y_value(spine_from_scale_y self, spine_skeleton skeleton, spine_bone_pose source, bool local, float *offsets); SPINE_C_API spine_rtti spine_from_scale_y_rtti(void); #ifdef __cplusplus diff --git a/spine-c/src/generated/from_shear_y.cpp b/spine-c/src/generated/from_shear_y.cpp index 2468199ac..813003860 100644 --- a/spine-c/src/generated/from_shear_y.cpp +++ b/spine-c/src/generated/from_shear_y.cpp @@ -4,21 +4,23 @@ using namespace spine; spine_from_shear_y spine_from_shear_y_create(void) { - return (spine_from_shear_y) new (__FILE__, __LINE__) FromShearY(); + return (spine_from_shear_y) new (__FILE__, __LINE__) FromShearY(); } void spine_from_shear_y_dispose(spine_from_shear_y self) { - delete (FromShearY*)self; + delete (FromShearY *) self; } spine_rtti spine_from_shear_y_get_rtti(spine_from_shear_y self) { - return (spine_rtti)&((FromShearY*)self)->getRTTI(); + FromShearY *_self = (FromShearY *) self; + return (spine_rtti) &_self->getRTTI(); } -float spine_from_shear_y_value(spine_from_shear_y self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets) { - return ((FromShearY*)self)->value(*((Skeleton*)skeleton), *((BonePose*)source), local, offsets); +float spine_from_shear_y_value(spine_from_shear_y self, spine_skeleton skeleton, spine_bone_pose source, bool local, float *offsets) { + FromShearY *_self = (FromShearY *) self; + return _self->value(*((Skeleton *) skeleton), *((BonePose *) source), local, offsets); } spine_rtti spine_from_shear_y_rtti(void) { - return (spine_rtti)&FromShearY::rtti; + return (spine_rtti) &FromShearY::rtti; } diff --git a/spine-c/src/generated/from_shear_y.h b/spine-c/src/generated/from_shear_y.h index 6419b89a2..88ccd27ca 100644 --- a/spine-c/src/generated/from_shear_y.h +++ b/spine-c/src/generated/from_shear_y.h @@ -13,7 +13,7 @@ SPINE_C_API spine_from_shear_y spine_from_shear_y_create(void); SPINE_C_API void spine_from_shear_y_dispose(spine_from_shear_y self); SPINE_C_API spine_rtti spine_from_shear_y_get_rtti(spine_from_shear_y self); -SPINE_C_API float spine_from_shear_y_value(spine_from_shear_y self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets); +SPINE_C_API float spine_from_shear_y_value(spine_from_shear_y self, spine_skeleton skeleton, spine_bone_pose source, bool local, float *offsets); SPINE_C_API spine_rtti spine_from_shear_y_rtti(void); #ifdef __cplusplus diff --git a/spine-c/src/generated/from_x.cpp b/spine-c/src/generated/from_x.cpp index 267553452..4cdf850bf 100644 --- a/spine-c/src/generated/from_x.cpp +++ b/spine-c/src/generated/from_x.cpp @@ -4,21 +4,23 @@ using namespace spine; spine_from_x spine_from_x_create(void) { - return (spine_from_x) new (__FILE__, __LINE__) FromX(); + return (spine_from_x) new (__FILE__, __LINE__) FromX(); } void spine_from_x_dispose(spine_from_x self) { - delete (FromX*)self; + delete (FromX *) self; } spine_rtti spine_from_x_get_rtti(spine_from_x self) { - return (spine_rtti)&((FromX*)self)->getRTTI(); + FromX *_self = (FromX *) self; + return (spine_rtti) &_self->getRTTI(); } -float spine_from_x_value(spine_from_x self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets) { - return ((FromX*)self)->value(*((Skeleton*)skeleton), *((BonePose*)source), local, offsets); +float spine_from_x_value(spine_from_x self, spine_skeleton skeleton, spine_bone_pose source, bool local, float *offsets) { + FromX *_self = (FromX *) self; + return _self->value(*((Skeleton *) skeleton), *((BonePose *) source), local, offsets); } spine_rtti spine_from_x_rtti(void) { - return (spine_rtti)&FromX::rtti; + return (spine_rtti) &FromX::rtti; } diff --git a/spine-c/src/generated/from_x.h b/spine-c/src/generated/from_x.h index d7fa37e20..99769d380 100644 --- a/spine-c/src/generated/from_x.h +++ b/spine-c/src/generated/from_x.h @@ -13,7 +13,7 @@ SPINE_C_API spine_from_x spine_from_x_create(void); SPINE_C_API void spine_from_x_dispose(spine_from_x self); SPINE_C_API spine_rtti spine_from_x_get_rtti(spine_from_x self); -SPINE_C_API float spine_from_x_value(spine_from_x self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets); +SPINE_C_API float spine_from_x_value(spine_from_x self, spine_skeleton skeleton, spine_bone_pose source, bool local, float *offsets); SPINE_C_API spine_rtti spine_from_x_rtti(void); #ifdef __cplusplus diff --git a/spine-c/src/generated/from_y.cpp b/spine-c/src/generated/from_y.cpp index fba4ea8c8..e4833533b 100644 --- a/spine-c/src/generated/from_y.cpp +++ b/spine-c/src/generated/from_y.cpp @@ -4,21 +4,23 @@ using namespace spine; spine_from_y spine_from_y_create(void) { - return (spine_from_y) new (__FILE__, __LINE__) FromY(); + return (spine_from_y) new (__FILE__, __LINE__) FromY(); } void spine_from_y_dispose(spine_from_y self) { - delete (FromY*)self; + delete (FromY *) self; } spine_rtti spine_from_y_get_rtti(spine_from_y self) { - return (spine_rtti)&((FromY*)self)->getRTTI(); + FromY *_self = (FromY *) self; + return (spine_rtti) &_self->getRTTI(); } -float spine_from_y_value(spine_from_y self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets) { - return ((FromY*)self)->value(*((Skeleton*)skeleton), *((BonePose*)source), local, offsets); +float spine_from_y_value(spine_from_y self, spine_skeleton skeleton, spine_bone_pose source, bool local, float *offsets) { + FromY *_self = (FromY *) self; + return _self->value(*((Skeleton *) skeleton), *((BonePose *) source), local, offsets); } spine_rtti spine_from_y_rtti(void) { - return (spine_rtti)&FromY::rtti; + return (spine_rtti) &FromY::rtti; } diff --git a/spine-c/src/generated/from_y.h b/spine-c/src/generated/from_y.h index 315d946f4..d97c85c71 100644 --- a/spine-c/src/generated/from_y.h +++ b/spine-c/src/generated/from_y.h @@ -13,7 +13,7 @@ SPINE_C_API spine_from_y spine_from_y_create(void); SPINE_C_API void spine_from_y_dispose(spine_from_y self); SPINE_C_API spine_rtti spine_from_y_get_rtti(spine_from_y self); -SPINE_C_API float spine_from_y_value(spine_from_y self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets); +SPINE_C_API float spine_from_y_value(spine_from_y self, spine_skeleton skeleton, spine_bone_pose source, bool local, float *offsets); SPINE_C_API spine_rtti spine_from_y_rtti(void); #ifdef __cplusplus diff --git a/spine-c/src/generated/ik_constraint.cpp b/spine-c/src/generated/ik_constraint.cpp index 105c2d94f..4056edb41 100644 --- a/spine-c/src/generated/ik_constraint.cpp +++ b/spine-c/src/generated/ik_constraint.cpp @@ -4,85 +4,111 @@ using namespace spine; spine_ik_constraint spine_ik_constraint_create(spine_ik_constraint_data data, spine_skeleton skeleton) { - return (spine_ik_constraint) new (__FILE__, __LINE__) IkConstraint(*((IkConstraintData*)data), *((Skeleton*)skeleton)); + return (spine_ik_constraint) new (__FILE__, __LINE__) IkConstraint(*((IkConstraintData *) data), *((Skeleton *) skeleton)); } void spine_ik_constraint_dispose(spine_ik_constraint self) { - delete (IkConstraint*)self; + delete (IkConstraint *) self; } spine_rtti spine_ik_constraint_get_rtti(spine_ik_constraint self) { - return (spine_rtti)&((IkConstraint*)self)->getRTTI(); + IkConstraint *_self = (IkConstraint *) self; + return (spine_rtti) &_self->getRTTI(); } spine_ik_constraint spine_ik_constraint_copy(spine_ik_constraint self, spine_skeleton skeleton) { - return (spine_ik_constraint)((IkConstraint*)self)->copy(*((Skeleton*)skeleton)); + IkConstraint *_self = (IkConstraint *) self; + return (spine_ik_constraint) _self->copy(*((Skeleton *) skeleton)); } void spine_ik_constraint_update(spine_ik_constraint self, spine_skeleton skeleton, spine_physics physics) { - ((IkConstraint*)self)->update(*((Skeleton*)skeleton), (Physics)physics); + IkConstraint *_self = (IkConstraint *) self; + _self->update(*((Skeleton *) skeleton), (Physics) physics); } void spine_ik_constraint_sort(spine_ik_constraint self, spine_skeleton skeleton) { - ((IkConstraint*)self)->sort(*((Skeleton*)skeleton)); + IkConstraint *_self = (IkConstraint *) self; + _self->sort(*((Skeleton *) skeleton)); } bool spine_ik_constraint_is_source_active(spine_ik_constraint self) { - return ((IkConstraint*)self)->isSourceActive(); + IkConstraint *_self = (IkConstraint *) self; + return _self->isSourceActive(); } spine_ik_constraint_data spine_ik_constraint_get_data(spine_ik_constraint self) { - return (spine_ik_constraint_data)&((IkConstraint*)self)->getData(); + IkConstraint *_self = (IkConstraint *) self; + return (spine_ik_constraint_data) &_self->getData(); } spine_array_bone_pose spine_ik_constraint_get_bones(spine_ik_constraint self) { - return (spine_array_bone_pose)&((IkConstraint*)self)->getBones(); + IkConstraint *_self = (IkConstraint *) self; + return (spine_array_bone_pose) &_self->getBones(); } spine_bone spine_ik_constraint_get_target(spine_ik_constraint self) { - return (spine_bone)((IkConstraint*)self)->getTarget(); + IkConstraint *_self = (IkConstraint *) self; + return (spine_bone) _self->getTarget(); } void spine_ik_constraint_set_target(spine_ik_constraint self, spine_bone inValue) { - ((IkConstraint*)self)->setTarget((Bone *)inValue); + IkConstraint *_self = (IkConstraint *) self; + _self->setTarget((Bone *) inValue); } -void spine_ik_constraint_apply_1(spine_skeleton skeleton, spine_bone_pose bone, float targetX, float targetY, bool compress, bool stretch, bool uniform, float mix) { - IkConstraint::apply(*((Skeleton*)skeleton), *((BonePose*)bone), targetX, targetY, compress, stretch, uniform, mix); +void spine_ik_constraint_apply_1(spine_skeleton skeleton, spine_bone_pose bone, float targetX, float targetY, bool compress, bool stretch, + bool uniform, float mix) { + IkConstraint::apply(*((Skeleton *) skeleton), *((BonePose *) bone), targetX, targetY, compress, stretch, uniform, mix); } -void spine_ik_constraint_apply_2(spine_skeleton skeleton, spine_bone_pose parent, spine_bone_pose child, float targetX, float targetY, int bendDirection, bool stretch, bool uniform, float softness, float mix) { - IkConstraint::apply(*((Skeleton*)skeleton), *((BonePose*)parent), *((BonePose*)child), targetX, targetY, bendDirection, stretch, uniform, softness, mix); +void spine_ik_constraint_apply_2(spine_skeleton skeleton, spine_bone_pose parent, spine_bone_pose child, float targetX, float targetY, + int bendDirection, bool stretch, bool uniform, float softness, float mix) { + IkConstraint::apply(*((Skeleton *) skeleton), *((BonePose *) parent), *((BonePose *) child), targetX, targetY, bendDirection, stretch, uniform, + softness, mix); } spine_ik_constraint_pose spine_ik_constraint_get_pose(spine_ik_constraint self) { - return (spine_ik_constraint_pose)&((ConstraintGeneric*)(IkConstraint*)self)->getPose(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (IkConstraint *) self; + return (spine_ik_constraint_pose) &_self->getPose(); } spine_ik_constraint_pose spine_ik_constraint_get_applied_pose(spine_ik_constraint self) { - return (spine_ik_constraint_pose)&((ConstraintGeneric*)(IkConstraint*)self)->getAppliedPose(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (IkConstraint *) self; + return (spine_ik_constraint_pose) &_self->getAppliedPose(); } void spine_ik_constraint_reset_constrained(spine_ik_constraint self) { - ((ConstraintGeneric*)(IkConstraint*)self)->resetConstrained(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (IkConstraint *) self; + _self->resetConstrained(); } void spine_ik_constraint_constrained(spine_ik_constraint self) { - ((ConstraintGeneric*)(IkConstraint*)self)->constrained(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (IkConstraint *) self; + _self->constrained(); } bool spine_ik_constraint_is_pose_equal_to_applied(spine_ik_constraint self) { - return ((ConstraintGeneric*)(IkConstraint*)self)->isPoseEqualToApplied(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (IkConstraint *) self; + return _self->isPoseEqualToApplied(); } bool spine_ik_constraint_is_active(spine_ik_constraint self) { - return ((ConstraintGeneric*)(IkConstraint*)self)->isActive(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (IkConstraint *) self; + return _self->isActive(); } void spine_ik_constraint_set_active(spine_ik_constraint self, bool active) { - ((ConstraintGeneric*)(IkConstraint*)self)->setActive(active); + ConstraintGeneric + *_self = (ConstraintGeneric *) (IkConstraint *) self; + _self->setActive(active); } spine_rtti spine_ik_constraint_rtti(void) { - return (spine_rtti)&IkConstraint::rtti; + return (spine_rtti) &IkConstraint::rtti; } diff --git a/spine-c/src/generated/ik_constraint.h b/spine-c/src/generated/ik_constraint.h index ed7b53b0b..64f11643c 100644 --- a/spine-c/src/generated/ik_constraint.h +++ b/spine-c/src/generated/ik_constraint.h @@ -21,8 +21,10 @@ SPINE_C_API spine_ik_constraint_data spine_ik_constraint_get_data(spine_ik_const SPINE_C_API spine_array_bone_pose spine_ik_constraint_get_bones(spine_ik_constraint self); SPINE_C_API spine_bone spine_ik_constraint_get_target(spine_ik_constraint self); SPINE_C_API void spine_ik_constraint_set_target(spine_ik_constraint self, spine_bone inValue); -SPINE_C_API void spine_ik_constraint_apply_1(spine_skeleton skeleton, spine_bone_pose bone, float targetX, float targetY, bool compress, bool stretch, bool uniform, float mix); -SPINE_C_API void spine_ik_constraint_apply_2(spine_skeleton skeleton, spine_bone_pose parent, spine_bone_pose child, float targetX, float targetY, int bendDirection, bool stretch, bool uniform, float softness, float mix); +SPINE_C_API void spine_ik_constraint_apply_1(spine_skeleton skeleton, spine_bone_pose bone, float targetX, float targetY, bool compress, bool stretch, + bool uniform, float mix); +SPINE_C_API void spine_ik_constraint_apply_2(spine_skeleton skeleton, spine_bone_pose parent, spine_bone_pose child, float targetX, float targetY, + int bendDirection, bool stretch, bool uniform, float softness, float mix); SPINE_C_API spine_ik_constraint_pose spine_ik_constraint_get_pose(spine_ik_constraint self); SPINE_C_API spine_ik_constraint_pose spine_ik_constraint_get_applied_pose(spine_ik_constraint self); SPINE_C_API void spine_ik_constraint_reset_constrained(spine_ik_constraint self); diff --git a/spine-c/src/generated/ik_constraint_data.cpp b/spine-c/src/generated/ik_constraint_data.cpp index d7754703e..a6ceb5c49 100644 --- a/spine-c/src/generated/ik_constraint_data.cpp +++ b/spine-c/src/generated/ik_constraint_data.cpp @@ -3,58 +3,73 @@ using namespace spine; -spine_ik_constraint_data spine_ik_constraint_data_create(const char * name) { - return (spine_ik_constraint_data) new (__FILE__, __LINE__) IkConstraintData(String(name)); +spine_ik_constraint_data spine_ik_constraint_data_create(const char *name) { + return (spine_ik_constraint_data) new (__FILE__, __LINE__) IkConstraintData(String(name)); } void spine_ik_constraint_data_dispose(spine_ik_constraint_data self) { - delete (IkConstraintData*)self; + delete (IkConstraintData *) self; } spine_rtti spine_ik_constraint_data_get_rtti(spine_ik_constraint_data self) { - return (spine_rtti)&((IkConstraintData*)self)->getRTTI(); + IkConstraintData *_self = (IkConstraintData *) self; + return (spine_rtti) &_self->getRTTI(); } spine_constraint spine_ik_constraint_data_create_method(spine_ik_constraint_data self, spine_skeleton skeleton) { - return (spine_constraint)((IkConstraintData*)self)->create(*((Skeleton*)skeleton)); + IkConstraintData *_self = (IkConstraintData *) self; + return (spine_constraint) _self->create(*((Skeleton *) skeleton)); } spine_array_bone_data spine_ik_constraint_data_get_bones(spine_ik_constraint_data self) { - return (spine_array_bone_data)&((IkConstraintData*)self)->getBones(); + IkConstraintData *_self = (IkConstraintData *) self; + return (spine_array_bone_data) &_self->getBones(); } spine_bone_data spine_ik_constraint_data_get_target(spine_ik_constraint_data self) { - return (spine_bone_data)((IkConstraintData*)self)->getTarget(); + IkConstraintData *_self = (IkConstraintData *) self; + return (spine_bone_data) _self->getTarget(); } void spine_ik_constraint_data_set_target(spine_ik_constraint_data self, spine_bone_data inValue) { - ((IkConstraintData*)self)->setTarget((BoneData *)inValue); + IkConstraintData *_self = (IkConstraintData *) self; + _self->setTarget((BoneData *) inValue); } bool spine_ik_constraint_data_get_uniform(spine_ik_constraint_data self) { - return ((IkConstraintData*)self)->getUniform(); + IkConstraintData *_self = (IkConstraintData *) self; + return _self->getUniform(); } void spine_ik_constraint_data_set_uniform(spine_ik_constraint_data self, bool uniform) { - ((IkConstraintData*)self)->setUniform(uniform); + IkConstraintData *_self = (IkConstraintData *) self; + _self->setUniform(uniform); } -const char * spine_ik_constraint_data_get_name(spine_ik_constraint_data self) { - return ((ConstraintDataGeneric*)(IkConstraintData*)self)->getName().buffer(); +const char *spine_ik_constraint_data_get_name(spine_ik_constraint_data self) { + ConstraintDataGeneric *_self = (ConstraintDataGeneric *) (IkConstraintData *) + self; + return _self->getName().buffer(); } bool spine_ik_constraint_data_get_skin_required(spine_ik_constraint_data self) { - return ((ConstraintDataGeneric*)(IkConstraintData*)self)->getSkinRequired(); + ConstraintDataGeneric *_self = (ConstraintDataGeneric *) (IkConstraintData *) + self; + return _self->getSkinRequired(); } spine_ik_constraint_pose spine_ik_constraint_data_get_setup_pose(spine_ik_constraint_data self) { - return (spine_ik_constraint_pose)&((ConstraintDataGeneric*)(IkConstraintData*)self)->getSetupPose(); + ConstraintDataGeneric *_self = (ConstraintDataGeneric *) (IkConstraintData *) + self; + return (spine_ik_constraint_pose) &_self->getSetupPose(); } void spine_ik_constraint_data_set_skin_required(spine_ik_constraint_data self, bool skinRequired) { - ((ConstraintDataGeneric*)(IkConstraintData*)self)->setSkinRequired(skinRequired); + ConstraintDataGeneric *_self = (ConstraintDataGeneric *) (IkConstraintData *) + self; + _self->setSkinRequired(skinRequired); } spine_rtti spine_ik_constraint_data_rtti(void) { - return (spine_rtti)&IkConstraintData::rtti; + return (spine_rtti) &IkConstraintData::rtti; } diff --git a/spine-c/src/generated/ik_constraint_data.h b/spine-c/src/generated/ik_constraint_data.h index 33e450a35..6356a11cd 100644 --- a/spine-c/src/generated/ik_constraint_data.h +++ b/spine-c/src/generated/ik_constraint_data.h @@ -8,7 +8,7 @@ extern "C" { #endif -SPINE_C_API spine_ik_constraint_data spine_ik_constraint_data_create(const char * name); +SPINE_C_API spine_ik_constraint_data spine_ik_constraint_data_create(const char *name); SPINE_C_API void spine_ik_constraint_data_dispose(spine_ik_constraint_data self); @@ -19,7 +19,7 @@ SPINE_C_API spine_bone_data spine_ik_constraint_data_get_target(spine_ik_constra SPINE_C_API void spine_ik_constraint_data_set_target(spine_ik_constraint_data self, spine_bone_data inValue); SPINE_C_API bool spine_ik_constraint_data_get_uniform(spine_ik_constraint_data self); SPINE_C_API void spine_ik_constraint_data_set_uniform(spine_ik_constraint_data self, bool uniform); -SPINE_C_API const char * spine_ik_constraint_data_get_name(spine_ik_constraint_data self); +SPINE_C_API const char *spine_ik_constraint_data_get_name(spine_ik_constraint_data self); SPINE_C_API bool spine_ik_constraint_data_get_skin_required(spine_ik_constraint_data self); SPINE_C_API spine_ik_constraint_pose spine_ik_constraint_data_get_setup_pose(spine_ik_constraint_data self); SPINE_C_API void spine_ik_constraint_data_set_skin_required(spine_ik_constraint_data self, bool skinRequired); diff --git a/spine-c/src/generated/ik_constraint_pose.cpp b/spine-c/src/generated/ik_constraint_pose.cpp index 0a09fbee2..d4d11c34e 100644 --- a/spine-c/src/generated/ik_constraint_pose.cpp +++ b/spine-c/src/generated/ik_constraint_pose.cpp @@ -4,53 +4,64 @@ using namespace spine; spine_ik_constraint_pose spine_ik_constraint_pose_create(void) { - return (spine_ik_constraint_pose) new (__FILE__, __LINE__) IkConstraintPose(); + return (spine_ik_constraint_pose) new (__FILE__, __LINE__) IkConstraintPose(); } void spine_ik_constraint_pose_dispose(spine_ik_constraint_pose self) { - delete (IkConstraintPose*)self; + delete (IkConstraintPose *) self; } void spine_ik_constraint_pose_set(spine_ik_constraint_pose self, spine_ik_constraint_pose pose) { - ((IkConstraintPose*)self)->set(*((IkConstraintPose*)pose)); + IkConstraintPose *_self = (IkConstraintPose *) self; + _self->set(*((IkConstraintPose *) pose)); } float spine_ik_constraint_pose_get_mix(spine_ik_constraint_pose self) { - return ((IkConstraintPose*)self)->getMix(); + IkConstraintPose *_self = (IkConstraintPose *) self; + return _self->getMix(); } void spine_ik_constraint_pose_set_mix(spine_ik_constraint_pose self, float mix) { - ((IkConstraintPose*)self)->setMix(mix); + IkConstraintPose *_self = (IkConstraintPose *) self; + _self->setMix(mix); } float spine_ik_constraint_pose_get_softness(spine_ik_constraint_pose self) { - return ((IkConstraintPose*)self)->getSoftness(); + IkConstraintPose *_self = (IkConstraintPose *) self; + return _self->getSoftness(); } void spine_ik_constraint_pose_set_softness(spine_ik_constraint_pose self, float softness) { - ((IkConstraintPose*)self)->setSoftness(softness); + IkConstraintPose *_self = (IkConstraintPose *) self; + _self->setSoftness(softness); } int spine_ik_constraint_pose_get_bend_direction(spine_ik_constraint_pose self) { - return ((IkConstraintPose*)self)->getBendDirection(); + IkConstraintPose *_self = (IkConstraintPose *) self; + return _self->getBendDirection(); } void spine_ik_constraint_pose_set_bend_direction(spine_ik_constraint_pose self, int bendDirection) { - ((IkConstraintPose*)self)->setBendDirection(bendDirection); + IkConstraintPose *_self = (IkConstraintPose *) self; + _self->setBendDirection(bendDirection); } bool spine_ik_constraint_pose_get_compress(spine_ik_constraint_pose self) { - return ((IkConstraintPose*)self)->getCompress(); + IkConstraintPose *_self = (IkConstraintPose *) self; + return _self->getCompress(); } void spine_ik_constraint_pose_set_compress(spine_ik_constraint_pose self, bool compress) { - ((IkConstraintPose*)self)->setCompress(compress); + IkConstraintPose *_self = (IkConstraintPose *) self; + _self->setCompress(compress); } bool spine_ik_constraint_pose_get_stretch(spine_ik_constraint_pose self) { - return ((IkConstraintPose*)self)->getStretch(); + IkConstraintPose *_self = (IkConstraintPose *) self; + return _self->getStretch(); } void spine_ik_constraint_pose_set_stretch(spine_ik_constraint_pose self, bool stretch) { - ((IkConstraintPose*)self)->setStretch(stretch); + IkConstraintPose *_self = (IkConstraintPose *) self; + _self->setStretch(stretch); } diff --git a/spine-c/src/generated/ik_constraint_timeline.cpp b/spine-c/src/generated/ik_constraint_timeline.cpp index dcf45c15b..660c9e2cf 100644 --- a/spine-c/src/generated/ik_constraint_timeline.cpp +++ b/spine-c/src/generated/ik_constraint_timeline.cpp @@ -4,73 +4,93 @@ using namespace spine; spine_ik_constraint_timeline spine_ik_constraint_timeline_create(size_t frameCount, size_t bezierCount, int constraintIndex) { - return (spine_ik_constraint_timeline) new (__FILE__, __LINE__) IkConstraintTimeline(frameCount, bezierCount, constraintIndex); + return (spine_ik_constraint_timeline) new (__FILE__, __LINE__) IkConstraintTimeline(frameCount, bezierCount, constraintIndex); } void spine_ik_constraint_timeline_dispose(spine_ik_constraint_timeline self) { - delete (IkConstraintTimeline*)self; + delete (IkConstraintTimeline *) self; } spine_rtti spine_ik_constraint_timeline_get_rtti(spine_ik_constraint_timeline self) { - return (spine_rtti)&((IkConstraintTimeline*)self)->getRTTI(); + IkConstraintTimeline *_self = (IkConstraintTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_ik_constraint_timeline_apply(spine_ik_constraint_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((IkConstraintTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_ik_constraint_timeline_apply(spine_ik_constraint_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose) { + IkConstraintTimeline *_self = (IkConstraintTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } -void spine_ik_constraint_timeline_set_frame(spine_ik_constraint_timeline self, int frame, float time, float mix, float softness, int bendDirection, bool compress, bool stretch) { - ((IkConstraintTimeline*)self)->setFrame(frame, time, mix, softness, bendDirection, compress, stretch); +void spine_ik_constraint_timeline_set_frame(spine_ik_constraint_timeline self, int frame, float time, float mix, float softness, int bendDirection, + bool compress, bool stretch) { + IkConstraintTimeline *_self = (IkConstraintTimeline *) self; + _self->setFrame(frame, time, mix, softness, bendDirection, compress, stretch); } void spine_ik_constraint_timeline_set_linear(spine_ik_constraint_timeline self, size_t frame) { - ((CurveTimeline*)(IkConstraintTimeline*)self)->setLinear(frame); + CurveTimeline *_self = (CurveTimeline *) (IkConstraintTimeline *) self; + _self->setLinear(frame); } void spine_ik_constraint_timeline_set_stepped(spine_ik_constraint_timeline self, size_t frame) { - ((CurveTimeline*)(IkConstraintTimeline*)self)->setStepped(frame); + CurveTimeline *_self = (CurveTimeline *) (IkConstraintTimeline *) self; + _self->setStepped(frame); } -void spine_ik_constraint_timeline_set_bezier(spine_ik_constraint_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((CurveTimeline*)(IkConstraintTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_ik_constraint_timeline_set_bezier(spine_ik_constraint_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2) { + CurveTimeline *_self = (CurveTimeline *) (IkConstraintTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_ik_constraint_timeline_get_bezier_value(spine_ik_constraint_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((CurveTimeline*)(IkConstraintTimeline*)self)->getBezierValue(time, frame, valueOffset, i); + CurveTimeline *_self = (CurveTimeline *) (IkConstraintTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_ik_constraint_timeline_get_curves(spine_ik_constraint_timeline self) { - return (spine_array_float)&((CurveTimeline*)(IkConstraintTimeline*)self)->getCurves(); + CurveTimeline *_self = (CurveTimeline *) (IkConstraintTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_ik_constraint_timeline_get_frame_entries(spine_ik_constraint_timeline self) { - return ((CurveTimeline*)(IkConstraintTimeline*)self)->getFrameEntries(); + CurveTimeline *_self = (CurveTimeline *) (IkConstraintTimeline *) self; + return _self->getFrameEntries(); } size_t spine_ik_constraint_timeline_get_frame_count(spine_ik_constraint_timeline self) { - return ((CurveTimeline*)(IkConstraintTimeline*)self)->getFrameCount(); + CurveTimeline *_self = (CurveTimeline *) (IkConstraintTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_ik_constraint_timeline_get_frames(spine_ik_constraint_timeline self) { - return (spine_array_float)&((CurveTimeline*)(IkConstraintTimeline*)self)->getFrames(); + CurveTimeline *_self = (CurveTimeline *) (IkConstraintTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_ik_constraint_timeline_get_duration(spine_ik_constraint_timeline self) { - return ((CurveTimeline*)(IkConstraintTimeline*)self)->getDuration(); + CurveTimeline *_self = (CurveTimeline *) (IkConstraintTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_ik_constraint_timeline_get_property_ids(spine_ik_constraint_timeline self) { - return (spine_array_property_id)&((CurveTimeline*)(IkConstraintTimeline*)self)->getPropertyIds(); + CurveTimeline *_self = (CurveTimeline *) (IkConstraintTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_ik_constraint_timeline_get_constraint_index(spine_ik_constraint_timeline self) { - return ((ConstraintTimeline*)(IkConstraintTimeline*)self)->getConstraintIndex(); + ConstraintTimeline *_self = (ConstraintTimeline *) (IkConstraintTimeline *) self; + return _self->getConstraintIndex(); } void spine_ik_constraint_timeline_set_constraint_index(spine_ik_constraint_timeline self, int inValue) { - ((ConstraintTimeline*)(IkConstraintTimeline*)self)->setConstraintIndex(inValue); + ConstraintTimeline *_self = (ConstraintTimeline *) (IkConstraintTimeline *) self; + _self->setConstraintIndex(inValue); } spine_rtti spine_ik_constraint_timeline_rtti(void) { - return (spine_rtti)&IkConstraintTimeline::rtti; + return (spine_rtti) &IkConstraintTimeline::rtti; } diff --git a/spine-c/src/generated/ik_constraint_timeline.h b/spine-c/src/generated/ik_constraint_timeline.h index 0c769b3da..0b21da3f3 100644 --- a/spine-c/src/generated/ik_constraint_timeline.h +++ b/spine-c/src/generated/ik_constraint_timeline.h @@ -13,12 +13,17 @@ SPINE_C_API spine_ik_constraint_timeline spine_ik_constraint_timeline_create(siz SPINE_C_API void spine_ik_constraint_timeline_dispose(spine_ik_constraint_timeline self); SPINE_C_API spine_rtti spine_ik_constraint_timeline_get_rtti(spine_ik_constraint_timeline self); -SPINE_C_API void spine_ik_constraint_timeline_apply(spine_ik_constraint_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); -SPINE_C_API void spine_ik_constraint_timeline_set_frame(spine_ik_constraint_timeline self, int frame, float time, float mix, float softness, int bendDirection, bool compress, bool stretch); +SPINE_C_API void spine_ik_constraint_timeline_apply(spine_ik_constraint_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); +SPINE_C_API void spine_ik_constraint_timeline_set_frame(spine_ik_constraint_timeline self, int frame, float time, float mix, float softness, + int bendDirection, bool compress, bool stretch); SPINE_C_API void spine_ik_constraint_timeline_set_linear(spine_ik_constraint_timeline self, size_t frame); SPINE_C_API void spine_ik_constraint_timeline_set_stepped(spine_ik_constraint_timeline self, size_t frame); -SPINE_C_API void spine_ik_constraint_timeline_set_bezier(spine_ik_constraint_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); -SPINE_C_API float spine_ik_constraint_timeline_get_bezier_value(spine_ik_constraint_timeline self, float time, size_t frame, size_t valueOffset, size_t i); +SPINE_C_API void spine_ik_constraint_timeline_set_bezier(spine_ik_constraint_timeline self, size_t bezier, size_t frame, float value, float time1, + float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API float spine_ik_constraint_timeline_get_bezier_value(spine_ik_constraint_timeline self, float time, size_t frame, size_t valueOffset, + size_t i); SPINE_C_API spine_array_float spine_ik_constraint_timeline_get_curves(spine_ik_constraint_timeline self); SPINE_C_API size_t spine_ik_constraint_timeline_get_frame_entries(spine_ik_constraint_timeline self); SPINE_C_API size_t spine_ik_constraint_timeline_get_frame_count(spine_ik_constraint_timeline self); diff --git a/spine-c/src/generated/inherit.h b/spine-c/src/generated/inherit.h index ad7444748..d4fa13d64 100644 --- a/spine-c/src/generated/inherit.h +++ b/spine-c/src/generated/inherit.h @@ -6,11 +6,11 @@ extern "C" { #endif typedef enum spine_inherit { - SPINE_INHERIT_NORMAL = 0, - SPINE_INHERIT_ONLY_TRANSLATION, - SPINE_INHERIT_NO_ROTATION_OR_REFLECTION, - SPINE_INHERIT_NO_SCALE, - SPINE_INHERIT_NO_SCALE_OR_REFLECTION + SPINE_INHERIT_NORMAL = 0, + SPINE_INHERIT_ONLY_TRANSLATION, + SPINE_INHERIT_NO_ROTATION_OR_REFLECTION, + SPINE_INHERIT_NO_SCALE, + SPINE_INHERIT_NO_SCALE_OR_REFLECTION } spine_inherit; #ifdef __cplusplus diff --git a/spine-c/src/generated/inherit_timeline.cpp b/spine-c/src/generated/inherit_timeline.cpp index 424bfbb3d..60fb219c6 100644 --- a/spine-c/src/generated/inherit_timeline.cpp +++ b/spine-c/src/generated/inherit_timeline.cpp @@ -4,53 +4,65 @@ using namespace spine; spine_inherit_timeline spine_inherit_timeline_create(size_t frameCount, int boneIndex) { - return (spine_inherit_timeline) new (__FILE__, __LINE__) InheritTimeline(frameCount, boneIndex); + return (spine_inherit_timeline) new (__FILE__, __LINE__) InheritTimeline(frameCount, boneIndex); } void spine_inherit_timeline_dispose(spine_inherit_timeline self) { - delete (InheritTimeline*)self; + delete (InheritTimeline *) self; } spine_rtti spine_inherit_timeline_get_rtti(spine_inherit_timeline self) { - return (spine_rtti)&((InheritTimeline*)self)->getRTTI(); + InheritTimeline *_self = (InheritTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } void spine_inherit_timeline_set_frame(spine_inherit_timeline self, int frame, float time, spine_inherit inherit) { - ((InheritTimeline*)self)->setFrame(frame, time, (Inherit)inherit); + InheritTimeline *_self = (InheritTimeline *) self; + _self->setFrame(frame, time, (Inherit) inherit); } -void spine_inherit_timeline_apply(spine_inherit_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((InheritTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_inherit_timeline_apply(spine_inherit_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + InheritTimeline *_self = (InheritTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } size_t spine_inherit_timeline_get_frame_entries(spine_inherit_timeline self) { - return ((Timeline*)(InheritTimeline*)self)->getFrameEntries(); + Timeline *_self = (Timeline *) (InheritTimeline *) self; + return _self->getFrameEntries(); } size_t spine_inherit_timeline_get_frame_count(spine_inherit_timeline self) { - return ((Timeline*)(InheritTimeline*)self)->getFrameCount(); + Timeline *_self = (Timeline *) (InheritTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_inherit_timeline_get_frames(spine_inherit_timeline self) { - return (spine_array_float)&((Timeline*)(InheritTimeline*)self)->getFrames(); + Timeline *_self = (Timeline *) (InheritTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_inherit_timeline_get_duration(spine_inherit_timeline self) { - return ((Timeline*)(InheritTimeline*)self)->getDuration(); + Timeline *_self = (Timeline *) (InheritTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_inherit_timeline_get_property_ids(spine_inherit_timeline self) { - return (spine_array_property_id)&((Timeline*)(InheritTimeline*)self)->getPropertyIds(); + Timeline *_self = (Timeline *) (InheritTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_inherit_timeline_get_bone_index(spine_inherit_timeline self) { - return ((BoneTimeline*)(InheritTimeline*)self)->getBoneIndex(); + BoneTimeline *_self = (BoneTimeline *) (InheritTimeline *) self; + return _self->getBoneIndex(); } void spine_inherit_timeline_set_bone_index(spine_inherit_timeline self, int inValue) { - ((BoneTimeline*)(InheritTimeline*)self)->setBoneIndex(inValue); + BoneTimeline *_self = (BoneTimeline *) (InheritTimeline *) self; + _self->setBoneIndex(inValue); } spine_rtti spine_inherit_timeline_rtti(void) { - return (spine_rtti)&InheritTimeline::rtti; + return (spine_rtti) &InheritTimeline::rtti; } diff --git a/spine-c/src/generated/inherit_timeline.h b/spine-c/src/generated/inherit_timeline.h index 706db86c1..f3f0443b4 100644 --- a/spine-c/src/generated/inherit_timeline.h +++ b/spine-c/src/generated/inherit_timeline.h @@ -14,7 +14,9 @@ SPINE_C_API void spine_inherit_timeline_dispose(spine_inherit_timeline self); SPINE_C_API spine_rtti spine_inherit_timeline_get_rtti(spine_inherit_timeline self); SPINE_C_API void spine_inherit_timeline_set_frame(spine_inherit_timeline self, int frame, float time, spine_inherit inherit); -SPINE_C_API void spine_inherit_timeline_apply(spine_inherit_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_inherit_timeline_apply(spine_inherit_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); SPINE_C_API size_t spine_inherit_timeline_get_frame_entries(spine_inherit_timeline self); SPINE_C_API size_t spine_inherit_timeline_get_frame_count(spine_inherit_timeline self); SPINE_C_API spine_array_float spine_inherit_timeline_get_frames(spine_inherit_timeline self); diff --git a/spine-c/src/generated/linked_mesh.cpp b/spine-c/src/generated/linked_mesh.cpp index f8f6f73fc..107cba81e 100644 --- a/spine-c/src/generated/linked_mesh.cpp +++ b/spine-c/src/generated/linked_mesh.cpp @@ -3,14 +3,17 @@ using namespace spine; -spine_linked_mesh spine_linked_mesh_create(spine_mesh_attachment mesh, const int skinIndex, size_t slotIndex, const char * parent, bool inheritTimelines) { - return (spine_linked_mesh) new (__FILE__, __LINE__) LinkedMesh((MeshAttachment *)mesh, skinIndex, slotIndex, String(parent), inheritTimelines); +spine_linked_mesh spine_linked_mesh_create(spine_mesh_attachment mesh, const int skinIndex, size_t slotIndex, const char *parent, + bool inheritTimelines) { + return (spine_linked_mesh) new (__FILE__, __LINE__) LinkedMesh((MeshAttachment *) mesh, skinIndex, slotIndex, String(parent), inheritTimelines); } -spine_linked_mesh spine_linked_mesh_create2(spine_mesh_attachment mesh, const char * skin, size_t slotIndex, const char * parent, bool inheritTimelines) { - return (spine_linked_mesh) new (__FILE__, __LINE__) LinkedMesh((MeshAttachment *)mesh, String(skin), slotIndex, String(parent), inheritTimelines); +spine_linked_mesh spine_linked_mesh_create2(spine_mesh_attachment mesh, const char *skin, size_t slotIndex, const char *parent, + bool inheritTimelines) { + return (spine_linked_mesh) new (__FILE__, __LINE__) + LinkedMesh((MeshAttachment *) mesh, String(skin), slotIndex, String(parent), inheritTimelines); } void spine_linked_mesh_dispose(spine_linked_mesh self) { - delete (LinkedMesh*)self; + delete (LinkedMesh *) self; } diff --git a/spine-c/src/generated/linked_mesh.h b/spine-c/src/generated/linked_mesh.h index 197ffa237..a774ca7f8 100644 --- a/spine-c/src/generated/linked_mesh.h +++ b/spine-c/src/generated/linked_mesh.h @@ -8,8 +8,10 @@ extern "C" { #endif -SPINE_C_API spine_linked_mesh spine_linked_mesh_create(spine_mesh_attachment mesh, const int skinIndex, size_t slotIndex, const char * parent, bool inheritTimelines); -SPINE_C_API spine_linked_mesh spine_linked_mesh_create2(spine_mesh_attachment mesh, const char * skin, size_t slotIndex, const char * parent, bool inheritTimelines); +SPINE_C_API spine_linked_mesh spine_linked_mesh_create(spine_mesh_attachment mesh, const int skinIndex, size_t slotIndex, const char *parent, + bool inheritTimelines); +SPINE_C_API spine_linked_mesh spine_linked_mesh_create2(spine_mesh_attachment mesh, const char *skin, size_t slotIndex, const char *parent, + bool inheritTimelines); SPINE_C_API void spine_linked_mesh_dispose(spine_linked_mesh self); diff --git a/spine-c/src/generated/mesh_attachment.cpp b/spine-c/src/generated/mesh_attachment.cpp index 28c714123..9040db41c 100644 --- a/spine-c/src/generated/mesh_attachment.cpp +++ b/spine-c/src/generated/mesh_attachment.cpp @@ -3,182 +3,226 @@ using namespace spine; -spine_mesh_attachment spine_mesh_attachment_create(const char * name) { - return (spine_mesh_attachment) new (__FILE__, __LINE__) MeshAttachment(String(name)); +spine_mesh_attachment spine_mesh_attachment_create(const char *name) { + return (spine_mesh_attachment) new (__FILE__, __LINE__) MeshAttachment(String(name)); } void spine_mesh_attachment_dispose(spine_mesh_attachment self) { - delete (MeshAttachment*)self; + delete (MeshAttachment *) self; } spine_rtti spine_mesh_attachment_get_rtti(spine_mesh_attachment self) { - return (spine_rtti)&((MeshAttachment*)self)->getRTTI(); + MeshAttachment *_self = (MeshAttachment *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_mesh_attachment_compute_world_vertices_1(spine_mesh_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, float * worldVertices, size_t offset, size_t stride) { - ((MeshAttachment*)self)->computeWorldVertices(*((Skeleton*)skeleton), *((Slot*)slot), start, count, worldVertices, offset, stride); +void spine_mesh_attachment_compute_world_vertices_1(spine_mesh_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, + float *worldVertices, size_t offset, size_t stride) { + MeshAttachment *_self = (MeshAttachment *) self; + _self->computeWorldVertices(*((Skeleton *) skeleton), *((Slot *) slot), start, count, worldVertices, offset, stride); } -void spine_mesh_attachment_compute_world_vertices_2(spine_mesh_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, spine_array_float worldVertices, size_t offset, size_t stride) { - ((VertexAttachment*)(MeshAttachment*)self)->computeWorldVertices(*((Skeleton*)skeleton), *((Slot*)slot), start, count, *((Array*)worldVertices), offset, stride); +void spine_mesh_attachment_compute_world_vertices_2(spine_mesh_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, + spine_array_float worldVertices, size_t offset, size_t stride) { + VertexAttachment *_self = (VertexAttachment *) (MeshAttachment *) self; + _self->computeWorldVertices(*((Skeleton *) skeleton), *((Slot *) slot), start, count, *((Array *) worldVertices), offset, stride); } void spine_mesh_attachment_update_region(spine_mesh_attachment self) { - ((MeshAttachment*)self)->updateRegion(); + MeshAttachment *_self = (MeshAttachment *) self; + _self->updateRegion(); } int spine_mesh_attachment_get_hull_length(spine_mesh_attachment self) { - return ((MeshAttachment*)self)->getHullLength(); + MeshAttachment *_self = (MeshAttachment *) self; + return _self->getHullLength(); } void spine_mesh_attachment_set_hull_length(spine_mesh_attachment self, int inValue) { - ((MeshAttachment*)self)->setHullLength(inValue); + MeshAttachment *_self = (MeshAttachment *) self; + _self->setHullLength(inValue); } spine_array_float spine_mesh_attachment_get_region_u_vs(spine_mesh_attachment self) { - return (spine_array_float)&((MeshAttachment*)self)->getRegionUVs(); + MeshAttachment *_self = (MeshAttachment *) self; + return (spine_array_float) &_self->getRegionUVs(); } void spine_mesh_attachment_set_region_u_vs(spine_mesh_attachment self, spine_array_float inValue) { - ((MeshAttachment*)self)->setRegionUVs(*((Array*)inValue)); + MeshAttachment *_self = (MeshAttachment *) self; + _self->setRegionUVs(*((Array *) inValue)); } spine_array_float spine_mesh_attachment_get_u_vs(spine_mesh_attachment self) { - return (spine_array_float)&((MeshAttachment*)self)->getUVs(); + MeshAttachment *_self = (MeshAttachment *) self; + return (spine_array_float) &_self->getUVs(); } spine_array_unsigned_short spine_mesh_attachment_get_triangles(spine_mesh_attachment self) { - return (spine_array_unsigned_short)&((MeshAttachment*)self)->getTriangles(); + MeshAttachment *_self = (MeshAttachment *) self; + return (spine_array_unsigned_short) &_self->getTriangles(); } void spine_mesh_attachment_set_triangles(spine_mesh_attachment self, spine_array_unsigned_short inValue) { - ((MeshAttachment*)self)->setTriangles(*((Array*)inValue)); + MeshAttachment *_self = (MeshAttachment *) self; + _self->setTriangles(*((Array *) inValue)); } spine_color spine_mesh_attachment_get_color(spine_mesh_attachment self) { - return (spine_color)&((MeshAttachment*)self)->getColor(); + MeshAttachment *_self = (MeshAttachment *) self; + return (spine_color) &_self->getColor(); } -const char * spine_mesh_attachment_get_path(spine_mesh_attachment self) { - return ((MeshAttachment*)self)->getPath().buffer(); +const char *spine_mesh_attachment_get_path(spine_mesh_attachment self) { + MeshAttachment *_self = (MeshAttachment *) self; + return _self->getPath().buffer(); } -void spine_mesh_attachment_set_path(spine_mesh_attachment self, const char * inValue) { - ((MeshAttachment*)self)->setPath(String(inValue)); +void spine_mesh_attachment_set_path(spine_mesh_attachment self, const char *inValue) { + MeshAttachment *_self = (MeshAttachment *) self; + _self->setPath(String(inValue)); } spine_texture_region spine_mesh_attachment_get_region(spine_mesh_attachment self) { - return (spine_texture_region)((MeshAttachment*)self)->getRegion(); + MeshAttachment *_self = (MeshAttachment *) self; + return (spine_texture_region) _self->getRegion(); } void spine_mesh_attachment_set_region(spine_mesh_attachment self, spine_texture_region region) { - ((MeshAttachment*)self)->setRegion((TextureRegion *)region); + MeshAttachment *_self = (MeshAttachment *) self; + _self->setRegion((TextureRegion *) region); } spine_sequence spine_mesh_attachment_get_sequence(spine_mesh_attachment self) { - return (spine_sequence)((MeshAttachment*)self)->getSequence(); + MeshAttachment *_self = (MeshAttachment *) self; + return (spine_sequence) _self->getSequence(); } void spine_mesh_attachment_set_sequence(spine_mesh_attachment self, spine_sequence sequence) { - ((MeshAttachment*)self)->setSequence((Sequence *)sequence); + MeshAttachment *_self = (MeshAttachment *) self; + _self->setSequence((Sequence *) sequence); } spine_mesh_attachment spine_mesh_attachment_get_parent_mesh(spine_mesh_attachment self) { - return (spine_mesh_attachment)((MeshAttachment*)self)->getParentMesh(); + MeshAttachment *_self = (MeshAttachment *) self; + return (spine_mesh_attachment) _self->getParentMesh(); } void spine_mesh_attachment_set_parent_mesh(spine_mesh_attachment self, spine_mesh_attachment inValue) { - ((MeshAttachment*)self)->setParentMesh((MeshAttachment *)inValue); + MeshAttachment *_self = (MeshAttachment *) self; + _self->setParentMesh((MeshAttachment *) inValue); } spine_array_unsigned_short spine_mesh_attachment_get_edges(spine_mesh_attachment self) { - return (spine_array_unsigned_short)&((MeshAttachment*)self)->getEdges(); + MeshAttachment *_self = (MeshAttachment *) self; + return (spine_array_unsigned_short) &_self->getEdges(); } void spine_mesh_attachment_set_edges(spine_mesh_attachment self, spine_array_unsigned_short inValue) { - ((MeshAttachment*)self)->setEdges(*((Array*)inValue)); + MeshAttachment *_self = (MeshAttachment *) self; + _self->setEdges(*((Array *) inValue)); } float spine_mesh_attachment_get_width(spine_mesh_attachment self) { - return ((MeshAttachment*)self)->getWidth(); + MeshAttachment *_self = (MeshAttachment *) self; + return _self->getWidth(); } void spine_mesh_attachment_set_width(spine_mesh_attachment self, float inValue) { - ((MeshAttachment*)self)->setWidth(inValue); + MeshAttachment *_self = (MeshAttachment *) self; + _self->setWidth(inValue); } float spine_mesh_attachment_get_height(spine_mesh_attachment self) { - return ((MeshAttachment*)self)->getHeight(); + MeshAttachment *_self = (MeshAttachment *) self; + return _self->getHeight(); } void spine_mesh_attachment_set_height(spine_mesh_attachment self, float inValue) { - ((MeshAttachment*)self)->setHeight(inValue); + MeshAttachment *_self = (MeshAttachment *) self; + _self->setHeight(inValue); } spine_attachment spine_mesh_attachment_copy(spine_mesh_attachment self) { - return (spine_attachment)((MeshAttachment*)self)->copy(); + MeshAttachment *_self = (MeshAttachment *) self; + return (spine_attachment) _self->copy(); } spine_mesh_attachment spine_mesh_attachment_new_linked_mesh(spine_mesh_attachment self) { - return (spine_mesh_attachment)((MeshAttachment*)self)->newLinkedMesh(); + MeshAttachment *_self = (MeshAttachment *) self; + return (spine_mesh_attachment) _self->newLinkedMesh(); } int spine_mesh_attachment_get_id(spine_mesh_attachment self) { - return ((VertexAttachment*)(MeshAttachment*)self)->getId(); + VertexAttachment *_self = (VertexAttachment *) (MeshAttachment *) self; + return _self->getId(); } spine_array_int spine_mesh_attachment_get_bones(spine_mesh_attachment self) { - return (spine_array_int)&((VertexAttachment*)(MeshAttachment*)self)->getBones(); + VertexAttachment *_self = (VertexAttachment *) (MeshAttachment *) self; + return (spine_array_int) &_self->getBones(); } void spine_mesh_attachment_set_bones(spine_mesh_attachment self, spine_array_int bones) { - ((VertexAttachment*)(MeshAttachment*)self)->setBones(*((Array*)bones)); + VertexAttachment *_self = (VertexAttachment *) (MeshAttachment *) self; + _self->setBones(*((Array *) bones)); } spine_array_float spine_mesh_attachment_get_vertices(spine_mesh_attachment self) { - return (spine_array_float)&((VertexAttachment*)(MeshAttachment*)self)->getVertices(); + VertexAttachment *_self = (VertexAttachment *) (MeshAttachment *) self; + return (spine_array_float) &_self->getVertices(); } void spine_mesh_attachment_set_vertices(spine_mesh_attachment self, spine_array_float vertices) { - ((VertexAttachment*)(MeshAttachment*)self)->setVertices(*((Array*)vertices)); + VertexAttachment *_self = (VertexAttachment *) (MeshAttachment *) self; + _self->setVertices(*((Array *) vertices)); } size_t spine_mesh_attachment_get_world_vertices_length(spine_mesh_attachment self) { - return ((VertexAttachment*)(MeshAttachment*)self)->getWorldVerticesLength(); + VertexAttachment *_self = (VertexAttachment *) (MeshAttachment *) self; + return _self->getWorldVerticesLength(); } void spine_mesh_attachment_set_world_vertices_length(spine_mesh_attachment self, size_t inValue) { - ((VertexAttachment*)(MeshAttachment*)self)->setWorldVerticesLength(inValue); + VertexAttachment *_self = (VertexAttachment *) (MeshAttachment *) self; + _self->setWorldVerticesLength(inValue); } spine_attachment spine_mesh_attachment_get_timeline_attachment(spine_mesh_attachment self) { - return (spine_attachment)((VertexAttachment*)(MeshAttachment*)self)->getTimelineAttachment(); + VertexAttachment *_self = (VertexAttachment *) (MeshAttachment *) self; + return (spine_attachment) _self->getTimelineAttachment(); } void spine_mesh_attachment_set_timeline_attachment(spine_mesh_attachment self, spine_attachment attachment) { - ((VertexAttachment*)(MeshAttachment*)self)->setTimelineAttachment((Attachment *)attachment); + VertexAttachment *_self = (VertexAttachment *) (MeshAttachment *) self; + _self->setTimelineAttachment((Attachment *) attachment); } void spine_mesh_attachment_copy_to(spine_mesh_attachment self, spine_vertex_attachment other) { - ((VertexAttachment*)(MeshAttachment*)self)->copyTo((VertexAttachment *)other); + VertexAttachment *_self = (VertexAttachment *) (MeshAttachment *) self; + _self->copyTo((VertexAttachment *) other); } -const char * spine_mesh_attachment_get_name(spine_mesh_attachment self) { - return ((VertexAttachment*)(MeshAttachment*)self)->getName().buffer(); +const char *spine_mesh_attachment_get_name(spine_mesh_attachment self) { + VertexAttachment *_self = (VertexAttachment *) (MeshAttachment *) self; + return _self->getName().buffer(); } int spine_mesh_attachment_get_ref_count(spine_mesh_attachment self) { - return ((VertexAttachment*)(MeshAttachment*)self)->getRefCount(); + VertexAttachment *_self = (VertexAttachment *) (MeshAttachment *) self; + return _self->getRefCount(); } void spine_mesh_attachment_reference(spine_mesh_attachment self) { - ((VertexAttachment*)(MeshAttachment*)self)->reference(); + VertexAttachment *_self = (VertexAttachment *) (MeshAttachment *) self; + _self->reference(); } void spine_mesh_attachment_dereference(spine_mesh_attachment self) { - ((VertexAttachment*)(MeshAttachment*)self)->dereference(); + VertexAttachment *_self = (VertexAttachment *) (MeshAttachment *) self; + _self->dereference(); } spine_rtti spine_mesh_attachment_rtti(void) { - return (spine_rtti)&MeshAttachment::rtti; + return (spine_rtti) &MeshAttachment::rtti; } diff --git a/spine-c/src/generated/mesh_attachment.h b/spine-c/src/generated/mesh_attachment.h index b897ed638..2667aa6ae 100644 --- a/spine-c/src/generated/mesh_attachment.h +++ b/spine-c/src/generated/mesh_attachment.h @@ -8,13 +8,15 @@ extern "C" { #endif -SPINE_C_API spine_mesh_attachment spine_mesh_attachment_create(const char * name); +SPINE_C_API spine_mesh_attachment spine_mesh_attachment_create(const char *name); SPINE_C_API void spine_mesh_attachment_dispose(spine_mesh_attachment self); SPINE_C_API spine_rtti spine_mesh_attachment_get_rtti(spine_mesh_attachment self); -SPINE_C_API void spine_mesh_attachment_compute_world_vertices_1(spine_mesh_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, float * worldVertices, size_t offset, size_t stride); -SPINE_C_API void spine_mesh_attachment_compute_world_vertices_2(spine_mesh_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, spine_array_float worldVertices, size_t offset, size_t stride); +SPINE_C_API void spine_mesh_attachment_compute_world_vertices_1(spine_mesh_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, + size_t count, float *worldVertices, size_t offset, size_t stride); +SPINE_C_API void spine_mesh_attachment_compute_world_vertices_2(spine_mesh_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, + size_t count, spine_array_float worldVertices, size_t offset, size_t stride); SPINE_C_API void spine_mesh_attachment_update_region(spine_mesh_attachment self); SPINE_C_API int spine_mesh_attachment_get_hull_length(spine_mesh_attachment self); SPINE_C_API void spine_mesh_attachment_set_hull_length(spine_mesh_attachment self, int inValue); @@ -24,8 +26,8 @@ SPINE_C_API spine_array_float spine_mesh_attachment_get_u_vs(spine_mesh_attachme SPINE_C_API spine_array_unsigned_short spine_mesh_attachment_get_triangles(spine_mesh_attachment self); SPINE_C_API void spine_mesh_attachment_set_triangles(spine_mesh_attachment self, spine_array_unsigned_short inValue); SPINE_C_API spine_color spine_mesh_attachment_get_color(spine_mesh_attachment self); -SPINE_C_API const char * spine_mesh_attachment_get_path(spine_mesh_attachment self); -SPINE_C_API void spine_mesh_attachment_set_path(spine_mesh_attachment self, const char * inValue); +SPINE_C_API const char *spine_mesh_attachment_get_path(spine_mesh_attachment self); +SPINE_C_API void spine_mesh_attachment_set_path(spine_mesh_attachment self, const char *inValue); SPINE_C_API spine_texture_region spine_mesh_attachment_get_region(spine_mesh_attachment self); SPINE_C_API void spine_mesh_attachment_set_region(spine_mesh_attachment self, spine_texture_region region); SPINE_C_API spine_sequence spine_mesh_attachment_get_sequence(spine_mesh_attachment self); @@ -50,7 +52,7 @@ SPINE_C_API void spine_mesh_attachment_set_world_vertices_length(spine_mesh_atta SPINE_C_API spine_attachment spine_mesh_attachment_get_timeline_attachment(spine_mesh_attachment self); SPINE_C_API void spine_mesh_attachment_set_timeline_attachment(spine_mesh_attachment self, spine_attachment attachment); SPINE_C_API void spine_mesh_attachment_copy_to(spine_mesh_attachment self, spine_vertex_attachment other); -SPINE_C_API const char * spine_mesh_attachment_get_name(spine_mesh_attachment self); +SPINE_C_API const char *spine_mesh_attachment_get_name(spine_mesh_attachment self); SPINE_C_API int spine_mesh_attachment_get_ref_count(spine_mesh_attachment self); SPINE_C_API void spine_mesh_attachment_reference(spine_mesh_attachment self); SPINE_C_API void spine_mesh_attachment_dereference(spine_mesh_attachment self); diff --git a/spine-c/src/generated/mix_blend.h b/spine-c/src/generated/mix_blend.h index 6f79edfb2..c42c03528 100644 --- a/spine-c/src/generated/mix_blend.h +++ b/spine-c/src/generated/mix_blend.h @@ -6,10 +6,10 @@ extern "C" { #endif typedef enum spine_mix_blend { - SPINE_MIX_BLEND_SETUP = 0, - SPINE_MIX_BLEND_FIRST, - SPINE_MIX_BLEND_REPLACE, - SPINE_MIX_BLEND_ADD + SPINE_MIX_BLEND_SETUP = 0, + SPINE_MIX_BLEND_FIRST, + SPINE_MIX_BLEND_REPLACE, + SPINE_MIX_BLEND_ADD } spine_mix_blend; #ifdef __cplusplus diff --git a/spine-c/src/generated/mix_direction.h b/spine-c/src/generated/mix_direction.h index 34a29acf7..f4fbb3e28 100644 --- a/spine-c/src/generated/mix_direction.h +++ b/spine-c/src/generated/mix_direction.h @@ -6,8 +6,8 @@ extern "C" { #endif typedef enum spine_mix_direction { - SPINE_MIX_DIRECTION_IN = 0, - SPINE_MIX_DIRECTION_OUT + SPINE_MIX_DIRECTION_IN = 0, + SPINE_MIX_DIRECTION_OUT } spine_mix_direction; #ifdef __cplusplus diff --git a/spine-c/src/generated/path_attachment.cpp b/spine-c/src/generated/path_attachment.cpp index de07e70e7..dd70bd58b 100644 --- a/spine-c/src/generated/path_attachment.cpp +++ b/spine-c/src/generated/path_attachment.cpp @@ -3,114 +3,141 @@ using namespace spine; -spine_path_attachment spine_path_attachment_create(const char * name) { - return (spine_path_attachment) new (__FILE__, __LINE__) PathAttachment(String(name)); +spine_path_attachment spine_path_attachment_create(const char *name) { + return (spine_path_attachment) new (__FILE__, __LINE__) PathAttachment(String(name)); } void spine_path_attachment_dispose(spine_path_attachment self) { - delete (PathAttachment*)self; + delete (PathAttachment *) self; } spine_rtti spine_path_attachment_get_rtti(spine_path_attachment self) { - return (spine_rtti)&((PathAttachment*)self)->getRTTI(); + PathAttachment *_self = (PathAttachment *) self; + return (spine_rtti) &_self->getRTTI(); } spine_array_float spine_path_attachment_get_lengths(spine_path_attachment self) { - return (spine_array_float)&((PathAttachment*)self)->getLengths(); + PathAttachment *_self = (PathAttachment *) self; + return (spine_array_float) &_self->getLengths(); } void spine_path_attachment_set_lengths(spine_path_attachment self, spine_array_float inValue) { - ((PathAttachment*)self)->setLengths(*((Array*)inValue)); + PathAttachment *_self = (PathAttachment *) self; + _self->setLengths(*((Array *) inValue)); } bool spine_path_attachment_get_closed(spine_path_attachment self) { - return ((PathAttachment*)self)->getClosed(); + PathAttachment *_self = (PathAttachment *) self; + return _self->getClosed(); } void spine_path_attachment_set_closed(spine_path_attachment self, bool inValue) { - ((PathAttachment*)self)->setClosed(inValue); + PathAttachment *_self = (PathAttachment *) self; + _self->setClosed(inValue); } bool spine_path_attachment_get_constant_speed(spine_path_attachment self) { - return ((PathAttachment*)self)->getConstantSpeed(); + PathAttachment *_self = (PathAttachment *) self; + return _self->getConstantSpeed(); } void spine_path_attachment_set_constant_speed(spine_path_attachment self, bool inValue) { - ((PathAttachment*)self)->setConstantSpeed(inValue); + PathAttachment *_self = (PathAttachment *) self; + _self->setConstantSpeed(inValue); } spine_color spine_path_attachment_get_color(spine_path_attachment self) { - return (spine_color)&((PathAttachment*)self)->getColor(); + PathAttachment *_self = (PathAttachment *) self; + return (spine_color) &_self->getColor(); } spine_attachment spine_path_attachment_copy(spine_path_attachment self) { - return (spine_attachment)((PathAttachment*)self)->copy(); + PathAttachment *_self = (PathAttachment *) self; + return (spine_attachment) _self->copy(); } -void spine_path_attachment_compute_world_vertices_1(spine_path_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, float * worldVertices, size_t offset, size_t stride) { - ((VertexAttachment*)(PathAttachment*)self)->computeWorldVertices(*((Skeleton*)skeleton), *((Slot*)slot), start, count, worldVertices, offset, stride); +void spine_path_attachment_compute_world_vertices_1(spine_path_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, + float *worldVertices, size_t offset, size_t stride) { + VertexAttachment *_self = (VertexAttachment *) (PathAttachment *) self; + _self->computeWorldVertices(*((Skeleton *) skeleton), *((Slot *) slot), start, count, worldVertices, offset, stride); } -void spine_path_attachment_compute_world_vertices_2(spine_path_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, spine_array_float worldVertices, size_t offset, size_t stride) { - ((VertexAttachment*)(PathAttachment*)self)->computeWorldVertices(*((Skeleton*)skeleton), *((Slot*)slot), start, count, *((Array*)worldVertices), offset, stride); +void spine_path_attachment_compute_world_vertices_2(spine_path_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, + spine_array_float worldVertices, size_t offset, size_t stride) { + VertexAttachment *_self = (VertexAttachment *) (PathAttachment *) self; + _self->computeWorldVertices(*((Skeleton *) skeleton), *((Slot *) slot), start, count, *((Array *) worldVertices), offset, stride); } int spine_path_attachment_get_id(spine_path_attachment self) { - return ((VertexAttachment*)(PathAttachment*)self)->getId(); + VertexAttachment *_self = (VertexAttachment *) (PathAttachment *) self; + return _self->getId(); } spine_array_int spine_path_attachment_get_bones(spine_path_attachment self) { - return (spine_array_int)&((VertexAttachment*)(PathAttachment*)self)->getBones(); + VertexAttachment *_self = (VertexAttachment *) (PathAttachment *) self; + return (spine_array_int) &_self->getBones(); } void spine_path_attachment_set_bones(spine_path_attachment self, spine_array_int bones) { - ((VertexAttachment*)(PathAttachment*)self)->setBones(*((Array*)bones)); + VertexAttachment *_self = (VertexAttachment *) (PathAttachment *) self; + _self->setBones(*((Array *) bones)); } spine_array_float spine_path_attachment_get_vertices(spine_path_attachment self) { - return (spine_array_float)&((VertexAttachment*)(PathAttachment*)self)->getVertices(); + VertexAttachment *_self = (VertexAttachment *) (PathAttachment *) self; + return (spine_array_float) &_self->getVertices(); } void spine_path_attachment_set_vertices(spine_path_attachment self, spine_array_float vertices) { - ((VertexAttachment*)(PathAttachment*)self)->setVertices(*((Array*)vertices)); + VertexAttachment *_self = (VertexAttachment *) (PathAttachment *) self; + _self->setVertices(*((Array *) vertices)); } size_t spine_path_attachment_get_world_vertices_length(spine_path_attachment self) { - return ((VertexAttachment*)(PathAttachment*)self)->getWorldVerticesLength(); + VertexAttachment *_self = (VertexAttachment *) (PathAttachment *) self; + return _self->getWorldVerticesLength(); } void spine_path_attachment_set_world_vertices_length(spine_path_attachment self, size_t inValue) { - ((VertexAttachment*)(PathAttachment*)self)->setWorldVerticesLength(inValue); + VertexAttachment *_self = (VertexAttachment *) (PathAttachment *) self; + _self->setWorldVerticesLength(inValue); } spine_attachment spine_path_attachment_get_timeline_attachment(spine_path_attachment self) { - return (spine_attachment)((VertexAttachment*)(PathAttachment*)self)->getTimelineAttachment(); + VertexAttachment *_self = (VertexAttachment *) (PathAttachment *) self; + return (spine_attachment) _self->getTimelineAttachment(); } void spine_path_attachment_set_timeline_attachment(spine_path_attachment self, spine_attachment attachment) { - ((VertexAttachment*)(PathAttachment*)self)->setTimelineAttachment((Attachment *)attachment); + VertexAttachment *_self = (VertexAttachment *) (PathAttachment *) self; + _self->setTimelineAttachment((Attachment *) attachment); } void spine_path_attachment_copy_to(spine_path_attachment self, spine_vertex_attachment other) { - ((VertexAttachment*)(PathAttachment*)self)->copyTo((VertexAttachment *)other); + VertexAttachment *_self = (VertexAttachment *) (PathAttachment *) self; + _self->copyTo((VertexAttachment *) other); } -const char * spine_path_attachment_get_name(spine_path_attachment self) { - return ((VertexAttachment*)(PathAttachment*)self)->getName().buffer(); +const char *spine_path_attachment_get_name(spine_path_attachment self) { + VertexAttachment *_self = (VertexAttachment *) (PathAttachment *) self; + return _self->getName().buffer(); } int spine_path_attachment_get_ref_count(spine_path_attachment self) { - return ((VertexAttachment*)(PathAttachment*)self)->getRefCount(); + VertexAttachment *_self = (VertexAttachment *) (PathAttachment *) self; + return _self->getRefCount(); } void spine_path_attachment_reference(spine_path_attachment self) { - ((VertexAttachment*)(PathAttachment*)self)->reference(); + VertexAttachment *_self = (VertexAttachment *) (PathAttachment *) self; + _self->reference(); } void spine_path_attachment_dereference(spine_path_attachment self) { - ((VertexAttachment*)(PathAttachment*)self)->dereference(); + VertexAttachment *_self = (VertexAttachment *) (PathAttachment *) self; + _self->dereference(); } spine_rtti spine_path_attachment_rtti(void) { - return (spine_rtti)&PathAttachment::rtti; + return (spine_rtti) &PathAttachment::rtti; } diff --git a/spine-c/src/generated/path_attachment.h b/spine-c/src/generated/path_attachment.h index 21c212896..d667fd950 100644 --- a/spine-c/src/generated/path_attachment.h +++ b/spine-c/src/generated/path_attachment.h @@ -8,7 +8,7 @@ extern "C" { #endif -SPINE_C_API spine_path_attachment spine_path_attachment_create(const char * name); +SPINE_C_API spine_path_attachment spine_path_attachment_create(const char *name); SPINE_C_API void spine_path_attachment_dispose(spine_path_attachment self); @@ -21,8 +21,10 @@ SPINE_C_API bool spine_path_attachment_get_constant_speed(spine_path_attachment SPINE_C_API void spine_path_attachment_set_constant_speed(spine_path_attachment self, bool inValue); SPINE_C_API spine_color spine_path_attachment_get_color(spine_path_attachment self); SPINE_C_API spine_attachment spine_path_attachment_copy(spine_path_attachment self); -SPINE_C_API void spine_path_attachment_compute_world_vertices_1(spine_path_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, float * worldVertices, size_t offset, size_t stride); -SPINE_C_API void spine_path_attachment_compute_world_vertices_2(spine_path_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, spine_array_float worldVertices, size_t offset, size_t stride); +SPINE_C_API void spine_path_attachment_compute_world_vertices_1(spine_path_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, + size_t count, float *worldVertices, size_t offset, size_t stride); +SPINE_C_API void spine_path_attachment_compute_world_vertices_2(spine_path_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, + size_t count, spine_array_float worldVertices, size_t offset, size_t stride); SPINE_C_API int spine_path_attachment_get_id(spine_path_attachment self); SPINE_C_API spine_array_int spine_path_attachment_get_bones(spine_path_attachment self); SPINE_C_API void spine_path_attachment_set_bones(spine_path_attachment self, spine_array_int bones); @@ -33,7 +35,7 @@ SPINE_C_API void spine_path_attachment_set_world_vertices_length(spine_path_atta SPINE_C_API spine_attachment spine_path_attachment_get_timeline_attachment(spine_path_attachment self); SPINE_C_API void spine_path_attachment_set_timeline_attachment(spine_path_attachment self, spine_attachment attachment); SPINE_C_API void spine_path_attachment_copy_to(spine_path_attachment self, spine_vertex_attachment other); -SPINE_C_API const char * spine_path_attachment_get_name(spine_path_attachment self); +SPINE_C_API const char *spine_path_attachment_get_name(spine_path_attachment self); SPINE_C_API int spine_path_attachment_get_ref_count(spine_path_attachment self); SPINE_C_API void spine_path_attachment_reference(spine_path_attachment self); SPINE_C_API void spine_path_attachment_dereference(spine_path_attachment self); diff --git a/spine-c/src/generated/path_constraint.cpp b/spine-c/src/generated/path_constraint.cpp index b2e34e868..948c53ba6 100644 --- a/spine-c/src/generated/path_constraint.cpp +++ b/spine-c/src/generated/path_constraint.cpp @@ -4,77 +4,100 @@ using namespace spine; spine_path_constraint spine_path_constraint_create(spine_path_constraint_data data, spine_skeleton skeleton) { - return (spine_path_constraint) new (__FILE__, __LINE__) PathConstraint(*((PathConstraintData*)data), *((Skeleton*)skeleton)); + return (spine_path_constraint) new (__FILE__, __LINE__) PathConstraint(*((PathConstraintData *) data), *((Skeleton *) skeleton)); } void spine_path_constraint_dispose(spine_path_constraint self) { - delete (PathConstraint*)self; + delete (PathConstraint *) self; } spine_rtti spine_path_constraint_get_rtti(spine_path_constraint self) { - return (spine_rtti)&((PathConstraint*)self)->getRTTI(); + PathConstraint *_self = (PathConstraint *) self; + return (spine_rtti) &_self->getRTTI(); } spine_path_constraint spine_path_constraint_copy(spine_path_constraint self, spine_skeleton skeleton) { - return (spine_path_constraint)((PathConstraint*)self)->copy(*((Skeleton*)skeleton)); + PathConstraint *_self = (PathConstraint *) self; + return (spine_path_constraint) _self->copy(*((Skeleton *) skeleton)); } void spine_path_constraint_update(spine_path_constraint self, spine_skeleton skeleton, spine_physics physics) { - ((PathConstraint*)self)->update(*((Skeleton*)skeleton), (Physics)physics); + PathConstraint *_self = (PathConstraint *) self; + _self->update(*((Skeleton *) skeleton), (Physics) physics); } void spine_path_constraint_sort(spine_path_constraint self, spine_skeleton skeleton) { - ((PathConstraint*)self)->sort(*((Skeleton*)skeleton)); + PathConstraint *_self = (PathConstraint *) self; + _self->sort(*((Skeleton *) skeleton)); } bool spine_path_constraint_is_source_active(spine_path_constraint self) { - return ((PathConstraint*)self)->isSourceActive(); + PathConstraint *_self = (PathConstraint *) self; + return _self->isSourceActive(); } spine_array_bone_pose spine_path_constraint_get_bones(spine_path_constraint self) { - return (spine_array_bone_pose)&((PathConstraint*)self)->getBones(); + PathConstraint *_self = (PathConstraint *) self; + return (spine_array_bone_pose) &_self->getBones(); } spine_slot spine_path_constraint_get_slot(spine_path_constraint self) { - return (spine_slot)((PathConstraint*)self)->getSlot(); + PathConstraint *_self = (PathConstraint *) self; + return (spine_slot) _self->getSlot(); } void spine_path_constraint_set_slot(spine_path_constraint self, spine_slot slot) { - ((PathConstraint*)self)->setSlot((Slot *)slot); + PathConstraint *_self = (PathConstraint *) self; + _self->setSlot((Slot *) slot); } spine_path_constraint_data spine_path_constraint_get_data(spine_path_constraint self) { - return (spine_path_constraint_data)&((PathConstraint*)self)->getData(); + PathConstraint *_self = (PathConstraint *) self; + return (spine_path_constraint_data) &_self->getData(); } spine_path_constraint_pose spine_path_constraint_get_pose(spine_path_constraint self) { - return (spine_path_constraint_pose)&((ConstraintGeneric*)(PathConstraint*)self)->getPose(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (PathConstraint *) self; + return (spine_path_constraint_pose) &_self->getPose(); } spine_path_constraint_pose spine_path_constraint_get_applied_pose(spine_path_constraint self) { - return (spine_path_constraint_pose)&((ConstraintGeneric*)(PathConstraint*)self)->getAppliedPose(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (PathConstraint *) self; + return (spine_path_constraint_pose) &_self->getAppliedPose(); } void spine_path_constraint_reset_constrained(spine_path_constraint self) { - ((ConstraintGeneric*)(PathConstraint*)self)->resetConstrained(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (PathConstraint *) self; + _self->resetConstrained(); } void spine_path_constraint_constrained(spine_path_constraint self) { - ((ConstraintGeneric*)(PathConstraint*)self)->constrained(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (PathConstraint *) self; + _self->constrained(); } bool spine_path_constraint_is_pose_equal_to_applied(spine_path_constraint self) { - return ((ConstraintGeneric*)(PathConstraint*)self)->isPoseEqualToApplied(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (PathConstraint *) self; + return _self->isPoseEqualToApplied(); } bool spine_path_constraint_is_active(spine_path_constraint self) { - return ((ConstraintGeneric*)(PathConstraint*)self)->isActive(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (PathConstraint *) self; + return _self->isActive(); } void spine_path_constraint_set_active(spine_path_constraint self, bool active) { - ((ConstraintGeneric*)(PathConstraint*)self)->setActive(active); + ConstraintGeneric + *_self = (ConstraintGeneric *) (PathConstraint *) self; + _self->setActive(active); } spine_rtti spine_path_constraint_rtti(void) { - return (spine_rtti)&PathConstraint::rtti; + return (spine_rtti) &PathConstraint::rtti; } diff --git a/spine-c/src/generated/path_constraint_data.cpp b/spine-c/src/generated/path_constraint_data.cpp index 782bdcf66..cc617792e 100644 --- a/spine-c/src/generated/path_constraint_data.cpp +++ b/spine-c/src/generated/path_constraint_data.cpp @@ -3,82 +3,103 @@ using namespace spine; -spine_path_constraint_data spine_path_constraint_data_create(const char * name) { - return (spine_path_constraint_data) new (__FILE__, __LINE__) PathConstraintData(String(name)); +spine_path_constraint_data spine_path_constraint_data_create(const char *name) { + return (spine_path_constraint_data) new (__FILE__, __LINE__) PathConstraintData(String(name)); } void spine_path_constraint_data_dispose(spine_path_constraint_data self) { - delete (PathConstraintData*)self; + delete (PathConstraintData *) self; } spine_rtti spine_path_constraint_data_get_rtti(spine_path_constraint_data self) { - return (spine_rtti)&((PathConstraintData*)self)->getRTTI(); + PathConstraintData *_self = (PathConstraintData *) self; + return (spine_rtti) &_self->getRTTI(); } spine_constraint spine_path_constraint_data_create_method(spine_path_constraint_data self, spine_skeleton skeleton) { - return (spine_constraint)((PathConstraintData*)self)->create(*((Skeleton*)skeleton)); + PathConstraintData *_self = (PathConstraintData *) self; + return (spine_constraint) _self->create(*((Skeleton *) skeleton)); } spine_array_bone_data spine_path_constraint_data_get_bones(spine_path_constraint_data self) { - return (spine_array_bone_data)&((PathConstraintData*)self)->getBones(); + PathConstraintData *_self = (PathConstraintData *) self; + return (spine_array_bone_data) &_self->getBones(); } spine_slot_data spine_path_constraint_data_get_slot(spine_path_constraint_data self) { - return (spine_slot_data)((PathConstraintData*)self)->getSlot(); + PathConstraintData *_self = (PathConstraintData *) self; + return (spine_slot_data) _self->getSlot(); } void spine_path_constraint_data_set_slot(spine_path_constraint_data self, spine_slot_data slot) { - ((PathConstraintData*)self)->setSlot((SlotData *)slot); + PathConstraintData *_self = (PathConstraintData *) self; + _self->setSlot((SlotData *) slot); } spine_position_mode spine_path_constraint_data_get_position_mode(spine_path_constraint_data self) { - return (spine_position_mode)((PathConstraintData*)self)->getPositionMode(); + PathConstraintData *_self = (PathConstraintData *) self; + return (spine_position_mode) _self->getPositionMode(); } void spine_path_constraint_data_set_position_mode(spine_path_constraint_data self, spine_position_mode positionMode) { - ((PathConstraintData*)self)->setPositionMode((PositionMode)positionMode); + PathConstraintData *_self = (PathConstraintData *) self; + _self->setPositionMode((PositionMode) positionMode); } spine_spacing_mode spine_path_constraint_data_get_spacing_mode(spine_path_constraint_data self) { - return (spine_spacing_mode)((PathConstraintData*)self)->getSpacingMode(); + PathConstraintData *_self = (PathConstraintData *) self; + return (spine_spacing_mode) _self->getSpacingMode(); } void spine_path_constraint_data_set_spacing_mode(spine_path_constraint_data self, spine_spacing_mode spacingMode) { - ((PathConstraintData*)self)->setSpacingMode((SpacingMode)spacingMode); + PathConstraintData *_self = (PathConstraintData *) self; + _self->setSpacingMode((SpacingMode) spacingMode); } spine_rotate_mode spine_path_constraint_data_get_rotate_mode(spine_path_constraint_data self) { - return (spine_rotate_mode)((PathConstraintData*)self)->getRotateMode(); + PathConstraintData *_self = (PathConstraintData *) self; + return (spine_rotate_mode) _self->getRotateMode(); } void spine_path_constraint_data_set_rotate_mode(spine_path_constraint_data self, spine_rotate_mode rotateMode) { - ((PathConstraintData*)self)->setRotateMode((RotateMode)rotateMode); + PathConstraintData *_self = (PathConstraintData *) self; + _self->setRotateMode((RotateMode) rotateMode); } float spine_path_constraint_data_get_offset_rotation(spine_path_constraint_data self) { - return ((PathConstraintData*)self)->getOffsetRotation(); + PathConstraintData *_self = (PathConstraintData *) self; + return _self->getOffsetRotation(); } void spine_path_constraint_data_set_offset_rotation(spine_path_constraint_data self, float offsetRotation) { - ((PathConstraintData*)self)->setOffsetRotation(offsetRotation); + PathConstraintData *_self = (PathConstraintData *) self; + _self->setOffsetRotation(offsetRotation); } -const char * spine_path_constraint_data_get_name(spine_path_constraint_data self) { - return ((ConstraintDataGeneric*)(PathConstraintData*)self)->getName().buffer(); +const char *spine_path_constraint_data_get_name(spine_path_constraint_data self) { + ConstraintDataGeneric + *_self = (ConstraintDataGeneric *) (PathConstraintData *) self; + return _self->getName().buffer(); } bool spine_path_constraint_data_get_skin_required(spine_path_constraint_data self) { - return ((ConstraintDataGeneric*)(PathConstraintData*)self)->getSkinRequired(); + ConstraintDataGeneric + *_self = (ConstraintDataGeneric *) (PathConstraintData *) self; + return _self->getSkinRequired(); } spine_path_constraint_pose spine_path_constraint_data_get_setup_pose(spine_path_constraint_data self) { - return (spine_path_constraint_pose)&((ConstraintDataGeneric*)(PathConstraintData*)self)->getSetupPose(); + ConstraintDataGeneric + *_self = (ConstraintDataGeneric *) (PathConstraintData *) self; + return (spine_path_constraint_pose) &_self->getSetupPose(); } void spine_path_constraint_data_set_skin_required(spine_path_constraint_data self, bool skinRequired) { - ((ConstraintDataGeneric*)(PathConstraintData*)self)->setSkinRequired(skinRequired); + ConstraintDataGeneric + *_self = (ConstraintDataGeneric *) (PathConstraintData *) self; + _self->setSkinRequired(skinRequired); } spine_rtti spine_path_constraint_data_rtti(void) { - return (spine_rtti)&PathConstraintData::rtti; + return (spine_rtti) &PathConstraintData::rtti; } diff --git a/spine-c/src/generated/path_constraint_data.h b/spine-c/src/generated/path_constraint_data.h index 8a6e65643..31a15d35b 100644 --- a/spine-c/src/generated/path_constraint_data.h +++ b/spine-c/src/generated/path_constraint_data.h @@ -8,7 +8,7 @@ extern "C" { #endif -SPINE_C_API spine_path_constraint_data spine_path_constraint_data_create(const char * name); +SPINE_C_API spine_path_constraint_data spine_path_constraint_data_create(const char *name); SPINE_C_API void spine_path_constraint_data_dispose(spine_path_constraint_data self); @@ -25,7 +25,7 @@ SPINE_C_API spine_rotate_mode spine_path_constraint_data_get_rotate_mode(spine_p SPINE_C_API void spine_path_constraint_data_set_rotate_mode(spine_path_constraint_data self, spine_rotate_mode rotateMode); SPINE_C_API float spine_path_constraint_data_get_offset_rotation(spine_path_constraint_data self); SPINE_C_API void spine_path_constraint_data_set_offset_rotation(spine_path_constraint_data self, float offsetRotation); -SPINE_C_API const char * spine_path_constraint_data_get_name(spine_path_constraint_data self); +SPINE_C_API const char *spine_path_constraint_data_get_name(spine_path_constraint_data self); SPINE_C_API bool spine_path_constraint_data_get_skin_required(spine_path_constraint_data self); SPINE_C_API spine_path_constraint_pose spine_path_constraint_data_get_setup_pose(spine_path_constraint_data self); SPINE_C_API void spine_path_constraint_data_set_skin_required(spine_path_constraint_data self, bool skinRequired); diff --git a/spine-c/src/generated/path_constraint_mix_timeline.cpp b/spine-c/src/generated/path_constraint_mix_timeline.cpp index 3658e5ea3..a42663303 100644 --- a/spine-c/src/generated/path_constraint_mix_timeline.cpp +++ b/spine-c/src/generated/path_constraint_mix_timeline.cpp @@ -4,73 +4,94 @@ using namespace spine; spine_path_constraint_mix_timeline spine_path_constraint_mix_timeline_create(size_t frameCount, size_t bezierCount, int constraintIndex) { - return (spine_path_constraint_mix_timeline) new (__FILE__, __LINE__) PathConstraintMixTimeline(frameCount, bezierCount, constraintIndex); + return (spine_path_constraint_mix_timeline) new (__FILE__, __LINE__) PathConstraintMixTimeline(frameCount, bezierCount, constraintIndex); } void spine_path_constraint_mix_timeline_dispose(spine_path_constraint_mix_timeline self) { - delete (PathConstraintMixTimeline*)self; + delete (PathConstraintMixTimeline *) self; } spine_rtti spine_path_constraint_mix_timeline_get_rtti(spine_path_constraint_mix_timeline self) { - return (spine_rtti)&((PathConstraintMixTimeline*)self)->getRTTI(); + PathConstraintMixTimeline *_self = (PathConstraintMixTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_path_constraint_mix_timeline_apply(spine_path_constraint_mix_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((PathConstraintMixTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_path_constraint_mix_timeline_apply(spine_path_constraint_mix_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose) { + PathConstraintMixTimeline *_self = (PathConstraintMixTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } -void spine_path_constraint_mix_timeline_set_frame(spine_path_constraint_mix_timeline self, int frame, float time, float mixRotate, float mixX, float mixY) { - ((PathConstraintMixTimeline*)self)->setFrame(frame, time, mixRotate, mixX, mixY); +void spine_path_constraint_mix_timeline_set_frame(spine_path_constraint_mix_timeline self, int frame, float time, float mixRotate, float mixX, + float mixY) { + PathConstraintMixTimeline *_self = (PathConstraintMixTimeline *) self; + _self->setFrame(frame, time, mixRotate, mixX, mixY); } void spine_path_constraint_mix_timeline_set_linear(spine_path_constraint_mix_timeline self, size_t frame) { - ((CurveTimeline*)(PathConstraintMixTimeline*)self)->setLinear(frame); + CurveTimeline *_self = (CurveTimeline *) (PathConstraintMixTimeline *) self; + _self->setLinear(frame); } void spine_path_constraint_mix_timeline_set_stepped(spine_path_constraint_mix_timeline self, size_t frame) { - ((CurveTimeline*)(PathConstraintMixTimeline*)self)->setStepped(frame); + CurveTimeline *_self = (CurveTimeline *) (PathConstraintMixTimeline *) self; + _self->setStepped(frame); } -void spine_path_constraint_mix_timeline_set_bezier(spine_path_constraint_mix_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((CurveTimeline*)(PathConstraintMixTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_path_constraint_mix_timeline_set_bezier(spine_path_constraint_mix_timeline self, size_t bezier, size_t frame, float value, float time1, + float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { + CurveTimeline *_self = (CurveTimeline *) (PathConstraintMixTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } -float spine_path_constraint_mix_timeline_get_bezier_value(spine_path_constraint_mix_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((CurveTimeline*)(PathConstraintMixTimeline*)self)->getBezierValue(time, frame, valueOffset, i); +float spine_path_constraint_mix_timeline_get_bezier_value(spine_path_constraint_mix_timeline self, float time, size_t frame, size_t valueOffset, + size_t i) { + CurveTimeline *_self = (CurveTimeline *) (PathConstraintMixTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_path_constraint_mix_timeline_get_curves(spine_path_constraint_mix_timeline self) { - return (spine_array_float)&((CurveTimeline*)(PathConstraintMixTimeline*)self)->getCurves(); + CurveTimeline *_self = (CurveTimeline *) (PathConstraintMixTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_path_constraint_mix_timeline_get_frame_entries(spine_path_constraint_mix_timeline self) { - return ((CurveTimeline*)(PathConstraintMixTimeline*)self)->getFrameEntries(); + CurveTimeline *_self = (CurveTimeline *) (PathConstraintMixTimeline *) self; + return _self->getFrameEntries(); } size_t spine_path_constraint_mix_timeline_get_frame_count(spine_path_constraint_mix_timeline self) { - return ((CurveTimeline*)(PathConstraintMixTimeline*)self)->getFrameCount(); + CurveTimeline *_self = (CurveTimeline *) (PathConstraintMixTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_path_constraint_mix_timeline_get_frames(spine_path_constraint_mix_timeline self) { - return (spine_array_float)&((CurveTimeline*)(PathConstraintMixTimeline*)self)->getFrames(); + CurveTimeline *_self = (CurveTimeline *) (PathConstraintMixTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_path_constraint_mix_timeline_get_duration(spine_path_constraint_mix_timeline self) { - return ((CurveTimeline*)(PathConstraintMixTimeline*)self)->getDuration(); + CurveTimeline *_self = (CurveTimeline *) (PathConstraintMixTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_path_constraint_mix_timeline_get_property_ids(spine_path_constraint_mix_timeline self) { - return (spine_array_property_id)&((CurveTimeline*)(PathConstraintMixTimeline*)self)->getPropertyIds(); + CurveTimeline *_self = (CurveTimeline *) (PathConstraintMixTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_path_constraint_mix_timeline_get_constraint_index(spine_path_constraint_mix_timeline self) { - return ((ConstraintTimeline*)(PathConstraintMixTimeline*)self)->getConstraintIndex(); + ConstraintTimeline *_self = (ConstraintTimeline *) (PathConstraintMixTimeline *) self; + return _self->getConstraintIndex(); } void spine_path_constraint_mix_timeline_set_constraint_index(spine_path_constraint_mix_timeline self, int inValue) { - ((ConstraintTimeline*)(PathConstraintMixTimeline*)self)->setConstraintIndex(inValue); + ConstraintTimeline *_self = (ConstraintTimeline *) (PathConstraintMixTimeline *) self; + _self->setConstraintIndex(inValue); } spine_rtti spine_path_constraint_mix_timeline_rtti(void) { - return (spine_rtti)&PathConstraintMixTimeline::rtti; + return (spine_rtti) &PathConstraintMixTimeline::rtti; } diff --git a/spine-c/src/generated/path_constraint_mix_timeline.h b/spine-c/src/generated/path_constraint_mix_timeline.h index ffffb9b70..e3dcb90eb 100644 --- a/spine-c/src/generated/path_constraint_mix_timeline.h +++ b/spine-c/src/generated/path_constraint_mix_timeline.h @@ -13,12 +13,18 @@ SPINE_C_API spine_path_constraint_mix_timeline spine_path_constraint_mix_timelin SPINE_C_API void spine_path_constraint_mix_timeline_dispose(spine_path_constraint_mix_timeline self); SPINE_C_API spine_rtti spine_path_constraint_mix_timeline_get_rtti(spine_path_constraint_mix_timeline self); -SPINE_C_API void spine_path_constraint_mix_timeline_apply(spine_path_constraint_mix_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); -SPINE_C_API void spine_path_constraint_mix_timeline_set_frame(spine_path_constraint_mix_timeline self, int frame, float time, float mixRotate, float mixX, float mixY); +SPINE_C_API void spine_path_constraint_mix_timeline_apply(spine_path_constraint_mix_timeline self, spine_skeleton skeleton, float lastTime, + float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, + spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_path_constraint_mix_timeline_set_frame(spine_path_constraint_mix_timeline self, int frame, float time, float mixRotate, + float mixX, float mixY); SPINE_C_API void spine_path_constraint_mix_timeline_set_linear(spine_path_constraint_mix_timeline self, size_t frame); SPINE_C_API void spine_path_constraint_mix_timeline_set_stepped(spine_path_constraint_mix_timeline self, size_t frame); -SPINE_C_API void spine_path_constraint_mix_timeline_set_bezier(spine_path_constraint_mix_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); -SPINE_C_API float spine_path_constraint_mix_timeline_get_bezier_value(spine_path_constraint_mix_timeline self, float time, size_t frame, size_t valueOffset, size_t i); +SPINE_C_API void spine_path_constraint_mix_timeline_set_bezier(spine_path_constraint_mix_timeline self, size_t bezier, size_t frame, float value, + float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, + float value2); +SPINE_C_API float spine_path_constraint_mix_timeline_get_bezier_value(spine_path_constraint_mix_timeline self, float time, size_t frame, + size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_path_constraint_mix_timeline_get_curves(spine_path_constraint_mix_timeline self); SPINE_C_API size_t spine_path_constraint_mix_timeline_get_frame_entries(spine_path_constraint_mix_timeline self); SPINE_C_API size_t spine_path_constraint_mix_timeline_get_frame_count(spine_path_constraint_mix_timeline self); diff --git a/spine-c/src/generated/path_constraint_pose.cpp b/spine-c/src/generated/path_constraint_pose.cpp index 0706e2990..51549535a 100644 --- a/spine-c/src/generated/path_constraint_pose.cpp +++ b/spine-c/src/generated/path_constraint_pose.cpp @@ -4,53 +4,64 @@ using namespace spine; spine_path_constraint_pose spine_path_constraint_pose_create(void) { - return (spine_path_constraint_pose) new (__FILE__, __LINE__) PathConstraintPose(); + return (spine_path_constraint_pose) new (__FILE__, __LINE__) PathConstraintPose(); } void spine_path_constraint_pose_dispose(spine_path_constraint_pose self) { - delete (PathConstraintPose*)self; + delete (PathConstraintPose *) self; } void spine_path_constraint_pose_set(spine_path_constraint_pose self, spine_path_constraint_pose pose) { - ((PathConstraintPose*)self)->set(*((PathConstraintPose*)pose)); + PathConstraintPose *_self = (PathConstraintPose *) self; + _self->set(*((PathConstraintPose *) pose)); } float spine_path_constraint_pose_get_position(spine_path_constraint_pose self) { - return ((PathConstraintPose*)self)->getPosition(); + PathConstraintPose *_self = (PathConstraintPose *) self; + return _self->getPosition(); } void spine_path_constraint_pose_set_position(spine_path_constraint_pose self, float position) { - ((PathConstraintPose*)self)->setPosition(position); + PathConstraintPose *_self = (PathConstraintPose *) self; + _self->setPosition(position); } float spine_path_constraint_pose_get_spacing(spine_path_constraint_pose self) { - return ((PathConstraintPose*)self)->getSpacing(); + PathConstraintPose *_self = (PathConstraintPose *) self; + return _self->getSpacing(); } void spine_path_constraint_pose_set_spacing(spine_path_constraint_pose self, float spacing) { - ((PathConstraintPose*)self)->setSpacing(spacing); + PathConstraintPose *_self = (PathConstraintPose *) self; + _self->setSpacing(spacing); } float spine_path_constraint_pose_get_mix_rotate(spine_path_constraint_pose self) { - return ((PathConstraintPose*)self)->getMixRotate(); + PathConstraintPose *_self = (PathConstraintPose *) self; + return _self->getMixRotate(); } void spine_path_constraint_pose_set_mix_rotate(spine_path_constraint_pose self, float mixRotate) { - ((PathConstraintPose*)self)->setMixRotate(mixRotate); + PathConstraintPose *_self = (PathConstraintPose *) self; + _self->setMixRotate(mixRotate); } float spine_path_constraint_pose_get_mix_x(spine_path_constraint_pose self) { - return ((PathConstraintPose*)self)->getMixX(); + PathConstraintPose *_self = (PathConstraintPose *) self; + return _self->getMixX(); } void spine_path_constraint_pose_set_mix_x(spine_path_constraint_pose self, float mixX) { - ((PathConstraintPose*)self)->setMixX(mixX); + PathConstraintPose *_self = (PathConstraintPose *) self; + _self->setMixX(mixX); } float spine_path_constraint_pose_get_mix_y(spine_path_constraint_pose self) { - return ((PathConstraintPose*)self)->getMixY(); + PathConstraintPose *_self = (PathConstraintPose *) self; + return _self->getMixY(); } void spine_path_constraint_pose_set_mix_y(spine_path_constraint_pose self, float mixY) { - ((PathConstraintPose*)self)->setMixY(mixY); + PathConstraintPose *_self = (PathConstraintPose *) self; + _self->setMixY(mixY); } diff --git a/spine-c/src/generated/path_constraint_position_timeline.cpp b/spine-c/src/generated/path_constraint_position_timeline.cpp index b36f3da08..1cad78780 100644 --- a/spine-c/src/generated/path_constraint_position_timeline.cpp +++ b/spine-c/src/generated/path_constraint_position_timeline.cpp @@ -4,93 +4,124 @@ using namespace spine; spine_path_constraint_position_timeline spine_path_constraint_position_timeline_create(size_t frameCount, size_t bezierCount, int constraintIndex) { - return (spine_path_constraint_position_timeline) new (__FILE__, __LINE__) PathConstraintPositionTimeline(frameCount, bezierCount, constraintIndex); + return (spine_path_constraint_position_timeline) new (__FILE__, __LINE__) + PathConstraintPositionTimeline(frameCount, bezierCount, constraintIndex); } void spine_path_constraint_position_timeline_dispose(spine_path_constraint_position_timeline self) { - delete (PathConstraintPositionTimeline*)self; + delete (PathConstraintPositionTimeline *) self; } spine_rtti spine_path_constraint_position_timeline_get_rtti(spine_path_constraint_position_timeline self) { - return (spine_rtti)&((PathConstraintPositionTimeline*)self)->getRTTI(); + PathConstraintPositionTimeline *_self = (PathConstraintPositionTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_path_constraint_position_timeline_apply(spine_path_constraint_position_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((PathConstraintPositionTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_path_constraint_position_timeline_apply(spine_path_constraint_position_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose) { + PathConstraintPositionTimeline *_self = (PathConstraintPositionTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_path_constraint_position_timeline_set_frame(spine_path_constraint_position_timeline self, size_t frame, float time, float value) { - ((ConstraintTimeline1*)(PathConstraintPositionTimeline*)self)->setFrame(frame, time, value); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintPositionTimeline *) self; + _self->setFrame(frame, time, value); } float spine_path_constraint_position_timeline_get_curve_value(spine_path_constraint_position_timeline self, float time) { - return ((ConstraintTimeline1*)(PathConstraintPositionTimeline*)self)->getCurveValue(time); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintPositionTimeline *) self; + return _self->getCurveValue(time); } -float spine_path_constraint_position_timeline_get_relative_value(spine_path_constraint_position_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((ConstraintTimeline1*)(PathConstraintPositionTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_path_constraint_position_timeline_get_relative_value(spine_path_constraint_position_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintPositionTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_path_constraint_position_timeline_get_absolute_value_1(spine_path_constraint_position_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((ConstraintTimeline1*)(PathConstraintPositionTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_path_constraint_position_timeline_get_absolute_value_1(spine_path_constraint_position_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintPositionTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_path_constraint_position_timeline_get_absolute_value_2(spine_path_constraint_position_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((ConstraintTimeline1*)(PathConstraintPositionTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_path_constraint_position_timeline_get_absolute_value_2(spine_path_constraint_position_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup, float value) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintPositionTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_path_constraint_position_timeline_get_scale_value(spine_path_constraint_position_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((ConstraintTimeline1*)(PathConstraintPositionTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_path_constraint_position_timeline_get_scale_value(spine_path_constraint_position_timeline self, float time, float alpha, + spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintPositionTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_path_constraint_position_timeline_set_linear(spine_path_constraint_position_timeline self, size_t frame) { - ((ConstraintTimeline1*)(PathConstraintPositionTimeline*)self)->setLinear(frame); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintPositionTimeline *) self; + _self->setLinear(frame); } void spine_path_constraint_position_timeline_set_stepped(spine_path_constraint_position_timeline self, size_t frame) { - ((ConstraintTimeline1*)(PathConstraintPositionTimeline*)self)->setStepped(frame); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintPositionTimeline *) self; + _self->setStepped(frame); } -void spine_path_constraint_position_timeline_set_bezier(spine_path_constraint_position_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((ConstraintTimeline1*)(PathConstraintPositionTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_path_constraint_position_timeline_set_bezier(spine_path_constraint_position_timeline self, size_t bezier, size_t frame, float value, + float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, + float value2) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintPositionTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } -float spine_path_constraint_position_timeline_get_bezier_value(spine_path_constraint_position_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((ConstraintTimeline1*)(PathConstraintPositionTimeline*)self)->getBezierValue(time, frame, valueOffset, i); +float spine_path_constraint_position_timeline_get_bezier_value(spine_path_constraint_position_timeline self, float time, size_t frame, + size_t valueOffset, size_t i) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintPositionTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_path_constraint_position_timeline_get_curves(spine_path_constraint_position_timeline self) { - return (spine_array_float)&((ConstraintTimeline1*)(PathConstraintPositionTimeline*)self)->getCurves(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintPositionTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_path_constraint_position_timeline_get_frame_entries(spine_path_constraint_position_timeline self) { - return ((ConstraintTimeline1*)(PathConstraintPositionTimeline*)self)->getFrameEntries(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintPositionTimeline *) self; + return _self->getFrameEntries(); } size_t spine_path_constraint_position_timeline_get_frame_count(spine_path_constraint_position_timeline self) { - return ((ConstraintTimeline1*)(PathConstraintPositionTimeline*)self)->getFrameCount(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintPositionTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_path_constraint_position_timeline_get_frames(spine_path_constraint_position_timeline self) { - return (spine_array_float)&((ConstraintTimeline1*)(PathConstraintPositionTimeline*)self)->getFrames(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintPositionTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_path_constraint_position_timeline_get_duration(spine_path_constraint_position_timeline self) { - return ((ConstraintTimeline1*)(PathConstraintPositionTimeline*)self)->getDuration(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintPositionTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_path_constraint_position_timeline_get_property_ids(spine_path_constraint_position_timeline self) { - return (spine_array_property_id)&((ConstraintTimeline1*)(PathConstraintPositionTimeline*)self)->getPropertyIds(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintPositionTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_path_constraint_position_timeline_get_constraint_index(spine_path_constraint_position_timeline self) { - return ((ConstraintTimeline1*)(PathConstraintPositionTimeline*)self)->getConstraintIndex(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintPositionTimeline *) self; + return _self->getConstraintIndex(); } void spine_path_constraint_position_timeline_set_constraint_index(spine_path_constraint_position_timeline self, int inValue) { - ((ConstraintTimeline1*)(PathConstraintPositionTimeline*)self)->setConstraintIndex(inValue); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintPositionTimeline *) self; + _self->setConstraintIndex(inValue); } spine_rtti spine_path_constraint_position_timeline_rtti(void) { - return (spine_rtti)&PathConstraintPositionTimeline::rtti; + return (spine_rtti) &PathConstraintPositionTimeline::rtti; } diff --git a/spine-c/src/generated/path_constraint_position_timeline.h b/spine-c/src/generated/path_constraint_position_timeline.h index 66d69440a..058d0c2a1 100644 --- a/spine-c/src/generated/path_constraint_position_timeline.h +++ b/spine-c/src/generated/path_constraint_position_timeline.h @@ -8,22 +8,34 @@ extern "C" { #endif -SPINE_C_API spine_path_constraint_position_timeline spine_path_constraint_position_timeline_create(size_t frameCount, size_t bezierCount, int constraintIndex); +SPINE_C_API spine_path_constraint_position_timeline spine_path_constraint_position_timeline_create(size_t frameCount, size_t bezierCount, + int constraintIndex); SPINE_C_API void spine_path_constraint_position_timeline_dispose(spine_path_constraint_position_timeline self); SPINE_C_API spine_rtti spine_path_constraint_position_timeline_get_rtti(spine_path_constraint_position_timeline self); -SPINE_C_API void spine_path_constraint_position_timeline_apply(spine_path_constraint_position_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); -SPINE_C_API void spine_path_constraint_position_timeline_set_frame(spine_path_constraint_position_timeline self, size_t frame, float time, float value); +SPINE_C_API void spine_path_constraint_position_timeline_apply(spine_path_constraint_position_timeline self, spine_skeleton skeleton, float lastTime, + float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, + spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_path_constraint_position_timeline_set_frame(spine_path_constraint_position_timeline self, size_t frame, float time, + float value); SPINE_C_API float spine_path_constraint_position_timeline_get_curve_value(spine_path_constraint_position_timeline self, float time); -SPINE_C_API float spine_path_constraint_position_timeline_get_relative_value(spine_path_constraint_position_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_path_constraint_position_timeline_get_absolute_value_1(spine_path_constraint_position_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_path_constraint_position_timeline_get_absolute_value_2(spine_path_constraint_position_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_path_constraint_position_timeline_get_scale_value(spine_path_constraint_position_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_path_constraint_position_timeline_get_relative_value(spine_path_constraint_position_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_path_constraint_position_timeline_get_absolute_value_1(spine_path_constraint_position_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_path_constraint_position_timeline_get_absolute_value_2(spine_path_constraint_position_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup, float value); +SPINE_C_API float spine_path_constraint_position_timeline_get_scale_value(spine_path_constraint_position_timeline self, float time, float alpha, + spine_mix_blend blend, spine_mix_direction direction, float current, + float setup); SPINE_C_API void spine_path_constraint_position_timeline_set_linear(spine_path_constraint_position_timeline self, size_t frame); SPINE_C_API void spine_path_constraint_position_timeline_set_stepped(spine_path_constraint_position_timeline self, size_t frame); -SPINE_C_API void spine_path_constraint_position_timeline_set_bezier(spine_path_constraint_position_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); -SPINE_C_API float spine_path_constraint_position_timeline_get_bezier_value(spine_path_constraint_position_timeline self, float time, size_t frame, size_t valueOffset, size_t i); +SPINE_C_API void spine_path_constraint_position_timeline_set_bezier(spine_path_constraint_position_timeline self, size_t bezier, size_t frame, + float value, float time1, float value1, float cx1, float cy1, float cx2, + float cy2, float time2, float value2); +SPINE_C_API float spine_path_constraint_position_timeline_get_bezier_value(spine_path_constraint_position_timeline self, float time, size_t frame, + size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_path_constraint_position_timeline_get_curves(spine_path_constraint_position_timeline self); SPINE_C_API size_t spine_path_constraint_position_timeline_get_frame_entries(spine_path_constraint_position_timeline self); SPINE_C_API size_t spine_path_constraint_position_timeline_get_frame_count(spine_path_constraint_position_timeline self); diff --git a/spine-c/src/generated/path_constraint_spacing_timeline.cpp b/spine-c/src/generated/path_constraint_spacing_timeline.cpp index 9cbff6677..2136780b3 100644 --- a/spine-c/src/generated/path_constraint_spacing_timeline.cpp +++ b/spine-c/src/generated/path_constraint_spacing_timeline.cpp @@ -4,93 +4,123 @@ using namespace spine; spine_path_constraint_spacing_timeline spine_path_constraint_spacing_timeline_create(size_t frameCount, size_t bezierCount, int constraintIndex) { - return (spine_path_constraint_spacing_timeline) new (__FILE__, __LINE__) PathConstraintSpacingTimeline(frameCount, bezierCount, constraintIndex); + return (spine_path_constraint_spacing_timeline) new (__FILE__, __LINE__) PathConstraintSpacingTimeline(frameCount, bezierCount, constraintIndex); } void spine_path_constraint_spacing_timeline_dispose(spine_path_constraint_spacing_timeline self) { - delete (PathConstraintSpacingTimeline*)self; + delete (PathConstraintSpacingTimeline *) self; } spine_rtti spine_path_constraint_spacing_timeline_get_rtti(spine_path_constraint_spacing_timeline self) { - return (spine_rtti)&((PathConstraintSpacingTimeline*)self)->getRTTI(); + PathConstraintSpacingTimeline *_self = (PathConstraintSpacingTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_path_constraint_spacing_timeline_apply(spine_path_constraint_spacing_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((PathConstraintSpacingTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_path_constraint_spacing_timeline_apply(spine_path_constraint_spacing_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose) { + PathConstraintSpacingTimeline *_self = (PathConstraintSpacingTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_path_constraint_spacing_timeline_set_frame(spine_path_constraint_spacing_timeline self, size_t frame, float time, float value) { - ((ConstraintTimeline1*)(PathConstraintSpacingTimeline*)self)->setFrame(frame, time, value); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintSpacingTimeline *) self; + _self->setFrame(frame, time, value); } float spine_path_constraint_spacing_timeline_get_curve_value(spine_path_constraint_spacing_timeline self, float time) { - return ((ConstraintTimeline1*)(PathConstraintSpacingTimeline*)self)->getCurveValue(time); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintSpacingTimeline *) self; + return _self->getCurveValue(time); } -float spine_path_constraint_spacing_timeline_get_relative_value(spine_path_constraint_spacing_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((ConstraintTimeline1*)(PathConstraintSpacingTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_path_constraint_spacing_timeline_get_relative_value(spine_path_constraint_spacing_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintSpacingTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_path_constraint_spacing_timeline_get_absolute_value_1(spine_path_constraint_spacing_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((ConstraintTimeline1*)(PathConstraintSpacingTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_path_constraint_spacing_timeline_get_absolute_value_1(spine_path_constraint_spacing_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintSpacingTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_path_constraint_spacing_timeline_get_absolute_value_2(spine_path_constraint_spacing_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((ConstraintTimeline1*)(PathConstraintSpacingTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_path_constraint_spacing_timeline_get_absolute_value_2(spine_path_constraint_spacing_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup, float value) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintSpacingTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_path_constraint_spacing_timeline_get_scale_value(spine_path_constraint_spacing_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((ConstraintTimeline1*)(PathConstraintSpacingTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_path_constraint_spacing_timeline_get_scale_value(spine_path_constraint_spacing_timeline self, float time, float alpha, + spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintSpacingTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_path_constraint_spacing_timeline_set_linear(spine_path_constraint_spacing_timeline self, size_t frame) { - ((ConstraintTimeline1*)(PathConstraintSpacingTimeline*)self)->setLinear(frame); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintSpacingTimeline *) self; + _self->setLinear(frame); } void spine_path_constraint_spacing_timeline_set_stepped(spine_path_constraint_spacing_timeline self, size_t frame) { - ((ConstraintTimeline1*)(PathConstraintSpacingTimeline*)self)->setStepped(frame); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintSpacingTimeline *) self; + _self->setStepped(frame); } -void spine_path_constraint_spacing_timeline_set_bezier(spine_path_constraint_spacing_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((ConstraintTimeline1*)(PathConstraintSpacingTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_path_constraint_spacing_timeline_set_bezier(spine_path_constraint_spacing_timeline self, size_t bezier, size_t frame, float value, + float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, + float value2) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintSpacingTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } -float spine_path_constraint_spacing_timeline_get_bezier_value(spine_path_constraint_spacing_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((ConstraintTimeline1*)(PathConstraintSpacingTimeline*)self)->getBezierValue(time, frame, valueOffset, i); +float spine_path_constraint_spacing_timeline_get_bezier_value(spine_path_constraint_spacing_timeline self, float time, size_t frame, + size_t valueOffset, size_t i) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintSpacingTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_path_constraint_spacing_timeline_get_curves(spine_path_constraint_spacing_timeline self) { - return (spine_array_float)&((ConstraintTimeline1*)(PathConstraintSpacingTimeline*)self)->getCurves(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintSpacingTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_path_constraint_spacing_timeline_get_frame_entries(spine_path_constraint_spacing_timeline self) { - return ((ConstraintTimeline1*)(PathConstraintSpacingTimeline*)self)->getFrameEntries(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintSpacingTimeline *) self; + return _self->getFrameEntries(); } size_t spine_path_constraint_spacing_timeline_get_frame_count(spine_path_constraint_spacing_timeline self) { - return ((ConstraintTimeline1*)(PathConstraintSpacingTimeline*)self)->getFrameCount(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintSpacingTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_path_constraint_spacing_timeline_get_frames(spine_path_constraint_spacing_timeline self) { - return (spine_array_float)&((ConstraintTimeline1*)(PathConstraintSpacingTimeline*)self)->getFrames(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintSpacingTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_path_constraint_spacing_timeline_get_duration(spine_path_constraint_spacing_timeline self) { - return ((ConstraintTimeline1*)(PathConstraintSpacingTimeline*)self)->getDuration(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintSpacingTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_path_constraint_spacing_timeline_get_property_ids(spine_path_constraint_spacing_timeline self) { - return (spine_array_property_id)&((ConstraintTimeline1*)(PathConstraintSpacingTimeline*)self)->getPropertyIds(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintSpacingTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_path_constraint_spacing_timeline_get_constraint_index(spine_path_constraint_spacing_timeline self) { - return ((ConstraintTimeline1*)(PathConstraintSpacingTimeline*)self)->getConstraintIndex(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintSpacingTimeline *) self; + return _self->getConstraintIndex(); } void spine_path_constraint_spacing_timeline_set_constraint_index(spine_path_constraint_spacing_timeline self, int inValue) { - ((ConstraintTimeline1*)(PathConstraintSpacingTimeline*)self)->setConstraintIndex(inValue); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (PathConstraintSpacingTimeline *) self; + _self->setConstraintIndex(inValue); } spine_rtti spine_path_constraint_spacing_timeline_rtti(void) { - return (spine_rtti)&PathConstraintSpacingTimeline::rtti; + return (spine_rtti) &PathConstraintSpacingTimeline::rtti; } diff --git a/spine-c/src/generated/path_constraint_spacing_timeline.h b/spine-c/src/generated/path_constraint_spacing_timeline.h index aa5e2e735..3f0a51a8a 100644 --- a/spine-c/src/generated/path_constraint_spacing_timeline.h +++ b/spine-c/src/generated/path_constraint_spacing_timeline.h @@ -8,22 +8,33 @@ extern "C" { #endif -SPINE_C_API spine_path_constraint_spacing_timeline spine_path_constraint_spacing_timeline_create(size_t frameCount, size_t bezierCount, int constraintIndex); +SPINE_C_API spine_path_constraint_spacing_timeline spine_path_constraint_spacing_timeline_create(size_t frameCount, size_t bezierCount, + int constraintIndex); SPINE_C_API void spine_path_constraint_spacing_timeline_dispose(spine_path_constraint_spacing_timeline self); SPINE_C_API spine_rtti spine_path_constraint_spacing_timeline_get_rtti(spine_path_constraint_spacing_timeline self); -SPINE_C_API void spine_path_constraint_spacing_timeline_apply(spine_path_constraint_spacing_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_path_constraint_spacing_timeline_apply(spine_path_constraint_spacing_timeline self, spine_skeleton skeleton, float lastTime, + float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, + spine_mix_direction direction, bool appliedPose); SPINE_C_API void spine_path_constraint_spacing_timeline_set_frame(spine_path_constraint_spacing_timeline self, size_t frame, float time, float value); SPINE_C_API float spine_path_constraint_spacing_timeline_get_curve_value(spine_path_constraint_spacing_timeline self, float time); -SPINE_C_API float spine_path_constraint_spacing_timeline_get_relative_value(spine_path_constraint_spacing_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_path_constraint_spacing_timeline_get_absolute_value_1(spine_path_constraint_spacing_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_path_constraint_spacing_timeline_get_absolute_value_2(spine_path_constraint_spacing_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_path_constraint_spacing_timeline_get_scale_value(spine_path_constraint_spacing_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_path_constraint_spacing_timeline_get_relative_value(spine_path_constraint_spacing_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_path_constraint_spacing_timeline_get_absolute_value_1(spine_path_constraint_spacing_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_path_constraint_spacing_timeline_get_absolute_value_2(spine_path_constraint_spacing_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup, float value); +SPINE_C_API float spine_path_constraint_spacing_timeline_get_scale_value(spine_path_constraint_spacing_timeline self, float time, float alpha, + spine_mix_blend blend, spine_mix_direction direction, float current, + float setup); SPINE_C_API void spine_path_constraint_spacing_timeline_set_linear(spine_path_constraint_spacing_timeline self, size_t frame); SPINE_C_API void spine_path_constraint_spacing_timeline_set_stepped(spine_path_constraint_spacing_timeline self, size_t frame); -SPINE_C_API void spine_path_constraint_spacing_timeline_set_bezier(spine_path_constraint_spacing_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); -SPINE_C_API float spine_path_constraint_spacing_timeline_get_bezier_value(spine_path_constraint_spacing_timeline self, float time, size_t frame, size_t valueOffset, size_t i); +SPINE_C_API void spine_path_constraint_spacing_timeline_set_bezier(spine_path_constraint_spacing_timeline self, size_t bezier, size_t frame, + float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, + float time2, float value2); +SPINE_C_API float spine_path_constraint_spacing_timeline_get_bezier_value(spine_path_constraint_spacing_timeline self, float time, size_t frame, + size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_path_constraint_spacing_timeline_get_curves(spine_path_constraint_spacing_timeline self); SPINE_C_API size_t spine_path_constraint_spacing_timeline_get_frame_entries(spine_path_constraint_spacing_timeline self); SPINE_C_API size_t spine_path_constraint_spacing_timeline_get_frame_count(spine_path_constraint_spacing_timeline self); diff --git a/spine-c/src/generated/physics.h b/spine-c/src/generated/physics.h index 754c48b77..2d8988007 100644 --- a/spine-c/src/generated/physics.h +++ b/spine-c/src/generated/physics.h @@ -6,10 +6,10 @@ extern "C" { #endif typedef enum spine_physics { - SPINE_PHYSICS_NONE, - SPINE_PHYSICS_RESET, - SPINE_PHYSICS_UPDATE, - SPINE_PHYSICS_POSE + SPINE_PHYSICS_NONE, + SPINE_PHYSICS_RESET, + SPINE_PHYSICS_UPDATE, + SPINE_PHYSICS_POSE } spine_physics; #ifdef __cplusplus diff --git a/spine-c/src/generated/physics_constraint.cpp b/spine-c/src/generated/physics_constraint.cpp index 962c59d43..2b0df2197 100644 --- a/spine-c/src/generated/physics_constraint.cpp +++ b/spine-c/src/generated/physics_constraint.cpp @@ -4,85 +4,111 @@ using namespace spine; spine_physics_constraint spine_physics_constraint_create(spine_physics_constraint_data data, spine_skeleton skeleton) { - return (spine_physics_constraint) new (__FILE__, __LINE__) PhysicsConstraint(*((PhysicsConstraintData*)data), *((Skeleton*)skeleton)); + return (spine_physics_constraint) new (__FILE__, __LINE__) PhysicsConstraint(*((PhysicsConstraintData *) data), *((Skeleton *) skeleton)); } void spine_physics_constraint_dispose(spine_physics_constraint self) { - delete (PhysicsConstraint*)self; + delete (PhysicsConstraint *) self; } spine_rtti spine_physics_constraint_get_rtti(spine_physics_constraint self) { - return (spine_rtti)&((PhysicsConstraint*)self)->getRTTI(); + PhysicsConstraint *_self = (PhysicsConstraint *) self; + return (spine_rtti) &_self->getRTTI(); } void spine_physics_constraint_update(spine_physics_constraint self, spine_skeleton skeleton, spine_physics physics) { - ((PhysicsConstraint*)self)->update(*((Skeleton*)skeleton), (Physics)physics); + PhysicsConstraint *_self = (PhysicsConstraint *) self; + _self->update(*((Skeleton *) skeleton), (Physics) physics); } void spine_physics_constraint_sort(spine_physics_constraint self, spine_skeleton skeleton) { - ((PhysicsConstraint*)self)->sort(*((Skeleton*)skeleton)); + PhysicsConstraint *_self = (PhysicsConstraint *) self; + _self->sort(*((Skeleton *) skeleton)); } bool spine_physics_constraint_is_source_active(spine_physics_constraint self) { - return ((PhysicsConstraint*)self)->isSourceActive(); + PhysicsConstraint *_self = (PhysicsConstraint *) self; + return _self->isSourceActive(); } spine_physics_constraint spine_physics_constraint_copy(spine_physics_constraint self, spine_skeleton skeleton) { - return (spine_physics_constraint)((PhysicsConstraint*)self)->copy(*((Skeleton*)skeleton)); + PhysicsConstraint *_self = (PhysicsConstraint *) self; + return (spine_physics_constraint) _self->copy(*((Skeleton *) skeleton)); } void spine_physics_constraint_reset(spine_physics_constraint self, spine_skeleton skeleton) { - ((PhysicsConstraint*)self)->reset(*((Skeleton*)skeleton)); + PhysicsConstraint *_self = (PhysicsConstraint *) self; + _self->reset(*((Skeleton *) skeleton)); } void spine_physics_constraint_translate(spine_physics_constraint self, float x, float y) { - ((PhysicsConstraint*)self)->translate(x, y); + PhysicsConstraint *_self = (PhysicsConstraint *) self; + _self->translate(x, y); } void spine_physics_constraint_rotate(spine_physics_constraint self, float x, float y, float degrees) { - ((PhysicsConstraint*)self)->rotate(x, y, degrees); + PhysicsConstraint *_self = (PhysicsConstraint *) self; + _self->rotate(x, y, degrees); } spine_bone_pose spine_physics_constraint_get_bone(spine_physics_constraint self) { - return (spine_bone_pose)&((PhysicsConstraint*)self)->getBone(); + PhysicsConstraint *_self = (PhysicsConstraint *) self; + return (spine_bone_pose) &_self->getBone(); } void spine_physics_constraint_set_bone(spine_physics_constraint self, spine_bone_pose bone) { - ((PhysicsConstraint*)self)->setBone(*((BonePose*)bone)); + PhysicsConstraint *_self = (PhysicsConstraint *) self; + _self->setBone(*((BonePose *) bone)); } spine_physics_constraint_data spine_physics_constraint_get_data(spine_physics_constraint self) { - return (spine_physics_constraint_data)&((ConstraintGeneric*)(PhysicsConstraint*)self)->getData(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (PhysicsConstraint *) self; + return (spine_physics_constraint_data) &_self->getData(); } spine_physics_constraint_pose spine_physics_constraint_get_pose(spine_physics_constraint self) { - return (spine_physics_constraint_pose)&((ConstraintGeneric*)(PhysicsConstraint*)self)->getPose(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (PhysicsConstraint *) self; + return (spine_physics_constraint_pose) &_self->getPose(); } spine_physics_constraint_pose spine_physics_constraint_get_applied_pose(spine_physics_constraint self) { - return (spine_physics_constraint_pose)&((ConstraintGeneric*)(PhysicsConstraint*)self)->getAppliedPose(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (PhysicsConstraint *) self; + return (spine_physics_constraint_pose) &_self->getAppliedPose(); } void spine_physics_constraint_reset_constrained(spine_physics_constraint self) { - ((ConstraintGeneric*)(PhysicsConstraint*)self)->resetConstrained(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (PhysicsConstraint *) self; + _self->resetConstrained(); } void spine_physics_constraint_constrained(spine_physics_constraint self) { - ((ConstraintGeneric*)(PhysicsConstraint*)self)->constrained(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (PhysicsConstraint *) self; + _self->constrained(); } bool spine_physics_constraint_is_pose_equal_to_applied(spine_physics_constraint self) { - return ((ConstraintGeneric*)(PhysicsConstraint*)self)->isPoseEqualToApplied(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (PhysicsConstraint *) self; + return _self->isPoseEqualToApplied(); } bool spine_physics_constraint_is_active(spine_physics_constraint self) { - return ((ConstraintGeneric*)(PhysicsConstraint*)self)->isActive(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (PhysicsConstraint *) self; + return _self->isActive(); } void spine_physics_constraint_set_active(spine_physics_constraint self, bool active) { - ((ConstraintGeneric*)(PhysicsConstraint*)self)->setActive(active); + ConstraintGeneric + *_self = (ConstraintGeneric *) (PhysicsConstraint *) self; + _self->setActive(active); } spine_rtti spine_physics_constraint_rtti(void) { - return (spine_rtti)&PhysicsConstraint::rtti; + return (spine_rtti) &PhysicsConstraint::rtti; } diff --git a/spine-c/src/generated/physics_constraint_damping_timeline.cpp b/spine-c/src/generated/physics_constraint_damping_timeline.cpp index ed449b354..8aab92381 100644 --- a/spine-c/src/generated/physics_constraint_damping_timeline.cpp +++ b/spine-c/src/generated/physics_constraint_damping_timeline.cpp @@ -3,94 +3,126 @@ using namespace spine; -spine_physics_constraint_damping_timeline spine_physics_constraint_damping_timeline_create(size_t frameCount, size_t bezierCount, int physicsConstraintIndex) { - return (spine_physics_constraint_damping_timeline) new (__FILE__, __LINE__) PhysicsConstraintDampingTimeline(frameCount, bezierCount, physicsConstraintIndex); +spine_physics_constraint_damping_timeline spine_physics_constraint_damping_timeline_create(size_t frameCount, size_t bezierCount, + int physicsConstraintIndex) { + return (spine_physics_constraint_damping_timeline) new (__FILE__, __LINE__) + PhysicsConstraintDampingTimeline(frameCount, bezierCount, physicsConstraintIndex); } void spine_physics_constraint_damping_timeline_dispose(spine_physics_constraint_damping_timeline self) { - delete (PhysicsConstraintDampingTimeline*)self; + delete (PhysicsConstraintDampingTimeline *) self; } spine_rtti spine_physics_constraint_damping_timeline_get_rtti(spine_physics_constraint_damping_timeline self) { - return (spine_rtti)&((PhysicsConstraintDampingTimeline*)self)->getRTTI(); + PhysicsConstraintDampingTimeline *_self = (PhysicsConstraintDampingTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_physics_constraint_damping_timeline_apply(spine_physics_constraint_damping_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintDampingTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_physics_constraint_damping_timeline_apply(spine_physics_constraint_damping_timeline self, spine_skeleton skeleton, float lastTime, + float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, + spine_mix_direction direction, bool appliedPose) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintDampingTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_physics_constraint_damping_timeline_set_frame(spine_physics_constraint_damping_timeline self, size_t frame, float time, float value) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintDampingTimeline*)self)->setFrame(frame, time, value); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintDampingTimeline *) self; + _self->setFrame(frame, time, value); } float spine_physics_constraint_damping_timeline_get_curve_value(spine_physics_constraint_damping_timeline self, float time) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintDampingTimeline*)self)->getCurveValue(time); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintDampingTimeline *) self; + return _self->getCurveValue(time); } -float spine_physics_constraint_damping_timeline_get_relative_value(spine_physics_constraint_damping_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintDampingTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_physics_constraint_damping_timeline_get_relative_value(spine_physics_constraint_damping_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintDampingTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_physics_constraint_damping_timeline_get_absolute_value_1(spine_physics_constraint_damping_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintDampingTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_physics_constraint_damping_timeline_get_absolute_value_1(spine_physics_constraint_damping_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintDampingTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_physics_constraint_damping_timeline_get_absolute_value_2(spine_physics_constraint_damping_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintDampingTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_physics_constraint_damping_timeline_get_absolute_value_2(spine_physics_constraint_damping_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup, float value) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintDampingTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_physics_constraint_damping_timeline_get_scale_value(spine_physics_constraint_damping_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintDampingTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_physics_constraint_damping_timeline_get_scale_value(spine_physics_constraint_damping_timeline self, float time, float alpha, + spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintDampingTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_physics_constraint_damping_timeline_set_linear(spine_physics_constraint_damping_timeline self, size_t frame) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintDampingTimeline*)self)->setLinear(frame); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintDampingTimeline *) self; + _self->setLinear(frame); } void spine_physics_constraint_damping_timeline_set_stepped(spine_physics_constraint_damping_timeline self, size_t frame) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintDampingTimeline*)self)->setStepped(frame); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintDampingTimeline *) self; + _self->setStepped(frame); } -void spine_physics_constraint_damping_timeline_set_bezier(spine_physics_constraint_damping_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintDampingTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_physics_constraint_damping_timeline_set_bezier(spine_physics_constraint_damping_timeline self, size_t bezier, size_t frame, float value, + float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, + float value2) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintDampingTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } -float spine_physics_constraint_damping_timeline_get_bezier_value(spine_physics_constraint_damping_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintDampingTimeline*)self)->getBezierValue(time, frame, valueOffset, i); +float spine_physics_constraint_damping_timeline_get_bezier_value(spine_physics_constraint_damping_timeline self, float time, size_t frame, + size_t valueOffset, size_t i) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintDampingTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_physics_constraint_damping_timeline_get_curves(spine_physics_constraint_damping_timeline self) { - return (spine_array_float)&((PhysicsConstraintTimeline*)(PhysicsConstraintDampingTimeline*)self)->getCurves(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintDampingTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_physics_constraint_damping_timeline_get_frame_entries(spine_physics_constraint_damping_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintDampingTimeline*)self)->getFrameEntries(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintDampingTimeline *) self; + return _self->getFrameEntries(); } size_t spine_physics_constraint_damping_timeline_get_frame_count(spine_physics_constraint_damping_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintDampingTimeline*)self)->getFrameCount(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintDampingTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_physics_constraint_damping_timeline_get_frames(spine_physics_constraint_damping_timeline self) { - return (spine_array_float)&((PhysicsConstraintTimeline*)(PhysicsConstraintDampingTimeline*)self)->getFrames(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintDampingTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_physics_constraint_damping_timeline_get_duration(spine_physics_constraint_damping_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintDampingTimeline*)self)->getDuration(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintDampingTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_physics_constraint_damping_timeline_get_property_ids(spine_physics_constraint_damping_timeline self) { - return (spine_array_property_id)&((PhysicsConstraintTimeline*)(PhysicsConstraintDampingTimeline*)self)->getPropertyIds(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintDampingTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_physics_constraint_damping_timeline_get_constraint_index(spine_physics_constraint_damping_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintDampingTimeline*)self)->getConstraintIndex(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintDampingTimeline *) self; + return _self->getConstraintIndex(); } void spine_physics_constraint_damping_timeline_set_constraint_index(spine_physics_constraint_damping_timeline self, int inValue) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintDampingTimeline*)self)->setConstraintIndex(inValue); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintDampingTimeline *) self; + _self->setConstraintIndex(inValue); } spine_rtti spine_physics_constraint_damping_timeline_rtti(void) { - return (spine_rtti)&PhysicsConstraintDampingTimeline::rtti; + return (spine_rtti) &PhysicsConstraintDampingTimeline::rtti; } diff --git a/spine-c/src/generated/physics_constraint_damping_timeline.h b/spine-c/src/generated/physics_constraint_damping_timeline.h index 58c4ed1d3..c1fb20439 100644 --- a/spine-c/src/generated/physics_constraint_damping_timeline.h +++ b/spine-c/src/generated/physics_constraint_damping_timeline.h @@ -8,22 +8,35 @@ extern "C" { #endif -SPINE_C_API spine_physics_constraint_damping_timeline spine_physics_constraint_damping_timeline_create(size_t frameCount, size_t bezierCount, int physicsConstraintIndex); +SPINE_C_API spine_physics_constraint_damping_timeline spine_physics_constraint_damping_timeline_create(size_t frameCount, size_t bezierCount, + int physicsConstraintIndex); SPINE_C_API void spine_physics_constraint_damping_timeline_dispose(spine_physics_constraint_damping_timeline self); SPINE_C_API spine_rtti spine_physics_constraint_damping_timeline_get_rtti(spine_physics_constraint_damping_timeline self); -SPINE_C_API void spine_physics_constraint_damping_timeline_apply(spine_physics_constraint_damping_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); -SPINE_C_API void spine_physics_constraint_damping_timeline_set_frame(spine_physics_constraint_damping_timeline self, size_t frame, float time, float value); +SPINE_C_API void spine_physics_constraint_damping_timeline_apply(spine_physics_constraint_damping_timeline self, spine_skeleton skeleton, + float lastTime, float time, spine_array_event pEvents, float alpha, + spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_physics_constraint_damping_timeline_set_frame(spine_physics_constraint_damping_timeline self, size_t frame, float time, + float value); SPINE_C_API float spine_physics_constraint_damping_timeline_get_curve_value(spine_physics_constraint_damping_timeline self, float time); -SPINE_C_API float spine_physics_constraint_damping_timeline_get_relative_value(spine_physics_constraint_damping_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_physics_constraint_damping_timeline_get_absolute_value_1(spine_physics_constraint_damping_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_physics_constraint_damping_timeline_get_absolute_value_2(spine_physics_constraint_damping_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_physics_constraint_damping_timeline_get_scale_value(spine_physics_constraint_damping_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_physics_constraint_damping_timeline_get_relative_value(spine_physics_constraint_damping_timeline self, float time, + float alpha, spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_physics_constraint_damping_timeline_get_absolute_value_1(spine_physics_constraint_damping_timeline self, float time, + float alpha, spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_physics_constraint_damping_timeline_get_absolute_value_2(spine_physics_constraint_damping_timeline self, float time, + float alpha, spine_mix_blend blend, float current, float setup, + float value); +SPINE_C_API float spine_physics_constraint_damping_timeline_get_scale_value(spine_physics_constraint_damping_timeline self, float time, float alpha, + spine_mix_blend blend, spine_mix_direction direction, float current, + float setup); SPINE_C_API void spine_physics_constraint_damping_timeline_set_linear(spine_physics_constraint_damping_timeline self, size_t frame); SPINE_C_API void spine_physics_constraint_damping_timeline_set_stepped(spine_physics_constraint_damping_timeline self, size_t frame); -SPINE_C_API void spine_physics_constraint_damping_timeline_set_bezier(spine_physics_constraint_damping_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); -SPINE_C_API float spine_physics_constraint_damping_timeline_get_bezier_value(spine_physics_constraint_damping_timeline self, float time, size_t frame, size_t valueOffset, size_t i); +SPINE_C_API void spine_physics_constraint_damping_timeline_set_bezier(spine_physics_constraint_damping_timeline self, size_t bezier, size_t frame, + float value, float time1, float value1, float cx1, float cy1, float cx2, + float cy2, float time2, float value2); +SPINE_C_API float spine_physics_constraint_damping_timeline_get_bezier_value(spine_physics_constraint_damping_timeline self, float time, size_t frame, + size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_physics_constraint_damping_timeline_get_curves(spine_physics_constraint_damping_timeline self); SPINE_C_API size_t spine_physics_constraint_damping_timeline_get_frame_entries(spine_physics_constraint_damping_timeline self); SPINE_C_API size_t spine_physics_constraint_damping_timeline_get_frame_count(spine_physics_constraint_damping_timeline self); diff --git a/spine-c/src/generated/physics_constraint_data.cpp b/spine-c/src/generated/physics_constraint_data.cpp index 186743f5a..73e0d0d90 100644 --- a/spine-c/src/generated/physics_constraint_data.cpp +++ b/spine-c/src/generated/physics_constraint_data.cpp @@ -3,158 +3,198 @@ using namespace spine; -spine_physics_constraint_data spine_physics_constraint_data_create(const char * name) { - return (spine_physics_constraint_data) new (__FILE__, __LINE__) PhysicsConstraintData(String(name)); +spine_physics_constraint_data spine_physics_constraint_data_create(const char *name) { + return (spine_physics_constraint_data) new (__FILE__, __LINE__) PhysicsConstraintData(String(name)); } void spine_physics_constraint_data_dispose(spine_physics_constraint_data self) { - delete (PhysicsConstraintData*)self; + delete (PhysicsConstraintData *) self; } spine_rtti spine_physics_constraint_data_get_rtti(spine_physics_constraint_data self) { - return (spine_rtti)&((PhysicsConstraintData*)self)->getRTTI(); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + return (spine_rtti) &_self->getRTTI(); } spine_constraint spine_physics_constraint_data_create_method(spine_physics_constraint_data self, spine_skeleton skeleton) { - return (spine_constraint)((PhysicsConstraintData*)self)->create(*((Skeleton*)skeleton)); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + return (spine_constraint) _self->create(*((Skeleton *) skeleton)); } spine_bone_data spine_physics_constraint_data_get_bone(spine_physics_constraint_data self) { - return (spine_bone_data)((PhysicsConstraintData*)self)->getBone(); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + return (spine_bone_data) _self->getBone(); } void spine_physics_constraint_data_set_bone(spine_physics_constraint_data self, spine_bone_data bone) { - ((PhysicsConstraintData*)self)->setBone((BoneData *)bone); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + _self->setBone((BoneData *) bone); } float spine_physics_constraint_data_get_step(spine_physics_constraint_data self) { - return ((PhysicsConstraintData*)self)->getStep(); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + return _self->getStep(); } void spine_physics_constraint_data_set_step(spine_physics_constraint_data self, float step) { - ((PhysicsConstraintData*)self)->setStep(step); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + _self->setStep(step); } float spine_physics_constraint_data_get_x(spine_physics_constraint_data self) { - return ((PhysicsConstraintData*)self)->getX(); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + return _self->getX(); } void spine_physics_constraint_data_set_x(spine_physics_constraint_data self, float x) { - ((PhysicsConstraintData*)self)->setX(x); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + _self->setX(x); } float spine_physics_constraint_data_get_y(spine_physics_constraint_data self) { - return ((PhysicsConstraintData*)self)->getY(); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + return _self->getY(); } void spine_physics_constraint_data_set_y(spine_physics_constraint_data self, float y) { - ((PhysicsConstraintData*)self)->setY(y); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + _self->setY(y); } float spine_physics_constraint_data_get_rotate(spine_physics_constraint_data self) { - return ((PhysicsConstraintData*)self)->getRotate(); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + return _self->getRotate(); } void spine_physics_constraint_data_set_rotate(spine_physics_constraint_data self, float rotate) { - ((PhysicsConstraintData*)self)->setRotate(rotate); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + _self->setRotate(rotate); } float spine_physics_constraint_data_get_scale_x(spine_physics_constraint_data self) { - return ((PhysicsConstraintData*)self)->getScaleX(); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + return _self->getScaleX(); } void spine_physics_constraint_data_set_scale_x(spine_physics_constraint_data self, float scaleX) { - ((PhysicsConstraintData*)self)->setScaleX(scaleX); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + _self->setScaleX(scaleX); } float spine_physics_constraint_data_get_shear_x(spine_physics_constraint_data self) { - return ((PhysicsConstraintData*)self)->getShearX(); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + return _self->getShearX(); } void spine_physics_constraint_data_set_shear_x(spine_physics_constraint_data self, float shearX) { - ((PhysicsConstraintData*)self)->setShearX(shearX); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + _self->setShearX(shearX); } float spine_physics_constraint_data_get_limit(spine_physics_constraint_data self) { - return ((PhysicsConstraintData*)self)->getLimit(); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + return _self->getLimit(); } void spine_physics_constraint_data_set_limit(spine_physics_constraint_data self, float limit) { - ((PhysicsConstraintData*)self)->setLimit(limit); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + _self->setLimit(limit); } bool spine_physics_constraint_data_get_inertia_global(spine_physics_constraint_data self) { - return ((PhysicsConstraintData*)self)->getInertiaGlobal(); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + return _self->getInertiaGlobal(); } void spine_physics_constraint_data_set_inertia_global(spine_physics_constraint_data self, bool inertiaGlobal) { - ((PhysicsConstraintData*)self)->setInertiaGlobal(inertiaGlobal); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + _self->setInertiaGlobal(inertiaGlobal); } bool spine_physics_constraint_data_get_strength_global(spine_physics_constraint_data self) { - return ((PhysicsConstraintData*)self)->getStrengthGlobal(); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + return _self->getStrengthGlobal(); } void spine_physics_constraint_data_set_strength_global(spine_physics_constraint_data self, bool strengthGlobal) { - ((PhysicsConstraintData*)self)->setStrengthGlobal(strengthGlobal); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + _self->setStrengthGlobal(strengthGlobal); } bool spine_physics_constraint_data_get_damping_global(spine_physics_constraint_data self) { - return ((PhysicsConstraintData*)self)->getDampingGlobal(); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + return _self->getDampingGlobal(); } void spine_physics_constraint_data_set_damping_global(spine_physics_constraint_data self, bool dampingGlobal) { - ((PhysicsConstraintData*)self)->setDampingGlobal(dampingGlobal); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + _self->setDampingGlobal(dampingGlobal); } bool spine_physics_constraint_data_get_mass_global(spine_physics_constraint_data self) { - return ((PhysicsConstraintData*)self)->getMassGlobal(); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + return _self->getMassGlobal(); } void spine_physics_constraint_data_set_mass_global(spine_physics_constraint_data self, bool massGlobal) { - ((PhysicsConstraintData*)self)->setMassGlobal(massGlobal); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + _self->setMassGlobal(massGlobal); } bool spine_physics_constraint_data_get_wind_global(spine_physics_constraint_data self) { - return ((PhysicsConstraintData*)self)->getWindGlobal(); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + return _self->getWindGlobal(); } void spine_physics_constraint_data_set_wind_global(spine_physics_constraint_data self, bool windGlobal) { - ((PhysicsConstraintData*)self)->setWindGlobal(windGlobal); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + _self->setWindGlobal(windGlobal); } bool spine_physics_constraint_data_get_gravity_global(spine_physics_constraint_data self) { - return ((PhysicsConstraintData*)self)->getGravityGlobal(); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + return _self->getGravityGlobal(); } void spine_physics_constraint_data_set_gravity_global(spine_physics_constraint_data self, bool gravityGlobal) { - ((PhysicsConstraintData*)self)->setGravityGlobal(gravityGlobal); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + _self->setGravityGlobal(gravityGlobal); } bool spine_physics_constraint_data_get_mix_global(spine_physics_constraint_data self) { - return ((PhysicsConstraintData*)self)->getMixGlobal(); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + return _self->getMixGlobal(); } void spine_physics_constraint_data_set_mix_global(spine_physics_constraint_data self, bool mixGlobal) { - ((PhysicsConstraintData*)self)->setMixGlobal(mixGlobal); + PhysicsConstraintData *_self = (PhysicsConstraintData *) self; + _self->setMixGlobal(mixGlobal); } -const char * spine_physics_constraint_data_get_name(spine_physics_constraint_data self) { - return ((ConstraintDataGeneric*)(PhysicsConstraintData*)self)->getName().buffer(); +const char *spine_physics_constraint_data_get_name(spine_physics_constraint_data self) { + ConstraintDataGeneric + *_self = (ConstraintDataGeneric *) (PhysicsConstraintData *) self; + return _self->getName().buffer(); } bool spine_physics_constraint_data_get_skin_required(spine_physics_constraint_data self) { - return ((ConstraintDataGeneric*)(PhysicsConstraintData*)self)->getSkinRequired(); + ConstraintDataGeneric + *_self = (ConstraintDataGeneric *) (PhysicsConstraintData *) self; + return _self->getSkinRequired(); } spine_physics_constraint_pose spine_physics_constraint_data_get_setup_pose(spine_physics_constraint_data self) { - return (spine_physics_constraint_pose)&((ConstraintDataGeneric*)(PhysicsConstraintData*)self)->getSetupPose(); + ConstraintDataGeneric + *_self = (ConstraintDataGeneric *) (PhysicsConstraintData *) self; + return (spine_physics_constraint_pose) &_self->getSetupPose(); } void spine_physics_constraint_data_set_skin_required(spine_physics_constraint_data self, bool skinRequired) { - ((ConstraintDataGeneric*)(PhysicsConstraintData*)self)->setSkinRequired(skinRequired); + ConstraintDataGeneric + *_self = (ConstraintDataGeneric *) (PhysicsConstraintData *) self; + _self->setSkinRequired(skinRequired); } spine_rtti spine_physics_constraint_data_rtti(void) { - return (spine_rtti)&PhysicsConstraintData::rtti; + return (spine_rtti) &PhysicsConstraintData::rtti; } diff --git a/spine-c/src/generated/physics_constraint_data.h b/spine-c/src/generated/physics_constraint_data.h index 808d54e56..172d2781a 100644 --- a/spine-c/src/generated/physics_constraint_data.h +++ b/spine-c/src/generated/physics_constraint_data.h @@ -8,7 +8,7 @@ extern "C" { #endif -SPINE_C_API spine_physics_constraint_data spine_physics_constraint_data_create(const char * name); +SPINE_C_API spine_physics_constraint_data spine_physics_constraint_data_create(const char *name); SPINE_C_API void spine_physics_constraint_data_dispose(spine_physics_constraint_data self); @@ -44,7 +44,7 @@ SPINE_C_API bool spine_physics_constraint_data_get_gravity_global(spine_physics_ SPINE_C_API void spine_physics_constraint_data_set_gravity_global(spine_physics_constraint_data self, bool gravityGlobal); SPINE_C_API bool spine_physics_constraint_data_get_mix_global(spine_physics_constraint_data self); SPINE_C_API void spine_physics_constraint_data_set_mix_global(spine_physics_constraint_data self, bool mixGlobal); -SPINE_C_API const char * spine_physics_constraint_data_get_name(spine_physics_constraint_data self); +SPINE_C_API const char *spine_physics_constraint_data_get_name(spine_physics_constraint_data self); SPINE_C_API bool spine_physics_constraint_data_get_skin_required(spine_physics_constraint_data self); SPINE_C_API spine_physics_constraint_pose spine_physics_constraint_data_get_setup_pose(spine_physics_constraint_data self); SPINE_C_API void spine_physics_constraint_data_set_skin_required(spine_physics_constraint_data self, bool skinRequired); diff --git a/spine-c/src/generated/physics_constraint_gravity_timeline.cpp b/spine-c/src/generated/physics_constraint_gravity_timeline.cpp index eff2c49fc..a30385dfd 100644 --- a/spine-c/src/generated/physics_constraint_gravity_timeline.cpp +++ b/spine-c/src/generated/physics_constraint_gravity_timeline.cpp @@ -3,94 +3,126 @@ using namespace spine; -spine_physics_constraint_gravity_timeline spine_physics_constraint_gravity_timeline_create(size_t frameCount, size_t bezierCount, int physicsConstraintIndex) { - return (spine_physics_constraint_gravity_timeline) new (__FILE__, __LINE__) PhysicsConstraintGravityTimeline(frameCount, bezierCount, physicsConstraintIndex); +spine_physics_constraint_gravity_timeline spine_physics_constraint_gravity_timeline_create(size_t frameCount, size_t bezierCount, + int physicsConstraintIndex) { + return (spine_physics_constraint_gravity_timeline) new (__FILE__, __LINE__) + PhysicsConstraintGravityTimeline(frameCount, bezierCount, physicsConstraintIndex); } void spine_physics_constraint_gravity_timeline_dispose(spine_physics_constraint_gravity_timeline self) { - delete (PhysicsConstraintGravityTimeline*)self; + delete (PhysicsConstraintGravityTimeline *) self; } spine_rtti spine_physics_constraint_gravity_timeline_get_rtti(spine_physics_constraint_gravity_timeline self) { - return (spine_rtti)&((PhysicsConstraintGravityTimeline*)self)->getRTTI(); + PhysicsConstraintGravityTimeline *_self = (PhysicsConstraintGravityTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_physics_constraint_gravity_timeline_apply(spine_physics_constraint_gravity_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintGravityTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_physics_constraint_gravity_timeline_apply(spine_physics_constraint_gravity_timeline self, spine_skeleton skeleton, float lastTime, + float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, + spine_mix_direction direction, bool appliedPose) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintGravityTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_physics_constraint_gravity_timeline_set_frame(spine_physics_constraint_gravity_timeline self, size_t frame, float time, float value) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintGravityTimeline*)self)->setFrame(frame, time, value); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintGravityTimeline *) self; + _self->setFrame(frame, time, value); } float spine_physics_constraint_gravity_timeline_get_curve_value(spine_physics_constraint_gravity_timeline self, float time) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintGravityTimeline*)self)->getCurveValue(time); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintGravityTimeline *) self; + return _self->getCurveValue(time); } -float spine_physics_constraint_gravity_timeline_get_relative_value(spine_physics_constraint_gravity_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintGravityTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_physics_constraint_gravity_timeline_get_relative_value(spine_physics_constraint_gravity_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintGravityTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_physics_constraint_gravity_timeline_get_absolute_value_1(spine_physics_constraint_gravity_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintGravityTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_physics_constraint_gravity_timeline_get_absolute_value_1(spine_physics_constraint_gravity_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintGravityTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_physics_constraint_gravity_timeline_get_absolute_value_2(spine_physics_constraint_gravity_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintGravityTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_physics_constraint_gravity_timeline_get_absolute_value_2(spine_physics_constraint_gravity_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup, float value) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintGravityTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_physics_constraint_gravity_timeline_get_scale_value(spine_physics_constraint_gravity_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintGravityTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_physics_constraint_gravity_timeline_get_scale_value(spine_physics_constraint_gravity_timeline self, float time, float alpha, + spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintGravityTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_physics_constraint_gravity_timeline_set_linear(spine_physics_constraint_gravity_timeline self, size_t frame) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintGravityTimeline*)self)->setLinear(frame); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintGravityTimeline *) self; + _self->setLinear(frame); } void spine_physics_constraint_gravity_timeline_set_stepped(spine_physics_constraint_gravity_timeline self, size_t frame) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintGravityTimeline*)self)->setStepped(frame); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintGravityTimeline *) self; + _self->setStepped(frame); } -void spine_physics_constraint_gravity_timeline_set_bezier(spine_physics_constraint_gravity_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintGravityTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_physics_constraint_gravity_timeline_set_bezier(spine_physics_constraint_gravity_timeline self, size_t bezier, size_t frame, float value, + float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, + float value2) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintGravityTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } -float spine_physics_constraint_gravity_timeline_get_bezier_value(spine_physics_constraint_gravity_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintGravityTimeline*)self)->getBezierValue(time, frame, valueOffset, i); +float spine_physics_constraint_gravity_timeline_get_bezier_value(spine_physics_constraint_gravity_timeline self, float time, size_t frame, + size_t valueOffset, size_t i) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintGravityTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_physics_constraint_gravity_timeline_get_curves(spine_physics_constraint_gravity_timeline self) { - return (spine_array_float)&((PhysicsConstraintTimeline*)(PhysicsConstraintGravityTimeline*)self)->getCurves(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintGravityTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_physics_constraint_gravity_timeline_get_frame_entries(spine_physics_constraint_gravity_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintGravityTimeline*)self)->getFrameEntries(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintGravityTimeline *) self; + return _self->getFrameEntries(); } size_t spine_physics_constraint_gravity_timeline_get_frame_count(spine_physics_constraint_gravity_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintGravityTimeline*)self)->getFrameCount(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintGravityTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_physics_constraint_gravity_timeline_get_frames(spine_physics_constraint_gravity_timeline self) { - return (spine_array_float)&((PhysicsConstraintTimeline*)(PhysicsConstraintGravityTimeline*)self)->getFrames(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintGravityTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_physics_constraint_gravity_timeline_get_duration(spine_physics_constraint_gravity_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintGravityTimeline*)self)->getDuration(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintGravityTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_physics_constraint_gravity_timeline_get_property_ids(spine_physics_constraint_gravity_timeline self) { - return (spine_array_property_id)&((PhysicsConstraintTimeline*)(PhysicsConstraintGravityTimeline*)self)->getPropertyIds(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintGravityTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_physics_constraint_gravity_timeline_get_constraint_index(spine_physics_constraint_gravity_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintGravityTimeline*)self)->getConstraintIndex(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintGravityTimeline *) self; + return _self->getConstraintIndex(); } void spine_physics_constraint_gravity_timeline_set_constraint_index(spine_physics_constraint_gravity_timeline self, int inValue) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintGravityTimeline*)self)->setConstraintIndex(inValue); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintGravityTimeline *) self; + _self->setConstraintIndex(inValue); } spine_rtti spine_physics_constraint_gravity_timeline_rtti(void) { - return (spine_rtti)&PhysicsConstraintGravityTimeline::rtti; + return (spine_rtti) &PhysicsConstraintGravityTimeline::rtti; } diff --git a/spine-c/src/generated/physics_constraint_gravity_timeline.h b/spine-c/src/generated/physics_constraint_gravity_timeline.h index 30031c541..adb2ea952 100644 --- a/spine-c/src/generated/physics_constraint_gravity_timeline.h +++ b/spine-c/src/generated/physics_constraint_gravity_timeline.h @@ -8,22 +8,35 @@ extern "C" { #endif -SPINE_C_API spine_physics_constraint_gravity_timeline spine_physics_constraint_gravity_timeline_create(size_t frameCount, size_t bezierCount, int physicsConstraintIndex); +SPINE_C_API spine_physics_constraint_gravity_timeline spine_physics_constraint_gravity_timeline_create(size_t frameCount, size_t bezierCount, + int physicsConstraintIndex); SPINE_C_API void spine_physics_constraint_gravity_timeline_dispose(spine_physics_constraint_gravity_timeline self); SPINE_C_API spine_rtti spine_physics_constraint_gravity_timeline_get_rtti(spine_physics_constraint_gravity_timeline self); -SPINE_C_API void spine_physics_constraint_gravity_timeline_apply(spine_physics_constraint_gravity_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); -SPINE_C_API void spine_physics_constraint_gravity_timeline_set_frame(spine_physics_constraint_gravity_timeline self, size_t frame, float time, float value); +SPINE_C_API void spine_physics_constraint_gravity_timeline_apply(spine_physics_constraint_gravity_timeline self, spine_skeleton skeleton, + float lastTime, float time, spine_array_event pEvents, float alpha, + spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_physics_constraint_gravity_timeline_set_frame(spine_physics_constraint_gravity_timeline self, size_t frame, float time, + float value); SPINE_C_API float spine_physics_constraint_gravity_timeline_get_curve_value(spine_physics_constraint_gravity_timeline self, float time); -SPINE_C_API float spine_physics_constraint_gravity_timeline_get_relative_value(spine_physics_constraint_gravity_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_physics_constraint_gravity_timeline_get_absolute_value_1(spine_physics_constraint_gravity_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_physics_constraint_gravity_timeline_get_absolute_value_2(spine_physics_constraint_gravity_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_physics_constraint_gravity_timeline_get_scale_value(spine_physics_constraint_gravity_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_physics_constraint_gravity_timeline_get_relative_value(spine_physics_constraint_gravity_timeline self, float time, + float alpha, spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_physics_constraint_gravity_timeline_get_absolute_value_1(spine_physics_constraint_gravity_timeline self, float time, + float alpha, spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_physics_constraint_gravity_timeline_get_absolute_value_2(spine_physics_constraint_gravity_timeline self, float time, + float alpha, spine_mix_blend blend, float current, float setup, + float value); +SPINE_C_API float spine_physics_constraint_gravity_timeline_get_scale_value(spine_physics_constraint_gravity_timeline self, float time, float alpha, + spine_mix_blend blend, spine_mix_direction direction, float current, + float setup); SPINE_C_API void spine_physics_constraint_gravity_timeline_set_linear(spine_physics_constraint_gravity_timeline self, size_t frame); SPINE_C_API void spine_physics_constraint_gravity_timeline_set_stepped(spine_physics_constraint_gravity_timeline self, size_t frame); -SPINE_C_API void spine_physics_constraint_gravity_timeline_set_bezier(spine_physics_constraint_gravity_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); -SPINE_C_API float spine_physics_constraint_gravity_timeline_get_bezier_value(spine_physics_constraint_gravity_timeline self, float time, size_t frame, size_t valueOffset, size_t i); +SPINE_C_API void spine_physics_constraint_gravity_timeline_set_bezier(spine_physics_constraint_gravity_timeline self, size_t bezier, size_t frame, + float value, float time1, float value1, float cx1, float cy1, float cx2, + float cy2, float time2, float value2); +SPINE_C_API float spine_physics_constraint_gravity_timeline_get_bezier_value(spine_physics_constraint_gravity_timeline self, float time, size_t frame, + size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_physics_constraint_gravity_timeline_get_curves(spine_physics_constraint_gravity_timeline self); SPINE_C_API size_t spine_physics_constraint_gravity_timeline_get_frame_entries(spine_physics_constraint_gravity_timeline self); SPINE_C_API size_t spine_physics_constraint_gravity_timeline_get_frame_count(spine_physics_constraint_gravity_timeline self); diff --git a/spine-c/src/generated/physics_constraint_inertia_timeline.cpp b/spine-c/src/generated/physics_constraint_inertia_timeline.cpp index 91ec0b74d..53836f1d8 100644 --- a/spine-c/src/generated/physics_constraint_inertia_timeline.cpp +++ b/spine-c/src/generated/physics_constraint_inertia_timeline.cpp @@ -3,94 +3,126 @@ using namespace spine; -spine_physics_constraint_inertia_timeline spine_physics_constraint_inertia_timeline_create(size_t frameCount, size_t bezierCount, int physicsConstraintIndex) { - return (spine_physics_constraint_inertia_timeline) new (__FILE__, __LINE__) PhysicsConstraintInertiaTimeline(frameCount, bezierCount, physicsConstraintIndex); +spine_physics_constraint_inertia_timeline spine_physics_constraint_inertia_timeline_create(size_t frameCount, size_t bezierCount, + int physicsConstraintIndex) { + return (spine_physics_constraint_inertia_timeline) new (__FILE__, __LINE__) + PhysicsConstraintInertiaTimeline(frameCount, bezierCount, physicsConstraintIndex); } void spine_physics_constraint_inertia_timeline_dispose(spine_physics_constraint_inertia_timeline self) { - delete (PhysicsConstraintInertiaTimeline*)self; + delete (PhysicsConstraintInertiaTimeline *) self; } spine_rtti spine_physics_constraint_inertia_timeline_get_rtti(spine_physics_constraint_inertia_timeline self) { - return (spine_rtti)&((PhysicsConstraintInertiaTimeline*)self)->getRTTI(); + PhysicsConstraintInertiaTimeline *_self = (PhysicsConstraintInertiaTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_physics_constraint_inertia_timeline_apply(spine_physics_constraint_inertia_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintInertiaTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_physics_constraint_inertia_timeline_apply(spine_physics_constraint_inertia_timeline self, spine_skeleton skeleton, float lastTime, + float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, + spine_mix_direction direction, bool appliedPose) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintInertiaTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_physics_constraint_inertia_timeline_set_frame(spine_physics_constraint_inertia_timeline self, size_t frame, float time, float value) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintInertiaTimeline*)self)->setFrame(frame, time, value); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintInertiaTimeline *) self; + _self->setFrame(frame, time, value); } float spine_physics_constraint_inertia_timeline_get_curve_value(spine_physics_constraint_inertia_timeline self, float time) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintInertiaTimeline*)self)->getCurveValue(time); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintInertiaTimeline *) self; + return _self->getCurveValue(time); } -float spine_physics_constraint_inertia_timeline_get_relative_value(spine_physics_constraint_inertia_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintInertiaTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_physics_constraint_inertia_timeline_get_relative_value(spine_physics_constraint_inertia_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintInertiaTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_physics_constraint_inertia_timeline_get_absolute_value_1(spine_physics_constraint_inertia_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintInertiaTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_physics_constraint_inertia_timeline_get_absolute_value_1(spine_physics_constraint_inertia_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintInertiaTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_physics_constraint_inertia_timeline_get_absolute_value_2(spine_physics_constraint_inertia_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintInertiaTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_physics_constraint_inertia_timeline_get_absolute_value_2(spine_physics_constraint_inertia_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup, float value) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintInertiaTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_physics_constraint_inertia_timeline_get_scale_value(spine_physics_constraint_inertia_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintInertiaTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_physics_constraint_inertia_timeline_get_scale_value(spine_physics_constraint_inertia_timeline self, float time, float alpha, + spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintInertiaTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_physics_constraint_inertia_timeline_set_linear(spine_physics_constraint_inertia_timeline self, size_t frame) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintInertiaTimeline*)self)->setLinear(frame); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintInertiaTimeline *) self; + _self->setLinear(frame); } void spine_physics_constraint_inertia_timeline_set_stepped(spine_physics_constraint_inertia_timeline self, size_t frame) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintInertiaTimeline*)self)->setStepped(frame); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintInertiaTimeline *) self; + _self->setStepped(frame); } -void spine_physics_constraint_inertia_timeline_set_bezier(spine_physics_constraint_inertia_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintInertiaTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_physics_constraint_inertia_timeline_set_bezier(spine_physics_constraint_inertia_timeline self, size_t bezier, size_t frame, float value, + float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, + float value2) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintInertiaTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } -float spine_physics_constraint_inertia_timeline_get_bezier_value(spine_physics_constraint_inertia_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintInertiaTimeline*)self)->getBezierValue(time, frame, valueOffset, i); +float spine_physics_constraint_inertia_timeline_get_bezier_value(spine_physics_constraint_inertia_timeline self, float time, size_t frame, + size_t valueOffset, size_t i) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintInertiaTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_physics_constraint_inertia_timeline_get_curves(spine_physics_constraint_inertia_timeline self) { - return (spine_array_float)&((PhysicsConstraintTimeline*)(PhysicsConstraintInertiaTimeline*)self)->getCurves(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintInertiaTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_physics_constraint_inertia_timeline_get_frame_entries(spine_physics_constraint_inertia_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintInertiaTimeline*)self)->getFrameEntries(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintInertiaTimeline *) self; + return _self->getFrameEntries(); } size_t spine_physics_constraint_inertia_timeline_get_frame_count(spine_physics_constraint_inertia_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintInertiaTimeline*)self)->getFrameCount(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintInertiaTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_physics_constraint_inertia_timeline_get_frames(spine_physics_constraint_inertia_timeline self) { - return (spine_array_float)&((PhysicsConstraintTimeline*)(PhysicsConstraintInertiaTimeline*)self)->getFrames(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintInertiaTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_physics_constraint_inertia_timeline_get_duration(spine_physics_constraint_inertia_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintInertiaTimeline*)self)->getDuration(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintInertiaTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_physics_constraint_inertia_timeline_get_property_ids(spine_physics_constraint_inertia_timeline self) { - return (spine_array_property_id)&((PhysicsConstraintTimeline*)(PhysicsConstraintInertiaTimeline*)self)->getPropertyIds(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintInertiaTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_physics_constraint_inertia_timeline_get_constraint_index(spine_physics_constraint_inertia_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintInertiaTimeline*)self)->getConstraintIndex(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintInertiaTimeline *) self; + return _self->getConstraintIndex(); } void spine_physics_constraint_inertia_timeline_set_constraint_index(spine_physics_constraint_inertia_timeline self, int inValue) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintInertiaTimeline*)self)->setConstraintIndex(inValue); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintInertiaTimeline *) self; + _self->setConstraintIndex(inValue); } spine_rtti spine_physics_constraint_inertia_timeline_rtti(void) { - return (spine_rtti)&PhysicsConstraintInertiaTimeline::rtti; + return (spine_rtti) &PhysicsConstraintInertiaTimeline::rtti; } diff --git a/spine-c/src/generated/physics_constraint_inertia_timeline.h b/spine-c/src/generated/physics_constraint_inertia_timeline.h index bcca14f68..6cfee1b8f 100644 --- a/spine-c/src/generated/physics_constraint_inertia_timeline.h +++ b/spine-c/src/generated/physics_constraint_inertia_timeline.h @@ -8,22 +8,35 @@ extern "C" { #endif -SPINE_C_API spine_physics_constraint_inertia_timeline spine_physics_constraint_inertia_timeline_create(size_t frameCount, size_t bezierCount, int physicsConstraintIndex); +SPINE_C_API spine_physics_constraint_inertia_timeline spine_physics_constraint_inertia_timeline_create(size_t frameCount, size_t bezierCount, + int physicsConstraintIndex); SPINE_C_API void spine_physics_constraint_inertia_timeline_dispose(spine_physics_constraint_inertia_timeline self); SPINE_C_API spine_rtti spine_physics_constraint_inertia_timeline_get_rtti(spine_physics_constraint_inertia_timeline self); -SPINE_C_API void spine_physics_constraint_inertia_timeline_apply(spine_physics_constraint_inertia_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); -SPINE_C_API void spine_physics_constraint_inertia_timeline_set_frame(spine_physics_constraint_inertia_timeline self, size_t frame, float time, float value); +SPINE_C_API void spine_physics_constraint_inertia_timeline_apply(spine_physics_constraint_inertia_timeline self, spine_skeleton skeleton, + float lastTime, float time, spine_array_event pEvents, float alpha, + spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_physics_constraint_inertia_timeline_set_frame(spine_physics_constraint_inertia_timeline self, size_t frame, float time, + float value); SPINE_C_API float spine_physics_constraint_inertia_timeline_get_curve_value(spine_physics_constraint_inertia_timeline self, float time); -SPINE_C_API float spine_physics_constraint_inertia_timeline_get_relative_value(spine_physics_constraint_inertia_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_physics_constraint_inertia_timeline_get_absolute_value_1(spine_physics_constraint_inertia_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_physics_constraint_inertia_timeline_get_absolute_value_2(spine_physics_constraint_inertia_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_physics_constraint_inertia_timeline_get_scale_value(spine_physics_constraint_inertia_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_physics_constraint_inertia_timeline_get_relative_value(spine_physics_constraint_inertia_timeline self, float time, + float alpha, spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_physics_constraint_inertia_timeline_get_absolute_value_1(spine_physics_constraint_inertia_timeline self, float time, + float alpha, spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_physics_constraint_inertia_timeline_get_absolute_value_2(spine_physics_constraint_inertia_timeline self, float time, + float alpha, spine_mix_blend blend, float current, float setup, + float value); +SPINE_C_API float spine_physics_constraint_inertia_timeline_get_scale_value(spine_physics_constraint_inertia_timeline self, float time, float alpha, + spine_mix_blend blend, spine_mix_direction direction, float current, + float setup); SPINE_C_API void spine_physics_constraint_inertia_timeline_set_linear(spine_physics_constraint_inertia_timeline self, size_t frame); SPINE_C_API void spine_physics_constraint_inertia_timeline_set_stepped(spine_physics_constraint_inertia_timeline self, size_t frame); -SPINE_C_API void spine_physics_constraint_inertia_timeline_set_bezier(spine_physics_constraint_inertia_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); -SPINE_C_API float spine_physics_constraint_inertia_timeline_get_bezier_value(spine_physics_constraint_inertia_timeline self, float time, size_t frame, size_t valueOffset, size_t i); +SPINE_C_API void spine_physics_constraint_inertia_timeline_set_bezier(spine_physics_constraint_inertia_timeline self, size_t bezier, size_t frame, + float value, float time1, float value1, float cx1, float cy1, float cx2, + float cy2, float time2, float value2); +SPINE_C_API float spine_physics_constraint_inertia_timeline_get_bezier_value(spine_physics_constraint_inertia_timeline self, float time, size_t frame, + size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_physics_constraint_inertia_timeline_get_curves(spine_physics_constraint_inertia_timeline self); SPINE_C_API size_t spine_physics_constraint_inertia_timeline_get_frame_entries(spine_physics_constraint_inertia_timeline self); SPINE_C_API size_t spine_physics_constraint_inertia_timeline_get_frame_count(spine_physics_constraint_inertia_timeline self); diff --git a/spine-c/src/generated/physics_constraint_mass_timeline.cpp b/spine-c/src/generated/physics_constraint_mass_timeline.cpp index 5341b87ec..1e0ef8d4b 100644 --- a/spine-c/src/generated/physics_constraint_mass_timeline.cpp +++ b/spine-c/src/generated/physics_constraint_mass_timeline.cpp @@ -3,94 +3,126 @@ using namespace spine; -spine_physics_constraint_mass_timeline spine_physics_constraint_mass_timeline_create(size_t frameCount, size_t bezierCount, int physicsConstraintIndex) { - return (spine_physics_constraint_mass_timeline) new (__FILE__, __LINE__) PhysicsConstraintMassTimeline(frameCount, bezierCount, physicsConstraintIndex); +spine_physics_constraint_mass_timeline spine_physics_constraint_mass_timeline_create(size_t frameCount, size_t bezierCount, + int physicsConstraintIndex) { + return (spine_physics_constraint_mass_timeline) new (__FILE__, __LINE__) + PhysicsConstraintMassTimeline(frameCount, bezierCount, physicsConstraintIndex); } void spine_physics_constraint_mass_timeline_dispose(spine_physics_constraint_mass_timeline self) { - delete (PhysicsConstraintMassTimeline*)self; + delete (PhysicsConstraintMassTimeline *) self; } spine_rtti spine_physics_constraint_mass_timeline_get_rtti(spine_physics_constraint_mass_timeline self) { - return (spine_rtti)&((PhysicsConstraintMassTimeline*)self)->getRTTI(); + PhysicsConstraintMassTimeline *_self = (PhysicsConstraintMassTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_physics_constraint_mass_timeline_apply(spine_physics_constraint_mass_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintMassTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_physics_constraint_mass_timeline_apply(spine_physics_constraint_mass_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMassTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_physics_constraint_mass_timeline_set_frame(spine_physics_constraint_mass_timeline self, size_t frame, float time, float value) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintMassTimeline*)self)->setFrame(frame, time, value); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMassTimeline *) self; + _self->setFrame(frame, time, value); } float spine_physics_constraint_mass_timeline_get_curve_value(spine_physics_constraint_mass_timeline self, float time) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMassTimeline*)self)->getCurveValue(time); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMassTimeline *) self; + return _self->getCurveValue(time); } -float spine_physics_constraint_mass_timeline_get_relative_value(spine_physics_constraint_mass_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMassTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_physics_constraint_mass_timeline_get_relative_value(spine_physics_constraint_mass_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMassTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_physics_constraint_mass_timeline_get_absolute_value_1(spine_physics_constraint_mass_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMassTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_physics_constraint_mass_timeline_get_absolute_value_1(spine_physics_constraint_mass_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMassTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_physics_constraint_mass_timeline_get_absolute_value_2(spine_physics_constraint_mass_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMassTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_physics_constraint_mass_timeline_get_absolute_value_2(spine_physics_constraint_mass_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup, float value) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMassTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_physics_constraint_mass_timeline_get_scale_value(spine_physics_constraint_mass_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMassTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_physics_constraint_mass_timeline_get_scale_value(spine_physics_constraint_mass_timeline self, float time, float alpha, + spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMassTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_physics_constraint_mass_timeline_set_linear(spine_physics_constraint_mass_timeline self, size_t frame) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintMassTimeline*)self)->setLinear(frame); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMassTimeline *) self; + _self->setLinear(frame); } void spine_physics_constraint_mass_timeline_set_stepped(spine_physics_constraint_mass_timeline self, size_t frame) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintMassTimeline*)self)->setStepped(frame); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMassTimeline *) self; + _self->setStepped(frame); } -void spine_physics_constraint_mass_timeline_set_bezier(spine_physics_constraint_mass_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintMassTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_physics_constraint_mass_timeline_set_bezier(spine_physics_constraint_mass_timeline self, size_t bezier, size_t frame, float value, + float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, + float value2) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMassTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } -float spine_physics_constraint_mass_timeline_get_bezier_value(spine_physics_constraint_mass_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMassTimeline*)self)->getBezierValue(time, frame, valueOffset, i); +float spine_physics_constraint_mass_timeline_get_bezier_value(spine_physics_constraint_mass_timeline self, float time, size_t frame, + size_t valueOffset, size_t i) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMassTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_physics_constraint_mass_timeline_get_curves(spine_physics_constraint_mass_timeline self) { - return (spine_array_float)&((PhysicsConstraintTimeline*)(PhysicsConstraintMassTimeline*)self)->getCurves(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMassTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_physics_constraint_mass_timeline_get_frame_entries(spine_physics_constraint_mass_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMassTimeline*)self)->getFrameEntries(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMassTimeline *) self; + return _self->getFrameEntries(); } size_t spine_physics_constraint_mass_timeline_get_frame_count(spine_physics_constraint_mass_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMassTimeline*)self)->getFrameCount(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMassTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_physics_constraint_mass_timeline_get_frames(spine_physics_constraint_mass_timeline self) { - return (spine_array_float)&((PhysicsConstraintTimeline*)(PhysicsConstraintMassTimeline*)self)->getFrames(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMassTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_physics_constraint_mass_timeline_get_duration(spine_physics_constraint_mass_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMassTimeline*)self)->getDuration(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMassTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_physics_constraint_mass_timeline_get_property_ids(spine_physics_constraint_mass_timeline self) { - return (spine_array_property_id)&((PhysicsConstraintTimeline*)(PhysicsConstraintMassTimeline*)self)->getPropertyIds(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMassTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_physics_constraint_mass_timeline_get_constraint_index(spine_physics_constraint_mass_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMassTimeline*)self)->getConstraintIndex(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMassTimeline *) self; + return _self->getConstraintIndex(); } void spine_physics_constraint_mass_timeline_set_constraint_index(spine_physics_constraint_mass_timeline self, int inValue) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintMassTimeline*)self)->setConstraintIndex(inValue); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMassTimeline *) self; + _self->setConstraintIndex(inValue); } spine_rtti spine_physics_constraint_mass_timeline_rtti(void) { - return (spine_rtti)&PhysicsConstraintMassTimeline::rtti; + return (spine_rtti) &PhysicsConstraintMassTimeline::rtti; } diff --git a/spine-c/src/generated/physics_constraint_mass_timeline.h b/spine-c/src/generated/physics_constraint_mass_timeline.h index 259385eff..310a57ea3 100644 --- a/spine-c/src/generated/physics_constraint_mass_timeline.h +++ b/spine-c/src/generated/physics_constraint_mass_timeline.h @@ -8,22 +8,33 @@ extern "C" { #endif -SPINE_C_API spine_physics_constraint_mass_timeline spine_physics_constraint_mass_timeline_create(size_t frameCount, size_t bezierCount, int physicsConstraintIndex); +SPINE_C_API spine_physics_constraint_mass_timeline spine_physics_constraint_mass_timeline_create(size_t frameCount, size_t bezierCount, + int physicsConstraintIndex); SPINE_C_API void spine_physics_constraint_mass_timeline_dispose(spine_physics_constraint_mass_timeline self); SPINE_C_API spine_rtti spine_physics_constraint_mass_timeline_get_rtti(spine_physics_constraint_mass_timeline self); -SPINE_C_API void spine_physics_constraint_mass_timeline_apply(spine_physics_constraint_mass_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_physics_constraint_mass_timeline_apply(spine_physics_constraint_mass_timeline self, spine_skeleton skeleton, float lastTime, + float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, + spine_mix_direction direction, bool appliedPose); SPINE_C_API void spine_physics_constraint_mass_timeline_set_frame(spine_physics_constraint_mass_timeline self, size_t frame, float time, float value); SPINE_C_API float spine_physics_constraint_mass_timeline_get_curve_value(spine_physics_constraint_mass_timeline self, float time); -SPINE_C_API float spine_physics_constraint_mass_timeline_get_relative_value(spine_physics_constraint_mass_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_physics_constraint_mass_timeline_get_absolute_value_1(spine_physics_constraint_mass_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_physics_constraint_mass_timeline_get_absolute_value_2(spine_physics_constraint_mass_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_physics_constraint_mass_timeline_get_scale_value(spine_physics_constraint_mass_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_physics_constraint_mass_timeline_get_relative_value(spine_physics_constraint_mass_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_physics_constraint_mass_timeline_get_absolute_value_1(spine_physics_constraint_mass_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_physics_constraint_mass_timeline_get_absolute_value_2(spine_physics_constraint_mass_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup, float value); +SPINE_C_API float spine_physics_constraint_mass_timeline_get_scale_value(spine_physics_constraint_mass_timeline self, float time, float alpha, + spine_mix_blend blend, spine_mix_direction direction, float current, + float setup); SPINE_C_API void spine_physics_constraint_mass_timeline_set_linear(spine_physics_constraint_mass_timeline self, size_t frame); SPINE_C_API void spine_physics_constraint_mass_timeline_set_stepped(spine_physics_constraint_mass_timeline self, size_t frame); -SPINE_C_API void spine_physics_constraint_mass_timeline_set_bezier(spine_physics_constraint_mass_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); -SPINE_C_API float spine_physics_constraint_mass_timeline_get_bezier_value(spine_physics_constraint_mass_timeline self, float time, size_t frame, size_t valueOffset, size_t i); +SPINE_C_API void spine_physics_constraint_mass_timeline_set_bezier(spine_physics_constraint_mass_timeline self, size_t bezier, size_t frame, + float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, + float time2, float value2); +SPINE_C_API float spine_physics_constraint_mass_timeline_get_bezier_value(spine_physics_constraint_mass_timeline self, float time, size_t frame, + size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_physics_constraint_mass_timeline_get_curves(spine_physics_constraint_mass_timeline self); SPINE_C_API size_t spine_physics_constraint_mass_timeline_get_frame_entries(spine_physics_constraint_mass_timeline self); SPINE_C_API size_t spine_physics_constraint_mass_timeline_get_frame_count(spine_physics_constraint_mass_timeline self); diff --git a/spine-c/src/generated/physics_constraint_mix_timeline.cpp b/spine-c/src/generated/physics_constraint_mix_timeline.cpp index d5ecc3ff2..a80b3cbd0 100644 --- a/spine-c/src/generated/physics_constraint_mix_timeline.cpp +++ b/spine-c/src/generated/physics_constraint_mix_timeline.cpp @@ -3,94 +3,126 @@ using namespace spine; -spine_physics_constraint_mix_timeline spine_physics_constraint_mix_timeline_create(size_t frameCount, size_t bezierCount, int physicsConstraintIndex) { - return (spine_physics_constraint_mix_timeline) new (__FILE__, __LINE__) PhysicsConstraintMixTimeline(frameCount, bezierCount, physicsConstraintIndex); +spine_physics_constraint_mix_timeline spine_physics_constraint_mix_timeline_create(size_t frameCount, size_t bezierCount, + int physicsConstraintIndex) { + return (spine_physics_constraint_mix_timeline) new (__FILE__, __LINE__) + PhysicsConstraintMixTimeline(frameCount, bezierCount, physicsConstraintIndex); } void spine_physics_constraint_mix_timeline_dispose(spine_physics_constraint_mix_timeline self) { - delete (PhysicsConstraintMixTimeline*)self; + delete (PhysicsConstraintMixTimeline *) self; } spine_rtti spine_physics_constraint_mix_timeline_get_rtti(spine_physics_constraint_mix_timeline self) { - return (spine_rtti)&((PhysicsConstraintMixTimeline*)self)->getRTTI(); + PhysicsConstraintMixTimeline *_self = (PhysicsConstraintMixTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_physics_constraint_mix_timeline_apply(spine_physics_constraint_mix_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintMixTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_physics_constraint_mix_timeline_apply(spine_physics_constraint_mix_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMixTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_physics_constraint_mix_timeline_set_frame(spine_physics_constraint_mix_timeline self, size_t frame, float time, float value) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintMixTimeline*)self)->setFrame(frame, time, value); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMixTimeline *) self; + _self->setFrame(frame, time, value); } float spine_physics_constraint_mix_timeline_get_curve_value(spine_physics_constraint_mix_timeline self, float time) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMixTimeline*)self)->getCurveValue(time); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMixTimeline *) self; + return _self->getCurveValue(time); } -float spine_physics_constraint_mix_timeline_get_relative_value(spine_physics_constraint_mix_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMixTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_physics_constraint_mix_timeline_get_relative_value(spine_physics_constraint_mix_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMixTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_physics_constraint_mix_timeline_get_absolute_value_1(spine_physics_constraint_mix_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMixTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_physics_constraint_mix_timeline_get_absolute_value_1(spine_physics_constraint_mix_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMixTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_physics_constraint_mix_timeline_get_absolute_value_2(spine_physics_constraint_mix_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMixTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_physics_constraint_mix_timeline_get_absolute_value_2(spine_physics_constraint_mix_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup, float value) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMixTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_physics_constraint_mix_timeline_get_scale_value(spine_physics_constraint_mix_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMixTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_physics_constraint_mix_timeline_get_scale_value(spine_physics_constraint_mix_timeline self, float time, float alpha, + spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMixTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_physics_constraint_mix_timeline_set_linear(spine_physics_constraint_mix_timeline self, size_t frame) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintMixTimeline*)self)->setLinear(frame); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMixTimeline *) self; + _self->setLinear(frame); } void spine_physics_constraint_mix_timeline_set_stepped(spine_physics_constraint_mix_timeline self, size_t frame) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintMixTimeline*)self)->setStepped(frame); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMixTimeline *) self; + _self->setStepped(frame); } -void spine_physics_constraint_mix_timeline_set_bezier(spine_physics_constraint_mix_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintMixTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_physics_constraint_mix_timeline_set_bezier(spine_physics_constraint_mix_timeline self, size_t bezier, size_t frame, float value, + float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, + float value2) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMixTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } -float spine_physics_constraint_mix_timeline_get_bezier_value(spine_physics_constraint_mix_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMixTimeline*)self)->getBezierValue(time, frame, valueOffset, i); +float spine_physics_constraint_mix_timeline_get_bezier_value(spine_physics_constraint_mix_timeline self, float time, size_t frame, size_t valueOffset, + size_t i) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMixTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_physics_constraint_mix_timeline_get_curves(spine_physics_constraint_mix_timeline self) { - return (spine_array_float)&((PhysicsConstraintTimeline*)(PhysicsConstraintMixTimeline*)self)->getCurves(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMixTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_physics_constraint_mix_timeline_get_frame_entries(spine_physics_constraint_mix_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMixTimeline*)self)->getFrameEntries(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMixTimeline *) self; + return _self->getFrameEntries(); } size_t spine_physics_constraint_mix_timeline_get_frame_count(spine_physics_constraint_mix_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMixTimeline*)self)->getFrameCount(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMixTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_physics_constraint_mix_timeline_get_frames(spine_physics_constraint_mix_timeline self) { - return (spine_array_float)&((PhysicsConstraintTimeline*)(PhysicsConstraintMixTimeline*)self)->getFrames(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMixTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_physics_constraint_mix_timeline_get_duration(spine_physics_constraint_mix_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMixTimeline*)self)->getDuration(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMixTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_physics_constraint_mix_timeline_get_property_ids(spine_physics_constraint_mix_timeline self) { - return (spine_array_property_id)&((PhysicsConstraintTimeline*)(PhysicsConstraintMixTimeline*)self)->getPropertyIds(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMixTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_physics_constraint_mix_timeline_get_constraint_index(spine_physics_constraint_mix_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintMixTimeline*)self)->getConstraintIndex(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMixTimeline *) self; + return _self->getConstraintIndex(); } void spine_physics_constraint_mix_timeline_set_constraint_index(spine_physics_constraint_mix_timeline self, int inValue) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintMixTimeline*)self)->setConstraintIndex(inValue); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintMixTimeline *) self; + _self->setConstraintIndex(inValue); } spine_rtti spine_physics_constraint_mix_timeline_rtti(void) { - return (spine_rtti)&PhysicsConstraintMixTimeline::rtti; + return (spine_rtti) &PhysicsConstraintMixTimeline::rtti; } diff --git a/spine-c/src/generated/physics_constraint_mix_timeline.h b/spine-c/src/generated/physics_constraint_mix_timeline.h index 9841e2942..0c8a5da83 100644 --- a/spine-c/src/generated/physics_constraint_mix_timeline.h +++ b/spine-c/src/generated/physics_constraint_mix_timeline.h @@ -8,22 +8,33 @@ extern "C" { #endif -SPINE_C_API spine_physics_constraint_mix_timeline spine_physics_constraint_mix_timeline_create(size_t frameCount, size_t bezierCount, int physicsConstraintIndex); +SPINE_C_API spine_physics_constraint_mix_timeline spine_physics_constraint_mix_timeline_create(size_t frameCount, size_t bezierCount, + int physicsConstraintIndex); SPINE_C_API void spine_physics_constraint_mix_timeline_dispose(spine_physics_constraint_mix_timeline self); SPINE_C_API spine_rtti spine_physics_constraint_mix_timeline_get_rtti(spine_physics_constraint_mix_timeline self); -SPINE_C_API void spine_physics_constraint_mix_timeline_apply(spine_physics_constraint_mix_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_physics_constraint_mix_timeline_apply(spine_physics_constraint_mix_timeline self, spine_skeleton skeleton, float lastTime, + float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, + spine_mix_direction direction, bool appliedPose); SPINE_C_API void spine_physics_constraint_mix_timeline_set_frame(spine_physics_constraint_mix_timeline self, size_t frame, float time, float value); SPINE_C_API float spine_physics_constraint_mix_timeline_get_curve_value(spine_physics_constraint_mix_timeline self, float time); -SPINE_C_API float spine_physics_constraint_mix_timeline_get_relative_value(spine_physics_constraint_mix_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_physics_constraint_mix_timeline_get_absolute_value_1(spine_physics_constraint_mix_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_physics_constraint_mix_timeline_get_absolute_value_2(spine_physics_constraint_mix_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_physics_constraint_mix_timeline_get_scale_value(spine_physics_constraint_mix_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_physics_constraint_mix_timeline_get_relative_value(spine_physics_constraint_mix_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_physics_constraint_mix_timeline_get_absolute_value_1(spine_physics_constraint_mix_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_physics_constraint_mix_timeline_get_absolute_value_2(spine_physics_constraint_mix_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup, float value); +SPINE_C_API float spine_physics_constraint_mix_timeline_get_scale_value(spine_physics_constraint_mix_timeline self, float time, float alpha, + spine_mix_blend blend, spine_mix_direction direction, float current, + float setup); SPINE_C_API void spine_physics_constraint_mix_timeline_set_linear(spine_physics_constraint_mix_timeline self, size_t frame); SPINE_C_API void spine_physics_constraint_mix_timeline_set_stepped(spine_physics_constraint_mix_timeline self, size_t frame); -SPINE_C_API void spine_physics_constraint_mix_timeline_set_bezier(spine_physics_constraint_mix_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); -SPINE_C_API float spine_physics_constraint_mix_timeline_get_bezier_value(spine_physics_constraint_mix_timeline self, float time, size_t frame, size_t valueOffset, size_t i); +SPINE_C_API void spine_physics_constraint_mix_timeline_set_bezier(spine_physics_constraint_mix_timeline self, size_t bezier, size_t frame, + float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, + float time2, float value2); +SPINE_C_API float spine_physics_constraint_mix_timeline_get_bezier_value(spine_physics_constraint_mix_timeline self, float time, size_t frame, + size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_physics_constraint_mix_timeline_get_curves(spine_physics_constraint_mix_timeline self); SPINE_C_API size_t spine_physics_constraint_mix_timeline_get_frame_entries(spine_physics_constraint_mix_timeline self); SPINE_C_API size_t spine_physics_constraint_mix_timeline_get_frame_count(spine_physics_constraint_mix_timeline self); diff --git a/spine-c/src/generated/physics_constraint_pose.cpp b/spine-c/src/generated/physics_constraint_pose.cpp index dfd53b9bf..29debd302 100644 --- a/spine-c/src/generated/physics_constraint_pose.cpp +++ b/spine-c/src/generated/physics_constraint_pose.cpp @@ -4,69 +4,84 @@ using namespace spine; spine_physics_constraint_pose spine_physics_constraint_pose_create(void) { - return (spine_physics_constraint_pose) new (__FILE__, __LINE__) PhysicsConstraintPose(); + return (spine_physics_constraint_pose) new (__FILE__, __LINE__) PhysicsConstraintPose(); } void spine_physics_constraint_pose_dispose(spine_physics_constraint_pose self) { - delete (PhysicsConstraintPose*)self; + delete (PhysicsConstraintPose *) self; } void spine_physics_constraint_pose_set(spine_physics_constraint_pose self, spine_physics_constraint_pose pose) { - ((PhysicsConstraintPose*)self)->set(*((PhysicsConstraintPose*)pose)); + PhysicsConstraintPose *_self = (PhysicsConstraintPose *) self; + _self->set(*((PhysicsConstraintPose *) pose)); } float spine_physics_constraint_pose_get_inertia(spine_physics_constraint_pose self) { - return ((PhysicsConstraintPose*)self)->getInertia(); + PhysicsConstraintPose *_self = (PhysicsConstraintPose *) self; + return _self->getInertia(); } void spine_physics_constraint_pose_set_inertia(spine_physics_constraint_pose self, float inertia) { - ((PhysicsConstraintPose*)self)->setInertia(inertia); + PhysicsConstraintPose *_self = (PhysicsConstraintPose *) self; + _self->setInertia(inertia); } float spine_physics_constraint_pose_get_strength(spine_physics_constraint_pose self) { - return ((PhysicsConstraintPose*)self)->getStrength(); + PhysicsConstraintPose *_self = (PhysicsConstraintPose *) self; + return _self->getStrength(); } void spine_physics_constraint_pose_set_strength(spine_physics_constraint_pose self, float strength) { - ((PhysicsConstraintPose*)self)->setStrength(strength); + PhysicsConstraintPose *_self = (PhysicsConstraintPose *) self; + _self->setStrength(strength); } float spine_physics_constraint_pose_get_damping(spine_physics_constraint_pose self) { - return ((PhysicsConstraintPose*)self)->getDamping(); + PhysicsConstraintPose *_self = (PhysicsConstraintPose *) self; + return _self->getDamping(); } void spine_physics_constraint_pose_set_damping(spine_physics_constraint_pose self, float damping) { - ((PhysicsConstraintPose*)self)->setDamping(damping); + PhysicsConstraintPose *_self = (PhysicsConstraintPose *) self; + _self->setDamping(damping); } float spine_physics_constraint_pose_get_mass_inverse(spine_physics_constraint_pose self) { - return ((PhysicsConstraintPose*)self)->getMassInverse(); + PhysicsConstraintPose *_self = (PhysicsConstraintPose *) self; + return _self->getMassInverse(); } void spine_physics_constraint_pose_set_mass_inverse(spine_physics_constraint_pose self, float massInverse) { - ((PhysicsConstraintPose*)self)->setMassInverse(massInverse); + PhysicsConstraintPose *_self = (PhysicsConstraintPose *) self; + _self->setMassInverse(massInverse); } float spine_physics_constraint_pose_get_wind(spine_physics_constraint_pose self) { - return ((PhysicsConstraintPose*)self)->getWind(); + PhysicsConstraintPose *_self = (PhysicsConstraintPose *) self; + return _self->getWind(); } void spine_physics_constraint_pose_set_wind(spine_physics_constraint_pose self, float wind) { - ((PhysicsConstraintPose*)self)->setWind(wind); + PhysicsConstraintPose *_self = (PhysicsConstraintPose *) self; + _self->setWind(wind); } float spine_physics_constraint_pose_get_gravity(spine_physics_constraint_pose self) { - return ((PhysicsConstraintPose*)self)->getGravity(); + PhysicsConstraintPose *_self = (PhysicsConstraintPose *) self; + return _self->getGravity(); } void spine_physics_constraint_pose_set_gravity(spine_physics_constraint_pose self, float gravity) { - ((PhysicsConstraintPose*)self)->setGravity(gravity); + PhysicsConstraintPose *_self = (PhysicsConstraintPose *) self; + _self->setGravity(gravity); } float spine_physics_constraint_pose_get_mix(spine_physics_constraint_pose self) { - return ((PhysicsConstraintPose*)self)->getMix(); + PhysicsConstraintPose *_self = (PhysicsConstraintPose *) self; + return _self->getMix(); } void spine_physics_constraint_pose_set_mix(spine_physics_constraint_pose self, float mix) { - ((PhysicsConstraintPose*)self)->setMix(mix); + PhysicsConstraintPose *_self = (PhysicsConstraintPose *) self; + _self->setMix(mix); } diff --git a/spine-c/src/generated/physics_constraint_reset_timeline.cpp b/spine-c/src/generated/physics_constraint_reset_timeline.cpp index ecec21c76..4c95ff33e 100644 --- a/spine-c/src/generated/physics_constraint_reset_timeline.cpp +++ b/spine-c/src/generated/physics_constraint_reset_timeline.cpp @@ -4,53 +4,66 @@ using namespace spine; spine_physics_constraint_reset_timeline spine_physics_constraint_reset_timeline_create(size_t frameCount, int constraintIndex) { - return (spine_physics_constraint_reset_timeline) new (__FILE__, __LINE__) PhysicsConstraintResetTimeline(frameCount, constraintIndex); + return (spine_physics_constraint_reset_timeline) new (__FILE__, __LINE__) PhysicsConstraintResetTimeline(frameCount, constraintIndex); } void spine_physics_constraint_reset_timeline_dispose(spine_physics_constraint_reset_timeline self) { - delete (PhysicsConstraintResetTimeline*)self; + delete (PhysicsConstraintResetTimeline *) self; } spine_rtti spine_physics_constraint_reset_timeline_get_rtti(spine_physics_constraint_reset_timeline self) { - return (spine_rtti)&((PhysicsConstraintResetTimeline*)self)->getRTTI(); + PhysicsConstraintResetTimeline *_self = (PhysicsConstraintResetTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_physics_constraint_reset_timeline_apply(spine_physics_constraint_reset_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((PhysicsConstraintResetTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_physics_constraint_reset_timeline_apply(spine_physics_constraint_reset_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose) { + PhysicsConstraintResetTimeline *_self = (PhysicsConstraintResetTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } int spine_physics_constraint_reset_timeline_get_frame_count(spine_physics_constraint_reset_timeline self) { - return ((PhysicsConstraintResetTimeline*)self)->getFrameCount(); + PhysicsConstraintResetTimeline *_self = (PhysicsConstraintResetTimeline *) self; + return _self->getFrameCount(); } int spine_physics_constraint_reset_timeline_get_constraint_index(spine_physics_constraint_reset_timeline self) { - return ((PhysicsConstraintResetTimeline*)self)->getConstraintIndex(); + PhysicsConstraintResetTimeline *_self = (PhysicsConstraintResetTimeline *) self; + return _self->getConstraintIndex(); } void spine_physics_constraint_reset_timeline_set_frame(spine_physics_constraint_reset_timeline self, int frame, float time) { - ((PhysicsConstraintResetTimeline*)self)->setFrame(frame, time); + PhysicsConstraintResetTimeline *_self = (PhysicsConstraintResetTimeline *) self; + _self->setFrame(frame, time); } size_t spine_physics_constraint_reset_timeline_get_frame_entries(spine_physics_constraint_reset_timeline self) { - return ((Timeline*)(PhysicsConstraintResetTimeline*)self)->getFrameEntries(); + Timeline *_self = (Timeline *) (PhysicsConstraintResetTimeline *) self; + return _self->getFrameEntries(); } spine_array_float spine_physics_constraint_reset_timeline_get_frames(spine_physics_constraint_reset_timeline self) { - return (spine_array_float)&((Timeline*)(PhysicsConstraintResetTimeline*)self)->getFrames(); + Timeline *_self = (Timeline *) (PhysicsConstraintResetTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_physics_constraint_reset_timeline_get_duration(spine_physics_constraint_reset_timeline self) { - return ((Timeline*)(PhysicsConstraintResetTimeline*)self)->getDuration(); + Timeline *_self = (Timeline *) (PhysicsConstraintResetTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_physics_constraint_reset_timeline_get_property_ids(spine_physics_constraint_reset_timeline self) { - return (spine_array_property_id)&((Timeline*)(PhysicsConstraintResetTimeline*)self)->getPropertyIds(); + Timeline *_self = (Timeline *) (PhysicsConstraintResetTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } void spine_physics_constraint_reset_timeline_set_constraint_index(spine_physics_constraint_reset_timeline self, int inValue) { - ((ConstraintTimeline*)(PhysicsConstraintResetTimeline*)self)->setConstraintIndex(inValue); + ConstraintTimeline *_self = (ConstraintTimeline *) (PhysicsConstraintResetTimeline *) self; + _self->setConstraintIndex(inValue); } spine_rtti spine_physics_constraint_reset_timeline_rtti(void) { - return (spine_rtti)&PhysicsConstraintResetTimeline::rtti; + return (spine_rtti) &PhysicsConstraintResetTimeline::rtti; } diff --git a/spine-c/src/generated/physics_constraint_reset_timeline.h b/spine-c/src/generated/physics_constraint_reset_timeline.h index f796803e7..6c1a0732c 100644 --- a/spine-c/src/generated/physics_constraint_reset_timeline.h +++ b/spine-c/src/generated/physics_constraint_reset_timeline.h @@ -13,7 +13,9 @@ SPINE_C_API spine_physics_constraint_reset_timeline spine_physics_constraint_res SPINE_C_API void spine_physics_constraint_reset_timeline_dispose(spine_physics_constraint_reset_timeline self); SPINE_C_API spine_rtti spine_physics_constraint_reset_timeline_get_rtti(spine_physics_constraint_reset_timeline self); -SPINE_C_API void spine_physics_constraint_reset_timeline_apply(spine_physics_constraint_reset_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_physics_constraint_reset_timeline_apply(spine_physics_constraint_reset_timeline self, spine_skeleton skeleton, float lastTime, + float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, + spine_mix_direction direction, bool appliedPose); SPINE_C_API int spine_physics_constraint_reset_timeline_get_frame_count(spine_physics_constraint_reset_timeline self); SPINE_C_API int spine_physics_constraint_reset_timeline_get_constraint_index(spine_physics_constraint_reset_timeline self); SPINE_C_API void spine_physics_constraint_reset_timeline_set_frame(spine_physics_constraint_reset_timeline self, int frame, float time); diff --git a/spine-c/src/generated/physics_constraint_strength_timeline.cpp b/spine-c/src/generated/physics_constraint_strength_timeline.cpp index c87f4ea0a..6a7bcea00 100644 --- a/spine-c/src/generated/physics_constraint_strength_timeline.cpp +++ b/spine-c/src/generated/physics_constraint_strength_timeline.cpp @@ -3,94 +3,126 @@ using namespace spine; -spine_physics_constraint_strength_timeline spine_physics_constraint_strength_timeline_create(size_t frameCount, size_t bezierCount, int physicsConstraintIndex) { - return (spine_physics_constraint_strength_timeline) new (__FILE__, __LINE__) PhysicsConstraintStrengthTimeline(frameCount, bezierCount, physicsConstraintIndex); +spine_physics_constraint_strength_timeline spine_physics_constraint_strength_timeline_create(size_t frameCount, size_t bezierCount, + int physicsConstraintIndex) { + return (spine_physics_constraint_strength_timeline) new (__FILE__, __LINE__) + PhysicsConstraintStrengthTimeline(frameCount, bezierCount, physicsConstraintIndex); } void spine_physics_constraint_strength_timeline_dispose(spine_physics_constraint_strength_timeline self) { - delete (PhysicsConstraintStrengthTimeline*)self; + delete (PhysicsConstraintStrengthTimeline *) self; } spine_rtti spine_physics_constraint_strength_timeline_get_rtti(spine_physics_constraint_strength_timeline self) { - return (spine_rtti)&((PhysicsConstraintStrengthTimeline*)self)->getRTTI(); + PhysicsConstraintStrengthTimeline *_self = (PhysicsConstraintStrengthTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_physics_constraint_strength_timeline_apply(spine_physics_constraint_strength_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintStrengthTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_physics_constraint_strength_timeline_apply(spine_physics_constraint_strength_timeline self, spine_skeleton skeleton, float lastTime, + float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, + spine_mix_direction direction, bool appliedPose) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintStrengthTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_physics_constraint_strength_timeline_set_frame(spine_physics_constraint_strength_timeline self, size_t frame, float time, float value) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintStrengthTimeline*)self)->setFrame(frame, time, value); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintStrengthTimeline *) self; + _self->setFrame(frame, time, value); } float spine_physics_constraint_strength_timeline_get_curve_value(spine_physics_constraint_strength_timeline self, float time) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintStrengthTimeline*)self)->getCurveValue(time); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintStrengthTimeline *) self; + return _self->getCurveValue(time); } -float spine_physics_constraint_strength_timeline_get_relative_value(spine_physics_constraint_strength_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintStrengthTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_physics_constraint_strength_timeline_get_relative_value(spine_physics_constraint_strength_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintStrengthTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_physics_constraint_strength_timeline_get_absolute_value_1(spine_physics_constraint_strength_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintStrengthTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_physics_constraint_strength_timeline_get_absolute_value_1(spine_physics_constraint_strength_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintStrengthTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_physics_constraint_strength_timeline_get_absolute_value_2(spine_physics_constraint_strength_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintStrengthTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_physics_constraint_strength_timeline_get_absolute_value_2(spine_physics_constraint_strength_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup, float value) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintStrengthTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_physics_constraint_strength_timeline_get_scale_value(spine_physics_constraint_strength_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintStrengthTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_physics_constraint_strength_timeline_get_scale_value(spine_physics_constraint_strength_timeline self, float time, float alpha, + spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintStrengthTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_physics_constraint_strength_timeline_set_linear(spine_physics_constraint_strength_timeline self, size_t frame) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintStrengthTimeline*)self)->setLinear(frame); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintStrengthTimeline *) self; + _self->setLinear(frame); } void spine_physics_constraint_strength_timeline_set_stepped(spine_physics_constraint_strength_timeline self, size_t frame) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintStrengthTimeline*)self)->setStepped(frame); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintStrengthTimeline *) self; + _self->setStepped(frame); } -void spine_physics_constraint_strength_timeline_set_bezier(spine_physics_constraint_strength_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintStrengthTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_physics_constraint_strength_timeline_set_bezier(spine_physics_constraint_strength_timeline self, size_t bezier, size_t frame, float value, + float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, + float value2) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintStrengthTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } -float spine_physics_constraint_strength_timeline_get_bezier_value(spine_physics_constraint_strength_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintStrengthTimeline*)self)->getBezierValue(time, frame, valueOffset, i); +float spine_physics_constraint_strength_timeline_get_bezier_value(spine_physics_constraint_strength_timeline self, float time, size_t frame, + size_t valueOffset, size_t i) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintStrengthTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_physics_constraint_strength_timeline_get_curves(spine_physics_constraint_strength_timeline self) { - return (spine_array_float)&((PhysicsConstraintTimeline*)(PhysicsConstraintStrengthTimeline*)self)->getCurves(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintStrengthTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_physics_constraint_strength_timeline_get_frame_entries(spine_physics_constraint_strength_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintStrengthTimeline*)self)->getFrameEntries(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintStrengthTimeline *) self; + return _self->getFrameEntries(); } size_t spine_physics_constraint_strength_timeline_get_frame_count(spine_physics_constraint_strength_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintStrengthTimeline*)self)->getFrameCount(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintStrengthTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_physics_constraint_strength_timeline_get_frames(spine_physics_constraint_strength_timeline self) { - return (spine_array_float)&((PhysicsConstraintTimeline*)(PhysicsConstraintStrengthTimeline*)self)->getFrames(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintStrengthTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_physics_constraint_strength_timeline_get_duration(spine_physics_constraint_strength_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintStrengthTimeline*)self)->getDuration(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintStrengthTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_physics_constraint_strength_timeline_get_property_ids(spine_physics_constraint_strength_timeline self) { - return (spine_array_property_id)&((PhysicsConstraintTimeline*)(PhysicsConstraintStrengthTimeline*)self)->getPropertyIds(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintStrengthTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_physics_constraint_strength_timeline_get_constraint_index(spine_physics_constraint_strength_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintStrengthTimeline*)self)->getConstraintIndex(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintStrengthTimeline *) self; + return _self->getConstraintIndex(); } void spine_physics_constraint_strength_timeline_set_constraint_index(spine_physics_constraint_strength_timeline self, int inValue) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintStrengthTimeline*)self)->setConstraintIndex(inValue); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintStrengthTimeline *) self; + _self->setConstraintIndex(inValue); } spine_rtti spine_physics_constraint_strength_timeline_rtti(void) { - return (spine_rtti)&PhysicsConstraintStrengthTimeline::rtti; + return (spine_rtti) &PhysicsConstraintStrengthTimeline::rtti; } diff --git a/spine-c/src/generated/physics_constraint_strength_timeline.h b/spine-c/src/generated/physics_constraint_strength_timeline.h index 0c757f3a3..78e1e4fa6 100644 --- a/spine-c/src/generated/physics_constraint_strength_timeline.h +++ b/spine-c/src/generated/physics_constraint_strength_timeline.h @@ -8,22 +8,35 @@ extern "C" { #endif -SPINE_C_API spine_physics_constraint_strength_timeline spine_physics_constraint_strength_timeline_create(size_t frameCount, size_t bezierCount, int physicsConstraintIndex); +SPINE_C_API spine_physics_constraint_strength_timeline spine_physics_constraint_strength_timeline_create(size_t frameCount, size_t bezierCount, + int physicsConstraintIndex); SPINE_C_API void spine_physics_constraint_strength_timeline_dispose(spine_physics_constraint_strength_timeline self); SPINE_C_API spine_rtti spine_physics_constraint_strength_timeline_get_rtti(spine_physics_constraint_strength_timeline self); -SPINE_C_API void spine_physics_constraint_strength_timeline_apply(spine_physics_constraint_strength_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); -SPINE_C_API void spine_physics_constraint_strength_timeline_set_frame(spine_physics_constraint_strength_timeline self, size_t frame, float time, float value); +SPINE_C_API void spine_physics_constraint_strength_timeline_apply(spine_physics_constraint_strength_timeline self, spine_skeleton skeleton, + float lastTime, float time, spine_array_event pEvents, float alpha, + spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_physics_constraint_strength_timeline_set_frame(spine_physics_constraint_strength_timeline self, size_t frame, float time, + float value); SPINE_C_API float spine_physics_constraint_strength_timeline_get_curve_value(spine_physics_constraint_strength_timeline self, float time); -SPINE_C_API float spine_physics_constraint_strength_timeline_get_relative_value(spine_physics_constraint_strength_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_physics_constraint_strength_timeline_get_absolute_value_1(spine_physics_constraint_strength_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_physics_constraint_strength_timeline_get_absolute_value_2(spine_physics_constraint_strength_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_physics_constraint_strength_timeline_get_scale_value(spine_physics_constraint_strength_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_physics_constraint_strength_timeline_get_relative_value(spine_physics_constraint_strength_timeline self, float time, + float alpha, spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_physics_constraint_strength_timeline_get_absolute_value_1(spine_physics_constraint_strength_timeline self, float time, + float alpha, spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_physics_constraint_strength_timeline_get_absolute_value_2(spine_physics_constraint_strength_timeline self, float time, + float alpha, spine_mix_blend blend, float current, float setup, + float value); +SPINE_C_API float spine_physics_constraint_strength_timeline_get_scale_value(spine_physics_constraint_strength_timeline self, float time, float alpha, + spine_mix_blend blend, spine_mix_direction direction, float current, + float setup); SPINE_C_API void spine_physics_constraint_strength_timeline_set_linear(spine_physics_constraint_strength_timeline self, size_t frame); SPINE_C_API void spine_physics_constraint_strength_timeline_set_stepped(spine_physics_constraint_strength_timeline self, size_t frame); -SPINE_C_API void spine_physics_constraint_strength_timeline_set_bezier(spine_physics_constraint_strength_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); -SPINE_C_API float spine_physics_constraint_strength_timeline_get_bezier_value(spine_physics_constraint_strength_timeline self, float time, size_t frame, size_t valueOffset, size_t i); +SPINE_C_API void spine_physics_constraint_strength_timeline_set_bezier(spine_physics_constraint_strength_timeline self, size_t bezier, size_t frame, + float value, float time1, float value1, float cx1, float cy1, float cx2, + float cy2, float time2, float value2); +SPINE_C_API float spine_physics_constraint_strength_timeline_get_bezier_value(spine_physics_constraint_strength_timeline self, float time, + size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_physics_constraint_strength_timeline_get_curves(spine_physics_constraint_strength_timeline self); SPINE_C_API size_t spine_physics_constraint_strength_timeline_get_frame_entries(spine_physics_constraint_strength_timeline self); SPINE_C_API size_t spine_physics_constraint_strength_timeline_get_frame_count(spine_physics_constraint_strength_timeline self); diff --git a/spine-c/src/generated/physics_constraint_timeline.cpp b/spine-c/src/generated/physics_constraint_timeline.cpp index b5b7fcd4d..ff643b47b 100644 --- a/spine-c/src/generated/physics_constraint_timeline.cpp +++ b/spine-c/src/generated/physics_constraint_timeline.cpp @@ -4,89 +4,118 @@ using namespace spine; void spine_physics_constraint_timeline_dispose(spine_physics_constraint_timeline self) { - delete (PhysicsConstraintTimeline*)self; + delete (PhysicsConstraintTimeline *) self; } spine_rtti spine_physics_constraint_timeline_get_rtti(spine_physics_constraint_timeline self) { - return (spine_rtti)&((PhysicsConstraintTimeline*)self)->getRTTI(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_physics_constraint_timeline_apply(spine_physics_constraint_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((PhysicsConstraintTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_physics_constraint_timeline_apply(spine_physics_constraint_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_physics_constraint_timeline_set_frame(spine_physics_constraint_timeline self, size_t frame, float time, float value) { - ((CurveTimeline1*)(PhysicsConstraintTimeline*)self)->setFrame(frame, time, value); + CurveTimeline1 *_self = (CurveTimeline1 *) (PhysicsConstraintTimeline *) self; + _self->setFrame(frame, time, value); } float spine_physics_constraint_timeline_get_curve_value(spine_physics_constraint_timeline self, float time) { - return ((CurveTimeline1*)(PhysicsConstraintTimeline*)self)->getCurveValue(time); + CurveTimeline1 *_self = (CurveTimeline1 *) (PhysicsConstraintTimeline *) self; + return _self->getCurveValue(time); } -float spine_physics_constraint_timeline_get_relative_value(spine_physics_constraint_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((CurveTimeline1*)(PhysicsConstraintTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_physics_constraint_timeline_get_relative_value(spine_physics_constraint_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup) { + CurveTimeline1 *_self = (CurveTimeline1 *) (PhysicsConstraintTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_physics_constraint_timeline_get_absolute_value_1(spine_physics_constraint_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((CurveTimeline1*)(PhysicsConstraintTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_physics_constraint_timeline_get_absolute_value_1(spine_physics_constraint_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup) { + CurveTimeline1 *_self = (CurveTimeline1 *) (PhysicsConstraintTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_physics_constraint_timeline_get_absolute_value_2(spine_physics_constraint_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((CurveTimeline1*)(PhysicsConstraintTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_physics_constraint_timeline_get_absolute_value_2(spine_physics_constraint_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup, float value) { + CurveTimeline1 *_self = (CurveTimeline1 *) (PhysicsConstraintTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_physics_constraint_timeline_get_scale_value(spine_physics_constraint_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((CurveTimeline1*)(PhysicsConstraintTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_physics_constraint_timeline_get_scale_value(spine_physics_constraint_timeline self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup) { + CurveTimeline1 *_self = (CurveTimeline1 *) (PhysicsConstraintTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_physics_constraint_timeline_set_linear(spine_physics_constraint_timeline self, size_t frame) { - ((CurveTimeline1*)(PhysicsConstraintTimeline*)self)->setLinear(frame); + CurveTimeline1 *_self = (CurveTimeline1 *) (PhysicsConstraintTimeline *) self; + _self->setLinear(frame); } void spine_physics_constraint_timeline_set_stepped(spine_physics_constraint_timeline self, size_t frame) { - ((CurveTimeline1*)(PhysicsConstraintTimeline*)self)->setStepped(frame); + CurveTimeline1 *_self = (CurveTimeline1 *) (PhysicsConstraintTimeline *) self; + _self->setStepped(frame); } -void spine_physics_constraint_timeline_set_bezier(spine_physics_constraint_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((CurveTimeline1*)(PhysicsConstraintTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_physics_constraint_timeline_set_bezier(spine_physics_constraint_timeline self, size_t bezier, size_t frame, float value, float time1, + float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { + CurveTimeline1 *_self = (CurveTimeline1 *) (PhysicsConstraintTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } -float spine_physics_constraint_timeline_get_bezier_value(spine_physics_constraint_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((CurveTimeline1*)(PhysicsConstraintTimeline*)self)->getBezierValue(time, frame, valueOffset, i); +float spine_physics_constraint_timeline_get_bezier_value(spine_physics_constraint_timeline self, float time, size_t frame, size_t valueOffset, + size_t i) { + CurveTimeline1 *_self = (CurveTimeline1 *) (PhysicsConstraintTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_physics_constraint_timeline_get_curves(spine_physics_constraint_timeline self) { - return (spine_array_float)&((CurveTimeline1*)(PhysicsConstraintTimeline*)self)->getCurves(); + CurveTimeline1 *_self = (CurveTimeline1 *) (PhysicsConstraintTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_physics_constraint_timeline_get_frame_entries(spine_physics_constraint_timeline self) { - return ((CurveTimeline1*)(PhysicsConstraintTimeline*)self)->getFrameEntries(); + CurveTimeline1 *_self = (CurveTimeline1 *) (PhysicsConstraintTimeline *) self; + return _self->getFrameEntries(); } size_t spine_physics_constraint_timeline_get_frame_count(spine_physics_constraint_timeline self) { - return ((CurveTimeline1*)(PhysicsConstraintTimeline*)self)->getFrameCount(); + CurveTimeline1 *_self = (CurveTimeline1 *) (PhysicsConstraintTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_physics_constraint_timeline_get_frames(spine_physics_constraint_timeline self) { - return (spine_array_float)&((CurveTimeline1*)(PhysicsConstraintTimeline*)self)->getFrames(); + CurveTimeline1 *_self = (CurveTimeline1 *) (PhysicsConstraintTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_physics_constraint_timeline_get_duration(spine_physics_constraint_timeline self) { - return ((CurveTimeline1*)(PhysicsConstraintTimeline*)self)->getDuration(); + CurveTimeline1 *_self = (CurveTimeline1 *) (PhysicsConstraintTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_physics_constraint_timeline_get_property_ids(spine_physics_constraint_timeline self) { - return (spine_array_property_id)&((CurveTimeline1*)(PhysicsConstraintTimeline*)self)->getPropertyIds(); + CurveTimeline1 *_self = (CurveTimeline1 *) (PhysicsConstraintTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_physics_constraint_timeline_get_constraint_index(spine_physics_constraint_timeline self) { - return ((ConstraintTimeline*)(PhysicsConstraintTimeline*)self)->getConstraintIndex(); + ConstraintTimeline *_self = (ConstraintTimeline *) (PhysicsConstraintTimeline *) self; + return _self->getConstraintIndex(); } void spine_physics_constraint_timeline_set_constraint_index(spine_physics_constraint_timeline self, int inValue) { - ((ConstraintTimeline*)(PhysicsConstraintTimeline*)self)->setConstraintIndex(inValue); + ConstraintTimeline *_self = (ConstraintTimeline *) (PhysicsConstraintTimeline *) self; + _self->setConstraintIndex(inValue); } spine_rtti spine_physics_constraint_timeline_rtti(void) { - return (spine_rtti)&PhysicsConstraintTimeline::rtti; + return (spine_rtti) &PhysicsConstraintTimeline::rtti; } diff --git a/spine-c/src/generated/physics_constraint_timeline.h b/spine-c/src/generated/physics_constraint_timeline.h index 31d68351a..c4ba14aa1 100644 --- a/spine-c/src/generated/physics_constraint_timeline.h +++ b/spine-c/src/generated/physics_constraint_timeline.h @@ -11,17 +11,26 @@ extern "C" { SPINE_C_API void spine_physics_constraint_timeline_dispose(spine_physics_constraint_timeline self); SPINE_C_API spine_rtti spine_physics_constraint_timeline_get_rtti(spine_physics_constraint_timeline self); -SPINE_C_API void spine_physics_constraint_timeline_apply(spine_physics_constraint_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_physics_constraint_timeline_apply(spine_physics_constraint_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); SPINE_C_API void spine_physics_constraint_timeline_set_frame(spine_physics_constraint_timeline self, size_t frame, float time, float value); SPINE_C_API float spine_physics_constraint_timeline_get_curve_value(spine_physics_constraint_timeline self, float time); -SPINE_C_API float spine_physics_constraint_timeline_get_relative_value(spine_physics_constraint_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_physics_constraint_timeline_get_absolute_value_1(spine_physics_constraint_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_physics_constraint_timeline_get_absolute_value_2(spine_physics_constraint_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_physics_constraint_timeline_get_scale_value(spine_physics_constraint_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_physics_constraint_timeline_get_relative_value(spine_physics_constraint_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_physics_constraint_timeline_get_absolute_value_1(spine_physics_constraint_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_physics_constraint_timeline_get_absolute_value_2(spine_physics_constraint_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup, float value); +SPINE_C_API float spine_physics_constraint_timeline_get_scale_value(spine_physics_constraint_timeline self, float time, float alpha, + spine_mix_blend blend, spine_mix_direction direction, float current, float setup); SPINE_C_API void spine_physics_constraint_timeline_set_linear(spine_physics_constraint_timeline self, size_t frame); SPINE_C_API void spine_physics_constraint_timeline_set_stepped(spine_physics_constraint_timeline self, size_t frame); -SPINE_C_API void spine_physics_constraint_timeline_set_bezier(spine_physics_constraint_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); -SPINE_C_API float spine_physics_constraint_timeline_get_bezier_value(spine_physics_constraint_timeline self, float time, size_t frame, size_t valueOffset, size_t i); +SPINE_C_API void spine_physics_constraint_timeline_set_bezier(spine_physics_constraint_timeline self, size_t bezier, size_t frame, float value, + float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, + float value2); +SPINE_C_API float spine_physics_constraint_timeline_get_bezier_value(spine_physics_constraint_timeline self, float time, size_t frame, + size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_physics_constraint_timeline_get_curves(spine_physics_constraint_timeline self); SPINE_C_API size_t spine_physics_constraint_timeline_get_frame_entries(spine_physics_constraint_timeline self); SPINE_C_API size_t spine_physics_constraint_timeline_get_frame_count(spine_physics_constraint_timeline self); diff --git a/spine-c/src/generated/physics_constraint_wind_timeline.cpp b/spine-c/src/generated/physics_constraint_wind_timeline.cpp index f8524a631..30010d6b3 100644 --- a/spine-c/src/generated/physics_constraint_wind_timeline.cpp +++ b/spine-c/src/generated/physics_constraint_wind_timeline.cpp @@ -3,94 +3,126 @@ using namespace spine; -spine_physics_constraint_wind_timeline spine_physics_constraint_wind_timeline_create(size_t frameCount, size_t bezierCount, int physicsConstraintIndex) { - return (spine_physics_constraint_wind_timeline) new (__FILE__, __LINE__) PhysicsConstraintWindTimeline(frameCount, bezierCount, physicsConstraintIndex); +spine_physics_constraint_wind_timeline spine_physics_constraint_wind_timeline_create(size_t frameCount, size_t bezierCount, + int physicsConstraintIndex) { + return (spine_physics_constraint_wind_timeline) new (__FILE__, __LINE__) + PhysicsConstraintWindTimeline(frameCount, bezierCount, physicsConstraintIndex); } void spine_physics_constraint_wind_timeline_dispose(spine_physics_constraint_wind_timeline self) { - delete (PhysicsConstraintWindTimeline*)self; + delete (PhysicsConstraintWindTimeline *) self; } spine_rtti spine_physics_constraint_wind_timeline_get_rtti(spine_physics_constraint_wind_timeline self) { - return (spine_rtti)&((PhysicsConstraintWindTimeline*)self)->getRTTI(); + PhysicsConstraintWindTimeline *_self = (PhysicsConstraintWindTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_physics_constraint_wind_timeline_apply(spine_physics_constraint_wind_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintWindTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_physics_constraint_wind_timeline_apply(spine_physics_constraint_wind_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintWindTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_physics_constraint_wind_timeline_set_frame(spine_physics_constraint_wind_timeline self, size_t frame, float time, float value) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintWindTimeline*)self)->setFrame(frame, time, value); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintWindTimeline *) self; + _self->setFrame(frame, time, value); } float spine_physics_constraint_wind_timeline_get_curve_value(spine_physics_constraint_wind_timeline self, float time) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintWindTimeline*)self)->getCurveValue(time); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintWindTimeline *) self; + return _self->getCurveValue(time); } -float spine_physics_constraint_wind_timeline_get_relative_value(spine_physics_constraint_wind_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintWindTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_physics_constraint_wind_timeline_get_relative_value(spine_physics_constraint_wind_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintWindTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_physics_constraint_wind_timeline_get_absolute_value_1(spine_physics_constraint_wind_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintWindTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_physics_constraint_wind_timeline_get_absolute_value_1(spine_physics_constraint_wind_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintWindTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_physics_constraint_wind_timeline_get_absolute_value_2(spine_physics_constraint_wind_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintWindTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_physics_constraint_wind_timeline_get_absolute_value_2(spine_physics_constraint_wind_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup, float value) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintWindTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_physics_constraint_wind_timeline_get_scale_value(spine_physics_constraint_wind_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintWindTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_physics_constraint_wind_timeline_get_scale_value(spine_physics_constraint_wind_timeline self, float time, float alpha, + spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintWindTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_physics_constraint_wind_timeline_set_linear(spine_physics_constraint_wind_timeline self, size_t frame) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintWindTimeline*)self)->setLinear(frame); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintWindTimeline *) self; + _self->setLinear(frame); } void spine_physics_constraint_wind_timeline_set_stepped(spine_physics_constraint_wind_timeline self, size_t frame) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintWindTimeline*)self)->setStepped(frame); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintWindTimeline *) self; + _self->setStepped(frame); } -void spine_physics_constraint_wind_timeline_set_bezier(spine_physics_constraint_wind_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintWindTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_physics_constraint_wind_timeline_set_bezier(spine_physics_constraint_wind_timeline self, size_t bezier, size_t frame, float value, + float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, + float value2) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintWindTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } -float spine_physics_constraint_wind_timeline_get_bezier_value(spine_physics_constraint_wind_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintWindTimeline*)self)->getBezierValue(time, frame, valueOffset, i); +float spine_physics_constraint_wind_timeline_get_bezier_value(spine_physics_constraint_wind_timeline self, float time, size_t frame, + size_t valueOffset, size_t i) { + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintWindTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_physics_constraint_wind_timeline_get_curves(spine_physics_constraint_wind_timeline self) { - return (spine_array_float)&((PhysicsConstraintTimeline*)(PhysicsConstraintWindTimeline*)self)->getCurves(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintWindTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_physics_constraint_wind_timeline_get_frame_entries(spine_physics_constraint_wind_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintWindTimeline*)self)->getFrameEntries(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintWindTimeline *) self; + return _self->getFrameEntries(); } size_t spine_physics_constraint_wind_timeline_get_frame_count(spine_physics_constraint_wind_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintWindTimeline*)self)->getFrameCount(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintWindTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_physics_constraint_wind_timeline_get_frames(spine_physics_constraint_wind_timeline self) { - return (spine_array_float)&((PhysicsConstraintTimeline*)(PhysicsConstraintWindTimeline*)self)->getFrames(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintWindTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_physics_constraint_wind_timeline_get_duration(spine_physics_constraint_wind_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintWindTimeline*)self)->getDuration(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintWindTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_physics_constraint_wind_timeline_get_property_ids(spine_physics_constraint_wind_timeline self) { - return (spine_array_property_id)&((PhysicsConstraintTimeline*)(PhysicsConstraintWindTimeline*)self)->getPropertyIds(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintWindTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_physics_constraint_wind_timeline_get_constraint_index(spine_physics_constraint_wind_timeline self) { - return ((PhysicsConstraintTimeline*)(PhysicsConstraintWindTimeline*)self)->getConstraintIndex(); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintWindTimeline *) self; + return _self->getConstraintIndex(); } void spine_physics_constraint_wind_timeline_set_constraint_index(spine_physics_constraint_wind_timeline self, int inValue) { - ((PhysicsConstraintTimeline*)(PhysicsConstraintWindTimeline*)self)->setConstraintIndex(inValue); + PhysicsConstraintTimeline *_self = (PhysicsConstraintTimeline *) (PhysicsConstraintWindTimeline *) self; + _self->setConstraintIndex(inValue); } spine_rtti spine_physics_constraint_wind_timeline_rtti(void) { - return (spine_rtti)&PhysicsConstraintWindTimeline::rtti; + return (spine_rtti) &PhysicsConstraintWindTimeline::rtti; } diff --git a/spine-c/src/generated/physics_constraint_wind_timeline.h b/spine-c/src/generated/physics_constraint_wind_timeline.h index 5875ed285..b6eb05b48 100644 --- a/spine-c/src/generated/physics_constraint_wind_timeline.h +++ b/spine-c/src/generated/physics_constraint_wind_timeline.h @@ -8,22 +8,33 @@ extern "C" { #endif -SPINE_C_API spine_physics_constraint_wind_timeline spine_physics_constraint_wind_timeline_create(size_t frameCount, size_t bezierCount, int physicsConstraintIndex); +SPINE_C_API spine_physics_constraint_wind_timeline spine_physics_constraint_wind_timeline_create(size_t frameCount, size_t bezierCount, + int physicsConstraintIndex); SPINE_C_API void spine_physics_constraint_wind_timeline_dispose(spine_physics_constraint_wind_timeline self); SPINE_C_API spine_rtti spine_physics_constraint_wind_timeline_get_rtti(spine_physics_constraint_wind_timeline self); -SPINE_C_API void spine_physics_constraint_wind_timeline_apply(spine_physics_constraint_wind_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_physics_constraint_wind_timeline_apply(spine_physics_constraint_wind_timeline self, spine_skeleton skeleton, float lastTime, + float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, + spine_mix_direction direction, bool appliedPose); SPINE_C_API void spine_physics_constraint_wind_timeline_set_frame(spine_physics_constraint_wind_timeline self, size_t frame, float time, float value); SPINE_C_API float spine_physics_constraint_wind_timeline_get_curve_value(spine_physics_constraint_wind_timeline self, float time); -SPINE_C_API float spine_physics_constraint_wind_timeline_get_relative_value(spine_physics_constraint_wind_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_physics_constraint_wind_timeline_get_absolute_value_1(spine_physics_constraint_wind_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_physics_constraint_wind_timeline_get_absolute_value_2(spine_physics_constraint_wind_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_physics_constraint_wind_timeline_get_scale_value(spine_physics_constraint_wind_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_physics_constraint_wind_timeline_get_relative_value(spine_physics_constraint_wind_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_physics_constraint_wind_timeline_get_absolute_value_1(spine_physics_constraint_wind_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup); +SPINE_C_API float spine_physics_constraint_wind_timeline_get_absolute_value_2(spine_physics_constraint_wind_timeline self, float time, float alpha, + spine_mix_blend blend, float current, float setup, float value); +SPINE_C_API float spine_physics_constraint_wind_timeline_get_scale_value(spine_physics_constraint_wind_timeline self, float time, float alpha, + spine_mix_blend blend, spine_mix_direction direction, float current, + float setup); SPINE_C_API void spine_physics_constraint_wind_timeline_set_linear(spine_physics_constraint_wind_timeline self, size_t frame); SPINE_C_API void spine_physics_constraint_wind_timeline_set_stepped(spine_physics_constraint_wind_timeline self, size_t frame); -SPINE_C_API void spine_physics_constraint_wind_timeline_set_bezier(spine_physics_constraint_wind_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); -SPINE_C_API float spine_physics_constraint_wind_timeline_get_bezier_value(spine_physics_constraint_wind_timeline self, float time, size_t frame, size_t valueOffset, size_t i); +SPINE_C_API void spine_physics_constraint_wind_timeline_set_bezier(spine_physics_constraint_wind_timeline self, size_t bezier, size_t frame, + float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, + float time2, float value2); +SPINE_C_API float spine_physics_constraint_wind_timeline_get_bezier_value(spine_physics_constraint_wind_timeline self, float time, size_t frame, + size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_physics_constraint_wind_timeline_get_curves(spine_physics_constraint_wind_timeline self); SPINE_C_API size_t spine_physics_constraint_wind_timeline_get_frame_entries(spine_physics_constraint_wind_timeline self); SPINE_C_API size_t spine_physics_constraint_wind_timeline_get_frame_count(spine_physics_constraint_wind_timeline self); diff --git a/spine-c/src/generated/point_attachment.cpp b/spine-c/src/generated/point_attachment.cpp index 11eda0f94..2aa902500 100644 --- a/spine-c/src/generated/point_attachment.cpp +++ b/spine-c/src/generated/point_attachment.cpp @@ -3,74 +3,89 @@ using namespace spine; -spine_point_attachment spine_point_attachment_create(const char * name) { - return (spine_point_attachment) new (__FILE__, __LINE__) PointAttachment(String(name)); +spine_point_attachment spine_point_attachment_create(const char *name) { + return (spine_point_attachment) new (__FILE__, __LINE__) PointAttachment(String(name)); } void spine_point_attachment_dispose(spine_point_attachment self) { - delete (PointAttachment*)self; + delete (PointAttachment *) self; } spine_rtti spine_point_attachment_get_rtti(spine_point_attachment self) { - return (spine_rtti)&((PointAttachment*)self)->getRTTI(); + PointAttachment *_self = (PointAttachment *) self; + return (spine_rtti) &_self->getRTTI(); } float spine_point_attachment_get_x(spine_point_attachment self) { - return ((PointAttachment*)self)->getX(); + PointAttachment *_self = (PointAttachment *) self; + return _self->getX(); } void spine_point_attachment_set_x(spine_point_attachment self, float inValue) { - ((PointAttachment*)self)->setX(inValue); + PointAttachment *_self = (PointAttachment *) self; + _self->setX(inValue); } float spine_point_attachment_get_y(spine_point_attachment self) { - return ((PointAttachment*)self)->getY(); + PointAttachment *_self = (PointAttachment *) self; + return _self->getY(); } void spine_point_attachment_set_y(spine_point_attachment self, float inValue) { - ((PointAttachment*)self)->setY(inValue); + PointAttachment *_self = (PointAttachment *) self; + _self->setY(inValue); } float spine_point_attachment_get_rotation(spine_point_attachment self) { - return ((PointAttachment*)self)->getRotation(); + PointAttachment *_self = (PointAttachment *) self; + return _self->getRotation(); } void spine_point_attachment_set_rotation(spine_point_attachment self, float inValue) { - ((PointAttachment*)self)->setRotation(inValue); + PointAttachment *_self = (PointAttachment *) self; + _self->setRotation(inValue); } spine_color spine_point_attachment_get_color(spine_point_attachment self) { - return (spine_color)&((PointAttachment*)self)->getColor(); + PointAttachment *_self = (PointAttachment *) self; + return (spine_color) &_self->getColor(); } -void spine_point_attachment_compute_world_position(spine_point_attachment self, spine_bone_pose bone, float * ox, float * oy) { - ((PointAttachment*)self)->computeWorldPosition(*((BonePose*)bone), *ox, *oy); +void spine_point_attachment_compute_world_position(spine_point_attachment self, spine_bone_pose bone, float *ox, float *oy) { + PointAttachment *_self = (PointAttachment *) self; + _self->computeWorldPosition(*((BonePose *) bone), *ox, *oy); } float spine_point_attachment_compute_world_rotation(spine_point_attachment self, spine_bone_pose bone) { - return ((PointAttachment*)self)->computeWorldRotation(*((BonePose*)bone)); + PointAttachment *_self = (PointAttachment *) self; + return _self->computeWorldRotation(*((BonePose *) bone)); } spine_attachment spine_point_attachment_copy(spine_point_attachment self) { - return (spine_attachment)((PointAttachment*)self)->copy(); + PointAttachment *_self = (PointAttachment *) self; + return (spine_attachment) _self->copy(); } -const char * spine_point_attachment_get_name(spine_point_attachment self) { - return ((Attachment*)(PointAttachment*)self)->getName().buffer(); +const char *spine_point_attachment_get_name(spine_point_attachment self) { + Attachment *_self = (Attachment *) (PointAttachment *) self; + return _self->getName().buffer(); } int spine_point_attachment_get_ref_count(spine_point_attachment self) { - return ((Attachment*)(PointAttachment*)self)->getRefCount(); + Attachment *_self = (Attachment *) (PointAttachment *) self; + return _self->getRefCount(); } void spine_point_attachment_reference(spine_point_attachment self) { - ((Attachment*)(PointAttachment*)self)->reference(); + Attachment *_self = (Attachment *) (PointAttachment *) self; + _self->reference(); } void spine_point_attachment_dereference(spine_point_attachment self) { - ((Attachment*)(PointAttachment*)self)->dereference(); + Attachment *_self = (Attachment *) (PointAttachment *) self; + _self->dereference(); } spine_rtti spine_point_attachment_rtti(void) { - return (spine_rtti)&PointAttachment::rtti; + return (spine_rtti) &PointAttachment::rtti; } diff --git a/spine-c/src/generated/point_attachment.h b/spine-c/src/generated/point_attachment.h index 005d67806..cc7e8e15a 100644 --- a/spine-c/src/generated/point_attachment.h +++ b/spine-c/src/generated/point_attachment.h @@ -8,7 +8,7 @@ extern "C" { #endif -SPINE_C_API spine_point_attachment spine_point_attachment_create(const char * name); +SPINE_C_API spine_point_attachment spine_point_attachment_create(const char *name); SPINE_C_API void spine_point_attachment_dispose(spine_point_attachment self); @@ -20,10 +20,10 @@ SPINE_C_API void spine_point_attachment_set_y(spine_point_attachment self, float SPINE_C_API float spine_point_attachment_get_rotation(spine_point_attachment self); SPINE_C_API void spine_point_attachment_set_rotation(spine_point_attachment self, float inValue); SPINE_C_API spine_color spine_point_attachment_get_color(spine_point_attachment self); -SPINE_C_API void spine_point_attachment_compute_world_position(spine_point_attachment self, spine_bone_pose bone, float * ox, float * oy); +SPINE_C_API void spine_point_attachment_compute_world_position(spine_point_attachment self, spine_bone_pose bone, float *ox, float *oy); SPINE_C_API float spine_point_attachment_compute_world_rotation(spine_point_attachment self, spine_bone_pose bone); SPINE_C_API spine_attachment spine_point_attachment_copy(spine_point_attachment self); -SPINE_C_API const char * spine_point_attachment_get_name(spine_point_attachment self); +SPINE_C_API const char *spine_point_attachment_get_name(spine_point_attachment self); SPINE_C_API int spine_point_attachment_get_ref_count(spine_point_attachment self); SPINE_C_API void spine_point_attachment_reference(spine_point_attachment self); SPINE_C_API void spine_point_attachment_dereference(spine_point_attachment self); diff --git a/spine-c/src/generated/polygon.cpp b/spine-c/src/generated/polygon.cpp index 35831b33f..2c0f3b7c9 100644 --- a/spine-c/src/generated/polygon.cpp +++ b/spine-c/src/generated/polygon.cpp @@ -4,25 +4,29 @@ using namespace spine; spine_polygon spine_polygon_create(void) { - return (spine_polygon) new (__FILE__, __LINE__) Polygon(); + return (spine_polygon) new (__FILE__, __LINE__) Polygon(); } void spine_polygon_dispose(spine_polygon self) { - delete (Polygon*)self; + delete (Polygon *) self; } spine_array_float spine_polygon_get__vertices(spine_polygon self) { - return (spine_array_float)&((Polygon*)self)->_vertices; + Polygon *_self = (Polygon *) self; + return (spine_array_float) &_self->_vertices; } void spine_polygon_set__vertices(spine_polygon self, spine_array_float value) { - ((Polygon*)self)->_vertices = *((Array*)value); + Polygon *_self = (Polygon *) self; + _self->_vertices = *((Array *) value); } int spine_polygon_get__count(spine_polygon self) { - return ((Polygon*)self)->_count; + Polygon *_self = (Polygon *) self; + return _self->_count; } void spine_polygon_set__count(spine_polygon self, int value) { - ((Polygon*)self)->_count = value; + Polygon *_self = (Polygon *) self; + _self->_count = value; } diff --git a/spine-c/src/generated/posed.cpp b/spine-c/src/generated/posed.cpp index c844dcae5..e99b0fd68 100644 --- a/spine-c/src/generated/posed.cpp +++ b/spine-c/src/generated/posed.cpp @@ -4,17 +4,20 @@ using namespace spine; void spine_posed_dispose(spine_posed self) { - delete (Posed*)self; + delete (Posed *) self; } void spine_posed_constrained(spine_posed self) { - ((Posed*)self)->constrained(); + Posed *_self = (Posed *) self; + _self->constrained(); } void spine_posed_reset_constrained(spine_posed self) { - ((Posed*)self)->resetConstrained(); + Posed *_self = (Posed *) self; + _self->resetConstrained(); } bool spine_posed_is_pose_equal_to_applied(spine_posed self) { - return ((Posed*)self)->isPoseEqualToApplied(); + Posed *_self = (Posed *) self; + return _self->isPoseEqualToApplied(); } diff --git a/spine-c/src/generated/posed_active.cpp b/spine-c/src/generated/posed_active.cpp index 82b59f838..4eefe5369 100644 --- a/spine-c/src/generated/posed_active.cpp +++ b/spine-c/src/generated/posed_active.cpp @@ -4,13 +4,15 @@ using namespace spine; void spine_posed_active_dispose(spine_posed_active self) { - delete (PosedActive*)self; + delete (PosedActive *) self; } bool spine_posed_active_is_active(spine_posed_active self) { - return ((PosedActive*)self)->isActive(); + PosedActive *_self = (PosedActive *) self; + return _self->isActive(); } void spine_posed_active_set_active(spine_posed_active self, bool active) { - ((PosedActive*)self)->setActive(active); + PosedActive *_self = (PosedActive *) self; + _self->setActive(active); } diff --git a/spine-c/src/generated/posed_data.cpp b/spine-c/src/generated/posed_data.cpp index 7eb9d90a1..cd5cc3a2d 100644 --- a/spine-c/src/generated/posed_data.cpp +++ b/spine-c/src/generated/posed_data.cpp @@ -3,22 +3,25 @@ using namespace spine; -spine_posed_data spine_posed_data_create(const char * name) { - return (spine_posed_data) new (__FILE__, __LINE__) PosedData(String(name)); +spine_posed_data spine_posed_data_create(const char *name) { + return (spine_posed_data) new (__FILE__, __LINE__) PosedData(String(name)); } void spine_posed_data_dispose(spine_posed_data self) { - delete (PosedData*)self; + delete (PosedData *) self; } -const char * spine_posed_data_get_name(spine_posed_data self) { - return ((PosedData*)self)->getName().buffer(); +const char *spine_posed_data_get_name(spine_posed_data self) { + PosedData *_self = (PosedData *) self; + return _self->getName().buffer(); } bool spine_posed_data_get_skin_required(spine_posed_data self) { - return ((PosedData*)self)->getSkinRequired(); + PosedData *_self = (PosedData *) self; + return _self->getSkinRequired(); } void spine_posed_data_set_skin_required(spine_posed_data self, bool skinRequired) { - ((PosedData*)self)->setSkinRequired(skinRequired); + PosedData *_self = (PosedData *) self; + _self->setSkinRequired(skinRequired); } diff --git a/spine-c/src/generated/posed_data.h b/spine-c/src/generated/posed_data.h index 581565f49..43dd23afb 100644 --- a/spine-c/src/generated/posed_data.h +++ b/spine-c/src/generated/posed_data.h @@ -8,11 +8,11 @@ extern "C" { #endif -SPINE_C_API spine_posed_data spine_posed_data_create(const char * name); +SPINE_C_API spine_posed_data spine_posed_data_create(const char *name); SPINE_C_API void spine_posed_data_dispose(spine_posed_data self); -SPINE_C_API const char * spine_posed_data_get_name(spine_posed_data self); +SPINE_C_API const char *spine_posed_data_get_name(spine_posed_data self); SPINE_C_API bool spine_posed_data_get_skin_required(spine_posed_data self); SPINE_C_API void spine_posed_data_set_skin_required(spine_posed_data self, bool skinRequired); diff --git a/spine-c/src/generated/position_mode.h b/spine-c/src/generated/position_mode.h index 6addb3a1c..9017bfd55 100644 --- a/spine-c/src/generated/position_mode.h +++ b/spine-c/src/generated/position_mode.h @@ -6,8 +6,8 @@ extern "C" { #endif typedef enum spine_position_mode { - SPINE_POSITION_MODE_FIXED = 0, - SPINE_POSITION_MODE_PERCENT + SPINE_POSITION_MODE_FIXED = 0, + SPINE_POSITION_MODE_PERCENT } spine_position_mode; #ifdef __cplusplus diff --git a/spine-c/src/generated/property.h b/spine-c/src/generated/property.h index f18af4455..f2c9c69ac 100644 --- a/spine-c/src/generated/property.h +++ b/spine-c/src/generated/property.h @@ -6,37 +6,37 @@ extern "C" { #endif typedef enum spine_property { - SPINE_PROPERTY_ROTATE = 1 << 0, - SPINE_PROPERTY_X = 1 << 1, - SPINE_PROPERTY_Y = 1 << 2, - SPINE_PROPERTY_SCALE_X = 1 << 3, - SPINE_PROPERTY_SCALE_Y = 1 << 4, - SPINE_PROPERTY_SHEAR_X = 1 << 5, - SPINE_PROPERTY_SHEAR_Y = 1 << 6, - SPINE_PROPERTY_INHERIT = 1 << 7, - SPINE_PROPERTY_RGB = 1 << 8, - SPINE_PROPERTY_ALPHA = 1 << 9, - SPINE_PROPERTY_RGB2 = 1 << 10, - SPINE_PROPERTY_ATTACHMENT = 1 << 11, - SPINE_PROPERTY_DEFORM = 1 << 12, - SPINE_PROPERTY_EVENT = 1 << 13, - SPINE_PROPERTY_DRAW_ORDER = 1 << 14, - SPINE_PROPERTY_IK_CONSTRAINT = 1 << 15, - SPINE_PROPERTY_TRANSFORM_CONSTRAINT = 1 << 16, - SPINE_PROPERTY_PATH_CONSTRAINT_POSITION = 1 << 17, - SPINE_PROPERTY_PATH_CONSTRAINT_SPACING = 1 << 18, - SPINE_PROPERTY_PATH_CONSTRAINT_MIX = 1 << 19, - SPINE_PROPERTY_PHYSICS_CONSTRAINT_INERTIA = 1 << 20, - SPINE_PROPERTY_PHYSICS_CONSTRAINT_STRENGTH = 1 << 21, - SPINE_PROPERTY_PHYSICS_CONSTRAINT_DAMPING = 1 << 22, - SPINE_PROPERTY_PHYSICS_CONSTRAINT_MASS = 1 << 23, - SPINE_PROPERTY_PHYSICS_CONSTRAINT_WIND = 1 << 24, - SPINE_PROPERTY_PHYSICS_CONSTRAINT_GRAVITY = 1 << 25, - SPINE_PROPERTY_PHYSICS_CONSTRAINT_MIX = 1 << 26, - SPINE_PROPERTY_PHYSICS_CONSTRAINT_RESET = 1 << 27, - SPINE_PROPERTY_SEQUENCE = 1 << 28, - SPINE_PROPERTY_SLIDER_TIME = 1 << 29, - SPINE_PROPERTY_SLIDER_MIX = 1 << 30 + SPINE_PROPERTY_ROTATE = 1 << 0, + SPINE_PROPERTY_X = 1 << 1, + SPINE_PROPERTY_Y = 1 << 2, + SPINE_PROPERTY_SCALE_X = 1 << 3, + SPINE_PROPERTY_SCALE_Y = 1 << 4, + SPINE_PROPERTY_SHEAR_X = 1 << 5, + SPINE_PROPERTY_SHEAR_Y = 1 << 6, + SPINE_PROPERTY_INHERIT = 1 << 7, + SPINE_PROPERTY_RGB = 1 << 8, + SPINE_PROPERTY_ALPHA = 1 << 9, + SPINE_PROPERTY_RGB2 = 1 << 10, + SPINE_PROPERTY_ATTACHMENT = 1 << 11, + SPINE_PROPERTY_DEFORM = 1 << 12, + SPINE_PROPERTY_EVENT = 1 << 13, + SPINE_PROPERTY_DRAW_ORDER = 1 << 14, + SPINE_PROPERTY_IK_CONSTRAINT = 1 << 15, + SPINE_PROPERTY_TRANSFORM_CONSTRAINT = 1 << 16, + SPINE_PROPERTY_PATH_CONSTRAINT_POSITION = 1 << 17, + SPINE_PROPERTY_PATH_CONSTRAINT_SPACING = 1 << 18, + SPINE_PROPERTY_PATH_CONSTRAINT_MIX = 1 << 19, + SPINE_PROPERTY_PHYSICS_CONSTRAINT_INERTIA = 1 << 20, + SPINE_PROPERTY_PHYSICS_CONSTRAINT_STRENGTH = 1 << 21, + SPINE_PROPERTY_PHYSICS_CONSTRAINT_DAMPING = 1 << 22, + SPINE_PROPERTY_PHYSICS_CONSTRAINT_MASS = 1 << 23, + SPINE_PROPERTY_PHYSICS_CONSTRAINT_WIND = 1 << 24, + SPINE_PROPERTY_PHYSICS_CONSTRAINT_GRAVITY = 1 << 25, + SPINE_PROPERTY_PHYSICS_CONSTRAINT_MIX = 1 << 26, + SPINE_PROPERTY_PHYSICS_CONSTRAINT_RESET = 1 << 27, + SPINE_PROPERTY_SEQUENCE = 1 << 28, + SPINE_PROPERTY_SLIDER_TIME = 1 << 29, + SPINE_PROPERTY_SLIDER_MIX = 1 << 30 } spine_property; #ifdef __cplusplus diff --git a/spine-c/src/generated/region_attachment.cpp b/spine-c/src/generated/region_attachment.cpp index d10a29033..d24923adf 100644 --- a/spine-c/src/generated/region_attachment.cpp +++ b/spine-c/src/generated/region_attachment.cpp @@ -3,142 +3,176 @@ using namespace spine; -spine_region_attachment spine_region_attachment_create(const char * name) { - return (spine_region_attachment) new (__FILE__, __LINE__) RegionAttachment(String(name)); +spine_region_attachment spine_region_attachment_create(const char *name) { + return (spine_region_attachment) new (__FILE__, __LINE__) RegionAttachment(String(name)); } void spine_region_attachment_dispose(spine_region_attachment self) { - delete (RegionAttachment*)self; + delete (RegionAttachment *) self; } spine_rtti spine_region_attachment_get_rtti(spine_region_attachment self) { - return (spine_rtti)&((RegionAttachment*)self)->getRTTI(); + RegionAttachment *_self = (RegionAttachment *) self; + return (spine_rtti) &_self->getRTTI(); } void spine_region_attachment_update_region(spine_region_attachment self) { - ((RegionAttachment*)self)->updateRegion(); + RegionAttachment *_self = (RegionAttachment *) self; + _self->updateRegion(); } -void spine_region_attachment_compute_world_vertices_1(spine_region_attachment self, spine_slot slot, float * worldVertices, size_t offset, size_t stride) { - ((RegionAttachment*)self)->computeWorldVertices(*((Slot*)slot), worldVertices, offset, stride); +void spine_region_attachment_compute_world_vertices_1(spine_region_attachment self, spine_slot slot, float *worldVertices, size_t offset, + size_t stride) { + RegionAttachment *_self = (RegionAttachment *) self; + _self->computeWorldVertices(*((Slot *) slot), worldVertices, offset, stride); } -void spine_region_attachment_compute_world_vertices_2(spine_region_attachment self, spine_slot slot, spine_array_float worldVertices, size_t offset, size_t stride) { - ((RegionAttachment*)self)->computeWorldVertices(*((Slot*)slot), *((Array*)worldVertices), offset, stride); +void spine_region_attachment_compute_world_vertices_2(spine_region_attachment self, spine_slot slot, spine_array_float worldVertices, size_t offset, + size_t stride) { + RegionAttachment *_self = (RegionAttachment *) self; + _self->computeWorldVertices(*((Slot *) slot), *((Array *) worldVertices), offset, stride); } float spine_region_attachment_get_x(spine_region_attachment self) { - return ((RegionAttachment*)self)->getX(); + RegionAttachment *_self = (RegionAttachment *) self; + return _self->getX(); } void spine_region_attachment_set_x(spine_region_attachment self, float inValue) { - ((RegionAttachment*)self)->setX(inValue); + RegionAttachment *_self = (RegionAttachment *) self; + _self->setX(inValue); } float spine_region_attachment_get_y(spine_region_attachment self) { - return ((RegionAttachment*)self)->getY(); + RegionAttachment *_self = (RegionAttachment *) self; + return _self->getY(); } void spine_region_attachment_set_y(spine_region_attachment self, float inValue) { - ((RegionAttachment*)self)->setY(inValue); + RegionAttachment *_self = (RegionAttachment *) self; + _self->setY(inValue); } float spine_region_attachment_get_rotation(spine_region_attachment self) { - return ((RegionAttachment*)self)->getRotation(); + RegionAttachment *_self = (RegionAttachment *) self; + return _self->getRotation(); } void spine_region_attachment_set_rotation(spine_region_attachment self, float inValue) { - ((RegionAttachment*)self)->setRotation(inValue); + RegionAttachment *_self = (RegionAttachment *) self; + _self->setRotation(inValue); } float spine_region_attachment_get_scale_x(spine_region_attachment self) { - return ((RegionAttachment*)self)->getScaleX(); + RegionAttachment *_self = (RegionAttachment *) self; + return _self->getScaleX(); } void spine_region_attachment_set_scale_x(spine_region_attachment self, float inValue) { - ((RegionAttachment*)self)->setScaleX(inValue); + RegionAttachment *_self = (RegionAttachment *) self; + _self->setScaleX(inValue); } float spine_region_attachment_get_scale_y(spine_region_attachment self) { - return ((RegionAttachment*)self)->getScaleY(); + RegionAttachment *_self = (RegionAttachment *) self; + return _self->getScaleY(); } void spine_region_attachment_set_scale_y(spine_region_attachment self, float inValue) { - ((RegionAttachment*)self)->setScaleY(inValue); + RegionAttachment *_self = (RegionAttachment *) self; + _self->setScaleY(inValue); } float spine_region_attachment_get_width(spine_region_attachment self) { - return ((RegionAttachment*)self)->getWidth(); + RegionAttachment *_self = (RegionAttachment *) self; + return _self->getWidth(); } void spine_region_attachment_set_width(spine_region_attachment self, float inValue) { - ((RegionAttachment*)self)->setWidth(inValue); + RegionAttachment *_self = (RegionAttachment *) self; + _self->setWidth(inValue); } float spine_region_attachment_get_height(spine_region_attachment self) { - return ((RegionAttachment*)self)->getHeight(); + RegionAttachment *_self = (RegionAttachment *) self; + return _self->getHeight(); } void spine_region_attachment_set_height(spine_region_attachment self, float inValue) { - ((RegionAttachment*)self)->setHeight(inValue); + RegionAttachment *_self = (RegionAttachment *) self; + _self->setHeight(inValue); } spine_color spine_region_attachment_get_color(spine_region_attachment self) { - return (spine_color)&((RegionAttachment*)self)->getColor(); + RegionAttachment *_self = (RegionAttachment *) self; + return (spine_color) &_self->getColor(); } -const char * spine_region_attachment_get_path(spine_region_attachment self) { - return ((RegionAttachment*)self)->getPath().buffer(); +const char *spine_region_attachment_get_path(spine_region_attachment self) { + RegionAttachment *_self = (RegionAttachment *) self; + return _self->getPath().buffer(); } -void spine_region_attachment_set_path(spine_region_attachment self, const char * inValue) { - ((RegionAttachment*)self)->setPath(String(inValue)); +void spine_region_attachment_set_path(spine_region_attachment self, const char *inValue) { + RegionAttachment *_self = (RegionAttachment *) self; + _self->setPath(String(inValue)); } spine_texture_region spine_region_attachment_get_region(spine_region_attachment self) { - return (spine_texture_region)((RegionAttachment*)self)->getRegion(); + RegionAttachment *_self = (RegionAttachment *) self; + return (spine_texture_region) _self->getRegion(); } void spine_region_attachment_set_region(spine_region_attachment self, spine_texture_region region) { - ((RegionAttachment*)self)->setRegion((TextureRegion *)region); + RegionAttachment *_self = (RegionAttachment *) self; + _self->setRegion((TextureRegion *) region); } spine_sequence spine_region_attachment_get_sequence(spine_region_attachment self) { - return (spine_sequence)((RegionAttachment*)self)->getSequence(); + RegionAttachment *_self = (RegionAttachment *) self; + return (spine_sequence) _self->getSequence(); } void spine_region_attachment_set_sequence(spine_region_attachment self, spine_sequence sequence) { - ((RegionAttachment*)self)->setSequence((Sequence *)sequence); + RegionAttachment *_self = (RegionAttachment *) self; + _self->setSequence((Sequence *) sequence); } spine_array_float spine_region_attachment_get_offset(spine_region_attachment self) { - return (spine_array_float)&((RegionAttachment*)self)->getOffset(); + RegionAttachment *_self = (RegionAttachment *) self; + return (spine_array_float) &_self->getOffset(); } spine_array_float spine_region_attachment_get_u_vs(spine_region_attachment self) { - return (spine_array_float)&((RegionAttachment*)self)->getUVs(); + RegionAttachment *_self = (RegionAttachment *) self; + return (spine_array_float) &_self->getUVs(); } spine_attachment spine_region_attachment_copy(spine_region_attachment self) { - return (spine_attachment)((RegionAttachment*)self)->copy(); + RegionAttachment *_self = (RegionAttachment *) self; + return (spine_attachment) _self->copy(); } -const char * spine_region_attachment_get_name(spine_region_attachment self) { - return ((Attachment*)(RegionAttachment*)self)->getName().buffer(); +const char *spine_region_attachment_get_name(spine_region_attachment self) { + Attachment *_self = (Attachment *) (RegionAttachment *) self; + return _self->getName().buffer(); } int spine_region_attachment_get_ref_count(spine_region_attachment self) { - return ((Attachment*)(RegionAttachment*)self)->getRefCount(); + Attachment *_self = (Attachment *) (RegionAttachment *) self; + return _self->getRefCount(); } void spine_region_attachment_reference(spine_region_attachment self) { - ((Attachment*)(RegionAttachment*)self)->reference(); + Attachment *_self = (Attachment *) (RegionAttachment *) self; + _self->reference(); } void spine_region_attachment_dereference(spine_region_attachment self) { - ((Attachment*)(RegionAttachment*)self)->dereference(); + Attachment *_self = (Attachment *) (RegionAttachment *) self; + _self->dereference(); } spine_rtti spine_region_attachment_rtti(void) { - return (spine_rtti)&RegionAttachment::rtti; + return (spine_rtti) &RegionAttachment::rtti; } diff --git a/spine-c/src/generated/region_attachment.h b/spine-c/src/generated/region_attachment.h index cf09b8c2c..521594b97 100644 --- a/spine-c/src/generated/region_attachment.h +++ b/spine-c/src/generated/region_attachment.h @@ -8,14 +8,16 @@ extern "C" { #endif -SPINE_C_API spine_region_attachment spine_region_attachment_create(const char * name); +SPINE_C_API spine_region_attachment spine_region_attachment_create(const char *name); SPINE_C_API void spine_region_attachment_dispose(spine_region_attachment self); SPINE_C_API spine_rtti spine_region_attachment_get_rtti(spine_region_attachment self); SPINE_C_API void spine_region_attachment_update_region(spine_region_attachment self); -SPINE_C_API void spine_region_attachment_compute_world_vertices_1(spine_region_attachment self, spine_slot slot, float * worldVertices, size_t offset, size_t stride); -SPINE_C_API void spine_region_attachment_compute_world_vertices_2(spine_region_attachment self, spine_slot slot, spine_array_float worldVertices, size_t offset, size_t stride); +SPINE_C_API void spine_region_attachment_compute_world_vertices_1(spine_region_attachment self, spine_slot slot, float *worldVertices, size_t offset, + size_t stride); +SPINE_C_API void spine_region_attachment_compute_world_vertices_2(spine_region_attachment self, spine_slot slot, spine_array_float worldVertices, + size_t offset, size_t stride); SPINE_C_API float spine_region_attachment_get_x(spine_region_attachment self); SPINE_C_API void spine_region_attachment_set_x(spine_region_attachment self, float inValue); SPINE_C_API float spine_region_attachment_get_y(spine_region_attachment self); @@ -31,8 +33,8 @@ SPINE_C_API void spine_region_attachment_set_width(spine_region_attachment self, SPINE_C_API float spine_region_attachment_get_height(spine_region_attachment self); SPINE_C_API void spine_region_attachment_set_height(spine_region_attachment self, float inValue); SPINE_C_API spine_color spine_region_attachment_get_color(spine_region_attachment self); -SPINE_C_API const char * spine_region_attachment_get_path(spine_region_attachment self); -SPINE_C_API void spine_region_attachment_set_path(spine_region_attachment self, const char * inValue); +SPINE_C_API const char *spine_region_attachment_get_path(spine_region_attachment self); +SPINE_C_API void spine_region_attachment_set_path(spine_region_attachment self, const char *inValue); SPINE_C_API spine_texture_region spine_region_attachment_get_region(spine_region_attachment self); SPINE_C_API void spine_region_attachment_set_region(spine_region_attachment self, spine_texture_region region); SPINE_C_API spine_sequence spine_region_attachment_get_sequence(spine_region_attachment self); @@ -40,7 +42,7 @@ SPINE_C_API void spine_region_attachment_set_sequence(spine_region_attachment se SPINE_C_API spine_array_float spine_region_attachment_get_offset(spine_region_attachment self); SPINE_C_API spine_array_float spine_region_attachment_get_u_vs(spine_region_attachment self); SPINE_C_API spine_attachment spine_region_attachment_copy(spine_region_attachment self); -SPINE_C_API const char * spine_region_attachment_get_name(spine_region_attachment self); +SPINE_C_API const char *spine_region_attachment_get_name(spine_region_attachment self); SPINE_C_API int spine_region_attachment_get_ref_count(spine_region_attachment self); SPINE_C_API void spine_region_attachment_reference(spine_region_attachment self); SPINE_C_API void spine_region_attachment_dereference(spine_region_attachment self); diff --git a/spine-c/src/generated/render_command.cpp b/spine-c/src/generated/render_command.cpp index bfceac989..8a6138842 100644 --- a/spine-c/src/generated/render_command.cpp +++ b/spine-c/src/generated/render_command.cpp @@ -4,45 +4,55 @@ using namespace spine; void spine_render_command_dispose(spine_render_command self) { - delete (RenderCommand*)self; + delete (RenderCommand *) self; } -float * spine_render_command_get_positions(spine_render_command self) { - return ((RenderCommand*)self)->positions; +float *spine_render_command_get_positions(spine_render_command self) { + RenderCommand *_self = (RenderCommand *) self; + return _self->positions; } -float * spine_render_command_get_uvs(spine_render_command self) { - return ((RenderCommand*)self)->uvs; +float *spine_render_command_get_uvs(spine_render_command self) { + RenderCommand *_self = (RenderCommand *) self; + return _self->uvs; } -uint32_t * spine_render_command_get_colors(spine_render_command self) { - return ((RenderCommand*)self)->colors; +uint32_t *spine_render_command_get_colors(spine_render_command self) { + RenderCommand *_self = (RenderCommand *) self; + return _self->colors; } -uint32_t * spine_render_command_get_dark_colors(spine_render_command self) { - return ((RenderCommand*)self)->darkColors; +uint32_t *spine_render_command_get_dark_colors(spine_render_command self) { + RenderCommand *_self = (RenderCommand *) self; + return _self->darkColors; } int32_t spine_render_command_get_num_vertices(spine_render_command self) { - return ((RenderCommand*)self)->numVertices; + RenderCommand *_self = (RenderCommand *) self; + return _self->numVertices; } -uint16_t * spine_render_command_get_indices(spine_render_command self) { - return ((RenderCommand*)self)->indices; +uint16_t *spine_render_command_get_indices(spine_render_command self) { + RenderCommand *_self = (RenderCommand *) self; + return _self->indices; } int32_t spine_render_command_get_num_indices(spine_render_command self) { - return ((RenderCommand*)self)->numIndices; + RenderCommand *_self = (RenderCommand *) self; + return _self->numIndices; } spine_blend_mode spine_render_command_get_blend_mode(spine_render_command self) { - return (spine_blend_mode)((RenderCommand*)self)->blendMode; + RenderCommand *_self = (RenderCommand *) self; + return (spine_blend_mode) _self->blendMode; } -void * spine_render_command_get_texture(spine_render_command self) { - return ((RenderCommand*)self)->texture; +void *spine_render_command_get_texture(spine_render_command self) { + RenderCommand *_self = (RenderCommand *) self; + return _self->texture; } spine_render_command spine_render_command_get_next(spine_render_command self) { - return (spine_render_command)((RenderCommand*)self)->next; + RenderCommand *_self = (RenderCommand *) self; + return (spine_render_command) _self->next; } diff --git a/spine-c/src/generated/render_command.h b/spine-c/src/generated/render_command.h index 52d8b031e..82c9e0020 100644 --- a/spine-c/src/generated/render_command.h +++ b/spine-c/src/generated/render_command.h @@ -10,15 +10,15 @@ extern "C" { SPINE_C_API void spine_render_command_dispose(spine_render_command self); -SPINE_C_API float * spine_render_command_get_positions(spine_render_command self); -SPINE_C_API float * spine_render_command_get_uvs(spine_render_command self); -SPINE_C_API uint32_t * spine_render_command_get_colors(spine_render_command self); -SPINE_C_API uint32_t * spine_render_command_get_dark_colors(spine_render_command self); +SPINE_C_API float *spine_render_command_get_positions(spine_render_command self); +SPINE_C_API float *spine_render_command_get_uvs(spine_render_command self); +SPINE_C_API uint32_t *spine_render_command_get_colors(spine_render_command self); +SPINE_C_API uint32_t *spine_render_command_get_dark_colors(spine_render_command self); SPINE_C_API int32_t spine_render_command_get_num_vertices(spine_render_command self); -SPINE_C_API uint16_t * spine_render_command_get_indices(spine_render_command self); +SPINE_C_API uint16_t *spine_render_command_get_indices(spine_render_command self); SPINE_C_API int32_t spine_render_command_get_num_indices(spine_render_command self); SPINE_C_API spine_blend_mode spine_render_command_get_blend_mode(spine_render_command self); -SPINE_C_API void * spine_render_command_get_texture(spine_render_command self); +SPINE_C_API void *spine_render_command_get_texture(spine_render_command self); SPINE_C_API spine_render_command spine_render_command_get_next(spine_render_command self); #ifdef __cplusplus diff --git a/spine-c/src/generated/rgb2_timeline.cpp b/spine-c/src/generated/rgb2_timeline.cpp index 31472ae82..c10ae69bb 100644 --- a/spine-c/src/generated/rgb2_timeline.cpp +++ b/spine-c/src/generated/rgb2_timeline.cpp @@ -4,73 +4,91 @@ using namespace spine; spine_rgb2_timeline spine_rgb2_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex) { - return (spine_rgb2_timeline) new (__FILE__, __LINE__) RGB2Timeline(frameCount, bezierCount, slotIndex); + return (spine_rgb2_timeline) new (__FILE__, __LINE__) RGB2Timeline(frameCount, bezierCount, slotIndex); } void spine_rgb2_timeline_dispose(spine_rgb2_timeline self) { - delete (RGB2Timeline*)self; + delete (RGB2Timeline *) self; } spine_rtti spine_rgb2_timeline_get_rtti(spine_rgb2_timeline self) { - return (spine_rtti)&((RGB2Timeline*)self)->getRTTI(); + RGB2Timeline *_self = (RGB2Timeline *) self; + return (spine_rtti) &_self->getRTTI(); } void spine_rgb2_timeline_set_frame(spine_rgb2_timeline self, int frame, float time, float r, float g, float b, float r2, float g2, float b2) { - ((RGB2Timeline*)self)->setFrame(frame, time, r, g, b, r2, g2, b2); + RGB2Timeline *_self = (RGB2Timeline *) self; + _self->setFrame(frame, time, r, g, b, r2, g2, b2); } -void spine_rgb2_timeline_apply(spine_rgb2_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((SlotCurveTimeline*)(RGB2Timeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_rgb2_timeline_apply(spine_rgb2_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, + spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGB2Timeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_rgb2_timeline_set_linear(spine_rgb2_timeline self, size_t frame) { - ((SlotCurveTimeline*)(RGB2Timeline*)self)->setLinear(frame); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGB2Timeline *) self; + _self->setLinear(frame); } void spine_rgb2_timeline_set_stepped(spine_rgb2_timeline self, size_t frame) { - ((SlotCurveTimeline*)(RGB2Timeline*)self)->setStepped(frame); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGB2Timeline *) self; + _self->setStepped(frame); } -void spine_rgb2_timeline_set_bezier(spine_rgb2_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((SlotCurveTimeline*)(RGB2Timeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_rgb2_timeline_set_bezier(spine_rgb2_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, + float cy1, float cx2, float cy2, float time2, float value2) { + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGB2Timeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_rgb2_timeline_get_bezier_value(spine_rgb2_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((SlotCurveTimeline*)(RGB2Timeline*)self)->getBezierValue(time, frame, valueOffset, i); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGB2Timeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_rgb2_timeline_get_curves(spine_rgb2_timeline self) { - return (spine_array_float)&((SlotCurveTimeline*)(RGB2Timeline*)self)->getCurves(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGB2Timeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_rgb2_timeline_get_frame_entries(spine_rgb2_timeline self) { - return ((SlotCurveTimeline*)(RGB2Timeline*)self)->getFrameEntries(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGB2Timeline *) self; + return _self->getFrameEntries(); } size_t spine_rgb2_timeline_get_frame_count(spine_rgb2_timeline self) { - return ((SlotCurveTimeline*)(RGB2Timeline*)self)->getFrameCount(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGB2Timeline *) self; + return _self->getFrameCount(); } spine_array_float spine_rgb2_timeline_get_frames(spine_rgb2_timeline self) { - return (spine_array_float)&((SlotCurveTimeline*)(RGB2Timeline*)self)->getFrames(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGB2Timeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_rgb2_timeline_get_duration(spine_rgb2_timeline self) { - return ((SlotCurveTimeline*)(RGB2Timeline*)self)->getDuration(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGB2Timeline *) self; + return _self->getDuration(); } spine_array_property_id spine_rgb2_timeline_get_property_ids(spine_rgb2_timeline self) { - return (spine_array_property_id)&((SlotCurveTimeline*)(RGB2Timeline*)self)->getPropertyIds(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGB2Timeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_rgb2_timeline_get_slot_index(spine_rgb2_timeline self) { - return ((SlotCurveTimeline*)(RGB2Timeline*)self)->getSlotIndex(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGB2Timeline *) self; + return _self->getSlotIndex(); } void spine_rgb2_timeline_set_slot_index(spine_rgb2_timeline self, int inValue) { - ((SlotCurveTimeline*)(RGB2Timeline*)self)->setSlotIndex(inValue); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGB2Timeline *) self; + _self->setSlotIndex(inValue); } spine_rtti spine_rgb2_timeline_rtti(void) { - return (spine_rtti)&RGB2Timeline::rtti; + return (spine_rtti) &RGB2Timeline::rtti; } diff --git a/spine-c/src/generated/rgb2_timeline.h b/spine-c/src/generated/rgb2_timeline.h index fb8a9072c..6250e8157 100644 --- a/spine-c/src/generated/rgb2_timeline.h +++ b/spine-c/src/generated/rgb2_timeline.h @@ -13,11 +13,14 @@ SPINE_C_API spine_rgb2_timeline spine_rgb2_timeline_create(size_t frameCount, si SPINE_C_API void spine_rgb2_timeline_dispose(spine_rgb2_timeline self); SPINE_C_API spine_rtti spine_rgb2_timeline_get_rtti(spine_rgb2_timeline self); -SPINE_C_API void spine_rgb2_timeline_set_frame(spine_rgb2_timeline self, int frame, float time, float r, float g, float b, float r2, float g2, float b2); -SPINE_C_API void spine_rgb2_timeline_apply(spine_rgb2_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_rgb2_timeline_set_frame(spine_rgb2_timeline self, int frame, float time, float r, float g, float b, float r2, float g2, + float b2); +SPINE_C_API void spine_rgb2_timeline_apply(spine_rgb2_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); SPINE_C_API void spine_rgb2_timeline_set_linear(spine_rgb2_timeline self, size_t frame); SPINE_C_API void spine_rgb2_timeline_set_stepped(spine_rgb2_timeline self, size_t frame); -SPINE_C_API void spine_rgb2_timeline_set_bezier(spine_rgb2_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_rgb2_timeline_set_bezier(spine_rgb2_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_rgb2_timeline_get_bezier_value(spine_rgb2_timeline self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_rgb2_timeline_get_curves(spine_rgb2_timeline self); SPINE_C_API size_t spine_rgb2_timeline_get_frame_entries(spine_rgb2_timeline self); diff --git a/spine-c/src/generated/rgb_timeline.cpp b/spine-c/src/generated/rgb_timeline.cpp index baba70dda..da1434e35 100644 --- a/spine-c/src/generated/rgb_timeline.cpp +++ b/spine-c/src/generated/rgb_timeline.cpp @@ -4,73 +4,91 @@ using namespace spine; spine_rgb_timeline spine_rgb_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex) { - return (spine_rgb_timeline) new (__FILE__, __LINE__) RGBTimeline(frameCount, bezierCount, slotIndex); + return (spine_rgb_timeline) new (__FILE__, __LINE__) RGBTimeline(frameCount, bezierCount, slotIndex); } void spine_rgb_timeline_dispose(spine_rgb_timeline self) { - delete (RGBTimeline*)self; + delete (RGBTimeline *) self; } spine_rtti spine_rgb_timeline_get_rtti(spine_rgb_timeline self) { - return (spine_rtti)&((RGBTimeline*)self)->getRTTI(); + RGBTimeline *_self = (RGBTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } void spine_rgb_timeline_set_frame(spine_rgb_timeline self, int frame, float time, float r, float g, float b) { - ((RGBTimeline*)self)->setFrame(frame, time, r, g, b); + RGBTimeline *_self = (RGBTimeline *) self; + _self->setFrame(frame, time, r, g, b); } -void spine_rgb_timeline_apply(spine_rgb_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((SlotCurveTimeline*)(RGBTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_rgb_timeline_apply(spine_rgb_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, + spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_rgb_timeline_set_linear(spine_rgb_timeline self, size_t frame) { - ((SlotCurveTimeline*)(RGBTimeline*)self)->setLinear(frame); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBTimeline *) self; + _self->setLinear(frame); } void spine_rgb_timeline_set_stepped(spine_rgb_timeline self, size_t frame) { - ((SlotCurveTimeline*)(RGBTimeline*)self)->setStepped(frame); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBTimeline *) self; + _self->setStepped(frame); } -void spine_rgb_timeline_set_bezier(spine_rgb_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((SlotCurveTimeline*)(RGBTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_rgb_timeline_set_bezier(spine_rgb_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, + float cx2, float cy2, float time2, float value2) { + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_rgb_timeline_get_bezier_value(spine_rgb_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((SlotCurveTimeline*)(RGBTimeline*)self)->getBezierValue(time, frame, valueOffset, i); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_rgb_timeline_get_curves(spine_rgb_timeline self) { - return (spine_array_float)&((SlotCurveTimeline*)(RGBTimeline*)self)->getCurves(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_rgb_timeline_get_frame_entries(spine_rgb_timeline self) { - return ((SlotCurveTimeline*)(RGBTimeline*)self)->getFrameEntries(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBTimeline *) self; + return _self->getFrameEntries(); } size_t spine_rgb_timeline_get_frame_count(spine_rgb_timeline self) { - return ((SlotCurveTimeline*)(RGBTimeline*)self)->getFrameCount(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_rgb_timeline_get_frames(spine_rgb_timeline self) { - return (spine_array_float)&((SlotCurveTimeline*)(RGBTimeline*)self)->getFrames(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_rgb_timeline_get_duration(spine_rgb_timeline self) { - return ((SlotCurveTimeline*)(RGBTimeline*)self)->getDuration(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_rgb_timeline_get_property_ids(spine_rgb_timeline self) { - return (spine_array_property_id)&((SlotCurveTimeline*)(RGBTimeline*)self)->getPropertyIds(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_rgb_timeline_get_slot_index(spine_rgb_timeline self) { - return ((SlotCurveTimeline*)(RGBTimeline*)self)->getSlotIndex(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBTimeline *) self; + return _self->getSlotIndex(); } void spine_rgb_timeline_set_slot_index(spine_rgb_timeline self, int inValue) { - ((SlotCurveTimeline*)(RGBTimeline*)self)->setSlotIndex(inValue); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBTimeline *) self; + _self->setSlotIndex(inValue); } spine_rtti spine_rgb_timeline_rtti(void) { - return (spine_rtti)&RGBTimeline::rtti; + return (spine_rtti) &RGBTimeline::rtti; } diff --git a/spine-c/src/generated/rgb_timeline.h b/spine-c/src/generated/rgb_timeline.h index 892c9c2bd..a3dfe7575 100644 --- a/spine-c/src/generated/rgb_timeline.h +++ b/spine-c/src/generated/rgb_timeline.h @@ -14,10 +14,12 @@ SPINE_C_API void spine_rgb_timeline_dispose(spine_rgb_timeline self); SPINE_C_API spine_rtti spine_rgb_timeline_get_rtti(spine_rgb_timeline self); SPINE_C_API void spine_rgb_timeline_set_frame(spine_rgb_timeline self, int frame, float time, float r, float g, float b); -SPINE_C_API void spine_rgb_timeline_apply(spine_rgb_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_rgb_timeline_apply(spine_rgb_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); SPINE_C_API void spine_rgb_timeline_set_linear(spine_rgb_timeline self, size_t frame); SPINE_C_API void spine_rgb_timeline_set_stepped(spine_rgb_timeline self, size_t frame); -SPINE_C_API void spine_rgb_timeline_set_bezier(spine_rgb_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_rgb_timeline_set_bezier(spine_rgb_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_rgb_timeline_get_bezier_value(spine_rgb_timeline self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_rgb_timeline_get_curves(spine_rgb_timeline self); SPINE_C_API size_t spine_rgb_timeline_get_frame_entries(spine_rgb_timeline self); diff --git a/spine-c/src/generated/rgba2_timeline.cpp b/spine-c/src/generated/rgba2_timeline.cpp index 0a1e3ea28..5f6d336a8 100644 --- a/spine-c/src/generated/rgba2_timeline.cpp +++ b/spine-c/src/generated/rgba2_timeline.cpp @@ -4,73 +4,92 @@ using namespace spine; spine_rgba2_timeline spine_rgba2_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex) { - return (spine_rgba2_timeline) new (__FILE__, __LINE__) RGBA2Timeline(frameCount, bezierCount, slotIndex); + return (spine_rgba2_timeline) new (__FILE__, __LINE__) RGBA2Timeline(frameCount, bezierCount, slotIndex); } void spine_rgba2_timeline_dispose(spine_rgba2_timeline self) { - delete (RGBA2Timeline*)self; + delete (RGBA2Timeline *) self; } spine_rtti spine_rgba2_timeline_get_rtti(spine_rgba2_timeline self) { - return (spine_rtti)&((RGBA2Timeline*)self)->getRTTI(); + RGBA2Timeline *_self = (RGBA2Timeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_rgba2_timeline_set_frame(spine_rgba2_timeline self, int frame, float time, float r, float g, float b, float a, float r2, float g2, float b2) { - ((RGBA2Timeline*)self)->setFrame(frame, time, r, g, b, a, r2, g2, b2); +void spine_rgba2_timeline_set_frame(spine_rgba2_timeline self, int frame, float time, float r, float g, float b, float a, float r2, float g2, + float b2) { + RGBA2Timeline *_self = (RGBA2Timeline *) self; + _self->setFrame(frame, time, r, g, b, a, r2, g2, b2); } -void spine_rgba2_timeline_apply(spine_rgba2_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((SlotCurveTimeline*)(RGBA2Timeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_rgba2_timeline_apply(spine_rgba2_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBA2Timeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_rgba2_timeline_set_linear(spine_rgba2_timeline self, size_t frame) { - ((SlotCurveTimeline*)(RGBA2Timeline*)self)->setLinear(frame); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBA2Timeline *) self; + _self->setLinear(frame); } void spine_rgba2_timeline_set_stepped(spine_rgba2_timeline self, size_t frame) { - ((SlotCurveTimeline*)(RGBA2Timeline*)self)->setStepped(frame); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBA2Timeline *) self; + _self->setStepped(frame); } -void spine_rgba2_timeline_set_bezier(spine_rgba2_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((SlotCurveTimeline*)(RGBA2Timeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_rgba2_timeline_set_bezier(spine_rgba2_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, + float cy1, float cx2, float cy2, float time2, float value2) { + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBA2Timeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_rgba2_timeline_get_bezier_value(spine_rgba2_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((SlotCurveTimeline*)(RGBA2Timeline*)self)->getBezierValue(time, frame, valueOffset, i); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBA2Timeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_rgba2_timeline_get_curves(spine_rgba2_timeline self) { - return (spine_array_float)&((SlotCurveTimeline*)(RGBA2Timeline*)self)->getCurves(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBA2Timeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_rgba2_timeline_get_frame_entries(spine_rgba2_timeline self) { - return ((SlotCurveTimeline*)(RGBA2Timeline*)self)->getFrameEntries(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBA2Timeline *) self; + return _self->getFrameEntries(); } size_t spine_rgba2_timeline_get_frame_count(spine_rgba2_timeline self) { - return ((SlotCurveTimeline*)(RGBA2Timeline*)self)->getFrameCount(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBA2Timeline *) self; + return _self->getFrameCount(); } spine_array_float spine_rgba2_timeline_get_frames(spine_rgba2_timeline self) { - return (spine_array_float)&((SlotCurveTimeline*)(RGBA2Timeline*)self)->getFrames(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBA2Timeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_rgba2_timeline_get_duration(spine_rgba2_timeline self) { - return ((SlotCurveTimeline*)(RGBA2Timeline*)self)->getDuration(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBA2Timeline *) self; + return _self->getDuration(); } spine_array_property_id spine_rgba2_timeline_get_property_ids(spine_rgba2_timeline self) { - return (spine_array_property_id)&((SlotCurveTimeline*)(RGBA2Timeline*)self)->getPropertyIds(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBA2Timeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_rgba2_timeline_get_slot_index(spine_rgba2_timeline self) { - return ((SlotCurveTimeline*)(RGBA2Timeline*)self)->getSlotIndex(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBA2Timeline *) self; + return _self->getSlotIndex(); } void spine_rgba2_timeline_set_slot_index(spine_rgba2_timeline self, int inValue) { - ((SlotCurveTimeline*)(RGBA2Timeline*)self)->setSlotIndex(inValue); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBA2Timeline *) self; + _self->setSlotIndex(inValue); } spine_rtti spine_rgba2_timeline_rtti(void) { - return (spine_rtti)&RGBA2Timeline::rtti; + return (spine_rtti) &RGBA2Timeline::rtti; } diff --git a/spine-c/src/generated/rgba2_timeline.h b/spine-c/src/generated/rgba2_timeline.h index e57435dda..f69de7273 100644 --- a/spine-c/src/generated/rgba2_timeline.h +++ b/spine-c/src/generated/rgba2_timeline.h @@ -13,11 +13,14 @@ SPINE_C_API spine_rgba2_timeline spine_rgba2_timeline_create(size_t frameCount, SPINE_C_API void spine_rgba2_timeline_dispose(spine_rgba2_timeline self); SPINE_C_API spine_rtti spine_rgba2_timeline_get_rtti(spine_rgba2_timeline self); -SPINE_C_API void spine_rgba2_timeline_set_frame(spine_rgba2_timeline self, int frame, float time, float r, float g, float b, float a, float r2, float g2, float b2); -SPINE_C_API void spine_rgba2_timeline_apply(spine_rgba2_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_rgba2_timeline_set_frame(spine_rgba2_timeline self, int frame, float time, float r, float g, float b, float a, float r2, + float g2, float b2); +SPINE_C_API void spine_rgba2_timeline_apply(spine_rgba2_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); SPINE_C_API void spine_rgba2_timeline_set_linear(spine_rgba2_timeline self, size_t frame); SPINE_C_API void spine_rgba2_timeline_set_stepped(spine_rgba2_timeline self, size_t frame); -SPINE_C_API void spine_rgba2_timeline_set_bezier(spine_rgba2_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_rgba2_timeline_set_bezier(spine_rgba2_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_rgba2_timeline_get_bezier_value(spine_rgba2_timeline self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_rgba2_timeline_get_curves(spine_rgba2_timeline self); SPINE_C_API size_t spine_rgba2_timeline_get_frame_entries(spine_rgba2_timeline self); diff --git a/spine-c/src/generated/rgba_timeline.cpp b/spine-c/src/generated/rgba_timeline.cpp index 780c6d37b..ec6013b18 100644 --- a/spine-c/src/generated/rgba_timeline.cpp +++ b/spine-c/src/generated/rgba_timeline.cpp @@ -4,73 +4,91 @@ using namespace spine; spine_rgba_timeline spine_rgba_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex) { - return (spine_rgba_timeline) new (__FILE__, __LINE__) RGBATimeline(frameCount, bezierCount, slotIndex); + return (spine_rgba_timeline) new (__FILE__, __LINE__) RGBATimeline(frameCount, bezierCount, slotIndex); } void spine_rgba_timeline_dispose(spine_rgba_timeline self) { - delete (RGBATimeline*)self; + delete (RGBATimeline *) self; } spine_rtti spine_rgba_timeline_get_rtti(spine_rgba_timeline self) { - return (spine_rtti)&((RGBATimeline*)self)->getRTTI(); + RGBATimeline *_self = (RGBATimeline *) self; + return (spine_rtti) &_self->getRTTI(); } void spine_rgba_timeline_set_frame(spine_rgba_timeline self, int frame, float time, float r, float g, float b, float a) { - ((RGBATimeline*)self)->setFrame(frame, time, r, g, b, a); + RGBATimeline *_self = (RGBATimeline *) self; + _self->setFrame(frame, time, r, g, b, a); } -void spine_rgba_timeline_apply(spine_rgba_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((SlotCurveTimeline*)(RGBATimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_rgba_timeline_apply(spine_rgba_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, + spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBATimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_rgba_timeline_set_linear(spine_rgba_timeline self, size_t frame) { - ((SlotCurveTimeline*)(RGBATimeline*)self)->setLinear(frame); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBATimeline *) self; + _self->setLinear(frame); } void spine_rgba_timeline_set_stepped(spine_rgba_timeline self, size_t frame) { - ((SlotCurveTimeline*)(RGBATimeline*)self)->setStepped(frame); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBATimeline *) self; + _self->setStepped(frame); } -void spine_rgba_timeline_set_bezier(spine_rgba_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((SlotCurveTimeline*)(RGBATimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_rgba_timeline_set_bezier(spine_rgba_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, + float cy1, float cx2, float cy2, float time2, float value2) { + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBATimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_rgba_timeline_get_bezier_value(spine_rgba_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((SlotCurveTimeline*)(RGBATimeline*)self)->getBezierValue(time, frame, valueOffset, i); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBATimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_rgba_timeline_get_curves(spine_rgba_timeline self) { - return (spine_array_float)&((SlotCurveTimeline*)(RGBATimeline*)self)->getCurves(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBATimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_rgba_timeline_get_frame_entries(spine_rgba_timeline self) { - return ((SlotCurveTimeline*)(RGBATimeline*)self)->getFrameEntries(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBATimeline *) self; + return _self->getFrameEntries(); } size_t spine_rgba_timeline_get_frame_count(spine_rgba_timeline self) { - return ((SlotCurveTimeline*)(RGBATimeline*)self)->getFrameCount(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBATimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_rgba_timeline_get_frames(spine_rgba_timeline self) { - return (spine_array_float)&((SlotCurveTimeline*)(RGBATimeline*)self)->getFrames(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBATimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_rgba_timeline_get_duration(spine_rgba_timeline self) { - return ((SlotCurveTimeline*)(RGBATimeline*)self)->getDuration(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBATimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_rgba_timeline_get_property_ids(spine_rgba_timeline self) { - return (spine_array_property_id)&((SlotCurveTimeline*)(RGBATimeline*)self)->getPropertyIds(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBATimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_rgba_timeline_get_slot_index(spine_rgba_timeline self) { - return ((SlotCurveTimeline*)(RGBATimeline*)self)->getSlotIndex(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBATimeline *) self; + return _self->getSlotIndex(); } void spine_rgba_timeline_set_slot_index(spine_rgba_timeline self, int inValue) { - ((SlotCurveTimeline*)(RGBATimeline*)self)->setSlotIndex(inValue); + SlotCurveTimeline *_self = (SlotCurveTimeline *) (RGBATimeline *) self; + _self->setSlotIndex(inValue); } spine_rtti spine_rgba_timeline_rtti(void) { - return (spine_rtti)&RGBATimeline::rtti; + return (spine_rtti) &RGBATimeline::rtti; } diff --git a/spine-c/src/generated/rgba_timeline.h b/spine-c/src/generated/rgba_timeline.h index 919c9e076..50f458612 100644 --- a/spine-c/src/generated/rgba_timeline.h +++ b/spine-c/src/generated/rgba_timeline.h @@ -14,10 +14,12 @@ SPINE_C_API void spine_rgba_timeline_dispose(spine_rgba_timeline self); SPINE_C_API spine_rtti spine_rgba_timeline_get_rtti(spine_rgba_timeline self); SPINE_C_API void spine_rgba_timeline_set_frame(spine_rgba_timeline self, int frame, float time, float r, float g, float b, float a); -SPINE_C_API void spine_rgba_timeline_apply(spine_rgba_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_rgba_timeline_apply(spine_rgba_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); SPINE_C_API void spine_rgba_timeline_set_linear(spine_rgba_timeline self, size_t frame); SPINE_C_API void spine_rgba_timeline_set_stepped(spine_rgba_timeline self, size_t frame); -SPINE_C_API void spine_rgba_timeline_set_bezier(spine_rgba_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_rgba_timeline_set_bezier(spine_rgba_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_rgba_timeline_get_bezier_value(spine_rgba_timeline self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_rgba_timeline_get_curves(spine_rgba_timeline self); SPINE_C_API size_t spine_rgba_timeline_get_frame_entries(spine_rgba_timeline self); diff --git a/spine-c/src/generated/rotate_mode.h b/spine-c/src/generated/rotate_mode.h index 611df6170..a462221b7 100644 --- a/spine-c/src/generated/rotate_mode.h +++ b/spine-c/src/generated/rotate_mode.h @@ -6,9 +6,9 @@ extern "C" { #endif typedef enum spine_rotate_mode { - SPINE_ROTATE_MODE_TANGENT = 0, - SPINE_ROTATE_MODE_CHAIN, - SPINE_ROTATE_MODE_CHAIN_SCALE + SPINE_ROTATE_MODE_TANGENT = 0, + SPINE_ROTATE_MODE_CHAIN, + SPINE_ROTATE_MODE_CHAIN_SCALE } spine_rotate_mode; #ifdef __cplusplus diff --git a/spine-c/src/generated/rotate_timeline.cpp b/spine-c/src/generated/rotate_timeline.cpp index 408773251..90201cfe5 100644 --- a/spine-c/src/generated/rotate_timeline.cpp +++ b/spine-c/src/generated/rotate_timeline.cpp @@ -4,93 +4,120 @@ using namespace spine; spine_rotate_timeline spine_rotate_timeline_create(size_t frameCount, size_t bezierCount, int boneIndex) { - return (spine_rotate_timeline) new (__FILE__, __LINE__) RotateTimeline(frameCount, bezierCount, boneIndex); + return (spine_rotate_timeline) new (__FILE__, __LINE__) RotateTimeline(frameCount, bezierCount, boneIndex); } void spine_rotate_timeline_dispose(spine_rotate_timeline self) { - delete (RotateTimeline*)self; + delete (RotateTimeline *) self; } spine_rtti spine_rotate_timeline_get_rtti(spine_rotate_timeline self) { - return (spine_rtti)&((RotateTimeline*)self)->getRTTI(); + RotateTimeline *_self = (RotateTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_rotate_timeline_apply(spine_rotate_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((BoneTimeline1*)(RotateTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_rotate_timeline_apply(spine_rotate_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + BoneTimeline1 *_self = (BoneTimeline1 *) (RotateTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_rotate_timeline_set_frame(spine_rotate_timeline self, size_t frame, float time, float value) { - ((BoneTimeline1*)(RotateTimeline*)self)->setFrame(frame, time, value); + BoneTimeline1 *_self = (BoneTimeline1 *) (RotateTimeline *) self; + _self->setFrame(frame, time, value); } float spine_rotate_timeline_get_curve_value(spine_rotate_timeline self, float time) { - return ((BoneTimeline1*)(RotateTimeline*)self)->getCurveValue(time); + BoneTimeline1 *_self = (BoneTimeline1 *) (RotateTimeline *) self; + return _self->getCurveValue(time); } -float spine_rotate_timeline_get_relative_value(spine_rotate_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((BoneTimeline1*)(RotateTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_rotate_timeline_get_relative_value(spine_rotate_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (RotateTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_rotate_timeline_get_absolute_value_1(spine_rotate_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((BoneTimeline1*)(RotateTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_rotate_timeline_get_absolute_value_1(spine_rotate_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (RotateTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_rotate_timeline_get_absolute_value_2(spine_rotate_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((BoneTimeline1*)(RotateTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_rotate_timeline_get_absolute_value_2(spine_rotate_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup, float value) { + BoneTimeline1 *_self = (BoneTimeline1 *) (RotateTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_rotate_timeline_get_scale_value(spine_rotate_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((BoneTimeline1*)(RotateTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_rotate_timeline_get_scale_value(spine_rotate_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, + float current, float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (RotateTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_rotate_timeline_set_linear(spine_rotate_timeline self, size_t frame) { - ((BoneTimeline1*)(RotateTimeline*)self)->setLinear(frame); + BoneTimeline1 *_self = (BoneTimeline1 *) (RotateTimeline *) self; + _self->setLinear(frame); } void spine_rotate_timeline_set_stepped(spine_rotate_timeline self, size_t frame) { - ((BoneTimeline1*)(RotateTimeline*)self)->setStepped(frame); + BoneTimeline1 *_self = (BoneTimeline1 *) (RotateTimeline *) self; + _self->setStepped(frame); } -void spine_rotate_timeline_set_bezier(spine_rotate_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((BoneTimeline1*)(RotateTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_rotate_timeline_set_bezier(spine_rotate_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, + float cy1, float cx2, float cy2, float time2, float value2) { + BoneTimeline1 *_self = (BoneTimeline1 *) (RotateTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_rotate_timeline_get_bezier_value(spine_rotate_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((BoneTimeline1*)(RotateTimeline*)self)->getBezierValue(time, frame, valueOffset, i); + BoneTimeline1 *_self = (BoneTimeline1 *) (RotateTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_rotate_timeline_get_curves(spine_rotate_timeline self) { - return (spine_array_float)&((BoneTimeline1*)(RotateTimeline*)self)->getCurves(); + BoneTimeline1 *_self = (BoneTimeline1 *) (RotateTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_rotate_timeline_get_frame_entries(spine_rotate_timeline self) { - return ((BoneTimeline1*)(RotateTimeline*)self)->getFrameEntries(); + BoneTimeline1 *_self = (BoneTimeline1 *) (RotateTimeline *) self; + return _self->getFrameEntries(); } size_t spine_rotate_timeline_get_frame_count(spine_rotate_timeline self) { - return ((BoneTimeline1*)(RotateTimeline*)self)->getFrameCount(); + BoneTimeline1 *_self = (BoneTimeline1 *) (RotateTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_rotate_timeline_get_frames(spine_rotate_timeline self) { - return (spine_array_float)&((BoneTimeline1*)(RotateTimeline*)self)->getFrames(); + BoneTimeline1 *_self = (BoneTimeline1 *) (RotateTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_rotate_timeline_get_duration(spine_rotate_timeline self) { - return ((BoneTimeline1*)(RotateTimeline*)self)->getDuration(); + BoneTimeline1 *_self = (BoneTimeline1 *) (RotateTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_rotate_timeline_get_property_ids(spine_rotate_timeline self) { - return (spine_array_property_id)&((BoneTimeline1*)(RotateTimeline*)self)->getPropertyIds(); + BoneTimeline1 *_self = (BoneTimeline1 *) (RotateTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_rotate_timeline_get_bone_index(spine_rotate_timeline self) { - return ((BoneTimeline1*)(RotateTimeline*)self)->getBoneIndex(); + BoneTimeline1 *_self = (BoneTimeline1 *) (RotateTimeline *) self; + return _self->getBoneIndex(); } void spine_rotate_timeline_set_bone_index(spine_rotate_timeline self, int inValue) { - ((BoneTimeline1*)(RotateTimeline*)self)->setBoneIndex(inValue); + BoneTimeline1 *_self = (BoneTimeline1 *) (RotateTimeline *) self; + _self->setBoneIndex(inValue); } spine_rtti spine_rotate_timeline_rtti(void) { - return (spine_rtti)&RotateTimeline::rtti; + return (spine_rtti) &RotateTimeline::rtti; } diff --git a/spine-c/src/generated/rotate_timeline.h b/spine-c/src/generated/rotate_timeline.h index aff950154..b10a7ca54 100644 --- a/spine-c/src/generated/rotate_timeline.h +++ b/spine-c/src/generated/rotate_timeline.h @@ -13,16 +13,23 @@ SPINE_C_API spine_rotate_timeline spine_rotate_timeline_create(size_t frameCount SPINE_C_API void spine_rotate_timeline_dispose(spine_rotate_timeline self); SPINE_C_API spine_rtti spine_rotate_timeline_get_rtti(spine_rotate_timeline self); -SPINE_C_API void spine_rotate_timeline_apply(spine_rotate_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_rotate_timeline_apply(spine_rotate_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); SPINE_C_API void spine_rotate_timeline_set_frame(spine_rotate_timeline self, size_t frame, float time, float value); SPINE_C_API float spine_rotate_timeline_get_curve_value(spine_rotate_timeline self, float time); -SPINE_C_API float spine_rotate_timeline_get_relative_value(spine_rotate_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_rotate_timeline_get_absolute_value_1(spine_rotate_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_rotate_timeline_get_absolute_value_2(spine_rotate_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_rotate_timeline_get_scale_value(spine_rotate_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_rotate_timeline_get_relative_value(spine_rotate_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup); +SPINE_C_API float spine_rotate_timeline_get_absolute_value_1(spine_rotate_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup); +SPINE_C_API float spine_rotate_timeline_get_absolute_value_2(spine_rotate_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup, float value); +SPINE_C_API float spine_rotate_timeline_get_scale_value(spine_rotate_timeline self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup); SPINE_C_API void spine_rotate_timeline_set_linear(spine_rotate_timeline self, size_t frame); SPINE_C_API void spine_rotate_timeline_set_stepped(spine_rotate_timeline self, size_t frame); -SPINE_C_API void spine_rotate_timeline_set_bezier(spine_rotate_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_rotate_timeline_set_bezier(spine_rotate_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_rotate_timeline_get_bezier_value(spine_rotate_timeline self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_rotate_timeline_get_curves(spine_rotate_timeline self); SPINE_C_API size_t spine_rotate_timeline_get_frame_entries(spine_rotate_timeline self); diff --git a/spine-c/src/generated/rtti.cpp b/spine-c/src/generated/rtti.cpp index b468b9d89..130f3f214 100644 --- a/spine-c/src/generated/rtti.cpp +++ b/spine-c/src/generated/rtti.cpp @@ -4,17 +4,20 @@ using namespace spine; void spine_rtti_dispose(spine_rtti self) { - delete (RTTI*)self; + delete (RTTI *) self; } -const char * spine_rtti_get_class_name(spine_rtti self) { - return ((RTTI*)self)->getClassName(); +const char *spine_rtti_get_class_name(spine_rtti self) { + RTTI *_self = (RTTI *) self; + return _self->getClassName(); } bool spine_rtti_is_exactly(spine_rtti self, spine_rtti rtti) { - return ((RTTI*)self)->isExactly(*((const RTTI*)rtti)); + RTTI *_self = (RTTI *) self; + return _self->isExactly(*((const RTTI *) rtti)); } bool spine_rtti_instance_of(spine_rtti self, spine_rtti rtti) { - return ((RTTI*)self)->instanceOf(*((const RTTI*)rtti)); + RTTI *_self = (RTTI *) self; + return _self->instanceOf(*((const RTTI *) rtti)); } diff --git a/spine-c/src/generated/rtti.h b/spine-c/src/generated/rtti.h index 3dfe10d37..31097201c 100644 --- a/spine-c/src/generated/rtti.h +++ b/spine-c/src/generated/rtti.h @@ -10,7 +10,7 @@ extern "C" { SPINE_C_API void spine_rtti_dispose(spine_rtti self); -SPINE_C_API const char * spine_rtti_get_class_name(spine_rtti self); +SPINE_C_API const char *spine_rtti_get_class_name(spine_rtti self); SPINE_C_API bool spine_rtti_is_exactly(spine_rtti self, spine_rtti rtti); SPINE_C_API bool spine_rtti_instance_of(spine_rtti self, spine_rtti rtti); diff --git a/spine-c/src/generated/scale_timeline.cpp b/spine-c/src/generated/scale_timeline.cpp index 878b4e002..fe97032dd 100644 --- a/spine-c/src/generated/scale_timeline.cpp +++ b/spine-c/src/generated/scale_timeline.cpp @@ -4,77 +4,96 @@ using namespace spine; spine_scale_timeline spine_scale_timeline_create(size_t frameCount, size_t bezierCount, int boneIndex) { - return (spine_scale_timeline) new (__FILE__, __LINE__) ScaleTimeline(frameCount, bezierCount, boneIndex); + return (spine_scale_timeline) new (__FILE__, __LINE__) ScaleTimeline(frameCount, bezierCount, boneIndex); } void spine_scale_timeline_dispose(spine_scale_timeline self) { - delete (ScaleTimeline*)self; + delete (ScaleTimeline *) self; } spine_rtti spine_scale_timeline_get_rtti(spine_scale_timeline self) { - return (spine_rtti)&((ScaleTimeline*)self)->getRTTI(); + ScaleTimeline *_self = (ScaleTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_scale_timeline_apply(spine_scale_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((BoneTimeline2*)(ScaleTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_scale_timeline_apply(spine_scale_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + BoneTimeline2 *_self = (BoneTimeline2 *) (ScaleTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_scale_timeline_set_frame(spine_scale_timeline self, size_t frame, float time, float value1, float value2) { - ((BoneTimeline2*)(ScaleTimeline*)self)->setFrame(frame, time, value1, value2); + BoneTimeline2 *_self = (BoneTimeline2 *) (ScaleTimeline *) self; + _self->setFrame(frame, time, value1, value2); } float spine_scale_timeline_get_curve_value(spine_scale_timeline self, float time) { - return ((BoneTimeline2*)(ScaleTimeline*)self)->getCurveValue(time); + BoneTimeline2 *_self = (BoneTimeline2 *) (ScaleTimeline *) self; + return _self->getCurveValue(time); } void spine_scale_timeline_set_linear(spine_scale_timeline self, size_t frame) { - ((BoneTimeline2*)(ScaleTimeline*)self)->setLinear(frame); + BoneTimeline2 *_self = (BoneTimeline2 *) (ScaleTimeline *) self; + _self->setLinear(frame); } void spine_scale_timeline_set_stepped(spine_scale_timeline self, size_t frame) { - ((BoneTimeline2*)(ScaleTimeline*)self)->setStepped(frame); + BoneTimeline2 *_self = (BoneTimeline2 *) (ScaleTimeline *) self; + _self->setStepped(frame); } -void spine_scale_timeline_set_bezier(spine_scale_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((BoneTimeline2*)(ScaleTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_scale_timeline_set_bezier(spine_scale_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, + float cy1, float cx2, float cy2, float time2, float value2) { + BoneTimeline2 *_self = (BoneTimeline2 *) (ScaleTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_scale_timeline_get_bezier_value(spine_scale_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((BoneTimeline2*)(ScaleTimeline*)self)->getBezierValue(time, frame, valueOffset, i); + BoneTimeline2 *_self = (BoneTimeline2 *) (ScaleTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_scale_timeline_get_curves(spine_scale_timeline self) { - return (spine_array_float)&((BoneTimeline2*)(ScaleTimeline*)self)->getCurves(); + BoneTimeline2 *_self = (BoneTimeline2 *) (ScaleTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_scale_timeline_get_frame_entries(spine_scale_timeline self) { - return ((BoneTimeline2*)(ScaleTimeline*)self)->getFrameEntries(); + BoneTimeline2 *_self = (BoneTimeline2 *) (ScaleTimeline *) self; + return _self->getFrameEntries(); } size_t spine_scale_timeline_get_frame_count(spine_scale_timeline self) { - return ((BoneTimeline2*)(ScaleTimeline*)self)->getFrameCount(); + BoneTimeline2 *_self = (BoneTimeline2 *) (ScaleTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_scale_timeline_get_frames(spine_scale_timeline self) { - return (spine_array_float)&((BoneTimeline2*)(ScaleTimeline*)self)->getFrames(); + BoneTimeline2 *_self = (BoneTimeline2 *) (ScaleTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_scale_timeline_get_duration(spine_scale_timeline self) { - return ((BoneTimeline2*)(ScaleTimeline*)self)->getDuration(); + BoneTimeline2 *_self = (BoneTimeline2 *) (ScaleTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_scale_timeline_get_property_ids(spine_scale_timeline self) { - return (spine_array_property_id)&((BoneTimeline2*)(ScaleTimeline*)self)->getPropertyIds(); + BoneTimeline2 *_self = (BoneTimeline2 *) (ScaleTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_scale_timeline_get_bone_index(spine_scale_timeline self) { - return ((BoneTimeline2*)(ScaleTimeline*)self)->getBoneIndex(); + BoneTimeline2 *_self = (BoneTimeline2 *) (ScaleTimeline *) self; + return _self->getBoneIndex(); } void spine_scale_timeline_set_bone_index(spine_scale_timeline self, int inValue) { - ((BoneTimeline2*)(ScaleTimeline*)self)->setBoneIndex(inValue); + BoneTimeline2 *_self = (BoneTimeline2 *) (ScaleTimeline *) self; + _self->setBoneIndex(inValue); } spine_rtti spine_scale_timeline_rtti(void) { - return (spine_rtti)&ScaleTimeline::rtti; + return (spine_rtti) &ScaleTimeline::rtti; } diff --git a/spine-c/src/generated/scale_timeline.h b/spine-c/src/generated/scale_timeline.h index a0fd57420..d952f46d3 100644 --- a/spine-c/src/generated/scale_timeline.h +++ b/spine-c/src/generated/scale_timeline.h @@ -13,12 +13,14 @@ SPINE_C_API spine_scale_timeline spine_scale_timeline_create(size_t frameCount, SPINE_C_API void spine_scale_timeline_dispose(spine_scale_timeline self); SPINE_C_API spine_rtti spine_scale_timeline_get_rtti(spine_scale_timeline self); -SPINE_C_API void spine_scale_timeline_apply(spine_scale_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_scale_timeline_apply(spine_scale_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); SPINE_C_API void spine_scale_timeline_set_frame(spine_scale_timeline self, size_t frame, float time, float value1, float value2); SPINE_C_API float spine_scale_timeline_get_curve_value(spine_scale_timeline self, float time); SPINE_C_API void spine_scale_timeline_set_linear(spine_scale_timeline self, size_t frame); SPINE_C_API void spine_scale_timeline_set_stepped(spine_scale_timeline self, size_t frame); -SPINE_C_API void spine_scale_timeline_set_bezier(spine_scale_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_scale_timeline_set_bezier(spine_scale_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_scale_timeline_get_bezier_value(spine_scale_timeline self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_scale_timeline_get_curves(spine_scale_timeline self); SPINE_C_API size_t spine_scale_timeline_get_frame_entries(spine_scale_timeline self); diff --git a/spine-c/src/generated/scale_x_timeline.cpp b/spine-c/src/generated/scale_x_timeline.cpp index 1deb86f44..ea00914f7 100644 --- a/spine-c/src/generated/scale_x_timeline.cpp +++ b/spine-c/src/generated/scale_x_timeline.cpp @@ -4,93 +4,120 @@ using namespace spine; spine_scale_x_timeline spine_scale_x_timeline_create(size_t frameCount, size_t bezierCount, int boneIndex) { - return (spine_scale_x_timeline) new (__FILE__, __LINE__) ScaleXTimeline(frameCount, bezierCount, boneIndex); + return (spine_scale_x_timeline) new (__FILE__, __LINE__) ScaleXTimeline(frameCount, bezierCount, boneIndex); } void spine_scale_x_timeline_dispose(spine_scale_x_timeline self) { - delete (ScaleXTimeline*)self; + delete (ScaleXTimeline *) self; } spine_rtti spine_scale_x_timeline_get_rtti(spine_scale_x_timeline self) { - return (spine_rtti)&((ScaleXTimeline*)self)->getRTTI(); + ScaleXTimeline *_self = (ScaleXTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_scale_x_timeline_apply(spine_scale_x_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((BoneTimeline1*)(ScaleXTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_scale_x_timeline_apply(spine_scale_x_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleXTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_scale_x_timeline_set_frame(spine_scale_x_timeline self, size_t frame, float time, float value) { - ((BoneTimeline1*)(ScaleXTimeline*)self)->setFrame(frame, time, value); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleXTimeline *) self; + _self->setFrame(frame, time, value); } float spine_scale_x_timeline_get_curve_value(spine_scale_x_timeline self, float time) { - return ((BoneTimeline1*)(ScaleXTimeline*)self)->getCurveValue(time); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleXTimeline *) self; + return _self->getCurveValue(time); } -float spine_scale_x_timeline_get_relative_value(spine_scale_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((BoneTimeline1*)(ScaleXTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_scale_x_timeline_get_relative_value(spine_scale_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleXTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_scale_x_timeline_get_absolute_value_1(spine_scale_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((BoneTimeline1*)(ScaleXTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_scale_x_timeline_get_absolute_value_1(spine_scale_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleXTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_scale_x_timeline_get_absolute_value_2(spine_scale_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((BoneTimeline1*)(ScaleXTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_scale_x_timeline_get_absolute_value_2(spine_scale_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup, float value) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleXTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_scale_x_timeline_get_scale_value(spine_scale_x_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((BoneTimeline1*)(ScaleXTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_scale_x_timeline_get_scale_value(spine_scale_x_timeline self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleXTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_scale_x_timeline_set_linear(spine_scale_x_timeline self, size_t frame) { - ((BoneTimeline1*)(ScaleXTimeline*)self)->setLinear(frame); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleXTimeline *) self; + _self->setLinear(frame); } void spine_scale_x_timeline_set_stepped(spine_scale_x_timeline self, size_t frame) { - ((BoneTimeline1*)(ScaleXTimeline*)self)->setStepped(frame); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleXTimeline *) self; + _self->setStepped(frame); } -void spine_scale_x_timeline_set_bezier(spine_scale_x_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((BoneTimeline1*)(ScaleXTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_scale_x_timeline_set_bezier(spine_scale_x_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, + float cy1, float cx2, float cy2, float time2, float value2) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleXTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_scale_x_timeline_get_bezier_value(spine_scale_x_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((BoneTimeline1*)(ScaleXTimeline*)self)->getBezierValue(time, frame, valueOffset, i); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleXTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_scale_x_timeline_get_curves(spine_scale_x_timeline self) { - return (spine_array_float)&((BoneTimeline1*)(ScaleXTimeline*)self)->getCurves(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleXTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_scale_x_timeline_get_frame_entries(spine_scale_x_timeline self) { - return ((BoneTimeline1*)(ScaleXTimeline*)self)->getFrameEntries(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleXTimeline *) self; + return _self->getFrameEntries(); } size_t spine_scale_x_timeline_get_frame_count(spine_scale_x_timeline self) { - return ((BoneTimeline1*)(ScaleXTimeline*)self)->getFrameCount(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleXTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_scale_x_timeline_get_frames(spine_scale_x_timeline self) { - return (spine_array_float)&((BoneTimeline1*)(ScaleXTimeline*)self)->getFrames(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleXTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_scale_x_timeline_get_duration(spine_scale_x_timeline self) { - return ((BoneTimeline1*)(ScaleXTimeline*)self)->getDuration(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleXTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_scale_x_timeline_get_property_ids(spine_scale_x_timeline self) { - return (spine_array_property_id)&((BoneTimeline1*)(ScaleXTimeline*)self)->getPropertyIds(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleXTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_scale_x_timeline_get_bone_index(spine_scale_x_timeline self) { - return ((BoneTimeline1*)(ScaleXTimeline*)self)->getBoneIndex(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleXTimeline *) self; + return _self->getBoneIndex(); } void spine_scale_x_timeline_set_bone_index(spine_scale_x_timeline self, int inValue) { - ((BoneTimeline1*)(ScaleXTimeline*)self)->setBoneIndex(inValue); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleXTimeline *) self; + _self->setBoneIndex(inValue); } spine_rtti spine_scale_x_timeline_rtti(void) { - return (spine_rtti)&ScaleXTimeline::rtti; + return (spine_rtti) &ScaleXTimeline::rtti; } diff --git a/spine-c/src/generated/scale_x_timeline.h b/spine-c/src/generated/scale_x_timeline.h index f2a174455..5500bb7ae 100644 --- a/spine-c/src/generated/scale_x_timeline.h +++ b/spine-c/src/generated/scale_x_timeline.h @@ -13,16 +13,23 @@ SPINE_C_API spine_scale_x_timeline spine_scale_x_timeline_create(size_t frameCou SPINE_C_API void spine_scale_x_timeline_dispose(spine_scale_x_timeline self); SPINE_C_API spine_rtti spine_scale_x_timeline_get_rtti(spine_scale_x_timeline self); -SPINE_C_API void spine_scale_x_timeline_apply(spine_scale_x_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_scale_x_timeline_apply(spine_scale_x_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); SPINE_C_API void spine_scale_x_timeline_set_frame(spine_scale_x_timeline self, size_t frame, float time, float value); SPINE_C_API float spine_scale_x_timeline_get_curve_value(spine_scale_x_timeline self, float time); -SPINE_C_API float spine_scale_x_timeline_get_relative_value(spine_scale_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_scale_x_timeline_get_absolute_value_1(spine_scale_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_scale_x_timeline_get_absolute_value_2(spine_scale_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_scale_x_timeline_get_scale_value(spine_scale_x_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_scale_x_timeline_get_relative_value(spine_scale_x_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup); +SPINE_C_API float spine_scale_x_timeline_get_absolute_value_1(spine_scale_x_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup); +SPINE_C_API float spine_scale_x_timeline_get_absolute_value_2(spine_scale_x_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup, float value); +SPINE_C_API float spine_scale_x_timeline_get_scale_value(spine_scale_x_timeline self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup); SPINE_C_API void spine_scale_x_timeline_set_linear(spine_scale_x_timeline self, size_t frame); SPINE_C_API void spine_scale_x_timeline_set_stepped(spine_scale_x_timeline self, size_t frame); -SPINE_C_API void spine_scale_x_timeline_set_bezier(spine_scale_x_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_scale_x_timeline_set_bezier(spine_scale_x_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_scale_x_timeline_get_bezier_value(spine_scale_x_timeline self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_scale_x_timeline_get_curves(spine_scale_x_timeline self); SPINE_C_API size_t spine_scale_x_timeline_get_frame_entries(spine_scale_x_timeline self); diff --git a/spine-c/src/generated/scale_y_timeline.cpp b/spine-c/src/generated/scale_y_timeline.cpp index 553e96c84..22554a39b 100644 --- a/spine-c/src/generated/scale_y_timeline.cpp +++ b/spine-c/src/generated/scale_y_timeline.cpp @@ -4,93 +4,120 @@ using namespace spine; spine_scale_y_timeline spine_scale_y_timeline_create(size_t frameCount, size_t bezierCount, int boneIndex) { - return (spine_scale_y_timeline) new (__FILE__, __LINE__) ScaleYTimeline(frameCount, bezierCount, boneIndex); + return (spine_scale_y_timeline) new (__FILE__, __LINE__) ScaleYTimeline(frameCount, bezierCount, boneIndex); } void spine_scale_y_timeline_dispose(spine_scale_y_timeline self) { - delete (ScaleYTimeline*)self; + delete (ScaleYTimeline *) self; } spine_rtti spine_scale_y_timeline_get_rtti(spine_scale_y_timeline self) { - return (spine_rtti)&((ScaleYTimeline*)self)->getRTTI(); + ScaleYTimeline *_self = (ScaleYTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_scale_y_timeline_apply(spine_scale_y_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((BoneTimeline1*)(ScaleYTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_scale_y_timeline_apply(spine_scale_y_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleYTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_scale_y_timeline_set_frame(spine_scale_y_timeline self, size_t frame, float time, float value) { - ((BoneTimeline1*)(ScaleYTimeline*)self)->setFrame(frame, time, value); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleYTimeline *) self; + _self->setFrame(frame, time, value); } float spine_scale_y_timeline_get_curve_value(spine_scale_y_timeline self, float time) { - return ((BoneTimeline1*)(ScaleYTimeline*)self)->getCurveValue(time); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleYTimeline *) self; + return _self->getCurveValue(time); } -float spine_scale_y_timeline_get_relative_value(spine_scale_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((BoneTimeline1*)(ScaleYTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_scale_y_timeline_get_relative_value(spine_scale_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleYTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_scale_y_timeline_get_absolute_value_1(spine_scale_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((BoneTimeline1*)(ScaleYTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_scale_y_timeline_get_absolute_value_1(spine_scale_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleYTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_scale_y_timeline_get_absolute_value_2(spine_scale_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((BoneTimeline1*)(ScaleYTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_scale_y_timeline_get_absolute_value_2(spine_scale_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup, float value) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleYTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_scale_y_timeline_get_scale_value(spine_scale_y_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((BoneTimeline1*)(ScaleYTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_scale_y_timeline_get_scale_value(spine_scale_y_timeline self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleYTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_scale_y_timeline_set_linear(spine_scale_y_timeline self, size_t frame) { - ((BoneTimeline1*)(ScaleYTimeline*)self)->setLinear(frame); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleYTimeline *) self; + _self->setLinear(frame); } void spine_scale_y_timeline_set_stepped(spine_scale_y_timeline self, size_t frame) { - ((BoneTimeline1*)(ScaleYTimeline*)self)->setStepped(frame); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleYTimeline *) self; + _self->setStepped(frame); } -void spine_scale_y_timeline_set_bezier(spine_scale_y_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((BoneTimeline1*)(ScaleYTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_scale_y_timeline_set_bezier(spine_scale_y_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, + float cy1, float cx2, float cy2, float time2, float value2) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleYTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_scale_y_timeline_get_bezier_value(spine_scale_y_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((BoneTimeline1*)(ScaleYTimeline*)self)->getBezierValue(time, frame, valueOffset, i); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleYTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_scale_y_timeline_get_curves(spine_scale_y_timeline self) { - return (spine_array_float)&((BoneTimeline1*)(ScaleYTimeline*)self)->getCurves(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleYTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_scale_y_timeline_get_frame_entries(spine_scale_y_timeline self) { - return ((BoneTimeline1*)(ScaleYTimeline*)self)->getFrameEntries(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleYTimeline *) self; + return _self->getFrameEntries(); } size_t spine_scale_y_timeline_get_frame_count(spine_scale_y_timeline self) { - return ((BoneTimeline1*)(ScaleYTimeline*)self)->getFrameCount(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleYTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_scale_y_timeline_get_frames(spine_scale_y_timeline self) { - return (spine_array_float)&((BoneTimeline1*)(ScaleYTimeline*)self)->getFrames(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleYTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_scale_y_timeline_get_duration(spine_scale_y_timeline self) { - return ((BoneTimeline1*)(ScaleYTimeline*)self)->getDuration(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleYTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_scale_y_timeline_get_property_ids(spine_scale_y_timeline self) { - return (spine_array_property_id)&((BoneTimeline1*)(ScaleYTimeline*)self)->getPropertyIds(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleYTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_scale_y_timeline_get_bone_index(spine_scale_y_timeline self) { - return ((BoneTimeline1*)(ScaleYTimeline*)self)->getBoneIndex(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleYTimeline *) self; + return _self->getBoneIndex(); } void spine_scale_y_timeline_set_bone_index(spine_scale_y_timeline self, int inValue) { - ((BoneTimeline1*)(ScaleYTimeline*)self)->setBoneIndex(inValue); + BoneTimeline1 *_self = (BoneTimeline1 *) (ScaleYTimeline *) self; + _self->setBoneIndex(inValue); } spine_rtti spine_scale_y_timeline_rtti(void) { - return (spine_rtti)&ScaleYTimeline::rtti; + return (spine_rtti) &ScaleYTimeline::rtti; } diff --git a/spine-c/src/generated/scale_y_timeline.h b/spine-c/src/generated/scale_y_timeline.h index f75eba022..7c1c328fe 100644 --- a/spine-c/src/generated/scale_y_timeline.h +++ b/spine-c/src/generated/scale_y_timeline.h @@ -13,16 +13,23 @@ SPINE_C_API spine_scale_y_timeline spine_scale_y_timeline_create(size_t frameCou SPINE_C_API void spine_scale_y_timeline_dispose(spine_scale_y_timeline self); SPINE_C_API spine_rtti spine_scale_y_timeline_get_rtti(spine_scale_y_timeline self); -SPINE_C_API void spine_scale_y_timeline_apply(spine_scale_y_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_scale_y_timeline_apply(spine_scale_y_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); SPINE_C_API void spine_scale_y_timeline_set_frame(spine_scale_y_timeline self, size_t frame, float time, float value); SPINE_C_API float spine_scale_y_timeline_get_curve_value(spine_scale_y_timeline self, float time); -SPINE_C_API float spine_scale_y_timeline_get_relative_value(spine_scale_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_scale_y_timeline_get_absolute_value_1(spine_scale_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_scale_y_timeline_get_absolute_value_2(spine_scale_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_scale_y_timeline_get_scale_value(spine_scale_y_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_scale_y_timeline_get_relative_value(spine_scale_y_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup); +SPINE_C_API float spine_scale_y_timeline_get_absolute_value_1(spine_scale_y_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup); +SPINE_C_API float spine_scale_y_timeline_get_absolute_value_2(spine_scale_y_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup, float value); +SPINE_C_API float spine_scale_y_timeline_get_scale_value(spine_scale_y_timeline self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup); SPINE_C_API void spine_scale_y_timeline_set_linear(spine_scale_y_timeline self, size_t frame); SPINE_C_API void spine_scale_y_timeline_set_stepped(spine_scale_y_timeline self, size_t frame); -SPINE_C_API void spine_scale_y_timeline_set_bezier(spine_scale_y_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_scale_y_timeline_set_bezier(spine_scale_y_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_scale_y_timeline_get_bezier_value(spine_scale_y_timeline self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_scale_y_timeline_get_curves(spine_scale_y_timeline self); SPINE_C_API size_t spine_scale_y_timeline_get_frame_entries(spine_scale_y_timeline self); diff --git a/spine-c/src/generated/sequence.cpp b/spine-c/src/generated/sequence.cpp index 433250cdd..3a95df08a 100644 --- a/spine-c/src/generated/sequence.cpp +++ b/spine-c/src/generated/sequence.cpp @@ -4,57 +4,69 @@ using namespace spine; spine_sequence spine_sequence_create(int count) { - return (spine_sequence) new (__FILE__, __LINE__) Sequence(count); + return (spine_sequence) new (__FILE__, __LINE__) Sequence(count); } void spine_sequence_dispose(spine_sequence self) { - delete (Sequence*)self; + delete (Sequence *) self; } spine_sequence spine_sequence_copy(spine_sequence self) { - return (spine_sequence)((Sequence*)self)->copy(); + Sequence *_self = (Sequence *) self; + return (spine_sequence) _self->copy(); } void spine_sequence_apply(spine_sequence self, spine_slot_pose slot, spine_attachment attachment) { - ((Sequence*)self)->apply((SlotPose *)slot, (Attachment *)attachment); + Sequence *_self = (Sequence *) self; + _self->apply((SlotPose *) slot, (Attachment *) attachment); } -const char * spine_sequence_get_path(spine_sequence self, const char * basePath, int index) { - return (const char *)&((Sequence*)self)->getPath(String(basePath), index); +const char *spine_sequence_get_path(spine_sequence self, const char *basePath, int index) { + Sequence *_self = (Sequence *) self; + return (const char *) &_self->getPath(String(basePath), index); } int spine_sequence_get_id(spine_sequence self) { - return ((Sequence*)self)->getId(); + Sequence *_self = (Sequence *) self; + return _self->getId(); } void spine_sequence_set_id(spine_sequence self, int id) { - ((Sequence*)self)->setId(id); + Sequence *_self = (Sequence *) self; + _self->setId(id); } int spine_sequence_get_start(spine_sequence self) { - return ((Sequence*)self)->getStart(); + Sequence *_self = (Sequence *) self; + return _self->getStart(); } void spine_sequence_set_start(spine_sequence self, int start) { - ((Sequence*)self)->setStart(start); + Sequence *_self = (Sequence *) self; + _self->setStart(start); } int spine_sequence_get_digits(spine_sequence self) { - return ((Sequence*)self)->getDigits(); + Sequence *_self = (Sequence *) self; + return _self->getDigits(); } void spine_sequence_set_digits(spine_sequence self, int digits) { - ((Sequence*)self)->setDigits(digits); + Sequence *_self = (Sequence *) self; + _self->setDigits(digits); } int spine_sequence_get_setup_index(spine_sequence self) { - return ((Sequence*)self)->getSetupIndex(); + Sequence *_self = (Sequence *) self; + return _self->getSetupIndex(); } void spine_sequence_set_setup_index(spine_sequence self, int setupIndex) { - ((Sequence*)self)->setSetupIndex(setupIndex); + Sequence *_self = (Sequence *) self; + _self->setSetupIndex(setupIndex); } spine_array_texture_region spine_sequence_get_regions(spine_sequence self) { - return (spine_array_texture_region)&((Sequence*)self)->getRegions(); + Sequence *_self = (Sequence *) self; + return (spine_array_texture_region) &_self->getRegions(); } diff --git a/spine-c/src/generated/sequence.h b/spine-c/src/generated/sequence.h index 9095a5aea..615125fef 100644 --- a/spine-c/src/generated/sequence.h +++ b/spine-c/src/generated/sequence.h @@ -14,7 +14,7 @@ SPINE_C_API void spine_sequence_dispose(spine_sequence self); SPINE_C_API spine_sequence spine_sequence_copy(spine_sequence self); SPINE_C_API void spine_sequence_apply(spine_sequence self, spine_slot_pose slot, spine_attachment attachment); -SPINE_C_API const char * spine_sequence_get_path(spine_sequence self, const char * basePath, int index); +SPINE_C_API const char *spine_sequence_get_path(spine_sequence self, const char *basePath, int index); SPINE_C_API int spine_sequence_get_id(spine_sequence self); SPINE_C_API void spine_sequence_set_id(spine_sequence self, int id); SPINE_C_API int spine_sequence_get_start(spine_sequence self); diff --git a/spine-c/src/generated/sequence_mode.h b/spine-c/src/generated/sequence_mode.h index 4a40ac7fe..68f4db892 100644 --- a/spine-c/src/generated/sequence_mode.h +++ b/spine-c/src/generated/sequence_mode.h @@ -6,13 +6,13 @@ extern "C" { #endif typedef enum spine_sequence_mode { - SPINE_SEQUENCE_MODE_HOLD = 0, - SPINE_SEQUENCE_MODE_ONCE = 1, - SPINE_SEQUENCE_MODE_LOOP = 2, - SPINE_SEQUENCE_MODE_PINGPONG = 3, - SPINE_SEQUENCE_MODE_ONCE_REVERSE = 4, - SPINE_SEQUENCE_MODE_LOOP_REVERSE = 5, - SPINE_SEQUENCE_MODE_PINGPONG_REVERSE = 6 + SPINE_SEQUENCE_MODE_HOLD = 0, + SPINE_SEQUENCE_MODE_ONCE = 1, + SPINE_SEQUENCE_MODE_LOOP = 2, + SPINE_SEQUENCE_MODE_PINGPONG = 3, + SPINE_SEQUENCE_MODE_ONCE_REVERSE = 4, + SPINE_SEQUENCE_MODE_LOOP_REVERSE = 5, + SPINE_SEQUENCE_MODE_PINGPONG_REVERSE = 6 } spine_sequence_mode; #ifdef __cplusplus diff --git a/spine-c/src/generated/sequence_timeline.cpp b/spine-c/src/generated/sequence_timeline.cpp index 2b1a437ca..9d7e9a553 100644 --- a/spine-c/src/generated/sequence_timeline.cpp +++ b/spine-c/src/generated/sequence_timeline.cpp @@ -4,57 +4,70 @@ using namespace spine; spine_sequence_timeline spine_sequence_timeline_create(size_t frameCount, int slotIndex, spine_attachment attachment) { - return (spine_sequence_timeline) new (__FILE__, __LINE__) SequenceTimeline(frameCount, slotIndex, (Attachment *)attachment); + return (spine_sequence_timeline) new (__FILE__, __LINE__) SequenceTimeline(frameCount, slotIndex, (Attachment *) attachment); } void spine_sequence_timeline_dispose(spine_sequence_timeline self) { - delete (SequenceTimeline*)self; + delete (SequenceTimeline *) self; } spine_rtti spine_sequence_timeline_get_rtti(spine_sequence_timeline self) { - return (spine_rtti)&((SequenceTimeline*)self)->getRTTI(); + SequenceTimeline *_self = (SequenceTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_sequence_timeline_apply(spine_sequence_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((SequenceTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_sequence_timeline_apply(spine_sequence_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + SequenceTimeline *_self = (SequenceTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_sequence_timeline_set_frame(spine_sequence_timeline self, int frame, float time, spine_sequence_mode mode, int index, float delay) { - ((SequenceTimeline*)self)->setFrame(frame, time, (SequenceMode)mode, index, delay); + SequenceTimeline *_self = (SequenceTimeline *) self; + _self->setFrame(frame, time, (SequenceMode) mode, index, delay); } spine_attachment spine_sequence_timeline_get_attachment(spine_sequence_timeline self) { - return (spine_attachment)((SequenceTimeline*)self)->getAttachment(); + SequenceTimeline *_self = (SequenceTimeline *) self; + return (spine_attachment) _self->getAttachment(); } size_t spine_sequence_timeline_get_frame_entries(spine_sequence_timeline self) { - return ((Timeline*)(SequenceTimeline*)self)->getFrameEntries(); + Timeline *_self = (Timeline *) (SequenceTimeline *) self; + return _self->getFrameEntries(); } size_t spine_sequence_timeline_get_frame_count(spine_sequence_timeline self) { - return ((Timeline*)(SequenceTimeline*)self)->getFrameCount(); + Timeline *_self = (Timeline *) (SequenceTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_sequence_timeline_get_frames(spine_sequence_timeline self) { - return (spine_array_float)&((Timeline*)(SequenceTimeline*)self)->getFrames(); + Timeline *_self = (Timeline *) (SequenceTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_sequence_timeline_get_duration(spine_sequence_timeline self) { - return ((Timeline*)(SequenceTimeline*)self)->getDuration(); + Timeline *_self = (Timeline *) (SequenceTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_sequence_timeline_get_property_ids(spine_sequence_timeline self) { - return (spine_array_property_id)&((Timeline*)(SequenceTimeline*)self)->getPropertyIds(); + Timeline *_self = (Timeline *) (SequenceTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_sequence_timeline_get_slot_index(spine_sequence_timeline self) { - return ((SlotTimeline*)(SequenceTimeline*)self)->getSlotIndex(); + SlotTimeline *_self = (SlotTimeline *) (SequenceTimeline *) self; + return _self->getSlotIndex(); } void spine_sequence_timeline_set_slot_index(spine_sequence_timeline self, int inValue) { - ((SlotTimeline*)(SequenceTimeline*)self)->setSlotIndex(inValue); + SlotTimeline *_self = (SlotTimeline *) (SequenceTimeline *) self; + _self->setSlotIndex(inValue); } spine_rtti spine_sequence_timeline_rtti(void) { - return (spine_rtti)&SequenceTimeline::rtti; + return (spine_rtti) &SequenceTimeline::rtti; } diff --git a/spine-c/src/generated/sequence_timeline.h b/spine-c/src/generated/sequence_timeline.h index b32419d45..93705ca0d 100644 --- a/spine-c/src/generated/sequence_timeline.h +++ b/spine-c/src/generated/sequence_timeline.h @@ -13,8 +13,11 @@ SPINE_C_API spine_sequence_timeline spine_sequence_timeline_create(size_t frameC SPINE_C_API void spine_sequence_timeline_dispose(spine_sequence_timeline self); SPINE_C_API spine_rtti spine_sequence_timeline_get_rtti(spine_sequence_timeline self); -SPINE_C_API void spine_sequence_timeline_apply(spine_sequence_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); -SPINE_C_API void spine_sequence_timeline_set_frame(spine_sequence_timeline self, int frame, float time, spine_sequence_mode mode, int index, float delay); +SPINE_C_API void spine_sequence_timeline_apply(spine_sequence_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); +SPINE_C_API void spine_sequence_timeline_set_frame(spine_sequence_timeline self, int frame, float time, spine_sequence_mode mode, int index, + float delay); SPINE_C_API spine_attachment spine_sequence_timeline_get_attachment(spine_sequence_timeline self); SPINE_C_API size_t spine_sequence_timeline_get_frame_entries(spine_sequence_timeline self); SPINE_C_API size_t spine_sequence_timeline_get_frame_count(spine_sequence_timeline self); diff --git a/spine-c/src/generated/shear_timeline.cpp b/spine-c/src/generated/shear_timeline.cpp index 9fdd1704d..13f53f0fb 100644 --- a/spine-c/src/generated/shear_timeline.cpp +++ b/spine-c/src/generated/shear_timeline.cpp @@ -4,77 +4,96 @@ using namespace spine; spine_shear_timeline spine_shear_timeline_create(size_t frameCount, size_t bezierCount, int boneIndex) { - return (spine_shear_timeline) new (__FILE__, __LINE__) ShearTimeline(frameCount, bezierCount, boneIndex); + return (spine_shear_timeline) new (__FILE__, __LINE__) ShearTimeline(frameCount, bezierCount, boneIndex); } void spine_shear_timeline_dispose(spine_shear_timeline self) { - delete (ShearTimeline*)self; + delete (ShearTimeline *) self; } spine_rtti spine_shear_timeline_get_rtti(spine_shear_timeline self) { - return (spine_rtti)&((ShearTimeline*)self)->getRTTI(); + ShearTimeline *_self = (ShearTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_shear_timeline_apply(spine_shear_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((BoneTimeline2*)(ShearTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_shear_timeline_apply(spine_shear_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + BoneTimeline2 *_self = (BoneTimeline2 *) (ShearTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_shear_timeline_set_frame(spine_shear_timeline self, size_t frame, float time, float value1, float value2) { - ((BoneTimeline2*)(ShearTimeline*)self)->setFrame(frame, time, value1, value2); + BoneTimeline2 *_self = (BoneTimeline2 *) (ShearTimeline *) self; + _self->setFrame(frame, time, value1, value2); } float spine_shear_timeline_get_curve_value(spine_shear_timeline self, float time) { - return ((BoneTimeline2*)(ShearTimeline*)self)->getCurveValue(time); + BoneTimeline2 *_self = (BoneTimeline2 *) (ShearTimeline *) self; + return _self->getCurveValue(time); } void spine_shear_timeline_set_linear(spine_shear_timeline self, size_t frame) { - ((BoneTimeline2*)(ShearTimeline*)self)->setLinear(frame); + BoneTimeline2 *_self = (BoneTimeline2 *) (ShearTimeline *) self; + _self->setLinear(frame); } void spine_shear_timeline_set_stepped(spine_shear_timeline self, size_t frame) { - ((BoneTimeline2*)(ShearTimeline*)self)->setStepped(frame); + BoneTimeline2 *_self = (BoneTimeline2 *) (ShearTimeline *) self; + _self->setStepped(frame); } -void spine_shear_timeline_set_bezier(spine_shear_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((BoneTimeline2*)(ShearTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_shear_timeline_set_bezier(spine_shear_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, + float cy1, float cx2, float cy2, float time2, float value2) { + BoneTimeline2 *_self = (BoneTimeline2 *) (ShearTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_shear_timeline_get_bezier_value(spine_shear_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((BoneTimeline2*)(ShearTimeline*)self)->getBezierValue(time, frame, valueOffset, i); + BoneTimeline2 *_self = (BoneTimeline2 *) (ShearTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_shear_timeline_get_curves(spine_shear_timeline self) { - return (spine_array_float)&((BoneTimeline2*)(ShearTimeline*)self)->getCurves(); + BoneTimeline2 *_self = (BoneTimeline2 *) (ShearTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_shear_timeline_get_frame_entries(spine_shear_timeline self) { - return ((BoneTimeline2*)(ShearTimeline*)self)->getFrameEntries(); + BoneTimeline2 *_self = (BoneTimeline2 *) (ShearTimeline *) self; + return _self->getFrameEntries(); } size_t spine_shear_timeline_get_frame_count(spine_shear_timeline self) { - return ((BoneTimeline2*)(ShearTimeline*)self)->getFrameCount(); + BoneTimeline2 *_self = (BoneTimeline2 *) (ShearTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_shear_timeline_get_frames(spine_shear_timeline self) { - return (spine_array_float)&((BoneTimeline2*)(ShearTimeline*)self)->getFrames(); + BoneTimeline2 *_self = (BoneTimeline2 *) (ShearTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_shear_timeline_get_duration(spine_shear_timeline self) { - return ((BoneTimeline2*)(ShearTimeline*)self)->getDuration(); + BoneTimeline2 *_self = (BoneTimeline2 *) (ShearTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_shear_timeline_get_property_ids(spine_shear_timeline self) { - return (spine_array_property_id)&((BoneTimeline2*)(ShearTimeline*)self)->getPropertyIds(); + BoneTimeline2 *_self = (BoneTimeline2 *) (ShearTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_shear_timeline_get_bone_index(spine_shear_timeline self) { - return ((BoneTimeline2*)(ShearTimeline*)self)->getBoneIndex(); + BoneTimeline2 *_self = (BoneTimeline2 *) (ShearTimeline *) self; + return _self->getBoneIndex(); } void spine_shear_timeline_set_bone_index(spine_shear_timeline self, int inValue) { - ((BoneTimeline2*)(ShearTimeline*)self)->setBoneIndex(inValue); + BoneTimeline2 *_self = (BoneTimeline2 *) (ShearTimeline *) self; + _self->setBoneIndex(inValue); } spine_rtti spine_shear_timeline_rtti(void) { - return (spine_rtti)&ShearTimeline::rtti; + return (spine_rtti) &ShearTimeline::rtti; } diff --git a/spine-c/src/generated/shear_timeline.h b/spine-c/src/generated/shear_timeline.h index f6f05683c..ad493ac25 100644 --- a/spine-c/src/generated/shear_timeline.h +++ b/spine-c/src/generated/shear_timeline.h @@ -13,12 +13,14 @@ SPINE_C_API spine_shear_timeline spine_shear_timeline_create(size_t frameCount, SPINE_C_API void spine_shear_timeline_dispose(spine_shear_timeline self); SPINE_C_API spine_rtti spine_shear_timeline_get_rtti(spine_shear_timeline self); -SPINE_C_API void spine_shear_timeline_apply(spine_shear_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_shear_timeline_apply(spine_shear_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); SPINE_C_API void spine_shear_timeline_set_frame(spine_shear_timeline self, size_t frame, float time, float value1, float value2); SPINE_C_API float spine_shear_timeline_get_curve_value(spine_shear_timeline self, float time); SPINE_C_API void spine_shear_timeline_set_linear(spine_shear_timeline self, size_t frame); SPINE_C_API void spine_shear_timeline_set_stepped(spine_shear_timeline self, size_t frame); -SPINE_C_API void spine_shear_timeline_set_bezier(spine_shear_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_shear_timeline_set_bezier(spine_shear_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_shear_timeline_get_bezier_value(spine_shear_timeline self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_shear_timeline_get_curves(spine_shear_timeline self); SPINE_C_API size_t spine_shear_timeline_get_frame_entries(spine_shear_timeline self); diff --git a/spine-c/src/generated/shear_x_timeline.cpp b/spine-c/src/generated/shear_x_timeline.cpp index 2f4ccce5e..04be77c3f 100644 --- a/spine-c/src/generated/shear_x_timeline.cpp +++ b/spine-c/src/generated/shear_x_timeline.cpp @@ -4,93 +4,120 @@ using namespace spine; spine_shear_x_timeline spine_shear_x_timeline_create(size_t frameCount, size_t bezierCount, int boneIndex) { - return (spine_shear_x_timeline) new (__FILE__, __LINE__) ShearXTimeline(frameCount, bezierCount, boneIndex); + return (spine_shear_x_timeline) new (__FILE__, __LINE__) ShearXTimeline(frameCount, bezierCount, boneIndex); } void spine_shear_x_timeline_dispose(spine_shear_x_timeline self) { - delete (ShearXTimeline*)self; + delete (ShearXTimeline *) self; } spine_rtti spine_shear_x_timeline_get_rtti(spine_shear_x_timeline self) { - return (spine_rtti)&((ShearXTimeline*)self)->getRTTI(); + ShearXTimeline *_self = (ShearXTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_shear_x_timeline_apply(spine_shear_x_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((BoneTimeline1*)(ShearXTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_shear_x_timeline_apply(spine_shear_x_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearXTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_shear_x_timeline_set_frame(spine_shear_x_timeline self, size_t frame, float time, float value) { - ((BoneTimeline1*)(ShearXTimeline*)self)->setFrame(frame, time, value); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearXTimeline *) self; + _self->setFrame(frame, time, value); } float spine_shear_x_timeline_get_curve_value(spine_shear_x_timeline self, float time) { - return ((BoneTimeline1*)(ShearXTimeline*)self)->getCurveValue(time); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearXTimeline *) self; + return _self->getCurveValue(time); } -float spine_shear_x_timeline_get_relative_value(spine_shear_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((BoneTimeline1*)(ShearXTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_shear_x_timeline_get_relative_value(spine_shear_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearXTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_shear_x_timeline_get_absolute_value_1(spine_shear_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((BoneTimeline1*)(ShearXTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_shear_x_timeline_get_absolute_value_1(spine_shear_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearXTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_shear_x_timeline_get_absolute_value_2(spine_shear_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((BoneTimeline1*)(ShearXTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_shear_x_timeline_get_absolute_value_2(spine_shear_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup, float value) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearXTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_shear_x_timeline_get_scale_value(spine_shear_x_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((BoneTimeline1*)(ShearXTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_shear_x_timeline_get_scale_value(spine_shear_x_timeline self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearXTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_shear_x_timeline_set_linear(spine_shear_x_timeline self, size_t frame) { - ((BoneTimeline1*)(ShearXTimeline*)self)->setLinear(frame); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearXTimeline *) self; + _self->setLinear(frame); } void spine_shear_x_timeline_set_stepped(spine_shear_x_timeline self, size_t frame) { - ((BoneTimeline1*)(ShearXTimeline*)self)->setStepped(frame); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearXTimeline *) self; + _self->setStepped(frame); } -void spine_shear_x_timeline_set_bezier(spine_shear_x_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((BoneTimeline1*)(ShearXTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_shear_x_timeline_set_bezier(spine_shear_x_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, + float cy1, float cx2, float cy2, float time2, float value2) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearXTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_shear_x_timeline_get_bezier_value(spine_shear_x_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((BoneTimeline1*)(ShearXTimeline*)self)->getBezierValue(time, frame, valueOffset, i); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearXTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_shear_x_timeline_get_curves(spine_shear_x_timeline self) { - return (spine_array_float)&((BoneTimeline1*)(ShearXTimeline*)self)->getCurves(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearXTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_shear_x_timeline_get_frame_entries(spine_shear_x_timeline self) { - return ((BoneTimeline1*)(ShearXTimeline*)self)->getFrameEntries(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearXTimeline *) self; + return _self->getFrameEntries(); } size_t spine_shear_x_timeline_get_frame_count(spine_shear_x_timeline self) { - return ((BoneTimeline1*)(ShearXTimeline*)self)->getFrameCount(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearXTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_shear_x_timeline_get_frames(spine_shear_x_timeline self) { - return (spine_array_float)&((BoneTimeline1*)(ShearXTimeline*)self)->getFrames(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearXTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_shear_x_timeline_get_duration(spine_shear_x_timeline self) { - return ((BoneTimeline1*)(ShearXTimeline*)self)->getDuration(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearXTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_shear_x_timeline_get_property_ids(spine_shear_x_timeline self) { - return (spine_array_property_id)&((BoneTimeline1*)(ShearXTimeline*)self)->getPropertyIds(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearXTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_shear_x_timeline_get_bone_index(spine_shear_x_timeline self) { - return ((BoneTimeline1*)(ShearXTimeline*)self)->getBoneIndex(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearXTimeline *) self; + return _self->getBoneIndex(); } void spine_shear_x_timeline_set_bone_index(spine_shear_x_timeline self, int inValue) { - ((BoneTimeline1*)(ShearXTimeline*)self)->setBoneIndex(inValue); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearXTimeline *) self; + _self->setBoneIndex(inValue); } spine_rtti spine_shear_x_timeline_rtti(void) { - return (spine_rtti)&ShearXTimeline::rtti; + return (spine_rtti) &ShearXTimeline::rtti; } diff --git a/spine-c/src/generated/shear_x_timeline.h b/spine-c/src/generated/shear_x_timeline.h index bb8c81d18..9fb958bcf 100644 --- a/spine-c/src/generated/shear_x_timeline.h +++ b/spine-c/src/generated/shear_x_timeline.h @@ -13,16 +13,23 @@ SPINE_C_API spine_shear_x_timeline spine_shear_x_timeline_create(size_t frameCou SPINE_C_API void spine_shear_x_timeline_dispose(spine_shear_x_timeline self); SPINE_C_API spine_rtti spine_shear_x_timeline_get_rtti(spine_shear_x_timeline self); -SPINE_C_API void spine_shear_x_timeline_apply(spine_shear_x_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_shear_x_timeline_apply(spine_shear_x_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); SPINE_C_API void spine_shear_x_timeline_set_frame(spine_shear_x_timeline self, size_t frame, float time, float value); SPINE_C_API float spine_shear_x_timeline_get_curve_value(spine_shear_x_timeline self, float time); -SPINE_C_API float spine_shear_x_timeline_get_relative_value(spine_shear_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_shear_x_timeline_get_absolute_value_1(spine_shear_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_shear_x_timeline_get_absolute_value_2(spine_shear_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_shear_x_timeline_get_scale_value(spine_shear_x_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_shear_x_timeline_get_relative_value(spine_shear_x_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup); +SPINE_C_API float spine_shear_x_timeline_get_absolute_value_1(spine_shear_x_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup); +SPINE_C_API float spine_shear_x_timeline_get_absolute_value_2(spine_shear_x_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup, float value); +SPINE_C_API float spine_shear_x_timeline_get_scale_value(spine_shear_x_timeline self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup); SPINE_C_API void spine_shear_x_timeline_set_linear(spine_shear_x_timeline self, size_t frame); SPINE_C_API void spine_shear_x_timeline_set_stepped(spine_shear_x_timeline self, size_t frame); -SPINE_C_API void spine_shear_x_timeline_set_bezier(spine_shear_x_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_shear_x_timeline_set_bezier(spine_shear_x_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_shear_x_timeline_get_bezier_value(spine_shear_x_timeline self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_shear_x_timeline_get_curves(spine_shear_x_timeline self); SPINE_C_API size_t spine_shear_x_timeline_get_frame_entries(spine_shear_x_timeline self); diff --git a/spine-c/src/generated/shear_y_timeline.cpp b/spine-c/src/generated/shear_y_timeline.cpp index 6d590a2f0..054702a67 100644 --- a/spine-c/src/generated/shear_y_timeline.cpp +++ b/spine-c/src/generated/shear_y_timeline.cpp @@ -4,93 +4,120 @@ using namespace spine; spine_shear_y_timeline spine_shear_y_timeline_create(size_t frameCount, size_t bezierCount, int boneIndex) { - return (spine_shear_y_timeline) new (__FILE__, __LINE__) ShearYTimeline(frameCount, bezierCount, boneIndex); + return (spine_shear_y_timeline) new (__FILE__, __LINE__) ShearYTimeline(frameCount, bezierCount, boneIndex); } void spine_shear_y_timeline_dispose(spine_shear_y_timeline self) { - delete (ShearYTimeline*)self; + delete (ShearYTimeline *) self; } spine_rtti spine_shear_y_timeline_get_rtti(spine_shear_y_timeline self) { - return (spine_rtti)&((ShearYTimeline*)self)->getRTTI(); + ShearYTimeline *_self = (ShearYTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_shear_y_timeline_apply(spine_shear_y_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((BoneTimeline1*)(ShearYTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_shear_y_timeline_apply(spine_shear_y_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearYTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_shear_y_timeline_set_frame(spine_shear_y_timeline self, size_t frame, float time, float value) { - ((BoneTimeline1*)(ShearYTimeline*)self)->setFrame(frame, time, value); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearYTimeline *) self; + _self->setFrame(frame, time, value); } float spine_shear_y_timeline_get_curve_value(spine_shear_y_timeline self, float time) { - return ((BoneTimeline1*)(ShearYTimeline*)self)->getCurveValue(time); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearYTimeline *) self; + return _self->getCurveValue(time); } -float spine_shear_y_timeline_get_relative_value(spine_shear_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((BoneTimeline1*)(ShearYTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_shear_y_timeline_get_relative_value(spine_shear_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearYTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_shear_y_timeline_get_absolute_value_1(spine_shear_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((BoneTimeline1*)(ShearYTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_shear_y_timeline_get_absolute_value_1(spine_shear_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearYTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_shear_y_timeline_get_absolute_value_2(spine_shear_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((BoneTimeline1*)(ShearYTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_shear_y_timeline_get_absolute_value_2(spine_shear_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup, float value) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearYTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_shear_y_timeline_get_scale_value(spine_shear_y_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((BoneTimeline1*)(ShearYTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_shear_y_timeline_get_scale_value(spine_shear_y_timeline self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearYTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_shear_y_timeline_set_linear(spine_shear_y_timeline self, size_t frame) { - ((BoneTimeline1*)(ShearYTimeline*)self)->setLinear(frame); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearYTimeline *) self; + _self->setLinear(frame); } void spine_shear_y_timeline_set_stepped(spine_shear_y_timeline self, size_t frame) { - ((BoneTimeline1*)(ShearYTimeline*)self)->setStepped(frame); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearYTimeline *) self; + _self->setStepped(frame); } -void spine_shear_y_timeline_set_bezier(spine_shear_y_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((BoneTimeline1*)(ShearYTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_shear_y_timeline_set_bezier(spine_shear_y_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, + float cy1, float cx2, float cy2, float time2, float value2) { + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearYTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_shear_y_timeline_get_bezier_value(spine_shear_y_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((BoneTimeline1*)(ShearYTimeline*)self)->getBezierValue(time, frame, valueOffset, i); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearYTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_shear_y_timeline_get_curves(spine_shear_y_timeline self) { - return (spine_array_float)&((BoneTimeline1*)(ShearYTimeline*)self)->getCurves(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearYTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_shear_y_timeline_get_frame_entries(spine_shear_y_timeline self) { - return ((BoneTimeline1*)(ShearYTimeline*)self)->getFrameEntries(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearYTimeline *) self; + return _self->getFrameEntries(); } size_t spine_shear_y_timeline_get_frame_count(spine_shear_y_timeline self) { - return ((BoneTimeline1*)(ShearYTimeline*)self)->getFrameCount(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearYTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_shear_y_timeline_get_frames(spine_shear_y_timeline self) { - return (spine_array_float)&((BoneTimeline1*)(ShearYTimeline*)self)->getFrames(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearYTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_shear_y_timeline_get_duration(spine_shear_y_timeline self) { - return ((BoneTimeline1*)(ShearYTimeline*)self)->getDuration(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearYTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_shear_y_timeline_get_property_ids(spine_shear_y_timeline self) { - return (spine_array_property_id)&((BoneTimeline1*)(ShearYTimeline*)self)->getPropertyIds(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearYTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_shear_y_timeline_get_bone_index(spine_shear_y_timeline self) { - return ((BoneTimeline1*)(ShearYTimeline*)self)->getBoneIndex(); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearYTimeline *) self; + return _self->getBoneIndex(); } void spine_shear_y_timeline_set_bone_index(spine_shear_y_timeline self, int inValue) { - ((BoneTimeline1*)(ShearYTimeline*)self)->setBoneIndex(inValue); + BoneTimeline1 *_self = (BoneTimeline1 *) (ShearYTimeline *) self; + _self->setBoneIndex(inValue); } spine_rtti spine_shear_y_timeline_rtti(void) { - return (spine_rtti)&ShearYTimeline::rtti; + return (spine_rtti) &ShearYTimeline::rtti; } diff --git a/spine-c/src/generated/shear_y_timeline.h b/spine-c/src/generated/shear_y_timeline.h index 12355b8e9..b1cc5bad2 100644 --- a/spine-c/src/generated/shear_y_timeline.h +++ b/spine-c/src/generated/shear_y_timeline.h @@ -13,16 +13,23 @@ SPINE_C_API spine_shear_y_timeline spine_shear_y_timeline_create(size_t frameCou SPINE_C_API void spine_shear_y_timeline_dispose(spine_shear_y_timeline self); SPINE_C_API spine_rtti spine_shear_y_timeline_get_rtti(spine_shear_y_timeline self); -SPINE_C_API void spine_shear_y_timeline_apply(spine_shear_y_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_shear_y_timeline_apply(spine_shear_y_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); SPINE_C_API void spine_shear_y_timeline_set_frame(spine_shear_y_timeline self, size_t frame, float time, float value); SPINE_C_API float spine_shear_y_timeline_get_curve_value(spine_shear_y_timeline self, float time); -SPINE_C_API float spine_shear_y_timeline_get_relative_value(spine_shear_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_shear_y_timeline_get_absolute_value_1(spine_shear_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_shear_y_timeline_get_absolute_value_2(spine_shear_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_shear_y_timeline_get_scale_value(spine_shear_y_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_shear_y_timeline_get_relative_value(spine_shear_y_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup); +SPINE_C_API float spine_shear_y_timeline_get_absolute_value_1(spine_shear_y_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup); +SPINE_C_API float spine_shear_y_timeline_get_absolute_value_2(spine_shear_y_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup, float value); +SPINE_C_API float spine_shear_y_timeline_get_scale_value(spine_shear_y_timeline self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup); SPINE_C_API void spine_shear_y_timeline_set_linear(spine_shear_y_timeline self, size_t frame); SPINE_C_API void spine_shear_y_timeline_set_stepped(spine_shear_y_timeline self, size_t frame); -SPINE_C_API void spine_shear_y_timeline_set_bezier(spine_shear_y_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_shear_y_timeline_set_bezier(spine_shear_y_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_shear_y_timeline_get_bezier_value(spine_shear_y_timeline self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_shear_y_timeline_get_curves(spine_shear_y_timeline self); SPINE_C_API size_t spine_shear_y_timeline_get_frame_entries(spine_shear_y_timeline self); diff --git a/spine-c/src/generated/skeleton.cpp b/spine-c/src/generated/skeleton.cpp index a92947a3c..8e63bc386 100644 --- a/spine-c/src/generated/skeleton.cpp +++ b/spine-c/src/generated/skeleton.cpp @@ -4,225 +4,280 @@ using namespace spine; spine_skeleton spine_skeleton_create(spine_skeleton_data skeletonData) { - return (spine_skeleton) new (__FILE__, __LINE__) Skeleton(*((SkeletonData*)skeletonData)); + return (spine_skeleton) new (__FILE__, __LINE__) Skeleton(*((SkeletonData *) skeletonData)); } void spine_skeleton_dispose(spine_skeleton self) { - delete (Skeleton*)self; + delete (Skeleton *) self; } void spine_skeleton_update_cache(spine_skeleton self) { - ((Skeleton*)self)->updateCache(); + Skeleton *_self = (Skeleton *) self; + _self->updateCache(); } void spine_skeleton_print_update_cache(spine_skeleton self) { - ((Skeleton*)self)->printUpdateCache(); + Skeleton *_self = (Skeleton *) self; + _self->printUpdateCache(); } void spine_skeleton_constrained(spine_skeleton self, spine_posed object) { - ((Skeleton*)self)->constrained(*((Posed*)object)); + Skeleton *_self = (Skeleton *) self; + _self->constrained(*((Posed *) object)); } void spine_skeleton_sort_bone(spine_skeleton self, spine_bone bone) { - ((Skeleton*)self)->sortBone((Bone *)bone); + Skeleton *_self = (Skeleton *) self; + _self->sortBone((Bone *) bone); } void spine_skeleton_sort_reset(spine_array_bone bones) { - Skeleton::sortReset(*((Array*)bones)); + Skeleton::sortReset(*((Array *) bones)); } void spine_skeleton_update_world_transform_1(spine_skeleton self, spine_physics physics) { - ((Skeleton*)self)->updateWorldTransform((Physics)physics); + Skeleton *_self = (Skeleton *) self; + _self->updateWorldTransform((Physics) physics); } void spine_skeleton_update_world_transform_2(spine_skeleton self, spine_physics physics, spine_bone_pose parent) { - ((Skeleton*)self)->updateWorldTransform((Physics)physics, (BonePose *)parent); + Skeleton *_self = (Skeleton *) self; + _self->updateWorldTransform((Physics) physics, (BonePose *) parent); } void spine_skeleton_setup_pose(spine_skeleton self) { - ((Skeleton*)self)->setupPose(); + Skeleton *_self = (Skeleton *) self; + _self->setupPose(); } void spine_skeleton_setup_pose_bones(spine_skeleton self) { - ((Skeleton*)self)->setupPoseBones(); + Skeleton *_self = (Skeleton *) self; + _self->setupPoseBones(); } void spine_skeleton_setup_pose_slots(spine_skeleton self) { - ((Skeleton*)self)->setupPoseSlots(); + Skeleton *_self = (Skeleton *) self; + _self->setupPoseSlots(); } spine_skeleton_data spine_skeleton_get_data(spine_skeleton self) { - return (spine_skeleton_data)((Skeleton*)self)->getData(); + Skeleton *_self = (Skeleton *) self; + return (spine_skeleton_data) _self->getData(); } spine_array_bone spine_skeleton_get_bones(spine_skeleton self) { - return (spine_array_bone)&((Skeleton*)self)->getBones(); + Skeleton *_self = (Skeleton *) self; + return (spine_array_bone) &_self->getBones(); } spine_array_update spine_skeleton_get_update_cache(spine_skeleton self) { - return (spine_array_update)&((Skeleton*)self)->getUpdateCache(); + Skeleton *_self = (Skeleton *) self; + return (spine_array_update) &_self->getUpdateCache(); } spine_bone spine_skeleton_get_root_bone(spine_skeleton self) { - return (spine_bone)((Skeleton*)self)->getRootBone(); + Skeleton *_self = (Skeleton *) self; + return (spine_bone) _self->getRootBone(); } -spine_bone spine_skeleton_find_bone(spine_skeleton self, const char * boneName) { - return (spine_bone)((Skeleton*)self)->findBone(String(boneName)); +spine_bone spine_skeleton_find_bone(spine_skeleton self, const char *boneName) { + Skeleton *_self = (Skeleton *) self; + return (spine_bone) _self->findBone(String(boneName)); } spine_array_slot spine_skeleton_get_slots(spine_skeleton self) { - return (spine_array_slot)&((Skeleton*)self)->getSlots(); + Skeleton *_self = (Skeleton *) self; + return (spine_array_slot) &_self->getSlots(); } -spine_slot spine_skeleton_find_slot(spine_skeleton self, const char * slotName) { - return (spine_slot)((Skeleton*)self)->findSlot(String(slotName)); +spine_slot spine_skeleton_find_slot(spine_skeleton self, const char *slotName) { + Skeleton *_self = (Skeleton *) self; + return (spine_slot) _self->findSlot(String(slotName)); } spine_array_slot spine_skeleton_get_draw_order(spine_skeleton self) { - return (spine_array_slot)&((Skeleton*)self)->getDrawOrder(); + Skeleton *_self = (Skeleton *) self; + return (spine_array_slot) &_self->getDrawOrder(); } spine_skin spine_skeleton_get_skin(spine_skeleton self) { - return (spine_skin)((Skeleton*)self)->getSkin(); + Skeleton *_self = (Skeleton *) self; + return (spine_skin) _self->getSkin(); } -void spine_skeleton_set_skin_1(spine_skeleton self, const char * skinName) { - ((Skeleton*)self)->setSkin(String(skinName)); +void spine_skeleton_set_skin_1(spine_skeleton self, const char *skinName) { + Skeleton *_self = (Skeleton *) self; + _self->setSkin(String(skinName)); } void spine_skeleton_set_skin_2(spine_skeleton self, spine_skin newSkin) { - ((Skeleton*)self)->setSkin((Skin *)newSkin); + Skeleton *_self = (Skeleton *) self; + _self->setSkin((Skin *) newSkin); } -spine_attachment spine_skeleton_get_attachment_1(spine_skeleton self, const char * slotName, const char * attachmentName) { - return (spine_attachment)((Skeleton*)self)->getAttachment(String(slotName), String(attachmentName)); +spine_attachment spine_skeleton_get_attachment_1(spine_skeleton self, const char *slotName, const char *attachmentName) { + Skeleton *_self = (Skeleton *) self; + return (spine_attachment) _self->getAttachment(String(slotName), String(attachmentName)); } -spine_attachment spine_skeleton_get_attachment_2(spine_skeleton self, int slotIndex, const char * attachmentName) { - return (spine_attachment)((Skeleton*)self)->getAttachment(slotIndex, String(attachmentName)); +spine_attachment spine_skeleton_get_attachment_2(spine_skeleton self, int slotIndex, const char *attachmentName) { + Skeleton *_self = (Skeleton *) self; + return (spine_attachment) _self->getAttachment(slotIndex, String(attachmentName)); } -void spine_skeleton_set_attachment(spine_skeleton self, const char * slotName, const char * attachmentName) { - ((Skeleton*)self)->setAttachment(String(slotName), String(attachmentName)); +void spine_skeleton_set_attachment(spine_skeleton self, const char *slotName, const char *attachmentName) { + Skeleton *_self = (Skeleton *) self; + _self->setAttachment(String(slotName), String(attachmentName)); } spine_array_constraint spine_skeleton_get_constraints(spine_skeleton self) { - return (spine_array_constraint)&((Skeleton*)self)->getConstraints(); + Skeleton *_self = (Skeleton *) self; + return (spine_array_constraint) &_self->getConstraints(); } spine_array_physics_constraint spine_skeleton_get_physics_constraints(spine_skeleton self) { - return (spine_array_physics_constraint)&((Skeleton*)self)->getPhysicsConstraints(); + Skeleton *_self = (Skeleton *) self; + return (spine_array_physics_constraint) &_self->getPhysicsConstraints(); } -void spine_skeleton_get_bounds_1(spine_skeleton self, float * outX, float * outY, float * outWidth, float * outHeight, spine_array_float outVertexBuffer) { - ((Skeleton*)self)->getBounds(*outX, *outY, *outWidth, *outHeight, *((Array*)outVertexBuffer)); +void spine_skeleton_get_bounds_1(spine_skeleton self, float *outX, float *outY, float *outWidth, float *outHeight, + spine_array_float outVertexBuffer) { + Skeleton *_self = (Skeleton *) self; + _self->getBounds(*outX, *outY, *outWidth, *outHeight, *((Array *) outVertexBuffer)); } -void spine_skeleton_get_bounds_2(spine_skeleton self, float * outX, float * outY, float * outWidth, float * outHeight, spine_array_float outVertexBuffer, spine_skeleton_clipping clipper) { - ((Skeleton*)self)->getBounds(*outX, *outY, *outWidth, *outHeight, *((Array*)outVertexBuffer), (SkeletonClipping *)clipper); +void spine_skeleton_get_bounds_2(spine_skeleton self, float *outX, float *outY, float *outWidth, float *outHeight, spine_array_float outVertexBuffer, + spine_skeleton_clipping clipper) { + Skeleton *_self = (Skeleton *) self; + _self->getBounds(*outX, *outY, *outWidth, *outHeight, *((Array *) outVertexBuffer), (SkeletonClipping *) clipper); } spine_color spine_skeleton_get_color(spine_skeleton self) { - return (spine_color)&((Skeleton*)self)->getColor(); + Skeleton *_self = (Skeleton *) self; + return (spine_color) &_self->getColor(); } void spine_skeleton_set_color_1(spine_skeleton self, spine_color color) { - ((Skeleton*)self)->setColor(*((Color*)color)); + Skeleton *_self = (Skeleton *) self; + _self->setColor(*((Color *) color)); } void spine_skeleton_set_color_2(spine_skeleton self, float r, float g, float b, float a) { - ((Skeleton*)self)->setColor(r, g, b, a); + Skeleton *_self = (Skeleton *) self; + _self->setColor(r, g, b, a); } float spine_skeleton_get_scale_x(spine_skeleton self) { - return ((Skeleton*)self)->getScaleX(); + Skeleton *_self = (Skeleton *) self; + return _self->getScaleX(); } void spine_skeleton_set_scale_x(spine_skeleton self, float inValue) { - ((Skeleton*)self)->setScaleX(inValue); + Skeleton *_self = (Skeleton *) self; + _self->setScaleX(inValue); } float spine_skeleton_get_scale_y(spine_skeleton self) { - return ((Skeleton*)self)->getScaleY(); + Skeleton *_self = (Skeleton *) self; + return _self->getScaleY(); } void spine_skeleton_set_scale_y(spine_skeleton self, float inValue) { - ((Skeleton*)self)->setScaleY(inValue); + Skeleton *_self = (Skeleton *) self; + _self->setScaleY(inValue); } void spine_skeleton_set_scale(spine_skeleton self, float scaleX, float scaleY) { - ((Skeleton*)self)->setScale(scaleX, scaleY); + Skeleton *_self = (Skeleton *) self; + _self->setScale(scaleX, scaleY); } float spine_skeleton_get_x(spine_skeleton self) { - return ((Skeleton*)self)->getX(); + Skeleton *_self = (Skeleton *) self; + return _self->getX(); } void spine_skeleton_set_x(spine_skeleton self, float inValue) { - ((Skeleton*)self)->setX(inValue); + Skeleton *_self = (Skeleton *) self; + _self->setX(inValue); } float spine_skeleton_get_y(spine_skeleton self) { - return ((Skeleton*)self)->getY(); + Skeleton *_self = (Skeleton *) self; + return _self->getY(); } void spine_skeleton_set_y(spine_skeleton self, float inValue) { - ((Skeleton*)self)->setY(inValue); + Skeleton *_self = (Skeleton *) self; + _self->setY(inValue); } void spine_skeleton_set_position(spine_skeleton self, float x, float y) { - ((Skeleton*)self)->setPosition(x, y); + Skeleton *_self = (Skeleton *) self; + _self->setPosition(x, y); } float spine_skeleton_get_wind_x(spine_skeleton self) { - return ((Skeleton*)self)->getWindX(); + Skeleton *_self = (Skeleton *) self; + return _self->getWindX(); } void spine_skeleton_set_wind_x(spine_skeleton self, float windX) { - ((Skeleton*)self)->setWindX(windX); + Skeleton *_self = (Skeleton *) self; + _self->setWindX(windX); } float spine_skeleton_get_wind_y(spine_skeleton self) { - return ((Skeleton*)self)->getWindY(); + Skeleton *_self = (Skeleton *) self; + return _self->getWindY(); } void spine_skeleton_set_wind_y(spine_skeleton self, float windY) { - ((Skeleton*)self)->setWindY(windY); + Skeleton *_self = (Skeleton *) self; + _self->setWindY(windY); } float spine_skeleton_get_gravity_x(spine_skeleton self) { - return ((Skeleton*)self)->getGravityX(); + Skeleton *_self = (Skeleton *) self; + return _self->getGravityX(); } void spine_skeleton_set_gravity_x(spine_skeleton self, float gravityX) { - ((Skeleton*)self)->setGravityX(gravityX); + Skeleton *_self = (Skeleton *) self; + _self->setGravityX(gravityX); } float spine_skeleton_get_gravity_y(spine_skeleton self) { - return ((Skeleton*)self)->getGravityY(); + Skeleton *_self = (Skeleton *) self; + return _self->getGravityY(); } void spine_skeleton_set_gravity_y(spine_skeleton self, float gravityY) { - ((Skeleton*)self)->setGravityY(gravityY); + Skeleton *_self = (Skeleton *) self; + _self->setGravityY(gravityY); } void spine_skeleton_physics_translate(spine_skeleton self, float x, float y) { - ((Skeleton*)self)->physicsTranslate(x, y); + Skeleton *_self = (Skeleton *) self; + _self->physicsTranslate(x, y); } void spine_skeleton_physics_rotate(spine_skeleton self, float x, float y, float degrees) { - ((Skeleton*)self)->physicsRotate(x, y, degrees); + Skeleton *_self = (Skeleton *) self; + _self->physicsRotate(x, y, degrees); } float spine_skeleton_get_time(spine_skeleton self) { - return ((Skeleton*)self)->getTime(); + Skeleton *_self = (Skeleton *) self; + return _self->getTime(); } void spine_skeleton_set_time(spine_skeleton self, float time) { - ((Skeleton*)self)->setTime(time); + Skeleton *_self = (Skeleton *) self; + _self->setTime(time); } void spine_skeleton_update(spine_skeleton self, float delta) { - ((Skeleton*)self)->update(delta); + Skeleton *_self = (Skeleton *) self; + _self->update(delta); } diff --git a/spine-c/src/generated/skeleton.h b/spine-c/src/generated/skeleton.h index 1d2f782e6..5792125fe 100644 --- a/spine-c/src/generated/skeleton.h +++ b/spine-c/src/generated/skeleton.h @@ -26,20 +26,22 @@ SPINE_C_API spine_skeleton_data spine_skeleton_get_data(spine_skeleton self); SPINE_C_API spine_array_bone spine_skeleton_get_bones(spine_skeleton self); SPINE_C_API spine_array_update spine_skeleton_get_update_cache(spine_skeleton self); SPINE_C_API spine_bone spine_skeleton_get_root_bone(spine_skeleton self); -SPINE_C_API spine_bone spine_skeleton_find_bone(spine_skeleton self, const char * boneName); +SPINE_C_API spine_bone spine_skeleton_find_bone(spine_skeleton self, const char *boneName); SPINE_C_API spine_array_slot spine_skeleton_get_slots(spine_skeleton self); -SPINE_C_API spine_slot spine_skeleton_find_slot(spine_skeleton self, const char * slotName); +SPINE_C_API spine_slot spine_skeleton_find_slot(spine_skeleton self, const char *slotName); SPINE_C_API spine_array_slot spine_skeleton_get_draw_order(spine_skeleton self); SPINE_C_API spine_skin spine_skeleton_get_skin(spine_skeleton self); -SPINE_C_API void spine_skeleton_set_skin_1(spine_skeleton self, const char * skinName); +SPINE_C_API void spine_skeleton_set_skin_1(spine_skeleton self, const char *skinName); SPINE_C_API void spine_skeleton_set_skin_2(spine_skeleton self, spine_skin newSkin); -SPINE_C_API spine_attachment spine_skeleton_get_attachment_1(spine_skeleton self, const char * slotName, const char * attachmentName); -SPINE_C_API spine_attachment spine_skeleton_get_attachment_2(spine_skeleton self, int slotIndex, const char * attachmentName); -SPINE_C_API void spine_skeleton_set_attachment(spine_skeleton self, const char * slotName, const char * attachmentName); +SPINE_C_API spine_attachment spine_skeleton_get_attachment_1(spine_skeleton self, const char *slotName, const char *attachmentName); +SPINE_C_API spine_attachment spine_skeleton_get_attachment_2(spine_skeleton self, int slotIndex, const char *attachmentName); +SPINE_C_API void spine_skeleton_set_attachment(spine_skeleton self, const char *slotName, const char *attachmentName); SPINE_C_API spine_array_constraint spine_skeleton_get_constraints(spine_skeleton self); SPINE_C_API spine_array_physics_constraint spine_skeleton_get_physics_constraints(spine_skeleton self); -SPINE_C_API void spine_skeleton_get_bounds_1(spine_skeleton self, float * outX, float * outY, float * outWidth, float * outHeight, spine_array_float outVertexBuffer); -SPINE_C_API void spine_skeleton_get_bounds_2(spine_skeleton self, float * outX, float * outY, float * outWidth, float * outHeight, spine_array_float outVertexBuffer, spine_skeleton_clipping clipper); +SPINE_C_API void spine_skeleton_get_bounds_1(spine_skeleton self, float *outX, float *outY, float *outWidth, float *outHeight, + spine_array_float outVertexBuffer); +SPINE_C_API void spine_skeleton_get_bounds_2(spine_skeleton self, float *outX, float *outY, float *outWidth, float *outHeight, + spine_array_float outVertexBuffer, spine_skeleton_clipping clipper); SPINE_C_API spine_color spine_skeleton_get_color(spine_skeleton self); SPINE_C_API void spine_skeleton_set_color_1(spine_skeleton self, spine_color color); SPINE_C_API void spine_skeleton_set_color_2(spine_skeleton self, float r, float g, float b, float a); diff --git a/spine-c/src/generated/skeleton_binary.cpp b/spine-c/src/generated/skeleton_binary.cpp index 133910468..4b9aa8ece 100644 --- a/spine-c/src/generated/skeleton_binary.cpp +++ b/spine-c/src/generated/skeleton_binary.cpp @@ -4,29 +4,33 @@ using namespace spine; spine_skeleton_binary spine_skeleton_binary_create(spine_atlas atlas) { - return (spine_skeleton_binary) new (__FILE__, __LINE__) SkeletonBinary((Atlas *)atlas); + return (spine_skeleton_binary) new (__FILE__, __LINE__) SkeletonBinary((Atlas *) atlas); } spine_skeleton_binary spine_skeleton_binary_create2(spine_attachment_loader attachmentLoader, bool ownsLoader) { - return (spine_skeleton_binary) new (__FILE__, __LINE__) SkeletonBinary((AttachmentLoader *)attachmentLoader, ownsLoader); + return (spine_skeleton_binary) new (__FILE__, __LINE__) SkeletonBinary((AttachmentLoader *) attachmentLoader, ownsLoader); } void spine_skeleton_binary_dispose(spine_skeleton_binary self) { - delete (SkeletonBinary*)self; + delete (SkeletonBinary *) self; } -spine_skeleton_data spine_skeleton_binary_read_skeleton_data(spine_skeleton_binary self, const unsigned char * binary, int length) { - return (spine_skeleton_data)((SkeletonBinary*)self)->readSkeletonData(binary, length); +spine_skeleton_data spine_skeleton_binary_read_skeleton_data(spine_skeleton_binary self, const unsigned char *binary, int length) { + SkeletonBinary *_self = (SkeletonBinary *) self; + return (spine_skeleton_data) _self->readSkeletonData(binary, length); } -spine_skeleton_data spine_skeleton_binary_read_skeleton_data_file(spine_skeleton_binary self, const char * path) { - return (spine_skeleton_data)((SkeletonBinary*)self)->readSkeletonDataFile(String(path)); +spine_skeleton_data spine_skeleton_binary_read_skeleton_data_file(spine_skeleton_binary self, const char *path) { + SkeletonBinary *_self = (SkeletonBinary *) self; + return (spine_skeleton_data) _self->readSkeletonDataFile(String(path)); } void spine_skeleton_binary_set_scale(spine_skeleton_binary self, float scale) { - ((SkeletonBinary*)self)->setScale(scale); + SkeletonBinary *_self = (SkeletonBinary *) self; + _self->setScale(scale); } -const char * spine_skeleton_binary_get_error(spine_skeleton_binary self) { - return ((SkeletonBinary*)self)->getError().buffer(); +const char *spine_skeleton_binary_get_error(spine_skeleton_binary self) { + SkeletonBinary *_self = (SkeletonBinary *) self; + return _self->getError().buffer(); } diff --git a/spine-c/src/generated/skeleton_binary.h b/spine-c/src/generated/skeleton_binary.h index 156a224a1..f5ecd8349 100644 --- a/spine-c/src/generated/skeleton_binary.h +++ b/spine-c/src/generated/skeleton_binary.h @@ -13,10 +13,10 @@ SPINE_C_API spine_skeleton_binary spine_skeleton_binary_create2(spine_attachment SPINE_C_API void spine_skeleton_binary_dispose(spine_skeleton_binary self); -SPINE_C_API spine_skeleton_data spine_skeleton_binary_read_skeleton_data(spine_skeleton_binary self, const unsigned char * binary, int length); -SPINE_C_API spine_skeleton_data spine_skeleton_binary_read_skeleton_data_file(spine_skeleton_binary self, const char * path); +SPINE_C_API spine_skeleton_data spine_skeleton_binary_read_skeleton_data(spine_skeleton_binary self, const unsigned char *binary, int length); +SPINE_C_API spine_skeleton_data spine_skeleton_binary_read_skeleton_data_file(spine_skeleton_binary self, const char *path); SPINE_C_API void spine_skeleton_binary_set_scale(spine_skeleton_binary self, float scale); -SPINE_C_API const char * spine_skeleton_binary_get_error(spine_skeleton_binary self); +SPINE_C_API const char *spine_skeleton_binary_get_error(spine_skeleton_binary self); #ifdef __cplusplus } diff --git a/spine-c/src/generated/skeleton_bounds.cpp b/spine-c/src/generated/skeleton_bounds.cpp index 935780efb..0775ae3e6 100644 --- a/spine-c/src/generated/skeleton_bounds.cpp +++ b/spine-c/src/generated/skeleton_bounds.cpp @@ -4,81 +4,99 @@ using namespace spine; spine_skeleton_bounds spine_skeleton_bounds_create(void) { - return (spine_skeleton_bounds) new (__FILE__, __LINE__) SkeletonBounds(); + return (spine_skeleton_bounds) new (__FILE__, __LINE__) SkeletonBounds(); } void spine_skeleton_bounds_dispose(spine_skeleton_bounds self) { - delete (SkeletonBounds*)self; + delete (SkeletonBounds *) self; } void spine_skeleton_bounds_update(spine_skeleton_bounds self, spine_skeleton skeleton, bool updateAabb) { - ((SkeletonBounds*)self)->update(*((Skeleton*)skeleton), updateAabb); + SkeletonBounds *_self = (SkeletonBounds *) self; + _self->update(*((Skeleton *) skeleton), updateAabb); } bool spine_skeleton_bounds_aabb_contains_point(spine_skeleton_bounds self, float x, float y) { - return ((SkeletonBounds*)self)->aabbContainsPoint(x, y); + SkeletonBounds *_self = (SkeletonBounds *) self; + return _self->aabbContainsPoint(x, y); } bool spine_skeleton_bounds_aabb_intersects_segment(spine_skeleton_bounds self, float x1, float y1, float x2, float y2) { - return ((SkeletonBounds*)self)->aabbIntersectsSegment(x1, y1, x2, y2); + SkeletonBounds *_self = (SkeletonBounds *) self; + return _self->aabbIntersectsSegment(x1, y1, x2, y2); } bool spine_skeleton_bounds_aabb_intersects_skeleton(spine_skeleton_bounds self, spine_skeleton_bounds bounds) { - return ((SkeletonBounds*)self)->aabbIntersectsSkeleton(*((SkeletonBounds*)bounds)); + SkeletonBounds *_self = (SkeletonBounds *) self; + return _self->aabbIntersectsSkeleton(*((SkeletonBounds *) bounds)); } bool spine_skeleton_bounds_contains_point_1(spine_skeleton_bounds self, spine_polygon polygon, float x, float y) { - return ((SkeletonBounds*)self)->containsPoint((Polygon *)polygon, x, y); + SkeletonBounds *_self = (SkeletonBounds *) self; + return _self->containsPoint((Polygon *) polygon, x, y); } spine_bounding_box_attachment spine_skeleton_bounds_contains_point_2(spine_skeleton_bounds self, float x, float y) { - return (spine_bounding_box_attachment)((SkeletonBounds*)self)->containsPoint(x, y); + SkeletonBounds *_self = (SkeletonBounds *) self; + return (spine_bounding_box_attachment) _self->containsPoint(x, y); } spine_bounding_box_attachment spine_skeleton_bounds_intersects_segment_1(spine_skeleton_bounds self, float x1, float y1, float x2, float y2) { - return (spine_bounding_box_attachment)((SkeletonBounds*)self)->intersectsSegment(x1, y1, x2, y2); + SkeletonBounds *_self = (SkeletonBounds *) self; + return (spine_bounding_box_attachment) _self->intersectsSegment(x1, y1, x2, y2); } bool spine_skeleton_bounds_intersects_segment_2(spine_skeleton_bounds self, spine_polygon polygon, float x1, float y1, float x2, float y2) { - return ((SkeletonBounds*)self)->intersectsSegment((Polygon *)polygon, x1, y1, x2, y2); + SkeletonBounds *_self = (SkeletonBounds *) self; + return _self->intersectsSegment((Polygon *) polygon, x1, y1, x2, y2); } spine_polygon spine_skeleton_bounds_get_polygon(spine_skeleton_bounds self, spine_bounding_box_attachment attachment) { - return (spine_polygon)((SkeletonBounds*)self)->getPolygon((BoundingBoxAttachment *)attachment); + SkeletonBounds *_self = (SkeletonBounds *) self; + return (spine_polygon) _self->getPolygon((BoundingBoxAttachment *) attachment); } spine_bounding_box_attachment spine_skeleton_bounds_get_bounding_box(spine_skeleton_bounds self, spine_polygon polygon) { - return (spine_bounding_box_attachment)((SkeletonBounds*)self)->getBoundingBox((Polygon *)polygon); + SkeletonBounds *_self = (SkeletonBounds *) self; + return (spine_bounding_box_attachment) _self->getBoundingBox((Polygon *) polygon); } spine_array_polygon spine_skeleton_bounds_get_polygons(spine_skeleton_bounds self) { - return (spine_array_polygon)&((SkeletonBounds*)self)->getPolygons(); + SkeletonBounds *_self = (SkeletonBounds *) self; + return (spine_array_polygon) &_self->getPolygons(); } spine_array_bounding_box_attachment spine_skeleton_bounds_get_bounding_boxes(spine_skeleton_bounds self) { - return (spine_array_bounding_box_attachment)&((SkeletonBounds*)self)->getBoundingBoxes(); + SkeletonBounds *_self = (SkeletonBounds *) self; + return (spine_array_bounding_box_attachment) &_self->getBoundingBoxes(); } float spine_skeleton_bounds_get_min_x(spine_skeleton_bounds self) { - return ((SkeletonBounds*)self)->getMinX(); + SkeletonBounds *_self = (SkeletonBounds *) self; + return _self->getMinX(); } float spine_skeleton_bounds_get_min_y(spine_skeleton_bounds self) { - return ((SkeletonBounds*)self)->getMinY(); + SkeletonBounds *_self = (SkeletonBounds *) self; + return _self->getMinY(); } float spine_skeleton_bounds_get_max_x(spine_skeleton_bounds self) { - return ((SkeletonBounds*)self)->getMaxX(); + SkeletonBounds *_self = (SkeletonBounds *) self; + return _self->getMaxX(); } float spine_skeleton_bounds_get_max_y(spine_skeleton_bounds self) { - return ((SkeletonBounds*)self)->getMaxY(); + SkeletonBounds *_self = (SkeletonBounds *) self; + return _self->getMaxY(); } float spine_skeleton_bounds_get_width(spine_skeleton_bounds self) { - return ((SkeletonBounds*)self)->getWidth(); + SkeletonBounds *_self = (SkeletonBounds *) self; + return _self->getWidth(); } float spine_skeleton_bounds_get_height(spine_skeleton_bounds self) { - return ((SkeletonBounds*)self)->getHeight(); + SkeletonBounds *_self = (SkeletonBounds *) self; + return _self->getHeight(); } diff --git a/spine-c/src/generated/skeleton_bounds.h b/spine-c/src/generated/skeleton_bounds.h index e0d019463..f3780f8fb 100644 --- a/spine-c/src/generated/skeleton_bounds.h +++ b/spine-c/src/generated/skeleton_bounds.h @@ -18,8 +18,10 @@ SPINE_C_API bool spine_skeleton_bounds_aabb_intersects_segment(spine_skeleton_bo SPINE_C_API bool spine_skeleton_bounds_aabb_intersects_skeleton(spine_skeleton_bounds self, spine_skeleton_bounds bounds); SPINE_C_API bool spine_skeleton_bounds_contains_point_1(spine_skeleton_bounds self, spine_polygon polygon, float x, float y); SPINE_C_API spine_bounding_box_attachment spine_skeleton_bounds_contains_point_2(spine_skeleton_bounds self, float x, float y); -SPINE_C_API spine_bounding_box_attachment spine_skeleton_bounds_intersects_segment_1(spine_skeleton_bounds self, float x1, float y1, float x2, float y2); -SPINE_C_API bool spine_skeleton_bounds_intersects_segment_2(spine_skeleton_bounds self, spine_polygon polygon, float x1, float y1, float x2, float y2); +SPINE_C_API spine_bounding_box_attachment spine_skeleton_bounds_intersects_segment_1(spine_skeleton_bounds self, float x1, float y1, float x2, + float y2); +SPINE_C_API bool spine_skeleton_bounds_intersects_segment_2(spine_skeleton_bounds self, spine_polygon polygon, float x1, float y1, float x2, + float y2); SPINE_C_API spine_polygon spine_skeleton_bounds_get_polygon(spine_skeleton_bounds self, spine_bounding_box_attachment attachment); SPINE_C_API spine_bounding_box_attachment spine_skeleton_bounds_get_bounding_box(spine_skeleton_bounds self, spine_polygon polygon); SPINE_C_API spine_array_polygon spine_skeleton_bounds_get_polygons(spine_skeleton_bounds self); diff --git a/spine-c/src/generated/skeleton_clipping.cpp b/spine-c/src/generated/skeleton_clipping.cpp index 34de6b394..38bc16c76 100644 --- a/spine-c/src/generated/skeleton_clipping.cpp +++ b/spine-c/src/generated/skeleton_clipping.cpp @@ -4,49 +4,61 @@ using namespace spine; spine_skeleton_clipping spine_skeleton_clipping_create(void) { - return (spine_skeleton_clipping) new (__FILE__, __LINE__) SkeletonClipping(); + return (spine_skeleton_clipping) new (__FILE__, __LINE__) SkeletonClipping(); } void spine_skeleton_clipping_dispose(spine_skeleton_clipping self) { - delete (SkeletonClipping*)self; + delete (SkeletonClipping *) self; } size_t spine_skeleton_clipping_clip_start(spine_skeleton_clipping self, spine_skeleton skeleton, spine_slot slot, spine_clipping_attachment clip) { - return ((SkeletonClipping*)self)->clipStart(*((Skeleton*)skeleton), *((Slot*)slot), (ClippingAttachment *)clip); + SkeletonClipping *_self = (SkeletonClipping *) self; + return _self->clipStart(*((Skeleton *) skeleton), *((Slot *) slot), (ClippingAttachment *) clip); } void spine_skeleton_clipping_clip_end_1(spine_skeleton_clipping self, spine_slot slot) { - ((SkeletonClipping*)self)->clipEnd(*((Slot*)slot)); + SkeletonClipping *_self = (SkeletonClipping *) self; + _self->clipEnd(*((Slot *) slot)); } void spine_skeleton_clipping_clip_end_2(spine_skeleton_clipping self) { - ((SkeletonClipping*)self)->clipEnd(); + SkeletonClipping *_self = (SkeletonClipping *) self; + _self->clipEnd(); } -bool spine_skeleton_clipping_clip_triangles_1(spine_skeleton_clipping self, float * vertices, unsigned short * triangles, size_t trianglesLength) { - return ((SkeletonClipping*)self)->clipTriangles(vertices, triangles, trianglesLength); +bool spine_skeleton_clipping_clip_triangles_1(spine_skeleton_clipping self, float *vertices, unsigned short *triangles, size_t trianglesLength) { + SkeletonClipping *_self = (SkeletonClipping *) self; + return _self->clipTriangles(vertices, triangles, trianglesLength); } -bool spine_skeleton_clipping_clip_triangles_2(spine_skeleton_clipping self, float * vertices, unsigned short * triangles, size_t trianglesLength, float * uvs, size_t stride) { - return ((SkeletonClipping*)self)->clipTriangles(vertices, triangles, trianglesLength, uvs, stride); +bool spine_skeleton_clipping_clip_triangles_2(spine_skeleton_clipping self, float *vertices, unsigned short *triangles, size_t trianglesLength, + float *uvs, size_t stride) { + SkeletonClipping *_self = (SkeletonClipping *) self; + return _self->clipTriangles(vertices, triangles, trianglesLength, uvs, stride); } -bool spine_skeleton_clipping_clip_triangles_3(spine_skeleton_clipping self, spine_array_float vertices, spine_array_unsigned_short triangles, spine_array_float uvs, size_t stride) { - return ((SkeletonClipping*)self)->clipTriangles(*((Array*)vertices), *((Array*)triangles), *((Array*)uvs), stride); +bool spine_skeleton_clipping_clip_triangles_3(spine_skeleton_clipping self, spine_array_float vertices, spine_array_unsigned_short triangles, + spine_array_float uvs, size_t stride) { + SkeletonClipping *_self = (SkeletonClipping *) self; + return _self->clipTriangles(*((Array *) vertices), *((Array *) triangles), *((Array *) uvs), stride); } bool spine_skeleton_clipping_is_clipping(spine_skeleton_clipping self) { - return ((SkeletonClipping*)self)->isClipping(); + SkeletonClipping *_self = (SkeletonClipping *) self; + return _self->isClipping(); } spine_array_float spine_skeleton_clipping_get_clipped_vertices(spine_skeleton_clipping self) { - return (spine_array_float)&((SkeletonClipping*)self)->getClippedVertices(); + SkeletonClipping *_self = (SkeletonClipping *) self; + return (spine_array_float) &_self->getClippedVertices(); } spine_array_unsigned_short spine_skeleton_clipping_get_clipped_triangles(spine_skeleton_clipping self) { - return (spine_array_unsigned_short)&((SkeletonClipping*)self)->getClippedTriangles(); + SkeletonClipping *_self = (SkeletonClipping *) self; + return (spine_array_unsigned_short) &_self->getClippedTriangles(); } spine_array_float spine_skeleton_clipping_get_clipped_u_vs(spine_skeleton_clipping self) { - return (spine_array_float)&((SkeletonClipping*)self)->getClippedUVs(); + SkeletonClipping *_self = (SkeletonClipping *) self; + return (spine_array_float) &_self->getClippedUVs(); } diff --git a/spine-c/src/generated/skeleton_clipping.h b/spine-c/src/generated/skeleton_clipping.h index c2de7d18d..38ee6ee0c 100644 --- a/spine-c/src/generated/skeleton_clipping.h +++ b/spine-c/src/generated/skeleton_clipping.h @@ -12,12 +12,16 @@ SPINE_C_API spine_skeleton_clipping spine_skeleton_clipping_create(void); SPINE_C_API void spine_skeleton_clipping_dispose(spine_skeleton_clipping self); -SPINE_C_API size_t spine_skeleton_clipping_clip_start(spine_skeleton_clipping self, spine_skeleton skeleton, spine_slot slot, spine_clipping_attachment clip); +SPINE_C_API size_t spine_skeleton_clipping_clip_start(spine_skeleton_clipping self, spine_skeleton skeleton, spine_slot slot, + spine_clipping_attachment clip); SPINE_C_API void spine_skeleton_clipping_clip_end_1(spine_skeleton_clipping self, spine_slot slot); SPINE_C_API void spine_skeleton_clipping_clip_end_2(spine_skeleton_clipping self); -SPINE_C_API bool spine_skeleton_clipping_clip_triangles_1(spine_skeleton_clipping self, float * vertices, unsigned short * triangles, size_t trianglesLength); -SPINE_C_API bool spine_skeleton_clipping_clip_triangles_2(spine_skeleton_clipping self, float * vertices, unsigned short * triangles, size_t trianglesLength, float * uvs, size_t stride); -SPINE_C_API bool spine_skeleton_clipping_clip_triangles_3(spine_skeleton_clipping self, spine_array_float vertices, spine_array_unsigned_short triangles, spine_array_float uvs, size_t stride); +SPINE_C_API bool spine_skeleton_clipping_clip_triangles_1(spine_skeleton_clipping self, float *vertices, unsigned short *triangles, + size_t trianglesLength); +SPINE_C_API bool spine_skeleton_clipping_clip_triangles_2(spine_skeleton_clipping self, float *vertices, unsigned short *triangles, + size_t trianglesLength, float *uvs, size_t stride); +SPINE_C_API bool spine_skeleton_clipping_clip_triangles_3(spine_skeleton_clipping self, spine_array_float vertices, + spine_array_unsigned_short triangles, spine_array_float uvs, size_t stride); SPINE_C_API bool spine_skeleton_clipping_is_clipping(spine_skeleton_clipping self); SPINE_C_API spine_array_float spine_skeleton_clipping_get_clipped_vertices(spine_skeleton_clipping self); SPINE_C_API spine_array_unsigned_short spine_skeleton_clipping_get_clipped_triangles(spine_skeleton_clipping self); diff --git a/spine-c/src/generated/skeleton_data.cpp b/spine-c/src/generated/skeleton_data.cpp index 24a57c7aa..74ef67377 100644 --- a/spine-c/src/generated/skeleton_data.cpp +++ b/spine-c/src/generated/skeleton_data.cpp @@ -4,149 +4,184 @@ using namespace spine; spine_skeleton_data spine_skeleton_data_create(void) { - return (spine_skeleton_data) new (__FILE__, __LINE__) SkeletonData(); + return (spine_skeleton_data) new (__FILE__, __LINE__) SkeletonData(); } void spine_skeleton_data_dispose(spine_skeleton_data self) { - delete (SkeletonData*)self; + delete (SkeletonData *) self; } -spine_bone_data spine_skeleton_data_find_bone(spine_skeleton_data self, const char * boneName) { - return (spine_bone_data)((SkeletonData*)self)->findBone(String(boneName)); +spine_bone_data spine_skeleton_data_find_bone(spine_skeleton_data self, const char *boneName) { + SkeletonData *_self = (SkeletonData *) self; + return (spine_bone_data) _self->findBone(String(boneName)); } -spine_slot_data spine_skeleton_data_find_slot(spine_skeleton_data self, const char * slotName) { - return (spine_slot_data)((SkeletonData*)self)->findSlot(String(slotName)); +spine_slot_data spine_skeleton_data_find_slot(spine_skeleton_data self, const char *slotName) { + SkeletonData *_self = (SkeletonData *) self; + return (spine_slot_data) _self->findSlot(String(slotName)); } -spine_skin spine_skeleton_data_find_skin(spine_skeleton_data self, const char * skinName) { - return (spine_skin)((SkeletonData*)self)->findSkin(String(skinName)); +spine_skin spine_skeleton_data_find_skin(spine_skeleton_data self, const char *skinName) { + SkeletonData *_self = (SkeletonData *) self; + return (spine_skin) _self->findSkin(String(skinName)); } -spine_event_data spine_skeleton_data_find_event(spine_skeleton_data self, const char * eventDataName) { - return (spine_event_data)((SkeletonData*)self)->findEvent(String(eventDataName)); +spine_event_data spine_skeleton_data_find_event(spine_skeleton_data self, const char *eventDataName) { + SkeletonData *_self = (SkeletonData *) self; + return (spine_event_data) _self->findEvent(String(eventDataName)); } -spine_animation spine_skeleton_data_find_animation(spine_skeleton_data self, const char * animationName) { - return (spine_animation)((SkeletonData*)self)->findAnimation(String(animationName)); +spine_animation spine_skeleton_data_find_animation(spine_skeleton_data self, const char *animationName) { + SkeletonData *_self = (SkeletonData *) self; + return (spine_animation) _self->findAnimation(String(animationName)); } -const char * spine_skeleton_data_get_name(spine_skeleton_data self) { - return ((SkeletonData*)self)->getName().buffer(); +const char *spine_skeleton_data_get_name(spine_skeleton_data self) { + SkeletonData *_self = (SkeletonData *) self; + return _self->getName().buffer(); } -void spine_skeleton_data_set_name(spine_skeleton_data self, const char * inValue) { - ((SkeletonData*)self)->setName(String(inValue)); +void spine_skeleton_data_set_name(spine_skeleton_data self, const char *inValue) { + SkeletonData *_self = (SkeletonData *) self; + _self->setName(String(inValue)); } spine_array_bone_data spine_skeleton_data_get_bones(spine_skeleton_data self) { - return (spine_array_bone_data)&((SkeletonData*)self)->getBones(); + SkeletonData *_self = (SkeletonData *) self; + return (spine_array_bone_data) &_self->getBones(); } spine_array_slot_data spine_skeleton_data_get_slots(spine_skeleton_data self) { - return (spine_array_slot_data)&((SkeletonData*)self)->getSlots(); + SkeletonData *_self = (SkeletonData *) self; + return (spine_array_slot_data) &_self->getSlots(); } spine_array_skin spine_skeleton_data_get_skins(spine_skeleton_data self) { - return (spine_array_skin)&((SkeletonData*)self)->getSkins(); + SkeletonData *_self = (SkeletonData *) self; + return (spine_array_skin) &_self->getSkins(); } spine_skin spine_skeleton_data_get_default_skin(spine_skeleton_data self) { - return (spine_skin)((SkeletonData*)self)->getDefaultSkin(); + SkeletonData *_self = (SkeletonData *) self; + return (spine_skin) _self->getDefaultSkin(); } void spine_skeleton_data_set_default_skin(spine_skeleton_data self, spine_skin inValue) { - ((SkeletonData*)self)->setDefaultSkin((Skin *)inValue); + SkeletonData *_self = (SkeletonData *) self; + _self->setDefaultSkin((Skin *) inValue); } spine_array_event_data spine_skeleton_data_get_events(spine_skeleton_data self) { - return (spine_array_event_data)&((SkeletonData*)self)->getEvents(); + SkeletonData *_self = (SkeletonData *) self; + return (spine_array_event_data) &_self->getEvents(); } spine_array_animation spine_skeleton_data_get_animations(spine_skeleton_data self) { - return (spine_array_animation)&((SkeletonData*)self)->getAnimations(); + SkeletonData *_self = (SkeletonData *) self; + return (spine_array_animation) &_self->getAnimations(); } spine_array_constraint_data spine_skeleton_data_get_constraints(spine_skeleton_data self) { - return (spine_array_constraint_data)&((SkeletonData*)self)->getConstraints(); + SkeletonData *_self = (SkeletonData *) self; + return (spine_array_constraint_data) &_self->getConstraints(); } float spine_skeleton_data_get_x(spine_skeleton_data self) { - return ((SkeletonData*)self)->getX(); + SkeletonData *_self = (SkeletonData *) self; + return _self->getX(); } void spine_skeleton_data_set_x(spine_skeleton_data self, float inValue) { - ((SkeletonData*)self)->setX(inValue); + SkeletonData *_self = (SkeletonData *) self; + _self->setX(inValue); } float spine_skeleton_data_get_y(spine_skeleton_data self) { - return ((SkeletonData*)self)->getY(); + SkeletonData *_self = (SkeletonData *) self; + return _self->getY(); } void spine_skeleton_data_set_y(spine_skeleton_data self, float inValue) { - ((SkeletonData*)self)->setY(inValue); + SkeletonData *_self = (SkeletonData *) self; + _self->setY(inValue); } float spine_skeleton_data_get_width(spine_skeleton_data self) { - return ((SkeletonData*)self)->getWidth(); + SkeletonData *_self = (SkeletonData *) self; + return _self->getWidth(); } void spine_skeleton_data_set_width(spine_skeleton_data self, float inValue) { - ((SkeletonData*)self)->setWidth(inValue); + SkeletonData *_self = (SkeletonData *) self; + _self->setWidth(inValue); } float spine_skeleton_data_get_height(spine_skeleton_data self) { - return ((SkeletonData*)self)->getHeight(); + SkeletonData *_self = (SkeletonData *) self; + return _self->getHeight(); } void spine_skeleton_data_set_height(spine_skeleton_data self, float inValue) { - ((SkeletonData*)self)->setHeight(inValue); + SkeletonData *_self = (SkeletonData *) self; + _self->setHeight(inValue); } float spine_skeleton_data_get_reference_scale(spine_skeleton_data self) { - return ((SkeletonData*)self)->getReferenceScale(); + SkeletonData *_self = (SkeletonData *) self; + return _self->getReferenceScale(); } void spine_skeleton_data_set_reference_scale(spine_skeleton_data self, float inValue) { - ((SkeletonData*)self)->setReferenceScale(inValue); + SkeletonData *_self = (SkeletonData *) self; + _self->setReferenceScale(inValue); } -const char * spine_skeleton_data_get_version(spine_skeleton_data self) { - return ((SkeletonData*)self)->getVersion().buffer(); +const char *spine_skeleton_data_get_version(spine_skeleton_data self) { + SkeletonData *_self = (SkeletonData *) self; + return _self->getVersion().buffer(); } -void spine_skeleton_data_set_version(spine_skeleton_data self, const char * inValue) { - ((SkeletonData*)self)->setVersion(String(inValue)); +void spine_skeleton_data_set_version(spine_skeleton_data self, const char *inValue) { + SkeletonData *_self = (SkeletonData *) self; + _self->setVersion(String(inValue)); } -const char * spine_skeleton_data_get_hash(spine_skeleton_data self) { - return ((SkeletonData*)self)->getHash().buffer(); +const char *spine_skeleton_data_get_hash(spine_skeleton_data self) { + SkeletonData *_self = (SkeletonData *) self; + return _self->getHash().buffer(); } -void spine_skeleton_data_set_hash(spine_skeleton_data self, const char * inValue) { - ((SkeletonData*)self)->setHash(String(inValue)); +void spine_skeleton_data_set_hash(spine_skeleton_data self, const char *inValue) { + SkeletonData *_self = (SkeletonData *) self; + _self->setHash(String(inValue)); } -const char * spine_skeleton_data_get_images_path(spine_skeleton_data self) { - return ((SkeletonData*)self)->getImagesPath().buffer(); +const char *spine_skeleton_data_get_images_path(spine_skeleton_data self) { + SkeletonData *_self = (SkeletonData *) self; + return _self->getImagesPath().buffer(); } -void spine_skeleton_data_set_images_path(spine_skeleton_data self, const char * inValue) { - ((SkeletonData*)self)->setImagesPath(String(inValue)); +void spine_skeleton_data_set_images_path(spine_skeleton_data self, const char *inValue) { + SkeletonData *_self = (SkeletonData *) self; + _self->setImagesPath(String(inValue)); } -const char * spine_skeleton_data_get_audio_path(spine_skeleton_data self) { - return ((SkeletonData*)self)->getAudioPath().buffer(); +const char *spine_skeleton_data_get_audio_path(spine_skeleton_data self) { + SkeletonData *_self = (SkeletonData *) self; + return _self->getAudioPath().buffer(); } -void spine_skeleton_data_set_audio_path(spine_skeleton_data self, const char * inValue) { - ((SkeletonData*)self)->setAudioPath(String(inValue)); +void spine_skeleton_data_set_audio_path(spine_skeleton_data self, const char *inValue) { + SkeletonData *_self = (SkeletonData *) self; + _self->setAudioPath(String(inValue)); } float spine_skeleton_data_get_fps(spine_skeleton_data self) { - return ((SkeletonData*)self)->getFps(); + SkeletonData *_self = (SkeletonData *) self; + return _self->getFps(); } void spine_skeleton_data_set_fps(spine_skeleton_data self, float inValue) { - ((SkeletonData*)self)->setFps(inValue); + SkeletonData *_self = (SkeletonData *) self; + _self->setFps(inValue); } diff --git a/spine-c/src/generated/skeleton_data.h b/spine-c/src/generated/skeleton_data.h index 05c886a30..d597a2d61 100644 --- a/spine-c/src/generated/skeleton_data.h +++ b/spine-c/src/generated/skeleton_data.h @@ -12,13 +12,13 @@ SPINE_C_API spine_skeleton_data spine_skeleton_data_create(void); SPINE_C_API void spine_skeleton_data_dispose(spine_skeleton_data self); -SPINE_C_API spine_bone_data spine_skeleton_data_find_bone(spine_skeleton_data self, const char * boneName); -SPINE_C_API spine_slot_data spine_skeleton_data_find_slot(spine_skeleton_data self, const char * slotName); -SPINE_C_API spine_skin spine_skeleton_data_find_skin(spine_skeleton_data self, const char * skinName); -SPINE_C_API spine_event_data spine_skeleton_data_find_event(spine_skeleton_data self, const char * eventDataName); -SPINE_C_API spine_animation spine_skeleton_data_find_animation(spine_skeleton_data self, const char * animationName); -SPINE_C_API const char * spine_skeleton_data_get_name(spine_skeleton_data self); -SPINE_C_API void spine_skeleton_data_set_name(spine_skeleton_data self, const char * inValue); +SPINE_C_API spine_bone_data spine_skeleton_data_find_bone(spine_skeleton_data self, const char *boneName); +SPINE_C_API spine_slot_data spine_skeleton_data_find_slot(spine_skeleton_data self, const char *slotName); +SPINE_C_API spine_skin spine_skeleton_data_find_skin(spine_skeleton_data self, const char *skinName); +SPINE_C_API spine_event_data spine_skeleton_data_find_event(spine_skeleton_data self, const char *eventDataName); +SPINE_C_API spine_animation spine_skeleton_data_find_animation(spine_skeleton_data self, const char *animationName); +SPINE_C_API const char *spine_skeleton_data_get_name(spine_skeleton_data self); +SPINE_C_API void spine_skeleton_data_set_name(spine_skeleton_data self, const char *inValue); SPINE_C_API spine_array_bone_data spine_skeleton_data_get_bones(spine_skeleton_data self); SPINE_C_API spine_array_slot_data spine_skeleton_data_get_slots(spine_skeleton_data self); SPINE_C_API spine_array_skin spine_skeleton_data_get_skins(spine_skeleton_data self); @@ -37,14 +37,14 @@ SPINE_C_API float spine_skeleton_data_get_height(spine_skeleton_data self); SPINE_C_API void spine_skeleton_data_set_height(spine_skeleton_data self, float inValue); SPINE_C_API float spine_skeleton_data_get_reference_scale(spine_skeleton_data self); SPINE_C_API void spine_skeleton_data_set_reference_scale(spine_skeleton_data self, float inValue); -SPINE_C_API const char * spine_skeleton_data_get_version(spine_skeleton_data self); -SPINE_C_API void spine_skeleton_data_set_version(spine_skeleton_data self, const char * inValue); -SPINE_C_API const char * spine_skeleton_data_get_hash(spine_skeleton_data self); -SPINE_C_API void spine_skeleton_data_set_hash(spine_skeleton_data self, const char * inValue); -SPINE_C_API const char * spine_skeleton_data_get_images_path(spine_skeleton_data self); -SPINE_C_API void spine_skeleton_data_set_images_path(spine_skeleton_data self, const char * inValue); -SPINE_C_API const char * spine_skeleton_data_get_audio_path(spine_skeleton_data self); -SPINE_C_API void spine_skeleton_data_set_audio_path(spine_skeleton_data self, const char * inValue); +SPINE_C_API const char *spine_skeleton_data_get_version(spine_skeleton_data self); +SPINE_C_API void spine_skeleton_data_set_version(spine_skeleton_data self, const char *inValue); +SPINE_C_API const char *spine_skeleton_data_get_hash(spine_skeleton_data self); +SPINE_C_API void spine_skeleton_data_set_hash(spine_skeleton_data self, const char *inValue); +SPINE_C_API const char *spine_skeleton_data_get_images_path(spine_skeleton_data self); +SPINE_C_API void spine_skeleton_data_set_images_path(spine_skeleton_data self, const char *inValue); +SPINE_C_API const char *spine_skeleton_data_get_audio_path(spine_skeleton_data self); +SPINE_C_API void spine_skeleton_data_set_audio_path(spine_skeleton_data self, const char *inValue); SPINE_C_API float spine_skeleton_data_get_fps(spine_skeleton_data self); SPINE_C_API void spine_skeleton_data_set_fps(spine_skeleton_data self, float inValue); diff --git a/spine-c/src/generated/skeleton_json.cpp b/spine-c/src/generated/skeleton_json.cpp index 2b539783e..30928848d 100644 --- a/spine-c/src/generated/skeleton_json.cpp +++ b/spine-c/src/generated/skeleton_json.cpp @@ -4,29 +4,33 @@ using namespace spine; spine_skeleton_json spine_skeleton_json_create(spine_atlas atlas) { - return (spine_skeleton_json) new (__FILE__, __LINE__) SkeletonJson((Atlas *)atlas); + return (spine_skeleton_json) new (__FILE__, __LINE__) SkeletonJson((Atlas *) atlas); } spine_skeleton_json spine_skeleton_json_create2(spine_attachment_loader attachmentLoader, bool ownsLoader) { - return (spine_skeleton_json) new (__FILE__, __LINE__) SkeletonJson((AttachmentLoader *)attachmentLoader, ownsLoader); + return (spine_skeleton_json) new (__FILE__, __LINE__) SkeletonJson((AttachmentLoader *) attachmentLoader, ownsLoader); } void spine_skeleton_json_dispose(spine_skeleton_json self) { - delete (SkeletonJson*)self; + delete (SkeletonJson *) self; } -spine_skeleton_data spine_skeleton_json_read_skeleton_data_file(spine_skeleton_json self, const char * path) { - return (spine_skeleton_data)((SkeletonJson*)self)->readSkeletonDataFile(String(path)); +spine_skeleton_data spine_skeleton_json_read_skeleton_data_file(spine_skeleton_json self, const char *path) { + SkeletonJson *_self = (SkeletonJson *) self; + return (spine_skeleton_data) _self->readSkeletonDataFile(String(path)); } -spine_skeleton_data spine_skeleton_json_read_skeleton_data(spine_skeleton_json self, const char * json) { - return (spine_skeleton_data)((SkeletonJson*)self)->readSkeletonData(json); +spine_skeleton_data spine_skeleton_json_read_skeleton_data(spine_skeleton_json self, const char *json) { + SkeletonJson *_self = (SkeletonJson *) self; + return (spine_skeleton_data) _self->readSkeletonData(json); } void spine_skeleton_json_set_scale(spine_skeleton_json self, float scale) { - ((SkeletonJson*)self)->setScale(scale); + SkeletonJson *_self = (SkeletonJson *) self; + _self->setScale(scale); } -const char * spine_skeleton_json_get_error(spine_skeleton_json self) { - return ((SkeletonJson*)self)->getError().buffer(); +const char *spine_skeleton_json_get_error(spine_skeleton_json self) { + SkeletonJson *_self = (SkeletonJson *) self; + return _self->getError().buffer(); } diff --git a/spine-c/src/generated/skeleton_json.h b/spine-c/src/generated/skeleton_json.h index 2cc06403c..78334c259 100644 --- a/spine-c/src/generated/skeleton_json.h +++ b/spine-c/src/generated/skeleton_json.h @@ -13,10 +13,10 @@ SPINE_C_API spine_skeleton_json spine_skeleton_json_create2(spine_attachment_loa SPINE_C_API void spine_skeleton_json_dispose(spine_skeleton_json self); -SPINE_C_API spine_skeleton_data spine_skeleton_json_read_skeleton_data_file(spine_skeleton_json self, const char * path); -SPINE_C_API spine_skeleton_data spine_skeleton_json_read_skeleton_data(spine_skeleton_json self, const char * json); +SPINE_C_API spine_skeleton_data spine_skeleton_json_read_skeleton_data_file(spine_skeleton_json self, const char *path); +SPINE_C_API spine_skeleton_data spine_skeleton_json_read_skeleton_data(spine_skeleton_json self, const char *json); SPINE_C_API void spine_skeleton_json_set_scale(spine_skeleton_json self, float scale); -SPINE_C_API const char * spine_skeleton_json_get_error(spine_skeleton_json self); +SPINE_C_API const char *spine_skeleton_json_get_error(spine_skeleton_json self); #ifdef __cplusplus } diff --git a/spine-c/src/generated/skeleton_renderer.cpp b/spine-c/src/generated/skeleton_renderer.cpp index 1b2670655..fc4429c90 100644 --- a/spine-c/src/generated/skeleton_renderer.cpp +++ b/spine-c/src/generated/skeleton_renderer.cpp @@ -4,13 +4,14 @@ using namespace spine; spine_skeleton_renderer spine_skeleton_renderer_create(void) { - return (spine_skeleton_renderer) new (__FILE__, __LINE__) SkeletonRenderer(); + return (spine_skeleton_renderer) new (__FILE__, __LINE__) SkeletonRenderer(); } void spine_skeleton_renderer_dispose(spine_skeleton_renderer self) { - delete (SkeletonRenderer*)self; + delete (SkeletonRenderer *) self; } spine_render_command spine_skeleton_renderer_render(spine_skeleton_renderer self, spine_skeleton skeleton) { - return (spine_render_command)((SkeletonRenderer*)self)->render(*((Skeleton*)skeleton)); + SkeletonRenderer *_self = (SkeletonRenderer *) self; + return (spine_render_command) _self->render(*((Skeleton *) skeleton)); } diff --git a/spine-c/src/generated/skin.cpp b/spine-c/src/generated/skin.cpp index 4a6e804a6..7b83d355d 100644 --- a/spine-c/src/generated/skin.cpp +++ b/spine-c/src/generated/skin.cpp @@ -3,50 +3,60 @@ using namespace spine; -spine_skin spine_skin_create(const char * name) { - return (spine_skin) new (__FILE__, __LINE__) Skin(String(name)); +spine_skin spine_skin_create(const char *name) { + return (spine_skin) new (__FILE__, __LINE__) Skin(String(name)); } void spine_skin_dispose(spine_skin self) { - delete (Skin*)self; + delete (Skin *) self; } -void spine_skin_set_attachment(spine_skin self, size_t slotIndex, const char * name, spine_attachment attachment) { - ((Skin*)self)->setAttachment(slotIndex, String(name), (Attachment *)attachment); +void spine_skin_set_attachment(spine_skin self, size_t slotIndex, const char *name, spine_attachment attachment) { + Skin *_self = (Skin *) self; + _self->setAttachment(slotIndex, String(name), (Attachment *) attachment); } -spine_attachment spine_skin_get_attachment(spine_skin self, size_t slotIndex, const char * name) { - return (spine_attachment)((Skin*)self)->getAttachment(slotIndex, String(name)); +spine_attachment spine_skin_get_attachment(spine_skin self, size_t slotIndex, const char *name) { + Skin *_self = (Skin *) self; + return (spine_attachment) _self->getAttachment(slotIndex, String(name)); } -void spine_skin_remove_attachment(spine_skin self, size_t slotIndex, const char * name) { - ((Skin*)self)->removeAttachment(slotIndex, String(name)); +void spine_skin_remove_attachment(spine_skin self, size_t slotIndex, const char *name) { + Skin *_self = (Skin *) self; + _self->removeAttachment(slotIndex, String(name)); } void spine_skin_find_attachments_for_slot(spine_skin self, size_t slotIndex, spine_array_attachment attachments) { - ((Skin*)self)->findAttachmentsForSlot(slotIndex, *((Array*)attachments)); + Skin *_self = (Skin *) self; + _self->findAttachmentsForSlot(slotIndex, *((Array *) attachments)); } -const char * spine_skin_get_name(spine_skin self) { - return ((Skin*)self)->getName().buffer(); +const char *spine_skin_get_name(spine_skin self) { + Skin *_self = (Skin *) self; + return _self->getName().buffer(); } void spine_skin_add_skin(spine_skin self, spine_skin other) { - ((Skin*)self)->addSkin((Skin *)other); + Skin *_self = (Skin *) self; + _self->addSkin((Skin *) other); } void spine_skin_copy_skin(spine_skin self, spine_skin other) { - ((Skin*)self)->copySkin((Skin *)other); + Skin *_self = (Skin *) self; + _self->copySkin((Skin *) other); } spine_array_bone_data spine_skin_get_bones(spine_skin self) { - return (spine_array_bone_data)&((Skin*)self)->getBones(); + Skin *_self = (Skin *) self; + return (spine_array_bone_data) &_self->getBones(); } spine_array_constraint_data spine_skin_get_constraints(spine_skin self) { - return (spine_array_constraint_data)&((Skin*)self)->getConstraints(); + Skin *_self = (Skin *) self; + return (spine_array_constraint_data) &_self->getConstraints(); } spine_color spine_skin_get_color(spine_skin self) { - return (spine_color)&((Skin*)self)->getColor(); + Skin *_self = (Skin *) self; + return (spine_color) &_self->getColor(); } diff --git a/spine-c/src/generated/skin.h b/spine-c/src/generated/skin.h index 101a12d35..bfe3a7227 100644 --- a/spine-c/src/generated/skin.h +++ b/spine-c/src/generated/skin.h @@ -8,15 +8,15 @@ extern "C" { #endif -SPINE_C_API spine_skin spine_skin_create(const char * name); +SPINE_C_API spine_skin spine_skin_create(const char *name); SPINE_C_API void spine_skin_dispose(spine_skin self); -SPINE_C_API void spine_skin_set_attachment(spine_skin self, size_t slotIndex, const char * name, spine_attachment attachment); -SPINE_C_API spine_attachment spine_skin_get_attachment(spine_skin self, size_t slotIndex, const char * name); -SPINE_C_API void spine_skin_remove_attachment(spine_skin self, size_t slotIndex, const char * name); +SPINE_C_API void spine_skin_set_attachment(spine_skin self, size_t slotIndex, const char *name, spine_attachment attachment); +SPINE_C_API spine_attachment spine_skin_get_attachment(spine_skin self, size_t slotIndex, const char *name); +SPINE_C_API void spine_skin_remove_attachment(spine_skin self, size_t slotIndex, const char *name); SPINE_C_API void spine_skin_find_attachments_for_slot(spine_skin self, size_t slotIndex, spine_array_attachment attachments); -SPINE_C_API const char * spine_skin_get_name(spine_skin self); +SPINE_C_API const char *spine_skin_get_name(spine_skin self); SPINE_C_API void spine_skin_add_skin(spine_skin self, spine_skin other); SPINE_C_API void spine_skin_copy_skin(spine_skin self, spine_skin other); SPINE_C_API spine_array_bone_data spine_skin_get_bones(spine_skin self); diff --git a/spine-c/src/generated/slider.cpp b/spine-c/src/generated/slider.cpp index e0b9f05ab..f358dd411 100644 --- a/spine-c/src/generated/slider.cpp +++ b/spine-c/src/generated/slider.cpp @@ -4,73 +4,88 @@ using namespace spine; spine_slider spine_slider_create(spine_slider_data data, spine_skeleton skeleton) { - return (spine_slider) new (__FILE__, __LINE__) Slider(*((SliderData*)data), *((Skeleton*)skeleton)); + return (spine_slider) new (__FILE__, __LINE__) Slider(*((SliderData *) data), *((Skeleton *) skeleton)); } void spine_slider_dispose(spine_slider self) { - delete (Slider*)self; + delete (Slider *) self; } spine_rtti spine_slider_get_rtti(spine_slider self) { - return (spine_rtti)&((Slider*)self)->getRTTI(); + Slider *_self = (Slider *) self; + return (spine_rtti) &_self->getRTTI(); } spine_slider spine_slider_copy(spine_slider self, spine_skeleton skeleton) { - return (spine_slider)((Slider*)self)->copy(*((Skeleton*)skeleton)); + Slider *_self = (Slider *) self; + return (spine_slider) _self->copy(*((Skeleton *) skeleton)); } void spine_slider_update(spine_slider self, spine_skeleton skeleton, spine_physics physics) { - ((Slider*)self)->update(*((Skeleton*)skeleton), (Physics)physics); + Slider *_self = (Slider *) self; + _self->update(*((Skeleton *) skeleton), (Physics) physics); } void spine_slider_sort(spine_slider self, spine_skeleton skeleton) { - ((Slider*)self)->sort(*((Skeleton*)skeleton)); + Slider *_self = (Slider *) self; + _self->sort(*((Skeleton *) skeleton)); } bool spine_slider_is_source_active(spine_slider self) { - return ((Slider*)self)->isSourceActive(); + Slider *_self = (Slider *) self; + return _self->isSourceActive(); } spine_bone spine_slider_get_bone(spine_slider self) { - return (spine_bone)((Slider*)self)->getBone(); + Slider *_self = (Slider *) self; + return (spine_bone) _self->getBone(); } void spine_slider_set_bone(spine_slider self, spine_bone bone) { - ((Slider*)self)->setBone((Bone *)bone); + Slider *_self = (Slider *) self; + _self->setBone((Bone *) bone); } spine_slider_data spine_slider_get_data(spine_slider self) { - return (spine_slider_data)&((ConstraintGeneric*)(Slider*)self)->getData(); + ConstraintGeneric *_self = (ConstraintGeneric *) (Slider *) self; + return (spine_slider_data) &_self->getData(); } spine_slider_pose spine_slider_get_pose(spine_slider self) { - return (spine_slider_pose)&((ConstraintGeneric*)(Slider*)self)->getPose(); + ConstraintGeneric *_self = (ConstraintGeneric *) (Slider *) self; + return (spine_slider_pose) &_self->getPose(); } spine_slider_pose spine_slider_get_applied_pose(spine_slider self) { - return (spine_slider_pose)&((ConstraintGeneric*)(Slider*)self)->getAppliedPose(); + ConstraintGeneric *_self = (ConstraintGeneric *) (Slider *) self; + return (spine_slider_pose) &_self->getAppliedPose(); } void spine_slider_reset_constrained(spine_slider self) { - ((ConstraintGeneric*)(Slider*)self)->resetConstrained(); + ConstraintGeneric *_self = (ConstraintGeneric *) (Slider *) self; + _self->resetConstrained(); } void spine_slider_constrained(spine_slider self) { - ((ConstraintGeneric*)(Slider*)self)->constrained(); + ConstraintGeneric *_self = (ConstraintGeneric *) (Slider *) self; + _self->constrained(); } bool spine_slider_is_pose_equal_to_applied(spine_slider self) { - return ((ConstraintGeneric*)(Slider*)self)->isPoseEqualToApplied(); + ConstraintGeneric *_self = (ConstraintGeneric *) (Slider *) self; + return _self->isPoseEqualToApplied(); } bool spine_slider_is_active(spine_slider self) { - return ((ConstraintGeneric*)(Slider*)self)->isActive(); + ConstraintGeneric *_self = (ConstraintGeneric *) (Slider *) self; + return _self->isActive(); } void spine_slider_set_active(spine_slider self, bool active) { - ((ConstraintGeneric*)(Slider*)self)->setActive(active); + ConstraintGeneric *_self = (ConstraintGeneric *) (Slider *) self; + _self->setActive(active); } spine_rtti spine_slider_rtti(void) { - return (spine_rtti)&Slider::rtti; + return (spine_rtti) &Slider::rtti; } diff --git a/spine-c/src/generated/slider_data.cpp b/spine-c/src/generated/slider_data.cpp index 6050025f2..989055886 100644 --- a/spine-c/src/generated/slider_data.cpp +++ b/spine-c/src/generated/slider_data.cpp @@ -3,102 +3,124 @@ using namespace spine; -spine_slider_data spine_slider_data_create(const char * name) { - return (spine_slider_data) new (__FILE__, __LINE__) SliderData(String(name)); +spine_slider_data spine_slider_data_create(const char *name) { + return (spine_slider_data) new (__FILE__, __LINE__) SliderData(String(name)); } void spine_slider_data_dispose(spine_slider_data self) { - delete (SliderData*)self; + delete (SliderData *) self; } spine_rtti spine_slider_data_get_rtti(spine_slider_data self) { - return (spine_rtti)&((SliderData*)self)->getRTTI(); + SliderData *_self = (SliderData *) self; + return (spine_rtti) &_self->getRTTI(); } spine_constraint spine_slider_data_create_method(spine_slider_data self, spine_skeleton skeleton) { - return (spine_constraint)((SliderData*)self)->create(*((Skeleton*)skeleton)); + SliderData *_self = (SliderData *) self; + return (spine_constraint) _self->create(*((Skeleton *) skeleton)); } spine_animation spine_slider_data_get_animation(spine_slider_data self) { - return (spine_animation)((SliderData*)self)->getAnimation(); + SliderData *_self = (SliderData *) self; + return (spine_animation) _self->getAnimation(); } void spine_slider_data_set_animation(spine_slider_data self, spine_animation animation) { - ((SliderData*)self)->setAnimation((Animation *)animation); + SliderData *_self = (SliderData *) self; + _self->setAnimation((Animation *) animation); } bool spine_slider_data_get_additive(spine_slider_data self) { - return ((SliderData*)self)->getAdditive(); + SliderData *_self = (SliderData *) self; + return _self->getAdditive(); } void spine_slider_data_set_additive(spine_slider_data self, bool additive) { - ((SliderData*)self)->setAdditive(additive); + SliderData *_self = (SliderData *) self; + _self->setAdditive(additive); } bool spine_slider_data_get_loop(spine_slider_data self) { - return ((SliderData*)self)->getLoop(); + SliderData *_self = (SliderData *) self; + return _self->getLoop(); } void spine_slider_data_set_loop(spine_slider_data self, bool loop) { - ((SliderData*)self)->setLoop(loop); + SliderData *_self = (SliderData *) self; + _self->setLoop(loop); } spine_bone_data spine_slider_data_get_bone(spine_slider_data self) { - return (spine_bone_data)((SliderData*)self)->getBone(); + SliderData *_self = (SliderData *) self; + return (spine_bone_data) _self->getBone(); } void spine_slider_data_set_bone(spine_slider_data self, spine_bone_data bone) { - ((SliderData*)self)->setBone((BoneData *)bone); + SliderData *_self = (SliderData *) self; + _self->setBone((BoneData *) bone); } spine_from_property spine_slider_data_get_property(spine_slider_data self) { - return (spine_from_property)((SliderData*)self)->getProperty(); + SliderData *_self = (SliderData *) self; + return (spine_from_property) _self->getProperty(); } void spine_slider_data_set_property(spine_slider_data self, spine_from_property property) { - ((SliderData*)self)->setProperty((FromProperty *)property); + SliderData *_self = (SliderData *) self; + _self->setProperty((FromProperty *) property); } float spine_slider_data_get_scale(spine_slider_data self) { - return ((SliderData*)self)->getScale(); + SliderData *_self = (SliderData *) self; + return _self->getScale(); } void spine_slider_data_set_scale(spine_slider_data self, float scale) { - ((SliderData*)self)->setScale(scale); + SliderData *_self = (SliderData *) self; + _self->setScale(scale); } float spine_slider_data_get_offset(spine_slider_data self) { - return ((SliderData*)self)->getOffset(); + SliderData *_self = (SliderData *) self; + return _self->getOffset(); } void spine_slider_data_set_offset(spine_slider_data self, float offset) { - ((SliderData*)self)->setOffset(offset); + SliderData *_self = (SliderData *) self; + _self->setOffset(offset); } bool spine_slider_data_get_local(spine_slider_data self) { - return ((SliderData*)self)->getLocal(); + SliderData *_self = (SliderData *) self; + return _self->getLocal(); } void spine_slider_data_set_local(spine_slider_data self, bool local) { - ((SliderData*)self)->setLocal(local); + SliderData *_self = (SliderData *) self; + _self->setLocal(local); } -const char * spine_slider_data_get_name(spine_slider_data self) { - return ((ConstraintDataGeneric*)(SliderData*)self)->getName().buffer(); +const char *spine_slider_data_get_name(spine_slider_data self) { + ConstraintDataGeneric *_self = (ConstraintDataGeneric *) (SliderData *) self; + return _self->getName().buffer(); } bool spine_slider_data_get_skin_required(spine_slider_data self) { - return ((ConstraintDataGeneric*)(SliderData*)self)->getSkinRequired(); + ConstraintDataGeneric *_self = (ConstraintDataGeneric *) (SliderData *) self; + return _self->getSkinRequired(); } spine_slider_pose spine_slider_data_get_setup_pose(spine_slider_data self) { - return (spine_slider_pose)&((ConstraintDataGeneric*)(SliderData*)self)->getSetupPose(); + ConstraintDataGeneric *_self = (ConstraintDataGeneric *) (SliderData *) self; + return (spine_slider_pose) &_self->getSetupPose(); } void spine_slider_data_set_skin_required(spine_slider_data self, bool skinRequired) { - ((ConstraintDataGeneric*)(SliderData*)self)->setSkinRequired(skinRequired); + ConstraintDataGeneric *_self = (ConstraintDataGeneric *) (SliderData *) self; + _self->setSkinRequired(skinRequired); } spine_rtti spine_slider_data_rtti(void) { - return (spine_rtti)&SliderData::rtti; + return (spine_rtti) &SliderData::rtti; } diff --git a/spine-c/src/generated/slider_data.h b/spine-c/src/generated/slider_data.h index ef8e158f7..78643b015 100644 --- a/spine-c/src/generated/slider_data.h +++ b/spine-c/src/generated/slider_data.h @@ -8,7 +8,7 @@ extern "C" { #endif -SPINE_C_API spine_slider_data spine_slider_data_create(const char * name); +SPINE_C_API spine_slider_data spine_slider_data_create(const char *name); SPINE_C_API void spine_slider_data_dispose(spine_slider_data self); @@ -30,7 +30,7 @@ SPINE_C_API float spine_slider_data_get_offset(spine_slider_data self); SPINE_C_API void spine_slider_data_set_offset(spine_slider_data self, float offset); SPINE_C_API bool spine_slider_data_get_local(spine_slider_data self); SPINE_C_API void spine_slider_data_set_local(spine_slider_data self, bool local); -SPINE_C_API const char * spine_slider_data_get_name(spine_slider_data self); +SPINE_C_API const char *spine_slider_data_get_name(spine_slider_data self); SPINE_C_API bool spine_slider_data_get_skin_required(spine_slider_data self); SPINE_C_API spine_slider_pose spine_slider_data_get_setup_pose(spine_slider_data self); SPINE_C_API void spine_slider_data_set_skin_required(spine_slider_data self, bool skinRequired); diff --git a/spine-c/src/generated/slider_mix_timeline.cpp b/spine-c/src/generated/slider_mix_timeline.cpp index a348e167b..3edd92048 100644 --- a/spine-c/src/generated/slider_mix_timeline.cpp +++ b/spine-c/src/generated/slider_mix_timeline.cpp @@ -4,93 +4,120 @@ using namespace spine; spine_slider_mix_timeline spine_slider_mix_timeline_create(size_t frameCount, size_t bezierCount, int sliderIndex) { - return (spine_slider_mix_timeline) new (__FILE__, __LINE__) SliderMixTimeline(frameCount, bezierCount, sliderIndex); + return (spine_slider_mix_timeline) new (__FILE__, __LINE__) SliderMixTimeline(frameCount, bezierCount, sliderIndex); } void spine_slider_mix_timeline_dispose(spine_slider_mix_timeline self) { - delete (SliderMixTimeline*)self; + delete (SliderMixTimeline *) self; } spine_rtti spine_slider_mix_timeline_get_rtti(spine_slider_mix_timeline self) { - return (spine_rtti)&((SliderMixTimeline*)self)->getRTTI(); + SliderMixTimeline *_self = (SliderMixTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_slider_mix_timeline_apply(spine_slider_mix_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((SliderMixTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_slider_mix_timeline_apply(spine_slider_mix_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + SliderMixTimeline *_self = (SliderMixTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_slider_mix_timeline_set_frame(spine_slider_mix_timeline self, size_t frame, float time, float value) { - ((ConstraintTimeline1*)(SliderMixTimeline*)self)->setFrame(frame, time, value); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderMixTimeline *) self; + _self->setFrame(frame, time, value); } float spine_slider_mix_timeline_get_curve_value(spine_slider_mix_timeline self, float time) { - return ((ConstraintTimeline1*)(SliderMixTimeline*)self)->getCurveValue(time); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderMixTimeline *) self; + return _self->getCurveValue(time); } -float spine_slider_mix_timeline_get_relative_value(spine_slider_mix_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((ConstraintTimeline1*)(SliderMixTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_slider_mix_timeline_get_relative_value(spine_slider_mix_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderMixTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_slider_mix_timeline_get_absolute_value_1(spine_slider_mix_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((ConstraintTimeline1*)(SliderMixTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_slider_mix_timeline_get_absolute_value_1(spine_slider_mix_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderMixTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_slider_mix_timeline_get_absolute_value_2(spine_slider_mix_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((ConstraintTimeline1*)(SliderMixTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_slider_mix_timeline_get_absolute_value_2(spine_slider_mix_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup, float value) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderMixTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_slider_mix_timeline_get_scale_value(spine_slider_mix_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((ConstraintTimeline1*)(SliderMixTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_slider_mix_timeline_get_scale_value(spine_slider_mix_timeline self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderMixTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_slider_mix_timeline_set_linear(spine_slider_mix_timeline self, size_t frame) { - ((ConstraintTimeline1*)(SliderMixTimeline*)self)->setLinear(frame); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderMixTimeline *) self; + _self->setLinear(frame); } void spine_slider_mix_timeline_set_stepped(spine_slider_mix_timeline self, size_t frame) { - ((ConstraintTimeline1*)(SliderMixTimeline*)self)->setStepped(frame); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderMixTimeline *) self; + _self->setStepped(frame); } -void spine_slider_mix_timeline_set_bezier(spine_slider_mix_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((ConstraintTimeline1*)(SliderMixTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_slider_mix_timeline_set_bezier(spine_slider_mix_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderMixTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_slider_mix_timeline_get_bezier_value(spine_slider_mix_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((ConstraintTimeline1*)(SliderMixTimeline*)self)->getBezierValue(time, frame, valueOffset, i); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderMixTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_slider_mix_timeline_get_curves(spine_slider_mix_timeline self) { - return (spine_array_float)&((ConstraintTimeline1*)(SliderMixTimeline*)self)->getCurves(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderMixTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_slider_mix_timeline_get_frame_entries(spine_slider_mix_timeline self) { - return ((ConstraintTimeline1*)(SliderMixTimeline*)self)->getFrameEntries(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderMixTimeline *) self; + return _self->getFrameEntries(); } size_t spine_slider_mix_timeline_get_frame_count(spine_slider_mix_timeline self) { - return ((ConstraintTimeline1*)(SliderMixTimeline*)self)->getFrameCount(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderMixTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_slider_mix_timeline_get_frames(spine_slider_mix_timeline self) { - return (spine_array_float)&((ConstraintTimeline1*)(SliderMixTimeline*)self)->getFrames(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderMixTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_slider_mix_timeline_get_duration(spine_slider_mix_timeline self) { - return ((ConstraintTimeline1*)(SliderMixTimeline*)self)->getDuration(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderMixTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_slider_mix_timeline_get_property_ids(spine_slider_mix_timeline self) { - return (spine_array_property_id)&((ConstraintTimeline1*)(SliderMixTimeline*)self)->getPropertyIds(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderMixTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_slider_mix_timeline_get_constraint_index(spine_slider_mix_timeline self) { - return ((ConstraintTimeline1*)(SliderMixTimeline*)self)->getConstraintIndex(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderMixTimeline *) self; + return _self->getConstraintIndex(); } void spine_slider_mix_timeline_set_constraint_index(spine_slider_mix_timeline self, int inValue) { - ((ConstraintTimeline1*)(SliderMixTimeline*)self)->setConstraintIndex(inValue); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderMixTimeline *) self; + _self->setConstraintIndex(inValue); } spine_rtti spine_slider_mix_timeline_rtti(void) { - return (spine_rtti)&SliderMixTimeline::rtti; + return (spine_rtti) &SliderMixTimeline::rtti; } diff --git a/spine-c/src/generated/slider_mix_timeline.h b/spine-c/src/generated/slider_mix_timeline.h index 83a979039..2f3c9b1ae 100644 --- a/spine-c/src/generated/slider_mix_timeline.h +++ b/spine-c/src/generated/slider_mix_timeline.h @@ -13,16 +13,23 @@ SPINE_C_API spine_slider_mix_timeline spine_slider_mix_timeline_create(size_t fr SPINE_C_API void spine_slider_mix_timeline_dispose(spine_slider_mix_timeline self); SPINE_C_API spine_rtti spine_slider_mix_timeline_get_rtti(spine_slider_mix_timeline self); -SPINE_C_API void spine_slider_mix_timeline_apply(spine_slider_mix_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_slider_mix_timeline_apply(spine_slider_mix_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); SPINE_C_API void spine_slider_mix_timeline_set_frame(spine_slider_mix_timeline self, size_t frame, float time, float value); SPINE_C_API float spine_slider_mix_timeline_get_curve_value(spine_slider_mix_timeline self, float time); -SPINE_C_API float spine_slider_mix_timeline_get_relative_value(spine_slider_mix_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_slider_mix_timeline_get_absolute_value_1(spine_slider_mix_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_slider_mix_timeline_get_absolute_value_2(spine_slider_mix_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_slider_mix_timeline_get_scale_value(spine_slider_mix_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_slider_mix_timeline_get_relative_value(spine_slider_mix_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup); +SPINE_C_API float spine_slider_mix_timeline_get_absolute_value_1(spine_slider_mix_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup); +SPINE_C_API float spine_slider_mix_timeline_get_absolute_value_2(spine_slider_mix_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup, float value); +SPINE_C_API float spine_slider_mix_timeline_get_scale_value(spine_slider_mix_timeline self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup); SPINE_C_API void spine_slider_mix_timeline_set_linear(spine_slider_mix_timeline self, size_t frame); SPINE_C_API void spine_slider_mix_timeline_set_stepped(spine_slider_mix_timeline self, size_t frame); -SPINE_C_API void spine_slider_mix_timeline_set_bezier(spine_slider_mix_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_slider_mix_timeline_set_bezier(spine_slider_mix_timeline self, size_t bezier, size_t frame, float value, float time1, + float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_slider_mix_timeline_get_bezier_value(spine_slider_mix_timeline self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_slider_mix_timeline_get_curves(spine_slider_mix_timeline self); SPINE_C_API size_t spine_slider_mix_timeline_get_frame_entries(spine_slider_mix_timeline self); diff --git a/spine-c/src/generated/slider_pose.cpp b/spine-c/src/generated/slider_pose.cpp index 3e8c83704..bd9f8bc1d 100644 --- a/spine-c/src/generated/slider_pose.cpp +++ b/spine-c/src/generated/slider_pose.cpp @@ -4,29 +4,34 @@ using namespace spine; spine_slider_pose spine_slider_pose_create(void) { - return (spine_slider_pose) new (__FILE__, __LINE__) SliderPose(); + return (spine_slider_pose) new (__FILE__, __LINE__) SliderPose(); } void spine_slider_pose_dispose(spine_slider_pose self) { - delete (SliderPose*)self; + delete (SliderPose *) self; } void spine_slider_pose_set(spine_slider_pose self, spine_slider_pose pose) { - ((SliderPose*)self)->set(*((SliderPose*)pose)); + SliderPose *_self = (SliderPose *) self; + _self->set(*((SliderPose *) pose)); } float spine_slider_pose_get_time(spine_slider_pose self) { - return ((SliderPose*)self)->getTime(); + SliderPose *_self = (SliderPose *) self; + return _self->getTime(); } void spine_slider_pose_set_time(spine_slider_pose self, float time) { - ((SliderPose*)self)->setTime(time); + SliderPose *_self = (SliderPose *) self; + _self->setTime(time); } float spine_slider_pose_get_mix(spine_slider_pose self) { - return ((SliderPose*)self)->getMix(); + SliderPose *_self = (SliderPose *) self; + return _self->getMix(); } void spine_slider_pose_set_mix(spine_slider_pose self, float mix) { - ((SliderPose*)self)->setMix(mix); + SliderPose *_self = (SliderPose *) self; + _self->setMix(mix); } diff --git a/spine-c/src/generated/slider_timeline.cpp b/spine-c/src/generated/slider_timeline.cpp index 26f800737..d89d3a64f 100644 --- a/spine-c/src/generated/slider_timeline.cpp +++ b/spine-c/src/generated/slider_timeline.cpp @@ -4,93 +4,120 @@ using namespace spine; spine_slider_timeline spine_slider_timeline_create(size_t frameCount, size_t bezierCount, int sliderIndex) { - return (spine_slider_timeline) new (__FILE__, __LINE__) SliderTimeline(frameCount, bezierCount, sliderIndex); + return (spine_slider_timeline) new (__FILE__, __LINE__) SliderTimeline(frameCount, bezierCount, sliderIndex); } void spine_slider_timeline_dispose(spine_slider_timeline self) { - delete (SliderTimeline*)self; + delete (SliderTimeline *) self; } spine_rtti spine_slider_timeline_get_rtti(spine_slider_timeline self) { - return (spine_rtti)&((SliderTimeline*)self)->getRTTI(); + SliderTimeline *_self = (SliderTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_slider_timeline_apply(spine_slider_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((SliderTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_slider_timeline_apply(spine_slider_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + SliderTimeline *_self = (SliderTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_slider_timeline_set_frame(spine_slider_timeline self, size_t frame, float time, float value) { - ((ConstraintTimeline1*)(SliderTimeline*)self)->setFrame(frame, time, value); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderTimeline *) self; + _self->setFrame(frame, time, value); } float spine_slider_timeline_get_curve_value(spine_slider_timeline self, float time) { - return ((ConstraintTimeline1*)(SliderTimeline*)self)->getCurveValue(time); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderTimeline *) self; + return _self->getCurveValue(time); } -float spine_slider_timeline_get_relative_value(spine_slider_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((ConstraintTimeline1*)(SliderTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_slider_timeline_get_relative_value(spine_slider_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_slider_timeline_get_absolute_value_1(spine_slider_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((ConstraintTimeline1*)(SliderTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_slider_timeline_get_absolute_value_1(spine_slider_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_slider_timeline_get_absolute_value_2(spine_slider_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((ConstraintTimeline1*)(SliderTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_slider_timeline_get_absolute_value_2(spine_slider_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup, float value) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_slider_timeline_get_scale_value(spine_slider_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((ConstraintTimeline1*)(SliderTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_slider_timeline_get_scale_value(spine_slider_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, + float current, float setup) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_slider_timeline_set_linear(spine_slider_timeline self, size_t frame) { - ((ConstraintTimeline1*)(SliderTimeline*)self)->setLinear(frame); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderTimeline *) self; + _self->setLinear(frame); } void spine_slider_timeline_set_stepped(spine_slider_timeline self, size_t frame) { - ((ConstraintTimeline1*)(SliderTimeline*)self)->setStepped(frame); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderTimeline *) self; + _self->setStepped(frame); } -void spine_slider_timeline_set_bezier(spine_slider_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((ConstraintTimeline1*)(SliderTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_slider_timeline_set_bezier(spine_slider_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, + float cy1, float cx2, float cy2, float time2, float value2) { + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_slider_timeline_get_bezier_value(spine_slider_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((ConstraintTimeline1*)(SliderTimeline*)self)->getBezierValue(time, frame, valueOffset, i); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_slider_timeline_get_curves(spine_slider_timeline self) { - return (spine_array_float)&((ConstraintTimeline1*)(SliderTimeline*)self)->getCurves(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_slider_timeline_get_frame_entries(spine_slider_timeline self) { - return ((ConstraintTimeline1*)(SliderTimeline*)self)->getFrameEntries(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderTimeline *) self; + return _self->getFrameEntries(); } size_t spine_slider_timeline_get_frame_count(spine_slider_timeline self) { - return ((ConstraintTimeline1*)(SliderTimeline*)self)->getFrameCount(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_slider_timeline_get_frames(spine_slider_timeline self) { - return (spine_array_float)&((ConstraintTimeline1*)(SliderTimeline*)self)->getFrames(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_slider_timeline_get_duration(spine_slider_timeline self) { - return ((ConstraintTimeline1*)(SliderTimeline*)self)->getDuration(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_slider_timeline_get_property_ids(spine_slider_timeline self) { - return (spine_array_property_id)&((ConstraintTimeline1*)(SliderTimeline*)self)->getPropertyIds(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_slider_timeline_get_constraint_index(spine_slider_timeline self) { - return ((ConstraintTimeline1*)(SliderTimeline*)self)->getConstraintIndex(); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderTimeline *) self; + return _self->getConstraintIndex(); } void spine_slider_timeline_set_constraint_index(spine_slider_timeline self, int inValue) { - ((ConstraintTimeline1*)(SliderTimeline*)self)->setConstraintIndex(inValue); + ConstraintTimeline1 *_self = (ConstraintTimeline1 *) (SliderTimeline *) self; + _self->setConstraintIndex(inValue); } spine_rtti spine_slider_timeline_rtti(void) { - return (spine_rtti)&SliderTimeline::rtti; + return (spine_rtti) &SliderTimeline::rtti; } diff --git a/spine-c/src/generated/slider_timeline.h b/spine-c/src/generated/slider_timeline.h index 005744eea..4fad6fce4 100644 --- a/spine-c/src/generated/slider_timeline.h +++ b/spine-c/src/generated/slider_timeline.h @@ -13,16 +13,23 @@ SPINE_C_API spine_slider_timeline spine_slider_timeline_create(size_t frameCount SPINE_C_API void spine_slider_timeline_dispose(spine_slider_timeline self); SPINE_C_API spine_rtti spine_slider_timeline_get_rtti(spine_slider_timeline self); -SPINE_C_API void spine_slider_timeline_apply(spine_slider_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_slider_timeline_apply(spine_slider_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); SPINE_C_API void spine_slider_timeline_set_frame(spine_slider_timeline self, size_t frame, float time, float value); SPINE_C_API float spine_slider_timeline_get_curve_value(spine_slider_timeline self, float time); -SPINE_C_API float spine_slider_timeline_get_relative_value(spine_slider_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_slider_timeline_get_absolute_value_1(spine_slider_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_slider_timeline_get_absolute_value_2(spine_slider_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_slider_timeline_get_scale_value(spine_slider_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_slider_timeline_get_relative_value(spine_slider_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup); +SPINE_C_API float spine_slider_timeline_get_absolute_value_1(spine_slider_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup); +SPINE_C_API float spine_slider_timeline_get_absolute_value_2(spine_slider_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup, float value); +SPINE_C_API float spine_slider_timeline_get_scale_value(spine_slider_timeline self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup); SPINE_C_API void spine_slider_timeline_set_linear(spine_slider_timeline self, size_t frame); SPINE_C_API void spine_slider_timeline_set_stepped(spine_slider_timeline self, size_t frame); -SPINE_C_API void spine_slider_timeline_set_bezier(spine_slider_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_slider_timeline_set_bezier(spine_slider_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_slider_timeline_get_bezier_value(spine_slider_timeline self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_slider_timeline_get_curves(spine_slider_timeline self); SPINE_C_API size_t spine_slider_timeline_get_frame_entries(spine_slider_timeline self); diff --git a/spine-c/src/generated/slot.cpp b/spine-c/src/generated/slot.cpp index 3a6722859..7d510318d 100644 --- a/spine-c/src/generated/slot.cpp +++ b/spine-c/src/generated/slot.cpp @@ -4,41 +4,49 @@ using namespace spine; spine_slot spine_slot_create(spine_slot_data data, spine_skeleton skeleton) { - return (spine_slot) new (__FILE__, __LINE__) Slot(*((SlotData*)data), *((Skeleton*)skeleton)); + return (spine_slot) new (__FILE__, __LINE__) Slot(*((SlotData *) data), *((Skeleton *) skeleton)); } void spine_slot_dispose(spine_slot self) { - delete (Slot*)self; + delete (Slot *) self; } spine_bone spine_slot_get_bone(spine_slot self) { - return (spine_bone)&((Slot*)self)->getBone(); + Slot *_self = (Slot *) self; + return (spine_bone) &_self->getBone(); } void spine_slot_setup_pose(spine_slot self) { - ((Slot*)self)->setupPose(); + Slot *_self = (Slot *) self; + _self->setupPose(); } spine_slot_data spine_slot_get_data(spine_slot self) { - return (spine_slot_data)&((PosedGeneric*)(Slot*)self)->getData(); + PosedGeneric *_self = (PosedGeneric *) (Slot *) self; + return (spine_slot_data) &_self->getData(); } spine_slot_pose spine_slot_get_pose(spine_slot self) { - return (spine_slot_pose)&((PosedGeneric*)(Slot*)self)->getPose(); + PosedGeneric *_self = (PosedGeneric *) (Slot *) self; + return (spine_slot_pose) &_self->getPose(); } spine_slot_pose spine_slot_get_applied_pose(spine_slot self) { - return (spine_slot_pose)&((PosedGeneric*)(Slot*)self)->getAppliedPose(); + PosedGeneric *_self = (PosedGeneric *) (Slot *) self; + return (spine_slot_pose) &_self->getAppliedPose(); } void spine_slot_reset_constrained(spine_slot self) { - ((PosedGeneric*)(Slot*)self)->resetConstrained(); + PosedGeneric *_self = (PosedGeneric *) (Slot *) self; + _self->resetConstrained(); } void spine_slot_constrained(spine_slot self) { - ((PosedGeneric*)(Slot*)self)->constrained(); + PosedGeneric *_self = (PosedGeneric *) (Slot *) self; + _self->constrained(); } bool spine_slot_is_pose_equal_to_applied(spine_slot self) { - return ((PosedGeneric*)(Slot*)self)->isPoseEqualToApplied(); + PosedGeneric *_self = (PosedGeneric *) (Slot *) self; + return _self->isPoseEqualToApplied(); } diff --git a/spine-c/src/generated/slot_curve_timeline.cpp b/spine-c/src/generated/slot_curve_timeline.cpp index abb2d2da6..ecb0d5d7b 100644 --- a/spine-c/src/generated/slot_curve_timeline.cpp +++ b/spine-c/src/generated/slot_curve_timeline.cpp @@ -4,65 +4,82 @@ using namespace spine; void spine_slot_curve_timeline_dispose(spine_slot_curve_timeline self) { - delete (SlotCurveTimeline*)self; + delete (SlotCurveTimeline *) self; } spine_rtti spine_slot_curve_timeline_get_rtti(spine_slot_curve_timeline self) { - return (spine_rtti)&((SlotCurveTimeline*)self)->getRTTI(); + SlotCurveTimeline *_self = (SlotCurveTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_slot_curve_timeline_apply(spine_slot_curve_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((SlotCurveTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_slot_curve_timeline_apply(spine_slot_curve_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + SlotCurveTimeline *_self = (SlotCurveTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_slot_curve_timeline_set_linear(spine_slot_curve_timeline self, size_t frame) { - ((CurveTimeline*)(SlotCurveTimeline*)self)->setLinear(frame); + CurveTimeline *_self = (CurveTimeline *) (SlotCurveTimeline *) self; + _self->setLinear(frame); } void spine_slot_curve_timeline_set_stepped(spine_slot_curve_timeline self, size_t frame) { - ((CurveTimeline*)(SlotCurveTimeline*)self)->setStepped(frame); + CurveTimeline *_self = (CurveTimeline *) (SlotCurveTimeline *) self; + _self->setStepped(frame); } -void spine_slot_curve_timeline_set_bezier(spine_slot_curve_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((CurveTimeline*)(SlotCurveTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_slot_curve_timeline_set_bezier(spine_slot_curve_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2) { + CurveTimeline *_self = (CurveTimeline *) (SlotCurveTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_slot_curve_timeline_get_bezier_value(spine_slot_curve_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((CurveTimeline*)(SlotCurveTimeline*)self)->getBezierValue(time, frame, valueOffset, i); + CurveTimeline *_self = (CurveTimeline *) (SlotCurveTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_slot_curve_timeline_get_curves(spine_slot_curve_timeline self) { - return (spine_array_float)&((CurveTimeline*)(SlotCurveTimeline*)self)->getCurves(); + CurveTimeline *_self = (CurveTimeline *) (SlotCurveTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_slot_curve_timeline_get_frame_entries(spine_slot_curve_timeline self) { - return ((CurveTimeline*)(SlotCurveTimeline*)self)->getFrameEntries(); + CurveTimeline *_self = (CurveTimeline *) (SlotCurveTimeline *) self; + return _self->getFrameEntries(); } size_t spine_slot_curve_timeline_get_frame_count(spine_slot_curve_timeline self) { - return ((CurveTimeline*)(SlotCurveTimeline*)self)->getFrameCount(); + CurveTimeline *_self = (CurveTimeline *) (SlotCurveTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_slot_curve_timeline_get_frames(spine_slot_curve_timeline self) { - return (spine_array_float)&((CurveTimeline*)(SlotCurveTimeline*)self)->getFrames(); + CurveTimeline *_self = (CurveTimeline *) (SlotCurveTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_slot_curve_timeline_get_duration(spine_slot_curve_timeline self) { - return ((CurveTimeline*)(SlotCurveTimeline*)self)->getDuration(); + CurveTimeline *_self = (CurveTimeline *) (SlotCurveTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_slot_curve_timeline_get_property_ids(spine_slot_curve_timeline self) { - return (spine_array_property_id)&((CurveTimeline*)(SlotCurveTimeline*)self)->getPropertyIds(); + CurveTimeline *_self = (CurveTimeline *) (SlotCurveTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_slot_curve_timeline_get_slot_index(spine_slot_curve_timeline self) { - return ((SlotTimeline*)(SlotCurveTimeline*)self)->getSlotIndex(); + SlotTimeline *_self = (SlotTimeline *) (SlotCurveTimeline *) self; + return _self->getSlotIndex(); } void spine_slot_curve_timeline_set_slot_index(spine_slot_curve_timeline self, int inValue) { - ((SlotTimeline*)(SlotCurveTimeline*)self)->setSlotIndex(inValue); + SlotTimeline *_self = (SlotTimeline *) (SlotCurveTimeline *) self; + _self->setSlotIndex(inValue); } spine_rtti spine_slot_curve_timeline_rtti(void) { - return (spine_rtti)&SlotCurveTimeline::rtti; + return (spine_rtti) &SlotCurveTimeline::rtti; } diff --git a/spine-c/src/generated/slot_curve_timeline.h b/spine-c/src/generated/slot_curve_timeline.h index 3a447c369..43a93d1f8 100644 --- a/spine-c/src/generated/slot_curve_timeline.h +++ b/spine-c/src/generated/slot_curve_timeline.h @@ -11,10 +11,13 @@ extern "C" { SPINE_C_API void spine_slot_curve_timeline_dispose(spine_slot_curve_timeline self); SPINE_C_API spine_rtti spine_slot_curve_timeline_get_rtti(spine_slot_curve_timeline self); -SPINE_C_API void spine_slot_curve_timeline_apply(spine_slot_curve_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_slot_curve_timeline_apply(spine_slot_curve_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); SPINE_C_API void spine_slot_curve_timeline_set_linear(spine_slot_curve_timeline self, size_t frame); SPINE_C_API void spine_slot_curve_timeline_set_stepped(spine_slot_curve_timeline self, size_t frame); -SPINE_C_API void spine_slot_curve_timeline_set_bezier(spine_slot_curve_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_slot_curve_timeline_set_bezier(spine_slot_curve_timeline self, size_t bezier, size_t frame, float value, float time1, + float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_slot_curve_timeline_get_bezier_value(spine_slot_curve_timeline self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_slot_curve_timeline_get_curves(spine_slot_curve_timeline self); SPINE_C_API size_t spine_slot_curve_timeline_get_frame_entries(spine_slot_curve_timeline self); diff --git a/spine-c/src/generated/slot_data.cpp b/spine-c/src/generated/slot_data.cpp index f335ee746..c5e531a7f 100644 --- a/spine-c/src/generated/slot_data.cpp +++ b/spine-c/src/generated/slot_data.cpp @@ -3,58 +3,70 @@ using namespace spine; -spine_slot_data spine_slot_data_create(int index, const char * name, spine_bone_data boneData) { - return (spine_slot_data) new (__FILE__, __LINE__) SlotData(index, String(name), *((BoneData*)boneData)); +spine_slot_data spine_slot_data_create(int index, const char *name, spine_bone_data boneData) { + return (spine_slot_data) new (__FILE__, __LINE__) SlotData(index, String(name), *((BoneData *) boneData)); } void spine_slot_data_dispose(spine_slot_data self) { - delete (SlotData*)self; + delete (SlotData *) self; } int spine_slot_data_get_index(spine_slot_data self) { - return ((SlotData*)self)->getIndex(); + SlotData *_self = (SlotData *) self; + return _self->getIndex(); } spine_bone_data spine_slot_data_get_bone_data(spine_slot_data self) { - return (spine_bone_data)&((SlotData*)self)->getBoneData(); + SlotData *_self = (SlotData *) self; + return (spine_bone_data) &_self->getBoneData(); } -void spine_slot_data_set_attachment_name(spine_slot_data self, const char * attachmentName) { - ((SlotData*)self)->setAttachmentName(String(attachmentName)); +void spine_slot_data_set_attachment_name(spine_slot_data self, const char *attachmentName) { + SlotData *_self = (SlotData *) self; + _self->setAttachmentName(String(attachmentName)); } -const char * spine_slot_data_get_attachment_name(spine_slot_data self) { - return ((SlotData*)self)->getAttachmentName().buffer(); +const char *spine_slot_data_get_attachment_name(spine_slot_data self) { + SlotData *_self = (SlotData *) self; + return _self->getAttachmentName().buffer(); } spine_blend_mode spine_slot_data_get_blend_mode(spine_slot_data self) { - return (spine_blend_mode)((SlotData*)self)->getBlendMode(); + SlotData *_self = (SlotData *) self; + return (spine_blend_mode) _self->getBlendMode(); } void spine_slot_data_set_blend_mode(spine_slot_data self, spine_blend_mode blendMode) { - ((SlotData*)self)->setBlendMode((BlendMode)blendMode); + SlotData *_self = (SlotData *) self; + _self->setBlendMode((BlendMode) blendMode); } bool spine_slot_data_get_visible(spine_slot_data self) { - return ((SlotData*)self)->getVisible(); + SlotData *_self = (SlotData *) self; + return _self->getVisible(); } void spine_slot_data_set_visible(spine_slot_data self, bool visible) { - ((SlotData*)self)->setVisible(visible); + SlotData *_self = (SlotData *) self; + _self->setVisible(visible); } spine_slot_pose spine_slot_data_get_setup_pose(spine_slot_data self) { - return (spine_slot_pose)&((PosedDataGeneric*)(SlotData*)self)->getSetupPose(); + PosedDataGeneric *_self = (PosedDataGeneric *) (SlotData *) self; + return (spine_slot_pose) &_self->getSetupPose(); } -const char * spine_slot_data_get_name(spine_slot_data self) { - return ((PosedDataGeneric*)(SlotData*)self)->getName().buffer(); +const char *spine_slot_data_get_name(spine_slot_data self) { + PosedDataGeneric *_self = (PosedDataGeneric *) (SlotData *) self; + return _self->getName().buffer(); } bool spine_slot_data_get_skin_required(spine_slot_data self) { - return ((PosedDataGeneric*)(SlotData*)self)->getSkinRequired(); + PosedDataGeneric *_self = (PosedDataGeneric *) (SlotData *) self; + return _self->getSkinRequired(); } void spine_slot_data_set_skin_required(spine_slot_data self, bool skinRequired) { - ((PosedDataGeneric*)(SlotData*)self)->setSkinRequired(skinRequired); + PosedDataGeneric *_self = (PosedDataGeneric *) (SlotData *) self; + _self->setSkinRequired(skinRequired); } diff --git a/spine-c/src/generated/slot_data.h b/spine-c/src/generated/slot_data.h index 4e4506d61..6123a838e 100644 --- a/spine-c/src/generated/slot_data.h +++ b/spine-c/src/generated/slot_data.h @@ -8,20 +8,20 @@ extern "C" { #endif -SPINE_C_API spine_slot_data spine_slot_data_create(int index, const char * name, spine_bone_data boneData); +SPINE_C_API spine_slot_data spine_slot_data_create(int index, const char *name, spine_bone_data boneData); SPINE_C_API void spine_slot_data_dispose(spine_slot_data self); SPINE_C_API int spine_slot_data_get_index(spine_slot_data self); SPINE_C_API spine_bone_data spine_slot_data_get_bone_data(spine_slot_data self); -SPINE_C_API void spine_slot_data_set_attachment_name(spine_slot_data self, const char * attachmentName); -SPINE_C_API const char * spine_slot_data_get_attachment_name(spine_slot_data self); +SPINE_C_API void spine_slot_data_set_attachment_name(spine_slot_data self, const char *attachmentName); +SPINE_C_API const char *spine_slot_data_get_attachment_name(spine_slot_data self); SPINE_C_API spine_blend_mode spine_slot_data_get_blend_mode(spine_slot_data self); SPINE_C_API void spine_slot_data_set_blend_mode(spine_slot_data self, spine_blend_mode blendMode); SPINE_C_API bool spine_slot_data_get_visible(spine_slot_data self); SPINE_C_API void spine_slot_data_set_visible(spine_slot_data self, bool visible); SPINE_C_API spine_slot_pose spine_slot_data_get_setup_pose(spine_slot_data self); -SPINE_C_API const char * spine_slot_data_get_name(spine_slot_data self); +SPINE_C_API const char *spine_slot_data_get_name(spine_slot_data self); SPINE_C_API bool spine_slot_data_get_skin_required(spine_slot_data self); SPINE_C_API void spine_slot_data_set_skin_required(spine_slot_data self, bool skinRequired); diff --git a/spine-c/src/generated/slot_pose.cpp b/spine-c/src/generated/slot_pose.cpp index e9fee8104..dc5464634 100644 --- a/spine-c/src/generated/slot_pose.cpp +++ b/spine-c/src/generated/slot_pose.cpp @@ -4,49 +4,59 @@ using namespace spine; spine_slot_pose spine_slot_pose_create(void) { - return (spine_slot_pose) new (__FILE__, __LINE__) SlotPose(); + return (spine_slot_pose) new (__FILE__, __LINE__) SlotPose(); } void spine_slot_pose_dispose(spine_slot_pose self) { - delete (SlotPose*)self; + delete (SlotPose *) self; } void spine_slot_pose_set(spine_slot_pose self, spine_slot_pose pose) { - ((SlotPose*)self)->set(*((SlotPose*)pose)); + SlotPose *_self = (SlotPose *) self; + _self->set(*((SlotPose *) pose)); } spine_color spine_slot_pose_get_color(spine_slot_pose self) { - return (spine_color)&((SlotPose*)self)->getColor(); + SlotPose *_self = (SlotPose *) self; + return (spine_color) &_self->getColor(); } spine_color spine_slot_pose_get_dark_color(spine_slot_pose self) { - return (spine_color)&((SlotPose*)self)->getDarkColor(); + SlotPose *_self = (SlotPose *) self; + return (spine_color) &_self->getDarkColor(); } bool spine_slot_pose_has_dark_color(spine_slot_pose self) { - return ((SlotPose*)self)->hasDarkColor(); + SlotPose *_self = (SlotPose *) self; + return _self->hasDarkColor(); } void spine_slot_pose_set_has_dark_color(spine_slot_pose self, bool hasDarkColor) { - ((SlotPose*)self)->setHasDarkColor(hasDarkColor); + SlotPose *_self = (SlotPose *) self; + _self->setHasDarkColor(hasDarkColor); } spine_attachment spine_slot_pose_get_attachment(spine_slot_pose self) { - return (spine_attachment)((SlotPose*)self)->getAttachment(); + SlotPose *_self = (SlotPose *) self; + return (spine_attachment) _self->getAttachment(); } void spine_slot_pose_set_attachment(spine_slot_pose self, spine_attachment attachment) { - ((SlotPose*)self)->setAttachment((Attachment *)attachment); + SlotPose *_self = (SlotPose *) self; + _self->setAttachment((Attachment *) attachment); } int spine_slot_pose_get_sequence_index(spine_slot_pose self) { - return ((SlotPose*)self)->getSequenceIndex(); + SlotPose *_self = (SlotPose *) self; + return _self->getSequenceIndex(); } void spine_slot_pose_set_sequence_index(spine_slot_pose self, int sequenceIndex) { - ((SlotPose*)self)->setSequenceIndex(sequenceIndex); + SlotPose *_self = (SlotPose *) self; + _self->setSequenceIndex(sequenceIndex); } spine_array_float spine_slot_pose_get_deform(spine_slot_pose self) { - return (spine_array_float)&((SlotPose*)self)->getDeform(); + SlotPose *_self = (SlotPose *) self; + return (spine_array_float) &_self->getDeform(); } diff --git a/spine-c/src/generated/slot_timeline.cpp b/spine-c/src/generated/slot_timeline.cpp index 8a739c353..8a784a38c 100644 --- a/spine-c/src/generated/slot_timeline.cpp +++ b/spine-c/src/generated/slot_timeline.cpp @@ -4,21 +4,24 @@ using namespace spine; void spine_slot_timeline_dispose(spine_slot_timeline self) { - delete (SlotTimeline*)self; + delete (SlotTimeline *) self; } spine_rtti spine_slot_timeline_get_rtti(spine_slot_timeline self) { - return (spine_rtti)&((SlotTimeline*)self)->getRTTI(); + SlotTimeline *_self = (SlotTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } int spine_slot_timeline_get_slot_index(spine_slot_timeline self) { - return ((SlotTimeline*)self)->getSlotIndex(); + SlotTimeline *_self = (SlotTimeline *) self; + return _self->getSlotIndex(); } void spine_slot_timeline_set_slot_index(spine_slot_timeline self, int inValue) { - ((SlotTimeline*)self)->setSlotIndex(inValue); + SlotTimeline *_self = (SlotTimeline *) self; + _self->setSlotIndex(inValue); } spine_rtti spine_slot_timeline_rtti(void) { - return (spine_rtti)&SlotTimeline::rtti; + return (spine_rtti) &SlotTimeline::rtti; } diff --git a/spine-c/src/generated/spacing_mode.h b/spine-c/src/generated/spacing_mode.h index a944521de..e514c7d48 100644 --- a/spine-c/src/generated/spacing_mode.h +++ b/spine-c/src/generated/spacing_mode.h @@ -6,10 +6,10 @@ extern "C" { #endif typedef enum spine_spacing_mode { - SPINE_SPACING_MODE_LENGTH = 0, - SPINE_SPACING_MODE_FIXED, - SPINE_SPACING_MODE_PERCENT, - SPINE_SPACING_MODE_PROPORTIONAL + SPINE_SPACING_MODE_LENGTH = 0, + SPINE_SPACING_MODE_FIXED, + SPINE_SPACING_MODE_PERCENT, + SPINE_SPACING_MODE_PROPORTIONAL } spine_spacing_mode; #ifdef __cplusplus diff --git a/spine-c/src/generated/texture_filter.h b/spine-c/src/generated/texture_filter.h index f3f95a468..134b60772 100644 --- a/spine-c/src/generated/texture_filter.h +++ b/spine-c/src/generated/texture_filter.h @@ -6,14 +6,14 @@ extern "C" { #endif typedef enum spine_texture_filter { - SPINE_TEXTURE_FILTER_UNKNOWN, - SPINE_TEXTURE_FILTER_NEAREST, - SPINE_TEXTURE_FILTER_LINEAR, - SPINE_TEXTURE_FILTER_MIP_MAP, - SPINE_TEXTURE_FILTER_MIP_MAP_NEAREST_NEAREST, - SPINE_TEXTURE_FILTER_MIP_MAP_LINEAR_NEAREST, - SPINE_TEXTURE_FILTER_MIP_MAP_NEAREST_LINEAR, - SPINE_TEXTURE_FILTER_MIP_MAP_LINEAR_LINEAR + SPINE_TEXTURE_FILTER_UNKNOWN, + SPINE_TEXTURE_FILTER_NEAREST, + SPINE_TEXTURE_FILTER_LINEAR, + SPINE_TEXTURE_FILTER_MIP_MAP, + SPINE_TEXTURE_FILTER_MIP_MAP_NEAREST_NEAREST, + SPINE_TEXTURE_FILTER_MIP_MAP_LINEAR_NEAREST, + SPINE_TEXTURE_FILTER_MIP_MAP_NEAREST_LINEAR, + SPINE_TEXTURE_FILTER_MIP_MAP_LINEAR_LINEAR } spine_texture_filter; #ifdef __cplusplus diff --git a/spine-c/src/generated/texture_region.cpp b/spine-c/src/generated/texture_region.cpp index adc5e518f..a0198482a 100644 --- a/spine-c/src/generated/texture_region.cpp +++ b/spine-c/src/generated/texture_region.cpp @@ -4,65 +4,78 @@ using namespace spine; spine_texture_region spine_texture_region_create(void) { - return (spine_texture_region) new (__FILE__, __LINE__) TextureRegion(); + return (spine_texture_region) new (__FILE__, __LINE__) TextureRegion(); } void spine_texture_region_dispose(spine_texture_region self) { - delete (TextureRegion*)self; + delete (TextureRegion *) self; } spine_rtti spine_texture_region_get_rtti(spine_texture_region self) { - return (spine_rtti)&((TextureRegion*)self)->getRTTI(); + TextureRegion *_self = (TextureRegion *) self; + return (spine_rtti) &_self->getRTTI(); } float spine_texture_region_get_u(spine_texture_region self) { - return ((TextureRegion*)self)->getU(); + TextureRegion *_self = (TextureRegion *) self; + return _self->getU(); } void spine_texture_region_set_u(spine_texture_region self, float value) { - ((TextureRegion*)self)->setU(value); + TextureRegion *_self = (TextureRegion *) self; + _self->setU(value); } float spine_texture_region_get_v(spine_texture_region self) { - return ((TextureRegion*)self)->getV(); + TextureRegion *_self = (TextureRegion *) self; + return _self->getV(); } void spine_texture_region_set_v(spine_texture_region self, float value) { - ((TextureRegion*)self)->setV(value); + TextureRegion *_self = (TextureRegion *) self; + _self->setV(value); } float spine_texture_region_get_u2(spine_texture_region self) { - return ((TextureRegion*)self)->getU2(); + TextureRegion *_self = (TextureRegion *) self; + return _self->getU2(); } void spine_texture_region_set_u2(spine_texture_region self, float value) { - ((TextureRegion*)self)->setU2(value); + TextureRegion *_self = (TextureRegion *) self; + _self->setU2(value); } float spine_texture_region_get_v2(spine_texture_region self) { - return ((TextureRegion*)self)->getV2(); + TextureRegion *_self = (TextureRegion *) self; + return _self->getV2(); } void spine_texture_region_set_v2(spine_texture_region self, float value) { - ((TextureRegion*)self)->setV2(value); + TextureRegion *_self = (TextureRegion *) self; + _self->setV2(value); } int spine_texture_region_get_region_width(spine_texture_region self) { - return ((TextureRegion*)self)->getRegionWidth(); + TextureRegion *_self = (TextureRegion *) self; + return _self->getRegionWidth(); } void spine_texture_region_set_region_width(spine_texture_region self, int value) { - ((TextureRegion*)self)->setRegionWidth(value); + TextureRegion *_self = (TextureRegion *) self; + _self->setRegionWidth(value); } int spine_texture_region_get_region_height(spine_texture_region self) { - return ((TextureRegion*)self)->getRegionHeight(); + TextureRegion *_self = (TextureRegion *) self; + return _self->getRegionHeight(); } void spine_texture_region_set_region_height(spine_texture_region self, int value) { - ((TextureRegion*)self)->setRegionHeight(value); + TextureRegion *_self = (TextureRegion *) self; + _self->setRegionHeight(value); } spine_rtti spine_texture_region_rtti(void) { - return (spine_rtti)&TextureRegion::rtti; + return (spine_rtti) &TextureRegion::rtti; } diff --git a/spine-c/src/generated/texture_wrap.h b/spine-c/src/generated/texture_wrap.h index 928430c61..e9953fe63 100644 --- a/spine-c/src/generated/texture_wrap.h +++ b/spine-c/src/generated/texture_wrap.h @@ -6,9 +6,9 @@ extern "C" { #endif typedef enum spine_texture_wrap { - SPINE_TEXTURE_WRAP_MIRRORED_REPEAT, - SPINE_TEXTURE_WRAP_CLAMP_TO_EDGE, - SPINE_TEXTURE_WRAP_REPEAT + SPINE_TEXTURE_WRAP_MIRRORED_REPEAT, + SPINE_TEXTURE_WRAP_CLAMP_TO_EDGE, + SPINE_TEXTURE_WRAP_REPEAT } spine_texture_wrap; #ifdef __cplusplus diff --git a/spine-c/src/generated/timeline.cpp b/spine-c/src/generated/timeline.cpp index 558cb8320..715c4c023 100644 --- a/spine-c/src/generated/timeline.cpp +++ b/spine-c/src/generated/timeline.cpp @@ -4,37 +4,46 @@ using namespace spine; void spine_timeline_dispose(spine_timeline self) { - delete (Timeline*)self; + delete (Timeline *) self; } spine_rtti spine_timeline_get_rtti(spine_timeline self) { - return (spine_rtti)&((Timeline*)self)->getRTTI(); + Timeline *_self = (Timeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_timeline_apply(spine_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((Timeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_timeline_apply(spine_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, + spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + Timeline *_self = (Timeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } size_t spine_timeline_get_frame_entries(spine_timeline self) { - return ((Timeline*)self)->getFrameEntries(); + Timeline *_self = (Timeline *) self; + return _self->getFrameEntries(); } size_t spine_timeline_get_frame_count(spine_timeline self) { - return ((Timeline*)self)->getFrameCount(); + Timeline *_self = (Timeline *) self; + return _self->getFrameCount(); } spine_array_float spine_timeline_get_frames(spine_timeline self) { - return (spine_array_float)&((Timeline*)self)->getFrames(); + Timeline *_self = (Timeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_timeline_get_duration(spine_timeline self) { - return ((Timeline*)self)->getDuration(); + Timeline *_self = (Timeline *) self; + return _self->getDuration(); } spine_array_property_id spine_timeline_get_property_ids(spine_timeline self) { - return (spine_array_property_id)&((Timeline*)self)->getPropertyIds(); + Timeline *_self = (Timeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } spine_rtti spine_timeline_rtti(void) { - return (spine_rtti)&Timeline::rtti; + return (spine_rtti) &Timeline::rtti; } diff --git a/spine-c/src/generated/timeline.h b/spine-c/src/generated/timeline.h index 7b2973a7c..7db7c9de7 100644 --- a/spine-c/src/generated/timeline.h +++ b/spine-c/src/generated/timeline.h @@ -11,7 +11,8 @@ extern "C" { SPINE_C_API void spine_timeline_dispose(spine_timeline self); SPINE_C_API spine_rtti spine_timeline_get_rtti(spine_timeline self); -SPINE_C_API void spine_timeline_apply(spine_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_timeline_apply(spine_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); SPINE_C_API size_t spine_timeline_get_frame_entries(spine_timeline self); SPINE_C_API size_t spine_timeline_get_frame_count(spine_timeline self); SPINE_C_API spine_array_float spine_timeline_get_frames(spine_timeline self); diff --git a/spine-c/src/generated/to_property.cpp b/spine-c/src/generated/to_property.cpp index 3c9f98801..0a228a44c 100644 --- a/spine-c/src/generated/to_property.cpp +++ b/spine-c/src/generated/to_property.cpp @@ -4,45 +4,55 @@ using namespace spine; void spine_to_property_dispose(spine_to_property self) { - delete (ToProperty*)self; + delete (ToProperty *) self; } spine_rtti spine_to_property_get_rtti(spine_to_property self) { - return (spine_rtti)&((ToProperty*)self)->getRTTI(); + ToProperty *_self = (ToProperty *) self; + return (spine_rtti) &_self->getRTTI(); } float spine_to_property_mix(spine_to_property self, spine_transform_constraint_pose pose) { - return ((ToProperty*)self)->mix(*((TransformConstraintPose*)pose)); + ToProperty *_self = (ToProperty *) self; + return _self->mix(*((TransformConstraintPose *) pose)); } -void spine_to_property_apply(spine_to_property self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, bool local, bool additive) { - ((ToProperty*)self)->apply(*((Skeleton*)skeleton), *((TransformConstraintPose*)pose), *((BonePose*)bone), value, local, additive); +void spine_to_property_apply(spine_to_property self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, + bool local, bool additive) { + ToProperty *_self = (ToProperty *) self; + _self->apply(*((Skeleton *) skeleton), *((TransformConstraintPose *) pose), *((BonePose *) bone), value, local, additive); } spine_rtti spine_to_property_rtti(void) { - return (spine_rtti)&ToProperty::rtti; + return (spine_rtti) &ToProperty::rtti; } float spine_to_property_get__offset(spine_to_property self) { - return ((ToProperty*)self)->_offset; + ToProperty *_self = (ToProperty *) self; + return _self->_offset; } void spine_to_property_set__offset(spine_to_property self, float value) { - ((ToProperty*)self)->_offset = value; + ToProperty *_self = (ToProperty *) self; + _self->_offset = value; } float spine_to_property_get__max(spine_to_property self) { - return ((ToProperty*)self)->_max; + ToProperty *_self = (ToProperty *) self; + return _self->_max; } void spine_to_property_set__max(spine_to_property self, float value) { - ((ToProperty*)self)->_max = value; + ToProperty *_self = (ToProperty *) self; + _self->_max = value; } float spine_to_property_get__scale(spine_to_property self) { - return ((ToProperty*)self)->_scale; + ToProperty *_self = (ToProperty *) self; + return _self->_scale; } void spine_to_property_set__scale(spine_to_property self, float value) { - ((ToProperty*)self)->_scale = value; + ToProperty *_self = (ToProperty *) self; + _self->_scale = value; } diff --git a/spine-c/src/generated/to_property.h b/spine-c/src/generated/to_property.h index d069fda1f..daa16ab01 100644 --- a/spine-c/src/generated/to_property.h +++ b/spine-c/src/generated/to_property.h @@ -12,7 +12,8 @@ SPINE_C_API void spine_to_property_dispose(spine_to_property self); SPINE_C_API spine_rtti spine_to_property_get_rtti(spine_to_property self); SPINE_C_API float spine_to_property_mix(spine_to_property self, spine_transform_constraint_pose pose); -SPINE_C_API void spine_to_property_apply(spine_to_property self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, bool local, bool additive); +SPINE_C_API void spine_to_property_apply(spine_to_property self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, + float value, bool local, bool additive); SPINE_C_API spine_rtti spine_to_property_rtti(void); SPINE_C_API float spine_to_property_get__offset(spine_to_property self); SPINE_C_API void spine_to_property_set__offset(spine_to_property self, float value); diff --git a/spine-c/src/generated/to_rotate.cpp b/spine-c/src/generated/to_rotate.cpp index c83014638..39d06440a 100644 --- a/spine-c/src/generated/to_rotate.cpp +++ b/spine-c/src/generated/to_rotate.cpp @@ -4,25 +4,29 @@ using namespace spine; spine_to_rotate spine_to_rotate_create(void) { - return (spine_to_rotate) new (__FILE__, __LINE__) ToRotate(); + return (spine_to_rotate) new (__FILE__, __LINE__) ToRotate(); } void spine_to_rotate_dispose(spine_to_rotate self) { - delete (ToRotate*)self; + delete (ToRotate *) self; } spine_rtti spine_to_rotate_get_rtti(spine_to_rotate self) { - return (spine_rtti)&((ToRotate*)self)->getRTTI(); + ToRotate *_self = (ToRotate *) self; + return (spine_rtti) &_self->getRTTI(); } float spine_to_rotate_mix(spine_to_rotate self, spine_transform_constraint_pose pose) { - return ((ToRotate*)self)->mix(*((TransformConstraintPose*)pose)); + ToRotate *_self = (ToRotate *) self; + return _self->mix(*((TransformConstraintPose *) pose)); } -void spine_to_rotate_apply(spine_to_rotate self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, bool local, bool additive) { - ((ToRotate*)self)->apply(*((Skeleton*)skeleton), *((TransformConstraintPose*)pose), *((BonePose*)bone), value, local, additive); +void spine_to_rotate_apply(spine_to_rotate self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, + bool local, bool additive) { + ToRotate *_self = (ToRotate *) self; + _self->apply(*((Skeleton *) skeleton), *((TransformConstraintPose *) pose), *((BonePose *) bone), value, local, additive); } spine_rtti spine_to_rotate_rtti(void) { - return (spine_rtti)&ToRotate::rtti; + return (spine_rtti) &ToRotate::rtti; } diff --git a/spine-c/src/generated/to_rotate.h b/spine-c/src/generated/to_rotate.h index 39bffc098..315ef7937 100644 --- a/spine-c/src/generated/to_rotate.h +++ b/spine-c/src/generated/to_rotate.h @@ -14,7 +14,8 @@ SPINE_C_API void spine_to_rotate_dispose(spine_to_rotate self); SPINE_C_API spine_rtti spine_to_rotate_get_rtti(spine_to_rotate self); SPINE_C_API float spine_to_rotate_mix(spine_to_rotate self, spine_transform_constraint_pose pose); -SPINE_C_API void spine_to_rotate_apply(spine_to_rotate self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, bool local, bool additive); +SPINE_C_API void spine_to_rotate_apply(spine_to_rotate self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, + float value, bool local, bool additive); SPINE_C_API spine_rtti spine_to_rotate_rtti(void); #ifdef __cplusplus diff --git a/spine-c/src/generated/to_scale_x.cpp b/spine-c/src/generated/to_scale_x.cpp index 26aed2ec5..4d54e913d 100644 --- a/spine-c/src/generated/to_scale_x.cpp +++ b/spine-c/src/generated/to_scale_x.cpp @@ -4,25 +4,29 @@ using namespace spine; spine_to_scale_x spine_to_scale_x_create(void) { - return (spine_to_scale_x) new (__FILE__, __LINE__) ToScaleX(); + return (spine_to_scale_x) new (__FILE__, __LINE__) ToScaleX(); } void spine_to_scale_x_dispose(spine_to_scale_x self) { - delete (ToScaleX*)self; + delete (ToScaleX *) self; } spine_rtti spine_to_scale_x_get_rtti(spine_to_scale_x self) { - return (spine_rtti)&((ToScaleX*)self)->getRTTI(); + ToScaleX *_self = (ToScaleX *) self; + return (spine_rtti) &_self->getRTTI(); } float spine_to_scale_x_mix(spine_to_scale_x self, spine_transform_constraint_pose pose) { - return ((ToScaleX*)self)->mix(*((TransformConstraintPose*)pose)); + ToScaleX *_self = (ToScaleX *) self; + return _self->mix(*((TransformConstraintPose *) pose)); } -void spine_to_scale_x_apply(spine_to_scale_x self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, bool local, bool additive) { - ((ToScaleX*)self)->apply(*((Skeleton*)skeleton), *((TransformConstraintPose*)pose), *((BonePose*)bone), value, local, additive); +void spine_to_scale_x_apply(spine_to_scale_x self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, + bool local, bool additive) { + ToScaleX *_self = (ToScaleX *) self; + _self->apply(*((Skeleton *) skeleton), *((TransformConstraintPose *) pose), *((BonePose *) bone), value, local, additive); } spine_rtti spine_to_scale_x_rtti(void) { - return (spine_rtti)&ToScaleX::rtti; + return (spine_rtti) &ToScaleX::rtti; } diff --git a/spine-c/src/generated/to_scale_x.h b/spine-c/src/generated/to_scale_x.h index 934f464d9..8ef9ccd5a 100644 --- a/spine-c/src/generated/to_scale_x.h +++ b/spine-c/src/generated/to_scale_x.h @@ -14,7 +14,8 @@ SPINE_C_API void spine_to_scale_x_dispose(spine_to_scale_x self); SPINE_C_API spine_rtti spine_to_scale_x_get_rtti(spine_to_scale_x self); SPINE_C_API float spine_to_scale_x_mix(spine_to_scale_x self, spine_transform_constraint_pose pose); -SPINE_C_API void spine_to_scale_x_apply(spine_to_scale_x self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, bool local, bool additive); +SPINE_C_API void spine_to_scale_x_apply(spine_to_scale_x self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, + float value, bool local, bool additive); SPINE_C_API spine_rtti spine_to_scale_x_rtti(void); #ifdef __cplusplus diff --git a/spine-c/src/generated/to_scale_y.cpp b/spine-c/src/generated/to_scale_y.cpp index 95e3a81c3..95f8a59c9 100644 --- a/spine-c/src/generated/to_scale_y.cpp +++ b/spine-c/src/generated/to_scale_y.cpp @@ -4,25 +4,29 @@ using namespace spine; spine_to_scale_y spine_to_scale_y_create(void) { - return (spine_to_scale_y) new (__FILE__, __LINE__) ToScaleY(); + return (spine_to_scale_y) new (__FILE__, __LINE__) ToScaleY(); } void spine_to_scale_y_dispose(spine_to_scale_y self) { - delete (ToScaleY*)self; + delete (ToScaleY *) self; } spine_rtti spine_to_scale_y_get_rtti(spine_to_scale_y self) { - return (spine_rtti)&((ToScaleY*)self)->getRTTI(); + ToScaleY *_self = (ToScaleY *) self; + return (spine_rtti) &_self->getRTTI(); } float spine_to_scale_y_mix(spine_to_scale_y self, spine_transform_constraint_pose pose) { - return ((ToScaleY*)self)->mix(*((TransformConstraintPose*)pose)); + ToScaleY *_self = (ToScaleY *) self; + return _self->mix(*((TransformConstraintPose *) pose)); } -void spine_to_scale_y_apply(spine_to_scale_y self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, bool local, bool additive) { - ((ToScaleY*)self)->apply(*((Skeleton*)skeleton), *((TransformConstraintPose*)pose), *((BonePose*)bone), value, local, additive); +void spine_to_scale_y_apply(spine_to_scale_y self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, + bool local, bool additive) { + ToScaleY *_self = (ToScaleY *) self; + _self->apply(*((Skeleton *) skeleton), *((TransformConstraintPose *) pose), *((BonePose *) bone), value, local, additive); } spine_rtti spine_to_scale_y_rtti(void) { - return (spine_rtti)&ToScaleY::rtti; + return (spine_rtti) &ToScaleY::rtti; } diff --git a/spine-c/src/generated/to_scale_y.h b/spine-c/src/generated/to_scale_y.h index 8313bf3cd..9238eb8b1 100644 --- a/spine-c/src/generated/to_scale_y.h +++ b/spine-c/src/generated/to_scale_y.h @@ -14,7 +14,8 @@ SPINE_C_API void spine_to_scale_y_dispose(spine_to_scale_y self); SPINE_C_API spine_rtti spine_to_scale_y_get_rtti(spine_to_scale_y self); SPINE_C_API float spine_to_scale_y_mix(spine_to_scale_y self, spine_transform_constraint_pose pose); -SPINE_C_API void spine_to_scale_y_apply(spine_to_scale_y self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, bool local, bool additive); +SPINE_C_API void spine_to_scale_y_apply(spine_to_scale_y self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, + float value, bool local, bool additive); SPINE_C_API spine_rtti spine_to_scale_y_rtti(void); #ifdef __cplusplus diff --git a/spine-c/src/generated/to_shear_y.cpp b/spine-c/src/generated/to_shear_y.cpp index 526b0a82f..9643f461c 100644 --- a/spine-c/src/generated/to_shear_y.cpp +++ b/spine-c/src/generated/to_shear_y.cpp @@ -4,25 +4,29 @@ using namespace spine; spine_to_shear_y spine_to_shear_y_create(void) { - return (spine_to_shear_y) new (__FILE__, __LINE__) ToShearY(); + return (spine_to_shear_y) new (__FILE__, __LINE__) ToShearY(); } void spine_to_shear_y_dispose(spine_to_shear_y self) { - delete (ToShearY*)self; + delete (ToShearY *) self; } spine_rtti spine_to_shear_y_get_rtti(spine_to_shear_y self) { - return (spine_rtti)&((ToShearY*)self)->getRTTI(); + ToShearY *_self = (ToShearY *) self; + return (spine_rtti) &_self->getRTTI(); } float spine_to_shear_y_mix(spine_to_shear_y self, spine_transform_constraint_pose pose) { - return ((ToShearY*)self)->mix(*((TransformConstraintPose*)pose)); + ToShearY *_self = (ToShearY *) self; + return _self->mix(*((TransformConstraintPose *) pose)); } -void spine_to_shear_y_apply(spine_to_shear_y self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, bool local, bool additive) { - ((ToShearY*)self)->apply(*((Skeleton*)skeleton), *((TransformConstraintPose*)pose), *((BonePose*)bone), value, local, additive); +void spine_to_shear_y_apply(spine_to_shear_y self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, + bool local, bool additive) { + ToShearY *_self = (ToShearY *) self; + _self->apply(*((Skeleton *) skeleton), *((TransformConstraintPose *) pose), *((BonePose *) bone), value, local, additive); } spine_rtti spine_to_shear_y_rtti(void) { - return (spine_rtti)&ToShearY::rtti; + return (spine_rtti) &ToShearY::rtti; } diff --git a/spine-c/src/generated/to_shear_y.h b/spine-c/src/generated/to_shear_y.h index 80318bba5..654e8dcbb 100644 --- a/spine-c/src/generated/to_shear_y.h +++ b/spine-c/src/generated/to_shear_y.h @@ -14,7 +14,8 @@ SPINE_C_API void spine_to_shear_y_dispose(spine_to_shear_y self); SPINE_C_API spine_rtti spine_to_shear_y_get_rtti(spine_to_shear_y self); SPINE_C_API float spine_to_shear_y_mix(spine_to_shear_y self, spine_transform_constraint_pose pose); -SPINE_C_API void spine_to_shear_y_apply(spine_to_shear_y self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, bool local, bool additive); +SPINE_C_API void spine_to_shear_y_apply(spine_to_shear_y self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, + float value, bool local, bool additive); SPINE_C_API spine_rtti spine_to_shear_y_rtti(void); #ifdef __cplusplus diff --git a/spine-c/src/generated/to_x.cpp b/spine-c/src/generated/to_x.cpp index ae555fa68..5b315e5a4 100644 --- a/spine-c/src/generated/to_x.cpp +++ b/spine-c/src/generated/to_x.cpp @@ -4,25 +4,29 @@ using namespace spine; spine_to_x spine_to_x_create(void) { - return (spine_to_x) new (__FILE__, __LINE__) ToX(); + return (spine_to_x) new (__FILE__, __LINE__) ToX(); } void spine_to_x_dispose(spine_to_x self) { - delete (ToX*)self; + delete (ToX *) self; } spine_rtti spine_to_x_get_rtti(spine_to_x self) { - return (spine_rtti)&((ToX*)self)->getRTTI(); + ToX *_self = (ToX *) self; + return (spine_rtti) &_self->getRTTI(); } float spine_to_x_mix(spine_to_x self, spine_transform_constraint_pose pose) { - return ((ToX*)self)->mix(*((TransformConstraintPose*)pose)); + ToX *_self = (ToX *) self; + return _self->mix(*((TransformConstraintPose *) pose)); } -void spine_to_x_apply(spine_to_x self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, bool local, bool additive) { - ((ToX*)self)->apply(*((Skeleton*)skeleton), *((TransformConstraintPose*)pose), *((BonePose*)bone), value, local, additive); +void spine_to_x_apply(spine_to_x self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, bool local, + bool additive) { + ToX *_self = (ToX *) self; + _self->apply(*((Skeleton *) skeleton), *((TransformConstraintPose *) pose), *((BonePose *) bone), value, local, additive); } spine_rtti spine_to_x_rtti(void) { - return (spine_rtti)&ToX::rtti; + return (spine_rtti) &ToX::rtti; } diff --git a/spine-c/src/generated/to_x.h b/spine-c/src/generated/to_x.h index 885cad844..8b894f11d 100644 --- a/spine-c/src/generated/to_x.h +++ b/spine-c/src/generated/to_x.h @@ -14,7 +14,8 @@ SPINE_C_API void spine_to_x_dispose(spine_to_x self); SPINE_C_API spine_rtti spine_to_x_get_rtti(spine_to_x self); SPINE_C_API float spine_to_x_mix(spine_to_x self, spine_transform_constraint_pose pose); -SPINE_C_API void spine_to_x_apply(spine_to_x self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, bool local, bool additive); +SPINE_C_API void spine_to_x_apply(spine_to_x self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, + bool local, bool additive); SPINE_C_API spine_rtti spine_to_x_rtti(void); #ifdef __cplusplus diff --git a/spine-c/src/generated/to_y.cpp b/spine-c/src/generated/to_y.cpp index ab4f09614..cf359f2e3 100644 --- a/spine-c/src/generated/to_y.cpp +++ b/spine-c/src/generated/to_y.cpp @@ -4,25 +4,29 @@ using namespace spine; spine_to_y spine_to_y_create(void) { - return (spine_to_y) new (__FILE__, __LINE__) ToY(); + return (spine_to_y) new (__FILE__, __LINE__) ToY(); } void spine_to_y_dispose(spine_to_y self) { - delete (ToY*)self; + delete (ToY *) self; } spine_rtti spine_to_y_get_rtti(spine_to_y self) { - return (spine_rtti)&((ToY*)self)->getRTTI(); + ToY *_self = (ToY *) self; + return (spine_rtti) &_self->getRTTI(); } float spine_to_y_mix(spine_to_y self, spine_transform_constraint_pose pose) { - return ((ToY*)self)->mix(*((TransformConstraintPose*)pose)); + ToY *_self = (ToY *) self; + return _self->mix(*((TransformConstraintPose *) pose)); } -void spine_to_y_apply(spine_to_y self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, bool local, bool additive) { - ((ToY*)self)->apply(*((Skeleton*)skeleton), *((TransformConstraintPose*)pose), *((BonePose*)bone), value, local, additive); +void spine_to_y_apply(spine_to_y self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, bool local, + bool additive) { + ToY *_self = (ToY *) self; + _self->apply(*((Skeleton *) skeleton), *((TransformConstraintPose *) pose), *((BonePose *) bone), value, local, additive); } spine_rtti spine_to_y_rtti(void) { - return (spine_rtti)&ToY::rtti; + return (spine_rtti) &ToY::rtti; } diff --git a/spine-c/src/generated/to_y.h b/spine-c/src/generated/to_y.h index 407ee3d9c..8f767ce70 100644 --- a/spine-c/src/generated/to_y.h +++ b/spine-c/src/generated/to_y.h @@ -14,7 +14,8 @@ SPINE_C_API void spine_to_y_dispose(spine_to_y self); SPINE_C_API spine_rtti spine_to_y_get_rtti(spine_to_y self); SPINE_C_API float spine_to_y_mix(spine_to_y self, spine_transform_constraint_pose pose); -SPINE_C_API void spine_to_y_apply(spine_to_y self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, bool local, bool additive); +SPINE_C_API void spine_to_y_apply(spine_to_y self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone, float value, + bool local, bool additive); SPINE_C_API spine_rtti spine_to_y_rtti(void); #ifdef __cplusplus diff --git a/spine-c/src/generated/track_entry.cpp b/spine-c/src/generated/track_entry.cpp index 780aed3ef..78bfd388e 100644 --- a/spine-c/src/generated/track_entry.cpp +++ b/spine-c/src/generated/track_entry.cpp @@ -4,225 +4,279 @@ using namespace spine; spine_track_entry spine_track_entry_create(void) { - return (spine_track_entry) new (__FILE__, __LINE__) TrackEntry(); + return (spine_track_entry) new (__FILE__, __LINE__) TrackEntry(); } void spine_track_entry_dispose(spine_track_entry self) { - delete (TrackEntry*)self; + delete (TrackEntry *) self; } int spine_track_entry_get_track_index(spine_track_entry self) { - return ((TrackEntry*)self)->getTrackIndex(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getTrackIndex(); } spine_animation spine_track_entry_get_animation(spine_track_entry self) { - return (spine_animation)((TrackEntry*)self)->getAnimation(); + TrackEntry *_self = (TrackEntry *) self; + return (spine_animation) _self->getAnimation(); } void spine_track_entry_set_animation(spine_track_entry self, spine_animation animation) { - ((TrackEntry*)self)->setAnimation((Animation *)animation); + TrackEntry *_self = (TrackEntry *) self; + _self->setAnimation((Animation *) animation); } spine_track_entry spine_track_entry_get_previous(spine_track_entry self) { - return (spine_track_entry)((TrackEntry*)self)->getPrevious(); + TrackEntry *_self = (TrackEntry *) self; + return (spine_track_entry) _self->getPrevious(); } bool spine_track_entry_get_loop(spine_track_entry self) { - return ((TrackEntry*)self)->getLoop(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getLoop(); } void spine_track_entry_set_loop(spine_track_entry self, bool inValue) { - ((TrackEntry*)self)->setLoop(inValue); + TrackEntry *_self = (TrackEntry *) self; + _self->setLoop(inValue); } bool spine_track_entry_get_hold_previous(spine_track_entry self) { - return ((TrackEntry*)self)->getHoldPrevious(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getHoldPrevious(); } void spine_track_entry_set_hold_previous(spine_track_entry self, bool inValue) { - ((TrackEntry*)self)->setHoldPrevious(inValue); + TrackEntry *_self = (TrackEntry *) self; + _self->setHoldPrevious(inValue); } bool spine_track_entry_get_reverse(spine_track_entry self) { - return ((TrackEntry*)self)->getReverse(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getReverse(); } void spine_track_entry_set_reverse(spine_track_entry self, bool inValue) { - ((TrackEntry*)self)->setReverse(inValue); + TrackEntry *_self = (TrackEntry *) self; + _self->setReverse(inValue); } bool spine_track_entry_get_shortest_rotation(spine_track_entry self) { - return ((TrackEntry*)self)->getShortestRotation(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getShortestRotation(); } void spine_track_entry_set_shortest_rotation(spine_track_entry self, bool inValue) { - ((TrackEntry*)self)->setShortestRotation(inValue); + TrackEntry *_self = (TrackEntry *) self; + _self->setShortestRotation(inValue); } float spine_track_entry_get_delay(spine_track_entry self) { - return ((TrackEntry*)self)->getDelay(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getDelay(); } void spine_track_entry_set_delay(spine_track_entry self, float inValue) { - ((TrackEntry*)self)->setDelay(inValue); + TrackEntry *_self = (TrackEntry *) self; + _self->setDelay(inValue); } float spine_track_entry_get_track_time(spine_track_entry self) { - return ((TrackEntry*)self)->getTrackTime(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getTrackTime(); } void spine_track_entry_set_track_time(spine_track_entry self, float inValue) { - ((TrackEntry*)self)->setTrackTime(inValue); + TrackEntry *_self = (TrackEntry *) self; + _self->setTrackTime(inValue); } float spine_track_entry_get_track_end(spine_track_entry self) { - return ((TrackEntry*)self)->getTrackEnd(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getTrackEnd(); } void spine_track_entry_set_track_end(spine_track_entry self, float inValue) { - ((TrackEntry*)self)->setTrackEnd(inValue); + TrackEntry *_self = (TrackEntry *) self; + _self->setTrackEnd(inValue); } float spine_track_entry_get_animation_start(spine_track_entry self) { - return ((TrackEntry*)self)->getAnimationStart(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getAnimationStart(); } void spine_track_entry_set_animation_start(spine_track_entry self, float inValue) { - ((TrackEntry*)self)->setAnimationStart(inValue); + TrackEntry *_self = (TrackEntry *) self; + _self->setAnimationStart(inValue); } float spine_track_entry_get_animation_end(spine_track_entry self) { - return ((TrackEntry*)self)->getAnimationEnd(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getAnimationEnd(); } void spine_track_entry_set_animation_end(spine_track_entry self, float inValue) { - ((TrackEntry*)self)->setAnimationEnd(inValue); + TrackEntry *_self = (TrackEntry *) self; + _self->setAnimationEnd(inValue); } float spine_track_entry_get_animation_last(spine_track_entry self) { - return ((TrackEntry*)self)->getAnimationLast(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getAnimationLast(); } void spine_track_entry_set_animation_last(spine_track_entry self, float inValue) { - ((TrackEntry*)self)->setAnimationLast(inValue); + TrackEntry *_self = (TrackEntry *) self; + _self->setAnimationLast(inValue); } float spine_track_entry_get_animation_time(spine_track_entry self) { - return ((TrackEntry*)self)->getAnimationTime(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getAnimationTime(); } float spine_track_entry_get_time_scale(spine_track_entry self) { - return ((TrackEntry*)self)->getTimeScale(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getTimeScale(); } void spine_track_entry_set_time_scale(spine_track_entry self, float inValue) { - ((TrackEntry*)self)->setTimeScale(inValue); + TrackEntry *_self = (TrackEntry *) self; + _self->setTimeScale(inValue); } float spine_track_entry_get_alpha(spine_track_entry self) { - return ((TrackEntry*)self)->getAlpha(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getAlpha(); } void spine_track_entry_set_alpha(spine_track_entry self, float inValue) { - ((TrackEntry*)self)->setAlpha(inValue); + TrackEntry *_self = (TrackEntry *) self; + _self->setAlpha(inValue); } float spine_track_entry_get_event_threshold(spine_track_entry self) { - return ((TrackEntry*)self)->getEventThreshold(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getEventThreshold(); } void spine_track_entry_set_event_threshold(spine_track_entry self, float inValue) { - ((TrackEntry*)self)->setEventThreshold(inValue); + TrackEntry *_self = (TrackEntry *) self; + _self->setEventThreshold(inValue); } float spine_track_entry_get_mix_attachment_threshold(spine_track_entry self) { - return ((TrackEntry*)self)->getMixAttachmentThreshold(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getMixAttachmentThreshold(); } void spine_track_entry_set_mix_attachment_threshold(spine_track_entry self, float inValue) { - ((TrackEntry*)self)->setMixAttachmentThreshold(inValue); + TrackEntry *_self = (TrackEntry *) self; + _self->setMixAttachmentThreshold(inValue); } float spine_track_entry_get_alpha_attachment_threshold(spine_track_entry self) { - return ((TrackEntry*)self)->getAlphaAttachmentThreshold(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getAlphaAttachmentThreshold(); } void spine_track_entry_set_alpha_attachment_threshold(spine_track_entry self, float inValue) { - ((TrackEntry*)self)->setAlphaAttachmentThreshold(inValue); + TrackEntry *_self = (TrackEntry *) self; + _self->setAlphaAttachmentThreshold(inValue); } float spine_track_entry_get_mix_draw_order_threshold(spine_track_entry self) { - return ((TrackEntry*)self)->getMixDrawOrderThreshold(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getMixDrawOrderThreshold(); } void spine_track_entry_set_mix_draw_order_threshold(spine_track_entry self, float inValue) { - ((TrackEntry*)self)->setMixDrawOrderThreshold(inValue); + TrackEntry *_self = (TrackEntry *) self; + _self->setMixDrawOrderThreshold(inValue); } spine_track_entry spine_track_entry_get_next(spine_track_entry self) { - return (spine_track_entry)((TrackEntry*)self)->getNext(); + TrackEntry *_self = (TrackEntry *) self; + return (spine_track_entry) _self->getNext(); } bool spine_track_entry_is_complete(spine_track_entry self) { - return ((TrackEntry*)self)->isComplete(); + TrackEntry *_self = (TrackEntry *) self; + return _self->isComplete(); } float spine_track_entry_get_mix_time(spine_track_entry self) { - return ((TrackEntry*)self)->getMixTime(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getMixTime(); } void spine_track_entry_set_mix_time(spine_track_entry self, float inValue) { - ((TrackEntry*)self)->setMixTime(inValue); + TrackEntry *_self = (TrackEntry *) self; + _self->setMixTime(inValue); } float spine_track_entry_get_mix_duration(spine_track_entry self) { - return ((TrackEntry*)self)->getMixDuration(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getMixDuration(); } void spine_track_entry_set_mix_duration_1(spine_track_entry self, float inValue) { - ((TrackEntry*)self)->setMixDuration(inValue); + TrackEntry *_self = (TrackEntry *) self; + _self->setMixDuration(inValue); } void spine_track_entry_set_mix_duration_2(spine_track_entry self, float mixDuration, float delay) { - ((TrackEntry*)self)->setMixDuration(mixDuration, delay); + TrackEntry *_self = (TrackEntry *) self; + _self->setMixDuration(mixDuration, delay); } spine_mix_blend spine_track_entry_get_mix_blend(spine_track_entry self) { - return (spine_mix_blend)((TrackEntry*)self)->getMixBlend(); + TrackEntry *_self = (TrackEntry *) self; + return (spine_mix_blend) _self->getMixBlend(); } void spine_track_entry_set_mix_blend(spine_track_entry self, spine_mix_blend blend) { - ((TrackEntry*)self)->setMixBlend((MixBlend)blend); + TrackEntry *_self = (TrackEntry *) self; + _self->setMixBlend((MixBlend) blend); } spine_track_entry spine_track_entry_get_mixing_from(spine_track_entry self) { - return (spine_track_entry)((TrackEntry*)self)->getMixingFrom(); + TrackEntry *_self = (TrackEntry *) self; + return (spine_track_entry) _self->getMixingFrom(); } spine_track_entry spine_track_entry_get_mixing_to(spine_track_entry self) { - return (spine_track_entry)((TrackEntry*)self)->getMixingTo(); + TrackEntry *_self = (TrackEntry *) self; + return (spine_track_entry) _self->getMixingTo(); } void spine_track_entry_reset_rotation_directions(spine_track_entry self) { - ((TrackEntry*)self)->resetRotationDirections(); + TrackEntry *_self = (TrackEntry *) self; + _self->resetRotationDirections(); } float spine_track_entry_get_track_complete(spine_track_entry self) { - return ((TrackEntry*)self)->getTrackComplete(); + TrackEntry *_self = (TrackEntry *) self; + return _self->getTrackComplete(); } bool spine_track_entry_is_empty_animation(spine_track_entry self) { - return ((TrackEntry*)self)->isEmptyAnimation(); + TrackEntry *_self = (TrackEntry *) self; + return _self->isEmptyAnimation(); } bool spine_track_entry_was_applied(spine_track_entry self) { - return ((TrackEntry*)self)->wasApplied(); + TrackEntry *_self = (TrackEntry *) self; + return _self->wasApplied(); } bool spine_track_entry_is_next_ready(spine_track_entry self) { - return ((TrackEntry*)self)->isNextReady(); + TrackEntry *_self = (TrackEntry *) self; + return _self->isNextReady(); } -void * spine_track_entry_get_renderer_object(spine_track_entry self) { - return ((HasRendererObject*)(TrackEntry*)self)->getRendererObject(); +void *spine_track_entry_get_renderer_object(spine_track_entry self) { + HasRendererObject *_self = (HasRendererObject *) (TrackEntry *) self; + return _self->getRendererObject(); } diff --git a/spine-c/src/generated/track_entry.h b/spine-c/src/generated/track_entry.h index 18048fb23..f062eca75 100644 --- a/spine-c/src/generated/track_entry.h +++ b/spine-c/src/generated/track_entry.h @@ -65,7 +65,7 @@ SPINE_C_API float spine_track_entry_get_track_complete(spine_track_entry self); SPINE_C_API bool spine_track_entry_is_empty_animation(spine_track_entry self); SPINE_C_API bool spine_track_entry_was_applied(spine_track_entry self); SPINE_C_API bool spine_track_entry_is_next_ready(spine_track_entry self); -SPINE_C_API void * spine_track_entry_get_renderer_object(spine_track_entry self); +SPINE_C_API void *spine_track_entry_get_renderer_object(spine_track_entry self); #ifdef __cplusplus } diff --git a/spine-c/src/generated/transform_constraint.cpp b/spine-c/src/generated/transform_constraint.cpp index 65d573fd7..0184c1858 100644 --- a/spine-c/src/generated/transform_constraint.cpp +++ b/spine-c/src/generated/transform_constraint.cpp @@ -4,77 +4,101 @@ using namespace spine; spine_transform_constraint spine_transform_constraint_create(spine_transform_constraint_data data, spine_skeleton skeleton) { - return (spine_transform_constraint) new (__FILE__, __LINE__) TransformConstraint(*((TransformConstraintData*)data), *((Skeleton*)skeleton)); + return (spine_transform_constraint) new (__FILE__, __LINE__) TransformConstraint(*((TransformConstraintData *) data), *((Skeleton *) skeleton)); } void spine_transform_constraint_dispose(spine_transform_constraint self) { - delete (TransformConstraint*)self; + delete (TransformConstraint *) self; } spine_rtti spine_transform_constraint_get_rtti(spine_transform_constraint self) { - return (spine_rtti)&((TransformConstraint*)self)->getRTTI(); + TransformConstraint *_self = (TransformConstraint *) self; + return (spine_rtti) &_self->getRTTI(); } spine_transform_constraint spine_transform_constraint_copy(spine_transform_constraint self, spine_skeleton skeleton) { - return (spine_transform_constraint)((TransformConstraint*)self)->copy(*((Skeleton*)skeleton)); + TransformConstraint *_self = (TransformConstraint *) self; + return (spine_transform_constraint) _self->copy(*((Skeleton *) skeleton)); } void spine_transform_constraint_update(spine_transform_constraint self, spine_skeleton skeleton, spine_physics physics) { - ((TransformConstraint*)self)->update(*((Skeleton*)skeleton), (Physics)physics); + TransformConstraint *_self = (TransformConstraint *) self; + _self->update(*((Skeleton *) skeleton), (Physics) physics); } void spine_transform_constraint_sort(spine_transform_constraint self, spine_skeleton skeleton) { - ((TransformConstraint*)self)->sort(*((Skeleton*)skeleton)); + TransformConstraint *_self = (TransformConstraint *) self; + _self->sort(*((Skeleton *) skeleton)); } bool spine_transform_constraint_is_source_active(spine_transform_constraint self) { - return ((TransformConstraint*)self)->isSourceActive(); + TransformConstraint *_self = (TransformConstraint *) self; + return _self->isSourceActive(); } spine_array_bone_pose spine_transform_constraint_get_bones(spine_transform_constraint self) { - return (spine_array_bone_pose)&((TransformConstraint*)self)->getBones(); + TransformConstraint *_self = (TransformConstraint *) self; + return (spine_array_bone_pose) &_self->getBones(); } spine_bone spine_transform_constraint_get_source(spine_transform_constraint self) { - return (spine_bone)((TransformConstraint*)self)->getSource(); + TransformConstraint *_self = (TransformConstraint *) self; + return (spine_bone) _self->getSource(); } void spine_transform_constraint_set_source(spine_transform_constraint self, spine_bone source) { - ((TransformConstraint*)self)->setSource((Bone *)source); + TransformConstraint *_self = (TransformConstraint *) self; + _self->setSource((Bone *) source); } spine_transform_constraint_data spine_transform_constraint_get_data(spine_transform_constraint self) { - return (spine_transform_constraint_data)&((ConstraintGeneric*)(TransformConstraint*)self)->getData(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (TransformConstraint *) self; + return (spine_transform_constraint_data) &_self->getData(); } spine_transform_constraint_pose spine_transform_constraint_get_pose(spine_transform_constraint self) { - return (spine_transform_constraint_pose)&((ConstraintGeneric*)(TransformConstraint*)self)->getPose(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (TransformConstraint *) self; + return (spine_transform_constraint_pose) &_self->getPose(); } spine_transform_constraint_pose spine_transform_constraint_get_applied_pose(spine_transform_constraint self) { - return (spine_transform_constraint_pose)&((ConstraintGeneric*)(TransformConstraint*)self)->getAppliedPose(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (TransformConstraint *) self; + return (spine_transform_constraint_pose) &_self->getAppliedPose(); } void spine_transform_constraint_reset_constrained(spine_transform_constraint self) { - ((ConstraintGeneric*)(TransformConstraint*)self)->resetConstrained(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (TransformConstraint *) self; + _self->resetConstrained(); } void spine_transform_constraint_constrained(spine_transform_constraint self) { - ((ConstraintGeneric*)(TransformConstraint*)self)->constrained(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (TransformConstraint *) self; + _self->constrained(); } bool spine_transform_constraint_is_pose_equal_to_applied(spine_transform_constraint self) { - return ((ConstraintGeneric*)(TransformConstraint*)self)->isPoseEqualToApplied(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (TransformConstraint *) self; + return _self->isPoseEqualToApplied(); } bool spine_transform_constraint_is_active(spine_transform_constraint self) { - return ((ConstraintGeneric*)(TransformConstraint*)self)->isActive(); + ConstraintGeneric + *_self = (ConstraintGeneric *) (TransformConstraint *) self; + return _self->isActive(); } void spine_transform_constraint_set_active(spine_transform_constraint self, bool active) { - ((ConstraintGeneric*)(TransformConstraint*)self)->setActive(active); + ConstraintGeneric + *_self = (ConstraintGeneric *) (TransformConstraint *) self; + _self->setActive(active); } spine_rtti spine_transform_constraint_rtti(void) { - return (spine_rtti)&TransformConstraint::rtti; + return (spine_rtti) &TransformConstraint::rtti; } diff --git a/spine-c/src/generated/transform_constraint_data.cpp b/spine-c/src/generated/transform_constraint_data.cpp index 8683fb79d..d1ec6db89 100644 --- a/spine-c/src/generated/transform_constraint_data.cpp +++ b/spine-c/src/generated/transform_constraint_data.cpp @@ -3,134 +3,168 @@ using namespace spine; -spine_transform_constraint_data spine_transform_constraint_data_create(const char * name) { - return (spine_transform_constraint_data) new (__FILE__, __LINE__) TransformConstraintData(String(name)); +spine_transform_constraint_data spine_transform_constraint_data_create(const char *name) { + return (spine_transform_constraint_data) new (__FILE__, __LINE__) TransformConstraintData(String(name)); } void spine_transform_constraint_data_dispose(spine_transform_constraint_data self) { - delete (TransformConstraintData*)self; + delete (TransformConstraintData *) self; } spine_rtti spine_transform_constraint_data_get_rtti(spine_transform_constraint_data self) { - return (spine_rtti)&((TransformConstraintData*)self)->getRTTI(); + TransformConstraintData *_self = (TransformConstraintData *) self; + return (spine_rtti) &_self->getRTTI(); } spine_constraint spine_transform_constraint_data_create_method(spine_transform_constraint_data self, spine_skeleton skeleton) { - return (spine_constraint)((TransformConstraintData*)self)->create(*((Skeleton*)skeleton)); + TransformConstraintData *_self = (TransformConstraintData *) self; + return (spine_constraint) _self->create(*((Skeleton *) skeleton)); } spine_array_bone_data spine_transform_constraint_data_get_bones(spine_transform_constraint_data self) { - return (spine_array_bone_data)&((TransformConstraintData*)self)->getBones(); + TransformConstraintData *_self = (TransformConstraintData *) self; + return (spine_array_bone_data) &_self->getBones(); } spine_bone_data spine_transform_constraint_data_get_source(spine_transform_constraint_data self) { - return (spine_bone_data)((TransformConstraintData*)self)->getSource(); + TransformConstraintData *_self = (TransformConstraintData *) self; + return (spine_bone_data) _self->getSource(); } void spine_transform_constraint_data_set_source(spine_transform_constraint_data self, spine_bone_data source) { - ((TransformConstraintData*)self)->setSource((BoneData *)source); + TransformConstraintData *_self = (TransformConstraintData *) self; + _self->setSource((BoneData *) source); } float spine_transform_constraint_data_get_offset_rotation(spine_transform_constraint_data self) { - return ((TransformConstraintData*)self)->getOffsetRotation(); + TransformConstraintData *_self = (TransformConstraintData *) self; + return _self->getOffsetRotation(); } void spine_transform_constraint_data_set_offset_rotation(spine_transform_constraint_data self, float offsetRotation) { - ((TransformConstraintData*)self)->setOffsetRotation(offsetRotation); + TransformConstraintData *_self = (TransformConstraintData *) self; + _self->setOffsetRotation(offsetRotation); } float spine_transform_constraint_data_get_offset_x(spine_transform_constraint_data self) { - return ((TransformConstraintData*)self)->getOffsetX(); + TransformConstraintData *_self = (TransformConstraintData *) self; + return _self->getOffsetX(); } void spine_transform_constraint_data_set_offset_x(spine_transform_constraint_data self, float offsetX) { - ((TransformConstraintData*)self)->setOffsetX(offsetX); + TransformConstraintData *_self = (TransformConstraintData *) self; + _self->setOffsetX(offsetX); } float spine_transform_constraint_data_get_offset_y(spine_transform_constraint_data self) { - return ((TransformConstraintData*)self)->getOffsetY(); + TransformConstraintData *_self = (TransformConstraintData *) self; + return _self->getOffsetY(); } void spine_transform_constraint_data_set_offset_y(spine_transform_constraint_data self, float offsetY) { - ((TransformConstraintData*)self)->setOffsetY(offsetY); + TransformConstraintData *_self = (TransformConstraintData *) self; + _self->setOffsetY(offsetY); } float spine_transform_constraint_data_get_offset_scale_x(spine_transform_constraint_data self) { - return ((TransformConstraintData*)self)->getOffsetScaleX(); + TransformConstraintData *_self = (TransformConstraintData *) self; + return _self->getOffsetScaleX(); } void spine_transform_constraint_data_set_offset_scale_x(spine_transform_constraint_data self, float offsetScaleX) { - ((TransformConstraintData*)self)->setOffsetScaleX(offsetScaleX); + TransformConstraintData *_self = (TransformConstraintData *) self; + _self->setOffsetScaleX(offsetScaleX); } float spine_transform_constraint_data_get_offset_scale_y(spine_transform_constraint_data self) { - return ((TransformConstraintData*)self)->getOffsetScaleY(); + TransformConstraintData *_self = (TransformConstraintData *) self; + return _self->getOffsetScaleY(); } void spine_transform_constraint_data_set_offset_scale_y(spine_transform_constraint_data self, float offsetScaleY) { - ((TransformConstraintData*)self)->setOffsetScaleY(offsetScaleY); + TransformConstraintData *_self = (TransformConstraintData *) self; + _self->setOffsetScaleY(offsetScaleY); } float spine_transform_constraint_data_get_offset_shear_y(spine_transform_constraint_data self) { - return ((TransformConstraintData*)self)->getOffsetShearY(); + TransformConstraintData *_self = (TransformConstraintData *) self; + return _self->getOffsetShearY(); } void spine_transform_constraint_data_set_offset_shear_y(spine_transform_constraint_data self, float offsetShearY) { - ((TransformConstraintData*)self)->setOffsetShearY(offsetShearY); + TransformConstraintData *_self = (TransformConstraintData *) self; + _self->setOffsetShearY(offsetShearY); } bool spine_transform_constraint_data_get_local_source(spine_transform_constraint_data self) { - return ((TransformConstraintData*)self)->getLocalSource(); + TransformConstraintData *_self = (TransformConstraintData *) self; + return _self->getLocalSource(); } void spine_transform_constraint_data_set_local_source(spine_transform_constraint_data self, bool localSource) { - ((TransformConstraintData*)self)->setLocalSource(localSource); + TransformConstraintData *_self = (TransformConstraintData *) self; + _self->setLocalSource(localSource); } bool spine_transform_constraint_data_get_local_target(spine_transform_constraint_data self) { - return ((TransformConstraintData*)self)->getLocalTarget(); + TransformConstraintData *_self = (TransformConstraintData *) self; + return _self->getLocalTarget(); } void spine_transform_constraint_data_set_local_target(spine_transform_constraint_data self, bool localTarget) { - ((TransformConstraintData*)self)->setLocalTarget(localTarget); + TransformConstraintData *_self = (TransformConstraintData *) self; + _self->setLocalTarget(localTarget); } bool spine_transform_constraint_data_get_additive(spine_transform_constraint_data self) { - return ((TransformConstraintData*)self)->getAdditive(); + TransformConstraintData *_self = (TransformConstraintData *) self; + return _self->getAdditive(); } void spine_transform_constraint_data_set_additive(spine_transform_constraint_data self, bool additive) { - ((TransformConstraintData*)self)->setAdditive(additive); + TransformConstraintData *_self = (TransformConstraintData *) self; + _self->setAdditive(additive); } bool spine_transform_constraint_data_get_clamp(spine_transform_constraint_data self) { - return ((TransformConstraintData*)self)->getClamp(); + TransformConstraintData *_self = (TransformConstraintData *) self; + return _self->getClamp(); } void spine_transform_constraint_data_set_clamp(spine_transform_constraint_data self, bool clamp) { - ((TransformConstraintData*)self)->setClamp(clamp); + TransformConstraintData *_self = (TransformConstraintData *) self; + _self->setClamp(clamp); } spine_array_from_property spine_transform_constraint_data_get_properties(spine_transform_constraint_data self) { - return (spine_array_from_property)&((TransformConstraintData*)self)->getProperties(); + TransformConstraintData *_self = (TransformConstraintData *) self; + return (spine_array_from_property) &_self->getProperties(); } -const char * spine_transform_constraint_data_get_name(spine_transform_constraint_data self) { - return ((ConstraintDataGeneric*)(TransformConstraintData*)self)->getName().buffer(); +const char *spine_transform_constraint_data_get_name(spine_transform_constraint_data self) { + ConstraintDataGeneric + *_self = (ConstraintDataGeneric *) (TransformConstraintData *) self; + return _self->getName().buffer(); } bool spine_transform_constraint_data_get_skin_required(spine_transform_constraint_data self) { - return ((ConstraintDataGeneric*)(TransformConstraintData*)self)->getSkinRequired(); + ConstraintDataGeneric + *_self = (ConstraintDataGeneric *) (TransformConstraintData *) self; + return _self->getSkinRequired(); } spine_transform_constraint_pose spine_transform_constraint_data_get_setup_pose(spine_transform_constraint_data self) { - return (spine_transform_constraint_pose)&((ConstraintDataGeneric*)(TransformConstraintData*)self)->getSetupPose(); + ConstraintDataGeneric + *_self = (ConstraintDataGeneric *) (TransformConstraintData *) self; + return (spine_transform_constraint_pose) &_self->getSetupPose(); } void spine_transform_constraint_data_set_skin_required(spine_transform_constraint_data self, bool skinRequired) { - ((ConstraintDataGeneric*)(TransformConstraintData*)self)->setSkinRequired(skinRequired); + ConstraintDataGeneric + *_self = (ConstraintDataGeneric *) (TransformConstraintData *) self; + _self->setSkinRequired(skinRequired); } spine_rtti spine_transform_constraint_data_rtti(void) { - return (spine_rtti)&TransformConstraintData::rtti; + return (spine_rtti) &TransformConstraintData::rtti; } diff --git a/spine-c/src/generated/transform_constraint_data.h b/spine-c/src/generated/transform_constraint_data.h index 0fe217d05..3bcea151c 100644 --- a/spine-c/src/generated/transform_constraint_data.h +++ b/spine-c/src/generated/transform_constraint_data.h @@ -8,7 +8,7 @@ extern "C" { #endif -SPINE_C_API spine_transform_constraint_data spine_transform_constraint_data_create(const char * name); +SPINE_C_API spine_transform_constraint_data spine_transform_constraint_data_create(const char *name); SPINE_C_API void spine_transform_constraint_data_dispose(spine_transform_constraint_data self); @@ -38,7 +38,7 @@ SPINE_C_API void spine_transform_constraint_data_set_additive(spine_transform_co SPINE_C_API bool spine_transform_constraint_data_get_clamp(spine_transform_constraint_data self); SPINE_C_API void spine_transform_constraint_data_set_clamp(spine_transform_constraint_data self, bool clamp); SPINE_C_API spine_array_from_property spine_transform_constraint_data_get_properties(spine_transform_constraint_data self); -SPINE_C_API const char * spine_transform_constraint_data_get_name(spine_transform_constraint_data self); +SPINE_C_API const char *spine_transform_constraint_data_get_name(spine_transform_constraint_data self); SPINE_C_API bool spine_transform_constraint_data_get_skin_required(spine_transform_constraint_data self); SPINE_C_API spine_transform_constraint_pose spine_transform_constraint_data_get_setup_pose(spine_transform_constraint_data self); SPINE_C_API void spine_transform_constraint_data_set_skin_required(spine_transform_constraint_data self, bool skinRequired); diff --git a/spine-c/src/generated/transform_constraint_pose.cpp b/spine-c/src/generated/transform_constraint_pose.cpp index 1ba64bd0a..6d54a41de 100644 --- a/spine-c/src/generated/transform_constraint_pose.cpp +++ b/spine-c/src/generated/transform_constraint_pose.cpp @@ -4,61 +4,74 @@ using namespace spine; spine_transform_constraint_pose spine_transform_constraint_pose_create(void) { - return (spine_transform_constraint_pose) new (__FILE__, __LINE__) TransformConstraintPose(); + return (spine_transform_constraint_pose) new (__FILE__, __LINE__) TransformConstraintPose(); } void spine_transform_constraint_pose_dispose(spine_transform_constraint_pose self) { - delete (TransformConstraintPose*)self; + delete (TransformConstraintPose *) self; } void spine_transform_constraint_pose_set(spine_transform_constraint_pose self, spine_transform_constraint_pose pose) { - ((TransformConstraintPose*)self)->set(*((TransformConstraintPose*)pose)); + TransformConstraintPose *_self = (TransformConstraintPose *) self; + _self->set(*((TransformConstraintPose *) pose)); } float spine_transform_constraint_pose_get_mix_rotate(spine_transform_constraint_pose self) { - return ((TransformConstraintPose*)self)->getMixRotate(); + TransformConstraintPose *_self = (TransformConstraintPose *) self; + return _self->getMixRotate(); } void spine_transform_constraint_pose_set_mix_rotate(spine_transform_constraint_pose self, float mixRotate) { - ((TransformConstraintPose*)self)->setMixRotate(mixRotate); + TransformConstraintPose *_self = (TransformConstraintPose *) self; + _self->setMixRotate(mixRotate); } float spine_transform_constraint_pose_get_mix_x(spine_transform_constraint_pose self) { - return ((TransformConstraintPose*)self)->getMixX(); + TransformConstraintPose *_self = (TransformConstraintPose *) self; + return _self->getMixX(); } void spine_transform_constraint_pose_set_mix_x(spine_transform_constraint_pose self, float mixX) { - ((TransformConstraintPose*)self)->setMixX(mixX); + TransformConstraintPose *_self = (TransformConstraintPose *) self; + _self->setMixX(mixX); } float spine_transform_constraint_pose_get_mix_y(spine_transform_constraint_pose self) { - return ((TransformConstraintPose*)self)->getMixY(); + TransformConstraintPose *_self = (TransformConstraintPose *) self; + return _self->getMixY(); } void spine_transform_constraint_pose_set_mix_y(spine_transform_constraint_pose self, float mixY) { - ((TransformConstraintPose*)self)->setMixY(mixY); + TransformConstraintPose *_self = (TransformConstraintPose *) self; + _self->setMixY(mixY); } float spine_transform_constraint_pose_get_mix_scale_x(spine_transform_constraint_pose self) { - return ((TransformConstraintPose*)self)->getMixScaleX(); + TransformConstraintPose *_self = (TransformConstraintPose *) self; + return _self->getMixScaleX(); } void spine_transform_constraint_pose_set_mix_scale_x(spine_transform_constraint_pose self, float mixScaleX) { - ((TransformConstraintPose*)self)->setMixScaleX(mixScaleX); + TransformConstraintPose *_self = (TransformConstraintPose *) self; + _self->setMixScaleX(mixScaleX); } float spine_transform_constraint_pose_get_mix_scale_y(spine_transform_constraint_pose self) { - return ((TransformConstraintPose*)self)->getMixScaleY(); + TransformConstraintPose *_self = (TransformConstraintPose *) self; + return _self->getMixScaleY(); } void spine_transform_constraint_pose_set_mix_scale_y(spine_transform_constraint_pose self, float mixScaleY) { - ((TransformConstraintPose*)self)->setMixScaleY(mixScaleY); + TransformConstraintPose *_self = (TransformConstraintPose *) self; + _self->setMixScaleY(mixScaleY); } float spine_transform_constraint_pose_get_mix_shear_y(spine_transform_constraint_pose self) { - return ((TransformConstraintPose*)self)->getMixShearY(); + TransformConstraintPose *_self = (TransformConstraintPose *) self; + return _self->getMixShearY(); } void spine_transform_constraint_pose_set_mix_shear_y(spine_transform_constraint_pose self, float mixShearY) { - ((TransformConstraintPose*)self)->setMixShearY(mixShearY); + TransformConstraintPose *_self = (TransformConstraintPose *) self; + _self->setMixShearY(mixShearY); } diff --git a/spine-c/src/generated/transform_constraint_timeline.cpp b/spine-c/src/generated/transform_constraint_timeline.cpp index bcb404ece..1f1dc0460 100644 --- a/spine-c/src/generated/transform_constraint_timeline.cpp +++ b/spine-c/src/generated/transform_constraint_timeline.cpp @@ -4,73 +4,95 @@ using namespace spine; spine_transform_constraint_timeline spine_transform_constraint_timeline_create(size_t frameCount, size_t bezierCount, int transformConstraintIndex) { - return (spine_transform_constraint_timeline) new (__FILE__, __LINE__) TransformConstraintTimeline(frameCount, bezierCount, transformConstraintIndex); + return (spine_transform_constraint_timeline) new (__FILE__, __LINE__) + TransformConstraintTimeline(frameCount, bezierCount, transformConstraintIndex); } void spine_transform_constraint_timeline_dispose(spine_transform_constraint_timeline self) { - delete (TransformConstraintTimeline*)self; + delete (TransformConstraintTimeline *) self; } spine_rtti spine_transform_constraint_timeline_get_rtti(spine_transform_constraint_timeline self) { - return (spine_rtti)&((TransformConstraintTimeline*)self)->getRTTI(); + TransformConstraintTimeline *_self = (TransformConstraintTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_transform_constraint_timeline_apply(spine_transform_constraint_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((TransformConstraintTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_transform_constraint_timeline_apply(spine_transform_constraint_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose) { + TransformConstraintTimeline *_self = (TransformConstraintTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } -void spine_transform_constraint_timeline_set_frame(spine_transform_constraint_timeline self, int frame, float time, float mixRotate, float mixX, float mixY, float mixScaleX, float mixScaleY, float mixShearY) { - ((TransformConstraintTimeline*)self)->setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY); +void spine_transform_constraint_timeline_set_frame(spine_transform_constraint_timeline self, int frame, float time, float mixRotate, float mixX, + float mixY, float mixScaleX, float mixScaleY, float mixShearY) { + TransformConstraintTimeline *_self = (TransformConstraintTimeline *) self; + _self->setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY); } void spine_transform_constraint_timeline_set_linear(spine_transform_constraint_timeline self, size_t frame) { - ((CurveTimeline*)(TransformConstraintTimeline*)self)->setLinear(frame); + CurveTimeline *_self = (CurveTimeline *) (TransformConstraintTimeline *) self; + _self->setLinear(frame); } void spine_transform_constraint_timeline_set_stepped(spine_transform_constraint_timeline self, size_t frame) { - ((CurveTimeline*)(TransformConstraintTimeline*)self)->setStepped(frame); + CurveTimeline *_self = (CurveTimeline *) (TransformConstraintTimeline *) self; + _self->setStepped(frame); } -void spine_transform_constraint_timeline_set_bezier(spine_transform_constraint_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((CurveTimeline*)(TransformConstraintTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_transform_constraint_timeline_set_bezier(spine_transform_constraint_timeline self, size_t bezier, size_t frame, float value, float time1, + float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { + CurveTimeline *_self = (CurveTimeline *) (TransformConstraintTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } -float spine_transform_constraint_timeline_get_bezier_value(spine_transform_constraint_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((CurveTimeline*)(TransformConstraintTimeline*)self)->getBezierValue(time, frame, valueOffset, i); +float spine_transform_constraint_timeline_get_bezier_value(spine_transform_constraint_timeline self, float time, size_t frame, size_t valueOffset, + size_t i) { + CurveTimeline *_self = (CurveTimeline *) (TransformConstraintTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_transform_constraint_timeline_get_curves(spine_transform_constraint_timeline self) { - return (spine_array_float)&((CurveTimeline*)(TransformConstraintTimeline*)self)->getCurves(); + CurveTimeline *_self = (CurveTimeline *) (TransformConstraintTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_transform_constraint_timeline_get_frame_entries(spine_transform_constraint_timeline self) { - return ((CurveTimeline*)(TransformConstraintTimeline*)self)->getFrameEntries(); + CurveTimeline *_self = (CurveTimeline *) (TransformConstraintTimeline *) self; + return _self->getFrameEntries(); } size_t spine_transform_constraint_timeline_get_frame_count(spine_transform_constraint_timeline self) { - return ((CurveTimeline*)(TransformConstraintTimeline*)self)->getFrameCount(); + CurveTimeline *_self = (CurveTimeline *) (TransformConstraintTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_transform_constraint_timeline_get_frames(spine_transform_constraint_timeline self) { - return (spine_array_float)&((CurveTimeline*)(TransformConstraintTimeline*)self)->getFrames(); + CurveTimeline *_self = (CurveTimeline *) (TransformConstraintTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_transform_constraint_timeline_get_duration(spine_transform_constraint_timeline self) { - return ((CurveTimeline*)(TransformConstraintTimeline*)self)->getDuration(); + CurveTimeline *_self = (CurveTimeline *) (TransformConstraintTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_transform_constraint_timeline_get_property_ids(spine_transform_constraint_timeline self) { - return (spine_array_property_id)&((CurveTimeline*)(TransformConstraintTimeline*)self)->getPropertyIds(); + CurveTimeline *_self = (CurveTimeline *) (TransformConstraintTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_transform_constraint_timeline_get_constraint_index(spine_transform_constraint_timeline self) { - return ((ConstraintTimeline*)(TransformConstraintTimeline*)self)->getConstraintIndex(); + ConstraintTimeline *_self = (ConstraintTimeline *) (TransformConstraintTimeline *) self; + return _self->getConstraintIndex(); } void spine_transform_constraint_timeline_set_constraint_index(spine_transform_constraint_timeline self, int inValue) { - ((ConstraintTimeline*)(TransformConstraintTimeline*)self)->setConstraintIndex(inValue); + ConstraintTimeline *_self = (ConstraintTimeline *) (TransformConstraintTimeline *) self; + _self->setConstraintIndex(inValue); } spine_rtti spine_transform_constraint_timeline_rtti(void) { - return (spine_rtti)&TransformConstraintTimeline::rtti; + return (spine_rtti) &TransformConstraintTimeline::rtti; } diff --git a/spine-c/src/generated/transform_constraint_timeline.h b/spine-c/src/generated/transform_constraint_timeline.h index 1cde58b47..b1a685513 100644 --- a/spine-c/src/generated/transform_constraint_timeline.h +++ b/spine-c/src/generated/transform_constraint_timeline.h @@ -8,17 +8,24 @@ extern "C" { #endif -SPINE_C_API spine_transform_constraint_timeline spine_transform_constraint_timeline_create(size_t frameCount, size_t bezierCount, int transformConstraintIndex); +SPINE_C_API spine_transform_constraint_timeline spine_transform_constraint_timeline_create(size_t frameCount, size_t bezierCount, + int transformConstraintIndex); SPINE_C_API void spine_transform_constraint_timeline_dispose(spine_transform_constraint_timeline self); SPINE_C_API spine_rtti spine_transform_constraint_timeline_get_rtti(spine_transform_constraint_timeline self); -SPINE_C_API void spine_transform_constraint_timeline_apply(spine_transform_constraint_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); -SPINE_C_API void spine_transform_constraint_timeline_set_frame(spine_transform_constraint_timeline self, int frame, float time, float mixRotate, float mixX, float mixY, float mixScaleX, float mixScaleY, float mixShearY); +SPINE_C_API void spine_transform_constraint_timeline_apply(spine_transform_constraint_timeline self, spine_skeleton skeleton, float lastTime, + float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, + spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_transform_constraint_timeline_set_frame(spine_transform_constraint_timeline self, int frame, float time, float mixRotate, + float mixX, float mixY, float mixScaleX, float mixScaleY, float mixShearY); SPINE_C_API void spine_transform_constraint_timeline_set_linear(spine_transform_constraint_timeline self, size_t frame); SPINE_C_API void spine_transform_constraint_timeline_set_stepped(spine_transform_constraint_timeline self, size_t frame); -SPINE_C_API void spine_transform_constraint_timeline_set_bezier(spine_transform_constraint_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); -SPINE_C_API float spine_transform_constraint_timeline_get_bezier_value(spine_transform_constraint_timeline self, float time, size_t frame, size_t valueOffset, size_t i); +SPINE_C_API void spine_transform_constraint_timeline_set_bezier(spine_transform_constraint_timeline self, size_t bezier, size_t frame, float value, + float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, + float value2); +SPINE_C_API float spine_transform_constraint_timeline_get_bezier_value(spine_transform_constraint_timeline self, float time, size_t frame, + size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_transform_constraint_timeline_get_curves(spine_transform_constraint_timeline self); SPINE_C_API size_t spine_transform_constraint_timeline_get_frame_entries(spine_transform_constraint_timeline self); SPINE_C_API size_t spine_transform_constraint_timeline_get_frame_count(spine_transform_constraint_timeline self); diff --git a/spine-c/src/generated/translate_timeline.cpp b/spine-c/src/generated/translate_timeline.cpp index 6792b1d5f..4d08b08ea 100644 --- a/spine-c/src/generated/translate_timeline.cpp +++ b/spine-c/src/generated/translate_timeline.cpp @@ -4,77 +4,96 @@ using namespace spine; spine_translate_timeline spine_translate_timeline_create(size_t frameCount, size_t bezierCount, int boneIndex) { - return (spine_translate_timeline) new (__FILE__, __LINE__) TranslateTimeline(frameCount, bezierCount, boneIndex); + return (spine_translate_timeline) new (__FILE__, __LINE__) TranslateTimeline(frameCount, bezierCount, boneIndex); } void spine_translate_timeline_dispose(spine_translate_timeline self) { - delete (TranslateTimeline*)self; + delete (TranslateTimeline *) self; } spine_rtti spine_translate_timeline_get_rtti(spine_translate_timeline self) { - return (spine_rtti)&((TranslateTimeline*)self)->getRTTI(); + TranslateTimeline *_self = (TranslateTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_translate_timeline_apply(spine_translate_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((BoneTimeline2*)(TranslateTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_translate_timeline_apply(spine_translate_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + BoneTimeline2 *_self = (BoneTimeline2 *) (TranslateTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_translate_timeline_set_frame(spine_translate_timeline self, size_t frame, float time, float value1, float value2) { - ((BoneTimeline2*)(TranslateTimeline*)self)->setFrame(frame, time, value1, value2); + BoneTimeline2 *_self = (BoneTimeline2 *) (TranslateTimeline *) self; + _self->setFrame(frame, time, value1, value2); } float spine_translate_timeline_get_curve_value(spine_translate_timeline self, float time) { - return ((BoneTimeline2*)(TranslateTimeline*)self)->getCurveValue(time); + BoneTimeline2 *_self = (BoneTimeline2 *) (TranslateTimeline *) self; + return _self->getCurveValue(time); } void spine_translate_timeline_set_linear(spine_translate_timeline self, size_t frame) { - ((BoneTimeline2*)(TranslateTimeline*)self)->setLinear(frame); + BoneTimeline2 *_self = (BoneTimeline2 *) (TranslateTimeline *) self; + _self->setLinear(frame); } void spine_translate_timeline_set_stepped(spine_translate_timeline self, size_t frame) { - ((BoneTimeline2*)(TranslateTimeline*)self)->setStepped(frame); + BoneTimeline2 *_self = (BoneTimeline2 *) (TranslateTimeline *) self; + _self->setStepped(frame); } -void spine_translate_timeline_set_bezier(spine_translate_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((BoneTimeline2*)(TranslateTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_translate_timeline_set_bezier(spine_translate_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2) { + BoneTimeline2 *_self = (BoneTimeline2 *) (TranslateTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_translate_timeline_get_bezier_value(spine_translate_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((BoneTimeline2*)(TranslateTimeline*)self)->getBezierValue(time, frame, valueOffset, i); + BoneTimeline2 *_self = (BoneTimeline2 *) (TranslateTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_translate_timeline_get_curves(spine_translate_timeline self) { - return (spine_array_float)&((BoneTimeline2*)(TranslateTimeline*)self)->getCurves(); + BoneTimeline2 *_self = (BoneTimeline2 *) (TranslateTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_translate_timeline_get_frame_entries(spine_translate_timeline self) { - return ((BoneTimeline2*)(TranslateTimeline*)self)->getFrameEntries(); + BoneTimeline2 *_self = (BoneTimeline2 *) (TranslateTimeline *) self; + return _self->getFrameEntries(); } size_t spine_translate_timeline_get_frame_count(spine_translate_timeline self) { - return ((BoneTimeline2*)(TranslateTimeline*)self)->getFrameCount(); + BoneTimeline2 *_self = (BoneTimeline2 *) (TranslateTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_translate_timeline_get_frames(spine_translate_timeline self) { - return (spine_array_float)&((BoneTimeline2*)(TranslateTimeline*)self)->getFrames(); + BoneTimeline2 *_self = (BoneTimeline2 *) (TranslateTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_translate_timeline_get_duration(spine_translate_timeline self) { - return ((BoneTimeline2*)(TranslateTimeline*)self)->getDuration(); + BoneTimeline2 *_self = (BoneTimeline2 *) (TranslateTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_translate_timeline_get_property_ids(spine_translate_timeline self) { - return (spine_array_property_id)&((BoneTimeline2*)(TranslateTimeline*)self)->getPropertyIds(); + BoneTimeline2 *_self = (BoneTimeline2 *) (TranslateTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_translate_timeline_get_bone_index(spine_translate_timeline self) { - return ((BoneTimeline2*)(TranslateTimeline*)self)->getBoneIndex(); + BoneTimeline2 *_self = (BoneTimeline2 *) (TranslateTimeline *) self; + return _self->getBoneIndex(); } void spine_translate_timeline_set_bone_index(spine_translate_timeline self, int inValue) { - ((BoneTimeline2*)(TranslateTimeline*)self)->setBoneIndex(inValue); + BoneTimeline2 *_self = (BoneTimeline2 *) (TranslateTimeline *) self; + _self->setBoneIndex(inValue); } spine_rtti spine_translate_timeline_rtti(void) { - return (spine_rtti)&TranslateTimeline::rtti; + return (spine_rtti) &TranslateTimeline::rtti; } diff --git a/spine-c/src/generated/translate_timeline.h b/spine-c/src/generated/translate_timeline.h index 3a84f1fd7..1d302c992 100644 --- a/spine-c/src/generated/translate_timeline.h +++ b/spine-c/src/generated/translate_timeline.h @@ -13,12 +13,15 @@ SPINE_C_API spine_translate_timeline spine_translate_timeline_create(size_t fram SPINE_C_API void spine_translate_timeline_dispose(spine_translate_timeline self); SPINE_C_API spine_rtti spine_translate_timeline_get_rtti(spine_translate_timeline self); -SPINE_C_API void spine_translate_timeline_apply(spine_translate_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_translate_timeline_apply(spine_translate_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); SPINE_C_API void spine_translate_timeline_set_frame(spine_translate_timeline self, size_t frame, float time, float value1, float value2); SPINE_C_API float spine_translate_timeline_get_curve_value(spine_translate_timeline self, float time); SPINE_C_API void spine_translate_timeline_set_linear(spine_translate_timeline self, size_t frame); SPINE_C_API void spine_translate_timeline_set_stepped(spine_translate_timeline self, size_t frame); -SPINE_C_API void spine_translate_timeline_set_bezier(spine_translate_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API void spine_translate_timeline_set_bezier(spine_translate_timeline self, size_t bezier, size_t frame, float value, float time1, + float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); SPINE_C_API float spine_translate_timeline_get_bezier_value(spine_translate_timeline self, float time, size_t frame, size_t valueOffset, size_t i); SPINE_C_API spine_array_float spine_translate_timeline_get_curves(spine_translate_timeline self); SPINE_C_API size_t spine_translate_timeline_get_frame_entries(spine_translate_timeline self); diff --git a/spine-c/src/generated/translate_x_timeline.cpp b/spine-c/src/generated/translate_x_timeline.cpp index ee1cf1d0e..2c258c81e 100644 --- a/spine-c/src/generated/translate_x_timeline.cpp +++ b/spine-c/src/generated/translate_x_timeline.cpp @@ -4,93 +4,120 @@ using namespace spine; spine_translate_x_timeline spine_translate_x_timeline_create(size_t frameCount, size_t bezierCount, int boneIndex) { - return (spine_translate_x_timeline) new (__FILE__, __LINE__) TranslateXTimeline(frameCount, bezierCount, boneIndex); + return (spine_translate_x_timeline) new (__FILE__, __LINE__) TranslateXTimeline(frameCount, bezierCount, boneIndex); } void spine_translate_x_timeline_dispose(spine_translate_x_timeline self) { - delete (TranslateXTimeline*)self; + delete (TranslateXTimeline *) self; } spine_rtti spine_translate_x_timeline_get_rtti(spine_translate_x_timeline self) { - return (spine_rtti)&((TranslateXTimeline*)self)->getRTTI(); + TranslateXTimeline *_self = (TranslateXTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_translate_x_timeline_apply(spine_translate_x_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((BoneTimeline1*)(TranslateXTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_translate_x_timeline_apply(spine_translate_x_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateXTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_translate_x_timeline_set_frame(spine_translate_x_timeline self, size_t frame, float time, float value) { - ((BoneTimeline1*)(TranslateXTimeline*)self)->setFrame(frame, time, value); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateXTimeline *) self; + _self->setFrame(frame, time, value); } float spine_translate_x_timeline_get_curve_value(spine_translate_x_timeline self, float time) { - return ((BoneTimeline1*)(TranslateXTimeline*)self)->getCurveValue(time); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateXTimeline *) self; + return _self->getCurveValue(time); } -float spine_translate_x_timeline_get_relative_value(spine_translate_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((BoneTimeline1*)(TranslateXTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_translate_x_timeline_get_relative_value(spine_translate_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateXTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_translate_x_timeline_get_absolute_value_1(spine_translate_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((BoneTimeline1*)(TranslateXTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_translate_x_timeline_get_absolute_value_1(spine_translate_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateXTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_translate_x_timeline_get_absolute_value_2(spine_translate_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((BoneTimeline1*)(TranslateXTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_translate_x_timeline_get_absolute_value_2(spine_translate_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup, float value) { + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateXTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_translate_x_timeline_get_scale_value(spine_translate_x_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((BoneTimeline1*)(TranslateXTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_translate_x_timeline_get_scale_value(spine_translate_x_timeline self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateXTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_translate_x_timeline_set_linear(spine_translate_x_timeline self, size_t frame) { - ((BoneTimeline1*)(TranslateXTimeline*)self)->setLinear(frame); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateXTimeline *) self; + _self->setLinear(frame); } void spine_translate_x_timeline_set_stepped(spine_translate_x_timeline self, size_t frame) { - ((BoneTimeline1*)(TranslateXTimeline*)self)->setStepped(frame); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateXTimeline *) self; + _self->setStepped(frame); } -void spine_translate_x_timeline_set_bezier(spine_translate_x_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((BoneTimeline1*)(TranslateXTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_translate_x_timeline_set_bezier(spine_translate_x_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2) { + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateXTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_translate_x_timeline_get_bezier_value(spine_translate_x_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((BoneTimeline1*)(TranslateXTimeline*)self)->getBezierValue(time, frame, valueOffset, i); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateXTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_translate_x_timeline_get_curves(spine_translate_x_timeline self) { - return (spine_array_float)&((BoneTimeline1*)(TranslateXTimeline*)self)->getCurves(); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateXTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_translate_x_timeline_get_frame_entries(spine_translate_x_timeline self) { - return ((BoneTimeline1*)(TranslateXTimeline*)self)->getFrameEntries(); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateXTimeline *) self; + return _self->getFrameEntries(); } size_t spine_translate_x_timeline_get_frame_count(spine_translate_x_timeline self) { - return ((BoneTimeline1*)(TranslateXTimeline*)self)->getFrameCount(); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateXTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_translate_x_timeline_get_frames(spine_translate_x_timeline self) { - return (spine_array_float)&((BoneTimeline1*)(TranslateXTimeline*)self)->getFrames(); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateXTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_translate_x_timeline_get_duration(spine_translate_x_timeline self) { - return ((BoneTimeline1*)(TranslateXTimeline*)self)->getDuration(); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateXTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_translate_x_timeline_get_property_ids(spine_translate_x_timeline self) { - return (spine_array_property_id)&((BoneTimeline1*)(TranslateXTimeline*)self)->getPropertyIds(); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateXTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_translate_x_timeline_get_bone_index(spine_translate_x_timeline self) { - return ((BoneTimeline1*)(TranslateXTimeline*)self)->getBoneIndex(); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateXTimeline *) self; + return _self->getBoneIndex(); } void spine_translate_x_timeline_set_bone_index(spine_translate_x_timeline self, int inValue) { - ((BoneTimeline1*)(TranslateXTimeline*)self)->setBoneIndex(inValue); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateXTimeline *) self; + _self->setBoneIndex(inValue); } spine_rtti spine_translate_x_timeline_rtti(void) { - return (spine_rtti)&TranslateXTimeline::rtti; + return (spine_rtti) &TranslateXTimeline::rtti; } diff --git a/spine-c/src/generated/translate_x_timeline.h b/spine-c/src/generated/translate_x_timeline.h index f6fc1680b..9ad888ff4 100644 --- a/spine-c/src/generated/translate_x_timeline.h +++ b/spine-c/src/generated/translate_x_timeline.h @@ -13,17 +13,25 @@ SPINE_C_API spine_translate_x_timeline spine_translate_x_timeline_create(size_t SPINE_C_API void spine_translate_x_timeline_dispose(spine_translate_x_timeline self); SPINE_C_API spine_rtti spine_translate_x_timeline_get_rtti(spine_translate_x_timeline self); -SPINE_C_API void spine_translate_x_timeline_apply(spine_translate_x_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_translate_x_timeline_apply(spine_translate_x_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); SPINE_C_API void spine_translate_x_timeline_set_frame(spine_translate_x_timeline self, size_t frame, float time, float value); SPINE_C_API float spine_translate_x_timeline_get_curve_value(spine_translate_x_timeline self, float time); -SPINE_C_API float spine_translate_x_timeline_get_relative_value(spine_translate_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_translate_x_timeline_get_absolute_value_1(spine_translate_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_translate_x_timeline_get_absolute_value_2(spine_translate_x_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_translate_x_timeline_get_scale_value(spine_translate_x_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_translate_x_timeline_get_relative_value(spine_translate_x_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup); +SPINE_C_API float spine_translate_x_timeline_get_absolute_value_1(spine_translate_x_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup); +SPINE_C_API float spine_translate_x_timeline_get_absolute_value_2(spine_translate_x_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup, float value); +SPINE_C_API float spine_translate_x_timeline_get_scale_value(spine_translate_x_timeline self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup); SPINE_C_API void spine_translate_x_timeline_set_linear(spine_translate_x_timeline self, size_t frame); SPINE_C_API void spine_translate_x_timeline_set_stepped(spine_translate_x_timeline self, size_t frame); -SPINE_C_API void spine_translate_x_timeline_set_bezier(spine_translate_x_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); -SPINE_C_API float spine_translate_x_timeline_get_bezier_value(spine_translate_x_timeline self, float time, size_t frame, size_t valueOffset, size_t i); +SPINE_C_API void spine_translate_x_timeline_set_bezier(spine_translate_x_timeline self, size_t bezier, size_t frame, float value, float time1, + float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API float spine_translate_x_timeline_get_bezier_value(spine_translate_x_timeline self, float time, size_t frame, size_t valueOffset, + size_t i); SPINE_C_API spine_array_float spine_translate_x_timeline_get_curves(spine_translate_x_timeline self); SPINE_C_API size_t spine_translate_x_timeline_get_frame_entries(spine_translate_x_timeline self); SPINE_C_API size_t spine_translate_x_timeline_get_frame_count(spine_translate_x_timeline self); diff --git a/spine-c/src/generated/translate_y_timeline.cpp b/spine-c/src/generated/translate_y_timeline.cpp index 2ce662dbd..162f3a44d 100644 --- a/spine-c/src/generated/translate_y_timeline.cpp +++ b/spine-c/src/generated/translate_y_timeline.cpp @@ -4,93 +4,120 @@ using namespace spine; spine_translate_y_timeline spine_translate_y_timeline_create(size_t frameCount, size_t bezierCount, int boneIndex) { - return (spine_translate_y_timeline) new (__FILE__, __LINE__) TranslateYTimeline(frameCount, bezierCount, boneIndex); + return (spine_translate_y_timeline) new (__FILE__, __LINE__) TranslateYTimeline(frameCount, bezierCount, boneIndex); } void spine_translate_y_timeline_dispose(spine_translate_y_timeline self) { - delete (TranslateYTimeline*)self; + delete (TranslateYTimeline *) self; } spine_rtti spine_translate_y_timeline_get_rtti(spine_translate_y_timeline self) { - return (spine_rtti)&((TranslateYTimeline*)self)->getRTTI(); + TranslateYTimeline *_self = (TranslateYTimeline *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_translate_y_timeline_apply(spine_translate_y_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { - ((BoneTimeline1*)(TranslateYTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose); +void spine_translate_y_timeline_apply(spine_translate_y_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, + float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) { + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateYTimeline *) self; + _self->apply(*((Skeleton *) skeleton), lastTime, time, (Array *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, + appliedPose); } void spine_translate_y_timeline_set_frame(spine_translate_y_timeline self, size_t frame, float time, float value) { - ((BoneTimeline1*)(TranslateYTimeline*)self)->setFrame(frame, time, value); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateYTimeline *) self; + _self->setFrame(frame, time, value); } float spine_translate_y_timeline_get_curve_value(spine_translate_y_timeline self, float time) { - return ((BoneTimeline1*)(TranslateYTimeline*)self)->getCurveValue(time); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateYTimeline *) self; + return _self->getCurveValue(time); } -float spine_translate_y_timeline_get_relative_value(spine_translate_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((BoneTimeline1*)(TranslateYTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup); +float spine_translate_y_timeline_get_relative_value(spine_translate_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateYTimeline *) self; + return _self->getRelativeValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_translate_y_timeline_get_absolute_value_1(spine_translate_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) { - return ((BoneTimeline1*)(TranslateYTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup); +float spine_translate_y_timeline_get_absolute_value_1(spine_translate_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateYTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup); } -float spine_translate_y_timeline_get_absolute_value_2(spine_translate_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) { - return ((BoneTimeline1*)(TranslateYTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value); +float spine_translate_y_timeline_get_absolute_value_2(spine_translate_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, + float setup, float value) { + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateYTimeline *) self; + return _self->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value); } -float spine_translate_y_timeline_get_scale_value(spine_translate_y_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) { - return ((BoneTimeline1*)(TranslateYTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup); +float spine_translate_y_timeline_get_scale_value(spine_translate_y_timeline self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup) { + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateYTimeline *) self; + return _self->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup); } void spine_translate_y_timeline_set_linear(spine_translate_y_timeline self, size_t frame) { - ((BoneTimeline1*)(TranslateYTimeline*)self)->setLinear(frame); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateYTimeline *) self; + _self->setLinear(frame); } void spine_translate_y_timeline_set_stepped(spine_translate_y_timeline self, size_t frame) { - ((BoneTimeline1*)(TranslateYTimeline*)self)->setStepped(frame); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateYTimeline *) self; + _self->setStepped(frame); } -void spine_translate_y_timeline_set_bezier(spine_translate_y_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) { - ((BoneTimeline1*)(TranslateYTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); +void spine_translate_y_timeline_set_bezier(spine_translate_y_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, + float cx1, float cy1, float cx2, float cy2, float time2, float value2) { + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateYTimeline *) self; + _self->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } float spine_translate_y_timeline_get_bezier_value(spine_translate_y_timeline self, float time, size_t frame, size_t valueOffset, size_t i) { - return ((BoneTimeline1*)(TranslateYTimeline*)self)->getBezierValue(time, frame, valueOffset, i); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateYTimeline *) self; + return _self->getBezierValue(time, frame, valueOffset, i); } spine_array_float spine_translate_y_timeline_get_curves(spine_translate_y_timeline self) { - return (spine_array_float)&((BoneTimeline1*)(TranslateYTimeline*)self)->getCurves(); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateYTimeline *) self; + return (spine_array_float) &_self->getCurves(); } size_t spine_translate_y_timeline_get_frame_entries(spine_translate_y_timeline self) { - return ((BoneTimeline1*)(TranslateYTimeline*)self)->getFrameEntries(); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateYTimeline *) self; + return _self->getFrameEntries(); } size_t spine_translate_y_timeline_get_frame_count(spine_translate_y_timeline self) { - return ((BoneTimeline1*)(TranslateYTimeline*)self)->getFrameCount(); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateYTimeline *) self; + return _self->getFrameCount(); } spine_array_float spine_translate_y_timeline_get_frames(spine_translate_y_timeline self) { - return (spine_array_float)&((BoneTimeline1*)(TranslateYTimeline*)self)->getFrames(); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateYTimeline *) self; + return (spine_array_float) &_self->getFrames(); } float spine_translate_y_timeline_get_duration(spine_translate_y_timeline self) { - return ((BoneTimeline1*)(TranslateYTimeline*)self)->getDuration(); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateYTimeline *) self; + return _self->getDuration(); } spine_array_property_id spine_translate_y_timeline_get_property_ids(spine_translate_y_timeline self) { - return (spine_array_property_id)&((BoneTimeline1*)(TranslateYTimeline*)self)->getPropertyIds(); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateYTimeline *) self; + return (spine_array_property_id) &_self->getPropertyIds(); } int spine_translate_y_timeline_get_bone_index(spine_translate_y_timeline self) { - return ((BoneTimeline1*)(TranslateYTimeline*)self)->getBoneIndex(); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateYTimeline *) self; + return _self->getBoneIndex(); } void spine_translate_y_timeline_set_bone_index(spine_translate_y_timeline self, int inValue) { - ((BoneTimeline1*)(TranslateYTimeline*)self)->setBoneIndex(inValue); + BoneTimeline1 *_self = (BoneTimeline1 *) (TranslateYTimeline *) self; + _self->setBoneIndex(inValue); } spine_rtti spine_translate_y_timeline_rtti(void) { - return (spine_rtti)&TranslateYTimeline::rtti; + return (spine_rtti) &TranslateYTimeline::rtti; } diff --git a/spine-c/src/generated/translate_y_timeline.h b/spine-c/src/generated/translate_y_timeline.h index 60cd040c3..3f9363eb7 100644 --- a/spine-c/src/generated/translate_y_timeline.h +++ b/spine-c/src/generated/translate_y_timeline.h @@ -13,17 +13,25 @@ SPINE_C_API spine_translate_y_timeline spine_translate_y_timeline_create(size_t SPINE_C_API void spine_translate_y_timeline_dispose(spine_translate_y_timeline self); SPINE_C_API spine_rtti spine_translate_y_timeline_get_rtti(spine_translate_y_timeline self); -SPINE_C_API void spine_translate_y_timeline_apply(spine_translate_y_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose); +SPINE_C_API void spine_translate_y_timeline_apply(spine_translate_y_timeline self, spine_skeleton skeleton, float lastTime, float time, + spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, + bool appliedPose); SPINE_C_API void spine_translate_y_timeline_set_frame(spine_translate_y_timeline self, size_t frame, float time, float value); SPINE_C_API float spine_translate_y_timeline_get_curve_value(spine_translate_y_timeline self, float time); -SPINE_C_API float spine_translate_y_timeline_get_relative_value(spine_translate_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_translate_y_timeline_get_absolute_value_1(spine_translate_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup); -SPINE_C_API float spine_translate_y_timeline_get_absolute_value_2(spine_translate_y_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value); -SPINE_C_API float spine_translate_y_timeline_get_scale_value(spine_translate_y_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup); +SPINE_C_API float spine_translate_y_timeline_get_relative_value(spine_translate_y_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup); +SPINE_C_API float spine_translate_y_timeline_get_absolute_value_1(spine_translate_y_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup); +SPINE_C_API float spine_translate_y_timeline_get_absolute_value_2(spine_translate_y_timeline self, float time, float alpha, spine_mix_blend blend, + float current, float setup, float value); +SPINE_C_API float spine_translate_y_timeline_get_scale_value(spine_translate_y_timeline self, float time, float alpha, spine_mix_blend blend, + spine_mix_direction direction, float current, float setup); SPINE_C_API void spine_translate_y_timeline_set_linear(spine_translate_y_timeline self, size_t frame); SPINE_C_API void spine_translate_y_timeline_set_stepped(spine_translate_y_timeline self, size_t frame); -SPINE_C_API void spine_translate_y_timeline_set_bezier(spine_translate_y_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); -SPINE_C_API float spine_translate_y_timeline_get_bezier_value(spine_translate_y_timeline self, float time, size_t frame, size_t valueOffset, size_t i); +SPINE_C_API void spine_translate_y_timeline_set_bezier(spine_translate_y_timeline self, size_t bezier, size_t frame, float value, float time1, + float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2); +SPINE_C_API float spine_translate_y_timeline_get_bezier_value(spine_translate_y_timeline self, float time, size_t frame, size_t valueOffset, + size_t i); SPINE_C_API spine_array_float spine_translate_y_timeline_get_curves(spine_translate_y_timeline self); SPINE_C_API size_t spine_translate_y_timeline_get_frame_entries(spine_translate_y_timeline self); SPINE_C_API size_t spine_translate_y_timeline_get_frame_count(spine_translate_y_timeline self); diff --git a/spine-c/src/generated/types.h b/spine-c/src/generated/types.h index 6c0bb8d6e..2cc072e61 100644 --- a/spine-c/src/generated/types.h +++ b/spine-c/src/generated/types.h @@ -187,4 +187,4 @@ SPINE_OPAQUE_TYPE(spine_vertex_attachment) } #endif -#endif // SPINE_C_TYPES_H +#endif// SPINE_C_TYPES_H diff --git a/spine-c/src/generated/update.cpp b/spine-c/src/generated/update.cpp index 2ad6d03a5..a4196ce19 100644 --- a/spine-c/src/generated/update.cpp +++ b/spine-c/src/generated/update.cpp @@ -4,17 +4,19 @@ using namespace spine; void spine_update_dispose(spine_update self) { - delete (Update*)self; + delete (Update *) self; } spine_rtti spine_update_get_rtti(spine_update self) { - return (spine_rtti)&((Update*)self)->getRTTI(); + Update *_self = (Update *) self; + return (spine_rtti) &_self->getRTTI(); } void spine_update_update(spine_update self, spine_skeleton skeleton, spine_physics physics) { - ((Update*)self)->update(*((Skeleton*)skeleton), (Physics)physics); + Update *_self = (Update *) self; + _self->update(*((Skeleton *) skeleton), (Physics) physics); } spine_rtti spine_update_rtti(void) { - return (spine_rtti)&Update::rtti; + return (spine_rtti) &Update::rtti; } diff --git a/spine-c/src/generated/vertex_attachment.cpp b/spine-c/src/generated/vertex_attachment.cpp index 75b816974..5f2f908e0 100644 --- a/spine-c/src/generated/vertex_attachment.cpp +++ b/spine-c/src/generated/vertex_attachment.cpp @@ -4,81 +4,101 @@ using namespace spine; void spine_vertex_attachment_dispose(spine_vertex_attachment self) { - delete (VertexAttachment*)self; + delete (VertexAttachment *) self; } spine_rtti spine_vertex_attachment_get_rtti(spine_vertex_attachment self) { - return (spine_rtti)&((VertexAttachment*)self)->getRTTI(); + VertexAttachment *_self = (VertexAttachment *) self; + return (spine_rtti) &_self->getRTTI(); } -void spine_vertex_attachment_compute_world_vertices_1(spine_vertex_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, float * worldVertices, size_t offset, size_t stride) { - ((VertexAttachment*)self)->computeWorldVertices(*((Skeleton*)skeleton), *((Slot*)slot), start, count, worldVertices, offset, stride); +void spine_vertex_attachment_compute_world_vertices_1(spine_vertex_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, + size_t count, float *worldVertices, size_t offset, size_t stride) { + VertexAttachment *_self = (VertexAttachment *) self; + _self->computeWorldVertices(*((Skeleton *) skeleton), *((Slot *) slot), start, count, worldVertices, offset, stride); } -void spine_vertex_attachment_compute_world_vertices_2(spine_vertex_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, spine_array_float worldVertices, size_t offset, size_t stride) { - ((VertexAttachment*)self)->computeWorldVertices(*((Skeleton*)skeleton), *((Slot*)slot), start, count, *((Array*)worldVertices), offset, stride); +void spine_vertex_attachment_compute_world_vertices_2(spine_vertex_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, + size_t count, spine_array_float worldVertices, size_t offset, size_t stride) { + VertexAttachment *_self = (VertexAttachment *) self; + _self->computeWorldVertices(*((Skeleton *) skeleton), *((Slot *) slot), start, count, *((Array *) worldVertices), offset, stride); } int spine_vertex_attachment_get_id(spine_vertex_attachment self) { - return ((VertexAttachment*)self)->getId(); + VertexAttachment *_self = (VertexAttachment *) self; + return _self->getId(); } spine_array_int spine_vertex_attachment_get_bones(spine_vertex_attachment self) { - return (spine_array_int)&((VertexAttachment*)self)->getBones(); + VertexAttachment *_self = (VertexAttachment *) self; + return (spine_array_int) &_self->getBones(); } void spine_vertex_attachment_set_bones(spine_vertex_attachment self, spine_array_int bones) { - ((VertexAttachment*)self)->setBones(*((Array*)bones)); + VertexAttachment *_self = (VertexAttachment *) self; + _self->setBones(*((Array *) bones)); } spine_array_float spine_vertex_attachment_get_vertices(spine_vertex_attachment self) { - return (spine_array_float)&((VertexAttachment*)self)->getVertices(); + VertexAttachment *_self = (VertexAttachment *) self; + return (spine_array_float) &_self->getVertices(); } void spine_vertex_attachment_set_vertices(spine_vertex_attachment self, spine_array_float vertices) { - ((VertexAttachment*)self)->setVertices(*((Array*)vertices)); + VertexAttachment *_self = (VertexAttachment *) self; + _self->setVertices(*((Array *) vertices)); } size_t spine_vertex_attachment_get_world_vertices_length(spine_vertex_attachment self) { - return ((VertexAttachment*)self)->getWorldVerticesLength(); + VertexAttachment *_self = (VertexAttachment *) self; + return _self->getWorldVerticesLength(); } void spine_vertex_attachment_set_world_vertices_length(spine_vertex_attachment self, size_t inValue) { - ((VertexAttachment*)self)->setWorldVerticesLength(inValue); + VertexAttachment *_self = (VertexAttachment *) self; + _self->setWorldVerticesLength(inValue); } spine_attachment spine_vertex_attachment_get_timeline_attachment(spine_vertex_attachment self) { - return (spine_attachment)((VertexAttachment*)self)->getTimelineAttachment(); + VertexAttachment *_self = (VertexAttachment *) self; + return (spine_attachment) _self->getTimelineAttachment(); } void spine_vertex_attachment_set_timeline_attachment(spine_vertex_attachment self, spine_attachment attachment) { - ((VertexAttachment*)self)->setTimelineAttachment((Attachment *)attachment); + VertexAttachment *_self = (VertexAttachment *) self; + _self->setTimelineAttachment((Attachment *) attachment); } void spine_vertex_attachment_copy_to(spine_vertex_attachment self, spine_vertex_attachment other) { - ((VertexAttachment*)self)->copyTo((VertexAttachment *)other); + VertexAttachment *_self = (VertexAttachment *) self; + _self->copyTo((VertexAttachment *) other); } -const char * spine_vertex_attachment_get_name(spine_vertex_attachment self) { - return ((Attachment*)(VertexAttachment*)self)->getName().buffer(); +const char *spine_vertex_attachment_get_name(spine_vertex_attachment self) { + Attachment *_self = (Attachment *) (VertexAttachment *) self; + return _self->getName().buffer(); } spine_attachment spine_vertex_attachment_copy(spine_vertex_attachment self) { - return (spine_attachment)((Attachment*)(VertexAttachment*)self)->copy(); + Attachment *_self = (Attachment *) (VertexAttachment *) self; + return (spine_attachment) _self->copy(); } int spine_vertex_attachment_get_ref_count(spine_vertex_attachment self) { - return ((Attachment*)(VertexAttachment*)self)->getRefCount(); + Attachment *_self = (Attachment *) (VertexAttachment *) self; + return _self->getRefCount(); } void spine_vertex_attachment_reference(spine_vertex_attachment self) { - ((Attachment*)(VertexAttachment*)self)->reference(); + Attachment *_self = (Attachment *) (VertexAttachment *) self; + _self->reference(); } void spine_vertex_attachment_dereference(spine_vertex_attachment self) { - ((Attachment*)(VertexAttachment*)self)->dereference(); + Attachment *_self = (Attachment *) (VertexAttachment *) self; + _self->dereference(); } spine_rtti spine_vertex_attachment_rtti(void) { - return (spine_rtti)&VertexAttachment::rtti; + return (spine_rtti) &VertexAttachment::rtti; } diff --git a/spine-c/src/generated/vertex_attachment.h b/spine-c/src/generated/vertex_attachment.h index cb15198bd..75f30b3b6 100644 --- a/spine-c/src/generated/vertex_attachment.h +++ b/spine-c/src/generated/vertex_attachment.h @@ -11,8 +11,11 @@ extern "C" { SPINE_C_API void spine_vertex_attachment_dispose(spine_vertex_attachment self); SPINE_C_API spine_rtti spine_vertex_attachment_get_rtti(spine_vertex_attachment self); -SPINE_C_API void spine_vertex_attachment_compute_world_vertices_1(spine_vertex_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, float * worldVertices, size_t offset, size_t stride); -SPINE_C_API void spine_vertex_attachment_compute_world_vertices_2(spine_vertex_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, spine_array_float worldVertices, size_t offset, size_t stride); +SPINE_C_API void spine_vertex_attachment_compute_world_vertices_1(spine_vertex_attachment self, spine_skeleton skeleton, spine_slot slot, + size_t start, size_t count, float *worldVertices, size_t offset, size_t stride); +SPINE_C_API void spine_vertex_attachment_compute_world_vertices_2(spine_vertex_attachment self, spine_skeleton skeleton, spine_slot slot, + size_t start, size_t count, spine_array_float worldVertices, size_t offset, + size_t stride); SPINE_C_API int spine_vertex_attachment_get_id(spine_vertex_attachment self); SPINE_C_API spine_array_int spine_vertex_attachment_get_bones(spine_vertex_attachment self); SPINE_C_API void spine_vertex_attachment_set_bones(spine_vertex_attachment self, spine_array_int bones); @@ -23,7 +26,7 @@ SPINE_C_API void spine_vertex_attachment_set_world_vertices_length(spine_vertex_ SPINE_C_API spine_attachment spine_vertex_attachment_get_timeline_attachment(spine_vertex_attachment self); SPINE_C_API void spine_vertex_attachment_set_timeline_attachment(spine_vertex_attachment self, spine_attachment attachment); SPINE_C_API void spine_vertex_attachment_copy_to(spine_vertex_attachment self, spine_vertex_attachment other); -SPINE_C_API const char * spine_vertex_attachment_get_name(spine_vertex_attachment self); +SPINE_C_API const char *spine_vertex_attachment_get_name(spine_vertex_attachment self); SPINE_C_API spine_attachment spine_vertex_attachment_copy(spine_vertex_attachment self); SPINE_C_API int spine_vertex_attachment_get_ref_count(spine_vertex_attachment self); SPINE_C_API void spine_vertex_attachment_reference(spine_vertex_attachment self); diff --git a/spine-c/tests/headless-test.c b/spine-c/tests/headless-test.c index 826b40cde..08df34289 100644 --- a/spine-c/tests/headless-test.c +++ b/spine-c/tests/headless-test.c @@ -161,8 +161,7 @@ int main(int argc, char *argv[]) { } // Load atlas with headless texture loader - spine_atlas atlas = spine_atlas_load_callback((const char *) atlasBytes, atlasDir, - headlessTextureLoader, headlessTextureUnloader); + spine_atlas atlas = spine_atlas_load_callback((const char *) atlasBytes, atlasDir, headlessTextureLoader, headlessTextureUnloader); free(atlasBytes); if (!atlas) { diff --git a/spine-cocos2dx/example/Classes/AppDelegate.cpp b/spine-cocos2dx/example/Classes/AppDelegate.cpp index eed7406ef..c363f3c0a 100644 --- a/spine-cocos2dx/example/Classes/AppDelegate.cpp +++ b/spine-cocos2dx/example/Classes/AppDelegate.cpp @@ -83,15 +83,18 @@ bool AppDelegate::applicationDidFinishLaunching() { if (frameSize.height > mediumResource.size.height) { // if the frame's height is larger than the height of medium resource size, select large resource. searchPath.push_back(largeResource.directory); - director->setContentScaleFactor(MIN(largeResource.size.height / designResolutionSize.height, largeResource.size.width / designResolutionSize.width)); + director->setContentScaleFactor( + MIN(largeResource.size.height / designResolutionSize.height, largeResource.size.width / designResolutionSize.width)); } else if (frameSize.height > smallResource.size.height) { // if the frame's height is larger than the height of small resource size, select medium resource. searchPath.push_back(mediumResource.directory); - director->setContentScaleFactor(MIN(mediumResource.size.height / designResolutionSize.height, mediumResource.size.width / designResolutionSize.width)); + director->setContentScaleFactor( + MIN(mediumResource.size.height / designResolutionSize.height, mediumResource.size.width / designResolutionSize.width)); } else { // if the frame's height is smaller than the height of medium resource size, select small resource. searchPath.push_back(smallResource.directory); - director->setContentScaleFactor(MIN(smallResource.size.height / designResolutionSize.height, smallResource.size.width / designResolutionSize.width)); + director->setContentScaleFactor( + MIN(smallResource.size.height / designResolutionSize.height, smallResource.size.width / designResolutionSize.width)); } searchPath.push_back("common"); diff --git a/spine-cocos2dx/example/Classes/BatchingExample.cpp b/spine-cocos2dx/example/Classes/BatchingExample.cpp index e51ba3527..5e0188563 100644 --- a/spine-cocos2dx/example/Classes/BatchingExample.cpp +++ b/spine-cocos2dx/example/Classes/BatchingExample.cpp @@ -85,9 +85,7 @@ bool BatchingExample::init() { // if (j == 20) j = 0; // skeletonNode->setTwoColorTint(true); - skeletonNode->setPosition(Vec2( - RandomHelper::random_int(xMin, xMax), - RandomHelper::random_int(yMin, yMax))); + skeletonNode->setPosition(Vec2(RandomHelper::random_int(xMin, xMax), RandomHelper::random_int(yMin, yMax))); addChild(skeletonNode); } diff --git a/spine-cocos2dx/example/Classes/SpineboyExample.cpp b/spine-cocos2dx/example/Classes/SpineboyExample.cpp index 10c8bd213..f602169a7 100644 --- a/spine-cocos2dx/example/Classes/SpineboyExample.cpp +++ b/spine-cocos2dx/example/Classes/SpineboyExample.cpp @@ -44,23 +44,14 @@ bool SpineboyExample::init() { skeletonNode = SkeletonAnimation::createWithJsonFile("spineboy-pro.json", "spineboy.atlas", 0.6f); - skeletonNode->setStartListener([](TrackEntry *entry) { - log("%d start: %s", entry->getTrackIndex(), entry->getAnimation()->getName().buffer()); - }); - skeletonNode->setInterruptListener([](TrackEntry *entry) { - log("%d interrupt", entry->getTrackIndex()); - }); - skeletonNode->setEndListener([](TrackEntry *entry) { - log("%d end", entry->getTrackIndex()); - }); - skeletonNode->setCompleteListener([](TrackEntry *entry) { - log("%d complete", entry->getTrackIndex()); - }); - skeletonNode->setDisposeListener([](TrackEntry *entry) { - log("%d dispose", entry->getTrackIndex()); - }); + skeletonNode->setStartListener([](TrackEntry *entry) { log("%d start: %s", entry->getTrackIndex(), entry->getAnimation()->getName().buffer()); }); + skeletonNode->setInterruptListener([](TrackEntry *entry) { log("%d interrupt", entry->getTrackIndex()); }); + skeletonNode->setEndListener([](TrackEntry *entry) { log("%d end", entry->getTrackIndex()); }); + skeletonNode->setCompleteListener([](TrackEntry *entry) { log("%d complete", entry->getTrackIndex()); }); + skeletonNode->setDisposeListener([](TrackEntry *entry) { log("%d dispose", entry->getTrackIndex()); }); skeletonNode->setEventListener([](TrackEntry *entry, spine::Event *event) { - log("%d event: %s, %d, %f, %s", entry->getTrackIndex(), event->getData().getName().buffer(), event->getIntValue(), event->getFloatValue(), event->getStringValue().buffer()); + log("%d event: %s, %d, %f, %s", entry->getTrackIndex(), event->getData().getName().buffer(), event->getIntValue(), event->getFloatValue(), + event->getStringValue().buffer()); }); skeletonNode->setMix("walk", "jump", 0.4); @@ -69,9 +60,7 @@ bool SpineboyExample::init() { TrackEntry *jumpEntry = skeletonNode->addAnimation(0, "jump", false, 1); skeletonNode->addAnimation(0, "run", true); - skeletonNode->setTrackStartListener(jumpEntry, [](TrackEntry *entry) { - log("jumped!"); - }); + skeletonNode->setTrackStartListener(jumpEntry, [](TrackEntry *entry) { log("jumped!"); }); // skeletonNode->addAnimation(1, "test", true); // skeletonNode->runAction(RepeatForever::create(Sequence::create(FadeOut::create(1), FadeIn::create(1), DelayTime::create(5), NULL))); diff --git a/spine-cocos2dx/spine-cocos2dx/src/spine/SkeletonAnimation.cpp b/spine-cocos2dx/spine-cocos2dx/src/spine/SkeletonAnimation.cpp index 32e36440d..49d846d93 100644 --- a/spine-cocos2dx/spine-cocos2dx/src/spine/SkeletonAnimation.cpp +++ b/spine-cocos2dx/spine-cocos2dx/src/spine/SkeletonAnimation.cpp @@ -120,8 +120,7 @@ namespace spine { _firstDraw = true; } - SkeletonAnimation::SkeletonAnimation() - : SkeletonRendererCocos2dX() { + SkeletonAnimation::SkeletonAnimation() : SkeletonRendererCocos2dX() { } SkeletonAnimation::~SkeletonAnimation() { @@ -138,7 +137,7 @@ namespace spine { if (_preUpdateListener) _preUpdateListener(this); _state->update(deltaTime); _state->apply(*_skeleton); - _skeleton->update(deltaTime); + _skeleton->update(deltaTime); _skeleton->updateWorldTransform(Physics_Update); if (_postUpdateListener) _postUpdateListener(this); } diff --git a/spine-cocos2dx/spine-cocos2dx/src/spine/SkeletonAnimation.h b/spine-cocos2dx/spine-cocos2dx/src/spine/SkeletonAnimation.h index 72b14ee0a..248cf5a97 100644 --- a/spine-cocos2dx/spine-cocos2dx/src/spine/SkeletonAnimation.h +++ b/spine-cocos2dx/spine-cocos2dx/src/spine/SkeletonAnimation.h @@ -62,7 +62,8 @@ namespace spine { return SkeletonAnimation::createWithJsonFile(skeletonJsonFile, atlas, scale); } // Use createWithJsonFile instead - CC_DEPRECATED_ATTRIBUTE static SkeletonAnimation *createWithFile(const std::string &skeletonJsonFile, const std::string &atlasFile, float scale = 1) { + CC_DEPRECATED_ATTRIBUTE static SkeletonAnimation *createWithFile(const std::string &skeletonJsonFile, const std::string &atlasFile, + float scale = 1) { return SkeletonAnimation::createWithJsonFile(skeletonJsonFile, atlasFile, scale); } diff --git a/spine-cocos2dx/spine-cocos2dx/src/spine/SkeletonRendererCocos2dX.cpp b/spine-cocos2dx/spine-cocos2dx/src/spine/SkeletonRendererCocos2dX.cpp index f2c64b650..305dbc2eb 100644 --- a/spine-cocos2dx/spine-cocos2dx/src/spine/SkeletonRendererCocos2dX.cpp +++ b/spine-cocos2dx/spine-cocos2dx/src/spine/SkeletonRendererCocos2dX.cpp @@ -52,13 +52,13 @@ namespace spine { // C Variable length array #ifdef _MSC_VER // VLA not supported, use _malloca -#define VLA(type, arr, count) \ - type *arr = static_cast(_malloca(sizeof(type) * count)) -#define VLA_FREE(arr) \ - do { _freea(arr); } while (false) +#define VLA(type, arr, count) type *arr = static_cast(_malloca(sizeof(type) * count)) +#define VLA_FREE(arr) \ + do { \ + _freea(arr); \ + } while (false) #else -#define VLA(type, arr, count) \ - type arr[count] +#define VLA(type, arr, count) type arr[count] #define VLA_FREE(arr) #endif @@ -80,7 +80,8 @@ namespace spine { return node; } - SkeletonRendererCocos2dX *SkeletonRendererCocos2dX::createWithFile(const std::string &skeletonDataFile, const std::string &atlasFile, float scale) { + SkeletonRendererCocos2dX *SkeletonRendererCocos2dX::createWithFile(const std::string &skeletonDataFile, const std::string &atlasFile, + float scale) { SkeletonRendererCocos2dX *node = new SkeletonRendererCocos2dX(skeletonDataFile, atlasFile, scale); node->autorelease(); return node; @@ -115,26 +116,31 @@ namespace spine { } SkeletonRendererCocos2dX::SkeletonRendererCocos2dX() - : _atlas(nullptr), _attachmentLoader(nullptr), _timeScale(1), _debugSlots(false), _debugBones(false), _debugMeshes(false), _debugBoundingRect(false), _startSlotIndex(0), _endSlotIndex(std::numeric_limits::max()) { + : _atlas(nullptr), _attachmentLoader(nullptr), _timeScale(1), _debugSlots(false), _debugBones(false), _debugMeshes(false), + _debugBoundingRect(false), _startSlotIndex(0), _endSlotIndex(std::numeric_limits::max()) { } SkeletonRendererCocos2dX::SkeletonRendererCocos2dX(Skeleton *skeleton, bool ownsSkeleton, bool ownsSkeletonData, bool ownsAtlas) - : _atlas(nullptr), _attachmentLoader(nullptr), _timeScale(1), _debugSlots(false), _debugBones(false), _debugMeshes(false), _debugBoundingRect(false), _startSlotIndex(0), _endSlotIndex(std::numeric_limits::max()) { + : _atlas(nullptr), _attachmentLoader(nullptr), _timeScale(1), _debugSlots(false), _debugBones(false), _debugMeshes(false), + _debugBoundingRect(false), _startSlotIndex(0), _endSlotIndex(std::numeric_limits::max()) { initWithSkeleton(skeleton, ownsSkeleton, ownsSkeletonData, ownsAtlas); } SkeletonRendererCocos2dX::SkeletonRendererCocos2dX(SkeletonData *skeletonData, bool ownsSkeletonData) - : _atlas(nullptr), _attachmentLoader(nullptr), _timeScale(1), _debugSlots(false), _debugBones(false), _debugMeshes(false), _debugBoundingRect(false), _startSlotIndex(0), _endSlotIndex(std::numeric_limits::max()) { + : _atlas(nullptr), _attachmentLoader(nullptr), _timeScale(1), _debugSlots(false), _debugBones(false), _debugMeshes(false), + _debugBoundingRect(false), _startSlotIndex(0), _endSlotIndex(std::numeric_limits::max()) { initWithData(skeletonData, ownsSkeletonData); } SkeletonRendererCocos2dX::SkeletonRendererCocos2dX(const std::string &skeletonDataFile, Atlas *atlas, float scale) - : _atlas(nullptr), _attachmentLoader(nullptr), _timeScale(1), _debugSlots(false), _debugBones(false), _debugMeshes(false), _debugBoundingRect(false), _startSlotIndex(0), _endSlotIndex(std::numeric_limits::max()) { + : _atlas(nullptr), _attachmentLoader(nullptr), _timeScale(1), _debugSlots(false), _debugBones(false), _debugMeshes(false), + _debugBoundingRect(false), _startSlotIndex(0), _endSlotIndex(std::numeric_limits::max()) { initWithJsonFile(skeletonDataFile, atlas, scale); } SkeletonRendererCocos2dX::SkeletonRendererCocos2dX(const std::string &skeletonDataFile, const std::string &atlasFile, float scale) - : _atlas(nullptr), _attachmentLoader(nullptr), _timeScale(1), _debugSlots(false), _debugBones(false), _debugMeshes(false), _debugBoundingRect(false), _startSlotIndex(0), _endSlotIndex(std::numeric_limits::max()) { + : _atlas(nullptr), _attachmentLoader(nullptr), _timeScale(1), _debugSlots(false), _debugBones(false), _debugMeshes(false), + _debugBoundingRect(false), _startSlotIndex(0), _endSlotIndex(std::numeric_limits::max()) { initWithJsonFile(skeletonDataFile, atlasFile, scale); } @@ -269,7 +275,7 @@ namespace spine { Color darkColor; const float darkPremultipliedAlpha = _premultipliedAlpha ? 1.f : 0; TwoColorTrianglesCommand *lastTwoColorTrianglesCommand = nullptr; - for (int i = 0, n = (int)_skeleton->getSlots().size(); i < n; ++i) { + for (int i = 0, n = (int) _skeleton->getSlots().size(); i < n; ++i) { Slot *slot = _skeleton->getDrawOrder()[i]; if (nothingToDraw(*slot, _startSlotIndex, _endSlotIndex)) { @@ -279,12 +285,12 @@ namespace spine { cocos2d::TrianglesCommand::Triangles triangles; TwoColorTriangles trianglesTwoColor; - static unsigned short quadIndices[6] = {0, 1, 2, 2, 3, 0}; - Texture2D *texture = nullptr; + static unsigned short quadIndices[6] = {0, 1, 2, 2, 3, 0}; + Texture2D *texture = nullptr; if (slot->getAttachment()->getRTTI().isExactly(RegionAttachment::rtti)) { RegionAttachment *attachment = static_cast(slot->getAttachment()); - texture = (Texture2D*)((AtlasRegion*)attachment->getRegion())->page->texture; + texture = (Texture2D *) ((AtlasRegion *) attachment->getRegion())->page->texture; float *dstTriangleVertices = nullptr; int dstStride = 0;// in floats @@ -294,11 +300,11 @@ namespace spine { triangles.verts = batch->allocateVertices(4); triangles.vertCount = 4; assert(triangles.vertCount == 4); - for (int v = 0, i = 0; v < triangles.vertCount; v++, i += 2) { - auto &texCoords = triangles.verts[v].texCoords; - texCoords.u = attachment->getUVs()[i]; - texCoords.v = attachment->getUVs()[i + 1]; - } + for (int v = 0, i = 0; v < triangles.vertCount; v++, i += 2) { + auto &texCoords = triangles.verts[v].texCoords; + texCoords.u = attachment->getUVs()[i]; + texCoords.v = attachment->getUVs()[i + 1]; + } dstStride = sizeof(V3F_C4B_T2F) / sizeof(float); dstTriangleVertices = reinterpret_cast(triangles.verts); } else { @@ -307,11 +313,11 @@ namespace spine { trianglesTwoColor.verts = twoColorBatch->allocateVertices(4); trianglesTwoColor.vertCount = 4; assert(trianglesTwoColor.vertCount == 4); - for (int v = 0, i = 0; v < trianglesTwoColor.vertCount; v++, i += 2) { - auto &texCoords = trianglesTwoColor.verts[v].texCoords; - texCoords.u = attachment->getUVs()[i]; - texCoords.v = attachment->getUVs()[i + 1]; - } + for (int v = 0, i = 0; v < trianglesTwoColor.vertCount; v++, i += 2) { + auto &texCoords = trianglesTwoColor.verts[v].texCoords; + texCoords.u = attachment->getUVs()[i]; + texCoords.v = attachment->getUVs()[i + 1]; + } dstTriangleVertices = reinterpret_cast(trianglesTwoColor.verts); dstStride = sizeof(V3F_C4B_C4B_T2F) / sizeof(float); } @@ -322,34 +328,34 @@ namespace spine { color = attachment->getColor(); } else if (slot->getAttachment()->getRTTI().isExactly(MeshAttachment::rtti)) { MeshAttachment *attachment = (MeshAttachment *) slot->getAttachment(); - texture = (Texture2D*)((AtlasRegion*)attachment->getRegion())->page->texture; + texture = (Texture2D *) ((AtlasRegion *) attachment->getRegion())->page->texture; float *dstTriangleVertices = nullptr; int dstStride = 0;// in floats int dstVertexCount = 0; if (hasSingleTint) { triangles.indices = attachment->getTriangles().buffer(); - triangles.indexCount = (unsigned short)attachment->getTriangles().size(); - triangles.verts = batch->allocateVertices((int)attachment->getWorldVerticesLength() / 2); - triangles.vertCount = (int)attachment->getWorldVerticesLength() / 2; - for (int v = 0, i = 0; v < triangles.vertCount; v++, i += 2) { - auto &texCoords = triangles.verts[v].texCoords; - texCoords.u = attachment->getUVs()[i]; - texCoords.v = attachment->getUVs()[i + 1]; - } + triangles.indexCount = (unsigned short) attachment->getTriangles().size(); + triangles.verts = batch->allocateVertices((int) attachment->getWorldVerticesLength() / 2); + triangles.vertCount = (int) attachment->getWorldVerticesLength() / 2; + for (int v = 0, i = 0; v < triangles.vertCount; v++, i += 2) { + auto &texCoords = triangles.verts[v].texCoords; + texCoords.u = attachment->getUVs()[i]; + texCoords.v = attachment->getUVs()[i + 1]; + } dstTriangleVertices = (float *) triangles.verts; dstStride = sizeof(V3F_C4B_T2F) / sizeof(float); dstVertexCount = triangles.vertCount; } else { trianglesTwoColor.indices = attachment->getTriangles().buffer(); - trianglesTwoColor.indexCount = (unsigned short)attachment->getTriangles().size(); - trianglesTwoColor.verts = twoColorBatch->allocateVertices((int)attachment->getWorldVerticesLength() / 2); - trianglesTwoColor.vertCount = (int)attachment->getWorldVerticesLength() / 2; - for (int v = 0, i = 0; v < trianglesTwoColor.vertCount; v++, i += 2) { - auto &texCoords = trianglesTwoColor.verts[v].texCoords; - texCoords.u = attachment->getUVs()[i]; - texCoords.v = attachment->getUVs()[i + 1]; - } + trianglesTwoColor.indexCount = (unsigned short) attachment->getTriangles().size(); + trianglesTwoColor.verts = twoColorBatch->allocateVertices((int) attachment->getWorldVerticesLength() / 2); + trianglesTwoColor.vertCount = (int) attachment->getWorldVerticesLength() / 2; + for (int v = 0, i = 0; v < trianglesTwoColor.vertCount; v++, i += 2) { + auto &texCoords = trianglesTwoColor.verts[v].texCoords; + texCoords.u = attachment->getUVs()[i]; + texCoords.v = attachment->getUVs()[i + 1]; + } dstTriangleVertices = (float *) trianglesTwoColor.verts; dstStride = sizeof(V3F_C4B_C4B_T2F) / sizeof(float); dstVertexCount = trianglesTwoColor.vertCount; @@ -400,7 +406,8 @@ namespace spine { if (hasSingleTint) { if (_clipper->isClipping()) { - _clipper->clipTriangles((float *) &triangles.verts[0].vertices, triangles.indices, triangles.indexCount, (float *) &triangles.verts[0].texCoords, sizeof(cocos2d::V3F_C4B_T2F) / 4); + _clipper->clipTriangles((float *) &triangles.verts[0].vertices, triangles.indices, triangles.indexCount, + (float *) &triangles.verts[0].texCoords, sizeof(cocos2d::V3F_C4B_T2F) / 4); batch->deallocateVertices(triangles.vertCount); if (_clipper->getClippedTriangles().size() == 0) { @@ -408,45 +415,51 @@ namespace spine { continue; } - triangles.vertCount = (int)_clipper->getClippedVertices().size() / 2; + triangles.vertCount = (int) _clipper->getClippedVertices().size() / 2; triangles.verts = batch->allocateVertices(triangles.vertCount); - triangles.indexCount = (int)_clipper->getClippedTriangles().size(); + triangles.indexCount = (int) _clipper->getClippedTriangles().size(); triangles.indices = batch->allocateIndices(triangles.indexCount); - memcpy(triangles.indices, _clipper->getClippedTriangles().buffer(), sizeof(unsigned short) * _clipper->getClippedTriangles().size()); + memcpy(triangles.indices, _clipper->getClippedTriangles().buffer(), + sizeof(unsigned short) * _clipper->getClippedTriangles().size()); #if COCOS2D_VERSION < 0x00040000 - cocos2d::TrianglesCommand *batchedTriangles = batch->addCommand(renderer, _globalZOrder, texture, _glProgramState, blendFunc, triangles, transform, transformFlags); + cocos2d::TrianglesCommand *batchedTriangles = batch->addCommand(renderer, _globalZOrder, texture, _glProgramState, blendFunc, + triangles, transform, transformFlags); #else - cocos2d::TrianglesCommand *batchedTriangles = batch->addCommand(renderer, _globalZOrder, texture, _programState, blendFunc, triangles, transform, transformFlags); + cocos2d::TrianglesCommand *batchedTriangles = batch->addCommand(renderer, _globalZOrder, texture, _programState, blendFunc, + triangles, transform, transformFlags); #endif const float *verts = _clipper->getClippedVertices().buffer(); const float *uvs = _clipper->getClippedUVs().buffer(); - V3F_C4B_T2F *vertex = batchedTriangles->getTriangles().verts; - for (int v = 0, vn = batchedTriangles->getTriangles().vertCount, vv = 0; v < vn; ++v, vv += 2, ++vertex) { - vertex->vertices.x = verts[vv]; - vertex->vertices.y = verts[vv + 1]; - vertex->texCoords.u = uvs[vv]; - vertex->texCoords.v = uvs[vv + 1]; - vertex->colors = color4B; - } + V3F_C4B_T2F *vertex = batchedTriangles->getTriangles().verts; + for (int v = 0, vn = batchedTriangles->getTriangles().vertCount, vv = 0; v < vn; ++v, vv += 2, ++vertex) { + vertex->vertices.x = verts[vv]; + vertex->vertices.y = verts[vv + 1]; + vertex->texCoords.u = uvs[vv]; + vertex->texCoords.v = uvs[vv + 1]; + vertex->colors = color4B; + } } else { // Not clipping. #if COCOS2D_VERSION < 0x00040000 - cocos2d::TrianglesCommand *batchedTriangles = batch->addCommand(renderer, _globalZOrder, texture, _glProgramState, blendFunc, triangles, transform, transformFlags); + cocos2d::TrianglesCommand *batchedTriangles = batch->addCommand(renderer, _globalZOrder, texture, _glProgramState, blendFunc, + triangles, transform, transformFlags); #else - cocos2d::TrianglesCommand *batchedTriangles = batch->addCommand(renderer, _globalZOrder, texture, _programState, blendFunc, triangles, transform, transformFlags); + cocos2d::TrianglesCommand *batchedTriangles = batch->addCommand(renderer, _globalZOrder, texture, _programState, blendFunc, + triangles, transform, transformFlags); #endif - V3F_C4B_T2F *vertex = batchedTriangles->getTriangles().verts; - for (int v = 0, vn = batchedTriangles->getTriangles().vertCount; v < vn; ++v, ++vertex) { - vertex->colors = color4B; - } + V3F_C4B_T2F *vertex = batchedTriangles->getTriangles().verts; + for (int v = 0, vn = batchedTriangles->getTriangles().vertCount; v < vn; ++v, ++vertex) { + vertex->colors = color4B; + } } } else { // Two color tinting. if (_clipper->isClipping()) { - _clipper->clipTriangles((float *) &trianglesTwoColor.verts[0].position, trianglesTwoColor.indices, trianglesTwoColor.indexCount, (float *) &trianglesTwoColor.verts[0].texCoords, sizeof(V3F_C4B_C4B_T2F) / 4); + _clipper->clipTriangles((float *) &trianglesTwoColor.verts[0].position, trianglesTwoColor.indices, trianglesTwoColor.indexCount, + (float *) &trianglesTwoColor.verts[0].texCoords, sizeof(V3F_C4B_C4B_T2F) / 4); twoColorBatch->deallocateVertices(trianglesTwoColor.vertCount); if (_clipper->getClippedTriangles().size() == 0) { @@ -454,41 +467,48 @@ namespace spine { continue; } - trianglesTwoColor.vertCount = (int)_clipper->getClippedVertices().size() / 2; + trianglesTwoColor.vertCount = (int) _clipper->getClippedVertices().size() / 2; trianglesTwoColor.verts = twoColorBatch->allocateVertices(trianglesTwoColor.vertCount); - trianglesTwoColor.indexCount = (int)_clipper->getClippedTriangles().size(); + trianglesTwoColor.indexCount = (int) _clipper->getClippedTriangles().size(); trianglesTwoColor.indices = twoColorBatch->allocateIndices(trianglesTwoColor.indexCount); - memcpy(trianglesTwoColor.indices, _clipper->getClippedTriangles().buffer(), sizeof(unsigned short) * _clipper->getClippedTriangles().size()); + memcpy(trianglesTwoColor.indices, _clipper->getClippedTriangles().buffer(), + sizeof(unsigned short) * _clipper->getClippedTriangles().size()); const float *verts = _clipper->getClippedVertices().buffer(); const float *uvs = _clipper->getClippedUVs().buffer(); - V3F_C4B_C4B_T2F *vertex = trianglesTwoColor.verts; - for (int v = 0, vn = trianglesTwoColor.vertCount, vv = 0; v < vn; ++v, vv += 2, ++vertex) { - vertex->position.x = verts[vv]; - vertex->position.y = verts[vv + 1]; - vertex->texCoords.u = uvs[vv]; - vertex->texCoords.v = uvs[vv + 1]; - vertex->color = color4B; - vertex->color2 = darkColor4B; - } + V3F_C4B_C4B_T2F *vertex = trianglesTwoColor.verts; + for (int v = 0, vn = trianglesTwoColor.vertCount, vv = 0; v < vn; ++v, vv += 2, ++vertex) { + vertex->position.x = verts[vv]; + vertex->position.y = verts[vv + 1]; + vertex->texCoords.u = uvs[vv]; + vertex->texCoords.v = uvs[vv + 1]; + vertex->color = color4B; + vertex->color2 = darkColor4B; + } #if COCOS2D_VERSION < 0x00040000 - TwoColorTrianglesCommand *batchedTriangles = lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, texture->getName(), _glProgramState, blendFunc, trianglesTwoColor, transform, transformFlags); + TwoColorTrianglesCommand *batchedTriangles = lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, + texture->getName(), + _glProgramState, blendFunc, + trianglesTwoColor, + transform, transformFlags); #else - lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, texture, _programState, blendFunc, trianglesTwoColor, transform, transformFlags); + lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, texture, _programState, blendFunc, + trianglesTwoColor, transform, transformFlags); #endif } else { - V3F_C4B_C4B_T2F* vertex = trianglesTwoColor.verts; - for (int v = 0, vn = trianglesTwoColor.vertCount; v < vn; ++v, ++vertex) - { - vertex->color = color4B; - vertex->color2 = darkColor4B; - } + V3F_C4B_C4B_T2F *vertex = trianglesTwoColor.verts; + for (int v = 0, vn = trianglesTwoColor.vertCount; v < vn; ++v, ++vertex) { + vertex->color = color4B; + vertex->color2 = darkColor4B; + } #if COCOS2D_VERSION < 0x00040000 - lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, texture->getName(), _glProgramState, blendFunc, trianglesTwoColor, transform, transformFlags); + lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, texture->getName(), _glProgramState, blendFunc, + trianglesTwoColor, transform, transformFlags); #else - lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, texture, _programState, blendFunc, trianglesTwoColor, transform, transformFlags); + lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, texture, _programState, blendFunc, + trianglesTwoColor, transform, transformFlags); #endif } } @@ -520,10 +540,11 @@ namespace spine { lastTwoColorTrianglesCommand->setForceFlush(true); } else { SkeletonRendererCocos2dX *siblingSkeleton = dynamic_cast(sibling); - if (!siblingSkeleton || // flush is next sibling isn't a SkeletonRenderer - !siblingSkeleton->isTwoColorTint() || // flush if next sibling isn't two color tinted - !siblingSkeleton->isVisible() || // flush if next sibling is two color tinted but not visible - (siblingSkeleton->getGlobalZOrder() != this->getGlobalZOrder())) {// flush if next sibling is two color tinted but z-order differs + if (!siblingSkeleton || // flush is next sibling isn't a SkeletonRenderer + !siblingSkeleton->isTwoColorTint() ||// flush if next sibling isn't two color tinted + !siblingSkeleton->isVisible() || // flush if next sibling is two color tinted but not visible + (siblingSkeleton->getGlobalZOrder() != + this->getGlobalZOrder())) {// flush if next sibling is two color tinted but z-order differs lastTwoColorTrianglesCommand->setForceFlush(true); } } @@ -557,12 +578,10 @@ namespace spine { drawNode->setLineWidth(2.0f); #endif const cocos2d::Rect brect = getBoundingBox(); - const Vec2 points[4] = - { - brect.origin, - {brect.origin.x + brect.size.width, brect.origin.y}, - {brect.origin.x + brect.size.width, brect.origin.y + brect.size.height}, - {brect.origin.x, brect.origin.y + brect.size.height}}; + const Vec2 points[4] = {brect.origin, + {brect.origin.x + brect.size.width, brect.origin.y}, + {brect.origin.x + brect.size.width, brect.origin.y + brect.size.height}, + {brect.origin.x, brect.origin.y + brect.size.height}}; drawNode->drawPoly(points, 4, true, Color4F::GREEN); } @@ -575,7 +594,7 @@ namespace spine { drawNode->setLineWidth(2.0f); #endif V3F_C4B_T2F_Quad quad; - for (int i = 0, n = (int)_skeleton->getSlots().size(); i < n; i++) { + for (int i = 0, n = (int) _skeleton->getSlots().size(); i < n; i++) { Slot *slot = _skeleton->getDrawOrder()[i]; if (!slot->getBone().isActive()) continue; @@ -588,12 +607,10 @@ namespace spine { RegionAttachment *attachment = (RegionAttachment *) slot->getAttachment(); float worldVertices[8]; attachment->computeWorldVertices(*slot, worldVertices, 0, 2); - const Vec2 points[4] = - { - {worldVertices[0], worldVertices[1]}, - {worldVertices[2], worldVertices[3]}, - {worldVertices[4], worldVertices[5]}, - {worldVertices[6], worldVertices[7]}}; + const Vec2 points[4] = {{worldVertices[0], worldVertices[1]}, + {worldVertices[2], worldVertices[3]}, + {worldVertices[4], worldVertices[5]}, + {worldVertices[6], worldVertices[7]}}; drawNode->drawPoly(points, 4, true, Color4F::BLUE); } } @@ -605,7 +622,7 @@ namespace spine { #else drawNode->setLineWidth(2.0f); #endif - for (int i = 0, n = (int)_skeleton->getBones().size(); i < n; i++) { + for (int i = 0, n = (int) _skeleton->getBones().size(); i < n; i++) { Bone *bone = _skeleton->getBones()[i]; if (!bone->isActive()) continue; float x = bone->getData().getLength() * bone->getA() + bone->getWorldX(); @@ -614,7 +631,7 @@ namespace spine { } // Bone origins. auto color = Color4F::BLUE;// Root bone is blue. - for (int i = 0, n = (int)_skeleton->getBones().size(); i < n; i++) { + for (int i = 0, n = (int) _skeleton->getBones().size(); i < n; i++) { Bone *bone = _skeleton->getBones()[i]; if (!bone->isActive()) continue; drawNode->drawPoint(Vec2(bone->getWorldX(), bone->getWorldY()), 4, color); @@ -629,7 +646,7 @@ namespace spine { #else drawNode->setLineWidth(2.0f); #endif - for (int i = 0, n = (int)_skeleton->getSlots().size(); i < n; ++i) { + for (int i = 0, n = (int) _skeleton->getSlots().size(); i < n; ++i) { Slot *slot = _skeleton->getDrawOrder()[i]; if (!slot->getBone().isActive()) continue; if (!slot->getAttachment() || !slot->getAttachment()->getRTTI().isExactly(MeshAttachment::rtti)) continue; @@ -641,11 +658,7 @@ namespace spine { const int idx0 = mesh->getTriangles()[t + 0]; const int idx1 = mesh->getTriangles()[t + 1]; const int idx2 = mesh->getTriangles()[t + 2]; - const Vec2 v[3] = - { - worldCoord + (idx0 * 2), - worldCoord + (idx1 * 2), - worldCoord + (idx2 * 2)}; + const Vec2 v[3] = {worldCoord + (idx0 * 2), worldCoord + (idx1 * 2), worldCoord + (idx2 * 2)}; drawNode->drawPoly(v, 3, true, Color4F::YELLOW); } VLA_FREE(worldCoord); @@ -836,21 +849,14 @@ namespace spine { bool nothingToDraw(Slot &slot, int startSlotIndex, int endSlotIndex) { Attachment *attachment = slot.getAttachment(); - if (!attachment || - slotIsOutRange(slot, startSlotIndex, endSlotIndex) || - !slot.getBone().isActive()) - return true; + if (!attachment || slotIsOutRange(slot, startSlotIndex, endSlotIndex) || !slot.getBone().isActive()) return true; const auto &attachmentRTTI = attachment->getRTTI(); - if (attachmentRTTI.isExactly(ClippingAttachment::rtti)) - return false; - if (slot.getColor().a == 0) - return true; + if (attachmentRTTI.isExactly(ClippingAttachment::rtti)) return false; + if (slot.getColor().a == 0) return true; if (attachmentRTTI.isExactly(RegionAttachment::rtti)) { - if (static_cast(attachment)->getColor().a == 0) - return true; + if (static_cast(attachment)->getColor().a == 0) return true; } else if (attachmentRTTI.isExactly(MeshAttachment::rtti)) { - if (static_cast(attachment)->getColor().a == 0) - return true; + if (static_cast(attachment)->getColor().a == 0) return true; } return false; } @@ -959,14 +965,12 @@ namespace spine { bool cullRectangle(Renderer *renderer, const Mat4 &transform, const cocos2d::Rect &rect) { - if (Camera::getVisitingCamera() == nullptr) - return false; + if (Camera::getVisitingCamera() == nullptr) return false; auto director = Director::getInstance(); auto scene = director->getRunningScene(); - if (!scene || (scene && Camera::getDefaultCamera() != Camera::getVisitingCamera())) - return false; + if (!scene || (scene && Camera::getDefaultCamera() != Camera::getVisitingCamera())) return false; Rect visibleRect(director->getVisibleOrigin(), director->getVisibleSize()); diff --git a/spine-cocos2dx/spine-cocos2dx/src/spine/SkeletonRendererCocos2dX.h b/spine-cocos2dx/spine-cocos2dx/src/spine/SkeletonRendererCocos2dX.h index 7c4c33e67..7cf82c312 100644 --- a/spine-cocos2dx/spine-cocos2dx/src/spine/SkeletonRendererCocos2dX.h +++ b/spine-cocos2dx/spine-cocos2dx/src/spine/SkeletonRendererCocos2dX.h @@ -154,7 +154,7 @@ namespace spine { int _endSlotIndex; bool _twoColorTint; - Pool _verticesPool; + Pool _verticesPool; }; }// namespace spine diff --git a/spine-cocos2dx/spine-cocos2dx/src/spine/spine-cocos2dx.cpp b/spine-cocos2dx/spine-cocos2dx/src/spine/spine-cocos2dx.cpp index ef9b0cbde..d8badf1fa 100644 --- a/spine-cocos2dx/spine-cocos2dx/src/spine/spine-cocos2dx.cpp +++ b/spine-cocos2dx/spine-cocos2dx/src/spine/spine-cocos2dx.cpp @@ -36,7 +36,8 @@ using namespace spine; Cocos2dAtlasAttachmentLoader::Cocos2dAtlasAttachmentLoader(Atlas *atlas) : AtlasAttachmentLoader(atlas) { } -Cocos2dAtlasAttachmentLoader::~Cocos2dAtlasAttachmentLoader() {} +Cocos2dAtlasAttachmentLoader::~Cocos2dAtlasAttachmentLoader() { +} #if COCOS2D_VERSION >= 0x0040000 @@ -96,8 +97,10 @@ GLuint filter(TextureFilter filter) { #endif -Cocos2dTextureLoader::Cocos2dTextureLoader() : TextureLoader() {} -Cocos2dTextureLoader::~Cocos2dTextureLoader() {} +Cocos2dTextureLoader::Cocos2dTextureLoader() : TextureLoader() { +} +Cocos2dTextureLoader::~Cocos2dTextureLoader() { +} void Cocos2dTextureLoader::load(AtlasPage &page, const spine::String &path) { Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(path.buffer()); @@ -124,9 +127,11 @@ void Cocos2dTextureLoader::unload(void *texture) { } -Cocos2dExtension::Cocos2dExtension() : DefaultSpineExtension() {} +Cocos2dExtension::Cocos2dExtension() : DefaultSpineExtension() { +} -Cocos2dExtension::~Cocos2dExtension() {} +Cocos2dExtension::~Cocos2dExtension() { +} char *Cocos2dExtension::_readFile(const spine::String &path, int *length) { Data data = FileUtils::getInstance()->getDataFromFile(path.buffer()); diff --git a/spine-cocos2dx/spine-cocos2dx/src/spine/v3/SkeletonBatch.cpp b/spine-cocos2dx/spine-cocos2dx/src/spine/v3/SkeletonBatch.cpp index 88372b8f6..73a563386 100644 --- a/spine-cocos2dx/spine-cocos2dx/src/spine/v3/SkeletonBatch.cpp +++ b/spine-cocos2dx/spine-cocos2dx/src/spine/v3/SkeletonBatch.cpp @@ -63,9 +63,8 @@ namespace spine { // callback after drawing is finished so we can clear out the batch state // for the next frame - Director::getInstance()->getEventDispatcher()->addCustomEventListener(EVENT_AFTER_DRAW_RESET_POSITION, [this](EventCustom *eventCustom) { - this->update(0); - }); + Director::getInstance()->getEventDispatcher()->addCustomEventListener(EVENT_AFTER_DRAW_RESET_POSITION, + [this](EventCustom *eventCustom) { this->update(0); }); ; } @@ -129,7 +128,10 @@ namespace spine { } - cocos2d::TrianglesCommand *SkeletonBatch::addCommand(cocos2d::Renderer *renderer, float globalOrder, cocos2d::Texture2D *texture, cocos2d::GLProgramState *glProgramState, cocos2d::BlendFunc blendType, const cocos2d::TrianglesCommand::Triangles &triangles, const cocos2d::Mat4 &mv, uint32_t flags) { + cocos2d::TrianglesCommand *SkeletonBatch::addCommand(cocos2d::Renderer *renderer, float globalOrder, cocos2d::Texture2D *texture, + cocos2d::GLProgramState *glProgramState, cocos2d::BlendFunc blendType, + const cocos2d::TrianglesCommand::Triangles &triangles, const cocos2d::Mat4 &mv, + uint32_t flags) { TrianglesCommand *command = nextFreeCommand(); command->init(globalOrder, texture, glProgramState, blendType, triangles, mv, flags); renderer->addCommand(command); diff --git a/spine-cocos2dx/spine-cocos2dx/src/spine/v3/SkeletonBatch.h b/spine-cocos2dx/spine-cocos2dx/src/spine/v3/SkeletonBatch.h index a77c005a2..c0e3e3b9b 100644 --- a/spine-cocos2dx/spine-cocos2dx/src/spine/v3/SkeletonBatch.h +++ b/spine-cocos2dx/spine-cocos2dx/src/spine/v3/SkeletonBatch.h @@ -50,7 +50,9 @@ namespace spine { void deallocateVertices(uint32_t numVertices); unsigned short *allocateIndices(uint32_t numIndices); void deallocateIndices(uint32_t numVertices); - cocos2d::TrianglesCommand *addCommand(cocos2d::Renderer *renderer, float globalOrder, cocos2d::Texture2D *texture, cocos2d::GLProgramState *glProgramState, cocos2d::BlendFunc blendType, const cocos2d::TrianglesCommand::Triangles &triangles, const cocos2d::Mat4 &mv, uint32_t flags); + cocos2d::TrianglesCommand *addCommand(cocos2d::Renderer *renderer, float globalOrder, cocos2d::Texture2D *texture, + cocos2d::GLProgramState *glProgramState, cocos2d::BlendFunc blendType, + const cocos2d::TrianglesCommand::Triangles &triangles, const cocos2d::Mat4 &mv, uint32_t flags); protected: SkeletonBatch(); diff --git a/spine-cocos2dx/spine-cocos2dx/src/spine/v3/SkeletonTwoColorBatch.cpp b/spine-cocos2dx/spine-cocos2dx/src/spine/v3/SkeletonTwoColorBatch.cpp index 51c9afe06..4eb4045ef 100644 --- a/spine-cocos2dx/spine-cocos2dx/src/spine/v3/SkeletonTwoColorBatch.cpp +++ b/spine-cocos2dx/spine-cocos2dx/src/spine/v3/SkeletonTwoColorBatch.cpp @@ -44,12 +44,14 @@ using std::max; namespace spine { - TwoColorTrianglesCommand::TwoColorTrianglesCommand() : _materialID(0), _textureID(0), _glProgramState(nullptr), _glProgram(nullptr), _blendType(BlendFunc::DISABLE), _alphaTextureID(0) { + TwoColorTrianglesCommand::TwoColorTrianglesCommand() + : _materialID(0), _textureID(0), _glProgramState(nullptr), _glProgram(nullptr), _blendType(BlendFunc::DISABLE), _alphaTextureID(0) { _type = RenderCommand::Type::CUSTOM_COMMAND; func = [this]() { draw(); }; } - void TwoColorTrianglesCommand::init(float globalOrder, GLuint textureID, GLProgramState *glProgramState, BlendFunc blendType, const TwoColorTriangles &triangles, const Mat4 &mv, uint32_t flags) { + void TwoColorTrianglesCommand::init(float globalOrder, GLuint textureID, GLProgramState *glProgramState, BlendFunc blendType, + const TwoColorTriangles &triangles, const Mat4 &mv, uint32_t flags) { CCASSERT(glProgramState, "Invalid GLProgramState"); CCASSERT(glProgramState->getVertexAttribsFlags() == 0, "No custom attributes are supported in QuadCommand"); @@ -63,8 +65,7 @@ namespace spine { } _mv = mv; - if (_textureID != textureID || _blendType.src != blendType.src || _blendType.dst != blendType.dst || - _glProgramState != glProgramState || + if (_textureID != textureID || _blendType.src != blendType.src || _blendType.dst != blendType.dst || _glProgramState != glProgramState || _glProgram != glProgramState->getGLProgram()) { _textureID = textureID; _blendType = blendType; @@ -107,45 +108,34 @@ namespace spine { SkeletonTwoColorBatch::getInstance()->batch(this); } - const char *TWO_COLOR_TINT_VERTEX_SHADER = STRINGIFY( - attribute vec4 a_position; - attribute vec4 a_color; - attribute vec4 a_color2; - attribute vec2 a_texCoords; + const char *TWO_COLOR_TINT_VERTEX_SHADER = STRINGIFY(attribute vec4 a_position; attribute vec4 a_color; attribute vec4 a_color2; + attribute vec2 a_texCoords; -\n #ifdef GL_ES\n - varying lowp vec4 v_light; - varying lowp vec4 v_dark; - varying mediump vec2 v_texCoord; -\n #else \n - varying vec4 v_light; - varying vec4 v_dark; - varying vec2 v_texCoord; +\n #ifdef GL_ES\n varying lowp vec4 v_light; varying lowp vec4 v_dark; varying mediump vec2 v_texCoord; +\n #else \n varying vec4 v_light; varying vec4 v_dark; varying vec2 v_texCoord; \n #endif \n - void main() { - v_light = a_color; - v_dark = a_color2; - v_texCoord = a_texCoords; - gl_Position = CC_PMatrix * a_position; - }); + void main() { + v_light = a_color; + v_dark = a_color2; + v_texCoord = a_texCoords; + gl_Position = CC_PMatrix * a_position; + }); const char *TWO_COLOR_TINT_FRAGMENT_SHADER = STRINGIFY( -\n #ifdef GL_ES\n - precision lowp float; +\n #ifdef GL_ES\n precision lowp float; \n #endif \n - varying vec4 v_light; - varying vec4 v_dark; - varying vec2 v_texCoord; + varying vec4 v_light; + varying vec4 v_dark; varying vec2 v_texCoord; - void main() { - vec4 texColor = texture2D(CC_Texture0, v_texCoord); - float alpha = texColor.a * v_light.a; - gl_FragColor.a = alpha; - gl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb; - }); + void main() { + vec4 texColor = texture2D(CC_Texture0, v_texCoord); + float alpha = texColor.a * v_light.a; + gl_FragColor.a = alpha; + gl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb; + }); static SkeletonTwoColorBatch *instance = nullptr; @@ -171,9 +161,8 @@ namespace spine { // callback after drawing is finished so we can clear out the batch state // for the next frame - Director::getInstance()->getEventDispatcher()->addCustomEventListener(EVENT_AFTER_DRAW_RESET_POSITION, [this](EventCustom *eventCustom) { - this->update(0); - }); + Director::getInstance()->getEventDispatcher()->addCustomEventListener(EVENT_AFTER_DRAW_RESET_POSITION, + [this](EventCustom *eventCustom) { this->update(0); }); _twoColorTintShader = cocos2d::GLProgram::createWithByteArrays(TWO_COLOR_TINT_VERTEX_SHADER, TWO_COLOR_TINT_FRAGMENT_SHADER); _twoColorTintShaderState = GLProgramState::getOrCreateWithGLProgram(_twoColorTintShader); @@ -252,7 +241,9 @@ namespace spine { _indices.setSize(_indices.size() - numIndices, 0); } - TwoColorTrianglesCommand *SkeletonTwoColorBatch::addCommand(cocos2d::Renderer *renderer, float globalOrder, GLuint textureID, cocos2d::GLProgramState *glProgramState, cocos2d::BlendFunc blendType, const TwoColorTriangles &triangles, const cocos2d::Mat4 &mv, uint32_t flags) { + TwoColorTrianglesCommand *SkeletonTwoColorBatch::addCommand(cocos2d::Renderer *renderer, float globalOrder, GLuint textureID, + cocos2d::GLProgramState *glProgramState, cocos2d::BlendFunc blendType, + const TwoColorTriangles &triangles, const cocos2d::Mat4 &mv, uint32_t flags) { TwoColorTrianglesCommand *command = nextFreeCommand(); command->init(globalOrder, textureID, glProgramState, blendType, triangles, mv, flags); renderer->addCommand(command); @@ -260,7 +251,8 @@ namespace spine { } void SkeletonTwoColorBatch::batch(TwoColorTrianglesCommand *command) { - if (_numVerticesBuffer + command->getTriangles().vertCount >= MAX_VERTICES || _numIndicesBuffer + command->getTriangles().indexCount >= MAX_INDICES) { + if (_numVerticesBuffer + command->getTriangles().vertCount >= MAX_VERTICES || + _numIndicesBuffer + command->getTriangles().indexCount >= MAX_INDICES) { flush(_lastCommand); } @@ -291,8 +283,7 @@ namespace spine { } void SkeletonTwoColorBatch::flush(TwoColorTrianglesCommand *materialCommand) { - if (!materialCommand) - return; + if (!materialCommand) return; materialCommand->useMaterial(); @@ -304,10 +295,14 @@ namespace spine { glEnableVertexAttribArray(_color2AttributeLocation); glEnableVertexAttribArray(_texCoordsAttributeLocation); - glVertexAttribPointer(_positionAttributeLocation, 3, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B_C4B_T2F), (GLvoid *) offsetof(V3F_C4B_C4B_T2F, position)); - glVertexAttribPointer(_colorAttributeLocation, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V3F_C4B_C4B_T2F), (GLvoid *) offsetof(V3F_C4B_C4B_T2F, color)); - glVertexAttribPointer(_color2AttributeLocation, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V3F_C4B_C4B_T2F), (GLvoid *) offsetof(V3F_C4B_C4B_T2F, color2)); - glVertexAttribPointer(_texCoordsAttributeLocation, 2, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B_C4B_T2F), (GLvoid *) offsetof(V3F_C4B_C4B_T2F, texCoords)); + glVertexAttribPointer(_positionAttributeLocation, 3, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B_C4B_T2F), + (GLvoid *) offsetof(V3F_C4B_C4B_T2F, position)); + glVertexAttribPointer(_colorAttributeLocation, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V3F_C4B_C4B_T2F), + (GLvoid *) offsetof(V3F_C4B_C4B_T2F, color)); + glVertexAttribPointer(_color2AttributeLocation, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V3F_C4B_C4B_T2F), + (GLvoid *) offsetof(V3F_C4B_C4B_T2F, color2)); + glVertexAttribPointer(_texCoordsAttributeLocation, 2, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B_C4B_T2F), + (GLvoid *) offsetof(V3F_C4B_C4B_T2F, texCoords)); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indexBufferHandle); glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned short) * _numIndicesBuffer, _indexBuffer, GL_STATIC_DRAW); diff --git a/spine-cocos2dx/spine-cocos2dx/src/spine/v3/SkeletonTwoColorBatch.h b/spine-cocos2dx/spine-cocos2dx/src/spine/v3/SkeletonTwoColorBatch.h index 23c72fdd7..3b2f993e5 100644 --- a/spine-cocos2dx/spine-cocos2dx/src/spine/v3/SkeletonTwoColorBatch.h +++ b/spine-cocos2dx/spine-cocos2dx/src/spine/v3/SkeletonTwoColorBatch.h @@ -57,35 +57,60 @@ namespace spine { ~TwoColorTrianglesCommand(); - void init(float globalOrder, GLuint textureID, cocos2d::GLProgramState *glProgramState, cocos2d::BlendFunc blendType, const TwoColorTriangles &triangles, const cocos2d::Mat4 &mv, uint32_t flags); + void init(float globalOrder, GLuint textureID, cocos2d::GLProgramState *glProgramState, cocos2d::BlendFunc blendType, + const TwoColorTriangles &triangles, const cocos2d::Mat4 &mv, uint32_t flags); void useMaterial() const; - inline uint32_t getMaterialID() const { return _materialID; } + inline uint32_t getMaterialID() const { + return _materialID; + } - inline GLuint getTextureID() const { return _textureID; } + inline GLuint getTextureID() const { + return _textureID; + } - inline const TwoColorTriangles &getTriangles() const { return _triangles; } + inline const TwoColorTriangles &getTriangles() const { + return _triangles; + } - inline ssize_t getVertexCount() const { return _triangles.vertCount; } + inline ssize_t getVertexCount() const { + return _triangles.vertCount; + } - inline ssize_t getIndexCount() const { return _triangles.indexCount; } + inline ssize_t getIndexCount() const { + return _triangles.indexCount; + } - inline const V3F_C4B_C4B_T2F *getVertices() const { return _triangles.verts; } + inline const V3F_C4B_C4B_T2F *getVertices() const { + return _triangles.verts; + } - inline const unsigned short *getIndices() const { return _triangles.indices; } + inline const unsigned short *getIndices() const { + return _triangles.indices; + } - inline cocos2d::GLProgramState *getGLProgramState() const { return _glProgramState; } + inline cocos2d::GLProgramState *getGLProgramState() const { + return _glProgramState; + } - inline cocos2d::BlendFunc getBlendType() const { return _blendType; } + inline cocos2d::BlendFunc getBlendType() const { + return _blendType; + } - inline const cocos2d::Mat4 &getModelView() const { return _mv; } + inline const cocos2d::Mat4 &getModelView() const { + return _mv; + } void draw(); - void setForceFlush(bool forceFlush) { _forceFlush = forceFlush; } + void setForceFlush(bool forceFlush) { + _forceFlush = forceFlush; + } - bool isForceFlush() { return _forceFlush; }; + bool isForceFlush() { + return _forceFlush; + }; protected: void generateMaterialID(); @@ -114,15 +139,21 @@ namespace spine { unsigned short *allocateIndices(uint32_t numIndices); void deallocateIndices(uint32_t numIndices); - TwoColorTrianglesCommand *addCommand(cocos2d::Renderer *renderer, float globalOrder, GLuint textureID, cocos2d::GLProgramState *glProgramState, cocos2d::BlendFunc blendType, const TwoColorTriangles &triangles, const cocos2d::Mat4 &mv, uint32_t flags); + TwoColorTrianglesCommand *addCommand(cocos2d::Renderer *renderer, float globalOrder, GLuint textureID, + cocos2d::GLProgramState *glProgramState, cocos2d::BlendFunc blendType, + const TwoColorTriangles &triangles, const cocos2d::Mat4 &mv, uint32_t flags); - cocos2d::GLProgramState *getTwoColorTintProgramState() { return _twoColorTintShaderState; } + cocos2d::GLProgramState *getTwoColorTintProgramState() { + return _twoColorTintShaderState; + } void batch(TwoColorTrianglesCommand *command); void flush(TwoColorTrianglesCommand *materialCommand); - uint32_t getNumBatches() { return _numBatches; }; + uint32_t getNumBatches() { + return _numBatches; + }; protected: SkeletonTwoColorBatch(); diff --git a/spine-cocos2dx/spine-cocos2dx/src/spine/v4/SkeletonBatch.cpp b/spine-cocos2dx/spine-cocos2dx/src/spine/v4/SkeletonBatch.cpp index 8b63bff63..7a528d534 100644 --- a/spine-cocos2dx/spine-cocos2dx/src/spine/v4/SkeletonBatch.cpp +++ b/spine-cocos2dx/spine-cocos2dx/src/spine/v4/SkeletonBatch.cpp @@ -69,9 +69,8 @@ namespace spine { reset(); // callback after drawing is finished so we can clear out the batch state // for the next frame - Director::getInstance()->getEventDispatcher()->addCustomEventListener(EVENT_AFTER_DRAW_RESET_POSITION, [this](EventCustom *eventCustom) { - this->update(0); - }); + Director::getInstance()->getEventDispatcher()->addCustomEventListener(EVENT_AFTER_DRAW_RESET_POSITION, + [this](EventCustom *eventCustom) { this->update(0); }); ; } @@ -93,9 +92,11 @@ namespace spine { auto locPosition = programState->getAttributeLocation(backend::ATTRIBUTE_NAME_POSITION); auto locTexcoord = programState->getAttributeLocation(backend::ATTRIBUTE_NAME_TEXCOORD); auto locColor = programState->getAttributeLocation(backend::ATTRIBUTE_NAME_COLOR); - vertexLayout->setAttribute(backend::ATTRIBUTE_NAME_POSITION, locPosition, backend::VertexFormat::FLOAT3, offsetof(V3F_C4B_T2F, vertices), false); + vertexLayout->setAttribute(backend::ATTRIBUTE_NAME_POSITION, locPosition, backend::VertexFormat::FLOAT3, offsetof(V3F_C4B_T2F, vertices), + false); vertexLayout->setAttribute(backend::ATTRIBUTE_NAME_COLOR, locColor, backend::VertexFormat::UBYTE4, offsetof(V3F_C4B_T2F, colors), true); - vertexLayout->setAttribute(backend::ATTRIBUTE_NAME_TEXCOORD, locTexcoord, backend::VertexFormat::FLOAT2, offsetof(V3F_C4B_T2F, texCoords), false); + vertexLayout->setAttribute(backend::ATTRIBUTE_NAME_TEXCOORD, locTexcoord, backend::VertexFormat::FLOAT2, offsetof(V3F_C4B_T2F, texCoords), + false); vertexLayout->setLayout(sizeof(_vertices[0])); @@ -132,7 +133,7 @@ namespace spine { unsigned short *SkeletonBatch::allocateIndices(uint32_t numIndices) { if (_indices.getCapacity() - _indices.size() < numIndices) { unsigned short *oldData = _indices.buffer(); - int oldSize = (int)_indices.size(); + int oldSize = (int) _indices.size(); _indices.ensureCapacity(_indices.size() + numIndices); unsigned short *newData = _indices.buffer(); for (uint32_t i = 0; i < this->_nextFreeCommand; i++) { @@ -154,12 +155,14 @@ namespace spine { } - cocos2d::TrianglesCommand *SkeletonBatch::addCommand(cocos2d::Renderer *renderer, float globalOrder, cocos2d::Texture2D *texture, backend::ProgramState *programState, cocos2d::BlendFunc blendType, const cocos2d::TrianglesCommand::Triangles &triangles, const cocos2d::Mat4 &mv, uint32_t flags) { + cocos2d::TrianglesCommand *SkeletonBatch::addCommand(cocos2d::Renderer *renderer, float globalOrder, cocos2d::Texture2D *texture, + backend::ProgramState *programState, cocos2d::BlendFunc blendType, + const cocos2d::TrianglesCommand::Triangles &triangles, const cocos2d::Mat4 &mv, + uint32_t flags) { TrianglesCommand *command = nextFreeCommand(); const cocos2d::Mat4 &projectionMat = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); - if (programState == nullptr) - programState = _programState; + if (programState == nullptr) programState = _programState; CCASSERT(programState, "programState should not be null"); @@ -187,8 +190,8 @@ namespace spine { cocos2d::TrianglesCommand *SkeletonBatch::nextFreeCommand() { if (_commandsPool.size() <= _nextFreeCommand) { - unsigned int newSize = (int)_commandsPool.size() * 2 + 1; - for (int i = (int)_commandsPool.size(); i < newSize; i++) { + unsigned int newSize = (int) _commandsPool.size() * 2 + 1; + for (int i = (int) _commandsPool.size(); i < newSize; i++) { _commandsPool.push_back(createNewTrianglesCommand()); } } diff --git a/spine-cocos2dx/spine-cocos2dx/src/spine/v4/SkeletonBatch.h b/spine-cocos2dx/spine-cocos2dx/src/spine/v4/SkeletonBatch.h index 32d25af3c..692beb45c 100644 --- a/spine-cocos2dx/spine-cocos2dx/src/spine/v4/SkeletonBatch.h +++ b/spine-cocos2dx/spine-cocos2dx/src/spine/v4/SkeletonBatch.h @@ -51,7 +51,9 @@ namespace spine { void deallocateVertices(uint32_t numVertices); unsigned short *allocateIndices(uint32_t numIndices); void deallocateIndices(uint32_t numVertices); - cocos2d::TrianglesCommand *addCommand(cocos2d::Renderer *renderer, float globalOrder, cocos2d::Texture2D *texture, cocos2d::backend::ProgramState *programState, cocos2d::BlendFunc blendType, const cocos2d::TrianglesCommand::Triangles &triangles, const cocos2d::Mat4 &mv, uint32_t flags); + cocos2d::TrianglesCommand *addCommand(cocos2d::Renderer *renderer, float globalOrder, cocos2d::Texture2D *texture, + cocos2d::backend::ProgramState *programState, cocos2d::BlendFunc blendType, + const cocos2d::TrianglesCommand::Triangles &triangles, const cocos2d::Mat4 &mv, uint32_t flags); void updateProgramStateLayout(cocos2d::backend::ProgramState *programState); diff --git a/spine-cocos2dx/spine-cocos2dx/src/spine/v4/SkeletonTwoColorBatch.cpp b/spine-cocos2dx/spine-cocos2dx/src/spine/v4/SkeletonTwoColorBatch.cpp index 882b1dacd..99963f8a1 100644 --- a/spine-cocos2dx/spine-cocos2dx/src/spine/v4/SkeletonTwoColorBatch.cpp +++ b/spine-cocos2dx/spine-cocos2dx/src/spine/v4/SkeletonTwoColorBatch.cpp @@ -51,46 +51,31 @@ using std::max; namespace { - const char *TWO_COLOR_TINT_VERTEX_SHADER = STRINGIFY( - uniform mat4 u_PMatrix; - attribute vec4 a_position; - attribute vec4 a_color; - attribute vec4 a_color2; - attribute vec2 a_texCoords; + const char *TWO_COLOR_TINT_VERTEX_SHADER = STRINGIFY(uniform mat4 u_PMatrix; attribute vec4 a_position; attribute vec4 a_color; + attribute vec4 a_color2; attribute vec2 a_texCoords; - \n #ifdef GL_ES\n - varying lowp vec4 v_light; - varying lowp vec4 v_dark; - varying mediump vec2 v_texCoord; - \n #else \n - varying vec4 v_light; - varying vec4 v_dark; - varying vec2 v_texCoord; + \n #ifdef GL_ES\n varying lowp vec4 v_light; varying lowp vec4 v_dark; varying mediump vec2 v_texCoord; + \n #else \n varying vec4 v_light; varying vec4 v_dark; varying vec2 v_texCoord; \n #endif \n - void main() { - v_light = a_color; - v_dark = a_color2; - v_texCoord = a_texCoords; - gl_Position = u_PMatrix * a_position; - }); + void main() { + v_light = a_color; + v_dark = a_color2; + v_texCoord = a_texCoords; + gl_Position = u_PMatrix * a_position; + }); const char *TWO_COLOR_TINT_FRAGMENT_SHADER = STRINGIFY( - \n #ifdef GL_ES\n - precision lowp float; - \n #endif \n - uniform sampler2D u_texture; - varying vec4 v_light; - varying vec4 v_dark; - varying vec2 v_texCoord; + \n #ifdef GL_ES\n precision lowp float; + \n #endif \n uniform sampler2D u_texture; varying vec4 v_light; varying vec4 v_dark; varying vec2 v_texCoord; - void main() { - vec4 texColor = texture2D(u_texture, v_texCoord); - float alpha = texColor.a * v_light.a; - gl_FragColor.a = alpha; - gl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb; - }); + void main() { + vec4 texColor = texture2D(u_texture, v_texCoord); + float alpha = texColor.a * v_light.a; + gl_FragColor.a = alpha; + gl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb; + }); std::shared_ptr __twoColorProgramState = nullptr; @@ -136,7 +121,8 @@ namespace spine { _type = RenderCommand::Type::CUSTOM_COMMAND; } - void TwoColorTrianglesCommand::init(float globalOrder, cocos2d::Texture2D *texture, cocos2d::backend::ProgramState *programState, BlendFunc blendType, const TwoColorTriangles &triangles, const Mat4 &mv, uint32_t flags) { + void TwoColorTrianglesCommand::init(float globalOrder, cocos2d::Texture2D *texture, cocos2d::backend::ProgramState *programState, + BlendFunc blendType, const TwoColorTriangles &triangles, const Mat4 &mv, uint32_t flags) { updateCommandPipelineDescriptor(programState); const cocos2d::Mat4 &projectionMat = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); @@ -158,8 +144,8 @@ namespace spine { _mv = mv; - if (_blendType.src != blendType.src || _blendType.dst != blendType.dst || - _texture != texture->getBackendTexture() || _pipelineDescriptor.programState != _programState) { + if (_blendType.src != blendType.src || _blendType.dst != blendType.dst || _texture != texture->getBackendTexture() || + _pipelineDescriptor.programState != _programState) { _texture = texture->getBackendTexture(); _blendType = blendType; @@ -199,8 +185,7 @@ namespace spine { CCASSERT(_programState, "programState should not be null"); pipelinePS = _programState; - if (needsUpdateStateLayout) - updateProgramStateLayout(pipelinePS); + if (needsUpdateStateLayout) updateProgramStateLayout(pipelinePS); _locPMatrix = __locPMatrix; _locTexture = __locTexture; @@ -214,8 +199,7 @@ namespace spine { // do not batch if using custom uniforms (since we cannot batch) it - struct - { + struct { void *texture; void *prog; backend::BlendFactor src; @@ -239,11 +223,10 @@ namespace spine { SkeletonTwoColorBatch::getInstance()->batch(r, this); } - void TwoColorTrianglesCommand::updateVertexAndIndexBuffer(Renderer *r, V3F_C4B_C4B_T2F *vertices, int verticesSize, uint16_t *indices, int indicesSize) { - if (verticesSize != _vertexCapacity) - createVertexBuffer(sizeof(V3F_C4B_C4B_T2F), verticesSize, CustomCommand::BufferUsage::DYNAMIC); - if (indicesSize != _indexCapacity) - createIndexBuffer(CustomCommand::IndexFormat::U_SHORT, indicesSize, CustomCommand::BufferUsage::DYNAMIC); + void TwoColorTrianglesCommand::updateVertexAndIndexBuffer(Renderer *r, V3F_C4B_C4B_T2F *vertices, int verticesSize, uint16_t *indices, + int indicesSize) { + if (verticesSize != _vertexCapacity) createVertexBuffer(sizeof(V3F_C4B_C4B_T2F), verticesSize, CustomCommand::BufferUsage::DYNAMIC); + if (indicesSize != _indexCapacity) createIndexBuffer(CustomCommand::IndexFormat::U_SHORT, indicesSize, CustomCommand::BufferUsage::DYNAMIC); updateVertexBuffer(vertices, sizeof(V3F_C4B_C4B_T2F) * verticesSize); updateIndexBuffer(indices, sizeof(uint16_t) * indicesSize); @@ -274,9 +257,8 @@ namespace spine { // callback after drawing is finished so we can clear out the batch state // for the next frame - Director::getInstance()->getEventDispatcher()->addCustomEventListener(EVENT_AFTER_DRAW_RESET_POSITION, [this](EventCustom *eventCustom) { - this->update(0); - }); + Director::getInstance()->getEventDispatcher()->addCustomEventListener(EVENT_AFTER_DRAW_RESET_POSITION, + [this](EventCustom *eventCustom) { this->update(0); }); } SkeletonTwoColorBatch::~SkeletonTwoColorBatch() { @@ -321,7 +303,7 @@ namespace spine { unsigned short *SkeletonTwoColorBatch::allocateIndices(uint32_t numIndices) { if (_indices.getCapacity() - _indices.size() < numIndices) { unsigned short *oldData = _indices.buffer(); - int oldSize = (int)_indices.size(); + int oldSize = (int) _indices.size(); _indices.ensureCapacity(_indices.size() + numIndices); unsigned short *newData = _indices.buffer(); for (uint32_t i = 0; i < this->_nextFreeCommand; i++) { @@ -342,7 +324,9 @@ namespace spine { _indices.setSize(_indices.size() - numIndices, 0); } - TwoColorTrianglesCommand *SkeletonTwoColorBatch::addCommand(cocos2d::Renderer *renderer, float globalOrder, cocos2d::Texture2D *texture, backend::ProgramState *programState, cocos2d::BlendFunc blendType, const TwoColorTriangles &triangles, const cocos2d::Mat4 &mv, uint32_t flags) { + TwoColorTrianglesCommand *SkeletonTwoColorBatch::addCommand(cocos2d::Renderer *renderer, float globalOrder, cocos2d::Texture2D *texture, + backend::ProgramState *programState, cocos2d::BlendFunc blendType, + const TwoColorTriangles &triangles, const cocos2d::Mat4 &mv, uint32_t flags) { TwoColorTrianglesCommand *command = nextFreeCommand(); command->init(globalOrder, texture, programState, blendType, triangles, mv, flags); command->updateVertexAndIndexBuffer(renderer, triangles.verts, triangles.vertCount, triangles.indices, triangles.indexCount); @@ -351,7 +335,8 @@ namespace spine { } void SkeletonTwoColorBatch::batch(cocos2d::Renderer *renderer, TwoColorTrianglesCommand *command) { - if (_numVerticesBuffer + command->getTriangles().vertCount >= MAX_VERTICES || _numIndicesBuffer + command->getTriangles().indexCount >= MAX_INDICES) { + if (_numVerticesBuffer + command->getTriangles().vertCount >= MAX_VERTICES || + _numIndicesBuffer + command->getTriangles().indexCount >= MAX_INDICES) { flush(renderer, _lastCommand); } @@ -382,8 +367,7 @@ namespace spine { } void SkeletonTwoColorBatch::flush(cocos2d::Renderer *renderer, TwoColorTrianglesCommand *materialCommand) { - if (!materialCommand) - return; + if (!materialCommand) return; materialCommand->updateVertexAndIndexBuffer(renderer, _vertexBuffer, _numVerticesBuffer, _indexBuffer, _numIndicesBuffer); @@ -406,8 +390,8 @@ namespace spine { TwoColorTrianglesCommand *SkeletonTwoColorBatch::nextFreeCommand() { if (_commandsPool.size() <= _nextFreeCommand) { - unsigned int newSize = (int)_commandsPool.size() * 2 + 1; - for (int i = (int)_commandsPool.size(); i < newSize; i++) { + unsigned int newSize = (int) _commandsPool.size() * 2 + 1; + for (int i = (int) _commandsPool.size(); i < newSize; i++) { _commandsPool.push_back(new TwoColorTrianglesCommand()); } } diff --git a/spine-cocos2dx/spine-cocos2dx/src/spine/v4/SkeletonTwoColorBatch.h b/spine-cocos2dx/spine-cocos2dx/src/spine/v4/SkeletonTwoColorBatch.h index ba8179fd3..40b8165d7 100644 --- a/spine-cocos2dx/spine-cocos2dx/src/spine/v4/SkeletonTwoColorBatch.h +++ b/spine-cocos2dx/spine-cocos2dx/src/spine/v4/SkeletonTwoColorBatch.h @@ -58,35 +58,58 @@ namespace spine { ~TwoColorTrianglesCommand(); - void init(float globalOrder, cocos2d::Texture2D *texture, cocos2d::backend::ProgramState *programState, cocos2d::BlendFunc blendType, const TwoColorTriangles &triangles, const cocos2d::Mat4 &mv, uint32_t flags); + void init(float globalOrder, cocos2d::Texture2D *texture, cocos2d::backend::ProgramState *programState, cocos2d::BlendFunc blendType, + const TwoColorTriangles &triangles, const cocos2d::Mat4 &mv, uint32_t flags); void updateCommandPipelineDescriptor(cocos2d::backend::ProgramState *programState); - inline cocos2d::backend::TextureBackend *getTexture() const { return _texture; } + inline cocos2d::backend::TextureBackend *getTexture() const { + return _texture; + } void draw(cocos2d::Renderer *renderer); void updateVertexAndIndexBuffer(cocos2d::Renderer *renderer, V3F_C4B_C4B_T2F *vertices, int verticesSize, uint16_t *indices, int indicesSize); - inline uint32_t getMaterialID() const { return _materialID; } + inline uint32_t getMaterialID() const { + return _materialID; + } - inline const TwoColorTriangles &getTriangles() const { return _triangles; } + inline const TwoColorTriangles &getTriangles() const { + return _triangles; + } - inline ssize_t getVertexCount() const { return _triangles.vertCount; } + inline ssize_t getVertexCount() const { + return _triangles.vertCount; + } - inline ssize_t getIndexCount() const { return _triangles.indexCount; } + inline ssize_t getIndexCount() const { + return _triangles.indexCount; + } - inline const V3F_C4B_C4B_T2F *getVertices() const { return _triangles.verts; } + inline const V3F_C4B_C4B_T2F *getVertices() const { + return _triangles.verts; + } - inline const unsigned short *getIndices() const { return _triangles.indices; } + inline const unsigned short *getIndices() const { + return _triangles.indices; + } - inline cocos2d::BlendFunc getBlendType() const { return _blendType; } + inline cocos2d::BlendFunc getBlendType() const { + return _blendType; + } - inline const cocos2d::Mat4 &getModelView() const { return _mv; } + inline const cocos2d::Mat4 &getModelView() const { + return _mv; + } - void setForceFlush(bool forceFlush) { _forceFlush = forceFlush; } + void setForceFlush(bool forceFlush) { + _forceFlush = forceFlush; + } - bool isForceFlush() { return _forceFlush; }; + bool isForceFlush() { + return _forceFlush; + }; protected: void generateMaterialID(); @@ -119,13 +142,17 @@ namespace spine { unsigned short *allocateIndices(uint32_t numIndices); void deallocateIndices(uint32_t numIndices); - TwoColorTrianglesCommand *addCommand(cocos2d::Renderer *renderer, float globalOrder, cocos2d::Texture2D *texture, cocos2d::backend::ProgramState *programState, cocos2d::BlendFunc blendType, const TwoColorTriangles &triangles, const cocos2d::Mat4 &mv, uint32_t flags); + TwoColorTrianglesCommand *addCommand(cocos2d::Renderer *renderer, float globalOrder, cocos2d::Texture2D *texture, + cocos2d::backend::ProgramState *programState, cocos2d::BlendFunc blendType, + const TwoColorTriangles &triangles, const cocos2d::Mat4 &mv, uint32_t flags); void batch(cocos2d::Renderer *renderer, TwoColorTrianglesCommand *command); void flush(cocos2d::Renderer *renderer, TwoColorTrianglesCommand *materialCommand); - uint32_t getNumBatches() { return _numBatches; }; + uint32_t getNumBatches() { + return _numBatches; + }; protected: SkeletonTwoColorBatch(); diff --git a/spine-cpp/include/spine/Animation.h b/spine-cpp/include/spine/Animation.h index b37ddd7c5..950b07d9f 100644 --- a/spine-cpp/include/spine/Animation.h +++ b/spine-cpp/include/spine/Animation.h @@ -139,8 +139,8 @@ namespace spine { /// @param blend Controls how mixing is applied when alpha < 1. /// @param direction Indicates whether the timelines are mixing in or out. Used by timelines which perform instant transitions, /// such as DrawOrderTimeline or AttachmentTimeline. - void apply(Skeleton &skeleton, float lastTime, float time, bool loop, Array *pEvents, float alpha, - MixBlend blend, MixDirection direction, bool appliedPose); + void apply(Skeleton &skeleton, float lastTime, float time, bool loop, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose); /// The animation's name, which is unique across all animations in the skeleton. const String &getName(); @@ -152,6 +152,7 @@ namespace spine { static int search(Array &values, float target); static int search(Array &values, float target, int step); + protected: Array _timelines; HashMap _timelineIds; diff --git a/spine-cpp/include/spine/AnimationState.h b/spine-cpp/include/spine/AnimationState.h index 2028e5f80..fa398a11a 100644 --- a/spine-cpp/include/spine/AnimationState.h +++ b/spine-cpp/include/spine/AnimationState.h @@ -70,7 +70,7 @@ namespace spine { class AttachmentTimeline; #ifdef SPINE_USE_STD_FUNCTION - typedef std::function AnimationStateListener; + typedef std::function AnimationStateListener; #else typedef void (*AnimationStateListener)(AnimationState *state, EventType type, TrackEntry *entry, Event *event); @@ -83,6 +83,7 @@ namespace spine { AnimationStateListenerObject() {}; virtual ~AnimationStateListenerObject() {}; + public: /// The callback function to be called virtual void callback(AnimationState *state, EventType type, TrackEntry *entry, Event *event) = 0; @@ -106,7 +107,7 @@ namespace spine { Animation *getAnimation(); /// Sets the animation for this track entry. - void setAnimation(Animation* animation); + void setAnimation(Animation *animation); TrackEntry *getPrevious(); @@ -240,11 +241,11 @@ namespace spine { void setMixAttachmentThreshold(float inValue); - /// When getAlpha() is greater than alphaAttachmentThreshold, attachment timelines are applied. - /// Defaults to 0, so attachment timelines are always applied. */ - float getAlphaAttachmentThreshold(); + /// When getAlpha() is greater than alphaAttachmentThreshold, attachment timelines are applied. + /// Defaults to 0, so attachment timelines are always applied. */ + float getAlphaAttachmentThreshold(); - void setAlphaAttachmentThreshold(float inValue); + void setAlphaAttachmentThreshold(float inValue); /// When the mix percentage (mix time / mix duration) is less than the draw order threshold, draw order timelines for the /// animation being mixed out will be applied. Defaults to 0, so draw order timelines are not applied for an animation being @@ -277,12 +278,12 @@ namespace spine { void setMixDuration(float inValue); - /// Sets both getMixDuration() and getDelay(). - /// @param delay If > 0, sets TrackEntry::getDelay(). If <= 0, the delay set is the duration of the previous track - /// entry minus the specified mix duration plus the specified delay (ie the mix ends at - /// (delay = 0) or before (delay < 0) the previous track entry duration). If the previous - /// entry is looping, its next loop completion is used instead of its duration. - void setMixDuration(float mixDuration, float delay); + /// Sets both getMixDuration() and getDelay(). + /// @param delay If > 0, sets TrackEntry::getDelay(). If <= 0, the delay set is the duration of the previous track + /// entry minus the specified mix duration plus the specified delay (ie the mix ends at + /// (delay = 0) or before (delay < 0) the previous track entry duration). If the previous + /// entry is looping, its next loop completion is used instead of its duration. + void setMixDuration(float mixDuration, float delay); MixBlend getMixBlend(); @@ -314,16 +315,16 @@ namespace spine { /// Returns true if this entry is for the empty animation. bool isEmptyAnimation(); - /// Returns true if this track entry has been applied at least once. - /// - /// See AnimationState::apply(Skeleton). - bool wasApplied(); + /// Returns true if this track entry has been applied at least once. + /// + /// See AnimationState::apply(Skeleton). + bool wasApplied(); - /// Returns true if there is a getNext() track entry that is ready to become the current track entry during the - /// next AnimationState::update(float)} - bool isNextReady () { - return _next != NULL && _nextTrackLast - _next->_delay >= 0; - } + /// Returns true if there is a getNext() track entry that is ready to become the current track entry during the + /// next AnimationState::update(float)} + bool isNextReady() { + return _next != NULL && _nextTrackLast - _next->_delay >= 0; + } private: Animation *_animation; @@ -522,7 +523,7 @@ namespace spine { void setManualTrackEntryDisposal(bool inValue); - bool getManualTrackEntryDisposal(); + bool getManualTrackEntryDisposal(); void disposeTrackEntry(TrackEntry *entry); @@ -559,16 +560,15 @@ namespace spine { /// Applies the rotate timeline, mixing with the current pose while keeping the same rotation direction chosen as the shortest /// the first time the mixing was applied. - static void - applyRotateTimeline(RotateTimeline *rotateTimeline, Skeleton &skeleton, float time, float alpha, MixBlend pose, - Array &timelinesRotation, size_t i, bool firstFrame); + static void applyRotateTimeline(RotateTimeline *rotateTimeline, Skeleton &skeleton, float time, float alpha, MixBlend pose, + Array &timelinesRotation, size_t i, bool firstFrame); /// Applies the attachment timeline and sets Slot::attachmentState. /// @param attachments False when: 1) the attachment timeline is mixing out, 2) mix < attachmentThreshold, and 3) the timeline /// is not the last timeline to set the slot's attachment. In that case the timeline is applied only so subsequent /// timelines see any deform. - void applyAttachmentTimeline(AttachmentTimeline *attachmentTimeline, Skeleton &skeleton, float animationTime, - MixBlend pose, bool attachments); + void applyAttachmentTimeline(AttachmentTimeline *attachmentTimeline, Skeleton &skeleton, float animationTime, MixBlend pose, + bool attachments); /// Returns true when all mixing from entries are complete. bool updateMixingFrom(TrackEntry *to, float delta); diff --git a/spine-cpp/include/spine/Array.h b/spine-cpp/include/spine/Array.h index 009376e5e..e19037db8 100644 --- a/spine-cpp/include/spine/Array.h +++ b/spine-cpp/include/spine/Array.h @@ -135,8 +135,7 @@ namespace spine { inline void clearAndAddAll(const Array &inValue) { ensureCapacity(inValue.size()); - for (size_t i = 0; i < inValue.size(); i++) - _buffer[i] = inValue[i]; + for (size_t i = 0; i < inValue.size(); i++) _buffer[i] = inValue[i]; _size = inValue.size(); } @@ -239,13 +238,12 @@ namespace spine { } inline void construct(T *buffer, const T &val) { - new(buffer) T(val); + new (buffer) T(val); } inline void destroy(T *buffer) { buffer->~T(); } - }; } diff --git a/spine-cpp/include/spine/Atlas.h b/spine-cpp/include/spine/Atlas.h index 50111b667..05f9feceb 100644 --- a/spine-cpp/include/spine/Atlas.h +++ b/spine-cpp/include/spine/Atlas.h @@ -101,10 +101,9 @@ namespace spine { int index; void *texture; - explicit AtlasPage(const String &inName) : name(inName), format(Format_RGBA8888), - minFilter(TextureFilter_Nearest), - magFilter(TextureFilter_Nearest), uWrap(TextureWrap_ClampToEdge), - vWrap(TextureWrap_ClampToEdge), width(0), height(0), pma(false), index(0), texture(nullptr) { + explicit AtlasPage(const String &inName) + : name(inName), format(Format_RGBA8888), minFilter(TextureFilter_Nearest), magFilter(TextureFilter_Nearest), + uWrap(TextureWrap_ClampToEdge), vWrap(TextureWrap_ClampToEdge), width(0), height(0), pma(false), index(0), texture(nullptr) { } }; @@ -113,47 +112,118 @@ namespace spine { friend class RegionAttachment; friend class MeshAttachment; - RTTI_DECL + RTTI_DECL public: - AtlasRegion() : TextureRegion(), _page(nullptr), _name(""), _index(0), _x(0), _y(0), - _offsetX(0), _offsetY(0), _packedWidth(0), _packedHeight(0), - _originalWidth(0), _originalHeight(0), _rotate(false), _degrees(0) {} - ~AtlasRegion() {} - AtlasPage *getPage() const { return _page; } - String getName() const { return _name; } - int getIndex() const { return _index; } - int getX() const { return _x; } - int getY() const { return _y; } - float getOffsetX() const { return _offsetX; } - float getOffsetY() const { return _offsetY; } - int getPackedWidth() const { return _packedWidth; } - int getPackedHeight() const { return _packedHeight; } - int getOriginalWidth() const { return _originalWidth; } - int getOriginalHeight() const { return _originalHeight; } - bool getRotate() const { return _rotate; } - int getDegrees() const { return _degrees; } - Array &getSplits() { return _splits; } - Array &getPads() { return _pads; } - Array &getNames() { return _names; } - Array &getValues() { return _values; } - void setPage(AtlasPage *value) { _page = value; } - void setName(const String &value) { _name = value; } - void setIndex(int value) { _index = value; } - void setX(int value) { _x = value; } - void setY(int value) { _y = value; } - void setOffsetX(float value) { _offsetX = value; } - void setOffsetY(float value) { _offsetY = value; } - void setPackedWidth(int value) { _packedWidth = value; } - void setPackedHeight(int value) { _packedHeight = value; } - void setOriginalWidth(int value) { _originalWidth = value; } - void setOriginalHeight(int value) { _originalHeight = value; } - void setRotate(bool value) { _rotate = value; } - void setDegrees(int value) { _degrees = value; } - void setSplits(const Array &value) { _splits = value; } - void setPads(const Array &value) { _pads = value; } - void setNames(const Array &value) { _names = value; } - void setValues(const Array &value) { _values = value; } + AtlasRegion() + : TextureRegion(), _page(nullptr), _name(""), _index(0), _x(0), _y(0), _offsetX(0), _offsetY(0), _packedWidth(0), _packedHeight(0), + _originalWidth(0), _originalHeight(0), _rotate(false), _degrees(0) { + } + ~AtlasRegion() { + } + AtlasPage *getPage() const { + return _page; + } + String getName() const { + return _name; + } + int getIndex() const { + return _index; + } + int getX() const { + return _x; + } + int getY() const { + return _y; + } + float getOffsetX() const { + return _offsetX; + } + float getOffsetY() const { + return _offsetY; + } + int getPackedWidth() const { + return _packedWidth; + } + int getPackedHeight() const { + return _packedHeight; + } + int getOriginalWidth() const { + return _originalWidth; + } + int getOriginalHeight() const { + return _originalHeight; + } + bool getRotate() const { + return _rotate; + } + int getDegrees() const { + return _degrees; + } + Array &getSplits() { + return _splits; + } + Array &getPads() { + return _pads; + } + Array &getNames() { + return _names; + } + Array &getValues() { + return _values; + } + void setPage(AtlasPage *value) { + _page = value; + } + void setName(const String &value) { + _name = value; + } + void setIndex(int value) { + _index = value; + } + void setX(int value) { + _x = value; + } + void setY(int value) { + _y = value; + } + void setOffsetX(float value) { + _offsetX = value; + } + void setOffsetY(float value) { + _offsetY = value; + } + void setPackedWidth(int value) { + _packedWidth = value; + } + void setPackedHeight(int value) { + _packedHeight = value; + } + void setOriginalWidth(int value) { + _originalWidth = value; + } + void setOriginalHeight(int value) { + _originalHeight = value; + } + void setRotate(bool value) { + _rotate = value; + } + void setDegrees(int value) { + _degrees = value; + } + void setSplits(const Array &value) { + _splits = value; + } + void setPads(const Array &value) { + _pads = value; + } + void setNames(const Array &value) { + _names = value; + } + void setValues(const Array &value) { + _values = value; + } + private: AtlasPage *_page; String _name; diff --git a/spine-cpp/include/spine/Attachment.h b/spine-cpp/include/spine/Attachment.h index 68ae39511..dd58d2b6f 100644 --- a/spine-cpp/include/spine/Attachment.h +++ b/spine-cpp/include/spine/Attachment.h @@ -36,7 +36,7 @@ namespace spine { class SP_API Attachment : public SpineObject { - RTTI_DECL_NOPARENT + RTTI_DECL_NOPARENT public: explicit Attachment(const String &name); diff --git a/spine-cpp/include/spine/AttachmentTimeline.h b/spine-cpp/include/spine/AttachmentTimeline.h index cd1782db8..2d2e79208 100644 --- a/spine-cpp/include/spine/AttachmentTimeline.h +++ b/spine-cpp/include/spine/AttachmentTimeline.h @@ -53,16 +53,15 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit AttachmentTimeline(size_t frameCount, int slotIndex); virtual ~AttachmentTimeline(); - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, - MixDirection direction, bool appliedPose) override; + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) override; /// Sets the time and attachment name for the specified frame. /// @param frame Between 0 and frameCount, inclusive. diff --git a/spine-cpp/include/spine/AttachmentType.h b/spine-cpp/include/spine/AttachmentType.h index 480c1b23b..e4b97dacb 100644 --- a/spine-cpp/include/spine/AttachmentType.h +++ b/spine-cpp/include/spine/AttachmentType.h @@ -42,16 +42,24 @@ namespace spine { AttachmentType_Point, AttachmentType_Clipping }; - - inline AttachmentType AttachmentType_valueOf(const char* value) { - if (strcmp(value, "region") == 0) return AttachmentType_Region; - else if (strcmp(value, "mesh") == 0) return AttachmentType_Mesh; - else if (strcmp(value, "linkedmesh") == 0) return AttachmentType_Linkedmesh; - else if (strcmp(value, "boundingbox") == 0) return AttachmentType_Boundingbox; - else if (strcmp(value, "path") == 0) return AttachmentType_Path; - else if (strcmp(value, "clipping") == 0) return AttachmentType_Clipping; - else if (strcmp(value, "point") == 0) return AttachmentType_Point; - else return AttachmentType_Region; // default + + inline AttachmentType AttachmentType_valueOf(const char *value) { + if (strcmp(value, "region") == 0) + return AttachmentType_Region; + else if (strcmp(value, "mesh") == 0) + return AttachmentType_Mesh; + else if (strcmp(value, "linkedmesh") == 0) + return AttachmentType_Linkedmesh; + else if (strcmp(value, "boundingbox") == 0) + return AttachmentType_Boundingbox; + else if (strcmp(value, "path") == 0) + return AttachmentType_Path; + else if (strcmp(value, "clipping") == 0) + return AttachmentType_Clipping; + else if (strcmp(value, "point") == 0) + return AttachmentType_Point; + else + return AttachmentType_Region;// default } } diff --git a/spine-cpp/include/spine/BlendMode.h b/spine-cpp/include/spine/BlendMode.h index 083686716..e89a4f3f3 100644 --- a/spine-cpp/include/spine/BlendMode.h +++ b/spine-cpp/include/spine/BlendMode.h @@ -39,13 +39,18 @@ namespace spine { BlendMode_Multiply, BlendMode_Screen }; - - inline BlendMode BlendMode_valueOf(const char* value) { - if (strcmp(value, "normal") == 0) return BlendMode_Normal; - else if (strcmp(value, "additive") == 0) return BlendMode_Additive; - else if (strcmp(value, "multiply") == 0) return BlendMode_Multiply; - else if (strcmp(value, "screen") == 0) return BlendMode_Screen; - else return BlendMode_Normal; // default + + inline BlendMode BlendMode_valueOf(const char *value) { + if (strcmp(value, "normal") == 0) + return BlendMode_Normal; + else if (strcmp(value, "additive") == 0) + return BlendMode_Additive; + else if (strcmp(value, "multiply") == 0) + return BlendMode_Multiply; + else if (strcmp(value, "screen") == 0) + return BlendMode_Screen; + else + return BlendMode_Normal;// default } } diff --git a/spine-cpp/include/spine/BlockAllocator.h b/spine-cpp/include/spine/BlockAllocator.h index 313b08bde..d08b6ec42 100644 --- a/spine-cpp/include/spine/BlockAllocator.h +++ b/spine-cpp/include/spine/BlockAllocator.h @@ -37,78 +37,78 @@ #include namespace spine { - struct Block { - int size; - int allocated; - uint8_t *memory; + struct Block { + int size; + int allocated; + uint8_t *memory; - int free() { - return size - allocated; - } + int free() { + return size - allocated; + } - bool canFit(int numBytes) { - return free() >= numBytes; - } + bool canFit(int numBytes) { + return free() >= numBytes; + } - uint8_t *allocate(int numBytes) { - uint8_t *ptr = memory + allocated; - allocated += numBytes; - return ptr; - } - }; + uint8_t *allocate(int numBytes) { + uint8_t *ptr = memory + allocated; + allocated += numBytes; + return ptr; + } + }; - class BlockAllocator : public SpineObject { - int initialBlockSize; - Array blocks; + class BlockAllocator : public SpineObject { + int initialBlockSize; + Array blocks; - public: - BlockAllocator(int initialBlockSize) : initialBlockSize(initialBlockSize) { - blocks.add(newBlock(initialBlockSize)); - } + public: + BlockAllocator(int initialBlockSize) : initialBlockSize(initialBlockSize) { + blocks.add(newBlock(initialBlockSize)); + } - ~BlockAllocator() { - for (int i = 0, n = (int) blocks.size(); i < n; i++) { - SpineExtension::free(blocks[i].memory, __FILE__, __LINE__); - } - } + ~BlockAllocator() { + for (int i = 0, n = (int) blocks.size(); i < n; i++) { + SpineExtension::free(blocks[i].memory, __FILE__, __LINE__); + } + } - template - T *allocate(size_t num) { - return (T *) _allocate((int) (sizeof(T) * num)); - } + template + T *allocate(size_t num) { + return (T *) _allocate((int) (sizeof(T) * num)); + } - void compress() { - if (blocks.size() == 1) { - blocks[0].allocated = 0; - return; - } - int totalSize = 0; - for (int i = 0, n = (int)blocks.size(); i < n; i++) { - totalSize += blocks[i].size; - SpineExtension::free(blocks[i].memory, __FILE__, __LINE__); - } - blocks.clear(); - blocks.add(newBlock(totalSize)); - } + void compress() { + if (blocks.size() == 1) { + blocks[0].allocated = 0; + return; + } + int totalSize = 0; + for (int i = 0, n = (int) blocks.size(); i < n; i++) { + totalSize += blocks[i].size; + SpineExtension::free(blocks[i].memory, __FILE__, __LINE__); + } + blocks.clear(); + blocks.add(newBlock(totalSize)); + } - private: - void *_allocate(int numBytes) { - // 16-byte align allocations - int alignedNumBytes = numBytes + (numBytes % 16 != 0 ? 16 - (numBytes % 16) : 0); - Block *block = &blocks[blocks.size() - 1]; - if (!block->canFit(alignedNumBytes)) { - blocks.add(newBlock(MathUtil::max(initialBlockSize, alignedNumBytes))); - block = &blocks[blocks.size() - 1]; - } - return block->allocate(alignedNumBytes); - } + private: + void *_allocate(int numBytes) { + // 16-byte align allocations + int alignedNumBytes = numBytes + (numBytes % 16 != 0 ? 16 - (numBytes % 16) : 0); + Block *block = &blocks[blocks.size() - 1]; + if (!block->canFit(alignedNumBytes)) { + blocks.add(newBlock(MathUtil::max(initialBlockSize, alignedNumBytes))); + block = &blocks[blocks.size() - 1]; + } + return block->allocate(alignedNumBytes); + } - Block newBlock(int numBytes) { - Block block = {MathUtil::max(initialBlockSize, numBytes), 0, nullptr}; - block.memory = SpineExtension::alloc(block.size, __FILE__, __LINE__); - return block; - } - }; + Block newBlock(int numBytes) { + Block block = {MathUtil::max(initialBlockSize, numBytes), 0, nullptr}; + block.memory = SpineExtension::alloc(block.size, __FILE__, __LINE__); + return block; + } + }; } #endif diff --git a/spine-cpp/include/spine/Bone.h b/spine-cpp/include/spine/Bone.h index b8db1518e..2e3695883 100644 --- a/spine-cpp/include/spine/Bone.h +++ b/spine-cpp/include/spine/Bone.h @@ -76,29 +76,33 @@ namespace spine { public: /// @param parent May be NULL. - Bone(BoneData& data, Bone* parent); + Bone(BoneData &data, Bone *parent); /// Copy constructor. Does not copy the children bones. - Bone(Bone& bone, Bone* parent); + Bone(Bone &bone, Bone *parent); /// The parent bone, or null if this is the root bone. - Bone* getParent(); + Bone *getParent(); /// The immediate children of this bone. - Array& getChildren(); + Array &getChildren(); - static bool isYDown() { return yDown; } - static void setYDown(bool value) { yDown = value; } + static bool isYDown() { + return yDown; + } + static void setYDown(bool value) { + yDown = value; + } - virtual void update(Skeleton& skeleton, Physics physics) override { + virtual void update(Skeleton &skeleton, Physics physics) override { // No-op, need to extend Update so we can stuff Bone into Skeleton.updateCache temporarily. // See Skeleton::updateCache(). } private: static bool yDown; - Bone* const _parent; - Array _children; + Bone *const _parent; + Array _children; bool _sorted; }; } diff --git a/spine-cpp/include/spine/BoneLocal.h b/spine-cpp/include/spine/BoneLocal.h index 7116262fc..d74eda648 100644 --- a/spine-cpp/include/spine/BoneLocal.h +++ b/spine-cpp/include/spine/BoneLocal.h @@ -79,7 +79,7 @@ namespace spine { BoneLocal(); virtual ~BoneLocal(); - virtual void set(BoneLocal& pose) override; + virtual void set(BoneLocal &pose) override; /// The local x translation. float getX(); diff --git a/spine-cpp/include/spine/BoneTimeline.h b/spine-cpp/include/spine/BoneTimeline.h index 267e6dd3b..3f6ef2667 100644 --- a/spine-cpp/include/spine/BoneTimeline.h +++ b/spine-cpp/include/spine/BoneTimeline.h @@ -38,22 +38,28 @@ namespace spine { class Event; class BoneLocal; - /// An interface for timelines which change the property of a bone. - class SP_API BoneTimeline { + /// An interface for timelines which change the property of a bone. + class SP_API BoneTimeline { RTTI_DECL_NOPARENT - public: - BoneTimeline(int boneIndex) : _boneIndex(boneIndex) {} - virtual ~BoneTimeline() {} + public: + BoneTimeline(int boneIndex) : _boneIndex(boneIndex) { + } + virtual ~BoneTimeline() { + } - /// The index of the bone in Skeleton::getBones() that will be changed when this timeline is applied. - virtual int getBoneIndex() { return _boneIndex; } + /// The index of the bone in Skeleton::getBones() that will be changed when this timeline is applied. + virtual int getBoneIndex() { + return _boneIndex; + } - virtual void setBoneIndex(int inValue) { _boneIndex = inValue; } + virtual void setBoneIndex(int inValue) { + _boneIndex = inValue; + } protected: int _boneIndex; - }; + }; /// Base class for timelines that animate a single bone property. class SP_API BoneTimeline1 : public CurveTimeline1, public BoneTimeline { @@ -61,19 +67,17 @@ namespace spine { friend class SkeletonJson; friend class AnimationState; - RTTI_DECL + RTTI_DECL public: BoneTimeline1(size_t frameCount, size_t bezierCount, int boneIndex, Property property); - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, - MixDirection direction, bool appliedPose) override; + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) override; protected: /// Applies changes to the pose based on the timeline values. - virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) = 0; + virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) = 0; }; /// Base class for timelines that animate two bone properties. @@ -82,20 +86,17 @@ namespace spine { friend class SkeletonJson; friend class AnimationState; - RTTI_DECL + RTTI_DECL public: BoneTimeline2(size_t frameCount, size_t bezierCount, int boneIndex, Property property1, Property property2); - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, - MixDirection direction, bool appliedPose) override; + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) override; protected: /// Applies changes to the pose based on the timeline values. - virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) = 0; - + virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) = 0; }; } diff --git a/spine-cpp/include/spine/BoundingBoxAttachment.h b/spine-cpp/include/spine/BoundingBoxAttachment.h index cd8e11635..ab76a71fc 100644 --- a/spine-cpp/include/spine/BoundingBoxAttachment.h +++ b/spine-cpp/include/spine/BoundingBoxAttachment.h @@ -37,7 +37,7 @@ namespace spine { /// Attachment that has a polygon for bounds checking. class SP_API BoundingBoxAttachment : public VertexAttachment { - RTTI_DECL + RTTI_DECL public: explicit BoundingBoxAttachment(const String &name); diff --git a/spine-cpp/include/spine/ClippingAttachment.h b/spine-cpp/include/spine/ClippingAttachment.h index b9d165acc..f85f460b2 100644 --- a/spine-cpp/include/spine/ClippingAttachment.h +++ b/spine-cpp/include/spine/ClippingAttachment.h @@ -43,7 +43,7 @@ namespace spine { friend class SkeletonClipping; - RTTI_DECL + RTTI_DECL public: explicit ClippingAttachment(const String &name); diff --git a/spine-cpp/include/spine/Color.h b/spine-cpp/include/spine/Color.h index 49a121925..0c670a894 100644 --- a/spine-cpp/include/spine/Color.h +++ b/spine-cpp/include/spine/Color.h @@ -105,14 +105,14 @@ namespace spine { } // Parse hex color string like "ff0000ff" (RRGGBBAA) or "ff0000" (RRGGBB) - static Color valueOf(const char* hexString) { + static Color valueOf(const char *hexString) { Color color; valueOf(hexString, color); return color; } // Parse hex color string into existing Color object - static void valueOf(const char* hexString, Color& color) { + static void valueOf(const char *hexString, Color &color) { size_t len = strlen(hexString); if (len >= 6) { color.r = parseHex(hexString, 0); @@ -122,7 +122,7 @@ namespace spine { } } - static float parseHex(const char* value, size_t index) { + static float parseHex(const char *value, size_t index) { char digits[3]; digits[0] = value[index * 2]; digits[1] = value[index * 2 + 1]; @@ -131,8 +131,8 @@ namespace spine { } // Convert packed RGBA8888 integer to Color - static void rgba8888ToColor(Color& color, int value) { - unsigned int rgba = (unsigned int)value; + static void rgba8888ToColor(Color &color, int value) { + unsigned int rgba = (unsigned int) value; color.r = ((rgba & 0xff000000) >> 24) / 255.0f; color.g = ((rgba & 0x00ff0000) >> 16) / 255.0f; color.b = ((rgba & 0x0000ff00) >> 8) / 255.0f; @@ -140,8 +140,8 @@ namespace spine { } // Convert packed RGB888 integer to Color (no alpha) - static void rgb888ToColor(Color& color, int value) { - unsigned int rgb = (unsigned int)value; + static void rgb888ToColor(Color &color, int value) { + unsigned int rgb = (unsigned int) value; color.r = ((rgb & 0xff0000) >> 16) / 255.0f; color.g = ((rgb & 0x00ff00) >> 8) / 255.0f; color.b = (rgb & 0x0000ff) / 255.0f; @@ -153,4 +153,4 @@ namespace spine { } -#endif //SPINE_COLOR_H +#endif//SPINE_COLOR_H diff --git a/spine-cpp/include/spine/ColorTimeline.h b/spine-cpp/include/spine/ColorTimeline.h index 7207d9cbc..66b0a4527 100644 --- a/spine-cpp/include/spine/ColorTimeline.h +++ b/spine-cpp/include/spine/ColorTimeline.h @@ -40,7 +40,7 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit RGBATimeline(size_t frameCount, size_t bezierCount, int slotIndex); @@ -53,7 +53,7 @@ namespace spine { void setFrame(int frame, float time, float r, float g, float b, float a); protected: - virtual void apply(Slot& slot, SlotPose& pose, float time, float alpha, MixBlend blend) override; + virtual void apply(Slot &slot, SlotPose &pose, float time, float alpha, MixBlend blend) override; static const int ENTRIES = 5; static const int R = 1; @@ -68,7 +68,7 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit RGBTimeline(size_t frameCount, size_t bezierCount, int slotIndex); @@ -81,7 +81,7 @@ namespace spine { void setFrame(int frame, float time, float r, float g, float b); protected: - virtual void apply(Slot& slot, SlotPose& pose, float time, float alpha, MixBlend blend) override; + virtual void apply(Slot &slot, SlotPose &pose, float time, float alpha, MixBlend blend) override; static const int ENTRIES = 4; static const int R = 1; @@ -94,16 +94,15 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit AlphaTimeline(size_t frameCount, size_t bezierCount, int slotIndex); virtual ~AlphaTimeline(); - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, - MixDirection direction, bool appliedPose) override; + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) override; }; /// Changes a slot's SlotPose::getColor() and SlotPose::getDarkColor() for two color tinting. @@ -112,7 +111,7 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit RGBA2Timeline(size_t frameCount, size_t bezierCount, int slotIndex); @@ -125,7 +124,7 @@ namespace spine { void setFrame(int frame, float time, float r, float g, float b, float a, float r2, float g2, float b2); protected: - virtual void apply(Slot& slot, SlotPose& pose, float time, float alpha, MixBlend blend) override; + virtual void apply(Slot &slot, SlotPose &pose, float time, float alpha, MixBlend blend) override; static const int ENTRIES = 8; static const int R = 1; @@ -143,7 +142,7 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit RGB2Timeline(size_t frameCount, size_t bezierCount, int slotIndex); @@ -156,7 +155,7 @@ namespace spine { void setFrame(int frame, float time, float r, float g, float b, float r2, float g2, float b2); protected: - virtual void apply(Slot& slot, SlotPose& pose, float time, float alpha, MixBlend blend) override; + virtual void apply(Slot &slot, SlotPose &pose, float time, float alpha, MixBlend blend) override; static const int ENTRIES = 7; static const int R = 1; diff --git a/spine-cpp/include/spine/ConstraintData.h b/spine-cpp/include/spine/ConstraintData.h index 8bd8280c4..44880ac19 100644 --- a/spine-cpp/include/spine/ConstraintData.h +++ b/spine-cpp/include/spine/ConstraintData.h @@ -45,10 +45,12 @@ namespace spine { friend class Constraint; public: - ConstraintData(const String &name) : SpineObject(name) {} - virtual ~ConstraintData() {} + ConstraintData(const String &name) : SpineObject(name) { + } + virtual ~ConstraintData() { + } - virtual Constraint* create(Skeleton& skeleton) = 0; + virtual Constraint *create(Skeleton &skeleton) = 0; virtual const String &getName() const = 0; @@ -57,16 +59,22 @@ namespace spine { /// Base class for all constraint data types. template - class SP_API ConstraintDataGeneric: public PosedDataGeneric

, public ConstraintData { + class SP_API ConstraintDataGeneric : public PosedDataGeneric

, public ConstraintData { public: - ConstraintDataGeneric(const String &name) : PosedDataGeneric

(name), ConstraintData(name) {} - virtual ~ConstraintDataGeneric() {} + ConstraintDataGeneric(const String &name) : PosedDataGeneric

(name), ConstraintData(name) { + } + virtual ~ConstraintDataGeneric() { + } - virtual Constraint* create(Skeleton& skeleton) override = 0; + virtual Constraint *create(Skeleton &skeleton) override = 0; // Resolve ambiguity by forwarding to PosedData's implementation - virtual const String &getName() const override { return PosedDataGeneric

::getName(); } - virtual bool getSkinRequired() const override { return PosedDataGeneric

::getSkinRequired(); } + virtual const String &getName() const override { + return PosedDataGeneric

::getName(); + } + virtual bool getSkinRequired() const override { + return PosedDataGeneric

::getSkinRequired(); + } }; } diff --git a/spine-cpp/include/spine/ConstraintTimeline.h b/spine-cpp/include/spine/ConstraintTimeline.h index 362655f6a..3716ab577 100644 --- a/spine-cpp/include/spine/ConstraintTimeline.h +++ b/spine-cpp/include/spine/ConstraintTimeline.h @@ -34,22 +34,27 @@ #include namespace spine { - /// An interface for timelines which change the property of a constraint. - class SP_API ConstraintTimeline { - RTTI_DECL_NOPARENT + /// An interface for timelines which change the property of a constraint. + class SP_API ConstraintTimeline { + RTTI_DECL_NOPARENT - public: - ConstraintTimeline(int constraintIndex); - virtual ~ConstraintTimeline() {} + public: + ConstraintTimeline(int constraintIndex); + virtual ~ConstraintTimeline() { + } - /// The index of the constraint in Skeleton::getConstraints() that will be changed when this timeline is applied. - virtual int getConstraintIndex() { return _constraintIndex; } + /// The index of the constraint in Skeleton::getConstraints() that will be changed when this timeline is applied. + virtual int getConstraintIndex() { + return _constraintIndex; + } - virtual void setConstraintIndex(int inValue) { _constraintIndex = inValue; } + virtual void setConstraintIndex(int inValue) { + _constraintIndex = inValue; + } - protected: - int _constraintIndex; - }; + protected: + int _constraintIndex; + }; } #endif \ No newline at end of file diff --git a/spine-cpp/include/spine/ConstraintTimeline1.h b/spine-cpp/include/spine/ConstraintTimeline1.h index 69ce0669f..d4d311d2f 100644 --- a/spine-cpp/include/spine/ConstraintTimeline1.h +++ b/spine-cpp/include/spine/ConstraintTimeline1.h @@ -41,7 +41,8 @@ namespace spine { public: ConstraintTimeline1(size_t frameCount, size_t bezierCount, int constraintIndex, Property property); - virtual ~ConstraintTimeline1() {} + virtual ~ConstraintTimeline1() { + } }; } diff --git a/spine-cpp/include/spine/CurveTimeline.h b/spine-cpp/include/spine/CurveTimeline.h index 072a2d96c..4a39ca47f 100644 --- a/spine-cpp/include/spine/CurveTimeline.h +++ b/spine-cpp/include/spine/CurveTimeline.h @@ -36,7 +36,7 @@ namespace spine { /// Base class for frames that use an interpolation bezier curve. class SP_API CurveTimeline : public Timeline { - RTTI_DECL + RTTI_DECL public: explicit CurveTimeline(size_t frameCount, size_t frameEntries, size_t bezierCount); @@ -47,9 +47,8 @@ namespace spine { void setStepped(size_t frame); - virtual void - setBezier(size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, - float cy2, float time2, float value2); + virtual void setBezier(size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, + float time2, float value2); float getBezierValue(float time, size_t frame, size_t valueOffset, size_t i); @@ -61,12 +60,12 @@ namespace spine { static const int BEZIER = 2; static const int BEZIER_SIZE = 18; - Array _curves; // type, x, y, ... + Array _curves;// type, x, y, ... }; /// The base class for a CurveTimeline that sets one property. class SP_API CurveTimeline1 : public CurveTimeline { - RTTI_DECL + RTTI_DECL public: /// @param frameCount The number of frames for this timeline. @@ -83,13 +82,13 @@ namespace spine { /// Returns the interpolated value for the specified time. float getCurveValue(float time); - float getRelativeValue(float time, float alpha, MixBlend blend, float current, float setup); + float getRelativeValue(float time, float alpha, MixBlend blend, float current, float setup); - float getAbsoluteValue(float time, float alpha, MixBlend blend, float current, float setup); + float getAbsoluteValue(float time, float alpha, MixBlend blend, float current, float setup); - float getAbsoluteValue (float time, float alpha, MixBlend blend, float current, float setup, float value); + float getAbsoluteValue(float time, float alpha, MixBlend blend, float current, float setup, float value); - float getScaleValue (float time, float alpha, MixBlend blend, MixDirection direction, float current, float setup); + float getScaleValue(float time, float alpha, MixBlend blend, MixDirection direction, float current, float setup); protected: static const int ENTRIES = 2; @@ -97,7 +96,7 @@ namespace spine { }; class SP_API CurveTimeline2 : public CurveTimeline { - RTTI_DECL + RTTI_DECL public: explicit CurveTimeline2(size_t frameCount, size_t bezierCount); diff --git a/spine-cpp/include/spine/Debug.h b/spine-cpp/include/spine/Debug.h index 19fe7c0e6..9bc09ce23 100644 --- a/spine-cpp/include/spine/Debug.h +++ b/spine-cpp/include/spine/Debug.h @@ -45,7 +45,8 @@ namespace spine { public: class SP_API DebugPair { public: - explicit DebugPair(K &k, V &v) : key(k), value(v) {} + explicit DebugPair(K &k, V &v) : key(k), value(v) { + } K &key; V &value; @@ -80,9 +81,7 @@ namespace spine { DebugEntry *_entry; }; - DebugHashMap() : - _head(NULL), - _size(0) { + DebugHashMap() : _head(NULL), _size(0) { } ~DebugHashMap() { @@ -126,7 +125,7 @@ namespace spine { } } - bool addAll(Array &keys, const V &value) { + bool addAll(Array &keys, const V &value) { size_t oldSize = _size; for (size_t i = 0; i < keys.size(); i++) { put(keys[i], value); @@ -145,8 +144,10 @@ namespace spine { DebugEntry *prev = entry->prev; DebugEntry *next = entry->next; - if (prev) prev->next = next; - else _head = next; + if (prev) + prev->next = next; + else + _head = next; if (next) next->prev = entry->prev; delete entry; @@ -157,7 +158,8 @@ namespace spine { V operator[](const K &key) { DebugEntry *entry = find(key); - if (entry) return entry->_value; + if (entry) + return entry->_value; else { assert(false); return 0; @@ -171,8 +173,7 @@ namespace spine { private: DebugEntry *find(const K &key) { for (DebugEntry *entry = _head; entry != NULL; entry = entry->next) { - if (entry->_key == key) - return entry; + if (entry->_key == key) return entry; } return NULL; } @@ -184,7 +185,8 @@ namespace spine { DebugEntry *next; DebugEntry *prev; - DebugEntry() : next(NULL), prev(NULL) {} + DebugEntry() : next(NULL), prev(NULL) { + } }; DebugEntry *_head; @@ -206,16 +208,14 @@ namespace spine { }; public: - DebugExtension(SpineExtension *extension) : _extension(extension), _allocations(0), _reallocations(0), - _frees(0) { + DebugExtension(SpineExtension *extension) : _extension(extension), _allocations(0), _reallocations(0), _frees(0) { } void reportLeaks() { DebugHashMap::DebugEntries entries = _allocated.getEntries(); while (entries.hasNext()) { DebugHashMap::DebugPair pair = entries.next(); - printf("\"%s:%i (%zu bytes at %p)\n", pair.value.fileName, pair.value.line, pair.value.size, - pair.value.address); + printf("\"%s:%i (%zu bytes at %p)\n", pair.value.fileName, pair.value.line, pair.value.size, pair.value.address); } printf("allocations: %zu, reallocations: %zu, frees: %zu\n", _allocations, _reallocations, _frees); if (_allocated.size() == 0) printf("No leaks detected\n"); @@ -284,15 +284,15 @@ namespace spine { } virtual char *_readFile(const String &path, int *length) { - auto data = _extension->_readFile(path, length); + auto data = _extension->_readFile(path, length); - if (!_allocated.containsKey(data)) { - _allocated.put(data, Allocation(data, sizeof(char) * (*length), nullptr, 0)); - _allocations++; - _usedMemory += sizeof(char) * (*length); - } + if (!_allocated.containsKey(data)) { + _allocated.put(data, Allocation(data, sizeof(char) * (*length), nullptr, 0)); + _allocations++; + _usedMemory += sizeof(char) * (*length); + } - return data; + return data; } size_t getUsedMemory() { @@ -310,4 +310,4 @@ namespace spine { } -#endif //SPINE_LOG_H +#endif//SPINE_LOG_H diff --git a/spine-cpp/include/spine/DeformTimeline.h b/spine-cpp/include/spine/DeformTimeline.h index 0410eaaf5..35caae6d0 100644 --- a/spine-cpp/include/spine/DeformTimeline.h +++ b/spine-cpp/include/spine/DeformTimeline.h @@ -41,7 +41,7 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit DeformTimeline(size_t frameCount, size_t bezierCount, int slotIndex, VertexAttachment *attachment); @@ -50,26 +50,27 @@ namespace spine { void setFrame(int frameIndex, float time, Array &vertices); /// The vertices for each frame. - Array > &getVertices(); + Array> &getVertices(); /// The attachment that will be deformed. VertexAttachment *getAttachment(); void setAttachment(VertexAttachment *inValue); - virtual void - setBezier(size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, - float cy2, float time2, float value2) override; + virtual void setBezier(size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, + float time2, float value2) override; float getCurvePercent(float time, int frame); - size_t getFrameCount() { return _frames.size(); } + size_t getFrameCount() { + return _frames.size(); + } protected: void apply(Slot &slot, SlotPose &pose, float time, float alpha, MixBlend blend) override; private: - Array > _vertices; + Array> _vertices; VertexAttachment *_attachment; }; diff --git a/spine-cpp/include/spine/DrawOrderTimeline.h b/spine-cpp/include/spine/DrawOrderTimeline.h index edec65fd4..267b43981 100644 --- a/spine-cpp/include/spine/DrawOrderTimeline.h +++ b/spine-cpp/include/spine/DrawOrderTimeline.h @@ -39,19 +39,18 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit DrawOrderTimeline(size_t frameCount); - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, - MixDirection direction, bool appliedPose) override; + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) override; size_t getFrameCount(); /// The draw order for each frame. See setFrame(). - Array > &getDrawOrders(); + Array> &getDrawOrders(); /// Sets the time and draw order for the specified frame. /// @param frame Between 0 and frameCount, inclusive. @@ -60,7 +59,7 @@ namespace spine { void setFrame(size_t frame, float time, Array *drawOrder); private: - Array > _drawOrders; + Array> _drawOrders; }; } diff --git a/spine-cpp/include/spine/EventData.h b/spine-cpp/include/spine/EventData.h index d09d5c5fe..6a8c612dd 100644 --- a/spine-cpp/include/spine/EventData.h +++ b/spine-cpp/include/spine/EventData.h @@ -34,7 +34,7 @@ #include namespace spine { -/// Stores the setup pose values for an Event. + /// Stores the setup pose values for an Event. class SP_API EventData : public SpineObject { friend class SkeletonBinary; diff --git a/spine-cpp/include/spine/EventTimeline.h b/spine-cpp/include/spine/EventTimeline.h index 251b26501..17e66490e 100644 --- a/spine-cpp/include/spine/EventTimeline.h +++ b/spine-cpp/include/spine/EventTimeline.h @@ -39,7 +39,7 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit EventTimeline(size_t frameCount); @@ -47,9 +47,8 @@ namespace spine { ~EventTimeline(); /// Fires events for frames > lastTime and <= time. - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, - MixDirection direction, bool appliedPose) override; + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) override; size_t getFrameCount(); diff --git a/spine-cpp/include/spine/Extension.h b/spine-cpp/include/spine/Extension.h index babb39738..e367d3721 100644 --- a/spine-cpp/include/spine/Extension.h +++ b/spine-cpp/include/spine/Extension.h @@ -34,7 +34,7 @@ #include #include -#define SP_UNUSED(x) (void)(x) +#define SP_UNUSED(x) (void) (x) namespace spine { class String; @@ -88,7 +88,9 @@ namespace spine { virtual char *_readFile(const String &path, int *length) = 0; - virtual void _beforeFree(void *ptr) { SP_UNUSED(ptr); } + virtual void _beforeFree(void *ptr) { + SP_UNUSED(ptr); + } protected: SpineExtension(); @@ -115,10 +117,10 @@ namespace spine { virtual char *_readFile(const String &path, int *length) override; }; -// This function is to be implemented by engine specific runtimes to provide -// the default extension for that engine. It is called the first time -// SpineExtension::getInstance() is called, when no instance has been set -// yet. + // This function is to be implemented by engine specific runtimes to provide + // the default extension for that engine. It is called the first time + // SpineExtension::getInstance() is called, when no instance has been set + // yet. extern SpineExtension *getDefaultExtension(); } diff --git a/spine-cpp/include/spine/HasRendererObject.h b/spine-cpp/include/spine/HasRendererObject.h index db49a48ae..55e038c5f 100644 --- a/spine-cpp/include/spine/HasRendererObject.h +++ b/spine-cpp/include/spine/HasRendererObject.h @@ -41,15 +41,15 @@ namespace spine { explicit HasRendererObject() : _rendererObject(0), _dispose(0) {}; virtual ~HasRendererObject() { - if (_dispose && _rendererObject) - _dispose(_rendererObject); + if (_dispose && _rendererObject) _dispose(_rendererObject); } - void *getRendererObject() { return _rendererObject; } + void *getRendererObject() { + return _rendererObject; + } void setRendererObject(void *rendererObject, DisposeRendererObject dispose = 0) { - if (_dispose && _rendererObject && _rendererObject != rendererObject) - _dispose(_rendererObject); + if (_dispose && _rendererObject && _rendererObject != rendererObject) _dispose(_rendererObject); _rendererObject = rendererObject; _dispose = dispose; diff --git a/spine-cpp/include/spine/HashMap.h b/spine-cpp/include/spine/HashMap.h old mode 100755 new mode 100644 index d3533dff6..436a270e4 --- a/spine-cpp/include/spine/HashMap.h +++ b/spine-cpp/include/spine/HashMap.h @@ -35,9 +35,9 @@ // Required for new with line number and file name in MSVC #ifdef _MSC_VER -#pragma warning(disable:4291) +#pragma warning(disable : 4291) -#pragma warning(disable:4251) +#pragma warning(disable : 4251) #endif @@ -50,7 +50,8 @@ namespace spine { public: class SP_API Pair { public: - explicit Pair(K &k, V &v) : key(k), value(v) {} + explicit Pair(K &k, V &v) : key(k), value(v) { + } K &key; V &value; @@ -85,9 +86,7 @@ namespace spine { Entry *_entry; }; - HashMap() : - _head(NULL), - _size(0) { + HashMap() : _head(NULL), _size(0) { } ~HashMap() { @@ -114,7 +113,7 @@ namespace spine { entry->_key = key; entry->_value = value; } else { - entry = new(__FILE__, __LINE__) Entry(); + entry = new (__FILE__, __LINE__) Entry(); entry->_key = key; entry->_value = value; @@ -131,7 +130,7 @@ namespace spine { } } - bool addAll(Array &keys, const V &value) { + bool addAll(Array &keys, const V &value) { size_t oldSize = _size; for (size_t i = 0; i < keys.size(); i++) { put(keys[i], value); @@ -150,8 +149,10 @@ namespace spine { Entry *prev = entry->prev; Entry *next = entry->next; - if (prev) prev->next = next; - else _head = next; + if (prev) + prev->next = next; + else + _head = next; if (next) next->prev = entry->prev; delete entry; @@ -162,7 +163,8 @@ namespace spine { V operator[](const K &key) { Entry *entry = find(key); - if (entry) return entry->_value; + if (entry) + return entry->_value; else { assert(false); return 0; @@ -176,8 +178,7 @@ namespace spine { private: Entry *find(const K &key) { for (Entry *entry = _head; entry != NULL; entry = entry->next) { - if (entry->_key == key) - return entry; + if (entry->_key == key) return entry; } return NULL; } @@ -189,7 +190,8 @@ namespace spine { Entry *next; Entry *prev; - Entry() : next(NULL), prev(NULL) {} + Entry() : next(NULL), prev(NULL) { + } }; Entry *_head; diff --git a/spine-cpp/include/spine/IkConstraint.h b/spine-cpp/include/spine/IkConstraint.h index fee2ef6fc..a5742883b 100644 --- a/spine-cpp/include/spine/IkConstraint.h +++ b/spine-cpp/include/spine/IkConstraint.h @@ -46,16 +46,16 @@ namespace spine { friend class IkConstraintTimeline; - RTTI_DECL + RTTI_DECL public: IkConstraint(IkConstraintData &data, Skeleton &skeleton); - virtual IkConstraint* copy(Skeleton& skeleton); + virtual IkConstraint *copy(Skeleton &skeleton); - virtual void update(Skeleton& skeleton, Physics physics) override; + virtual void update(Skeleton &skeleton, Physics physics) override; - virtual void sort(Skeleton& skeleton) override; + virtual void sort(Skeleton &skeleton) override; virtual bool isSourceActive() override; @@ -69,15 +69,13 @@ namespace spine { /// Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified /// in the world coordinate system. - static void - apply(Skeleton& skeleton, BonePose& bone, float targetX, float targetY, bool compress, bool stretch, bool uniform, float mix); + static void apply(Skeleton &skeleton, BonePose &bone, float targetX, float targetY, bool compress, bool stretch, bool uniform, float mix); /// Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as /// possible. The target is specified in the world coordinate system. /// @param child A direct descendant of the parent bone. - static void - apply(Skeleton& skeleton, BonePose& parent, BonePose& child, float targetX, float targetY, int bendDirection, bool stretch, bool uniform, - float softness, float mix); + static void apply(Skeleton &skeleton, BonePose &parent, BonePose &child, float targetX, float targetY, int bendDirection, bool stretch, + bool uniform, float softness, float mix); private: Array _bones; diff --git a/spine-cpp/include/spine/IkConstraintData.h b/spine-cpp/include/spine/IkConstraintData.h index f85983a72..22a50db0f 100644 --- a/spine-cpp/include/spine/IkConstraintData.h +++ b/spine-cpp/include/spine/IkConstraintData.h @@ -57,7 +57,7 @@ namespace spine { public: explicit IkConstraintData(const String &name); - virtual Constraint* create(Skeleton& skeleton) override; + virtual Constraint *create(Skeleton &skeleton) override; /// The bones that are constrained by this IK Constraint. Array &getBones(); diff --git a/spine-cpp/include/spine/IkConstraintPose.h b/spine-cpp/include/spine/IkConstraintPose.h index 72e0b88e8..cc25abc35 100644 --- a/spine-cpp/include/spine/IkConstraintPose.h +++ b/spine-cpp/include/spine/IkConstraintPose.h @@ -46,7 +46,7 @@ namespace spine { IkConstraintPose(); virtual ~IkConstraintPose(); - virtual void set(IkConstraintPose& pose) override; + virtual void set(IkConstraintPose &pose) override; /// A percentage (0-1) that controls the mix between the constrained and unconstrained rotation. /// diff --git a/spine-cpp/include/spine/IkConstraintTimeline.h b/spine-cpp/include/spine/IkConstraintTimeline.h index c442d4f18..1b32aedfd 100644 --- a/spine-cpp/include/spine/IkConstraintTimeline.h +++ b/spine-cpp/include/spine/IkConstraintTimeline.h @@ -42,16 +42,15 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit IkConstraintTimeline(size_t frameCount, size_t bezierCount, int constraintIndex); virtual ~IkConstraintTimeline(); - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, - MixDirection direction, bool appliedPose) override; + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) override; /// Sets the time, mix, softness, bend direction, compress, and stretch for the specified frame. /// @param frame Between 0 and frameCount, inclusive. diff --git a/spine-cpp/include/spine/Inherit.h b/spine-cpp/include/spine/Inherit.h index 02ec9e3c3..ec520ccf6 100644 --- a/spine-cpp/include/spine/Inherit.h +++ b/spine-cpp/include/spine/Inherit.h @@ -41,14 +41,20 @@ namespace spine { Inherit_NoScale, Inherit_NoScaleOrReflection }; - - inline Inherit Inherit_valueOf(const char* value) { - if (strcmp(value, "normal") == 0) return Inherit_Normal; - else if (strcmp(value, "onlyTranslation") == 0) return Inherit_OnlyTranslation; - else if (strcmp(value, "noRotationOrReflection") == 0) return Inherit_NoRotationOrReflection; - else if (strcmp(value, "noScale") == 0) return Inherit_NoScale; - else if (strcmp(value, "noScaleOrReflection") == 0) return Inherit_NoScaleOrReflection; - else return Inherit_Normal; // default + + inline Inherit Inherit_valueOf(const char *value) { + if (strcmp(value, "normal") == 0) + return Inherit_Normal; + else if (strcmp(value, "onlyTranslation") == 0) + return Inherit_OnlyTranslation; + else if (strcmp(value, "noRotationOrReflection") == 0) + return Inherit_NoRotationOrReflection; + else if (strcmp(value, "noScale") == 0) + return Inherit_NoScale; + else if (strcmp(value, "noScaleOrReflection") == 0) + return Inherit_NoScaleOrReflection; + else + return Inherit_Normal;// default } } diff --git a/spine-cpp/include/spine/InheritTimeline.h b/spine-cpp/include/spine/InheritTimeline.h index cdabc0018..4635c1fda 100644 --- a/spine-cpp/include/spine/InheritTimeline.h +++ b/spine-cpp/include/spine/InheritTimeline.h @@ -44,7 +44,7 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit InheritTimeline(size_t frameCount, int boneIndex); @@ -54,15 +54,14 @@ namespace spine { /// Sets the inherit transform mode for the specified frame. /// @param frame Between 0 and frameCount, inclusive. /// @param time The frame time in seconds. - void setFrame(int frame, float time, Inherit inherit); + void setFrame(int frame, float time, Inherit inherit); - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, - MixDirection direction, bool appliedPose) override; + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) override; private: - static const int ENTRIES = 2; - static const int INHERIT = 1; + static const int ENTRIES = 2; + static const int INHERIT = 1; }; } diff --git a/spine-cpp/include/spine/Json.h b/spine-cpp/include/spine/Json.h index fc5095160..b7683f16d 100644 --- a/spine-cpp/include/spine/Json.h +++ b/spine-cpp/include/spine/Json.h @@ -56,8 +56,7 @@ namespace spine { if (value == NULL) return false; array.setSize(value->_size, 0); Json *vertex = value->_child; - for (int i = 0; vertex; vertex = vertex->_next, i++) - array[i] = vertex->_valueFloat; + for (int i = 0; vertex; vertex = vertex->_next, i++) array[i] = vertex->_valueFloat; return true; } @@ -65,8 +64,7 @@ namespace spine { if (value == NULL) return false; array.setSize(value->_size, 0); Json *vertex = value->_child; - for (int i = 0; vertex; vertex = vertex->_next, i++) - array[i] = vertex->_valueInt; + for (int i = 0; vertex; vertex = vertex->_next, i++) array[i] = vertex->_valueInt; return true; } @@ -74,8 +72,7 @@ namespace spine { if (value == NULL) return false; array.setSize(value->_size, 0); Json *vertex = value->_child; - for (int i = 0; vertex; vertex = vertex->_next, i++) - array[i] = (unsigned short)vertex->_valueInt; + for (int i = 0; vertex; vertex = vertex->_next, i++) array[i] = (unsigned short) vertex->_valueInt; return true; } @@ -106,7 +103,7 @@ namespace spine { Json *_next; #if SPINE_JSON_HAVE_PREV - Json* _prev; /* next/prev allow you to walk array/object chains. Alternatively, use getSize/getItem */ + Json *_prev; /* next/prev allow you to walk array/object chains. Alternatively, use getSize/getItem */ #endif Json *_child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ @@ -114,8 +111,8 @@ namespace spine { int _size; /* The number of children. */ const char *_valueString; /* The item's string, if type==JSON_STRING */ - int _valueInt; /* The item's number, if type==JSON_NUMBER */ - float _valueFloat; /* The item's number, if type==JSON_NUMBER */ + int _valueInt; /* The item's number, if type==JSON_NUMBER */ + float _valueFloat; /* The item's number, if type==JSON_NUMBER */ const char *_name; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ diff --git a/spine-cpp/include/spine/LinkedMesh.h b/spine-cpp/include/spine/LinkedMesh.h index cbf8f770b..3770ec45c 100644 --- a/spine-cpp/include/spine/LinkedMesh.h +++ b/spine-cpp/include/spine/LinkedMesh.h @@ -42,16 +42,14 @@ namespace spine { friend class SkeletonJson; public: - LinkedMesh(MeshAttachment *mesh, const int skinIndex, size_t slotIndex, const String &parent, - bool inheritTimelines); + LinkedMesh(MeshAttachment *mesh, const int skinIndex, size_t slotIndex, const String &parent, bool inheritTimelines); - LinkedMesh(MeshAttachment *mesh, const String &skin, size_t slotIndex, const String &parent, - bool inheritTimelines); + LinkedMesh(MeshAttachment *mesh, const String &skin, size_t slotIndex, const String &parent, bool inheritTimelines); private: MeshAttachment *_mesh; int _skinIndex; - String _skin; + String _skin; size_t _slotIndex; String _parent; bool _inheritTimelines; diff --git a/spine-cpp/include/spine/MathUtil.h b/spine-cpp/include/spine/MathUtil.h index ef8f46bfc..96e257dcd 100644 --- a/spine-cpp/include/spine/MathUtil.h +++ b/spine-cpp/include/spine/MathUtil.h @@ -46,15 +46,19 @@ namespace spine { public: static const float Pi; static const float Pi_2; - static const float InvPi_2; + static const float InvPi_2; static const float Deg_Rad; static const float Rad_Deg; template - static inline T min(T a, T b) { return a < b ? a : b; } + static inline T min(T a, T b) { + return a < b ? a : b; + } template - static inline T max(T a, T b) { return a > b ? a : b; } + static inline T max(T a, T b) { + return a > b ? a : b; + } static float sign(float val); @@ -78,7 +82,7 @@ namespace spine { /// degrees), largest error of 0.00488 radians (0.2796 degrees). static float atan2(float y, float x); - static float atan2Deg(float x, float y); + static float atan2Deg(float x, float y); static float acos(float v); @@ -88,7 +92,7 @@ namespace spine { static bool isNan(float v); - static float quietNan(); + static float quietNan(); static float random(); @@ -98,7 +102,7 @@ namespace spine { static float pow(float a, float b); - static float ceil(float v); + static float ceil(float v); }; } diff --git a/spine-cpp/include/spine/MeshAttachment.h b/spine-cpp/include/spine/MeshAttachment.h index b1be09aaa..a125df51f 100644 --- a/spine-cpp/include/spine/MeshAttachment.h +++ b/spine-cpp/include/spine/MeshAttachment.h @@ -46,7 +46,7 @@ namespace spine { friend class AtlasAttachmentLoader; - RTTI_DECL + RTTI_DECL public: explicit MeshAttachment(const String &name); @@ -56,7 +56,7 @@ namespace spine { using VertexAttachment::computeWorldVertices; virtual void computeWorldVertices(Skeleton &skeleton, Slot &slot, size_t start, size_t count, float *worldVertices, size_t offset, - size_t stride = 2) override; + size_t stride = 2) override; void updateRegion(); diff --git a/spine-cpp/include/spine/MixBlend.h b/spine-cpp/include/spine/MixBlend.h index 8265beb32..7fc4dda3f 100644 --- a/spine-cpp/include/spine/MixBlend.h +++ b/spine-cpp/include/spine/MixBlend.h @@ -34,28 +34,28 @@ namespace spine { /// Controls how timeline values are mixed with setup pose values or current pose values when a timeline is applied with /// alpha < 1. - /// + /// /// See Timeline::apply(). enum MixBlend { /// Transitions between the setup and timeline values (the current value is not used). Before the first frame, the setup /// value is used. - /// + /// /// MixBlend_Setup is intended to transition to or from the setup pose, not for animations layered on top of others. MixBlend_Setup = 0, /// Transitions between the current and timeline values. Before the first frame, transitions between the current and setup /// values. Timelines which perform instant transitions, such as DrawOrderTimeline or AttachmentTimeline, use /// the setup value before the first frame. - /// + /// /// MixBlend_First is intended for the first animations applied, not for animations layered on top of others. MixBlend_First, /// Transitions between the current and timeline values. No change is made before the first frame. - /// + /// /// MixBlend_Replace is intended for animations layered on top of others, not for the first animations applied. MixBlend_Replace, /// Transitions between the current value and the current plus timeline values. No change is made before the first frame. - /// + /// /// MixBlend_Add is intended for animations layered on top of others, not for the first animations applied. - /// + /// /// Properties set by additive animations must be set manually or by another animation before applying the additive /// animations, else the property values will increase each time the additive animations are applied. MixBlend_Add diff --git a/spine-cpp/include/spine/MixDirection.h b/spine-cpp/include/spine/MixDirection.h index 0ba09a5c9..47a3b4ba2 100644 --- a/spine-cpp/include/spine/MixDirection.h +++ b/spine-cpp/include/spine/MixDirection.h @@ -34,7 +34,7 @@ namespace spine { /// Indicates whether a timeline's alpha is mixing out over time toward 0 (the setup or current pose value) or /// mixing in toward 1 (the timeline's value). Some timelines use this to decide how values are applied. - /// + /// /// See Timeline::apply(). enum MixDirection { MixDirection_In = 0, diff --git a/spine-cpp/include/spine/PathAttachment.h b/spine-cpp/include/spine/PathAttachment.h index 2db13ed41..9653565cc 100644 --- a/spine-cpp/include/spine/PathAttachment.h +++ b/spine-cpp/include/spine/PathAttachment.h @@ -39,7 +39,7 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit PathAttachment(const String &name); diff --git a/spine-cpp/include/spine/PathConstraint.h b/spine-cpp/include/spine/PathConstraint.h index fcedb350a..85b431c7d 100644 --- a/spine-cpp/include/spine/PathConstraint.h +++ b/spine-cpp/include/spine/PathConstraint.h @@ -64,12 +64,12 @@ namespace spine { PathConstraint(PathConstraintData &data, Skeleton &skeleton); - PathConstraint* copy(Skeleton &skeleton); + PathConstraint *copy(Skeleton &skeleton); /// Applies the constraint to the constrained bones. - virtual void update(Skeleton& skeleton, Physics physics) override; + virtual void update(Skeleton &skeleton, Physics physics) override; - virtual void sort(Skeleton& skeleton) override; + virtual void sort(Skeleton &skeleton) override; virtual bool isSourceActive() override; @@ -84,7 +84,6 @@ namespace spine { virtual PathConstraintData &getData() override; - private: Array _bones; Slot *_slot; @@ -96,18 +95,18 @@ namespace spine { Array _lengths; Array _segments; - Array &computeWorldPositions(Skeleton& skeleton, PathAttachment &path, int spacesCount, bool tangents); + Array &computeWorldPositions(Skeleton &skeleton, PathAttachment &path, int spacesCount, bool tangents); void addBeforePosition(float p, Array &temp, int i, Array &output, int o); void addAfterPosition(float p, Array &temp, int i, Array &output, int o); - void addCurvePosition(float p, float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2, - Array &output, int o, bool tangents); + void addCurvePosition(float p, float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2, Array &output, + int o, bool tangents); - void sortPathSlot(Skeleton& skeleton, Skin& skin, int slotIndex, Bone& slotBone); + void sortPathSlot(Skeleton &skeleton, Skin &skin, int slotIndex, Bone &slotBone); - void sortPath(Skeleton& skeleton, Attachment* attachment, Bone& slotBone); + void sortPath(Skeleton &skeleton, Attachment *attachment, Bone &slotBone); }; } diff --git a/spine-cpp/include/spine/PathConstraintData.h b/spine-cpp/include/spine/PathConstraintData.h index 3b080bd3a..d2d4dde74 100644 --- a/spine-cpp/include/spine/PathConstraintData.h +++ b/spine-cpp/include/spine/PathConstraintData.h @@ -65,10 +65,9 @@ namespace spine { RTTI_DECL public: - explicit PathConstraintData(const String &name); - virtual Constraint* create(Skeleton& skeleton) override; + virtual Constraint *create(Skeleton &skeleton) override; /// The bones that will be modified by this path constraint. diff --git a/spine-cpp/include/spine/PathConstraintMixTimeline.h b/spine-cpp/include/spine/PathConstraintMixTimeline.h index eed33698c..f46e1b97a 100644 --- a/spine-cpp/include/spine/PathConstraintMixTimeline.h +++ b/spine-cpp/include/spine/PathConstraintMixTimeline.h @@ -42,16 +42,15 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit PathConstraintMixTimeline(size_t frameCount, size_t bezierCount, int constraintIndex); virtual ~PathConstraintMixTimeline(); - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, - MixDirection direction, bool appliedPose) override; + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) override; /// Sets the time and color for the specified frame. /// @param frame Between 0 and frameCount, inclusive. diff --git a/spine-cpp/include/spine/PathConstraintPose.h b/spine-cpp/include/spine/PathConstraintPose.h index 9b1bd6cc3..7ced81989 100644 --- a/spine-cpp/include/spine/PathConstraintPose.h +++ b/spine-cpp/include/spine/PathConstraintPose.h @@ -34,48 +34,48 @@ #include namespace spine { - /// Stores a pose for a path constraint. - class SP_API PathConstraintPose : public Pose { - friend class PathConstraint; - friend class PathConstraintPositionTimeline; - friend class PathConstraintSpacingTimeline; - friend class PathConstraintMixTimeline; - friend class SkeletonJson; - friend class SkeletonBinary; + /// Stores a pose for a path constraint. + class SP_API PathConstraintPose : public Pose { + friend class PathConstraint; + friend class PathConstraintPositionTimeline; + friend class PathConstraintSpacingTimeline; + friend class PathConstraintMixTimeline; + friend class SkeletonJson; + friend class SkeletonBinary; - private: - float _position; - float _spacing; - float _mixRotate; - float _mixX; - float _mixY; + private: + float _position; + float _spacing; + float _mixRotate; + float _mixX; + float _mixY; - public: - PathConstraintPose(); - virtual ~PathConstraintPose(); + public: + PathConstraintPose(); + virtual ~PathConstraintPose(); - virtual void set(PathConstraintPose& pose) override; + virtual void set(PathConstraintPose &pose) override; - /// The position along the path. - float getPosition(); - void setPosition(float position); + /// The position along the path. + float getPosition(); + void setPosition(float position); - /// The spacing between bones. - float getSpacing(); - void setSpacing(float spacing); + /// The spacing between bones. + float getSpacing(); + void setSpacing(float spacing); - /// A percentage (0-1) that controls the mix between the constrained and unconstrained rotation. - float getMixRotate(); - void setMixRotate(float mixRotate); + /// A percentage (0-1) that controls the mix between the constrained and unconstrained rotation. + float getMixRotate(); + void setMixRotate(float mixRotate); - /// A percentage (0-1) that controls the mix between the constrained and unconstrained translation X. - float getMixX(); - void setMixX(float mixX); + /// A percentage (0-1) that controls the mix between the constrained and unconstrained translation X. + float getMixX(); + void setMixX(float mixX); - /// A percentage (0-1) that controls the mix between the constrained and unconstrained translation Y. - float getMixY(); - void setMixY(float mixY); - }; + /// A percentage (0-1) that controls the mix between the constrained and unconstrained translation Y. + float getMixY(); + void setMixY(float mixY); + }; } #endif \ No newline at end of file diff --git a/spine-cpp/include/spine/PathConstraintPositionTimeline.h b/spine-cpp/include/spine/PathConstraintPositionTimeline.h index 477dffb11..1b66f99c6 100644 --- a/spine-cpp/include/spine/PathConstraintPositionTimeline.h +++ b/spine-cpp/include/spine/PathConstraintPositionTimeline.h @@ -40,7 +40,7 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: static const int ENTRIES; @@ -49,9 +49,8 @@ namespace spine { virtual ~PathConstraintPositionTimeline(); - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, - MixDirection direction, bool appliedPose) override; + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) override; }; } diff --git a/spine-cpp/include/spine/PathConstraintSpacingTimeline.h b/spine-cpp/include/spine/PathConstraintSpacingTimeline.h index 2171f30f9..fc7a7f666 100644 --- a/spine-cpp/include/spine/PathConstraintSpacingTimeline.h +++ b/spine-cpp/include/spine/PathConstraintSpacingTimeline.h @@ -39,16 +39,15 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit PathConstraintSpacingTimeline(size_t frameCount, size_t bezierCount, int constraintIndex); virtual ~PathConstraintSpacingTimeline(); - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, - MixDirection direction, bool appliedPose) override; + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) override; }; } diff --git a/spine-cpp/include/spine/Physics.h b/spine-cpp/include/spine/Physics.h index 138533854..84cbb3a97 100644 --- a/spine-cpp/include/spine/Physics.h +++ b/spine-cpp/include/spine/Physics.h @@ -31,20 +31,20 @@ #define Spine_Physics_h namespace spine { - /// Determines how physics and other non-deterministic updates are applied. - enum Physics { - /// Physics are not updated or applied. - Physics_None, + /// Determines how physics and other non-deterministic updates are applied. + enum Physics { + /// Physics are not updated or applied. + Physics_None, - /// Physics are reset to the current pose. - Physics_Reset, + /// Physics are reset to the current pose. + Physics_Reset, - /// Physics are updated and the pose from physics is applied. - Physics_Update, + /// Physics are updated and the pose from physics is applied. + Physics_Update, - /// Physics are not updated but the pose from physics is applied. - Physics_Pose - }; + /// Physics are not updated but the pose from physics is applied. + Physics_Pose + }; } #endif diff --git a/spine-cpp/include/spine/PhysicsConstraint.h b/spine-cpp/include/spine/PhysicsConstraint.h index 22d6d36dd..fc7335be1 100644 --- a/spine-cpp/include/spine/PhysicsConstraint.h +++ b/spine-cpp/include/spine/PhysicsConstraint.h @@ -59,14 +59,14 @@ namespace spine { public: RTTI_DECL - PhysicsConstraint(PhysicsConstraintData& data, Skeleton& skeleton); + PhysicsConstraint(PhysicsConstraintData &data, Skeleton &skeleton); - void update(Skeleton& skeleton, Physics physics) override; - void sort(Skeleton& skeleton) override; + void update(Skeleton &skeleton, Physics physics) override; + void sort(Skeleton &skeleton) override; bool isSourceActive() override; - PhysicsConstraint* copy(Skeleton& skeleton); + PhysicsConstraint *copy(Skeleton &skeleton); - void reset(Skeleton& skeleton); + void reset(Skeleton &skeleton); /// Translates the physics constraint so next update() forces are applied as if the bone moved an additional amount in world space. void translate(float x, float y); @@ -75,11 +75,11 @@ namespace spine { void rotate(float x, float y, float degrees); /// The bone constrained by this physics constraint. - BonePose& getBone(); - void setBone(BonePose& bone); + BonePose &getBone(); + void setBone(BonePose &bone); private: - BonePose* _bone; + BonePose *_bone; bool _reset; float _ux, _uy, _cx, _cy, _tx, _ty; diff --git a/spine-cpp/include/spine/PhysicsConstraintData.h b/spine-cpp/include/spine/PhysicsConstraintData.h index 2e9386922..209661e80 100644 --- a/spine-cpp/include/spine/PhysicsConstraintData.h +++ b/spine-cpp/include/spine/PhysicsConstraintData.h @@ -50,12 +50,12 @@ namespace spine { RTTI_DECL public: explicit PhysicsConstraintData(const String &name); - - virtual Constraint* create(Skeleton& skeleton) override; + + virtual Constraint *create(Skeleton &skeleton) override; /// The bone constrained by this physics constraint. - BoneData* getBone(); - void setBone(BoneData* bone); + BoneData *getBone(); + void setBone(BoneData *bone); float getStep(); void setStep(float step); @@ -100,7 +100,7 @@ namespace spine { void setMixGlobal(bool mixGlobal); private: - BoneData* _bone; + BoneData *_bone; float _x, _y, _rotate, _scaleX, _shearX, _limit, _step; bool _inertiaGlobal, _strengthGlobal, _dampingGlobal, _massGlobal, _windGlobal, _gravityGlobal, _mixGlobal; }; diff --git a/spine-cpp/include/spine/PhysicsConstraintPose.h b/spine-cpp/include/spine/PhysicsConstraintPose.h index ffed19d46..330179f0b 100644 --- a/spine-cpp/include/spine/PhysicsConstraintPose.h +++ b/spine-cpp/include/spine/PhysicsConstraintPose.h @@ -34,50 +34,50 @@ #include namespace spine { - /// Stores a pose for a physics constraint. - class SP_API PhysicsConstraintPose : public Pose { - friend class PhysicsConstraint; - friend class PhysicsConstraintTimeline; - friend class SkeletonJson; - friend class SkeletonBinary; + /// Stores a pose for a physics constraint. + class SP_API PhysicsConstraintPose : public Pose { + friend class PhysicsConstraint; + friend class PhysicsConstraintTimeline; + friend class SkeletonJson; + friend class SkeletonBinary; - private: - float _inertia; - float _strength; - float _damping; - float _massInverse; - float _wind; - float _gravity; - float _mix; + private: + float _inertia; + float _strength; + float _damping; + float _massInverse; + float _wind; + float _gravity; + float _mix; - public: - PhysicsConstraintPose(); - virtual ~PhysicsConstraintPose(); + public: + PhysicsConstraintPose(); + virtual ~PhysicsConstraintPose(); - virtual void set(PhysicsConstraintPose& pose) override; + virtual void set(PhysicsConstraintPose &pose) override; - float getInertia(); - void setInertia(float inertia); + float getInertia(); + void setInertia(float inertia); - float getStrength(); - void setStrength(float strength); + float getStrength(); + void setStrength(float strength); - float getDamping(); - void setDamping(float damping); + float getDamping(); + void setDamping(float damping); - float getMassInverse(); - void setMassInverse(float massInverse); + float getMassInverse(); + void setMassInverse(float massInverse); - float getWind(); - void setWind(float wind); + float getWind(); + void setWind(float wind); - float getGravity(); - void setGravity(float gravity); + float getGravity(); + void setGravity(float gravity); - /// A percentage (0-1) that controls the mix between the constrained and unconstrained poses. - float getMix(); - void setMix(float mix); - }; + /// A percentage (0-1) that controls the mix between the constrained and unconstrained poses. + float getMix(); + void setMix(float mix); + }; } #endif \ No newline at end of file diff --git a/spine-cpp/include/spine/PhysicsConstraintTimeline.h b/spine-cpp/include/spine/PhysicsConstraintTimeline.h index de5112f90..d6aa5f601 100644 --- a/spine-cpp/include/spine/PhysicsConstraintTimeline.h +++ b/spine-cpp/include/spine/PhysicsConstraintTimeline.h @@ -44,232 +44,243 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: /// @param constraintIndex -1 for all physics constraints in the skeleton. explicit PhysicsConstraintTimeline(size_t frameCount, size_t bezierCount, int constraintIndex, Property property); - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, - MixDirection direction, bool appliedPose) override; + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) override; - protected: - virtual float get(PhysicsConstraintPose &pose) = 0; - virtual void set(PhysicsConstraintPose &pose, float value) = 0; - virtual bool global(PhysicsConstraintData &constraintData) = 0; + protected: + virtual float get(PhysicsConstraintPose &pose) = 0; + virtual void set(PhysicsConstraintPose &pose, float value) = 0; + virtual bool global(PhysicsConstraintData &constraintData) = 0; private: int _constraintIndex; }; - /// Changes a physics constraint's PhysicsConstraintPose::getInertia(). - class SP_API PhysicsConstraintInertiaTimeline : public PhysicsConstraintTimeline { - friend class SkeletonBinary; + /// Changes a physics constraint's PhysicsConstraintPose::getInertia(). + class SP_API PhysicsConstraintInertiaTimeline : public PhysicsConstraintTimeline { + friend class SkeletonBinary; - friend class SkeletonJson; + friend class SkeletonJson; - RTTI_DECL + RTTI_DECL - public: - explicit PhysicsConstraintInertiaTimeline(size_t frameCount, size_t bezierCount, int physicsConstraintIndex): PhysicsConstraintTimeline(frameCount, bezierCount, physicsConstraintIndex, Property_PhysicsConstraintInertia) {}; + public: + explicit PhysicsConstraintInertiaTimeline(size_t frameCount, size_t bezierCount, int physicsConstraintIndex) + : PhysicsConstraintTimeline(frameCount, bezierCount, physicsConstraintIndex, Property_PhysicsConstraintInertia) {}; - protected: - float get(PhysicsConstraintPose &pose) override { - return pose.getInertia(); - } + protected: + float get(PhysicsConstraintPose &pose) override { + return pose.getInertia(); + } - void set(PhysicsConstraintPose &pose, float value) override { - pose.setInertia(value); - } + void set(PhysicsConstraintPose &pose, float value) override { + pose.setInertia(value); + } - bool global(PhysicsConstraintData &constraintData) override { - return constraintData.getInertiaGlobal(); - } - }; + bool global(PhysicsConstraintData &constraintData) override { + return constraintData.getInertiaGlobal(); + } + }; - /// Changes a physics constraint's PhysicsConstraintPose::getStrength(). - class SP_API PhysicsConstraintStrengthTimeline : public PhysicsConstraintTimeline { - friend class SkeletonBinary; + /// Changes a physics constraint's PhysicsConstraintPose::getStrength(). + class SP_API PhysicsConstraintStrengthTimeline : public PhysicsConstraintTimeline { + friend class SkeletonBinary; - friend class SkeletonJson; + friend class SkeletonJson; - RTTI_DECL + RTTI_DECL - public: - explicit PhysicsConstraintStrengthTimeline(size_t frameCount, size_t bezierCount, int physicsConstraintIndex): PhysicsConstraintTimeline(frameCount, bezierCount, physicsConstraintIndex, Property_PhysicsConstraintStrength) {}; + public: + explicit PhysicsConstraintStrengthTimeline(size_t frameCount, size_t bezierCount, int physicsConstraintIndex) + : PhysicsConstraintTimeline(frameCount, bezierCount, physicsConstraintIndex, Property_PhysicsConstraintStrength) {}; - protected: - float get(PhysicsConstraintPose &pose) override { - return pose.getStrength(); - } + protected: + float get(PhysicsConstraintPose &pose) override { + return pose.getStrength(); + } - void set(PhysicsConstraintPose &pose, float value) override { - pose.setStrength(value); - } + void set(PhysicsConstraintPose &pose, float value) override { + pose.setStrength(value); + } - bool global(PhysicsConstraintData &constraintData) override { - return constraintData.getStrengthGlobal(); - } - }; + bool global(PhysicsConstraintData &constraintData) override { + return constraintData.getStrengthGlobal(); + } + }; - /// Changes a physics constraint's PhysicsConstraintPose::getDamping(). - class SP_API PhysicsConstraintDampingTimeline : public PhysicsConstraintTimeline { - friend class SkeletonBinary; + /// Changes a physics constraint's PhysicsConstraintPose::getDamping(). + class SP_API PhysicsConstraintDampingTimeline : public PhysicsConstraintTimeline { + friend class SkeletonBinary; - friend class SkeletonJson; + friend class SkeletonJson; - RTTI_DECL + RTTI_DECL - public: - explicit PhysicsConstraintDampingTimeline(size_t frameCount, size_t bezierCount, int physicsConstraintIndex): PhysicsConstraintTimeline(frameCount, bezierCount, physicsConstraintIndex, Property_PhysicsConstraintDamping) {}; + public: + explicit PhysicsConstraintDampingTimeline(size_t frameCount, size_t bezierCount, int physicsConstraintIndex) + : PhysicsConstraintTimeline(frameCount, bezierCount, physicsConstraintIndex, Property_PhysicsConstraintDamping) {}; - protected: - float get(PhysicsConstraintPose &pose) override { - return pose.getDamping(); - } + protected: + float get(PhysicsConstraintPose &pose) override { + return pose.getDamping(); + } - void set(PhysicsConstraintPose &pose, float value) override { - pose.setDamping(value); - } + void set(PhysicsConstraintPose &pose, float value) override { + pose.setDamping(value); + } - bool global(PhysicsConstraintData &constraintData) override { - return constraintData.getDampingGlobal(); - } - }; + bool global(PhysicsConstraintData &constraintData) override { + return constraintData.getDampingGlobal(); + } + }; - /// Changes a physics constraint's PhysicsConstraintPose::getMassInverse(). The timeline values are not inverted. - class SP_API PhysicsConstraintMassTimeline : public PhysicsConstraintTimeline { - friend class SkeletonBinary; + /// Changes a physics constraint's PhysicsConstraintPose::getMassInverse(). The timeline values are not inverted. + class SP_API PhysicsConstraintMassTimeline : public PhysicsConstraintTimeline { + friend class SkeletonBinary; - friend class SkeletonJson; + friend class SkeletonJson; - RTTI_DECL + RTTI_DECL - public: - explicit PhysicsConstraintMassTimeline(size_t frameCount, size_t bezierCount, int physicsConstraintIndex): PhysicsConstraintTimeline(frameCount, bezierCount, physicsConstraintIndex, Property_PhysicsConstraintMass) {}; + public: + explicit PhysicsConstraintMassTimeline(size_t frameCount, size_t bezierCount, int physicsConstraintIndex) + : PhysicsConstraintTimeline(frameCount, bezierCount, physicsConstraintIndex, Property_PhysicsConstraintMass) {}; - protected: - float get(PhysicsConstraintPose &pose) override { - return 1 / pose.getMassInverse(); - } + protected: + float get(PhysicsConstraintPose &pose) override { + return 1 / pose.getMassInverse(); + } - void set(PhysicsConstraintPose &pose, float value) override { - pose.setMassInverse(1 / value); - } + void set(PhysicsConstraintPose &pose, float value) override { + pose.setMassInverse(1 / value); + } - bool global(PhysicsConstraintData &constraintData) override { - return constraintData.getMassGlobal(); - } - }; + bool global(PhysicsConstraintData &constraintData) override { + return constraintData.getMassGlobal(); + } + }; - /// Changes a physics constraint's PhysicsConstraintPose::getWind(). - class SP_API PhysicsConstraintWindTimeline : public PhysicsConstraintTimeline { - friend class SkeletonBinary; + /// Changes a physics constraint's PhysicsConstraintPose::getWind(). + class SP_API PhysicsConstraintWindTimeline : public PhysicsConstraintTimeline { + friend class SkeletonBinary; - friend class SkeletonJson; + friend class SkeletonJson; - RTTI_DECL + RTTI_DECL - public: - explicit PhysicsConstraintWindTimeline(size_t frameCount, size_t bezierCount, int physicsConstraintIndex): PhysicsConstraintTimeline(frameCount, bezierCount, physicsConstraintIndex, Property_PhysicsConstraintWind) {}; + public: + explicit PhysicsConstraintWindTimeline(size_t frameCount, size_t bezierCount, int physicsConstraintIndex) + : PhysicsConstraintTimeline(frameCount, bezierCount, physicsConstraintIndex, Property_PhysicsConstraintWind) {}; - protected: - float get(PhysicsConstraintPose &pose) override { - return pose.getWind(); - } + protected: + float get(PhysicsConstraintPose &pose) override { + return pose.getWind(); + } - void set(PhysicsConstraintPose &pose, float value) override { - pose.setWind(value); - } + void set(PhysicsConstraintPose &pose, float value) override { + pose.setWind(value); + } - bool global(PhysicsConstraintData &constraintData) override { - return constraintData.getWindGlobal(); - } - }; + bool global(PhysicsConstraintData &constraintData) override { + return constraintData.getWindGlobal(); + } + }; - /// Changes a physics constraint's PhysicsConstraintPose::getGravity(). - class SP_API PhysicsConstraintGravityTimeline : public PhysicsConstraintTimeline { - friend class SkeletonBinary; + /// Changes a physics constraint's PhysicsConstraintPose::getGravity(). + class SP_API PhysicsConstraintGravityTimeline : public PhysicsConstraintTimeline { + friend class SkeletonBinary; - friend class SkeletonJson; + friend class SkeletonJson; - RTTI_DECL + RTTI_DECL - public: - explicit PhysicsConstraintGravityTimeline(size_t frameCount, size_t bezierCount, int physicsConstraintIndex): PhysicsConstraintTimeline(frameCount, bezierCount, physicsConstraintIndex, Property_PhysicsConstraintGravity) {}; + public: + explicit PhysicsConstraintGravityTimeline(size_t frameCount, size_t bezierCount, int physicsConstraintIndex) + : PhysicsConstraintTimeline(frameCount, bezierCount, physicsConstraintIndex, Property_PhysicsConstraintGravity) {}; - protected: - float get(PhysicsConstraintPose &pose) override { - return pose.getGravity(); - } + protected: + float get(PhysicsConstraintPose &pose) override { + return pose.getGravity(); + } - void set(PhysicsConstraintPose &pose, float value) override { - pose.setGravity(value); - } + void set(PhysicsConstraintPose &pose, float value) override { + pose.setGravity(value); + } - bool global(PhysicsConstraintData &constraintData) override { - return constraintData.getGravityGlobal(); - } - }; + bool global(PhysicsConstraintData &constraintData) override { + return constraintData.getGravityGlobal(); + } + }; - /// Changes a physics constraint's PhysicsConstraintPose::getMix(). - class SP_API PhysicsConstraintMixTimeline : public PhysicsConstraintTimeline { - friend class SkeletonBinary; + /// Changes a physics constraint's PhysicsConstraintPose::getMix(). + class SP_API PhysicsConstraintMixTimeline : public PhysicsConstraintTimeline { + friend class SkeletonBinary; - friend class SkeletonJson; + friend class SkeletonJson; - RTTI_DECL + RTTI_DECL - public: - explicit PhysicsConstraintMixTimeline(size_t frameCount, size_t bezierCount, int physicsConstraintIndex): PhysicsConstraintTimeline(frameCount, bezierCount, physicsConstraintIndex, Property_PhysicsConstraintMix) {}; + public: + explicit PhysicsConstraintMixTimeline(size_t frameCount, size_t bezierCount, int physicsConstraintIndex) + : PhysicsConstraintTimeline(frameCount, bezierCount, physicsConstraintIndex, Property_PhysicsConstraintMix) {}; - protected: - float get(PhysicsConstraintPose &pose) override { - return pose.getMix(); - } + protected: + float get(PhysicsConstraintPose &pose) override { + return pose.getMix(); + } - void set(PhysicsConstraintPose &pose, float value) override { - pose.setMix(value); - } + void set(PhysicsConstraintPose &pose, float value) override { + pose.setMix(value); + } - bool global(PhysicsConstraintData &constraintData) override { - return constraintData.getMixGlobal(); - } - }; + bool global(PhysicsConstraintData &constraintData) override { + return constraintData.getMixGlobal(); + } + }; - /// Resets a physics constraint when specific animation times are reached. - class SP_API PhysicsConstraintResetTimeline : public Timeline, public ConstraintTimeline { - friend class SkeletonBinary; + /// Resets a physics constraint when specific animation times are reached. + class SP_API PhysicsConstraintResetTimeline : public Timeline, public ConstraintTimeline { + friend class SkeletonBinary; - friend class SkeletonJson; + friend class SkeletonJson; - RTTI_DECL + RTTI_DECL - public: - /// @param constraintIndex -1 for all physics constraints in the skeleton. - explicit PhysicsConstraintResetTimeline(size_t frameCount, int constraintIndex): Timeline(frameCount, 1), ConstraintTimeline(constraintIndex) { - PropertyId ids[] = {((PropertyId)Property_PhysicsConstraintReset) << 32}; - setPropertyIds(ids, 1); - } + public: + /// @param constraintIndex -1 for all physics constraints in the skeleton. + explicit PhysicsConstraintResetTimeline(size_t frameCount, int constraintIndex) + : Timeline(frameCount, 1), ConstraintTimeline(constraintIndex) { + PropertyId ids[] = {((PropertyId) Property_PhysicsConstraintReset) << 32}; + setPropertyIds(ids, 1); + } - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, - MixDirection direction, bool appliedPose) override; + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) override; - int getFrameCount() { return (int)_frames.size(); } + int getFrameCount() { + return (int) _frames.size(); + } - /// The index of the physics constraint in Skeleton::getConstraints() that will be reset when this timeline is - /// applied, or -1 if all physics constraints in the skeleton will be reset. - virtual int getConstraintIndex() override { return _constraintIndex; } + /// The index of the physics constraint in Skeleton::getConstraints() that will be reset when this timeline is + /// applied, or -1 if all physics constraints in the skeleton will be reset. + virtual int getConstraintIndex() override { + return _constraintIndex; + } - /// Sets the time for the specified frame. - void setFrame(int frame, float time) { - _frames[frame] = time; - } - private: - int _constraintIndex; - }; + /// Sets the time for the specified frame. + void setFrame(int frame, float time) { + _frames[frame] = time; + } + + private: + int _constraintIndex; + }; } #endif /* Spine_PhysicsConstraintTimeline_h */ diff --git a/spine-cpp/include/spine/PointAttachment.h b/spine-cpp/include/spine/PointAttachment.h index e25fd840c..c99addd85 100644 --- a/spine-cpp/include/spine/PointAttachment.h +++ b/spine-cpp/include/spine/PointAttachment.h @@ -48,7 +48,7 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit PointAttachment(const String &name); diff --git a/spine-cpp/include/spine/Pool.h b/spine-cpp/include/spine/Pool.h index d577ad721..53d095191 100644 --- a/spine-cpp/include/spine/Pool.h +++ b/spine-cpp/include/spine/Pool.h @@ -54,7 +54,7 @@ namespace spine { return ret; } else { - T *ret = new(__FILE__, __LINE__) T(); + T *ret = new (__FILE__, __LINE__) T(); return ret; } diff --git a/spine-cpp/include/spine/Pose.h b/spine-cpp/include/spine/Pose.h index 629e163f6..30f1e2477 100644 --- a/spine-cpp/include/spine/Pose.h +++ b/spine-cpp/include/spine/Pose.h @@ -33,15 +33,15 @@ #include namespace spine { - template - class SP_API Pose : public SpineObject { - public: - Pose() {}; - virtual ~Pose() {}; + template + class SP_API Pose : public SpineObject { + public: + Pose() {}; + virtual ~Pose() {}; - /// Sets the pose values. - virtual void set(P& pose) = 0; - }; + /// Sets the pose values. + virtual void set(P &pose) = 0; + }; } #endif \ No newline at end of file diff --git a/spine-cpp/include/spine/Posed.h b/spine-cpp/include/spine/Posed.h index 09a044f69..d85ba2775 100644 --- a/spine-cpp/include/spine/Posed.h +++ b/spine-cpp/include/spine/Posed.h @@ -36,8 +36,10 @@ namespace spine { class SP_API Posed { public: - Posed() {} - virtual ~Posed() {} + Posed() { + } + virtual ~Posed() { + } virtual void constrained() = 0; diff --git a/spine-cpp/include/spine/PosedActive.h b/spine-cpp/include/spine/PosedActive.h index 325632219..02bdef531 100644 --- a/spine-cpp/include/spine/PosedActive.h +++ b/spine-cpp/include/spine/PosedActive.h @@ -39,11 +39,17 @@ namespace spine { bool _active; public: - PosedActive() : _active(true) {} - virtual ~PosedActive() {} + PosedActive() : _active(true) { + } + virtual ~PosedActive() { + } - bool isActive() const { return _active; } - void setActive(bool active) { _active = active; } + bool isActive() const { + return _active; + } + void setActive(bool active) { + _active = active; + } }; } diff --git a/spine-cpp/include/spine/PosedData.h b/spine-cpp/include/spine/PosedData.h index c5714d161..beaba563f 100644 --- a/spine-cpp/include/spine/PosedData.h +++ b/spine-cpp/include/spine/PosedData.h @@ -34,103 +34,113 @@ #include namespace spine { - template - class Pose; + template + class Pose; - class SP_API PosedData : public SpineObject { - friend class SkeletonBinary; - friend class SkeletonJson; - friend class BoneTimeline1; - friend class BoneTimeline2; - friend class RotateTimeline; - friend class AttachmentTimeline; - friend class RGBATimeline; - friend class RGBTimeline; - friend class AlphaTimeline; - friend class RGBA2Timeline; - friend class RGB2Timeline; - friend class ScaleTimeline; - friend class ScaleXTimeline; - friend class ScaleYTimeline; - friend class ShearTimeline; - friend class ShearXTimeline; - friend class ShearYTimeline; - friend class TranslateTimeline; - friend class TranslateXTimeline; - friend class TranslateYTimeline; - friend class InheritTimeline; - friend class Skeleton; - friend class Slot; + class SP_API PosedData : public SpineObject { + friend class SkeletonBinary; + friend class SkeletonJson; + friend class BoneTimeline1; + friend class BoneTimeline2; + friend class RotateTimeline; + friend class AttachmentTimeline; + friend class RGBATimeline; + friend class RGBTimeline; + friend class AlphaTimeline; + friend class RGBA2Timeline; + friend class RGB2Timeline; + friend class ScaleTimeline; + friend class ScaleXTimeline; + friend class ScaleYTimeline; + friend class ShearTimeline; + friend class ShearXTimeline; + friend class ShearYTimeline; + friend class TranslateTimeline; + friend class TranslateXTimeline; + friend class TranslateYTimeline; + friend class InheritTimeline; + friend class Skeleton; + friend class Slot; - public: - PosedData(const String& name); - virtual ~PosedData(); + public: + PosedData(const String &name); + virtual ~PosedData(); - /// The constraint's name, which is unique across all constraints in the skeleton of the same type. - const String& getName() const { return _name; }; + /// The constraint's name, which is unique across all constraints in the skeleton of the same type. + const String &getName() const { + return _name; + }; - /// When true, Skeleton::updateWorldTransform(Physics) only updates this constraint if the Skeleton::getSkin() - /// contains this constraint. - /// - /// See Skin::getConstraints(). - bool getSkinRequired() const { return _skinRequired; }; - void setSkinRequired(bool skinRequired) { _skinRequired = skinRequired; }; + /// When true, Skeleton::updateWorldTransform(Physics) only updates this constraint if the Skeleton::getSkin() + /// contains this constraint. + /// + /// See Skin::getConstraints(). + bool getSkinRequired() const { + return _skinRequired; + }; + void setSkinRequired(bool skinRequired) { + _skinRequired = skinRequired; + }; - protected: - String _name; - bool _skinRequired; - }; + protected: + String _name; + bool _skinRequired; + }; - inline PosedData::PosedData(const String& name) : _name(name), _skinRequired(false) { - } + inline PosedData::PosedData(const String &name) : _name(name), _skinRequired(false) { + } - inline PosedData::~PosedData() { - } + inline PosedData::~PosedData() { + } - /// The base class for all constrained datas. - template - class SP_API PosedDataGeneric : public PosedData { - friend class SkeletonBinary; - friend class SkeletonJson; - friend class BoneTimeline1; - friend class BoneTimeline2; - friend class RotateTimeline; - friend class AttachmentTimeline; - friend class RGBATimeline; - friend class RGBTimeline; - friend class AlphaTimeline; - friend class RGBA2Timeline; - friend class RGB2Timeline; - friend class ScaleTimeline; - friend class ScaleXTimeline; - friend class ScaleYTimeline; - friend class ShearTimeline; - friend class ShearXTimeline; - friend class ShearYTimeline; - friend class TranslateTimeline; - friend class TranslateXTimeline; - friend class TranslateYTimeline; - friend class InheritTimeline; - friend class PhysicsConstraintTimeline; - friend class PhysicsConstraintInertiaTimeline; - friend class PhysicsConstraintStrengthTimeline; - friend class PhysicsConstraintDampingTimeline; - friend class PhysicsConstraintMassTimeline; - friend class PhysicsConstraintWindTimeline; - friend class PhysicsConstraintGravityTimeline; - friend class Slot; + /// The base class for all constrained datas. + template + class SP_API PosedDataGeneric : public PosedData { + friend class SkeletonBinary; + friend class SkeletonJson; + friend class BoneTimeline1; + friend class BoneTimeline2; + friend class RotateTimeline; + friend class AttachmentTimeline; + friend class RGBATimeline; + friend class RGBTimeline; + friend class AlphaTimeline; + friend class RGBA2Timeline; + friend class RGB2Timeline; + friend class ScaleTimeline; + friend class ScaleXTimeline; + friend class ScaleYTimeline; + friend class ShearTimeline; + friend class ShearXTimeline; + friend class ShearYTimeline; + friend class TranslateTimeline; + friend class TranslateXTimeline; + friend class TranslateYTimeline; + friend class InheritTimeline; + friend class PhysicsConstraintTimeline; + friend class PhysicsConstraintInertiaTimeline; + friend class PhysicsConstraintStrengthTimeline; + friend class PhysicsConstraintDampingTimeline; + friend class PhysicsConstraintMassTimeline; + friend class PhysicsConstraintWindTimeline; + friend class PhysicsConstraintGravityTimeline; + friend class Slot; - protected: - P _setup; + protected: + P _setup; - public: - PosedDataGeneric(const String& name): PosedData(name), _setup() { - } - virtual ~PosedDataGeneric() {}; + public: + PosedDataGeneric(const String &name) : PosedData(name), _setup() { + } + virtual ~PosedDataGeneric() {}; - P& getSetupPose() { return _setup; }; - const P& getSetupPose() const { return _setup; }; - }; + P &getSetupPose() { + return _setup; + }; + const P &getSetupPose() const { + return _setup; + }; + }; } #endif \ No newline at end of file diff --git a/spine-cpp/include/spine/PositionMode.h b/spine-cpp/include/spine/PositionMode.h index c1761a0b2..5736607ad 100644 --- a/spine-cpp/include/spine/PositionMode.h +++ b/spine-cpp/include/spine/PositionMode.h @@ -34,17 +34,20 @@ namespace spine { /// Controls how the first bone is positioned along the path. - /// + /// /// @see https://esotericsoftware.com/spine-path-constraints#Position-mode Position mode in the Spine User Guide. enum PositionMode { PositionMode_Fixed = 0, PositionMode_Percent }; - - inline PositionMode PositionMode_valueOf(const char* value) { - if (strcmp(value, "fixed") == 0) return PositionMode_Fixed; - else if (strcmp(value, "percent") == 0) return PositionMode_Percent; - else return PositionMode_Percent; // default + + inline PositionMode PositionMode_valueOf(const char *value) { + if (strcmp(value, "fixed") == 0) + return PositionMode_Fixed; + else if (strcmp(value, "percent") == 0) + return PositionMode_Percent; + else + return PositionMode_Percent;// default } } diff --git a/spine-cpp/include/spine/Property.h b/spine-cpp/include/spine/Property.h index ac7bfc689..978f5c7f5 100644 --- a/spine-cpp/include/spine/Property.h +++ b/spine-cpp/include/spine/Property.h @@ -40,7 +40,7 @@ namespace spine { Property_ScaleY = 1 << 4, Property_ShearX = 1 << 5, Property_ShearY = 1 << 6, - Property_Inherit = 1 << 7, + Property_Inherit = 1 << 7, Property_Rgb = 1 << 8, Property_Alpha = 1 << 9, Property_Rgb2 = 1 << 10, @@ -53,14 +53,14 @@ namespace spine { Property_PathConstraintPosition = 1 << 17, Property_PathConstraintSpacing = 1 << 18, Property_PathConstraintMix = 1 << 19, - Property_PhysicsConstraintInertia = 1 << 20, - Property_PhysicsConstraintStrength = 1 << 21, - Property_PhysicsConstraintDamping = 1 << 22, - Property_PhysicsConstraintMass = 1 << 23, - Property_PhysicsConstraintWind = 1 << 24, - Property_PhysicsConstraintGravity = 1 << 25, - Property_PhysicsConstraintMix = 1 << 26, - Property_PhysicsConstraintReset = 1 << 27, + Property_PhysicsConstraintInertia = 1 << 20, + Property_PhysicsConstraintStrength = 1 << 21, + Property_PhysicsConstraintDamping = 1 << 22, + Property_PhysicsConstraintMass = 1 << 23, + Property_PhysicsConstraintWind = 1 << 24, + Property_PhysicsConstraintGravity = 1 << 25, + Property_PhysicsConstraintMix = 1 << 26, + Property_PhysicsConstraintReset = 1 << 27, Property_Sequence = 1 << 28, Property_SliderTime = 1 << 29, Property_SliderMix = 1 << 30 diff --git a/spine-cpp/include/spine/RTTI.h b/spine-cpp/include/spine/RTTI.h index 35ce15975..43cdbe5ec 100644 --- a/spine-cpp/include/spine/RTTI.h +++ b/spine-cpp/include/spine/RTTI.h @@ -40,10 +40,7 @@ namespace spine { RTTI(const char *className, const RTTI &baseRTTI); // New constructor for multiple interfaces (up to 3) - RTTI(const char *className, const RTTI &baseRTTI, - const RTTI* interface1, - const RTTI* interface2 = 0, - const RTTI* interface3 = 0); + RTTI(const char *className, const RTTI &baseRTTI, const RTTI *interface1, const RTTI *interface2 = 0, const RTTI *interface3 = 0); const char *getClassName() const; @@ -59,31 +56,37 @@ namespace spine { const char *_className; const RTTI *_pBaseRTTI; - const RTTI *_interfaces[3]; // Support up to 3 interfaces + const RTTI *_interfaces[3];// Support up to 3 interfaces int _interfaceCount; }; } -#define RTTI_DECL_NOPARENT \ -public: \ -static const RTTI rtti; \ -virtual const RTTI& getRTTI() const; +#define RTTI_DECL_NOPARENT \ +public: \ + static const RTTI rtti; \ + virtual const RTTI &getRTTI() const; -#define RTTI_DECL \ -public: \ -static const RTTI rtti; \ -virtual const RTTI& getRTTI() const override; +#define RTTI_DECL \ +public: \ + static const RTTI rtti; \ + virtual const RTTI &getRTTI() const override; -#define RTTI_IMPL_NOPARENT(name) \ -const RTTI name::rtti(#name); \ -const RTTI& name::getRTTI() const { return rtti; } +#define RTTI_IMPL_NOPARENT(name) \ + const RTTI name::rtti(#name); \ + const RTTI &name::getRTTI() const { \ + return rtti; \ + } -#define RTTI_IMPL(name, parent) \ -const RTTI name::rtti(#name, parent::rtti); \ -const RTTI& name::getRTTI() const { return rtti; } +#define RTTI_IMPL(name, parent) \ + const RTTI name::rtti(#name, parent::rtti); \ + const RTTI &name::getRTTI() const { \ + return rtti; \ + } -#define RTTI_IMPL_MULTI(name, parent, ...) \ -const RTTI name::rtti(#name, parent::rtti, &__VA_ARGS__::rtti); \ -const RTTI& name::getRTTI() const { return rtti; } +#define RTTI_IMPL_MULTI(name, parent, ...) \ + const RTTI name::rtti(#name, parent::rtti, &__VA_ARGS__::rtti); \ + const RTTI &name::getRTTI() const { \ + return rtti; \ + } #endif /* Spine_RTTI_h */ diff --git a/spine-cpp/include/spine/RegionAttachment.h b/spine-cpp/include/spine/RegionAttachment.h index 33d52f5ef..bc8230548 100644 --- a/spine-cpp/include/spine/RegionAttachment.h +++ b/spine-cpp/include/spine/RegionAttachment.h @@ -50,7 +50,7 @@ namespace spine { friend class AtlasAttachmentLoader; - RTTI_DECL + RTTI_DECL public: explicit RegionAttachment(const String &name); diff --git a/spine-cpp/include/spine/RotateMode.h b/spine-cpp/include/spine/RotateMode.h index f159578df..7f9a717ac 100644 --- a/spine-cpp/include/spine/RotateMode.h +++ b/spine-cpp/include/spine/RotateMode.h @@ -34,7 +34,7 @@ namespace spine { /// Controls how bones are rotated, translated, and scaled to match the path. - /// + /// /// @see https://esotericsoftware.com/spine-path-constraints#Rotate-Mix Rotate mode in the Spine User Guide. enum RotateMode { RotateMode_Tangent = 0, @@ -43,12 +43,16 @@ namespace spine { /// doesn't affect other constrained bones. RotateMode_ChainScale }; - - inline RotateMode RotateMode_valueOf(const char* value) { - if (strcmp(value, "tangent") == 0) return RotateMode_Tangent; - else if (strcmp(value, "chain") == 0) return RotateMode_Chain; - else if (strcmp(value, "chainScale") == 0) return RotateMode_ChainScale; - else return RotateMode_Tangent; // default + + inline RotateMode RotateMode_valueOf(const char *value) { + if (strcmp(value, "tangent") == 0) + return RotateMode_Tangent; + else if (strcmp(value, "chain") == 0) + return RotateMode_Chain; + else if (strcmp(value, "chainScale") == 0) + return RotateMode_ChainScale; + else + return RotateMode_Tangent;// default } } diff --git a/spine-cpp/include/spine/RotateTimeline.h b/spine-cpp/include/spine/RotateTimeline.h index 086217fb3..84de7e99f 100644 --- a/spine-cpp/include/spine/RotateTimeline.h +++ b/spine-cpp/include/spine/RotateTimeline.h @@ -41,14 +41,13 @@ namespace spine { friend class AnimationState; - RTTI_DECL + RTTI_DECL public: explicit RotateTimeline(size_t frameCount, size_t bezierCount, int boneIndex); protected: - virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) override; + virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) override; }; } diff --git a/spine-cpp/include/spine/ScaleTimeline.h b/spine-cpp/include/spine/ScaleTimeline.h index 1b85bc3cd..759bf94d6 100644 --- a/spine-cpp/include/spine/ScaleTimeline.h +++ b/spine-cpp/include/spine/ScaleTimeline.h @@ -39,14 +39,13 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit ScaleTimeline(size_t frameCount, size_t bezierCount, int boneIndex); protected: - virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) override; + virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) override; }; /// Changes a bone's local BoneLocal::getScaleX(). @@ -55,14 +54,13 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit ScaleXTimeline(size_t frameCount, size_t bezierCount, int boneIndex); protected: - virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) override; + virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) override; }; /// Changes a bone's local BoneLocal::getScaleY(). @@ -71,14 +69,13 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit ScaleYTimeline(size_t frameCount, size_t bezierCount, int boneIndex); protected: - virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) override; + virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) override; }; } diff --git a/spine-cpp/include/spine/Sequence.h b/spine-cpp/include/spine/Sequence.h index e5bb7b8ed..347f1f5f3 100644 --- a/spine-cpp/include/spine/Sequence.h +++ b/spine-cpp/include/spine/Sequence.h @@ -45,36 +45,55 @@ namespace spine { class SP_API Sequence : public SpineObject { friend class SkeletonBinary; friend class SkeletonJson; + public: Sequence(int count); ~Sequence(); - Sequence* copy(); + Sequence *copy(); - void apply(SlotPose* slot, Attachment* attachment); + void apply(SlotPose *slot, Attachment *attachment); String &getPath(const String &basePath, int index); /// Returns a unique ID for this attachment. - int getId() { return _id; } + int getId() { + return _id; + } - void setId(int id) { _id = id; } + void setId(int id) { + _id = id; + } - int getStart() { return _start; } + int getStart() { + return _start; + } - void setStart(int start) { _start = start; } + void setStart(int start) { + _start = start; + } - int getDigits() { return _digits; } + int getDigits() { + return _digits; + } - void setDigits(int digits) { _digits = digits; } + void setDigits(int digits) { + _digits = digits; + } /// The index of the region to show for the setup pose. - int getSetupIndex() { return _setupIndex; } + int getSetupIndex() { + return _setupIndex; + } - void setSetupIndex(int setupIndex) { _setupIndex = setupIndex; } + void setSetupIndex(int setupIndex) { + _setupIndex = setupIndex; + } - Array &getRegions() { return _regions; } + Array &getRegions() { + return _regions; + } private: static int _nextID; diff --git a/spine-cpp/include/spine/SequenceTimeline.h b/spine-cpp/include/spine/SequenceTimeline.h index f71b70c6c..25bab0726 100644 --- a/spine-cpp/include/spine/SequenceTimeline.h +++ b/spine-cpp/include/spine/SequenceTimeline.h @@ -44,23 +44,24 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit SequenceTimeline(size_t frameCount, int slotIndex, Attachment *attachment); virtual ~SequenceTimeline(); - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, - MixDirection direction, bool appliedPose) override; + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) override; /// Sets the time, mode, index, and frame time for the specified frame. /// @param frame Between 0 and frameCount, inclusive. /// @param delay Seconds between frames. void setFrame(int frame, float time, SequenceMode mode, int index, float delay); - Attachment *getAttachment() { return (Attachment*)_attachment; } + Attachment *getAttachment() { + return (Attachment *) _attachment; + } protected: HasTextureRegion *_attachment; diff --git a/spine-cpp/include/spine/ShearTimeline.h b/spine-cpp/include/spine/ShearTimeline.h index b5ab1422c..b04af3e94 100644 --- a/spine-cpp/include/spine/ShearTimeline.h +++ b/spine-cpp/include/spine/ShearTimeline.h @@ -39,14 +39,13 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit ShearTimeline(size_t frameCount, size_t bezierCount, int boneIndex); protected: - virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) override; + virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) override; }; /// Changes a bone's local BoneLocal::getShearX(). @@ -55,14 +54,13 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit ShearXTimeline(size_t frameCount, size_t bezierCount, int boneIndex); protected: - virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) override; + virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) override; }; /// Changes a bone's local BoneLocal::getShearY(). @@ -71,14 +69,13 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit ShearYTimeline(size_t frameCount, size_t bezierCount, int boneIndex); protected: - virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) override; + virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) override; }; } diff --git a/spine-cpp/include/spine/SkeletonBinary.h b/spine-cpp/include/spine/SkeletonBinary.h index dec56fb56..ada33a220 100644 --- a/spine-cpp/include/spine/SkeletonBinary.h +++ b/spine-cpp/include/spine/SkeletonBinary.h @@ -125,9 +125,13 @@ namespace spine { SkeletonData *readSkeletonDataFile(const String &path); - void setScale(float scale) { _scale = scale; } + void setScale(float scale) { + _scale = scale; + } - const String &getError() const { return _error; } + const String &getError() const { + return _error; + } private: struct DataInput : public SpineObject { @@ -135,7 +139,9 @@ namespace spine { const unsigned char *end; SkeletonData *skeletonData; - DataInput(SkeletonData *skeletonData, const unsigned char *data, size_t length) : cursor(data), end(data + length), skeletonData(skeletonData) {} + DataInput(SkeletonData *skeletonData, const unsigned char *data, size_t length) + : cursor(data), end(data + length), skeletonData(skeletonData) { + } inline int read() { return readUnsignedByte(); @@ -234,8 +240,8 @@ namespace spine { Skin *readSkin(DataInput &input, SkeletonData &skeletonData, bool defaultSkin, bool nonessential); - Attachment *readAttachment(DataInput &input, Skin &skin, int slotIndex, const String &attachmentName, - SkeletonData &skeletonData, bool nonessential); + Attachment *readAttachment(DataInput &input, Skin &skin, int slotIndex, const String &attachmentName, SkeletonData &skeletonData, + bool nonessential); Sequence *readSequence(DataInput &input); @@ -251,9 +257,8 @@ namespace spine { void readTimeline(DataInput &input, Array &timelines, BoneTimeline2 &timeline, float scale); - void - setBezier(DataInput &input, CurveTimeline &timeline, int bezier, int frame, int value, float time1, float time2, - float value1, float value2, float scale); + void setBezier(DataInput &input, CurveTimeline &timeline, int bezier, int frame, int value, float time1, float time2, float value1, + float value2, float scale); }; }// namespace spine diff --git a/spine-cpp/include/spine/SkeletonBounds.h b/spine-cpp/include/spine/SkeletonBounds.h index b91617b2b..809397a62 100644 --- a/spine-cpp/include/spine/SkeletonBounds.h +++ b/spine-cpp/include/spine/SkeletonBounds.h @@ -81,18 +81,18 @@ namespace spine { /// Returns true if the polygon contains any part of the line segment. bool intersectsSegment(Polygon *polygon, float x1, float y1, float x2, float y2); - /// Returns the polygon for the given bounding box attachment or null if no - /// polygon can be found for the attachment. Requires a call to update() first. + /// Returns the polygon for the given bounding box attachment or null if no + /// polygon can be found for the attachment. Requires a call to update() first. Polygon *getPolygon(BoundingBoxAttachment *attachment); - /// Returns the bounding box for the given polygon or null. Requires a call to update() first. - BoundingBoxAttachment * getBoundingBox(Polygon *polygon); + /// Returns the bounding box for the given polygon or null. Requires a call to update() first. + BoundingBoxAttachment *getBoundingBox(Polygon *polygon); - /// Returns all polygons or an empty array. Requires a call to update() first. - Array &getPolygons(); + /// Returns all polygons or an empty array. Requires a call to update() first. + Array &getPolygons(); - /// Returns all bounding boxes. Requires a call to update() first. - Array &getBoundingBoxes(); + /// Returns all bounding boxes. Requires a call to update() first. + Array &getBoundingBoxes(); /// The left edge of the axis aligned bounding box. float getMinX(); @@ -113,7 +113,7 @@ namespace spine { float getHeight(); private: - Pool _polygonPool; + Pool _polygonPool; Array _boundingBoxes; Array _polygons; float _minX, _minY, _maxX, _maxY; diff --git a/spine-cpp/include/spine/SkeletonClipping.h b/spine-cpp/include/spine/SkeletonClipping.h index 1891b33d4..c9fb7de81 100644 --- a/spine-cpp/include/spine/SkeletonClipping.h +++ b/spine-cpp/include/spine/SkeletonClipping.h @@ -48,14 +48,11 @@ namespace spine { void clipEnd(); - bool - clipTriangles(float *vertices, unsigned short *triangles, size_t trianglesLength); + bool clipTriangles(float *vertices, unsigned short *triangles, size_t trianglesLength); - bool - clipTriangles(float *vertices, unsigned short *triangles, size_t trianglesLength, float *uvs, size_t stride); + bool clipTriangles(float *vertices, unsigned short *triangles, size_t trianglesLength, float *uvs, size_t stride); - bool - clipTriangles(Array &vertices, Array &triangles, Array &uvs, size_t stride); + bool clipTriangles(Array &vertices, Array &triangles, Array &uvs, size_t stride); bool isClipping(); @@ -78,8 +75,7 @@ namespace spine { /** Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping * area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list. */ - bool clip(float x1, float y1, float x2, float y2, float x3, float y3, Array *clippingArea, - Array *output); + bool clip(float x1, float y1, float x2, float y2, float x3, float y3, Array *clippingArea, Array *output); static void makeClockwise(Array &polygon); }; diff --git a/spine-cpp/include/spine/SkeletonData.h b/spine-cpp/include/spine/SkeletonData.h index 1da5a0941..a5fd92f03 100644 --- a/spine-cpp/include/spine/SkeletonData.h +++ b/spine-cpp/include/spine/SkeletonData.h @@ -51,14 +51,14 @@ namespace spine { class PathConstraintData; - class PhysicsConstraintData; + class PhysicsConstraintData; class ConstraintData; -/// Stores the setup pose and all of the stateless data for a skeleton. -/// -/// See Data objects in the Spine Runtimes -/// Guide. + /// Stores the setup pose and all of the stateless data for a skeleton. + /// + /// See Data objects in the Spine Runtimes + /// Guide. class SP_API SkeletonData : public SpineObject { friend class SkeletonBinary; @@ -123,11 +123,11 @@ namespace spine { /// @return May be NULL. template T *findConstraint(const String &constraintName) { - getConstraints(); // Ensure constraints array is populated + getConstraints();// Ensure constraints array is populated for (size_t i = 0, n = _constraints.size(); i < n; i++) { ConstraintData *constraint = _constraints[i]; if (constraint->getName() == constraintName && constraint->getRTTI().instanceOf(T::rtti)) { - return static_cast(constraint); + return static_cast(constraint); } } return NULL; @@ -153,11 +153,11 @@ namespace spine { void setHeight(float inValue); - /// Baseline scale factor for applying physics and other effects based on distance to non-scalable properties, such as angle or - /// scale. Default is 100. - float getReferenceScale(); + /// Baseline scale factor for applying physics and other effects based on distance to non-scalable properties, such as angle or + /// scale. Default is 100. + float getReferenceScale(); - void setReferenceScale(float inValue); + void setReferenceScale(float inValue); /// The Spine version used to export this data, or NULL. const String &getVersion(); @@ -186,15 +186,15 @@ namespace spine { private: String _name; - Array _bones; // Ordered parents first - Array _slots; // Setup pose draw order. + Array _bones;// Ordered parents first + Array _slots;// Setup pose draw order. Array _skins; Skin *_defaultSkin; Array _events; Array _animations; Array _constraints; float _x, _y, _width, _height; - float _referenceScale; + float _referenceScale; String _version; String _hash; Array _strings; diff --git a/spine-cpp/include/spine/SkeletonJson.h b/spine-cpp/include/spine/SkeletonJson.h index 54ba2561c..34e418d2f 100644 --- a/spine-cpp/include/spine/SkeletonJson.h +++ b/spine-cpp/include/spine/SkeletonJson.h @@ -77,9 +77,13 @@ namespace spine { SkeletonData *readSkeletonData(const char *json); - void setScale(float scale) { _scale = scale; } + void setScale(float scale) { + _scale = scale; + } - const String &getError() const { return _error; } + const String &getError() const { + return _error; + } private: AttachmentLoader *_attachmentLoader; @@ -90,20 +94,16 @@ namespace spine { static Sequence *readSequence(Json *sequence); - static void - setBezier(CurveTimeline *timeline, int frame, int value, int bezier, float time1, float value1, float cx1, - float cy1, - float cx2, float cy2, float time2, float value2); + static void setBezier(CurveTimeline *timeline, int frame, int value, int bezier, float time1, float value1, float cx1, float cy1, float cx2, + float cy2, float time2, float value2); - static int - readCurve(Json *curve, CurveTimeline *timeline, int bezier, int frame, int value, float time1, float time2, - float value1, float value2, float scale); + static int readCurve(Json *curve, CurveTimeline *timeline, int bezier, int frame, int value, float time1, float time2, float value1, + float value2, float scale); static void readTimeline(Array &timelines, Json *keyMap, CurveTimeline1 *timeline, float defaultValue, float scale); - static void - readTimeline(Array &timelines, Json *keyMap, CurveTimeline2 *timeline, const char *name1, const char *name2, float defaultValue, - float scale); + static void readTimeline(Array &timelines, Json *keyMap, CurveTimeline2 *timeline, const char *name1, const char *name2, + float defaultValue, float scale); Animation *readAnimation(Json *root, SkeletonData *skeletonData); diff --git a/spine-cpp/include/spine/SkeletonRenderer.h b/spine-cpp/include/spine/SkeletonRenderer.h index 72a50751c..244b521e9 100644 --- a/spine-cpp/include/spine/SkeletonRenderer.h +++ b/spine-cpp/include/spine/SkeletonRenderer.h @@ -35,35 +35,36 @@ #include namespace spine { - class Skeleton; + class Skeleton; - struct SP_API RenderCommand { - float *positions; - float *uvs; - uint32_t *colors; - uint32_t *darkColors; - int32_t numVertices; - uint16_t *indices; - int32_t numIndices; - BlendMode blendMode; - void *texture; - RenderCommand *next; - }; + struct SP_API RenderCommand { + float *positions; + float *uvs; + uint32_t *colors; + uint32_t *darkColors; + int32_t numVertices; + uint16_t *indices; + int32_t numIndices; + BlendMode blendMode; + void *texture; + RenderCommand *next; + }; - class SP_API SkeletonRenderer: public SpineObject { - public: - explicit SkeletonRenderer(); + class SP_API SkeletonRenderer : public SpineObject { + public: + explicit SkeletonRenderer(); - ~SkeletonRenderer(); + ~SkeletonRenderer(); - RenderCommand *render(Skeleton &skeleton); - private: - BlockAllocator _allocator; - Array _worldVertices; - Array _quadIndices; - SkeletonClipping _clipping; - Array _renderCommands; - }; + RenderCommand *render(Skeleton &skeleton); + + private: + BlockAllocator _allocator; + Array _worldVertices; + Array _quadIndices; + SkeletonClipping _clipping; + Array _renderCommands; + }; } #endif diff --git a/spine-cpp/include/spine/Skin.h b/spine-cpp/include/spine/Skin.h index 19e3169a8..deb0ab755 100644 --- a/spine-cpp/include/spine/Skin.h +++ b/spine-cpp/include/spine/Skin.h @@ -43,9 +43,9 @@ namespace spine { class ConstraintData; -/// Stores attachments by slot index and attachment name. -/// See SkeletonData::getDefaultSkin, Skeleton::getSkin, and -/// http://esotericsoftware.com/spine-runtime-skins in the Spine Runtimes Guide. + /// Stores attachments by slot index and attachment name. + /// See SkeletonData::getDefaultSkin, Skeleton::getSkin, and + /// http://esotericsoftware.com/spine-runtime-skins in the Spine Runtimes Guide. class SP_API Skin : public SpineObject { friend class Skeleton; @@ -59,10 +59,7 @@ namespace spine { String _name; Attachment *_attachment; - Entry(size_t slotIndex, const String &name, Attachment *attachment) : - _slotIndex(slotIndex), - _name(name), - _attachment(attachment) { + Entry(size_t slotIndex, const String &name, Attachment *attachment) : _slotIndex(slotIndex), _name(name), _attachment(attachment) { } }; @@ -89,11 +86,11 @@ namespace spine { } protected: - Entries(Array > &buckets) : _buckets(buckets), _slotIndex(0), _bucketIndex(0) { + Entries(Array> &buckets) : _buckets(buckets), _slotIndex(0), _bucketIndex(0) { } private: - Array > &_buckets; + Array> &_buckets; size_t _slotIndex; size_t _bucketIndex; }; @@ -110,10 +107,9 @@ namespace spine { AttachmentMap(); private: + int findInBucket(Array &, const String &attachmentName); - int findInBucket(Array &, const String &attachmentName); - - Array > _buckets; + Array> _buckets; }; explicit Skin(const String &name); @@ -133,7 +129,7 @@ namespace spine { /// Finds the skin keys for a given slot. The results are added to the passed array of names. /// @param slotIndex The target slotIndex. To find the slot index, use SkeletonData::findSlot and SlotData::getIndex. /// @param names Found skin key names will be added to this array. - void findNamesForSlot(size_t slotIndex, Array &names); + void findNamesForSlot(size_t slotIndex, Array &names); /// Finds the attachments for a given slot. The results are added to the passed array of Attachments. /// @param slotIndex The target slotIndex. To find the slot index, use SkeletonData::findSlot and SlotData::getIndex. @@ -154,14 +150,16 @@ namespace spine { Array &getConstraints(); - Color &getColor() { return _color; } + Color &getColor() { + return _color; + } private: const String _name; AttachmentMap _attachments; Array _bones; Array _constraints; - Color _color; + Color _color; /// Attach all attachments from this skin if the corresponding attachment from the old skin is currently attached. void attachAll(Skeleton &skeleton, Skin &oldSkin); diff --git a/spine-cpp/include/spine/Slider.h b/spine-cpp/include/spine/Slider.h index 666b0d21e..a760946fd 100644 --- a/spine-cpp/include/spine/Slider.h +++ b/spine-cpp/include/spine/Slider.h @@ -50,22 +50,22 @@ namespace spine { RTTI_DECL public: - Slider(SliderData& data, Skeleton& skeleton); + Slider(SliderData &data, Skeleton &skeleton); - Slider* copy(Skeleton& skeleton); + Slider *copy(Skeleton &skeleton); - virtual void update(Skeleton& skeleton, Physics physics) override; + virtual void update(Skeleton &skeleton, Physics physics) override; - virtual void sort(Skeleton& skeleton) override; + virtual void sort(Skeleton &skeleton) override; virtual bool isSourceActive() override; - Bone* getBone(); + Bone *getBone(); - void setBone(Bone* bone); + void setBone(Bone *bone); private: - Bone* _bone; + Bone *_bone; static float _offsets[6]; }; } diff --git a/spine-cpp/include/spine/SliderData.h b/spine-cpp/include/spine/SliderData.h index c8db306fa..4218c07f1 100644 --- a/spine-cpp/include/spine/SliderData.h +++ b/spine-cpp/include/spine/SliderData.h @@ -56,10 +56,10 @@ namespace spine { explicit SliderData(const String &name); /// Creates a slider instance. - virtual Constraint* create(Skeleton& skeleton) override; + virtual Constraint *create(Skeleton &skeleton) override; - Animation* getAnimation(); - void setAnimation(Animation* animation); + Animation *getAnimation(); + void setAnimation(Animation *animation); bool getAdditive(); void setAdditive(bool additive); @@ -67,11 +67,11 @@ namespace spine { bool getLoop(); void setLoop(bool loop); - BoneData* getBone(); - void setBone(BoneData* bone); + BoneData *getBone(); + void setBone(BoneData *bone); - FromProperty* getProperty(); - void setProperty(FromProperty* property); + FromProperty *getProperty(); + void setProperty(FromProperty *property); float getScale(); void setScale(float scale); @@ -83,11 +83,11 @@ namespace spine { void setLocal(bool local); private: - Animation* _animation; + Animation *_animation; bool _additive; bool _loop; - BoneData* _bone; - FromProperty* _property; + BoneData *_bone; + FromProperty *_property; float _offset; float _scale; bool _local; diff --git a/spine-cpp/include/spine/SliderMixTimeline.h b/spine-cpp/include/spine/SliderMixTimeline.h index c86937c5b..533c00f58 100644 --- a/spine-cpp/include/spine/SliderMixTimeline.h +++ b/spine-cpp/include/spine/SliderMixTimeline.h @@ -38,16 +38,15 @@ namespace spine { friend class SkeletonBinary; friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit SliderMixTimeline(size_t frameCount, size_t bezierCount, int sliderIndex); virtual ~SliderMixTimeline(); - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, - MixDirection direction, bool appliedPose) override; + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) override; }; } diff --git a/spine-cpp/include/spine/SliderPose.h b/spine-cpp/include/spine/SliderPose.h index cd6e9e5d6..04de5bbd1 100644 --- a/spine-cpp/include/spine/SliderPose.h +++ b/spine-cpp/include/spine/SliderPose.h @@ -34,31 +34,31 @@ #include namespace spine { - class Slider; + class Slider; - /// Stores a pose for a slider. - class SP_API SliderPose : public Pose { - friend class Slider; - friend class SliderMixTimeline; - friend class SliderTimeline; - friend class SkeletonJson; - friend class SkeletonBinary; + /// Stores a pose for a slider. + class SP_API SliderPose : public Pose { + friend class Slider; + friend class SliderMixTimeline; + friend class SliderTimeline; + friend class SkeletonJson; + friend class SkeletonBinary; - private: - float _time, _mix; + private: + float _time, _mix; - public: - SliderPose(); - virtual ~SliderPose(); + public: + SliderPose(); + virtual ~SliderPose(); - virtual void set(SliderPose& pose) override; + virtual void set(SliderPose &pose) override; - float getTime(); - void setTime(float time); + float getTime(); + void setTime(float time); - float getMix(); - void setMix(float mix); - }; + float getMix(); + void setMix(float mix); + }; } #endif \ No newline at end of file diff --git a/spine-cpp/include/spine/SliderTimeline.h b/spine-cpp/include/spine/SliderTimeline.h index 3b3e8358a..1431ff96f 100644 --- a/spine-cpp/include/spine/SliderTimeline.h +++ b/spine-cpp/include/spine/SliderTimeline.h @@ -38,16 +38,15 @@ namespace spine { friend class SkeletonBinary; friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit SliderTimeline(size_t frameCount, size_t bezierCount, int sliderIndex); virtual ~SliderTimeline(); - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, - MixDirection direction, bool appliedPose) override; + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) override; }; } diff --git a/spine-cpp/include/spine/SlotCurveTimeline.h b/spine-cpp/include/spine/SlotCurveTimeline.h index 4a44c7de4..596e14400 100644 --- a/spine-cpp/include/spine/SlotCurveTimeline.h +++ b/spine-cpp/include/spine/SlotCurveTimeline.h @@ -42,19 +42,19 @@ namespace spine { friend class SkeletonBinary; friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: SlotCurveTimeline(size_t frameCount, size_t frameEntries, size_t bezierCount, int slotIndex); virtual ~SlotCurveTimeline(); - virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, - MixBlend blend, MixDirection direction, bool appliedPose) override; + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) override; protected: /// Applies the timeline to the slot pose. - virtual void apply(Slot& slot, SlotPose& pose, float time, float alpha, MixBlend blend) = 0; + virtual void apply(Slot &slot, SlotPose &pose, float time, float alpha, MixBlend blend) = 0; }; } diff --git a/spine-cpp/include/spine/SlotData.h b/spine-cpp/include/spine/SlotData.h index ef63bc85d..373291131 100644 --- a/spine-cpp/include/spine/SlotData.h +++ b/spine-cpp/include/spine/SlotData.h @@ -65,18 +65,18 @@ namespace spine { friend class Slot; public: - SlotData(int index, const String& name, BoneData& boneData); + SlotData(int index, const String &name, BoneData &boneData); /// The index of the slot in Skeleton::getSlots(). int getIndex(); /// The bone this slot belongs to. - BoneData& getBoneData(); + BoneData &getBoneData(); - void setAttachmentName(const String& attachmentName); + void setAttachmentName(const String &attachmentName); /// The name of the attachment that is visible for this slot in the setup pose, or empty if no attachment is visible. - const String& getAttachmentName(); + const String &getAttachmentName(); /// The blend mode for drawing the slot's attachment. BlendMode getBlendMode(); @@ -88,7 +88,7 @@ namespace spine { private: const int _index; - BoneData& _boneData; + BoneData &_boneData; String _attachmentName; BlendMode _blendMode; bool _visible; diff --git a/spine-cpp/include/spine/SlotPose.h b/spine-cpp/include/spine/SlotPose.h index 16362ceee..ed77a56e5 100644 --- a/spine-cpp/include/spine/SlotPose.h +++ b/spine-cpp/include/spine/SlotPose.h @@ -58,7 +58,7 @@ namespace spine { Color _color; Color _darkColor; bool _hasDarkColor; - Attachment* _attachment; + Attachment *_attachment; int _sequenceIndex; Array _deform; @@ -66,15 +66,15 @@ namespace spine { SlotPose(); virtual ~SlotPose(); - virtual void set(SlotPose& pose) override; + virtual void set(SlotPose &pose) override; /// The color used to tint the slot's attachment. If getDarkColor() is set, this is used as the light color for two /// color tinting. - Color& getColor(); + Color &getColor(); /// The dark color used to tint the slot's attachment for two color tinting. The dark /// color's alpha is not used. - Color& getDarkColor(); + Color &getDarkColor(); /// Returns true if this slot has a dark color. bool hasDarkColor(); @@ -82,12 +82,12 @@ namespace spine { void setHasDarkColor(bool hasDarkColor); /// The current attachment for the slot, or null if the slot has no attachment. - Attachment* getAttachment(); + Attachment *getAttachment(); /// Sets the slot's attachment and, if the attachment changed, resets sequenceIndex and clears the deform. /// The deform is not cleared if the old attachment has the same VertexAttachment::getTimelineAttachment() as the /// specified attachment. - void setAttachment(Attachment* attachment); + void setAttachment(Attachment *attachment); /// The index of the texture region to display when the slot's attachment has a Sequence. -1 represents the /// Sequence::getSetupIndex(). @@ -98,7 +98,7 @@ namespace spine { /// weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions. /// /// See VertexAttachment::computeWorldVertices() and DeformTimeline. - Array& getDeform(); + Array &getDeform(); }; } diff --git a/spine-cpp/include/spine/SpacingMode.h b/spine-cpp/include/spine/SpacingMode.h index 546ff3cc3..bf8553e3e 100644 --- a/spine-cpp/include/spine/SpacingMode.h +++ b/spine-cpp/include/spine/SpacingMode.h @@ -34,7 +34,7 @@ namespace spine { /// Controls how bones after the first bone are positioned along the path. - /// + /// /// @see https://esotericsoftware.com/spine-path-constraints#Spacing-mode Spacing mode in the Spine User Guide. enum SpacingMode { SpacingMode_Length = 0, @@ -42,13 +42,18 @@ namespace spine { SpacingMode_Percent, SpacingMode_Proportional }; - - inline SpacingMode SpacingMode_valueOf(const char* value) { - if (strcmp(value, "length") == 0) return SpacingMode_Length; - else if (strcmp(value, "fixed") == 0) return SpacingMode_Fixed; - else if (strcmp(value, "percent") == 0) return SpacingMode_Percent; - else if (strcmp(value, "proportional") == 0) return SpacingMode_Proportional; - else return SpacingMode_Length; // default + + inline SpacingMode SpacingMode_valueOf(const char *value) { + if (strcmp(value, "length") == 0) + return SpacingMode_Length; + else if (strcmp(value, "fixed") == 0) + return SpacingMode_Fixed; + else if (strcmp(value, "percent") == 0) + return SpacingMode_Percent; + else if (strcmp(value, "proportional") == 0) + return SpacingMode_Proportional; + else + return SpacingMode_Length;// default } } diff --git a/spine-cpp/include/spine/SpineString.h b/spine-cpp/include/spine/SpineString.h index a34d2e1fc..99667e57f 100644 --- a/spine-cpp/include/spine/SpineString.h +++ b/spine-cpp/include/spine/SpineString.h @@ -190,39 +190,39 @@ namespace spine { bool startsWith(const String &needle) const { if (needle.length() > length()) return false; - for (int i = 0; i < (int)needle.length(); i++) { + for (int i = 0; i < (int) needle.length(); i++) { if (buffer()[i] != needle.buffer()[i]) return false; } return true; } - int lastIndexOf(const char c) const { - for (int i = (int)length() - 1; i >= 0; i--) { - if (buffer()[i] == c) return i; - } - return -1; - } + int lastIndexOf(const char c) const { + for (int i = (int) length() - 1; i >= 0; i--) { + if (buffer()[i] == c) return i; + } + return -1; + } - String substring(int startIndex, int length) const { - if (startIndex < 0 || startIndex >= (int)_length || length < 0 || startIndex + length > (int)_length) { - return String(); - } - char* subStr = SpineExtension::calloc(length + 1, __FILE__, __LINE__); - memcpy(subStr, _buffer + startIndex, length); - subStr[length] = '\0'; - return String(subStr, true, true); - } + String substring(int startIndex, int length) const { + if (startIndex < 0 || startIndex >= (int) _length || length < 0 || startIndex + length > (int) _length) { + return String(); + } + char *subStr = SpineExtension::calloc(length + 1, __FILE__, __LINE__); + memcpy(subStr, _buffer + startIndex, length); + subStr[length] = '\0'; + return String(subStr, true, true); + } - String substring(int startIndex) const { - if (startIndex < 0 || startIndex >= (int)_length) { - return String(); - } - int length = (int)_length - startIndex; - char* subStr = SpineExtension::calloc(length + 1, __FILE__, __LINE__); - memcpy(subStr, _buffer + startIndex, length); - subStr[length] = '\0'; - return String(subStr, true, true); - } + String substring(int startIndex) const { + if (startIndex < 0 || startIndex >= (int) _length) { + return String(); + } + int length = (int) _length - startIndex; + char *subStr = SpineExtension::calloc(length + 1, __FILE__, __LINE__); + memcpy(subStr, _buffer + startIndex, length); + subStr[length] = '\0'; + return String(subStr, true, true); + } friend bool operator==(const String &a, const String &b) { if (a._buffer == b._buffer) return true; @@ -252,4 +252,4 @@ namespace spine { } -#endif //SPINE_STRING_H +#endif//SPINE_STRING_H diff --git a/spine-cpp/include/spine/TextureRegion.h b/spine-cpp/include/spine/TextureRegion.h index 988f3f383..dd5c4abb9 100644 --- a/spine-cpp/include/spine/TextureRegion.h +++ b/spine-cpp/include/spine/TextureRegion.h @@ -41,24 +41,48 @@ namespace spine { friend class AtlasRegion; friend class SkeletonRenderer; - RTTI_DECL_NOPARENT + RTTI_DECL_NOPARENT public: - TextureRegion(): _rendererObject(nullptr), _u(0), _v(0), _u2(0), _v2(0), _regionWidth(0), _regionHeight(0) {}; + TextureRegion() : _rendererObject(nullptr), _u(0), _v(0), _u2(0), _v2(0), _regionWidth(0), _regionHeight(0) {}; ~TextureRegion() {}; - float getU() const { return _u; }; - void setU(float value) { _u = value; } - float getV() const { return _v; } - void setV(float value) { _v = value; } - float getU2() const { return _u2; } - void setU2(float value) { _u2 = value; } - float getV2() const { return _v2; } - void setV2(float value) { _v2 = value; } - int getRegionWidth() const { return _regionWidth; }; - void setRegionWidth(int value) { _regionWidth = value; } - int getRegionHeight() const { return _regionHeight; } - void setRegionHeight(int value) { _regionHeight = value; } + float getU() const { + return _u; + }; + void setU(float value) { + _u = value; + } + float getV() const { + return _v; + } + void setV(float value) { + _v = value; + } + float getU2() const { + return _u2; + } + void setU2(float value) { + _u2 = value; + } + float getV2() const { + return _v2; + } + void setV2(float value) { + _v2 = value; + } + int getRegionWidth() const { + return _regionWidth; + }; + void setRegionWidth(int value) { + _regionWidth = value; + } + int getRegionHeight() const { + return _regionHeight; + } + void setRegionHeight(int value) { + _regionHeight = value; + } private: void *_rendererObject; diff --git a/spine-cpp/include/spine/Timeline.h b/spine-cpp/include/spine/Timeline.h index ef8ec60f5..60151d6c8 100644 --- a/spine-cpp/include/spine/Timeline.h +++ b/spine-cpp/include/spine/Timeline.h @@ -43,7 +43,7 @@ namespace spine { class Event; class SP_API Timeline : public SpineObject { - RTTI_DECL_NOPARENT + RTTI_DECL_NOPARENT public: Timeline(size_t frameCount, size_t frameEntries); @@ -61,9 +61,8 @@ namespace spine { /// @param blend Controls how mixing is applied when alpha is than 1. /// @param direction Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions such as DrawOrderTimeline and AttachmentTimeline. /// @param appliedPose True to modify the applied pose. - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, - MixDirection direction, bool appliedPose) = 0; + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) = 0; size_t getFrameEntries(); @@ -73,12 +72,12 @@ namespace spine { float getDuration(); - virtual Array &getPropertyIds(); + virtual Array &getPropertyIds(); protected: void setPropertyIds(PropertyId propertyIds[], size_t propertyIdsCount); - Array _propertyIds; + Array _propertyIds; Array _frames; size_t _frameEntries; }; diff --git a/spine-cpp/include/spine/TransformConstraint.h b/spine-cpp/include/spine/TransformConstraint.h index 4c5e0a824..7a2d17e0f 100644 --- a/spine-cpp/include/spine/TransformConstraint.h +++ b/spine-cpp/include/spine/TransformConstraint.h @@ -44,31 +44,31 @@ namespace spine { friend class Skeleton; friend class TransformConstraintTimeline; - RTTI_DECL + RTTI_DECL public: - TransformConstraint(TransformConstraintData& data, Skeleton& skeleton); + TransformConstraint(TransformConstraintData &data, Skeleton &skeleton); - virtual TransformConstraint* copy(Skeleton& skeleton); + virtual TransformConstraint *copy(Skeleton &skeleton); /// Applies the constraint to the constrained bones. - void update(Skeleton& skeleton, Physics physics) override; + void update(Skeleton &skeleton, Physics physics) override; - void sort(Skeleton& skeleton) override; + void sort(Skeleton &skeleton) override; bool isSourceActive() override; /// The bones that will be modified by this transform constraint. - Array& getBones(); + Array &getBones(); /// The bone whose world transform will be copied to the constrained bones. - Bone* getSource(); + Bone *getSource(); - void setSource(Bone* source); + void setSource(Bone *source); private: - Array _bones; - Bone* _source; + Array _bones; + Bone *_source; }; } diff --git a/spine-cpp/include/spine/TransformConstraintData.h b/spine-cpp/include/spine/TransformConstraintData.h index 24d2513c2..d0592214a 100644 --- a/spine-cpp/include/spine/TransformConstraintData.h +++ b/spine-cpp/include/spine/TransformConstraintData.h @@ -47,6 +47,7 @@ namespace spine { /// Source property for a TransformConstraint. class SP_API FromProperty : public SpineObject { friend class SkeletonBinary; + public: RTTI_DECL_NOPARENT @@ -54,18 +55,19 @@ namespace spine { float _offset; /// Constrained properties. - Array _to; + Array _to; FromProperty(); virtual ~FromProperty(); /// Reads this property from the specified bone. - virtual float value(Skeleton& skeleton, BonePose& source, bool local, float* offsets) = 0; + virtual float value(Skeleton &skeleton, BonePose &source, bool local, float *offsets) = 0; }; /// Constrained property for a TransformConstraint. class SP_API ToProperty : public SpineObject { friend class SkeletonBinary; + public: RTTI_DECL_NOPARENT @@ -82,136 +84,160 @@ namespace spine { virtual ~ToProperty(); /// Reads the mix for this property from the specified pose. - virtual float mix(TransformConstraintPose& pose) = 0; + virtual float mix(TransformConstraintPose &pose) = 0; /// Applies the value to this property. - virtual void apply(Skeleton& skeleton, TransformConstraintPose& pose, BonePose& bone, float value, bool local, bool additive) = 0; + virtual void apply(Skeleton &skeleton, TransformConstraintPose &pose, BonePose &bone, float value, bool local, bool additive) = 0; }; class SP_API FromRotate : public FromProperty { public: RTTI_DECL - FromRotate() : FromProperty() {} - ~FromRotate() {} + FromRotate() : FromProperty() { + } + ~FromRotate() { + } - float value(Skeleton &skeleton, BonePose& source, bool local, float* offsets) override; + float value(Skeleton &skeleton, BonePose &source, bool local, float *offsets) override; }; class SP_API ToRotate : public ToProperty { public: RTTI_DECL - ToRotate() : ToProperty() {} - ~ToRotate() {} + ToRotate() : ToProperty() { + } + ~ToRotate() { + } - float mix(TransformConstraintPose& pose) override; - void apply(Skeleton &skeleton, TransformConstraintPose& pose, BonePose& bone, float value, bool local, bool additive) override; + float mix(TransformConstraintPose &pose) override; + void apply(Skeleton &skeleton, TransformConstraintPose &pose, BonePose &bone, float value, bool local, bool additive) override; }; class SP_API FromX : public FromProperty { public: RTTI_DECL - FromX() : FromProperty() {} - ~FromX() {} + FromX() : FromProperty() { + } + ~FromX() { + } - float value(Skeleton &skeleton, BonePose& source, bool local, float* offsets) override; + float value(Skeleton &skeleton, BonePose &source, bool local, float *offsets) override; }; class SP_API ToX : public ToProperty { public: RTTI_DECL - ToX() : ToProperty() {} - ~ToX() {} + ToX() : ToProperty() { + } + ~ToX() { + } - float mix(TransformConstraintPose& pose) override; - void apply(Skeleton &skeleton, TransformConstraintPose& pose, BonePose& bone, float value, bool local, bool additive) override; + float mix(TransformConstraintPose &pose) override; + void apply(Skeleton &skeleton, TransformConstraintPose &pose, BonePose &bone, float value, bool local, bool additive) override; }; class SP_API FromY : public FromProperty { public: RTTI_DECL - FromY() : FromProperty() {} - ~FromY() {} + FromY() : FromProperty() { + } + ~FromY() { + } - float value(Skeleton &skeleton, BonePose& source, bool local, float* offsets) override; + float value(Skeleton &skeleton, BonePose &source, bool local, float *offsets) override; }; class SP_API ToY : public ToProperty { public: RTTI_DECL - ToY() : ToProperty() {} - ~ToY() {} + ToY() : ToProperty() { + } + ~ToY() { + } - float mix(TransformConstraintPose& pose) override; - void apply(Skeleton &skeleton, TransformConstraintPose& pose, BonePose& bone, float value, bool local, bool additive) override; + float mix(TransformConstraintPose &pose) override; + void apply(Skeleton &skeleton, TransformConstraintPose &pose, BonePose &bone, float value, bool local, bool additive) override; }; class SP_API FromScaleX : public FromProperty { public: RTTI_DECL - FromScaleX() : FromProperty() {} - ~FromScaleX() {} + FromScaleX() : FromProperty() { + } + ~FromScaleX() { + } - float value(Skeleton &skeleton, BonePose& source, bool local, float* offsets) override; + float value(Skeleton &skeleton, BonePose &source, bool local, float *offsets) override; }; class SP_API ToScaleX : public ToProperty { public: RTTI_DECL - ToScaleX() : ToProperty() {} - ~ToScaleX() {} + ToScaleX() : ToProperty() { + } + ~ToScaleX() { + } - float mix(TransformConstraintPose& pose) override; - void apply(Skeleton &skeleton, TransformConstraintPose& pose, BonePose& bone, float value, bool local, bool additive) override; + float mix(TransformConstraintPose &pose) override; + void apply(Skeleton &skeleton, TransformConstraintPose &pose, BonePose &bone, float value, bool local, bool additive) override; }; class SP_API FromScaleY : public FromProperty { public: RTTI_DECL - FromScaleY() : FromProperty() {} - ~FromScaleY() {} + FromScaleY() : FromProperty() { + } + ~FromScaleY() { + } - float value(Skeleton &skeleton, BonePose& source, bool local, float* offsets) override; + float value(Skeleton &skeleton, BonePose &source, bool local, float *offsets) override; }; class SP_API ToScaleY : public ToProperty { public: RTTI_DECL - ToScaleY() : ToProperty() {} - ~ToScaleY() {} + ToScaleY() : ToProperty() { + } + ~ToScaleY() { + } - float mix(TransformConstraintPose& pose) override; - void apply(Skeleton &skeleton, TransformConstraintPose& pose, BonePose& bone, float value, bool local, bool additive) override; + float mix(TransformConstraintPose &pose) override; + void apply(Skeleton &skeleton, TransformConstraintPose &pose, BonePose &bone, float value, bool local, bool additive) override; }; class SP_API FromShearY : public FromProperty { public: RTTI_DECL - FromShearY() : FromProperty() {} - ~FromShearY() {} + FromShearY() : FromProperty() { + } + ~FromShearY() { + } - float value(Skeleton &skeleton, BonePose& source, bool local, float* offsets) override; + float value(Skeleton &skeleton, BonePose &source, bool local, float *offsets) override; }; class SP_API ToShearY : public ToProperty { public: RTTI_DECL - ToShearY() : ToProperty() {} - ~ToShearY() {} + ToShearY() : ToProperty() { + } + ~ToShearY() { + } - float mix(TransformConstraintPose& pose) override; - void apply(Skeleton &skeleton, TransformConstraintPose& pose, BonePose& bone, float value, bool local, bool additive) override; + float mix(TransformConstraintPose &pose) override; + void apply(Skeleton &skeleton, TransformConstraintPose &pose, BonePose &bone, float value, bool local, bool additive) override; }; /// Stores the setup pose for a TransformConstraint. @@ -231,14 +257,14 @@ namespace spine { explicit TransformConstraintData(const String &name); ~TransformConstraintData(); - virtual Constraint* create(Skeleton& skeleton) override; + virtual Constraint *create(Skeleton &skeleton) override; /// The bones that will be modified by this transform constraint. - Array& getBones(); + Array &getBones(); /// The bone whose world transform will be copied to the constrained bones. - BoneData* getSource(); - void setSource(BoneData* source); + BoneData *getSource(); + void setSource(BoneData *source); /// An offset added to the constrained bone rotation. float getOffsetRotation(); @@ -281,14 +307,14 @@ namespace spine { void setClamp(bool clamp); /// The mapping of transform properties to other transform properties. - Array& getProperties(); + Array &getProperties(); private: - Array _bones; - BoneData* _source; - float _offsets[6]; // [rotation, x, y, scaleX, scaleY, shearY] + Array _bones; + BoneData *_source; + float _offsets[6];// [rotation, x, y, scaleX, scaleY, shearY] bool _localSource, _localTarget, _additive, _clamp; - Array _properties; + Array _properties; }; } diff --git a/spine-cpp/include/spine/TransformConstraintPose.h b/spine-cpp/include/spine/TransformConstraintPose.h index ff4fff7c5..f96a4944d 100644 --- a/spine-cpp/include/spine/TransformConstraintPose.h +++ b/spine-cpp/include/spine/TransformConstraintPose.h @@ -34,60 +34,60 @@ #include namespace spine { - /// Stores a pose for a transform constraint. - class SP_API TransformConstraintPose : public Pose { - friend class FromProperty; - friend class ToProperty; - friend class FromRotate; - friend class ToRotate; - friend class FromX; - friend class ToX; - friend class FromY; - friend class ToY; - friend class FromScaleX; - friend class ToScaleX; - friend class FromScaleY; - friend class ToScaleY; - friend class FromShearY; - friend class ToShearY; - friend class TransformConstraint; - friend class TransformConstraintTimeline; - friend class SkeletonJson; - friend class SkeletonBinary; + /// Stores a pose for a transform constraint. + class SP_API TransformConstraintPose : public Pose { + friend class FromProperty; + friend class ToProperty; + friend class FromRotate; + friend class ToRotate; + friend class FromX; + friend class ToX; + friend class FromY; + friend class ToY; + friend class FromScaleX; + friend class ToScaleX; + friend class FromScaleY; + friend class ToScaleY; + friend class FromShearY; + friend class ToShearY; + friend class TransformConstraint; + friend class TransformConstraintTimeline; + friend class SkeletonJson; + friend class SkeletonBinary; - private: - float _mixRotate, _mixX, _mixY, _mixScaleX, _mixScaleY, _mixShearY; + private: + float _mixRotate, _mixX, _mixY, _mixScaleX, _mixScaleY, _mixShearY; - public: - TransformConstraintPose(); - virtual ~TransformConstraintPose(); + public: + TransformConstraintPose(); + virtual ~TransformConstraintPose(); - virtual void set(TransformConstraintPose& pose) override; + virtual void set(TransformConstraintPose &pose) override; - /// A percentage (0-1) that controls the mix between the constrained and unconstrained rotation. - float getMixRotate(); - void setMixRotate(float mixRotate); + /// A percentage (0-1) that controls the mix between the constrained and unconstrained rotation. + float getMixRotate(); + void setMixRotate(float mixRotate); - /// A percentage (0-1) that controls the mix between the constrained and unconstrained translation X. - float getMixX(); - void setMixX(float mixX); + /// A percentage (0-1) that controls the mix between the constrained and unconstrained translation X. + float getMixX(); + void setMixX(float mixX); - /// A percentage (0-1) that controls the mix between the constrained and unconstrained translation Y. - float getMixY(); - void setMixY(float mixY); + /// A percentage (0-1) that controls the mix between the constrained and unconstrained translation Y. + float getMixY(); + void setMixY(float mixY); - /// A percentage (0-1) that controls the mix between the constrained and unconstrained scale X. - float getMixScaleX(); - void setMixScaleX(float mixScaleX); + /// A percentage (0-1) that controls the mix between the constrained and unconstrained scale X. + float getMixScaleX(); + void setMixScaleX(float mixScaleX); - /// A percentage (0-1) that controls the mix between the constrained and unconstrained scale Y. - float getMixScaleY(); - void setMixScaleY(float mixScaleY); + /// A percentage (0-1) that controls the mix between the constrained and unconstrained scale Y. + float getMixScaleY(); + void setMixScaleY(float mixScaleY); - /// A percentage (0-1) that controls the mix between the constrained and unconstrained shear Y. - float getMixShearY(); - void setMixShearY(float mixShearY); - }; + /// A percentage (0-1) that controls the mix between the constrained and unconstrained shear Y. + float getMixShearY(); + void setMixShearY(float mixShearY); + }; } #endif \ No newline at end of file diff --git a/spine-cpp/include/spine/TransformConstraintTimeline.h b/spine-cpp/include/spine/TransformConstraintTimeline.h index 4587e729c..945606cc0 100644 --- a/spine-cpp/include/spine/TransformConstraintTimeline.h +++ b/spine-cpp/include/spine/TransformConstraintTimeline.h @@ -43,22 +43,20 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit TransformConstraintTimeline(size_t frameCount, size_t bezierCount, int transformConstraintIndex); virtual ~TransformConstraintTimeline(); - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, - MixDirection direction, bool appliedPose) override; + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) override; /// Sets the time, rotate mix, translate mix, scale mix, and shear mix for the specified frame. /// @param frame Between 0 and frameCount, inclusive. /// @param time The frame time in seconds. - void setFrame(int frame, float time, float mixRotate, float mixX, float mixY, float mixScaleX, - float mixScaleY, float mixShearY); + void setFrame(int frame, float time, float mixRotate, float mixX, float mixY, float mixScaleX, float mixScaleY, float mixShearY); private: static const int ENTRIES = 7; diff --git a/spine-cpp/include/spine/TranslateTimeline.h b/spine-cpp/include/spine/TranslateTimeline.h index 992f7906e..5b24789fe 100644 --- a/spine-cpp/include/spine/TranslateTimeline.h +++ b/spine-cpp/include/spine/TranslateTimeline.h @@ -40,14 +40,13 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit TranslateTimeline(size_t frameCount, size_t bezierCount, int boneIndex); protected: - virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) override; + virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) override; }; /// Changes a bone's local X translation. @@ -56,14 +55,13 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit TranslateXTimeline(size_t frameCount, size_t bezierCount, int boneIndex); protected: - virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) override; + virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) override; }; /// Changes a bone's local Y translation. @@ -72,14 +70,13 @@ namespace spine { friend class SkeletonJson; - RTTI_DECL + RTTI_DECL public: explicit TranslateYTimeline(size_t frameCount, size_t bezierCount, int boneIndex); protected: - virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) override; + virtual void apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) override; }; } diff --git a/spine-cpp/include/spine/Triangulator.h b/spine-cpp/include/spine/Triangulator.h index 31a2eb498..aa5a15400 100644 --- a/spine-cpp/include/spine/Triangulator.h +++ b/spine-cpp/include/spine/Triangulator.h @@ -40,24 +40,18 @@ namespace spine { Array &triangulate(Array &vertices); - Array* > & - decompose(Array - &vertices, - Array &triangles - ); + Array *> &decompose(Array &vertices, Array &triangles); private: - Array* > - _convexPolygons; - Array* > - _convexPolygonsIndices; + Array *> _convexPolygons; + Array *> _convexPolygonsIndices; Array _indices; Array _isConcaveArray; Array _triangles; - Pool > _polygonPool; - Pool > _polygonIndicesPool; + Pool> _polygonPool; + Pool> _polygonIndicesPool; static bool isConcave(int index, int vertexCount, Array &vertices, Array &indices); diff --git a/spine-cpp/include/spine/Update.h b/spine-cpp/include/spine/Update.h index 788dbc518..52fd951ec 100644 --- a/spine-cpp/include/spine/Update.h +++ b/spine-cpp/include/spine/Update.h @@ -46,7 +46,7 @@ namespace spine { virtual ~Update(); /// @param physics Determines how physics and other non-deterministic updates are applied. - virtual void update(Skeleton& skeleton, Physics physics) = 0; + virtual void update(Skeleton &skeleton, Physics physics) = 0; }; } diff --git a/spine-cpp/include/spine/VertexAttachment.h b/spine-cpp/include/spine/VertexAttachment.h index 6a0ad01ec..8bd8841a0 100644 --- a/spine-cpp/include/spine/VertexAttachment.h +++ b/spine-cpp/include/spine/VertexAttachment.h @@ -47,7 +47,7 @@ namespace spine { friend class DeformTimeline; - RTTI_DECL + RTTI_DECL public: explicit VertexAttachment(const String &name); @@ -66,10 +66,10 @@ namespace spine { /// @param offset The worldVertices index to begin writing values. /// @param stride The number of worldVertices entries between the value pairs written. virtual void computeWorldVertices(Skeleton &skeleton, Slot &slot, size_t start, size_t count, float *worldVertices, size_t offset, - size_t stride = 2); + size_t stride = 2); virtual void computeWorldVertices(Skeleton &skeleton, Slot &slot, size_t start, size_t count, Array &worldVertices, size_t offset, - size_t stride = 2); + size_t stride = 2); /// Gets a unique ID for this attachment. int getId(); @@ -86,14 +86,14 @@ namespace spine { void setWorldVerticesLength(size_t inValue); - Attachment * getTimelineAttachment(); + Attachment *getTimelineAttachment(); void setTimelineAttachment(Attachment *attachment); void copyTo(VertexAttachment *other); protected: - Array _bones; + Array _bones; Array _vertices; size_t _worldVerticesLength; Attachment *_timelineAttachment; diff --git a/spine-cpp/spine-cpp-lite/spine-cpp-lite.cpp b/spine-cpp/spine-cpp-lite/spine-cpp-lite.cpp index 2f28b2d58..1f65d1269 100644 --- a/spine-cpp/spine-cpp-lite/spine-cpp-lite.cpp +++ b/spine-cpp/spine-cpp-lite/spine-cpp-lite.cpp @@ -38,7 +38,7 @@ struct AnimationStateEvent { EventType type; TrackEntry *entry; Event *event; - AnimationStateEvent(EventType type, TrackEntry *entry, Event *event) : type(type), entry(entry), event(event){}; + AnimationStateEvent(EventType type, TrackEntry *entry, Event *event) : type(type), entry(entry), event(event) {}; }; struct EventListener : public AnimationStateListenerObject { @@ -211,7 +211,8 @@ class CallbackTextureLoad : public TextureLoader { spine_texture_loader_unload_func unloadCb; public: - CallbackTextureLoad() : loadCb(nullptr), unloadCb(nullptr) {} + CallbackTextureLoad() : loadCb(nullptr), unloadCb(nullptr) { + } void setCallbacks(spine_texture_loader_load_func load, spine_texture_loader_unload_func unload) { loadCb = load; @@ -229,7 +230,8 @@ public: CallbackTextureLoad callbackLoader; -spine_atlas spine_atlas_load_callback(const utf8 *atlasData, const utf8 *atlasDir, spine_texture_loader_load_func load, spine_texture_loader_unload_func unload) { +spine_atlas spine_atlas_load_callback(const utf8 *atlasData, const utf8 *atlasDir, spine_texture_loader_load_func load, + spine_texture_loader_unload_func unload) { if (!atlasData) return nullptr; int32_t length = (int32_t) strlen(atlasData); callbackLoader.setCallbacks(load, unload); @@ -815,7 +817,8 @@ void spine_animation_state_clear_track(spine_animation_state state, int32_t trac _state->clearTrack(trackIndex); } -spine_track_entry spine_animation_state_set_animation_by_name(spine_animation_state state, int32_t trackIndex, const utf8 *animationName, spine_bool loop) { +spine_track_entry spine_animation_state_set_animation_by_name(spine_animation_state state, int32_t trackIndex, const utf8 *animationName, + spine_bool loop) { if (state == nullptr) return nullptr; AnimationState *_state = (AnimationState *) state; return (spine_track_entry) _state->setAnimation(trackIndex, animationName, loop); @@ -827,13 +830,15 @@ spine_track_entry spine_animation_state_set_animation(spine_animation_state stat return (spine_track_entry) _state->setAnimation(trackIndex, (Animation *) animation, loop); } -spine_track_entry spine_animation_state_add_animation_by_name(spine_animation_state state, int32_t trackIndex, const utf8 *animationName, spine_bool loop, float delay) { +spine_track_entry spine_animation_state_add_animation_by_name(spine_animation_state state, int32_t trackIndex, const utf8 *animationName, + spine_bool loop, float delay) { if (state == nullptr) return nullptr; AnimationState *_state = (AnimationState *) state; return (spine_track_entry) _state->addAnimation(trackIndex, animationName, loop, delay); } -spine_track_entry spine_animation_state_add_animation(spine_animation_state state, int32_t trackIndex, spine_animation animation, spine_bool loop, float delay) { +spine_track_entry spine_animation_state_add_animation(spine_animation_state state, int32_t trackIndex, spine_animation animation, spine_bool loop, + float delay) { if (state == nullptr) return nullptr; AnimationState *_state = (AnimationState *) state; return (spine_track_entry) _state->addAnimation(trackIndex, (Animation *) animation, loop, delay); @@ -2030,7 +2035,8 @@ void spine_bone_update_world_transform(spine_bone bone) { _bone->updateWorldTransform(); } -void spine_bone_update_world_transform_with(spine_bone bone, float x, float y, float rotation, float scaleX, float scaleY, float shearX, float shearY) { +void spine_bone_update_world_transform_with(spine_bone bone, float x, float y, float rotation, float scaleX, float scaleY, float shearX, + float shearY) { if (bone == nullptr) return; Bone *_bone = (Bone *) bone; _bone->updateWorldTransform(x, y, rotation, scaleX, scaleY, shearX, shearY); @@ -4779,7 +4785,8 @@ spine_bounding_box_attachment spine_skeleton_bounds_contains_point_attachment(sp return (spine_bounding_box_attachment) ((SkeletonBounds *) bounds)->containsPoint(x, y); } -spine_bounding_box_attachment spine_skeleton_bounds_intersects_segment_attachment(spine_skeleton_bounds bounds, float x1, float y1, float x2, float y2) { +spine_bounding_box_attachment spine_skeleton_bounds_intersects_segment_attachment(spine_skeleton_bounds bounds, float x1, float y1, float x2, + float y2) { if (bounds == nullptr) return nullptr; return (spine_bounding_box_attachment) ((SkeletonBounds *) bounds)->intersectsSegment(x1, y1, x2, y2); } diff --git a/spine-cpp/spine-cpp-lite/spine-cpp-lite.h b/spine-cpp/spine-cpp-lite/spine-cpp-lite.h index 530afa421..37186e6a6 100644 --- a/spine-cpp/spine-cpp-lite/spine-cpp-lite.h +++ b/spine-cpp/spine-cpp-lite/spine-cpp-lite.h @@ -54,9 +54,9 @@ #endif #endif -#define SPINE_OPAQUE_TYPE(name) \ - typedef struct name##_wrapper { \ - } name##_wrapper; \ +#define SPINE_OPAQUE_TYPE(name) \ + typedef struct name##_wrapper { \ + } name##_wrapper; \ typedef name##_wrapper *name; // @start: opaque_types @@ -189,7 +189,7 @@ typedef enum spine_physics { typedef int32_t spine_bool; -typedef void* (*spine_texture_loader_load_func)(const char *path); +typedef void *(*spine_texture_loader_load_func)(const char *path); typedef void (*spine_texture_loader_unload_func)(void *texture); @@ -215,7 +215,8 @@ SPINE_CPP_LITE_EXPORT float spine_vector_get_y(spine_vector vector); SPINE_CPP_LITE_EXPORT spine_atlas spine_atlas_load(const utf8 *atlasData); // @ignore -SPINE_CPP_LITE_EXPORT spine_atlas spine_atlas_load_callback(const utf8 *atlasData, const utf8 *atlasDir, spine_texture_loader_load_func load, spine_texture_loader_unload_func unload); +SPINE_CPP_LITE_EXPORT spine_atlas spine_atlas_load_callback(const utf8 *atlasData, const utf8 *atlasDir, spine_texture_loader_load_func load, + spine_texture_loader_unload_func unload); SPINE_CPP_LITE_EXPORT int32_t spine_atlas_get_num_image_paths(spine_atlas atlas); SPINE_CPP_LITE_EXPORT utf8 *spine_atlas_get_image_path(spine_atlas atlas, int32_t index); SPINE_CPP_LITE_EXPORT spine_bool spine_atlas_is_pma(spine_atlas atlas); @@ -318,10 +319,13 @@ SPINE_CPP_LITE_EXPORT float spine_animation_get_duration(spine_animation animati SPINE_CPP_LITE_EXPORT spine_skeleton_data spine_animation_state_data_get_skeleton_data(spine_animation_state_data stateData); SPINE_CPP_LITE_EXPORT float spine_animation_state_data_get_default_mix(spine_animation_state_data stateData); SPINE_CPP_LITE_EXPORT void spine_animation_state_data_set_default_mix(spine_animation_state_data stateData, float defaultMix); -SPINE_CPP_LITE_EXPORT void spine_animation_state_data_set_mix(spine_animation_state_data stateData, spine_animation from, spine_animation to, float duration); +SPINE_CPP_LITE_EXPORT void spine_animation_state_data_set_mix(spine_animation_state_data stateData, spine_animation from, spine_animation to, + float duration); SPINE_CPP_LITE_EXPORT float spine_animation_state_data_get_mix(spine_animation_state_data stateData, spine_animation from, spine_animation to); -SPINE_CPP_LITE_EXPORT void spine_animation_state_data_set_mix_by_name(spine_animation_state_data stateData, const utf8 *fromName, const utf8 *toName, float duration); -SPINE_CPP_LITE_EXPORT float spine_animation_state_data_get_mix_by_name(spine_animation_state_data stateData, const utf8 *fromName, const utf8 *toName); +SPINE_CPP_LITE_EXPORT void spine_animation_state_data_set_mix_by_name(spine_animation_state_data stateData, const utf8 *fromName, const utf8 *toName, + float duration); +SPINE_CPP_LITE_EXPORT float spine_animation_state_data_get_mix_by_name(spine_animation_state_data stateData, const utf8 *fromName, + const utf8 *toName); SPINE_CPP_LITE_EXPORT void spine_animation_state_data_clear(spine_animation_state_data stateData); SPINE_CPP_LITE_EXPORT void spine_animation_state_update(spine_animation_state state, float delta); @@ -329,12 +333,17 @@ SPINE_CPP_LITE_EXPORT void spine_animation_state_apply(spine_animation_state sta SPINE_CPP_LITE_EXPORT void spine_animation_state_clear_tracks(spine_animation_state state); SPINE_CPP_LITE_EXPORT void spine_animation_state_clear_track(spine_animation_state state, int32_t trackIndex); SPINE_CPP_LITE_EXPORT int32_t spine_animation_state_get_num_tracks(spine_animation_state state); -SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_set_animation_by_name(spine_animation_state state, int32_t trackIndex, const utf8 *animationName, spine_bool loop); -SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_set_animation(spine_animation_state state, int32_t trackIndex, spine_animation animation, spine_bool loop); -SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_add_animation_by_name(spine_animation_state state, int32_t trackIndex, const utf8 *animationName, spine_bool loop, float delay); -SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_add_animation(spine_animation_state state, int32_t trackIndex, spine_animation animation, spine_bool loop, float delay); +SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_set_animation_by_name(spine_animation_state state, int32_t trackIndex, + const utf8 *animationName, spine_bool loop); +SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_set_animation(spine_animation_state state, int32_t trackIndex, + spine_animation animation, spine_bool loop); +SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_add_animation_by_name(spine_animation_state state, int32_t trackIndex, + const utf8 *animationName, spine_bool loop, float delay); +SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_add_animation(spine_animation_state state, int32_t trackIndex, + spine_animation animation, spine_bool loop, float delay); SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_set_empty_animation(spine_animation_state state, int32_t trackIndex, float mixDuration); -SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_add_empty_animation(spine_animation_state state, int32_t trackIndex, float mixDuration, float delay); +SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_add_empty_animation(spine_animation_state state, int32_t trackIndex, float mixDuration, + float delay); SPINE_CPP_LITE_EXPORT void spine_animation_state_set_empty_animations(spine_animation_state state, float mixDuration); // @optional SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_get_current(spine_animation_state state, int32_t trackIndex); @@ -425,7 +434,8 @@ SPINE_CPP_LITE_EXPORT spine_slot spine_skeleton_find_slot(spine_skeleton skeleto SPINE_CPP_LITE_EXPORT void spine_skeleton_set_skin_by_name(spine_skeleton skeleton, const utf8 *skinName); SPINE_CPP_LITE_EXPORT void spine_skeleton_set_skin(spine_skeleton skeleton, spine_skin skin); // @optional -SPINE_CPP_LITE_EXPORT spine_attachment spine_skeleton_get_attachment_by_name(spine_skeleton skeleton, const utf8 *slotName, const utf8 *attachmentName); +SPINE_CPP_LITE_EXPORT spine_attachment spine_skeleton_get_attachment_by_name(spine_skeleton skeleton, const utf8 *slotName, + const utf8 *attachmentName); // @optional SPINE_CPP_LITE_EXPORT spine_attachment spine_skeleton_get_attachment(spine_skeleton skeleton, int32_t slotIndex, const utf8 *attachmentName); SPINE_CPP_LITE_EXPORT void spine_skeleton_set_attachment(spine_skeleton skeleton, const utf8 *slotName, const utf8 *attachmentName); @@ -565,7 +575,8 @@ SPINE_CPP_LITE_EXPORT void spine_bone_set_is_y_down(spine_bool yDown); SPINE_CPP_LITE_EXPORT spine_bool spine_bone_get_is_y_down(); SPINE_CPP_LITE_EXPORT void spine_bone_update(spine_bone bone); SPINE_CPP_LITE_EXPORT void spine_bone_update_world_transform(spine_bone bone); -SPINE_CPP_LITE_EXPORT void spine_bone_update_world_transform_with(spine_bone bone, float x, float y, float rotation, float scaleX, float scaleY, float shearX, float shearY); +SPINE_CPP_LITE_EXPORT void spine_bone_update_world_transform_with(spine_bone bone, float x, float y, float rotation, float scaleX, float scaleY, + float shearX, float shearY); SPINE_CPP_LITE_EXPORT void spine_bone_update_applied_transform(spine_bone bone); SPINE_CPP_LITE_EXPORT void spine_bone_set_to_setup_pose(spine_bone bone); SPINE_CPP_LITE_EXPORT spine_vector spine_bone_world_to_local(spine_bone bone, float worldX, float worldY); @@ -1066,8 +1077,10 @@ SPINE_CPP_LITE_EXPORT spine_bool spine_skeleton_bounds_aabb_intersects_segment(s SPINE_CPP_LITE_EXPORT spine_bool spine_skeleton_bounds_aabb_intersects_skeleton(spine_skeleton_bounds bounds, spine_skeleton_bounds otherBounds); SPINE_CPP_LITE_EXPORT spine_bool spine_skeleton_bounds_contains_point(spine_skeleton_bounds bounds, spine_polygon polygon, float x, float y); SPINE_CPP_LITE_EXPORT spine_bounding_box_attachment spine_skeleton_bounds_contains_point_attachment(spine_skeleton_bounds bounds, float x, float y); -SPINE_CPP_LITE_EXPORT spine_bounding_box_attachment spine_skeleton_bounds_intersects_segment_attachment(spine_skeleton_bounds bounds, float x1, float y1, float x2, float y2); -SPINE_CPP_LITE_EXPORT spine_bool spine_skeleton_bounds_intersects_segment(spine_skeleton_bounds bounds, spine_polygon polygon, float x1, float y1, float x2, float y2); +SPINE_CPP_LITE_EXPORT spine_bounding_box_attachment spine_skeleton_bounds_intersects_segment_attachment(spine_skeleton_bounds bounds, float x1, + float y1, float x2, float y2); +SPINE_CPP_LITE_EXPORT spine_bool spine_skeleton_bounds_intersects_segment(spine_skeleton_bounds bounds, spine_polygon polygon, float x1, float y1, + float x2, float y2); SPINE_CPP_LITE_EXPORT spine_polygon spine_skeleton_bounds_get_polygon(spine_skeleton_bounds bounds, spine_bounding_box_attachment attachment); SPINE_CPP_LITE_EXPORT spine_bounding_box_attachment spine_skeleton_bounds_get_bounding_box(spine_skeleton_bounds bounds, spine_polygon polygon); SPINE_CPP_LITE_EXPORT int32_t spine_skeleton_bounds_get_num_polygons(spine_skeleton_bounds bounds); diff --git a/spine-cpp/src/spine/Animation.cpp b/spine-cpp/src/spine/Animation.cpp index 35b1db7a2..ac4a2b3cd 100644 --- a/spine-cpp/src/spine/Animation.cpp +++ b/spine-cpp/src/spine/Animation.cpp @@ -41,11 +41,8 @@ using namespace spine; -Animation::Animation(const String &name, Array &timelines, float duration) : _timelines(), - _timelineIds(), - _bones(), - _duration(duration), - _name(name) { +Animation::Animation(const String &name, Array &timelines, float duration) + : _timelines(), _timelineIds(), _bones(), _duration(duration), _name(name) { setTimelines(timelines); } @@ -60,8 +57,8 @@ Animation::~Animation() { ArrayUtils::deleteElements(_timelines); } -void Animation::apply(Skeleton &skeleton, float lastTime, float time, bool loop, Array *pEvents, float alpha, - MixBlend blend, MixDirection direction, bool appliedPose) { +void Animation::apply(Skeleton &skeleton, float lastTime, float time, bool loop, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) { if (loop && _duration != 0) { time = MathUtil::fmod(time, _duration); if (lastTime > 0) { diff --git a/spine-cpp/src/spine/AnimationState.cpp b/spine-cpp/src/spine/AnimationState.cpp index 9d9dc77e8..02f15b6d4 100644 --- a/spine-cpp/src/spine/AnimationState.cpp +++ b/spine-cpp/src/spine/AnimationState.cpp @@ -53,21 +53,24 @@ void dummyOnAnimationEventFunc(AnimationState *state, EventType type, TrackEntry SP_UNUSED(event); } -TrackEntry::TrackEntry() : _animation(NULL), _previous(NULL), _next(NULL), _mixingFrom(NULL), _mixingTo(0), - _trackIndex(0), _loop(false), _holdPrevious(false), _reverse(false), - _shortestRotation(false), - _eventThreshold(0), _mixAttachmentThreshold(0), _alphaAttachmentThreshold(0), _mixDrawOrderThreshold(0), _animationStart(0), - _animationEnd(0), _animationLast(0), _nextAnimationLast(0), _delay(0), _trackTime(0), - _trackLast(0), _nextTrackLast(0), _trackEnd(0), _timeScale(1.0f), _alpha(0), _mixTime(0), - _mixDuration(0), _interruptAlpha(0), _totalAlpha(0), _mixBlend(MixBlend_Replace), - _listener(dummyOnAnimationEventFunc), _listenerObject(NULL) { +TrackEntry::TrackEntry() + : _animation(NULL), _previous(NULL), _next(NULL), _mixingFrom(NULL), _mixingTo(0), _trackIndex(0), _loop(false), _holdPrevious(false), + _reverse(false), _shortestRotation(false), _eventThreshold(0), _mixAttachmentThreshold(0), _alphaAttachmentThreshold(0), + _mixDrawOrderThreshold(0), _animationStart(0), _animationEnd(0), _animationLast(0), _nextAnimationLast(0), _delay(0), _trackTime(0), + _trackLast(0), _nextTrackLast(0), _trackEnd(0), _timeScale(1.0f), _alpha(0), _mixTime(0), _mixDuration(0), _interruptAlpha(0), _totalAlpha(0), + _mixBlend(MixBlend_Replace), _listener(dummyOnAnimationEventFunc), _listenerObject(NULL) { } -TrackEntry::~TrackEntry() {} +TrackEntry::~TrackEntry() { +} -int TrackEntry::getTrackIndex() { return _trackIndex; } +int TrackEntry::getTrackIndex() { + return _trackIndex; +} -Animation *TrackEntry::getAnimation() { return _animation; } +Animation *TrackEntry::getAnimation() { + return _animation; +} void TrackEntry::setAnimation(Animation *animation) { if (animation == NULL) { @@ -76,25 +79,45 @@ void TrackEntry::setAnimation(Animation *animation) { _animation = animation; } -TrackEntry *TrackEntry::getPrevious() { return _previous; } +TrackEntry *TrackEntry::getPrevious() { + return _previous; +} -bool TrackEntry::getLoop() { return _loop; } +bool TrackEntry::getLoop() { + return _loop; +} -void TrackEntry::setLoop(bool inValue) { _loop = inValue; } +void TrackEntry::setLoop(bool inValue) { + _loop = inValue; +} -bool TrackEntry::getHoldPrevious() { return _holdPrevious; } +bool TrackEntry::getHoldPrevious() { + return _holdPrevious; +} -void TrackEntry::setHoldPrevious(bool inValue) { _holdPrevious = inValue; } +void TrackEntry::setHoldPrevious(bool inValue) { + _holdPrevious = inValue; +} -bool TrackEntry::getReverse() { return _reverse; } +bool TrackEntry::getReverse() { + return _reverse; +} -void TrackEntry::setReverse(bool inValue) { _reverse = inValue; } +void TrackEntry::setReverse(bool inValue) { + _reverse = inValue; +} -bool TrackEntry::getShortestRotation() { return _shortestRotation; } +bool TrackEntry::getShortestRotation() { + return _shortestRotation; +} -void TrackEntry::setShortestRotation(bool inValue) { _shortestRotation = inValue; } +void TrackEntry::setShortestRotation(bool inValue) { + _shortestRotation = inValue; +} -float TrackEntry::getDelay() { return _delay; } +float TrackEntry::getDelay() { + return _delay; +} void TrackEntry::setDelay(float inValue) { if (inValue < 0) { @@ -103,23 +126,41 @@ void TrackEntry::setDelay(float inValue) { _delay = inValue; } -float TrackEntry::getTrackTime() { return _trackTime; } +float TrackEntry::getTrackTime() { + return _trackTime; +} -void TrackEntry::setTrackTime(float inValue) { _trackTime = inValue; } +void TrackEntry::setTrackTime(float inValue) { + _trackTime = inValue; +} -float TrackEntry::getTrackEnd() { return _trackEnd; } +float TrackEntry::getTrackEnd() { + return _trackEnd; +} -void TrackEntry::setTrackEnd(float inValue) { _trackEnd = inValue; } +void TrackEntry::setTrackEnd(float inValue) { + _trackEnd = inValue; +} -float TrackEntry::getAnimationStart() { return _animationStart; } +float TrackEntry::getAnimationStart() { + return _animationStart; +} -void TrackEntry::setAnimationStart(float inValue) { _animationStart = inValue; } +void TrackEntry::setAnimationStart(float inValue) { + _animationStart = inValue; +} -float TrackEntry::getAnimationEnd() { return _animationEnd; } +float TrackEntry::getAnimationEnd() { + return _animationEnd; +} -void TrackEntry::setAnimationEnd(float inValue) { _animationEnd = inValue; } +void TrackEntry::setAnimationEnd(float inValue) { + _animationEnd = inValue; +} -float TrackEntry::getAnimationLast() { return _animationLast; } +float TrackEntry::getAnimationLast() { + return _animationLast; +} void TrackEntry::setAnimationLast(float inValue) { _animationLast = inValue; @@ -136,43 +177,77 @@ float TrackEntry::getAnimationTime() { return _animationEnd >= _animation->getDuration() ? animationTime : MathUtil::min(animationTime, _animationEnd); } -float TrackEntry::getTimeScale() { return _timeScale; } +float TrackEntry::getTimeScale() { + return _timeScale; +} -void TrackEntry::setTimeScale(float inValue) { _timeScale = inValue; } +void TrackEntry::setTimeScale(float inValue) { + _timeScale = inValue; +} -float TrackEntry::getAlpha() { return _alpha; } +float TrackEntry::getAlpha() { + return _alpha; +} -void TrackEntry::setAlpha(float inValue) { _alpha = inValue; } +void TrackEntry::setAlpha(float inValue) { + _alpha = inValue; +} -float TrackEntry::getEventThreshold() { return _eventThreshold; } +float TrackEntry::getEventThreshold() { + return _eventThreshold; +} -void TrackEntry::setEventThreshold(float inValue) { _eventThreshold = inValue; } +void TrackEntry::setEventThreshold(float inValue) { + _eventThreshold = inValue; +} -float TrackEntry::getMixAttachmentThreshold() { return _mixAttachmentThreshold; } +float TrackEntry::getMixAttachmentThreshold() { + return _mixAttachmentThreshold; +} -void TrackEntry::setMixAttachmentThreshold(float inValue) { _mixAttachmentThreshold = inValue; } +void TrackEntry::setMixAttachmentThreshold(float inValue) { + _mixAttachmentThreshold = inValue; +} -float TrackEntry::getAlphaAttachmentThreshold() { return _alphaAttachmentThreshold; } +float TrackEntry::getAlphaAttachmentThreshold() { + return _alphaAttachmentThreshold; +} -void TrackEntry::setAlphaAttachmentThreshold(float inValue) { _alphaAttachmentThreshold = inValue; } +void TrackEntry::setAlphaAttachmentThreshold(float inValue) { + _alphaAttachmentThreshold = inValue; +} -float TrackEntry::getMixDrawOrderThreshold() { return _mixDrawOrderThreshold; } +float TrackEntry::getMixDrawOrderThreshold() { + return _mixDrawOrderThreshold; +} -void TrackEntry::setMixDrawOrderThreshold(float inValue) { _mixDrawOrderThreshold = inValue; } +void TrackEntry::setMixDrawOrderThreshold(float inValue) { + _mixDrawOrderThreshold = inValue; +} -TrackEntry *TrackEntry::getNext() { return _next; } +TrackEntry *TrackEntry::getNext() { + return _next; +} bool TrackEntry::isComplete() { return _trackTime >= _animationEnd - _animationStart; } -float TrackEntry::getMixTime() { return _mixTime; } +float TrackEntry::getMixTime() { + return _mixTime; +} -void TrackEntry::setMixTime(float inValue) { _mixTime = inValue; } +void TrackEntry::setMixTime(float inValue) { + _mixTime = inValue; +} -float TrackEntry::getMixDuration() { return _mixDuration; } +float TrackEntry::getMixDuration() { + return _mixDuration; +} -void TrackEntry::setMixDuration(float inValue) { _mixDuration = inValue; } +void TrackEntry::setMixDuration(float inValue) { + _mixDuration = inValue; +} void TrackEntry::setMixDuration(float mixDuration, float delay) { _mixDuration = mixDuration; @@ -185,15 +260,21 @@ void TrackEntry::setMixDuration(float mixDuration, float delay) { this->_delay = delay; } -TrackEntry *TrackEntry::getMixingFrom() { return _mixingFrom; } +TrackEntry *TrackEntry::getMixingFrom() { + return _mixingFrom; +} -TrackEntry *TrackEntry::getMixingTo() { return _mixingTo; } +TrackEntry *TrackEntry::getMixingTo() { + return _mixingTo; +} void TrackEntry::setMixBlend(MixBlend blend) { _mixBlend = blend; } -MixBlend TrackEntry::getMixBlend() { return _mixBlend; } +MixBlend TrackEntry::getMixBlend() { + return _mixBlend; +} void TrackEntry::resetRotationDirections() { _timelinesRotation.clear(); @@ -243,9 +324,7 @@ bool TrackEntry::isEmptyAnimation() { return _animation == AnimationState::getEmptyAnimation(); } -EventQueueEntry::EventQueueEntry(EventType eventType, TrackEntry *trackEntry, Event *event) : _type(eventType), - _entry(trackEntry), - _event(event) { +EventQueueEntry::EventQueueEntry(EventType eventType, TrackEntry *trackEntry, Event *event) : _type(eventType), _entry(trackEntry), _event(event) { } EventQueue *EventQueue::newEventQueue(AnimationState &state) { @@ -256,8 +335,7 @@ EventQueueEntry EventQueue::newEventQueueEntry(EventType eventType, TrackEntry * return EventQueueEntry(eventType, entry, event); } -EventQueue::EventQueue(AnimationState &state) : _state(state), - _drainDisabled(false) { +EventQueue::EventQueue(AnimationState &state) : _state(state), _drainDisabled(false) { } EventQueue::~EventQueue() { @@ -308,26 +386,32 @@ void EventQueue::drain() { case EventType_Start: case EventType_Interrupt: case EventType_Complete: - if (!trackEntry->_listenerObject) trackEntry->_listener(&state, queueEntry._type, trackEntry, NULL); + if (!trackEntry->_listenerObject) + trackEntry->_listener(&state, queueEntry._type, trackEntry, NULL); else trackEntry->_listenerObject->callback(&state, queueEntry._type, trackEntry, NULL); - if (!state._listenerObject) state._listener(&state, queueEntry._type, trackEntry, NULL); + if (!state._listenerObject) + state._listener(&state, queueEntry._type, trackEntry, NULL); else state._listenerObject->callback(&state, queueEntry._type, trackEntry, NULL); break; case EventType_End: - if (!trackEntry->_listenerObject) trackEntry->_listener(&state, queueEntry._type, trackEntry, NULL); + if (!trackEntry->_listenerObject) + trackEntry->_listener(&state, queueEntry._type, trackEntry, NULL); else trackEntry->_listenerObject->callback(&state, queueEntry._type, trackEntry, NULL); - if (!state._listenerObject) state._listener(&state, queueEntry._type, trackEntry, NULL); + if (!state._listenerObject) + state._listener(&state, queueEntry._type, trackEntry, NULL); else state._listenerObject->callback(&state, queueEntry._type, trackEntry, NULL); /* Fall through. */ case EventType_Dispose: - if (!trackEntry->_listenerObject) trackEntry->_listener(&state, EventType_Dispose, trackEntry, NULL); + if (!trackEntry->_listenerObject) + trackEntry->_listener(&state, EventType_Dispose, trackEntry, NULL); else trackEntry->_listenerObject->callback(&state, EventType_Dispose, trackEntry, NULL); - if (!state._listenerObject) state._listener(&state, EventType_Dispose, trackEntry, NULL); + if (!state._listenerObject) + state._listener(&state, EventType_Dispose, trackEntry, NULL); else state._listenerObject->callback(&state, EventType_Dispose, trackEntry, NULL); @@ -338,7 +422,8 @@ void EventQueue::drain() { trackEntry->_listener(&state, queueEntry._type, trackEntry, queueEntry._event); else trackEntry->_listenerObject->callback(&state, queueEntry._type, trackEntry, queueEntry._event); - if (!state._listenerObject) state._listener(&state, queueEntry._type, trackEntry, queueEntry._event); + if (!state._listenerObject) + state._listener(&state, queueEntry._type, trackEntry, queueEntry._event); else state._listenerObject->callback(&state, queueEntry._type, trackEntry, queueEntry._event); break; @@ -349,14 +434,9 @@ void EventQueue::drain() { _drainDisabled = false; } -AnimationState::AnimationState(AnimationStateData *data) : _data(data), - _queue(EventQueue::newEventQueue(*this)), - _animationsChanged(false), - _listener(dummyOnAnimationEventFunc), - _listenerObject(NULL), - _unkeyedState(0), - _timeScale(1), - _manualTrackEntryDisposal(false) { +AnimationState::AnimationState(AnimationStateData *data) + : _data(data), _queue(EventQueue::newEventQueue(*this)), _animationsChanged(false), _listener(dummyOnAnimationEventFunc), _listenerObject(NULL), + _unkeyedState(0), _timeScale(1), _manualTrackEntryDisposal(false) { } AnimationState::~AnimationState() { @@ -411,8 +491,7 @@ void AnimationState::update(float delta) { float nextTime = current._trackLast - next->_delay; if (nextTime >= 0) { next->_delay = 0; - next->_trackTime += - current._timeScale == 0 ? 0 : (nextTime / current._timeScale + delta) * next->_timeScale; + next->_trackTime += current._timeScale == 0 ? 0 : (nextTime / current._timeScale + delta) * next->_timeScale; current._trackTime += currentDelta; setCurrent(i, next, true); while (next->_mixingFrom != NULL) { @@ -489,8 +568,7 @@ bool AnimationState::apply(Skeleton &skeleton) { for (size_t ii = 0; ii < timelineCount; ++ii) { Timeline *timeline = timelines[ii]; if (timeline->getRTTI().isExactly(AttachmentTimeline::rtti)) - applyAttachmentTimeline(static_cast(timeline), skeleton, applyTime, blend, - attachments); + applyAttachmentTimeline(static_cast(timeline), skeleton, applyTime, blend, attachments); else timeline->apply(skeleton, animationLast, applyTime, applyEvents, alpha, blend, MixDirection_In, false); } @@ -509,14 +587,12 @@ bool AnimationState::apply(Skeleton &skeleton) { MixBlend timelineBlend = timelineMode[ii] == Subsequent ? blend : MixBlend_Setup; if (!shortestRotation && timeline->getRTTI().isExactly(RotateTimeline::rtti)) - applyRotateTimeline(static_cast(timeline), skeleton, applyTime, alpha, - timelineBlend, timelinesRotation, ii << 1, firstFrame); + applyRotateTimeline(static_cast(timeline), skeleton, applyTime, alpha, timelineBlend, timelinesRotation, + ii << 1, firstFrame); else if (timeline->getRTTI().isExactly(AttachmentTimeline::rtti)) - applyAttachmentTimeline(static_cast(timeline), skeleton, applyTime, - blend, attachments); + applyAttachmentTimeline(static_cast(timeline), skeleton, applyTime, blend, attachments); else - timeline->apply(skeleton, animationLast, applyTime, applyEvents, alpha, timelineBlend, - MixDirection_In, false); + timeline->apply(skeleton, animationLast, applyTime, applyEvents, alpha, timelineBlend, MixDirection_In, false); } } @@ -544,8 +620,7 @@ bool AnimationState::apply(Skeleton &skeleton) { void AnimationState::clearTracks() { bool oldDrainDisabled = _queue->_drainDisabled; _queue->_drainDisabled = true; - for (size_t i = 0, n = _tracks.size(); i < n; ++i) - clearTrack(i); + for (size_t i = 0, n = _tracks.size(); i < n; ++i) clearTrack(i); _tracks.clear(); _queue->_drainDisabled = oldDrainDisabled; _queue->drain(); @@ -620,8 +695,7 @@ TrackEntry *AnimationState::addAnimation(size_t trackIndex, Animation *animation TrackEntry *last = expandToIndex(trackIndex); if (last != NULL) { - while (last->_next != NULL) - last = last->_next; + while (last->_next != NULL) last = last->_next; } TrackEntry *entry = newTrackEntry(trackIndex, animation, loop, last); @@ -725,18 +799,16 @@ Animation *AnimationState::getEmptyAnimation() { return &ret; } -void AnimationState::applyAttachmentTimeline(AttachmentTimeline *attachmentTimeline, Skeleton &skeleton, float time, - MixBlend blend, bool attachments) { +void AnimationState::applyAttachmentTimeline(AttachmentTimeline *attachmentTimeline, Skeleton &skeleton, float time, MixBlend blend, + bool attachments) { Slot *slot = skeleton.getSlots()[attachmentTimeline->getSlotIndex()]; if (!slot->getBone().isActive()) return; Array &frames = attachmentTimeline->getFrames(); if (time < frames[0]) { - if (blend == MixBlend_Setup || blend == MixBlend_First) - setAttachment(skeleton, *slot, slot->getData().getAttachmentName(), attachments); + if (blend == MixBlend_Setup || blend == MixBlend_First) setAttachment(skeleton, *slot, slot->getData().getAttachmentName(), attachments); } else { - setAttachment(skeleton, *slot, attachmentTimeline->getAttachmentNames()[Animation::search(frames, time)], - attachments); + setAttachment(skeleton, *slot, attachmentTimeline->getAttachmentNames()[Animation::search(frames, time)], attachments); } /* If an attachment wasn't set (ie before the first frame or attachments is false), set the setup attachment later.*/ @@ -744,8 +816,8 @@ void AnimationState::applyAttachmentTimeline(AttachmentTimeline *attachmentTimel } -void AnimationState::applyRotateTimeline(RotateTimeline *rotateTimeline, Skeleton &skeleton, float time, float alpha, - MixBlend blend, Array &timelinesRotation, size_t i, bool firstFrame) { +void AnimationState::applyRotateTimeline(RotateTimeline *rotateTimeline, Skeleton &skeleton, float time, float alpha, MixBlend blend, + Array &timelinesRotation, size_t i, bool firstFrame) { if (firstFrame) timelinesRotation[i] = 0; if (alpha == 1) { @@ -913,14 +985,12 @@ float AnimationState::applyMixingFrom(TrackEntry *to, Skeleton &skeleton, MixBle } from->_totalAlpha += alpha; if (!shortestRotation && (timeline->getRTTI().isExactly(RotateTimeline::rtti))) { - applyRotateTimeline((RotateTimeline *) timeline, skeleton, applyTime, alpha, timelineBlend, - timelinesRotation, i << 1, firstFrame); + applyRotateTimeline((RotateTimeline *) timeline, skeleton, applyTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame); } else if (timeline->getRTTI().isExactly(AttachmentTimeline::rtti)) { applyAttachmentTimeline(static_cast(timeline), skeleton, applyTime, timelineBlend, attachments && alpha >= from->_alphaAttachmentThreshold); } else { - if (drawOrder && timeline->getRTTI().isExactly(DrawOrderTimeline::rtti) && - timelineBlend == MixBlend_Setup) + if (drawOrder && timeline->getRTTI().isExactly(DrawOrderTimeline::rtti) && timelineBlend == MixBlend_Setup) direction = MixDirection_In; timeline->apply(skeleton, animationLast, applyTime, events, alpha, timelineBlend, direction, false); } @@ -939,8 +1009,7 @@ float AnimationState::applyMixingFrom(TrackEntry *to, Skeleton &skeleton, MixBle } void AnimationState::setAttachment(Skeleton &skeleton, Slot &slot, const String &attachmentName, bool attachments) { - slot._pose.setAttachment( - attachmentName.isEmpty() ? NULL : skeleton.getAttachment(slot.getData().getIndex(), attachmentName)); + slot._pose.setAttachment(attachmentName.isEmpty() ? NULL : skeleton.getAttachment(slot.getData().getIndex(), attachmentName)); if (attachments) slot._attachmentState = _unkeyedState + Current; } @@ -1005,8 +1074,7 @@ void AnimationState::setCurrent(size_t index, TrackEntry *current, bool interrup TrackEntry *AnimationState::expandToIndex(size_t index) { if (index < _tracks.size()) return _tracks[index]; - while (index >= _tracks.size()) - _tracks.add(NULL); + while (index >= _tracks.size()) _tracks.add(NULL); return NULL; } @@ -1067,8 +1135,7 @@ void AnimationState::animationsChanged() { TrackEntry *entry = _tracks[i]; if (!entry) continue; - while (entry->_mixingFrom != NULL) - entry = entry->_mixingFrom; + while (entry->_mixingFrom != NULL) entry = entry->_mixingFrom; do { if (entry->_mixingTo == NULL || entry->_mixBlend != MixBlend_Add) computeHold(entry); @@ -1102,8 +1169,7 @@ continue_outer: if (!_propertyIDs.addAll(ids, true)) { timelineMode[i] = Subsequent; } else { - if (to == NULL || timeline->getRTTI().isExactly(AttachmentTimeline::rtti) || - timeline->getRTTI().isExactly(DrawOrderTimeline::rtti) || + if (to == NULL || timeline->getRTTI().isExactly(AttachmentTimeline::rtti) || timeline->getRTTI().isExactly(DrawOrderTimeline::rtti) || timeline->getRTTI().isExactly(EventTimeline::rtti) || !to->_animation->hasTimeline(ids)) { timelineMode[i] = First; } else { diff --git a/spine-cpp/src/spine/Atlas.cpp b/spine-cpp/src/spine/Atlas.cpp index 2d8476270..b8fbff7a2 100644 --- a/spine-cpp/src/spine/Atlas.cpp +++ b/spine-cpp/src/spine/Atlas.cpp @@ -62,9 +62,7 @@ Atlas::Atlas(const String &path, TextureLoader *textureLoader, bool createTextur SpineExtension::free(dir, __FILE__, __LINE__); } -Atlas::Atlas(const char *data, int length, const char *dir, TextureLoader *textureLoader, bool createTexture) - : _textureLoader( - textureLoader) { +Atlas::Atlas(const char *data, int length, const char *dir, TextureLoader *textureLoader, bool createTexture) : _textureLoader(textureLoader) { load(data, length, dir, createTexture); } @@ -107,15 +105,13 @@ struct SimpleString { int length; SimpleString trim() { - while (isspace((unsigned char) *start) && start < end) - start++; + while (isspace((unsigned char) *start) && start < end) start++; if (start == end) { length = (int) (end - start); return *this; } end--; - while (((unsigned char) *end == '\r') && end >= start) - end--; + while (((unsigned char) *end == '\r') && end >= start) end--; end++; length = (int) (end - start); return *this; @@ -184,13 +180,13 @@ struct AtlasInput { int length; SimpleString line; - AtlasInput(const char *data, int length) : start(data), end(data + length), index((char *) data), length(length) {} + AtlasInput(const char *data, int length) : start(data), end(data + length), index((char *) data), length(length) { + } SimpleString *readLine() { if (index >= end) return 0; line.start = index; - while (index < end && *index != '\n') - index++; + while (index < end && *index != '\n') index++; line.end = index; if (index != end) index++; line = line.trim(); @@ -226,11 +222,9 @@ int indexOf(const char **array, int count, SimpleString *str) { } void Atlas::load(const char *begin, int length, const char *dir, bool createTexture) { - static const char *formatNames[] = {"", "Alpha", "Intensity", "LuminanceAlpha", "RGB565", "RGBA4444", "RGB888", - "RGBA8888"}; - static const char *textureFilterNames[] = {"", "Nearest", "Linear", "MipMap", "MipMapNearestNearest", - "MipMapLinearNearest", - "MipMapNearestLinear", "MipMapLinearLinear"}; + static const char *formatNames[] = {"", "Alpha", "Intensity", "LuminanceAlpha", "RGB565", "RGBA4444", "RGB888", "RGBA8888"}; + static const char *textureFilterNames[] = + {"", "Nearest", "Linear", "MipMap", "MipMapNearestNearest", "MipMapLinearNearest", "MipMapNearestLinear", "MipMapLinearLinear"}; int dirLength = (int) strlen(dir); int needsSlash = dirLength > 0 && dir[dirLength - 1] != '/' && dir[dirLength - 1] != '\\'; @@ -239,8 +233,7 @@ void Atlas::load(const char *begin, int length, const char *dir, bool createText AtlasPage *page = nullptr; SimpleString *line = reader.readLine(); - while (line != nullptr && line->length == 0) - line = reader.readLine(); + while (line != nullptr && line->length == 0) line = reader.readLine(); while (true) { if (line == nullptr || line->length == 0) break; diff --git a/spine-cpp/src/spine/AttachmentTimeline.cpp b/spine-cpp/src/spine/AttachmentTimeline.cpp index 25b7811d8..367f80861 100644 --- a/spine-cpp/src/spine/AttachmentTimeline.cpp +++ b/spine-cpp/src/spine/AttachmentTimeline.cpp @@ -43,8 +43,7 @@ using namespace spine; RTTI_IMPL_MULTI(AttachmentTimeline, Timeline, SlotTimeline) -AttachmentTimeline::AttachmentTimeline(size_t frameCount, int slotIndex) : Timeline(frameCount, 1), - SlotTimeline(slotIndex) { +AttachmentTimeline::AttachmentTimeline(size_t frameCount, int slotIndex) : Timeline(frameCount, 1), SlotTimeline(slotIndex) { PropertyId ids[] = {((PropertyId) Property_Attachment << 32) | slotIndex}; setPropertyIds(ids, 1); @@ -54,14 +53,15 @@ AttachmentTimeline::AttachmentTimeline(size_t frameCount, int slotIndex) : Timel } } -AttachmentTimeline::~AttachmentTimeline() {} +AttachmentTimeline::~AttachmentTimeline() { +} void AttachmentTimeline::setAttachment(Skeleton &skeleton, SlotPose &pose, String *attachmentName) { pose.setAttachment(attachmentName == NULL || attachmentName->isEmpty() ? NULL : skeleton.getAttachment(_slotIndex, *attachmentName)); } -void AttachmentTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, - MixBlend blend, MixDirection direction, bool appliedPose) { +void AttachmentTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); SP_UNUSED(alpha); diff --git a/spine-cpp/src/spine/Bone.cpp b/spine-cpp/src/spine/Bone.cpp index 0380d881f..1494bdff7 100644 --- a/spine-cpp/src/spine/Bone.cpp +++ b/spine-cpp/src/spine/Bone.cpp @@ -38,20 +38,14 @@ RTTI_IMPL(Bone, Update) bool Bone::yDown = true; -Bone::Bone(BoneData &data, Bone *parent) : PosedGeneric(data), - PosedActive(), - _parent(parent), - _children(), - _sorted(false) { +Bone::Bone(BoneData &data, Bone *parent) + : PosedGeneric(data), PosedActive(), _parent(parent), _children(), _sorted(false) { _constrained._bone = this; _applied->_bone = this; } -Bone::Bone(Bone &bone, Bone *parent) : PosedGeneric(bone._data), - PosedActive(), - _parent(parent), - _children(), - _sorted(false) { +Bone::Bone(Bone &bone, Bone *parent) + : PosedGeneric(bone._data), PosedActive(), _parent(parent), _children(), _sorted(false) { _constrained._bone = this; _applied->_bone = this; _pose.set(bone._pose); diff --git a/spine-cpp/src/spine/BoneData.cpp b/spine-cpp/src/spine/BoneData.cpp index a78ccbc5b..bf5a32c1d 100644 --- a/spine-cpp/src/spine/BoneData.cpp +++ b/spine-cpp/src/spine/BoneData.cpp @@ -33,13 +33,8 @@ using namespace spine; -BoneData::BoneData(int index, const String &name, BoneData *parent) : PosedDataGeneric(name), - _index(index), - _parent(parent), - _length(0), - _color(0.61f, 0.61f, 0.61f, 1.0f), - _icon(), - _visible(true) { +BoneData::BoneData(int index, const String &name, BoneData *parent) + : PosedDataGeneric(name), _index(index), _parent(parent), _length(0), _color(0.61f, 0.61f, 0.61f, 1.0f), _icon(), _visible(true) { assert(index >= 0); } diff --git a/spine-cpp/src/spine/BoneTimeline.cpp b/spine-cpp/src/spine/BoneTimeline.cpp index bd2c42985..b74a9aaa5 100644 --- a/spine-cpp/src/spine/BoneTimeline.cpp +++ b/spine-cpp/src/spine/BoneTimeline.cpp @@ -42,13 +42,14 @@ RTTI_IMPL_NOPARENT(BoneTimeline) RTTI_IMPL_MULTI(BoneTimeline1, CurveTimeline1, BoneTimeline) -BoneTimeline1::BoneTimeline1(size_t frameCount, size_t bezierCount, int boneIndex, Property property) : CurveTimeline1(frameCount, bezierCount), BoneTimeline(boneIndex) { +BoneTimeline1::BoneTimeline1(size_t frameCount, size_t bezierCount, int boneIndex, Property property) + : CurveTimeline1(frameCount, bezierCount), BoneTimeline(boneIndex) { PropertyId ids[] = {((PropertyId) property << 32) | boneIndex}; setPropertyIds(ids, 1); } -void BoneTimeline1::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, - MixBlend blend, MixDirection direction, bool appliedPose) { +void BoneTimeline1::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); @@ -60,13 +61,14 @@ void BoneTimeline1::apply(Skeleton &skeleton, float lastTime, float time, Array< RTTI_IMPL_MULTI(BoneTimeline2, CurveTimeline2, BoneTimeline) -BoneTimeline2::BoneTimeline2(size_t frameCount, size_t bezierCount, int boneIndex, Property property1, Property property2) : CurveTimeline2(frameCount, bezierCount), BoneTimeline(boneIndex) { +BoneTimeline2::BoneTimeline2(size_t frameCount, size_t bezierCount, int boneIndex, Property property1, Property property2) + : CurveTimeline2(frameCount, bezierCount), BoneTimeline(boneIndex) { PropertyId ids[] = {((PropertyId) property1 << 32) | boneIndex, ((PropertyId) property2 << 32) | boneIndex}; setPropertyIds(ids, 2); } -void BoneTimeline2::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, - MixBlend blend, MixDirection direction, bool appliedPose) { +void BoneTimeline2::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); diff --git a/spine-cpp/src/spine/ColorTimeline.cpp b/spine-cpp/src/spine/ColorTimeline.cpp index a0b525e3e..4a2379ae7 100644 --- a/spine-cpp/src/spine/ColorTimeline.cpp +++ b/spine-cpp/src/spine/ColorTimeline.cpp @@ -42,10 +42,8 @@ using namespace spine; RTTI_IMPL(RGBATimeline, SlotCurveTimeline) -RGBATimeline::RGBATimeline(size_t frameCount, size_t bezierCount, int slotIndex) - : SlotCurveTimeline(frameCount, ENTRIES, bezierCount, slotIndex) { - PropertyId ids[] = {((PropertyId) Property_Rgb << 32) | slotIndex, - ((PropertyId) Property_Alpha << 32) | slotIndex}; +RGBATimeline::RGBATimeline(size_t frameCount, size_t bezierCount, int slotIndex) : SlotCurveTimeline(frameCount, ENTRIES, bezierCount, slotIndex) { + PropertyId ids[] = {((PropertyId) Property_Rgb << 32) | slotIndex, ((PropertyId) Property_Alpha << 32) | slotIndex}; setPropertyIds(ids, 2); } @@ -70,8 +68,7 @@ void RGBATimeline::apply(Slot &slot, SlotPose &pose, float time, float alpha, Mi color.set(setup); return; case MixBlend_First: - color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, - (setup.b - color.b) * alpha, (setup.a - color.a) * alpha); + color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha); return; default: return; @@ -115,15 +112,13 @@ void RGBATimeline::apply(Slot &slot, SlotPose &pose, float time, float alpha, Mi color.set(r, g, b, a); else { if (blend == MixBlend_Setup) color.set(slot._data._setup._color); - color.add((r - color.r) * alpha, (g - color.g) * alpha, - (b - color.b) * alpha, (a - color.a) * alpha); + color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha); } } RTTI_IMPL(RGBTimeline, SlotCurveTimeline) -RGBTimeline::RGBTimeline(size_t frameCount, size_t bezierCount, int slotIndex) - : SlotCurveTimeline(frameCount, ENTRIES, bezierCount, slotIndex) { +RGBTimeline::RGBTimeline(size_t frameCount, size_t bezierCount, int slotIndex) : SlotCurveTimeline(frameCount, ENTRIES, bezierCount, slotIndex) { PropertyId ids[] = {((PropertyId) Property_Rgb << 32) | slotIndex}; setPropertyIds(ids, 1); } @@ -216,8 +211,8 @@ AlphaTimeline::AlphaTimeline(size_t frameCount, size_t bezierCount, int slotInde AlphaTimeline::~AlphaTimeline() { } -void AlphaTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, - MixBlend blend, MixDirection direction, bool appliedPose) { +void AlphaTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); SP_UNUSED(direction); @@ -251,10 +246,8 @@ void AlphaTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array< RTTI_IMPL(RGBA2Timeline, SlotCurveTimeline) -RGBA2Timeline::RGBA2Timeline(size_t frameCount, size_t bezierCount, int slotIndex) - : SlotCurveTimeline(frameCount, ENTRIES, bezierCount, slotIndex) { - PropertyId ids[] = {((PropertyId) Property_Rgb << 32) | slotIndex, - ((PropertyId) Property_Alpha << 32) | slotIndex, +RGBA2Timeline::RGBA2Timeline(size_t frameCount, size_t bezierCount, int slotIndex) : SlotCurveTimeline(frameCount, ENTRIES, bezierCount, slotIndex) { + PropertyId ids[] = {((PropertyId) Property_Rgb << 32) | slotIndex, ((PropertyId) Property_Alpha << 32) | slotIndex, ((PropertyId) Property_Rgb2 << 32) | slotIndex}; setPropertyIds(ids, 3); } @@ -289,8 +282,8 @@ void RGBA2Timeline::apply(Slot &slot, SlotPose &pose, float time, float alpha, M dark.b = setupDark.b; return; case MixBlend_First: - light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, - (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha); + light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, + (setupLight.a - light.a) * alpha); dark.r += (setupDark.r - dark.r) * alpha; dark.g += (setupDark.g - dark.g) * alpha; dark.b += (setupDark.b - dark.b) * alpha; @@ -359,8 +352,7 @@ void RGBA2Timeline::apply(Slot &slot, SlotPose &pose, float time, float alpha, M dark.g = setupDark.g; dark.b = setupDark.b; } - light.add((r - light.r) * alpha, (g - light.g) * alpha, - (b - light.b) * alpha, (a - light.a) * alpha); + light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha); dark.r += (r2 - dark.r) * alpha; dark.g += (g2 - dark.g) * alpha; dark.b += (b2 - dark.b) * alpha; @@ -369,10 +361,8 @@ void RGBA2Timeline::apply(Slot &slot, SlotPose &pose, float time, float alpha, M RTTI_IMPL(RGB2Timeline, SlotCurveTimeline) -RGB2Timeline::RGB2Timeline(size_t frameCount, size_t bezierCount, int slotIndex) - : SlotCurveTimeline(frameCount, ENTRIES, bezierCount, slotIndex) { - PropertyId ids[] = {((PropertyId) Property_Rgb << 32) | slotIndex, - ((PropertyId) Property_Rgb2 << 32) | slotIndex}; +RGB2Timeline::RGB2Timeline(size_t frameCount, size_t bezierCount, int slotIndex) : SlotCurveTimeline(frameCount, ENTRIES, bezierCount, slotIndex) { + PropertyId ids[] = {((PropertyId) Property_Rgb << 32) | slotIndex, ((PropertyId) Property_Rgb2 << 32) | slotIndex}; setPropertyIds(ids, 2); } diff --git a/spine-cpp/src/spine/ConstraintTimeline.cpp b/spine-cpp/src/spine/ConstraintTimeline.cpp index aa5c6777b..d2e690087 100644 --- a/spine-cpp/src/spine/ConstraintTimeline.cpp +++ b/spine-cpp/src/spine/ConstraintTimeline.cpp @@ -33,4 +33,5 @@ using namespace spine; RTTI_IMPL_NOPARENT(ConstraintTimeline) -ConstraintTimeline::ConstraintTimeline(int constraintIndex) : _constraintIndex(constraintIndex) {} \ No newline at end of file +ConstraintTimeline::ConstraintTimeline(int constraintIndex) : _constraintIndex(constraintIndex) { +} \ No newline at end of file diff --git a/spine-cpp/src/spine/CurveTimeline.cpp b/spine-cpp/src/spine/CurveTimeline.cpp index 95124862a..792e7a882 100644 --- a/spine-cpp/src/spine/CurveTimeline.cpp +++ b/spine-cpp/src/spine/CurveTimeline.cpp @@ -35,8 +35,7 @@ using namespace spine; RTTI_IMPL(CurveTimeline, Timeline) -CurveTimeline::CurveTimeline(size_t frameCount, size_t frameEntries, size_t bezierCount) : Timeline(frameCount, - frameEntries) { +CurveTimeline::CurveTimeline(size_t frameCount, size_t frameEntries, size_t bezierCount) : Timeline(frameCount, frameEntries) { _curves.setSize(frameCount + bezierCount * BEZIER_SIZE, 0); _curves[frameCount - 1] = STEPPED; } @@ -52,8 +51,8 @@ void CurveTimeline::setStepped(size_t frame) { _curves[frame] = STEPPED; } -void CurveTimeline::setBezier(size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, - float cx2, float cy2, float time2, float value2) { +void CurveTimeline::setBezier(size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, + float time2, float value2) { size_t i = getFrameCount() + bezier * BEZIER_SIZE; if (value == 0) _curves[frame] = BEZIER + i; float tmpx = (time1 - cx1 * 2 + cx2) * 0.03, tmpy = (value1 - cy1 * 2 + cy2) * 0.03; @@ -96,9 +95,7 @@ Array &CurveTimeline::getCurves() { RTTI_IMPL(CurveTimeline1, CurveTimeline) -CurveTimeline1::CurveTimeline1(size_t frameCount, size_t bezierCount) : CurveTimeline(frameCount, - CurveTimeline1::ENTRIES, - bezierCount) { +CurveTimeline1::CurveTimeline1(size_t frameCount, size_t bezierCount) : CurveTimeline(frameCount, CurveTimeline1::ENTRIES, bezierCount) { } CurveTimeline1::~CurveTimeline1() { @@ -123,8 +120,9 @@ float CurveTimeline1::getCurveValue(float time) { switch (curveType) { case CurveTimeline::LINEAR: { float before = _frames[i], value = _frames[i + CurveTimeline1::VALUE]; - return value + (time - before) / (_frames[i + CurveTimeline1::ENTRIES] - before) * - (_frames[i + CurveTimeline1::ENTRIES + CurveTimeline1::VALUE] - value); + return value + + (time - before) / (_frames[i + CurveTimeline1::ENTRIES] - before) * + (_frames[i + CurveTimeline1::ENTRIES + CurveTimeline1::VALUE] - value); } case CurveTimeline::STEPPED: return _frames[i + CurveTimeline1::VALUE]; @@ -203,8 +201,7 @@ float CurveTimeline1::getAbsoluteValue(float time, float alpha, MixBlend blend, return current; } -float CurveTimeline1::getScaleValue(float time, float alpha, MixBlend blend, MixDirection direction, float current, - float setup) { +float CurveTimeline1::getScaleValue(float time, float alpha, MixBlend blend, MixDirection direction, float current, float setup) { if (time < _frames[0]) { switch (blend) { case MixBlend_Setup: @@ -251,9 +248,7 @@ float CurveTimeline1::getScaleValue(float time, float alpha, MixBlend blend, Mix RTTI_IMPL(CurveTimeline2, CurveTimeline) -CurveTimeline2::CurveTimeline2(size_t frameCount, size_t bezierCount) : CurveTimeline(frameCount, - CurveTimeline2::ENTRIES, - bezierCount) { +CurveTimeline2::CurveTimeline2(size_t frameCount, size_t bezierCount) : CurveTimeline(frameCount, CurveTimeline2::ENTRIES, bezierCount) { } CurveTimeline2::~CurveTimeline2() { diff --git a/spine-cpp/src/spine/DeformTimeline.cpp b/spine-cpp/src/spine/DeformTimeline.cpp index 40e3ab957..60ce4f603 100644 --- a/spine-cpp/src/spine/DeformTimeline.cpp +++ b/spine-cpp/src/spine/DeformTimeline.cpp @@ -91,13 +91,11 @@ void DeformTimeline::apply(Slot &slot, SlotPose &pose, float time, float alpha, if (vertexAttachment->getBones().size() == 0) { // Unweighted vertex positions. Array &setupVertices = vertexAttachment->getVertices(); - for (size_t i = 0; i < vertexCount; i++) - deform[i] += (setupVertices[i] - deform[i]) * alpha; + for (size_t i = 0; i < vertexCount; i++) deform[i] += (setupVertices[i] - deform[i]) * alpha; } else { // Weighted deform offsets. alpha = 1 - alpha; - for (size_t i = 0; i < vertexCount; i++) - deform[i] *= alpha; + for (size_t i = 0; i < vertexCount; i++) deform[i] *= alpha; } break; } @@ -118,12 +116,10 @@ void DeformTimeline::apply(Slot &slot, SlotPose &pose, float time, float alpha, if (vertexAttachment->getBones().size() == 0) { // Unweighted vertex positions, no alpha. Array &setupVertices = vertexAttachment->getVertices(); - for (size_t i = 0; i < vertexCount; i++) - deform[i] += lastVertices[i] - setupVertices[i]; + for (size_t i = 0; i < vertexCount; i++) deform[i] += lastVertices[i] - setupVertices[i]; } else { // Weighted deform offsets, no alpha. - for (size_t i = 0; i < vertexCount; i++) - deform[i] += lastVertices[i]; + for (size_t i = 0; i < vertexCount; i++) deform[i] += lastVertices[i]; } } else { // Vertex positions or deform offsets, no alpha. @@ -141,27 +137,23 @@ void DeformTimeline::apply(Slot &slot, SlotPose &pose, float time, float alpha, } } else { // Weighted deform offsets, with alpha. - for (size_t i = 0; i < vertexCount; i++) - deform[i] = lastVertices[i] * alpha; + for (size_t i = 0; i < vertexCount; i++) deform[i] = lastVertices[i] * alpha; } break; } case MixBlend_First: case MixBlend_Replace: // Vertex positions or deform offsets, with alpha. - for (size_t i = 0; i < vertexCount; i++) - deform[i] += (lastVertices[i] - deform[i]) * alpha; + for (size_t i = 0; i < vertexCount; i++) deform[i] += (lastVertices[i] - deform[i]) * alpha; break; case MixBlend_Add: if (vertexAttachment->getBones().size() == 0) { // Unweighted vertex positions, with alpha. Array &setupVertices = vertexAttachment->getVertices(); - for (size_t i = 0; i < vertexCount; i++) - deform[i] += (lastVertices[i] - setupVertices[i]) * alpha; + for (size_t i = 0; i < vertexCount; i++) deform[i] += (lastVertices[i] - setupVertices[i]) * alpha; } else { // Weighted deform offsets, alpha. - for (size_t i = 0; i < vertexCount; i++) - deform[i] += lastVertices[i] * alpha; + for (size_t i = 0; i < vertexCount; i++) deform[i] += lastVertices[i] * alpha; } break; } @@ -247,8 +239,8 @@ void DeformTimeline::apply(Slot &slot, SlotPose &pose, float time, float alpha, } } -void DeformTimeline::setBezier(size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, - float cx2, float cy2, float time2, float value2) { +void DeformTimeline::setBezier(size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, + float time2, float value2) { SP_UNUSED(value1); SP_UNUSED(value2); Array &curves = _curves; diff --git a/spine-cpp/src/spine/DrawOrderTimeline.cpp b/spine-cpp/src/spine/DrawOrderTimeline.cpp index bab7f89b4..7cd3a0db0 100644 --- a/spine-cpp/src/spine/DrawOrderTimeline.cpp +++ b/spine-cpp/src/spine/DrawOrderTimeline.cpp @@ -52,8 +52,8 @@ DrawOrderTimeline::DrawOrderTimeline(size_t frameCount) : Timeline(frameCount, 1 } } -void DrawOrderTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, - MixBlend blend, MixDirection direction, bool appliedPose) { +void DrawOrderTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) { SP_UNUSED(appliedPose); SP_UNUSED(lastTime); SP_UNUSED(pEvents); @@ -65,8 +65,7 @@ void DrawOrderTimeline::apply(Skeleton &skeleton, float lastTime, float time, Ar if (blend == MixBlend_Setup) { drawOrder.clear(); drawOrder.ensureCapacity(slots.size()); - for (size_t i = 0, n = slots.size(); i < n; ++i) - drawOrder.add(slots[i]); + for (size_t i = 0, n = slots.size(); i < n; ++i) drawOrder.add(slots[i]); } return; } @@ -75,8 +74,7 @@ void DrawOrderTimeline::apply(Skeleton &skeleton, float lastTime, float time, Ar if (blend == MixBlend_Setup || blend == MixBlend_First) { drawOrder.clear(); drawOrder.ensureCapacity(slots.size()); - for (size_t i = 0, n = slots.size(); i < n; ++i) - drawOrder.add(slots[i]); + for (size_t i = 0, n = slots.size(); i < n; ++i) drawOrder.add(slots[i]); } return; } @@ -85,13 +83,11 @@ void DrawOrderTimeline::apply(Skeleton &skeleton, float lastTime, float time, Ar if (drawOrderToSetupIndex.size() == 0) { drawOrder.clear(); drawOrder.ensureCapacity(slots.size()); - for (size_t i = 0, n = slots.size(); i < n; ++i) - drawOrder.add(slots[i]); + for (size_t i = 0, n = slots.size(); i < n; ++i) drawOrder.add(slots[i]); } else { drawOrder.clear(); drawOrder.ensureCapacity(drawOrderToSetupIndex.size()); - for (size_t i = 0, n = drawOrderToSetupIndex.size(); i < n; ++i) - drawOrder.add(slots[drawOrderToSetupIndex[i]]); + for (size_t i = 0, n = drawOrderToSetupIndex.size(); i < n; ++i) drawOrder.add(slots[drawOrderToSetupIndex[i]]); } } diff --git a/spine-cpp/src/spine/Event.cpp b/spine-cpp/src/spine/Event.cpp index 867623e75..dcbcecaf2 100644 --- a/spine-cpp/src/spine/Event.cpp +++ b/spine-cpp/src/spine/Event.cpp @@ -33,13 +33,9 @@ using namespace spine; -Event::Event(float time, const EventData &data) : _data(data), - _time(time), - _intValue(data.getInt()), - _floatValue(data.getFloat()), - _stringValue(data.getString()), - _volume(data.getVolume()), - _balance(data.getBalance()) { +Event::Event(float time, const EventData &data) + : _data(data), _time(time), _intValue(data.getInt()), _floatValue(data.getFloat()), _stringValue(data.getString()), _volume(data.getVolume()), + _balance(data.getBalance()) { } const EventData &Event::getData() { diff --git a/spine-cpp/src/spine/EventData.cpp b/spine-cpp/src/spine/EventData.cpp index 0a9622c3e..a90f93146 100644 --- a/spine-cpp/src/spine/EventData.cpp +++ b/spine-cpp/src/spine/EventData.cpp @@ -33,13 +33,7 @@ using namespace spine; -EventData::EventData(const String &name) : _name(name), - _intValue(0), - _floatValue(0), - _stringValue(), - _audioPath(), - _volume(1), - _balance(0) { +EventData::EventData(const String &name) : _name(name), _intValue(0), _floatValue(0), _stringValue(), _audioPath(), _volume(1), _balance(0) { assert(_name.length() > 0); } diff --git a/spine-cpp/src/spine/EventTimeline.cpp b/spine-cpp/src/spine/EventTimeline.cpp index dab32d73b..c5ba0388c 100644 --- a/spine-cpp/src/spine/EventTimeline.cpp +++ b/spine-cpp/src/spine/EventTimeline.cpp @@ -55,8 +55,8 @@ EventTimeline::~EventTimeline() { ArrayUtils::deleteElements(_events); } -void EventTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, - MixBlend blend, MixDirection direction, bool appliedPose) { +void EventTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) { if (pEvents == NULL) return; Array &events = *pEvents; @@ -87,8 +87,7 @@ void EventTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array< } } - for (; (size_t) i < frameCount && time >= _frames[i]; i++) - events.add(_events[i]); + for (; (size_t) i < frameCount && time >= _frames[i]; i++) events.add(_events[i]); } void EventTimeline::setFrame(size_t frame, Event *event) { diff --git a/spine-cpp/src/spine/Extension.cpp b/spine-cpp/src/spine/Extension.cpp index bf87c5b19..e905cf735 100644 --- a/spine-cpp/src/spine/Extension.cpp +++ b/spine-cpp/src/spine/Extension.cpp @@ -62,8 +62,7 @@ void *DefaultSpineExtension::_alloc(size_t size, const char *file, int line) { SP_UNUSED(file); SP_UNUSED(line); - if (size == 0) - return 0; + if (size == 0) return 0; void *ptr = ::malloc(size); return ptr; } @@ -72,8 +71,7 @@ void *DefaultSpineExtension::_calloc(size_t size, const char *file, int line) { SP_UNUSED(file); SP_UNUSED(line); - if (size == 0) - return 0; + if (size == 0) return 0; void *ptr = ::malloc(size); if (ptr) { @@ -87,8 +85,7 @@ void *DefaultSpineExtension::_realloc(void *ptr, size_t size, const char *file, SP_UNUSED(line); void *mem = NULL; - if (size == 0) - return 0; + if (size == 0) return 0; if (ptr == NULL) mem = ::malloc(size); else diff --git a/spine-cpp/src/spine/IkConstraint.cpp b/spine-cpp/src/spine/IkConstraint.cpp index 6a450f5f8..f0f5cfa24 100644 --- a/spine-cpp/src/spine/IkConstraint.cpp +++ b/spine-cpp/src/spine/IkConstraint.cpp @@ -41,8 +41,8 @@ using namespace spine; RTTI_IMPL(IkConstraint, Constraint) -IkConstraint::IkConstraint(IkConstraintData &data, Skeleton &skeleton) : ConstraintGeneric(data), - _target(skeleton._bones[data._target->getIndex()]) { +IkConstraint::IkConstraint(IkConstraintData &data, Skeleton &skeleton) + : ConstraintGeneric(data), _target(skeleton._bones[data._target->getIndex()]) { _bones.ensureCapacity(data._bones.size()); for (size_t i = 0; i < data._bones.size(); i++) { @@ -66,8 +66,8 @@ void IkConstraint::update(Skeleton &skeleton, Physics physics) { apply(skeleton, *_bones[0], target._worldX, target._worldY, p._compress, p._stretch, _data._uniform, p._mix); } break; case 2: { - apply(skeleton, *_bones[0], *_bones[1], target._worldX, target._worldY, p._bendDirection, p._stretch, _data._uniform, - p._softness, p._mix); + apply(skeleton, *_bones[0], *_bones[1], target._worldX, target._worldY, p._bendDirection, p._stretch, _data._uniform, p._softness, + p._mix); } break; } } @@ -162,8 +162,8 @@ void IkConstraint::apply(Skeleton &skeleton, BonePose &bone, float targetX, floa } } -void IkConstraint::apply(Skeleton &skeleton, BonePose &parent, BonePose &child, float targetX, float targetY, int bendDir, - bool stretch, bool uniform, float softness, float mix) { +void IkConstraint::apply(Skeleton &skeleton, BonePose &parent, BonePose &child, float targetX, float targetY, int bendDir, bool stretch, bool uniform, + float softness, float mix) { if (parent._inherit != Inherit_Normal || child._inherit != Inherit_Normal) return; parent.modifyLocal(skeleton); child.modifyLocal(skeleton); diff --git a/spine-cpp/src/spine/IkConstraintData.cpp b/spine-cpp/src/spine/IkConstraintData.cpp index fb1101b26..34a0d44c0 100644 --- a/spine-cpp/src/spine/IkConstraintData.cpp +++ b/spine-cpp/src/spine/IkConstraintData.cpp @@ -36,9 +36,7 @@ using namespace spine; RTTI_IMPL(IkConstraintData, ConstraintData) -IkConstraintData::IkConstraintData(const String &name) : ConstraintDataGeneric(name), - _target(NULL), - _uniform(false) { +IkConstraintData::IkConstraintData(const String &name) : ConstraintDataGeneric(name), _target(NULL), _uniform(false) { } Array &IkConstraintData::getBones() { diff --git a/spine-cpp/src/spine/IkConstraintTimeline.cpp b/spine-cpp/src/spine/IkConstraintTimeline.cpp index dad1442fd..54a233645 100644 --- a/spine-cpp/src/spine/IkConstraintTimeline.cpp +++ b/spine-cpp/src/spine/IkConstraintTimeline.cpp @@ -53,8 +53,8 @@ IkConstraintTimeline::IkConstraintTimeline(size_t frameCount, size_t bezierCount IkConstraintTimeline::~IkConstraintTimeline() { } -void IkConstraintTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, - MixBlend blend, MixDirection direction, bool appliedPose) { +void IkConstraintTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); @@ -104,9 +104,7 @@ void IkConstraintTimeline::apply(Skeleton &skeleton, float lastTime, float time, } default: { mix = getBezierValue(time, i, MIX, curveType - BEZIER); - softness = getBezierValue(time, i, SOFTNESS, - curveType + BEZIER_SIZE - - BEZIER); + softness = getBezierValue(time, i, SOFTNESS, curveType + BEZIER_SIZE - BEZIER); } } @@ -140,8 +138,7 @@ void IkConstraintTimeline::apply(Skeleton &skeleton, float lastTime, float time, pose._stretch = _frames[i + STRETCH] != 0; } -void IkConstraintTimeline::setFrame(int frame, float time, float mix, float softness, int bendDirection, bool compress, - bool stretch) { +void IkConstraintTimeline::setFrame(int frame, float time, float mix, float softness, int bendDirection, bool compress, bool stretch) { frame *= ENTRIES; _frames[frame] = time; _frames[frame + MIX] = mix; diff --git a/spine-cpp/src/spine/InheritTimeline.cpp b/spine-cpp/src/spine/InheritTimeline.cpp index 7702381f9..6f2cd2140 100644 --- a/spine-cpp/src/spine/InheritTimeline.cpp +++ b/spine-cpp/src/spine/InheritTimeline.cpp @@ -42,8 +42,7 @@ using namespace spine; RTTI_IMPL_MULTI(InheritTimeline, Timeline, BoneTimeline) -InheritTimeline::InheritTimeline(size_t frameCount, int boneIndex) : Timeline(frameCount, ENTRIES), - BoneTimeline(boneIndex) { +InheritTimeline::InheritTimeline(size_t frameCount, int boneIndex) : Timeline(frameCount, ENTRIES), BoneTimeline(boneIndex) { PropertyId ids[] = {((PropertyId) Property_Inherit << 32) | boneIndex}; setPropertyIds(ids, 1); } @@ -58,8 +57,8 @@ void InheritTimeline::setFrame(int frame, float time, Inherit inherit) { } -void InheritTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, - MixBlend blend, MixDirection direction, bool appliedPose) { +void InheritTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); SP_UNUSED(alpha); diff --git a/spine-cpp/src/spine/Json.cpp b/spine-cpp/src/spine/Json.cpp index 53123340e..5f14718f3 100644 --- a/spine-cpp/src/spine/Json.cpp +++ b/spine-cpp/src/spine/Json.cpp @@ -108,17 +108,12 @@ const char *Json::getError() { return _error; } -Json::Json(const char *value) : _next(NULL), +Json::Json(const char *value) + : _next(NULL), #if SPINE_JSON_HAVE_PREV - _prev(NULL), + _prev(NULL), #endif - _child(NULL), - _type(0), - _size(0), - _valueString(NULL), - _valueInt(0), - _valueFloat(0), - _name(NULL) { + _child(NULL), _type(0), _size(0), _valueString(NULL), _valueInt(0), _valueFloat(0), _name(NULL) { if (value) { value = parseValue(this, skip(value)); diff --git a/spine-cpp/src/spine/LinkedMesh.cpp b/spine-cpp/src/spine/LinkedMesh.cpp index f23952c11..28755c649 100644 --- a/spine-cpp/src/spine/LinkedMesh.cpp +++ b/spine-cpp/src/spine/LinkedMesh.cpp @@ -33,20 +33,10 @@ using namespace spine; -LinkedMesh::LinkedMesh(MeshAttachment *mesh, const int skinIndex, size_t slotIndex, const String &parent, - bool inheritTimelines) : _mesh(mesh), - _skinIndex(skinIndex), - _skin(""), - _slotIndex(slotIndex), - _parent(parent), - _inheritTimelines(inheritTimelines) { +LinkedMesh::LinkedMesh(MeshAttachment *mesh, const int skinIndex, size_t slotIndex, const String &parent, bool inheritTimelines) + : _mesh(mesh), _skinIndex(skinIndex), _skin(""), _slotIndex(slotIndex), _parent(parent), _inheritTimelines(inheritTimelines) { } -LinkedMesh::LinkedMesh(MeshAttachment *mesh, const String &skin, size_t slotIndex, const String &parent, - bool inheritTimelines) : _mesh(mesh), - _skinIndex(-1), - _skin(skin), - _slotIndex(slotIndex), - _parent(parent), - _inheritTimelines(inheritTimelines) { +LinkedMesh::LinkedMesh(MeshAttachment *mesh, const String &skin, size_t slotIndex, const String &parent, bool inheritTimelines) + : _mesh(mesh), _skinIndex(-1), _skin(skin), _slotIndex(slotIndex), _parent(parent), _inheritTimelines(inheritTimelines) { } diff --git a/spine-cpp/src/spine/MathUtil.cpp b/spine-cpp/src/spine/MathUtil.cpp index 44f48fa9e..040f76918 100644 --- a/spine-cpp/src/spine/MathUtil.cpp +++ b/spine-cpp/src/spine/MathUtil.cpp @@ -50,8 +50,7 @@ float MathUtil::abs(float v) { } float MathUtil::sign(float v) { - return ((v) < 0 ? -1.0f : (v) > 0 ? 1.0f - : 0.0f); + return ((v) < 0 ? -1.0f : (v) > 0 ? 1.0f : 0.0f); } float MathUtil::clamp(float x, float min, float max) { diff --git a/spine-cpp/src/spine/MeshAttachment.cpp b/spine-cpp/src/spine/MeshAttachment.cpp index da8ca5ae6..8a003f936 100644 --- a/spine-cpp/src/spine/MeshAttachment.cpp +++ b/spine-cpp/src/spine/MeshAttachment.cpp @@ -35,15 +35,9 @@ using namespace spine; RTTI_IMPL(MeshAttachment, VertexAttachment) -MeshAttachment::MeshAttachment(const String &name) : VertexAttachment(name), - _region(NULL), - _path(), - _color(1, 1, 1, 1), - _hullLength(0), - _parentMesh(NULL), - _sequence(NULL), - _width(0), - _height(0) {} +MeshAttachment::MeshAttachment(const String &name) + : VertexAttachment(name), _region(NULL), _path(), _color(1, 1, 1, 1), _hullLength(0), _parentMesh(NULL), _sequence(NULL), _width(0), _height(0) { +} MeshAttachment::~MeshAttachment() { if (_sequence) delete _sequence; diff --git a/spine-cpp/src/spine/PathAttachment.cpp b/spine-cpp/src/spine/PathAttachment.cpp index 2f9023bbc..7ccde21b9 100644 --- a/spine-cpp/src/spine/PathAttachment.cpp +++ b/spine-cpp/src/spine/PathAttachment.cpp @@ -33,8 +33,7 @@ using namespace spine; RTTI_IMPL(PathAttachment, VertexAttachment) -PathAttachment::PathAttachment(const String &name) : VertexAttachment(name), _closed(false), _constantSpeed(false), - _color() { +PathAttachment::PathAttachment(const String &name) : VertexAttachment(name), _closed(false), _constantSpeed(false), _color() { } Array &PathAttachment::getLengths() { diff --git a/spine-cpp/src/spine/PathConstraint.cpp b/spine-cpp/src/spine/PathConstraint.cpp index e7b2c4bcc..998881099 100644 --- a/spine-cpp/src/spine/PathConstraint.cpp +++ b/spine-cpp/src/spine/PathConstraint.cpp @@ -51,7 +51,8 @@ const int PathConstraint::NONE = -1; const int PathConstraint::BEFORE = -2; const int PathConstraint::AFTER = -3; -PathConstraint::PathConstraint(PathConstraintData &data, Skeleton &skeleton) : ConstraintGeneric(data) { +PathConstraint::PathConstraint(PathConstraintData &data, Skeleton &skeleton) + : ConstraintGeneric(data) { _bones.ensureCapacity(data.getBones().size()); for (size_t i = 0; i < data.getBones().size(); i++) { @@ -227,10 +228,8 @@ void PathConstraint::sort(Skeleton &skeleton) { skeleton.constrained(*bone); } skeleton._updateCache.add(this); - for (size_t i = 0; i < boneCount; i++) - skeleton.sortReset(bones[i]->_bone->getChildren()); - for (size_t i = 0; i < boneCount; i++) - bones[i]->_bone->_sorted = true; + for (size_t i = 0; i < boneCount; i++) skeleton.sortReset(bones[i]->_bone->getChildren()); + for (size_t i = 0; i < boneCount; i++) bones[i]->_bone->_sorted = true; } bool PathConstraint::isSourceActive() { @@ -253,8 +252,7 @@ void PathConstraint::setSlot(Slot *slot) { _slot = slot; } -Array & -PathConstraint::computeWorldPositions(Skeleton &skeleton, PathAttachment &path, int spacesCount, bool tangents) { +Array &PathConstraint::computeWorldPositions(Skeleton &skeleton, PathAttachment &path, int spacesCount, bool tangents) { float position = _applied->_position; float *spaces = _spaces.buffer(); _positions.setSize(spacesCount * 3 + 2, 0); @@ -332,8 +330,8 @@ PathConstraint::computeWorldPositions(Skeleton &skeleton, PathAttachment &path, } else path.computeWorldVertices(skeleton, *_slot, curve * 6 + 2, 8, world, 0, 2); } - addCurvePosition(p, worldBuffer[0], worldBuffer[1], worldBuffer[2], worldBuffer[3], worldBuffer[4], worldBuffer[5], worldBuffer[6], worldBuffer[7], - out, o, tangents || (i > 0 && space < epsilon)); + addCurvePosition(p, worldBuffer[0], worldBuffer[1], worldBuffer[2], worldBuffer[3], worldBuffer[4], worldBuffer[5], worldBuffer[6], + worldBuffer[7], out, o, tangents || (i > 0 && space < epsilon)); } return out; } @@ -493,8 +491,7 @@ PathConstraint::computeWorldPositions(Skeleton &skeleton, PathAttachment &path, } break; } - addCurvePosition(p * 0.1f, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, - tangents || (i > 0 && space < epsilon)); + addCurvePosition(p * 0.1f, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space < epsilon)); } return out; @@ -514,8 +511,8 @@ void PathConstraint::addAfterPosition(float p, Array &temp, int i, Array< output[o + 2] = r; } -void PathConstraint::addCurvePosition(float p, float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, - float y2, Array &output, int o, bool tangents) { +void PathConstraint::addCurvePosition(float p, float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2, + Array &output, int o, bool tangents) { if (p < epsilon || MathUtil::isNan(p)) { output[o] = x1; output[o + 1] = y1; @@ -531,8 +528,7 @@ void PathConstraint::addCurvePosition(float p, float x1, float y1, float cx1, fl if (p < 0.001f) output[o + 2] = MathUtil::atan2(cy1 - y1, cx1 - x1); else - output[o + 2] = MathUtil::atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), - x - (x1 * uu + cx1 * ut * 2 + cx2 * tt)); + output[o + 2] = MathUtil::atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt)); } } @@ -555,8 +551,7 @@ void PathConstraint::sortPath(Skeleton &skeleton, Attachment *attachment, Bone & for (size_t i = 0, n = pathBones.size(); i < n;) { int nn = pathBones[i++]; nn += i; - while (i < (size_t) nn) - skeleton.sortBone(bones[pathBones[i++]]); + while (i < (size_t) nn) skeleton.sortBone(bones[pathBones[i++]]); } } } \ No newline at end of file diff --git a/spine-cpp/src/spine/PathConstraintData.cpp b/spine-cpp/src/spine/PathConstraintData.cpp index e8dd97dbd..94d85821a 100644 --- a/spine-cpp/src/spine/PathConstraintData.cpp +++ b/spine-cpp/src/spine/PathConstraintData.cpp @@ -37,12 +37,9 @@ using namespace spine; RTTI_IMPL(PathConstraintData, ConstraintData) -PathConstraintData::PathConstraintData(const String &name) : ConstraintDataGeneric(name), - _slot(NULL), - _positionMode(PositionMode_Fixed), - _spacingMode(SpacingMode_Length), - _rotateMode(RotateMode_Tangent), - _offsetRotation(0) { +PathConstraintData::PathConstraintData(const String &name) + : ConstraintDataGeneric(name), _slot(NULL), _positionMode(PositionMode_Fixed), + _spacingMode(SpacingMode_Length), _rotateMode(RotateMode_Tangent), _offsetRotation(0) { } diff --git a/spine-cpp/src/spine/PathConstraintMixTimeline.cpp b/spine-cpp/src/spine/PathConstraintMixTimeline.cpp index 486581a59..e33155af9 100644 --- a/spine-cpp/src/spine/PathConstraintMixTimeline.cpp +++ b/spine-cpp/src/spine/PathConstraintMixTimeline.cpp @@ -45,8 +45,7 @@ using namespace spine; RTTI_IMPL_MULTI(PathConstraintMixTimeline, CurveTimeline, ConstraintTimeline) PathConstraintMixTimeline::PathConstraintMixTimeline(size_t frameCount, size_t bezierCount, int constraintIndex) - : CurveTimeline(frameCount, PathConstraintMixTimeline::ENTRIES, bezierCount), - ConstraintTimeline(constraintIndex) { + : CurveTimeline(frameCount, PathConstraintMixTimeline::ENTRIES, bezierCount), ConstraintTimeline(constraintIndex) { PropertyId ids[] = {((PropertyId) Property_PathConstraintMix << 32) | constraintIndex}; setPropertyIds(ids, 1); } @@ -54,8 +53,8 @@ PathConstraintMixTimeline::PathConstraintMixTimeline(size_t frameCount, size_t b PathConstraintMixTimeline::~PathConstraintMixTimeline() { } -void PathConstraintMixTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, - MixBlend blend, MixDirection direction, bool appliedPose) { +void PathConstraintMixTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); SP_UNUSED(direction); diff --git a/spine-cpp/src/spine/PathConstraintPositionTimeline.cpp b/spine-cpp/src/spine/PathConstraintPositionTimeline.cpp index 7ecc5b79a..28de135da 100644 --- a/spine-cpp/src/spine/PathConstraintPositionTimeline.cpp +++ b/spine-cpp/src/spine/PathConstraintPositionTimeline.cpp @@ -43,18 +43,15 @@ using namespace spine; RTTI_IMPL(PathConstraintPositionTimeline, ConstraintTimeline1) -PathConstraintPositionTimeline::PathConstraintPositionTimeline(size_t frameCount, size_t bezierCount, - int constraintIndex) : ConstraintTimeline1(frameCount, - bezierCount, - constraintIndex, - Property_PathConstraintPosition) { +PathConstraintPositionTimeline::PathConstraintPositionTimeline(size_t frameCount, size_t bezierCount, int constraintIndex) + : ConstraintTimeline1(frameCount, bezierCount, constraintIndex, Property_PathConstraintPosition) { } PathConstraintPositionTimeline::~PathConstraintPositionTimeline() { } -void PathConstraintPositionTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, - float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { +void PathConstraintPositionTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); SP_UNUSED(direction); diff --git a/spine-cpp/src/spine/PathConstraintSpacingTimeline.cpp b/spine-cpp/src/spine/PathConstraintSpacingTimeline.cpp index c701fe93e..681ce1c58 100644 --- a/spine-cpp/src/spine/PathConstraintSpacingTimeline.cpp +++ b/spine-cpp/src/spine/PathConstraintSpacingTimeline.cpp @@ -43,18 +43,15 @@ using namespace spine; RTTI_IMPL(PathConstraintSpacingTimeline, ConstraintTimeline1) -PathConstraintSpacingTimeline::PathConstraintSpacingTimeline(size_t frameCount, size_t bezierCount, - int constraintIndex) : ConstraintTimeline1(frameCount, - bezierCount, - constraintIndex, - Property_PathConstraintSpacing) { +PathConstraintSpacingTimeline::PathConstraintSpacingTimeline(size_t frameCount, size_t bezierCount, int constraintIndex) + : ConstraintTimeline1(frameCount, bezierCount, constraintIndex, Property_PathConstraintSpacing) { } PathConstraintSpacingTimeline::~PathConstraintSpacingTimeline() { } -void PathConstraintSpacingTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, - float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { +void PathConstraintSpacingTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); SP_UNUSED(direction); diff --git a/spine-cpp/src/spine/PhysicsConstraint.cpp b/spine-cpp/src/spine/PhysicsConstraint.cpp index 24766d873..7f55cf0e3 100644 --- a/spine-cpp/src/spine/PhysicsConstraint.cpp +++ b/spine-cpp/src/spine/PhysicsConstraint.cpp @@ -41,11 +41,10 @@ using namespace spine; RTTI_IMPL(PhysicsConstraint, Constraint) -PhysicsConstraint::PhysicsConstraint(PhysicsConstraintData &data, Skeleton &skeleton) : ConstraintGeneric(data), - _reset(true), _ux(0), _uy(0), _cx(0), _cy(0), _tx(0), _ty(0), - _xOffset(0), _xLag(0), _xVelocity(0), _yOffset(0), _yLag(0), _yVelocity(0), - _rotateOffset(0), _rotateLag(0), _rotateVelocity(0), _scaleOffset(0), _scaleLag(0), _scaleVelocity(0), - _remaining(0), _lastTime(0) { +PhysicsConstraint::PhysicsConstraint(PhysicsConstraintData &data, Skeleton &skeleton) + : ConstraintGeneric(data), _reset(true), _ux(0), _uy(0), _cx(0), _cy(0), _tx(0), + _ty(0), _xOffset(0), _xLag(0), _xVelocity(0), _yOffset(0), _yLag(0), _yVelocity(0), _rotateOffset(0), _rotateLag(0), _rotateVelocity(0), + _scaleOffset(0), _scaleLag(0), _scaleVelocity(0), _remaining(0), _lastTime(0) { _bone = &skeleton._bones[(size_t) data._bone->getIndex()]->_constrained; } @@ -119,14 +118,12 @@ void PhysicsConstraint::update(Skeleton &skeleton, Physics physics) { if (x || y) { if (x) { float u = (_ux - bx) * i; - _xOffset += u > qx ? qx : u < -qx ? -qx - : u; + _xOffset += u > qx ? qx : u < -qx ? -qx : u; _ux = bx; } if (y) { float u = (_uy - by) * i; - _yOffset += u > qy ? qy : u < -qy ? -qy - : u; + _yOffset += u > qy ? qy : u < -qy ? -qy : u; _uy = by; } if (a >= t) { diff --git a/spine-cpp/src/spine/PhysicsConstraintData.cpp b/spine-cpp/src/spine/PhysicsConstraintData.cpp index 107ba86af..e35d3e40c 100644 --- a/spine-cpp/src/spine/PhysicsConstraintData.cpp +++ b/spine-cpp/src/spine/PhysicsConstraintData.cpp @@ -36,11 +36,10 @@ using namespace spine; RTTI_IMPL(PhysicsConstraintData, ConstraintData) -PhysicsConstraintData::PhysicsConstraintData(const String &name) : ConstraintDataGeneric(name), - _bone(NULL), - _x(0), _y(0), _rotate(0), _scaleX(0), _shearX(0), _limit(0), _step(0), - _inertiaGlobal(false), _strengthGlobal(false), _dampingGlobal(false), _massGlobal(false), - _windGlobal(false), _gravityGlobal(false), _mixGlobal(false) { +PhysicsConstraintData::PhysicsConstraintData(const String &name) + : ConstraintDataGeneric(name), _bone(NULL), _x(0), _y(0), _rotate(0), _scaleX(0), _shearX(0), _limit(0), + _step(0), _inertiaGlobal(false), _strengthGlobal(false), _dampingGlobal(false), _massGlobal(false), _windGlobal(false), _gravityGlobal(false), + _mixGlobal(false) { } BoneData *PhysicsConstraintData::getBone() { diff --git a/spine-cpp/src/spine/PhysicsConstraintPose.cpp b/spine-cpp/src/spine/PhysicsConstraintPose.cpp index d665d20b3..255af11f2 100644 --- a/spine-cpp/src/spine/PhysicsConstraintPose.cpp +++ b/spine-cpp/src/spine/PhysicsConstraintPose.cpp @@ -31,7 +31,8 @@ using namespace spine; -PhysicsConstraintPose::PhysicsConstraintPose() : Pose(), _inertia(0), _strength(0), _damping(0), _massInverse(0), _wind(0), _gravity(0), _mix(0) { +PhysicsConstraintPose::PhysicsConstraintPose() + : Pose(), _inertia(0), _strength(0), _damping(0), _massInverse(0), _wind(0), _gravity(0), _mix(0) { } PhysicsConstraintPose::~PhysicsConstraintPose() { diff --git a/spine-cpp/src/spine/PhysicsConstraintTimeline.cpp b/spine-cpp/src/spine/PhysicsConstraintTimeline.cpp index d0206119b..dc108e1c6 100644 --- a/spine-cpp/src/spine/PhysicsConstraintTimeline.cpp +++ b/spine-cpp/src/spine/PhysicsConstraintTimeline.cpp @@ -51,15 +51,14 @@ RTTI_IMPL(PhysicsConstraintGravityTimeline, PhysicsConstraintTimeline) RTTI_IMPL(PhysicsConstraintMixTimeline, PhysicsConstraintTimeline) RTTI_IMPL_MULTI(PhysicsConstraintResetTimeline, Timeline, ConstraintTimeline) -PhysicsConstraintTimeline::PhysicsConstraintTimeline(size_t frameCount, size_t bezierCount, - int constraintIndex, Property property) : CurveTimeline1(frameCount, bezierCount), - ConstraintTimeline(constraintIndex) { +PhysicsConstraintTimeline::PhysicsConstraintTimeline(size_t frameCount, size_t bezierCount, int constraintIndex, Property property) + : CurveTimeline1(frameCount, bezierCount), ConstraintTimeline(constraintIndex) { PropertyId ids[] = {((PropertyId) property << 32) | constraintIndex}; setPropertyIds(ids, 1); } -void PhysicsConstraintTimeline::apply(Skeleton &skeleton, float, float time, Array *, - float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { +void PhysicsConstraintTimeline::apply(Skeleton &skeleton, float, float time, Array *, float alpha, MixBlend blend, MixDirection direction, + bool appliedPose) { if (_constraintIndex == -1) { float value = time >= _frames[0] ? getCurveValue(time) : 0; @@ -80,7 +79,8 @@ void PhysicsConstraintTimeline::apply(Skeleton &skeleton, float, float time, Arr } } -void PhysicsConstraintResetTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { +void PhysicsConstraintResetTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) { PhysicsConstraint *constraint = nullptr; if (_constraintIndex != -1) { constraint = static_cast(skeleton.getConstraints()[_constraintIndex]); diff --git a/spine-cpp/src/spine/RegionAttachment.cpp b/spine-cpp/src/spine/RegionAttachment.cpp index 941c9063d..f94e1e6b5 100644 --- a/spine-cpp/src/spine/RegionAttachment.cpp +++ b/spine-cpp/src/spine/RegionAttachment.cpp @@ -48,18 +48,9 @@ const int RegionAttachment::URY = 5; const int RegionAttachment::BRX = 6; const int RegionAttachment::BRY = 7; -RegionAttachment::RegionAttachment(const String &name) : Attachment(name), - _region(NULL), - _path(), - _x(0), - _y(0), - _scaleX(1), - _scaleY(1), - _rotation(0), - _width(0), - _height(0), - _color(1, 1, 1, 1), - _sequence(NULL) { +RegionAttachment::RegionAttachment(const String &name) + : Attachment(name), _region(NULL), _path(), _x(0), _y(0), _scaleX(1), _scaleY(1), _rotation(0), _width(0), _height(0), _color(1, 1, 1, 1), + _sequence(NULL) { _offset.setSize(8, 0); _uvs.setSize(8, 0); } diff --git a/spine-cpp/src/spine/RotateTimeline.cpp b/spine-cpp/src/spine/RotateTimeline.cpp index ad4de77a9..0ecf17be3 100644 --- a/spine-cpp/src/spine/RotateTimeline.cpp +++ b/spine-cpp/src/spine/RotateTimeline.cpp @@ -35,11 +35,11 @@ using namespace spine; RTTI_IMPL(RotateTimeline, BoneTimeline1) -RotateTimeline::RotateTimeline(size_t frameCount, size_t bezierCount, int boneIndex) : BoneTimeline1(frameCount, bezierCount, boneIndex, Property_Rotate) { +RotateTimeline::RotateTimeline(size_t frameCount, size_t bezierCount, int boneIndex) + : BoneTimeline1(frameCount, bezierCount, boneIndex, Property_Rotate) { } -void RotateTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) { +void RotateTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) { SP_UNUSED(direction); pose._rotation = getRelativeValue(time, alpha, blend, pose._rotation, setup._rotation); } \ No newline at end of file diff --git a/spine-cpp/src/spine/ScaleTimeline.cpp b/spine-cpp/src/spine/ScaleTimeline.cpp index 9086e841b..c9b1d3611 100644 --- a/spine-cpp/src/spine/ScaleTimeline.cpp +++ b/spine-cpp/src/spine/ScaleTimeline.cpp @@ -42,11 +42,11 @@ using namespace spine; RTTI_IMPL(ScaleTimeline, BoneTimeline2) -ScaleTimeline::ScaleTimeline(size_t frameCount, size_t bezierCount, int boneIndex) : BoneTimeline2(frameCount, bezierCount, boneIndex, Property_ScaleX, Property_ScaleY) { +ScaleTimeline::ScaleTimeline(size_t frameCount, size_t bezierCount, int boneIndex) + : BoneTimeline2(frameCount, bezierCount, boneIndex, Property_ScaleX, Property_ScaleY) { } -void ScaleTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) { +void ScaleTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) { if (time < _frames[0]) { switch (blend) { case MixBlend_Setup: @@ -82,8 +82,7 @@ void ScaleTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float a } default: { x = getBezierValue(time, i, CurveTimeline2::VALUE1, curveType - CurveTimeline2::BEZIER); - y = getBezierValue(time, i, CurveTimeline2::VALUE2, - curveType + CurveTimeline2::BEZIER_SIZE - CurveTimeline2::BEZIER); + y = getBezierValue(time, i, CurveTimeline2::VALUE2, curveType + CurveTimeline2::BEZIER_SIZE - CurveTimeline2::BEZIER); } } x *= setup._scaleX; @@ -143,20 +142,20 @@ void ScaleTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float a RTTI_IMPL(ScaleXTimeline, BoneTimeline1) -ScaleXTimeline::ScaleXTimeline(size_t frameCount, size_t bezierCount, int boneIndex) : BoneTimeline1(frameCount, bezierCount, boneIndex, Property_ScaleX) { +ScaleXTimeline::ScaleXTimeline(size_t frameCount, size_t bezierCount, int boneIndex) + : BoneTimeline1(frameCount, bezierCount, boneIndex, Property_ScaleX) { } -void ScaleXTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) { +void ScaleXTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) { pose._scaleX = getScaleValue(time, alpha, blend, direction, pose._scaleX, setup._scaleX); } RTTI_IMPL(ScaleYTimeline, BoneTimeline1) -ScaleYTimeline::ScaleYTimeline(size_t frameCount, size_t bezierCount, int boneIndex) : BoneTimeline1(frameCount, bezierCount, boneIndex, Property_ScaleY) { +ScaleYTimeline::ScaleYTimeline(size_t frameCount, size_t bezierCount, int boneIndex) + : BoneTimeline1(frameCount, bezierCount, boneIndex, Property_ScaleY) { } -void ScaleYTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) { +void ScaleYTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) { pose._scaleY = getScaleValue(time, alpha, blend, direction, pose._scaleY, setup._scaleY); } \ No newline at end of file diff --git a/spine-cpp/src/spine/Sequence.cpp b/spine-cpp/src/spine/Sequence.cpp index 542654d8a..c7cd7473d 100644 --- a/spine-cpp/src/spine/Sequence.cpp +++ b/spine-cpp/src/spine/Sequence.cpp @@ -38,11 +38,7 @@ using namespace spine; int Sequence::_nextID = 0; -Sequence::Sequence(int count) : _id(nextID()), - _regions(), - _start(0), - _digits(0), - _setupIndex(0) { +Sequence::Sequence(int count) : _id(nextID()), _regions(), _start(0), _digits(0), _setupIndex(0) { _regions.setSize(count, NULL); } @@ -87,8 +83,7 @@ String &Sequence::getPath(const String &basePath, int index) { _tmpPath = basePath; String frame; frame.append(_start + index); - for (int i = _digits - (int) frame.length(); i > 0; i--) - _tmpPath.append("0"); + for (int i = _digits - (int) frame.length(); i > 0; i--) _tmpPath.append("0"); _tmpPath.append(frame); return _tmpPath; } diff --git a/spine-cpp/src/spine/SequenceTimeline.cpp b/spine-cpp/src/spine/SequenceTimeline.cpp index bac124da9..d51951e76 100644 --- a/spine-cpp/src/spine/SequenceTimeline.cpp +++ b/spine-cpp/src/spine/SequenceTimeline.cpp @@ -43,7 +43,8 @@ using namespace spine; RTTI_IMPL_MULTI(SequenceTimeline, Timeline, SlotTimeline) -SequenceTimeline::SequenceTimeline(size_t frameCount, int slotIndex, Attachment *attachment) : Timeline(frameCount, ENTRIES), SlotTimeline(slotIndex), _attachment((HasTextureRegion *) attachment) { +SequenceTimeline::SequenceTimeline(size_t frameCount, int slotIndex, Attachment *attachment) + : Timeline(frameCount, ENTRIES), SlotTimeline(slotIndex), _attachment((HasTextureRegion *) attachment) { int sequenceId = 0; if (attachment->getRTTI().instanceOf(RegionAttachment::rtti)) sequenceId = ((RegionAttachment *) attachment)->getSequence()->getId(); if (attachment->getRTTI().instanceOf(MeshAttachment::rtti)) sequenceId = ((MeshAttachment *) attachment)->getSequence()->getId(); @@ -62,8 +63,8 @@ void SequenceTimeline::setFrame(int frame, float time, SequenceMode mode, int in frames[frame + DELAY] = delay; } -void SequenceTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, - float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { +void SequenceTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) { SP_UNUSED(alpha); SP_UNUSED(lastTime); SP_UNUSED(pEvents); @@ -74,7 +75,9 @@ void SequenceTimeline::apply(Skeleton &skeleton, float lastTime, float time, Arr Attachment *slotAttachment = pose.getAttachment(); if (slotAttachment != (Attachment *) _attachment) { - if (slotAttachment == NULL || !slotAttachment->getRTTI().instanceOf(VertexAttachment::rtti) || ((VertexAttachment *) slotAttachment)->getTimelineAttachment() != (Attachment *) _attachment) return; + if (slotAttachment == NULL || !slotAttachment->getRTTI().instanceOf(VertexAttachment::rtti) || + ((VertexAttachment *) slotAttachment)->getTimelineAttachment() != (Attachment *) _attachment) + return; } Sequence *sequence = NULL; if (((Attachment *) _attachment)->getRTTI().instanceOf(RegionAttachment::rtti)) sequence = ((RegionAttachment *) _attachment)->getSequence(); diff --git a/spine-cpp/src/spine/ShearTimeline.cpp b/spine-cpp/src/spine/ShearTimeline.cpp index 612bd4f00..5dc4f9640 100644 --- a/spine-cpp/src/spine/ShearTimeline.cpp +++ b/spine-cpp/src/spine/ShearTimeline.cpp @@ -42,11 +42,11 @@ using namespace spine; RTTI_IMPL(ShearTimeline, BoneTimeline2) -ShearTimeline::ShearTimeline(size_t frameCount, size_t bezierCount, int boneIndex) : BoneTimeline2(frameCount, bezierCount, boneIndex, Property_ShearX, Property_ShearY) { +ShearTimeline::ShearTimeline(size_t frameCount, size_t bezierCount, int boneIndex) + : BoneTimeline2(frameCount, bezierCount, boneIndex, Property_ShearX, Property_ShearY) { } -void ShearTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) { +void ShearTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) { if (time < _frames[0]) { switch (blend) { case MixBlend_Setup: @@ -82,8 +82,7 @@ void ShearTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float a } default: { x = getBezierValue(time, i, CurveTimeline2::VALUE1, curveType - CurveTimeline2::BEZIER); - y = getBezierValue(time, i, CurveTimeline2::VALUE2, - curveType + CurveTimeline2::BEZIER_SIZE - CurveTimeline2::BEZIER); + y = getBezierValue(time, i, CurveTimeline2::VALUE2, curveType + CurveTimeline2::BEZIER_SIZE - CurveTimeline2::BEZIER); } } @@ -105,20 +104,20 @@ void ShearTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float a RTTI_IMPL(ShearXTimeline, BoneTimeline1) -ShearXTimeline::ShearXTimeline(size_t frameCount, size_t bezierCount, int boneIndex) : BoneTimeline1(frameCount, bezierCount, boneIndex, Property_ShearX) { +ShearXTimeline::ShearXTimeline(size_t frameCount, size_t bezierCount, int boneIndex) + : BoneTimeline1(frameCount, bezierCount, boneIndex, Property_ShearX) { } -void ShearXTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) { +void ShearXTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) { pose._shearX = getRelativeValue(time, alpha, blend, pose._shearX, setup._shearX); } RTTI_IMPL(ShearYTimeline, BoneTimeline1) -ShearYTimeline::ShearYTimeline(size_t frameCount, size_t bezierCount, int boneIndex) : BoneTimeline1(frameCount, bezierCount, boneIndex, Property_ShearY) { +ShearYTimeline::ShearYTimeline(size_t frameCount, size_t bezierCount, int boneIndex) + : BoneTimeline1(frameCount, bezierCount, boneIndex, Property_ShearY) { } -void ShearYTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) { +void ShearYTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) { pose._shearY = getRelativeValue(time, alpha, blend, pose._shearY, setup._shearY); } \ No newline at end of file diff --git a/spine-cpp/src/spine/Skeleton.cpp b/spine-cpp/src/spine/Skeleton.cpp index 0fc417d30..4de6004dd 100644 --- a/spine-cpp/src/spine/Skeleton.cpp +++ b/spine-cpp/src/spine/Skeleton.cpp @@ -59,8 +59,9 @@ using namespace spine; -Skeleton::Skeleton(SkeletonData &skeletonData) : _data(skeletonData), _skin(NULL), _color(1, 1, 1, 1), _x(0), _y(0), - _scaleX(1), _scaleY(1), _windX(1), _windY(0), _gravityX(0), _gravityY(1), _time(0), _update(0) { +Skeleton::Skeleton(SkeletonData &skeletonData) + : _data(skeletonData), _skin(NULL), _color(1, 1, 1, 1), _x(0), _y(0), _scaleX(1), _scaleY(1), _windX(1), _windY(0), _gravityX(0), _gravityY(1), + _time(0), _update(0) { _bones.ensureCapacity(_data.getBones().size()); for (size_t i = 0; i < _data.getBones().size(); ++i) { @@ -145,7 +146,7 @@ void Skeleton::updateCache() { for (size_t i = 0; i < n; i++) { Constraint *constraint = constraints[i]; constraint->_active = constraint->isSourceActive() && - ((!constraint->getData().getSkinRequired()) || (_skin && _skin->_constraints.contains(&constraint->getData()))); + ((!constraint->getData().getSkinRequired()) || (_skin && _skin->_constraints.contains(&constraint->getData()))); if (constraint->_active) constraint->sort(*this); } @@ -170,20 +171,15 @@ void Skeleton::printUpdateCache() { if (updatable->getRTTI().isExactly(Bone::rtti)) { printf("bone %s\n", ((Bone *) updatable)->getData().getName().buffer()); } else if (updatable->getRTTI().isExactly(TransformConstraint::rtti)) { - printf("transform constraint %s\n", - ((TransformConstraint *) updatable)->getData().getName().buffer()); + printf("transform constraint %s\n", ((TransformConstraint *) updatable)->getData().getName().buffer()); } else if (updatable->getRTTI().isExactly(IkConstraint::rtti)) { - printf("ik constraint %s\n", - ((IkConstraint *) updatable)->getData().getName().buffer()); + printf("ik constraint %s\n", ((IkConstraint *) updatable)->getData().getName().buffer()); } else if (updatable->getRTTI().isExactly(PathConstraint::rtti)) { - printf("path constraint %s\n", - ((PathConstraint *) updatable)->getData().getName().buffer()); + printf("path constraint %s\n", ((PathConstraint *) updatable)->getData().getName().buffer()); } else if (updatable->getRTTI().isExactly(PhysicsConstraint::rtti)) { - printf("physics constraint %s\n", - ((PhysicsConstraint *) updatable)->getData().getName().buffer()); + printf("physics constraint %s\n", ((PhysicsConstraint *) updatable)->getData().getName().buffer()); } else if (updatable->getRTTI().isExactly(Slider::rtti)) { - printf("slider %s\n", - ((Slider *) updatable)->getData().getName().buffer()); + printf("slider %s\n", ((Slider *) updatable)->getData().getName().buffer()); } } } diff --git a/spine-cpp/src/spine/SkeletonBinary.cpp b/spine-cpp/src/spine/SkeletonBinary.cpp index c2b233912..7a6e79b84 100644 --- a/spine-cpp/src/spine/SkeletonBinary.cpp +++ b/spine-cpp/src/spine/SkeletonBinary.cpp @@ -79,16 +79,12 @@ using namespace spine; -SkeletonBinary::SkeletonBinary(Atlas *atlas) : _attachmentLoader( - new (__FILE__, __LINE__) AtlasAttachmentLoader(atlas)), - _error(), _scale(1), _ownsLoader(true) { +SkeletonBinary::SkeletonBinary(Atlas *atlas) + : _attachmentLoader(new(__FILE__, __LINE__) AtlasAttachmentLoader(atlas)), _error(), _scale(1), _ownsLoader(true) { } -SkeletonBinary::SkeletonBinary(AttachmentLoader *attachmentLoader, bool ownsLoader) : _attachmentLoader( - attachmentLoader), - _error(), - _scale(1), - _ownsLoader(ownsLoader) { +SkeletonBinary::SkeletonBinary(AttachmentLoader *attachmentLoader, bool ownsLoader) + : _attachmentLoader(attachmentLoader), _error(), _scale(1), _ownsLoader(ownsLoader) { assert(_attachmentLoader != NULL); } @@ -178,8 +174,7 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons int n = input.readInt(true); Array &strings = skeletonData->_strings.setSize(n, NULL); - for (int i = 0; i < n; i++) - strings[i] = input.readString(); + for (int i = 0; i < n; i++) strings[i] = input.readString(); /* Bones. */ Array &bones = skeletonData->_bones.setSize(input.readInt(true), NULL); @@ -236,8 +231,7 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons case CONSTRAINT_IK: { IkConstraintData *data = new (__FILE__, __LINE__) IkConstraintData(name); Array &constraintBones = data->_bones.setSize(nn = input.readInt(true), NULL); - for (int ii = 0; ii < nn; ii++) - constraintBones[ii] = bones[input.readInt(true)]; + for (int ii = 0; ii < nn; ii++) constraintBones[ii] = bones[input.readInt(true)]; data->_target = bones[input.readInt(true)]; int flags = input.read(); data->_skinRequired = (flags & 1) != 0; @@ -254,8 +248,7 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons case CONSTRAINT_TRANSFORM: { TransformConstraintData *data = new (__FILE__, __LINE__) TransformConstraintData(name); Array &constraintBones = data->_bones.setSize(nn = input.readInt(true), NULL); - for (int ii = 0; ii < nn; ii++) - constraintBones[ii] = bones[input.readInt(true)]; + for (int ii = 0; ii < nn; ii++) constraintBones[ii] = bones[input.readInt(true)]; data->_source = bones[input.readInt(true)]; int flags = input.read(); data->_skinRequired = (flags & 1) != 0; @@ -344,8 +337,7 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons case CONSTRAINT_PATH: { PathConstraintData *data = new (__FILE__, __LINE__) PathConstraintData(name); Array &constraintBones = data->_bones.setSize(nn = input.readInt(true), NULL); - for (int ii = 0; ii < nn; ii++) - constraintBones[ii] = bones[input.readInt(true)]; + for (int ii = 0; ii < nn; ii++) constraintBones[ii] = bones[input.readInt(true)]; data->_slot = slots[input.readInt(true)]; int flags = input.read(); data->_skinRequired = (flags & 1) != 0; @@ -482,8 +474,7 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons setError("Parent mesh not found: ", linkedMesh->_parent.buffer()); return NULL; } - linkedMesh->_mesh->_timelineAttachment = linkedMesh->_inheritTimelines ? static_cast(parent) - : linkedMesh->_mesh; + linkedMesh->_mesh->_timelineAttachment = linkedMesh->_inheritTimelines ? static_cast(parent) : linkedMesh->_mesh; linkedMesh->_mesh->setParentMesh(static_cast(parent)); if (linkedMesh->_mesh->getSequence() == NULL) linkedMesh->_mesh->updateRegion(); } @@ -554,13 +545,11 @@ Skin *SkeletonBinary::readSkin(DataInput &input, SkeletonData &skeletonData, boo int n; Array &from = skeletonData._bones; Array &bones = skin->getBones().setSize(n = input.readInt(true), NULL); - for (int i = 0; i < n; i++) - bones[i] = from[input.readInt(true)]; + for (int i = 0; i < n; i++) bones[i] = from[input.readInt(true)]; Array &fromConstraints = skeletonData._constraints; Array &constraints = skin->getConstraints().setSize(n = input.readInt(true), NULL); - for (int i = 0; i < n; i++) - constraints[i] = fromConstraints[input.readInt(true)]; + for (int i = 0; i < n; i++) constraints[i] = fromConstraints[input.readInt(true)]; slotCount = input.readInt(true); } @@ -582,8 +571,8 @@ Skin *SkeletonBinary::readSkin(DataInput &input, SkeletonData &skeletonData, boo return skin; } -Attachment *SkeletonBinary::readAttachment(DataInput &input, Skin &skin, int slotIndex, const String &attachmentName, - SkeletonData &skeletonData, bool nonessential) { +Attachment *SkeletonBinary::readAttachment(DataInput &input, Skin &skin, int slotIndex, const String &attachmentName, SkeletonData &skeletonData, + bool nonessential) { float scale = _scale; int flags = input.readByte(); @@ -704,8 +693,7 @@ Attachment *SkeletonBinary::readAttachment(DataInput &input, Skin &skin, int slo int verticesLength = readVertices(input, vertices, bones, (flags & 64) != 0); Array lengths; lengths.setSize(verticesLength / 6, 0); - for (int i = 0, n = lengths.size(); i < n; i++) - lengths[i] = input.readFloat() * scale; + for (int i = 0, n = lengths.size(); i < n; i++) lengths[i] = input.readFloat() * scale; int color = nonessential ? input.readInt() : 0; PathAttachment *path = _attachmentLoader->newPathAttachment(skin, name); @@ -818,8 +806,7 @@ Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, S switch (timelineType) { case SLOT_ATTACHMENT: { AttachmentTimeline *timeline = new (__FILE__, __LINE__) AttachmentTimeline(frameCount, slotIndex); - for (int frame = 0; frame < frameCount; ++frame) - timeline->setFrame(frame, input.readFloat(), input.readStringRef()); + for (int frame = 0; frame < frameCount; ++frame) timeline->setFrame(frame, input.readFloat(), input.readStringRef()); timelines.add(timeline); break; } @@ -1125,14 +1112,8 @@ Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, S break; } case PATH_SPACING: { - readTimeline(input, timelines, - *(new (__FILE__, __LINE__) PathConstraintSpacingTimeline(frameCount, - bezierCount, - index)), - data->_spacingMode == SpacingMode_Length || - data->_spacingMode == SpacingMode_Fixed - ? scale - : 1); + readTimeline(input, timelines, *(new (__FILE__, __LINE__) PathConstraintSpacingTimeline(frameCount, bezierCount, index)), + data->_spacingMode == SpacingMode_Length || data->_spacingMode == SpacingMode_Fixed ? scale : 1); break; } case PATH_MIX: { @@ -1176,8 +1157,7 @@ Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, S int type = input.readByte(), frameCount = input.readInt(true); if (type == PHYSICS_RESET) { PhysicsConstraintResetTimeline *timeline = new (__FILE__, __LINE__) PhysicsConstraintResetTimeline(frameCount, index); - for (int frame = 0; frame < frameCount; frame++) - timeline->setFrame(frame, input.readFloat()); + for (int frame = 0; frame < frameCount; frame++) timeline->setFrame(frame, input.readFloat()); timelines.add(timeline); continue; } @@ -1255,8 +1235,8 @@ Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, S Array &vertices = vertexAttachment->_vertices; int deformLength = weighted ? (int) vertices.size() / 3 * 2 : (int) vertices.size(); - DeformTimeline *timeline = new (__FILE__, __LINE__) DeformTimeline(frameCount, input.readInt(true), slotIndex, - vertexAttachment); + DeformTimeline *timeline = new (__FILE__, __LINE__) + DeformTimeline(frameCount, input.readInt(true), slotIndex, vertexAttachment); float time = input.readFloat(); for (int frame = 0, bezier = 0;; ++frame) { @@ -1265,8 +1245,7 @@ Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, S if (end == 0) { if (weighted) { deform.setSize(deformLength, 0); - for (int i = 0; i < deformLength; ++i) - deform[i] = 0; + for (int i = 0; i < deformLength; ++i) deform[i] = 0; } else { deform.clearAndAddAll(vertices); } @@ -1275,15 +1254,12 @@ Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, S size_t start = (size_t) input.readInt(true); end += start; if (scale == 1) { - for (size_t v = start; v < end; ++v) - deform[v] = input.readFloat(); + for (size_t v = start; v < end; ++v) deform[v] = input.readFloat(); } else { - for (size_t v = start; v < end; ++v) - deform[v] = input.readFloat() * scale; + for (size_t v = start; v < end; ++v) deform[v] = input.readFloat() * scale; } if (!weighted) { - for (size_t v = 0, vn = deform.size(); v < vn; ++v) - deform[v] += vertices[v]; + for (size_t v = 0, vn = deform.size(); v < vn; ++v) deform[v] += vertices[v]; } } timeline->setFrame(frame, time, deform); @@ -1334,23 +1310,20 @@ Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, S size_t offsetCount = (size_t) input.readInt(true); Array drawOrder; drawOrder.setSize(slotCount, 0); - for (int ii = (int) slotCount - 1; ii >= 0; --ii) - drawOrder[ii] = -1; + for (int ii = (int) slotCount - 1; ii >= 0; --ii) drawOrder[ii] = -1; Array unchanged; unchanged.setSize(slotCount - offsetCount, 0); size_t originalIndex = 0, unchangedIndex = 0; for (size_t ii = 0; ii < offsetCount; ++ii) { size_t slotIndex = (size_t) input.readInt(true); // Collect unchanged items. - while (originalIndex != slotIndex) - unchanged[unchangedIndex++] = (int) originalIndex++; + while (originalIndex != slotIndex) unchanged[unchangedIndex++] = (int) originalIndex++; // Set changed items. size_t index = originalIndex; drawOrder[index + (size_t) input.readInt(true)] = (int) originalIndex++; } // Collect remaining unchanged items. - while (originalIndex < slotCount) - unchanged[unchangedIndex++] = (int) originalIndex++; + while (originalIndex < slotCount) unchanged[unchangedIndex++] = (int) originalIndex++; // Fill in unchanged items. for (int ii = (int) slotCount - 1; ii >= 0; --ii) if (drawOrder[ii] == -1) drawOrder[ii] = unchanged[--unchangedIndex]; @@ -1433,9 +1406,8 @@ void SkeletonBinary::readTimeline(DataInput &input, Array &timelines timelines.add(&timeline); } -void SkeletonBinary::setBezier(DataInput &input, CurveTimeline &timeline, int bezier, int frame, int value, float time1, - float time2, - float value1, float value2, float scale) { +void SkeletonBinary::setBezier(DataInput &input, CurveTimeline &timeline, int bezier, int frame, int value, float time1, float time2, float value1, + float value2, float scale) { float cx1 = input.readFloat(); float cy1 = input.readFloat(); float cx2 = input.readFloat(); diff --git a/spine-cpp/src/spine/SkeletonBounds.cpp b/spine-cpp/src/spine/SkeletonBounds.cpp index 4bcad8cd4..a4e633f23 100644 --- a/spine-cpp/src/spine/SkeletonBounds.cpp +++ b/spine-cpp/src/spine/SkeletonBounds.cpp @@ -43,8 +43,7 @@ SkeletonBounds::SkeletonBounds() : _minX(0), _minY(0), _maxX(0), _maxY(0) { } SkeletonBounds::~SkeletonBounds() { - for (size_t i = 0, n = _polygons.size(); i < n; i++) - _polygonPool.free(_polygons[i]); + for (size_t i = 0, n = _polygons.size(); i < n; i++) _polygonPool.free(_polygons[i]); _polygons.clear(); } @@ -101,8 +100,7 @@ bool SkeletonBounds::aabbIntersectsSegment(float x1, float y1, float x2, float y float maxX = _maxX; float maxY = _maxY; - if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || - (y1 >= maxY && y2 >= maxY)) { + if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY)) { return false; } diff --git a/spine-cpp/src/spine/SkeletonClipping.cpp b/spine-cpp/src/spine/SkeletonClipping.cpp index 917ba0c9c..f16fe1b93 100644 --- a/spine-cpp/src/spine/SkeletonClipping.cpp +++ b/spine-cpp/src/spine/SkeletonClipping.cpp @@ -85,8 +85,7 @@ void SkeletonClipping::clipEnd() { _clippingPolygon.clear(); } -bool SkeletonClipping::clipTriangles(float *vertices, unsigned short *triangles, - size_t trianglesLength) { +bool SkeletonClipping::clipTriangles(float *vertices, unsigned short *triangles, size_t trianglesLength) { Array &clipOutput = _clipOutput; Array &clippedVertices = _clippedVertices; Array &clippedTriangles = _clippedTriangles; @@ -159,13 +158,11 @@ bool SkeletonClipping::clipTriangles(float *vertices, unsigned short *triangles, return clipped; } -bool SkeletonClipping::clipTriangles(Array &vertices, Array &triangles, Array &uvs, - size_t stride) { +bool SkeletonClipping::clipTriangles(Array &vertices, Array &triangles, Array &uvs, size_t stride) { return clipTriangles(vertices.buffer(), triangles.buffer(), triangles.size(), uvs.buffer(), stride); } -bool SkeletonClipping::clipTriangles(float *vertices, unsigned short *triangles, - size_t trianglesLength, float *uvs, size_t stride) { +bool SkeletonClipping::clipTriangles(float *vertices, unsigned short *triangles, size_t trianglesLength, float *uvs, size_t stride) { Array &clipOutput = _clipOutput; Array &clippedVertices = _clippedVertices; Array &clippedTriangles = _clippedTriangles; @@ -273,8 +270,7 @@ Array &SkeletonClipping::getClippedUVs() { return _clippedUVs; } -bool SkeletonClipping::clip(float x1, float y1, float x2, float y2, float x3, float y3, Array *clippingArea, - Array *output) { +bool SkeletonClipping::clip(float x1, float y1, float x2, float y2, float x3, float y3, Array *clippingArea, Array *output) { Array *originalOutput = output; bool clipped = false; @@ -363,8 +359,7 @@ bool SkeletonClipping::clip(float x1, float y1, float x2, float y2, float x3, fl if (originalOutput != output) { originalOutput->clear(); - for (size_t i = 0, n = output->size() - 2; i < n; ++i) - originalOutput->add((*output)[i]); + for (size_t i = 0, n = output->size() - 2; i < n; ++i) originalOutput->add((*output)[i]); } else originalOutput->setSize(originalOutput->size() - 2, 0); diff --git a/spine-cpp/src/spine/SkeletonData.cpp b/spine-cpp/src/spine/SkeletonData.cpp index 54dce9e60..e37d68909 100644 --- a/spine-cpp/src/spine/SkeletonData.cpp +++ b/spine-cpp/src/spine/SkeletonData.cpp @@ -44,18 +44,9 @@ using namespace spine; -SkeletonData::SkeletonData() : _name(), - _defaultSkin(NULL), - _x(0), - _y(0), - _width(0), - _height(0), - _referenceScale(100), - _version(), - _hash(), - _fps(30), - _imagesPath(), - _audioPath() { +SkeletonData::SkeletonData() + : _name(), _defaultSkin(NULL), _x(0), _y(0), _width(0), _height(0), _referenceScale(100), _version(), _hash(), _fps(30), _imagesPath(), + _audioPath() { } SkeletonData::~SkeletonData() { diff --git a/spine-cpp/src/spine/SkeletonJson.cpp b/spine-cpp/src/spine/SkeletonJson.cpp index 48d59ae4b..dcf043c0b 100644 --- a/spine-cpp/src/spine/SkeletonJson.cpp +++ b/spine-cpp/src/spine/SkeletonJson.cpp @@ -90,15 +90,16 @@ public: Array _weights; }; -#define SKELETON_JSON_ERROR(root, message, value) \ - do { \ - delete skeletonData; \ - setError(root, message, value); \ - return NULL; \ +#define SKELETON_JSON_ERROR(root, message, value) \ + do { \ + delete skeletonData; \ + setError(root, message, value); \ + return NULL; \ } while (0) static FromProperty *fromProperty(const char *type) { - if (strcmp(type, "rotate") == 0) return new FromRotate(); + if (strcmp(type, "rotate") == 0) + return new FromRotate(); else if (strcmp(type, "x") == 0) return new FromX(); else if (strcmp(type, "y") == 0) @@ -114,17 +115,17 @@ static FromProperty *fromProperty(const char *type) { } static float propertyScale(const char *type, float scale) { - if (strcmp(type, "x") == 0 || strcmp(type, "y") == 0) return scale; + if (strcmp(type, "x") == 0 || strcmp(type, "y") == 0) + return scale; else return 1; } -SkeletonJson::SkeletonJson(Atlas *atlas) : _attachmentLoader(new (__FILE__, __LINE__) AtlasAttachmentLoader(atlas)), - _scale(1), _ownsLoader(true) {} +SkeletonJson::SkeletonJson(Atlas *atlas) : _attachmentLoader(new(__FILE__, __LINE__) AtlasAttachmentLoader(atlas)), _scale(1), _ownsLoader(true) { +} -SkeletonJson::SkeletonJson(AttachmentLoader *attachmentLoader, bool ownsLoader) : _attachmentLoader(attachmentLoader), - _scale(1), - _ownsLoader(ownsLoader) { +SkeletonJson::SkeletonJson(AttachmentLoader *attachmentLoader, bool ownsLoader) + : _attachmentLoader(attachmentLoader), _scale(1), _ownsLoader(ownsLoader) { assert(_attachmentLoader != NULL); } @@ -362,7 +363,8 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) { } } - if (from->_to.size() > 0) data->_properties.add(from); + if (from->_to.size() > 0) + data->_properties.add(from); else delete from; } @@ -408,8 +410,7 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) { setup._position = Json::getFloat(constraintMap, "position", 0); if (data->_positionMode == PositionMode_Fixed) setup._position *= _scale; setup._spacing = Json::getFloat(constraintMap, "spacing", 0); - if (data->_spacingMode == SpacingMode_Length || data->_spacingMode == SpacingMode_Fixed) - setup._spacing *= _scale; + if (data->_spacingMode == SpacingMode_Length || data->_spacingMode == SpacingMode_Fixed) setup._spacing *= _scale; setup._mixRotate = Json::getFloat(constraintMap, "mixRotate", 1); setup._mixX = Json::getFloat(constraintMap, "mixX", 1); setup._mixY = Json::getFloat(constraintMap, "mixY", setup._mixX); @@ -536,7 +537,8 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) { if (!slot) SKELETON_JSON_ERROR(root, "Skin slot not found: ", slotEntry->_name); for (Json *entry = slotEntry->_child; entry; entry = entry->_next) { Attachment *attachment = readAttachment(entry, skin, slot->getIndex(), entry->_name, skeletonData); - if (attachment) skin->setAttachment(slot->getIndex(), entry->_name, attachment); + if (attachment) + skin->setAttachment(slot->getIndex(), entry->_name, attachment); else SKELETON_JSON_ERROR(root, "Error reading attachment: ", entry->_name); } @@ -558,8 +560,7 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) { if (skin == NULL) SKELETON_JSON_ERROR(root, "Skin not found: ", linkedMesh->_skin.buffer()); Attachment *parent = skin->getAttachment(linkedMesh->_slotIndex, linkedMesh->_parent); if (parent == NULL) SKELETON_JSON_ERROR(root, "Parent mesh not found: ", linkedMesh->_parent.buffer()); - linkedMesh->_mesh->_timelineAttachment = linkedMesh->_inheritTimelines ? static_cast(parent) - : linkedMesh->_mesh; + linkedMesh->_mesh->_timelineAttachment = linkedMesh->_inheritTimelines ? static_cast(parent) : linkedMesh->_mesh; linkedMesh->_mesh->setParentMesh(static_cast(parent)); if (linkedMesh->_mesh->_region != NULL) linkedMesh->_mesh->updateRegion(); } @@ -673,7 +674,8 @@ Attachment *SkeletonJson::readAttachment(Json *map, Skin *skin, int slotIndex, c const char *parent = Json::getString(map, "parent", NULL); if (parent) { - LinkedMesh *linkedMesh = new (__FILE__, __LINE__) LinkedMesh(mesh, Json::getString(map, "skin", NULL), slotIndex, parent, Json::getBoolean(map, "timelines", true)); + LinkedMesh *linkedMesh = new (__FILE__, __LINE__) + LinkedMesh(mesh, Json::getString(map, "skin", NULL), slotIndex, parent, Json::getBoolean(map, "timelines", true)); _linkedMeshes.add(linkedMesh); return mesh; } @@ -703,8 +705,7 @@ Attachment *SkeletonJson::readAttachment(Json *map, Skin *skin, int slotIndex, c readVertices(map, path, vertexCount << 1); if (!Json::asFloatArray(Json::getItem(map, "lengths"), path->_lengths)) return NULL; - for (int i = 0; i < (int) path->_lengths.size(); i++) - path->_lengths[i] *= scale; + for (int i = 0; i < (int) path->_lengths.size(); i++) path->_lengths[i] *= scale; const char *color = Json::getString(map, "color", NULL); if (color) Color::valueOf(color, path->getColor()); @@ -760,8 +761,7 @@ void SkeletonJson::readVertices(Json *map, VertexAttachment *attachment, size_t } if (verticesLength == vertices.size()) { if (_scale != 1) { - for (int i = 0; i < (int) vertices.size(); ++i) - vertices[i] *= _scale; + for (int i = 0; i < (int) vertices.size(); ++i) vertices[i] *= _scale; } attachment->getVertices().clearAndAddAll(vertices); return; @@ -869,9 +869,7 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { } timelines.add(timeline); } else if (strcmp(timelineMap->_name, "alpha") == 0) { - readTimeline(timelines, keyMap, - new (__FILE__, __LINE__) AlphaTimeline(frames, frames, slotIndex), - 0, 1); + readTimeline(timelines, keyMap, new (__FILE__, __LINE__) AlphaTimeline(frames, frames, slotIndex), 0, 1); } else if (strcmp(timelineMap->_name, "rgba2") == 0) { RGBA2Timeline *timeline = new (__FILE__, __LINE__) RGBA2Timeline(frames, frames * 7, slotIndex); float time = Json::getFloat(keyMap, "time", 0); @@ -988,8 +986,7 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { int frames = timelineMap->_size; if (strcmp(timelineMap->_name, "rotate") == 0) { - readTimeline(timelines, keyMap, - new (__FILE__, __LINE__) RotateTimeline(frames, frames, boneIndex), 0, 1); + readTimeline(timelines, keyMap, new (__FILE__, __LINE__) RotateTimeline(frames, frames, boneIndex), 0, 1); } else if (strcmp(timelineMap->_name, "translate") == 0) { readTimeline(timelines, keyMap, new (__FILE__, __LINE__) TranslateTimeline(frames, frames << 1, boneIndex), "x", "y", 0, _scale); } else if (strcmp(timelineMap->_name, "translatex") == 0) { @@ -1033,9 +1030,7 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { return NULL; } int constraintIndex = skeletonData->_constraints.indexOf(constraint); - IkConstraintTimeline *timeline = new (__FILE__, __LINE__) IkConstraintTimeline(timelineMap->_size, - timelineMap->_size << 1, - constraintIndex); + IkConstraintTimeline *timeline = new (__FILE__, __LINE__) IkConstraintTimeline(timelineMap->_size, timelineMap->_size << 1, constraintIndex); float time = Json::getFloat(keyMap, "time", 0); float mix = Json::getFloat(keyMap, "mix", 1), softness = Json::getFloat(keyMap, "softness", 0) * _scale; for (int frame = 0, bezier = 0;; frame++) { @@ -1064,7 +1059,8 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { } // Transform constraint timelines. - for (Json *timelineMap = Json::getItem(map, "transform") ? Json::getItem(map, "transform")->_child : NULL; timelineMap; timelineMap = timelineMap->_next) { + for (Json *timelineMap = Json::getItem(map, "transform") ? Json::getItem(map, "transform")->_child : NULL; timelineMap; + timelineMap = timelineMap->_next) { Json *keyMap = timelineMap->_child; if (keyMap == NULL) continue; TransformConstraintData *constraint = skeletonData->findConstraint(timelineMap->_name); @@ -1073,8 +1069,8 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { return NULL; } int constraintIndex = skeletonData->_constraints.indexOf(constraint); - TransformConstraintTimeline *timeline = new (__FILE__, __LINE__) TransformConstraintTimeline( - timelineMap->_size, timelineMap->_size * 6, constraintIndex); + TransformConstraintTimeline *timeline = new (__FILE__, __LINE__) + TransformConstraintTimeline(timelineMap->_size, timelineMap->_size * 6, constraintIndex); float time = Json::getFloat(keyMap, "time", 0); float mixRotate = Json::getFloat(keyMap, "mixRotate", 1); float mixX = Json::getFloat(keyMap, "mixX", 1), mixY = Json::getFloat(keyMap, "mixY", mixX); @@ -1115,7 +1111,8 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { } // Path constraint timelines. - for (Json *constraintMap = Json::getItem(map, "path") ? Json::getItem(map, "path")->_child : NULL; constraintMap; constraintMap = constraintMap->_next) { + for (Json *constraintMap = Json::getItem(map, "path") ? Json::getItem(map, "path")->_child : NULL; constraintMap; + constraintMap = constraintMap->_next) { PathConstraintData *constraint = skeletonData->findConstraint(constraintMap->_name); if (!constraint) { ArrayUtils::deleteElements(timelines); @@ -1129,20 +1126,14 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { int frames = timelineMap->_size; const char *timelineName = timelineMap->_name; if (strcmp(timelineName, "position") == 0) { - PathConstraintPositionTimeline *timeline = new (__FILE__, __LINE__) PathConstraintPositionTimeline( - frames, frames, index); + PathConstraintPositionTimeline *timeline = new (__FILE__, __LINE__) PathConstraintPositionTimeline(frames, frames, index); readTimeline(timelines, keyMap, timeline, 0, constraint->_positionMode == PositionMode_Fixed ? _scale : 1); } else if (strcmp(timelineName, "spacing") == 0) { - CurveTimeline1 *timeline = new (__FILE__, __LINE__) PathConstraintSpacingTimeline(frames, frames, - index); + CurveTimeline1 *timeline = new (__FILE__, __LINE__) PathConstraintSpacingTimeline(frames, frames, index); readTimeline(timelines, keyMap, timeline, 0, - constraint->_spacingMode == SpacingMode_Length || - constraint->_spacingMode == SpacingMode_Fixed - ? _scale - : 1); + constraint->_spacingMode == SpacingMode_Length || constraint->_spacingMode == SpacingMode_Fixed ? _scale : 1); } else if (strcmp(timelineName, "mix") == 0) { - PathConstraintMixTimeline *timeline = new (__FILE__, __LINE__) PathConstraintMixTimeline(frames, - frames * 3, index); + PathConstraintMixTimeline *timeline = new (__FILE__, __LINE__) PathConstraintMixTimeline(frames, frames * 3, index); float time = Json::getFloat(keyMap, "time", 0); float mixRotate = Json::getFloat(keyMap, "mixRotate", 1); float mixX = Json::getFloat(keyMap, "mixX", 1); @@ -1174,7 +1165,8 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { } // Physics constraint timelines. - for (Json *constraintMap = Json::getItem(map, "physics") ? Json::getItem(map, "physics")->_child : NULL; constraintMap; constraintMap = constraintMap->_next) { + for (Json *constraintMap = Json::getItem(map, "physics") ? Json::getItem(map, "physics")->_child : NULL; constraintMap; + constraintMap = constraintMap->_next) { int index = -1; if (constraintMap->_name && strlen(constraintMap->_name) > 0) { PhysicsConstraintData *constraint = skeletonData->findConstraint(constraintMap->_name); @@ -1192,8 +1184,7 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { const char *timelineName = timelineMap->_name; if (strcmp(timelineName, "reset") == 0) { PhysicsConstraintResetTimeline *timeline = new (__FILE__, __LINE__) PhysicsConstraintResetTimeline(frames, index); - for (int frame = 0; keyMap != NULL; keyMap = keyMap->_next, frame++) - timeline->setFrame(frame, Json::getFloat(keyMap, "time", 0)); + for (int frame = 0; keyMap != NULL; keyMap = keyMap->_next, frame++) timeline->setFrame(frame, Json::getFloat(keyMap, "time", 0)); timelines.add(timeline); continue; } @@ -1223,7 +1214,8 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { } // Slider timelines. - for (Json *constraintMap = Json::getItem(map, "slider") ? Json::getItem(map, "slider")->_child : NULL; constraintMap; constraintMap = constraintMap->_next) { + for (Json *constraintMap = Json::getItem(map, "slider") ? Json::getItem(map, "slider")->_child : NULL; constraintMap; + constraintMap = constraintMap->_next) { SliderData *constraint = skeletonData->findConstraint(constraintMap->_name); if (!constraint) { ArrayUtils::deleteElements(timelines); @@ -1244,7 +1236,8 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { } // Attachment timelines. - for (Json *attachmentsMap = Json::getItem(map, "attachments") ? Json::getItem(map, "attachments")->_child : NULL; attachmentsMap; attachmentsMap = attachmentsMap->_next) { + for (Json *attachmentsMap = Json::getItem(map, "attachments") ? Json::getItem(map, "attachments")->_child : NULL; attachmentsMap; + attachmentsMap = attachmentsMap->_next) { Skin *skin = skeletonData->findSkin(attachmentsMap->_name); if (!skin) { ArrayUtils::deleteElements(timelines); @@ -1269,8 +1262,7 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { Array &vertices = vertexAttachment->_vertices; int deformLength = weighted ? (int) vertices.size() / 3 * 2 : (int) vertices.size(); - DeformTimeline *timeline = new (__FILE__, __LINE__) DeformTimeline(frames, - frames, slotIndex, vertexAttachment); + DeformTimeline *timeline = new (__FILE__, __LINE__) DeformTimeline(frames, frames, slotIndex, vertexAttachment); float time = Json::getFloat(keyMap, "time", 0); for (int frame = 0, bezier = 0;; frame++) { Array deform; @@ -1318,7 +1310,8 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { for (int frame = 0; keyMap != NULL; keyMap = keyMap->_next, frame++) { float delay = Json::getFloat(keyMap, "delay", lastDelay); timeline->setFrame(frame, Json::getFloat(keyMap, "time", 0), - SequenceMode_valueOf(Json::getString(keyMap, "mode", "hold")), Json::getInt(keyMap, "index", 0), delay); + SequenceMode_valueOf(Json::getString(keyMap, "mode", "hold")), Json::getInt(keyMap, "index", 0), + delay); lastDelay = delay; } timelines.add(timeline); @@ -1339,8 +1332,7 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { Json *offsets = Json::getItem(keyMap, "offsets"); if (offsets) { drawOrder2.setSize(slotCount, 0); - for (int i = slotCount - 1; i >= 0; i--) - drawOrder2[i] = -1; + for (int i = slotCount - 1; i >= 0; i--) drawOrder2[i] = -1; Array unchanged; unchanged.setSize(slotCount - offsets->_size, 0); int originalIndex = 0, unchangedIndex = 0; @@ -1351,15 +1343,13 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { return NULL; } /* Collect unchanged items. */ - while (originalIndex != slot->_index) - unchanged[unchangedIndex++] = originalIndex++; + while (originalIndex != slot->_index) unchanged[unchangedIndex++] = originalIndex++; /* Set changed items. */ int index = originalIndex; drawOrder2[index + Json::getInt(offsetMap, "offset", 0)] = originalIndex++; } /* Collect remaining unchanged items. */ - while (originalIndex < slotCount) - unchanged[unchangedIndex++] = originalIndex++; + while (originalIndex < slotCount) unchanged[unchangedIndex++] = originalIndex++; /* Fill in unchanged items. */ for (int i = slotCount - 1; i >= 0; i--) if (drawOrder2[i] == -1) drawOrder2[i] = unchanged[--unchangedIndex]; @@ -1394,8 +1384,7 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { } float duration = 0; - for (size_t i = 0; i < timelines.size(); i++) - duration = MathUtil::max(duration, timelines[i]->getDuration()); + for (size_t i = 0; i < timelines.size(); i++) duration = MathUtil::max(duration, timelines[i]->getDuration()); return new (__FILE__, __LINE__) Animation(String(map->_name), timelines, duration); } @@ -1443,9 +1432,8 @@ void SkeletonJson::readTimeline(Array &timelines, Json *keyMap, Curv } } -int SkeletonJson::readCurve(Json *curve, CurveTimeline *timeline, int bezier, int frame, int value, float time1, - float time2, - float value1, float value2, float scale) { +int SkeletonJson::readCurve(Json *curve, CurveTimeline *timeline, int bezier, int frame, int value, float time1, float time2, float value1, + float value2, float scale) { if (curve->_type == Json::JSON_STRING) { if (strcmp(curve->_valueString, "stepped") == 0) timeline->setStepped(frame); return bezier; @@ -1462,9 +1450,8 @@ int SkeletonJson::readCurve(Json *curve, CurveTimeline *timeline, int bezier, in return bezier + 1; } -void SkeletonJson::setBezier(CurveTimeline *timeline, int frame, int value, int bezier, float time1, float value1, float cx1, - float cy1, - float cx2, float cy2, float time2, float value2) { +void SkeletonJson::setBezier(CurveTimeline *timeline, int frame, int value, int bezier, float time1, float value1, float cx1, float cy1, float cx2, + float cy2, float time2, float value2) { timeline->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } diff --git a/spine-cpp/src/spine/SkeletonRenderer.cpp b/spine-cpp/src/spine/SkeletonRenderer.cpp index c500a6fc1..2d20412ba 100644 --- a/spine-cpp/src/spine/SkeletonRenderer.cpp +++ b/spine-cpp/src/spine/SkeletonRenderer.cpp @@ -65,7 +65,8 @@ static RenderCommand *createRenderCommand(BlockAllocator &allocator, int numVert return cmd; } -static RenderCommand *batchSubCommands(BlockAllocator &allocator, Array &commands, int first, int last, int numVertices, int numIndices) { +static RenderCommand *batchSubCommands(BlockAllocator &allocator, Array &commands, int first, int last, int numVertices, + int numIndices) { RenderCommand *batched = createRenderCommand(allocator, numVertices, numIndices, commands[first]->blendMode, commands[first]->texture); float *positions = batched->positions; float *uvs = batched->uvs; @@ -79,8 +80,7 @@ static RenderCommand *batchSubCommands(BlockAllocator &allocator, Arrayuvs, sizeof(float) * 2 * cmd->numVertices); memcpy(colors, cmd->colors, sizeof(int32_t) * cmd->numVertices); memcpy(darkColors, cmd->darkColors, sizeof(int32_t) * cmd->numVertices); - for (int ii = 0; ii < cmd->numIndices; ii++) - indices[ii] = cmd->indices[ii] + indicesOffset; + for (int ii = 0; ii < cmd->numIndices; ii++) indices[ii] = cmd->indices[ii] + indicesOffset; indicesOffset += cmd->numVertices; positions += 2 * cmd->numVertices; uvs += 2 * cmd->numVertices; @@ -110,11 +110,8 @@ static RenderCommand *batchCommands(BlockAllocator &allocator, Arraytexture == first->texture && - cmd->blendMode == first->blendMode && - cmd->colors[0] == first->colors[0] && - cmd->darkColors[0] == first->darkColors[0] && - numIndices + cmd->numIndices < 0xffff) { + if (cmd != nullptr && cmd->texture == first->texture && cmd->blendMode == first->blendMode && cmd->colors[0] == first->colors[0] && + cmd->darkColors[0] == first->darkColors[0] && numIndices + cmd->numIndices < 0xffff) { numVertices += cmd->numVertices; numIndices += cmd->numIndices; } else { @@ -217,7 +214,8 @@ RenderCommand *SkeletonRenderer::render(Skeleton &skeleton) { uint32_t darkColor = 0xff000000; if (slot.getAppliedPose().hasDarkColor()) { Color &slotDarkColor = slot.getAppliedPose().getDarkColor(); - darkColor = 0xff000000 | (static_cast(slotDarkColor.r * 255) << 16) | (static_cast(slotDarkColor.g * 255) << 8) | static_cast(slotDarkColor.b * 255); + darkColor = 0xff000000 | (static_cast(slotDarkColor.r * 255) << 16) | (static_cast(slotDarkColor.g * 255) << 8) | + static_cast(slotDarkColor.b * 255); } if (clipper.isClipping()) { diff --git a/spine-cpp/src/spine/Skin.cpp b/spine-cpp/src/spine/Skin.cpp index 58aaa6914..f789196c5 100644 --- a/spine-cpp/src/spine/Skin.cpp +++ b/spine-cpp/src/spine/Skin.cpp @@ -50,8 +50,7 @@ static void disposeAttachment(Attachment *attachment) { } void Skin::AttachmentMap::put(size_t slotIndex, const String &attachmentName, Attachment *attachment) { - if (slotIndex >= _buckets.size()) - _buckets.setSize(slotIndex + 1, Array()); + if (slotIndex >= _buckets.size()) _buckets.setSize(slotIndex + 1, Array()); Array &bucket = _buckets[slotIndex]; int existing = findInBucket(bucket, attachmentName); attachment->reference(); @@ -179,8 +178,7 @@ void Skin::copySkin(Skin *other) { while (entries.hasNext()) { AttachmentMap::Entry &entry = entries.next(); if (entry._attachment->getRTTI().isExactly(MeshAttachment::rtti)) - setAttachment(entry._slotIndex, entry._name, - static_cast(entry._attachment)->newLinkedMesh()); + setAttachment(entry._slotIndex, entry._name, static_cast(entry._attachment)->newLinkedMesh()); else setAttachment(entry._slotIndex, entry._name, entry._attachment->copy()); } diff --git a/spine-cpp/src/spine/Slider.cpp b/spine-cpp/src/spine/Slider.cpp index db26792bb..b2b7b3f7e 100644 --- a/spine-cpp/src/spine/Slider.cpp +++ b/spine-cpp/src/spine/Slider.cpp @@ -70,7 +70,8 @@ void Slider::update(Skeleton &skeleton, Physics physics) { if (_bone != NULL) { if (!_bone->isActive()) return; if (_data._local) _bone->_applied->validateLocalTransform(skeleton); - p._time = _data._offset + (_data._property->value(skeleton, *_bone->_applied, _data._local, _offsets) - _data._property->_offset) * _data._scale; + p._time = _data._offset + + (_data._property->value(skeleton, *_bone->_applied, _data._local, _offsets) - _data._property->_offset) * _data._scale; if (_data._loop) p._time = animation->getDuration() + MathUtil::fmod(p._time, animation->getDuration()); else @@ -79,11 +80,9 @@ void Slider::update(Skeleton &skeleton, Physics physics) { Array &bones = skeleton._bones; const Array &indices = animation->getBones(); - for (size_t i = 0, n = indices.size(); i < n; i++) - bones[indices[i]]->_applied->modifyLocal(skeleton); + for (size_t i = 0, n = indices.size(); i < n; i++) bones[indices[i]]->_applied->modifyLocal(skeleton); - animation->apply(skeleton, p._time, p._time, _data._loop, NULL, p._mix, _data._additive ? MixBlend_Add : MixBlend_Replace, - MixDirection_In, true); + animation->apply(skeleton, p._time, p._time, _data._loop, NULL, p._mix, _data._additive ? MixBlend_Add : MixBlend_Replace, MixDirection_In, true); } void Slider::sort(Skeleton &skeleton) { @@ -113,8 +112,7 @@ void Slider::sort(Skeleton &skeleton) { } else if (t->getRTTI().instanceOf(PhysicsConstraintTimeline::rtti)) { PhysicsConstraintTimeline *timeline = (PhysicsConstraintTimeline *) t; if (timeline->getConstraintIndex() == -1) { - for (size_t ii = 0; ii < physicsCount; ii++) - skeleton.constrained(*physics[ii]); + for (size_t ii = 0; ii < physicsCount; ii++) skeleton.constrained(*physics[ii]); } else skeleton.constrained((Posed &) *constraints[timeline->getConstraintIndex()]); } else if (t->getRTTI().instanceOf(ConstraintTimeline::rtti)) { diff --git a/spine-cpp/src/spine/SliderData.cpp b/spine-cpp/src/spine/SliderData.cpp index d08fc91e6..1b6e0500e 100644 --- a/spine-cpp/src/spine/SliderData.cpp +++ b/spine-cpp/src/spine/SliderData.cpp @@ -35,15 +35,9 @@ using namespace spine; RTTI_IMPL(SliderData, ConstraintData) -SliderData::SliderData(const String &name) : ConstraintDataGeneric(name), - _animation(NULL), - _additive(false), - _loop(false), - _bone(NULL), - _property(NULL), - _offset(0.0f), - _scale(0.0f), - _local(false) { +SliderData::SliderData(const String &name) + : ConstraintDataGeneric(name), _animation(NULL), _additive(false), _loop(false), _bone(NULL), _property(NULL), _offset(0.0f), + _scale(0.0f), _local(false) { } Constraint *SliderData::create(Skeleton &skeleton) { diff --git a/spine-cpp/src/spine/SliderMixTimeline.cpp b/spine-cpp/src/spine/SliderMixTimeline.cpp index afcc28d6a..081067119 100644 --- a/spine-cpp/src/spine/SliderMixTimeline.cpp +++ b/spine-cpp/src/spine/SliderMixTimeline.cpp @@ -42,11 +42,8 @@ using namespace spine; RTTI_IMPL(SliderMixTimeline, ConstraintTimeline1) -SliderMixTimeline::SliderMixTimeline(size_t frameCount, size_t bezierCount, - int sliderIndex) : ConstraintTimeline1(frameCount, - bezierCount, - sliderIndex, - Property_SliderMix) { +SliderMixTimeline::SliderMixTimeline(size_t frameCount, size_t bezierCount, int sliderIndex) + : ConstraintTimeline1(frameCount, bezierCount, sliderIndex, Property_SliderMix) { PropertyId ids[] = {((PropertyId) Property_SliderMix << 32) | sliderIndex}; setPropertyIds(ids, 1); } @@ -54,8 +51,8 @@ SliderMixTimeline::SliderMixTimeline(size_t frameCount, size_t bezierCount, SliderMixTimeline::~SliderMixTimeline() { } -void SliderMixTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, - float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { +void SliderMixTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); SP_UNUSED(direction); diff --git a/spine-cpp/src/spine/SliderTimeline.cpp b/spine-cpp/src/spine/SliderTimeline.cpp index faa3c1a7c..ed145f757 100644 --- a/spine-cpp/src/spine/SliderTimeline.cpp +++ b/spine-cpp/src/spine/SliderTimeline.cpp @@ -42,11 +42,8 @@ using namespace spine; RTTI_IMPL(SliderTimeline, ConstraintTimeline1) -SliderTimeline::SliderTimeline(size_t frameCount, size_t bezierCount, - int sliderIndex) : ConstraintTimeline1(frameCount, - bezierCount, - sliderIndex, - Property_SliderTime) { +SliderTimeline::SliderTimeline(size_t frameCount, size_t bezierCount, int sliderIndex) + : ConstraintTimeline1(frameCount, bezierCount, sliderIndex, Property_SliderTime) { PropertyId ids[] = {((PropertyId) Property_SliderTime << 32) | sliderIndex}; setPropertyIds(ids, 1); } @@ -54,8 +51,8 @@ SliderTimeline::SliderTimeline(size_t frameCount, size_t bezierCount, SliderTimeline::~SliderTimeline() { } -void SliderTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, - float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { +void SliderTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); SP_UNUSED(direction); diff --git a/spine-cpp/src/spine/Slot.cpp b/spine-cpp/src/spine/Slot.cpp index 261783e4e..0287440da 100644 --- a/spine-cpp/src/spine/Slot.cpp +++ b/spine-cpp/src/spine/Slot.cpp @@ -37,10 +37,8 @@ using namespace spine; -Slot::Slot(SlotData &data, Skeleton &skeleton) : PosedGeneric(data), - _skeleton(skeleton), - _bone(*skeleton.getBones()[data._boneData._index]), - _attachmentState(0) { +Slot::Slot(SlotData &data, Skeleton &skeleton) + : PosedGeneric(data), _skeleton(skeleton), _bone(*skeleton.getBones()[data._boneData._index]), _attachmentState(0) { if (data.getSetupPose().hasDarkColor()) { _pose._hasDarkColor = true; diff --git a/spine-cpp/src/spine/SlotCurveTimeline.cpp b/spine-cpp/src/spine/SlotCurveTimeline.cpp index b54c254ac..d4f016af8 100644 --- a/spine-cpp/src/spine/SlotCurveTimeline.cpp +++ b/spine-cpp/src/spine/SlotCurveTimeline.cpp @@ -45,8 +45,8 @@ SlotCurveTimeline::SlotCurveTimeline(size_t frameCount, size_t frameEntries, siz SlotCurveTimeline::~SlotCurveTimeline() { } -void SlotCurveTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, - MixBlend blend, MixDirection direction, bool appliedPose) { +void SlotCurveTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); SP_UNUSED(direction); diff --git a/spine-cpp/src/spine/SlotData.cpp b/spine-cpp/src/spine/SlotData.cpp index 509eda2ec..9d261f8ad 100644 --- a/spine-cpp/src/spine/SlotData.cpp +++ b/spine-cpp/src/spine/SlotData.cpp @@ -35,12 +35,8 @@ using namespace spine; -SlotData::SlotData(int index, const String &name, BoneData &boneData) : PosedDataGeneric(name), - _index(index), - _boneData(boneData), - _attachmentName(), - _blendMode(BlendMode_Normal), - _visible(true) { +SlotData::SlotData(int index, const String &name, BoneData &boneData) + : PosedDataGeneric(name), _index(index), _boneData(boneData), _attachmentName(), _blendMode(BlendMode_Normal), _visible(true) { assert(index >= 0); } diff --git a/spine-cpp/src/spine/SlotPose.cpp b/spine-cpp/src/spine/SlotPose.cpp index a253ef8ef..d13074f7a 100644 --- a/spine-cpp/src/spine/SlotPose.cpp +++ b/spine-cpp/src/spine/SlotPose.cpp @@ -73,12 +73,10 @@ void SlotPose::setAttachment(Attachment *attachment) { if (_attachment == attachment) return; // Check if we need to clear deform based on timeline attachment - if (!attachment || - !_attachment || - !attachment->getRTTI().instanceOf(VertexAttachment::rtti) || + if (!attachment || !_attachment || !attachment->getRTTI().instanceOf(VertexAttachment::rtti) || !_attachment->getRTTI().instanceOf(VertexAttachment::rtti) || static_cast(attachment)->getTimelineAttachment() != - static_cast(_attachment)->getTimelineAttachment()) { + static_cast(_attachment)->getTimelineAttachment()) { _deform.clear(); } _attachment = attachment; diff --git a/spine-cpp/src/spine/Timeline.cpp b/spine-cpp/src/spine/Timeline.cpp index 63643a4f1..d35eb1403 100644 --- a/spine-cpp/src/spine/Timeline.cpp +++ b/spine-cpp/src/spine/Timeline.cpp @@ -36,8 +36,7 @@ using namespace spine; RTTI_IMPL_NOPARENT(Timeline) -Timeline::Timeline(size_t frameCount, size_t frameEntries) - : _propertyIds(), _frames(), _frameEntries(frameEntries) { +Timeline::Timeline(size_t frameCount, size_t frameEntries) : _propertyIds(), _frames(), _frameEntries(frameEntries) { _frames.setSize(frameCount * frameEntries, 0); } diff --git a/spine-cpp/src/spine/TransformConstraint.cpp b/spine-cpp/src/spine/TransformConstraint.cpp index 04fc34a53..3d329347f 100644 --- a/spine-cpp/src/spine/TransformConstraint.cpp +++ b/spine-cpp/src/spine/TransformConstraint.cpp @@ -41,7 +41,8 @@ using namespace spine; RTTI_IMPL(TransformConstraint, Constraint) -TransformConstraint::TransformConstraint(TransformConstraintData &data, Skeleton &skeleton) : ConstraintGeneric(data) { +TransformConstraint::TransformConstraint(TransformConstraintData &data, Skeleton &skeleton) + : ConstraintGeneric(data) { _bones.ensureCapacity(data.getBones().size()); for (size_t i = 0; i < data.getBones().size(); i++) { @@ -109,8 +110,7 @@ void TransformConstraint::sort(Skeleton &skeleton) { size_t boneCount = _bones.size(); bool worldTarget = !_data._localTarget; if (worldTarget) { - for (size_t i = 0; i < boneCount; i++) - skeleton.sortBone(bones[i]->_bone); + for (size_t i = 0; i < boneCount; i++) skeleton.sortBone(bones[i]->_bone); } skeleton._updateCache.add(this); for (size_t i = 0; i < boneCount; i++) { @@ -118,8 +118,7 @@ void TransformConstraint::sort(Skeleton &skeleton) { skeleton.sortReset(bone->_children); skeleton.constrained(*bone); } - for (size_t i = 0; i < boneCount; i++) - bones[i]->_bone->_sorted = worldTarget; + for (size_t i = 0; i < boneCount; i++) bones[i]->_bone->_sorted = worldTarget; } bool TransformConstraint::isSourceActive() { diff --git a/spine-cpp/src/spine/TransformConstraintData.cpp b/spine-cpp/src/spine/TransformConstraintData.cpp index fd1925484..9aacefecf 100644 --- a/spine-cpp/src/spine/TransformConstraintData.cpp +++ b/spine-cpp/src/spine/TransformConstraintData.cpp @@ -54,12 +54,9 @@ RTTI_IMPL(ToScaleY, ToProperty) RTTI_IMPL(FromShearY, FromProperty) RTTI_IMPL(ToShearY, ToProperty) -TransformConstraintData::TransformConstraintData(const String &name) : ConstraintDataGeneric(name), - _source(NULL), - _localSource(false), - _localTarget(false), - _additive(false), - _clamp(false) { +TransformConstraintData::TransformConstraintData(const String &name) + : ConstraintDataGeneric(name), _source(NULL), _localSource(false), _localTarget(false), + _additive(false), _clamp(false) { for (int i = 0; i < 6; i++) { _offsets[i] = 0; } @@ -176,7 +173,9 @@ ToProperty::~ToProperty() { float FromRotate::value(Skeleton &skeleton, BonePose &source, bool local, float *offsets) { if (local) return source._rotation + offsets[TransformConstraintData::ROTATION]; float sx = skeleton.getScaleX(), sy = skeleton.getScaleY(); - float value = MathUtil::atan2(source._c / sy, source._a / sx) * MathUtil::Rad_Deg + ((source._a * source._d - source._b * source._c) * sx * sy > 0 ? offsets[TransformConstraintData::ROTATION] : -offsets[TransformConstraintData::ROTATION]); + float value = MathUtil::atan2(source._c / sy, source._a / sx) * MathUtil::Rad_Deg + + ((source._a * source._d - source._b * source._c) * sx * sy > 0 ? offsets[TransformConstraintData::ROTATION] + : -offsets[TransformConstraintData::ROTATION]); if (value < 0) value += 360; return value; } @@ -207,7 +206,9 @@ void ToRotate::apply(Skeleton &skeleton, TransformConstraintPose &pose, BonePose } float FromX::value(Skeleton &skeleton, BonePose &source, bool local, float *offsets) { - return local ? source._x + offsets[TransformConstraintData::X] : (offsets[TransformConstraintData::X] * source._a + offsets[TransformConstraintData::Y] * source._b + source._worldX) / skeleton.getScaleX(); + return local + ? source._x + offsets[TransformConstraintData::X] + : (offsets[TransformConstraintData::X] * source._a + offsets[TransformConstraintData::Y] * source._b + source._worldX) / skeleton.getScaleX(); } float ToX::mix(TransformConstraintPose &pose) { @@ -224,7 +225,9 @@ void ToX::apply(Skeleton &skeleton, TransformConstraintPose &pose, BonePose &bon } float FromY::value(Skeleton &skeleton, BonePose &source, bool local, float *offsets) { - return local ? source._y + offsets[TransformConstraintData::Y] : (offsets[TransformConstraintData::X] * source._c + offsets[TransformConstraintData::Y] * source._d + source._worldY) / skeleton.getScaleY(); + return local + ? source._y + offsets[TransformConstraintData::Y] + : (offsets[TransformConstraintData::X] * source._c + offsets[TransformConstraintData::Y] * source._d + source._worldY) / skeleton.getScaleY(); } float ToY::mix(TransformConstraintPose &pose) { @@ -303,7 +306,8 @@ void ToScaleY::apply(Skeleton &skeleton, TransformConstraintPose &pose, BonePose float FromShearY::value(Skeleton &skeleton, BonePose &source, bool local, float *offsets) { if (local) return source._shearY + offsets[TransformConstraintData::SHEARY]; float ix = 1 / skeleton.getScaleX(), iy = 1 / skeleton.getScaleY(); - return (MathUtil::atan2(source._d * iy, source._b * ix) - MathUtil::atan2(source._c * iy, source._a * ix)) * MathUtil::Rad_Deg - 90 + offsets[TransformConstraintData::SHEARY]; + return (MathUtil::atan2(source._d * iy, source._b * ix) - MathUtil::atan2(source._c * iy, source._a * ix)) * MathUtil::Rad_Deg - 90 + + offsets[TransformConstraintData::SHEARY]; } float ToShearY::mix(TransformConstraintPose &pose) { diff --git a/spine-cpp/src/spine/TransformConstraintTimeline.cpp b/spine-cpp/src/spine/TransformConstraintTimeline.cpp index ed379cc07..ecdea639b 100644 --- a/spine-cpp/src/spine/TransformConstraintTimeline.cpp +++ b/spine-cpp/src/spine/TransformConstraintTimeline.cpp @@ -44,11 +44,8 @@ using namespace spine; RTTI_IMPL_MULTI(TransformConstraintTimeline, CurveTimeline, ConstraintTimeline) -TransformConstraintTimeline::TransformConstraintTimeline(size_t frameCount, size_t bezierCount, - int transformConstraintIndex) : CurveTimeline(frameCount, - TransformConstraintTimeline::ENTRIES, - bezierCount), - ConstraintTimeline(transformConstraintIndex) { +TransformConstraintTimeline::TransformConstraintTimeline(size_t frameCount, size_t bezierCount, int transformConstraintIndex) + : CurveTimeline(frameCount, TransformConstraintTimeline::ENTRIES, bezierCount), ConstraintTimeline(transformConstraintIndex) { PropertyId ids[] = {((PropertyId) Property_TransformConstraint << 32) | transformConstraintIndex}; setPropertyIds(ids, 1); } @@ -56,8 +53,8 @@ TransformConstraintTimeline::TransformConstraintTimeline(size_t frameCount, size TransformConstraintTimeline::~TransformConstraintTimeline() { } -void TransformConstraintTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, - float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { +void TransformConstraintTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, + MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); SP_UNUSED(direction); @@ -161,8 +158,8 @@ void TransformConstraintTimeline::apply(Skeleton &skeleton, float lastTime, floa } } -void TransformConstraintTimeline::setFrame(int frame, float time, float mixRotate, float mixX, float mixY, - float mixScaleX, float mixScaleY, float mixShearY) { +void TransformConstraintTimeline::setFrame(int frame, float time, float mixRotate, float mixX, float mixY, float mixScaleX, float mixScaleY, + float mixShearY) { frame *= ENTRIES; _frames[frame] = time; _frames[frame + ROTATE] = mixRotate; diff --git a/spine-cpp/src/spine/TranslateTimeline.cpp b/spine-cpp/src/spine/TranslateTimeline.cpp index da1f5a7a1..d1aa5b5d2 100644 --- a/spine-cpp/src/spine/TranslateTimeline.cpp +++ b/spine-cpp/src/spine/TranslateTimeline.cpp @@ -42,11 +42,11 @@ using namespace spine; RTTI_IMPL(TranslateTimeline, BoneTimeline2) -TranslateTimeline::TranslateTimeline(size_t frameCount, size_t bezierCount, int boneIndex) : BoneTimeline2(frameCount, bezierCount, boneIndex, Property_X, Property_Y) { +TranslateTimeline::TranslateTimeline(size_t frameCount, size_t bezierCount, int boneIndex) + : BoneTimeline2(frameCount, bezierCount, boneIndex, Property_X, Property_Y) { } -void TranslateTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) { +void TranslateTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) { if (time < _frames[0]) { switch (blend) { case MixBlend_Setup: @@ -82,8 +82,7 @@ void TranslateTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, flo } default: { x = getBezierValue(time, i, CurveTimeline2::VALUE1, curveType - CurveTimeline2::BEZIER); - y = getBezierValue(time, i, CurveTimeline2::VALUE2, - curveType + CurveTimeline2::BEZIER_SIZE - CurveTimeline2::BEZIER); + y = getBezierValue(time, i, CurveTimeline2::VALUE2, curveType + CurveTimeline2::BEZIER_SIZE - CurveTimeline2::BEZIER); } } @@ -105,20 +104,20 @@ void TranslateTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, flo RTTI_IMPL(TranslateXTimeline, BoneTimeline1) -TranslateXTimeline::TranslateXTimeline(size_t frameCount, size_t bezierCount, int boneIndex) : BoneTimeline1(frameCount, bezierCount, boneIndex, Property_X) { +TranslateXTimeline::TranslateXTimeline(size_t frameCount, size_t bezierCount, int boneIndex) + : BoneTimeline1(frameCount, bezierCount, boneIndex, Property_X) { } -void TranslateXTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) { +void TranslateXTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) { pose._x = getRelativeValue(time, alpha, blend, pose._x, setup._x); } RTTI_IMPL(TranslateYTimeline, BoneTimeline1) -TranslateYTimeline::TranslateYTimeline(size_t frameCount, size_t bezierCount, int boneIndex) : BoneTimeline1(frameCount, bezierCount, boneIndex, Property_Y) { +TranslateYTimeline::TranslateYTimeline(size_t frameCount, size_t bezierCount, int boneIndex) + : BoneTimeline1(frameCount, bezierCount, boneIndex, Property_Y) { } -void TranslateYTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, - MixDirection direction) { +void TranslateYTimeline::apply(BoneLocal &pose, BoneLocal &setup, float time, float alpha, MixBlend blend, MixDirection direction) { pose._y = getRelativeValue(time, alpha, blend, pose._y, setup._y); } \ No newline at end of file diff --git a/spine-cpp/src/spine/Triangulator.cpp b/spine-cpp/src/spine/Triangulator.cpp index a4a4bfc15..0b639f04f 100644 --- a/spine-cpp/src/spine/Triangulator.cpp +++ b/spine-cpp/src/spine/Triangulator.cpp @@ -126,13 +126,11 @@ Array &Triangulator::triangulate(Array &vertices) { Array *> &Triangulator::decompose(Array &vertices, Array &triangles) { Array *> &convexPolygons = _convexPolygons; - for (size_t i = 0, n = convexPolygons.size(); i < n; ++i) - _polygonPool.free(convexPolygons[i]); + for (size_t i = 0, n = convexPolygons.size(); i < n; ++i) _polygonPool.free(convexPolygons[i]); convexPolygons.clear(); Array *> &convexPolygonsIndices = _convexPolygonsIndices; - for (size_t i = 0, n = convexPolygonsIndices.size(); i < n; ++i) - _polygonIndicesPool.free(convexPolygonsIndices[i]); + for (size_t i = 0, n = convexPolygonsIndices.size(); i < n; ++i) _polygonIndicesPool.free(convexPolygonsIndices[i]); convexPolygonsIndices.clear(); Array *polygonIndices = _polygonIndicesPool.obtain(); @@ -270,9 +268,7 @@ bool Triangulator::isConcave(int index, int vertexCount, Array &vertices, int current = indices[index] << 1; int next = indices[(index + 1) % vertexCount] << 1; - return !positiveArea(vertices[previous], vertices[previous + 1], - vertices[current], vertices[current + 1], - vertices[next], vertices[next + 1]); + return !positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]); } bool Triangulator::positiveArea(float p1x, float p1y, float p2x, float p2y, float p3x, float p3y) { diff --git a/spine-cpp/src/spine/VertexAttachment.cpp b/spine-cpp/src/spine/VertexAttachment.cpp index 14e4d73a0..4469259ea 100644 --- a/spine-cpp/src/spine/VertexAttachment.cpp +++ b/spine-cpp/src/spine/VertexAttachment.cpp @@ -38,16 +38,15 @@ using namespace spine; RTTI_IMPL(VertexAttachment, Attachment) -VertexAttachment::VertexAttachment(const String &name) : Attachment(name), _worldVerticesLength(0), - _timelineAttachment(this), _id(getNextID()) { +VertexAttachment::VertexAttachment(const String &name) : Attachment(name), _worldVerticesLength(0), _timelineAttachment(this), _id(getNextID()) { } VertexAttachment::~VertexAttachment() { } -void VertexAttachment::computeWorldVertices(Skeleton &skeleton, Slot &slot, size_t start, size_t count, Array &worldVertices, - size_t offset, size_t stride) { +void VertexAttachment::computeWorldVertices(Skeleton &skeleton, Slot &slot, size_t start, size_t count, Array &worldVertices, size_t offset, + size_t stride) { computeWorldVertices(skeleton, slot, start, count, worldVertices.buffer(), offset, stride); } diff --git a/spine-cpp/tests/JsonWriter.h b/spine-cpp/tests/JsonWriter.h index 7d873ccce..8044e023e 100644 --- a/spine-cpp/tests/JsonWriter.h +++ b/spine-cpp/tests/JsonWriter.h @@ -6,183 +6,200 @@ namespace spine { -class JsonWriter { -private: - String buffer; - int depth; - bool needsComma; + class JsonWriter { + private: + String buffer; + int depth; + bool needsComma; -public: - JsonWriter() : depth(0), needsComma(false) {} + public: + JsonWriter() : depth(0), needsComma(false) { + } - void writeObjectStart() { - writeCommaIfNeeded(); - buffer.append("{"); - depth++; - needsComma = false; - } + void writeObjectStart() { + writeCommaIfNeeded(); + buffer.append("{"); + depth++; + needsComma = false; + } - void writeObjectEnd() { - depth--; - if (needsComma) { - buffer.append("\n"); - writeIndent(); - } - buffer.append("}"); - needsComma = true; - } + void writeObjectEnd() { + depth--; + if (needsComma) { + buffer.append("\n"); + writeIndent(); + } + buffer.append("}"); + needsComma = true; + } - void writeArrayStart() { - writeCommaIfNeeded(); - buffer.append("["); - depth++; - needsComma = false; - } + void writeArrayStart() { + writeCommaIfNeeded(); + buffer.append("["); + depth++; + needsComma = false; + } - void writeArrayEnd() { - depth--; - if (needsComma) { - buffer.append("\n"); - writeIndent(); - } - buffer.append("]"); - needsComma = true; - } + void writeArrayEnd() { + depth--; + if (needsComma) { + buffer.append("\n"); + writeIndent(); + } + buffer.append("]"); + needsComma = true; + } - void writeName(const char* name) { - writeCommaIfNeeded(); - buffer.append("\n"); - writeIndent(); - buffer.append("\""); - buffer.append(name); - buffer.append("\": "); - needsComma = false; - } + void writeName(const char *name) { + writeCommaIfNeeded(); + buffer.append("\n"); + writeIndent(); + buffer.append("\""); + buffer.append(name); + buffer.append("\": "); + needsComma = false; + } - void writeValue(const String& value) { - writeCommaIfNeeded(); - if (value.buffer() == nullptr) { - buffer.append("null"); - } else { - buffer.append("\""); - buffer.append(escapeString(value)); - buffer.append("\""); - } - needsComma = true; - } + void writeValue(const String &value) { + writeCommaIfNeeded(); + if (value.buffer() == nullptr) { + buffer.append("null"); + } else { + buffer.append("\""); + buffer.append(escapeString(value)); + buffer.append("\""); + } + needsComma = true; + } - void writeValue(const char* value) { - writeCommaIfNeeded(); - if (value == nullptr) { - buffer.append("null"); - } else { - buffer.append("\""); - buffer.append(escapeString(String(value))); - buffer.append("\""); - } - needsComma = true; - } + void writeValue(const char *value) { + writeCommaIfNeeded(); + if (value == nullptr) { + buffer.append("null"); + } else { + buffer.append("\""); + buffer.append(escapeString(String(value))); + buffer.append("\""); + } + needsComma = true; + } - void writeValue(float value) { - writeCommaIfNeeded(); + void writeValue(float value) { + writeCommaIfNeeded(); - // Format float with 6 decimal places - char temp[32]; - snprintf(temp, sizeof(temp), "%.6f", value); + // Format float with 6 decimal places + char temp[32]; + snprintf(temp, sizeof(temp), "%.6f", value); - // Remove trailing zeros - char* end = temp + strlen(temp) - 1; - while (end > temp && *end == '0') { - end--; - } - if (*end == '.') { - end--; - } - *(end + 1) = '\0'; + // Remove trailing zeros + char *end = temp + strlen(temp) - 1; + while (end > temp && *end == '0') { + end--; + } + if (*end == '.') { + end--; + } + *(end + 1) = '\0'; - buffer.append(temp); - needsComma = true; - } + buffer.append(temp); + needsComma = true; + } - void writeValue(int value) { - writeCommaIfNeeded(); - char temp[32]; - snprintf(temp, sizeof(temp), "%d", value); - buffer.append(temp); - needsComma = true; - } + void writeValue(int value) { + writeCommaIfNeeded(); + char temp[32]; + snprintf(temp, sizeof(temp), "%d", value); + buffer.append(temp); + needsComma = true; + } - void writeValue(bool value) { - writeCommaIfNeeded(); - buffer.append(value ? "true" : "false"); - needsComma = true; - } + void writeValue(bool value) { + writeCommaIfNeeded(); + buffer.append(value ? "true" : "false"); + needsComma = true; + } - void writeValue(size_t value) { - writeCommaIfNeeded(); - char temp[32]; - snprintf(temp, sizeof(temp), "%zu", value); - buffer.append(temp); - needsComma = true; - } + void writeValue(size_t value) { + writeCommaIfNeeded(); + char temp[32]; + snprintf(temp, sizeof(temp), "%zu", value); + buffer.append(temp); + needsComma = true; + } - void writeValue(PropertyId value) { - writeCommaIfNeeded(); - char temp[32]; - snprintf(temp, sizeof(temp), "%lld", (long long)value); - buffer.append(temp); - needsComma = true; - } + void writeValue(PropertyId value) { + writeCommaIfNeeded(); + char temp[32]; + snprintf(temp, sizeof(temp), "%lld", (long long) value); + buffer.append(temp); + needsComma = true; + } - void writeNull() { - writeCommaIfNeeded(); - buffer.append("null"); - needsComma = true; - } + void writeNull() { + writeCommaIfNeeded(); + buffer.append("null"); + needsComma = true; + } - void close() { - buffer.append("\n"); - } + void close() { + buffer.append("\n"); + } - String getString() const { - return buffer; - } + String getString() const { + return buffer; + } -private: - void writeCommaIfNeeded() { - if (needsComma) { - buffer.append(","); - } - } + private: + void writeCommaIfNeeded() { + if (needsComma) { + buffer.append(","); + } + } - void writeIndent() { - for (int i = 0; i < depth; i++) { - buffer.append(" "); - } - } + void writeIndent() { + for (int i = 0; i < depth; i++) { + buffer.append(" "); + } + } - String escapeString(const String& str) { - String result(""); - const char* chars = str.buffer(); - if (chars) { - for (size_t i = 0; i < str.length(); i++) { - char c = chars[i]; - switch (c) { - case '"': result.append("\\\""); break; - case '\\': result.append("\\\\"); break; - case '\b': result.append("\\b"); break; - case '\f': result.append("\\f"); break; - case '\n': result.append("\\n"); break; - case '\r': result.append("\\r"); break; - case '\t': result.append("\\t"); break; - default: result.append(c); break; - } - } - } - return result; - } -}; + String escapeString(const String &str) { + String result(""); + const char *chars = str.buffer(); + if (chars) { + for (size_t i = 0; i < str.length(); i++) { + char c = chars[i]; + switch (c) { + case '"': + result.append("\\\""); + break; + case '\\': + result.append("\\\\"); + break; + case '\b': + result.append("\\b"); + break; + case '\f': + result.append("\\f"); + break; + case '\n': + result.append("\\n"); + break; + case '\r': + result.append("\\r"); + break; + case '\t': + result.append("\\t"); + break; + default: + result.append(c); + break; + } + } + } + return result; + } + }; -} // namespace spine +}// namespace spine #endif \ No newline at end of file diff --git a/spine-cpp/tests/SkeletonSerializer.h b/spine-cpp/tests/SkeletonSerializer.h index efcfec6b3..9ccf71a35 100644 --- a/spine-cpp/tests/SkeletonSerializer.h +++ b/spine-cpp/tests/SkeletonSerializer.h @@ -8,4249 +8,4292 @@ namespace spine { -class SkeletonSerializer { -private: - HashMap _visitedObjects; - JsonWriter _json; - -public: - SkeletonSerializer() {} - ~SkeletonSerializer() {} - - String serializeSkeletonData(SkeletonData* data) { - _visitedObjects.clear(); - _json = JsonWriter(); - writeSkeletonData(data); - return _json.getString(); - } - - String serializeSkeleton(Skeleton* skeleton) { - _visitedObjects.clear(); - _json = JsonWriter(); - writeSkeleton(skeleton); - return _json.getString(); - } - - String serializeAnimationState(AnimationState* state) { - _visitedObjects.clear(); - _json = JsonWriter(); - writeAnimationState(state); - return _json.getString(); - } - -private: - void writeAnimation(Animation* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("Animation"); - - _json.writeName("timelines"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getTimelines().size(); i++) { - writeTimeline(obj->getTimelines()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeName("bones"); - writeIntArray(obj->getBones()); - - _json.writeName("name"); - _json.writeValue(obj->getName()); - - _json.writeObjectEnd(); - } - - void writeAlphaTimeline(AlphaTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("AlphaTimeline"); - - _json.writeName("slotIndex"); - _json.writeValue(obj->getSlotIndex()); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeAttachmentTimeline(AttachmentTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("AttachmentTimeline"); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("slotIndex"); - _json.writeValue(obj->getSlotIndex()); - - _json.writeName("attachmentNames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getAttachmentNames().size(); i++) { - _json.writeValue(obj->getAttachmentNames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeDeformTimeline(DeformTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("DeformTimeline"); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("attachment"); - writeVertexAttachment(obj->getAttachment()); - - _json.writeName("vertices"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getVertices().size(); i++) { - Array& nestedArray = obj->getVertices()[i]; - _json.writeArrayStart(); - for (size_t j = 0; j < nestedArray.size(); j++) { - _json.writeValue(nestedArray[j]); - } - _json.writeArrayEnd(); - } - _json.writeArrayEnd(); - - _json.writeName("slotIndex"); - _json.writeValue(obj->getSlotIndex()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeDrawOrderTimeline(DrawOrderTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("DrawOrderTimeline"); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("drawOrders"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getDrawOrders().size(); i++) { - Array& nestedArray = obj->getDrawOrders()[i]; - _json.writeArrayStart(); - for (size_t j = 0; j < nestedArray.size(); j++) { - _json.writeValue(nestedArray[j]); - } - _json.writeArrayEnd(); - } - _json.writeArrayEnd(); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeEventTimeline(EventTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("EventTimeline"); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("events"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getEvents().size(); i++) { - writeEvent(obj->getEvents()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeIkConstraintTimeline(IkConstraintTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("IkConstraintTimeline"); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("constraintIndex"); - _json.writeValue(obj->getConstraintIndex()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeInheritTimeline(InheritTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("InheritTimeline"); - - _json.writeName("boneIndex"); - _json.writeValue(obj->getBoneIndex()); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writePathConstraintMixTimeline(PathConstraintMixTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("PathConstraintMixTimeline"); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("constraintIndex"); - _json.writeValue(obj->getConstraintIndex()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writePathConstraintPositionTimeline(PathConstraintPositionTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("PathConstraintPositionTimeline"); - - _json.writeName("constraintIndex"); - _json.writeValue(obj->getConstraintIndex()); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writePathConstraintSpacingTimeline(PathConstraintSpacingTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("PathConstraintSpacingTimeline"); - - _json.writeName("constraintIndex"); - _json.writeValue(obj->getConstraintIndex()); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writePhysicsConstraintDampingTimeline(PhysicsConstraintDampingTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("PhysicsConstraintDampingTimeline"); - - _json.writeName("constraintIndex"); - _json.writeValue(obj->getConstraintIndex()); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writePhysicsConstraintGravityTimeline(PhysicsConstraintGravityTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("PhysicsConstraintGravityTimeline"); - - _json.writeName("constraintIndex"); - _json.writeValue(obj->getConstraintIndex()); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writePhysicsConstraintInertiaTimeline(PhysicsConstraintInertiaTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("PhysicsConstraintInertiaTimeline"); - - _json.writeName("constraintIndex"); - _json.writeValue(obj->getConstraintIndex()); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writePhysicsConstraintMassTimeline(PhysicsConstraintMassTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("PhysicsConstraintMassTimeline"); - - _json.writeName("constraintIndex"); - _json.writeValue(obj->getConstraintIndex()); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writePhysicsConstraintMixTimeline(PhysicsConstraintMixTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("PhysicsConstraintMixTimeline"); - - _json.writeName("constraintIndex"); - _json.writeValue(obj->getConstraintIndex()); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writePhysicsConstraintResetTimeline(PhysicsConstraintResetTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("PhysicsConstraintResetTimeline"); - - _json.writeName("constraintIndex"); - _json.writeValue(obj->getConstraintIndex()); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writePhysicsConstraintStrengthTimeline(PhysicsConstraintStrengthTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("PhysicsConstraintStrengthTimeline"); - - _json.writeName("constraintIndex"); - _json.writeValue(obj->getConstraintIndex()); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writePhysicsConstraintWindTimeline(PhysicsConstraintWindTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("PhysicsConstraintWindTimeline"); - - _json.writeName("constraintIndex"); - _json.writeValue(obj->getConstraintIndex()); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeRGB2Timeline(RGB2Timeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("RGB2Timeline"); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("slotIndex"); - _json.writeValue(obj->getSlotIndex()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeRGBA2Timeline(RGBA2Timeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("RGBA2Timeline"); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("slotIndex"); - _json.writeValue(obj->getSlotIndex()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeRGBATimeline(RGBATimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("RGBATimeline"); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("slotIndex"); - _json.writeValue(obj->getSlotIndex()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeRGBTimeline(RGBTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("RGBTimeline"); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("slotIndex"); - _json.writeValue(obj->getSlotIndex()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeRotateTimeline(RotateTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("RotateTimeline"); - - _json.writeName("boneIndex"); - _json.writeValue(obj->getBoneIndex()); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeScaleTimeline(ScaleTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("ScaleTimeline"); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("boneIndex"); - _json.writeValue(obj->getBoneIndex()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeScaleXTimeline(ScaleXTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("ScaleXTimeline"); - - _json.writeName("boneIndex"); - _json.writeValue(obj->getBoneIndex()); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeScaleYTimeline(ScaleYTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("ScaleYTimeline"); - - _json.writeName("boneIndex"); - _json.writeValue(obj->getBoneIndex()); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeSequenceTimeline(SequenceTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("SequenceTimeline"); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("slotIndex"); - _json.writeValue(obj->getSlotIndex()); - - _json.writeName("attachment"); - writeAttachment(obj->getAttachment()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeShearTimeline(ShearTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("ShearTimeline"); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("boneIndex"); - _json.writeValue(obj->getBoneIndex()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeShearXTimeline(ShearXTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("ShearXTimeline"); - - _json.writeName("boneIndex"); - _json.writeValue(obj->getBoneIndex()); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeShearYTimeline(ShearYTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("ShearYTimeline"); - - _json.writeName("boneIndex"); - _json.writeValue(obj->getBoneIndex()); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeSliderMixTimeline(SliderMixTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("SliderMixTimeline"); - - _json.writeName("constraintIndex"); - _json.writeValue(obj->getConstraintIndex()); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeSliderTimeline(SliderTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("SliderTimeline"); - - _json.writeName("constraintIndex"); - _json.writeValue(obj->getConstraintIndex()); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeTimeline(Timeline* obj) { - if (obj->getRTTI().instanceOf(AlphaTimeline::rtti)) { - writeAlphaTimeline((AlphaTimeline*)obj); - } else if (obj->getRTTI().instanceOf(AttachmentTimeline::rtti)) { - writeAttachmentTimeline((AttachmentTimeline*)obj); - } else if (obj->getRTTI().instanceOf(DeformTimeline::rtti)) { - writeDeformTimeline((DeformTimeline*)obj); - } else if (obj->getRTTI().instanceOf(DrawOrderTimeline::rtti)) { - writeDrawOrderTimeline((DrawOrderTimeline*)obj); - } else if (obj->getRTTI().instanceOf(EventTimeline::rtti)) { - writeEventTimeline((EventTimeline*)obj); - } else if (obj->getRTTI().instanceOf(IkConstraintTimeline::rtti)) { - writeIkConstraintTimeline((IkConstraintTimeline*)obj); - } else if (obj->getRTTI().instanceOf(InheritTimeline::rtti)) { - writeInheritTimeline((InheritTimeline*)obj); - } else if (obj->getRTTI().instanceOf(PathConstraintMixTimeline::rtti)) { - writePathConstraintMixTimeline((PathConstraintMixTimeline*)obj); - } else if (obj->getRTTI().instanceOf(PathConstraintPositionTimeline::rtti)) { - writePathConstraintPositionTimeline((PathConstraintPositionTimeline*)obj); - } else if (obj->getRTTI().instanceOf(PathConstraintSpacingTimeline::rtti)) { - writePathConstraintSpacingTimeline((PathConstraintSpacingTimeline*)obj); - } else if (obj->getRTTI().instanceOf(PhysicsConstraintDampingTimeline::rtti)) { - writePhysicsConstraintDampingTimeline((PhysicsConstraintDampingTimeline*)obj); - } else if (obj->getRTTI().instanceOf(PhysicsConstraintGravityTimeline::rtti)) { - writePhysicsConstraintGravityTimeline((PhysicsConstraintGravityTimeline*)obj); - } else if (obj->getRTTI().instanceOf(PhysicsConstraintInertiaTimeline::rtti)) { - writePhysicsConstraintInertiaTimeline((PhysicsConstraintInertiaTimeline*)obj); - } else if (obj->getRTTI().instanceOf(PhysicsConstraintMassTimeline::rtti)) { - writePhysicsConstraintMassTimeline((PhysicsConstraintMassTimeline*)obj); - } else if (obj->getRTTI().instanceOf(PhysicsConstraintMixTimeline::rtti)) { - writePhysicsConstraintMixTimeline((PhysicsConstraintMixTimeline*)obj); - } else if (obj->getRTTI().instanceOf(PhysicsConstraintResetTimeline::rtti)) { - writePhysicsConstraintResetTimeline((PhysicsConstraintResetTimeline*)obj); - } else if (obj->getRTTI().instanceOf(PhysicsConstraintStrengthTimeline::rtti)) { - writePhysicsConstraintStrengthTimeline((PhysicsConstraintStrengthTimeline*)obj); - } else if (obj->getRTTI().instanceOf(PhysicsConstraintWindTimeline::rtti)) { - writePhysicsConstraintWindTimeline((PhysicsConstraintWindTimeline*)obj); - } else if (obj->getRTTI().instanceOf(RGB2Timeline::rtti)) { - writeRGB2Timeline((RGB2Timeline*)obj); - } else if (obj->getRTTI().instanceOf(RGBA2Timeline::rtti)) { - writeRGBA2Timeline((RGBA2Timeline*)obj); - } else if (obj->getRTTI().instanceOf(RGBATimeline::rtti)) { - writeRGBATimeline((RGBATimeline*)obj); - } else if (obj->getRTTI().instanceOf(RGBTimeline::rtti)) { - writeRGBTimeline((RGBTimeline*)obj); - } else if (obj->getRTTI().instanceOf(RotateTimeline::rtti)) { - writeRotateTimeline((RotateTimeline*)obj); - } else if (obj->getRTTI().instanceOf(ScaleTimeline::rtti)) { - writeScaleTimeline((ScaleTimeline*)obj); - } else if (obj->getRTTI().instanceOf(ScaleXTimeline::rtti)) { - writeScaleXTimeline((ScaleXTimeline*)obj); - } else if (obj->getRTTI().instanceOf(ScaleYTimeline::rtti)) { - writeScaleYTimeline((ScaleYTimeline*)obj); - } else if (obj->getRTTI().instanceOf(SequenceTimeline::rtti)) { - writeSequenceTimeline((SequenceTimeline*)obj); - } else if (obj->getRTTI().instanceOf(ShearTimeline::rtti)) { - writeShearTimeline((ShearTimeline*)obj); - } else if (obj->getRTTI().instanceOf(ShearXTimeline::rtti)) { - writeShearXTimeline((ShearXTimeline*)obj); - } else if (obj->getRTTI().instanceOf(ShearYTimeline::rtti)) { - writeShearYTimeline((ShearYTimeline*)obj); - } else if (obj->getRTTI().instanceOf(SliderMixTimeline::rtti)) { - writeSliderMixTimeline((SliderMixTimeline*)obj); - } else if (obj->getRTTI().instanceOf(SliderTimeline::rtti)) { - writeSliderTimeline((SliderTimeline*)obj); - } else if (obj->getRTTI().instanceOf(TransformConstraintTimeline::rtti)) { - writeTransformConstraintTimeline((TransformConstraintTimeline*)obj); - } else if (obj->getRTTI().instanceOf(TranslateTimeline::rtti)) { - writeTranslateTimeline((TranslateTimeline*)obj); - } else if (obj->getRTTI().instanceOf(TranslateXTimeline::rtti)) { - writeTranslateXTimeline((TranslateXTimeline*)obj); - } else if (obj->getRTTI().instanceOf(TranslateYTimeline::rtti)) { - writeTranslateYTimeline((TranslateYTimeline*)obj); - } else { - fprintf(stderr, "Error: Unknown Timeline type\n"); exit(1); - } - } - - void writeTransformConstraintTimeline(TransformConstraintTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("TransformConstraintTimeline"); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("constraintIndex"); - _json.writeValue(obj->getConstraintIndex()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeTranslateTimeline(TranslateTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("TranslateTimeline"); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("boneIndex"); - _json.writeValue(obj->getBoneIndex()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeTranslateXTimeline(TranslateXTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("TranslateXTimeline"); - - _json.writeName("boneIndex"); - _json.writeValue(obj->getBoneIndex()); - - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); - - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); - - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); - - _json.writeObjectEnd(); - } - - void writeTranslateYTimeline(TranslateYTimeline* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("TranslateYTimeline"); + class SkeletonSerializer { + private: + HashMap _visitedObjects; + JsonWriter _json; + + public: + SkeletonSerializer() { + } + ~SkeletonSerializer() { + } + + String serializeSkeletonData(SkeletonData *data) { + _visitedObjects.clear(); + _json = JsonWriter(); + writeSkeletonData(data); + return _json.getString(); + } + + String serializeSkeleton(Skeleton *skeleton) { + _visitedObjects.clear(); + _json = JsonWriter(); + writeSkeleton(skeleton); + return _json.getString(); + } + + String serializeAnimationState(AnimationState *state) { + _visitedObjects.clear(); + _json = JsonWriter(); + writeAnimationState(state); + return _json.getString(); + } + + private: + void writeAnimation(Animation *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("Animation"); + + _json.writeName("timelines"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getTimelines().size(); i++) { + writeTimeline(obj->getTimelines()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeName("bones"); + writeIntArray(obj->getBones()); + + _json.writeName("name"); + _json.writeValue(obj->getName()); + + _json.writeObjectEnd(); + } + + void writeAlphaTimeline(AlphaTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("AlphaTimeline"); + + _json.writeName("slotIndex"); + _json.writeValue(obj->getSlotIndex()); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeAttachmentTimeline(AttachmentTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("AttachmentTimeline"); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("slotIndex"); + _json.writeValue(obj->getSlotIndex()); + + _json.writeName("attachmentNames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getAttachmentNames().size(); i++) { + _json.writeValue(obj->getAttachmentNames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeDeformTimeline(DeformTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("DeformTimeline"); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("attachment"); + writeVertexAttachment(obj->getAttachment()); + + _json.writeName("vertices"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getVertices().size(); i++) { + Array &nestedArray = obj->getVertices()[i]; + _json.writeArrayStart(); + for (size_t j = 0; j < nestedArray.size(); j++) { + _json.writeValue(nestedArray[j]); + } + _json.writeArrayEnd(); + } + _json.writeArrayEnd(); + + _json.writeName("slotIndex"); + _json.writeValue(obj->getSlotIndex()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeDrawOrderTimeline(DrawOrderTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("DrawOrderTimeline"); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("drawOrders"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getDrawOrders().size(); i++) { + Array &nestedArray = obj->getDrawOrders()[i]; + _json.writeArrayStart(); + for (size_t j = 0; j < nestedArray.size(); j++) { + _json.writeValue(nestedArray[j]); + } + _json.writeArrayEnd(); + } + _json.writeArrayEnd(); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeEventTimeline(EventTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("EventTimeline"); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("events"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getEvents().size(); i++) { + writeEvent(obj->getEvents()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeIkConstraintTimeline(IkConstraintTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("IkConstraintTimeline"); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("constraintIndex"); + _json.writeValue(obj->getConstraintIndex()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeInheritTimeline(InheritTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("InheritTimeline"); + + _json.writeName("boneIndex"); + _json.writeValue(obj->getBoneIndex()); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writePathConstraintMixTimeline(PathConstraintMixTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("PathConstraintMixTimeline"); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("constraintIndex"); + _json.writeValue(obj->getConstraintIndex()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writePathConstraintPositionTimeline(PathConstraintPositionTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("PathConstraintPositionTimeline"); + + _json.writeName("constraintIndex"); + _json.writeValue(obj->getConstraintIndex()); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writePathConstraintSpacingTimeline(PathConstraintSpacingTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("PathConstraintSpacingTimeline"); + + _json.writeName("constraintIndex"); + _json.writeValue(obj->getConstraintIndex()); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writePhysicsConstraintDampingTimeline(PhysicsConstraintDampingTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("PhysicsConstraintDampingTimeline"); + + _json.writeName("constraintIndex"); + _json.writeValue(obj->getConstraintIndex()); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writePhysicsConstraintGravityTimeline(PhysicsConstraintGravityTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("PhysicsConstraintGravityTimeline"); + + _json.writeName("constraintIndex"); + _json.writeValue(obj->getConstraintIndex()); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writePhysicsConstraintInertiaTimeline(PhysicsConstraintInertiaTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("PhysicsConstraintInertiaTimeline"); + + _json.writeName("constraintIndex"); + _json.writeValue(obj->getConstraintIndex()); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writePhysicsConstraintMassTimeline(PhysicsConstraintMassTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("PhysicsConstraintMassTimeline"); + + _json.writeName("constraintIndex"); + _json.writeValue(obj->getConstraintIndex()); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writePhysicsConstraintMixTimeline(PhysicsConstraintMixTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("PhysicsConstraintMixTimeline"); + + _json.writeName("constraintIndex"); + _json.writeValue(obj->getConstraintIndex()); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writePhysicsConstraintResetTimeline(PhysicsConstraintResetTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("PhysicsConstraintResetTimeline"); + + _json.writeName("constraintIndex"); + _json.writeValue(obj->getConstraintIndex()); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writePhysicsConstraintStrengthTimeline(PhysicsConstraintStrengthTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("PhysicsConstraintStrengthTimeline"); + + _json.writeName("constraintIndex"); + _json.writeValue(obj->getConstraintIndex()); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writePhysicsConstraintWindTimeline(PhysicsConstraintWindTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("PhysicsConstraintWindTimeline"); + + _json.writeName("constraintIndex"); + _json.writeValue(obj->getConstraintIndex()); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeRGB2Timeline(RGB2Timeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("RGB2Timeline"); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("slotIndex"); + _json.writeValue(obj->getSlotIndex()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeRGBA2Timeline(RGBA2Timeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("RGBA2Timeline"); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("slotIndex"); + _json.writeValue(obj->getSlotIndex()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeRGBATimeline(RGBATimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("RGBATimeline"); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("slotIndex"); + _json.writeValue(obj->getSlotIndex()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeRGBTimeline(RGBTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("RGBTimeline"); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("slotIndex"); + _json.writeValue(obj->getSlotIndex()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeRotateTimeline(RotateTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("RotateTimeline"); + + _json.writeName("boneIndex"); + _json.writeValue(obj->getBoneIndex()); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeScaleTimeline(ScaleTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("ScaleTimeline"); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("boneIndex"); + _json.writeValue(obj->getBoneIndex()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeScaleXTimeline(ScaleXTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("ScaleXTimeline"); + + _json.writeName("boneIndex"); + _json.writeValue(obj->getBoneIndex()); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeScaleYTimeline(ScaleYTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("ScaleYTimeline"); + + _json.writeName("boneIndex"); + _json.writeValue(obj->getBoneIndex()); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeSequenceTimeline(SequenceTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("SequenceTimeline"); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("slotIndex"); + _json.writeValue(obj->getSlotIndex()); + + _json.writeName("attachment"); + writeAttachment(obj->getAttachment()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeShearTimeline(ShearTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("ShearTimeline"); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("boneIndex"); + _json.writeValue(obj->getBoneIndex()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeShearXTimeline(ShearXTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("ShearXTimeline"); + + _json.writeName("boneIndex"); + _json.writeValue(obj->getBoneIndex()); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeShearYTimeline(ShearYTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("ShearYTimeline"); + + _json.writeName("boneIndex"); + _json.writeValue(obj->getBoneIndex()); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeSliderMixTimeline(SliderMixTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("SliderMixTimeline"); + + _json.writeName("constraintIndex"); + _json.writeValue(obj->getConstraintIndex()); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeSliderTimeline(SliderTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("SliderTimeline"); + + _json.writeName("constraintIndex"); + _json.writeValue(obj->getConstraintIndex()); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeTimeline(Timeline *obj) { + if (obj->getRTTI().instanceOf(AlphaTimeline::rtti)) { + writeAlphaTimeline((AlphaTimeline *) obj); + } else if (obj->getRTTI().instanceOf(AttachmentTimeline::rtti)) { + writeAttachmentTimeline((AttachmentTimeline *) obj); + } else if (obj->getRTTI().instanceOf(DeformTimeline::rtti)) { + writeDeformTimeline((DeformTimeline *) obj); + } else if (obj->getRTTI().instanceOf(DrawOrderTimeline::rtti)) { + writeDrawOrderTimeline((DrawOrderTimeline *) obj); + } else if (obj->getRTTI().instanceOf(EventTimeline::rtti)) { + writeEventTimeline((EventTimeline *) obj); + } else if (obj->getRTTI().instanceOf(IkConstraintTimeline::rtti)) { + writeIkConstraintTimeline((IkConstraintTimeline *) obj); + } else if (obj->getRTTI().instanceOf(InheritTimeline::rtti)) { + writeInheritTimeline((InheritTimeline *) obj); + } else if (obj->getRTTI().instanceOf(PathConstraintMixTimeline::rtti)) { + writePathConstraintMixTimeline((PathConstraintMixTimeline *) obj); + } else if (obj->getRTTI().instanceOf(PathConstraintPositionTimeline::rtti)) { + writePathConstraintPositionTimeline((PathConstraintPositionTimeline *) obj); + } else if (obj->getRTTI().instanceOf(PathConstraintSpacingTimeline::rtti)) { + writePathConstraintSpacingTimeline((PathConstraintSpacingTimeline *) obj); + } else if (obj->getRTTI().instanceOf(PhysicsConstraintDampingTimeline::rtti)) { + writePhysicsConstraintDampingTimeline((PhysicsConstraintDampingTimeline *) obj); + } else if (obj->getRTTI().instanceOf(PhysicsConstraintGravityTimeline::rtti)) { + writePhysicsConstraintGravityTimeline((PhysicsConstraintGravityTimeline *) obj); + } else if (obj->getRTTI().instanceOf(PhysicsConstraintInertiaTimeline::rtti)) { + writePhysicsConstraintInertiaTimeline((PhysicsConstraintInertiaTimeline *) obj); + } else if (obj->getRTTI().instanceOf(PhysicsConstraintMassTimeline::rtti)) { + writePhysicsConstraintMassTimeline((PhysicsConstraintMassTimeline *) obj); + } else if (obj->getRTTI().instanceOf(PhysicsConstraintMixTimeline::rtti)) { + writePhysicsConstraintMixTimeline((PhysicsConstraintMixTimeline *) obj); + } else if (obj->getRTTI().instanceOf(PhysicsConstraintResetTimeline::rtti)) { + writePhysicsConstraintResetTimeline((PhysicsConstraintResetTimeline *) obj); + } else if (obj->getRTTI().instanceOf(PhysicsConstraintStrengthTimeline::rtti)) { + writePhysicsConstraintStrengthTimeline((PhysicsConstraintStrengthTimeline *) obj); + } else if (obj->getRTTI().instanceOf(PhysicsConstraintWindTimeline::rtti)) { + writePhysicsConstraintWindTimeline((PhysicsConstraintWindTimeline *) obj); + } else if (obj->getRTTI().instanceOf(RGB2Timeline::rtti)) { + writeRGB2Timeline((RGB2Timeline *) obj); + } else if (obj->getRTTI().instanceOf(RGBA2Timeline::rtti)) { + writeRGBA2Timeline((RGBA2Timeline *) obj); + } else if (obj->getRTTI().instanceOf(RGBATimeline::rtti)) { + writeRGBATimeline((RGBATimeline *) obj); + } else if (obj->getRTTI().instanceOf(RGBTimeline::rtti)) { + writeRGBTimeline((RGBTimeline *) obj); + } else if (obj->getRTTI().instanceOf(RotateTimeline::rtti)) { + writeRotateTimeline((RotateTimeline *) obj); + } else if (obj->getRTTI().instanceOf(ScaleTimeline::rtti)) { + writeScaleTimeline((ScaleTimeline *) obj); + } else if (obj->getRTTI().instanceOf(ScaleXTimeline::rtti)) { + writeScaleXTimeline((ScaleXTimeline *) obj); + } else if (obj->getRTTI().instanceOf(ScaleYTimeline::rtti)) { + writeScaleYTimeline((ScaleYTimeline *) obj); + } else if (obj->getRTTI().instanceOf(SequenceTimeline::rtti)) { + writeSequenceTimeline((SequenceTimeline *) obj); + } else if (obj->getRTTI().instanceOf(ShearTimeline::rtti)) { + writeShearTimeline((ShearTimeline *) obj); + } else if (obj->getRTTI().instanceOf(ShearXTimeline::rtti)) { + writeShearXTimeline((ShearXTimeline *) obj); + } else if (obj->getRTTI().instanceOf(ShearYTimeline::rtti)) { + writeShearYTimeline((ShearYTimeline *) obj); + } else if (obj->getRTTI().instanceOf(SliderMixTimeline::rtti)) { + writeSliderMixTimeline((SliderMixTimeline *) obj); + } else if (obj->getRTTI().instanceOf(SliderTimeline::rtti)) { + writeSliderTimeline((SliderTimeline *) obj); + } else if (obj->getRTTI().instanceOf(TransformConstraintTimeline::rtti)) { + writeTransformConstraintTimeline((TransformConstraintTimeline *) obj); + } else if (obj->getRTTI().instanceOf(TranslateTimeline::rtti)) { + writeTranslateTimeline((TranslateTimeline *) obj); + } else if (obj->getRTTI().instanceOf(TranslateXTimeline::rtti)) { + writeTranslateXTimeline((TranslateXTimeline *) obj); + } else if (obj->getRTTI().instanceOf(TranslateYTimeline::rtti)) { + writeTranslateYTimeline((TranslateYTimeline *) obj); + } else { + fprintf(stderr, "Error: Unknown Timeline type\n"); + exit(1); + } + } + + void writeTransformConstraintTimeline(TransformConstraintTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("TransformConstraintTimeline"); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("constraintIndex"); + _json.writeValue(obj->getConstraintIndex()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeTranslateTimeline(TranslateTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("TranslateTimeline"); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("boneIndex"); + _json.writeValue(obj->getBoneIndex()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeTranslateXTimeline(TranslateXTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("TranslateXTimeline"); + + _json.writeName("boneIndex"); + _json.writeValue(obj->getBoneIndex()); + + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); + + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); + + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); + + _json.writeObjectEnd(); + } + + void writeTranslateYTimeline(TranslateYTimeline *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("TranslateYTimeline"); - _json.writeName("boneIndex"); - _json.writeValue(obj->getBoneIndex()); + _json.writeName("boneIndex"); + _json.writeValue(obj->getBoneIndex()); - _json.writeName("frameEntries"); - _json.writeValue(obj->getFrameEntries()); + _json.writeName("frameEntries"); + _json.writeValue(obj->getFrameEntries()); - _json.writeName("propertyIds"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { - _json.writeValue(obj->getPropertyIds()[i]); - } - _json.writeArrayEnd(); + _json.writeName("propertyIds"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPropertyIds().size(); i++) { + _json.writeValue(obj->getPropertyIds()[i]); + } + _json.writeArrayEnd(); - _json.writeName("frames"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getFrames().size(); i++) { - _json.writeValue(obj->getFrames()[i]); - } - _json.writeArrayEnd(); + _json.writeName("frames"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getFrames().size(); i++) { + _json.writeValue(obj->getFrames()[i]); + } + _json.writeArrayEnd(); - _json.writeName("frameCount"); - _json.writeValue(obj->getFrameCount()); + _json.writeName("frameCount"); + _json.writeValue(obj->getFrameCount()); - _json.writeName("duration"); - _json.writeValue(obj->getDuration()); + _json.writeName("duration"); + _json.writeValue(obj->getDuration()); - _json.writeObjectEnd(); - } - - void writeAnimationState(AnimationState* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); + _json.writeObjectEnd(); + } + + void writeAnimationState(AnimationState *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("AnimationState"); + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("AnimationState"); - _json.writeName("timeScale"); - _json.writeValue(obj->getTimeScale()); + _json.writeName("timeScale"); + _json.writeValue(obj->getTimeScale()); - _json.writeName("data"); - writeAnimationStateData(obj->getData()); - - _json.writeName("tracks"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getTracks().size(); i++) { - writeTrackEntry(obj->getTracks()[i]); - } - _json.writeArrayEnd(); - - _json.writeObjectEnd(); - } - - void writeTrackEntry(TrackEntry* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("TrackEntry"); - - _json.writeName("trackIndex"); - _json.writeValue(obj->getTrackIndex()); - - _json.writeName("animation"); - writeAnimation(obj->getAnimation()); - - _json.writeName("loop"); - _json.writeValue(obj->getLoop()); - - _json.writeName("delay"); - _json.writeValue(obj->getDelay()); - - _json.writeName("trackTime"); - _json.writeValue(obj->getTrackTime()); - - _json.writeName("trackEnd"); - _json.writeValue(obj->getTrackEnd()); - - _json.writeName("trackComplete"); - _json.writeValue(obj->getTrackComplete()); - - _json.writeName("animationStart"); - _json.writeValue(obj->getAnimationStart()); - - _json.writeName("animationEnd"); - _json.writeValue(obj->getAnimationEnd()); - - _json.writeName("animationLast"); - _json.writeValue(obj->getAnimationLast()); - - _json.writeName("animationTime"); - _json.writeValue(obj->getAnimationTime()); - - _json.writeName("timeScale"); - _json.writeValue(obj->getTimeScale()); - - _json.writeName("alpha"); - _json.writeValue(obj->getAlpha()); - - _json.writeName("eventThreshold"); - _json.writeValue(obj->getEventThreshold()); - - _json.writeName("alphaAttachmentThreshold"); - _json.writeValue(obj->getAlphaAttachmentThreshold()); - - _json.writeName("mixAttachmentThreshold"); - _json.writeValue(obj->getMixAttachmentThreshold()); - - _json.writeName("mixDrawOrderThreshold"); - _json.writeValue(obj->getMixDrawOrderThreshold()); - - _json.writeName("next"); - if (obj->getNext() == nullptr) { - _json.writeNull(); - } else { - writeTrackEntry(obj->getNext()); - } - - _json.writeName("previous"); - if (obj->getPrevious() == nullptr) { - _json.writeNull(); - } else { - writeTrackEntry(obj->getPrevious()); - } - - _json.writeName("mixTime"); - _json.writeValue(obj->getMixTime()); - - _json.writeName("mixDuration"); - _json.writeValue(obj->getMixDuration()); - - _json.writeName("mixBlend"); - _json.writeValue([&]() -> String { - switch(obj->getMixBlend()) { - case MixBlend_Setup: return "setup"; - case MixBlend_First: return "first"; - case MixBlend_Replace: return "replace"; - case MixBlend_Add: return "add"; - default: return "unknown"; - } - }()); - - _json.writeName("mixingFrom"); - if (obj->getMixingFrom() == nullptr) { - _json.writeNull(); - } else { - writeTrackEntry(obj->getMixingFrom()); - } - - _json.writeName("mixingTo"); - if (obj->getMixingTo() == nullptr) { - _json.writeNull(); - } else { - writeTrackEntry(obj->getMixingTo()); - } - - _json.writeName("holdPrevious"); - _json.writeValue(obj->getHoldPrevious()); - - _json.writeName("shortestRotation"); - _json.writeValue(obj->getShortestRotation()); - - _json.writeName("reverse"); - _json.writeValue(obj->getReverse()); - - _json.writeObjectEnd(); - } - - void writeAnimationStateData(AnimationStateData* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("AnimationStateData"); - - _json.writeName("skeletonData"); - writeSkeletonData(obj->getSkeletonData()); - - _json.writeName("defaultMix"); - _json.writeValue(obj->getDefaultMix()); - - _json.writeObjectEnd(); - } - - void writeAttachment(Attachment* obj) { - if (obj->getRTTI().instanceOf(BoundingBoxAttachment::rtti)) { - writeBoundingBoxAttachment((BoundingBoxAttachment*)obj); - } else if (obj->getRTTI().instanceOf(ClippingAttachment::rtti)) { - writeClippingAttachment((ClippingAttachment*)obj); - } else if (obj->getRTTI().instanceOf(MeshAttachment::rtti)) { - writeMeshAttachment((MeshAttachment*)obj); - } else if (obj->getRTTI().instanceOf(PathAttachment::rtti)) { - writePathAttachment((PathAttachment*)obj); - } else if (obj->getRTTI().instanceOf(PointAttachment::rtti)) { - writePointAttachment((PointAttachment*)obj); - } else if (obj->getRTTI().instanceOf(RegionAttachment::rtti)) { - writeRegionAttachment((RegionAttachment*)obj); - } else { - fprintf(stderr, "Error: Unknown Attachment type\n"); exit(1); - } - } - - void writeBone(Bone* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("Bone"); - - _json.writeName("parent"); - if (obj->getParent() == nullptr) { - _json.writeNull(); - } else { - writeBone(obj->getParent()); - } - - _json.writeName("children"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getChildren().size(); i++) { - writeBone(obj->getChildren()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("data"); - writeBoneData(obj->getData()); - - _json.writeName("pose"); - writeBoneLocal(obj->getPose()); - - _json.writeName("appliedPose"); - writeBonePose(obj->getAppliedPose()); - - _json.writeObjectEnd(); - } - - void writeBoneData(BoneData* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("BoneData"); - - _json.writeName("index"); - _json.writeValue(obj->getIndex()); - - _json.writeName("parent"); - if (obj->getParent() == nullptr) { - _json.writeNull(); - } else { - writeBoneData(obj->getParent()); - } - - _json.writeName("length"); - _json.writeValue(obj->getLength()); - - _json.writeName("color"); - writeColor(obj->getColor()); - - _json.writeName("icon"); - _json.writeValue(obj->getIcon()); - - _json.writeName("visible"); - _json.writeValue(obj->getVisible()); - - _json.writeName("name"); - _json.writeValue(obj->getName()); - - _json.writeName("setupPose"); - writeBoneLocal(obj->getSetupPose()); - - _json.writeName("skinRequired"); - _json.writeValue(obj->getSkinRequired()); - - _json.writeObjectEnd(); - } - - void writeBoneLocal(BoneLocal* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); + _json.writeName("data"); + writeAnimationStateData(obj->getData()); + + _json.writeName("tracks"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getTracks().size(); i++) { + writeTrackEntry(obj->getTracks()[i]); + } + _json.writeArrayEnd(); + + _json.writeObjectEnd(); + } + + void writeTrackEntry(TrackEntry *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("TrackEntry"); + + _json.writeName("trackIndex"); + _json.writeValue(obj->getTrackIndex()); + + _json.writeName("animation"); + writeAnimation(obj->getAnimation()); + + _json.writeName("loop"); + _json.writeValue(obj->getLoop()); + + _json.writeName("delay"); + _json.writeValue(obj->getDelay()); + + _json.writeName("trackTime"); + _json.writeValue(obj->getTrackTime()); + + _json.writeName("trackEnd"); + _json.writeValue(obj->getTrackEnd()); + + _json.writeName("trackComplete"); + _json.writeValue(obj->getTrackComplete()); + + _json.writeName("animationStart"); + _json.writeValue(obj->getAnimationStart()); + + _json.writeName("animationEnd"); + _json.writeValue(obj->getAnimationEnd()); + + _json.writeName("animationLast"); + _json.writeValue(obj->getAnimationLast()); + + _json.writeName("animationTime"); + _json.writeValue(obj->getAnimationTime()); + + _json.writeName("timeScale"); + _json.writeValue(obj->getTimeScale()); + + _json.writeName("alpha"); + _json.writeValue(obj->getAlpha()); + + _json.writeName("eventThreshold"); + _json.writeValue(obj->getEventThreshold()); + + _json.writeName("alphaAttachmentThreshold"); + _json.writeValue(obj->getAlphaAttachmentThreshold()); + + _json.writeName("mixAttachmentThreshold"); + _json.writeValue(obj->getMixAttachmentThreshold()); + + _json.writeName("mixDrawOrderThreshold"); + _json.writeValue(obj->getMixDrawOrderThreshold()); + + _json.writeName("next"); + if (obj->getNext() == nullptr) { + _json.writeNull(); + } else { + writeTrackEntry(obj->getNext()); + } + + _json.writeName("previous"); + if (obj->getPrevious() == nullptr) { + _json.writeNull(); + } else { + writeTrackEntry(obj->getPrevious()); + } + + _json.writeName("mixTime"); + _json.writeValue(obj->getMixTime()); + + _json.writeName("mixDuration"); + _json.writeValue(obj->getMixDuration()); + + _json.writeName("mixBlend"); + _json.writeValue([&]() -> String { + switch (obj->getMixBlend()) { + case MixBlend_Setup: + return "setup"; + case MixBlend_First: + return "first"; + case MixBlend_Replace: + return "replace"; + case MixBlend_Add: + return "add"; + default: + return "unknown"; + } + }()); + + _json.writeName("mixingFrom"); + if (obj->getMixingFrom() == nullptr) { + _json.writeNull(); + } else { + writeTrackEntry(obj->getMixingFrom()); + } + + _json.writeName("mixingTo"); + if (obj->getMixingTo() == nullptr) { + _json.writeNull(); + } else { + writeTrackEntry(obj->getMixingTo()); + } + + _json.writeName("holdPrevious"); + _json.writeValue(obj->getHoldPrevious()); + + _json.writeName("shortestRotation"); + _json.writeValue(obj->getShortestRotation()); + + _json.writeName("reverse"); + _json.writeValue(obj->getReverse()); + + _json.writeObjectEnd(); + } + + void writeAnimationStateData(AnimationStateData *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("AnimationStateData"); + + _json.writeName("skeletonData"); + writeSkeletonData(obj->getSkeletonData()); + + _json.writeName("defaultMix"); + _json.writeValue(obj->getDefaultMix()); + + _json.writeObjectEnd(); + } + + void writeAttachment(Attachment *obj) { + if (obj->getRTTI().instanceOf(BoundingBoxAttachment::rtti)) { + writeBoundingBoxAttachment((BoundingBoxAttachment *) obj); + } else if (obj->getRTTI().instanceOf(ClippingAttachment::rtti)) { + writeClippingAttachment((ClippingAttachment *) obj); + } else if (obj->getRTTI().instanceOf(MeshAttachment::rtti)) { + writeMeshAttachment((MeshAttachment *) obj); + } else if (obj->getRTTI().instanceOf(PathAttachment::rtti)) { + writePathAttachment((PathAttachment *) obj); + } else if (obj->getRTTI().instanceOf(PointAttachment::rtti)) { + writePointAttachment((PointAttachment *) obj); + } else if (obj->getRTTI().instanceOf(RegionAttachment::rtti)) { + writeRegionAttachment((RegionAttachment *) obj); + } else { + fprintf(stderr, "Error: Unknown Attachment type\n"); + exit(1); + } + } + + void writeBone(Bone *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("Bone"); + + _json.writeName("parent"); + if (obj->getParent() == nullptr) { + _json.writeNull(); + } else { + writeBone(obj->getParent()); + } + + _json.writeName("children"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getChildren().size(); i++) { + writeBone(obj->getChildren()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("data"); + writeBoneData(obj->getData()); + + _json.writeName("pose"); + writeBoneLocal(obj->getPose()); + + _json.writeName("appliedPose"); + writeBonePose(obj->getAppliedPose()); + + _json.writeObjectEnd(); + } + + void writeBoneData(BoneData *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("BoneData"); + + _json.writeName("index"); + _json.writeValue(obj->getIndex()); + + _json.writeName("parent"); + if (obj->getParent() == nullptr) { + _json.writeNull(); + } else { + writeBoneData(obj->getParent()); + } + + _json.writeName("length"); + _json.writeValue(obj->getLength()); + + _json.writeName("color"); + writeColor(obj->getColor()); + + _json.writeName("icon"); + _json.writeValue(obj->getIcon()); + + _json.writeName("visible"); + _json.writeValue(obj->getVisible()); + + _json.writeName("name"); + _json.writeValue(obj->getName()); + + _json.writeName("setupPose"); + writeBoneLocal(obj->getSetupPose()); + + _json.writeName("skinRequired"); + _json.writeValue(obj->getSkinRequired()); + + _json.writeObjectEnd(); + } + + void writeBoneLocal(BoneLocal *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("BoneLocal"); + + _json.writeName("x"); + _json.writeValue(obj->getX()); - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("BoneLocal"); + _json.writeName("y"); + _json.writeValue(obj->getY()); - _json.writeName("x"); - _json.writeValue(obj->getX()); + _json.writeName("rotation"); + _json.writeValue(obj->getRotation()); - _json.writeName("y"); - _json.writeValue(obj->getY()); + _json.writeName("scaleX"); + _json.writeValue(obj->getScaleX()); - _json.writeName("rotation"); - _json.writeValue(obj->getRotation()); + _json.writeName("scaleY"); + _json.writeValue(obj->getScaleY()); + + _json.writeName("shearX"); + _json.writeValue(obj->getShearX()); + + _json.writeName("shearY"); + _json.writeValue(obj->getShearY()); + + _json.writeName("inherit"); + _json.writeValue([&]() -> String { + switch (obj->getInherit()) { + case Inherit_Normal: + return "normal"; + case Inherit_OnlyTranslation: + return "onlyTranslation"; + case Inherit_NoRotationOrReflection: + return "noRotationOrReflection"; + case Inherit_NoScale: + return "noScale"; + case Inherit_NoScaleOrReflection: + return "noScaleOrReflection"; + default: + return "unknown"; + } + }()); + + _json.writeObjectEnd(); + } + + void writeBonePose(BonePose *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("BonePose"); + + _json.writeName("a"); + _json.writeValue(obj->getA()); + + _json.writeName("b"); + _json.writeValue(obj->getB()); + + _json.writeName("c"); + _json.writeValue(obj->getC()); + + _json.writeName("d"); + _json.writeValue(obj->getD()); + + _json.writeName("worldX"); + _json.writeValue(obj->getWorldX()); + + _json.writeName("worldY"); + _json.writeValue(obj->getWorldY()); + + _json.writeName("worldRotationX"); + _json.writeValue(obj->getWorldRotationX()); + + _json.writeName("worldRotationY"); + _json.writeValue(obj->getWorldRotationY()); + + _json.writeName("worldScaleX"); + _json.writeValue(obj->getWorldScaleX()); + + _json.writeName("worldScaleY"); + _json.writeValue(obj->getWorldScaleY()); + + _json.writeName("x"); + _json.writeValue(obj->getX()); + + _json.writeName("y"); + _json.writeValue(obj->getY()); + + _json.writeName("rotation"); + _json.writeValue(obj->getRotation()); + + _json.writeName("scaleX"); + _json.writeValue(obj->getScaleX()); + + _json.writeName("scaleY"); + _json.writeValue(obj->getScaleY()); + + _json.writeName("shearX"); + _json.writeValue(obj->getShearX()); + + _json.writeName("shearY"); + _json.writeValue(obj->getShearY()); + + _json.writeName("inherit"); + _json.writeValue([&]() -> String { + switch (obj->getInherit()) { + case Inherit_Normal: + return "normal"; + case Inherit_OnlyTranslation: + return "onlyTranslation"; + case Inherit_NoRotationOrReflection: + return "noRotationOrReflection"; + case Inherit_NoScale: + return "noScale"; + case Inherit_NoScaleOrReflection: + return "noScaleOrReflection"; + default: + return "unknown"; + } + }()); + + _json.writeObjectEnd(); + } + + void writeBoundingBoxAttachment(BoundingBoxAttachment *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("BoundingBoxAttachment"); + + _json.writeName("color"); + writeColor(obj->getColor()); + + _json.writeName("bones"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getBones().size(); i++) { + _json.writeValue(obj->getBones()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("vertices"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getVertices().size(); i++) { + _json.writeValue(obj->getVertices()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("worldVerticesLength"); + _json.writeValue(obj->getWorldVerticesLength()); + + _json.writeName("timelineAttachment"); + if (obj->getTimelineAttachment() == nullptr) { + _json.writeNull(); + } else { + writeAttachment(obj->getTimelineAttachment()); + } + + _json.writeName("id"); + _json.writeValue(obj->getId()); + + _json.writeName("name"); + _json.writeValue(obj->getName()); + + _json.writeObjectEnd(); + } + + void writeClippingAttachment(ClippingAttachment *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("ClippingAttachment"); + + _json.writeName("endSlot"); + if (obj->getEndSlot() == nullptr) { + _json.writeNull(); + } else { + writeSlotData(obj->getEndSlot()); + } + + _json.writeName("color"); + writeColor(obj->getColor()); + + _json.writeName("bones"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getBones().size(); i++) { + _json.writeValue(obj->getBones()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("vertices"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getVertices().size(); i++) { + _json.writeValue(obj->getVertices()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("worldVerticesLength"); + _json.writeValue(obj->getWorldVerticesLength()); + + _json.writeName("timelineAttachment"); + if (obj->getTimelineAttachment() == nullptr) { + _json.writeNull(); + } else { + writeAttachment(obj->getTimelineAttachment()); + } + + _json.writeName("id"); + _json.writeValue(obj->getId()); + + _json.writeName("name"); + _json.writeValue(obj->getName()); + + _json.writeObjectEnd(); + } + + void writeConstraint(Constraint *obj) { + if (obj->getRTTI().instanceOf(IkConstraint::rtti)) { + writeIkConstraint((IkConstraint *) obj); + } else if (obj->getRTTI().instanceOf(PathConstraint::rtti)) { + writePathConstraint((PathConstraint *) obj); + } else if (obj->getRTTI().instanceOf(PhysicsConstraint::rtti)) { + writePhysicsConstraint((PhysicsConstraint *) obj); + } else if (obj->getRTTI().instanceOf(Slider::rtti)) { + writeSlider((Slider *) obj); + } else if (obj->getRTTI().instanceOf(TransformConstraint::rtti)) { + writeTransformConstraint((TransformConstraint *) obj); + } else { + fprintf(stderr, "Error: Unknown Constraint type\n"); + exit(1); + } + } + + void writeConstraintData(ConstraintData *obj) { + if (obj->getRTTI().instanceOf(IkConstraintData::rtti)) { + writeIkConstraintData((IkConstraintData *) obj); + } else if (obj->getRTTI().instanceOf(PathConstraintData::rtti)) { + writePathConstraintData((PathConstraintData *) obj); + } else if (obj->getRTTI().instanceOf(PhysicsConstraintData::rtti)) { + writePhysicsConstraintData((PhysicsConstraintData *) obj); + } else if (obj->getRTTI().instanceOf(SliderData::rtti)) { + writeSliderData((SliderData *) obj); + } else if (obj->getRTTI().instanceOf(TransformConstraintData::rtti)) { + writeTransformConstraintData((TransformConstraintData *) obj); + } else { + fprintf(stderr, "Error: Unknown ConstraintData type\n"); + exit(1); + } + } + + void writeEvent(Event *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("Event"); + + _json.writeName("int"); + _json.writeValue(obj->getInt()); + + _json.writeName("float"); + _json.writeValue(obj->getFloat()); + + _json.writeName("string"); + _json.writeValue(obj->getString()); + + _json.writeName("volume"); + _json.writeValue(obj->getVolume()); + + _json.writeName("balance"); + _json.writeValue(obj->getBalance()); + + _json.writeName("time"); + _json.writeValue(obj->getTime()); + + _json.writeName("data"); + writeEventData(obj->getData()); + + _json.writeObjectEnd(); + } + + void writeEventData(EventData *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("EventData"); + + _json.writeName("int"); + _json.writeValue(obj->getInt()); + + _json.writeName("float"); + _json.writeValue(obj->getFloat()); + + _json.writeName("string"); + _json.writeValue(obj->getString()); + + _json.writeName("audioPath"); + _json.writeValue(obj->getAudioPath()); + + _json.writeName("volume"); + _json.writeValue(obj->getVolume()); + + _json.writeName("balance"); + _json.writeValue(obj->getBalance()); + + _json.writeName("name"); + _json.writeValue(obj->getName()); + + _json.writeObjectEnd(); + } + + void writeIkConstraint(IkConstraint *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("IkConstraint"); + + _json.writeName("bones"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getBones().size(); i++) { + writeBonePose(obj->getBones()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("target"); + writeBone(obj->getTarget()); + + _json.writeName("data"); + writeIkConstraintData(obj->getData()); - _json.writeName("scaleX"); - _json.writeValue(obj->getScaleX()); + _json.writeName("pose"); + writeIkConstraintPose(obj->getPose()); - _json.writeName("scaleY"); - _json.writeValue(obj->getScaleY()); + _json.writeName("appliedPose"); + writeIkConstraintPose(obj->getAppliedPose()); - _json.writeName("shearX"); - _json.writeValue(obj->getShearX()); + _json.writeObjectEnd(); + } - _json.writeName("shearY"); - _json.writeValue(obj->getShearY()); + void writeIkConstraintData(IkConstraintData *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); - _json.writeName("inherit"); - _json.writeValue([&]() -> String { - switch(obj->getInherit()) { - case Inherit_Normal: return "normal"; - case Inherit_OnlyTranslation: return "onlyTranslation"; - case Inherit_NoRotationOrReflection: return "noRotationOrReflection"; - case Inherit_NoScale: return "noScale"; - case Inherit_NoScaleOrReflection: return "noScaleOrReflection"; - default: return "unknown"; - } - }()); + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("IkConstraintData"); - _json.writeObjectEnd(); - } + _json.writeName("bones"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getBones().size(); i++) { + writeBoneData(obj->getBones()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("target"); + writeBoneData(obj->getTarget()); + + _json.writeName("uniform"); + _json.writeValue(obj->getUniform()); + + _json.writeName("name"); + _json.writeValue(obj->getName()); + + _json.writeName("setupPose"); + writeIkConstraintPose(obj->getSetupPose()); + + _json.writeName("skinRequired"); + _json.writeValue(obj->getSkinRequired()); + + _json.writeObjectEnd(); + } + + void writeIkConstraintPose(IkConstraintPose *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("IkConstraintPose"); + + _json.writeName("mix"); + _json.writeValue(obj->getMix()); + + _json.writeName("softness"); + _json.writeValue(obj->getSoftness()); + + _json.writeName("bendDirection"); + _json.writeValue(obj->getBendDirection()); + + _json.writeName("compress"); + _json.writeValue(obj->getCompress()); + + _json.writeName("stretch"); + _json.writeValue(obj->getStretch()); + + _json.writeObjectEnd(); + } + + void writeMeshAttachment(MeshAttachment *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("MeshAttachment"); + + _json.writeName("region"); + if (obj->getRegion() == nullptr) { + _json.writeNull(); + } else { + writeTextureRegion(obj->getRegion()); + } + + _json.writeName("triangles"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getTriangles().size(); i++) { + _json.writeValue(obj->getTriangles()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("regionUVs"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getRegionUVs().size(); i++) { + _json.writeValue(obj->getRegionUVs()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("uVs"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getUVs().size(); i++) { + _json.writeValue(obj->getUVs()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("color"); + writeColor(obj->getColor()); + + _json.writeName("path"); + _json.writeValue(obj->getPath()); + + _json.writeName("hullLength"); + _json.writeValue(obj->getHullLength()); + + _json.writeName("edges"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getEdges().size(); i++) { + _json.writeValue(obj->getEdges()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("width"); + _json.writeValue(obj->getWidth()); + + _json.writeName("height"); + _json.writeValue(obj->getHeight()); + + _json.writeName("sequence"); + if (obj->getSequence() == nullptr) { + _json.writeNull(); + } else { + writeSequence(obj->getSequence()); + } + + _json.writeName("parentMesh"); + if (obj->getParentMesh() == nullptr) { + _json.writeNull(); + } else { + writeMeshAttachment(obj->getParentMesh()); + } + + _json.writeName("bones"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getBones().size(); i++) { + _json.writeValue(obj->getBones()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("vertices"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getVertices().size(); i++) { + _json.writeValue(obj->getVertices()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("worldVerticesLength"); + _json.writeValue(obj->getWorldVerticesLength()); + + _json.writeName("timelineAttachment"); + if (obj->getTimelineAttachment() == nullptr) { + _json.writeNull(); + } else { + writeAttachment(obj->getTimelineAttachment()); + } + + _json.writeName("id"); + _json.writeValue(obj->getId()); + + _json.writeName("name"); + _json.writeValue(obj->getName()); + + _json.writeObjectEnd(); + } + + void writePathAttachment(PathAttachment *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("PathAttachment"); + + _json.writeName("closed"); + _json.writeValue(obj->getClosed()); + + _json.writeName("constantSpeed"); + _json.writeValue(obj->getConstantSpeed()); + + _json.writeName("lengths"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getLengths().size(); i++) { + _json.writeValue(obj->getLengths()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("color"); + writeColor(obj->getColor()); + + _json.writeName("bones"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getBones().size(); i++) { + _json.writeValue(obj->getBones()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("vertices"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getVertices().size(); i++) { + _json.writeValue(obj->getVertices()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("worldVerticesLength"); + _json.writeValue(obj->getWorldVerticesLength()); + + _json.writeName("timelineAttachment"); + if (obj->getTimelineAttachment() == nullptr) { + _json.writeNull(); + } else { + writeAttachment(obj->getTimelineAttachment()); + } + + _json.writeName("id"); + _json.writeValue(obj->getId()); + + _json.writeName("name"); + _json.writeValue(obj->getName()); + + _json.writeObjectEnd(); + } + + void writePathConstraint(PathConstraint *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("PathConstraint"); + + _json.writeName("bones"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getBones().size(); i++) { + writeBonePose(obj->getBones()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("slot"); + writeSlot(obj->getSlot()); + + _json.writeName("data"); + writePathConstraintData(obj->getData()); + + _json.writeName("pose"); + writePathConstraintPose(obj->getPose()); + + _json.writeName("appliedPose"); + writePathConstraintPose(obj->getAppliedPose()); + + _json.writeObjectEnd(); + } + + void writePathConstraintData(PathConstraintData *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("PathConstraintData"); + + _json.writeName("bones"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getBones().size(); i++) { + writeBoneData(obj->getBones()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("slot"); + writeSlotData(obj->getSlot()); + + _json.writeName("positionMode"); + _json.writeValue([&]() -> String { + switch (obj->getPositionMode()) { + case PositionMode_Fixed: + return "fixed"; + case PositionMode_Percent: + return "percent"; + default: + return "unknown"; + } + }()); + + _json.writeName("spacingMode"); + _json.writeValue([&]() -> String { + switch (obj->getSpacingMode()) { + case SpacingMode_Length: + return "length"; + case SpacingMode_Fixed: + return "fixed"; + case SpacingMode_Percent: + return "percent"; + case SpacingMode_Proportional: + return "proportional"; + default: + return "unknown"; + } + }()); + + _json.writeName("rotateMode"); + _json.writeValue([&]() -> String { + switch (obj->getRotateMode()) { + case RotateMode_Tangent: + return "tangent"; + case RotateMode_Chain: + return "chain"; + case RotateMode_ChainScale: + return "chainScale"; + default: + return "unknown"; + } + }()); + + _json.writeName("offsetRotation"); + _json.writeValue(obj->getOffsetRotation()); + + _json.writeName("name"); + _json.writeValue(obj->getName()); + + _json.writeName("setupPose"); + writePathConstraintPose(obj->getSetupPose()); + + _json.writeName("skinRequired"); + _json.writeValue(obj->getSkinRequired()); + + _json.writeObjectEnd(); + } + + void writePathConstraintPose(PathConstraintPose *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("PathConstraintPose"); + + _json.writeName("position"); + _json.writeValue(obj->getPosition()); + + _json.writeName("spacing"); + _json.writeValue(obj->getSpacing()); + + _json.writeName("mixRotate"); + _json.writeValue(obj->getMixRotate()); + + _json.writeName("mixX"); + _json.writeValue(obj->getMixX()); + + _json.writeName("mixY"); + _json.writeValue(obj->getMixY()); + + _json.writeObjectEnd(); + } + + void writePhysicsConstraint(PhysicsConstraint *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("PhysicsConstraint"); - void writeBonePose(BonePose* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); + _json.writeName("bone"); + writeBonePose(obj->getBone()); - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("BonePose"); + _json.writeName("data"); + writePhysicsConstraintData(obj->getData()); - _json.writeName("a"); - _json.writeValue(obj->getA()); + _json.writeName("pose"); + writePhysicsConstraintPose(obj->getPose()); - _json.writeName("b"); - _json.writeValue(obj->getB()); + _json.writeName("appliedPose"); + writePhysicsConstraintPose(obj->getAppliedPose()); - _json.writeName("c"); - _json.writeValue(obj->getC()); + _json.writeObjectEnd(); + } - _json.writeName("d"); - _json.writeValue(obj->getD()); + void writePhysicsConstraintData(PhysicsConstraintData *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); - _json.writeName("worldX"); - _json.writeValue(obj->getWorldX()); + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("PhysicsConstraintData"); - _json.writeName("worldY"); - _json.writeValue(obj->getWorldY()); + _json.writeName("bone"); + writeBoneData(obj->getBone()); - _json.writeName("worldRotationX"); - _json.writeValue(obj->getWorldRotationX()); + _json.writeName("step"); + _json.writeValue(obj->getStep()); - _json.writeName("worldRotationY"); - _json.writeValue(obj->getWorldRotationY()); + _json.writeName("x"); + _json.writeValue(obj->getX()); - _json.writeName("worldScaleX"); - _json.writeValue(obj->getWorldScaleX()); + _json.writeName("y"); + _json.writeValue(obj->getY()); - _json.writeName("worldScaleY"); - _json.writeValue(obj->getWorldScaleY()); - - _json.writeName("x"); - _json.writeValue(obj->getX()); - - _json.writeName("y"); - _json.writeValue(obj->getY()); - - _json.writeName("rotation"); - _json.writeValue(obj->getRotation()); - - _json.writeName("scaleX"); - _json.writeValue(obj->getScaleX()); - - _json.writeName("scaleY"); - _json.writeValue(obj->getScaleY()); - - _json.writeName("shearX"); - _json.writeValue(obj->getShearX()); - - _json.writeName("shearY"); - _json.writeValue(obj->getShearY()); - - _json.writeName("inherit"); - _json.writeValue([&]() -> String { - switch(obj->getInherit()) { - case Inherit_Normal: return "normal"; - case Inherit_OnlyTranslation: return "onlyTranslation"; - case Inherit_NoRotationOrReflection: return "noRotationOrReflection"; - case Inherit_NoScale: return "noScale"; - case Inherit_NoScaleOrReflection: return "noScaleOrReflection"; - default: return "unknown"; - } - }()); - - _json.writeObjectEnd(); - } - - void writeBoundingBoxAttachment(BoundingBoxAttachment* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("BoundingBoxAttachment"); - - _json.writeName("color"); - writeColor(obj->getColor()); - - _json.writeName("bones"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getBones().size(); i++) { - _json.writeValue(obj->getBones()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("vertices"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getVertices().size(); i++) { - _json.writeValue(obj->getVertices()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("worldVerticesLength"); - _json.writeValue(obj->getWorldVerticesLength()); - - _json.writeName("timelineAttachment"); - if (obj->getTimelineAttachment() == nullptr) { - _json.writeNull(); - } else { - writeAttachment(obj->getTimelineAttachment()); - } - - _json.writeName("id"); - _json.writeValue(obj->getId()); - - _json.writeName("name"); - _json.writeValue(obj->getName()); - - _json.writeObjectEnd(); - } - - void writeClippingAttachment(ClippingAttachment* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("ClippingAttachment"); - - _json.writeName("endSlot"); - if (obj->getEndSlot() == nullptr) { - _json.writeNull(); - } else { - writeSlotData(obj->getEndSlot()); - } - - _json.writeName("color"); - writeColor(obj->getColor()); - - _json.writeName("bones"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getBones().size(); i++) { - _json.writeValue(obj->getBones()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("vertices"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getVertices().size(); i++) { - _json.writeValue(obj->getVertices()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("worldVerticesLength"); - _json.writeValue(obj->getWorldVerticesLength()); - - _json.writeName("timelineAttachment"); - if (obj->getTimelineAttachment() == nullptr) { - _json.writeNull(); - } else { - writeAttachment(obj->getTimelineAttachment()); - } - - _json.writeName("id"); - _json.writeValue(obj->getId()); - - _json.writeName("name"); - _json.writeValue(obj->getName()); - - _json.writeObjectEnd(); - } - - void writeConstraint(Constraint* obj) { - if (obj->getRTTI().instanceOf(IkConstraint::rtti)) { - writeIkConstraint((IkConstraint*)obj); - } else if (obj->getRTTI().instanceOf(PathConstraint::rtti)) { - writePathConstraint((PathConstraint*)obj); - } else if (obj->getRTTI().instanceOf(PhysicsConstraint::rtti)) { - writePhysicsConstraint((PhysicsConstraint*)obj); - } else if (obj->getRTTI().instanceOf(Slider::rtti)) { - writeSlider((Slider*)obj); - } else if (obj->getRTTI().instanceOf(TransformConstraint::rtti)) { - writeTransformConstraint((TransformConstraint*)obj); - } else { - fprintf(stderr, "Error: Unknown Constraint type\n"); exit(1); - } - } - - void writeConstraintData(ConstraintData* obj) { - if (obj->getRTTI().instanceOf(IkConstraintData::rtti)) { - writeIkConstraintData((IkConstraintData*)obj); - } else if (obj->getRTTI().instanceOf(PathConstraintData::rtti)) { - writePathConstraintData((PathConstraintData*)obj); - } else if (obj->getRTTI().instanceOf(PhysicsConstraintData::rtti)) { - writePhysicsConstraintData((PhysicsConstraintData*)obj); - } else if (obj->getRTTI().instanceOf(SliderData::rtti)) { - writeSliderData((SliderData*)obj); - } else if (obj->getRTTI().instanceOf(TransformConstraintData::rtti)) { - writeTransformConstraintData((TransformConstraintData*)obj); - } else { - fprintf(stderr, "Error: Unknown ConstraintData type\n"); exit(1); - } - } - - void writeEvent(Event* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("Event"); - - _json.writeName("int"); - _json.writeValue(obj->getInt()); - - _json.writeName("float"); - _json.writeValue(obj->getFloat()); - - _json.writeName("string"); - _json.writeValue(obj->getString()); - - _json.writeName("volume"); - _json.writeValue(obj->getVolume()); - - _json.writeName("balance"); - _json.writeValue(obj->getBalance()); - - _json.writeName("time"); - _json.writeValue(obj->getTime()); - - _json.writeName("data"); - writeEventData(obj->getData()); - - _json.writeObjectEnd(); - } - - void writeEventData(EventData* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("EventData"); - - _json.writeName("int"); - _json.writeValue(obj->getInt()); - - _json.writeName("float"); - _json.writeValue(obj->getFloat()); - - _json.writeName("string"); - _json.writeValue(obj->getString()); - - _json.writeName("audioPath"); - _json.writeValue(obj->getAudioPath()); - - _json.writeName("volume"); - _json.writeValue(obj->getVolume()); - - _json.writeName("balance"); - _json.writeValue(obj->getBalance()); - - _json.writeName("name"); - _json.writeValue(obj->getName()); - - _json.writeObjectEnd(); - } - - void writeIkConstraint(IkConstraint* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("IkConstraint"); - - _json.writeName("bones"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getBones().size(); i++) { - writeBonePose(obj->getBones()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("target"); - writeBone(obj->getTarget()); - - _json.writeName("data"); - writeIkConstraintData(obj->getData()); + _json.writeName("rotate"); + _json.writeValue(obj->getRotate()); - _json.writeName("pose"); - writeIkConstraintPose(obj->getPose()); + _json.writeName("scaleX"); + _json.writeValue(obj->getScaleX()); - _json.writeName("appliedPose"); - writeIkConstraintPose(obj->getAppliedPose()); + _json.writeName("shearX"); + _json.writeValue(obj->getShearX()); - _json.writeObjectEnd(); - } + _json.writeName("limit"); + _json.writeValue(obj->getLimit()); - void writeIkConstraintData(IkConstraintData* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); + _json.writeName("inertiaGlobal"); + _json.writeValue(obj->getInertiaGlobal()); - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("IkConstraintData"); + _json.writeName("strengthGlobal"); + _json.writeValue(obj->getStrengthGlobal()); - _json.writeName("bones"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getBones().size(); i++) { - writeBoneData(obj->getBones()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("target"); - writeBoneData(obj->getTarget()); - - _json.writeName("uniform"); - _json.writeValue(obj->getUniform()); - - _json.writeName("name"); - _json.writeValue(obj->getName()); - - _json.writeName("setupPose"); - writeIkConstraintPose(obj->getSetupPose()); - - _json.writeName("skinRequired"); - _json.writeValue(obj->getSkinRequired()); - - _json.writeObjectEnd(); - } - - void writeIkConstraintPose(IkConstraintPose* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("IkConstraintPose"); - - _json.writeName("mix"); - _json.writeValue(obj->getMix()); - - _json.writeName("softness"); - _json.writeValue(obj->getSoftness()); - - _json.writeName("bendDirection"); - _json.writeValue(obj->getBendDirection()); - - _json.writeName("compress"); - _json.writeValue(obj->getCompress()); - - _json.writeName("stretch"); - _json.writeValue(obj->getStretch()); - - _json.writeObjectEnd(); - } - - void writeMeshAttachment(MeshAttachment* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("MeshAttachment"); - - _json.writeName("region"); - if (obj->getRegion() == nullptr) { - _json.writeNull(); - } else { - writeTextureRegion(obj->getRegion()); - } - - _json.writeName("triangles"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getTriangles().size(); i++) { - _json.writeValue(obj->getTriangles()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("regionUVs"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getRegionUVs().size(); i++) { - _json.writeValue(obj->getRegionUVs()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("uVs"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getUVs().size(); i++) { - _json.writeValue(obj->getUVs()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("color"); - writeColor(obj->getColor()); - - _json.writeName("path"); - _json.writeValue(obj->getPath()); - - _json.writeName("hullLength"); - _json.writeValue(obj->getHullLength()); - - _json.writeName("edges"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getEdges().size(); i++) { - _json.writeValue(obj->getEdges()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("width"); - _json.writeValue(obj->getWidth()); - - _json.writeName("height"); - _json.writeValue(obj->getHeight()); - - _json.writeName("sequence"); - if (obj->getSequence() == nullptr) { - _json.writeNull(); - } else { - writeSequence(obj->getSequence()); - } - - _json.writeName("parentMesh"); - if (obj->getParentMesh() == nullptr) { - _json.writeNull(); - } else { - writeMeshAttachment(obj->getParentMesh()); - } - - _json.writeName("bones"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getBones().size(); i++) { - _json.writeValue(obj->getBones()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("vertices"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getVertices().size(); i++) { - _json.writeValue(obj->getVertices()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("worldVerticesLength"); - _json.writeValue(obj->getWorldVerticesLength()); - - _json.writeName("timelineAttachment"); - if (obj->getTimelineAttachment() == nullptr) { - _json.writeNull(); - } else { - writeAttachment(obj->getTimelineAttachment()); - } - - _json.writeName("id"); - _json.writeValue(obj->getId()); - - _json.writeName("name"); - _json.writeValue(obj->getName()); - - _json.writeObjectEnd(); - } - - void writePathAttachment(PathAttachment* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("PathAttachment"); - - _json.writeName("closed"); - _json.writeValue(obj->getClosed()); - - _json.writeName("constantSpeed"); - _json.writeValue(obj->getConstantSpeed()); - - _json.writeName("lengths"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getLengths().size(); i++) { - _json.writeValue(obj->getLengths()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("color"); - writeColor(obj->getColor()); - - _json.writeName("bones"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getBones().size(); i++) { - _json.writeValue(obj->getBones()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("vertices"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getVertices().size(); i++) { - _json.writeValue(obj->getVertices()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("worldVerticesLength"); - _json.writeValue(obj->getWorldVerticesLength()); - - _json.writeName("timelineAttachment"); - if (obj->getTimelineAttachment() == nullptr) { - _json.writeNull(); - } else { - writeAttachment(obj->getTimelineAttachment()); - } - - _json.writeName("id"); - _json.writeValue(obj->getId()); - - _json.writeName("name"); - _json.writeValue(obj->getName()); - - _json.writeObjectEnd(); - } - - void writePathConstraint(PathConstraint* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("PathConstraint"); - - _json.writeName("bones"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getBones().size(); i++) { - writeBonePose(obj->getBones()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("slot"); - writeSlot(obj->getSlot()); - - _json.writeName("data"); - writePathConstraintData(obj->getData()); - - _json.writeName("pose"); - writePathConstraintPose(obj->getPose()); - - _json.writeName("appliedPose"); - writePathConstraintPose(obj->getAppliedPose()); - - _json.writeObjectEnd(); - } - - void writePathConstraintData(PathConstraintData* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("PathConstraintData"); - - _json.writeName("bones"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getBones().size(); i++) { - writeBoneData(obj->getBones()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("slot"); - writeSlotData(obj->getSlot()); - - _json.writeName("positionMode"); - _json.writeValue([&]() -> String { - switch(obj->getPositionMode()) { - case PositionMode_Fixed: return "fixed"; - case PositionMode_Percent: return "percent"; - default: return "unknown"; - } - }()); - - _json.writeName("spacingMode"); - _json.writeValue([&]() -> String { - switch(obj->getSpacingMode()) { - case SpacingMode_Length: return "length"; - case SpacingMode_Fixed: return "fixed"; - case SpacingMode_Percent: return "percent"; - case SpacingMode_Proportional: return "proportional"; - default: return "unknown"; - } - }()); - - _json.writeName("rotateMode"); - _json.writeValue([&]() -> String { - switch(obj->getRotateMode()) { - case RotateMode_Tangent: return "tangent"; - case RotateMode_Chain: return "chain"; - case RotateMode_ChainScale: return "chainScale"; - default: return "unknown"; - } - }()); - - _json.writeName("offsetRotation"); - _json.writeValue(obj->getOffsetRotation()); - - _json.writeName("name"); - _json.writeValue(obj->getName()); - - _json.writeName("setupPose"); - writePathConstraintPose(obj->getSetupPose()); - - _json.writeName("skinRequired"); - _json.writeValue(obj->getSkinRequired()); - - _json.writeObjectEnd(); - } - - void writePathConstraintPose(PathConstraintPose* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); + _json.writeName("dampingGlobal"); + _json.writeValue(obj->getDampingGlobal()); - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("PathConstraintPose"); + _json.writeName("massGlobal"); + _json.writeValue(obj->getMassGlobal()); - _json.writeName("position"); - _json.writeValue(obj->getPosition()); + _json.writeName("windGlobal"); + _json.writeValue(obj->getWindGlobal()); - _json.writeName("spacing"); - _json.writeValue(obj->getSpacing()); + _json.writeName("gravityGlobal"); + _json.writeValue(obj->getGravityGlobal()); - _json.writeName("mixRotate"); - _json.writeValue(obj->getMixRotate()); + _json.writeName("mixGlobal"); + _json.writeValue(obj->getMixGlobal()); - _json.writeName("mixX"); - _json.writeValue(obj->getMixX()); + _json.writeName("name"); + _json.writeValue(obj->getName()); - _json.writeName("mixY"); - _json.writeValue(obj->getMixY()); + _json.writeName("setupPose"); + writePhysicsConstraintPose(obj->getSetupPose()); - _json.writeObjectEnd(); - } + _json.writeName("skinRequired"); + _json.writeValue(obj->getSkinRequired()); - void writePhysicsConstraint(PhysicsConstraint* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); + _json.writeObjectEnd(); + } - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("PhysicsConstraint"); + void writePhysicsConstraintPose(PhysicsConstraintPose *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); - _json.writeName("bone"); - writeBonePose(obj->getBone()); + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("PhysicsConstraintPose"); - _json.writeName("data"); - writePhysicsConstraintData(obj->getData()); + _json.writeName("inertia"); + _json.writeValue(obj->getInertia()); - _json.writeName("pose"); - writePhysicsConstraintPose(obj->getPose()); + _json.writeName("strength"); + _json.writeValue(obj->getStrength()); - _json.writeName("appliedPose"); - writePhysicsConstraintPose(obj->getAppliedPose()); + _json.writeName("damping"); + _json.writeValue(obj->getDamping()); - _json.writeObjectEnd(); - } + _json.writeName("massInverse"); + _json.writeValue(obj->getMassInverse()); - void writePhysicsConstraintData(PhysicsConstraintData* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); + _json.writeName("wind"); + _json.writeValue(obj->getWind()); - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("PhysicsConstraintData"); + _json.writeName("gravity"); + _json.writeValue(obj->getGravity()); - _json.writeName("bone"); - writeBoneData(obj->getBone()); + _json.writeName("mix"); + _json.writeValue(obj->getMix()); - _json.writeName("step"); - _json.writeValue(obj->getStep()); + _json.writeObjectEnd(); + } - _json.writeName("x"); - _json.writeValue(obj->getX()); + void writePointAttachment(PointAttachment *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); - _json.writeName("y"); - _json.writeValue(obj->getY()); + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("PointAttachment"); - _json.writeName("rotate"); - _json.writeValue(obj->getRotate()); + _json.writeName("x"); + _json.writeValue(obj->getX()); - _json.writeName("scaleX"); - _json.writeValue(obj->getScaleX()); + _json.writeName("y"); + _json.writeValue(obj->getY()); - _json.writeName("shearX"); - _json.writeValue(obj->getShearX()); + _json.writeName("rotation"); + _json.writeValue(obj->getRotation()); - _json.writeName("limit"); - _json.writeValue(obj->getLimit()); + _json.writeName("color"); + writeColor(obj->getColor()); - _json.writeName("inertiaGlobal"); - _json.writeValue(obj->getInertiaGlobal()); + _json.writeName("name"); + _json.writeValue(obj->getName()); - _json.writeName("strengthGlobal"); - _json.writeValue(obj->getStrengthGlobal()); + _json.writeObjectEnd(); + } - _json.writeName("dampingGlobal"); - _json.writeValue(obj->getDampingGlobal()); + void writeRegionAttachment(RegionAttachment *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); - _json.writeName("massGlobal"); - _json.writeValue(obj->getMassGlobal()); + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("RegionAttachment"); - _json.writeName("windGlobal"); - _json.writeValue(obj->getWindGlobal()); + _json.writeName("region"); + if (obj->getRegion() == nullptr) { + _json.writeNull(); + } else { + writeTextureRegion(obj->getRegion()); + } - _json.writeName("gravityGlobal"); - _json.writeValue(obj->getGravityGlobal()); + _json.writeName("offset"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getOffset().size(); i++) { + _json.writeValue(obj->getOffset()[i]); + } + _json.writeArrayEnd(); - _json.writeName("mixGlobal"); - _json.writeValue(obj->getMixGlobal()); + _json.writeName("uVs"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getUVs().size(); i++) { + _json.writeValue(obj->getUVs()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("x"); + _json.writeValue(obj->getX()); + + _json.writeName("y"); + _json.writeValue(obj->getY()); + + _json.writeName("scaleX"); + _json.writeValue(obj->getScaleX()); + + _json.writeName("scaleY"); + _json.writeValue(obj->getScaleY()); + + _json.writeName("rotation"); + _json.writeValue(obj->getRotation()); + + _json.writeName("width"); + _json.writeValue(obj->getWidth()); + + _json.writeName("height"); + _json.writeValue(obj->getHeight()); + + _json.writeName("color"); + writeColor(obj->getColor()); + + _json.writeName("path"); + _json.writeValue(obj->getPath()); + + _json.writeName("sequence"); + if (obj->getSequence() == nullptr) { + _json.writeNull(); + } else { + writeSequence(obj->getSequence()); + } + + _json.writeName("name"); + _json.writeValue(obj->getName()); + + _json.writeObjectEnd(); + } + + void writeSequence(Sequence *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("Sequence"); + + _json.writeName("start"); + _json.writeValue(obj->getStart()); + + _json.writeName("digits"); + _json.writeValue(obj->getDigits()); + + _json.writeName("setupIndex"); + _json.writeValue(obj->getSetupIndex()); + + _json.writeName("regions"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getRegions().size(); i++) { + writeTextureRegion(obj->getRegions()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("id"); + _json.writeValue(obj->getId()); + + _json.writeObjectEnd(); + } + + void writeSkeleton(Skeleton *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("Skeleton"); + + _json.writeName("data"); + writeSkeletonData(obj->getData()); + + _json.writeName("bones"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getBones().size(); i++) { + writeBone(obj->getBones()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("updateCache"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getUpdateCache().size(); i++) { + writeUpdate(obj->getUpdateCache()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("rootBone"); + writeBone(obj->getRootBone()); + + _json.writeName("slots"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getSlots().size(); i++) { + writeSlot(obj->getSlots()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("drawOrder"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getDrawOrder().size(); i++) { + writeSlot(obj->getDrawOrder()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("skin"); + if (obj->getSkin() == nullptr) { + _json.writeNull(); + } else { + writeSkin(obj->getSkin()); + } + + _json.writeName("constraints"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getConstraints().size(); i++) { + writeConstraint(obj->getConstraints()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("physicsConstraints"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getPhysicsConstraints().size(); i++) { + writePhysicsConstraint(obj->getPhysicsConstraints()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("color"); + writeColor(obj->getColor()); + + _json.writeName("scaleX"); + _json.writeValue(obj->getScaleX()); + + _json.writeName("scaleY"); + _json.writeValue(obj->getScaleY()); + + _json.writeName("x"); + _json.writeValue(obj->getX()); + + _json.writeName("y"); + _json.writeValue(obj->getY()); + + _json.writeName("windX"); + _json.writeValue(obj->getWindX()); + + _json.writeName("windY"); + _json.writeValue(obj->getWindY()); + + _json.writeName("gravityX"); + _json.writeValue(obj->getGravityX()); + + _json.writeName("gravityY"); + _json.writeValue(obj->getGravityY()); + + _json.writeName("time"); + _json.writeValue(obj->getTime()); + + _json.writeObjectEnd(); + } + + void writeSkeletonData(SkeletonData *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("SkeletonData"); + + _json.writeName("bones"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getBones().size(); i++) { + writeBoneData(obj->getBones()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("slots"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getSlots().size(); i++) { + writeSlotData(obj->getSlots()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("defaultSkin"); + if (obj->getDefaultSkin() == nullptr) { + _json.writeNull(); + } else { + writeSkin(obj->getDefaultSkin()); + } + + _json.writeName("skins"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getSkins().size(); i++) { + writeSkin(obj->getSkins()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("events"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getEvents().size(); i++) { + writeEventData(obj->getEvents()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("animations"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getAnimations().size(); i++) { + writeAnimation(obj->getAnimations()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("constraints"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getConstraints().size(); i++) { + writeConstraintData(obj->getConstraints()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("name"); + _json.writeValue(obj->getName()); + + _json.writeName("x"); + _json.writeValue(obj->getX()); + + _json.writeName("y"); + _json.writeValue(obj->getY()); + + _json.writeName("width"); + _json.writeValue(obj->getWidth()); + + _json.writeName("height"); + _json.writeValue(obj->getHeight()); + + _json.writeName("referenceScale"); + _json.writeValue(obj->getReferenceScale()); + + _json.writeName("version"); + _json.writeValue(obj->getVersion()); + + _json.writeName("hash"); + _json.writeValue(obj->getHash()); + + _json.writeName("imagesPath"); + _json.writeValue(obj->getImagesPath()); + + _json.writeName("audioPath"); + _json.writeValue(obj->getAudioPath()); + + _json.writeName("fps"); + _json.writeValue(obj->getFps()); + + _json.writeObjectEnd(); + } + + void writeSkin(Skin *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("Skin"); + + _json.writeName("attachments"); + _json.writeArrayStart(); + Skin::AttachmentMap::Entries entries = obj->getAttachments(); + while (entries.hasNext()) { + Skin::AttachmentMap::Entry &entry = entries.next(); + writeSkinEntry(&entry); + } + _json.writeArrayEnd(); + + _json.writeName("bones"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getBones().size(); i++) { + BoneData *item = obj->getBones()[i]; + writeBoneData(item); + } + _json.writeArrayEnd(); + + _json.writeName("constraints"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getConstraints().size(); i++) { + ConstraintData *item = obj->getConstraints()[i]; + writeConstraintData(item); + } + _json.writeArrayEnd(); + + _json.writeName("name"); + _json.writeValue(obj->getName()); + + _json.writeName("color"); + writeColor(&obj->getColor()); + + _json.writeObjectEnd(); + } + + void writeSkinEntry(Skin::AttachmentMap::Entry *obj) { + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("SkinEntry"); + _json.writeName("slotIndex"); + _json.writeValue((int) obj->_slotIndex); + _json.writeName("name"); + _json.writeValue(obj->_name); + _json.writeName("attachment"); + writeAttachment(obj->_attachment); + _json.writeObjectEnd(); + } + + void writeSlider(Slider *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("Slider"); + + _json.writeName("bone"); + writeBone(obj->getBone()); + + _json.writeName("data"); + writeSliderData(obj->getData()); + + _json.writeName("pose"); + writeSliderPose(obj->getPose()); + + _json.writeName("appliedPose"); + writeSliderPose(obj->getAppliedPose()); + + _json.writeObjectEnd(); + } + + void writeSliderData(SliderData *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("SliderData"); + + _json.writeName("animation"); + writeAnimation(obj->getAnimation()); + + _json.writeName("additive"); + _json.writeValue(obj->getAdditive()); + + _json.writeName("loop"); + _json.writeValue(obj->getLoop()); + + _json.writeName("bone"); + if (obj->getBone() == nullptr) { + _json.writeNull(); + } else { + writeBoneData(obj->getBone()); + } + + _json.writeName("property"); + if (obj->getProperty() == nullptr) { + _json.writeNull(); + } else { + writeFromProperty(obj->getProperty()); + } + + _json.writeName("offset"); + _json.writeValue(obj->getOffset()); + + _json.writeName("scale"); + _json.writeValue(obj->getScale()); + + _json.writeName("local"); + _json.writeValue(obj->getLocal()); + + _json.writeName("name"); + _json.writeValue(obj->getName()); + + _json.writeName("setupPose"); + writeSliderPose(obj->getSetupPose()); + + _json.writeName("skinRequired"); + _json.writeValue(obj->getSkinRequired()); + + _json.writeObjectEnd(); + } + + void writeSliderPose(SliderPose *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("SliderPose"); + + _json.writeName("time"); + _json.writeValue(obj->getTime()); + + _json.writeName("mix"); + _json.writeValue(obj->getMix()); + + _json.writeObjectEnd(); + } + + void writeSlot(Slot *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("Slot"); + + _json.writeName("bone"); + writeBone(obj->getBone()); + + _json.writeName("data"); + writeSlotData(obj->getData()); + + _json.writeName("pose"); + writeSlotPose(obj->getPose()); + + _json.writeName("appliedPose"); + writeSlotPose(obj->getAppliedPose()); + + _json.writeObjectEnd(); + } + + void writeSlotData(SlotData *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("SlotData"); + + _json.writeName("index"); + _json.writeValue(obj->getIndex()); + + _json.writeName("boneData"); + writeBoneData(obj->getBoneData()); + + _json.writeName("attachmentName"); + _json.writeValue(obj->getAttachmentName()); + + _json.writeName("blendMode"); + _json.writeValue([&]() -> String { + switch (obj->getBlendMode()) { + case BlendMode_Normal: + return "normal"; + case BlendMode_Additive: + return "additive"; + case BlendMode_Multiply: + return "multiply"; + case BlendMode_Screen: + return "screen"; + default: + return "unknown"; + } + }()); + + _json.writeName("visible"); + _json.writeValue(obj->getVisible()); + + _json.writeName("name"); + _json.writeValue(obj->getName()); + + _json.writeName("setupPose"); + writeSlotPose(obj->getSetupPose()); + + _json.writeName("skinRequired"); + _json.writeValue(obj->getSkinRequired()); + + _json.writeObjectEnd(); + } + + void writeSlotPose(SlotPose *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("SlotPose"); + + _json.writeName("color"); + writeColor(obj->getColor()); + + _json.writeName("darkColor"); + if (obj->hasDarkColor()) { + writeColor(&obj->getDarkColor()); + } else { + _json.writeNull(); + } + + _json.writeName("attachment"); + if (obj->getAttachment() == nullptr) { + _json.writeNull(); + } else { + writeAttachment(obj->getAttachment()); + } + + _json.writeName("sequenceIndex"); + _json.writeValue(obj->getSequenceIndex()); + + _json.writeName("deform"); + writeFloatArray(obj->getDeform()); - _json.writeName("name"); - _json.writeValue(obj->getName()); + _json.writeObjectEnd(); + } - _json.writeName("setupPose"); - writePhysicsConstraintPose(obj->getSetupPose()); + void writeTransformConstraint(TransformConstraint *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("TransformConstraint"); + + _json.writeName("bones"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getBones().size(); i++) { + writeBonePose(obj->getBones()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("source"); + writeBone(obj->getSource()); + + _json.writeName("data"); + writeTransformConstraintData(obj->getData()); + + _json.writeName("pose"); + writeTransformConstraintPose(obj->getPose()); + + _json.writeName("appliedPose"); + writeTransformConstraintPose(obj->getAppliedPose()); + + _json.writeObjectEnd(); + } + + void writeTransformConstraintData(TransformConstraintData *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("TransformConstraintData"); + + _json.writeName("bones"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getBones().size(); i++) { + writeBoneData(obj->getBones()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("source"); + writeBoneData(obj->getSource()); + + _json.writeName("offsetRotation"); + _json.writeValue(obj->getOffsetRotation()); + + _json.writeName("offsetX"); + _json.writeValue(obj->getOffsetX()); + + _json.writeName("offsetY"); + _json.writeValue(obj->getOffsetY()); + + _json.writeName("offsetScaleX"); + _json.writeValue(obj->getOffsetScaleX()); + + _json.writeName("offsetScaleY"); + _json.writeValue(obj->getOffsetScaleY()); + + _json.writeName("offsetShearY"); + _json.writeValue(obj->getOffsetShearY()); + + _json.writeName("localSource"); + _json.writeValue(obj->getLocalSource()); + + _json.writeName("localTarget"); + _json.writeValue(obj->getLocalTarget()); + + _json.writeName("additive"); + _json.writeValue(obj->getAdditive()); + + _json.writeName("clamp"); + _json.writeValue(obj->getClamp()); + + _json.writeName("properties"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->getProperties().size(); i++) { + writeFromProperty(obj->getProperties()[i]); + } + _json.writeArrayEnd(); + + _json.writeName("name"); + _json.writeValue(obj->getName()); + + _json.writeName("setupPose"); + writeTransformConstraintPose(obj->getSetupPose()); + + _json.writeName("skinRequired"); + _json.writeValue(obj->getSkinRequired()); + + _json.writeObjectEnd(); + } + + void writeFromProperty(FromProperty *obj) { + if (obj->getRTTI().instanceOf(FromRotate::rtti)) { + writeFromRotate((FromRotate *) obj); + } else if (obj->getRTTI().instanceOf(FromScaleX::rtti)) { + writeFromScaleX((FromScaleX *) obj); + } else if (obj->getRTTI().instanceOf(FromScaleY::rtti)) { + writeFromScaleY((FromScaleY *) obj); + } else if (obj->getRTTI().instanceOf(FromShearY::rtti)) { + writeFromShearY((FromShearY *) obj); + } else if (obj->getRTTI().instanceOf(FromX::rtti)) { + writeFromX((FromX *) obj); + } else if (obj->getRTTI().instanceOf(FromY::rtti)) { + writeFromY((FromY *) obj); + } else { + fprintf(stderr, "Error: Unknown FromProperty type\n"); + exit(1); + } + } + + void writeFromRotate(FromRotate *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("FromRotate"); + + _json.writeName("offset"); + _json.writeValue(obj->_offset); + + _json.writeName("to"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->_to.size(); i++) { + writeToProperty(obj->_to[i]); + } + _json.writeArrayEnd(); + + _json.writeObjectEnd(); + } + + void writeFromScaleX(FromScaleX *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("FromScaleX"); + + _json.writeName("offset"); + _json.writeValue(obj->_offset); + + _json.writeName("to"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->_to.size(); i++) { + writeToProperty(obj->_to[i]); + } + _json.writeArrayEnd(); + + _json.writeObjectEnd(); + } + + void writeFromScaleY(FromScaleY *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("FromScaleY"); + + _json.writeName("offset"); + _json.writeValue(obj->_offset); + + _json.writeName("to"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->_to.size(); i++) { + writeToProperty(obj->_to[i]); + } + _json.writeArrayEnd(); + + _json.writeObjectEnd(); + } + + void writeFromShearY(FromShearY *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("FromShearY"); + + _json.writeName("offset"); + _json.writeValue(obj->_offset); + + _json.writeName("to"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->_to.size(); i++) { + writeToProperty(obj->_to[i]); + } + _json.writeArrayEnd(); + + _json.writeObjectEnd(); + } + + void writeFromX(FromX *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("FromX"); + + _json.writeName("offset"); + _json.writeValue(obj->_offset); + + _json.writeName("to"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->_to.size(); i++) { + writeToProperty(obj->_to[i]); + } + _json.writeArrayEnd(); + + _json.writeObjectEnd(); + } + + void writeFromY(FromY *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("FromY"); + + _json.writeName("offset"); + _json.writeValue(obj->_offset); + + _json.writeName("to"); + _json.writeArrayStart(); + for (size_t i = 0; i < obj->_to.size(); i++) { + writeToProperty(obj->_to[i]); + } + _json.writeArrayEnd(); + + _json.writeObjectEnd(); + } + + void writeToProperty(ToProperty *obj) { + if (obj->getRTTI().instanceOf(ToRotate::rtti)) { + writeToRotate((ToRotate *) obj); + } else if (obj->getRTTI().instanceOf(ToScaleX::rtti)) { + writeToScaleX((ToScaleX *) obj); + } else if (obj->getRTTI().instanceOf(ToScaleY::rtti)) { + writeToScaleY((ToScaleY *) obj); + } else if (obj->getRTTI().instanceOf(ToShearY::rtti)) { + writeToShearY((ToShearY *) obj); + } else if (obj->getRTTI().instanceOf(ToX::rtti)) { + writeToX((ToX *) obj); + } else if (obj->getRTTI().instanceOf(ToY::rtti)) { + writeToY((ToY *) obj); + } else { + fprintf(stderr, "Error: Unknown ToProperty type\n"); + exit(1); + } + } + + void writeToRotate(ToRotate *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("ToRotate"); + + _json.writeName("offset"); + _json.writeValue(obj->_offset); + + _json.writeName("max"); + _json.writeValue(obj->_max); + + _json.writeName("scale"); + _json.writeValue(obj->_scale); + + _json.writeObjectEnd(); + } + + void writeToScaleX(ToScaleX *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("ToScaleX"); + + _json.writeName("offset"); + _json.writeValue(obj->_offset); + + _json.writeName("max"); + _json.writeValue(obj->_max); + + _json.writeName("scale"); + _json.writeValue(obj->_scale); + + _json.writeObjectEnd(); + } + + void writeToScaleY(ToScaleY *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("ToScaleY"); + + _json.writeName("offset"); + _json.writeValue(obj->_offset); + + _json.writeName("max"); + _json.writeValue(obj->_max); + + _json.writeName("scale"); + _json.writeValue(obj->_scale); + + _json.writeObjectEnd(); + } + + void writeToShearY(ToShearY *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("ToShearY"); + + _json.writeName("offset"); + _json.writeValue(obj->_offset); + + _json.writeName("max"); + _json.writeValue(obj->_max); + + _json.writeName("scale"); + _json.writeValue(obj->_scale); + + _json.writeObjectEnd(); + } + + void writeToX(ToX *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("ToX"); + + _json.writeName("offset"); + _json.writeValue(obj->_offset); + + _json.writeName("max"); + _json.writeValue(obj->_max); + + _json.writeName("scale"); + _json.writeValue(obj->_scale); + + _json.writeObjectEnd(); + } + + void writeToY(ToY *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("ToY"); + + _json.writeName("offset"); + _json.writeValue(obj->_offset); + + _json.writeName("max"); + _json.writeValue(obj->_max); + + _json.writeName("scale"); + _json.writeValue(obj->_scale); + + _json.writeObjectEnd(); + } + + void writeTransformConstraintPose(TransformConstraintPose *obj) { + if (_visitedObjects.containsKey(obj)) { + _json.writeValue(""); + return; + } + _visitedObjects.put(obj, true); + + _json.writeObjectStart(); + _json.writeName("type"); + _json.writeValue("TransformConstraintPose"); + + _json.writeName("mixRotate"); + _json.writeValue(obj->getMixRotate()); + + _json.writeName("mixX"); + _json.writeValue(obj->getMixX()); + + _json.writeName("mixY"); + _json.writeValue(obj->getMixY()); + + _json.writeName("mixScaleX"); + _json.writeValue(obj->getMixScaleX()); + + _json.writeName("mixScaleY"); + _json.writeValue(obj->getMixScaleY()); + + _json.writeName("mixShearY"); + _json.writeValue(obj->getMixShearY()); + + _json.writeObjectEnd(); + } + + void writeUpdate(Update *obj) { + if (obj->getRTTI().instanceOf(BonePose::rtti)) { + writeBonePose((BonePose *) obj); + } else if (obj->getRTTI().instanceOf(IkConstraint::rtti)) { + writeIkConstraint((IkConstraint *) obj); + } else if (obj->getRTTI().instanceOf(PathConstraint::rtti)) { + writePathConstraint((PathConstraint *) obj); + } else if (obj->getRTTI().instanceOf(PhysicsConstraint::rtti)) { + writePhysicsConstraint((PhysicsConstraint *) obj); + } else if (obj->getRTTI().instanceOf(Slider::rtti)) { + writeSlider((Slider *) obj); + } else if (obj->getRTTI().instanceOf(TransformConstraint::rtti)) { + writeTransformConstraint((TransformConstraint *) obj); + } else { + fprintf(stderr, "Error: Unknown Update type\n"); + exit(1); + } + } + + void writeVertexAttachment(VertexAttachment *obj) { + if (obj->getRTTI().instanceOf(BoundingBoxAttachment::rtti)) { + writeBoundingBoxAttachment((BoundingBoxAttachment *) obj); + } else if (obj->getRTTI().instanceOf(ClippingAttachment::rtti)) { + writeClippingAttachment((ClippingAttachment *) obj); + } else if (obj->getRTTI().instanceOf(MeshAttachment::rtti)) { + writeMeshAttachment((MeshAttachment *) obj); + } else if (obj->getRTTI().instanceOf(PathAttachment::rtti)) { + writePathAttachment((PathAttachment *) obj); + } else { + fprintf(stderr, "Error: Unknown VertexAttachment type\n"); + exit(1); + } + } + + // Custom helper methods + void writeColor(Color *obj) { + if (obj == nullptr) { + _json.writeNull(); + } else { + _json.writeObjectStart(); + _json.writeName("r"); + _json.writeValue(obj->r); + _json.writeName("g"); + _json.writeValue(obj->g); + _json.writeName("b"); + _json.writeValue(obj->b); + _json.writeName("a"); + _json.writeValue(obj->a); + _json.writeObjectEnd(); + } + } + + void writeColor(const Color &obj) { + _json.writeObjectStart(); + _json.writeName("r"); + _json.writeValue(obj.r); + _json.writeName("g"); + _json.writeValue(obj.g); + _json.writeName("b"); + _json.writeValue(obj.b); + _json.writeName("a"); + _json.writeValue(obj.a); + _json.writeObjectEnd(); + } + + void writeTextureRegion(TextureRegion *obj) { + if (obj == nullptr) { + _json.writeNull(); + } else { + _json.writeObjectStart(); + _json.writeName("u"); + _json.writeValue(obj->getU()); + _json.writeName("v"); + _json.writeValue(obj->getV()); + _json.writeName("u2"); + _json.writeValue(obj->getU2()); + _json.writeName("v2"); + _json.writeValue(obj->getV2()); + _json.writeName("width"); + _json.writeValue(obj->getRegionWidth()); + _json.writeName("height"); + _json.writeValue(obj->getRegionHeight()); + _json.writeObjectEnd(); + } + } + + void writeTextureRegion(const TextureRegion &obj) { + _json.writeObjectStart(); + _json.writeName("u"); + _json.writeValue(obj.getU()); + _json.writeName("v"); + _json.writeValue(obj.getV()); + _json.writeName("u2"); + _json.writeValue(obj.getU2()); + _json.writeName("v2"); + _json.writeValue(obj.getV2()); + _json.writeName("width"); + _json.writeValue(obj.getRegionWidth()); + _json.writeName("height"); + _json.writeValue(obj.getRegionHeight()); + _json.writeObjectEnd(); + } + + void writeIntArray(const Array &obj) { + _json.writeArrayStart(); + for (size_t i = 0; i < obj.size(); i++) { + _json.writeValue(obj[i]); + } + _json.writeArrayEnd(); + } + + void writeFloatArray(const Array &obj) { + _json.writeArrayStart(); + for (size_t i = 0; i < obj.size(); i++) { + _json.writeValue(obj[i]); + } + _json.writeArrayEnd(); + } + + // Reference versions of write methods + void writeAnimation(const Animation &obj) { + writeAnimation(const_cast(&obj)); + } + + void writeAlphaTimeline(const AlphaTimeline &obj) { + writeAlphaTimeline(const_cast(&obj)); + } + + void writeAttachmentTimeline(const AttachmentTimeline &obj) { + writeAttachmentTimeline(const_cast(&obj)); + } + + void writeDeformTimeline(const DeformTimeline &obj) { + writeDeformTimeline(const_cast(&obj)); + } + + void writeDrawOrderTimeline(const DrawOrderTimeline &obj) { + writeDrawOrderTimeline(const_cast(&obj)); + } + + void writeEventTimeline(const EventTimeline &obj) { + writeEventTimeline(const_cast(&obj)); + } + + void writeIkConstraintTimeline(const IkConstraintTimeline &obj) { + writeIkConstraintTimeline(const_cast(&obj)); + } + + void writeInheritTimeline(const InheritTimeline &obj) { + writeInheritTimeline(const_cast(&obj)); + } + + void writePathConstraintMixTimeline(const PathConstraintMixTimeline &obj) { + writePathConstraintMixTimeline(const_cast(&obj)); + } + + void writePathConstraintPositionTimeline(const PathConstraintPositionTimeline &obj) { + writePathConstraintPositionTimeline(const_cast(&obj)); + } + + void writePathConstraintSpacingTimeline(const PathConstraintSpacingTimeline &obj) { + writePathConstraintSpacingTimeline(const_cast(&obj)); + } + + void writePhysicsConstraintDampingTimeline(const PhysicsConstraintDampingTimeline &obj) { + writePhysicsConstraintDampingTimeline(const_cast(&obj)); + } + + void writePhysicsConstraintGravityTimeline(const PhysicsConstraintGravityTimeline &obj) { + writePhysicsConstraintGravityTimeline(const_cast(&obj)); + } + + void writePhysicsConstraintInertiaTimeline(const PhysicsConstraintInertiaTimeline &obj) { + writePhysicsConstraintInertiaTimeline(const_cast(&obj)); + } + + void writePhysicsConstraintMassTimeline(const PhysicsConstraintMassTimeline &obj) { + writePhysicsConstraintMassTimeline(const_cast(&obj)); + } + + void writePhysicsConstraintMixTimeline(const PhysicsConstraintMixTimeline &obj) { + writePhysicsConstraintMixTimeline(const_cast(&obj)); + } + + void writePhysicsConstraintResetTimeline(const PhysicsConstraintResetTimeline &obj) { + writePhysicsConstraintResetTimeline(const_cast(&obj)); + } + + void writePhysicsConstraintStrengthTimeline(const PhysicsConstraintStrengthTimeline &obj) { + writePhysicsConstraintStrengthTimeline(const_cast(&obj)); + } + + void writePhysicsConstraintWindTimeline(const PhysicsConstraintWindTimeline &obj) { + writePhysicsConstraintWindTimeline(const_cast(&obj)); + } + + void writeRGB2Timeline(const RGB2Timeline &obj) { + writeRGB2Timeline(const_cast(&obj)); + } + + void writeRGBA2Timeline(const RGBA2Timeline &obj) { + writeRGBA2Timeline(const_cast(&obj)); + } + + void writeRGBATimeline(const RGBATimeline &obj) { + writeRGBATimeline(const_cast(&obj)); + } + + void writeRGBTimeline(const RGBTimeline &obj) { + writeRGBTimeline(const_cast(&obj)); + } + + void writeRotateTimeline(const RotateTimeline &obj) { + writeRotateTimeline(const_cast(&obj)); + } - _json.writeName("skinRequired"); - _json.writeValue(obj->getSkinRequired()); + void writeScaleTimeline(const ScaleTimeline &obj) { + writeScaleTimeline(const_cast(&obj)); + } - _json.writeObjectEnd(); - } + void writeScaleXTimeline(const ScaleXTimeline &obj) { + writeScaleXTimeline(const_cast(&obj)); + } - void writePhysicsConstraintPose(PhysicsConstraintPose* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); + void writeScaleYTimeline(const ScaleYTimeline &obj) { + writeScaleYTimeline(const_cast(&obj)); + } - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("PhysicsConstraintPose"); + void writeSequenceTimeline(const SequenceTimeline &obj) { + writeSequenceTimeline(const_cast(&obj)); + } - _json.writeName("inertia"); - _json.writeValue(obj->getInertia()); + void writeShearTimeline(const ShearTimeline &obj) { + writeShearTimeline(const_cast(&obj)); + } - _json.writeName("strength"); - _json.writeValue(obj->getStrength()); + void writeShearXTimeline(const ShearXTimeline &obj) { + writeShearXTimeline(const_cast(&obj)); + } - _json.writeName("damping"); - _json.writeValue(obj->getDamping()); + void writeShearYTimeline(const ShearYTimeline &obj) { + writeShearYTimeline(const_cast(&obj)); + } - _json.writeName("massInverse"); - _json.writeValue(obj->getMassInverse()); + void writeSliderMixTimeline(const SliderMixTimeline &obj) { + writeSliderMixTimeline(const_cast(&obj)); + } - _json.writeName("wind"); - _json.writeValue(obj->getWind()); + void writeSliderTimeline(const SliderTimeline &obj) { + writeSliderTimeline(const_cast(&obj)); + } - _json.writeName("gravity"); - _json.writeValue(obj->getGravity()); + void writeTransformConstraintTimeline(const TransformConstraintTimeline &obj) { + writeTransformConstraintTimeline(const_cast(&obj)); + } - _json.writeName("mix"); - _json.writeValue(obj->getMix()); + void writeTranslateTimeline(const TranslateTimeline &obj) { + writeTranslateTimeline(const_cast(&obj)); + } - _json.writeObjectEnd(); - } + void writeTranslateXTimeline(const TranslateXTimeline &obj) { + writeTranslateXTimeline(const_cast(&obj)); + } - void writePointAttachment(PointAttachment* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); + void writeTranslateYTimeline(const TranslateYTimeline &obj) { + writeTranslateYTimeline(const_cast(&obj)); + } - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("PointAttachment"); + void writeAnimationState(const AnimationState &obj) { + writeAnimationState(const_cast(&obj)); + } - _json.writeName("x"); - _json.writeValue(obj->getX()); + void writeTrackEntry(const TrackEntry &obj) { + writeTrackEntry(const_cast(&obj)); + } - _json.writeName("y"); - _json.writeValue(obj->getY()); + void writeAnimationStateData(const AnimationStateData &obj) { + writeAnimationStateData(const_cast(&obj)); + } - _json.writeName("rotation"); - _json.writeValue(obj->getRotation()); + void writeBone(const Bone &obj) { + writeBone(const_cast(&obj)); + } - _json.writeName("color"); - writeColor(obj->getColor()); + void writeBoneData(const BoneData &obj) { + writeBoneData(const_cast(&obj)); + } - _json.writeName("name"); - _json.writeValue(obj->getName()); + void writeBoneLocal(const BoneLocal &obj) { + writeBoneLocal(const_cast(&obj)); + } - _json.writeObjectEnd(); - } + void writeBonePose(const BonePose &obj) { + writeBonePose(const_cast(&obj)); + } - void writeRegionAttachment(RegionAttachment* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); + void writeBoundingBoxAttachment(const BoundingBoxAttachment &obj) { + writeBoundingBoxAttachment(const_cast(&obj)); + } - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("RegionAttachment"); + void writeClippingAttachment(const ClippingAttachment &obj) { + writeClippingAttachment(const_cast(&obj)); + } - _json.writeName("region"); - if (obj->getRegion() == nullptr) { - _json.writeNull(); - } else { - writeTextureRegion(obj->getRegion()); - } + void writeEvent(const Event &obj) { + writeEvent(const_cast(&obj)); + } - _json.writeName("offset"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getOffset().size(); i++) { - _json.writeValue(obj->getOffset()[i]); - } - _json.writeArrayEnd(); + void writeEventData(const EventData &obj) { + writeEventData(const_cast(&obj)); + } - _json.writeName("uVs"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getUVs().size(); i++) { - _json.writeValue(obj->getUVs()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("x"); - _json.writeValue(obj->getX()); - - _json.writeName("y"); - _json.writeValue(obj->getY()); - - _json.writeName("scaleX"); - _json.writeValue(obj->getScaleX()); - - _json.writeName("scaleY"); - _json.writeValue(obj->getScaleY()); - - _json.writeName("rotation"); - _json.writeValue(obj->getRotation()); - - _json.writeName("width"); - _json.writeValue(obj->getWidth()); - - _json.writeName("height"); - _json.writeValue(obj->getHeight()); - - _json.writeName("color"); - writeColor(obj->getColor()); - - _json.writeName("path"); - _json.writeValue(obj->getPath()); - - _json.writeName("sequence"); - if (obj->getSequence() == nullptr) { - _json.writeNull(); - } else { - writeSequence(obj->getSequence()); - } - - _json.writeName("name"); - _json.writeValue(obj->getName()); - - _json.writeObjectEnd(); - } - - void writeSequence(Sequence* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("Sequence"); - - _json.writeName("start"); - _json.writeValue(obj->getStart()); - - _json.writeName("digits"); - _json.writeValue(obj->getDigits()); - - _json.writeName("setupIndex"); - _json.writeValue(obj->getSetupIndex()); - - _json.writeName("regions"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getRegions().size(); i++) { - writeTextureRegion(obj->getRegions()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("id"); - _json.writeValue(obj->getId()); - - _json.writeObjectEnd(); - } - - void writeSkeleton(Skeleton* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("Skeleton"); - - _json.writeName("data"); - writeSkeletonData(obj->getData()); - - _json.writeName("bones"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getBones().size(); i++) { - writeBone(obj->getBones()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("updateCache"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getUpdateCache().size(); i++) { - writeUpdate(obj->getUpdateCache()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("rootBone"); - writeBone(obj->getRootBone()); - - _json.writeName("slots"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getSlots().size(); i++) { - writeSlot(obj->getSlots()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("drawOrder"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getDrawOrder().size(); i++) { - writeSlot(obj->getDrawOrder()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("skin"); - if (obj->getSkin() == nullptr) { - _json.writeNull(); - } else { - writeSkin(obj->getSkin()); - } - - _json.writeName("constraints"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getConstraints().size(); i++) { - writeConstraint(obj->getConstraints()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("physicsConstraints"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getPhysicsConstraints().size(); i++) { - writePhysicsConstraint(obj->getPhysicsConstraints()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("color"); - writeColor(obj->getColor()); - - _json.writeName("scaleX"); - _json.writeValue(obj->getScaleX()); - - _json.writeName("scaleY"); - _json.writeValue(obj->getScaleY()); - - _json.writeName("x"); - _json.writeValue(obj->getX()); - - _json.writeName("y"); - _json.writeValue(obj->getY()); - - _json.writeName("windX"); - _json.writeValue(obj->getWindX()); - - _json.writeName("windY"); - _json.writeValue(obj->getWindY()); - - _json.writeName("gravityX"); - _json.writeValue(obj->getGravityX()); - - _json.writeName("gravityY"); - _json.writeValue(obj->getGravityY()); - - _json.writeName("time"); - _json.writeValue(obj->getTime()); - - _json.writeObjectEnd(); - } - - void writeSkeletonData(SkeletonData* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("SkeletonData"); - - _json.writeName("bones"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getBones().size(); i++) { - writeBoneData(obj->getBones()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("slots"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getSlots().size(); i++) { - writeSlotData(obj->getSlots()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("defaultSkin"); - if (obj->getDefaultSkin() == nullptr) { - _json.writeNull(); - } else { - writeSkin(obj->getDefaultSkin()); - } - - _json.writeName("skins"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getSkins().size(); i++) { - writeSkin(obj->getSkins()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("events"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getEvents().size(); i++) { - writeEventData(obj->getEvents()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("animations"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getAnimations().size(); i++) { - writeAnimation(obj->getAnimations()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("constraints"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getConstraints().size(); i++) { - writeConstraintData(obj->getConstraints()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("name"); - _json.writeValue(obj->getName()); - - _json.writeName("x"); - _json.writeValue(obj->getX()); - - _json.writeName("y"); - _json.writeValue(obj->getY()); - - _json.writeName("width"); - _json.writeValue(obj->getWidth()); - - _json.writeName("height"); - _json.writeValue(obj->getHeight()); - - _json.writeName("referenceScale"); - _json.writeValue(obj->getReferenceScale()); - - _json.writeName("version"); - _json.writeValue(obj->getVersion()); - - _json.writeName("hash"); - _json.writeValue(obj->getHash()); - - _json.writeName("imagesPath"); - _json.writeValue(obj->getImagesPath()); - - _json.writeName("audioPath"); - _json.writeValue(obj->getAudioPath()); - - _json.writeName("fps"); - _json.writeValue(obj->getFps()); - - _json.writeObjectEnd(); - } - - void writeSkin(Skin* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("Skin"); - - _json.writeName("attachments"); - _json.writeArrayStart(); - Skin::AttachmentMap::Entries entries = obj->getAttachments(); - while (entries.hasNext()) { - Skin::AttachmentMap::Entry& entry = entries.next(); - writeSkinEntry(&entry); - } - _json.writeArrayEnd(); - - _json.writeName("bones"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getBones().size(); i++) { - BoneData* item = obj->getBones()[i]; - writeBoneData(item); - } - _json.writeArrayEnd(); - - _json.writeName("constraints"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getConstraints().size(); i++) { - ConstraintData* item = obj->getConstraints()[i]; - writeConstraintData(item); - } - _json.writeArrayEnd(); - - _json.writeName("name"); - _json.writeValue(obj->getName()); - - _json.writeName("color"); - writeColor(&obj->getColor()); - - _json.writeObjectEnd(); - } - - void writeSkinEntry(Skin::AttachmentMap::Entry* obj) { - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("SkinEntry"); - _json.writeName("slotIndex"); - _json.writeValue((int)obj->_slotIndex); - _json.writeName("name"); - _json.writeValue(obj->_name); - _json.writeName("attachment"); - writeAttachment(obj->_attachment); - _json.writeObjectEnd(); - } - - void writeSlider(Slider* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("Slider"); - - _json.writeName("bone"); - writeBone(obj->getBone()); - - _json.writeName("data"); - writeSliderData(obj->getData()); - - _json.writeName("pose"); - writeSliderPose(obj->getPose()); - - _json.writeName("appliedPose"); - writeSliderPose(obj->getAppliedPose()); - - _json.writeObjectEnd(); - } - - void writeSliderData(SliderData* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("SliderData"); - - _json.writeName("animation"); - writeAnimation(obj->getAnimation()); - - _json.writeName("additive"); - _json.writeValue(obj->getAdditive()); - - _json.writeName("loop"); - _json.writeValue(obj->getLoop()); - - _json.writeName("bone"); - if (obj->getBone() == nullptr) { - _json.writeNull(); - } else { - writeBoneData(obj->getBone()); - } - - _json.writeName("property"); - if (obj->getProperty() == nullptr) { - _json.writeNull(); - } else { - writeFromProperty(obj->getProperty()); - } - - _json.writeName("offset"); - _json.writeValue(obj->getOffset()); - - _json.writeName("scale"); - _json.writeValue(obj->getScale()); - - _json.writeName("local"); - _json.writeValue(obj->getLocal()); - - _json.writeName("name"); - _json.writeValue(obj->getName()); - - _json.writeName("setupPose"); - writeSliderPose(obj->getSetupPose()); - - _json.writeName("skinRequired"); - _json.writeValue(obj->getSkinRequired()); - - _json.writeObjectEnd(); - } - - void writeSliderPose(SliderPose* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("SliderPose"); - - _json.writeName("time"); - _json.writeValue(obj->getTime()); - - _json.writeName("mix"); - _json.writeValue(obj->getMix()); - - _json.writeObjectEnd(); - } - - void writeSlot(Slot* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); + void writeIkConstraint(const IkConstraint &obj) { + writeIkConstraint(const_cast(&obj)); + } - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("Slot"); + void writeIkConstraintData(const IkConstraintData &obj) { + writeIkConstraintData(const_cast(&obj)); + } - _json.writeName("bone"); - writeBone(obj->getBone()); - - _json.writeName("data"); - writeSlotData(obj->getData()); - - _json.writeName("pose"); - writeSlotPose(obj->getPose()); - - _json.writeName("appliedPose"); - writeSlotPose(obj->getAppliedPose()); - - _json.writeObjectEnd(); - } - - void writeSlotData(SlotData* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("SlotData"); - - _json.writeName("index"); - _json.writeValue(obj->getIndex()); - - _json.writeName("boneData"); - writeBoneData(obj->getBoneData()); - - _json.writeName("attachmentName"); - _json.writeValue(obj->getAttachmentName()); - - _json.writeName("blendMode"); - _json.writeValue([&]() -> String { - switch(obj->getBlendMode()) { - case BlendMode_Normal: return "normal"; - case BlendMode_Additive: return "additive"; - case BlendMode_Multiply: return "multiply"; - case BlendMode_Screen: return "screen"; - default: return "unknown"; - } - }()); - - _json.writeName("visible"); - _json.writeValue(obj->getVisible()); - - _json.writeName("name"); - _json.writeValue(obj->getName()); - - _json.writeName("setupPose"); - writeSlotPose(obj->getSetupPose()); - - _json.writeName("skinRequired"); - _json.writeValue(obj->getSkinRequired()); - - _json.writeObjectEnd(); - } - - void writeSlotPose(SlotPose* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("SlotPose"); - - _json.writeName("color"); - writeColor(obj->getColor()); + void writeIkConstraintPose(const IkConstraintPose &obj) { + writeIkConstraintPose(const_cast(&obj)); + } - _json.writeName("darkColor"); - if (obj->hasDarkColor()) { - writeColor(&obj->getDarkColor()); - } else { - _json.writeNull(); - } + void writeMeshAttachment(const MeshAttachment &obj) { + writeMeshAttachment(const_cast(&obj)); + } - _json.writeName("attachment"); - if (obj->getAttachment() == nullptr) { - _json.writeNull(); - } else { - writeAttachment(obj->getAttachment()); - } + void writePathAttachment(const PathAttachment &obj) { + writePathAttachment(const_cast(&obj)); + } - _json.writeName("sequenceIndex"); - _json.writeValue(obj->getSequenceIndex()); + void writePathConstraint(const PathConstraint &obj) { + writePathConstraint(const_cast(&obj)); + } - _json.writeName("deform"); - writeFloatArray(obj->getDeform()); + void writePathConstraintData(const PathConstraintData &obj) { + writePathConstraintData(const_cast(&obj)); + } - _json.writeObjectEnd(); - } + void writePathConstraintPose(const PathConstraintPose &obj) { + writePathConstraintPose(const_cast(&obj)); + } - void writeTransformConstraint(TransformConstraint* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); + void writePhysicsConstraint(const PhysicsConstraint &obj) { + writePhysicsConstraint(const_cast(&obj)); + } - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("TransformConstraint"); - - _json.writeName("bones"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getBones().size(); i++) { - writeBonePose(obj->getBones()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("source"); - writeBone(obj->getSource()); - - _json.writeName("data"); - writeTransformConstraintData(obj->getData()); - - _json.writeName("pose"); - writeTransformConstraintPose(obj->getPose()); - - _json.writeName("appliedPose"); - writeTransformConstraintPose(obj->getAppliedPose()); - - _json.writeObjectEnd(); - } - - void writeTransformConstraintData(TransformConstraintData* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("TransformConstraintData"); - - _json.writeName("bones"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getBones().size(); i++) { - writeBoneData(obj->getBones()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("source"); - writeBoneData(obj->getSource()); - - _json.writeName("offsetRotation"); - _json.writeValue(obj->getOffsetRotation()); - - _json.writeName("offsetX"); - _json.writeValue(obj->getOffsetX()); - - _json.writeName("offsetY"); - _json.writeValue(obj->getOffsetY()); - - _json.writeName("offsetScaleX"); - _json.writeValue(obj->getOffsetScaleX()); - - _json.writeName("offsetScaleY"); - _json.writeValue(obj->getOffsetScaleY()); - - _json.writeName("offsetShearY"); - _json.writeValue(obj->getOffsetShearY()); - - _json.writeName("localSource"); - _json.writeValue(obj->getLocalSource()); - - _json.writeName("localTarget"); - _json.writeValue(obj->getLocalTarget()); - - _json.writeName("additive"); - _json.writeValue(obj->getAdditive()); - - _json.writeName("clamp"); - _json.writeValue(obj->getClamp()); - - _json.writeName("properties"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->getProperties().size(); i++) { - writeFromProperty(obj->getProperties()[i]); - } - _json.writeArrayEnd(); - - _json.writeName("name"); - _json.writeValue(obj->getName()); - - _json.writeName("setupPose"); - writeTransformConstraintPose(obj->getSetupPose()); - - _json.writeName("skinRequired"); - _json.writeValue(obj->getSkinRequired()); - - _json.writeObjectEnd(); - } - - void writeFromProperty(FromProperty* obj) { - if (obj->getRTTI().instanceOf(FromRotate::rtti)) { - writeFromRotate((FromRotate*)obj); - } else if (obj->getRTTI().instanceOf(FromScaleX::rtti)) { - writeFromScaleX((FromScaleX*)obj); - } else if (obj->getRTTI().instanceOf(FromScaleY::rtti)) { - writeFromScaleY((FromScaleY*)obj); - } else if (obj->getRTTI().instanceOf(FromShearY::rtti)) { - writeFromShearY((FromShearY*)obj); - } else if (obj->getRTTI().instanceOf(FromX::rtti)) { - writeFromX((FromX*)obj); - } else if (obj->getRTTI().instanceOf(FromY::rtti)) { - writeFromY((FromY*)obj); - } else { - fprintf(stderr, "Error: Unknown FromProperty type\n"); exit(1); - } - } - - void writeFromRotate(FromRotate* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("FromRotate"); - - _json.writeName("offset"); - _json.writeValue(obj->_offset); - - _json.writeName("to"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->_to.size(); i++) { - writeToProperty(obj->_to[i]); - } - _json.writeArrayEnd(); - - _json.writeObjectEnd(); - } - - void writeFromScaleX(FromScaleX* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("FromScaleX"); - - _json.writeName("offset"); - _json.writeValue(obj->_offset); - - _json.writeName("to"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->_to.size(); i++) { - writeToProperty(obj->_to[i]); - } - _json.writeArrayEnd(); - - _json.writeObjectEnd(); - } - - void writeFromScaleY(FromScaleY* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("FromScaleY"); - - _json.writeName("offset"); - _json.writeValue(obj->_offset); - - _json.writeName("to"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->_to.size(); i++) { - writeToProperty(obj->_to[i]); - } - _json.writeArrayEnd(); - - _json.writeObjectEnd(); - } - - void writeFromShearY(FromShearY* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("FromShearY"); - - _json.writeName("offset"); - _json.writeValue(obj->_offset); - - _json.writeName("to"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->_to.size(); i++) { - writeToProperty(obj->_to[i]); - } - _json.writeArrayEnd(); - - _json.writeObjectEnd(); - } - - void writeFromX(FromX* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("FromX"); - - _json.writeName("offset"); - _json.writeValue(obj->_offset); - - _json.writeName("to"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->_to.size(); i++) { - writeToProperty(obj->_to[i]); - } - _json.writeArrayEnd(); - - _json.writeObjectEnd(); - } - - void writeFromY(FromY* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("FromY"); - - _json.writeName("offset"); - _json.writeValue(obj->_offset); - - _json.writeName("to"); - _json.writeArrayStart(); - for (size_t i = 0; i < obj->_to.size(); i++) { - writeToProperty(obj->_to[i]); - } - _json.writeArrayEnd(); - - _json.writeObjectEnd(); - } - - void writeToProperty(ToProperty* obj) { - if (obj->getRTTI().instanceOf(ToRotate::rtti)) { - writeToRotate((ToRotate*)obj); - } else if (obj->getRTTI().instanceOf(ToScaleX::rtti)) { - writeToScaleX((ToScaleX*)obj); - } else if (obj->getRTTI().instanceOf(ToScaleY::rtti)) { - writeToScaleY((ToScaleY*)obj); - } else if (obj->getRTTI().instanceOf(ToShearY::rtti)) { - writeToShearY((ToShearY*)obj); - } else if (obj->getRTTI().instanceOf(ToX::rtti)) { - writeToX((ToX*)obj); - } else if (obj->getRTTI().instanceOf(ToY::rtti)) { - writeToY((ToY*)obj); - } else { - fprintf(stderr, "Error: Unknown ToProperty type\n"); exit(1); - } - } - - void writeToRotate(ToRotate* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("ToRotate"); - - _json.writeName("offset"); - _json.writeValue(obj->_offset); - - _json.writeName("max"); - _json.writeValue(obj->_max); - - _json.writeName("scale"); - _json.writeValue(obj->_scale); - - _json.writeObjectEnd(); - } - - void writeToScaleX(ToScaleX* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("ToScaleX"); - - _json.writeName("offset"); - _json.writeValue(obj->_offset); - - _json.writeName("max"); - _json.writeValue(obj->_max); - - _json.writeName("scale"); - _json.writeValue(obj->_scale); - - _json.writeObjectEnd(); - } - - void writeToScaleY(ToScaleY* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("ToScaleY"); - - _json.writeName("offset"); - _json.writeValue(obj->_offset); - - _json.writeName("max"); - _json.writeValue(obj->_max); - - _json.writeName("scale"); - _json.writeValue(obj->_scale); - - _json.writeObjectEnd(); - } - - void writeToShearY(ToShearY* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("ToShearY"); - - _json.writeName("offset"); - _json.writeValue(obj->_offset); - - _json.writeName("max"); - _json.writeValue(obj->_max); - - _json.writeName("scale"); - _json.writeValue(obj->_scale); - - _json.writeObjectEnd(); - } - - void writeToX(ToX* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("ToX"); - - _json.writeName("offset"); - _json.writeValue(obj->_offset); - - _json.writeName("max"); - _json.writeValue(obj->_max); - - _json.writeName("scale"); - _json.writeValue(obj->_scale); - - _json.writeObjectEnd(); - } - - void writeToY(ToY* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("ToY"); - - _json.writeName("offset"); - _json.writeValue(obj->_offset); - - _json.writeName("max"); - _json.writeValue(obj->_max); - - _json.writeName("scale"); - _json.writeValue(obj->_scale); - - _json.writeObjectEnd(); - } - - void writeTransformConstraintPose(TransformConstraintPose* obj) { - if (_visitedObjects.containsKey(obj)) { - _json.writeValue(""); - return; - } - _visitedObjects.put(obj, true); - - _json.writeObjectStart(); - _json.writeName("type"); - _json.writeValue("TransformConstraintPose"); - - _json.writeName("mixRotate"); - _json.writeValue(obj->getMixRotate()); - - _json.writeName("mixX"); - _json.writeValue(obj->getMixX()); - - _json.writeName("mixY"); - _json.writeValue(obj->getMixY()); - - _json.writeName("mixScaleX"); - _json.writeValue(obj->getMixScaleX()); - - _json.writeName("mixScaleY"); - _json.writeValue(obj->getMixScaleY()); - - _json.writeName("mixShearY"); - _json.writeValue(obj->getMixShearY()); - - _json.writeObjectEnd(); - } - - void writeUpdate(Update* obj) { - if (obj->getRTTI().instanceOf(BonePose::rtti)) { - writeBonePose((BonePose*)obj); - } else if (obj->getRTTI().instanceOf(IkConstraint::rtti)) { - writeIkConstraint((IkConstraint*)obj); - } else if (obj->getRTTI().instanceOf(PathConstraint::rtti)) { - writePathConstraint((PathConstraint*)obj); - } else if (obj->getRTTI().instanceOf(PhysicsConstraint::rtti)) { - writePhysicsConstraint((PhysicsConstraint*)obj); - } else if (obj->getRTTI().instanceOf(Slider::rtti)) { - writeSlider((Slider*)obj); - } else if (obj->getRTTI().instanceOf(TransformConstraint::rtti)) { - writeTransformConstraint((TransformConstraint*)obj); - } else { - fprintf(stderr, "Error: Unknown Update type\n"); exit(1); - } - } - - void writeVertexAttachment(VertexAttachment* obj) { - if (obj->getRTTI().instanceOf(BoundingBoxAttachment::rtti)) { - writeBoundingBoxAttachment((BoundingBoxAttachment*)obj); - } else if (obj->getRTTI().instanceOf(ClippingAttachment::rtti)) { - writeClippingAttachment((ClippingAttachment*)obj); - } else if (obj->getRTTI().instanceOf(MeshAttachment::rtti)) { - writeMeshAttachment((MeshAttachment*)obj); - } else if (obj->getRTTI().instanceOf(PathAttachment::rtti)) { - writePathAttachment((PathAttachment*)obj); - } else { - fprintf(stderr, "Error: Unknown VertexAttachment type\n"); exit(1); - } - } - - // Custom helper methods - void writeColor(Color* obj) { - if (obj == nullptr) { - _json.writeNull(); - } else { - _json.writeObjectStart(); - _json.writeName("r"); - _json.writeValue(obj->r); - _json.writeName("g"); - _json.writeValue(obj->g); - _json.writeName("b"); - _json.writeValue(obj->b); - _json.writeName("a"); - _json.writeValue(obj->a); - _json.writeObjectEnd(); - } - } - - void writeColor(const Color& obj) { - _json.writeObjectStart(); - _json.writeName("r"); - _json.writeValue(obj.r); - _json.writeName("g"); - _json.writeValue(obj.g); - _json.writeName("b"); - _json.writeValue(obj.b); - _json.writeName("a"); - _json.writeValue(obj.a); - _json.writeObjectEnd(); - } - - void writeTextureRegion(TextureRegion* obj) { - if (obj == nullptr) { - _json.writeNull(); - } else { - _json.writeObjectStart(); - _json.writeName("u"); - _json.writeValue(obj->getU()); - _json.writeName("v"); - _json.writeValue(obj->getV()); - _json.writeName("u2"); - _json.writeValue(obj->getU2()); - _json.writeName("v2"); - _json.writeValue(obj->getV2()); - _json.writeName("width"); - _json.writeValue(obj->getRegionWidth()); - _json.writeName("height"); - _json.writeValue(obj->getRegionHeight()); - _json.writeObjectEnd(); - } - } - - void writeTextureRegion(const TextureRegion& obj) { - _json.writeObjectStart(); - _json.writeName("u"); - _json.writeValue(obj.getU()); - _json.writeName("v"); - _json.writeValue(obj.getV()); - _json.writeName("u2"); - _json.writeValue(obj.getU2()); - _json.writeName("v2"); - _json.writeValue(obj.getV2()); - _json.writeName("width"); - _json.writeValue(obj.getRegionWidth()); - _json.writeName("height"); - _json.writeValue(obj.getRegionHeight()); - _json.writeObjectEnd(); - } - - void writeIntArray(const Array& obj) { - _json.writeArrayStart(); - for (size_t i = 0; i < obj.size(); i++) { - _json.writeValue(obj[i]); - } - _json.writeArrayEnd(); - } - - void writeFloatArray(const Array& obj) { - _json.writeArrayStart(); - for (size_t i = 0; i < obj.size(); i++) { - _json.writeValue(obj[i]); - } - _json.writeArrayEnd(); - } - - // Reference versions of write methods - void writeAnimation(const Animation& obj) { - writeAnimation(const_cast(&obj)); - } - - void writeAlphaTimeline(const AlphaTimeline& obj) { - writeAlphaTimeline(const_cast(&obj)); - } - - void writeAttachmentTimeline(const AttachmentTimeline& obj) { - writeAttachmentTimeline(const_cast(&obj)); - } - - void writeDeformTimeline(const DeformTimeline& obj) { - writeDeformTimeline(const_cast(&obj)); - } - - void writeDrawOrderTimeline(const DrawOrderTimeline& obj) { - writeDrawOrderTimeline(const_cast(&obj)); - } - - void writeEventTimeline(const EventTimeline& obj) { - writeEventTimeline(const_cast(&obj)); - } - - void writeIkConstraintTimeline(const IkConstraintTimeline& obj) { - writeIkConstraintTimeline(const_cast(&obj)); - } - - void writeInheritTimeline(const InheritTimeline& obj) { - writeInheritTimeline(const_cast(&obj)); - } - - void writePathConstraintMixTimeline(const PathConstraintMixTimeline& obj) { - writePathConstraintMixTimeline(const_cast(&obj)); - } - - void writePathConstraintPositionTimeline(const PathConstraintPositionTimeline& obj) { - writePathConstraintPositionTimeline(const_cast(&obj)); - } - - void writePathConstraintSpacingTimeline(const PathConstraintSpacingTimeline& obj) { - writePathConstraintSpacingTimeline(const_cast(&obj)); - } - - void writePhysicsConstraintDampingTimeline(const PhysicsConstraintDampingTimeline& obj) { - writePhysicsConstraintDampingTimeline(const_cast(&obj)); - } - - void writePhysicsConstraintGravityTimeline(const PhysicsConstraintGravityTimeline& obj) { - writePhysicsConstraintGravityTimeline(const_cast(&obj)); - } - - void writePhysicsConstraintInertiaTimeline(const PhysicsConstraintInertiaTimeline& obj) { - writePhysicsConstraintInertiaTimeline(const_cast(&obj)); - } - - void writePhysicsConstraintMassTimeline(const PhysicsConstraintMassTimeline& obj) { - writePhysicsConstraintMassTimeline(const_cast(&obj)); - } - - void writePhysicsConstraintMixTimeline(const PhysicsConstraintMixTimeline& obj) { - writePhysicsConstraintMixTimeline(const_cast(&obj)); - } - - void writePhysicsConstraintResetTimeline(const PhysicsConstraintResetTimeline& obj) { - writePhysicsConstraintResetTimeline(const_cast(&obj)); - } - - void writePhysicsConstraintStrengthTimeline(const PhysicsConstraintStrengthTimeline& obj) { - writePhysicsConstraintStrengthTimeline(const_cast(&obj)); - } - - void writePhysicsConstraintWindTimeline(const PhysicsConstraintWindTimeline& obj) { - writePhysicsConstraintWindTimeline(const_cast(&obj)); - } - - void writeRGB2Timeline(const RGB2Timeline& obj) { - writeRGB2Timeline(const_cast(&obj)); - } - - void writeRGBA2Timeline(const RGBA2Timeline& obj) { - writeRGBA2Timeline(const_cast(&obj)); - } - - void writeRGBATimeline(const RGBATimeline& obj) { - writeRGBATimeline(const_cast(&obj)); - } - - void writeRGBTimeline(const RGBTimeline& obj) { - writeRGBTimeline(const_cast(&obj)); - } - - void writeRotateTimeline(const RotateTimeline& obj) { - writeRotateTimeline(const_cast(&obj)); - } + void writePhysicsConstraintData(const PhysicsConstraintData &obj) { + writePhysicsConstraintData(const_cast(&obj)); + } - void writeScaleTimeline(const ScaleTimeline& obj) { - writeScaleTimeline(const_cast(&obj)); - } + void writePhysicsConstraintPose(const PhysicsConstraintPose &obj) { + writePhysicsConstraintPose(const_cast(&obj)); + } - void writeScaleXTimeline(const ScaleXTimeline& obj) { - writeScaleXTimeline(const_cast(&obj)); - } + void writePointAttachment(const PointAttachment &obj) { + writePointAttachment(const_cast(&obj)); + } - void writeScaleYTimeline(const ScaleYTimeline& obj) { - writeScaleYTimeline(const_cast(&obj)); - } + void writeRegionAttachment(const RegionAttachment &obj) { + writeRegionAttachment(const_cast(&obj)); + } - void writeSequenceTimeline(const SequenceTimeline& obj) { - writeSequenceTimeline(const_cast(&obj)); - } + void writeSequence(const Sequence &obj) { + writeSequence(const_cast(&obj)); + } - void writeShearTimeline(const ShearTimeline& obj) { - writeShearTimeline(const_cast(&obj)); - } + void writeSkeleton(const Skeleton &obj) { + writeSkeleton(const_cast(&obj)); + } - void writeShearXTimeline(const ShearXTimeline& obj) { - writeShearXTimeline(const_cast(&obj)); - } + void writeSkeletonData(const SkeletonData &obj) { + writeSkeletonData(const_cast(&obj)); + } - void writeShearYTimeline(const ShearYTimeline& obj) { - writeShearYTimeline(const_cast(&obj)); - } + void writeSlider(const Slider &obj) { + writeSlider(const_cast(&obj)); + } - void writeSliderMixTimeline(const SliderMixTimeline& obj) { - writeSliderMixTimeline(const_cast(&obj)); - } + void writeSliderData(const SliderData &obj) { + writeSliderData(const_cast(&obj)); + } - void writeSliderTimeline(const SliderTimeline& obj) { - writeSliderTimeline(const_cast(&obj)); - } + void writeSliderPose(const SliderPose &obj) { + writeSliderPose(const_cast(&obj)); + } - void writeTransformConstraintTimeline(const TransformConstraintTimeline& obj) { - writeTransformConstraintTimeline(const_cast(&obj)); - } + void writeSlot(const Slot &obj) { + writeSlot(const_cast(&obj)); + } - void writeTranslateTimeline(const TranslateTimeline& obj) { - writeTranslateTimeline(const_cast(&obj)); - } + void writeSlotData(const SlotData &obj) { + writeSlotData(const_cast(&obj)); + } - void writeTranslateXTimeline(const TranslateXTimeline& obj) { - writeTranslateXTimeline(const_cast(&obj)); - } + void writeSlotPose(const SlotPose &obj) { + writeSlotPose(const_cast(&obj)); + } - void writeTranslateYTimeline(const TranslateYTimeline& obj) { - writeTranslateYTimeline(const_cast(&obj)); - } + void writeTransformConstraint(const TransformConstraint &obj) { + writeTransformConstraint(const_cast(&obj)); + } - void writeAnimationState(const AnimationState& obj) { - writeAnimationState(const_cast(&obj)); - } + void writeTransformConstraintData(const TransformConstraintData &obj) { + writeTransformConstraintData(const_cast(&obj)); + } - void writeTrackEntry(const TrackEntry& obj) { - writeTrackEntry(const_cast(&obj)); - } + void writeFromRotate(const FromRotate &obj) { + writeFromRotate(const_cast(&obj)); + } - void writeAnimationStateData(const AnimationStateData& obj) { - writeAnimationStateData(const_cast(&obj)); - } + void writeFromScaleX(const FromScaleX &obj) { + writeFromScaleX(const_cast(&obj)); + } - void writeBone(const Bone& obj) { - writeBone(const_cast(&obj)); - } + void writeFromScaleY(const FromScaleY &obj) { + writeFromScaleY(const_cast(&obj)); + } - void writeBoneData(const BoneData& obj) { - writeBoneData(const_cast(&obj)); - } + void writeFromShearY(const FromShearY &obj) { + writeFromShearY(const_cast(&obj)); + } - void writeBoneLocal(const BoneLocal& obj) { - writeBoneLocal(const_cast(&obj)); - } + void writeFromX(const FromX &obj) { + writeFromX(const_cast(&obj)); + } - void writeBonePose(const BonePose& obj) { - writeBonePose(const_cast(&obj)); - } + void writeFromY(const FromY &obj) { + writeFromY(const_cast(&obj)); + } - void writeBoundingBoxAttachment(const BoundingBoxAttachment& obj) { - writeBoundingBoxAttachment(const_cast(&obj)); - } + void writeToRotate(const ToRotate &obj) { + writeToRotate(const_cast(&obj)); + } - void writeClippingAttachment(const ClippingAttachment& obj) { - writeClippingAttachment(const_cast(&obj)); - } + void writeToScaleX(const ToScaleX &obj) { + writeToScaleX(const_cast(&obj)); + } - void writeEvent(const Event& obj) { - writeEvent(const_cast(&obj)); - } + void writeToScaleY(const ToScaleY &obj) { + writeToScaleY(const_cast(&obj)); + } - void writeEventData(const EventData& obj) { - writeEventData(const_cast(&obj)); - } + void writeToShearY(const ToShearY &obj) { + writeToShearY(const_cast(&obj)); + } - void writeIkConstraint(const IkConstraint& obj) { - writeIkConstraint(const_cast(&obj)); - } + void writeToX(const ToX &obj) { + writeToX(const_cast(&obj)); + } - void writeIkConstraintData(const IkConstraintData& obj) { - writeIkConstraintData(const_cast(&obj)); - } + void writeToY(const ToY &obj) { + writeToY(const_cast(&obj)); + } - void writeIkConstraintPose(const IkConstraintPose& obj) { - writeIkConstraintPose(const_cast(&obj)); - } + void writeTransformConstraintPose(const TransformConstraintPose &obj) { + writeTransformConstraintPose(const_cast(&obj)); + } + }; - void writeMeshAttachment(const MeshAttachment& obj) { - writeMeshAttachment(const_cast(&obj)); - } - - void writePathAttachment(const PathAttachment& obj) { - writePathAttachment(const_cast(&obj)); - } - - void writePathConstraint(const PathConstraint& obj) { - writePathConstraint(const_cast(&obj)); - } - - void writePathConstraintData(const PathConstraintData& obj) { - writePathConstraintData(const_cast(&obj)); - } - - void writePathConstraintPose(const PathConstraintPose& obj) { - writePathConstraintPose(const_cast(&obj)); - } - - void writePhysicsConstraint(const PhysicsConstraint& obj) { - writePhysicsConstraint(const_cast(&obj)); - } - - void writePhysicsConstraintData(const PhysicsConstraintData& obj) { - writePhysicsConstraintData(const_cast(&obj)); - } - - void writePhysicsConstraintPose(const PhysicsConstraintPose& obj) { - writePhysicsConstraintPose(const_cast(&obj)); - } - - void writePointAttachment(const PointAttachment& obj) { - writePointAttachment(const_cast(&obj)); - } - - void writeRegionAttachment(const RegionAttachment& obj) { - writeRegionAttachment(const_cast(&obj)); - } - - void writeSequence(const Sequence& obj) { - writeSequence(const_cast(&obj)); - } - - void writeSkeleton(const Skeleton& obj) { - writeSkeleton(const_cast(&obj)); - } - - void writeSkeletonData(const SkeletonData& obj) { - writeSkeletonData(const_cast(&obj)); - } - - void writeSlider(const Slider& obj) { - writeSlider(const_cast(&obj)); - } - - void writeSliderData(const SliderData& obj) { - writeSliderData(const_cast(&obj)); - } - - void writeSliderPose(const SliderPose& obj) { - writeSliderPose(const_cast(&obj)); - } - - void writeSlot(const Slot& obj) { - writeSlot(const_cast(&obj)); - } - - void writeSlotData(const SlotData& obj) { - writeSlotData(const_cast(&obj)); - } - - void writeSlotPose(const SlotPose& obj) { - writeSlotPose(const_cast(&obj)); - } - - void writeTransformConstraint(const TransformConstraint& obj) { - writeTransformConstraint(const_cast(&obj)); - } - - void writeTransformConstraintData(const TransformConstraintData& obj) { - writeTransformConstraintData(const_cast(&obj)); - } - - void writeFromRotate(const FromRotate& obj) { - writeFromRotate(const_cast(&obj)); - } - - void writeFromScaleX(const FromScaleX& obj) { - writeFromScaleX(const_cast(&obj)); - } - - void writeFromScaleY(const FromScaleY& obj) { - writeFromScaleY(const_cast(&obj)); - } - - void writeFromShearY(const FromShearY& obj) { - writeFromShearY(const_cast(&obj)); - } - - void writeFromX(const FromX& obj) { - writeFromX(const_cast(&obj)); - } - - void writeFromY(const FromY& obj) { - writeFromY(const_cast(&obj)); - } - - void writeToRotate(const ToRotate& obj) { - writeToRotate(const_cast(&obj)); - } - - void writeToScaleX(const ToScaleX& obj) { - writeToScaleX(const_cast(&obj)); - } - - void writeToScaleY(const ToScaleY& obj) { - writeToScaleY(const_cast(&obj)); - } - - void writeToShearY(const ToShearY& obj) { - writeToShearY(const_cast(&obj)); - } - - void writeToX(const ToX& obj) { - writeToX(const_cast(&obj)); - } - - void writeToY(const ToY& obj) { - writeToY(const_cast(&obj)); - } - - void writeTransformConstraintPose(const TransformConstraintPose& obj) { - writeTransformConstraintPose(const_cast(&obj)); - } - -}; - -} // namespace spine +}// namespace spine #endif \ No newline at end of file diff --git a/spine-glfw/src/spine-glfw.cpp b/spine-glfw/src/spine-glfw.cpp index 42150b642..2eacaf8e5 100644 --- a/spine-glfw/src/spine-glfw.cpp +++ b/spine-glfw/src/spine-glfw.cpp @@ -53,11 +53,12 @@ typedef struct { /// The 4 supported blend modes SPINE_BLEND_MODE_NORMAL, SPINE_BLEND_MODE_ADDITIVE, SPINE_BLEND_MODE_MULTIPLY, /// and SPINE_BLEND_MODE_SCREEN, expressed as OpenGL blend functions. -blend_mode_t blend_modes[] = { - {(unsigned int) GL_SRC_ALPHA, (unsigned int) GL_ONE, (unsigned int) GL_ONE_MINUS_SRC_ALPHA, (unsigned int) GL_ONE}, - {(unsigned int) GL_SRC_ALPHA, (unsigned int) GL_ONE, (unsigned int) GL_ONE, (unsigned int) GL_ONE}, - {(unsigned int) GL_DST_COLOR, (unsigned int) GL_DST_COLOR, (unsigned int) GL_ONE_MINUS_SRC_ALPHA, (unsigned int) GL_ONE_MINUS_SRC_ALPHA}, - {(unsigned int) GL_ONE, (unsigned int) GL_ONE, (unsigned int) GL_ONE_MINUS_SRC_COLOR, (unsigned int) GL_ONE_MINUS_SRC_COLOR}}; +blend_mode_t blend_modes[] = {{(unsigned int) GL_SRC_ALPHA, (unsigned int) GL_ONE, (unsigned int) GL_ONE_MINUS_SRC_ALPHA, (unsigned int) GL_ONE}, + {(unsigned int) GL_SRC_ALPHA, (unsigned int) GL_ONE, (unsigned int) GL_ONE, (unsigned int) GL_ONE}, + {(unsigned int) GL_DST_COLOR, (unsigned int) GL_DST_COLOR, (unsigned int) GL_ONE_MINUS_SRC_ALPHA, + (unsigned int) GL_ONE_MINUS_SRC_ALPHA}, + {(unsigned int) GL_ONE, (unsigned int) GL_ONE, (unsigned int) GL_ONE_MINUS_SRC_COLOR, + (unsigned int) GL_ONE_MINUS_SRC_COLOR}}; mesh_t *mesh_create() { GLuint vao, vbo, ibo; @@ -351,7 +352,8 @@ void renderer_draw(renderer_t *renderer, Skeleton *skeleton, bool premultipliedA mesh_update(renderer->mesh, renderer->vertex_buffer, num_command_vertices, indices, num_command_indices); blend_mode_t blend_mode = blend_modes[command->blendMode]; - glBlendFuncSeparate(premultipliedAlpha ? (GLenum) blend_mode.source_color_pma : (GLenum) blend_mode.source_color, (GLenum) blend_mode.dest_color, (GLenum) blend_mode.source_alpha, (GLenum) blend_mode.dest_color); + glBlendFuncSeparate(premultipliedAlpha ? (GLenum) blend_mode.source_color_pma : (GLenum) blend_mode.source_color, + (GLenum) blend_mode.dest_color, (GLenum) blend_mode.source_alpha, (GLenum) blend_mode.dest_color); auto texture = (texture_t) (uintptr_t) command->texture; texture_use(texture); diff --git a/spine-glfw/src/stb_image.h b/spine-glfw/src/stb_image.h index 295bdfaac..fc1c62bd1 100644 --- a/spine-glfw/src/stb_image.h +++ b/spine-glfw/src/stb_image.h @@ -404,11 +404,11 @@ extern "C" { // load image by filename, open file, or memory buffer // -typedef struct -{ - int (*read)(void *user, char *data, int size);// fill 'data' with 'size' bytes. return number of bytes actually read - void (*skip)(void *user, int n); // skip the next 'n' bytes, or 'unget' the last -n bytes if negative - int (*eof)(void *user); // returns nonzero if we are at end of file/data +typedef struct { + int (*read)(void *user, char *data, + int size); // fill 'data' with 'size' bytes. return number of bytes actually read + void (*skip)(void *user, int n);// skip the next 'n' bytes, or 'unget' the last -n bytes if negative + int (*eof)(void *user); // returns nonzero if we are at end of file/data } stbi_io_callbacks; //////////////////////////////////// @@ -541,7 +541,8 @@ STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char #ifdef STB_IMAGE_IMPLEMENTATION -#if defined(STBI_ONLY_JPEG) || defined(STBI_ONLY_PNG) || defined(STBI_ONLY_BMP) || defined(STBI_ONLY_TGA) || defined(STBI_ONLY_GIF) || defined(STBI_ONLY_PSD) || defined(STBI_ONLY_HDR) || defined(STBI_ONLY_PIC) || defined(STBI_ONLY_PNM) || defined(STBI_ONLY_ZLIB) +#if defined(STBI_ONLY_JPEG) || defined(STBI_ONLY_PNG) || defined(STBI_ONLY_BMP) || defined(STBI_ONLY_TGA) || defined(STBI_ONLY_GIF) || \ + defined(STBI_ONLY_PSD) || defined(STBI_ONLY_HDR) || defined(STBI_ONLY_PIC) || defined(STBI_ONLY_PNM) || defined(STBI_ONLY_ZLIB) #ifndef STBI_ONLY_JPEG #define STBI_NO_JPEG #endif @@ -659,7 +660,7 @@ typedef unsigned char validate_uint32[sizeof(stbi__uint32) == 4 ? 1 : -1]; #ifdef STBI_HAS_LROTL #define stbi_lrot(x, y) _lrotl(x, y) #else -#define stbi_lrot(x, y) (((x) << (y)) | ((x) >> (-(y) &31))) +#define stbi_lrot(x, y) (((x) << (y)) | ((x) >> (-(y) & 31))) #endif #if defined(STBI_MALLOC) && defined(STBI_FREE) && (defined(STBI_REALLOC) || defined(STBI_REALLOC_SIZED)) @@ -790,8 +791,7 @@ static int stbi__sse2_available(void) { // stbi__context structure is our basic context used by all images, so it // contains all the IO context, plus some basic image information -typedef struct -{ +typedef struct { stbi__uint32 img_x, img_y; int img_n, img_out_n; @@ -850,11 +850,10 @@ static int stbi__stdio_eof(void *user) { return feof((FILE *) user) || ferror((FILE *) user); } -static stbi_io_callbacks stbi__stdio_callbacks = - { - stbi__stdio_read, - stbi__stdio_skip, - stbi__stdio_eof, +static stbi_io_callbacks stbi__stdio_callbacks = { + stbi__stdio_read, + stbi__stdio_skip, + stbi__stdio_eof, }; static void stbi__start_file(stbi__context *s, FILE *f) { @@ -878,8 +877,7 @@ enum { STBI_ORDER_BGR }; -typedef struct -{ +typedef struct { int bits_per_channel; int num_channels; int channel_order; @@ -945,9 +943,9 @@ static int stbi__pnm_is16(stbi__context *s); static #ifdef STBI_THREAD_LOCAL - STBI_THREAD_LOCAL + STBI_THREAD_LOCAL #endif - const char *stbi__g_failure_reason; + const char *stbi__g_failure_reason; STBIDEF const char *stbi_failure_reason(void) { return stbi__g_failure_reason; @@ -1003,15 +1001,14 @@ static int stbi__mad2sizes_valid(int a, int b, int add) { // returns 1 if "a*b*c + add" has no negative terms/factors and doesn't overflow static int stbi__mad3sizes_valid(int a, int b, int c, int add) { - return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a * b, c) && - stbi__addsizes_valid(a * b * c, add); + return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a * b, c) && stbi__addsizes_valid(a * b * c, add); } // returns 1 if "a*b*c*d + add" has no negative terms/factors and doesn't overflow #if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR) || !defined(STBI_NO_PNM) static int stbi__mad4sizes_valid(int a, int b, int c, int d, int add) { - return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a * b, c) && - stbi__mul2sizes_valid(a * b * c, d) && stbi__addsizes_valid(a * b * c * d, add); + return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a * b, c) && stbi__mul2sizes_valid(a * b * c, d) && + stbi__addsizes_valid(a * b * c * d, add); } #endif @@ -1078,9 +1075,7 @@ STBIDEF void stbi_set_flip_vertically_on_load_thread(int flag_true_if_should_fli stbi__vertically_flip_on_load_set = 1; } -#define stbi__vertically_flip_on_load (stbi__vertically_flip_on_load_set \ - ? stbi__vertically_flip_on_load_local \ - : stbi__vertically_flip_on_load_global) +#define stbi__vertically_flip_on_load (stbi__vertically_flip_on_load_set ? stbi__vertically_flip_on_load_local : stbi__vertically_flip_on_load_global) #endif// STBI_THREAD_LOCAL static void *stbi__load_main(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc) { @@ -1128,8 +1123,7 @@ static void *stbi__load_main(stbi__context *s, int *x, int *y, int *comp, int re #ifndef STBI_NO_TGA // test tga last because it's a crappy test! - if (stbi__tga_test(s)) - return stbi__tga_load(s, x, y, comp, req_comp, ri); + if (stbi__tga_test(s)) return stbi__tga_load(s, x, y, comp, req_comp, ri); #endif return stbi__errpuc("unknown image type", "Image not of any known type, or corrupt"); @@ -1143,8 +1137,7 @@ static stbi_uc *stbi__convert_16_to_8(stbi__uint16 *orig, int w, int h, int chan reduced = (stbi_uc *) stbi__malloc(img_len); if (reduced == NULL) return stbi__errpuc("outofmem", "Out of memory"); - for (i = 0; i < img_len; ++i) - reduced[i] = (stbi_uc) ((orig[i] >> 8) & 0xFF);// top half of each byte is sufficient approx of 16->8 bit scaling + for (i = 0; i < img_len; ++i) reduced[i] = (stbi_uc) ((orig[i] >> 8) & 0xFF);// top half of each byte is sufficient approx of 16->8 bit scaling STBI_FREE(orig); return reduced; @@ -1158,8 +1151,7 @@ static stbi__uint16 *stbi__convert_8_to_16(stbi_uc *orig, int w, int h, int chan enlarged = (stbi__uint16 *) stbi__malloc(img_len * 2); if (enlarged == NULL) return (stbi__uint16 *) stbi__errpuc("outofmem", "Out of memory"); - for (i = 0; i < img_len; ++i) - enlarged[i] = (stbi__uint16) ((orig[i] << 8) + orig[i]);// replicate to high and low byte, maps 0->0, 255->0xffff + for (i = 0; i < img_len; ++i) enlarged[i] = (stbi__uint16) ((orig[i] << 8) + orig[i]);// replicate to high and low byte, maps 0->0, 255->0xffff STBI_FREE(orig); return enlarged; @@ -1205,8 +1197,7 @@ static unsigned char *stbi__load_and_postprocess_8bit(stbi__context *s, int *x, stbi__result_info ri; void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 8); - if (result == NULL) - return NULL; + if (result == NULL) return NULL; // it is the responsibility of the loaders to make sure we get either 8 or 16 bit. STBI_ASSERT(ri.bits_per_channel == 8 || ri.bits_per_channel == 16); @@ -1230,8 +1221,7 @@ static stbi__uint16 *stbi__load_and_postprocess_16bit(stbi__context *s, int *x, stbi__result_info ri; void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 16); - if (result == NULL) - return NULL; + if (result == NULL) return NULL; // it is the responsibility of the loaders to make sure we get either 8 or 16 bit. STBI_ASSERT(ri.bits_per_channel == 8 || ri.bits_per_channel == 16); @@ -1264,8 +1254,11 @@ static void stbi__float_postprocess(float *result, int *x, int *y, int *comp, in #ifndef STBI_NO_STDIO #if defined(_WIN32) && defined(STBI_WINDOWS_UTF8) -STBI_EXTERN __declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int cp, unsigned long flags, const char *str, int cbmb, wchar_t *widestr, int cchwide); -STBI_EXTERN __declspec(dllimport) int __stdcall WideCharToMultiByte(unsigned int cp, unsigned long flags, const wchar_t *widestr, int cchwide, char *str, int cbmb, const char *defchar, int *used_default); +STBI_EXTERN +__declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int cp, unsigned long flags, const char *str, int cbmb, wchar_t *widestr, + int cchwide); +STBI_EXTERN __declspec(dllimport) int __stdcall WideCharToMultiByte(unsigned int cp, unsigned long flags, const wchar_t *widestr, int cchwide, + char *str, int cbmb, const char *defchar, int *used_default); #endif #if defined(_WIN32) && defined(STBI_WINDOWS_UTF8) @@ -1279,22 +1272,18 @@ static FILE *stbi__fopen(char const *filename, char const *mode) { #if defined(_WIN32) && defined(STBI_WINDOWS_UTF8) wchar_t wMode[64]; wchar_t wFilename[1024]; - if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, filename, -1, wFilename, sizeof(wFilename) / sizeof(*wFilename))) - return 0; + if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, filename, -1, wFilename, sizeof(wFilename) / sizeof(*wFilename))) return 0; - if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, mode, -1, wMode, sizeof(wMode) / sizeof(*wMode))) - return 0; + if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, mode, -1, wMode, sizeof(wMode) / sizeof(*wMode))) return 0; #if defined(_MSC_VER) && _MSC_VER >= 1400 - if (0 != _wfopen_s(&f, wFilename, wMode)) - f = 0; + if (0 != _wfopen_s(&f, wFilename, wMode)) f = 0; #else f = _wfopen(wFilename, wMode); #endif #elif defined(_MSC_VER) && _MSC_VER >= 1400 - if (0 != fopen_s(&f, filename, mode)) - f = 0; + if (0 != fopen_s(&f, filename, mode)) f = 0; #else f = fopen(filename, mode); #endif @@ -1393,14 +1382,12 @@ static float *stbi__loadf_main(stbi__context *s, int *x, int *y, int *comp, int if (stbi__hdr_test(s)) { stbi__result_info ri; float *hdr_data = stbi__hdr_load(s, x, y, comp, req_comp, &ri); - if (hdr_data) - stbi__float_postprocess(hdr_data, x, y, comp, req_comp); + if (hdr_data) stbi__float_postprocess(hdr_data, x, y, comp, req_comp); return hdr_data; } #endif data = stbi__load_and_postprocess_8bit(s, x, y, comp, req_comp); - if (data) - return stbi__ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp); + if (data) return stbi__ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp); return stbi__errpf("unknown image type", "Image not of any known type, or corrupt"); } @@ -1493,14 +1480,22 @@ STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user #ifndef STBI_NO_LINEAR static float stbi__l2h_gamma = 2.2f, stbi__l2h_scale = 1.0f; -STBIDEF void stbi_ldr_to_hdr_gamma(float gamma) { stbi__l2h_gamma = gamma; } -STBIDEF void stbi_ldr_to_hdr_scale(float scale) { stbi__l2h_scale = scale; } +STBIDEF void stbi_ldr_to_hdr_gamma(float gamma) { + stbi__l2h_gamma = gamma; +} +STBIDEF void stbi_ldr_to_hdr_scale(float scale) { + stbi__l2h_scale = scale; +} #endif static float stbi__h2l_gamma_i = 1.0f / 2.2f, stbi__h2l_scale_i = 1.0f; -STBIDEF void stbi_hdr_to_ldr_gamma(float gamma) { stbi__h2l_gamma_i = 1 / gamma; } -STBIDEF void stbi_hdr_to_ldr_scale(float scale) { stbi__h2l_scale_i = 1 / scale; } +STBIDEF void stbi_hdr_to_ldr_gamma(float gamma) { + stbi__h2l_gamma_i = 1 / gamma; +} +STBIDEF void stbi_hdr_to_ldr_scale(float scale) { + stbi__h2l_scale_i = 1 / scale; +} ////////////////////////////////////////////////////////////////////////////// @@ -1531,8 +1526,7 @@ static void stbi__refill_buffer(stbi__context *s) { } stbi_inline static stbi_uc stbi__get8(stbi__context *s) { - if (s->img_buffer < s->img_buffer_end) - return *s->img_buffer++; + if (s->img_buffer < s->img_buffer_end) return *s->img_buffer++; if (s->read_from_callbacks) { stbi__refill_buffer(s); return *s->img_buffer++; @@ -1555,7 +1549,8 @@ stbi_inline static int stbi__at_eof(stbi__context *s) { } #endif -#if defined(STBI_NO_JPEG) && defined(STBI_NO_PNG) && defined(STBI_NO_BMP) && defined(STBI_NO_PSD) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) && defined(STBI_NO_PIC) +#if defined(STBI_NO_JPEG) && defined(STBI_NO_PNG) && defined(STBI_NO_BMP) && defined(STBI_NO_PSD) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) && \ + defined(STBI_NO_PIC) // nothing #else static void stbi__skip(stbi__context *s, int n) { @@ -1638,9 +1633,10 @@ static stbi__uint32 stbi__get32le(stbi__context *s) { } #endif -#define STBI__BYTECAST(x) ((stbi_uc) ((x) &255))// truncate int to byte without warnings +#define STBI__BYTECAST(x) ((stbi_uc) ((x) & 255))// truncate int to byte without warnings -#if defined(STBI_NO_JPEG) && defined(STBI_NO_PNG) && defined(STBI_NO_BMP) && defined(STBI_NO_PSD) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) && defined(STBI_NO_PIC) && defined(STBI_NO_PNM) +#if defined(STBI_NO_JPEG) && defined(STBI_NO_PNG) && defined(STBI_NO_BMP) && defined(STBI_NO_PSD) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) && \ + defined(STBI_NO_PIC) && defined(STBI_NO_PNM) // nothing #else ////////////////////////////////////////////////////////////////////////////// @@ -1659,7 +1655,8 @@ static stbi_uc stbi__compute_y(int r, int g, int b) { } #endif -#if defined(STBI_NO_PNG) && defined(STBI_NO_BMP) && defined(STBI_NO_PSD) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) && defined(STBI_NO_PIC) && defined(STBI_NO_PNM) +#if defined(STBI_NO_PNG) && defined(STBI_NO_BMP) && defined(STBI_NO_PSD) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) && defined(STBI_NO_PIC) && \ + defined(STBI_NO_PNM) // nothing #else static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int req_comp, unsigned int x, unsigned int y) { @@ -1679,9 +1676,9 @@ static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int r unsigned char *src = data + j * x * img_n; unsigned char *dest = good + j * x * req_comp; -#define STBI__COMBO(a, b) ((a) *8 + (b)) -#define STBI__CASE(a, b) \ - case STBI__COMBO(a, b): \ +#define STBI__COMBO(a, b) ((a) * 8 + (b)) +#define STBI__CASE(a, b) \ + case STBI__COMBO(a, b): \ for (i = x - 1; i >= 0; --i, src += a, dest += b) // convert source image with img_n components to one with req_comp components; // avoid switch per pixel, so use switch per scanline and massive macros @@ -1691,16 +1688,22 @@ static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int r dest[1] = 255; } break; - STBI__CASE(1, 3) { dest[0] = dest[1] = dest[2] = src[0]; } + STBI__CASE(1, 3) { + dest[0] = dest[1] = dest[2] = src[0]; + } break; STBI__CASE(1, 4) { dest[0] = dest[1] = dest[2] = src[0]; dest[3] = 255; } break; - STBI__CASE(2, 1) { dest[0] = src[0]; } + STBI__CASE(2, 1) { + dest[0] = src[0]; + } break; - STBI__CASE(2, 3) { dest[0] = dest[1] = dest[2] = src[0]; } + STBI__CASE(2, 3) { + dest[0] = dest[1] = dest[2] = src[0]; + } break; STBI__CASE(2, 4) { dest[0] = dest[1] = dest[2] = src[0]; @@ -1714,14 +1717,18 @@ static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int r dest[3] = 255; } break; - STBI__CASE(3, 1) { dest[0] = stbi__compute_y(src[0], src[1], src[2]); } + STBI__CASE(3, 1) { + dest[0] = stbi__compute_y(src[0], src[1], src[2]); + } break; STBI__CASE(3, 2) { dest[0] = stbi__compute_y(src[0], src[1], src[2]); dest[1] = 255; } break; - STBI__CASE(4, 1) { dest[0] = stbi__compute_y(src[0], src[1], src[2]); } + STBI__CASE(4, 1) { + dest[0] = stbi__compute_y(src[0], src[1], src[2]); + } break; STBI__CASE(4, 2) { dest[0] = stbi__compute_y(src[0], src[1], src[2]); @@ -1776,9 +1783,9 @@ static stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_n, int r stbi__uint16 *src = data + j * x * img_n; stbi__uint16 *dest = good + j * x * req_comp; -#define STBI__COMBO(a, b) ((a) *8 + (b)) -#define STBI__CASE(a, b) \ - case STBI__COMBO(a, b): \ +#define STBI__COMBO(a, b) ((a) * 8 + (b)) +#define STBI__CASE(a, b) \ + case STBI__COMBO(a, b): \ for (i = x - 1; i >= 0; --i, src += a, dest += b) // convert source image with img_n components to one with req_comp components; // avoid switch per pixel, so use switch per scanline and massive macros @@ -1788,16 +1795,22 @@ static stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_n, int r dest[1] = 0xffff; } break; - STBI__CASE(1, 3) { dest[0] = dest[1] = dest[2] = src[0]; } + STBI__CASE(1, 3) { + dest[0] = dest[1] = dest[2] = src[0]; + } break; STBI__CASE(1, 4) { dest[0] = dest[1] = dest[2] = src[0]; dest[3] = 0xffff; } break; - STBI__CASE(2, 1) { dest[0] = src[0]; } + STBI__CASE(2, 1) { + dest[0] = src[0]; + } break; - STBI__CASE(2, 3) { dest[0] = dest[1] = dest[2] = src[0]; } + STBI__CASE(2, 3) { + dest[0] = dest[1] = dest[2] = src[0]; + } break; STBI__CASE(2, 4) { dest[0] = dest[1] = dest[2] = src[0]; @@ -1811,14 +1824,18 @@ static stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_n, int r dest[3] = 0xffff; } break; - STBI__CASE(3, 1) { dest[0] = stbi__compute_y_16(src[0], src[1], src[2]); } + STBI__CASE(3, 1) { + dest[0] = stbi__compute_y_16(src[0], src[1], src[2]); + } break; STBI__CASE(3, 2) { dest[0] = stbi__compute_y_16(src[0], src[1], src[2]); dest[1] = 0xffff; } break; - STBI__CASE(4, 1) { dest[0] = stbi__compute_y_16(src[0], src[1], src[2]); } + STBI__CASE(4, 1) { + dest[0] = stbi__compute_y_16(src[0], src[1], src[2]); + } break; STBI__CASE(4, 2) { dest[0] = stbi__compute_y_16(src[0], src[1], src[2]); @@ -1856,7 +1873,8 @@ static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp) { return stbi__errpf("outofmem", "Out of memory"); } // compute number of non-alpha components - if (comp & 1) n = comp; + if (comp & 1) + n = comp; else n = comp - 1; for (i = 0; i < x * y; ++i) { @@ -1886,7 +1904,8 @@ static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp) { return stbi__errpuc("outofmem", "Out of memory"); } // compute number of non-alpha components - if (comp & 1) n = comp; + if (comp & 1) + n = comp; else n = comp - 1; for (i = 0; i < x * y; ++i) { @@ -1934,8 +1953,7 @@ static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp) { // huffman decoding acceleration #define FAST_BITS 9// larger handles more cases; smaller stomps less cache -typedef struct -{ +typedef struct { stbi_uc fast[1 << FAST_BITS]; // weirdly, repacking this into AoS is a 10% speed loss, instead of a win stbi__uint16 code[256]; @@ -1945,8 +1963,7 @@ typedef struct int delta[17];// old 'firstsymbol' - old 'firstcode' } stbi__huffman; -typedef struct -{ +typedef struct { stbi__context *s; stbi__huffman huff_dc[4]; stbi__huffman huff_ac[4]; @@ -1959,8 +1976,7 @@ typedef struct int img_mcu_w, img_mcu_h; // definition of jpeg image component - struct - { + struct { int id; int h, v; int tq; @@ -2004,8 +2020,7 @@ static int stbi__build_huffman(stbi__huffman *h, int *count) { unsigned int code; // build size list for each symbol (from JPEG spec) for (i = 0; i < 16; ++i) - for (j = 0; j < count[i]; ++j) - h->size[k++] = (stbi_uc) (i + 1); + for (j = 0; j < count[i]; ++j) h->size[k++] = (stbi_uc) (i + 1); h->size[k] = 0; // compute actual symbols (from jpeg spec) @@ -2015,8 +2030,7 @@ static int stbi__build_huffman(stbi__huffman *h, int *count) { // compute delta to add to code to compute symbol id h->delta[j] = k - code; if (h->size[k] == j) { - while (h->size[k] == j) - h->code[k++] = (stbi__uint16) (code++); + while (h->size[k] == j) h->code[k++] = (stbi__uint16) (code++); if (code - 1 >= (1u << j)) return stbi__err("bad code lengths", "Corrupt JPEG"); } // compute largest code + 1 for this size, preshifted as needed later @@ -2059,8 +2073,7 @@ static void stbi__build_fast_ac(stbi__int16 *fast_ac, stbi__huffman *h) { int m = 1 << (magbits - 1); if (k < m) k += (~0U << magbits) + 1; // if the result is small enough, we can fit it in fast_ac table - if (k >= -128 && k <= 127) - fast_ac[i] = (stbi__int16) ((k * 256) + (run * 16) + (len + magbits)); + if (k >= -128 && k <= 127) fast_ac[i] = (stbi__int16) ((k * 256) + (run * 16) + (len + magbits)); } } } @@ -2099,8 +2112,7 @@ stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h) { k = h->fast[c]; if (k < 255) { int s = h->size[k]; - if (s > j->code_bits) - return -1; + if (s > j->code_bits) return -1; j->code_buffer <<= s; j->code_bits -= s; return h->values[k]; @@ -2114,16 +2126,14 @@ stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h) { // that way we don't need to shift inside the loop. temp = j->code_buffer >> 16; for (k = FAST_BITS + 1;; ++k) - if (temp < h->maxcode[k]) - break; + if (temp < h->maxcode[k]) break; if (k == 17) { // error! code not found j->code_bits -= 16; return -1; } - if (k > j->code_bits) - return -1; + if (k > j->code_bits) return -1; // convert the huffman code to the symbol id c = ((j->code_buffer >> (32 - k)) & stbi__bmask[k]) + h->delta[k]; @@ -2175,22 +2185,15 @@ stbi_inline static int stbi__jpeg_get_bit(stbi__jpeg *j) { // given a value that's at position X in the zigzag stream, // where does it appear in the 8x8 matrix coded as row-major? -static const stbi_uc stbi__jpeg_dezigzag[64 + 15] = - { - 0, 1, 8, 16, 9, 2, 3, 10, - 17, 24, 32, 25, 18, 11, 4, 5, - 12, 19, 26, 33, 40, 48, 41, 34, - 27, 20, 13, 6, 7, 14, 21, 28, - 35, 42, 49, 56, 57, 50, 43, 36, - 29, 22, 15, 23, 30, 37, 44, 51, - 58, 59, 52, 45, 38, 31, 39, 46, - 53, 60, 61, 54, 47, 55, 62, 63, - // let corrupt input sample past end - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63}; +static const stbi_uc stbi__jpeg_dezigzag[64 + 15] = {0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, + 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, + 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63, + // let corrupt input sample past end + 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63}; // decode one 64-entry block-- -static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman *hdc, stbi__huffman *hac, stbi__int16 *fac, int b, stbi__uint16 *dequant) { +static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman *hdc, stbi__huffman *hac, stbi__int16 *fac, int b, + stbi__uint16 *dequant) { int diff, dc, k; int t; @@ -2260,8 +2263,7 @@ static int stbi__jpeg_decode_block_prog_dc(stbi__jpeg *j, short data[64], stbi__ data[0] = (short) (dc * (1 << j->succ_low)); } else { // refinement scan for DC coefficient - if (stbi__jpeg_get_bit(j)) - data[0] += (short) (1 << j->succ_low); + if (stbi__jpeg_get_bit(j)) data[0] += (short) (1 << j->succ_low); } return 1; } @@ -2302,8 +2304,7 @@ static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64], stbi__ if (s == 0) { if (r < 15) { j->eob_run = (1 << r); - if (r) - j->eob_run += stbi__jpeg_get_bits(j, r); + if (r) j->eob_run += stbi__jpeg_get_bits(j, r); --j->eob_run; break; } @@ -2344,8 +2345,7 @@ static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64], stbi__ if (s == 0) { if (r < 15) { j->eob_run = (1 << r) - 1; - if (r) - j->eob_run += stbi__jpeg_get_bits(j, r); + if (r) j->eob_run += stbi__jpeg_get_bits(j, r); r = 64;// force end of block } else { // r=15 s=0 should write 16 0s, so we just do @@ -2396,45 +2396,45 @@ stbi_inline static stbi_uc stbi__clamp(int x) { return (stbi_uc) x; } -#define stbi__f2f(x) ((int) (((x) *4096 + 0.5))) -#define stbi__fsh(x) ((x) *4096) +#define stbi__f2f(x) ((int) (((x) * 4096 + 0.5))) +#define stbi__fsh(x) ((x) * 4096) // derived from jidctint -- DCT_ISLOW -#define STBI__IDCT_1D(s0, s1, s2, s3, s4, s5, s6, s7) \ - int t0, t1, t2, t3, p1, p2, p3, p4, p5, x0, x1, x2, x3; \ - p2 = s2; \ - p3 = s6; \ - p1 = (p2 + p3) * stbi__f2f(0.5411961f); \ - t2 = p1 + p3 * stbi__f2f(-1.847759065f); \ - t3 = p1 + p2 * stbi__f2f(0.765366865f); \ - p2 = s0; \ - p3 = s4; \ - t0 = stbi__fsh(p2 + p3); \ - t1 = stbi__fsh(p2 - p3); \ - x0 = t0 + t3; \ - x3 = t0 - t3; \ - x1 = t1 + t2; \ - x2 = t1 - t2; \ - t0 = s7; \ - t1 = s5; \ - t2 = s3; \ - t3 = s1; \ - p3 = t0 + t2; \ - p4 = t1 + t3; \ - p1 = t0 + t3; \ - p2 = t1 + t2; \ - p5 = (p3 + p4) * stbi__f2f(1.175875602f); \ - t0 = t0 * stbi__f2f(0.298631336f); \ - t1 = t1 * stbi__f2f(2.053119869f); \ - t2 = t2 * stbi__f2f(3.072711026f); \ - t3 = t3 * stbi__f2f(1.501321110f); \ - p1 = p5 + p1 * stbi__f2f(-0.899976223f); \ - p2 = p5 + p2 * stbi__f2f(-2.562915447f); \ - p3 = p3 * stbi__f2f(-1.961570560f); \ - p4 = p4 * stbi__f2f(-0.390180644f); \ - t3 += p1 + p4; \ - t2 += p2 + p3; \ - t1 += p2 + p4; \ +#define STBI__IDCT_1D(s0, s1, s2, s3, s4, s5, s6, s7) \ + int t0, t1, t2, t3, p1, p2, p3, p4, p5, x0, x1, x2, x3; \ + p2 = s2; \ + p3 = s6; \ + p1 = (p2 + p3) * stbi__f2f(0.5411961f); \ + t2 = p1 + p3 * stbi__f2f(-1.847759065f); \ + t3 = p1 + p2 * stbi__f2f(0.765366865f); \ + p2 = s0; \ + p3 = s4; \ + t0 = stbi__fsh(p2 + p3); \ + t1 = stbi__fsh(p2 - p3); \ + x0 = t0 + t3; \ + x3 = t0 - t3; \ + x1 = t1 + t2; \ + x2 = t1 - t2; \ + t0 = s7; \ + t1 = s5; \ + t2 = s3; \ + t3 = s1; \ + p3 = t0 + t2; \ + p4 = t1 + t3; \ + p1 = t0 + t3; \ + p2 = t1 + t2; \ + p5 = (p3 + p4) * stbi__f2f(1.175875602f); \ + t0 = t0 * stbi__f2f(0.298631336f); \ + t1 = t1 * stbi__f2f(2.053119869f); \ + t2 = t2 * stbi__f2f(3.072711026f); \ + t3 = t3 * stbi__f2f(1.501321110f); \ + p1 = p5 + p1 * stbi__f2f(-0.899976223f); \ + p2 = p5 + p2 * stbi__f2f(-2.562915447f); \ + p3 = p3 * stbi__f2f(-1.961570560f); \ + p4 = p4 * stbi__f2f(-0.390180644f); \ + t3 += p1 + p4; \ + t2 += p2 + p3; \ + t1 += p2 + p4; \ t0 += p1 + p3; static void stbi__idct_block(stbi_uc *out, int out_stride, short data[64]) { @@ -2511,78 +2511,78 @@ static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64]) { // out(0) = c0[even]*x + c0[odd]*y (c0, x, y 16-bit, out 32-bit) // out(1) = c1[even]*x + c1[odd]*y -#define dct_rot(out0, out1, x, y, c0, c1) \ - __m128i c0##lo = _mm_unpacklo_epi16((x), (y)); \ - __m128i c0##hi = _mm_unpackhi_epi16((x), (y)); \ - __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \ - __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \ - __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \ +#define dct_rot(out0, out1, x, y, c0, c1) \ + __m128i c0##lo = _mm_unpacklo_epi16((x), (y)); \ + __m128i c0##hi = _mm_unpackhi_epi16((x), (y)); \ + __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \ + __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \ + __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \ __m128i out1##_h = _mm_madd_epi16(c0##hi, c1) // out = in << 12 (in 16-bit, out 32-bit) -#define dct_widen(out, in) \ - __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \ +#define dct_widen(out, in) \ + __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \ __m128i out##_h = _mm_srai_epi32(_mm_unpackhi_epi16(_mm_setzero_si128(), (in)), 4) // wide add -#define dct_wadd(out, a, b) \ - __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \ +#define dct_wadd(out, a, b) \ + __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \ __m128i out##_h = _mm_add_epi32(a##_h, b##_h) // wide sub -#define dct_wsub(out, a, b) \ - __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \ +#define dct_wsub(out, a, b) \ + __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \ __m128i out##_h = _mm_sub_epi32(a##_h, b##_h) // butterfly a/b, add bias, then shift by "s" and pack -#define dct_bfly32o(out0, out1, a, b, bias, s) \ - { \ - __m128i abiased_l = _mm_add_epi32(a##_l, bias); \ - __m128i abiased_h = _mm_add_epi32(a##_h, bias); \ - dct_wadd(sum, abiased, b); \ - dct_wsub(dif, abiased, b); \ - out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \ - out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \ +#define dct_bfly32o(out0, out1, a, b, bias, s) \ + { \ + __m128i abiased_l = _mm_add_epi32(a##_l, bias); \ + __m128i abiased_h = _mm_add_epi32(a##_h, bias); \ + dct_wadd(sum, abiased, b); \ + dct_wsub(dif, abiased, b); \ + out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \ + out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \ } // 8-bit interleave step (for transposes) -#define dct_interleave8(a, b) \ - tmp = a; \ - a = _mm_unpacklo_epi8(a, b); \ +#define dct_interleave8(a, b) \ + tmp = a; \ + a = _mm_unpacklo_epi8(a, b); \ b = _mm_unpackhi_epi8(tmp, b) // 16-bit interleave step (for transposes) -#define dct_interleave16(a, b) \ - tmp = a; \ - a = _mm_unpacklo_epi16(a, b); \ +#define dct_interleave16(a, b) \ + tmp = a; \ + a = _mm_unpacklo_epi16(a, b); \ b = _mm_unpackhi_epi16(tmp, b) -#define dct_pass(bias, shift) \ - { \ - /* even part */ \ - dct_rot(t2e, t3e, row2, row6, rot0_0, rot0_1); \ - __m128i sum04 = _mm_add_epi16(row0, row4); \ - __m128i dif04 = _mm_sub_epi16(row0, row4); \ - dct_widen(t0e, sum04); \ - dct_widen(t1e, dif04); \ - dct_wadd(x0, t0e, t3e); \ - dct_wsub(x3, t0e, t3e); \ - dct_wadd(x1, t1e, t2e); \ - dct_wsub(x2, t1e, t2e); \ - /* odd part */ \ - dct_rot(y0o, y2o, row7, row3, rot2_0, rot2_1); \ - dct_rot(y1o, y3o, row5, row1, rot3_0, rot3_1); \ - __m128i sum17 = _mm_add_epi16(row1, row7); \ - __m128i sum35 = _mm_add_epi16(row3, row5); \ - dct_rot(y4o, y5o, sum17, sum35, rot1_0, rot1_1); \ - dct_wadd(x4, y0o, y4o); \ - dct_wadd(x5, y1o, y5o); \ - dct_wadd(x6, y2o, y5o); \ - dct_wadd(x7, y3o, y4o); \ - dct_bfly32o(row0, row7, x0, x7, bias, shift); \ - dct_bfly32o(row1, row6, x1, x6, bias, shift); \ - dct_bfly32o(row2, row5, x2, x5, bias, shift); \ - dct_bfly32o(row3, row4, x3, x4, bias, shift); \ +#define dct_pass(bias, shift) \ + { \ + /* even part */ \ + dct_rot(t2e, t3e, row2, row6, rot0_0, rot0_1); \ + __m128i sum04 = _mm_add_epi16(row0, row4); \ + __m128i dif04 = _mm_sub_epi16(row0, row4); \ + dct_widen(t0e, sum04); \ + dct_widen(t1e, dif04); \ + dct_wadd(x0, t0e, t3e); \ + dct_wsub(x3, t0e, t3e); \ + dct_wadd(x1, t1e, t2e); \ + dct_wsub(x2, t1e, t2e); \ + /* odd part */ \ + dct_rot(y0o, y2o, row7, row3, rot2_0, rot2_1); \ + dct_rot(y1o, y3o, row5, row1, rot3_0, rot3_1); \ + __m128i sum17 = _mm_add_epi16(row1, row7); \ + __m128i sum35 = _mm_add_epi16(row3, row5); \ + dct_rot(y4o, y5o, sum17, sum35, rot1_0, rot1_1); \ + dct_wadd(x4, y0o, y4o); \ + dct_wadd(x5, y1o, y5o); \ + dct_wadd(x6, y2o, y5o); \ + dct_wadd(x7, y3o, y4o); \ + dct_bfly32o(row0, row7, x0, x7, bias, shift); \ + dct_bfly32o(row1, row6, x1, x6, bias, shift); \ + dct_bfly32o(row2, row5, x2, x5, bias, shift); \ + dct_bfly32o(row3, row4, x3, x4, bias, shift); \ } __m128i rot0_0 = dct_const(stbi__f2f(0.5411961f), stbi__f2f(0.5411961f) + stbi__f2f(-1.847759065f)); @@ -2704,75 +2704,75 @@ static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64]) { int16x4_t rot3_2 = vdup_n_s16(stbi__f2f(3.072711026f)); int16x4_t rot3_3 = vdup_n_s16(stbi__f2f(1.501321110f)); -#define dct_long_mul(out, inq, coeff) \ - int32x4_t out##_l = vmull_s16(vget_low_s16(inq), coeff); \ +#define dct_long_mul(out, inq, coeff) \ + int32x4_t out##_l = vmull_s16(vget_low_s16(inq), coeff); \ int32x4_t out##_h = vmull_s16(vget_high_s16(inq), coeff) -#define dct_long_mac(out, acc, inq, coeff) \ - int32x4_t out##_l = vmlal_s16(acc##_l, vget_low_s16(inq), coeff); \ +#define dct_long_mac(out, acc, inq, coeff) \ + int32x4_t out##_l = vmlal_s16(acc##_l, vget_low_s16(inq), coeff); \ int32x4_t out##_h = vmlal_s16(acc##_h, vget_high_s16(inq), coeff) -#define dct_widen(out, inq) \ - int32x4_t out##_l = vshll_n_s16(vget_low_s16(inq), 12); \ +#define dct_widen(out, inq) \ + int32x4_t out##_l = vshll_n_s16(vget_low_s16(inq), 12); \ int32x4_t out##_h = vshll_n_s16(vget_high_s16(inq), 12) // wide add -#define dct_wadd(out, a, b) \ - int32x4_t out##_l = vaddq_s32(a##_l, b##_l); \ +#define dct_wadd(out, a, b) \ + int32x4_t out##_l = vaddq_s32(a##_l, b##_l); \ int32x4_t out##_h = vaddq_s32(a##_h, b##_h) // wide sub -#define dct_wsub(out, a, b) \ - int32x4_t out##_l = vsubq_s32(a##_l, b##_l); \ +#define dct_wsub(out, a, b) \ + int32x4_t out##_l = vsubq_s32(a##_l, b##_l); \ int32x4_t out##_h = vsubq_s32(a##_h, b##_h) // butterfly a/b, then shift using "shiftop" by "s" and pack -#define dct_bfly32o(out0, out1, a, b, shiftop, s) \ - { \ - dct_wadd(sum, a, b); \ - dct_wsub(dif, a, b); \ - out0 = vcombine_s16(shiftop(sum_l, s), shiftop(sum_h, s)); \ - out1 = vcombine_s16(shiftop(dif_l, s), shiftop(dif_h, s)); \ +#define dct_bfly32o(out0, out1, a, b, shiftop, s) \ + { \ + dct_wadd(sum, a, b); \ + dct_wsub(dif, a, b); \ + out0 = vcombine_s16(shiftop(sum_l, s), shiftop(sum_h, s)); \ + out1 = vcombine_s16(shiftop(dif_l, s), shiftop(dif_h, s)); \ } -#define dct_pass(shiftop, shift) \ - { \ - /* even part */ \ - int16x8_t sum26 = vaddq_s16(row2, row6); \ - dct_long_mul(p1e, sum26, rot0_0); \ - dct_long_mac(t2e, p1e, row6, rot0_1); \ - dct_long_mac(t3e, p1e, row2, rot0_2); \ - int16x8_t sum04 = vaddq_s16(row0, row4); \ - int16x8_t dif04 = vsubq_s16(row0, row4); \ - dct_widen(t0e, sum04); \ - dct_widen(t1e, dif04); \ - dct_wadd(x0, t0e, t3e); \ - dct_wsub(x3, t0e, t3e); \ - dct_wadd(x1, t1e, t2e); \ - dct_wsub(x2, t1e, t2e); \ - /* odd part */ \ - int16x8_t sum15 = vaddq_s16(row1, row5); \ - int16x8_t sum17 = vaddq_s16(row1, row7); \ - int16x8_t sum35 = vaddq_s16(row3, row5); \ - int16x8_t sum37 = vaddq_s16(row3, row7); \ - int16x8_t sumodd = vaddq_s16(sum17, sum35); \ - dct_long_mul(p5o, sumodd, rot1_0); \ - dct_long_mac(p1o, p5o, sum17, rot1_1); \ - dct_long_mac(p2o, p5o, sum35, rot1_2); \ - dct_long_mul(p3o, sum37, rot2_0); \ - dct_long_mul(p4o, sum15, rot2_1); \ - dct_wadd(sump13o, p1o, p3o); \ - dct_wadd(sump24o, p2o, p4o); \ - dct_wadd(sump23o, p2o, p3o); \ - dct_wadd(sump14o, p1o, p4o); \ - dct_long_mac(x4, sump13o, row7, rot3_0); \ - dct_long_mac(x5, sump24o, row5, rot3_1); \ - dct_long_mac(x6, sump23o, row3, rot3_2); \ - dct_long_mac(x7, sump14o, row1, rot3_3); \ - dct_bfly32o(row0, row7, x0, x7, shiftop, shift); \ - dct_bfly32o(row1, row6, x1, x6, shiftop, shift); \ - dct_bfly32o(row2, row5, x2, x5, shiftop, shift); \ - dct_bfly32o(row3, row4, x3, x4, shiftop, shift); \ +#define dct_pass(shiftop, shift) \ + { \ + /* even part */ \ + int16x8_t sum26 = vaddq_s16(row2, row6); \ + dct_long_mul(p1e, sum26, rot0_0); \ + dct_long_mac(t2e, p1e, row6, rot0_1); \ + dct_long_mac(t3e, p1e, row2, rot0_2); \ + int16x8_t sum04 = vaddq_s16(row0, row4); \ + int16x8_t dif04 = vsubq_s16(row0, row4); \ + dct_widen(t0e, sum04); \ + dct_widen(t1e, dif04); \ + dct_wadd(x0, t0e, t3e); \ + dct_wsub(x3, t0e, t3e); \ + dct_wadd(x1, t1e, t2e); \ + dct_wsub(x2, t1e, t2e); \ + /* odd part */ \ + int16x8_t sum15 = vaddq_s16(row1, row5); \ + int16x8_t sum17 = vaddq_s16(row1, row7); \ + int16x8_t sum35 = vaddq_s16(row3, row5); \ + int16x8_t sum37 = vaddq_s16(row3, row7); \ + int16x8_t sumodd = vaddq_s16(sum17, sum35); \ + dct_long_mul(p5o, sumodd, rot1_0); \ + dct_long_mac(p1o, p5o, sum17, rot1_1); \ + dct_long_mac(p2o, p5o, sum35, rot1_2); \ + dct_long_mul(p3o, sum37, rot2_0); \ + dct_long_mul(p4o, sum15, rot2_1); \ + dct_wadd(sump13o, p1o, p3o); \ + dct_wadd(sump24o, p2o, p4o); \ + dct_wadd(sump23o, p2o, p3o); \ + dct_wadd(sump14o, p1o, p4o); \ + dct_long_mac(x4, sump13o, row7, rot3_0); \ + dct_long_mac(x5, sump24o, row5, rot3_1); \ + dct_long_mac(x6, sump23o, row3, rot3_2); \ + dct_long_mac(x7, sump14o, row1, rot3_3); \ + dct_bfly32o(row0, row7, x0, x7, shiftop, shift); \ + dct_bfly32o(row1, row6, x1, x6, shiftop, shift); \ + dct_bfly32o(row2, row5, x2, x5, shiftop, shift); \ + dct_bfly32o(row3, row4, x3, x4, shiftop, shift); \ } // load @@ -2795,24 +2795,24 @@ static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64]) { { // these three map to a single VTRN.16, VTRN.32, and VSWP, respectively. // whether compilers actually get this is another story, sadly. -#define dct_trn16(x, y) \ - { \ - int16x8x2_t t = vtrnq_s16(x, y); \ - x = t.val[0]; \ - y = t.val[1]; \ +#define dct_trn16(x, y) \ + { \ + int16x8x2_t t = vtrnq_s16(x, y); \ + x = t.val[0]; \ + y = t.val[1]; \ } -#define dct_trn32(x, y) \ - { \ - int32x4x2_t t = vtrnq_s32(vreinterpretq_s32_s16(x), vreinterpretq_s32_s16(y)); \ - x = vreinterpretq_s16_s32(t.val[0]); \ - y = vreinterpretq_s16_s32(t.val[1]); \ +#define dct_trn32(x, y) \ + { \ + int32x4x2_t t = vtrnq_s32(vreinterpretq_s32_s16(x), vreinterpretq_s32_s16(y)); \ + x = vreinterpretq_s16_s32(t.val[0]); \ + y = vreinterpretq_s16_s32(t.val[1]); \ } -#define dct_trn64(x, y) \ - { \ - int16x8_t x0 = x; \ - int16x8_t y0 = y; \ - x = vcombine_s16(vget_low_s16(x0), vget_low_s16(y0)); \ - y = vcombine_s16(vget_high_s16(x0), vget_high_s16(y0)); \ +#define dct_trn64(x, y) \ + { \ + int16x8_t x0 = x; \ + int16x8_t y0 = y; \ + x = vcombine_s16(vget_low_s16(x0), vget_low_s16(y0)); \ + y = vcombine_s16(vget_high_s16(x0), vget_high_s16(y0)); \ } // pass 1 @@ -2856,23 +2856,23 @@ static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64]) { uint8x8_t p7 = vqrshrun_n_s16(row7, 1); // again, these can translate into one instruction, but often don't. -#define dct_trn8_8(x, y) \ - { \ - uint8x8x2_t t = vtrn_u8(x, y); \ - x = t.val[0]; \ - y = t.val[1]; \ +#define dct_trn8_8(x, y) \ + { \ + uint8x8x2_t t = vtrn_u8(x, y); \ + x = t.val[0]; \ + y = t.val[1]; \ } -#define dct_trn8_16(x, y) \ - { \ - uint16x4x2_t t = vtrn_u16(vreinterpret_u16_u8(x), vreinterpret_u16_u8(y)); \ - x = vreinterpret_u8_u16(t.val[0]); \ - y = vreinterpret_u8_u16(t.val[1]); \ +#define dct_trn8_16(x, y) \ + { \ + uint16x4x2_t t = vtrn_u16(vreinterpret_u16_u8(x), vreinterpret_u16_u8(y)); \ + x = vreinterpret_u8_u16(t.val[0]); \ + y = vreinterpret_u8_u16(t.val[1]); \ } -#define dct_trn8_32(x, y) \ - { \ - uint32x2x2_t t = vtrn_u32(vreinterpret_u32_u8(x), vreinterpret_u32_u8(y)); \ - x = vreinterpret_u8_u32(t.val[0]); \ - y = vreinterpret_u8_u32(t.val[1]); \ +#define dct_trn8_32(x, y) \ + { \ + uint32x2x2_t t = vtrn_u32(vreinterpret_u32_u8(x), vreinterpret_u32_u8(y)); \ + x = vreinterpret_u8_u32(t.val[0]); \ + y = vreinterpret_u8_u32(t.val[1]); \ } // sadly can't use interleaved stores here since we only write @@ -2942,8 +2942,7 @@ static stbi_uc stbi__get_marker(stbi__jpeg *j) { } x = stbi__get8(j->s); if (x != 0xff) return STBI__MARKER_none; - while (x == 0xff) - x = stbi__get8(j->s);// consume repeated 0xff fill bytes + while (x == 0xff) x = stbi__get8(j->s);// consume repeated 0xff fill bytes return x; } @@ -2981,7 +2980,9 @@ static int stbi__parse_entropy_coded_data(stbi__jpeg *z) { for (j = 0; j < h; ++j) { for (i = 0; i < w; ++i) { int ha = z->img_comp[n].ha; - if (!stbi__jpeg_decode_block(z, data, z->huff_dc + z->img_comp[n].hd, z->huff_ac + ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0; + if (!stbi__jpeg_decode_block(z, data, z->huff_dc + z->img_comp[n].hd, z->huff_ac + ha, z->fast_ac[ha], n, + z->dequant[z->img_comp[n].tq])) + return 0; z->idct_block_kernel(z->img_comp[n].data + z->img_comp[n].w2 * j * 8 + i * 8, z->img_comp[n].w2, data); // every data block is an MCU, so countdown the restart interval if (--z->todo <= 0) { @@ -3009,7 +3010,9 @@ static int stbi__parse_entropy_coded_data(stbi__jpeg *z) { int x2 = (i * z->img_comp[n].h + x) * 8; int y2 = (j * z->img_comp[n].v + y) * 8; int ha = z->img_comp[n].ha; - if (!stbi__jpeg_decode_block(z, data, z->huff_dc + z->img_comp[n].hd, z->huff_ac + ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0; + if (!stbi__jpeg_decode_block(z, data, z->huff_dc + z->img_comp[n].hd, z->huff_ac + ha, z->fast_ac[ha], n, + z->dequant[z->img_comp[n].tq])) + return 0; z->idct_block_kernel(z->img_comp[n].data + z->img_comp[n].w2 * y2 + x2, z->img_comp[n].w2, data); } } @@ -3039,12 +3042,10 @@ static int stbi__parse_entropy_coded_data(stbi__jpeg *z) { for (i = 0; i < w; ++i) { short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w); if (z->spec_start == 0) { - if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n)) - return 0; + if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n)) return 0; } else { int ha = z->img_comp[n].ha; - if (!stbi__jpeg_decode_block_prog_ac(z, data, &z->huff_ac[ha], z->fast_ac[ha])) - return 0; + if (!stbi__jpeg_decode_block_prog_ac(z, data, &z->huff_ac[ha], z->fast_ac[ha])) return 0; } // every data block is an MCU, so countdown the restart interval if (--z->todo <= 0) { @@ -3069,8 +3070,7 @@ static int stbi__parse_entropy_coded_data(stbi__jpeg *z) { int x2 = (i * z->img_comp[n].h + x); int y2 = (j * z->img_comp[n].v + y); short *data = z->img_comp[n].coeff + 64 * (x2 + y2 * z->img_comp[n].coeff_w); - if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n)) - return 0; + if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n)) return 0; } } } @@ -3090,8 +3090,7 @@ static int stbi__parse_entropy_coded_data(stbi__jpeg *z) { static void stbi__jpeg_dequantize(short *data, stbi__uint16 *dequant) { int i; - for (i = 0; i < 64; ++i) - data[i] *= dequant[i]; + for (i = 0; i < 64; ++i) data[i] *= dequant[i]; } static void stbi__jpeg_finish(stbi__jpeg *z) { @@ -3132,8 +3131,7 @@ static int stbi__process_marker(stbi__jpeg *z, int m) { if (p != 0 && p != 1) return stbi__err("bad DQT type", "Corrupt JPEG"); if (t > 3) return stbi__err("bad DQT table", "Corrupt JPEG"); - for (i = 0; i < 64; ++i) - z->dequant[t][stbi__jpeg_dezigzag[i]] = (stbi__uint16) (sixteen ? stbi__get16be(z->s) : stbi__get8(z->s)); + for (i = 0; i < 64; ++i) z->dequant[t][stbi__jpeg_dezigzag[i]] = (stbi__uint16) (sixteen ? stbi__get16be(z->s) : stbi__get8(z->s)); L -= (sixteen ? 129 : 65); } return L == 0; @@ -3159,10 +3157,8 @@ static int stbi__process_marker(stbi__jpeg *z, int m) { if (!stbi__build_huffman(z->huff_ac + th, sizes)) return 0; v = z->huff_ac[th].values; } - for (i = 0; i < n; ++i) - v[i] = stbi__get8(z->s); - if (tc != 0) - stbi__build_fast_ac(z->fast_ac[th], z->huff_ac + th); + for (i = 0; i < n; ++i) v[i] = stbi__get8(z->s); + if (tc != 0) stbi__build_fast_ac(z->fast_ac[th], z->huff_ac + th); L -= n; } return L == 0; @@ -3184,18 +3180,15 @@ static int stbi__process_marker(stbi__jpeg *z, int m) { int ok = 1; int i; for (i = 0; i < 5; ++i) - if (stbi__get8(z->s) != tag[i]) - ok = 0; + if (stbi__get8(z->s) != tag[i]) ok = 0; L -= 5; - if (ok) - z->jfif = 1; + if (ok) z->jfif = 1; } else if (m == 0xEE && L >= 12) {// Adobe APP14 segment static const unsigned char tag[6] = {'A', 'd', 'o', 'b', 'e', '\0'}; int ok = 1; int i; for (i = 0; i < 6; ++i) - if (stbi__get8(z->s) != tag[i]) - ok = 0; + if (stbi__get8(z->s) != tag[i]) ok = 0; L -= 6; if (ok) { stbi__get8(z->s); // version @@ -3224,8 +3217,7 @@ static int stbi__process_scan_header(stbi__jpeg *z) { int id = stbi__get8(z->s), which; int q = stbi__get8(z->s); for (which = 0; which < z->s->img_n; ++which) - if (z->img_comp[which].id == id) - break; + if (z->img_comp[which].id == id) break; if (which == z->s->img_n) return 0;// no match z->img_comp[which].hd = q >> 4; if (z->img_comp[which].hd > 3) return stbi__err("bad DC huff", "Corrupt JPEG"); @@ -3283,7 +3275,9 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan) { p = stbi__get8(s); if (p != 8) return stbi__err("only 8-bit", "JPEG format not supported: 8-bit only");// JPEG baseline s->img_y = stbi__get16be(s); - if (s->img_y == 0) return stbi__err("no header height", "JPEG format not supported: delayed height");// Legal, but we don't handle it--but neither does IJG + if (s->img_y == 0) + return stbi__err("no header height", + "JPEG format not supported: delayed height");// Legal, but we don't handle it--but neither does IJG s->img_x = stbi__get16be(s); if (s->img_x == 0) return stbi__err("0 width", "Corrupt JPEG");// JPEG requires if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__err("too large", "Very large image (corrupt?)"); @@ -3302,8 +3296,7 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan) { for (i = 0; i < s->img_n; ++i) { static const unsigned char rgb[3] = {'R', 'G', 'B'}; z->img_comp[i].id = stbi__get8(s); - if (s->img_n == 3 && z->img_comp[i].id == rgb[i]) - ++z->rgb; + if (s->img_n == 3 && z->img_comp[i].id == rgb[i]) ++z->rgb; q = stbi__get8(s); z->img_comp[i].h = (q >> 4); if (!z->img_comp[i].h || z->img_comp[i].h > 4) return stbi__err("bad H", "Corrupt JPEG"); @@ -3355,8 +3348,7 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan) { z->img_comp[i].raw_coeff = 0; z->img_comp[i].linebuf = NULL; z->img_comp[i].raw_data = stbi__malloc_mad2(z->img_comp[i].w2, z->img_comp[i].h2, 15); - if (z->img_comp[i].raw_data == NULL) - return stbi__free_jpeg_components(z, i + 1, stbi__err("outofmem", "Out of memory")); + if (z->img_comp[i].raw_data == NULL) return stbi__free_jpeg_components(z, i + 1, stbi__err("outofmem", "Out of memory")); // align blocks for idct using mmx/sse z->img_comp[i].data = (stbi_uc *) (((size_t) z->img_comp[i].raw_data + 15) & ~15); if (z->progressive) { @@ -3364,8 +3356,7 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan) { z->img_comp[i].coeff_w = z->img_comp[i].w2 / 8; z->img_comp[i].coeff_h = z->img_comp[i].h2 / 8; z->img_comp[i].raw_coeff = stbi__malloc_mad3(z->img_comp[i].w2, z->img_comp[i].h2, sizeof(short), 15); - if (z->img_comp[i].raw_coeff == NULL) - return stbi__free_jpeg_components(z, i + 1, stbi__err("outofmem", "Out of memory")); + if (z->img_comp[i].raw_coeff == NULL) return stbi__free_jpeg_components(z, i + 1, stbi__err("outofmem", "Out of memory")); z->img_comp[i].coeff = (short *) (((size_t) z->img_comp[i].raw_coeff + 15) & ~15); } } @@ -3440,15 +3431,13 @@ static int stbi__decode_jpeg_image(stbi__jpeg *j) { } m = stbi__get_marker(j); } - if (j->progressive) - stbi__jpeg_finish(j); + if (j->progressive) stbi__jpeg_finish(j); return 1; } // static jfif-centered resampling (across block boundaries) -typedef stbi_uc *(*resample_row_func)(stbi_uc *out, stbi_uc *in0, stbi_uc *in1, - int w, int hs); +typedef stbi_uc *(*resample_row_func)(stbi_uc *out, stbi_uc *in0, stbi_uc *in1, int w, int hs); #define stbi__div4(x) ((stbi_uc) ((x) >> 2)) @@ -3464,8 +3453,7 @@ static stbi_uc *stbi__resample_row_v_2(stbi_uc *out, stbi_uc *in_near, stbi_uc * // need to generate two samples vertically for every one in input int i; STBI_NOTUSED(hs); - for (i = 0; i < w; ++i) - out[i] = stbi__div4(3 * in_near[i] + in_far[i] + 2); + for (i = 0; i < w; ++i) out[i] = stbi__div4(3 * in_near[i] + in_far[i] + 2); return out; } @@ -3642,14 +3630,13 @@ static stbi_uc *stbi__resample_row_generic(stbi_uc *out, stbi_uc *in_near, stbi_ int i, j; STBI_NOTUSED(in_far); for (i = 0; i < w; ++i) - for (j = 0; j < hs; ++j) - out[i * hs + j] = in_near[i]; + for (j = 0; j < hs; ++j) out[i * hs + j] = in_near[i]; return out; } // this is a reduced-precision calculation of YCbCr-to-RGB introduced // to make sure the code produces the same results in both SIMD and scalar -#define stbi__float2fixed(x) (((int) ((x) *4096.0f + 0.5f)) << 8) +#define stbi__float2fixed(x) (((int) ((x) * 4096.0f + 0.5f)) << 8) static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step) { int i; for (i = 0; i < count; ++i) { @@ -3664,17 +3651,20 @@ static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc g >>= 20; b >>= 20; if ((unsigned) r > 255) { - if (r < 0) r = 0; + if (r < 0) + r = 0; else r = 255; } if ((unsigned) g > 255) { - if (g < 0) g = 0; + if (g < 0) + g = 0; else g = 255; } if ((unsigned) b > 255) { - if (b < 0) b = 0; + if (b < 0) + b = 0; else b = 255; } @@ -3809,17 +3799,20 @@ static void stbi__YCbCr_to_RGB_simd(stbi_uc *out, stbi_uc const *y, stbi_uc cons g >>= 20; b >>= 20; if ((unsigned) r > 255) { - if (r < 0) r = 0; + if (r < 0) + r = 0; else r = 255; } if ((unsigned) g > 255) { - if (g < 0) g = 0; + if (g < 0) + g = 0; else g = 255; } if ((unsigned) b > 255) { - if (b < 0) b = 0; + if (b < 0) + b = 0; else b = 255; } @@ -3858,8 +3851,7 @@ static void stbi__cleanup_jpeg(stbi__jpeg *j) { stbi__free_jpeg_components(j, j->s->img_n, 0); } -typedef struct -{ +typedef struct { resample_row_func resample; stbi_uc *line0, *line1; int hs, vs; // expansion factor in each axis @@ -3888,8 +3880,7 @@ static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp } // determine actual number of components to generate - n = req_comp ? req_comp : z->s->img_n >= 3 ? 3 - : 1; + n = req_comp ? req_comp : z->s->img_n >= 3 ? 3 : 1; is_rgb = z->s->img_n == 3 && (z->rgb == 3 || (z->app14_color_transform == 0 && !z->jfif)); @@ -3932,7 +3923,8 @@ static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp r->ypos = 0; r->line0 = r->line1 = z->img_comp[k].data; - if (r->hs == 1 && r->vs == 1) r->resample = resample_row_1; + if (r->hs == 1 && r->vs == 1) + r->resample = resample_row_1; else if (r->hs == 1 && r->vs == 2) r->resample = stbi__resample_row_v_2; else if (r->hs == 2 && r->vs == 1) @@ -3956,15 +3948,11 @@ static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp for (k = 0; k < decode_n; ++k) { stbi__resample *r = &res_comp[k]; int y_bot = r->ystep >= (r->vs >> 1); - coutput[k] = r->resample(z->img_comp[k].linebuf, - y_bot ? r->line1 : r->line0, - y_bot ? r->line0 : r->line1, - r->w_lores, r->hs); + coutput[k] = r->resample(z->img_comp[k].linebuf, y_bot ? r->line1 : r->line0, y_bot ? r->line0 : r->line1, r->w_lores, r->hs); if (++r->ystep >= r->vs) { r->ystep = 0; r->line0 = r->line1; - if (++r->ypos < z->img_comp[k].y) - r->line1 += z->img_comp[k].w2; + if (++r->ypos < z->img_comp[k].y) r->line1 += z->img_comp[k].w2; } } if (n >= 3) { @@ -4012,8 +4000,7 @@ static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp } else { if (is_rgb) { if (n == 1) - for (i = 0; i < z->s->img_x; ++i) - *out++ = stbi__compute_y(coutput[0][i], coutput[1][i], coutput[2][i]); + for (i = 0; i < z->s->img_x; ++i) *out++ = stbi__compute_y(coutput[0][i], coutput[1][i], coutput[2][i]); else { for (i = 0; i < z->s->img_x; ++i, out += 2) { out[0] = stbi__compute_y(coutput[0][i], coutput[1][i], coutput[2][i]); @@ -4118,8 +4105,7 @@ static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp) { // zlib-style huffman encoding // (jpegs packs from left, zlib from right, so can't share code) -typedef struct -{ +typedef struct { stbi__uint16 fast[1 << STBI__ZFAST_BITS]; stbi__uint16 firstcode[16]; int maxcode[17]; @@ -4150,12 +4136,10 @@ static int stbi__zbuild_huffman(stbi__zhuffman *z, const stbi_uc *sizelist, int // DEFLATE spec for generating codes memset(sizes, 0, sizeof(sizes)); memset(z->fast, 0, sizeof(z->fast)); - for (i = 0; i < num; ++i) - ++sizes[sizelist[i]]; + for (i = 0; i < num; ++i) ++sizes[sizelist[i]]; sizes[0] = 0; for (i = 1; i < 16; ++i) - if (sizes[i] > (1 << i)) - return stbi__err("bad sizes", "Corrupt PNG"); + if (sizes[i] > (1 << i)) return stbi__err("bad sizes", "Corrupt PNG"); code = 0; for (i = 1; i < 16; ++i) { next_code[i] = code; @@ -4195,8 +4179,7 @@ static int stbi__zbuild_huffman(stbi__zhuffman *z, const stbi_uc *sizelist, int // we require PNG read all the IDATs and combine them into a single // memory buffer -typedef struct -{ +typedef struct { stbi_uc *zbuffer, *zbuffer_end; int num_bits; stbi__uint32 code_buffer; @@ -4243,8 +4226,7 @@ static int stbi__zhuffman_decode_slowpath(stbi__zbuf *a, stbi__zhuffman *z) { // use jpeg approach, which requires MSbits at top k = stbi__bit_reverse(a->code_buffer, 16); for (s = STBI__ZFAST_BITS + 1;; ++s) - if (k < z->maxcode[s]) - break; + if (k < z->maxcode[s]) break; if (s >= 16) return -1;// invalid code! // code size is s, so: b = (k >> (16 - s)) - z->firstcode[s] + z->firstsymbol[s]; @@ -4295,19 +4277,15 @@ static int stbi__zexpand(stbi__zbuf *z, char *zout, int n)// need to make room f return 1; } -static const int stbi__zlength_base[31] = { - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, - 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, - 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; +static const int stbi__zlength_base[31] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; -static const int stbi__zlength_extra[31] = - {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0}; +static const int stbi__zlength_extra[31] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0}; -static const int stbi__zdist_base[32] = {1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0}; +static const int stbi__zdist_base[32] = {1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0}; -static const int stbi__zdist_extra[32] = - {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; +static const int stbi__zdist_extra[32] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; static int stbi__parse_huffman_block(stbi__zbuf *a) { char *zout = a->zout; @@ -4408,8 +4386,7 @@ static int stbi__compute_huffman_codes(stbi__zbuf *a) { static int stbi__parse_uncompressed_block(stbi__zbuf *a) { stbi_uc header[4]; int len, nlen, k; - if (a->num_bits & 7) - stbi__zreceive(a, a->num_bits & 7);// discard + if (a->num_bits & 7) stbi__zreceive(a, a->num_bits & 7);// discard // drain the bit-packed data into header k = 0; while (a->num_bits > 0) { @@ -4419,8 +4396,7 @@ static int stbi__parse_uncompressed_block(stbi__zbuf *a) { } if (a->num_bits < 0) return stbi__err("zlib corrupt", "Corrupt PNG"); // now fill header the normal way - while (k < 4) - header[k++] = stbi__zget8(a); + while (k < 4) header[k++] = stbi__zget8(a); len = header[1] * 256 + header[0]; nlen = header[3] * 256 + header[2]; if (nlen != (len ^ 0xffff)) return stbi__err("zlib corrupt", "Corrupt PNG"); @@ -4446,20 +4422,17 @@ static int stbi__parse_zlib_header(stbi__zbuf *a) { return 1; } -static const stbi_uc stbi__zdefault_length[STBI__ZNSYMS] = - { - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8}; -static const stbi_uc stbi__zdefault_distance[32] = - { - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5}; +static const stbi_uc stbi__zdefault_length[STBI__ZNSYMS] = {8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8}; +static const stbi_uc stbi__zdefault_distance[32] = {5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5}; /* Init algorithm: { @@ -4590,8 +4563,7 @@ STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char // - uses stb_zlib, a PD zlib implementation with fast huffman decoding #ifndef STBI_NO_PNG -typedef struct -{ +typedef struct { stbi__uint32 length; stbi__uint32 type; } stbi__pngchunk; @@ -4611,8 +4583,7 @@ static int stbi__check_png_header(stbi__context *s) { return 1; } -typedef struct -{ +typedef struct { stbi__context *s; stbi_uc *idata, *expanded, *out; int depth; @@ -4630,13 +4601,7 @@ enum { STBI__F_paeth_first }; -static stbi_uc first_row_filter[5] = - { - STBI__F_none, - STBI__F_sub, - STBI__F_none, - STBI__F_avg_first, - STBI__F_paeth_first}; +static stbi_uc first_row_filter[5] = {STBI__F_none, STBI__F_sub, STBI__F_none, STBI__F_avg_first, STBI__F_paeth_first}; static int stbi__paeth(int a, int b, int c) { int p = a + b - c; @@ -4651,7 +4616,8 @@ static int stbi__paeth(int a, int b, int c) { static const stbi_uc stbi__depth_scale_table[9] = {0, 0xff, 0x55, 0, 0x11, 0, 0, 0, 0x01}; // create the png data from post-deflated data -static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, int color) { +static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, + int color) { int bytes = (depth == 16 ? 2 : 1); stbi__context *s = a->s; stbi__uint32 i, j, stride = x * out_n * bytes; @@ -4681,8 +4647,7 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r stbi_uc *prior; int filter = *raw++; - if (filter > 4) - return stbi__err("invalid filter", "Corrupt PNG"); + if (filter > 4) return stbi__err("invalid filter", "Corrupt PNG"); if (depth < 8) { if (img_width_bytes > x) return stbi__err("invalid width", "Corrupt PNG"); @@ -4723,8 +4688,7 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r } if (depth == 8) { - if (img_n != out_n) - cur[img_n] = 255;// first pixel + if (img_n != out_n) cur[img_n] = 255;// first pixel raw += img_n; cur += out_n; prior += out_n; @@ -4745,49 +4709,75 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r // this is a little gross, so that we don't switch per-pixel or per-component if (depth < 8 || img_n == out_n) { int nk = (width - 1) * filter_bytes; -#define STBI__CASE(f) \ - case f: \ +#define STBI__CASE(f) \ + case f: \ for (k = 0; k < nk; ++k) switch (filter) { // "none" filter turns into a memcpy here; make that explicit. case STBI__F_none: memcpy(cur, raw, nk); break; - STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k - filter_bytes]); } + STBI__CASE(STBI__F_sub) { + cur[k] = STBI__BYTECAST(raw[k] + cur[k - filter_bytes]); + } break; - STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } + STBI__CASE(STBI__F_up) { + cur[k] = STBI__BYTECAST(raw[k] + prior[k]); + } break; - STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k - filter_bytes]) >> 1)); } + STBI__CASE(STBI__F_avg) { + cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k - filter_bytes]) >> 1)); + } break; - STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k - filter_bytes], prior[k], prior[k - filter_bytes])); } + STBI__CASE(STBI__F_paeth) { + cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k - filter_bytes], prior[k], prior[k - filter_bytes])); + } break; - STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k - filter_bytes] >> 1)); } + STBI__CASE(STBI__F_avg_first) { + cur[k] = STBI__BYTECAST(raw[k] + (cur[k - filter_bytes] >> 1)); + } break; - STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k - filter_bytes], 0, 0)); } + STBI__CASE(STBI__F_paeth_first) { + cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k - filter_bytes], 0, 0)); + } break; } #undef STBI__CASE raw += nk; } else { STBI_ASSERT(img_n + 1 == out_n); -#define STBI__CASE(f) \ - case f: \ - for (i = x - 1; i >= 1; --i, cur[filter_bytes] = 255, raw += filter_bytes, cur += output_bytes, prior += output_bytes) \ +#define STBI__CASE(f) \ + case f: \ + for (i = x - 1; i >= 1; --i, cur[filter_bytes] = 255, raw += filter_bytes, cur += output_bytes, prior += output_bytes) \ for (k = 0; k < filter_bytes; ++k) switch (filter) { - STBI__CASE(STBI__F_none) { cur[k] = raw[k]; } + STBI__CASE(STBI__F_none) { + cur[k] = raw[k]; + } break; - STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k - output_bytes]); } + STBI__CASE(STBI__F_sub) { + cur[k] = STBI__BYTECAST(raw[k] + cur[k - output_bytes]); + } break; - STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } + STBI__CASE(STBI__F_up) { + cur[k] = STBI__BYTECAST(raw[k] + prior[k]); + } break; - STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k - output_bytes]) >> 1)); } + STBI__CASE(STBI__F_avg) { + cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k - output_bytes]) >> 1)); + } break; - STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k - output_bytes], prior[k], prior[k - output_bytes])); } + STBI__CASE(STBI__F_paeth) { + cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k - output_bytes], prior[k], prior[k - output_bytes])); + } break; - STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k - output_bytes] >> 1)); } + STBI__CASE(STBI__F_avg_first) { + cur[k] = STBI__BYTECAST(raw[k] + (cur[k - output_bytes] >> 1)); + } break; - STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k - output_bytes], 0, 0)); } + STBI__CASE(STBI__F_paeth_first) { + cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k - output_bytes], 0, 0)); + } break; } #undef STBI__CASE @@ -4896,8 +4886,7 @@ static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stbi__uint3 int out_bytes = out_n * bytes; stbi_uc *final; int p; - if (!interlaced) - return stbi__create_png_image_raw(a, image_data, image_data_len, out_n, a->s->img_x, a->s->img_y, depth, color); + if (!interlaced) return stbi__create_png_image_raw(a, image_data, image_data_len, out_n, a->s->img_x, a->s->img_y, depth, color); // de-interlacing final = (stbi_uc *) stbi__malloc_mad3(a->s->img_x, a->s->img_y, out_bytes, 0); @@ -4921,8 +4910,7 @@ static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stbi__uint3 for (i = 0; i < x; ++i) { int out_y = j * yspc[p] + yorig[p]; int out_x = i * xspc[p] + xorig[p]; - memcpy(final + out_y * a->s->img_x * out_bytes + out_x * out_bytes, - a->out + (j * x + i) * out_bytes, out_bytes); + memcpy(final + out_y * a->s->img_x * out_bytes + out_x * out_bytes, a->out + (j * x + i) * out_bytes, out_bytes); } } STBI_FREE(a->out); @@ -4951,8 +4939,7 @@ static int stbi__compute_transparency(stbi__png *z, stbi_uc tc[3], int out_n) { } } else { for (i = 0; i < pixel_count; ++i) { - if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) - p[3] = 0; + if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) p[3] = 0; p += 4; } } @@ -4975,8 +4962,7 @@ static int stbi__compute_transparency16(stbi__png *z, stbi__uint16 tc[3], int ou } } else { for (i = 0; i < pixel_count; ++i) { - if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) - p[3] = 0; + if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) p[3] = 0; p += 4; } } @@ -5047,12 +5033,8 @@ STBIDEF void stbi_convert_iphone_png_to_rgb_thread(int flag_true_if_should_conve stbi__de_iphone_flag_set = 1; } -#define stbi__unpremultiply_on_load (stbi__unpremultiply_on_load_set \ - ? stbi__unpremultiply_on_load_local \ - : stbi__unpremultiply_on_load_global) -#define stbi__de_iphone_flag (stbi__de_iphone_flag_set \ - ? stbi__de_iphone_flag_local \ - : stbi__de_iphone_flag_global) +#define stbi__unpremultiply_on_load (stbi__unpremultiply_on_load_set ? stbi__unpremultiply_on_load_local : stbi__unpremultiply_on_load_global) +#define stbi__de_iphone_flag (stbi__de_iphone_flag_set ? stbi__de_iphone_flag_local : stbi__de_iphone_flag_global) #endif// STBI_THREAD_LOCAL static void stbi__de_iphone(stbi__png *z) { @@ -5132,11 +5114,13 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) { if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__err("too large", "Very large image (corrupt?)"); if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__err("too large", "Very large image (corrupt?)"); z->depth = stbi__get8(s); - if (z->depth != 1 && z->depth != 2 && z->depth != 4 && z->depth != 8 && z->depth != 16) return stbi__err("1/2/4/8/16-bit only", "PNG not supported: 1/2/4/8/16-bit only"); + if (z->depth != 1 && z->depth != 2 && z->depth != 4 && z->depth != 8 && z->depth != 16) + return stbi__err("1/2/4/8/16-bit only", "PNG not supported: 1/2/4/8/16-bit only"); color = stbi__get8(s); if (color > 6) return stbi__err("bad ctype", "Corrupt PNG"); if (color == 3 && z->depth == 16) return stbi__err("bad ctype", "Corrupt PNG"); - if (color == 3) pal_img_n = 3; + if (color == 3) + pal_img_n = 3; else if (color & 1) return stbi__err("bad ctype", "Corrupt PNG"); comp = stbi__get8(s); @@ -5185,8 +5169,7 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) { if (pal_len == 0) return stbi__err("tRNS before PLTE", "Corrupt PNG"); if (c.length > pal_len) return stbi__err("bad tRNS len", "Corrupt PNG"); pal_img_n = 4; - for (i = 0; i < c.length; ++i) - palette[i * 4 + 3] = stbi__get8(s); + for (i = 0; i < c.length; ++i) palette[i * 4 + 3] = stbi__get8(s); } else { if (!(s->img_n & 1)) return stbi__err("tRNS with alpha", "Corrupt PNG"); if (c.length != (stbi__uint32) s->img_n * 2) return stbi__err("bad tRNS len", "Corrupt PNG"); @@ -5194,7 +5177,8 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) { if (z->depth == 16) { for (k = 0; k < s->img_n; ++k) tc16[k] = (stbi__uint16) stbi__get16be(s);// copy the values as-is } else { - for (k = 0; k < s->img_n; ++k) tc[k] = (stbi_uc) (stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth];// non 8-bit images will be larger + for (k = 0; k < s->img_n; ++k) + tc[k] = (stbi_uc) (stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth];// non 8-bit images will be larger } } break; @@ -5212,8 +5196,7 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) { stbi__uint32 idata_limit_old = idata_limit; stbi_uc *p; if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096; - while (ioff + c.length > idata_limit) - idata_limit *= 2; + while (ioff + c.length > idata_limit) idata_limit *= 2; STBI_NOTUSED(idata_limit_old); p = (stbi_uc *) STBI_REALLOC_SIZED(z->idata, idata_limit_old, idata_limit); if (p == NULL) return stbi__err("outofmem", "Out of memory"); @@ -5232,7 +5215,8 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) { // initial guess for decoded data size to avoid unnecessary reallocs bpl = (s->img_x * z->depth + 7) / 8;// bytes per line, per component raw_len = bpl * s->img_y * s->img_n /* pixels */ + s->img_y /* filter mode per row */; - z->expanded = (stbi_uc *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, raw_len, (int *) &raw_len, !is_iphone); + z->expanded = (stbi_uc *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, raw_len, (int *) &raw_len, + !is_iphone); if (z->expanded == NULL) return 0;// zlib should set error STBI_FREE(z->idata); z->idata = NULL; @@ -5248,15 +5232,13 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) { if (!stbi__compute_transparency(z, tc, s->img_out_n)) return 0; } } - if (is_iphone && stbi__de_iphone_flag && s->img_out_n > 2) - stbi__de_iphone(z); + if (is_iphone && stbi__de_iphone_flag && s->img_out_n > 2) stbi__de_iphone(z); if (pal_img_n) { // pal_img_n == 3 or 4 s->img_n = pal_img_n;// record the actual colors we had s->img_out_n = pal_img_n; if (req_comp >= 3) s->img_out_n = req_comp; - if (!stbi__expand_png_palette(z, palette, pal_len, s->img_out_n)) - return 0; + if (!stbi__expand_png_palette(z, palette, pal_len, s->img_out_n)) return 0; } else if (has_trans) { // non-paletted image with tRNS -> source image has (constant) alpha ++s->img_n; @@ -5357,8 +5339,7 @@ static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp) { static int stbi__png_is16(stbi__context *s) { stbi__png p; p.s = s; - if (!stbi__png_info_raw(&p, NULL, NULL, NULL)) - return 0; + if (!stbi__png_info_raw(&p, NULL, NULL, NULL)) return 0; if (p.depth != 16) { stbi__rewind(p.s); return 0; @@ -5411,7 +5392,9 @@ static int stbi__high_bit(unsigned int z) { n += 2; z >>= 2; } - if (z >= 0x00002) { n += 1; /* >>= 1;*/ } + if (z >= 0x00002) { + n += 1; /* >>= 1;*/ + } return n; } @@ -5429,26 +5412,18 @@ static int stbi__bitcount(unsigned int a) { // extend it to full full range. static int stbi__shiftsigned(unsigned int v, int shift, int bits) { static unsigned int mul_table[9] = { - 0, - 0xff /*0b11111111*/, - 0x55 /*0b01010101*/, - 0x49 /*0b01001001*/, - 0x11 /*0b00010001*/, - 0x21 /*0b00100001*/, - 0x41 /*0b01000001*/, - 0x81 /*0b10000001*/, - 0x01 /*0b00000001*/, + 0, + 0xff /*0b11111111*/, + 0x55 /*0b01010101*/, + 0x49 /*0b01001001*/, + 0x11 /*0b00010001*/, + 0x21 /*0b00100001*/, + 0x41 /*0b01000001*/, + 0x81 /*0b10000001*/, + 0x01 /*0b00000001*/, }; static unsigned int shift_table[9] = { - 0, - 0, - 0, - 1, - 0, - 2, - 4, - 6, - 0, + 0, 0, 0, 1, 0, 2, 4, 6, 0, }; if (shift < 0) v <<= -shift; @@ -5460,8 +5435,7 @@ static int stbi__shiftsigned(unsigned int v, int shift, int bits) { return (int) ((unsigned) v * mul_table[bits]) >> shift_table[bits]; } -typedef struct -{ +typedef struct { int bpp, offset, hsz; unsigned int mr, mg, mb, ma, all_a; int extra_read; @@ -5469,8 +5443,7 @@ typedef struct static int stbi__bmp_set_mask_defaults(stbi__bmp_data *info, int compress) { // BI_BITFIELDS specifies masks explicitly, don't override - if (compress == 3) - return 1; + if (compress == 3) return 1; if (compress == 0) { if (info->bpp == 16) { @@ -5518,13 +5491,14 @@ static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info) { if (hsz != 12) { int compress = stbi__get32le(s); if (compress == 1 || compress == 2) return stbi__errpuc("BMP RLE", "BMP type not supported: RLE"); - if (compress >= 4) return stbi__errpuc("BMP JPEG/PNG", "BMP type not supported: unsupported compression");// this includes PNG/JPEG modes - if (compress == 3 && info->bpp != 16 && info->bpp != 32) return stbi__errpuc("bad BMP", "bad BMP"); // bitfields requires 16 or 32 bits/pixel - stbi__get32le(s); // discard sizeof - stbi__get32le(s); // discard hres - stbi__get32le(s); // discard vres - stbi__get32le(s); // discard colorsused - stbi__get32le(s); // discard max important + if (compress >= 4) return stbi__errpuc("BMP JPEG/PNG", + "BMP type not supported: unsupported compression"); // this includes PNG/JPEG modes + if (compress == 3 && info->bpp != 16 && info->bpp != 32) return stbi__errpuc("bad BMP", "bad BMP");// bitfields requires 16 or 32 bits/pixel + stbi__get32le(s); // discard sizeof + stbi__get32le(s); // discard hres + stbi__get32le(s); // discard vres + stbi__get32le(s); // discard colorsused + stbi__get32le(s); // discard max important if (hsz == 40 || hsz == 56) { if (hsz == 56) { stbi__get32le(s); @@ -5551,17 +5525,15 @@ static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info) { } else { // V4/V5 header int i; - if (hsz != 108 && hsz != 124) - return stbi__errpuc("bad BMP", "bad BMP"); + if (hsz != 108 && hsz != 124) return stbi__errpuc("bad BMP", "bad BMP"); info->mr = stbi__get32le(s); info->mg = stbi__get32le(s); info->mb = stbi__get32le(s); info->ma = stbi__get32le(s); if (compress != 3)// override mr/mg/mb unless in BI_BITFIELDS mode, as per docs stbi__bmp_set_mask_defaults(info, compress); - stbi__get32le(s);// discard color space - for (i = 0; i < 12; ++i) - stbi__get32le(s);// discard color space parameters + stbi__get32le(s); // discard color space + for (i = 0; i < 12; ++i) stbi__get32le(s);// discard color space parameters if (hsz == 124) { stbi__get32le(s);// discard rendering intent stbi__get32le(s);// discard offset of profile data @@ -5584,8 +5556,7 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req STBI_NOTUSED(ri); info.all_a = 255; - if (stbi__bmp_parse_header(s, &info) == NULL) - return NULL;// error code already set + if (stbi__bmp_parse_header(s, &info) == NULL) return NULL;// error code already set flip_vertically = ((int) s->img_y) > 0; s->img_y = abs((int) s->img_y); @@ -5600,11 +5571,9 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req all_a = info.all_a; if (info.hsz == 12) { - if (info.bpp < 24) - psize = (info.offset - info.extra_read - 24) / 3; + if (info.bpp < 24) psize = (info.offset - info.extra_read - 24) / 3; } else { - if (info.bpp < 16) - psize = (info.offset - info.extra_read - info.hsz) >> 2; + if (info.bpp < 16) psize = (info.offset - info.extra_read - info.hsz) >> 2; } if (psize == 0) { if (info.offset != s->callback_already_read + (s->img_buffer - s->img_buffer_original)) { @@ -5622,8 +5591,7 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req target = s->img_n;// if they want monochrome, we'll post-convert // sanity-check size - if (!stbi__mad3sizes_valid(target, s->img_x, s->img_y, 0)) - return stbi__errpuc("too large", "Corrupt BMP"); + if (!stbi__mad3sizes_valid(target, s->img_x, s->img_y, 0)) return stbi__errpuc("too large", "Corrupt BMP"); out = (stbi_uc *) stbi__malloc_mad3(target, s->img_x, s->img_y, 0); if (!out) return stbi__errpuc("outofmem", "Out of memory"); @@ -5641,7 +5609,8 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req pal[i][3] = 255; } stbi__skip(s, info.offset - info.extra_read - info.hsz - psize * (info.hsz == 12 ? 3 : 4)); - if (info.bpp == 1) width = (s->img_x + 7) >> 3; + if (info.bpp == 1) + width = (s->img_x + 7) >> 3; else if (info.bpp == 4) width = (s->img_x + 1) >> 1; else if (info.bpp == 8) @@ -5695,7 +5664,8 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req int z = 0; int easy = 0; stbi__skip(s, info.offset - info.extra_read - info.hsz); - if (info.bpp == 24) width = 3 * s->img_x; + if (info.bpp == 24) + width = 3 * s->img_x; else if (info.bpp == 16) width = 2 * s->img_x; else /* bpp = 32 and pad = 0 */ @@ -5704,8 +5674,7 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req if (info.bpp == 24) { easy = 1; } else if (info.bpp == 32) { - if (mb == 0xff && mg == 0xff00 && mr == 0x00ff0000 && ma == 0xff000000) - easy = 2; + if (mb == 0xff && mg == 0xff00 && mr == 0x00ff0000 && ma == 0xff000000) easy = 2; } if (!easy) { if (!mr || !mg || !mb) { @@ -5757,8 +5726,7 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req // if alpha channel is all 0s, replace with all 255s if (target == 4 && all_a == 0) - for (i = 4 * s->img_x * s->img_y - 1; i >= 0; i -= 4) - out[i] = 255; + for (i = 4 * s->img_x * s->img_y - 1; i >= 0; i -= 4) out[i] = 255; if (flip_vertically) { stbi_uc t; @@ -5962,7 +5930,8 @@ static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req tga_inverted = 1 - ((tga_inverted >> 5) & 1); // If I'm paletted, then I'll use the number of bits from the palette - if (tga_indexed) tga_comp = stbi__tga_get_comp(tga_palette_bits, 0, &tga_rgb16); + if (tga_indexed) + tga_comp = stbi__tga_get_comp(tga_palette_bits, 0, &tga_rgb16); else tga_comp = stbi__tga_get_comp(tga_bits_per_pixel, (tga_image_type == 3), &tga_rgb16); @@ -5974,8 +5943,7 @@ static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req *y = tga_height; if (comp) *comp = tga_comp; - if (!stbi__mad3sizes_valid(tga_width, tga_height, tga_comp, 0)) - return stbi__errpuc("too large", "Corrupt TGA"); + if (!stbi__mad3sizes_valid(tga_width, tga_height, tga_comp, 0)) return stbi__errpuc("too large", "Corrupt TGA"); tga_data = (unsigned char *) stbi__malloc_mad3(tga_width, tga_height, tga_comp, 0); if (!tga_data) return stbi__errpuc("outofmem", "Out of memory"); @@ -6062,8 +6030,7 @@ static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req }// end of reading a pixel // copy data - for (j = 0; j < tga_comp; ++j) - tga_data[i * tga_comp + j] = raw_data[j]; + for (j = 0; j < tga_comp; ++j) tga_data[i * tga_comp + j] = raw_data[j]; // in case we're in RLE mode, keep counting down --RLE_count; @@ -6100,13 +6067,11 @@ static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req } // convert to target component count - if (req_comp && req_comp != tga_comp) - tga_data = stbi__convert_format(tga_data, tga_comp, req_comp, tga_width, tga_height); + if (req_comp && req_comp != tga_comp) tga_data = stbi__convert_format(tga_data, tga_comp, req_comp, tga_width, tga_height); // the things I do to get rid of an error message, and yet keep // Microsoft's C compilers happy... [8^( - tga_palette_start = tga_palette_len = tga_palette_bits = - tga_x_origin = tga_y_origin = 0; + tga_palette_start = tga_palette_len = tga_palette_bits = tga_x_origin = tga_y_origin = 0; STBI_NOTUSED(tga_palette_start); // OK, done return tga_data; @@ -6174,16 +6139,14 @@ static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req return stbi__errpuc("not PSD", "Corrupt PSD image"); // Check file type version. - if (stbi__get16be(s) != 1) - return stbi__errpuc("wrong version", "Unsupported version of PSD image"); + if (stbi__get16be(s) != 1) return stbi__errpuc("wrong version", "Unsupported version of PSD image"); // Skip 6 reserved bytes. stbi__skip(s, 6); // Read the number of channels (R, G, B, A, etc). channelCount = stbi__get16be(s); - if (channelCount < 0 || channelCount > 16) - return stbi__errpuc("wrong channel count", "Unsupported number of channels in PSD image"); + if (channelCount < 0 || channelCount > 16) return stbi__errpuc("wrong channel count", "Unsupported number of channels in PSD image"); // Read the rows and columns of the image. h = stbi__get32be(s); @@ -6194,8 +6157,7 @@ static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req // Make sure the depth is 8 bits. bitdepth = stbi__get16be(s); - if (bitdepth != 8 && bitdepth != 16) - return stbi__errpuc("unsupported bit depth", "PSD bit depth is not 8 or 16 bit"); + if (bitdepth != 8 && bitdepth != 16) return stbi__errpuc("unsupported bit depth", "PSD bit depth is not 8 or 16 bit"); // Make sure the color mode is RGB. // Valid options are: @@ -6207,8 +6169,7 @@ static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req // 7: Multichannel // 8: Duotone // 9: Lab color - if (stbi__get16be(s) != 3) - return stbi__errpuc("wrong color format", "PSD is not in RGB color format"); + if (stbi__get16be(s) != 3) return stbi__errpuc("wrong color format", "PSD is not in RGB color format"); // Skip the Mode Data. (It's the palette for indexed color; other info for other modes.) stbi__skip(s, stbi__get32be(s)); @@ -6224,12 +6185,10 @@ static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req // 0: no compression // 1: RLE compressed compression = stbi__get16be(s); - if (compression > 1) - return stbi__errpuc("bad compression", "PSD has an unknown compression format"); + if (compression > 1) return stbi__errpuc("bad compression", "PSD has an unknown compression format"); // Check size - if (!stbi__mad3sizes_valid(4, w, h, 0)) - return stbi__errpuc("too large", "Corrupt PSD"); + if (!stbi__mad3sizes_valid(4, w, h, 0)) return stbi__errpuc("too large", "Corrupt PSD"); // Create the destination image. @@ -6266,8 +6225,7 @@ static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req p = out + channel; if (channel >= channelCount) { // Fill this channel with default data. - for (i = 0; i < pixelCount; i++, p += 4) - *p = (channel == 3 ? 255 : 0); + for (i = 0; i < pixelCount; i++, p += 4) *p = (channel == 3 ? 255 : 0); } else { // Read the RLE data. if (!stbi__psd_decode_rle(s, p, pixelCount)) { @@ -6288,27 +6246,22 @@ static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req if (bitdepth == 16 && bpc == 16) { stbi__uint16 *q = ((stbi__uint16 *) out) + channel; stbi__uint16 val = channel == 3 ? 65535 : 0; - for (i = 0; i < pixelCount; i++, q += 4) - *q = val; + for (i = 0; i < pixelCount; i++, q += 4) *q = val; } else { stbi_uc *p = out + channel; stbi_uc val = channel == 3 ? 255 : 0; - for (i = 0; i < pixelCount; i++, p += 4) - *p = val; + for (i = 0; i < pixelCount; i++, p += 4) *p = val; } } else { if (ri->bits_per_channel == 16) {// output bpc stbi__uint16 *q = ((stbi__uint16 *) out) + channel; - for (i = 0; i < pixelCount; i++, q += 4) - *q = (stbi__uint16) stbi__get16be(s); + for (i = 0; i < pixelCount; i++, q += 4) *q = (stbi__uint16) stbi__get16be(s); } else { stbi_uc *p = out + channel; if (bitdepth == 16) {// input bpc - for (i = 0; i < pixelCount; i++, p += 4) - *p = (stbi_uc) (stbi__get16be(s) >> 8); + for (i = 0; i < pixelCount; i++, p += 4) *p = (stbi_uc) (stbi__get16be(s) >> 8); } else { - for (i = 0; i < pixelCount; i++, p += 4) - *p = stbi__get8(s); + for (i = 0; i < pixelCount; i++, p += 4) *p = stbi__get8(s); } } } @@ -6372,8 +6325,7 @@ static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req static int stbi__pic_is4(stbi__context *s, const char *str) { int i; for (i = 0; i < 4; ++i) - if (stbi__get8(s) != (stbi_uc) str[i]) - return 0; + if (stbi__get8(s) != (stbi_uc) str[i]) return 0; return 1; } @@ -6381,20 +6333,16 @@ static int stbi__pic_is4(stbi__context *s, const char *str) { static int stbi__pic_test_core(stbi__context *s) { int i; - if (!stbi__pic_is4(s, "\x53\x80\xF6\x34")) - return 0; + if (!stbi__pic_is4(s, "\x53\x80\xF6\x34")) return 0; - for (i = 0; i < 84; ++i) - stbi__get8(s); + for (i = 0; i < 84; ++i) stbi__get8(s); - if (!stbi__pic_is4(s, "PICT")) - return 0; + if (!stbi__pic_is4(s, "PICT")) return 0; return 1; } -typedef struct -{ +typedef struct { stbi_uc size, type, channel; } stbi__pic_packet; @@ -6415,8 +6363,7 @@ static void stbi__copyval(int channel, stbi_uc *dest, const stbi_uc *src) { int mask = 0x80, i; for (i = 0; i < 4; ++i, mask >>= 1) - if (channel & mask) - dest[i] = src[i]; + if (channel & mask) dest[i] = src[i]; } static stbi_uc *stbi__pic_load_core(stbi__context *s, int width, int height, int *comp, stbi_uc *result) { @@ -6428,8 +6375,7 @@ static stbi_uc *stbi__pic_load_core(stbi__context *s, int width, int height, int do { stbi__pic_packet *packet; - if (num_packets == sizeof(packets) / sizeof(packets[0])) - return stbi__errpuc("bad format", "too many packets"); + if (num_packets == sizeof(packets) / sizeof(packets[0])) return stbi__errpuc("bad format", "too many packets"); packet = &packets[num_packets++]; @@ -6461,8 +6407,7 @@ static stbi_uc *stbi__pic_load_core(stbi__context *s, int width, int height, int int x; for (x = 0; x < width; ++x, dest += 4) - if (!stbi__readval(s, packet->channel, dest)) - return 0; + if (!stbi__readval(s, packet->channel, dest)) return 0; break; } @@ -6476,13 +6421,11 @@ static stbi_uc *stbi__pic_load_core(stbi__context *s, int width, int height, int count = stbi__get8(s); if (stbi__at_eof(s)) return stbi__errpuc("bad file", "file too short (pure read count)"); - if (count > left) - count = (stbi_uc) left; + if (count > left) count = (stbi_uc) left; if (!stbi__readval(s, packet->channel, value)) return 0; - for (i = 0; i < count; ++i, dest += 4) - stbi__copyval(packet->channel, dest, value); + for (i = 0; i < count; ++i, dest += 4) stbi__copyval(packet->channel, dest, value); left -= count; } } break; @@ -6500,21 +6443,17 @@ static stbi_uc *stbi__pic_load_core(stbi__context *s, int width, int height, int count = stbi__get16be(s); else count -= 127; - if (count > left) - return stbi__errpuc("bad file", "scanline overrun"); + if (count > left) return stbi__errpuc("bad file", "scanline overrun"); - if (!stbi__readval(s, packet->channel, value)) - return 0; + if (!stbi__readval(s, packet->channel, value)) return 0; - for (i = 0; i < count; ++i, dest += 4) - stbi__copyval(packet->channel, dest, value); + for (i = 0; i < count; ++i, dest += 4) stbi__copyval(packet->channel, dest, value); } else {// Raw ++count; if (count > left) return stbi__errpuc("bad file", "scanline overrun"); for (i = 0; i < count; ++i, dest += 4) - if (!stbi__readval(s, packet->channel, dest)) - return 0; + if (!stbi__readval(s, packet->channel, dest)) return 0; } left -= count; } @@ -6534,8 +6473,7 @@ static void *stbi__pic_load(stbi__context *s, int *px, int *py, int *comp, int r if (!comp) comp = &internal_comp; - for (i = 0; i < 92; ++i) - stbi__get8(s); + for (i = 0; i < 92; ++i) stbi__get8(s); x = stbi__get16be(s); y = stbi__get16be(s); @@ -6578,15 +6516,13 @@ static int stbi__pic_test(stbi__context *s) { // GIF loader -- public domain by Jean-Marc Lienher -- simplified/shrunk by stb #ifndef STBI_NO_GIF -typedef struct -{ +typedef struct { stbi__int16 prefix; stbi_uc first; stbi_uc suffix; } stbi__gif_lzw; -typedef struct -{ +typedef struct { int w, h; stbi_uc *out; // output buffer (always 4 components) stbi_uc *background;// The current "background" as far as a gif is concerned @@ -6632,8 +6568,7 @@ static void stbi__gif_parse_colortable(stbi__context *s, stbi_uc pal[256][4], in static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, int is_info) { stbi_uc version; - if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8') - return stbi__err("not GIF", "Corrupt GIF"); + if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8') return stbi__err("not GIF", "Corrupt GIF"); version = stbi__get8(s); if (version != '7' && version != '9') return stbi__err("not GIF", "Corrupt GIF"); @@ -6654,8 +6589,7 @@ static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, int is_in if (is_info) return 1; - if (g->flags & 0x80) - stbi__gif_parse_colortable(s, g->pal, 2 << (g->flags & 7), -1); + if (g->flags & 0x80) stbi__gif_parse_colortable(s, g->pal, 2 << (g->flags & 7), -1); return 1; } @@ -6680,8 +6614,7 @@ static void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code) { // recurse to decode the prefixes, since the linked-list is backwards, // and working backwards through an interleaved image would be nasty - if (g->codes[code].prefix >= 0) - stbi__out_gif_code(g, g->codes[code].prefix); + if (g->codes[code].prefix >= 0) stbi__out_gif_code(g, g->codes[code].prefix); if (g->cur_y >= g->max_y) return; @@ -6740,8 +6673,7 @@ static stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g) { if (valid_bits < codesize) { if (len == 0) { len = stbi__get8(s);// start new block - if (len == 0) - return g->out; + if (len == 0) return g->out; } --len; bits |= (stbi__int32) stbi__get8(s) << valid_bits; @@ -6759,8 +6691,7 @@ static stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g) { first = 0; } else if (code == clear + 1) {// end of stream code stbi__skip(s, len); - while ((len = stbi__get8(s)) > 0) - stbi__skip(s, len); + while ((len = stbi__get8(s)) > 0) stbi__skip(s, len); return g->out; } else if (code <= avail) { if (first) { @@ -6807,14 +6738,12 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i first_frame = 0; if (g->out == 0) { if (!stbi__gif_header(s, g, comp, 0)) return 0;// stbi__g_failure_reason set by stbi__gif_header - if (!stbi__mad3sizes_valid(4, g->w, g->h, 0)) - return stbi__errpuc("too large", "GIF image is too large"); + if (!stbi__mad3sizes_valid(4, g->w, g->h, 0)) return stbi__errpuc("too large", "GIF image is too large"); pcount = g->w * g->h; g->out = (stbi_uc *) stbi__malloc(4 * pcount); g->background = (stbi_uc *) stbi__malloc(4 * pcount); g->history = (stbi_uc *) stbi__malloc(pcount); - if (!g->out || !g->background || !g->history) - return stbi__errpuc("outofmem", "Out of memory"); + if (!g->out || !g->background || !g->history) return stbi__errpuc("outofmem", "Out of memory"); // image is treated as "transparent" at the start - ie, nothing overwrites the current background; // background colour is only used for pixels that are not rendered first frame, after that "background" @@ -6871,8 +6800,7 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i y = stbi__get16le(s); w = stbi__get16le(s); h = stbi__get16le(s); - if (((x + w) > (g->w)) || ((y + h) > (g->h))) - return stbi__errpuc("bad Image Descriptor", "Corrupt GIF"); + if (((x + w) > (g->w)) || ((y + h) > (g->h))) return stbi__errpuc("bad Image Descriptor", "Corrupt GIF"); g->line_size = g->w * 4; g->start_x = x * 4; @@ -6886,8 +6814,7 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i // we may not see *any* pixels or the image is malformed; // to make sure this is caught, move the current y down to // max_y (which is what out_gif_code checks). - if (w == 0) - g->cur_y = g->max_y; + if (w == 0) g->cur_y = g->max_y; g->lflags = stbi__get8(s); @@ -7019,20 +6946,17 @@ static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y, if (delays) { int *new_delays = (int *) STBI_REALLOC_SIZED(*delays, delays_size, sizeof(int) * layers); - if (!new_delays) - return stbi__load_gif_main_outofmem(&g, out, delays); + if (!new_delays) return stbi__load_gif_main_outofmem(&g, out, delays); *delays = new_delays; delays_size = layers * sizeof(int); } } else { out = (stbi_uc *) stbi__malloc(layers * stride); - if (!out) - return stbi__load_gif_main_outofmem(&g, out, delays); + if (!out) return stbi__load_gif_main_outofmem(&g, out, delays); out_size = layers * stride; if (delays) { *delays = (int *) stbi__malloc(layers * sizeof(int)); - if (!*delays) - return stbi__load_gif_main_outofmem(&g, out, delays); + if (!*delays) return stbi__load_gif_main_outofmem(&g, out, delays); delays_size = layers * sizeof(int); } } @@ -7053,8 +6977,7 @@ static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y, STBI_FREE(g.background); // do the final conversion after loading everything; - if (req_comp && req_comp != 4) - out = stbi__convert_format(out, 4, req_comp, layers * g.w, g.h); + if (req_comp && req_comp != 4) out = stbi__convert_format(out, 4, req_comp, layers * g.w, g.h); *z = layers; return out; @@ -7077,8 +7000,7 @@ static void *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req // moved conversion to after successful load so that the same // can be done for multiple frames. - if (req_comp && req_comp != 4) - u = stbi__convert_format(u, 4, req_comp, g.w, g.h); + if (req_comp && req_comp != 4) u = stbi__convert_format(u, 4, req_comp, g.w, g.h); } else if (g.out) { // if there was an error and we allocated an image buffer, free it! STBI_FREE(g.out); @@ -7103,8 +7025,7 @@ static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp) { static int stbi__hdr_test_core(stbi__context *s, const char *signature) { int i; for (i = 0; signature[i]; ++i) - if (stbi__get8(s) != signature[i]) - return 0; + if (stbi__get8(s) != signature[i]) return 0; stbi__rewind(s); return 1; } @@ -7130,8 +7051,7 @@ static char *stbi__hdr_gettoken(stbi__context *z, char *buffer) { buffer[len++] = c; if (len == STBI__HDR_BUFLEN - 1) { // flush to end of line - while (!stbi__at_eof(z) && stbi__get8(z) != '\n') - ; + while (!stbi__at_eof(z) && stbi__get8(z) != '\n'); break; } c = (char) stbi__get8(z); @@ -7186,8 +7106,7 @@ static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int re // Check identifier headerToken = stbi__hdr_gettoken(s, buffer); - if (strcmp(headerToken, "#?RADIANCE") != 0 && strcmp(headerToken, "#?RGBE") != 0) - return stbi__errpf("not HDR", "Corrupt HDR image"); + if (strcmp(headerToken, "#?RADIANCE") != 0 && strcmp(headerToken, "#?RGBE") != 0) return stbi__errpf("not HDR", "Corrupt HDR image"); // Parse header for (;;) { @@ -7218,13 +7137,11 @@ static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int re if (comp) *comp = 3; if (req_comp == 0) req_comp = 3; - if (!stbi__mad4sizes_valid(width, height, req_comp, sizeof(float), 0)) - return stbi__errpf("too large", "HDR image is too large"); + if (!stbi__mad4sizes_valid(width, height, req_comp, sizeof(float), 0)) return stbi__errpf("too large", "HDR image is too large"); // Read data hdr_data = (float *) stbi__malloc_mad4(width, height, req_comp, sizeof(float), 0); - if (!hdr_data) - return stbi__errpf("outofmem", "Out of memory"); + if (!hdr_data) return stbi__errpf("outofmem", "Out of memory"); // Load image data // image data is stored as some number of sca @@ -7289,8 +7206,7 @@ static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int re STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); } - for (z = 0; z < count; ++z) - scanline[i++ * 4 + k] = value; + for (z = 0; z < count; ++z) scanline[i++ * 4 + k] = value; } else { // Dump if (count > nleft) { @@ -7298,16 +7214,13 @@ static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int re STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); } - for (z = 0; z < count; ++z) - scanline[i++ * 4 + k] = stbi__get8(s); + for (z = 0; z < count; ++z) scanline[i++ * 4 + k] = stbi__get8(s); } } } - for (i = 0; i < width; ++i) - stbi__hdr_convert(hdr_data + (j * width + i) * req_comp, scanline + i * 4, req_comp); + for (i = 0; i < width; ++i) stbi__hdr_convert(hdr_data + (j * width + i) * req_comp, scanline + i * 4, req_comp); } - if (scanline) - STBI_FREE(scanline); + if (scanline) STBI_FREE(scanline); } return hdr_data; @@ -7474,8 +7387,7 @@ static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp) { do { stbi__pic_packet *packet; - if (num_packets == sizeof(packets) / sizeof(packets[0])) - return 0; + if (num_packets == sizeof(packets) / sizeof(packets[0])) return 0; packet = &packets[num_packets++]; chained = stbi__get8(s); @@ -7529,8 +7441,7 @@ static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req STBI_NOTUSED(ri); ri->bits_per_channel = stbi__pnm_info(s, (int *) &s->img_x, (int *) &s->img_y, (int *) &s->img_n); - if (ri->bits_per_channel == 0) - return 0; + if (ri->bits_per_channel == 0) return 0; if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large", "Very large image (corrupt?)"); if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large", "Very large image (corrupt?)"); @@ -7539,8 +7450,7 @@ static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req *y = s->img_y; if (comp) *comp = s->img_n; - if (!stbi__mad4sizes_valid(s->img_n, s->img_x, s->img_y, ri->bits_per_channel / 8, 0)) - return stbi__errpuc("too large", "PNM too large"); + if (!stbi__mad4sizes_valid(s->img_n, s->img_x, s->img_y, ri->bits_per_channel / 8, 0)) return stbi__errpuc("too large", "PNM too large"); out = (stbi_uc *) stbi__malloc_mad4(s->img_n, s->img_x, s->img_y, ri->bits_per_channel / 8, 0); if (!out) return stbi__errpuc("outofmem", "Out of memory"); @@ -7559,14 +7469,11 @@ static int stbi__pnm_isspace(char c) { static void stbi__pnm_skip_whitespace(stbi__context *s, char *c) { for (;;) { - while (!stbi__at_eof(s) && stbi__pnm_isspace(*c)) - *c = (char) stbi__get8(s); + while (!stbi__at_eof(s) && stbi__pnm_isspace(*c)) *c = (char) stbi__get8(s); - if (stbi__at_eof(s) || *c != '#') - break; + if (stbi__at_eof(s) || *c != '#') break; - while (!stbi__at_eof(s) && *c != '\n' && *c != '\r') - *c = (char) stbi__get8(s); + while (!stbi__at_eof(s) && *c != '\n' && *c != '\r') *c = (char) stbi__get8(s); } } @@ -7624,8 +7531,7 @@ static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp) { } static int stbi__pnm_is16(stbi__context *s) { - if (stbi__pnm_info(s, NULL, NULL, NULL) == 16) - return 1; + if (stbi__pnm_info(s, NULL, NULL, NULL) == 16) return 1; return 0; } #endif @@ -7665,8 +7571,7 @@ static int stbi__info_main(stbi__context *s, int *x, int *y, int *comp) { // test tga last because it's a crappy test! #ifndef STBI_NO_TGA - if (stbi__tga_info(s, x, y, comp)) - return 1; + if (stbi__tga_info(s, x, y, comp)) return 1; #endif return stbi__err("unknown image type", "Image not of any known type, or corrupt"); } diff --git a/spine-godot/spine_godot/SpineAnimation.cpp b/spine-godot/spine_godot/SpineAnimation.cpp index ed54d460a..3eea8bb03 100644 --- a/spine-godot/spine_godot/SpineAnimation.cpp +++ b/spine-godot/spine_godot/SpineAnimation.cpp @@ -62,12 +62,12 @@ void SpineAnimation::set_duration(float duration) { get_spine_object()->setDuration(duration); } -void SpineAnimation::apply(Ref skeleton, float last_time, float time, bool loop, - Array events, float alpha, SpineConstant::MixBlend blend, - SpineConstant::MixDirection direction) { +void SpineAnimation::apply(Ref skeleton, float last_time, float time, bool loop, Array events, float alpha, + SpineConstant::MixBlend blend, SpineConstant::MixDirection direction) { SPINE_CHECK(get_spine_object(), ) spine::Vector spineEvents; - get_spine_object()->apply(*(skeleton->get_spine_object()), last_time, time, loop, &spineEvents, alpha, (spine::MixBlend) blend, (spine::MixDirection) direction); + get_spine_object()->apply(*(skeleton->get_spine_object()), last_time, time, loop, &spineEvents, alpha, (spine::MixBlend) blend, + (spine::MixDirection) direction); for (int i = 0; i < (int) spineEvents.size(); ++i) { auto event_ref = memnew(SpineEvent); event_ref->set_spine_object(skeleton->get_spine_owner(), spineEvents[i]); diff --git a/spine-godot/spine_godot/SpineAnimation.h b/spine-godot/spine_godot/SpineAnimation.h index 2d857a2e8..f32de2e96 100644 --- a/spine-godot/spine_godot/SpineAnimation.h +++ b/spine-godot/spine_godot/SpineAnimation.h @@ -45,7 +45,8 @@ protected: static void _bind_methods(); public: - void apply(Ref skeleton, float last_time, float time, bool loop, Array events, float alpha, SpineConstant::MixBlend blend, SpineConstant::MixDirection direction); + void apply(Ref skeleton, float last_time, float time, bool loop, Array events, float alpha, SpineConstant::MixBlend blend, + SpineConstant::MixDirection direction); Array get_timelines(); diff --git a/spine-godot/spine_godot/SpineAnimationState.cpp b/spine-godot/spine_godot/SpineAnimationState.cpp index 80dd624d3..c88dca1f4 100644 --- a/spine-godot/spine_godot/SpineAnimationState.cpp +++ b/spine-godot/spine_godot/SpineAnimationState.cpp @@ -36,8 +36,10 @@ void SpineAnimationState::_bind_methods() { ClassDB::bind_method(D_METHOD("clear_tracks"), &SpineAnimationState::clear_tracks); ClassDB::bind_method(D_METHOD("clear_track"), &SpineAnimationState::clear_track); ClassDB::bind_method(D_METHOD("get_num_tracks"), &SpineAnimationState::get_num_tracks); - ClassDB::bind_method(D_METHOD("set_animation", "animation_name", "loop", "track_id"), &SpineAnimationState::set_animation, DEFVAL(true), DEFVAL(0)); - ClassDB::bind_method(D_METHOD("add_animation", "animation_name", "delay", "loop", "track_id"), &SpineAnimationState::add_animation, DEFVAL(0), DEFVAL(true), DEFVAL(0)); + ClassDB::bind_method(D_METHOD("set_animation", "animation_name", "loop", "track_id"), &SpineAnimationState::set_animation, DEFVAL(true), + DEFVAL(0)); + ClassDB::bind_method(D_METHOD("add_animation", "animation_name", "delay", "loop", "track_id"), &SpineAnimationState::add_animation, DEFVAL(0), + DEFVAL(true), DEFVAL(0)); ClassDB::bind_method(D_METHOD("set_empty_animation", "track_id", "mix_duration"), &SpineAnimationState::set_empty_animation); ClassDB::bind_method(D_METHOD("add_empty_animation", "track_id", "mix_duration", "delay"), &SpineAnimationState::add_empty_animation); ClassDB::bind_method(D_METHOD("set_empty_animations", "mix_duration"), &SpineAnimationState::set_empty_animations); diff --git a/spine-godot/spine_godot/SpineAnimationState.h b/spine-godot/spine_godot/SpineAnimationState.h index 29ea13e8b..9d0019ba0 100644 --- a/spine-godot/spine_godot/SpineAnimationState.h +++ b/spine-godot/spine_godot/SpineAnimationState.h @@ -48,7 +48,9 @@ public: SpineAnimationState(); ~SpineAnimationState(); - spine::AnimationState *get_spine_object() { return animation_state; } + spine::AnimationState *get_spine_object() { + return animation_state; + } void set_spine_sprite(SpineSprite *sprite); diff --git a/spine-godot/spine_godot/SpineAnimationTrack.cpp b/spine-godot/spine_godot/SpineAnimationTrack.cpp index a6965bbd3..220d6a6eb 100644 --- a/spine-godot/spine_godot/SpineAnimationTrack.cpp +++ b/spine-godot/spine_godot/SpineAnimationTrack.cpp @@ -77,8 +77,12 @@ void SpineAnimationTrack::_bind_methods() { ClassDB::bind_method(D_METHOD("update_animation_state", "spine_sprite"), &SpineAnimationTrack::update_animation_state); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "animation_name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_NOEDITOR), "set_animation_name", "get_animation_name"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "loop", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_NOEDITOR), "set_loop", "get_loop"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "animation_name", PROPERTY_HINT_NONE, "", + PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_NOEDITOR), + "set_animation_name", "get_animation_name"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "loop", PROPERTY_HINT_NONE, "", + PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_NOEDITOR), + "set_loop", "get_loop"); ADD_PROPERTY(PropertyInfo(Variant::INT, "track_index", PROPERTY_HINT_RANGE, "0,256,1"), "set_track_index", "get_track_index"); ADD_PROPERTY(PropertyInfo(VARIANT_FLOAT, "mix_duration"), "set_mix_duration", "get_mix_duration"); @@ -94,21 +98,10 @@ void SpineAnimationTrack::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "debug"), "set_debug", "get_debug"); } -SpineAnimationTrack::SpineAnimationTrack() : loop(false), - animation_changed(false), - track_index(-1), - mix_duration(-1), - hold_previous(false), - reverse(false), - shortest_rotation(false), - time_scale(1), - alpha(1), - mix_attachment_threshold(0), - mix_draw_order_threshold(0), - mix_blend(SpineConstant::MixBlend_Replace), - blend_tree_mode(false), - debug(false), - sprite(nullptr) { +SpineAnimationTrack::SpineAnimationTrack() + : loop(false), animation_changed(false), track_index(-1), mix_duration(-1), hold_previous(false), reverse(false), shortest_rotation(false), + time_scale(1), alpha(1), mix_attachment_threshold(0), mix_draw_order_threshold(0), mix_blend(SpineConstant::MixBlend_Replace), + blend_tree_mode(false), debug(false), sprite(nullptr) { } void SpineAnimationTrack::_notification(int what) { @@ -167,8 +160,7 @@ void SpineAnimationTrack::setup_animation_player() { for (int i = 0; i < sprite->get_child_count(); i++) { auto other_track = cast_to(sprite->get_child(i)); if (other_track) { - if (other_track->track_index > highest_track_number) - highest_track_number = other_track->track_index; + if (other_track->track_index > highest_track_number) highest_track_number = other_track->track_index; } } track_index = highest_track_number + 1; @@ -318,12 +310,20 @@ void SpineAnimationTrack::update_animation_state(const Variant &variant_sprite) entry->setMixDrawOrderThreshold(mix_draw_order_threshold); entry->setMixBlend((spine::MixBlend) mix_blend); - if (debug) print_line(String("Setting animation {0} with mix_duration {1} on track {2} on {3}").format(varray(animation_name, mix_duration, track_index, sprite->get_name())).utf8().ptr()); + if (debug) + print_line(String("Setting animation {0} with mix_duration {1} on track {2} on {3}") + .format(varray(animation_name, mix_duration, track_index, sprite->get_name())) + .utf8() + .ptr()); } else { if (!current_entry || (String("") != other_name)) { auto entry = animation_state->setEmptyAnimation(track_index, should_set_mix ? mix_duration : 0); entry->setTrackEnd(FLT_MAX); - if (debug) print_line(String("Setting empty animation with mix_duration {0} on track {1} on {2}").format(varray(mix_duration, track_index, sprite->get_name())).utf8().ptr()); + if (debug) + print_line(String("Setting empty animation with mix_duration {0} on track {1} on {2}") + .format(varray(mix_duration, track_index, sprite->get_name())) + .utf8() + .ptr()); } } } @@ -446,12 +446,20 @@ void SpineAnimationTrack::update_animation_state(const Variant &variant_sprite) entry->setMixDrawOrderThreshold(mix_draw_order_threshold); entry->setMixBlend((spine::MixBlend) mix_blend); - if (debug) print_line(String("Setting animation {0} with mix_duration {1} on track {2} on {3}").format(varray(animation_name, mix_duration, track_index, sprite->get_name())).utf8().ptr()); + if (debug) + print_line(String("Setting animation {0} with mix_duration {1} on track {2} on {3}") + .format(varray(animation_name, mix_duration, track_index, sprite->get_name())) + .utf8() + .ptr()); } else { if (!current_entry || (String("") != other_name)) { auto entry = animation_state->setEmptyAnimation(track_index, should_set_mix ? mix_duration : 0); entry->setTrackEnd(FLT_MAX); - if (debug) print_line(String("Setting empty animation with mix_duration {0} on track {1} on {2}").format(varray(mix_duration, track_index, sprite->get_name())).utf8().ptr()); + if (debug) + print_line(String("Setting empty animation with mix_duration {0} on track {1} on {2}") + .format(varray(mix_duration, track_index, sprite->get_name())) + .utf8() + .ptr()); } } } diff --git a/spine-godot/spine_godot/SpineAtlasResource.cpp b/spine-godot/spine_godot/SpineAtlasResource.cpp index ca0ea381a..482c20e2b 100644 --- a/spine-godot/spine_godot/SpineAtlasResource.cpp +++ b/spine-godot/spine_godot/SpineAtlasResource.cpp @@ -66,7 +66,10 @@ class GodotSpineTextureLoader : public spine::TextureLoader { String specular_map_prefix; public: - GodotSpineTextureLoader(Array *_textures, Array *_normal_maps, Array *_specular_maps, const String &normal_map_prefix, const String &specular_map_prefix, bool is_importing) : textures(_textures), normal_maps(_normal_maps), specular_maps(_specular_maps), normal_map_prefix(normal_map_prefix), specular_map_prefix(specular_map_prefix) { + GodotSpineTextureLoader(Array *_textures, Array *_normal_maps, Array *_specular_maps, const String &normal_map_prefix, + const String &specular_map_prefix, bool is_importing) + : textures(_textures), normal_maps(_normal_maps), specular_maps(_specular_maps), normal_map_prefix(normal_map_prefix), + specular_map_prefix(specular_map_prefix) { } static bool fix_path(String &path) { @@ -407,7 +410,8 @@ Error SpineAtlasResource::copy_from(const Ref &p_resource) { Variant SpineAtlasResourceFormatLoader::_load(const String &path, const String &original_path, bool use_sub_threads, int32_t cache_mode) { #else #if VERSION_MAJOR > 3 -RES SpineAtlasResourceFormatLoader::load(const String &path, const String &original_path, Error *error, bool use_sub_threads, float *progress, CacheMode cache_mode) { +RES SpineAtlasResourceFormatLoader::load(const String &path, const String &original_path, Error *error, bool use_sub_threads, float *progress, + CacheMode cache_mode) { #else #if VERSION_MINOR > 5 RES SpineAtlasResourceFormatLoader::load(const String &path, const String &original_path, Error *error, bool p_no_subresource_cache) { @@ -434,8 +438,7 @@ PackedStringArray SpineAtlasResourceFormatLoader::_get_recognized_extensions() { #else void SpineAtlasResourceFormatLoader::get_recognized_extensions(List *extensions) const { const char atlas_ext[] = "spatlas"; - if (!extensions->find(atlas_ext)) - extensions->push_back(atlas_ext); + if (!extensions->find(atlas_ext)) extensions->push_back(atlas_ext); } #endif @@ -478,8 +481,7 @@ PackedStringArray SpineAtlasResourceFormatSaver::_get_recognized_extensions(cons } #else void SpineAtlasResourceFormatSaver::get_recognized_extensions(const RES &resource, List *extensions) const { - if (Object::cast_to(*resource)) - extensions->push_back("spatlas"); + if (Object::cast_to(*resource)) extensions->push_back("spatlas"); } #endif diff --git a/spine-godot/spine_godot/SpineAtlasResource.h b/spine-godot/spine_godot/SpineAtlasResource.h index 4635654e2..97ced8869 100644 --- a/spine-godot/spine_godot/SpineAtlasResource.h +++ b/spine-godot/spine_godot/SpineAtlasResource.h @@ -70,11 +70,17 @@ public: SpineAtlasResource(); ~SpineAtlasResource() override; - spine::Atlas *get_spine_atlas() { return atlas; } + spine::Atlas *get_spine_atlas() { + return atlas; + } - void set_normal_texture_prefix(const String &prefix) { normal_map_prefix = prefix; } + void set_normal_texture_prefix(const String &prefix) { + normal_map_prefix = prefix; + } - void set_specular_texture_prefix(const String &prefix) { specular_map_prefix = prefix; } + void set_specular_texture_prefix(const String &prefix) { + specular_map_prefix = prefix; + } Error load_from_atlas_file(const String &path);// .atlas @@ -109,7 +115,7 @@ class SpineAtlasResourceFormatLoader : public ResourceFormatLoader { public: #ifdef SPINE_GODOT_EXTENSION - static void _bind_methods(){}; + static void _bind_methods() {}; PackedStringArray _get_recognized_extensions(); @@ -142,7 +148,7 @@ class SpineAtlasResourceFormatSaver : public ResourceFormatSaver { public: #ifdef SPINE_GODOT_EXTENSION - static void _bind_methods(){}; + static void _bind_methods() {}; Error _save(const Ref &resource, const String &path, uint32_t flags) override; diff --git a/spine-godot/spine_godot/SpineBoneNode.cpp b/spine-godot/spine_godot/SpineBoneNode.cpp index 4d3b24604..0c359cb8a 100644 --- a/spine-godot/spine_godot/SpineBoneNode.cpp +++ b/spine-godot/spine_godot/SpineBoneNode.cpp @@ -113,7 +113,8 @@ void SpineBoneNode::_get_property_list(List *list) const { Vector bone_names; #endif SpineSprite *sprite = find_parent_sprite(); - if (sprite) sprite->get_skeleton_data_res()->get_bone_names(bone_names); + if (sprite) + sprite->get_skeleton_data_res()->get_bone_names(bone_names); else bone_names.push_back(bone_name); auto element = list->front(); diff --git a/spine-godot/spine_godot/SpineBoneNode.h b/spine-godot/spine_godot/SpineBoneNode.h index 7aa2f19b0..3d8585be1 100644 --- a/spine-godot/spine_godot/SpineBoneNode.h +++ b/spine-godot/spine_godot/SpineBoneNode.h @@ -59,7 +59,8 @@ protected: void draw(); public: - SpineBoneNode() : bone_mode(SpineConstant::BoneMode_Follow), enabled(true), debug_color(Color::hex(0xff000077)), debug_thickness(5) {} + SpineBoneNode() : bone_mode(SpineConstant::BoneMode_Follow), enabled(true), debug_color(Color::hex(0xff000077)), debug_thickness(5) { + } SpineConstant::BoneMode get_bone_mode(); diff --git a/spine-godot/spine_godot/SpineCommon.h b/spine-godot/spine_godot/SpineCommon.h index c9cdda5d5..14ce5b229 100644 --- a/spine-godot/spine_godot/SpineCommon.h +++ b/spine-godot/spine_godot/SpineCommon.h @@ -85,15 +85,19 @@ using namespace godot; #define GDREGISTER_CLASS(x) ClassDB::register_class() #define GEOMETRY2D Geometry #ifndef SNAME -#define SNAME(m_arg) ([]() -> const StringName & { static StringName sname = _scs_create(m_arg); return sname; })() +#define SNAME(m_arg) \ + ([]() -> const StringName & { \ + static StringName sname = _scs_create(m_arg); \ + return sname; \ + })() #endif #endif #endif -#define SPINE_CHECK(obj, ret) \ - if (!(obj)) { \ - ERR_PRINT("Native Spine object not set."); \ - return ret; \ +#define SPINE_CHECK(obj, ret) \ + if (!(obj)) { \ + ERR_PRINT("Native Spine object not set."); \ + return ret; \ } #define SPINE_STRING(x) spine::String((x).utf8()) @@ -147,8 +151,12 @@ protected: #endif } - void *_get_spine_object_internal() { return spine_object; } - void *_get_spine_owner_internal() { return spine_owner; } + void *_get_spine_object_internal() { + return spine_object; + } + void *_get_spine_owner_internal() { + return spine_owner; + } }; class SpineSprite; diff --git a/spine-godot/spine_godot/SpineEditorPlugin.cpp b/spine-godot/spine_godot/SpineEditorPlugin.cpp index 47f051706..806f153ad 100644 --- a/spine-godot/spine_godot/SpineEditorPlugin.cpp +++ b/spine-godot/spine_godot/SpineEditorPlugin.cpp @@ -41,16 +41,21 @@ #include "editor/editor_undo_redo_manager.h" #endif #ifdef SPINE_GODOT_EXTENSION -Error SpineAtlasResourceImportPlugin::_import(const String &source_file, const String &save_path, const Dictionary &options, const TypedArray &platform_variants, const TypedArray &gen_files) const { +Error SpineAtlasResourceImportPlugin::_import(const String &source_file, const String &save_path, const Dictionary &options, + const TypedArray &platform_variants, const TypedArray &gen_files) const { #else #if VERSION_MINOR > 3 -Error SpineAtlasResourceImportPlugin::import(ResourceUID::ID p_source_id, const String &source_file, const String &save_path, const HashMap &options, List *r_platform_variants, List *r_gen_files, Variant *r_metadata) { +Error SpineAtlasResourceImportPlugin::import(ResourceUID::ID p_source_id, const String &source_file, const String &save_path, + const HashMap &options, List *r_platform_variants, + List *r_gen_files, Variant *r_metadata) { #else -Error SpineAtlasResourceImportPlugin::import(const String &source_file, const String &save_path, const HashMap &options, List *platform_variants, List *gen_files, Variant *metadata) { +Error SpineAtlasResourceImportPlugin::import(const String &source_file, const String &save_path, const HashMap &options, + List *platform_variants, List *gen_files, Variant *metadata) { #endif #endif #else -Error SpineAtlasResourceImportPlugin::import(const String &source_file, const String &save_path, const Map &options, List *platform_variants, List *gen_files, Variant *metadata) { +Error SpineAtlasResourceImportPlugin::import(const String &source_file, const String &save_path, const Map &options, + List *platform_variants, List *gen_files, Variant *metadata) { #endif Ref atlas(memnew(SpineAtlasResource)); atlas->set_normal_texture_prefix(options["normal_map_prefix"]); @@ -118,16 +123,21 @@ void SpineAtlasResourceImportPlugin::get_import_options(List *opti #if VERSION_MAJOR > 3 #ifdef SPINE_GODOT_EXTENSION -Error SpineJsonResourceImportPlugin::_import(const String &source_file, const String &save_path, const Dictionary &options, const TypedArray &platform_variants, const TypedArray &gen_files) const { +Error SpineJsonResourceImportPlugin::_import(const String &source_file, const String &save_path, const Dictionary &options, + const TypedArray &platform_variants, const TypedArray &gen_files) const { #else #if VERSION_MINOR > 3 -Error SpineJsonResourceImportPlugin::import(ResourceUID::ID p_source_id, const String &source_file, const String &save_path, const HashMap &p_options, List *r_platform_variants, List *r_gen_files, Variant *r_metadata) { +Error SpineJsonResourceImportPlugin::import(ResourceUID::ID p_source_id, const String &source_file, const String &save_path, + const HashMap &p_options, List *r_platform_variants, + List *r_gen_files, Variant *r_metadata) { #else -Error SpineJsonResourceImportPlugin::import(const String &source_file, const String &save_path, const HashMap &options, List *platform_variants, List *gen_files, Variant *metadata) { +Error SpineJsonResourceImportPlugin::import(const String &source_file, const String &save_path, const HashMap &options, + List *platform_variants, List *gen_files, Variant *metadata) { #endif #endif #else -Error SpineJsonResourceImportPlugin::import(const String &source_file, const String &save_path, const Map &options, List *platform_variants, List *gen_files, Variant *metadata) { +Error SpineJsonResourceImportPlugin::import(const String &source_file, const String &save_path, const Map &options, + List *platform_variants, List *gen_files, Variant *metadata) { #endif Ref skeleton_file_res(memnew(SpineSkeletonFileResource)); Error error = skeleton_file_res->load_from_file(source_file); @@ -150,16 +160,21 @@ Error SpineJsonResourceImportPlugin::import(const String &source_file, const Str #if VERSION_MAJOR > 3 #ifdef SPINE_GODOT_EXTENSION -Error SpineBinaryResourceImportPlugin::_import(const String &source_file, const String &save_path, const Dictionary &options, const TypedArray &platform_variants, const TypedArray &gen_files) const { +Error SpineBinaryResourceImportPlugin::_import(const String &source_file, const String &save_path, const Dictionary &options, + const TypedArray &platform_variants, const TypedArray &gen_files) const { #else #if VERSION_MINOR > 3 -Error SpineBinaryResourceImportPlugin::import(ResourceUID::ID p_source_id, const String &source_file, const String &save_path, const HashMap &p_options, List *r_platform_variants, List *r_gen_files, Variant *r_metadata) { +Error SpineBinaryResourceImportPlugin::import(ResourceUID::ID p_source_id, const String &source_file, const String &save_path, + const HashMap &p_options, List *r_platform_variants, + List *r_gen_files, Variant *r_metadata) { #else -Error SpineBinaryResourceImportPlugin::import(const String &source_file, const String &save_path, const HashMap &options, List *platform_variants, List *gen_files, Variant *metadata) { +Error SpineBinaryResourceImportPlugin::import(const String &source_file, const String &save_path, const HashMap &options, + List *platform_variants, List *gen_files, Variant *metadata) { #endif #endif #else -Error SpineBinaryResourceImportPlugin::import(const String &source_file, const String &save_path, const Map &options, List *platform_variants, List *gen_files, Variant *metadata) { +Error SpineBinaryResourceImportPlugin::import(const String &source_file, const String &save_path, const Map &options, + List *platform_variants, List *gen_files, Variant *metadata) { #endif Ref skeleton_file_res(memnew(SpineSkeletonFileResource)); Error error = skeleton_file_res->load_from_file(source_file); @@ -208,13 +223,15 @@ bool SpineSkeletonDataResourceInspectorPlugin::can_handle(Object *object) { #if VERSION_MAJOR > 3 #ifdef SPINE_GODOT_EXTENSION -bool SpineSkeletonDataResourceInspectorPlugin::_parse_property(Object *object, Variant::Type type, const String &path, PropertyHint hint, const String &hint_text, const BitField p_usage, bool wide) { +bool SpineSkeletonDataResourceInspectorPlugin::_parse_property(Object *object, Variant::Type type, const String &path, PropertyHint hint, + const String &hint_text, const BitField p_usage, bool wide) { #else -bool SpineSkeletonDataResourceInspectorPlugin::parse_property(Object *object, const Variant::Type type, const String &path, const PropertyHint hint, const String &hint_text, const BitField p_usage, const bool wide) { +bool SpineSkeletonDataResourceInspectorPlugin::parse_property(Object *object, const Variant::Type type, const String &path, const PropertyHint hint, + const String &hint_text, const BitField p_usage, const bool wide) { #endif #else -bool SpineSkeletonDataResourceInspectorPlugin::parse_property(Object *object, Variant::Type type, const String &path, - PropertyHint hint, const String &hint_text, int usage) { +bool SpineSkeletonDataResourceInspectorPlugin::parse_property(Object *object, Variant::Type type, const String &path, PropertyHint hint, + const String &hint_text, int usage) { #endif // FIXME can't do this in godot-cpp #ifndef SPINE_GODOT_EXTENSION @@ -339,10 +356,12 @@ void SpineEditorPropertyAnimationMixes::update_property() { updating = false; } -SpineEditorPropertyAnimationMix::SpineEditorPropertyAnimationMix() : mixes_property(nullptr), skeleton_data(nullptr), index(0), container(nullptr), updating(false) { +SpineEditorPropertyAnimationMix::SpineEditorPropertyAnimationMix() + : mixes_property(nullptr), skeleton_data(nullptr), index(0), container(nullptr), updating(false) { } -void SpineEditorPropertyAnimationMix::setup(SpineEditorPropertyAnimationMixes *_mixes_property, const Ref &_skeleton_data, int _index) { +void SpineEditorPropertyAnimationMix::setup(SpineEditorPropertyAnimationMixes *_mixes_property, const Ref &_skeleton_data, + int _index) { this->mixes_property = _mixes_property; this->skeleton_data = _skeleton_data; this->index = _index; diff --git a/spine-godot/spine_godot/SpineEditorPlugin.h b/spine-godot/spine_godot/SpineEditorPlugin.h index e6964ee62..d84f8ff99 100644 --- a/spine-godot/spine_godot/SpineEditorPlugin.h +++ b/spine-godot/spine_godot/SpineEditorPlugin.h @@ -53,11 +53,15 @@ class SpineAtlasResourceImportPlugin : public EditorImportPlugin { public: #ifdef SPINE_GODOT_EXTENSION - static void _bind_methods(){}; + static void _bind_methods() {}; - String _get_importer_name() const override { return "spine.atlas"; } + String _get_importer_name() const override { + return "spine.atlas"; + } - String _get_visible_name() const override { return "Spine Runtime Atlas"; } + String _get_visible_name() const override { + return "Spine Runtime Atlas"; + } PackedStringArray _get_recognized_extensions() const override { PackedStringArray extensions; @@ -65,60 +69,100 @@ public: return extensions; } - String _get_preset_name(int idx) const override { return idx == 0 ? "Default" : "Unknown"; } + String _get_preset_name(int idx) const override { + return idx == 0 ? "Default" : "Unknown"; + } - int _get_preset_count() const override { return 1; } + int _get_preset_count() const override { + return 1; + } - String _get_save_extension() const override { return "spatlas"; } + String _get_save_extension() const override { + return "spatlas"; + } - String _get_resource_type() const override { return "SpineAtlasResource"; } + String _get_resource_type() const override { + return "SpineAtlasResource"; + } #else - String get_importer_name() const override { return "spine.atlas"; } + String get_importer_name() const override { + return "spine.atlas"; + } - String get_visible_name() const override { return "Spine Runtime Atlas"; } + String get_visible_name() const override { + return "Spine Runtime Atlas"; + } - void get_recognized_extensions(List *extensions) const override { extensions->push_back("atlas"); } + void get_recognized_extensions(List *extensions) const override { + extensions->push_back("atlas"); + } - String get_preset_name(int idx) const override { return idx == 0 ? "Default" : "Unknown"; } + String get_preset_name(int idx) const override { + return idx == 0 ? "Default" : "Unknown"; + } - int get_preset_count() const override { return 1; } + int get_preset_count() const override { + return 1; + } - String get_save_extension() const override { return "spatlas"; } + String get_save_extension() const override { + return "spatlas"; + } - String get_resource_type() const override { return "SpineAtlasResource"; } + String get_resource_type() const override { + return "SpineAtlasResource"; + } #endif #if VERSION_MAJOR > 3 #ifdef SPINE_GODOT_EXTENSION - virtual int _get_import_order() const override { return IMPORT_ORDER_DEFAULT; } + virtual int _get_import_order() const override { + return IMPORT_ORDER_DEFAULT; + } - virtual float _get_priority() const override { return 1; } + virtual float _get_priority() const override { + return 1; + } TypedArray _get_import_options(const String &p_path, int32_t p_preset_index) const override; - virtual bool _get_option_visibility(const String &p_path, const StringName &p_option_name, const Dictionary &p_options) const override { return true; }; + virtual bool _get_option_visibility(const String &p_path, const StringName &p_option_name, const Dictionary &p_options) const override { + return true; + }; - virtual Error _import(const String &p_source_file, const String &p_save_path, const Dictionary &p_options, const TypedArray &p_platform_variants, const TypedArray &p_gen_files) const override; + virtual Error _import(const String &p_source_file, const String &p_save_path, const Dictionary &p_options, + const TypedArray &p_platform_variants, const TypedArray &p_gen_files) const override; #else - int get_import_order() const override { return IMPORT_ORDER_DEFAULT; } + int get_import_order() const override { + return IMPORT_ORDER_DEFAULT; + } - float get_priority() const override { return 1; } + float get_priority() const override { + return 1; + } void get_import_options(const String &path, List *options, int preset) const override; - virtual bool get_option_visibility(const String &path, const String &option, const HashMap &options) const override { return true; } + virtual bool get_option_visibility(const String &path, const String &option, const HashMap &options) const override { + return true; + } #if VERSION_MINOR > 3 - Error import(ResourceUID::ID p_source_id, const String &source_file, const String &save_path, const HashMap &options, List *r_platform_variants, List *r_gen_files, Variant *r_metadata = nullptr) override; + Error import(ResourceUID::ID p_source_id, const String &source_file, const String &save_path, const HashMap &options, + List *r_platform_variants, List *r_gen_files, Variant *r_metadata = nullptr) override; #else - Error import(const String &source_file, const String &save_path, const HashMap &options, List *platform_variants, List *gen_files, Variant *metadata) override; + Error import(const String &source_file, const String &save_path, const HashMap &options, List *platform_variants, + List *gen_files, Variant *metadata) override; #endif #endif #else void get_import_options(List *options, int preset) const override; - bool get_option_visibility(const String &option, const Map &options) const override { return true; } + bool get_option_visibility(const String &option, const Map &options) const override { + return true; + } - Error import(const String &source_file, const String &save_path, const Map &options, List *platform_variants, List *gen_files, Variant *metadata) override; + Error import(const String &source_file, const String &save_path, const Map &options, List *platform_variants, + List *gen_files, Variant *metadata) override; #endif }; @@ -127,11 +171,15 @@ class SpineJsonResourceImportPlugin : public EditorImportPlugin { public: #ifdef SPINE_GODOT_EXTENSION - static void _bind_methods(){}; + static void _bind_methods() {}; - String _get_importer_name() const override { return "spine.json"; } + String _get_importer_name() const override { + return "spine.json"; + } - String _get_visible_name() const override { return "Spine Skeleton Json"; } + String _get_visible_name() const override { + return "Spine Skeleton Json"; + } PackedStringArray _get_recognized_extensions() const override { PackedStringArray extensions; @@ -139,64 +187,106 @@ public: return extensions; } - String _get_preset_name(int idx) const override { return idx == 0 ? "Default" : "Unknown"; } + String _get_preset_name(int idx) const override { + return idx == 0 ? "Default" : "Unknown"; + } - int _get_preset_count() const override { return 1; } + int _get_preset_count() const override { + return 1; + } - String _get_save_extension() const override { return "spjson"; } + String _get_save_extension() const override { + return "spjson"; + } - String _get_resource_type() const override { return "SpineSkeletonFileResource"; } + String _get_resource_type() const override { + return "SpineSkeletonFileResource"; + } #else - String get_importer_name() const override { return "spine.json"; } + String get_importer_name() const override { + return "spine.json"; + } - String get_visible_name() const override { return "Spine Skeleton Json"; } + String get_visible_name() const override { + return "Spine Skeleton Json"; + } - void get_recognized_extensions(List *extensions) const override { extensions->push_back("spine-json"); } + void get_recognized_extensions(List *extensions) const override { + extensions->push_back("spine-json"); + } - String get_preset_name(int idx) const override { return idx == 0 ? "Default" : "Unknown"; } + String get_preset_name(int idx) const override { + return idx == 0 ? "Default" : "Unknown"; + } - int get_preset_count() const override { return 1; } + int get_preset_count() const override { + return 1; + } - String get_save_extension() const override { return "spjson"; } + String get_save_extension() const override { + return "spjson"; + } - String get_resource_type() const override { return "SpineSkeletonFileResource"; } + String get_resource_type() const override { + return "SpineSkeletonFileResource"; + } #endif #if VERSION_MAJOR > 3 #ifdef SPINE_GODOT_EXTENSION - int _get_import_order() const override { return IMPORT_ORDER_DEFAULT; } + int _get_import_order() const override { + return IMPORT_ORDER_DEFAULT; + } - float _get_priority() const override { return 1; } + float _get_priority() const override { + return 1; + } TypedArray _get_import_options(const String &p_path, int32_t p_preset_index) const override { TypedArray options; return options; } - virtual bool _get_option_visibility(const String &p_path, const StringName &p_option_name, const Dictionary &p_options) const override { return true; }; + virtual bool _get_option_visibility(const String &p_path, const StringName &p_option_name, const Dictionary &p_options) const override { + return true; + }; - virtual Error _import(const String &p_source_file, const String &p_save_path, const Dictionary &p_options, const TypedArray &p_platform_variants, const TypedArray &p_gen_files) const override; + virtual Error _import(const String &p_source_file, const String &p_save_path, const Dictionary &p_options, + const TypedArray &p_platform_variants, const TypedArray &p_gen_files) const override; #else - int get_import_order() const override { return IMPORT_ORDER_DEFAULT; } + int get_import_order() const override { + return IMPORT_ORDER_DEFAULT; + } - float get_priority() const override { return 1; } + float get_priority() const override { + return 1; + } - void get_import_options(const String &path, List *options, int preset) const override {} + void get_import_options(const String &path, List *options, int preset) const override { + } - bool get_option_visibility(const String &path, const String &option, const HashMap &options) const override { return true; } + bool get_option_visibility(const String &path, const String &option, const HashMap &options) const override { + return true; + } #if VERSION_MINOR > 3 - Error import(ResourceUID::ID p_source_id, const String &p_source_file, const String &p_save_path, const HashMap &p_options, List *r_platform_variants, List *r_gen_files, Variant *r_metadata = nullptr) override; + Error import(ResourceUID::ID p_source_id, const String &p_source_file, const String &p_save_path, const HashMap &p_options, + List *r_platform_variants, List *r_gen_files, Variant *r_metadata = nullptr) override; #else - Error import(const String &source_file, const String &save_path, const HashMap &options, List *platform_variants, List *gen_files, Variant *metadata) override; + Error import(const String &source_file, const String &save_path, const HashMap &options, List *platform_variants, + List *gen_files, Variant *metadata) override; #endif #endif #else - void get_import_options(List *options, int preset) const override {} + void get_import_options(List *options, int preset) const override { + } - bool get_option_visibility(const String &option, const Map &options) const override { return true; } + bool get_option_visibility(const String &option, const Map &options) const override { + return true; + } - Error import(const String &source_file, const String &save_path, const Map &options, List *platform_variants, List *gen_files, Variant *metadata) override; + Error import(const String &source_file, const String &save_path, const Map &options, List *platform_variants, + List *gen_files, Variant *metadata) override; #endif }; @@ -205,11 +295,15 @@ class SpineBinaryResourceImportPlugin : public EditorImportPlugin { public: #ifdef SPINE_GODOT_EXTENSION - static void _bind_methods(){}; + static void _bind_methods() {}; - String _get_importer_name() const override { return "spine.skel"; } + String _get_importer_name() const override { + return "spine.skel"; + } - String _get_visible_name() const override { return "Spine Skeleton Binary"; } + String _get_visible_name() const override { + return "Spine Skeleton Binary"; + } PackedStringArray _get_recognized_extensions() const override { PackedStringArray extensions; @@ -217,83 +311,132 @@ public: return extensions; } - String _get_preset_name(int idx) const override { return idx == 0 ? "Default" : "Unknown"; } + String _get_preset_name(int idx) const override { + return idx == 0 ? "Default" : "Unknown"; + } - int _get_preset_count() const override { return 1; } + int _get_preset_count() const override { + return 1; + } - String _get_save_extension() const override { return "spskel"; } + String _get_save_extension() const override { + return "spskel"; + } - String _get_resource_type() const override { return "SpineSkeletonFileResource"; } + String _get_resource_type() const override { + return "SpineSkeletonFileResource"; + } #else - String get_importer_name() const override { return "spine.skel"; } + String get_importer_name() const override { + return "spine.skel"; + } - String get_visible_name() const override { return "Spine Skeleton Binary"; } + String get_visible_name() const override { + return "Spine Skeleton Binary"; + } - void get_recognized_extensions(List *extensions) const override { extensions->push_back("skel"); } + void get_recognized_extensions(List *extensions) const override { + extensions->push_back("skel"); + } - String get_preset_name(int idx) const override { return idx == 0 ? "Default" : "Unknown"; } + String get_preset_name(int idx) const override { + return idx == 0 ? "Default" : "Unknown"; + } - int get_preset_count() const override { return 1; } + int get_preset_count() const override { + return 1; + } - String get_save_extension() const override { return "spskel"; } + String get_save_extension() const override { + return "spskel"; + } - String get_resource_type() const override { return "SpineSkeletonFileResource"; } + String get_resource_type() const override { + return "SpineSkeletonFileResource"; + } #endif #if VERSION_MAJOR > 3 #ifdef SPINE_GODOT_EXTENSION - int _get_import_order() const override { return IMPORT_ORDER_DEFAULT; } + int _get_import_order() const override { + return IMPORT_ORDER_DEFAULT; + } - float _get_priority() const override { return 1; } + float _get_priority() const override { + return 1; + } TypedArray _get_import_options(const String &p_path, int32_t p_preset_index) const override { TypedArray options; return options; } - virtual bool _get_option_visibility(const String &p_path, const StringName &p_option_name, const Dictionary &p_options) const override { return true; }; + virtual bool _get_option_visibility(const String &p_path, const StringName &p_option_name, const Dictionary &p_options) const override { + return true; + }; - virtual Error _import(const String &p_source_file, const String &p_save_path, const Dictionary &p_options, const TypedArray &p_platform_variants, const TypedArray &p_gen_files) const override; + virtual Error _import(const String &p_source_file, const String &p_save_path, const Dictionary &p_options, + const TypedArray &p_platform_variants, const TypedArray &p_gen_files) const override; #else - int get_import_order() const override { return IMPORT_ORDER_DEFAULT; } + int get_import_order() const override { + return IMPORT_ORDER_DEFAULT; + } - float get_priority() const override { return 1; } + float get_priority() const override { + return 1; + } - void get_import_options(const String &path, List *options, int preset) const override {} + void get_import_options(const String &path, List *options, int preset) const override { + } - bool get_option_visibility(const String &path, const String &option, const HashMap &options) const override { return true; } + bool get_option_visibility(const String &path, const String &option, const HashMap &options) const override { + return true; + } #if VERSION_MINOR > 3 - Error import(ResourceUID::ID p_source_id, const String &p_source_file, const String &p_save_path, const HashMap &p_options, List *r_platform_variants, List *r_gen_files, Variant *r_metadata = nullptr) override; + Error import(ResourceUID::ID p_source_id, const String &p_source_file, const String &p_save_path, const HashMap &p_options, + List *r_platform_variants, List *r_gen_files, Variant *r_metadata = nullptr) override; #else - Error import(const String &source_file, const String &save_path, const HashMap &options, List *platform_variants, List *gen_files, Variant *metadata) override; + Error import(const String &source_file, const String &save_path, const HashMap &options, List *platform_variants, + List *gen_files, Variant *metadata) override; #endif #endif #else - void get_import_options(List *options, int preset) const override {} + void get_import_options(List *options, int preset) const override { + } - bool get_option_visibility(const String &option, const Map &options) const override { return true; } + bool get_option_visibility(const String &option, const Map &options) const override { + return true; + } - Error import(const String &source_file, const String &save_path, const Map &options, List *platform_variants, List *gen_files, Variant *metadata) override; + Error import(const String &source_file, const String &save_path, const Map &options, List *platform_variants, + List *gen_files, Variant *metadata) override; #endif }; class SpineEditorPlugin : public EditorPlugin { GDCLASS(SpineEditorPlugin, EditorPlugin) - static void _bind_methods() {} + static void _bind_methods() { + } public: #ifdef SPINE_GODOT_EXTENSION explicit SpineEditorPlugin(); - String _get_plugin_name() const override { return "SpineEditorPlugin"; } + String _get_plugin_name() const override { + return "SpineEditorPlugin"; + } #else explicit SpineEditorPlugin(EditorNode *node); #if VERSION_MAJOR > 3 && VERSION_MINOR > 3 - String get_plugin_name() const override { return "SpineEditorPlugin"; } + String get_plugin_name() const override { + return "SpineEditorPlugin"; + } #else - String get_name() const override { return "SpineEditorPlugin"; } + String get_name() const override { + return "SpineEditorPlugin"; + } #endif #endif }; @@ -303,14 +446,17 @@ class SpineSkeletonDataResourceInspectorPlugin : public EditorInspectorPlugin { public: #ifdef SPINE_GODOT_EXTENSION - static void _bind_methods() {} + static void _bind_methods() { + } bool _can_handle(Object *p_object) const override; - bool _parse_property(Object *object, Variant::Type type, const String &path, PropertyHint hint, const String &hint_text, const BitField p_usage, bool wide) override; + bool _parse_property(Object *object, Variant::Type type, const String &path, PropertyHint hint, const String &hint_text, + const BitField p_usage, bool wide) override; #else bool can_handle(Object *object) override; #if VERSION_MAJOR > 3 - bool parse_property(Object *object, Variant::Type type, const String &path, PropertyHint hint, const String &hint_text, const BitField p_usage, bool wide) override; + bool parse_property(Object *object, Variant::Type type, const String &path, PropertyHint hint, const String &hint_text, + const BitField p_usage, bool wide) override; #else bool parse_property(Object *object, Variant::Type type, const String &path, PropertyHint hint, const String &hint_text, int usage) override; #endif @@ -336,7 +482,9 @@ class SpineEditorPropertyAnimationMixes : public EditorProperty { public: SpineEditorPropertyAnimationMixes(); - void setup(const Ref &_skeleton_data) { this->skeleton_data = _skeleton_data; }; + void setup(const Ref &_skeleton_data) { + this->skeleton_data = _skeleton_data; + }; void update_property() override; }; diff --git a/spine-godot/spine_godot/SpineIkConstraintData.h b/spine-godot/spine_godot/SpineIkConstraintData.h index 0e6ef9ed3..85e50b537 100644 --- a/spine-godot/spine_godot/SpineIkConstraintData.h +++ b/spine-godot/spine_godot/SpineIkConstraintData.h @@ -36,7 +36,9 @@ class SpineIkConstraintData : public SpineConstraintData { GDCLASS(SpineIkConstraintData, SpineConstraintData) - spine::IkConstraintData *get_spine_constraint_data() { return (spine::IkConstraintData *) get_spine_object(); } + spine::IkConstraintData *get_spine_constraint_data() { + return (spine::IkConstraintData *) get_spine_object(); + } protected: static void _bind_methods(); diff --git a/spine-godot/spine_godot/SpinePathConstraintData.h b/spine-godot/spine_godot/SpinePathConstraintData.h index b2e4fa7f1..67528d94e 100644 --- a/spine-godot/spine_godot/SpinePathConstraintData.h +++ b/spine-godot/spine_godot/SpinePathConstraintData.h @@ -38,7 +38,9 @@ class SpinePathConstraintData : public SpineConstraintData { GDCLASS(SpinePathConstraintData, SpineConstraintData) - spine::PathConstraintData *get_spine_constraint_data() { return (spine::PathConstraintData *) get_spine_object(); } + spine::PathConstraintData *get_spine_constraint_data() { + return (spine::PathConstraintData *) get_spine_object(); + } protected: static void _bind_methods(); diff --git a/spine-godot/spine_godot/SpinePhysicsConstraintData.h b/spine-godot/spine_godot/SpinePhysicsConstraintData.h index ffcd0b4c5..411b05481 100644 --- a/spine-godot/spine_godot/SpinePhysicsConstraintData.h +++ b/spine-godot/spine_godot/SpinePhysicsConstraintData.h @@ -36,7 +36,9 @@ class SpinePhysicsConstraintData : public SpineConstraintData { GDCLASS(SpinePhysicsConstraintData, SpineConstraintData) - spine::PhysicsConstraintData *get_spine_constraint_data() { return (spine::PhysicsConstraintData *) SpineConstraintData::get_spine_object(); } + spine::PhysicsConstraintData *get_spine_constraint_data() { + return (spine::PhysicsConstraintData *) SpineConstraintData::get_spine_object(); + } protected: static void _bind_methods(); diff --git a/spine-godot/spine_godot/SpineSkeleton.h b/spine-godot/spine_godot/SpineSkeleton.h index ff98aa364..c2634b99b 100644 --- a/spine-godot/spine_godot/SpineSkeleton.h +++ b/spine-godot/spine_godot/SpineSkeleton.h @@ -59,8 +59,12 @@ protected: static void _bind_methods(); void set_spine_sprite(SpineSprite *_sprite); - spine::Skeleton *get_spine_object() { return skeleton; } - SpineSprite *get_spine_owner() { return sprite; } + spine::Skeleton *get_spine_object() { + return skeleton; + } + SpineSprite *get_spine_owner() { + return sprite; + } Ref get_skeleton_data_res() const; private: diff --git a/spine-godot/spine_godot/SpineSkeletonDataResource.cpp b/spine-godot/spine_godot/SpineSkeletonDataResource.cpp index 83ef759f3..27da97b71 100644 --- a/spine-godot/spine_godot/SpineSkeletonDataResource.cpp +++ b/spine-godot/spine_godot/SpineSkeletonDataResource.cpp @@ -53,8 +53,7 @@ #endif void SpineAnimationMix::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_from", "from"), - &SpineAnimationMix::set_from); + ClassDB::bind_method(D_METHOD("set_from", "from"), &SpineAnimationMix::set_from); ClassDB::bind_method(D_METHOD("get_from"), &SpineAnimationMix::get_from); ClassDB::bind_method(D_METHOD("set_to", "to"), &SpineAnimationMix::set_to); ClassDB::bind_method(D_METHOD("get_to"), &SpineAnimationMix::get_to); @@ -70,135 +69,98 @@ void SpineAnimationMix::_bind_methods() { #endif } -SpineAnimationMix::SpineAnimationMix() : from(""), to(""), mix(0) {} +SpineAnimationMix::SpineAnimationMix() : from(""), to(""), mix(0) { +} -void SpineAnimationMix::set_from(const String &_from) { this->from = _from; } +void SpineAnimationMix::set_from(const String &_from) { + this->from = _from; +} -String SpineAnimationMix::get_from() { return from; } +String SpineAnimationMix::get_from() { + return from; +} -void SpineAnimationMix::set_to(const String &_to) { this->to = _to; } +void SpineAnimationMix::set_to(const String &_to) { + this->to = _to; +} -String SpineAnimationMix::get_to() { return to; } +String SpineAnimationMix::get_to() { + return to; +} -void SpineAnimationMix::set_mix(float _mix) { this->mix = _mix; } +void SpineAnimationMix::set_mix(float _mix) { + this->mix = _mix; +} -float SpineAnimationMix::get_mix() { return mix; } +float SpineAnimationMix::get_mix() { + return mix; +} void SpineSkeletonDataResource::_bind_methods() { - ClassDB::bind_method(D_METHOD("is_skeleton_data_loaded"), - &SpineSkeletonDataResource::is_skeleton_data_loaded); - ClassDB::bind_method(D_METHOD("set_atlas_res", "atlas_res"), - &SpineSkeletonDataResource::set_atlas_res); - ClassDB::bind_method(D_METHOD("get_atlas_res"), - &SpineSkeletonDataResource::get_atlas_res); - ClassDB::bind_method(D_METHOD("set_skeleton_file_res", "skeleton_file_res"), - &SpineSkeletonDataResource::set_skeleton_file_res); - ClassDB::bind_method(D_METHOD("get_skeleton_file_res"), - &SpineSkeletonDataResource::get_skeleton_file_res); - ClassDB::bind_method(D_METHOD("set_default_mix", "default_mix"), - &SpineSkeletonDataResource::set_default_mix); - ClassDB::bind_method(D_METHOD("get_default_mix"), - &SpineSkeletonDataResource::get_default_mix); - ClassDB::bind_method(D_METHOD("set_animation_mixes", "mixes"), - &SpineSkeletonDataResource::set_animation_mixes); - ClassDB::bind_method(D_METHOD("get_animation_mixes"), - &SpineSkeletonDataResource::get_animation_mixes); + ClassDB::bind_method(D_METHOD("is_skeleton_data_loaded"), &SpineSkeletonDataResource::is_skeleton_data_loaded); + ClassDB::bind_method(D_METHOD("set_atlas_res", "atlas_res"), &SpineSkeletonDataResource::set_atlas_res); + ClassDB::bind_method(D_METHOD("get_atlas_res"), &SpineSkeletonDataResource::get_atlas_res); + ClassDB::bind_method(D_METHOD("set_skeleton_file_res", "skeleton_file_res"), &SpineSkeletonDataResource::set_skeleton_file_res); + ClassDB::bind_method(D_METHOD("get_skeleton_file_res"), &SpineSkeletonDataResource::get_skeleton_file_res); + ClassDB::bind_method(D_METHOD("set_default_mix", "default_mix"), &SpineSkeletonDataResource::set_default_mix); + ClassDB::bind_method(D_METHOD("get_default_mix"), &SpineSkeletonDataResource::get_default_mix); + ClassDB::bind_method(D_METHOD("set_animation_mixes", "mixes"), &SpineSkeletonDataResource::set_animation_mixes); + ClassDB::bind_method(D_METHOD("get_animation_mixes"), &SpineSkeletonDataResource::get_animation_mixes); // Spine API - ClassDB::bind_method(D_METHOD("find_bone", "bone_name"), - &SpineSkeletonDataResource::find_bone); - ClassDB::bind_method(D_METHOD("find_slot", "slot_name"), - &SpineSkeletonDataResource::find_slot); - ClassDB::bind_method(D_METHOD("find_skin", "skin_name"), - &SpineSkeletonDataResource::find_skin); - ClassDB::bind_method(D_METHOD("find_event", "event_data_name"), - &SpineSkeletonDataResource::find_event); - ClassDB::bind_method(D_METHOD("find_animation", "animation_name"), - &SpineSkeletonDataResource::find_animation); - ClassDB::bind_method(D_METHOD("find_ik_constraint_data", "constraint_name"), - &SpineSkeletonDataResource::find_ik_constraint); - ClassDB::bind_method( - D_METHOD("find_transform_constraint_data", "constraint_name"), - &SpineSkeletonDataResource::find_transform_constraint); - ClassDB::bind_method(D_METHOD("find_path_constraint_data", "constraint_name"), - &SpineSkeletonDataResource::find_path_constraint); - ClassDB::bind_method(D_METHOD("find_physics_constraint_data", "constraint_name"), - &SpineSkeletonDataResource::find_physics_constraint); - ClassDB::bind_method(D_METHOD("get_skeleton_name"), - &SpineSkeletonDataResource::get_skeleton_name); - ClassDB::bind_method(D_METHOD("get_bones"), - &SpineSkeletonDataResource::get_bones); - ClassDB::bind_method(D_METHOD("get_slots"), - &SpineSkeletonDataResource::get_slots); - ClassDB::bind_method(D_METHOD("get_skins"), - &SpineSkeletonDataResource::get_skins); - ClassDB::bind_method(D_METHOD("get_default_skin"), - &SpineSkeletonDataResource::get_default_skin); - ClassDB::bind_method(D_METHOD("set_default_skin", "skin"), - &SpineSkeletonDataResource::set_default_skin); - ClassDB::bind_method(D_METHOD("get_events"), - &SpineSkeletonDataResource::get_events); - ClassDB::bind_method(D_METHOD("get_animations"), - &SpineSkeletonDataResource::get_animations); - ClassDB::bind_method(D_METHOD("get_ik_constraints"), - &SpineSkeletonDataResource::get_ik_constraints); - ClassDB::bind_method(D_METHOD("get_transform_constraints"), - &SpineSkeletonDataResource::get_transform_constraints); - ClassDB::bind_method(D_METHOD("get_path_constraints"), - &SpineSkeletonDataResource::get_path_constraints); - ClassDB::bind_method(D_METHOD("get_physics_constraints"), - &SpineSkeletonDataResource::get_physics_constraints); + ClassDB::bind_method(D_METHOD("find_bone", "bone_name"), &SpineSkeletonDataResource::find_bone); + ClassDB::bind_method(D_METHOD("find_slot", "slot_name"), &SpineSkeletonDataResource::find_slot); + ClassDB::bind_method(D_METHOD("find_skin", "skin_name"), &SpineSkeletonDataResource::find_skin); + ClassDB::bind_method(D_METHOD("find_event", "event_data_name"), &SpineSkeletonDataResource::find_event); + ClassDB::bind_method(D_METHOD("find_animation", "animation_name"), &SpineSkeletonDataResource::find_animation); + ClassDB::bind_method(D_METHOD("find_ik_constraint_data", "constraint_name"), &SpineSkeletonDataResource::find_ik_constraint); + ClassDB::bind_method(D_METHOD("find_transform_constraint_data", "constraint_name"), &SpineSkeletonDataResource::find_transform_constraint); + ClassDB::bind_method(D_METHOD("find_path_constraint_data", "constraint_name"), &SpineSkeletonDataResource::find_path_constraint); + ClassDB::bind_method(D_METHOD("find_physics_constraint_data", "constraint_name"), &SpineSkeletonDataResource::find_physics_constraint); + ClassDB::bind_method(D_METHOD("get_skeleton_name"), &SpineSkeletonDataResource::get_skeleton_name); + ClassDB::bind_method(D_METHOD("get_bones"), &SpineSkeletonDataResource::get_bones); + ClassDB::bind_method(D_METHOD("get_slots"), &SpineSkeletonDataResource::get_slots); + ClassDB::bind_method(D_METHOD("get_skins"), &SpineSkeletonDataResource::get_skins); + ClassDB::bind_method(D_METHOD("get_default_skin"), &SpineSkeletonDataResource::get_default_skin); + ClassDB::bind_method(D_METHOD("set_default_skin", "skin"), &SpineSkeletonDataResource::set_default_skin); + ClassDB::bind_method(D_METHOD("get_events"), &SpineSkeletonDataResource::get_events); + ClassDB::bind_method(D_METHOD("get_animations"), &SpineSkeletonDataResource::get_animations); + ClassDB::bind_method(D_METHOD("get_ik_constraints"), &SpineSkeletonDataResource::get_ik_constraints); + ClassDB::bind_method(D_METHOD("get_transform_constraints"), &SpineSkeletonDataResource::get_transform_constraints); + ClassDB::bind_method(D_METHOD("get_path_constraints"), &SpineSkeletonDataResource::get_path_constraints); + ClassDB::bind_method(D_METHOD("get_physics_constraints"), &SpineSkeletonDataResource::get_physics_constraints); ClassDB::bind_method(D_METHOD("get_x"), &SpineSkeletonDataResource::get_x); ClassDB::bind_method(D_METHOD("get_y"), &SpineSkeletonDataResource::get_y); - ClassDB::bind_method(D_METHOD("get_width"), - &SpineSkeletonDataResource::get_width); - ClassDB::bind_method(D_METHOD("get_height"), - &SpineSkeletonDataResource::get_height); - ClassDB::bind_method(D_METHOD("get_version"), - &SpineSkeletonDataResource::get_version); - ClassDB::bind_method(D_METHOD("get_hash"), - &SpineSkeletonDataResource::get_hash); - ClassDB::bind_method(D_METHOD("get_images_path"), - &SpineSkeletonDataResource::get_images_path); - ClassDB::bind_method(D_METHOD("get_audio_path"), - &SpineSkeletonDataResource::get_audio_path); - ClassDB::bind_method(D_METHOD("get_fps"), - &SpineSkeletonDataResource::get_fps); - ClassDB::bind_method(D_METHOD("get_reference_scale"), - &SpineSkeletonDataResource::get_reference_scale); - ClassDB::bind_method(D_METHOD("set_reference_scale", "reference_scale"), - &SpineSkeletonDataResource::set_reference_scale); - ClassDB::bind_method(D_METHOD("update_skeleton_data"), - &SpineSkeletonDataResource::update_skeleton_data); + ClassDB::bind_method(D_METHOD("get_width"), &SpineSkeletonDataResource::get_width); + ClassDB::bind_method(D_METHOD("get_height"), &SpineSkeletonDataResource::get_height); + ClassDB::bind_method(D_METHOD("get_version"), &SpineSkeletonDataResource::get_version); + ClassDB::bind_method(D_METHOD("get_hash"), &SpineSkeletonDataResource::get_hash); + ClassDB::bind_method(D_METHOD("get_images_path"), &SpineSkeletonDataResource::get_images_path); + ClassDB::bind_method(D_METHOD("get_audio_path"), &SpineSkeletonDataResource::get_audio_path); + ClassDB::bind_method(D_METHOD("get_fps"), &SpineSkeletonDataResource::get_fps); + ClassDB::bind_method(D_METHOD("get_reference_scale"), &SpineSkeletonDataResource::get_reference_scale); + ClassDB::bind_method(D_METHOD("set_reference_scale", "reference_scale"), &SpineSkeletonDataResource::set_reference_scale); + ClassDB::bind_method(D_METHOD("update_skeleton_data"), &SpineSkeletonDataResource::update_skeleton_data); ADD_SIGNAL(MethodInfo("skeleton_data_changed")); ADD_SIGNAL(MethodInfo("_internal_spine_objects_invalidated")); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "atlas_res", - PropertyHint::PROPERTY_HINT_RESOURCE_TYPE, - "SpineAtlasResource"), - "set_atlas_res", "get_atlas_res"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "skeleton_file_res", - PropertyHint::PROPERTY_HINT_RESOURCE_TYPE, - "SpineSkeletonFileResource"), + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "atlas_res", PropertyHint::PROPERTY_HINT_RESOURCE_TYPE, "SpineAtlasResource"), "set_atlas_res", + "get_atlas_res"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "skeleton_file_res", PropertyHint::PROPERTY_HINT_RESOURCE_TYPE, "SpineSkeletonFileResource"), "set_skeleton_file_res", "get_skeleton_file_res"); #if VERSION_MAJOR > 3 - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "default_mix"), "set_default_mix", - "get_default_mix"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "default_mix"), "set_default_mix", "get_default_mix"); #else - ADD_PROPERTY(PropertyInfo(Variant::REAL, "default_mix"), "set_default_mix", - "get_default_mix"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "default_mix"), "set_default_mix", "get_default_mix"); #endif - ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "animation_mixes"), - "set_animation_mixes", "get_animation_mixes"); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "animation_mixes"), "set_animation_mixes", "get_animation_mixes"); #ifdef TOOLS_ENABLED #if VERSION_MAJOR > 3 - ClassDB::bind_method(D_METHOD("_on_resources_reimported", "resources"), - &SpineSkeletonDataResource::_on_resources_reimported); + ClassDB::bind_method(D_METHOD("_on_resources_reimported", "resources"), &SpineSkeletonDataResource::_on_resources_reimported); #else - ClassDB::bind_method(D_METHOD("_on_resources_reimported", "resources"), - &SpineSkeletonDataResource::_on_resources_reimported); + ClassDB::bind_method(D_METHOD("_on_resources_reimported", "resources"), &SpineSkeletonDataResource::_on_resources_reimported); #endif #endif } @@ -217,8 +179,7 @@ EditorFileSystem *get_editor_file_system() { } #endif -SpineSkeletonDataResource::SpineSkeletonDataResource() - : default_mix(0), skeleton_data(nullptr), animation_state_data(nullptr) { +SpineSkeletonDataResource::SpineSkeletonDataResource() : default_mix(0), skeleton_data(nullptr), animation_state_data(nullptr) { #ifdef TOOLS_ENABLED #if VERSION_MAJOR > 3 @@ -311,8 +272,7 @@ void SpineSkeletonDataResource::update_skeleton_data() { emit_signal(SNAME("_internal_spine_objects_invalidated")); if (atlas_res.is_valid() && skeleton_file_res.is_valid()) { - load_resources(atlas_res->get_spine_atlas(), skeleton_file_res->get_json(), - skeleton_file_res->get_binary()); + load_resources(atlas_res->get_spine_atlas(), skeleton_file_res->get_json(), skeleton_file_res->get_binary()); } emit_signal(SNAME("skeleton_data_changed")); #ifdef TOOLS_ENABLED @@ -321,16 +281,11 @@ void SpineSkeletonDataResource::update_skeleton_data() { } #ifdef SPINE_GODOT_EXTENSION -void SpineSkeletonDataResource::load_resources(spine::Atlas *atlas, - const String &json, - const PackedByteArray &binary) { +void SpineSkeletonDataResource::load_resources(spine::Atlas *atlas, const String &json, const PackedByteArray &binary) { #else -void SpineSkeletonDataResource::load_resources(spine::Atlas *atlas, - const String &json, - const Vector &binary) { +void SpineSkeletonDataResource::load_resources(spine::Atlas *atlas, const String &json, const Vector &binary) { #endif - if ((EMPTY(json) && EMPTY(binary)) || atlas == nullptr) - return; + if ((EMPTY(json) && EMPTY(binary)) || atlas == nullptr) return; spine::SkeletonData *data; if (!EMPTY(json)) { @@ -359,8 +314,7 @@ bool SpineSkeletonDataResource::is_skeleton_data_loaded() const { return skeleton_data != nullptr; } -void SpineSkeletonDataResource::set_atlas_res( - const Ref &atlas) { +void SpineSkeletonDataResource::set_atlas_res(const Ref &atlas) { atlas_res = atlas; update_skeleton_data(); } @@ -369,14 +323,12 @@ Ref SpineSkeletonDataResource::get_atlas_res() { return atlas_res; } -void SpineSkeletonDataResource::set_skeleton_file_res( - const Ref &skeleton_file) { +void SpineSkeletonDataResource::set_skeleton_file_res(const Ref &skeleton_file) { skeleton_file_res = skeleton_file; update_skeleton_data(); } -Ref -SpineSkeletonDataResource::get_skeleton_file_res() { +Ref SpineSkeletonDataResource::get_skeleton_file_res() { return skeleton_file_res; } @@ -386,8 +338,7 @@ void SpineSkeletonDataResource::get_animation_names(PackedStringArray &animation void SpineSkeletonDataResource::get_animation_names(Vector &animation_names) const { #endif animation_names.clear(); - if (!is_skeleton_data_loaded()) - return; + if (!is_skeleton_data_loaded()) return; auto animations = skeleton_data->getAnimations(); for (size_t i = 0; i < animations.size(); ++i) { auto animation = animations[i]; @@ -403,8 +354,7 @@ void SpineSkeletonDataResource::get_skin_names(PackedStringArray &skin_names) co void SpineSkeletonDataResource::get_skin_names(Vector &skin_names) const { #endif skin_names.clear(); - if (!is_skeleton_data_loaded()) - return; + if (!is_skeleton_data_loaded()) return; auto skins = skeleton_data->getSkins(); for (size_t i = 0; i < skins.size(); ++i) { auto skin = skins[i]; @@ -420,8 +370,7 @@ void SpineSkeletonDataResource::get_slot_names(PackedStringArray &slot_names) { void SpineSkeletonDataResource::get_slot_names(Vector &slot_names) { #endif slot_names.clear(); - if (!is_skeleton_data_loaded()) - return; + if (!is_skeleton_data_loaded()) return; auto slots = skeleton_data->getSlots(); for (size_t i = 0; i < slots.size(); ++i) { auto slot = slots[i]; @@ -437,8 +386,7 @@ void SpineSkeletonDataResource::get_bone_names(PackedStringArray &bone_names) { void SpineSkeletonDataResource::get_bone_names(Vector &bone_names) { #endif bone_names.clear(); - if (!is_skeleton_data_loaded()) - return; + if (!is_skeleton_data_loaded()) return; auto bones = skeleton_data->getBones(); for (size_t i = 0; i < bones.size(); ++i) { auto bone = bones[i]; @@ -453,7 +401,9 @@ void SpineSkeletonDataResource::set_default_mix(float _default_mix) { update_mixes(); } -float SpineSkeletonDataResource::get_default_mix() { return default_mix; } +float SpineSkeletonDataResource::get_default_mix() { + return default_mix; +} void SpineSkeletonDataResource::set_animation_mixes(Array _animation_mixes) { for (int i = 0; i < _animation_mixes.size(); i++) { @@ -473,16 +423,13 @@ Array SpineSkeletonDataResource::get_animation_mixes() { } void SpineSkeletonDataResource::update_mixes() { - if (!is_skeleton_data_loaded()) - return; + if (!is_skeleton_data_loaded()) return; animation_state_data->clear(); animation_state_data->setDefaultMix(default_mix); for (int i = 0; i < animation_mixes.size(); i++) { Ref mix = animation_mixes[i]; - spine::Animation *from = - skeleton_data->findAnimation(mix->get_from().utf8().ptr()); - spine::Animation *to = - skeleton_data->findAnimation(mix->get_to().utf8().ptr()); + spine::Animation *from = skeleton_data->findAnimation(mix->get_from().utf8().ptr()); + spine::Animation *to = skeleton_data->findAnimation(mix->get_to().utf8().ptr()); if (!from) { ERR_PRINT(vformat("Failed to set animation mix %s->%s. Animation %s does " "not exist in skeleton.", @@ -499,128 +446,92 @@ void SpineSkeletonDataResource::update_mixes() { } } -Ref -SpineSkeletonDataResource::find_animation(const String &animation_name) const { +Ref SpineSkeletonDataResource::find_animation(const String &animation_name) const { SPINE_CHECK(skeleton_data, nullptr) - if (EMPTY(animation_name)) - return nullptr; - auto animation = - skeleton_data->findAnimation(SPINE_STRING_TMP(animation_name)); - if (!animation) - return nullptr; + if (EMPTY(animation_name)) return nullptr; + auto animation = skeleton_data->findAnimation(SPINE_STRING_TMP(animation_name)); + if (!animation) return nullptr; Ref animation_ref(memnew(SpineAnimation)); animation_ref->set_spine_object(this, animation); return animation_ref; } -Ref -SpineSkeletonDataResource::find_bone(const String &bone_name) const { +Ref SpineSkeletonDataResource::find_bone(const String &bone_name) const { SPINE_CHECK(skeleton_data, nullptr) - if (EMPTY(bone_name)) - return nullptr; + if (EMPTY(bone_name)) return nullptr; auto bone = skeleton_data->findBone(SPINE_STRING_TMP(bone_name)); - if (!bone) - return nullptr; + if (!bone) return nullptr; Ref bone_ref(memnew(SpineBoneData)); bone_ref->set_spine_object(this, bone); return bone_ref; } -Ref -SpineSkeletonDataResource::find_slot(const String &slot_name) const { +Ref SpineSkeletonDataResource::find_slot(const String &slot_name) const { SPINE_CHECK(skeleton_data, nullptr) - if (EMPTY(slot_name)) - return nullptr; + if (EMPTY(slot_name)) return nullptr; auto slot = skeleton_data->findSlot(SPINE_STRING_TMP(slot_name)); - if (!slot) - return nullptr; + if (!slot) return nullptr; Ref slot_ref(memnew(SpineSlotData)); slot_ref->set_spine_object(this, slot); return slot_ref; } -Ref -SpineSkeletonDataResource::find_skin(const String &skin_name) const { +Ref SpineSkeletonDataResource::find_skin(const String &skin_name) const { SPINE_CHECK(skeleton_data, nullptr) - if (EMPTY(skin_name)) - return nullptr; + if (EMPTY(skin_name)) return nullptr; auto skin = skeleton_data->findSkin(SPINE_STRING_TMP(skin_name)); - if (!skin) - return nullptr; + if (!skin) return nullptr; Ref skin_ref(memnew(SpineSkin)); skin_ref->set_spine_object(this, skin); return skin_ref; } -Ref -SpineSkeletonDataResource::find_event(const String &event_data_name) const { +Ref SpineSkeletonDataResource::find_event(const String &event_data_name) const { SPINE_CHECK(skeleton_data, nullptr) - if (EMPTY(event_data_name)) - return nullptr; + if (EMPTY(event_data_name)) return nullptr; auto event = skeleton_data->findEvent(SPINE_STRING_TMP(event_data_name)); - if (!event) - return nullptr; + if (!event) return nullptr; Ref event_ref(memnew(SpineEventData)); event_ref->set_spine_object(this, event); return event_ref; } -Ref SpineSkeletonDataResource::find_ik_constraint( - const String &constraint_name) const { +Ref SpineSkeletonDataResource::find_ik_constraint(const String &constraint_name) const { SPINE_CHECK(skeleton_data, nullptr) - if (EMPTY(constraint_name)) - return nullptr; - auto constraint = - skeleton_data->findIkConstraint(SPINE_STRING_TMP(constraint_name)); - if (!constraint) - return nullptr; + if (EMPTY(constraint_name)) return nullptr; + auto constraint = skeleton_data->findIkConstraint(SPINE_STRING_TMP(constraint_name)); + if (!constraint) return nullptr; Ref constraint_ref(memnew(SpineIkConstraintData)); constraint_ref->set_spine_object(this, constraint); return constraint_ref; } -Ref -SpineSkeletonDataResource::find_transform_constraint( - const String &constraint_name) const { +Ref SpineSkeletonDataResource::find_transform_constraint(const String &constraint_name) const { SPINE_CHECK(skeleton_data, nullptr) - if (EMPTY(constraint_name)) - return nullptr; - auto constraint = - skeleton_data->findTransformConstraint(SPINE_STRING_TMP(constraint_name)); - if (!constraint) - return nullptr; - Ref constraint_ref( - memnew(SpineTransformConstraintData)); + if (EMPTY(constraint_name)) return nullptr; + auto constraint = skeleton_data->findTransformConstraint(SPINE_STRING_TMP(constraint_name)); + if (!constraint) return nullptr; + Ref constraint_ref(memnew(SpineTransformConstraintData)); constraint_ref->set_spine_object(this, constraint); return constraint_ref; } -Ref SpineSkeletonDataResource::find_path_constraint( - const String &constraint_name) const { +Ref SpineSkeletonDataResource::find_path_constraint(const String &constraint_name) const { SPINE_CHECK(skeleton_data, nullptr) - if (EMPTY(constraint_name)) - return nullptr; - auto constraint = - skeleton_data->findPathConstraint(SPINE_STRING_TMP(constraint_name)); - if (constraint == nullptr) - return nullptr; + if (EMPTY(constraint_name)) return nullptr; + auto constraint = skeleton_data->findPathConstraint(SPINE_STRING_TMP(constraint_name)); + if (constraint == nullptr) return nullptr; Ref constraint_ref(memnew(SpinePathConstraintData)); constraint_ref->set_spine_object(this, constraint); return constraint_ref; } -Ref -SpineSkeletonDataResource::find_physics_constraint( - const String &constraint_name) const { +Ref SpineSkeletonDataResource::find_physics_constraint(const String &constraint_name) const { SPINE_CHECK(skeleton_data, nullptr) - if (EMPTY(constraint_name)) - return nullptr; - auto constraint = - skeleton_data->findPhysicsConstraint(SPINE_STRING_TMP(constraint_name)); - if (constraint == nullptr) - return nullptr; - Ref constraint_ref( - memnew(SpinePhysicsConstraintData)); + if (EMPTY(constraint_name)) return nullptr; + auto constraint = skeleton_data->findPhysicsConstraint(SPINE_STRING_TMP(constraint_name)); + if (constraint == nullptr) return nullptr; + Ref constraint_ref(memnew(SpinePhysicsConstraintData)); constraint_ref->set_spine_object(this, constraint); return constraint_ref; } @@ -674,8 +585,7 @@ Array SpineSkeletonDataResource::get_skins() const { Ref SpineSkeletonDataResource::get_default_skin() const { SPINE_CHECK(skeleton_data, nullptr) auto skin = skeleton_data->getDefaultSkin(); - if (skin) - return nullptr; + if (skin) return nullptr; Ref skin_ref(memnew(SpineSkin)); skin_ref->set_spine_object(this, skin); return skin_ref; @@ -683,9 +593,7 @@ Ref SpineSkeletonDataResource::get_default_skin() const { void SpineSkeletonDataResource::set_default_skin(Ref skin) { SPINE_CHECK(skeleton_data, ) - skeleton_data->setDefaultSkin(skin.is_valid() && skin->get_spine_object() - ? skin->get_spine_object() - : nullptr); + skeleton_data->setDefaultSkin(skin.is_valid() && skin->get_spine_object() ? skin->get_spine_object() : nullptr); } Array SpineSkeletonDataResource::get_events() const { @@ -733,8 +641,7 @@ Array SpineSkeletonDataResource::get_transform_constraints() const { auto constraints = skeleton_data->getTransformConstraints(); result.resize((int) constraints.size()); for (int i = 0; i < constraints.size(); ++i) { - Ref constraint_ref( - memnew(SpineTransformConstraintData)); + Ref constraint_ref(memnew(SpineTransformConstraintData)); constraint_ref->set_spine_object(this, constraints[i]); result[i] = constraint_ref; } @@ -747,8 +654,7 @@ Array SpineSkeletonDataResource::get_path_constraints() const { auto constraints = skeleton_data->getPathConstraints(); result.resize((int) constraints.size()); for (int i = 0; i < constraints.size(); ++i) { - Ref constraint_ref( - memnew(SpinePathConstraintData)); + Ref constraint_ref(memnew(SpinePathConstraintData)); constraint_ref->set_spine_object(this, constraints[i]); result[i] = constraint_ref; } @@ -761,8 +667,7 @@ Array SpineSkeletonDataResource::get_physics_constraints() const { auto constraints = skeleton_data->getPhysicsConstraints(); result.resize((int) constraints.size()); for (int i = 0; i < constraints.size(); ++i) { - Ref constraint_ref( - memnew(SpinePhysicsConstraintData)); + Ref constraint_ref(memnew(SpinePhysicsConstraintData)); constraint_ref->set_spine_object(this, constraints[i]); result[i] = constraint_ref; } diff --git a/spine-godot/spine_godot/SpineSkeletonDataResource.h b/spine-godot/spine_godot/SpineSkeletonDataResource.h index 6292e9c8c..ee39b6023 100644 --- a/spine-godot/spine_godot/SpineSkeletonDataResource.h +++ b/spine-godot/spine_godot/SpineSkeletonDataResource.h @@ -85,11 +85,9 @@ private: void update_skeleton_data(); #ifdef SPINE_GODOT_EXTENSION - void load_resources(spine::Atlas *atlas, const String &json, - const PackedByteArray &binary); + void load_resources(spine::Atlas *atlas, const String &json, const PackedByteArray &binary); #else - void load_resources(spine::Atlas *atlas, const String &json, - const Vector &binary); + void load_resources(spine::Atlas *atlas, const String &json, const Vector &binary); #endif public: @@ -101,11 +99,12 @@ public: void set_atlas_res(const Ref &atlas); Ref get_atlas_res(); - void - set_skeleton_file_res(const Ref &skeleton_file); + void set_skeleton_file_res(const Ref &skeleton_file); Ref get_skeleton_file_res(); - spine::SkeletonData *get_skeleton_data() const { return skeleton_data; } + spine::SkeletonData *get_skeleton_data() const { + return skeleton_data; + } spine::AnimationStateData *get_animation_state_data() const { return animation_state_data; @@ -152,17 +151,13 @@ public: Ref find_animation(const String &animation_name) const; - Ref - find_ik_constraint(const String &constraint_name) const; + Ref find_ik_constraint(const String &constraint_name) const; - Ref - find_transform_constraint(const String &constraint_name) const; + Ref find_transform_constraint(const String &constraint_name) const; - Ref - find_path_constraint(const String &constraint_name) const; + Ref find_path_constraint(const String &constraint_name) const; - Ref - find_physics_constraint(const String &constraint_name) const; + Ref find_physics_constraint(const String &constraint_name) const; String get_skeleton_name() const; diff --git a/spine-godot/spine_godot/SpineSkeletonFileResource.cpp b/spine-godot/spine_godot/SpineSkeletonFileResource.cpp index 1872fc19e..830c61d94 100644 --- a/spine-godot/spine_godot/SpineSkeletonFileResource.cpp +++ b/spine-godot/spine_godot/SpineSkeletonFileResource.cpp @@ -200,7 +200,8 @@ Error SpineSkeletonFileResource::copy_from(const Ref &p_resource) { Variant SpineSkeletonFileResourceFormatLoader::_load(const String &path, const String &original_path, bool use_sub_threads, int32_t cache_mode) { #else #if VERSION_MAJOR > 3 -RES SpineSkeletonFileResourceFormatLoader::load(const String &path, const String &original_path, Error *error, bool use_sub_threads, float *progress, CacheMode cache_mode) { +RES SpineSkeletonFileResourceFormatLoader::load(const String &path, const String &original_path, Error *error, bool use_sub_threads, float *progress, + CacheMode cache_mode) { #else #if VERSION_MINOR > 5 RES SpineSkeletonFileResourceFormatLoader::load(const String &path, const String &original_path, Error *error, bool no_subresource_cache) { @@ -236,7 +237,9 @@ String SpineSkeletonFileResourceFormatLoader::_get_resource_type(const String &p #else String SpineSkeletonFileResourceFormatLoader::get_resource_type(const String &path) const { #endif - return path.ends_with(".spjson") || path.ends_with(".spskel") || path.ends_with(".spine-json") || path.ends_with(".skel") ? "SpineSkeletonFileResource" : ""; + return path.ends_with(".spjson") || path.ends_with(".spskel") || path.ends_with(".spine-json") || path.ends_with(".skel") + ? "SpineSkeletonFileResource" + : ""; } #ifdef SPINE_GODOT_EXTENSION diff --git a/spine-godot/spine_godot/SpineSkeletonFileResource.h b/spine-godot/spine_godot/SpineSkeletonFileResource.h index b0064518c..960dd089b 100644 --- a/spine-godot/spine_godot/SpineSkeletonFileResource.h +++ b/spine-godot/spine_godot/SpineSkeletonFileResource.h @@ -57,15 +57,23 @@ protected: #endif public: - bool is_binary() { return binary.size() > 0; } + bool is_binary() { + return binary.size() > 0; + } #ifdef SPINE_GODOT_EXTENSION - const PackedByteArray &get_binary() { return binary; } + const PackedByteArray &get_binary() { + return binary; + } #else - const Vector &get_binary() { return binary; } + const Vector &get_binary() { + return binary; + } #endif - const String &get_json() { return json; } + const String &get_json() { + return json; + } Error load_from_file(const String &path); @@ -83,7 +91,7 @@ class SpineSkeletonFileResourceFormatLoader : public ResourceFormatLoader { public: #ifdef SPINE_GODOT_EXTENSION - static void _bind_methods(){}; + static void _bind_methods() {}; PackedStringArray _get_recognized_extensions(); @@ -116,7 +124,7 @@ class SpineSkeletonFileResourceFormatSaver : public ResourceFormatSaver { public: #ifdef SPINE_GODOT_EXTENSION - static void _bind_methods(){}; + static void _bind_methods() {}; Error _save(const Ref &resource, const String &path, uint32_t flags) override; diff --git a/spine-godot/spine_godot/SpineSkin.cpp b/spine-godot/spine_godot/SpineSkin.cpp index 1c37f62a3..db633871d 100644 --- a/spine-godot/spine_godot/SpineSkin.cpp +++ b/spine-godot/spine_godot/SpineSkin.cpp @@ -74,7 +74,8 @@ Ref SpineSkin::init(const String &name, SpineSprite *sprite) { void SpineSkin::set_attachment(int slot_index, const String &name, Ref attachment) { SPINE_CHECK(get_spine_object(), ) - get_spine_object()->setAttachment(slot_index, SPINE_STRING(name), attachment.is_valid() && attachment->get_spine_owner() ? attachment->get_spine_object() : nullptr); + get_spine_object()->setAttachment(slot_index, SPINE_STRING(name), + attachment.is_valid() && attachment->get_spine_owner() ? attachment->get_spine_object() : nullptr); } Ref SpineSkin::get_attachment(int slot_index, const String &name) { diff --git a/spine-godot/spine_godot/SpineSlotNode.cpp b/spine-godot/spine_godot/SpineSlotNode.cpp index 3aa54ee0e..cccfa4771 100644 --- a/spine-godot/spine_godot/SpineSlotNode.cpp +++ b/spine-godot/spine_godot/SpineSlotNode.cpp @@ -55,10 +55,14 @@ void SpineSlotNode::_bind_methods() { ClassDB::bind_method(D_METHOD("get_screen_material"), &SpineSlotNode::get_screen_material); ADD_GROUP("Materials", ""); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "normal_material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_normal_material", "get_normal_material"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "additive_material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_additive_material", "get_additive_material"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "multiply_material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_multiply_material", "get_multiply_material"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "screen_material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_screen_material", "get_screen_material"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "normal_material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_normal_material", + "get_normal_material"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "additive_material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_additive_material", + "get_additive_material"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "multiply_material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_multiply_material", + "get_multiply_material"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "screen_material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_screen_material", + "get_screen_material"); } SpineSlotNode::SpineSlotNode() : slot_index(-1) { @@ -113,7 +117,8 @@ void SpineSlotNode::_get_property_list(List *list) const { Vector slot_names; #endif SpineSprite *sprite = cast_to(get_parent()); - if (sprite && sprite->get_skeleton_data_res().is_valid()) sprite->get_skeleton_data_res()->get_slot_names(slot_names); + if (sprite && sprite->get_skeleton_data_res().is_valid()) + sprite->get_skeleton_data_res()->get_slot_names(slot_names); else slot_names.push_back(slot_name); auto element = list->front(); diff --git a/spine-godot/spine_godot/SpineSlotNode.h b/spine-godot/spine_godot/SpineSlotNode.h index 504b2f21b..4d0113f85 100644 --- a/spine-godot/spine_godot/SpineSlotNode.h +++ b/spine-godot/spine_godot/SpineSlotNode.h @@ -63,7 +63,9 @@ public: String get_slot_name(); - int get_slot_index() { return slot_index; } + int get_slot_index() { + return slot_index; + } Ref get_normal_material(); diff --git a/spine-godot/spine_godot/SpineSprite.cpp b/spine-godot/spine_godot/SpineSprite.cpp index a728031d6..f272d3e82 100644 --- a/spine-godot/spine_godot/SpineSprite.cpp +++ b/spine-godot/spine_godot/SpineSprite.cpp @@ -146,8 +146,7 @@ public: SpineSpriteStatics *SpineSpriteStatics::_instance = nullptr; -static void -clear_triangles(SpineMesh2D *mesh_instance) { +static void clear_triangles(SpineMesh2D *mesh_instance) { #if VERSION_MAJOR > 3 RenderingServer::get_singleton()->canvas_item_clear(mesh_instance->get_canvas_item()); #else @@ -156,19 +155,11 @@ clear_triangles(SpineMesh2D *mesh_instance) { } #ifdef SPINE_GODOT_EXTENSION -static void add_triangles(SpineMesh2D *mesh_instance, - const PackedVector2Array &vertices, - const PackedVector2Array &uvs, - const PackedColorArray &colors, - const PackedInt32Array &indices, - SpineRendererObject *renderer_object) { +static void add_triangles(SpineMesh2D *mesh_instance, const PackedVector2Array &vertices, const PackedVector2Array &uvs, + const PackedColorArray &colors, const PackedInt32Array &indices, SpineRendererObject *renderer_object) { #else -static void add_triangles(SpineMesh2D *mesh_instance, - const Vector &vertices, - const Vector &uvs, - const Vector &colors, - const Vector &indices, - SpineRendererObject *renderer_object) { +static void add_triangles(SpineMesh2D *mesh_instance, const Vector &vertices, const Vector &uvs, const Vector &colors, + const Vector &indices, SpineRendererObject *renderer_object) { #endif #if VERSION_MAJOR > 3 mesh_instance->update_mesh(vertices, uvs, colors, indices, renderer_object); @@ -180,15 +171,8 @@ static void add_triangles(SpineMesh2D *mesh_instance, auto texture = renderer_object->texture; auto normal_map = renderer_object->normal_map; auto specular_map = renderer_object->specular_map; - VisualServer::get_singleton()->canvas_item_add_triangle_array(mesh_instance->get_canvas_item(), - indices, - vertices, - colors, - uvs, - Vector(), - Vector(), - texture.is_null() ? RID() : texture->get_rid(), - -1, + VisualServer::get_singleton()->canvas_item_add_triangle_array(mesh_instance->get_canvas_item(), indices, vertices, colors, uvs, Vector(), + Vector(), texture.is_null() ? RID() : texture->get_rid(), -1, normal_map.is_null() ? RID() : normal_map->get_rid(), specular_map.is_null() ? RID() : specular_map->get_rid()); #endif @@ -210,8 +194,7 @@ void SpineMesh2D::_notification(int what) { break; case NOTIFICATION_DRAW: clear_triangles(this); - if (renderer_object) - add_triangles(this, vertices, uvs, colors, indices, renderer_object); + if (renderer_object) add_triangles(this, vertices, uvs, colors, indices, renderer_object); break; default: break; @@ -222,11 +205,8 @@ void SpineMesh2D::_bind_methods() { } #ifdef SPINE_GODOT_EXTENSION -void SpineMesh2D::update_mesh(const PackedVector2Array &vertices, - const PackedVector2Array &uvs, - const PackedColorArray &colors, - const PackedInt32Array &indices, - SpineRendererObject *renderer_object) { +void SpineMesh2D::update_mesh(const PackedVector2Array &vertices, const PackedVector2Array &uvs, const PackedColorArray &colors, + const PackedInt32Array &indices, SpineRendererObject *renderer_object) { if (!mesh.is_valid() || vertices.size() != num_vertices || indices.size() != num_indices || indices_changed) { if (mesh.is_valid()) { RS::get_singleton()->free_rid(mesh); @@ -238,7 +218,8 @@ void SpineMesh2D::update_mesh(const PackedVector2Array &vertices, arrays[Mesh::ARRAY_TEX_UV] = uvs; arrays[Mesh::ARRAY_COLOR] = colors; arrays[Mesh::ARRAY_INDEX] = indices; - RS::get_singleton()->mesh_add_surface_from_arrays(mesh, RS::PrimitiveType::PRIMITIVE_TRIANGLES, arrays, Array(), Dictionary(), RS::ArrayFormat::ARRAY_FLAG_USE_DYNAMIC_UPDATE); + RS::get_singleton()->mesh_add_surface_from_arrays(mesh, RS::PrimitiveType::PRIMITIVE_TRIANGLES, arrays, Array(), Dictionary(), + RS::ArrayFormat::ARRAY_FLAG_USE_DYNAMIC_UPDATE); Dictionary surface = RS::get_singleton()->mesh_get_surface(mesh, 0); RS::ArrayFormat surface_format = (RS::ArrayFormat) static_cast(surface["format"]); surface_offsets[RS::ARRAY_VERTEX] = RS::get_singleton()->mesh_surface_get_format_offset(surface_format, vertices.size(), RS::ARRAY_VERTEX); @@ -253,11 +234,8 @@ void SpineMesh2D::update_mesh(const PackedVector2Array &vertices, indices_changed = false; } else { AABB aabb_new; - uint8_t color[4] = { - uint8_t(CLAMP(colors[0].r * 255.0, 0.0, 255.0)), - uint8_t(CLAMP(colors[0].g * 255.0, 0.0, 255.0)), - uint8_t(CLAMP(colors[0].b * 255.0, 0.0, 255.0)), - uint8_t(CLAMP(colors[0].a * 255.0, 0.0, 255.0))}; + uint8_t color[4] = {uint8_t(CLAMP(colors[0].r * 255.0, 0.0, 255.0)), uint8_t(CLAMP(colors[0].g * 255.0, 0.0, 255.0)), + uint8_t(CLAMP(colors[0].b * 255.0, 0.0, 255.0)), uint8_t(CLAMP(colors[0].a * 255.0, 0.0, 255.0))}; uint8_t *vertex_write_buffer = vertex_buffer.ptrw(); uint8_t *attribute_write_buffer = attribute_buffer.ptrw(); @@ -280,13 +258,11 @@ void SpineMesh2D::update_mesh(const PackedVector2Array &vertices, RS::get_singleton()->mesh_set_custom_aabb(mesh, aabb_new); } - RenderingServer::get_singleton()->canvas_item_add_mesh(this->get_canvas_item(), mesh, Transform2D(), Color(1, 1, 1, 1), renderer_object->canvas_texture->get_rid()); + RenderingServer::get_singleton()->canvas_item_add_mesh(this->get_canvas_item(), mesh, Transform2D(), Color(1, 1, 1, 1), + renderer_object->canvas_texture->get_rid()); } #else -void SpineMesh2D::update_mesh(const Vector &vertices, - const Vector &uvs, - const Vector &colors, - const Vector &indices, +void SpineMesh2D::update_mesh(const Vector &vertices, const Vector &uvs, const Vector &colors, const Vector &indices, SpineRendererObject *renderer_object) { #if VERSION_MAJOR > 3 if (!mesh.is_valid() || vertices.size() != num_vertices || indices.size() != num_indices || indices_changed) { @@ -306,12 +282,16 @@ void SpineMesh2D::update_mesh(const Vector &vertices, arrays[Mesh::ARRAY_INDEX] = indices; RS::SurfaceData surface; uint32_t skin_stride; - RS::get_singleton()->mesh_create_surface_data_from_arrays(&surface, (RS::PrimitiveType) Mesh::PRIMITIVE_TRIANGLES, arrays, TypedArray(), Dictionary(), Mesh::ArrayFormat::ARRAY_FLAG_USE_DYNAMIC_UPDATE); + RS::get_singleton()->mesh_create_surface_data_from_arrays(&surface, (RS::PrimitiveType) Mesh::PRIMITIVE_TRIANGLES, arrays, + TypedArray(), Dictionary(), + Mesh::ArrayFormat::ARRAY_FLAG_USE_DYNAMIC_UPDATE); RS::get_singleton()->mesh_add_surface(mesh, surface); #if VERSION_MINOR > 1 - RS::get_singleton()->mesh_surface_make_offsets_from_format(surface.format, surface.vertex_count, surface.index_count, surface_offsets, vertex_stride, normal_tangent_stride, attribute_stride, skin_stride); + RS::get_singleton()->mesh_surface_make_offsets_from_format(surface.format, surface.vertex_count, surface.index_count, surface_offsets, + vertex_stride, normal_tangent_stride, attribute_stride, skin_stride); #else - RS::get_singleton()->mesh_surface_make_offsets_from_format(surface.format, surface.vertex_count, surface.index_count, surface_offsets, vertex_stride, attribute_stride, skin_stride); + RS::get_singleton()->mesh_surface_make_offsets_from_format(surface.format, surface.vertex_count, surface.index_count, surface_offsets, + vertex_stride, attribute_stride, skin_stride); #endif num_vertices = vertices.size(); num_indices = indices.size(); @@ -322,11 +302,8 @@ void SpineMesh2D::update_mesh(const Vector &vertices, AABB aabb_new; uint8_t *vertex_write_buffer = vertex_buffer.ptrw(); uint8_t *attribute_write_buffer = attribute_buffer.ptrw(); - uint8_t color[4] = { - uint8_t(CLAMP(colors[0].r * 255.0, 0.0, 255.0)), - uint8_t(CLAMP(colors[0].g * 255.0, 0.0, 255.0)), - uint8_t(CLAMP(colors[0].b * 255.0, 0.0, 255.0)), - uint8_t(CLAMP(colors[0].a * 255.0, 0.0, 255.0))}; + uint8_t color[4] = {uint8_t(CLAMP(colors[0].r * 255.0, 0.0, 255.0)), uint8_t(CLAMP(colors[0].g * 255.0, 0.0, 255.0)), + uint8_t(CLAMP(colors[0].b * 255.0, 0.0, 255.0)), uint8_t(CLAMP(colors[0].a * 255.0, 0.0, 255.0))}; for (int i = 0; i < vertices.size(); i++) { Vector2 vertex(vertices[i]); @@ -347,7 +324,8 @@ void SpineMesh2D::update_mesh(const Vector &vertices, RS::get_singleton()->mesh_set_custom_aabb(mesh, aabb_new); } - RenderingServer::get_singleton()->canvas_item_add_mesh(this->get_canvas_item(), mesh, Transform2D(), Color(1, 1, 1, 1), renderer_object->canvas_texture->get_rid()); + RenderingServer::get_singleton()->canvas_item_add_mesh(this->get_canvas_item(), mesh, Transform2D(), Color(1, 1, 1, 1), + renderer_object->canvas_texture->get_rid()); #else if (!mesh.is_valid() || vertices.size() != num_vertices || indices.size() != num_indices || indices_changed) { if (mesh.is_valid()) { @@ -366,7 +344,8 @@ void SpineMesh2D::update_mesh(const Vector &vertices, int surface_index_len = VS::get_singleton()->mesh_surface_get_array_index_len(mesh, 0); mesh_surface_format = VS::get_singleton()->mesh_surface_get_format(mesh, 0); mesh_buffer = VS::get_singleton()->mesh_surface_get_array(mesh, 0); - VS::get_singleton()->mesh_surface_make_offsets_from_format(mesh_surface_format, surface_vertex_len, surface_index_len, mesh_surface_offsets, mesh_stride); + VS::get_singleton()->mesh_surface_make_offsets_from_format(mesh_surface_format, surface_vertex_len, surface_index_len, mesh_surface_offsets, + mesh_stride); num_vertices = vertices.size(); num_indices = indices.size(); indices_changed = false; @@ -374,11 +353,8 @@ void SpineMesh2D::update_mesh(const Vector &vertices, AABB aabb_new; PoolVector::Write write_buffer = mesh_buffer.write(); - uint8_t color[4] = { - uint8_t(CLAMP(colors[0].r * 255.0, 0.0, 255.0)), - uint8_t(CLAMP(colors[0].g * 255.0, 0.0, 255.0)), - uint8_t(CLAMP(colors[0].b * 255.0, 0.0, 255.0)), - uint8_t(CLAMP(colors[0].a * 255.0, 0.0, 255.0))}; + uint8_t color[4] = {uint8_t(CLAMP(colors[0].r * 255.0, 0.0, 255.0)), uint8_t(CLAMP(colors[0].g * 255.0, 0.0, 255.0)), + uint8_t(CLAMP(colors[0].b * 255.0, 0.0, 255.0)), uint8_t(CLAMP(colors[0].a * 255.0, 0.0, 255.0))}; for (int i = 0; i < vertices.size(); i++) { Vector2 vertex(vertices[i]); @@ -399,14 +375,10 @@ void SpineMesh2D::update_mesh(const Vector &vertices, VS::get_singleton()->mesh_set_custom_aabb(mesh, aabb_new); } - VS::get_singleton()->canvas_item_add_mesh( - this->get_canvas_item(), - mesh, - Transform2D(), - Color(1, 1, 1, 1), - renderer_object->texture.is_null() ? RID() : renderer_object->texture->get_rid(), - renderer_object->normal_map.is_null() ? RID() : renderer_object->normal_map->get_rid(), - renderer_object->specular_map.is_null() ? RID() : renderer_object->specular_map->get_rid()); + VS::get_singleton()->canvas_item_add_mesh(this->get_canvas_item(), mesh, Transform2D(), Color(1, 1, 1, 1), + renderer_object->texture.is_null() ? RID() : renderer_object->texture->get_rid(), + renderer_object->normal_map.is_null() ? RID() : renderer_object->normal_map->get_rid(), + renderer_object->specular_map.is_null() ? RID() : renderer_object->specular_map->get_rid()); #endif } #endif @@ -474,25 +446,43 @@ void SpineSprite::_bind_methods() { ClassDB::bind_method(D_METHOD("update_skeleton", "delta"), &SpineSprite::update_skeleton); ClassDB::bind_method(D_METHOD("new_skin", "name"), &SpineSprite::new_skin); - ADD_SIGNAL(MethodInfo("animation_started", PropertyInfo(Variant::OBJECT, "spine_sprite", PROPERTY_HINT_TYPE_STRING, "SpineSprite"), PropertyInfo(Variant::OBJECT, "animation_state", PROPERTY_HINT_TYPE_STRING, "SpineAnimationState"), PropertyInfo(Variant::OBJECT, "track_entry", PROPERTY_HINT_TYPE_STRING, "SpineTrackEntry"))); - ADD_SIGNAL(MethodInfo("animation_interrupted", PropertyInfo(Variant::OBJECT, "spine_sprite", PROPERTY_HINT_TYPE_STRING, "SpineSprite"), PropertyInfo(Variant::OBJECT, "animation_state", PROPERTY_HINT_TYPE_STRING, "SpineAnimationState"), PropertyInfo(Variant::OBJECT, "track_entry", PROPERTY_HINT_TYPE_STRING, "SpineTrackEntry"))); - ADD_SIGNAL(MethodInfo("animation_ended", PropertyInfo(Variant::OBJECT, "spine_sprite", PROPERTY_HINT_TYPE_STRING, "SpineSprite"), PropertyInfo(Variant::OBJECT, "animation_state", PROPERTY_HINT_TYPE_STRING, "SpineAnimationState"), PropertyInfo(Variant::OBJECT, "track_entry", PROPERTY_HINT_TYPE_STRING, "SpineTrackEntry"))); - ADD_SIGNAL(MethodInfo("animation_completed", PropertyInfo(Variant::OBJECT, "spine_sprite", PROPERTY_HINT_TYPE_STRING, "SpineSprite"), PropertyInfo(Variant::OBJECT, "animation_state", PROPERTY_HINT_TYPE_STRING, "SpineAnimationState"), PropertyInfo(Variant::OBJECT, "track_entry", PROPERTY_HINT_TYPE_STRING, "SpineTrackEntry"))); - ADD_SIGNAL(MethodInfo("animation_disposed", PropertyInfo(Variant::OBJECT, "spine_sprite", PROPERTY_HINT_TYPE_STRING, "SpineSprite"), PropertyInfo(Variant::OBJECT, "animation_state", PROPERTY_HINT_TYPE_STRING, "SpineAnimationState"), PropertyInfo(Variant::OBJECT, "track_entry", PROPERTY_HINT_TYPE_STRING, "SpineTrackEntry"))); - ADD_SIGNAL(MethodInfo("animation_event", PropertyInfo(Variant::OBJECT, "spine_sprite", PROPERTY_HINT_TYPE_STRING, "SpineSprite"), PropertyInfo(Variant::OBJECT, "animation_state", PROPERTY_HINT_TYPE_STRING, "SpineAnimationState"), PropertyInfo(Variant::OBJECT, "track_entry", PROPERTY_HINT_TYPE_STRING, "SpineTrackEntry"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_TYPE_STRING, "SpineEvent"))); + ADD_SIGNAL(MethodInfo("animation_started", PropertyInfo(Variant::OBJECT, "spine_sprite", PROPERTY_HINT_TYPE_STRING, "SpineSprite"), + PropertyInfo(Variant::OBJECT, "animation_state", PROPERTY_HINT_TYPE_STRING, "SpineAnimationState"), + PropertyInfo(Variant::OBJECT, "track_entry", PROPERTY_HINT_TYPE_STRING, "SpineTrackEntry"))); + ADD_SIGNAL(MethodInfo("animation_interrupted", PropertyInfo(Variant::OBJECT, "spine_sprite", PROPERTY_HINT_TYPE_STRING, "SpineSprite"), + PropertyInfo(Variant::OBJECT, "animation_state", PROPERTY_HINT_TYPE_STRING, "SpineAnimationState"), + PropertyInfo(Variant::OBJECT, "track_entry", PROPERTY_HINT_TYPE_STRING, "SpineTrackEntry"))); + ADD_SIGNAL(MethodInfo("animation_ended", PropertyInfo(Variant::OBJECT, "spine_sprite", PROPERTY_HINT_TYPE_STRING, "SpineSprite"), + PropertyInfo(Variant::OBJECT, "animation_state", PROPERTY_HINT_TYPE_STRING, "SpineAnimationState"), + PropertyInfo(Variant::OBJECT, "track_entry", PROPERTY_HINT_TYPE_STRING, "SpineTrackEntry"))); + ADD_SIGNAL(MethodInfo("animation_completed", PropertyInfo(Variant::OBJECT, "spine_sprite", PROPERTY_HINT_TYPE_STRING, "SpineSprite"), + PropertyInfo(Variant::OBJECT, "animation_state", PROPERTY_HINT_TYPE_STRING, "SpineAnimationState"), + PropertyInfo(Variant::OBJECT, "track_entry", PROPERTY_HINT_TYPE_STRING, "SpineTrackEntry"))); + ADD_SIGNAL(MethodInfo("animation_disposed", PropertyInfo(Variant::OBJECT, "spine_sprite", PROPERTY_HINT_TYPE_STRING, "SpineSprite"), + PropertyInfo(Variant::OBJECT, "animation_state", PROPERTY_HINT_TYPE_STRING, "SpineAnimationState"), + PropertyInfo(Variant::OBJECT, "track_entry", PROPERTY_HINT_TYPE_STRING, "SpineTrackEntry"))); + ADD_SIGNAL(MethodInfo("animation_event", PropertyInfo(Variant::OBJECT, "spine_sprite", PROPERTY_HINT_TYPE_STRING, "SpineSprite"), + PropertyInfo(Variant::OBJECT, "animation_state", PROPERTY_HINT_TYPE_STRING, "SpineAnimationState"), + PropertyInfo(Variant::OBJECT, "track_entry", PROPERTY_HINT_TYPE_STRING, "SpineTrackEntry"), + PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_TYPE_STRING, "SpineEvent"))); ADD_SIGNAL(MethodInfo("before_animation_state_update", PropertyInfo(Variant::OBJECT, "spine_sprite", PROPERTY_HINT_TYPE_STRING, "SpineSprite"))); ADD_SIGNAL(MethodInfo("before_animation_state_apply", PropertyInfo(Variant::OBJECT, "spine_sprite", PROPERTY_HINT_TYPE_STRING, "SpineSprite"))); ADD_SIGNAL(MethodInfo("before_world_transforms_change", PropertyInfo(Variant::OBJECT, "spine_sprite", PROPERTY_HINT_TYPE_STRING, "SpineSprite"))); ADD_SIGNAL(MethodInfo("world_transforms_changed", PropertyInfo(Variant::OBJECT, "spine_sprite", PROPERTY_HINT_TYPE_STRING, "SpineSprite"))); ADD_SIGNAL(MethodInfo("_internal_spine_objects_invalidated")); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "skeleton_data_res", PropertyHint::PROPERTY_HINT_RESOURCE_TYPE, "SpineSkeletonDataResource"), "set_skeleton_data_res", "get_skeleton_data_res"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "skeleton_data_res", PropertyHint::PROPERTY_HINT_RESOURCE_TYPE, "SpineSkeletonDataResource"), + "set_skeleton_data_res", "get_skeleton_data_res"); ADD_PROPERTY(PropertyInfo(Variant::INT, "update_mode", PROPERTY_HINT_ENUM, "Process,Physics,Manual"), "set_update_mode", "get_update_mode"); ADD_GROUP("Materials", ""); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "normal_material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_normal_material", "get_normal_material"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "additive_material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_additive_material", "get_additive_material"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "multiply_material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_multiply_material", "get_multiply_material"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "screen_material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_screen_material", "get_screen_material"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "normal_material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_normal_material", + "get_normal_material"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "additive_material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_additive_material", + "get_additive_material"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "multiply_material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_multiply_material", + "get_multiply_material"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "screen_material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_screen_material", + "get_screen_material"); ADD_GROUP("Debug", ""); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "root"), "set_debug_root", "get_debug_root"); @@ -515,7 +505,9 @@ void SpineSprite::_bind_methods() { // Filled in in _get_property_list() } -SpineSprite::SpineSprite() : update_mode(SpineConstant::UpdateMode_Process), time_scale(1.0), preview_skin("Default"), preview_animation("-- Empty --"), preview_frame(false), preview_time(0), skeleton_clipper(nullptr), modified_bones(false) { +SpineSprite::SpineSprite() + : update_mode(SpineConstant::UpdateMode_Process), time_scale(1.0), preview_skin("Default"), preview_animation("-- Empty --"), + preview_frame(false), preview_time(0), skeleton_clipper(nullptr), modified_bones(false) { skeleton_clipper = new spine::SkeletonClipping(); auto statics = SpineSpriteStatics::instance(); @@ -544,8 +536,7 @@ SpineSprite::~SpineSprite() { auto statics = SpineSpriteStatics::instance(); statics.sprite_count--; if (!statics.sprite_count) { - for (int i = 0; i < 4; i++) - statics.default_materials[i].unref(); + for (int i = 0; i < 4; i++) statics.default_materials[i].unref(); } } @@ -666,13 +657,11 @@ void SpineSprite::_notification(int what) { break; } case NOTIFICATION_INTERNAL_PROCESS: { - if (update_mode == SpineConstant::UpdateMode_Process) - update_skeleton(get_process_delta_time()); + if (update_mode == SpineConstant::UpdateMode_Process) update_skeleton(get_process_delta_time()); break; } case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { - if (update_mode == SpineConstant::UpdateMode_Physics) - update_skeleton(get_physics_process_delta_time()); + if (update_mode == SpineConstant::UpdateMode_Physics) update_skeleton(get_physics_process_delta_time()); break; } case NOTIFICATION_DRAW: { @@ -814,12 +803,8 @@ bool SpineSprite::_set(const StringName &property, const Variant &value) { } void SpineSprite::update_skeleton(float delta) { - if (!skeleton_data_res.is_valid() || - !skeleton_data_res->is_skeleton_data_loaded() || - !skeleton.is_valid() || - !skeleton->get_spine_object() || - !animation_state.is_valid() || - !animation_state->get_spine_object()) + if (!skeleton_data_res.is_valid() || !skeleton_data_res->is_skeleton_data_loaded() || !skeleton.is_valid() || !skeleton->get_spine_object() || + !animation_state.is_valid() || !animation_state->get_spine_object()) return; emit_signal(SNAME("before_animation_state_update"), this); @@ -862,7 +847,8 @@ void SpineSprite::update_meshes(Ref skeleton_ref) { spine::Color skeleton_color = skeleton->getColor(); spine::Color slot_color = slot->getColor(); - spine::Color tint(skeleton_color.r * slot_color.r, skeleton_color.g * slot_color.g, skeleton_color.b * slot_color.b, skeleton_color.a * slot_color.a); + spine::Color tint(skeleton_color.r * slot_color.r, skeleton_color.g * slot_color.g, skeleton_color.b * slot_color.b, + skeleton_color.a * slot_color.a); SpineRendererObject *renderer_object; spine::Vector *vertices = &statics.scratch_vertices; spine::Vector *uvs; @@ -997,7 +983,8 @@ void SpineSprite::update_meshes(Ref skeleton_ref) { } // Set the custom material, or the default material - if (custom_material.is_valid()) mesh_instance->set_material(custom_material); + if (custom_material.is_valid()) + mesh_instance->set_material(custom_material); else mesh_instance->set_material(statics.default_materials[slot->getData().getBlendMode()]); } @@ -1245,7 +1232,8 @@ void SpineSprite::draw() { } auto global_scale = get_global_scale(); - draw_set_transform(mouse_position + Vector2(20, 0), -get_global_rotation(), Vector2(inverse_zoom * (1 / global_scale.x), inverse_zoom * (1 / global_scale.y))); + draw_set_transform(mouse_position + Vector2(20, 0), -get_global_rotation(), + Vector2(inverse_zoom * (1 / global_scale.x), inverse_zoom * (1 / global_scale.y))); Ref default_font; auto control = memnew(Control); @@ -1284,9 +1272,11 @@ void SpineSprite::draw() { for (int i = 0; i < hover_text_lines.size(); i++) { #if VERSION_MAJOR > 3 #ifdef SPINE_GODOT_EXTENSION - draw_string(default_font, Vector2(10, 0 + i * default_font->get_height()), hover_text_lines[i], HORIZONTAL_ALIGNMENT_LEFT, -1, 16, Color(1, 1, 1, 1)); + draw_string(default_font, Vector2(10, 0 + i * default_font->get_height()), hover_text_lines[i], HORIZONTAL_ALIGNMENT_LEFT, -1, 16, + Color(1, 1, 1, 1)); #else - draw_string(default_font, Vector2(10, 0 + i * default_font->get_height(Font::DEFAULT_FONT_SIZE)), hover_text_lines[i], HORIZONTAL_ALIGNMENT_LEFT, -1, Font::DEFAULT_FONT_SIZE, Color(1, 1, 1, 1)); + draw_string(default_font, Vector2(10, 0 + i * default_font->get_height(Font::DEFAULT_FONT_SIZE)), hover_text_lines[i], + HORIZONTAL_ALIGNMENT_LEFT, -1, Font::DEFAULT_FONT_SIZE, Color(1, 1, 1, 1)); #endif #else draw_string(default_font, Vector2(10, 0 + i * default_font->get_height()), hover_text_lines[i], Color(1, 1, 1, 1)); @@ -1296,7 +1286,8 @@ void SpineSprite::draw() { } void SpineSprite::draw_bone(spine::Bone *bone, const Color &color) { - draw_set_transform(Vector2(bone->getWorldX(), bone->getWorldY()), spine::MathUtil::Deg_Rad * bone->getWorldRotationX(), Vector2(bone->getWorldScaleX(), bone->getWorldScaleY())); + draw_set_transform(Vector2(bone->getWorldX(), bone->getWorldY()), spine::MathUtil::Deg_Rad * bone->getWorldRotationX(), + Vector2(bone->getWorldScaleX(), bone->getWorldScaleY())); float bone_length = bone->getData().getLength(); if (bone_length == 0) bone_length = debug_bones_thickness * 2; #ifdef SPINE_GODOT_EXTENSION diff --git a/spine-godot/spine_godot/SpineSprite.h b/spine-godot/spine_godot/SpineSprite.h index 151ec475c..4dbaaee98 100644 --- a/spine-godot/spine_godot/SpineSprite.h +++ b/spine-godot/spine_godot/SpineSprite.h @@ -96,7 +96,9 @@ protected: public: #if VERSION_MAJOR > 3 - SpineMesh2D() : renderer_object(nullptr), indices_changed(true), num_vertices(0), num_indices(0), vertex_stride(0), normal_tangent_stride(0), attribute_stride(0){}; + SpineMesh2D() + : renderer_object(nullptr), indices_changed(true), num_vertices(0), num_indices(0), vertex_stride(0), normal_tangent_stride(0), + attribute_stride(0) {}; ~SpineMesh2D() { if (mesh.is_valid()) { #ifdef SPINE_GODOT_EXTENSION @@ -107,7 +109,7 @@ public: } } #else - SpineMesh2D() : renderer_object(nullptr), indices_changed(true), num_vertices(0), num_indices(0){}; + SpineMesh2D() : renderer_object(nullptr), indices_changed(true), num_vertices(0), num_indices(0) {}; ~SpineMesh2D() { if (mesh.is_valid()) { VS::get_singleton()->free(mesh); @@ -116,22 +118,15 @@ public: #endif #ifdef SPINE_GODOT_EXTENSION - void update_mesh(const PackedVector2Array &vertices, - const PackedVector2Array &uvs, - const PackedColorArray &colors, - const PackedInt32Array &indices, - SpineRendererObject *renderer_object); + void update_mesh(const PackedVector2Array &vertices, const PackedVector2Array &uvs, const PackedColorArray &colors, + const PackedInt32Array &indices, SpineRendererObject *renderer_object); #else - void update_mesh(const Vector &vertices, - const Vector &uvs, - const Vector &colors, - const Vector &indices, + void update_mesh(const Vector &vertices, const Vector &uvs, const Vector &colors, const Vector &indices, SpineRendererObject *renderer_object); #endif }; -class SpineSprite : public Node2D, - public spine::AnimationStateListenerObject { +class SpineSprite : public Node2D, public spine::AnimationStateListenerObject { GDCLASS(SpineSprite, Node2D) friend class SpineBone; @@ -183,7 +178,9 @@ protected: void remove_meshes(); void sort_slot_nodes(); void update_meshes(Ref skeleton_ref); - void set_modified_bones() { modified_bones = true; } + void set_modified_bones() { + modified_bones = true; + } void draw(); void draw_bone(spine::Bone *bone, const Color &color); @@ -235,65 +232,125 @@ public: float get_time_scale(); - bool get_debug_root() { return debug_root; } + bool get_debug_root() { + return debug_root; + } - void set_debug_root(bool root) { debug_root = root; } + void set_debug_root(bool root) { + debug_root = root; + } - Color get_debug_root_color() { return debug_root_color; } + Color get_debug_root_color() { + return debug_root_color; + } - void set_debug_root_color(const Color &color) { debug_root_color = color; } + void set_debug_root_color(const Color &color) { + debug_root_color = color; + } - bool get_debug_bones() { return debug_bones; } + bool get_debug_bones() { + return debug_bones; + } - void set_debug_bones(bool bones) { debug_bones = bones; } + void set_debug_bones(bool bones) { + debug_bones = bones; + } - Color get_debug_bones_color() { return debug_bones_color; } + Color get_debug_bones_color() { + return debug_bones_color; + } - void set_debug_bones_color(const Color &color) { debug_bones_color = color; } + void set_debug_bones_color(const Color &color) { + debug_bones_color = color; + } - float get_debug_bones_thickness() { return debug_bones_thickness; } + float get_debug_bones_thickness() { + return debug_bones_thickness; + } - void set_debug_bones_thickness(float thickness) { debug_bones_thickness = thickness; } + void set_debug_bones_thickness(float thickness) { + debug_bones_thickness = thickness; + } - bool get_debug_regions() { return debug_regions; } + bool get_debug_regions() { + return debug_regions; + } - void set_debug_regions(bool regions) { debug_regions = regions; } + void set_debug_regions(bool regions) { + debug_regions = regions; + } - Color get_debug_regions_color() { return debug_regions_color; } + Color get_debug_regions_color() { + return debug_regions_color; + } - void set_debug_regions_color(const Color &color) { debug_regions_color = color; } + void set_debug_regions_color(const Color &color) { + debug_regions_color = color; + } - bool get_debug_meshes() { return debug_meshes; } + bool get_debug_meshes() { + return debug_meshes; + } - void set_debug_meshes(bool meshes) { debug_meshes = meshes; } + void set_debug_meshes(bool meshes) { + debug_meshes = meshes; + } - Color get_debug_meshes_color() { return debug_meshes_color; } + Color get_debug_meshes_color() { + return debug_meshes_color; + } - void set_debug_meshes_color(const Color &color) { debug_meshes_color = color; } + void set_debug_meshes_color(const Color &color) { + debug_meshes_color = color; + } - bool get_debug_paths() { return debug_paths; } + bool get_debug_paths() { + return debug_paths; + } - void set_debug_paths(bool paths) { debug_paths = paths; } + void set_debug_paths(bool paths) { + debug_paths = paths; + } - Color get_debug_paths_color() { return debug_paths_color; } + Color get_debug_paths_color() { + return debug_paths_color; + } - void set_debug_paths_color(const Color &color) { debug_paths_color = color; } + void set_debug_paths_color(const Color &color) { + debug_paths_color = color; + } - bool get_debug_bounding_boxes() { return debug_bounding_boxes; } + bool get_debug_bounding_boxes() { + return debug_bounding_boxes; + } - void set_debug_bounding_boxes(bool paths) { debug_bounding_boxes = paths; } + void set_debug_bounding_boxes(bool paths) { + debug_bounding_boxes = paths; + } - Color get_debug_bounding_boxes_color() { return debug_bounding_boxes_color; } + Color get_debug_bounding_boxes_color() { + return debug_bounding_boxes_color; + } - void set_debug_bounding_boxes_color(const Color &color) { debug_bounding_boxes_color = color; } + void set_debug_bounding_boxes_color(const Color &color) { + debug_bounding_boxes_color = color; + } - bool get_debug_clipping() { return debug_clipping; } + bool get_debug_clipping() { + return debug_clipping; + } - void set_debug_clipping(bool clipping) { debug_clipping = clipping; } + void set_debug_clipping(bool clipping) { + debug_clipping = clipping; + } - Color get_debug_clipping_color() { return debug_clipping_color; } + Color get_debug_clipping_color() { + return debug_clipping_color; + } - void set_debug_clipping_color(const Color &color) { debug_clipping_color = color; } + void set_debug_clipping_color(const Color &color) { + debug_clipping_color = color; + } #ifndef SPINE_GODOT_EXTENSION // FIXME diff --git a/spine-godot/spine_godot/SpineTimeline.cpp b/spine-godot/spine_godot/SpineTimeline.cpp index 36bd2c8e2..c323e3b1c 100644 --- a/spine-godot/spine_godot/SpineTimeline.cpp +++ b/spine-godot/spine_godot/SpineTimeline.cpp @@ -44,8 +44,8 @@ void SpineTimeline::_bind_methods() { ClassDB::bind_method(D_METHOD("get_type"), &SpineTimeline::get_type); } -void SpineTimeline::apply(Ref skeleton, float last_time, float time, Array events, float alpha, - SpineConstant::MixBlend blend, SpineConstant::MixDirection direction) { +void SpineTimeline::apply(Ref skeleton, float last_time, float time, Array events, float alpha, SpineConstant::MixBlend blend, + SpineConstant::MixDirection direction) { SPINE_CHECK(get_spine_object(), ) if (!skeleton->get_spine_object()) return; spine::Vector spine_events; @@ -53,7 +53,8 @@ void SpineTimeline::apply(Ref skeleton, float last_time, float ti for (int i = 0; i < events.size(); ++i) { events[i] = ((Ref) spine_events[i])->get_spine_object(); } - get_spine_object()->apply(*(skeleton->get_spine_object()), last_time, time, &spine_events, alpha, (spine::MixBlend) blend, (spine::MixDirection) direction); + get_spine_object()->apply(*(skeleton->get_spine_object()), last_time, time, &spine_events, alpha, (spine::MixBlend) blend, + (spine::MixDirection) direction); } int SpineTimeline::get_frame_entries() { diff --git a/spine-godot/spine_godot/SpineTimeline.h b/spine-godot/spine_godot/SpineTimeline.h index 3affd93b3..0eb82e1a3 100644 --- a/spine-godot/spine_godot/SpineTimeline.h +++ b/spine-godot/spine_godot/SpineTimeline.h @@ -45,7 +45,8 @@ protected: static void _bind_methods(); public: - void apply(Ref skeleton, float last_time, float time, Array events, float alpha, SpineConstant::MixBlend blend, SpineConstant::MixDirection direction); + void apply(Ref skeleton, float last_time, float time, Array events, float alpha, SpineConstant::MixBlend blend, + SpineConstant::MixDirection direction); int get_frame_entries(); diff --git a/spine-godot/spine_godot/SpineTransformConstraintData.h b/spine-godot/spine_godot/SpineTransformConstraintData.h index 7b0ef7607..76adbb352 100644 --- a/spine-godot/spine_godot/SpineTransformConstraintData.h +++ b/spine-godot/spine_godot/SpineTransformConstraintData.h @@ -36,7 +36,9 @@ class SpineTransformConstraintData : public SpineConstraintData { GDCLASS(SpineTransformConstraintData, SpineConstraintData) - spine::TransformConstraintData *get_spine_constraint_data() { return (spine::TransformConstraintData *) SpineConstraintData::get_spine_object(); } + spine::TransformConstraintData *get_spine_constraint_data() { + return (spine::TransformConstraintData *) SpineConstraintData::get_spine_object(); + } protected: static void _bind_methods(); diff --git a/spine-godot/spine_godot/register_types.cpp b/spine-godot/spine_godot/register_types.cpp index f2c11c1fa..f5619739b 100644 --- a/spine-godot/spine_godot/register_types.cpp +++ b/spine-godot/spine_godot/register_types.cpp @@ -219,7 +219,8 @@ void unregister_spine_godot_types() { #ifdef SPINE_GODOT_EXTENSION -extern "C" GDExtensionBool GDE_EXPORT spine_godot_library_init(GDExtensionInterfaceGetProcAddress p_get_proc_address, GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) { +extern "C" GDExtensionBool GDE_EXPORT spine_godot_library_init(GDExtensionInterfaceGetProcAddress p_get_proc_address, + GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) { GDExtensionBinding::InitObject init_obj(p_get_proc_address, p_library, r_initialization); init_obj.register_initializer(initialize_spine_godot_module); init_obj.register_terminator(uninitialize_spine_godot_module); diff --git a/spine-ios/Sources/SpineShadersStructs/SpineShadersStructs.h b/spine-ios/Sources/SpineShadersStructs/SpineShadersStructs.h index 052b0c618..1bbc3b332 100644 --- a/spine-ios/Sources/SpineShadersStructs/SpineShadersStructs.h +++ b/spine-ios/Sources/SpineShadersStructs/SpineShadersStructs.h @@ -33,25 +33,25 @@ #include typedef enum SpineVertexInputIndex { - SpineVertexInputIndexVertices = 0, - SpineVertexInputIndexTransform = 1, - SpineVertexInputIndexViewportSize = 2, + SpineVertexInputIndexVertices = 0, + SpineVertexInputIndexTransform = 1, + SpineVertexInputIndexViewportSize = 2, } SpineVertexInputIndex; typedef enum SpineTextureIndex { - SpineTextureIndexBaseColor = 0, + SpineTextureIndexBaseColor = 0, } SpineTextureIndex; typedef struct { - simd_float2 position; - simd_float4 color; - simd_float2 uv; + simd_float2 position; + simd_float4 color; + simd_float2 uv; } SpineVertex; typedef struct { - vector_float2 translation; - vector_float2 scale; - vector_float2 offset; + vector_float2 translation; + vector_float2 scale; + vector_float2 offset; } SpineTransform; #endif /* SpineShadersStructs_h */ diff --git a/spine-sdl/example/main.cpp b/spine-sdl/example/main.cpp index cee70a7da..7ac0f9a14 100644 --- a/spine-sdl/example/main.cpp +++ b/spine-sdl/example/main.cpp @@ -41,8 +41,7 @@ int main() { printf("Error: %s", SDL_GetError()); return -1; } - SDL_Window *window = SDL_CreateWindow("Spine SDL", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, - 0); + SDL_Window *window = SDL_CreateWindow("Spine SDL", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, 0); if (!window) { printf("Error: %s", SDL_GetError()); return -1; diff --git a/spine-sdl/src/spine-sdl-c.c b/spine-sdl/src/spine-sdl-c.c index 3184c372f..800576dd6 100644 --- a/spine-sdl/src/spine-sdl-c.c +++ b/spine-sdl/src/spine-sdl-c.c @@ -162,8 +162,7 @@ void spSkeletonDrawable_draw(spSkeletonDrawable *self, struct SDL_Renderer *rend spSdlVertexArray_add(self->sdlVertices, sdlVertex); } spIntArray_clear(self->sdlIndices); - for (int ii = 0; ii < (int) indicesCount; ii++) - spIntArray_add(self->sdlIndices, indices[ii]); + for (int ii = 0; ii < (int) indicesCount; ii++) spIntArray_add(self->sdlIndices, indices[ii]); if (!self->usePremultipliedAlpha) { switch (slot->data->blendMode) { @@ -184,25 +183,27 @@ void spSkeletonDrawable_draw(spSkeletonDrawable *self, struct SDL_Renderer *rend SDL_BlendMode target; switch (slot->data->blendMode) { case SP_BLEND_MODE_NORMAL: - target = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD); + target = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, + SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD); SDL_SetTextureBlendMode(texture, target); break; case SP_BLEND_MODE_MULTIPLY: SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_MOD); break; case SP_BLEND_MODE_ADDITIVE: - target = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD, SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD); + target = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD, SDL_BLENDFACTOR_ONE, + SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD); SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_ADD); break; case SP_BLEND_MODE_SCREEN: - target = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD); + target = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, + SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD); SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); break; } } - SDL_RenderGeometry(renderer, texture, self->sdlVertices->items, self->sdlVertices->size, self->sdlIndices->items, - indicesCount); + SDL_RenderGeometry(renderer, texture, self->sdlVertices->items, self->sdlVertices->size, self->sdlIndices->items, indicesCount); spSkeletonClipping_clipEnd(clipper, slot); } spSkeletonClipping_clipEnd2(clipper); diff --git a/spine-sdl/src/spine-sdl-cpp.cpp b/spine-sdl/src/spine-sdl-cpp.cpp index 0662df2c6..e447b40da 100644 --- a/spine-sdl/src/spine-sdl-cpp.cpp +++ b/spine-sdl/src/spine-sdl-cpp.cpp @@ -87,8 +87,7 @@ void SkeletonDrawable::draw(SDL_Renderer *renderer) { } sdlIndices.clear(); uint16_t *indices = command->indices; - for (int ii = 0; ii < command->numIndices; ii++) - sdlIndices.add(indices[ii]); + for (int ii = 0; ii < command->numIndices; ii++) sdlIndices.add(indices[ii]); BlendMode blendMode = command->blendMode; SDL_Texture *texture = (SDL_Texture *) command->texture; @@ -111,25 +110,27 @@ void SkeletonDrawable::draw(SDL_Renderer *renderer) { SDL_BlendMode target; switch (blendMode) { case BlendMode_Normal: - target = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD); + target = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, + SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD); SDL_SetTextureBlendMode(texture, target); break; case BlendMode_Multiply: SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_MOD); break; case BlendMode_Additive: - target = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD, SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD); + target = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD, SDL_BLENDFACTOR_ONE, + SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD); SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_ADD); break; case BlendMode_Screen: - target = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD); + target = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, + SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD); SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); break; } } - SDL_RenderGeometry(renderer, texture, sdlVertices.buffer(), sdlVertices.size(), sdlIndices.buffer(), - command->numIndices); + SDL_RenderGeometry(renderer, texture, sdlVertices.buffer(), sdlVertices.size(), sdlIndices.buffer(), command->numIndices); command = command->next; } } @@ -138,8 +139,7 @@ SDL_Texture *loadTexture(SDL_Renderer *renderer, const String &path) { int width, height, components; stbi_uc *imageData = stbi_load(path.buffer(), &width, &height, &components, 4); if (!imageData) return nullptr; - SDL_Texture *texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ABGR8888, SDL_TEXTUREACCESS_STATIC, width, - height); + SDL_Texture *texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ABGR8888, SDL_TEXTUREACCESS_STATIC, width, height); if (!texture) { stbi_image_free(imageData); return nullptr; diff --git a/spine-sdl/src/stb_image.h b/spine-sdl/src/stb_image.h index 295bdfaac..fc1c62bd1 100644 --- a/spine-sdl/src/stb_image.h +++ b/spine-sdl/src/stb_image.h @@ -404,11 +404,11 @@ extern "C" { // load image by filename, open file, or memory buffer // -typedef struct -{ - int (*read)(void *user, char *data, int size);// fill 'data' with 'size' bytes. return number of bytes actually read - void (*skip)(void *user, int n); // skip the next 'n' bytes, or 'unget' the last -n bytes if negative - int (*eof)(void *user); // returns nonzero if we are at end of file/data +typedef struct { + int (*read)(void *user, char *data, + int size); // fill 'data' with 'size' bytes. return number of bytes actually read + void (*skip)(void *user, int n);// skip the next 'n' bytes, or 'unget' the last -n bytes if negative + int (*eof)(void *user); // returns nonzero if we are at end of file/data } stbi_io_callbacks; //////////////////////////////////// @@ -541,7 +541,8 @@ STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char #ifdef STB_IMAGE_IMPLEMENTATION -#if defined(STBI_ONLY_JPEG) || defined(STBI_ONLY_PNG) || defined(STBI_ONLY_BMP) || defined(STBI_ONLY_TGA) || defined(STBI_ONLY_GIF) || defined(STBI_ONLY_PSD) || defined(STBI_ONLY_HDR) || defined(STBI_ONLY_PIC) || defined(STBI_ONLY_PNM) || defined(STBI_ONLY_ZLIB) +#if defined(STBI_ONLY_JPEG) || defined(STBI_ONLY_PNG) || defined(STBI_ONLY_BMP) || defined(STBI_ONLY_TGA) || defined(STBI_ONLY_GIF) || \ + defined(STBI_ONLY_PSD) || defined(STBI_ONLY_HDR) || defined(STBI_ONLY_PIC) || defined(STBI_ONLY_PNM) || defined(STBI_ONLY_ZLIB) #ifndef STBI_ONLY_JPEG #define STBI_NO_JPEG #endif @@ -659,7 +660,7 @@ typedef unsigned char validate_uint32[sizeof(stbi__uint32) == 4 ? 1 : -1]; #ifdef STBI_HAS_LROTL #define stbi_lrot(x, y) _lrotl(x, y) #else -#define stbi_lrot(x, y) (((x) << (y)) | ((x) >> (-(y) &31))) +#define stbi_lrot(x, y) (((x) << (y)) | ((x) >> (-(y) & 31))) #endif #if defined(STBI_MALLOC) && defined(STBI_FREE) && (defined(STBI_REALLOC) || defined(STBI_REALLOC_SIZED)) @@ -790,8 +791,7 @@ static int stbi__sse2_available(void) { // stbi__context structure is our basic context used by all images, so it // contains all the IO context, plus some basic image information -typedef struct -{ +typedef struct { stbi__uint32 img_x, img_y; int img_n, img_out_n; @@ -850,11 +850,10 @@ static int stbi__stdio_eof(void *user) { return feof((FILE *) user) || ferror((FILE *) user); } -static stbi_io_callbacks stbi__stdio_callbacks = - { - stbi__stdio_read, - stbi__stdio_skip, - stbi__stdio_eof, +static stbi_io_callbacks stbi__stdio_callbacks = { + stbi__stdio_read, + stbi__stdio_skip, + stbi__stdio_eof, }; static void stbi__start_file(stbi__context *s, FILE *f) { @@ -878,8 +877,7 @@ enum { STBI_ORDER_BGR }; -typedef struct -{ +typedef struct { int bits_per_channel; int num_channels; int channel_order; @@ -945,9 +943,9 @@ static int stbi__pnm_is16(stbi__context *s); static #ifdef STBI_THREAD_LOCAL - STBI_THREAD_LOCAL + STBI_THREAD_LOCAL #endif - const char *stbi__g_failure_reason; + const char *stbi__g_failure_reason; STBIDEF const char *stbi_failure_reason(void) { return stbi__g_failure_reason; @@ -1003,15 +1001,14 @@ static int stbi__mad2sizes_valid(int a, int b, int add) { // returns 1 if "a*b*c + add" has no negative terms/factors and doesn't overflow static int stbi__mad3sizes_valid(int a, int b, int c, int add) { - return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a * b, c) && - stbi__addsizes_valid(a * b * c, add); + return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a * b, c) && stbi__addsizes_valid(a * b * c, add); } // returns 1 if "a*b*c*d + add" has no negative terms/factors and doesn't overflow #if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR) || !defined(STBI_NO_PNM) static int stbi__mad4sizes_valid(int a, int b, int c, int d, int add) { - return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a * b, c) && - stbi__mul2sizes_valid(a * b * c, d) && stbi__addsizes_valid(a * b * c * d, add); + return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a * b, c) && stbi__mul2sizes_valid(a * b * c, d) && + stbi__addsizes_valid(a * b * c * d, add); } #endif @@ -1078,9 +1075,7 @@ STBIDEF void stbi_set_flip_vertically_on_load_thread(int flag_true_if_should_fli stbi__vertically_flip_on_load_set = 1; } -#define stbi__vertically_flip_on_load (stbi__vertically_flip_on_load_set \ - ? stbi__vertically_flip_on_load_local \ - : stbi__vertically_flip_on_load_global) +#define stbi__vertically_flip_on_load (stbi__vertically_flip_on_load_set ? stbi__vertically_flip_on_load_local : stbi__vertically_flip_on_load_global) #endif// STBI_THREAD_LOCAL static void *stbi__load_main(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc) { @@ -1128,8 +1123,7 @@ static void *stbi__load_main(stbi__context *s, int *x, int *y, int *comp, int re #ifndef STBI_NO_TGA // test tga last because it's a crappy test! - if (stbi__tga_test(s)) - return stbi__tga_load(s, x, y, comp, req_comp, ri); + if (stbi__tga_test(s)) return stbi__tga_load(s, x, y, comp, req_comp, ri); #endif return stbi__errpuc("unknown image type", "Image not of any known type, or corrupt"); @@ -1143,8 +1137,7 @@ static stbi_uc *stbi__convert_16_to_8(stbi__uint16 *orig, int w, int h, int chan reduced = (stbi_uc *) stbi__malloc(img_len); if (reduced == NULL) return stbi__errpuc("outofmem", "Out of memory"); - for (i = 0; i < img_len; ++i) - reduced[i] = (stbi_uc) ((orig[i] >> 8) & 0xFF);// top half of each byte is sufficient approx of 16->8 bit scaling + for (i = 0; i < img_len; ++i) reduced[i] = (stbi_uc) ((orig[i] >> 8) & 0xFF);// top half of each byte is sufficient approx of 16->8 bit scaling STBI_FREE(orig); return reduced; @@ -1158,8 +1151,7 @@ static stbi__uint16 *stbi__convert_8_to_16(stbi_uc *orig, int w, int h, int chan enlarged = (stbi__uint16 *) stbi__malloc(img_len * 2); if (enlarged == NULL) return (stbi__uint16 *) stbi__errpuc("outofmem", "Out of memory"); - for (i = 0; i < img_len; ++i) - enlarged[i] = (stbi__uint16) ((orig[i] << 8) + orig[i]);// replicate to high and low byte, maps 0->0, 255->0xffff + for (i = 0; i < img_len; ++i) enlarged[i] = (stbi__uint16) ((orig[i] << 8) + orig[i]);// replicate to high and low byte, maps 0->0, 255->0xffff STBI_FREE(orig); return enlarged; @@ -1205,8 +1197,7 @@ static unsigned char *stbi__load_and_postprocess_8bit(stbi__context *s, int *x, stbi__result_info ri; void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 8); - if (result == NULL) - return NULL; + if (result == NULL) return NULL; // it is the responsibility of the loaders to make sure we get either 8 or 16 bit. STBI_ASSERT(ri.bits_per_channel == 8 || ri.bits_per_channel == 16); @@ -1230,8 +1221,7 @@ static stbi__uint16 *stbi__load_and_postprocess_16bit(stbi__context *s, int *x, stbi__result_info ri; void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 16); - if (result == NULL) - return NULL; + if (result == NULL) return NULL; // it is the responsibility of the loaders to make sure we get either 8 or 16 bit. STBI_ASSERT(ri.bits_per_channel == 8 || ri.bits_per_channel == 16); @@ -1264,8 +1254,11 @@ static void stbi__float_postprocess(float *result, int *x, int *y, int *comp, in #ifndef STBI_NO_STDIO #if defined(_WIN32) && defined(STBI_WINDOWS_UTF8) -STBI_EXTERN __declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int cp, unsigned long flags, const char *str, int cbmb, wchar_t *widestr, int cchwide); -STBI_EXTERN __declspec(dllimport) int __stdcall WideCharToMultiByte(unsigned int cp, unsigned long flags, const wchar_t *widestr, int cchwide, char *str, int cbmb, const char *defchar, int *used_default); +STBI_EXTERN +__declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int cp, unsigned long flags, const char *str, int cbmb, wchar_t *widestr, + int cchwide); +STBI_EXTERN __declspec(dllimport) int __stdcall WideCharToMultiByte(unsigned int cp, unsigned long flags, const wchar_t *widestr, int cchwide, + char *str, int cbmb, const char *defchar, int *used_default); #endif #if defined(_WIN32) && defined(STBI_WINDOWS_UTF8) @@ -1279,22 +1272,18 @@ static FILE *stbi__fopen(char const *filename, char const *mode) { #if defined(_WIN32) && defined(STBI_WINDOWS_UTF8) wchar_t wMode[64]; wchar_t wFilename[1024]; - if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, filename, -1, wFilename, sizeof(wFilename) / sizeof(*wFilename))) - return 0; + if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, filename, -1, wFilename, sizeof(wFilename) / sizeof(*wFilename))) return 0; - if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, mode, -1, wMode, sizeof(wMode) / sizeof(*wMode))) - return 0; + if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, mode, -1, wMode, sizeof(wMode) / sizeof(*wMode))) return 0; #if defined(_MSC_VER) && _MSC_VER >= 1400 - if (0 != _wfopen_s(&f, wFilename, wMode)) - f = 0; + if (0 != _wfopen_s(&f, wFilename, wMode)) f = 0; #else f = _wfopen(wFilename, wMode); #endif #elif defined(_MSC_VER) && _MSC_VER >= 1400 - if (0 != fopen_s(&f, filename, mode)) - f = 0; + if (0 != fopen_s(&f, filename, mode)) f = 0; #else f = fopen(filename, mode); #endif @@ -1393,14 +1382,12 @@ static float *stbi__loadf_main(stbi__context *s, int *x, int *y, int *comp, int if (stbi__hdr_test(s)) { stbi__result_info ri; float *hdr_data = stbi__hdr_load(s, x, y, comp, req_comp, &ri); - if (hdr_data) - stbi__float_postprocess(hdr_data, x, y, comp, req_comp); + if (hdr_data) stbi__float_postprocess(hdr_data, x, y, comp, req_comp); return hdr_data; } #endif data = stbi__load_and_postprocess_8bit(s, x, y, comp, req_comp); - if (data) - return stbi__ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp); + if (data) return stbi__ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp); return stbi__errpf("unknown image type", "Image not of any known type, or corrupt"); } @@ -1493,14 +1480,22 @@ STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user #ifndef STBI_NO_LINEAR static float stbi__l2h_gamma = 2.2f, stbi__l2h_scale = 1.0f; -STBIDEF void stbi_ldr_to_hdr_gamma(float gamma) { stbi__l2h_gamma = gamma; } -STBIDEF void stbi_ldr_to_hdr_scale(float scale) { stbi__l2h_scale = scale; } +STBIDEF void stbi_ldr_to_hdr_gamma(float gamma) { + stbi__l2h_gamma = gamma; +} +STBIDEF void stbi_ldr_to_hdr_scale(float scale) { + stbi__l2h_scale = scale; +} #endif static float stbi__h2l_gamma_i = 1.0f / 2.2f, stbi__h2l_scale_i = 1.0f; -STBIDEF void stbi_hdr_to_ldr_gamma(float gamma) { stbi__h2l_gamma_i = 1 / gamma; } -STBIDEF void stbi_hdr_to_ldr_scale(float scale) { stbi__h2l_scale_i = 1 / scale; } +STBIDEF void stbi_hdr_to_ldr_gamma(float gamma) { + stbi__h2l_gamma_i = 1 / gamma; +} +STBIDEF void stbi_hdr_to_ldr_scale(float scale) { + stbi__h2l_scale_i = 1 / scale; +} ////////////////////////////////////////////////////////////////////////////// @@ -1531,8 +1526,7 @@ static void stbi__refill_buffer(stbi__context *s) { } stbi_inline static stbi_uc stbi__get8(stbi__context *s) { - if (s->img_buffer < s->img_buffer_end) - return *s->img_buffer++; + if (s->img_buffer < s->img_buffer_end) return *s->img_buffer++; if (s->read_from_callbacks) { stbi__refill_buffer(s); return *s->img_buffer++; @@ -1555,7 +1549,8 @@ stbi_inline static int stbi__at_eof(stbi__context *s) { } #endif -#if defined(STBI_NO_JPEG) && defined(STBI_NO_PNG) && defined(STBI_NO_BMP) && defined(STBI_NO_PSD) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) && defined(STBI_NO_PIC) +#if defined(STBI_NO_JPEG) && defined(STBI_NO_PNG) && defined(STBI_NO_BMP) && defined(STBI_NO_PSD) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) && \ + defined(STBI_NO_PIC) // nothing #else static void stbi__skip(stbi__context *s, int n) { @@ -1638,9 +1633,10 @@ static stbi__uint32 stbi__get32le(stbi__context *s) { } #endif -#define STBI__BYTECAST(x) ((stbi_uc) ((x) &255))// truncate int to byte without warnings +#define STBI__BYTECAST(x) ((stbi_uc) ((x) & 255))// truncate int to byte without warnings -#if defined(STBI_NO_JPEG) && defined(STBI_NO_PNG) && defined(STBI_NO_BMP) && defined(STBI_NO_PSD) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) && defined(STBI_NO_PIC) && defined(STBI_NO_PNM) +#if defined(STBI_NO_JPEG) && defined(STBI_NO_PNG) && defined(STBI_NO_BMP) && defined(STBI_NO_PSD) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) && \ + defined(STBI_NO_PIC) && defined(STBI_NO_PNM) // nothing #else ////////////////////////////////////////////////////////////////////////////// @@ -1659,7 +1655,8 @@ static stbi_uc stbi__compute_y(int r, int g, int b) { } #endif -#if defined(STBI_NO_PNG) && defined(STBI_NO_BMP) && defined(STBI_NO_PSD) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) && defined(STBI_NO_PIC) && defined(STBI_NO_PNM) +#if defined(STBI_NO_PNG) && defined(STBI_NO_BMP) && defined(STBI_NO_PSD) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) && defined(STBI_NO_PIC) && \ + defined(STBI_NO_PNM) // nothing #else static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int req_comp, unsigned int x, unsigned int y) { @@ -1679,9 +1676,9 @@ static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int r unsigned char *src = data + j * x * img_n; unsigned char *dest = good + j * x * req_comp; -#define STBI__COMBO(a, b) ((a) *8 + (b)) -#define STBI__CASE(a, b) \ - case STBI__COMBO(a, b): \ +#define STBI__COMBO(a, b) ((a) * 8 + (b)) +#define STBI__CASE(a, b) \ + case STBI__COMBO(a, b): \ for (i = x - 1; i >= 0; --i, src += a, dest += b) // convert source image with img_n components to one with req_comp components; // avoid switch per pixel, so use switch per scanline and massive macros @@ -1691,16 +1688,22 @@ static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int r dest[1] = 255; } break; - STBI__CASE(1, 3) { dest[0] = dest[1] = dest[2] = src[0]; } + STBI__CASE(1, 3) { + dest[0] = dest[1] = dest[2] = src[0]; + } break; STBI__CASE(1, 4) { dest[0] = dest[1] = dest[2] = src[0]; dest[3] = 255; } break; - STBI__CASE(2, 1) { dest[0] = src[0]; } + STBI__CASE(2, 1) { + dest[0] = src[0]; + } break; - STBI__CASE(2, 3) { dest[0] = dest[1] = dest[2] = src[0]; } + STBI__CASE(2, 3) { + dest[0] = dest[1] = dest[2] = src[0]; + } break; STBI__CASE(2, 4) { dest[0] = dest[1] = dest[2] = src[0]; @@ -1714,14 +1717,18 @@ static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int r dest[3] = 255; } break; - STBI__CASE(3, 1) { dest[0] = stbi__compute_y(src[0], src[1], src[2]); } + STBI__CASE(3, 1) { + dest[0] = stbi__compute_y(src[0], src[1], src[2]); + } break; STBI__CASE(3, 2) { dest[0] = stbi__compute_y(src[0], src[1], src[2]); dest[1] = 255; } break; - STBI__CASE(4, 1) { dest[0] = stbi__compute_y(src[0], src[1], src[2]); } + STBI__CASE(4, 1) { + dest[0] = stbi__compute_y(src[0], src[1], src[2]); + } break; STBI__CASE(4, 2) { dest[0] = stbi__compute_y(src[0], src[1], src[2]); @@ -1776,9 +1783,9 @@ static stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_n, int r stbi__uint16 *src = data + j * x * img_n; stbi__uint16 *dest = good + j * x * req_comp; -#define STBI__COMBO(a, b) ((a) *8 + (b)) -#define STBI__CASE(a, b) \ - case STBI__COMBO(a, b): \ +#define STBI__COMBO(a, b) ((a) * 8 + (b)) +#define STBI__CASE(a, b) \ + case STBI__COMBO(a, b): \ for (i = x - 1; i >= 0; --i, src += a, dest += b) // convert source image with img_n components to one with req_comp components; // avoid switch per pixel, so use switch per scanline and massive macros @@ -1788,16 +1795,22 @@ static stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_n, int r dest[1] = 0xffff; } break; - STBI__CASE(1, 3) { dest[0] = dest[1] = dest[2] = src[0]; } + STBI__CASE(1, 3) { + dest[0] = dest[1] = dest[2] = src[0]; + } break; STBI__CASE(1, 4) { dest[0] = dest[1] = dest[2] = src[0]; dest[3] = 0xffff; } break; - STBI__CASE(2, 1) { dest[0] = src[0]; } + STBI__CASE(2, 1) { + dest[0] = src[0]; + } break; - STBI__CASE(2, 3) { dest[0] = dest[1] = dest[2] = src[0]; } + STBI__CASE(2, 3) { + dest[0] = dest[1] = dest[2] = src[0]; + } break; STBI__CASE(2, 4) { dest[0] = dest[1] = dest[2] = src[0]; @@ -1811,14 +1824,18 @@ static stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_n, int r dest[3] = 0xffff; } break; - STBI__CASE(3, 1) { dest[0] = stbi__compute_y_16(src[0], src[1], src[2]); } + STBI__CASE(3, 1) { + dest[0] = stbi__compute_y_16(src[0], src[1], src[2]); + } break; STBI__CASE(3, 2) { dest[0] = stbi__compute_y_16(src[0], src[1], src[2]); dest[1] = 0xffff; } break; - STBI__CASE(4, 1) { dest[0] = stbi__compute_y_16(src[0], src[1], src[2]); } + STBI__CASE(4, 1) { + dest[0] = stbi__compute_y_16(src[0], src[1], src[2]); + } break; STBI__CASE(4, 2) { dest[0] = stbi__compute_y_16(src[0], src[1], src[2]); @@ -1856,7 +1873,8 @@ static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp) { return stbi__errpf("outofmem", "Out of memory"); } // compute number of non-alpha components - if (comp & 1) n = comp; + if (comp & 1) + n = comp; else n = comp - 1; for (i = 0; i < x * y; ++i) { @@ -1886,7 +1904,8 @@ static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp) { return stbi__errpuc("outofmem", "Out of memory"); } // compute number of non-alpha components - if (comp & 1) n = comp; + if (comp & 1) + n = comp; else n = comp - 1; for (i = 0; i < x * y; ++i) { @@ -1934,8 +1953,7 @@ static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp) { // huffman decoding acceleration #define FAST_BITS 9// larger handles more cases; smaller stomps less cache -typedef struct -{ +typedef struct { stbi_uc fast[1 << FAST_BITS]; // weirdly, repacking this into AoS is a 10% speed loss, instead of a win stbi__uint16 code[256]; @@ -1945,8 +1963,7 @@ typedef struct int delta[17];// old 'firstsymbol' - old 'firstcode' } stbi__huffman; -typedef struct -{ +typedef struct { stbi__context *s; stbi__huffman huff_dc[4]; stbi__huffman huff_ac[4]; @@ -1959,8 +1976,7 @@ typedef struct int img_mcu_w, img_mcu_h; // definition of jpeg image component - struct - { + struct { int id; int h, v; int tq; @@ -2004,8 +2020,7 @@ static int stbi__build_huffman(stbi__huffman *h, int *count) { unsigned int code; // build size list for each symbol (from JPEG spec) for (i = 0; i < 16; ++i) - for (j = 0; j < count[i]; ++j) - h->size[k++] = (stbi_uc) (i + 1); + for (j = 0; j < count[i]; ++j) h->size[k++] = (stbi_uc) (i + 1); h->size[k] = 0; // compute actual symbols (from jpeg spec) @@ -2015,8 +2030,7 @@ static int stbi__build_huffman(stbi__huffman *h, int *count) { // compute delta to add to code to compute symbol id h->delta[j] = k - code; if (h->size[k] == j) { - while (h->size[k] == j) - h->code[k++] = (stbi__uint16) (code++); + while (h->size[k] == j) h->code[k++] = (stbi__uint16) (code++); if (code - 1 >= (1u << j)) return stbi__err("bad code lengths", "Corrupt JPEG"); } // compute largest code + 1 for this size, preshifted as needed later @@ -2059,8 +2073,7 @@ static void stbi__build_fast_ac(stbi__int16 *fast_ac, stbi__huffman *h) { int m = 1 << (magbits - 1); if (k < m) k += (~0U << magbits) + 1; // if the result is small enough, we can fit it in fast_ac table - if (k >= -128 && k <= 127) - fast_ac[i] = (stbi__int16) ((k * 256) + (run * 16) + (len + magbits)); + if (k >= -128 && k <= 127) fast_ac[i] = (stbi__int16) ((k * 256) + (run * 16) + (len + magbits)); } } } @@ -2099,8 +2112,7 @@ stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h) { k = h->fast[c]; if (k < 255) { int s = h->size[k]; - if (s > j->code_bits) - return -1; + if (s > j->code_bits) return -1; j->code_buffer <<= s; j->code_bits -= s; return h->values[k]; @@ -2114,16 +2126,14 @@ stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h) { // that way we don't need to shift inside the loop. temp = j->code_buffer >> 16; for (k = FAST_BITS + 1;; ++k) - if (temp < h->maxcode[k]) - break; + if (temp < h->maxcode[k]) break; if (k == 17) { // error! code not found j->code_bits -= 16; return -1; } - if (k > j->code_bits) - return -1; + if (k > j->code_bits) return -1; // convert the huffman code to the symbol id c = ((j->code_buffer >> (32 - k)) & stbi__bmask[k]) + h->delta[k]; @@ -2175,22 +2185,15 @@ stbi_inline static int stbi__jpeg_get_bit(stbi__jpeg *j) { // given a value that's at position X in the zigzag stream, // where does it appear in the 8x8 matrix coded as row-major? -static const stbi_uc stbi__jpeg_dezigzag[64 + 15] = - { - 0, 1, 8, 16, 9, 2, 3, 10, - 17, 24, 32, 25, 18, 11, 4, 5, - 12, 19, 26, 33, 40, 48, 41, 34, - 27, 20, 13, 6, 7, 14, 21, 28, - 35, 42, 49, 56, 57, 50, 43, 36, - 29, 22, 15, 23, 30, 37, 44, 51, - 58, 59, 52, 45, 38, 31, 39, 46, - 53, 60, 61, 54, 47, 55, 62, 63, - // let corrupt input sample past end - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63}; +static const stbi_uc stbi__jpeg_dezigzag[64 + 15] = {0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, + 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, + 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63, + // let corrupt input sample past end + 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63}; // decode one 64-entry block-- -static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman *hdc, stbi__huffman *hac, stbi__int16 *fac, int b, stbi__uint16 *dequant) { +static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman *hdc, stbi__huffman *hac, stbi__int16 *fac, int b, + stbi__uint16 *dequant) { int diff, dc, k; int t; @@ -2260,8 +2263,7 @@ static int stbi__jpeg_decode_block_prog_dc(stbi__jpeg *j, short data[64], stbi__ data[0] = (short) (dc * (1 << j->succ_low)); } else { // refinement scan for DC coefficient - if (stbi__jpeg_get_bit(j)) - data[0] += (short) (1 << j->succ_low); + if (stbi__jpeg_get_bit(j)) data[0] += (short) (1 << j->succ_low); } return 1; } @@ -2302,8 +2304,7 @@ static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64], stbi__ if (s == 0) { if (r < 15) { j->eob_run = (1 << r); - if (r) - j->eob_run += stbi__jpeg_get_bits(j, r); + if (r) j->eob_run += stbi__jpeg_get_bits(j, r); --j->eob_run; break; } @@ -2344,8 +2345,7 @@ static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64], stbi__ if (s == 0) { if (r < 15) { j->eob_run = (1 << r) - 1; - if (r) - j->eob_run += stbi__jpeg_get_bits(j, r); + if (r) j->eob_run += stbi__jpeg_get_bits(j, r); r = 64;// force end of block } else { // r=15 s=0 should write 16 0s, so we just do @@ -2396,45 +2396,45 @@ stbi_inline static stbi_uc stbi__clamp(int x) { return (stbi_uc) x; } -#define stbi__f2f(x) ((int) (((x) *4096 + 0.5))) -#define stbi__fsh(x) ((x) *4096) +#define stbi__f2f(x) ((int) (((x) * 4096 + 0.5))) +#define stbi__fsh(x) ((x) * 4096) // derived from jidctint -- DCT_ISLOW -#define STBI__IDCT_1D(s0, s1, s2, s3, s4, s5, s6, s7) \ - int t0, t1, t2, t3, p1, p2, p3, p4, p5, x0, x1, x2, x3; \ - p2 = s2; \ - p3 = s6; \ - p1 = (p2 + p3) * stbi__f2f(0.5411961f); \ - t2 = p1 + p3 * stbi__f2f(-1.847759065f); \ - t3 = p1 + p2 * stbi__f2f(0.765366865f); \ - p2 = s0; \ - p3 = s4; \ - t0 = stbi__fsh(p2 + p3); \ - t1 = stbi__fsh(p2 - p3); \ - x0 = t0 + t3; \ - x3 = t0 - t3; \ - x1 = t1 + t2; \ - x2 = t1 - t2; \ - t0 = s7; \ - t1 = s5; \ - t2 = s3; \ - t3 = s1; \ - p3 = t0 + t2; \ - p4 = t1 + t3; \ - p1 = t0 + t3; \ - p2 = t1 + t2; \ - p5 = (p3 + p4) * stbi__f2f(1.175875602f); \ - t0 = t0 * stbi__f2f(0.298631336f); \ - t1 = t1 * stbi__f2f(2.053119869f); \ - t2 = t2 * stbi__f2f(3.072711026f); \ - t3 = t3 * stbi__f2f(1.501321110f); \ - p1 = p5 + p1 * stbi__f2f(-0.899976223f); \ - p2 = p5 + p2 * stbi__f2f(-2.562915447f); \ - p3 = p3 * stbi__f2f(-1.961570560f); \ - p4 = p4 * stbi__f2f(-0.390180644f); \ - t3 += p1 + p4; \ - t2 += p2 + p3; \ - t1 += p2 + p4; \ +#define STBI__IDCT_1D(s0, s1, s2, s3, s4, s5, s6, s7) \ + int t0, t1, t2, t3, p1, p2, p3, p4, p5, x0, x1, x2, x3; \ + p2 = s2; \ + p3 = s6; \ + p1 = (p2 + p3) * stbi__f2f(0.5411961f); \ + t2 = p1 + p3 * stbi__f2f(-1.847759065f); \ + t3 = p1 + p2 * stbi__f2f(0.765366865f); \ + p2 = s0; \ + p3 = s4; \ + t0 = stbi__fsh(p2 + p3); \ + t1 = stbi__fsh(p2 - p3); \ + x0 = t0 + t3; \ + x3 = t0 - t3; \ + x1 = t1 + t2; \ + x2 = t1 - t2; \ + t0 = s7; \ + t1 = s5; \ + t2 = s3; \ + t3 = s1; \ + p3 = t0 + t2; \ + p4 = t1 + t3; \ + p1 = t0 + t3; \ + p2 = t1 + t2; \ + p5 = (p3 + p4) * stbi__f2f(1.175875602f); \ + t0 = t0 * stbi__f2f(0.298631336f); \ + t1 = t1 * stbi__f2f(2.053119869f); \ + t2 = t2 * stbi__f2f(3.072711026f); \ + t3 = t3 * stbi__f2f(1.501321110f); \ + p1 = p5 + p1 * stbi__f2f(-0.899976223f); \ + p2 = p5 + p2 * stbi__f2f(-2.562915447f); \ + p3 = p3 * stbi__f2f(-1.961570560f); \ + p4 = p4 * stbi__f2f(-0.390180644f); \ + t3 += p1 + p4; \ + t2 += p2 + p3; \ + t1 += p2 + p4; \ t0 += p1 + p3; static void stbi__idct_block(stbi_uc *out, int out_stride, short data[64]) { @@ -2511,78 +2511,78 @@ static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64]) { // out(0) = c0[even]*x + c0[odd]*y (c0, x, y 16-bit, out 32-bit) // out(1) = c1[even]*x + c1[odd]*y -#define dct_rot(out0, out1, x, y, c0, c1) \ - __m128i c0##lo = _mm_unpacklo_epi16((x), (y)); \ - __m128i c0##hi = _mm_unpackhi_epi16((x), (y)); \ - __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \ - __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \ - __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \ +#define dct_rot(out0, out1, x, y, c0, c1) \ + __m128i c0##lo = _mm_unpacklo_epi16((x), (y)); \ + __m128i c0##hi = _mm_unpackhi_epi16((x), (y)); \ + __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \ + __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \ + __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \ __m128i out1##_h = _mm_madd_epi16(c0##hi, c1) // out = in << 12 (in 16-bit, out 32-bit) -#define dct_widen(out, in) \ - __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \ +#define dct_widen(out, in) \ + __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \ __m128i out##_h = _mm_srai_epi32(_mm_unpackhi_epi16(_mm_setzero_si128(), (in)), 4) // wide add -#define dct_wadd(out, a, b) \ - __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \ +#define dct_wadd(out, a, b) \ + __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \ __m128i out##_h = _mm_add_epi32(a##_h, b##_h) // wide sub -#define dct_wsub(out, a, b) \ - __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \ +#define dct_wsub(out, a, b) \ + __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \ __m128i out##_h = _mm_sub_epi32(a##_h, b##_h) // butterfly a/b, add bias, then shift by "s" and pack -#define dct_bfly32o(out0, out1, a, b, bias, s) \ - { \ - __m128i abiased_l = _mm_add_epi32(a##_l, bias); \ - __m128i abiased_h = _mm_add_epi32(a##_h, bias); \ - dct_wadd(sum, abiased, b); \ - dct_wsub(dif, abiased, b); \ - out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \ - out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \ +#define dct_bfly32o(out0, out1, a, b, bias, s) \ + { \ + __m128i abiased_l = _mm_add_epi32(a##_l, bias); \ + __m128i abiased_h = _mm_add_epi32(a##_h, bias); \ + dct_wadd(sum, abiased, b); \ + dct_wsub(dif, abiased, b); \ + out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \ + out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \ } // 8-bit interleave step (for transposes) -#define dct_interleave8(a, b) \ - tmp = a; \ - a = _mm_unpacklo_epi8(a, b); \ +#define dct_interleave8(a, b) \ + tmp = a; \ + a = _mm_unpacklo_epi8(a, b); \ b = _mm_unpackhi_epi8(tmp, b) // 16-bit interleave step (for transposes) -#define dct_interleave16(a, b) \ - tmp = a; \ - a = _mm_unpacklo_epi16(a, b); \ +#define dct_interleave16(a, b) \ + tmp = a; \ + a = _mm_unpacklo_epi16(a, b); \ b = _mm_unpackhi_epi16(tmp, b) -#define dct_pass(bias, shift) \ - { \ - /* even part */ \ - dct_rot(t2e, t3e, row2, row6, rot0_0, rot0_1); \ - __m128i sum04 = _mm_add_epi16(row0, row4); \ - __m128i dif04 = _mm_sub_epi16(row0, row4); \ - dct_widen(t0e, sum04); \ - dct_widen(t1e, dif04); \ - dct_wadd(x0, t0e, t3e); \ - dct_wsub(x3, t0e, t3e); \ - dct_wadd(x1, t1e, t2e); \ - dct_wsub(x2, t1e, t2e); \ - /* odd part */ \ - dct_rot(y0o, y2o, row7, row3, rot2_0, rot2_1); \ - dct_rot(y1o, y3o, row5, row1, rot3_0, rot3_1); \ - __m128i sum17 = _mm_add_epi16(row1, row7); \ - __m128i sum35 = _mm_add_epi16(row3, row5); \ - dct_rot(y4o, y5o, sum17, sum35, rot1_0, rot1_1); \ - dct_wadd(x4, y0o, y4o); \ - dct_wadd(x5, y1o, y5o); \ - dct_wadd(x6, y2o, y5o); \ - dct_wadd(x7, y3o, y4o); \ - dct_bfly32o(row0, row7, x0, x7, bias, shift); \ - dct_bfly32o(row1, row6, x1, x6, bias, shift); \ - dct_bfly32o(row2, row5, x2, x5, bias, shift); \ - dct_bfly32o(row3, row4, x3, x4, bias, shift); \ +#define dct_pass(bias, shift) \ + { \ + /* even part */ \ + dct_rot(t2e, t3e, row2, row6, rot0_0, rot0_1); \ + __m128i sum04 = _mm_add_epi16(row0, row4); \ + __m128i dif04 = _mm_sub_epi16(row0, row4); \ + dct_widen(t0e, sum04); \ + dct_widen(t1e, dif04); \ + dct_wadd(x0, t0e, t3e); \ + dct_wsub(x3, t0e, t3e); \ + dct_wadd(x1, t1e, t2e); \ + dct_wsub(x2, t1e, t2e); \ + /* odd part */ \ + dct_rot(y0o, y2o, row7, row3, rot2_0, rot2_1); \ + dct_rot(y1o, y3o, row5, row1, rot3_0, rot3_1); \ + __m128i sum17 = _mm_add_epi16(row1, row7); \ + __m128i sum35 = _mm_add_epi16(row3, row5); \ + dct_rot(y4o, y5o, sum17, sum35, rot1_0, rot1_1); \ + dct_wadd(x4, y0o, y4o); \ + dct_wadd(x5, y1o, y5o); \ + dct_wadd(x6, y2o, y5o); \ + dct_wadd(x7, y3o, y4o); \ + dct_bfly32o(row0, row7, x0, x7, bias, shift); \ + dct_bfly32o(row1, row6, x1, x6, bias, shift); \ + dct_bfly32o(row2, row5, x2, x5, bias, shift); \ + dct_bfly32o(row3, row4, x3, x4, bias, shift); \ } __m128i rot0_0 = dct_const(stbi__f2f(0.5411961f), stbi__f2f(0.5411961f) + stbi__f2f(-1.847759065f)); @@ -2704,75 +2704,75 @@ static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64]) { int16x4_t rot3_2 = vdup_n_s16(stbi__f2f(3.072711026f)); int16x4_t rot3_3 = vdup_n_s16(stbi__f2f(1.501321110f)); -#define dct_long_mul(out, inq, coeff) \ - int32x4_t out##_l = vmull_s16(vget_low_s16(inq), coeff); \ +#define dct_long_mul(out, inq, coeff) \ + int32x4_t out##_l = vmull_s16(vget_low_s16(inq), coeff); \ int32x4_t out##_h = vmull_s16(vget_high_s16(inq), coeff) -#define dct_long_mac(out, acc, inq, coeff) \ - int32x4_t out##_l = vmlal_s16(acc##_l, vget_low_s16(inq), coeff); \ +#define dct_long_mac(out, acc, inq, coeff) \ + int32x4_t out##_l = vmlal_s16(acc##_l, vget_low_s16(inq), coeff); \ int32x4_t out##_h = vmlal_s16(acc##_h, vget_high_s16(inq), coeff) -#define dct_widen(out, inq) \ - int32x4_t out##_l = vshll_n_s16(vget_low_s16(inq), 12); \ +#define dct_widen(out, inq) \ + int32x4_t out##_l = vshll_n_s16(vget_low_s16(inq), 12); \ int32x4_t out##_h = vshll_n_s16(vget_high_s16(inq), 12) // wide add -#define dct_wadd(out, a, b) \ - int32x4_t out##_l = vaddq_s32(a##_l, b##_l); \ +#define dct_wadd(out, a, b) \ + int32x4_t out##_l = vaddq_s32(a##_l, b##_l); \ int32x4_t out##_h = vaddq_s32(a##_h, b##_h) // wide sub -#define dct_wsub(out, a, b) \ - int32x4_t out##_l = vsubq_s32(a##_l, b##_l); \ +#define dct_wsub(out, a, b) \ + int32x4_t out##_l = vsubq_s32(a##_l, b##_l); \ int32x4_t out##_h = vsubq_s32(a##_h, b##_h) // butterfly a/b, then shift using "shiftop" by "s" and pack -#define dct_bfly32o(out0, out1, a, b, shiftop, s) \ - { \ - dct_wadd(sum, a, b); \ - dct_wsub(dif, a, b); \ - out0 = vcombine_s16(shiftop(sum_l, s), shiftop(sum_h, s)); \ - out1 = vcombine_s16(shiftop(dif_l, s), shiftop(dif_h, s)); \ +#define dct_bfly32o(out0, out1, a, b, shiftop, s) \ + { \ + dct_wadd(sum, a, b); \ + dct_wsub(dif, a, b); \ + out0 = vcombine_s16(shiftop(sum_l, s), shiftop(sum_h, s)); \ + out1 = vcombine_s16(shiftop(dif_l, s), shiftop(dif_h, s)); \ } -#define dct_pass(shiftop, shift) \ - { \ - /* even part */ \ - int16x8_t sum26 = vaddq_s16(row2, row6); \ - dct_long_mul(p1e, sum26, rot0_0); \ - dct_long_mac(t2e, p1e, row6, rot0_1); \ - dct_long_mac(t3e, p1e, row2, rot0_2); \ - int16x8_t sum04 = vaddq_s16(row0, row4); \ - int16x8_t dif04 = vsubq_s16(row0, row4); \ - dct_widen(t0e, sum04); \ - dct_widen(t1e, dif04); \ - dct_wadd(x0, t0e, t3e); \ - dct_wsub(x3, t0e, t3e); \ - dct_wadd(x1, t1e, t2e); \ - dct_wsub(x2, t1e, t2e); \ - /* odd part */ \ - int16x8_t sum15 = vaddq_s16(row1, row5); \ - int16x8_t sum17 = vaddq_s16(row1, row7); \ - int16x8_t sum35 = vaddq_s16(row3, row5); \ - int16x8_t sum37 = vaddq_s16(row3, row7); \ - int16x8_t sumodd = vaddq_s16(sum17, sum35); \ - dct_long_mul(p5o, sumodd, rot1_0); \ - dct_long_mac(p1o, p5o, sum17, rot1_1); \ - dct_long_mac(p2o, p5o, sum35, rot1_2); \ - dct_long_mul(p3o, sum37, rot2_0); \ - dct_long_mul(p4o, sum15, rot2_1); \ - dct_wadd(sump13o, p1o, p3o); \ - dct_wadd(sump24o, p2o, p4o); \ - dct_wadd(sump23o, p2o, p3o); \ - dct_wadd(sump14o, p1o, p4o); \ - dct_long_mac(x4, sump13o, row7, rot3_0); \ - dct_long_mac(x5, sump24o, row5, rot3_1); \ - dct_long_mac(x6, sump23o, row3, rot3_2); \ - dct_long_mac(x7, sump14o, row1, rot3_3); \ - dct_bfly32o(row0, row7, x0, x7, shiftop, shift); \ - dct_bfly32o(row1, row6, x1, x6, shiftop, shift); \ - dct_bfly32o(row2, row5, x2, x5, shiftop, shift); \ - dct_bfly32o(row3, row4, x3, x4, shiftop, shift); \ +#define dct_pass(shiftop, shift) \ + { \ + /* even part */ \ + int16x8_t sum26 = vaddq_s16(row2, row6); \ + dct_long_mul(p1e, sum26, rot0_0); \ + dct_long_mac(t2e, p1e, row6, rot0_1); \ + dct_long_mac(t3e, p1e, row2, rot0_2); \ + int16x8_t sum04 = vaddq_s16(row0, row4); \ + int16x8_t dif04 = vsubq_s16(row0, row4); \ + dct_widen(t0e, sum04); \ + dct_widen(t1e, dif04); \ + dct_wadd(x0, t0e, t3e); \ + dct_wsub(x3, t0e, t3e); \ + dct_wadd(x1, t1e, t2e); \ + dct_wsub(x2, t1e, t2e); \ + /* odd part */ \ + int16x8_t sum15 = vaddq_s16(row1, row5); \ + int16x8_t sum17 = vaddq_s16(row1, row7); \ + int16x8_t sum35 = vaddq_s16(row3, row5); \ + int16x8_t sum37 = vaddq_s16(row3, row7); \ + int16x8_t sumodd = vaddq_s16(sum17, sum35); \ + dct_long_mul(p5o, sumodd, rot1_0); \ + dct_long_mac(p1o, p5o, sum17, rot1_1); \ + dct_long_mac(p2o, p5o, sum35, rot1_2); \ + dct_long_mul(p3o, sum37, rot2_0); \ + dct_long_mul(p4o, sum15, rot2_1); \ + dct_wadd(sump13o, p1o, p3o); \ + dct_wadd(sump24o, p2o, p4o); \ + dct_wadd(sump23o, p2o, p3o); \ + dct_wadd(sump14o, p1o, p4o); \ + dct_long_mac(x4, sump13o, row7, rot3_0); \ + dct_long_mac(x5, sump24o, row5, rot3_1); \ + dct_long_mac(x6, sump23o, row3, rot3_2); \ + dct_long_mac(x7, sump14o, row1, rot3_3); \ + dct_bfly32o(row0, row7, x0, x7, shiftop, shift); \ + dct_bfly32o(row1, row6, x1, x6, shiftop, shift); \ + dct_bfly32o(row2, row5, x2, x5, shiftop, shift); \ + dct_bfly32o(row3, row4, x3, x4, shiftop, shift); \ } // load @@ -2795,24 +2795,24 @@ static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64]) { { // these three map to a single VTRN.16, VTRN.32, and VSWP, respectively. // whether compilers actually get this is another story, sadly. -#define dct_trn16(x, y) \ - { \ - int16x8x2_t t = vtrnq_s16(x, y); \ - x = t.val[0]; \ - y = t.val[1]; \ +#define dct_trn16(x, y) \ + { \ + int16x8x2_t t = vtrnq_s16(x, y); \ + x = t.val[0]; \ + y = t.val[1]; \ } -#define dct_trn32(x, y) \ - { \ - int32x4x2_t t = vtrnq_s32(vreinterpretq_s32_s16(x), vreinterpretq_s32_s16(y)); \ - x = vreinterpretq_s16_s32(t.val[0]); \ - y = vreinterpretq_s16_s32(t.val[1]); \ +#define dct_trn32(x, y) \ + { \ + int32x4x2_t t = vtrnq_s32(vreinterpretq_s32_s16(x), vreinterpretq_s32_s16(y)); \ + x = vreinterpretq_s16_s32(t.val[0]); \ + y = vreinterpretq_s16_s32(t.val[1]); \ } -#define dct_trn64(x, y) \ - { \ - int16x8_t x0 = x; \ - int16x8_t y0 = y; \ - x = vcombine_s16(vget_low_s16(x0), vget_low_s16(y0)); \ - y = vcombine_s16(vget_high_s16(x0), vget_high_s16(y0)); \ +#define dct_trn64(x, y) \ + { \ + int16x8_t x0 = x; \ + int16x8_t y0 = y; \ + x = vcombine_s16(vget_low_s16(x0), vget_low_s16(y0)); \ + y = vcombine_s16(vget_high_s16(x0), vget_high_s16(y0)); \ } // pass 1 @@ -2856,23 +2856,23 @@ static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64]) { uint8x8_t p7 = vqrshrun_n_s16(row7, 1); // again, these can translate into one instruction, but often don't. -#define dct_trn8_8(x, y) \ - { \ - uint8x8x2_t t = vtrn_u8(x, y); \ - x = t.val[0]; \ - y = t.val[1]; \ +#define dct_trn8_8(x, y) \ + { \ + uint8x8x2_t t = vtrn_u8(x, y); \ + x = t.val[0]; \ + y = t.val[1]; \ } -#define dct_trn8_16(x, y) \ - { \ - uint16x4x2_t t = vtrn_u16(vreinterpret_u16_u8(x), vreinterpret_u16_u8(y)); \ - x = vreinterpret_u8_u16(t.val[0]); \ - y = vreinterpret_u8_u16(t.val[1]); \ +#define dct_trn8_16(x, y) \ + { \ + uint16x4x2_t t = vtrn_u16(vreinterpret_u16_u8(x), vreinterpret_u16_u8(y)); \ + x = vreinterpret_u8_u16(t.val[0]); \ + y = vreinterpret_u8_u16(t.val[1]); \ } -#define dct_trn8_32(x, y) \ - { \ - uint32x2x2_t t = vtrn_u32(vreinterpret_u32_u8(x), vreinterpret_u32_u8(y)); \ - x = vreinterpret_u8_u32(t.val[0]); \ - y = vreinterpret_u8_u32(t.val[1]); \ +#define dct_trn8_32(x, y) \ + { \ + uint32x2x2_t t = vtrn_u32(vreinterpret_u32_u8(x), vreinterpret_u32_u8(y)); \ + x = vreinterpret_u8_u32(t.val[0]); \ + y = vreinterpret_u8_u32(t.val[1]); \ } // sadly can't use interleaved stores here since we only write @@ -2942,8 +2942,7 @@ static stbi_uc stbi__get_marker(stbi__jpeg *j) { } x = stbi__get8(j->s); if (x != 0xff) return STBI__MARKER_none; - while (x == 0xff) - x = stbi__get8(j->s);// consume repeated 0xff fill bytes + while (x == 0xff) x = stbi__get8(j->s);// consume repeated 0xff fill bytes return x; } @@ -2981,7 +2980,9 @@ static int stbi__parse_entropy_coded_data(stbi__jpeg *z) { for (j = 0; j < h; ++j) { for (i = 0; i < w; ++i) { int ha = z->img_comp[n].ha; - if (!stbi__jpeg_decode_block(z, data, z->huff_dc + z->img_comp[n].hd, z->huff_ac + ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0; + if (!stbi__jpeg_decode_block(z, data, z->huff_dc + z->img_comp[n].hd, z->huff_ac + ha, z->fast_ac[ha], n, + z->dequant[z->img_comp[n].tq])) + return 0; z->idct_block_kernel(z->img_comp[n].data + z->img_comp[n].w2 * j * 8 + i * 8, z->img_comp[n].w2, data); // every data block is an MCU, so countdown the restart interval if (--z->todo <= 0) { @@ -3009,7 +3010,9 @@ static int stbi__parse_entropy_coded_data(stbi__jpeg *z) { int x2 = (i * z->img_comp[n].h + x) * 8; int y2 = (j * z->img_comp[n].v + y) * 8; int ha = z->img_comp[n].ha; - if (!stbi__jpeg_decode_block(z, data, z->huff_dc + z->img_comp[n].hd, z->huff_ac + ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0; + if (!stbi__jpeg_decode_block(z, data, z->huff_dc + z->img_comp[n].hd, z->huff_ac + ha, z->fast_ac[ha], n, + z->dequant[z->img_comp[n].tq])) + return 0; z->idct_block_kernel(z->img_comp[n].data + z->img_comp[n].w2 * y2 + x2, z->img_comp[n].w2, data); } } @@ -3039,12 +3042,10 @@ static int stbi__parse_entropy_coded_data(stbi__jpeg *z) { for (i = 0; i < w; ++i) { short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w); if (z->spec_start == 0) { - if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n)) - return 0; + if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n)) return 0; } else { int ha = z->img_comp[n].ha; - if (!stbi__jpeg_decode_block_prog_ac(z, data, &z->huff_ac[ha], z->fast_ac[ha])) - return 0; + if (!stbi__jpeg_decode_block_prog_ac(z, data, &z->huff_ac[ha], z->fast_ac[ha])) return 0; } // every data block is an MCU, so countdown the restart interval if (--z->todo <= 0) { @@ -3069,8 +3070,7 @@ static int stbi__parse_entropy_coded_data(stbi__jpeg *z) { int x2 = (i * z->img_comp[n].h + x); int y2 = (j * z->img_comp[n].v + y); short *data = z->img_comp[n].coeff + 64 * (x2 + y2 * z->img_comp[n].coeff_w); - if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n)) - return 0; + if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n)) return 0; } } } @@ -3090,8 +3090,7 @@ static int stbi__parse_entropy_coded_data(stbi__jpeg *z) { static void stbi__jpeg_dequantize(short *data, stbi__uint16 *dequant) { int i; - for (i = 0; i < 64; ++i) - data[i] *= dequant[i]; + for (i = 0; i < 64; ++i) data[i] *= dequant[i]; } static void stbi__jpeg_finish(stbi__jpeg *z) { @@ -3132,8 +3131,7 @@ static int stbi__process_marker(stbi__jpeg *z, int m) { if (p != 0 && p != 1) return stbi__err("bad DQT type", "Corrupt JPEG"); if (t > 3) return stbi__err("bad DQT table", "Corrupt JPEG"); - for (i = 0; i < 64; ++i) - z->dequant[t][stbi__jpeg_dezigzag[i]] = (stbi__uint16) (sixteen ? stbi__get16be(z->s) : stbi__get8(z->s)); + for (i = 0; i < 64; ++i) z->dequant[t][stbi__jpeg_dezigzag[i]] = (stbi__uint16) (sixteen ? stbi__get16be(z->s) : stbi__get8(z->s)); L -= (sixteen ? 129 : 65); } return L == 0; @@ -3159,10 +3157,8 @@ static int stbi__process_marker(stbi__jpeg *z, int m) { if (!stbi__build_huffman(z->huff_ac + th, sizes)) return 0; v = z->huff_ac[th].values; } - for (i = 0; i < n; ++i) - v[i] = stbi__get8(z->s); - if (tc != 0) - stbi__build_fast_ac(z->fast_ac[th], z->huff_ac + th); + for (i = 0; i < n; ++i) v[i] = stbi__get8(z->s); + if (tc != 0) stbi__build_fast_ac(z->fast_ac[th], z->huff_ac + th); L -= n; } return L == 0; @@ -3184,18 +3180,15 @@ static int stbi__process_marker(stbi__jpeg *z, int m) { int ok = 1; int i; for (i = 0; i < 5; ++i) - if (stbi__get8(z->s) != tag[i]) - ok = 0; + if (stbi__get8(z->s) != tag[i]) ok = 0; L -= 5; - if (ok) - z->jfif = 1; + if (ok) z->jfif = 1; } else if (m == 0xEE && L >= 12) {// Adobe APP14 segment static const unsigned char tag[6] = {'A', 'd', 'o', 'b', 'e', '\0'}; int ok = 1; int i; for (i = 0; i < 6; ++i) - if (stbi__get8(z->s) != tag[i]) - ok = 0; + if (stbi__get8(z->s) != tag[i]) ok = 0; L -= 6; if (ok) { stbi__get8(z->s); // version @@ -3224,8 +3217,7 @@ static int stbi__process_scan_header(stbi__jpeg *z) { int id = stbi__get8(z->s), which; int q = stbi__get8(z->s); for (which = 0; which < z->s->img_n; ++which) - if (z->img_comp[which].id == id) - break; + if (z->img_comp[which].id == id) break; if (which == z->s->img_n) return 0;// no match z->img_comp[which].hd = q >> 4; if (z->img_comp[which].hd > 3) return stbi__err("bad DC huff", "Corrupt JPEG"); @@ -3283,7 +3275,9 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan) { p = stbi__get8(s); if (p != 8) return stbi__err("only 8-bit", "JPEG format not supported: 8-bit only");// JPEG baseline s->img_y = stbi__get16be(s); - if (s->img_y == 0) return stbi__err("no header height", "JPEG format not supported: delayed height");// Legal, but we don't handle it--but neither does IJG + if (s->img_y == 0) + return stbi__err("no header height", + "JPEG format not supported: delayed height");// Legal, but we don't handle it--but neither does IJG s->img_x = stbi__get16be(s); if (s->img_x == 0) return stbi__err("0 width", "Corrupt JPEG");// JPEG requires if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__err("too large", "Very large image (corrupt?)"); @@ -3302,8 +3296,7 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan) { for (i = 0; i < s->img_n; ++i) { static const unsigned char rgb[3] = {'R', 'G', 'B'}; z->img_comp[i].id = stbi__get8(s); - if (s->img_n == 3 && z->img_comp[i].id == rgb[i]) - ++z->rgb; + if (s->img_n == 3 && z->img_comp[i].id == rgb[i]) ++z->rgb; q = stbi__get8(s); z->img_comp[i].h = (q >> 4); if (!z->img_comp[i].h || z->img_comp[i].h > 4) return stbi__err("bad H", "Corrupt JPEG"); @@ -3355,8 +3348,7 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan) { z->img_comp[i].raw_coeff = 0; z->img_comp[i].linebuf = NULL; z->img_comp[i].raw_data = stbi__malloc_mad2(z->img_comp[i].w2, z->img_comp[i].h2, 15); - if (z->img_comp[i].raw_data == NULL) - return stbi__free_jpeg_components(z, i + 1, stbi__err("outofmem", "Out of memory")); + if (z->img_comp[i].raw_data == NULL) return stbi__free_jpeg_components(z, i + 1, stbi__err("outofmem", "Out of memory")); // align blocks for idct using mmx/sse z->img_comp[i].data = (stbi_uc *) (((size_t) z->img_comp[i].raw_data + 15) & ~15); if (z->progressive) { @@ -3364,8 +3356,7 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan) { z->img_comp[i].coeff_w = z->img_comp[i].w2 / 8; z->img_comp[i].coeff_h = z->img_comp[i].h2 / 8; z->img_comp[i].raw_coeff = stbi__malloc_mad3(z->img_comp[i].w2, z->img_comp[i].h2, sizeof(short), 15); - if (z->img_comp[i].raw_coeff == NULL) - return stbi__free_jpeg_components(z, i + 1, stbi__err("outofmem", "Out of memory")); + if (z->img_comp[i].raw_coeff == NULL) return stbi__free_jpeg_components(z, i + 1, stbi__err("outofmem", "Out of memory")); z->img_comp[i].coeff = (short *) (((size_t) z->img_comp[i].raw_coeff + 15) & ~15); } } @@ -3440,15 +3431,13 @@ static int stbi__decode_jpeg_image(stbi__jpeg *j) { } m = stbi__get_marker(j); } - if (j->progressive) - stbi__jpeg_finish(j); + if (j->progressive) stbi__jpeg_finish(j); return 1; } // static jfif-centered resampling (across block boundaries) -typedef stbi_uc *(*resample_row_func)(stbi_uc *out, stbi_uc *in0, stbi_uc *in1, - int w, int hs); +typedef stbi_uc *(*resample_row_func)(stbi_uc *out, stbi_uc *in0, stbi_uc *in1, int w, int hs); #define stbi__div4(x) ((stbi_uc) ((x) >> 2)) @@ -3464,8 +3453,7 @@ static stbi_uc *stbi__resample_row_v_2(stbi_uc *out, stbi_uc *in_near, stbi_uc * // need to generate two samples vertically for every one in input int i; STBI_NOTUSED(hs); - for (i = 0; i < w; ++i) - out[i] = stbi__div4(3 * in_near[i] + in_far[i] + 2); + for (i = 0; i < w; ++i) out[i] = stbi__div4(3 * in_near[i] + in_far[i] + 2); return out; } @@ -3642,14 +3630,13 @@ static stbi_uc *stbi__resample_row_generic(stbi_uc *out, stbi_uc *in_near, stbi_ int i, j; STBI_NOTUSED(in_far); for (i = 0; i < w; ++i) - for (j = 0; j < hs; ++j) - out[i * hs + j] = in_near[i]; + for (j = 0; j < hs; ++j) out[i * hs + j] = in_near[i]; return out; } // this is a reduced-precision calculation of YCbCr-to-RGB introduced // to make sure the code produces the same results in both SIMD and scalar -#define stbi__float2fixed(x) (((int) ((x) *4096.0f + 0.5f)) << 8) +#define stbi__float2fixed(x) (((int) ((x) * 4096.0f + 0.5f)) << 8) static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step) { int i; for (i = 0; i < count; ++i) { @@ -3664,17 +3651,20 @@ static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc g >>= 20; b >>= 20; if ((unsigned) r > 255) { - if (r < 0) r = 0; + if (r < 0) + r = 0; else r = 255; } if ((unsigned) g > 255) { - if (g < 0) g = 0; + if (g < 0) + g = 0; else g = 255; } if ((unsigned) b > 255) { - if (b < 0) b = 0; + if (b < 0) + b = 0; else b = 255; } @@ -3809,17 +3799,20 @@ static void stbi__YCbCr_to_RGB_simd(stbi_uc *out, stbi_uc const *y, stbi_uc cons g >>= 20; b >>= 20; if ((unsigned) r > 255) { - if (r < 0) r = 0; + if (r < 0) + r = 0; else r = 255; } if ((unsigned) g > 255) { - if (g < 0) g = 0; + if (g < 0) + g = 0; else g = 255; } if ((unsigned) b > 255) { - if (b < 0) b = 0; + if (b < 0) + b = 0; else b = 255; } @@ -3858,8 +3851,7 @@ static void stbi__cleanup_jpeg(stbi__jpeg *j) { stbi__free_jpeg_components(j, j->s->img_n, 0); } -typedef struct -{ +typedef struct { resample_row_func resample; stbi_uc *line0, *line1; int hs, vs; // expansion factor in each axis @@ -3888,8 +3880,7 @@ static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp } // determine actual number of components to generate - n = req_comp ? req_comp : z->s->img_n >= 3 ? 3 - : 1; + n = req_comp ? req_comp : z->s->img_n >= 3 ? 3 : 1; is_rgb = z->s->img_n == 3 && (z->rgb == 3 || (z->app14_color_transform == 0 && !z->jfif)); @@ -3932,7 +3923,8 @@ static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp r->ypos = 0; r->line0 = r->line1 = z->img_comp[k].data; - if (r->hs == 1 && r->vs == 1) r->resample = resample_row_1; + if (r->hs == 1 && r->vs == 1) + r->resample = resample_row_1; else if (r->hs == 1 && r->vs == 2) r->resample = stbi__resample_row_v_2; else if (r->hs == 2 && r->vs == 1) @@ -3956,15 +3948,11 @@ static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp for (k = 0; k < decode_n; ++k) { stbi__resample *r = &res_comp[k]; int y_bot = r->ystep >= (r->vs >> 1); - coutput[k] = r->resample(z->img_comp[k].linebuf, - y_bot ? r->line1 : r->line0, - y_bot ? r->line0 : r->line1, - r->w_lores, r->hs); + coutput[k] = r->resample(z->img_comp[k].linebuf, y_bot ? r->line1 : r->line0, y_bot ? r->line0 : r->line1, r->w_lores, r->hs); if (++r->ystep >= r->vs) { r->ystep = 0; r->line0 = r->line1; - if (++r->ypos < z->img_comp[k].y) - r->line1 += z->img_comp[k].w2; + if (++r->ypos < z->img_comp[k].y) r->line1 += z->img_comp[k].w2; } } if (n >= 3) { @@ -4012,8 +4000,7 @@ static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp } else { if (is_rgb) { if (n == 1) - for (i = 0; i < z->s->img_x; ++i) - *out++ = stbi__compute_y(coutput[0][i], coutput[1][i], coutput[2][i]); + for (i = 0; i < z->s->img_x; ++i) *out++ = stbi__compute_y(coutput[0][i], coutput[1][i], coutput[2][i]); else { for (i = 0; i < z->s->img_x; ++i, out += 2) { out[0] = stbi__compute_y(coutput[0][i], coutput[1][i], coutput[2][i]); @@ -4118,8 +4105,7 @@ static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp) { // zlib-style huffman encoding // (jpegs packs from left, zlib from right, so can't share code) -typedef struct -{ +typedef struct { stbi__uint16 fast[1 << STBI__ZFAST_BITS]; stbi__uint16 firstcode[16]; int maxcode[17]; @@ -4150,12 +4136,10 @@ static int stbi__zbuild_huffman(stbi__zhuffman *z, const stbi_uc *sizelist, int // DEFLATE spec for generating codes memset(sizes, 0, sizeof(sizes)); memset(z->fast, 0, sizeof(z->fast)); - for (i = 0; i < num; ++i) - ++sizes[sizelist[i]]; + for (i = 0; i < num; ++i) ++sizes[sizelist[i]]; sizes[0] = 0; for (i = 1; i < 16; ++i) - if (sizes[i] > (1 << i)) - return stbi__err("bad sizes", "Corrupt PNG"); + if (sizes[i] > (1 << i)) return stbi__err("bad sizes", "Corrupt PNG"); code = 0; for (i = 1; i < 16; ++i) { next_code[i] = code; @@ -4195,8 +4179,7 @@ static int stbi__zbuild_huffman(stbi__zhuffman *z, const stbi_uc *sizelist, int // we require PNG read all the IDATs and combine them into a single // memory buffer -typedef struct -{ +typedef struct { stbi_uc *zbuffer, *zbuffer_end; int num_bits; stbi__uint32 code_buffer; @@ -4243,8 +4226,7 @@ static int stbi__zhuffman_decode_slowpath(stbi__zbuf *a, stbi__zhuffman *z) { // use jpeg approach, which requires MSbits at top k = stbi__bit_reverse(a->code_buffer, 16); for (s = STBI__ZFAST_BITS + 1;; ++s) - if (k < z->maxcode[s]) - break; + if (k < z->maxcode[s]) break; if (s >= 16) return -1;// invalid code! // code size is s, so: b = (k >> (16 - s)) - z->firstcode[s] + z->firstsymbol[s]; @@ -4295,19 +4277,15 @@ static int stbi__zexpand(stbi__zbuf *z, char *zout, int n)// need to make room f return 1; } -static const int stbi__zlength_base[31] = { - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, - 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, - 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; +static const int stbi__zlength_base[31] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; -static const int stbi__zlength_extra[31] = - {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0}; +static const int stbi__zlength_extra[31] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0}; -static const int stbi__zdist_base[32] = {1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0}; +static const int stbi__zdist_base[32] = {1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0}; -static const int stbi__zdist_extra[32] = - {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; +static const int stbi__zdist_extra[32] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; static int stbi__parse_huffman_block(stbi__zbuf *a) { char *zout = a->zout; @@ -4408,8 +4386,7 @@ static int stbi__compute_huffman_codes(stbi__zbuf *a) { static int stbi__parse_uncompressed_block(stbi__zbuf *a) { stbi_uc header[4]; int len, nlen, k; - if (a->num_bits & 7) - stbi__zreceive(a, a->num_bits & 7);// discard + if (a->num_bits & 7) stbi__zreceive(a, a->num_bits & 7);// discard // drain the bit-packed data into header k = 0; while (a->num_bits > 0) { @@ -4419,8 +4396,7 @@ static int stbi__parse_uncompressed_block(stbi__zbuf *a) { } if (a->num_bits < 0) return stbi__err("zlib corrupt", "Corrupt PNG"); // now fill header the normal way - while (k < 4) - header[k++] = stbi__zget8(a); + while (k < 4) header[k++] = stbi__zget8(a); len = header[1] * 256 + header[0]; nlen = header[3] * 256 + header[2]; if (nlen != (len ^ 0xffff)) return stbi__err("zlib corrupt", "Corrupt PNG"); @@ -4446,20 +4422,17 @@ static int stbi__parse_zlib_header(stbi__zbuf *a) { return 1; } -static const stbi_uc stbi__zdefault_length[STBI__ZNSYMS] = - { - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8}; -static const stbi_uc stbi__zdefault_distance[32] = - { - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5}; +static const stbi_uc stbi__zdefault_length[STBI__ZNSYMS] = {8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8}; +static const stbi_uc stbi__zdefault_distance[32] = {5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5}; /* Init algorithm: { @@ -4590,8 +4563,7 @@ STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char // - uses stb_zlib, a PD zlib implementation with fast huffman decoding #ifndef STBI_NO_PNG -typedef struct -{ +typedef struct { stbi__uint32 length; stbi__uint32 type; } stbi__pngchunk; @@ -4611,8 +4583,7 @@ static int stbi__check_png_header(stbi__context *s) { return 1; } -typedef struct -{ +typedef struct { stbi__context *s; stbi_uc *idata, *expanded, *out; int depth; @@ -4630,13 +4601,7 @@ enum { STBI__F_paeth_first }; -static stbi_uc first_row_filter[5] = - { - STBI__F_none, - STBI__F_sub, - STBI__F_none, - STBI__F_avg_first, - STBI__F_paeth_first}; +static stbi_uc first_row_filter[5] = {STBI__F_none, STBI__F_sub, STBI__F_none, STBI__F_avg_first, STBI__F_paeth_first}; static int stbi__paeth(int a, int b, int c) { int p = a + b - c; @@ -4651,7 +4616,8 @@ static int stbi__paeth(int a, int b, int c) { static const stbi_uc stbi__depth_scale_table[9] = {0, 0xff, 0x55, 0, 0x11, 0, 0, 0, 0x01}; // create the png data from post-deflated data -static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, int color) { +static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, + int color) { int bytes = (depth == 16 ? 2 : 1); stbi__context *s = a->s; stbi__uint32 i, j, stride = x * out_n * bytes; @@ -4681,8 +4647,7 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r stbi_uc *prior; int filter = *raw++; - if (filter > 4) - return stbi__err("invalid filter", "Corrupt PNG"); + if (filter > 4) return stbi__err("invalid filter", "Corrupt PNG"); if (depth < 8) { if (img_width_bytes > x) return stbi__err("invalid width", "Corrupt PNG"); @@ -4723,8 +4688,7 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r } if (depth == 8) { - if (img_n != out_n) - cur[img_n] = 255;// first pixel + if (img_n != out_n) cur[img_n] = 255;// first pixel raw += img_n; cur += out_n; prior += out_n; @@ -4745,49 +4709,75 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r // this is a little gross, so that we don't switch per-pixel or per-component if (depth < 8 || img_n == out_n) { int nk = (width - 1) * filter_bytes; -#define STBI__CASE(f) \ - case f: \ +#define STBI__CASE(f) \ + case f: \ for (k = 0; k < nk; ++k) switch (filter) { // "none" filter turns into a memcpy here; make that explicit. case STBI__F_none: memcpy(cur, raw, nk); break; - STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k - filter_bytes]); } + STBI__CASE(STBI__F_sub) { + cur[k] = STBI__BYTECAST(raw[k] + cur[k - filter_bytes]); + } break; - STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } + STBI__CASE(STBI__F_up) { + cur[k] = STBI__BYTECAST(raw[k] + prior[k]); + } break; - STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k - filter_bytes]) >> 1)); } + STBI__CASE(STBI__F_avg) { + cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k - filter_bytes]) >> 1)); + } break; - STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k - filter_bytes], prior[k], prior[k - filter_bytes])); } + STBI__CASE(STBI__F_paeth) { + cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k - filter_bytes], prior[k], prior[k - filter_bytes])); + } break; - STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k - filter_bytes] >> 1)); } + STBI__CASE(STBI__F_avg_first) { + cur[k] = STBI__BYTECAST(raw[k] + (cur[k - filter_bytes] >> 1)); + } break; - STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k - filter_bytes], 0, 0)); } + STBI__CASE(STBI__F_paeth_first) { + cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k - filter_bytes], 0, 0)); + } break; } #undef STBI__CASE raw += nk; } else { STBI_ASSERT(img_n + 1 == out_n); -#define STBI__CASE(f) \ - case f: \ - for (i = x - 1; i >= 1; --i, cur[filter_bytes] = 255, raw += filter_bytes, cur += output_bytes, prior += output_bytes) \ +#define STBI__CASE(f) \ + case f: \ + for (i = x - 1; i >= 1; --i, cur[filter_bytes] = 255, raw += filter_bytes, cur += output_bytes, prior += output_bytes) \ for (k = 0; k < filter_bytes; ++k) switch (filter) { - STBI__CASE(STBI__F_none) { cur[k] = raw[k]; } + STBI__CASE(STBI__F_none) { + cur[k] = raw[k]; + } break; - STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k - output_bytes]); } + STBI__CASE(STBI__F_sub) { + cur[k] = STBI__BYTECAST(raw[k] + cur[k - output_bytes]); + } break; - STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } + STBI__CASE(STBI__F_up) { + cur[k] = STBI__BYTECAST(raw[k] + prior[k]); + } break; - STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k - output_bytes]) >> 1)); } + STBI__CASE(STBI__F_avg) { + cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k - output_bytes]) >> 1)); + } break; - STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k - output_bytes], prior[k], prior[k - output_bytes])); } + STBI__CASE(STBI__F_paeth) { + cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k - output_bytes], prior[k], prior[k - output_bytes])); + } break; - STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k - output_bytes] >> 1)); } + STBI__CASE(STBI__F_avg_first) { + cur[k] = STBI__BYTECAST(raw[k] + (cur[k - output_bytes] >> 1)); + } break; - STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k - output_bytes], 0, 0)); } + STBI__CASE(STBI__F_paeth_first) { + cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k - output_bytes], 0, 0)); + } break; } #undef STBI__CASE @@ -4896,8 +4886,7 @@ static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stbi__uint3 int out_bytes = out_n * bytes; stbi_uc *final; int p; - if (!interlaced) - return stbi__create_png_image_raw(a, image_data, image_data_len, out_n, a->s->img_x, a->s->img_y, depth, color); + if (!interlaced) return stbi__create_png_image_raw(a, image_data, image_data_len, out_n, a->s->img_x, a->s->img_y, depth, color); // de-interlacing final = (stbi_uc *) stbi__malloc_mad3(a->s->img_x, a->s->img_y, out_bytes, 0); @@ -4921,8 +4910,7 @@ static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stbi__uint3 for (i = 0; i < x; ++i) { int out_y = j * yspc[p] + yorig[p]; int out_x = i * xspc[p] + xorig[p]; - memcpy(final + out_y * a->s->img_x * out_bytes + out_x * out_bytes, - a->out + (j * x + i) * out_bytes, out_bytes); + memcpy(final + out_y * a->s->img_x * out_bytes + out_x * out_bytes, a->out + (j * x + i) * out_bytes, out_bytes); } } STBI_FREE(a->out); @@ -4951,8 +4939,7 @@ static int stbi__compute_transparency(stbi__png *z, stbi_uc tc[3], int out_n) { } } else { for (i = 0; i < pixel_count; ++i) { - if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) - p[3] = 0; + if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) p[3] = 0; p += 4; } } @@ -4975,8 +4962,7 @@ static int stbi__compute_transparency16(stbi__png *z, stbi__uint16 tc[3], int ou } } else { for (i = 0; i < pixel_count; ++i) { - if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) - p[3] = 0; + if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) p[3] = 0; p += 4; } } @@ -5047,12 +5033,8 @@ STBIDEF void stbi_convert_iphone_png_to_rgb_thread(int flag_true_if_should_conve stbi__de_iphone_flag_set = 1; } -#define stbi__unpremultiply_on_load (stbi__unpremultiply_on_load_set \ - ? stbi__unpremultiply_on_load_local \ - : stbi__unpremultiply_on_load_global) -#define stbi__de_iphone_flag (stbi__de_iphone_flag_set \ - ? stbi__de_iphone_flag_local \ - : stbi__de_iphone_flag_global) +#define stbi__unpremultiply_on_load (stbi__unpremultiply_on_load_set ? stbi__unpremultiply_on_load_local : stbi__unpremultiply_on_load_global) +#define stbi__de_iphone_flag (stbi__de_iphone_flag_set ? stbi__de_iphone_flag_local : stbi__de_iphone_flag_global) #endif// STBI_THREAD_LOCAL static void stbi__de_iphone(stbi__png *z) { @@ -5132,11 +5114,13 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) { if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__err("too large", "Very large image (corrupt?)"); if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__err("too large", "Very large image (corrupt?)"); z->depth = stbi__get8(s); - if (z->depth != 1 && z->depth != 2 && z->depth != 4 && z->depth != 8 && z->depth != 16) return stbi__err("1/2/4/8/16-bit only", "PNG not supported: 1/2/4/8/16-bit only"); + if (z->depth != 1 && z->depth != 2 && z->depth != 4 && z->depth != 8 && z->depth != 16) + return stbi__err("1/2/4/8/16-bit only", "PNG not supported: 1/2/4/8/16-bit only"); color = stbi__get8(s); if (color > 6) return stbi__err("bad ctype", "Corrupt PNG"); if (color == 3 && z->depth == 16) return stbi__err("bad ctype", "Corrupt PNG"); - if (color == 3) pal_img_n = 3; + if (color == 3) + pal_img_n = 3; else if (color & 1) return stbi__err("bad ctype", "Corrupt PNG"); comp = stbi__get8(s); @@ -5185,8 +5169,7 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) { if (pal_len == 0) return stbi__err("tRNS before PLTE", "Corrupt PNG"); if (c.length > pal_len) return stbi__err("bad tRNS len", "Corrupt PNG"); pal_img_n = 4; - for (i = 0; i < c.length; ++i) - palette[i * 4 + 3] = stbi__get8(s); + for (i = 0; i < c.length; ++i) palette[i * 4 + 3] = stbi__get8(s); } else { if (!(s->img_n & 1)) return stbi__err("tRNS with alpha", "Corrupt PNG"); if (c.length != (stbi__uint32) s->img_n * 2) return stbi__err("bad tRNS len", "Corrupt PNG"); @@ -5194,7 +5177,8 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) { if (z->depth == 16) { for (k = 0; k < s->img_n; ++k) tc16[k] = (stbi__uint16) stbi__get16be(s);// copy the values as-is } else { - for (k = 0; k < s->img_n; ++k) tc[k] = (stbi_uc) (stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth];// non 8-bit images will be larger + for (k = 0; k < s->img_n; ++k) + tc[k] = (stbi_uc) (stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth];// non 8-bit images will be larger } } break; @@ -5212,8 +5196,7 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) { stbi__uint32 idata_limit_old = idata_limit; stbi_uc *p; if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096; - while (ioff + c.length > idata_limit) - idata_limit *= 2; + while (ioff + c.length > idata_limit) idata_limit *= 2; STBI_NOTUSED(idata_limit_old); p = (stbi_uc *) STBI_REALLOC_SIZED(z->idata, idata_limit_old, idata_limit); if (p == NULL) return stbi__err("outofmem", "Out of memory"); @@ -5232,7 +5215,8 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) { // initial guess for decoded data size to avoid unnecessary reallocs bpl = (s->img_x * z->depth + 7) / 8;// bytes per line, per component raw_len = bpl * s->img_y * s->img_n /* pixels */ + s->img_y /* filter mode per row */; - z->expanded = (stbi_uc *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, raw_len, (int *) &raw_len, !is_iphone); + z->expanded = (stbi_uc *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, raw_len, (int *) &raw_len, + !is_iphone); if (z->expanded == NULL) return 0;// zlib should set error STBI_FREE(z->idata); z->idata = NULL; @@ -5248,15 +5232,13 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) { if (!stbi__compute_transparency(z, tc, s->img_out_n)) return 0; } } - if (is_iphone && stbi__de_iphone_flag && s->img_out_n > 2) - stbi__de_iphone(z); + if (is_iphone && stbi__de_iphone_flag && s->img_out_n > 2) stbi__de_iphone(z); if (pal_img_n) { // pal_img_n == 3 or 4 s->img_n = pal_img_n;// record the actual colors we had s->img_out_n = pal_img_n; if (req_comp >= 3) s->img_out_n = req_comp; - if (!stbi__expand_png_palette(z, palette, pal_len, s->img_out_n)) - return 0; + if (!stbi__expand_png_palette(z, palette, pal_len, s->img_out_n)) return 0; } else if (has_trans) { // non-paletted image with tRNS -> source image has (constant) alpha ++s->img_n; @@ -5357,8 +5339,7 @@ static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp) { static int stbi__png_is16(stbi__context *s) { stbi__png p; p.s = s; - if (!stbi__png_info_raw(&p, NULL, NULL, NULL)) - return 0; + if (!stbi__png_info_raw(&p, NULL, NULL, NULL)) return 0; if (p.depth != 16) { stbi__rewind(p.s); return 0; @@ -5411,7 +5392,9 @@ static int stbi__high_bit(unsigned int z) { n += 2; z >>= 2; } - if (z >= 0x00002) { n += 1; /* >>= 1;*/ } + if (z >= 0x00002) { + n += 1; /* >>= 1;*/ + } return n; } @@ -5429,26 +5412,18 @@ static int stbi__bitcount(unsigned int a) { // extend it to full full range. static int stbi__shiftsigned(unsigned int v, int shift, int bits) { static unsigned int mul_table[9] = { - 0, - 0xff /*0b11111111*/, - 0x55 /*0b01010101*/, - 0x49 /*0b01001001*/, - 0x11 /*0b00010001*/, - 0x21 /*0b00100001*/, - 0x41 /*0b01000001*/, - 0x81 /*0b10000001*/, - 0x01 /*0b00000001*/, + 0, + 0xff /*0b11111111*/, + 0x55 /*0b01010101*/, + 0x49 /*0b01001001*/, + 0x11 /*0b00010001*/, + 0x21 /*0b00100001*/, + 0x41 /*0b01000001*/, + 0x81 /*0b10000001*/, + 0x01 /*0b00000001*/, }; static unsigned int shift_table[9] = { - 0, - 0, - 0, - 1, - 0, - 2, - 4, - 6, - 0, + 0, 0, 0, 1, 0, 2, 4, 6, 0, }; if (shift < 0) v <<= -shift; @@ -5460,8 +5435,7 @@ static int stbi__shiftsigned(unsigned int v, int shift, int bits) { return (int) ((unsigned) v * mul_table[bits]) >> shift_table[bits]; } -typedef struct -{ +typedef struct { int bpp, offset, hsz; unsigned int mr, mg, mb, ma, all_a; int extra_read; @@ -5469,8 +5443,7 @@ typedef struct static int stbi__bmp_set_mask_defaults(stbi__bmp_data *info, int compress) { // BI_BITFIELDS specifies masks explicitly, don't override - if (compress == 3) - return 1; + if (compress == 3) return 1; if (compress == 0) { if (info->bpp == 16) { @@ -5518,13 +5491,14 @@ static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info) { if (hsz != 12) { int compress = stbi__get32le(s); if (compress == 1 || compress == 2) return stbi__errpuc("BMP RLE", "BMP type not supported: RLE"); - if (compress >= 4) return stbi__errpuc("BMP JPEG/PNG", "BMP type not supported: unsupported compression");// this includes PNG/JPEG modes - if (compress == 3 && info->bpp != 16 && info->bpp != 32) return stbi__errpuc("bad BMP", "bad BMP"); // bitfields requires 16 or 32 bits/pixel - stbi__get32le(s); // discard sizeof - stbi__get32le(s); // discard hres - stbi__get32le(s); // discard vres - stbi__get32le(s); // discard colorsused - stbi__get32le(s); // discard max important + if (compress >= 4) return stbi__errpuc("BMP JPEG/PNG", + "BMP type not supported: unsupported compression"); // this includes PNG/JPEG modes + if (compress == 3 && info->bpp != 16 && info->bpp != 32) return stbi__errpuc("bad BMP", "bad BMP");// bitfields requires 16 or 32 bits/pixel + stbi__get32le(s); // discard sizeof + stbi__get32le(s); // discard hres + stbi__get32le(s); // discard vres + stbi__get32le(s); // discard colorsused + stbi__get32le(s); // discard max important if (hsz == 40 || hsz == 56) { if (hsz == 56) { stbi__get32le(s); @@ -5551,17 +5525,15 @@ static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info) { } else { // V4/V5 header int i; - if (hsz != 108 && hsz != 124) - return stbi__errpuc("bad BMP", "bad BMP"); + if (hsz != 108 && hsz != 124) return stbi__errpuc("bad BMP", "bad BMP"); info->mr = stbi__get32le(s); info->mg = stbi__get32le(s); info->mb = stbi__get32le(s); info->ma = stbi__get32le(s); if (compress != 3)// override mr/mg/mb unless in BI_BITFIELDS mode, as per docs stbi__bmp_set_mask_defaults(info, compress); - stbi__get32le(s);// discard color space - for (i = 0; i < 12; ++i) - stbi__get32le(s);// discard color space parameters + stbi__get32le(s); // discard color space + for (i = 0; i < 12; ++i) stbi__get32le(s);// discard color space parameters if (hsz == 124) { stbi__get32le(s);// discard rendering intent stbi__get32le(s);// discard offset of profile data @@ -5584,8 +5556,7 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req STBI_NOTUSED(ri); info.all_a = 255; - if (stbi__bmp_parse_header(s, &info) == NULL) - return NULL;// error code already set + if (stbi__bmp_parse_header(s, &info) == NULL) return NULL;// error code already set flip_vertically = ((int) s->img_y) > 0; s->img_y = abs((int) s->img_y); @@ -5600,11 +5571,9 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req all_a = info.all_a; if (info.hsz == 12) { - if (info.bpp < 24) - psize = (info.offset - info.extra_read - 24) / 3; + if (info.bpp < 24) psize = (info.offset - info.extra_read - 24) / 3; } else { - if (info.bpp < 16) - psize = (info.offset - info.extra_read - info.hsz) >> 2; + if (info.bpp < 16) psize = (info.offset - info.extra_read - info.hsz) >> 2; } if (psize == 0) { if (info.offset != s->callback_already_read + (s->img_buffer - s->img_buffer_original)) { @@ -5622,8 +5591,7 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req target = s->img_n;// if they want monochrome, we'll post-convert // sanity-check size - if (!stbi__mad3sizes_valid(target, s->img_x, s->img_y, 0)) - return stbi__errpuc("too large", "Corrupt BMP"); + if (!stbi__mad3sizes_valid(target, s->img_x, s->img_y, 0)) return stbi__errpuc("too large", "Corrupt BMP"); out = (stbi_uc *) stbi__malloc_mad3(target, s->img_x, s->img_y, 0); if (!out) return stbi__errpuc("outofmem", "Out of memory"); @@ -5641,7 +5609,8 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req pal[i][3] = 255; } stbi__skip(s, info.offset - info.extra_read - info.hsz - psize * (info.hsz == 12 ? 3 : 4)); - if (info.bpp == 1) width = (s->img_x + 7) >> 3; + if (info.bpp == 1) + width = (s->img_x + 7) >> 3; else if (info.bpp == 4) width = (s->img_x + 1) >> 1; else if (info.bpp == 8) @@ -5695,7 +5664,8 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req int z = 0; int easy = 0; stbi__skip(s, info.offset - info.extra_read - info.hsz); - if (info.bpp == 24) width = 3 * s->img_x; + if (info.bpp == 24) + width = 3 * s->img_x; else if (info.bpp == 16) width = 2 * s->img_x; else /* bpp = 32 and pad = 0 */ @@ -5704,8 +5674,7 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req if (info.bpp == 24) { easy = 1; } else if (info.bpp == 32) { - if (mb == 0xff && mg == 0xff00 && mr == 0x00ff0000 && ma == 0xff000000) - easy = 2; + if (mb == 0xff && mg == 0xff00 && mr == 0x00ff0000 && ma == 0xff000000) easy = 2; } if (!easy) { if (!mr || !mg || !mb) { @@ -5757,8 +5726,7 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req // if alpha channel is all 0s, replace with all 255s if (target == 4 && all_a == 0) - for (i = 4 * s->img_x * s->img_y - 1; i >= 0; i -= 4) - out[i] = 255; + for (i = 4 * s->img_x * s->img_y - 1; i >= 0; i -= 4) out[i] = 255; if (flip_vertically) { stbi_uc t; @@ -5962,7 +5930,8 @@ static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req tga_inverted = 1 - ((tga_inverted >> 5) & 1); // If I'm paletted, then I'll use the number of bits from the palette - if (tga_indexed) tga_comp = stbi__tga_get_comp(tga_palette_bits, 0, &tga_rgb16); + if (tga_indexed) + tga_comp = stbi__tga_get_comp(tga_palette_bits, 0, &tga_rgb16); else tga_comp = stbi__tga_get_comp(tga_bits_per_pixel, (tga_image_type == 3), &tga_rgb16); @@ -5974,8 +5943,7 @@ static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req *y = tga_height; if (comp) *comp = tga_comp; - if (!stbi__mad3sizes_valid(tga_width, tga_height, tga_comp, 0)) - return stbi__errpuc("too large", "Corrupt TGA"); + if (!stbi__mad3sizes_valid(tga_width, tga_height, tga_comp, 0)) return stbi__errpuc("too large", "Corrupt TGA"); tga_data = (unsigned char *) stbi__malloc_mad3(tga_width, tga_height, tga_comp, 0); if (!tga_data) return stbi__errpuc("outofmem", "Out of memory"); @@ -6062,8 +6030,7 @@ static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req }// end of reading a pixel // copy data - for (j = 0; j < tga_comp; ++j) - tga_data[i * tga_comp + j] = raw_data[j]; + for (j = 0; j < tga_comp; ++j) tga_data[i * tga_comp + j] = raw_data[j]; // in case we're in RLE mode, keep counting down --RLE_count; @@ -6100,13 +6067,11 @@ static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req } // convert to target component count - if (req_comp && req_comp != tga_comp) - tga_data = stbi__convert_format(tga_data, tga_comp, req_comp, tga_width, tga_height); + if (req_comp && req_comp != tga_comp) tga_data = stbi__convert_format(tga_data, tga_comp, req_comp, tga_width, tga_height); // the things I do to get rid of an error message, and yet keep // Microsoft's C compilers happy... [8^( - tga_palette_start = tga_palette_len = tga_palette_bits = - tga_x_origin = tga_y_origin = 0; + tga_palette_start = tga_palette_len = tga_palette_bits = tga_x_origin = tga_y_origin = 0; STBI_NOTUSED(tga_palette_start); // OK, done return tga_data; @@ -6174,16 +6139,14 @@ static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req return stbi__errpuc("not PSD", "Corrupt PSD image"); // Check file type version. - if (stbi__get16be(s) != 1) - return stbi__errpuc("wrong version", "Unsupported version of PSD image"); + if (stbi__get16be(s) != 1) return stbi__errpuc("wrong version", "Unsupported version of PSD image"); // Skip 6 reserved bytes. stbi__skip(s, 6); // Read the number of channels (R, G, B, A, etc). channelCount = stbi__get16be(s); - if (channelCount < 0 || channelCount > 16) - return stbi__errpuc("wrong channel count", "Unsupported number of channels in PSD image"); + if (channelCount < 0 || channelCount > 16) return stbi__errpuc("wrong channel count", "Unsupported number of channels in PSD image"); // Read the rows and columns of the image. h = stbi__get32be(s); @@ -6194,8 +6157,7 @@ static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req // Make sure the depth is 8 bits. bitdepth = stbi__get16be(s); - if (bitdepth != 8 && bitdepth != 16) - return stbi__errpuc("unsupported bit depth", "PSD bit depth is not 8 or 16 bit"); + if (bitdepth != 8 && bitdepth != 16) return stbi__errpuc("unsupported bit depth", "PSD bit depth is not 8 or 16 bit"); // Make sure the color mode is RGB. // Valid options are: @@ -6207,8 +6169,7 @@ static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req // 7: Multichannel // 8: Duotone // 9: Lab color - if (stbi__get16be(s) != 3) - return stbi__errpuc("wrong color format", "PSD is not in RGB color format"); + if (stbi__get16be(s) != 3) return stbi__errpuc("wrong color format", "PSD is not in RGB color format"); // Skip the Mode Data. (It's the palette for indexed color; other info for other modes.) stbi__skip(s, stbi__get32be(s)); @@ -6224,12 +6185,10 @@ static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req // 0: no compression // 1: RLE compressed compression = stbi__get16be(s); - if (compression > 1) - return stbi__errpuc("bad compression", "PSD has an unknown compression format"); + if (compression > 1) return stbi__errpuc("bad compression", "PSD has an unknown compression format"); // Check size - if (!stbi__mad3sizes_valid(4, w, h, 0)) - return stbi__errpuc("too large", "Corrupt PSD"); + if (!stbi__mad3sizes_valid(4, w, h, 0)) return stbi__errpuc("too large", "Corrupt PSD"); // Create the destination image. @@ -6266,8 +6225,7 @@ static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req p = out + channel; if (channel >= channelCount) { // Fill this channel with default data. - for (i = 0; i < pixelCount; i++, p += 4) - *p = (channel == 3 ? 255 : 0); + for (i = 0; i < pixelCount; i++, p += 4) *p = (channel == 3 ? 255 : 0); } else { // Read the RLE data. if (!stbi__psd_decode_rle(s, p, pixelCount)) { @@ -6288,27 +6246,22 @@ static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req if (bitdepth == 16 && bpc == 16) { stbi__uint16 *q = ((stbi__uint16 *) out) + channel; stbi__uint16 val = channel == 3 ? 65535 : 0; - for (i = 0; i < pixelCount; i++, q += 4) - *q = val; + for (i = 0; i < pixelCount; i++, q += 4) *q = val; } else { stbi_uc *p = out + channel; stbi_uc val = channel == 3 ? 255 : 0; - for (i = 0; i < pixelCount; i++, p += 4) - *p = val; + for (i = 0; i < pixelCount; i++, p += 4) *p = val; } } else { if (ri->bits_per_channel == 16) {// output bpc stbi__uint16 *q = ((stbi__uint16 *) out) + channel; - for (i = 0; i < pixelCount; i++, q += 4) - *q = (stbi__uint16) stbi__get16be(s); + for (i = 0; i < pixelCount; i++, q += 4) *q = (stbi__uint16) stbi__get16be(s); } else { stbi_uc *p = out + channel; if (bitdepth == 16) {// input bpc - for (i = 0; i < pixelCount; i++, p += 4) - *p = (stbi_uc) (stbi__get16be(s) >> 8); + for (i = 0; i < pixelCount; i++, p += 4) *p = (stbi_uc) (stbi__get16be(s) >> 8); } else { - for (i = 0; i < pixelCount; i++, p += 4) - *p = stbi__get8(s); + for (i = 0; i < pixelCount; i++, p += 4) *p = stbi__get8(s); } } } @@ -6372,8 +6325,7 @@ static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req static int stbi__pic_is4(stbi__context *s, const char *str) { int i; for (i = 0; i < 4; ++i) - if (stbi__get8(s) != (stbi_uc) str[i]) - return 0; + if (stbi__get8(s) != (stbi_uc) str[i]) return 0; return 1; } @@ -6381,20 +6333,16 @@ static int stbi__pic_is4(stbi__context *s, const char *str) { static int stbi__pic_test_core(stbi__context *s) { int i; - if (!stbi__pic_is4(s, "\x53\x80\xF6\x34")) - return 0; + if (!stbi__pic_is4(s, "\x53\x80\xF6\x34")) return 0; - for (i = 0; i < 84; ++i) - stbi__get8(s); + for (i = 0; i < 84; ++i) stbi__get8(s); - if (!stbi__pic_is4(s, "PICT")) - return 0; + if (!stbi__pic_is4(s, "PICT")) return 0; return 1; } -typedef struct -{ +typedef struct { stbi_uc size, type, channel; } stbi__pic_packet; @@ -6415,8 +6363,7 @@ static void stbi__copyval(int channel, stbi_uc *dest, const stbi_uc *src) { int mask = 0x80, i; for (i = 0; i < 4; ++i, mask >>= 1) - if (channel & mask) - dest[i] = src[i]; + if (channel & mask) dest[i] = src[i]; } static stbi_uc *stbi__pic_load_core(stbi__context *s, int width, int height, int *comp, stbi_uc *result) { @@ -6428,8 +6375,7 @@ static stbi_uc *stbi__pic_load_core(stbi__context *s, int width, int height, int do { stbi__pic_packet *packet; - if (num_packets == sizeof(packets) / sizeof(packets[0])) - return stbi__errpuc("bad format", "too many packets"); + if (num_packets == sizeof(packets) / sizeof(packets[0])) return stbi__errpuc("bad format", "too many packets"); packet = &packets[num_packets++]; @@ -6461,8 +6407,7 @@ static stbi_uc *stbi__pic_load_core(stbi__context *s, int width, int height, int int x; for (x = 0; x < width; ++x, dest += 4) - if (!stbi__readval(s, packet->channel, dest)) - return 0; + if (!stbi__readval(s, packet->channel, dest)) return 0; break; } @@ -6476,13 +6421,11 @@ static stbi_uc *stbi__pic_load_core(stbi__context *s, int width, int height, int count = stbi__get8(s); if (stbi__at_eof(s)) return stbi__errpuc("bad file", "file too short (pure read count)"); - if (count > left) - count = (stbi_uc) left; + if (count > left) count = (stbi_uc) left; if (!stbi__readval(s, packet->channel, value)) return 0; - for (i = 0; i < count; ++i, dest += 4) - stbi__copyval(packet->channel, dest, value); + for (i = 0; i < count; ++i, dest += 4) stbi__copyval(packet->channel, dest, value); left -= count; } } break; @@ -6500,21 +6443,17 @@ static stbi_uc *stbi__pic_load_core(stbi__context *s, int width, int height, int count = stbi__get16be(s); else count -= 127; - if (count > left) - return stbi__errpuc("bad file", "scanline overrun"); + if (count > left) return stbi__errpuc("bad file", "scanline overrun"); - if (!stbi__readval(s, packet->channel, value)) - return 0; + if (!stbi__readval(s, packet->channel, value)) return 0; - for (i = 0; i < count; ++i, dest += 4) - stbi__copyval(packet->channel, dest, value); + for (i = 0; i < count; ++i, dest += 4) stbi__copyval(packet->channel, dest, value); } else {// Raw ++count; if (count > left) return stbi__errpuc("bad file", "scanline overrun"); for (i = 0; i < count; ++i, dest += 4) - if (!stbi__readval(s, packet->channel, dest)) - return 0; + if (!stbi__readval(s, packet->channel, dest)) return 0; } left -= count; } @@ -6534,8 +6473,7 @@ static void *stbi__pic_load(stbi__context *s, int *px, int *py, int *comp, int r if (!comp) comp = &internal_comp; - for (i = 0; i < 92; ++i) - stbi__get8(s); + for (i = 0; i < 92; ++i) stbi__get8(s); x = stbi__get16be(s); y = stbi__get16be(s); @@ -6578,15 +6516,13 @@ static int stbi__pic_test(stbi__context *s) { // GIF loader -- public domain by Jean-Marc Lienher -- simplified/shrunk by stb #ifndef STBI_NO_GIF -typedef struct -{ +typedef struct { stbi__int16 prefix; stbi_uc first; stbi_uc suffix; } stbi__gif_lzw; -typedef struct -{ +typedef struct { int w, h; stbi_uc *out; // output buffer (always 4 components) stbi_uc *background;// The current "background" as far as a gif is concerned @@ -6632,8 +6568,7 @@ static void stbi__gif_parse_colortable(stbi__context *s, stbi_uc pal[256][4], in static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, int is_info) { stbi_uc version; - if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8') - return stbi__err("not GIF", "Corrupt GIF"); + if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8') return stbi__err("not GIF", "Corrupt GIF"); version = stbi__get8(s); if (version != '7' && version != '9') return stbi__err("not GIF", "Corrupt GIF"); @@ -6654,8 +6589,7 @@ static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, int is_in if (is_info) return 1; - if (g->flags & 0x80) - stbi__gif_parse_colortable(s, g->pal, 2 << (g->flags & 7), -1); + if (g->flags & 0x80) stbi__gif_parse_colortable(s, g->pal, 2 << (g->flags & 7), -1); return 1; } @@ -6680,8 +6614,7 @@ static void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code) { // recurse to decode the prefixes, since the linked-list is backwards, // and working backwards through an interleaved image would be nasty - if (g->codes[code].prefix >= 0) - stbi__out_gif_code(g, g->codes[code].prefix); + if (g->codes[code].prefix >= 0) stbi__out_gif_code(g, g->codes[code].prefix); if (g->cur_y >= g->max_y) return; @@ -6740,8 +6673,7 @@ static stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g) { if (valid_bits < codesize) { if (len == 0) { len = stbi__get8(s);// start new block - if (len == 0) - return g->out; + if (len == 0) return g->out; } --len; bits |= (stbi__int32) stbi__get8(s) << valid_bits; @@ -6759,8 +6691,7 @@ static stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g) { first = 0; } else if (code == clear + 1) {// end of stream code stbi__skip(s, len); - while ((len = stbi__get8(s)) > 0) - stbi__skip(s, len); + while ((len = stbi__get8(s)) > 0) stbi__skip(s, len); return g->out; } else if (code <= avail) { if (first) { @@ -6807,14 +6738,12 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i first_frame = 0; if (g->out == 0) { if (!stbi__gif_header(s, g, comp, 0)) return 0;// stbi__g_failure_reason set by stbi__gif_header - if (!stbi__mad3sizes_valid(4, g->w, g->h, 0)) - return stbi__errpuc("too large", "GIF image is too large"); + if (!stbi__mad3sizes_valid(4, g->w, g->h, 0)) return stbi__errpuc("too large", "GIF image is too large"); pcount = g->w * g->h; g->out = (stbi_uc *) stbi__malloc(4 * pcount); g->background = (stbi_uc *) stbi__malloc(4 * pcount); g->history = (stbi_uc *) stbi__malloc(pcount); - if (!g->out || !g->background || !g->history) - return stbi__errpuc("outofmem", "Out of memory"); + if (!g->out || !g->background || !g->history) return stbi__errpuc("outofmem", "Out of memory"); // image is treated as "transparent" at the start - ie, nothing overwrites the current background; // background colour is only used for pixels that are not rendered first frame, after that "background" @@ -6871,8 +6800,7 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i y = stbi__get16le(s); w = stbi__get16le(s); h = stbi__get16le(s); - if (((x + w) > (g->w)) || ((y + h) > (g->h))) - return stbi__errpuc("bad Image Descriptor", "Corrupt GIF"); + if (((x + w) > (g->w)) || ((y + h) > (g->h))) return stbi__errpuc("bad Image Descriptor", "Corrupt GIF"); g->line_size = g->w * 4; g->start_x = x * 4; @@ -6886,8 +6814,7 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i // we may not see *any* pixels or the image is malformed; // to make sure this is caught, move the current y down to // max_y (which is what out_gif_code checks). - if (w == 0) - g->cur_y = g->max_y; + if (w == 0) g->cur_y = g->max_y; g->lflags = stbi__get8(s); @@ -7019,20 +6946,17 @@ static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y, if (delays) { int *new_delays = (int *) STBI_REALLOC_SIZED(*delays, delays_size, sizeof(int) * layers); - if (!new_delays) - return stbi__load_gif_main_outofmem(&g, out, delays); + if (!new_delays) return stbi__load_gif_main_outofmem(&g, out, delays); *delays = new_delays; delays_size = layers * sizeof(int); } } else { out = (stbi_uc *) stbi__malloc(layers * stride); - if (!out) - return stbi__load_gif_main_outofmem(&g, out, delays); + if (!out) return stbi__load_gif_main_outofmem(&g, out, delays); out_size = layers * stride; if (delays) { *delays = (int *) stbi__malloc(layers * sizeof(int)); - if (!*delays) - return stbi__load_gif_main_outofmem(&g, out, delays); + if (!*delays) return stbi__load_gif_main_outofmem(&g, out, delays); delays_size = layers * sizeof(int); } } @@ -7053,8 +6977,7 @@ static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y, STBI_FREE(g.background); // do the final conversion after loading everything; - if (req_comp && req_comp != 4) - out = stbi__convert_format(out, 4, req_comp, layers * g.w, g.h); + if (req_comp && req_comp != 4) out = stbi__convert_format(out, 4, req_comp, layers * g.w, g.h); *z = layers; return out; @@ -7077,8 +7000,7 @@ static void *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req // moved conversion to after successful load so that the same // can be done for multiple frames. - if (req_comp && req_comp != 4) - u = stbi__convert_format(u, 4, req_comp, g.w, g.h); + if (req_comp && req_comp != 4) u = stbi__convert_format(u, 4, req_comp, g.w, g.h); } else if (g.out) { // if there was an error and we allocated an image buffer, free it! STBI_FREE(g.out); @@ -7103,8 +7025,7 @@ static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp) { static int stbi__hdr_test_core(stbi__context *s, const char *signature) { int i; for (i = 0; signature[i]; ++i) - if (stbi__get8(s) != signature[i]) - return 0; + if (stbi__get8(s) != signature[i]) return 0; stbi__rewind(s); return 1; } @@ -7130,8 +7051,7 @@ static char *stbi__hdr_gettoken(stbi__context *z, char *buffer) { buffer[len++] = c; if (len == STBI__HDR_BUFLEN - 1) { // flush to end of line - while (!stbi__at_eof(z) && stbi__get8(z) != '\n') - ; + while (!stbi__at_eof(z) && stbi__get8(z) != '\n'); break; } c = (char) stbi__get8(z); @@ -7186,8 +7106,7 @@ static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int re // Check identifier headerToken = stbi__hdr_gettoken(s, buffer); - if (strcmp(headerToken, "#?RADIANCE") != 0 && strcmp(headerToken, "#?RGBE") != 0) - return stbi__errpf("not HDR", "Corrupt HDR image"); + if (strcmp(headerToken, "#?RADIANCE") != 0 && strcmp(headerToken, "#?RGBE") != 0) return stbi__errpf("not HDR", "Corrupt HDR image"); // Parse header for (;;) { @@ -7218,13 +7137,11 @@ static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int re if (comp) *comp = 3; if (req_comp == 0) req_comp = 3; - if (!stbi__mad4sizes_valid(width, height, req_comp, sizeof(float), 0)) - return stbi__errpf("too large", "HDR image is too large"); + if (!stbi__mad4sizes_valid(width, height, req_comp, sizeof(float), 0)) return stbi__errpf("too large", "HDR image is too large"); // Read data hdr_data = (float *) stbi__malloc_mad4(width, height, req_comp, sizeof(float), 0); - if (!hdr_data) - return stbi__errpf("outofmem", "Out of memory"); + if (!hdr_data) return stbi__errpf("outofmem", "Out of memory"); // Load image data // image data is stored as some number of sca @@ -7289,8 +7206,7 @@ static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int re STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); } - for (z = 0; z < count; ++z) - scanline[i++ * 4 + k] = value; + for (z = 0; z < count; ++z) scanline[i++ * 4 + k] = value; } else { // Dump if (count > nleft) { @@ -7298,16 +7214,13 @@ static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int re STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); } - for (z = 0; z < count; ++z) - scanline[i++ * 4 + k] = stbi__get8(s); + for (z = 0; z < count; ++z) scanline[i++ * 4 + k] = stbi__get8(s); } } } - for (i = 0; i < width; ++i) - stbi__hdr_convert(hdr_data + (j * width + i) * req_comp, scanline + i * 4, req_comp); + for (i = 0; i < width; ++i) stbi__hdr_convert(hdr_data + (j * width + i) * req_comp, scanline + i * 4, req_comp); } - if (scanline) - STBI_FREE(scanline); + if (scanline) STBI_FREE(scanline); } return hdr_data; @@ -7474,8 +7387,7 @@ static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp) { do { stbi__pic_packet *packet; - if (num_packets == sizeof(packets) / sizeof(packets[0])) - return 0; + if (num_packets == sizeof(packets) / sizeof(packets[0])) return 0; packet = &packets[num_packets++]; chained = stbi__get8(s); @@ -7529,8 +7441,7 @@ static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req STBI_NOTUSED(ri); ri->bits_per_channel = stbi__pnm_info(s, (int *) &s->img_x, (int *) &s->img_y, (int *) &s->img_n); - if (ri->bits_per_channel == 0) - return 0; + if (ri->bits_per_channel == 0) return 0; if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large", "Very large image (corrupt?)"); if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large", "Very large image (corrupt?)"); @@ -7539,8 +7450,7 @@ static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req *y = s->img_y; if (comp) *comp = s->img_n; - if (!stbi__mad4sizes_valid(s->img_n, s->img_x, s->img_y, ri->bits_per_channel / 8, 0)) - return stbi__errpuc("too large", "PNM too large"); + if (!stbi__mad4sizes_valid(s->img_n, s->img_x, s->img_y, ri->bits_per_channel / 8, 0)) return stbi__errpuc("too large", "PNM too large"); out = (stbi_uc *) stbi__malloc_mad4(s->img_n, s->img_x, s->img_y, ri->bits_per_channel / 8, 0); if (!out) return stbi__errpuc("outofmem", "Out of memory"); @@ -7559,14 +7469,11 @@ static int stbi__pnm_isspace(char c) { static void stbi__pnm_skip_whitespace(stbi__context *s, char *c) { for (;;) { - while (!stbi__at_eof(s) && stbi__pnm_isspace(*c)) - *c = (char) stbi__get8(s); + while (!stbi__at_eof(s) && stbi__pnm_isspace(*c)) *c = (char) stbi__get8(s); - if (stbi__at_eof(s) || *c != '#') - break; + if (stbi__at_eof(s) || *c != '#') break; - while (!stbi__at_eof(s) && *c != '\n' && *c != '\r') - *c = (char) stbi__get8(s); + while (!stbi__at_eof(s) && *c != '\n' && *c != '\r') *c = (char) stbi__get8(s); } } @@ -7624,8 +7531,7 @@ static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp) { } static int stbi__pnm_is16(stbi__context *s) { - if (stbi__pnm_info(s, NULL, NULL, NULL) == 16) - return 1; + if (stbi__pnm_info(s, NULL, NULL, NULL) == 16) return 1; return 0; } #endif @@ -7665,8 +7571,7 @@ static int stbi__info_main(stbi__context *s, int *x, int *y, int *comp) { // test tga last because it's a crappy test! #ifndef STBI_NO_TGA - if (stbi__tga_info(s, x, y, comp)) - return 1; + if (stbi__tga_info(s, x, y, comp)) return 1; #endif return stbi__err("unknown image type", "Image not of any known type, or corrupt"); } diff --git a/spine-sfml/c/example/main.cpp b/spine-sfml/c/example/main.cpp index b0444dc4f..f3a575690 100644 --- a/spine-sfml/c/example/main.cpp +++ b/spine-sfml/c/example/main.cpp @@ -90,8 +90,7 @@ spSkeletonData *readSkeletonBinaryData(const char *filename, spAtlas *atlas, flo return skeletonData; } -void testcase(void func(spSkeletonData *skeletonData, spAtlas *atlas), - const char *jsonName, const char *binaryName, const char *atlasName, +void testcase(void func(spSkeletonData *skeletonData, spAtlas *atlas), const char *jsonName, const char *binaryName, const char *atlasName, float scale) { spAtlas *atlas = spAtlas_createFromFile(atlasName, 0); @@ -760,7 +759,7 @@ void celestialCircus(spSkeletonData *skeletonData, spAtlas *atlas) { spSkeleton *skeleton = drawable->skeleton; skeleton->x = 320; skeleton->y = 480; - skeleton->scaleX = skeleton->scaleY = 0.2f; + skeleton->scaleX = skeleton->scaleY = 0.2f; spSkeleton_updateWorldTransform(skeleton, SP_PHYSICS_UPDATE); spAnimationState_setAnimationByName(drawable->state, 0, "swing", true); @@ -785,7 +784,7 @@ void celestialCircus(spSkeletonData *skeletonData, spAtlas *atlas) { } int main() { - testcase(celestialCircus, "data/celestial-circus-pro.json", "data/celestial-circus-pro.skel", "data/celestial-circus-pma.atlas", 1); + testcase(celestialCircus, "data/celestial-circus-pro.json", "data/celestial-circus-pro.skel", "data/celestial-circus-pma.atlas", 1); testcase(cloudpot, "data/cloud-pot.json", "data/cloud-pot.skel", "data/cloud-pot-pma.atlas", 0.2); testcase(sack, "data/sack-pro.json", "data/sack-pro.skel", "data/sack-pma.atlas", 0.2f); testcase(snowglobe, "data/snowglobe-pro.json", "data/snowglobe-pro.skel", "data/snowglobe-pma.atlas", 0.2f); diff --git a/spine-sfml/c/src/spine/spine-sfml.cpp b/spine-sfml/c/src/spine/spine-sfml.cpp index ef81ea202..e2e90c098 100644 --- a/spine-sfml/c/src/spine/spine-sfml.cpp +++ b/spine-sfml/c/src/spine/spine-sfml.cpp @@ -56,7 +56,9 @@ void spColorArray_dispose(spColorArray *self) { _spFree((void *) self->items); _spFree((void *) self); } -void spColorArray_clear(spColorArray *self) { self->size = 0; } +void spColorArray_clear(spColorArray *self) { + self->size = 0; +} spColorArray *spColorArray_setSize(spColorArray *self, int newSize) { self->size = newSize; if (self->capacity < newSize) { @@ -79,11 +81,15 @@ void spColorArray_add(spColorArray *self, spColor value) { } void spColorArray_addAll(spColorArray *self, spColorArray *other) { int i = 0; - for (; i < other->size; i++) { spColorArray_add(self, other->items[i]); } + for (; i < other->size; i++) { + spColorArray_add(self, other->items[i]); + } } void spColorArray_addAllValues(spColorArray *self, spColor *values, int offset, int count) { int i = offset, n = offset + count; - for (; i < n; i++) { spColorArray_add(self, values[i]); } + for (; i < n; i++) { + spColorArray_add(self, values[i]); + } } void spColorArray_removeAt(spColorArray *self, int index) { self->size--; @@ -94,7 +100,9 @@ spColor spColorArray_pop(spColorArray *self) { spColor item = self->items[--self->size]; return item; } -spColor spColorArray_peek(spColorArray *self) { return self->items[self->size - 1]; } +spColor spColorArray_peek(spColorArray *self) { + return self->items[self->size - 1]; +} void _spAtlasPage_createTexture(spAtlasPage *self, const char *path) { Texture *texture = new Texture(); @@ -121,9 +129,8 @@ char *_spUtil_readFile(const char *path, int *length) { namespace spine { - SkeletonDrawable::SkeletonDrawable(spSkeletonData *skeletonData, spAnimationStateData *stateData) : timeScale(1), - vertexArray(new VertexArray(Triangles, skeletonData->bonesCount * 4)), - worldVertices(0), clipper(0) { + SkeletonDrawable::SkeletonDrawable(spSkeletonData *skeletonData, spAnimationStateData *stateData) + : timeScale(1), vertexArray(new VertexArray(Triangles, skeletonData->bonesCount * 4)), worldVertices(0), clipper(0) { spBone_setYDown(true); worldVertices = MALLOC(float, SPINE_MESH_VERTEX_COUNT_MAX); skeleton = spSkeleton_create(skeletonData); diff --git a/spine-sfml/c/src/spine/spine-sfml.h b/spine-sfml/c/src/spine/spine-sfml.h index c9f39a8f6..bdbf2d82a 100644 --- a/spine-sfml/c/src/spine/spine-sfml.h +++ b/spine-sfml/c/src/spine/spine-sfml.h @@ -56,8 +56,12 @@ namespace spine { virtual void draw(sf::RenderTarget &target, sf::RenderStates states) const; - void setUsePremultipliedAlpha(bool usePMA) { usePremultipliedAlpha = usePMA; }; - bool getUsePremultipliedAlpha() { return usePremultipliedAlpha; }; + void setUsePremultipliedAlpha(bool usePMA) { + usePremultipliedAlpha = usePMA; + }; + bool getUsePremultipliedAlpha() { + return usePremultipliedAlpha; + }; private: bool ownsAnimationStateData; diff --git a/spine-sfml/cpp/example/main.cpp b/spine-sfml/cpp/example/main.cpp index 52113b2df..54abb6ba9 100644 --- a/spine-sfml/cpp/example/main.cpp +++ b/spine-sfml/cpp/example/main.cpp @@ -63,8 +63,8 @@ void callback(AnimationState *state, EventType type, TrackEntry *entry, Event *e printf("%d dispose: %s\n", entry->getTrackIndex(), animationName.buffer()); break; case EventType_Event: - printf("%d event: %s, %s: %d, %f, %s %f %f\n", entry->getTrackIndex(), animationName.buffer(), event->getData().getName().buffer(), event->getIntValue(), event->getFloatValue(), - event->getStringValue().buffer(), event->getVolume(), event->getBalance()); + printf("%d event: %s, %s: %d, %f, %s %f %f\n", entry->getTrackIndex(), animationName.buffer(), event->getData().getName().buffer(), + event->getIntValue(), event->getFloatValue(), event->getStringValue().buffer(), event->getVolume(), event->getBalance()); break; } fflush(stdout); @@ -92,9 +92,7 @@ shared_ptr readSkeletonBinaryData(const char *filename, Atlas *atl return shared_ptr(skeletonData); } -void testcase(void func(SkeletonData *skeletonData, Atlas *atlas), - const char *jsonName, const char *binaryName, const char *atlasName, - float scale) { +void testcase(void func(SkeletonData *skeletonData, Atlas *atlas), const char *jsonName, const char *binaryName, const char *atlasName, float scale) { SP_UNUSED(jsonName); SFMLTextureLoader textureLoader; auto atlas = make_unique_test(atlasName, &textureLoader); @@ -623,8 +621,8 @@ void celestialCircus(SkeletonData *skeletonData, Atlas *atlas) { Skeleton *skeleton = drawable.skeleton; skeleton->setPosition(320, 480); - skeleton->setScaleX(0.2); - skeleton->setScaleY(0.2); + skeleton->setScaleX(0.2); + skeleton->setScaleY(0.2); skeleton->updateWorldTransform(Physics_Update); drawable.state->setAnimation(0, "swing", true); @@ -777,7 +775,7 @@ extern spine::SkeletonRenderer *skeletonRenderer; int main() { SpineExtension::setInstance(&dbgExtension); - testcase(celestialCircus, "data/celestial-circus-pro.json", "data/celestial-circus-pro.skel", "data/celestial-circus-pma.atlas", 1); + testcase(celestialCircus, "data/celestial-circus-pro.json", "data/celestial-circus-pro.skel", "data/celestial-circus-pma.atlas", 1); testcase(mixAndMatch, "data/mix-and-match-pro.json", "data/mix-and-match-pro.skel", "data/mix-and-match-pma.atlas", 0.5f); testcase(cloudpot, "data/cloud-pot.json", "data/cloud-pot.skel", "data/cloud-pot-pma.atlas", 0.2); testcase(sack, "data/sack-pro.json", "data/sack-pro.skel", "data/sack-pma.atlas", 0.2f); @@ -793,7 +791,7 @@ int main() { testcase(goblins, "data/goblins-pro.json", "data/goblins-pro.skel", "data/goblins-pma.atlas", 1.4f); testcase(stretchyman, "data/stretchyman-pro.json", "data/stretchyman-pro.skel", "data/stretchyman-pma.atlas", 0.6f); - delete skeletonRenderer; + delete skeletonRenderer; dbgExtension.reportLeaks(); return 0; } diff --git a/spine-sfml/cpp/example/testbed.cpp b/spine-sfml/cpp/example/testbed.cpp index 4f9d0d9a9..9e7b422a3 100644 --- a/spine-sfml/cpp/example/testbed.cpp +++ b/spine-sfml/cpp/example/testbed.cpp @@ -35,9 +35,11 @@ using namespace spine; class NullTextureLoader : public TextureLoader { public: - virtual void load(AtlasPage &, const String &) {} + virtual void load(AtlasPage &, const String &) { + } - virtual void unload(void *) {} + virtual void unload(void *) { + } }; class NullAttachmentLoader : public AttachmentLoader { diff --git a/spine-sfml/cpp/src/spine/spine-sfml.cpp b/spine-sfml/cpp/src/spine/spine-sfml.cpp index cbadc9835..8f9a72ae8 100644 --- a/spine-sfml/cpp/src/spine/spine-sfml.cpp +++ b/spine-sfml/cpp/src/spine/spine-sfml.cpp @@ -36,24 +36,22 @@ using namespace sf; using namespace spine; -sf::BlendMode blendModes[] = { - sf::BlendMode(sf::BlendMode::SrcAlpha, sf::BlendMode::OneMinusSrcAlpha), - sf::BlendMode(sf::BlendMode::SrcAlpha, sf::BlendMode::One), - sf::BlendMode(sf::BlendMode::DstColor, sf::BlendMode::OneMinusSrcAlpha), - sf::BlendMode(sf::BlendMode::One, sf::BlendMode::OneMinusSrcColor)}; +sf::BlendMode blendModes[] = {sf::BlendMode(sf::BlendMode::SrcAlpha, sf::BlendMode::OneMinusSrcAlpha), + sf::BlendMode(sf::BlendMode::SrcAlpha, sf::BlendMode::One), + sf::BlendMode(sf::BlendMode::DstColor, sf::BlendMode::OneMinusSrcAlpha), + sf::BlendMode(sf::BlendMode::One, sf::BlendMode::OneMinusSrcColor)}; sf::BlendMode blendModesPma[] = { - sf::BlendMode(sf::BlendMode::One, sf::BlendMode::OneMinusSrcAlpha), - sf::BlendMode(sf::BlendMode::One, sf::BlendMode::One), - sf::BlendMode(sf::BlendMode::DstColor, sf::BlendMode::OneMinusSrcAlpha), - sf::BlendMode(sf::BlendMode::One, sf::BlendMode::OneMinusSrcColor), + sf::BlendMode(sf::BlendMode::One, sf::BlendMode::OneMinusSrcAlpha), + sf::BlendMode(sf::BlendMode::One, sf::BlendMode::One), + sf::BlendMode(sf::BlendMode::DstColor, sf::BlendMode::OneMinusSrcAlpha), + sf::BlendMode(sf::BlendMode::One, sf::BlendMode::OneMinusSrcColor), }; SkeletonRenderer *skeletonRenderer = nullptr; -SkeletonDrawable::SkeletonDrawable(SkeletonData *skeletonData, AnimationStateData *stateData) : timeScale(1), - usePremultipliedAlpha(false), - vertexArray(new VertexArray(Triangles, skeletonData->getBones().size() * 4)) { +SkeletonDrawable::SkeletonDrawable(SkeletonData *skeletonData, AnimationStateData *stateData) + : timeScale(1), usePremultipliedAlpha(false), vertexArray(new VertexArray(Triangles, skeletonData->getBones().size() * 4)) { Bone::setYDown(true); skeleton = new (__FILE__, __LINE__) Skeleton(skeletonData); ownsAnimationStateData = stateData == 0; diff --git a/spine-sfml/cpp/src/spine/spine-sfml.h b/spine-sfml/cpp/src/spine/spine-sfml.h index cf28930de..58d9dff10 100644 --- a/spine-sfml/cpp/src/spine/spine-sfml.h +++ b/spine-sfml/cpp/src/spine/spine-sfml.h @@ -55,9 +55,13 @@ namespace spine { virtual void draw(sf::RenderTarget &target, sf::RenderStates states) const; - void setUsePremultipliedAlpha(bool usePMA) { usePremultipliedAlpha = usePMA; }; + void setUsePremultipliedAlpha(bool usePMA) { + usePremultipliedAlpha = usePMA; + }; - bool getUsePremultipliedAlpha() { return usePremultipliedAlpha; }; + bool getUsePremultipliedAlpha() { + return usePremultipliedAlpha; + }; private: bool ownsAnimationStateData; diff --git a/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Private/SpineAtlasImportFactory.cpp b/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Private/SpineAtlasImportFactory.cpp index d415330a0..880a96825 100644 --- a/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Private/SpineAtlasImportFactory.cpp +++ b/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Private/SpineAtlasImportFactory.cpp @@ -53,7 +53,8 @@ bool USpineAtlasAssetFactory::FactoryCanImport(const FString &Filename) { return true; } -UObject *USpineAtlasAssetFactory::FactoryCreateFile(UClass *InClass, UObject *InParent, FName InName, EObjectFlags Flags, const FString &Filename, const TCHAR *Parms, FFeedbackContext *Warn, bool &bOutOperationCanceled) { +UObject *USpineAtlasAssetFactory::FactoryCreateFile(UClass *InClass, UObject *InParent, FName InName, EObjectFlags Flags, const FString &Filename, + const TCHAR *Parms, FFeedbackContext *Warn, bool &bOutOperationCanceled) { FString FileExtension = FPaths::GetExtension(Filename); GEditor->GetEditorSubsystem()->BroadcastAssetPreImport(this, InClass, InParent, InName, *FileExtension); @@ -79,8 +80,7 @@ bool USpineAtlasAssetFactory::CanReimport(UObject *Obj, TArray &OutFile if (!asset) return false; FString filename = asset->GetAtlasFileName().ToString(); - if (!filename.IsEmpty()) - OutFilenames.Add(filename); + if (!filename.IsEmpty()) OutFilenames.Add(filename); return true; } @@ -88,8 +88,7 @@ bool USpineAtlasAssetFactory::CanReimport(UObject *Obj, TArray &OutFile void USpineAtlasAssetFactory::SetReimportPaths(UObject *Obj, const TArray &NewReimportPaths) { USpineAtlasAsset *asset = Cast(Obj); - if (asset && ensure(NewReimportPaths.Num() == 1)) - asset->SetAtlasFileName(FName(*NewReimportPaths[0])); + if (asset && ensure(NewReimportPaths.Num() == 1)) asset->SetAtlasFileName(FName(*NewReimportPaths[0])); } EReimportResult::Type USpineAtlasAssetFactory::Reimport(UObject *Obj) { @@ -105,7 +104,8 @@ EReimportResult::Type USpineAtlasAssetFactory::Reimport(UObject *Obj) { LoadAtlas(asset, currentSourcePath, longPackagePath); - if (Obj->GetOuter()) Obj->GetOuter()->MarkPackageDirty(); + if (Obj->GetOuter()) + Obj->GetOuter()->MarkPackageDirty(); else Obj->MarkPackageDirty(); diff --git a/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Private/SpineEditorPlugin.cpp b/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Private/SpineEditorPlugin.cpp index d91235883..8605fb5d2 100644 --- a/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Private/SpineEditorPlugin.cpp +++ b/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Private/SpineEditorPlugin.cpp @@ -34,18 +34,34 @@ class FSpineAtlasAssetTypeActions : public FAssetTypeActions_Base { public: - UClass *GetSupportedClass() const override { return USpineAtlasAsset::StaticClass(); }; - FText GetName() const override { return INVTEXT("Spine atlas asset"); }; - FColor GetTypeColor() const override { return FColor::Red; }; - uint32 GetCategories() override { return EAssetTypeCategories::Misc; }; + UClass *GetSupportedClass() const override { + return USpineAtlasAsset::StaticClass(); + }; + FText GetName() const override { + return INVTEXT("Spine atlas asset"); + }; + FColor GetTypeColor() const override { + return FColor::Red; + }; + uint32 GetCategories() override { + return EAssetTypeCategories::Misc; + }; }; class FSpineSkeletonDataAssetTypeActions : public FAssetTypeActions_Base { public: - UClass *GetSupportedClass() const override { return USpineSkeletonDataAsset::StaticClass(); }; - FText GetName() const override { return INVTEXT("Spine data asset"); }; - FColor GetTypeColor() const override { return FColor::Red; }; - uint32 GetCategories() override { return EAssetTypeCategories::Misc; }; + UClass *GetSupportedClass() const override { + return USpineSkeletonDataAsset::StaticClass(); + }; + FText GetName() const override { + return INVTEXT("Spine data asset"); + }; + FColor GetTypeColor() const override { + return FColor::Red; + }; + uint32 GetCategories() override { + return EAssetTypeCategories::Misc; + }; }; class FSpineEditorPlugin : public ISpineEditorPlugin { diff --git a/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Private/SpineSkeletonImportFactory.cpp b/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Private/SpineSkeletonImportFactory.cpp index b27dcac09..a25d4d21a 100644 --- a/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Private/SpineSkeletonImportFactory.cpp +++ b/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Private/SpineSkeletonImportFactory.cpp @@ -75,7 +75,8 @@ void LoadAtlas(const FString &Filename, const FString &TargetPath) { AssetToolsModule.Get().ImportAssets(fileNames, TargetPath); } -UObject *USpineSkeletonAssetFactory::FactoryCreateFile(UClass *InClass, UObject *InParent, FName InName, EObjectFlags Flags, const FString &Filename, const TCHAR *Parms, FFeedbackContext *Warn, bool &bOutOperationCanceled) { +UObject *USpineSkeletonAssetFactory::FactoryCreateFile(UClass *InClass, UObject *InParent, FName InName, EObjectFlags Flags, const FString &Filename, + const TCHAR *Parms, FFeedbackContext *Warn, bool &bOutOperationCanceled) { USpineSkeletonDataAsset *asset = NewObject(InParent, InClass, InName, Flags); TArray rawData; if (!FFileHelper::LoadFileToArray(rawData, *Filename, 0)) { @@ -94,8 +95,7 @@ bool USpineSkeletonAssetFactory::CanReimport(UObject *Obj, TArray &OutF if (!asset) return false; FString filename = asset->GetSkeletonDataFileName().ToString(); - if (!filename.IsEmpty()) - OutFilenames.Add(filename); + if (!filename.IsEmpty()) OutFilenames.Add(filename); return true; } @@ -103,8 +103,7 @@ bool USpineSkeletonAssetFactory::CanReimport(UObject *Obj, TArray &OutF void USpineSkeletonAssetFactory::SetReimportPaths(UObject *Obj, const TArray &NewReimportPaths) { USpineSkeletonDataAsset *asset = Cast(Obj); - if (asset && ensure(NewReimportPaths.Num() == 1)) - asset->SetSkeletonDataFileName(FName(*NewReimportPaths[0])); + if (asset && ensure(NewReimportPaths.Num() == 1)) asset->SetSkeletonDataFileName(FName(*NewReimportPaths[0])); } EReimportResult::Type USpineSkeletonAssetFactory::Reimport(UObject *Obj) { @@ -116,7 +115,8 @@ EReimportResult::Type USpineSkeletonAssetFactory::Reimport(UObject *Obj) { const FString longPackagePath = FPackageName::GetLongPackagePath(asset->GetOutermost()->GetPathName()); LoadAtlas(*asset->GetSkeletonDataFileName().ToString(), longPackagePath); - if (Obj->GetOuter()) Obj->GetOuter()->MarkPackageDirty(); + if (Obj->GetOuter()) + Obj->GetOuter()->MarkPackageDirty(); else Obj->MarkPackageDirty(); diff --git a/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Public/SpineAtlasImportFactory.h b/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Public/SpineAtlasImportFactory.h index 054ec3b96..8cd14e69b 100644 --- a/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Public/SpineAtlasImportFactory.h +++ b/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Public/SpineAtlasImportFactory.h @@ -42,7 +42,8 @@ class USpineAtlasAssetFactory : public UFactory, public FReimportHandler { virtual FText GetToolTip() const override; virtual bool FactoryCanImport(const FString &Filename) override; - virtual UObject *FactoryCreateFile(UClass *InClass, UObject *InParent, FName InName, EObjectFlags Flags, const FString &Filename, const TCHAR *Parms, FFeedbackContext *Warn, bool &bOutOperationCanceled) override; + virtual UObject *FactoryCreateFile(UClass *InClass, UObject *InParent, FName InName, EObjectFlags Flags, const FString &Filename, + const TCHAR *Parms, FFeedbackContext *Warn, bool &bOutOperationCanceled) override; virtual bool CanReimport(UObject *Obj, TArray &OutFilenames) override; virtual void SetReimportPaths(UObject *Obj, const TArray &NewReimportPaths) override; diff --git a/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Public/SpineSkeletonImportFactory.h b/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Public/SpineSkeletonImportFactory.h index 652113a7f..0208e403c 100644 --- a/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Public/SpineSkeletonImportFactory.h +++ b/spine-ue/Plugins/SpinePlugin/Source/SpineEditorPlugin/Public/SpineSkeletonImportFactory.h @@ -41,7 +41,8 @@ class USpineSkeletonAssetFactory : public UFactory, public FReimportHandler { virtual FText GetToolTip() const override; virtual bool FactoryCanImport(const FString &Filename) override; - virtual UObject *FactoryCreateFile(UClass *InClass, UObject *InParent, FName InName, EObjectFlags Flags, const FString &Filename, const TCHAR *Parms, FFeedbackContext *Warn, bool &bOutOperationCanceled) override; + virtual UObject *FactoryCreateFile(UClass *InClass, UObject *InParent, FName InName, EObjectFlags Flags, const FString &Filename, + const TCHAR *Parms, FFeedbackContext *Warn, bool &bOutOperationCanceled) override; virtual bool CanReimport(UObject *Obj, TArray &OutFilenames) override; virtual void SetReimportPaths(UObject *Obj, const TArray &NewReimportPaths) override; diff --git a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp index 585291c4d..5bead80a8 100644 --- a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp +++ b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp @@ -50,7 +50,8 @@ struct SpineSlateMaterialBrush : public FSlateBrush { static FCriticalSection NamePoolLock; SpineSlateMaterialBrush(class UMaterialInterface &InMaterial, const FVector2D &InImageSize) - : FSlateBrush(ESlateBrushDrawType::Image, FName(TEXT("None")), FMargin(0), ESlateBrushTileType::NoTile, ESlateBrushImageType::FullColor, InImageSize, FLinearColor::White, &InMaterial) { + : FSlateBrush(ESlateBrushDrawType::Image, FName(TEXT("None")), FMargin(0), ESlateBrushTileType::NoTile, ESlateBrushImageType::FullColor, + InImageSize, FLinearColor::White, &InMaterial) { // Workaround for https://github.com/EsotericSoftware/spine-runtimes/issues/2006 FScopeLock Lock(&NamePoolLock); @@ -106,8 +107,8 @@ static void setVertex(FSlateVertex *vertex, float x, float y, float u, float v, vertex->PixelSize[1] = 1; } -int32 SSpineWidget::OnPaint(const FPaintArgs &Args, const FGeometry &AllottedGeometry, const FSlateRect &MyClippingRect, FSlateWindowElementList &OutDrawElements, - int32 LayerId, const FWidgetStyle &InWidgetStyle, bool bParentEnabled) const { +int32 SSpineWidget::OnPaint(const FPaintArgs &Args, const FGeometry &AllottedGeometry, const FSlateRect &MyClippingRect, + FSlateWindowElementList &OutDrawElements, int32 LayerId, const FWidgetStyle &InWidgetStyle, bool bParentEnabled) const { SSpineWidget *self = (SSpineWidget *) this; UMaterialInstanceDynamic *MatNow = nullptr; @@ -200,7 +201,9 @@ int32 SSpineWidget::OnPaint(const FPaintArgs &Args, const FGeometry &AllottedGeo return LayerId; } -void SSpineWidget::Flush(int32 LayerId, FSlateWindowElementList &OutDrawElements, const FGeometry &AllottedGeometry, int &Idx, TArray &Vertices, TArray &Indices, TArray &Uvs, TArray &Colors, TArray &Colors2, UMaterialInstanceDynamic *Material) { +void SSpineWidget::Flush(int32 LayerId, FSlateWindowElementList &OutDrawElements, const FGeometry &AllottedGeometry, int &Idx, + TArray &Vertices, TArray &Indices, TArray &Uvs, TArray &Colors, TArray &Colors2, + UMaterialInstanceDynamic *Material) { if (Vertices.Num() == 0) return; SSpineWidget *self = (SSpineWidget *) this; @@ -209,7 +212,8 @@ void SSpineWidget::Flush(int32 LayerId, FSlateWindowElementList &OutDrawElements const float setupScale = sizeScale.GetMin(); for (int i = 0; i < Vertices.Num(); i++) { - Vertices[i] = (Vertices[i] + FVector(-boundsMin.X - boundsSize.X / 2, boundsMin.Y + boundsSize.Y / 2, 0)) * setupScale + FVector(widgetSize.X / 2, widgetSize.Y / 2, 0); + Vertices[i] = (Vertices[i] + FVector(-boundsMin.X - boundsSize.X / 2, boundsMin.Y + boundsSize.Y / 2, 0)) * setupScale + + FVector(widgetSize.X / 2, widgetSize.Y / 2, 0); } self->renderData.IndexData.SetNumUninitialized(Indices.Num()); @@ -235,7 +239,8 @@ void SSpineWidget::Flush(int32 LayerId, FSlateWindowElementList &OutDrawElements } if (renderData.RenderingResourceHandle.IsValid()) { - FSlateDrawElement::MakeCustomVerts(OutDrawElements, LayerId, renderData.RenderingResourceHandle, renderData.VertexData, renderData.IndexData, nullptr, 0, 0); + FSlateDrawElement::MakeCustomVerts(OutDrawElements, LayerId, renderData.RenderingResourceHandle, renderData.VertexData, renderData.IndexData, + nullptr, 0, 0); } Vertices.SetNum(0); @@ -292,7 +297,8 @@ void SSpineWidget::UpdateMesh(int32 LayerId, FSlateWindowElementList &OutDrawEle clipper.clipEnd(*slot); continue; } - if (!attachment->getRTTI().isExactly(RegionAttachment::rtti) && !attachment->getRTTI().isExactly(MeshAttachment::rtti) && !attachment->getRTTI().isExactly(ClippingAttachment::rtti)) { + if (!attachment->getRTTI().isExactly(RegionAttachment::rtti) && !attachment->getRTTI().isExactly(MeshAttachment::rtti) && + !attachment->getRTTI().isExactly(ClippingAttachment::rtti)) { clipper.clipEnd(*slot); continue; } diff --git a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineAtlasAsset.cpp b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineAtlasAsset.cpp index 0971e52e9..a3bd35123 100644 --- a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineAtlasAsset.cpp +++ b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineAtlasAsset.cpp @@ -44,13 +44,11 @@ void USpineAtlasAsset::SetAtlasFileName(const FName &AtlasFileName) { importData->UpdateFilenameOnly(AtlasFileName.ToString()); TArray files; importData->ExtractFilenames(files); - if (files.Num() > 0) - atlasFileName = FName(*files[0]); + if (files.Num() > 0) atlasFileName = FName(*files[0]); } void USpineAtlasAsset::PostInitProperties() { - if (!HasAnyFlags(RF_ClassDefaultObject)) - importData = NewObject(this, TEXT("AssetImportData")); + if (!HasAnyFlags(RF_ClassDefaultObject)) importData = NewObject(this, TEXT("AssetImportData")); Super::PostInitProperties(); } @@ -69,8 +67,7 @@ void USpineAtlasAsset::Serialize(FArchive &Ar) { FName USpineAtlasAsset::GetAtlasFileName() const { #if WITH_EDITORONLY_DATA TArray files; - if (importData) - importData->ExtractFilenames(files); + if (importData) importData->ExtractFilenames(files); if (files.Num() > 0) return FName(*files[0]); else @@ -115,8 +112,7 @@ Atlas *USpineAtlasAsset::GetAtlas() { } std::string t = TCHAR_TO_UTF8(*rawData); - atlas = new (__FILE__, __LINE__) - Atlas(t.c_str(), strlen(t.c_str()), "", &_spineUETextureLoader); + atlas = new (__FILE__, __LINE__) Atlas(t.c_str(), strlen(t.c_str()), "", &_spineUETextureLoader); } return this->atlas; } diff --git a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineBoneDriverComponent.cpp b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineBoneDriverComponent.cpp index 830786e4f..15d675603 100644 --- a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineBoneDriverComponent.cpp +++ b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineBoneDriverComponent.cpp @@ -56,7 +56,8 @@ void USpineBoneDriverComponent::TickComponent(float DeltaTime, ELevelTick TickTy Super::TickComponent(DeltaTime, TickType, ThisTickFunction); if (Target) { - USpineSkeletonComponent *skeleton = static_cast(Target->GetComponentByClass(USpineSkeletonComponent::StaticClass())); + USpineSkeletonComponent *skeleton = static_cast( + Target->GetComponentByClass(USpineSkeletonComponent::StaticClass())); if (skeleton != lastBoundComponent && skeleton) { // if (lastBoundComponent) lastBoundComponent->BeforeUpdateWorldTransform.RemoveAll(this); if (!skeleton->BeforeUpdateWorldTransform.GetAllObjects().Contains(this)) diff --git a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineBoneFollowerComponent.cpp b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineBoneFollowerComponent.cpp index cbbb8de1b..927c5e142 100644 --- a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineBoneFollowerComponent.cpp +++ b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineBoneFollowerComponent.cpp @@ -45,7 +45,8 @@ void USpineBoneFollowerComponent::TickComponent(float DeltaTime, ELevelTick Tick Super::TickComponent(DeltaTime, TickType, ThisTickFunction); if (Target) { - USpineSkeletonComponent *skeleton = static_cast(Target->GetComponentByClass(USpineSkeletonComponent::StaticClass())); + USpineSkeletonComponent *skeleton = static_cast( + Target->GetComponentByClass(USpineSkeletonComponent::StaticClass())); if (skeleton) { FTransform transform = skeleton->GetBoneWorldTransform(BoneName); if (UseComponentTransform) { diff --git a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpinePlugin.cpp b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpinePlugin.cpp index c7d66ec1c..06641ddc5 100644 --- a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpinePlugin.cpp +++ b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpinePlugin.cpp @@ -42,13 +42,16 @@ IMPLEMENT_MODULE(FSpinePlugin, SpinePlugin) void FSpinePlugin::StartupModule() { } -void FSpinePlugin::ShutdownModule() {} +void FSpinePlugin::ShutdownModule() { +} class Ue4Extension : public spine::DefaultSpineExtension { public: - Ue4Extension() : spine::DefaultSpineExtension() {} + Ue4Extension() : spine::DefaultSpineExtension() { + } - virtual ~Ue4Extension() {} + virtual ~Ue4Extension() { + } virtual void *_alloc(size_t size, const char *file, int line) { return FMemory::Malloc(size); diff --git a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonAnimationComponent.cpp b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonAnimationComponent.cpp index 5d7033c24..968544639 100644 --- a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonAnimationComponent.cpp +++ b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonAnimationComponent.cpp @@ -105,14 +105,16 @@ void USpineSkeletonAnimationComponent::InternalTick(float DeltaTime, bool CallDe if (state && bAutoPlaying) { if (Preview) { if (lastPreviewAnimation != PreviewAnimation) { - if (PreviewAnimation != "") SetAnimation(0, PreviewAnimation, true); + if (PreviewAnimation != "") + SetAnimation(0, PreviewAnimation, true); else SetEmptyAnimation(0, 0); lastPreviewAnimation = PreviewAnimation; } if (lastPreviewSkin != PreviewSkin) { - if (PreviewSkin != "") SetSkin(PreviewSkin); + if (PreviewSkin != "") + SetSkin(PreviewSkin); else SetSkin("default"); lastPreviewSkin = PreviewSkin; diff --git a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonComponent.cpp b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonComponent.cpp index 513702f60..0c125fe75 100644 --- a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonComponent.cpp +++ b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonComponent.cpp @@ -119,8 +119,10 @@ FTransform USpineSkeletonComponent::GetBoneWorldTransform(const FString &BoneNam FTransform baseTransform; AActor *owner = GetOwner(); if (owner) { - USpineSkeletonRendererComponent *rendererComponent = static_cast(owner->GetComponentByClass(USpineSkeletonRendererComponent::StaticClass())); - if (rendererComponent) baseTransform = rendererComponent->GetComponentTransform(); + USpineSkeletonRendererComponent *rendererComponent = static_cast( + owner->GetComponentByClass(USpineSkeletonRendererComponent::StaticClass())); + if (rendererComponent) + baseTransform = rendererComponent->GetComponentTransform(); else baseTransform = owner->GetActorTransform(); } @@ -152,8 +154,10 @@ void USpineSkeletonComponent::SetBoneWorldPosition(const FString &BoneName, cons FTransform baseTransform; AActor *owner = GetOwner(); if (owner) { - USpineSkeletonRendererComponent *rendererComponent = static_cast(owner->GetComponentByClass(USpineSkeletonRendererComponent::StaticClass())); - if (rendererComponent) baseTransform = rendererComponent->GetComponentTransform(); + USpineSkeletonRendererComponent *rendererComponent = static_cast( + owner->GetComponentByClass(USpineSkeletonRendererComponent::StaticClass())); + if (rendererComponent) + baseTransform = rendererComponent->GetComponentTransform(); else baseTransform = owner->GetActorTransform(); } @@ -280,7 +284,8 @@ float USpineSkeletonComponent::GetAnimationDuration(FString AnimationName) { CheckState(); if (skeleton) { Animation *animation = skeleton->getData()->findAnimation(TCHAR_TO_UTF8(*AnimationName)); - if (animation == nullptr) return 0; + if (animation == nullptr) + return 0; else return animation->getDuration(); } diff --git a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonDataAsset.cpp b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonDataAsset.cpp index 002fa0480..503f1d808 100644 --- a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonDataAsset.cpp +++ b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonDataAsset.cpp @@ -42,8 +42,7 @@ using namespace spine; FName USpineSkeletonDataAsset::GetSkeletonDataFileName() const { #if WITH_EDITORONLY_DATA TArray files; - if (importData) - importData->ExtractFilenames(files); + if (importData) importData->ExtractFilenames(files); if (files.Num() > 0) return FName(*files[0]); else @@ -55,18 +54,15 @@ FName USpineSkeletonDataAsset::GetSkeletonDataFileName() const { #if WITH_EDITORONLY_DATA -void USpineSkeletonDataAsset::SetSkeletonDataFileName( - const FName &SkeletonDataFileName) { +void USpineSkeletonDataAsset::SetSkeletonDataFileName(const FName &SkeletonDataFileName) { importData->UpdateFilenameOnly(SkeletonDataFileName.ToString()); TArray files; importData->ExtractFilenames(files); - if (files.Num() > 0) - this->skeletonDataFileName = FName(*files[0]); + if (files.Num() > 0) this->skeletonDataFileName = FName(*files[0]); } void USpineSkeletonDataAsset::PostInitProperties() { - if (!HasAnyFlags(RF_ClassDefaultObject)) - importData = NewObject(this, TEXT("AssetImportData")); + if (!HasAnyFlags(RF_ClassDefaultObject)) importData = NewObject(this, TEXT("AssetImportData")); Super::PostInitProperties(); } @@ -78,12 +74,9 @@ void USpineSkeletonDataAsset::GetAssetRegistryTags(FAssetRegistryTagsContext Con Super::GetAssetRegistryTags(Context); } #else -void USpineSkeletonDataAsset::GetAssetRegistryTags( - TArray &OutTags) const { +void USpineSkeletonDataAsset::GetAssetRegistryTags(TArray &OutTags) const { if (importData) { - OutTags.Add(FAssetRegistryTag(SourceFileTagName(), - importData->GetSourceData().ToJson(), - FAssetRegistryTag::TT_Hidden)); + OutTags.Add(FAssetRegistryTag(SourceFileTagName(), importData->GetSourceData().ToJson(), FAssetRegistryTag::TT_Hidden)); } Super::GetAssetRegistryTags(OutTags); @@ -105,10 +98,8 @@ void USpineSkeletonDataAsset::Serialize(FArchive &Ar) { void USpineSkeletonDataAsset::ClearNativeData() { for (auto &pair : atlasToNativeData) { - if (pair.Value.skeletonData) - delete pair.Value.skeletonData; - if (pair.Value.animationStateData) - delete pair.Value.animationStateData; + if (pair.Value.skeletonData) delete pair.Value.skeletonData; + if (pair.Value.animationStateData) delete pair.Value.animationStateData; } atlasToNativeData.Empty(); } @@ -121,20 +112,15 @@ void USpineSkeletonDataAsset::BeginDestroy() { class SP_API NullAttachmentLoader : public AttachmentLoader { public: - virtual RegionAttachment *newRegionAttachment(Skin &skin, const String &name, - const String &path, - Sequence *sequence) { + virtual RegionAttachment *newRegionAttachment(Skin &skin, const String &name, const String &path, Sequence *sequence) { return new (__FILE__, __LINE__) RegionAttachment(name); } - virtual MeshAttachment *newMeshAttachment(Skin &skin, const String &name, - const String &path, - Sequence *sequence) { + virtual MeshAttachment *newMeshAttachment(Skin &skin, const String &name, const String &path, Sequence *sequence) { return new (__FILE__, __LINE__) MeshAttachment(name); } - virtual BoundingBoxAttachment *newBoundingBoxAttachment(Skin &skin, - const String &name) { + virtual BoundingBoxAttachment *newBoundingBoxAttachment(Skin &skin, const String &name) { return new (__FILE__, __LINE__) BoundingBoxAttachment(name); } @@ -146,12 +132,12 @@ public: return new (__FILE__, __LINE__) PointAttachment(name); } - virtual ClippingAttachment *newClippingAttachment(Skin &skin, - const String &name) { + virtual ClippingAttachment *newClippingAttachment(Skin &skin, const String &name) { return new (__FILE__, __LINE__) ClippingAttachment(name); } - virtual void configureAttachment(Attachment *attachment) {} + virtual void configureAttachment(Attachment *attachment) { + } }; void USpineSkeletonDataAsset::SetRawData(TArray &Data) { @@ -164,8 +150,7 @@ void USpineSkeletonDataAsset::SetRawData(TArray &Data) { } static bool checkVersion(const char *version) { - if (!version) - return false; + if (!version) return false; char *result = (char *) (strstr(version, SPINE_VERSION_STRING) - version); return result == 0; } @@ -173,11 +158,9 @@ static bool checkVersion(const char *version) { static bool checkJson(const char *jsonData) { Json json(jsonData); Json *skeleton = Json::getItem(&json, "skeleton"); - if (!skeleton) - return false; + if (!skeleton) return false; const char *version = Json::getString(skeleton, "spine", 0); - if (!version) - return false; + if (!version) return false; return checkVersion(version); } @@ -187,7 +170,9 @@ struct BinaryInput { const unsigned char *end; }; -static unsigned char readByte(BinaryInput *input) { return *input->cursor++; } +static unsigned char readByte(BinaryInput *input) { + return *input->cursor++; +} static int readVarint(BinaryInput *input, bool optimizePositive) { unsigned char b = readByte(input); @@ -201,8 +186,7 @@ static int readVarint(BinaryInput *input, bool optimizePositive) { if (b & 0x80) { b = readByte(input); value |= (b & 0x7F) << 21; - if (b & 0x80) - value |= (readByte(input) & 0x7F) << 28; + if (b & 0x80) value |= (readByte(input) & 0x7F) << 28; } } } @@ -242,60 +226,47 @@ static bool checkBinary(const char *binaryData, int length) { void USpineSkeletonDataAsset::LoadInfo() { #if WITH_EDITORONLY_DATA int dataLen = rawData.Num(); - if (dataLen == 0) - return; + if (dataLen == 0) return; NullAttachmentLoader loader; SkeletonData *skeletonData = nullptr; if (skeletonDataFileName.GetPlainNameString().Contains(TEXT(".json"))) { SkeletonJson *json = new (__FILE__, __LINE__) SkeletonJson(&loader); - if (checkJson((const char *) rawData.GetData())) - skeletonData = json->readSkeletonData((const char *) rawData.GetData()); + if (checkJson((const char *) rawData.GetData())) skeletonData = json->readSkeletonData((const char *) rawData.GetData()); if (!skeletonData) { - FMessageDialog::Debugf(FText::FromString( - FString("Couldn't load skeleton data and/or atlas. Please ensure the " - "version of your exported data matches your runtime " - "version.\n\n") + - skeletonDataFileName.GetPlainNameString() + FString("\n\n") + - UTF8_TO_TCHAR(json->getError().buffer()))); - UE_LOG(SpineLog, Error, TEXT("Couldn't load skeleton data and atlas: %s"), - UTF8_TO_TCHAR(json->getError().buffer())); + FMessageDialog::Debugf(FText::FromString(FString("Couldn't load skeleton data and/or atlas. Please ensure the " + "version of your exported data matches your runtime " + "version.\n\n") + + skeletonDataFileName.GetPlainNameString() + FString("\n\n") + + UTF8_TO_TCHAR(json->getError().buffer()))); + UE_LOG(SpineLog, Error, TEXT("Couldn't load skeleton data and atlas: %s"), UTF8_TO_TCHAR(json->getError().buffer())); } delete json; } else { SkeletonBinary *binary = new (__FILE__, __LINE__) SkeletonBinary(&loader); if (checkBinary((const char *) rawData.GetData(), (int) rawData.Num())) - skeletonData = binary->readSkeletonData( - (const unsigned char *) rawData.GetData(), (int) rawData.Num()); + skeletonData = binary->readSkeletonData((const unsigned char *) rawData.GetData(), (int) rawData.Num()); if (!skeletonData) { - FMessageDialog::Debugf(FText::FromString( - FString("Couldn't load skeleton data and/or atlas. Please ensure the " - "version of your exported data matches your runtime " - "version.\n\n") + - skeletonDataFileName.GetPlainNameString() + FString("\n\n") + - UTF8_TO_TCHAR(binary->getError().buffer()))); - UE_LOG(SpineLog, Error, TEXT("Couldn't load skeleton data and atlas: %s"), - UTF8_TO_TCHAR(binary->getError().buffer())); + FMessageDialog::Debugf(FText::FromString(FString("Couldn't load skeleton data and/or atlas. Please ensure the " + "version of your exported data matches your runtime " + "version.\n\n") + + skeletonDataFileName.GetPlainNameString() + FString("\n\n") + + UTF8_TO_TCHAR(binary->getError().buffer()))); + UE_LOG(SpineLog, Error, TEXT("Couldn't load skeleton data and atlas: %s"), UTF8_TO_TCHAR(binary->getError().buffer())); } delete binary; } if (skeletonData) { Bones.Empty(); - for (int i = 0; i < skeletonData->getBones().size(); i++) - Bones.Add(UTF8_TO_TCHAR(skeletonData->getBones()[i]->getName().buffer())); + for (int i = 0; i < skeletonData->getBones().size(); i++) Bones.Add(UTF8_TO_TCHAR(skeletonData->getBones()[i]->getName().buffer())); Skins.Empty(); - for (int i = 0; i < skeletonData->getSkins().size(); i++) - Skins.Add(UTF8_TO_TCHAR(skeletonData->getSkins()[i]->getName().buffer())); + for (int i = 0; i < skeletonData->getSkins().size(); i++) Skins.Add(UTF8_TO_TCHAR(skeletonData->getSkins()[i]->getName().buffer())); Slots.Empty(); - for (int i = 0; i < skeletonData->getSlots().size(); i++) - Slots.Add(UTF8_TO_TCHAR(skeletonData->getSlots()[i]->getName().buffer())); + for (int i = 0; i < skeletonData->getSlots().size(); i++) Slots.Add(UTF8_TO_TCHAR(skeletonData->getSlots()[i]->getName().buffer())); Animations.Empty(); for (int i = 0; i < skeletonData->getAnimations().size(); i++) - Animations.Add( - UTF8_TO_TCHAR(skeletonData->getAnimations()[i]->getName().buffer())); + Animations.Add(UTF8_TO_TCHAR(skeletonData->getAnimations()[i]->getName().buffer())); Events.Empty(); - for (int i = 0; i < skeletonData->getEvents().size(); i++) - Events.Add( - UTF8_TO_TCHAR(skeletonData->getEvents()[i]->getName().buffer())); + for (int i = 0; i < skeletonData->getEvents().size(); i++) Events.Add(UTF8_TO_TCHAR(skeletonData->getEvents()[i]->getName().buffer())); delete skeletonData; } #endif @@ -313,46 +284,37 @@ SkeletonData *USpineSkeletonDataAsset::GetSkeletonData(Atlas *Atlas) { int dataLen = rawData.Num(); if (skeletonDataFileName.GetPlainNameString().Contains(TEXT(".json"))) { SkeletonJson *json = new (__FILE__, __LINE__) SkeletonJson(Atlas); - if (checkJson((const char *) rawData.GetData())) - skeletonData = json->readSkeletonData((const char *) rawData.GetData()); + if (checkJson((const char *) rawData.GetData())) skeletonData = json->readSkeletonData((const char *) rawData.GetData()); if (!skeletonData) { #if WITH_EDITORONLY_DATA - FMessageDialog::Debugf(FText::FromString( - FString("Couldn't load skeleton data and/or atlas. Please ensure " - "the version of your exported data matches your runtime " - "version.\n\n") + - skeletonDataFileName.GetPlainNameString() + FString("\n\n") + - UTF8_TO_TCHAR(json->getError().buffer()))); + FMessageDialog::Debugf(FText::FromString(FString("Couldn't load skeleton data and/or atlas. Please ensure " + "the version of your exported data matches your runtime " + "version.\n\n") + + skeletonDataFileName.GetPlainNameString() + FString("\n\n") + + UTF8_TO_TCHAR(json->getError().buffer()))); #endif - UE_LOG(SpineLog, Error, - TEXT("Couldn't load skeleton data and atlas: %s"), - UTF8_TO_TCHAR(json->getError().buffer())); + UE_LOG(SpineLog, Error, TEXT("Couldn't load skeleton data and atlas: %s"), UTF8_TO_TCHAR(json->getError().buffer())); } delete json; } else { SkeletonBinary *binary = new (__FILE__, __LINE__) SkeletonBinary(Atlas); if (checkBinary((const char *) rawData.GetData(), (int) rawData.Num())) - skeletonData = binary->readSkeletonData( - (const unsigned char *) rawData.GetData(), (int) rawData.Num()); + skeletonData = binary->readSkeletonData((const unsigned char *) rawData.GetData(), (int) rawData.Num()); if (!skeletonData) { #if WITH_EDITORONLY_DATA - FMessageDialog::Debugf(FText::FromString( - FString("Couldn't load skeleton data and/or atlas. Please ensure " - "the version of your exported data matches your runtime " - "version.\n\n") + - skeletonDataFileName.GetPlainNameString() + FString("\n\n") + - UTF8_TO_TCHAR(binary->getError().buffer()))); + FMessageDialog::Debugf(FText::FromString(FString("Couldn't load skeleton data and/or atlas. Please ensure " + "the version of your exported data matches your runtime " + "version.\n\n") + + skeletonDataFileName.GetPlainNameString() + FString("\n\n") + + UTF8_TO_TCHAR(binary->getError().buffer()))); #endif - UE_LOG(SpineLog, Error, - TEXT("Couldn't load skeleton data and atlas: %s"), - UTF8_TO_TCHAR(binary->getError().buffer())); + UE_LOG(SpineLog, Error, TEXT("Couldn't load skeleton data and atlas: %s"), UTF8_TO_TCHAR(binary->getError().buffer())); } delete binary; } if (skeletonData) { - animationStateData = - new (__FILE__, __LINE__) AnimationStateData(skeletonData); + animationStateData = new (__FILE__, __LINE__) AnimationStateData(skeletonData); SetMixes(animationStateData); atlasToNativeData.Add(Atlas, {skeletonData, animationStateData}); } @@ -372,17 +334,14 @@ void USpineSkeletonDataAsset::SetMixes(AnimationStateData *animationStateData) { animationStateData->setDefaultMix(DefaultMix); } -AnimationStateData * -USpineSkeletonDataAsset::GetAnimationStateData(Atlas *atlas) { - if (!atlasToNativeData.Contains(atlas)) - return nullptr; +AnimationStateData *USpineSkeletonDataAsset::GetAnimationStateData(Atlas *atlas) { + if (!atlasToNativeData.Contains(atlas)) return nullptr; AnimationStateData *data = atlasToNativeData[atlas].animationStateData; SetMixes(data); return data; } -void USpineSkeletonDataAsset::SetMix(const FString &from, const FString &to, - float mix) { +void USpineSkeletonDataAsset::SetMix(const FString &from, const FString &to, float mix) { FSpineAnimationStateMixData data; data.From = from; data.To = to; @@ -395,8 +354,7 @@ void USpineSkeletonDataAsset::SetMix(const FString &from, const FString &to, float USpineSkeletonDataAsset::GetMix(const FString &from, const FString &to) { for (auto &data : MixData) { - if (data.From.Equals(from) && data.To.Equals(to)) - return data.Mix; + if (data.From.Equals(from) && data.To.Equals(to)) return data.Mix; } return 0; } diff --git a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp index 5f5c18f41..e454223da 100644 --- a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp +++ b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp @@ -130,11 +130,12 @@ void USpineSkeletonRendererComponent::UpdateRenderer(USpineSkeletonComponent *co } } -void USpineSkeletonRendererComponent::UpdateMaterial(UTexture2D *Texture, UMaterialInstanceDynamic *&CurrentInstance, UMaterialInterface *ParentMaterial) { +void USpineSkeletonRendererComponent::UpdateMaterial(UTexture2D *Texture, UMaterialInstanceDynamic *&CurrentInstance, + UMaterialInterface *ParentMaterial) { UTexture *oldTexture = nullptr; - if (!CurrentInstance || !CurrentInstance->GetTextureParameterValue(TextureParameterName, oldTexture) || - oldTexture != Texture || CurrentInstance->Parent != ParentMaterial) { + if (!CurrentInstance || !CurrentInstance->GetTextureParameterValue(TextureParameterName, oldTexture) || oldTexture != Texture || + CurrentInstance->Parent != ParentMaterial) { UMaterialInstanceDynamic *material = UMaterialInstanceDynamic::Create(ParentMaterial, this); material->SetTextureParameterValue(TextureParameterName, Texture); @@ -142,7 +143,8 @@ void USpineSkeletonRendererComponent::UpdateMaterial(UTexture2D *Texture, UMater } } -void USpineSkeletonRendererComponent::Flush(int &Idx, TArray &Vertices, TArray &Indices, TArray &Normals, TArray &Uvs, TArray &Colors, UMaterialInstanceDynamic *Material) { +void USpineSkeletonRendererComponent::Flush(int &Idx, TArray &Vertices, TArray &Indices, TArray &Normals, + TArray &Uvs, TArray &Colors, UMaterialInstanceDynamic *Material) { if (Vertices.Num() == 0) return; SetMaterial(Idx, Material); @@ -206,7 +208,8 @@ void USpineSkeletonRendererComponent::UpdateMesh(USpineSkeletonComponent *compon clipper.clipEnd(*slot); continue; } - if (!attachment->getRTTI().isExactly(RegionAttachment::rtti) && !attachment->getRTTI().isExactly(MeshAttachment::rtti) && !attachment->getRTTI().isExactly(ClippingAttachment::rtti)) { + if (!attachment->getRTTI().isExactly(RegionAttachment::rtti) && !attachment->getRTTI().isExactly(MeshAttachment::rtti) && + !attachment->getRTTI().isExactly(ClippingAttachment::rtti)) { clipper.clipEnd(*slot); continue; } @@ -332,10 +335,9 @@ void USpineSkeletonRendererComponent::UpdateMesh(USpineSkeletonComponent *compon int numTriangles = indices.Num() / 3; for (int j = 0; j < numTriangles; j++) { const int triangleIndex = j * 3; - if (FVector::CrossProduct( - vertices[indices[triangleIndex + 2]] - vertices[indices[triangleIndex]], - vertices[indices[triangleIndex + 1]] - vertices[indices[triangleIndex]]) - .Y < 0.f) { + if (FVector::CrossProduct(vertices[indices[triangleIndex + 2]] - vertices[indices[triangleIndex]], + vertices[indices[triangleIndex + 1]] - vertices[indices[triangleIndex]]) + .Y < 0.f) { const int32 targetVertex = indices[triangleIndex]; indices[triangleIndex] = indices[triangleIndex + 2]; indices[triangleIndex + 2] = targetVertex; diff --git a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineWidget.cpp b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineWidget.cpp index e7d811818..6ee92cf23 100644 --- a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineWidget.cpp +++ b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineWidget.cpp @@ -405,7 +405,8 @@ float USpineWidget::GetAnimationDuration(FString AnimationName) { CheckState(); if (skeleton) { spine::Animation *animation = skeleton->getData()->findAnimation(TCHAR_TO_UTF8(*AnimationName)); - if (animation == nullptr) return 0; + if (animation == nullptr) + return 0; else return animation->getDuration(); } diff --git a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Public/SSpineWidget.h b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Public/SSpineWidget.h index bfa6eae06..d2341c8a4 100644 --- a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Public/SSpineWidget.h +++ b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Public/SSpineWidget.h @@ -39,7 +39,8 @@ class USpineWidget; class SSpineWidget : public SMeshWidget { public: - SLATE_BEGIN_ARGS(SSpineWidget) : _MeshData(nullptr) {} + SLATE_BEGIN_ARGS(SSpineWidget) : _MeshData(nullptr) { + } SLATE_ARGUMENT(USlateVectorArtData *, MeshData) SLATE_END_ARGS() @@ -49,11 +50,14 @@ public: FSlateBrush *brush; protected: - virtual int32 OnPaint(const FPaintArgs &Args, const FGeometry &AllottedGeometry, const FSlateRect &MyCullingRect, FSlateWindowElementList &OutDrawElements, int32 LayerId, const FWidgetStyle &InWidgetStyle, bool bParentEnabled) const override; + virtual int32 OnPaint(const FPaintArgs &Args, const FGeometry &AllottedGeometry, const FSlateRect &MyCullingRect, + FSlateWindowElementList &OutDrawElements, int32 LayerId, const FWidgetStyle &InWidgetStyle, + bool bParentEnabled) const override; void UpdateMesh(int32 LayerId, FSlateWindowElementList &OutDrawElements, const FGeometry &AllottedGeometry, spine::Skeleton *Skeleton); - void Flush(int32 LayerId, FSlateWindowElementList &OutDrawElements, const FGeometry &AllottedGeometry, int &Idx, TArray &Vertices, TArray &Indices, TArray &Uvs, TArray &Colors, TArray &Colors2, UMaterialInstanceDynamic *Material); + void Flush(int32 LayerId, FSlateWindowElementList &OutDrawElements, const FGeometry &AllottedGeometry, int &Idx, TArray &Vertices, + TArray &Indices, TArray &Uvs, TArray &Colors, TArray &Colors2, UMaterialInstanceDynamic *Material); virtual FVector2D ComputeDesiredSize(float) const override; diff --git a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonAnimationComponent.h b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonAnimationComponent.h index 9dede8092..aca4bafcb 100644 --- a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonAnimationComponent.h +++ b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonAnimationComponent.h @@ -41,7 +41,8 @@ struct SPINEPLUGIN_API FSpineEvent { GENERATED_BODY(); public: - FSpineEvent() : IntValue(0), FloatValue(0.0f), Time(0.0f) {} + FSpineEvent() : IntValue(0), FloatValue(0.0f), Time(0.0f) { + } void SetEvent(spine::Event *event) { Name = FString(UTF8_TO_TCHAR(event->getData().getName().buffer())); @@ -81,127 +82,168 @@ class SPINEPLUGIN_API UTrackEntry : public UObject { GENERATED_BODY() public: - UTrackEntry() {} + UTrackEntry() { + } void SetTrackEntry(spine::TrackEntry *trackEntry); - spine::TrackEntry *GetTrackEntry() { return entry; } + spine::TrackEntry *GetTrackEntry() { + return entry; + } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") - int GetTrackIndex() { return entry ? entry->getTrackIndex() : 0; } + int GetTrackIndex() { + return entry ? entry->getTrackIndex() : 0; + } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") - bool GetLoop() { return entry ? entry->getLoop() : false; } + bool GetLoop() { + return entry ? entry->getLoop() : false; + } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") void SetLoop(bool loop) { if (entry) entry->setLoop(loop); } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") - float GetEventThreshold() { return entry ? entry->getEventThreshold() : 0; } + float GetEventThreshold() { + return entry ? entry->getEventThreshold() : 0; + } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") void SetEventThreshold(float eventThreshold) { if (entry) entry->setEventThreshold(eventThreshold); } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") - float GetAlphaAttachmentThreshold() { return entry ? entry->getAlphaAttachmentThreshold() : 0; } + float GetAlphaAttachmentThreshold() { + return entry ? entry->getAlphaAttachmentThreshold() : 0; + } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") void SetAlphaAttachmentThreshold(float attachmentThreshold) { if (entry) entry->setAlphaAttachmentThreshold(attachmentThreshold); } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") - float GetMixDrawOrderThreshold() { return entry ? entry->getMixDrawOrderThreshold() : 0; } + float GetMixDrawOrderThreshold() { + return entry ? entry->getMixDrawOrderThreshold() : 0; + } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") void SetMixDrawOrderThreshold(float drawOrderThreshold) { if (entry) entry->setMixDrawOrderThreshold(drawOrderThreshold); } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") - float GetMixAttachmentThreshold() { return entry ? entry->getMixAttachmentThreshold() : 0; } + float GetMixAttachmentThreshold() { + return entry ? entry->getMixAttachmentThreshold() : 0; + } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") void SetMixAttachmentThreshold(float drawOrderThreshold) { if (entry) entry->setMixAttachmentThreshold(drawOrderThreshold); } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") - float GetAnimationStart() { return entry ? entry->getAnimationStart() : 0; } + float GetAnimationStart() { + return entry ? entry->getAnimationStart() : 0; + } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") void SetAnimationStart(float animationStart) { if (entry) entry->setAnimationStart(animationStart); } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") - float GetAnimationEnd() { return entry ? entry->getAnimationEnd() : 0; } + float GetAnimationEnd() { + return entry ? entry->getAnimationEnd() : 0; + } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") void SetAnimationEnd(float animationEnd) { if (entry) entry->setAnimationEnd(animationEnd); } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") - float GetAnimationLast() { return entry ? entry->getAnimationLast() : 0; } + float GetAnimationLast() { + return entry ? entry->getAnimationLast() : 0; + } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") void SetAnimationLast(float animationLast) { if (entry) entry->setAnimationLast(animationLast); } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") - float GetDelay() { return entry ? entry->getDelay() : 0; } + float GetDelay() { + return entry ? entry->getDelay() : 0; + } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") void SetDelay(float delay) { if (entry) entry->setDelay(delay); } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") - float GetTrackTime() { return entry ? entry->getTrackTime() : 0; } + float GetTrackTime() { + return entry ? entry->getTrackTime() : 0; + } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") void SetTrackTime(float trackTime) { if (entry) entry->setTrackTime(trackTime); } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") - float GetTrackEnd() { return entry ? entry->getTrackEnd() : 0; } + float GetTrackEnd() { + return entry ? entry->getTrackEnd() : 0; + } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") void SetTrackEnd(float trackEnd) { if (entry) entry->setTrackEnd(trackEnd); } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") - float GetTimeScale() { return entry ? entry->getTimeScale() : 0; } + float GetTimeScale() { + return entry ? entry->getTimeScale() : 0; + } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") void SetTimeScale(float timeScale) { if (entry) entry->setTimeScale(timeScale); } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") - float GetAlpha() { return entry ? entry->getAlpha() : 0; } + float GetAlpha() { + return entry ? entry->getAlpha() : 0; + } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") void SetAlpha(float alpha) { if (entry) entry->setAlpha(alpha); } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") - float GetMixTime() { return entry ? entry->getMixTime() : 0; } + float GetMixTime() { + return entry ? entry->getMixTime() : 0; + } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") void SetMixTime(float mixTime) { if (entry) entry->setMixTime(mixTime); } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") - float GetMixDuration() { return entry ? entry->getMixDuration() : 0; } + float GetMixDuration() { + return entry ? entry->getMixDuration() : 0; + } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") void SetMixDuration(float mixDuration) { if (entry) entry->setMixDuration(mixDuration); } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") - FString getAnimationName() { return entry ? entry->getAnimation()->getName().buffer() : ""; } + FString getAnimationName() { + return entry ? entry->getAnimation()->getName().buffer() : ""; + } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") - float getAnimationDuration() { return entry ? entry->getAnimation()->getDuration() : 0; } + float getAnimationDuration() { + return entry ? entry->getAnimation()->getDuration() : 0; + } UFUNCTION(BlueprintCallable, Category = "Components|Spine|TrackEntry") - bool isValidAnimation() { return entry != nullptr; } + bool isValidAnimation() { + return entry != nullptr; + } UPROPERTY(BlueprintAssignable, Category = "Components|Spine|TrackEntry") FSpineAnimationStartDelegate AnimationStart; @@ -233,7 +275,9 @@ class SPINEPLUGIN_API USpineSkeletonAnimationComponent : public USpineSkeletonCo GENERATED_BODY() public: - spine::AnimationState *GetAnimationState() { return state; }; + spine::AnimationState *GetAnimationState() { + return state; + }; USpineSkeletonAnimationComponent(); @@ -313,7 +357,9 @@ public: // used in C event callback. Needs to be public as we can't call // protected methods from plain old C function. - void GCTrackEntry(UTrackEntry *entry) { trackEntries.Remove(entry); } + void GCTrackEntry(UTrackEntry *entry) { + trackEntries.Remove(entry); + } protected: virtual void CheckState() override; diff --git a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonRendererComponent.h b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonRendererComponent.h index 99807f533..227ee5027 100644 --- a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonRendererComponent.h +++ b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonRendererComponent.h @@ -95,7 +95,8 @@ protected: void UpdateMesh(USpineSkeletonComponent *component, spine::Skeleton *Skeleton); - void Flush(int &Idx, TArray &Vertices, TArray &Indices, TArray &Normals, TArray &Uvs, TArray &Colors, UMaterialInstanceDynamic *Material); + void Flush(int &Idx, TArray &Vertices, TArray &Indices, TArray &Normals, TArray &Uvs, TArray &Colors, + UMaterialInstanceDynamic *Material); spine::Vector worldVertices; spine::SkeletonClipping clipper; diff --git a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineWidget.h b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineWidget.h index b6a3ed69a..f392a7e37 100644 --- a/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineWidget.h +++ b/spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineWidget.h @@ -235,7 +235,9 @@ public: // used in C event callback. Needs to be public as we can't call // protected methods from plain old C function. - void GCTrackEntry(UTrackEntry *entry) { trackEntries.Remove(entry); } + void GCTrackEntry(UTrackEntry *entry) { + trackEntries.Remove(entry); + } protected: friend class SSpineWidget; diff --git a/spine-ue/Source/SpineUE/MySceneComponent.cpp b/spine-ue/Source/SpineUE/MySceneComponent.cpp index f37493ceb..a6b5fb9d1 100644 --- a/spine-ue/Source/SpineUE/MySceneComponent.cpp +++ b/spine-ue/Source/SpineUE/MySceneComponent.cpp @@ -5,9 +5,7 @@ #include "spine/spine.h" // Sets default values for this component's properties -UMySceneComponent::UMySceneComponent( - const FObjectInitializer &ObjectInitializer) - : USpineSkeletonRendererComponent(ObjectInitializer) { +UMySceneComponent::UMySceneComponent(const FObjectInitializer &ObjectInitializer) : USpineSkeletonRendererComponent(ObjectInitializer) { // Set this component to be initialized when the game starts, and to be ticked // every frame. You can turn these features off to improve performance if you // don't need them. @@ -22,9 +20,7 @@ void UMySceneComponent::BeginPlay() { } // Called every frame -void UMySceneComponent::TickComponent( - float DeltaTime, ELevelTick TickType, - FActorComponentTickFunction *ThisTickFunction) { +void UMySceneComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) { Super::TickComponent(DeltaTime, TickType, ThisTickFunction); // ... diff --git a/spine-ue/Source/SpineUE/MySceneComponent.h b/spine-ue/Source/SpineUE/MySceneComponent.h index c23104252..8d252b2f2 100644 --- a/spine-ue/Source/SpineUE/MySceneComponent.h +++ b/spine-ue/Source/SpineUE/MySceneComponent.h @@ -21,7 +21,5 @@ protected: public: // Called every frame - virtual void - TickComponent(float DeltaTime, ELevelTick TickType, - FActorComponentTickFunction *ThisTickFunction) override; + virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override; }; diff --git a/spine-ue/Source/SpineUE/SpineboyCppPawn.cpp b/spine-ue/Source/SpineUE/SpineboyCppPawn.cpp index 945290b45..7b1b08be4 100644 --- a/spine-ue/Source/SpineUE/SpineboyCppPawn.cpp +++ b/spine-ue/Source/SpineUE/SpineboyCppPawn.cpp @@ -14,27 +14,22 @@ ASpineboyCppPawn::ASpineboyCppPawn() { // Called when the game starts or when spawned void ASpineboyCppPawn::BeginPlay() { Super::BeginPlay(); - USpineSkeletonAnimationComponent *animationComponent = - FindComponentByClass(); + USpineSkeletonAnimationComponent *animationComponent = FindComponentByClass(); animationComponent->SetAnimation(0, FString("walk"), true); } // Called every frame void ASpineboyCppPawn::Tick(float DeltaTime) { Super::Tick(DeltaTime); - USpineSkeletonAnimationComponent *animationComponent = - FindComponentByClass(); + USpineSkeletonAnimationComponent *animationComponent = FindComponentByClass(); spine::AnimationState *state = animationComponent->GetAnimationState(); spine::TrackEntry *entry = state->getCurrent(0); if (entry) { - GEngine->AddOnScreenDebugMessage( - -1, 0.5f, FColor::Yellow, - FString(entry->getAnimation()->getName().buffer())); + GEngine->AddOnScreenDebugMessage(-1, 0.5f, FColor::Yellow, FString(entry->getAnimation()->getName().buffer())); } } // Called to bind functionality to input -void ASpineboyCppPawn::SetupPlayerInputComponent( - UInputComponent *PlayerInputComponent) { +void ASpineboyCppPawn::SetupPlayerInputComponent(UInputComponent *PlayerInputComponent) { Super::SetupPlayerInputComponent(PlayerInputComponent); } diff --git a/spine-ue/Source/SpineUE/SpineboyCppPawn.h b/spine-ue/Source/SpineUE/SpineboyCppPawn.h index ece541bd7..765f939b2 100644 --- a/spine-ue/Source/SpineUE/SpineboyCppPawn.h +++ b/spine-ue/Source/SpineUE/SpineboyCppPawn.h @@ -23,6 +23,5 @@ public: virtual void Tick(float DeltaTime) override; // Called to bind functionality to input - virtual void SetupPlayerInputComponent( - class UInputComponent *PlayerInputComponent) override; + virtual void SetupPlayerInputComponent(class UInputComponent *PlayerInputComponent) override; };