From c001bb16d256a6516c3a6d0a115dd136821989b8 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Tue, 19 Jul 2005 15:39:54 +0000 Subject: Use greyscale graphics in minesweeper. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7197 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/minesweeper.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'apps/plugins') diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c index aec9ba166b..64e3e6fb9d 100644 --- a/apps/plugins/minesweeper.c +++ b/apps/plugins/minesweeper.c @@ -67,6 +67,15 @@ use F3 to see how many mines are left (supposing all your flags are correct) #endif +#if LCD_DEPTH > 1 +#if HAVE_LCD_COLOR +#define LIGHT_GRAY ((struct rgb){2*MAX_RED/3, 2*MAX_GREEN/3, 2*MAX_BLUE/3}) +#define DARK_GRAY ((struct rgb){MAX_RED/3, MAX_GREEN/3, MAX_BLUE/3}) +#else +#define LIGHT_GRAY (2*LCD_MAX_LEVEL/3) +#define DARK_GRAY (LCD_MAX_LEVEL/3) +#endif +#endif /* here is a global api struct pointer. while not strictly necessary, it's nice not to have to pass the api pointer in all function calls @@ -375,7 +384,13 @@ int minesweeper(void) //display the mine field for(i=0;i 1 + rb->lcd_set_foreground(DARK_GRAY); + rb->lcd_drawrect(j*8,i*8,8,8); + rb->lcd_set_foreground(LCD_BLACK); +#else rb->lcd_drawrect(j*8,i*8,8,8); +#endif if(minefield[i][j].known){ if(minefield[i][j].mine){ rb->lcd_putsxy(j*8+1,i*8+1,"b"); @@ -388,7 +403,13 @@ int minesweeper(void) rb->lcd_drawline(j*8+2,i*8+2,j*8+5,i*8+5); rb->lcd_drawline(j*8+2,i*8+5,j*8+5,i*8+2); } else { +#if LCD_DEPTH > 1 + rb->lcd_set_foreground(LIGHT_GRAY); + rb->lcd_fillrect(j*8+1,i*8+1,6,6); + rb->lcd_set_foreground(LCD_BLACK); +#else rb->lcd_fillrect(j*8+2,i*8+2,4,4); +#endif } } } -- cgit v1.2.3