@@ -105,7 +105,7 @@ impl RcSprite {
105
105
/// * color - New color of the sprite
106
106
pub fn set_color ( & mut self , color : Color ) {
107
107
if !self . texture_exists ( ) {
108
- eprintln ! ( "{}" , ERROR_MSG ) ;
108
+ eprintln ! ( "{ERROR_MSG}" ) ;
109
109
return ;
110
110
}
111
111
unsafe { ffi:: sfSprite_setColor ( self . sprite . as_ptr ( ) , color) }
@@ -133,7 +133,7 @@ impl RcSprite {
133
133
#[ must_use]
134
134
pub fn color ( & self ) -> Color {
135
135
if !self . texture_exists ( ) {
136
- eprintln ! ( "{}" , RETURN_ERROR_MSG ) ;
136
+ eprintln ! ( "{RETURN_ERROR_MSG}" ) ;
137
137
return Default :: default ( ) ;
138
138
}
139
139
unsafe { ffi:: sfSprite_getColor ( self . sprite . as_ptr ( ) ) }
@@ -151,7 +151,7 @@ impl RcSprite {
151
151
#[ must_use]
152
152
pub fn local_bounds ( & self ) -> FloatRect {
153
153
if !self . texture_exists ( ) {
154
- eprintln ! ( "{}" , RETURN_ERROR_MSG ) ;
154
+ eprintln ! ( "{RETURN_ERROR_MSG}" ) ;
155
155
return Default :: default ( ) ;
156
156
}
157
157
unsafe { ffi:: sfSprite_getLocalBounds ( self . sprite . as_ptr ( ) ) }
@@ -169,7 +169,7 @@ impl RcSprite {
169
169
#[ must_use]
170
170
pub fn global_bounds ( & self ) -> FloatRect {
171
171
if !self . texture_exists ( ) {
172
- eprintln ! ( "{}" , RETURN_ERROR_MSG ) ;
172
+ eprintln ! ( "{RETURN_ERROR_MSG}" ) ;
173
173
return Default :: default ( ) ;
174
174
}
175
175
unsafe { ffi:: sfSprite_getGlobalBounds ( self . sprite . as_ptr ( ) ) }
@@ -181,7 +181,7 @@ impl RcSprite {
181
181
#[ must_use]
182
182
pub fn texture_rect ( & self ) -> IntRect {
183
183
if !self . texture_exists ( ) {
184
- eprintln ! ( "{}" , RETURN_ERROR_MSG ) ;
184
+ eprintln ! ( "{RETURN_ERROR_MSG}" ) ;
185
185
return Default :: default ( ) ;
186
186
}
187
187
unsafe { ffi:: sfSprite_getTextureRect ( self . sprite . as_ptr ( ) ) }
@@ -197,7 +197,7 @@ impl RcSprite {
197
197
/// * rectangle - Rectangle defining the region of the texture to display
198
198
pub fn set_texture_rect ( & mut self , rect : IntRect ) {
199
199
if !self . texture_exists ( ) {
200
- eprintln ! ( "{}" , ERROR_MSG ) ;
200
+ eprintln ! ( "{ERROR_MSG}" ) ;
201
201
return ;
202
202
}
203
203
unsafe { ffi:: sfSprite_setTextureRect ( self . sprite . as_ptr ( ) , rect) }
@@ -240,77 +240,77 @@ impl Drawable for RcSprite {
240
240
impl Transformable for RcSprite {
241
241
fn set_position < P : Into < Vector2f > > ( & mut self , position : P ) {
242
242
if !self . texture_exists ( ) {
243
- eprintln ! ( "{}" , ERROR_MSG ) ;
243
+ eprintln ! ( "{ERROR_MSG}" ) ;
244
244
return ;
245
245
}
246
246
unsafe { ffi:: sfSprite_setPosition ( self . sprite . as_ptr ( ) , position. into ( ) ) }
247
247
}
248
248
fn set_rotation ( & mut self , angle : f32 ) {
249
249
if !self . texture_exists ( ) {
250
- eprintln ! ( "{}" , ERROR_MSG ) ;
250
+ eprintln ! ( "{ERROR_MSG}" ) ;
251
251
return ;
252
252
}
253
253
unsafe { ffi:: sfSprite_setRotation ( self . sprite . as_ptr ( ) , angle) }
254
254
}
255
255
fn set_scale < S : Into < Vector2f > > ( & mut self , scale : S ) {
256
256
if !self . texture_exists ( ) {
257
- eprintln ! ( "{}" , ERROR_MSG ) ;
257
+ eprintln ! ( "{ERROR_MSG}" ) ;
258
258
return ;
259
259
}
260
260
unsafe { ffi:: sfSprite_setScale ( self . sprite . as_ptr ( ) , scale. into ( ) ) }
261
261
}
262
262
fn set_origin < O : Into < Vector2f > > ( & mut self , origin : O ) {
263
263
if !self . texture_exists ( ) {
264
- eprintln ! ( "{}" , ERROR_MSG ) ;
264
+ eprintln ! ( "{ERROR_MSG}" ) ;
265
265
return ;
266
266
}
267
267
unsafe { ffi:: sfSprite_setOrigin ( self . sprite . as_ptr ( ) , origin. into ( ) ) }
268
268
}
269
269
fn position ( & self ) -> Vector2f {
270
270
if !self . texture_exists ( ) {
271
- eprintln ! ( "{}" , RETURN_ERROR_MSG ) ;
271
+ eprintln ! ( "{RETURN_ERROR_MSG}" ) ;
272
272
return Default :: default ( ) ;
273
273
}
274
274
unsafe { ffi:: sfSprite_getPosition ( self . sprite . as_ptr ( ) ) }
275
275
}
276
276
fn rotation ( & self ) -> f32 {
277
277
if !self . texture_exists ( ) {
278
- eprintln ! ( "{}" , RETURN_ERROR_MSG ) ;
278
+ eprintln ! ( "{RETURN_ERROR_MSG}" ) ;
279
279
return Default :: default ( ) ;
280
280
}
281
281
unsafe { ffi:: sfSprite_getRotation ( self . sprite . as_ptr ( ) ) }
282
282
}
283
283
fn get_scale ( & self ) -> Vector2f {
284
284
if !self . texture_exists ( ) {
285
- eprintln ! ( "{}" , RETURN_ERROR_MSG ) ;
285
+ eprintln ! ( "{RETURN_ERROR_MSG}" ) ;
286
286
return Default :: default ( ) ;
287
287
}
288
288
unsafe { ffi:: sfSprite_getScale ( self . sprite . as_ptr ( ) ) }
289
289
}
290
290
fn origin ( & self ) -> Vector2f {
291
291
if !self . texture_exists ( ) {
292
- eprintln ! ( "{}" , RETURN_ERROR_MSG ) ;
292
+ eprintln ! ( "{RETURN_ERROR_MSG}" ) ;
293
293
return Default :: default ( ) ;
294
294
}
295
295
unsafe { ffi:: sfSprite_getOrigin ( self . sprite . as_ptr ( ) ) }
296
296
}
297
297
fn move_ < O : Into < Vector2f > > ( & mut self , offset : O ) {
298
298
if !self . texture_exists ( ) {
299
- eprintln ! ( "{}" , ERROR_MSG ) ;
299
+ eprintln ! ( "{ERROR_MSG}" ) ;
300
300
return ;
301
301
}
302
302
unsafe { ffi:: sfSprite_move ( self . sprite . as_ptr ( ) , offset. into ( ) ) }
303
303
}
304
304
fn rotate ( & mut self , angle : f32 ) {
305
305
if !self . texture_exists ( ) {
306
- eprintln ! ( "{}" , ERROR_MSG ) ;
306
+ eprintln ! ( "{ERROR_MSG}" ) ;
307
307
return ;
308
308
}
309
309
unsafe { ffi:: sfSprite_rotate ( self . sprite . as_ptr ( ) , angle) }
310
310
}
311
311
fn scale < F : Into < Vector2f > > ( & mut self , factors : F ) {
312
312
if !self . texture_exists ( ) {
313
- eprintln ! ( "{}" , ERROR_MSG ) ;
313
+ eprintln ! ( "{ERROR_MSG}" ) ;
314
314
return ;
315
315
}
316
316
unsafe { ffi:: sfSprite_scale ( self . sprite . as_ptr ( ) , factors. into ( ) ) }
0 commit comments