summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-08-09 17:39:39 +0000
committerThomas Martitz <kugel@rockbox.org>2009-08-09 17:39:39 +0000
commit9f3fc27be4a2483815dacfa3f532ea8d35df650f (patch)
tree10b28f80936509dc3c7cf2a17bdc2df11c00a88f
parentdc4e90341ccf97d1451f46fa1bd4acde5e950298 (diff)
downloadrockbox-9f3fc27be4a2483815dacfa3f532ea8d35df650f.tar.gz
rockbox-9f3fc27be4a2483815dacfa3f532ea8d35df650f.zip
Fix player and greyscale reds.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22224 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/viewport.c38
-rw-r--r--apps/gui/viewport.h2
2 files changed, 27 insertions, 13 deletions
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index 52704d9f69..fbbd4eab5a 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -37,12 +37,24 @@
+#ifdef HAVE_LCD_COLOR
#define LINE_SEL_FROM_SETTINGS(vp) \
do { \
vp->lss_pattern = global_settings.lss_color; \
vp->lse_pattern = global_settings.lse_color; \
vp->lst_pattern = global_settings.lst_color; \
} while (0)
+#else
+#define LINE_SEL_FROM_SETTINGS(vp)
+#endif
+
+#ifdef HAVE_LCD_COLOR
+#define FG_FALLBACK global_settings.fg_color
+#define BG_FALLBACK global_settings.bg_color
+#else
+#define FG_FALLBACK LCD_DEFAULT_FG
+#define BG_FALLBACK LCD_DEFAULT_FG
+#endif
static int statusbar_enabled = 0;
@@ -89,20 +101,17 @@ void viewport_set_defaults(struct viewport *vp, enum screen_type screen)
#endif
vp->height = screens[screen].lcdheight - (showing_bars(screen)?STATUSBAR_HEIGHT:0);
+#if LCD_DEPTH > 1
#ifdef HAVE_REMOTE_LCD
/* We only need this test if there is a remote LCD */
if (screen == SCREEN_MAIN)
#endif
{
-#ifdef HAVE_LCD_COLOR
- vp->fg_pattern = global_settings.fg_color;
- vp->bg_pattern = global_settings.bg_color;
+ vp->fg_pattern = FG_FALLBACK;
+ vp->bg_pattern = BG_FALLBACK;
LINE_SEL_FROM_SETTINGS(vp);
-#elif LCD_DEPTH > 1
- vp->fg_pattern = LCD_DEFAULT_FG;
- vp->bg_pattern = LCD_DEFAULT_BG;
-#endif
}
+#endif
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
if (screen == SCREEN_REMOTE)
@@ -159,6 +168,7 @@ void viewportmanager_statusbar_changed(void* data)
viewportmanager_set_statusbar(statusbar_enabled);
}
+#ifdef HAVE_LCD_BITMAP
const char* viewport_parse_viewport(struct viewport *vp,
enum screen_type screen,
const char *bufptr,
@@ -219,15 +229,15 @@ const char* viewport_parse_viewport(struct viewport *vp,
if (!LIST_VALUE_PARSED(set, PL_HEIGHT))
vp->height = screens[screen].lcdheight - vp->y;
-#if (LCD_DEPTH > 1)
+#if LCD_DEPTH > 1 || LCD_REMOTE_DEPTH > 1
if (!LIST_VALUE_PARSED(set, PL_FG))
- vp->fg_pattern = global_settings.fg_color;
+ vp->fg_pattern = FG_FALLBACK;
if (!LIST_VALUE_PARSED(set, PL_BG))
- vp->bg_pattern = global_settings.bg_color;
-#endif
-#ifdef HAVE_LCD_COLOR
+ vp->bg_pattern = BG_FALLBACK;
+#endif /* LCD_DEPTH > 1 || LCD_REMOTE_DEPTH > 1 */
+
LINE_SEL_FROM_SETTINGS(vp);
-#endif
+
/* Validate the viewport dimensions - we know that the numbers are
non-negative integers, ignore bars and assume the viewport takes them
* into account */
@@ -249,3 +259,5 @@ const char* viewport_parse_viewport(struct viewport *vp,
return ptr;
}
+
+#endif /* HAVE_LCD_BITMAP */
diff --git a/apps/gui/viewport.h b/apps/gui/viewport.h
index 65a9815bcd..f703c97342 100644
--- a/apps/gui/viewport.h
+++ b/apps/gui/viewport.h
@@ -41,10 +41,12 @@ void viewport_set_defaults(struct viewport *vp, enum screen_type screen);
/* parse a viewport list, which looks like
* X|Y|width|height|font|foregorund color|background color
* | is a separator */
+#ifdef HAVE_LCD_BITMAP
const char* viewport_parse_viewport(struct viewport *vp,
enum screen_type screen,
const char *bufptr,
const char separator);
+#endif
/* Used to specify which screens the statusbar (SB) should be displayed on.
*
* The parameter is a bit OR'ed combination of the following (screen is