File tree 2 files changed +14
-3
lines changed 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -109,15 +109,21 @@ impl<'self> ConvexShape<'self> {
109
109
/**
110
110
* Create a new convex shape
111
111
*
112
+ * # Arguments
113
+ * * points_count - The number of point for the convex shape
114
+ *
112
115
* Return a new convexShape object
113
116
*/
114
117
#[ fixed_stack_segment] #[ inline( never) ]
115
- pub fn new ( ) -> Option < ConvexShape < ' self > > {
118
+ pub fn new ( points_count : uint ) -> Option < ConvexShape < ' self > > {
116
119
let shape = unsafe { ffi:: sfConvexShape_create ( ) } ;
117
120
if ptr:: is_null ( shape) {
118
121
None
119
122
}
120
123
else {
124
+ unsafe {
125
+ ffi:: sfConvexShape_setPointCount ( shape, points_count as c_uint ) ;
126
+ }
121
127
Some ( ConvexShape {
122
128
convex_shape : shape,
123
129
texture : None
@@ -128,17 +134,22 @@ impl<'self> ConvexShape<'self> {
128
134
/**
129
135
* Create a new convex shape with a texture
130
136
*
137
+ * # Arguments
138
+ * * texture - The texture to apply to the convex shape
139
+ * * points_count - The number of point for the convex shape
140
+ *
131
141
* Return a new convexShape object
132
142
*/
133
143
#[ fixed_stack_segment] #[ inline( never) ]
134
- pub fn new_with_texture ( texture : & ' self Texture ) -> Option < ConvexShape < ' self > > {
144
+ pub fn new_with_texture ( texture : & ' self Texture , points_count : uint ) -> Option < ConvexShape < ' self > > {
135
145
let shape = unsafe { ffi:: sfConvexShape_create ( ) } ;
136
146
if ptr:: is_null ( shape) {
137
147
None
138
148
}
139
149
else {
140
150
unsafe {
141
151
ffi:: sfConvexShape_setTexture ( shape, texture. unwrap ( ) , SFTRUE ) ;
152
+ ffi:: sfConvexShape_setPointCount ( shape, points_count as c_uint )
142
153
}
143
154
Some ( ConvexShape {
144
155
convex_shape : shape,
Original file line number Diff line number Diff line change 32
32
uuid = "4F3334F2-A32B-4460-A63A-9B56C98D1D78" ,
33
33
url = "http://https://github.com/JeremyLetang/rust-sfml" ) ] ;
34
34
35
- #[ comment = "Rust binding for sfml" ] ;
35
+ #[ desc = "Rust binding for sfml" ] ;
36
36
#[ license = "Zlib/png" ] ;
37
37
#[ crate_type = "lib" ] ;
38
38
You can’t perform that action at this time.
0 commit comments