rendered paste bodyIndex: solitaire.c
===================================================================
RCS file: /cvsroot/rockbox/apps/plugins/solitaire.c,v
retrieving revision 1.39
diff -u -r1.39 solitaire.c
--- solitaire.c 3 Aug 2006 20:58:35 -0000 1.39
+++ solitaire.c 6 Aug 2006 21:07:45 -0000
@@ -5,7 +5,7 @@
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
- * $Id: solitaire.c,v 1.39 2006-08-03 20:58:35 dionoea Exp $
+ * $Id: solitaire.c,v 1.39 2006/08/03 20:58:35 dionoea Exp $
*
* Copyright (C) 2004-2006 Antoine Cellerier <dionoea @t videolan d.t org>
*
@@ -246,14 +246,20 @@
#define draw_number( num, x, y ) \
- rb->lcd_bitmap_part( numbers, 0, num * NUMBER_HEIGHT, NUMBER_STRIDE, \
- x, y, NUMBER_WIDTH, NUMBER_HEIGHT );
+ rb->lcd_mono_bitmap_part( (const unsigned char *)numbers, 0, num * NUMBER_HEIGHT, \
+ NUMBER_STRIDE, x, y, NUMBER_WIDTH, NUMBER_HEIGHT );
extern const fb_data solitaire_numbers[];
#define numbers solitaire_numbers
+#ifdef HAVE_LCD_COLOR
+#define draw_suit( num, x, y ) \
+ rb->lcd_bitmap_part(suits, 0, num * SUIT_HEIGHT, SUIT_STRIDE, \
+ x, y, SUIT_WIDTH, SUIT_HEIGHT );
+#else
#define draw_suit( num, x, y ) \
- rb->lcd_bitmap_part( suits, 0, num * SUIT_HEIGHT, SUIT_STRIDE, \
+ rb->lcd_mono_bitmap_part( (const unsigned char *)suits, 0, num * SUIT_HEIGHT, SUIT_STRIDE, \
x, y, SUIT_WIDTH, SUIT_HEIGHT );
+#endif
extern const fb_data solitaire_suits[];
#define suits solitaire_suits
@@ -264,9 +270,16 @@
# define SUITI_WIDTH SUIT_WIDTH
# define draw_suiti( num, x, y ) draw_suit( num, x, y )
#else
+
+#ifdef HAVE_LCD_COLOR
# define draw_suiti( num, x, y ) \
rb->lcd_bitmap_part( suitsi, 0, num * SUITI_HEIGHT, SUITI_STRIDE, \
x, y, SUITI_WIDTH, SUITI_HEIGHT );
+#else
+# define draw_suiti( num, x, y ) \
+ rb->lcd_mono_bitmap_part( (const unsigned char *)suitsi, 0, num * SUITI_HEIGHT, SUITI_STRIDE, \
+ x, y, SUITI_WIDTH, SUITI_HEIGHT );
+#endif
extern const fb_data solitaire_suitsi[];
# define suitsi solitaire_suitsi
#endif
@@ -283,6 +296,15 @@
extern const fb_data solitaire_cardback[];
#endif
+#if LCD_DEPTH>1
+static const unsigned colors[4] = {
+#ifdef HAVE_LCD_COLOR
+ LCD_BLACK, LCD_RGBPACK(255, 0, 0), LCD_BLACK, LCD_RGBPACK(255, 0, 0) };
+#else
+ LCD_BLACK, LCD_BRIGHTNESS(127), LCD_BLACK, LCD_BRIGHTNESS(127) };
+#endif
+#endif
+
#define CONFIG_FILENAME "sol.cfg"
#define NOT_A_CARD 255
@@ -384,6 +406,10 @@
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
@@ -423,6 +449,10 @@
#if LCD_DEPTH == 1
rb->lcd_set_drawmode( DRMODE_SOLID );
#endif
+
+#if (LCD_DEPTH > 1) && (LCD_DEPTH < 16)
+ rb->lcd_set_foreground(colors[s]);
+#endif
draw_suiti( s, x+(CARD_WIDTH-SUITI_WIDTH)/2,
y+(CARD_HEIGHT-SUITI_HEIGHT)/2 );
Index: bitmaps/mono/SOURCES
===================================================================
RCS file: /cvsroot/rockbox/apps/plugins/bitmaps/mono/SOURCES,v
retrieving revision 1.7
diff -u -r1.7 SOURCES
--- bitmaps/mono/SOURCES 5 Jun 2006 20:41:49 -0000 1.7
+++ bitmaps/mono/SOURCES 6 Aug 2006 21:07:45 -0000
@@ -26,6 +26,18 @@
#endif
+/* Solitaire */
+#if LCD_HEIGHT > 64
+solitaire_numbers.8x10x1.bmp
+#ifndef HAVE_LCD_COLOR
+solitaire_suits.8x10x1.bmp
+solitaire_suitsi.15x16x1.bmp
+#endif
+#else
+solitaire_numbers.6x6x1.bmp
+solitaire_suits.6x6x1.bmp
+#endif
+
/* Tetrox */
#if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64)
tetrox_background.112x64x1.bmp
Index: bitmaps/native/SOURCES
===================================================================
RCS file: /cvsroot/rockbox/apps/plugins/bitmaps/native/SOURCES,v
retrieving revision 1.32
diff -u -r1.32 SOURCES
--- bitmaps/native/SOURCES 2 Aug 2006 22:14:58 -0000 1.32
+++ bitmaps/native/SOURCES 6 Aug 2006 21:07:46 -0000
@@ -152,27 +152,14 @@
/* Solitaire */
#ifdef HAVE_LCD_COLOR
+solitaire_suits.8x10x16.bmp
+solitaire_suitsi.15x16x16.bmp
#if (LCD_WIDTH >= 220) && (LCD_HEIGHT >= 176)
solitaire_cardback.220x176x16.bmp
#else
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 == 112) && (LCD_HEIGHT==64) && (LCD_DEPTH == 1)