From 5d3bbe6d3896e02cd72dcd12896036abb622f8a3 Mon Sep 17 00:00:00 2001 From: Kevin Ferrare Date: Thu, 26 Jul 2007 11:59:36 +0000 Subject: [PATCH] fix red for maze plugin git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13997 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/maze.c | 46 ++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/apps/plugins/maze.c b/apps/plugins/maze.c index 6f01665e35..e0f9e0134c 100644 --- a/apps/plugins/maze.c +++ b/apps/plugins/maze.c @@ -206,14 +206,15 @@ void maze_draw(struct maze* maze, struct screen* display){ display->drawline(x*wx, y*wy, x*wx, y*wy+wy); } } -#if (LCD_DEPTH > 1) || (defined(LCD_REMOTE_DEPTH) && (LCD_REMOTE_DEPTH > 1)) - unsigned color; - if(display->depth>1){ - color=(display->depth>=16)?LCD_RGBPACK(127,127,127):1; - display->set_foreground(color); - } -#endif if(maze->solved){ +#if LCD_DEPTH >= 16 + if(display->depth>=16) + display->set_foreground(LCD_RGBPACK(127,127,127)); +#endif +#if LCD_DEPTH >= 2 + if(display->depth==2) + display->set_foreground(1); +#endif for(y=0; ymaze[x][y]; @@ -223,13 +224,15 @@ void maze_draw(struct maze* maze, struct screen* display){ point_width, point_height); } } - } -#if (LCD_DEPTH > 1) || (defined(LCD_REMOTE_DEPTH) && (LCD_REMOTE_DEPTH > 1)) - if(display->depth>1){ - color=(display->depth>=16)?LCD_RGBPACK(0,0,0):0; - display->set_foreground(color); - } +#if LCD_DEPTH >= 16 + if(display->depth>=16) + display->set_foreground(LCD_RGBPACK(0,0,0)); #endif +#if LCD_DEPTH >= 2 + if(display->depth==2) + display->set_foreground(0); +#endif + } /* mark start and end */ display->drawline(0, 0, wx, wy); @@ -453,19 +456,16 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter){ rb = api; rb->backlight_set_timeout(1); + #if LCD_DEPTH > 1 rb->lcd_set_backdrop(NULL); - FOR_NB_SCREENS(i){ - if(rb->screens[i]->depth>1){ - rb->screens[i]->set_background(LCD_DEFAULT_BG); - if(rb->screens[i]->depth>=16) - rb->screens[i]->set_foreground( LCD_RGBPACK( 0, 0, 0)); - else if(rb->screens[i]->depth==2) - rb->screens[i]->set_foreground(0); - } - } + rb->lcd_set_background(LCD_DEFAULT_BG); +#if LCD_DEPTH >= 16 + rb->lcd_set_foreground( LCD_RGBPACK( 0, 0, 0)); +#elif LCD_DEPTH == 2 + rb->lcd_set_foreground(0); +#endif #endif - maze_init(&maze); maze_generate(&maze); FOR_NB_SCREENS(i)