summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-07-19 10:33:41 +0000
committerJens Arnold <amiconn@rockbox.org>2005-07-19 10:33:41 +0000
commitb0e056b5aeaac668312cbf67ee9c9d1713704b05 (patch)
treee0db08c1723c11b82191366ca3930046f5f1f34b /apps
parent82ea7c3bacd0b5308e7f0b1d8f35a4e3e13e54f7 (diff)
downloadrockbox-b0e056b5aeaac668312cbf67ee9c9d1713704b05.tar.gz
rockbox-b0e056b5aeaac668312cbf67ee9c9d1713704b05.zip
More preparations and conversions for colour LCD support.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7195 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugin.c8
-rw-r--r--apps/plugin.h7
-rw-r--r--apps/plugins/bounce.c11
-rw-r--r--apps/plugins/cube.c12
-rw-r--r--apps/screens.c6
5 files changed, 35 insertions, 9 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index e298b55b23..6df7621203 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -412,11 +412,11 @@ int plugin_load(const char* plugin, void* parameter)
412 button_clear_queue(); 412 button_clear_queue();
413#ifdef HAVE_LCD_BITMAP 413#ifdef HAVE_LCD_BITMAP
414#if LCD_DEPTH > 1 414#if LCD_DEPTH > 1
415 lcd_set_drawinfo(DRMODE_SOLID, 0, LCD_MAX_LEVEL); 415 lcd_set_drawinfo(DRMODE_SOLID, LCD_BLACK, LCD_WHITE);
416#else 416#else /* LCD_DEPTH == 1 */
417 lcd_set_drawmode(DRMODE_SOLID); 417 lcd_set_drawmode(DRMODE_SOLID);
418#endif 418#endif /* LCD_DEPTH */
419#endif 419#endif /* HAVE_LCD_BITMAP */
420 420
421 plugin_loaded = false; 421 plugin_loaded = false;
422 422
diff --git a/apps/plugin.h b/apps/plugin.h
index b081887328..801c49e0f1 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -403,10 +403,17 @@ struct plugin_api {
403 int *rundb_initialized; 403 int *rundb_initialized;
404 int (*strncmp)(const char *, const char *, size_t); 404 int (*strncmp)(const char *, const char *, size_t);
405#if LCD_DEPTH > 1 405#if LCD_DEPTH > 1
406#ifdef HAVE_LCD_COLOR
407 void (*lcd_set_foreground)(struct rgb color);
408 struct rgb (*lcd_get_foreground)(void);
409 void (*lcd_set_background)(struct rgb color);
410 struct rgb (*lcd_get_background)(void);
411#else
406 void (*lcd_set_foreground)(int brightness); 412 void (*lcd_set_foreground)(int brightness);
407 int (*lcd_get_foreground)(void); 413 int (*lcd_get_foreground)(void);
408 void (*lcd_set_background)(int brightness); 414 void (*lcd_set_background)(int brightness);
409 int (*lcd_get_background)(void); 415 int (*lcd_get_background)(void);
416#endif
410 void (*lcd_bitmap_part)(const unsigned char *src, int src_x, int src_y, 417 void (*lcd_bitmap_part)(const unsigned char *src, int src_x, int src_y,
411 int stride, int x, int y, int width, int height); 418 int stride, int x, int y, int width, int height);
412 void (*lcd_bitmap)(const unsigned char *src, int x, int y, int width, 419 void (*lcd_bitmap)(const unsigned char *src, int x, int y, int width,
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)
282#define DRAW_WIDTH (LCD_WIDTH + LETTER_WIDTH*2) 282#define DRAW_WIDTH (LCD_WIDTH + LETTER_WIDTH*2)
283 283
284#if LCD_DEPTH > 1 284#if LCD_DEPTH > 1
285static const int face_colors[] = 285#ifdef HAVE_LCD_COLOR
286static const struct rgb face_colors[] =
287{
288 LCD_BLACK, {0, 0, LCD_MAX_BLUE}, {LCD_MAX_RED, 0, 0}
289};
290#else
291static const int face_colors[] =
286{ 292{
287 0, 2*LCD_MAX_LEVEL/3, LCD_MAX_LEVEL/3 293 0, 2*LCD_MAX_LEVEL/3, LCD_MAX_LEVEL/3
288}; 294};
289#endif 295#endif
296#endif
290 297
291static int scrollit(void) 298static int scrollit(void)
292{ 299{
@@ -474,7 +481,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
474 if (h > 0) 481 if (h > 0)
475 h = scrollit(); 482 h = scrollit();
476#if LCD_DEPTH > 1 483#if LCD_DEPTH > 1
477 rb->lcd_set_foreground(0); 484 rb->lcd_set_foreground(LCD_BLACK);
478#endif 485#endif
479 } while(h > 0); 486 } while(h > 0);
480 487
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] =
152}; 152};
153 153
154#if LCD_DEPTH > 1 154#if LCD_DEPTH > 1
155static const int face_colors[6] = 155#ifdef HAVE_LCD_COLOR
156static const struct rgb face_colors[6] =
157{
158 {LCD_MAX_RED, 0, 0}, {LCD_MAX_RED, 0, 0}, {0, LCD_MAX_GREEN, 0},
159 {0, LCD_MAX_GREEN, 0}, {0, 0, LCD_MAX_BLUE}, {0, 0, LCD_MAX_BLUE}
160};
161#else
162static const int face_colors[6] =
156{ 163{
157 2*LCD_MAX_LEVEL/3, 2*LCD_MAX_LEVEL/3, LCD_MAX_LEVEL/3, LCD_MAX_LEVEL/3, 0, 0 164 2*LCD_MAX_LEVEL/3, 2*LCD_MAX_LEVEL/3, LCD_MAX_LEVEL/3, LCD_MAX_LEVEL/3, 0, 0
158}; 165};
159#endif 166#endif
167#endif
160 168
161enum { 169enum {
162#if LCD_DEPTH > 1 170#if LCD_DEPTH > 1
@@ -352,7 +360,7 @@ static void cube_draw(void)
352 point2D[faces[i].corner[3]].y); 360 point2D[faces[i].corner[3]].y);
353 361
354 } 362 }
355 rb->lcd_set_foreground(0); 363 rb->lcd_set_foreground(LCD_BLACK);
356 break; 364 break;
357#endif /* LCD_DEPTH > 1 */ 365#endif /* LCD_DEPTH > 1 */
358 366
diff --git a/apps/screens.c b/apps/screens.c
index a51d83fed3..19afe44baa 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -855,8 +855,12 @@ void splash(int ticks, /* how long the splash is displayed */
855 int xx = (LCD_WIDTH-maxw)/2 - 2; 855 int xx = (LCD_WIDTH-maxw)/2 - 2;
856 /* The new graphics routines handle clipping, so no need to check */ 856 /* The new graphics routines handle clipping, so no need to check */
857#if LCD_DEPTH > 1 857#if LCD_DEPTH > 1
858#ifdef HAVE_LCD_COLOR
859 lcd_set_background((struct rgb){LCD_MAX_RED-1, LCD_MAX_GREEN-1, LCD_MAX_BLUE-1});
860#else
858 lcd_set_background(LCD_MAX_LEVEL-1); 861 lcd_set_background(LCD_MAX_LEVEL-1);
859#endif 862#endif
863#endif
860 lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); 864 lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
861 lcd_fillrect(xx, y-2, maxw+4, LCD_HEIGHT-y*2+4); 865 lcd_fillrect(xx, y-2, maxw+4, LCD_HEIGHT-y*2+4);
862 lcd_set_drawmode(DRMODE_SOLID); 866 lcd_set_drawmode(DRMODE_SOLID);
@@ -903,7 +907,7 @@ void splash(int ticks, /* how long the splash is displayed */
903 next = strtok_r(NULL, " ", &store); 907 next = strtok_r(NULL, " ", &store);
904 } 908 }
905#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH > 1) 909#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH > 1)
906 lcd_set_background(LCD_MAX_LEVEL); 910 lcd_set_background(LCD_WHITE);
907#endif 911#endif
908 lcd_update(); 912 lcd_update();
909 913