diff --git a/src/atlas.rs b/src/atlas.rs index b4c9d6a..b179b84 100644 --- a/src/atlas.rs +++ b/src/atlas.rs @@ -172,6 +172,7 @@ pub mod atlas { c_ptr!(c_atlas_page, spAtlasPage); } + /// Functions available if using the `mint` feature. #[cfg(feature = "mint")] impl AtlasPage { pub fn size(&self) -> Vector2 { @@ -367,6 +368,7 @@ pub mod atlas { } } + /// Functions available if using the `mint` feature. #[cfg(feature = "mint")] impl AtlasRegion { pub fn position(&self) -> Vector2 { diff --git a/src/bone.rs b/src/bone.rs index a950597..5a59de9 100644 --- a/src/bone.rs +++ b/src/bone.rs @@ -83,28 +83,6 @@ impl Bone { } } - #[cfg(feature = "mint")] - pub fn update_world_transform_with2( - &mut self, - position: mint::Vector2, - rotation: f32, - scale: mint::Vector2, - shear: mint::Vector2, - ) { - unsafe { - spBone_updateWorldTransformWith( - self.c_ptr(), - position.x, - position.y, - rotation, - scale.x, - scale.y, - shear.x, - shear.y, - ); - } - } - pub fn update_applied_transform(&mut self) { unsafe { spBone_updateAppliedTransform(self.c_ptr()); @@ -243,6 +221,7 @@ impl Bone { c_ptr!(c_bone, spBone); } +/// Functions available if using the `mint` feature. #[cfg(feature = "mint")] impl Bone { pub fn position(&self) -> Vector2 { @@ -349,6 +328,27 @@ impl Bone { y: self.world_rotation_y(), } } + + pub fn update_world_transform_with2( + &mut self, + position: mint::Vector2, + rotation: f32, + scale: mint::Vector2, + shear: mint::Vector2, + ) { + unsafe { + spBone_updateWorldTransformWith( + self.c_ptr(), + position.x, + position.y, + rotation, + scale.x, + scale.y, + shear.x, + shear.y, + ); + } + } } c_handle_decl!( @@ -411,6 +411,7 @@ impl BoneData { c_accessor_tmp_ptr_optional!(parent, parent_mut, parent, BoneData, spBoneData); } +/// Functions available if using the `mint` feature. #[cfg(feature = "mint")] impl BoneData { pub fn position(&self) -> Vector2 { diff --git a/src/bounding_box_attachment.rs b/src/bounding_box_attachment.rs index 076a373..5001117 100644 --- a/src/bounding_box_attachment.rs +++ b/src/bounding_box_attachment.rs @@ -35,3 +35,9 @@ impl BoundingBoxAttachment { c_accessor_color!(color, color); c_ptr!(c_bounding_box_attachment, spBoundingBoxAttachment); } + +/// Functions available if using the `mint` feature. +#[cfg(feature = "mint")] +impl BoundingBoxAttachment { + c_vertex_attachment_accessors_mint!(); +} diff --git a/src/c_interface.rs b/src/c_interface.rs index 66d4d43..658c747 100644 --- a/src/c_interface.rs +++ b/src/c_interface.rs @@ -765,8 +765,13 @@ macro_rules! c_vertex_attachment_accessors { verticesCount ); + // TODO: accessor for timelineAttachment + }; +} + +macro_rules! c_vertex_attachment_accessors_mint { + () => { /// Gets the vertices of the attachment as a Vector2 slice. - #[cfg(feature = "mint")] pub fn vertices2(&self) -> &[mint::Vector2] { unsafe { std::slice::from_raw_parts( @@ -777,8 +782,6 @@ macro_rules! c_vertex_attachment_accessors { .unwrap() } } - - // TODO: accessor for timelineAttachment }; } diff --git a/src/mesh_attachment.rs b/src/mesh_attachment.rs index d3074d8..e2465ea 100644 --- a/src/mesh_attachment.rs +++ b/src/mesh_attachment.rs @@ -70,6 +70,7 @@ impl MeshAttachment { // TODO: sequence accessor } +/// Functions available if using the `mint` feature. #[cfg(feature = "mint")] impl MeshAttachment { pub fn size(&self) -> Vector2 { @@ -78,4 +79,6 @@ impl MeshAttachment { y: self.height(), } } + + c_vertex_attachment_accessors_mint!(); } diff --git a/src/path_attachment.rs b/src/path_attachment.rs index a1f229f..ed57a5b 100644 --- a/src/path_attachment.rs +++ b/src/path_attachment.rs @@ -36,3 +36,9 @@ impl PathAttachment { c_accessor_passthrough!(lengths, lengths, *mut c_float); c_ptr!(c_path_attachment, spPathAttachment); } + +/// Functions available if using the `mint` feature. +#[cfg(feature = "mint")] +impl PathAttachment { + c_vertex_attachment_accessors_mint!(); +} diff --git a/src/point_attachment.rs b/src/point_attachment.rs index b02c7a6..4c29d92 100644 --- a/src/point_attachment.rs +++ b/src/point_attachment.rs @@ -52,6 +52,7 @@ impl PointAttachment { c_ptr!(c_point_attachment, spPointAttachment); } +/// Functions available if using the `mint` feature. #[cfg(feature = "mint")] impl PointAttachment { pub fn position(&self) -> Vector2 { diff --git a/src/region_attachment.rs b/src/region_attachment.rs index 85bb214..17b9694 100644 --- a/src/region_attachment.rs +++ b/src/region_attachment.rs @@ -69,6 +69,7 @@ impl RegionAttachment { // TODO: sequence accessor } +/// Functions available if using the `mint` feature. #[cfg(feature = "mint")] impl RegionAttachment { pub fn position(&self) -> Vector2 { diff --git a/src/skeleton.rs b/src/skeleton.rs index bd15256..9411e40 100644 --- a/src/skeleton.rs +++ b/src/skeleton.rs @@ -230,6 +230,7 @@ impl Skeleton { c_ptr!(c_skeleton, spSkeleton); } +/// Functions available if using the `mint` feature. #[cfg(feature = "mint")] impl Skeleton { pub fn position(&self) -> Vector2 { diff --git a/src/skeleton_data.rs b/src/skeleton_data.rs index c3ad7d8..f260cb8 100644 --- a/src/skeleton_data.rs +++ b/src/skeleton_data.rs @@ -111,6 +111,7 @@ impl SkeletonData { // TODO: accessors and methods for the arrays in spSkeletonData } +/// Functions available if using the `mint` feature. #[cfg(feature = "mint")] impl SkeletonData { pub fn position(&self) -> Vector2 { diff --git a/src/texture_region.rs b/src/texture_region.rs index 1df2999..e69eeb3 100644 --- a/src/texture_region.rs +++ b/src/texture_region.rs @@ -35,6 +35,7 @@ impl TextureRegion { c_ptr!(c_texture_region, spTextureRegion); } +/// Functions available if using the `mint` feature. #[cfg(feature = "mint")] impl TextureRegion { pub fn uvs(&self) -> (Vector2, Vector2) {