From 68fb89f41e36331db14ff06dfb42f02d75ec9bc9 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sun, 26 Nov 2006 18:41:09 +0000 Subject: [PATCH] Cube: Keep main colours and backdrop. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11607 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/cube.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c index 02f7b45770..00c9a3b606 100644 --- a/apps/plugins/cube.c +++ b/apps/plugins/cube.c @@ -188,13 +188,13 @@ static struct my_lcd *mylcd = &grayfuncs; #define MYLCD(fn) mylcd->fn #define MY_FILLTRIANGLE(x1, y1, x2, y2, x3, y3) gray_filltriangle(x1, y1, x2, y2, x3, y3) #define MY_SET_FOREGROUND(fg) gray_set_foreground(fg) -#define MY_BLACK GRAY_BLACK +#define MY_GET_FOREGROUND() gray_get_foreground() #else #define MYLCD(fn) rb->lcd_ ## fn #define MY_FILLTRIANGLE(x1, y1, x2, y2, x3, y3) xlcd_filltriangle(x1, y1, x2, y2, x3, y3) #define MY_SET_FOREGROUND(fg) rb->lcd_set_foreground(fg) -#define MY_BLACK LCD_BLACK +#define MY_GET_FOREGROUND() rb->lcd_get_foreground() #endif #if CONFIG_LCD == LCD_SSD1815 @@ -443,12 +443,16 @@ static void cube_viewport(void) static void cube_draw(void) { int i, j, line; +#if LCD_DEPTH > 1 || defined(USE_GSLIB) + unsigned old_foreground; +#endif switch (mode) { #if LCD_DEPTH > 1 || defined(USE_GSLIB) case SOLID: - + + old_foreground = MY_GET_FOREGROUND(); for (i = 0; i < 6; i++) { /* backface culling; if the shape winds counter-clockwise, we are @@ -475,7 +479,7 @@ static void cube_draw(void) point2D[faces[i].corner[3]].y); } - MY_SET_FOREGROUND(MY_BLACK); + MY_SET_FOREGROUND(old_foreground); break; #endif /* (LCD_DEPTH > 1) || GSLIB */ @@ -558,7 +562,6 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) #ifdef HAVE_LCD_BITMAP #if LCD_DEPTH > 1 - rb->lcd_set_backdrop(NULL); xlcd_init(rb); #elif defined(USE_GSLIB) gbuf = (unsigned char *)rb->plugin_get_buffer(&gbuf_size);