From b0e056b5aeaac668312cbf67ee9c9d1713704b05 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Tue, 19 Jul 2005 10:33:41 +0000 Subject: More preparations and conversions for colour LCD support. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7195 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/bounce.c | 11 +++++++++-- apps/plugins/cube.c | 12 ++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'apps/plugins') diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c index c3bea8e14f..3ff3a8d5f6 100644 --- a/apps/plugins/bounce.c +++ b/apps/plugins/bounce.c @@ -282,11 +282,18 @@ static void addclock(void) #define DRAW_WIDTH (LCD_WIDTH + LETTER_WIDTH*2) #if LCD_DEPTH > 1 -static const int face_colors[] = +#ifdef HAVE_LCD_COLOR +static const struct rgb face_colors[] = +{ + LCD_BLACK, {0, 0, LCD_MAX_BLUE}, {LCD_MAX_RED, 0, 0} +}; +#else +static const int face_colors[] = { 0, 2*LCD_MAX_LEVEL/3, LCD_MAX_LEVEL/3 }; #endif +#endif static int scrollit(void) { @@ -474,7 +481,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) if (h > 0) h = scrollit(); #if LCD_DEPTH > 1 - rb->lcd_set_foreground(0); + rb->lcd_set_foreground(LCD_BLACK); #endif } while(h > 0); diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c index afb2b88628..e69ef46c80 100644 --- a/apps/plugins/cube.c +++ b/apps/plugins/cube.c @@ -152,11 +152,19 @@ static const struct face faces[6] = }; #if LCD_DEPTH > 1 -static const int face_colors[6] = +#ifdef HAVE_LCD_COLOR +static const struct rgb face_colors[6] = +{ + {LCD_MAX_RED, 0, 0}, {LCD_MAX_RED, 0, 0}, {0, LCD_MAX_GREEN, 0}, + {0, LCD_MAX_GREEN, 0}, {0, 0, LCD_MAX_BLUE}, {0, 0, LCD_MAX_BLUE} +}; +#else +static const int face_colors[6] = { 2*LCD_MAX_LEVEL/3, 2*LCD_MAX_LEVEL/3, LCD_MAX_LEVEL/3, LCD_MAX_LEVEL/3, 0, 0 }; #endif +#endif enum { #if LCD_DEPTH > 1 @@ -352,7 +360,7 @@ static void cube_draw(void) point2D[faces[i].corner[3]].y); } - rb->lcd_set_foreground(0); + rb->lcd_set_foreground(LCD_BLACK); break; #endif /* LCD_DEPTH > 1 */ -- cgit v1.2.3