From 1d7f8067a6a52946f331ab040fd43917e58c36f6 Mon Sep 17 00:00:00 2001 From: Antoine Cellerier Date: Sat, 10 Jun 2006 23:08:29 +0000 Subject: Grayscale graphics for sokoban. (h1x0, ipod mini and ipod 4g) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10108 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/bitmaps/native/SOURCES | 2 ++ apps/plugins/bitmaps/native/sokoban_tiles.6x6x2.bmp | Bin 0 -> 774 bytes apps/plugins/sokoban.c | 20 ++++++++------------ 3 files changed, 10 insertions(+), 12 deletions(-) create mode 100644 apps/plugins/bitmaps/native/sokoban_tiles.6x6x2.bmp diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES index 6b37436e02..c071b78504 100644 --- a/apps/plugins/bitmaps/native/SOURCES +++ b/apps/plugins/bitmaps/native/SOURCES @@ -116,6 +116,8 @@ sokoban_tiles.9x9.bmp /* LCD_HEIGHT >= 128 */ sokoban_tiles.6x6.bmp #endif +#elif LCD_DEPTH >= 2 +sokoban_tiles.6x6x2.bmp #endif /* Flip it */ diff --git a/apps/plugins/bitmaps/native/sokoban_tiles.6x6x2.bmp b/apps/plugins/bitmaps/native/sokoban_tiles.6x6x2.bmp new file mode 100644 index 0000000000..0cc7ad8421 Binary files /dev/null and b/apps/plugins/bitmaps/native/sokoban_tiles.6x6x2.bmp differ diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c index 55f94b72dc..248a3654f1 100644 --- a/apps/plugins/sokoban.c +++ b/apps/plugins/sokoban.c @@ -24,7 +24,7 @@ PLUGIN_HEADER -#ifdef HAVE_LCD_COLOR +#if LCD_DEPTH >= 2 extern const fb_data sokoban_tiles[]; #endif @@ -426,7 +426,7 @@ static void update_screen(void) int magnify = 14; #elif LCD_HEIGHT >= 176 /* h3x0, ipod color/photo */ int magnify = 9; -#elif LCD_HEIGHT >= 128 /* h1x0, ipod nano */ +#elif LCD_HEIGHT >= 110 /* h1x0, ipod nano, ipod mini */ int magnify = 6; #else /* other */ int magnify = 4; @@ -443,13 +443,9 @@ static void update_screen(void) break; case '#': /* this is a wall */ -#if HAVE_LCD_COLOR +#if LCD_DEPTH >= 1 rb->lcd_bitmap_part( sokoban_tiles, 0, 1*magnify, magnify, c, b, magnify, magnify ); -#elif LCD_DEPTH > 1 - rb->lcd_set_foreground(MEDIUM_GRAY); - rb->lcd_fillrect(c, b, magnify, magnify); - rb->lcd_set_foreground(LCD_BLACK); #else { int i, j; @@ -462,7 +458,7 @@ static void update_screen(void) break; case '.': /* this is a home location */ -#ifdef HAVE_LCD_COLOR +#if LCD_DEPTH >= 1 rb->lcd_bitmap_part( sokoban_tiles, 0, 4*magnify, magnify, c, b, magnify, magnify ); #else @@ -472,7 +468,7 @@ static void update_screen(void) break; case '$': /* this is a box */ -#ifdef HAVE_LCD_COLOR +#if LCD_DEPTH >= 1 rb->lcd_bitmap_part( sokoban_tiles, 0, 2*magnify, magnify, c, b, magnify, magnify ); #else @@ -482,7 +478,7 @@ static void update_screen(void) case '@': /* this is you */ { -#ifdef HAVE_LCD_COLOR +#if LCD_DEPTH >= 1 rb->lcd_bitmap_part( sokoban_tiles, 0, 5*magnify, magnify, c, b, magnify, magnify ); #else @@ -503,7 +499,7 @@ static void update_screen(void) case '%': /* this is a box on a home spot */ -#ifdef HAVE_LCD_COLOR +#if LCD_DEPTH >= 1 rb->lcd_bitmap_part( sokoban_tiles, 0, 3*magnify, magnify, c, b, magnify, magnify ); #else @@ -513,7 +509,7 @@ static void update_screen(void) #endif break; -#ifdef HAVE_LCD_COLOR +#if LCD_DEPTH >= 1 default: rb->lcd_bitmap_part( sokoban_tiles, 0, 0*magnify, magnify, c, b, magnify, magnify ); -- cgit v1.2.3