From cf605c34349f5519135dc9206df2c049745b16c4 Mon Sep 17 00:00:00 2001 From: Antoine Cellerier Date: Sat, 2 Sep 2006 22:45:27 +0000 Subject: [PATCH] Fix solitaire card colors git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10861 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/bitmaps/mono/SOURCES | 18 +++++++++ .../solitaire_numbers.6x6x1.bmp | Bin .../solitaire_numbers.8x10x1.bmp | Bin .../solitaire_suits.6x6x1.bmp | Bin .../solitaire_suits.8x10x1.bmp | Bin .../mono/solitaire_suits.8x10x1_filled.bmp | Bin 0 -> 222 bytes .../solitaire_suitsi.15x16x1.bmp | Bin .../mono/solitaire_suitsi.15x16x1_filled.bmp | Bin 0 -> 318 bytes apps/plugins/bitmaps/native/SOURCES | 15 ------- .../native/solitaire_suits.8x10x16.bmp | Bin 1014 -> 0 bytes .../native/solitaire_suitsi.15x16x16.bmp | Bin 3126 -> 0 bytes apps/plugins/solitaire.c | 37 +++++++++++++----- 12 files changed, 46 insertions(+), 24 deletions(-) rename apps/plugins/bitmaps/{native => mono}/solitaire_numbers.6x6x1.bmp (100%) rename apps/plugins/bitmaps/{native => mono}/solitaire_numbers.8x10x1.bmp (100%) rename apps/plugins/bitmaps/{native => mono}/solitaire_suits.6x6x1.bmp (100%) rename apps/plugins/bitmaps/{native => mono}/solitaire_suits.8x10x1.bmp (100%) create mode 100644 apps/plugins/bitmaps/mono/solitaire_suits.8x10x1_filled.bmp rename apps/plugins/bitmaps/{native => mono}/solitaire_suitsi.15x16x1.bmp (100%) create mode 100644 apps/plugins/bitmaps/mono/solitaire_suitsi.15x16x1_filled.bmp delete mode 100644 apps/plugins/bitmaps/native/solitaire_suits.8x10x16.bmp delete mode 100644 apps/plugins/bitmaps/native/solitaire_suitsi.15x16x16.bmp diff --git a/apps/plugins/bitmaps/mono/SOURCES b/apps/plugins/bitmaps/mono/SOURCES index 82bab1be12..0fbc4766d1 100644 --- a/apps/plugins/bitmaps/mono/SOURCES +++ b/apps/plugins/bitmaps/mono/SOURCES @@ -31,4 +31,22 @@ brickmania_powerups.112x64x1.bmp tetrox_background.112x64x1.bmp #endif +/* Solitaire */ +#if LCD_HEIGHT > 64 +solitaire_numbers.8x10x1.bmp +#if HAVE_LCD_COLOR +solitaire_suits.8x10x1_filled.bmp +#else +solitaire_suits.8x10x1.bmp +#endif +#else +solitaire_numbers.6x6x1.bmp +solitaire_suits.6x6x1.bmp +#endif +#if HAVE_LCD_COLOR +solitaire_suitsi.15x16x1_filled.bmp +#else +solitaire_suitsi.15x16x1.bmp +#endif + #endif /* HAVE_LCD_BITMAP */ diff --git a/apps/plugins/bitmaps/native/solitaire_numbers.6x6x1.bmp b/apps/plugins/bitmaps/mono/solitaire_numbers.6x6x1.bmp similarity index 100% rename from apps/plugins/bitmaps/native/solitaire_numbers.6x6x1.bmp rename to apps/plugins/bitmaps/mono/solitaire_numbers.6x6x1.bmp diff --git a/apps/plugins/bitmaps/native/solitaire_numbers.8x10x1.bmp b/apps/plugins/bitmaps/mono/solitaire_numbers.8x10x1.bmp similarity index 100% rename from apps/plugins/bitmaps/native/solitaire_numbers.8x10x1.bmp rename to apps/plugins/bitmaps/mono/solitaire_numbers.8x10x1.bmp diff --git a/apps/plugins/bitmaps/native/solitaire_suits.6x6x1.bmp b/apps/plugins/bitmaps/mono/solitaire_suits.6x6x1.bmp similarity index 100% rename from apps/plugins/bitmaps/native/solitaire_suits.6x6x1.bmp rename to apps/plugins/bitmaps/mono/solitaire_suits.6x6x1.bmp diff --git a/apps/plugins/bitmaps/native/solitaire_suits.8x10x1.bmp b/apps/plugins/bitmaps/mono/solitaire_suits.8x10x1.bmp similarity index 100% rename from apps/plugins/bitmaps/native/solitaire_suits.8x10x1.bmp rename to apps/plugins/bitmaps/mono/solitaire_suits.8x10x1.bmp diff --git a/apps/plugins/bitmaps/mono/solitaire_suits.8x10x1_filled.bmp b/apps/plugins/bitmaps/mono/solitaire_suits.8x10x1_filled.bmp new file mode 100644 index 0000000000000000000000000000000000000000..497dcae149825f8add5babb82460b9601a8fc37f GIT binary patch literal 222 zcmZ?ry~h9nc0fu4h&iA%BLgE?VgZm8;)Y-*ARB~1;Q#;s4F7@jcOZTY#0P=60g6Fv tkQhh~qy~haL-A4|-3Y}XvBOYtm^y6cH2~Fg0P$TQhN;759>`o|^8kLtB{cv5 literal 0 HcmV?d00001 diff --git a/apps/plugins/bitmaps/native/solitaire_suitsi.15x16x1.bmp b/apps/plugins/bitmaps/mono/solitaire_suitsi.15x16x1.bmp similarity index 100% rename from apps/plugins/bitmaps/native/solitaire_suitsi.15x16x1.bmp rename to apps/plugins/bitmaps/mono/solitaire_suitsi.15x16x1.bmp diff --git a/apps/plugins/bitmaps/mono/solitaire_suitsi.15x16x1_filled.bmp b/apps/plugins/bitmaps/mono/solitaire_suitsi.15x16x1_filled.bmp new file mode 100644 index 0000000000000000000000000000000000000000..541bfc06888efff9be241baf85896280c74602d6 GIT binary patch literal 318 zcmZvVF%H5o5Ck_AG)N%v0BT-gA$oXH#0z*6d;}rE1JaQqve}6_g(7E-E#KYl9#5&! zSjqR^Y|OzlK4baWt||*RfGVY^WGT0m!3NOpD&1Ow_{Ti<(ZbM9bk^RM(#0YF&|?<# nscO;ZANbH`=jq%zpSyitSLySZ^pXEQ&uj3(4`2M*CzI?i)Id=u literal 0 HcmV?d00001 diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES index 7ddb042def..8df3bef608 100644 --- a/apps/plugins/bitmaps/native/SOURCES +++ b/apps/plugins/bitmaps/native/SOURCES @@ -158,21 +158,6 @@ solitaire_cardback.220x176x16.bmp solitaire_cardback.176x132x16.bmp #endif #endif -#if defined( HAVE_LCD_COLOR ) -solitaire_numbers.8x10x1.bmp -solitaire_suits.8x10x16.bmp -#elif LCD_HEIGHT > 64 -solitaire_numbers.8x10x1.bmp -solitaire_suits.8x10x1.bmp -#else -solitaire_numbers.6x6x1.bmp -solitaire_suits.6x6x1.bmp -#endif -#ifdef HAVE_LCD_COLOR -solitaire_suitsi.15x16x16.bmp -#else -solitaire_suitsi.15x16x1.bmp -#endif /* Sudoku */ #if LCD_WIDTH >= LCD_HEIGHT diff --git a/apps/plugins/bitmaps/native/solitaire_suits.8x10x16.bmp b/apps/plugins/bitmaps/native/solitaire_suits.8x10x16.bmp deleted file mode 100644 index df8ad2e8b24f63bbe3afb408e925e74ae2378a42..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1014 zcmbu5K@Nj33)%&^v$TRb1OumM$wBL>nw6v1e_^@@rnZrq~nrg!9!hElC@(T~G5W0B> H=fVE~LPdPf diff --git a/apps/plugins/bitmaps/native/solitaire_suitsi.15x16x16.bmp b/apps/plugins/bitmaps/native/solitaire_suitsi.15x16x16.bmp deleted file mode 100644 index 530921db3dd1b0f4ae5d16f777885e5366725023..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3126 zcmd6lK@P$&3IX?l$e6s0)iG_wg$^Yn<+e~9;RJRUBnW9LE`@f zFD2f*q>}H!x75Si5dzozzu==YmH2*YWP^tZN34aOia+9)KGuJ}0qbXtB$0pKB%Mhp zfy_0_tF{~8(-IhB+;G*7ODuqdu|xm~hj`Qq@7tLH{oHz z5l?}hiaoqB+|bHI+ET>cnA*nkHAZyW_L#G9H@>GOFvPgwULMdw&)B|JB7hHLNz97k OOVU&nSu&)jFn!+sk2whd 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; #define draw_number( num, x, y ) \ - rb->lcd_bitmap_part( numbers, 0, num * NUMBER_HEIGHT, NUMBER_STRIDE, \ - x, y, NUMBER_WIDTH, NUMBER_HEIGHT ); -extern const fb_data solitaire_numbers[]; + rb->lcd_mono_bitmap_part( numbers, 0, num * NUMBER_HEIGHT, NUMBER_STRIDE, \ + x, y, NUMBER_WIDTH, NUMBER_HEIGHT ); +extern const unsigned char solitaire_numbers[]; #define numbers solitaire_numbers #define draw_suit( num, x, y ) \ - rb->lcd_bitmap_part( suits, 0, num * SUIT_HEIGHT, SUIT_STRIDE, \ - x, y, SUIT_WIDTH, SUIT_HEIGHT ); -extern const fb_data solitaire_suits[]; + rb->lcd_mono_bitmap_part( suits, 0, num * SUIT_HEIGHT, SUIT_STRIDE, \ + x, y, SUIT_WIDTH, SUIT_HEIGHT ); +extern const unsigned char solitaire_suits[]; #define suits solitaire_suits #if ( CARD_HEIGHT < SUITI_HEIGHT + 1 ) || ( CARD_WIDTH < SUITI_WIDTH + 1 ) @@ -284,9 +284,9 @@ extern const fb_data solitaire_suits[]; # define draw_suiti( num, x, y ) draw_suit( num, x, y ) #else # define draw_suiti( num, x, y ) \ - rb->lcd_bitmap_part( suitsi, 0, num * SUITI_HEIGHT, SUITI_STRIDE, \ - x, y, SUITI_WIDTH, SUITI_HEIGHT ); - extern const fb_data solitaire_suitsi[]; + rb->lcd_mono_bitmap_part( suitsi, 0, num * SUITI_HEIGHT, SUITI_STRIDE, \ + x, y, SUITI_WIDTH, SUITI_HEIGHT ); + extern const unsigned char solitaire_suitsi[]; # define suitsi solitaire_suitsi #endif @@ -302,6 +302,16 @@ extern const fb_data solitaire_suits[]; extern const fb_data solitaire_cardback[]; #endif +#if HAVE_LCD_COLOR + static const unsigned colors[4] = { + LCD_BLACK, LCD_RGBPACK(255, 0, 0), LCD_BLACK, LCD_RGBPACK(255, 0, 0) + }; +#elif LCD_DEPTH > 1 + static const unsigned colors[4] = { + LCD_BLACK, LCD_BRIGHTNESS(127), LCD_BLACK, LCD_BRIGHTNESS(127) + }; +#endif + #define CONFIG_FILENAME "sol.cfg" #define NOT_A_CARD 255 @@ -403,6 +413,10 @@ static void draw_card( card_t card, int x, int y, rb->lcd_set_foreground( LCD_WHITE ); rb->lcd_fillrect( x+1, y+1, CARD_WIDTH-1, CARD_HEIGHT-1 ); #endif + +#if LCD_DEPTH > 1 + rb->lcd_set_foreground( colors[card.suit] ); +#endif if( leftstyle ) { #if UPPER_ROW_MARGIN > 0 @@ -442,6 +456,11 @@ static void draw_empty_stack( int s, int x, int y, bool cursor ) #if LCD_DEPTH == 1 rb->lcd_set_drawmode( DRMODE_SOLID ); #endif + +#if LCD_DEPTH > 1 + rb->lcd_set_foreground( colors[s] ); +#endif + draw_suiti( s, x+(CARD_WIDTH-SUITI_WIDTH)/2, y+(CARD_HEIGHT-SUITI_HEIGHT)/2 );