diff options
author | Antoine Cellerier <dionoea@videolan.org> | 2006-09-02 22:45:27 +0000 |
---|---|---|
committer | Antoine Cellerier <dionoea@videolan.org> | 2006-09-02 22:45:27 +0000 |
commit | cf605c34349f5519135dc9206df2c049745b16c4 (patch) | |
tree | e26cc38be60c99f4af1feb5398eb7620f66aaaf0 /apps/plugins/solitaire.c | |
parent | 55a3018cdd246168cf6b8286032383e7831226ad (diff) | |
download | rockbox-cf605c34349f5519135dc9206df2c049745b16c4.tar.gz rockbox-cf605c34349f5519135dc9206df2c049745b16c4.zip |
Fix solitaire card colors
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10861 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/solitaire.c')
-rw-r--r-- | apps/plugins/solitaire.c | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c index 0f0f56e14a..8d6890db83 100644 --- a/apps/plugins/solitaire.c +++ b/apps/plugins/solitaire.c | |||
@@ -265,15 +265,15 @@ static struct plugin_api* rb; | |||
265 | 265 | ||
266 | 266 | ||
267 | #define draw_number( num, x, y ) \ | 267 | #define draw_number( num, x, y ) \ |
268 | rb->lcd_bitmap_part( numbers, 0, num * NUMBER_HEIGHT, NUMBER_STRIDE, \ | 268 | rb->lcd_mono_bitmap_part( numbers, 0, num * NUMBER_HEIGHT, NUMBER_STRIDE, \ |
269 | x, y, NUMBER_WIDTH, NUMBER_HEIGHT ); | 269 | x, y, NUMBER_WIDTH, NUMBER_HEIGHT ); |
270 | extern const fb_data solitaire_numbers[]; | 270 | extern const unsigned char solitaire_numbers[]; |
271 | #define numbers solitaire_numbers | 271 | #define numbers solitaire_numbers |
272 | 272 | ||
273 | #define draw_suit( num, x, y ) \ | 273 | #define draw_suit( num, x, y ) \ |
274 | rb->lcd_bitmap_part( suits, 0, num * SUIT_HEIGHT, SUIT_STRIDE, \ | 274 | rb->lcd_mono_bitmap_part( suits, 0, num * SUIT_HEIGHT, SUIT_STRIDE, \ |
275 | x, y, SUIT_WIDTH, SUIT_HEIGHT ); | 275 | x, y, SUIT_WIDTH, SUIT_HEIGHT ); |
276 | extern const fb_data solitaire_suits[]; | 276 | extern const unsigned char solitaire_suits[]; |
277 | #define suits solitaire_suits | 277 | #define suits solitaire_suits |
278 | 278 | ||
279 | #if ( CARD_HEIGHT < SUITI_HEIGHT + 1 ) || ( CARD_WIDTH < SUITI_WIDTH + 1 ) | 279 | #if ( CARD_HEIGHT < SUITI_HEIGHT + 1 ) || ( CARD_WIDTH < SUITI_WIDTH + 1 ) |
@@ -284,9 +284,9 @@ extern const fb_data solitaire_suits[]; | |||
284 | # define draw_suiti( num, x, y ) draw_suit( num, x, y ) | 284 | # define draw_suiti( num, x, y ) draw_suit( num, x, y ) |
285 | #else | 285 | #else |
286 | # define draw_suiti( num, x, y ) \ | 286 | # define draw_suiti( num, x, y ) \ |
287 | rb->lcd_bitmap_part( suitsi, 0, num * SUITI_HEIGHT, SUITI_STRIDE, \ | 287 | rb->lcd_mono_bitmap_part( suitsi, 0, num * SUITI_HEIGHT, SUITI_STRIDE, \ |
288 | x, y, SUITI_WIDTH, SUITI_HEIGHT ); | 288 | x, y, SUITI_WIDTH, SUITI_HEIGHT ); |
289 | extern const fb_data solitaire_suitsi[]; | 289 | extern const unsigned char solitaire_suitsi[]; |
290 | # define suitsi solitaire_suitsi | 290 | # define suitsi solitaire_suitsi |
291 | #endif | 291 | #endif |
292 | 292 | ||
@@ -302,6 +302,16 @@ extern const fb_data solitaire_suits[]; | |||
302 | extern const fb_data solitaire_cardback[]; | 302 | extern const fb_data solitaire_cardback[]; |
303 | #endif | 303 | #endif |
304 | 304 | ||
305 | #if HAVE_LCD_COLOR | ||
306 | static const unsigned colors[4] = { | ||
307 | LCD_BLACK, LCD_RGBPACK(255, 0, 0), LCD_BLACK, LCD_RGBPACK(255, 0, 0) | ||
308 | }; | ||
309 | #elif LCD_DEPTH > 1 | ||
310 | static const unsigned colors[4] = { | ||
311 | LCD_BLACK, LCD_BRIGHTNESS(127), LCD_BLACK, LCD_BRIGHTNESS(127) | ||
312 | }; | ||
313 | #endif | ||
314 | |||
305 | #define CONFIG_FILENAME "sol.cfg" | 315 | #define CONFIG_FILENAME "sol.cfg" |
306 | 316 | ||
307 | #define NOT_A_CARD 255 | 317 | #define NOT_A_CARD 255 |
@@ -403,6 +413,10 @@ static void draw_card( card_t card, int x, int y, | |||
403 | rb->lcd_set_foreground( LCD_WHITE ); | 413 | rb->lcd_set_foreground( LCD_WHITE ); |
404 | rb->lcd_fillrect( x+1, y+1, CARD_WIDTH-1, CARD_HEIGHT-1 ); | 414 | rb->lcd_fillrect( x+1, y+1, CARD_WIDTH-1, CARD_HEIGHT-1 ); |
405 | #endif | 415 | #endif |
416 | |||
417 | #if LCD_DEPTH > 1 | ||
418 | rb->lcd_set_foreground( colors[card.suit] ); | ||
419 | #endif | ||
406 | if( leftstyle ) | 420 | if( leftstyle ) |
407 | { | 421 | { |
408 | #if UPPER_ROW_MARGIN > 0 | 422 | #if UPPER_ROW_MARGIN > 0 |
@@ -442,6 +456,11 @@ static void draw_empty_stack( int s, int x, int y, bool cursor ) | |||
442 | #if LCD_DEPTH == 1 | 456 | #if LCD_DEPTH == 1 |
443 | rb->lcd_set_drawmode( DRMODE_SOLID ); | 457 | rb->lcd_set_drawmode( DRMODE_SOLID ); |
444 | #endif | 458 | #endif |
459 | |||
460 | #if LCD_DEPTH > 1 | ||
461 | rb->lcd_set_foreground( colors[s] ); | ||
462 | #endif | ||
463 | |||
445 | draw_suiti( s, x+(CARD_WIDTH-SUITI_WIDTH)/2, | 464 | draw_suiti( s, x+(CARD_WIDTH-SUITI_WIDTH)/2, |
446 | y+(CARD_HEIGHT-SUITI_HEIGHT)/2 ); | 465 | y+(CARD_HEIGHT-SUITI_HEIGHT)/2 ); |
447 | 466 | ||