summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2013-04-12 07:27:08 +0200
committerThomas Martitz <kugel@rockbox.org>2013-12-14 23:11:31 +0100
commit26801b3bd8f11fe680146086aa0a2fd12e7de289 (patch)
treee9ea482107bf77382a07c842fa7a5f65e4a40ead
parentb094d80dab4f7ac501172d0412e9e53289ede27b (diff)
downloadrockbox-26801b3bd8f11fe680146086aa0a2fd12e7de289.tar.gz
rockbox-26801b3bd8f11fe680146086aa0a2fd12e7de289.zip
scroll_engine: Add STYLE_NONE to allow for drawing lines without styling.
This allows to draw lines without destroying styles that were drawn manually (e.g. from apps/) beforehand. Change-Id: I0de290c9343061efb115e1b76da5b76395c2b2af
-rw-r--r--firmware/drivers/lcd-bitmap-common.c6
-rw-r--r--firmware/export/lcd-remote.h3
-rw-r--r--firmware/export/lcd.h13
3 files changed, 13 insertions, 9 deletions
diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c
index 10a567edf1..c04f57ef22 100644
--- a/firmware/drivers/lcd-bitmap-common.c
+++ b/firmware/drivers/lcd-bitmap-common.c
@@ -360,6 +360,12 @@ static void LCDFN(putsxyofs_style)(int xpos, int ypos,
int text_ypos = ypos;
int line_height = font_get(current_vp->font)->height;
text_ypos += h/2 - line_height/2; /* center the text in the line */
+
+ if ((style & STYLE_MODE_MASK) == STYLE_NONE) {
+ if (str[0])
+ LCDFN(putsxyofs)(xpos, text_ypos, offset, str);
+ return;
+ }
#if defined(MAIN_LCD) && defined(HAVE_LCD_COLOR)
int oldfgcolor = current_vp->fg_pattern;
int oldbgcolor = current_vp->bg_pattern;
diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h
index 74b668db3d..be6816cd7e 100644
--- a/firmware/export/lcd-remote.h
+++ b/firmware/export/lcd-remote.h
@@ -37,9 +37,6 @@
int remote_type(void);
#endif
-#define STYLE_DEFAULT 0x00000000
-#define STYLE_INVERT 0x20000000
-
#if LCD_REMOTE_DEPTH <= 8
#if (LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED) \
|| (LCD_REMOTE_PIXELFORMAT == HORIZONTAL_INTERLEAVED)
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index 7ea053f241..37e6bf4d16 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -119,12 +119,13 @@ enum screen_type {
#define STRIDE(screen, w, h) (screen==SCREEN_MAIN?STRIDE_MAIN((w), \
(h)):STRIDE_REMOTE((w),(h)))
-#define STYLE_DEFAULT 0x00000000
-#define STYLE_COLORED 0x10000000
-#define STYLE_INVERT 0x20000000
-#define STYLE_COLORBAR 0x40000000
-#define STYLE_GRADIENT 0x80000000
-#define STYLE_MODE_MASK 0xF0000000
+#define STYLE_NONE 0x00000000
+#define STYLE_DEFAULT 0x01000000
+#define STYLE_COLORED 0x02000000
+#define STYLE_INVERT 0x04000000
+#define STYLE_COLORBAR 0x08000000
+#define STYLE_GRADIENT 0x10000000
+#define STYLE_MODE_MASK 0xFF000000
/* HACK: This isnt really a style, We need to be able to tell some of
* the lcd API that we want to draw text to a specific pixel instead
* of a char. Remove this hack when the whole LCD api goes to fully