diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/minesweeper.c | 21 |
1 files changed, 21 insertions, 0 deletions
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) | |||
67 | 67 | ||
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | #if LCD_DEPTH > 1 | ||
71 | #if HAVE_LCD_COLOR | ||
72 | #define LIGHT_GRAY ((struct rgb){2*MAX_RED/3, 2*MAX_GREEN/3, 2*MAX_BLUE/3}) | ||
73 | #define DARK_GRAY ((struct rgb){MAX_RED/3, MAX_GREEN/3, MAX_BLUE/3}) | ||
74 | #else | ||
75 | #define LIGHT_GRAY (2*LCD_MAX_LEVEL/3) | ||
76 | #define DARK_GRAY (LCD_MAX_LEVEL/3) | ||
77 | #endif | ||
78 | #endif | ||
70 | 79 | ||
71 | /* here is a global api struct pointer. while not strictly necessary, | 80 | /* here is a global api struct pointer. while not strictly necessary, |
72 | it's nice not to have to pass the api pointer in all function calls | 81 | it's nice not to have to pass the api pointer in all function calls |
@@ -375,7 +384,13 @@ int minesweeper(void) | |||
375 | //display the mine field | 384 | //display the mine field |
376 | for(i=0;i<height;i++){ | 385 | for(i=0;i<height;i++){ |
377 | for(j=0;j<width;j++){ | 386 | for(j=0;j<width;j++){ |
387 | #if LCD_DEPTH > 1 | ||
388 | rb->lcd_set_foreground(DARK_GRAY); | ||
389 | rb->lcd_drawrect(j*8,i*8,8,8); | ||
390 | rb->lcd_set_foreground(LCD_BLACK); | ||
391 | #else | ||
378 | rb->lcd_drawrect(j*8,i*8,8,8); | 392 | rb->lcd_drawrect(j*8,i*8,8,8); |
393 | #endif | ||
379 | if(minefield[i][j].known){ | 394 | if(minefield[i][j].known){ |
380 | if(minefield[i][j].mine){ | 395 | if(minefield[i][j].mine){ |
381 | rb->lcd_putsxy(j*8+1,i*8+1,"b"); | 396 | rb->lcd_putsxy(j*8+1,i*8+1,"b"); |
@@ -388,7 +403,13 @@ int minesweeper(void) | |||
388 | rb->lcd_drawline(j*8+2,i*8+2,j*8+5,i*8+5); | 403 | rb->lcd_drawline(j*8+2,i*8+2,j*8+5,i*8+5); |
389 | rb->lcd_drawline(j*8+2,i*8+5,j*8+5,i*8+2); | 404 | rb->lcd_drawline(j*8+2,i*8+5,j*8+5,i*8+2); |
390 | } else { | 405 | } else { |
406 | #if LCD_DEPTH > 1 | ||
407 | rb->lcd_set_foreground(LIGHT_GRAY); | ||
408 | rb->lcd_fillrect(j*8+1,i*8+1,6,6); | ||
409 | rb->lcd_set_foreground(LCD_BLACK); | ||
410 | #else | ||
391 | rb->lcd_fillrect(j*8+2,i*8+2,4,4); | 411 | rb->lcd_fillrect(j*8+2,i*8+2,4,4); |
412 | #endif | ||
392 | } | 413 | } |
393 | } | 414 | } |
394 | } | 415 | } |