@@ -9,7 +9,7 @@ use sdl2::keyboard::Keycode;
9
9
#[ cfg( feature = "unsafe_textures" ) ]
10
10
use sdl2:: mouse:: MouseButton ;
11
11
#[ cfg( feature = "unsafe_textures" ) ]
12
- use sdl2:: pixels:: Color ;
12
+ use sdl2:: pixels:: RColor ;
13
13
#[ cfg( feature = "unsafe_textures" ) ]
14
14
use sdl2:: rect:: { Point , Rect } ;
15
15
#[ cfg( feature = "unsafe_textures" ) ]
@@ -140,20 +140,20 @@ fn dummy_texture<'a>(canvas: &mut Canvas<Window>) -> Result<(Texture, Texture),
140
140
] ;
141
141
canvas
142
142
. with_multiple_texture_canvas ( textures. iter ( ) , |texture_canvas, user_context| {
143
- texture_canvas. set_draw_color ( Color :: RGB ( 0 , 0 , 0 ) ) ;
143
+ texture_canvas. set_draw_color ( RColor :: RGB ( 0 , 0 , 0 ) ) ;
144
144
texture_canvas. clear ( ) ;
145
145
match * user_context {
146
146
TextureColor :: Yellow => {
147
147
for i in 0 ..SQUARE_SIZE {
148
148
for j in 0 ..SQUARE_SIZE {
149
149
if ( i + j) % 4 == 0 {
150
- texture_canvas. set_draw_color ( Color :: RGB ( 255 , 255 , 0 ) ) ;
150
+ texture_canvas. set_draw_color ( RColor :: RGB ( 255 , 255 , 0 ) ) ;
151
151
texture_canvas
152
152
. draw_point ( Point :: new ( i as i32 , j as i32 ) )
153
153
. expect ( "could not draw point" ) ;
154
154
}
155
155
if ( i + j * 2 ) % 9 == 0 {
156
- texture_canvas. set_draw_color ( Color :: RGB ( 200 , 200 , 0 ) ) ;
156
+ texture_canvas. set_draw_color ( RColor :: RGB ( 200 , 200 , 0 ) ) ;
157
157
texture_canvas
158
158
. draw_point ( Point :: new ( i as i32 , j as i32 ) )
159
159
. expect ( "could not draw point" ) ;
@@ -169,13 +169,13 @@ fn dummy_texture<'a>(canvas: &mut Canvas<Window>) -> Result<(Texture, Texture),
169
169
if ( i + j) % 7 == 0 {
170
170
// this doesn't mean anything, there was some trial and error to find
171
171
// something that wasn't too ugly
172
- texture_canvas. set_draw_color ( Color :: RGB ( 192 , 192 , 192 ) ) ;
172
+ texture_canvas. set_draw_color ( RColor :: RGB ( 192 , 192 , 192 ) ) ;
173
173
texture_canvas
174
174
. draw_point ( Point :: new ( i as i32 , j as i32 ) )
175
175
. expect ( "could not draw point" ) ;
176
176
}
177
177
if ( i + j * 2 ) % 5 == 0 {
178
- texture_canvas. set_draw_color ( Color :: RGB ( 64 , 64 , 64 ) ) ;
178
+ texture_canvas. set_draw_color ( RColor :: RGB ( 64 , 64 , 64 ) ) ;
179
179
texture_canvas
180
180
. draw_point ( Point :: new ( i as i32 , j as i32 ) )
181
181
. expect ( "could not draw point" ) ;
@@ -191,13 +191,13 @@ fn dummy_texture<'a>(canvas: &mut Canvas<Window>) -> Result<(Texture, Texture),
191
191
if ( i + j) % 7 == 0 {
192
192
// this doesn't mean anything, there was some trial and serror to find
193
193
// something that wasn't too ugly
194
- texture_canvas. set_draw_color ( Color :: RGB ( 192 , 192 , 192 ) ) ;
194
+ texture_canvas. set_draw_color ( RColor :: RGB ( 192 , 192 , 192 ) ) ;
195
195
texture_canvas
196
196
. draw_point ( Point :: new ( i as i32 , j as i32 ) )
197
197
. expect ( "could not draw point" ) ;
198
198
}
199
199
if ( i + j * 2 ) % 5 == 0 {
200
- texture_canvas. set_draw_color ( Color :: RGB ( 64 , 64 , 64 ) ) ;
200
+ texture_canvas. set_draw_color ( RColor :: RGB ( 64 , 64 , 64 ) ) ;
201
201
texture_canvas
202
202
. draw_point ( Point :: new ( i as i32 , j as i32 ) )
203
203
. expect ( "could not draw point" ) ;
@@ -239,7 +239,7 @@ pub fn main() -> Result<(), String> {
239
239
. map_err ( |e| e. to_string ( ) ) ?;
240
240
241
241
println ! ( "Using SDL_Renderer \" {}\" " , canvas. info( ) . name) ;
242
- canvas. set_draw_color ( Color :: RGB ( 0 , 0 , 0 ) ) ;
242
+ canvas. set_draw_color ( RColor :: RGB ( 0 , 0 , 0 ) ) ;
243
243
// clears the canvas with the color we set in `set_draw_color`.
244
244
canvas. clear ( ) ;
245
245
// However the canvas has not been updated to the window yet, everything has been processed to
@@ -294,7 +294,7 @@ pub fn main() -> Result<(), String> {
294
294
frame = 0 ;
295
295
}
296
296
297
- canvas. set_draw_color ( Color :: RGB ( 0 , 0 , 0 ) ) ;
297
+ canvas. set_draw_color ( RColor :: RGB ( 0 , 0 , 0 ) ) ;
298
298
canvas. clear ( ) ;
299
299
for ( i, unit) in ( & game) . into_iter ( ) . enumerate ( ) {
300
300
let i = i as u32 ;
0 commit comments