Fix solitaire card colors

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10861 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Antoine Cellerier 2006-09-02 22:45:27 +00:00
parent 55a3018cdd
commit cf605c3434
12 changed files with 46 additions and 24 deletions

View file

@ -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 */

View file

Before

Width:  |  Height:  |  Size: 374 B

After

Width:  |  Height:  |  Size: 374 B

View file

Before

Width:  |  Height:  |  Size: 582 B

After

Width:  |  Height:  |  Size: 582 B

View file

Before

Width:  |  Height:  |  Size: 158 B

After

Width:  |  Height:  |  Size: 158 B

View file

Before

Width:  |  Height:  |  Size: 222 B

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

View file

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

View file

@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1,014 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -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 );