From 0a16a99a696545fec80643cee6aae5d1b65869d7 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Wed, 3 Feb 2010 07:03:48 +0000 Subject: fix a bug where the backdrop from the sbs is displayed on scrolling lines in the wps when the %wd tag is not used. I'm not crazy about this commit and maybe a better solution would be to outright disable the sbs backdrop when in any skinned screen. This then means backdrops go back to needing special handling (i.e they arnt "free") git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24478 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/lcd-bitmap-common.c | 18 ++++++++++++++++-- firmware/export/scroll_engine.h | 3 +++ 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'firmware') diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c index 586c74578f..24c5aa15cb 100644 --- a/firmware/drivers/lcd-bitmap-common.c +++ b/firmware/drivers/lcd-bitmap-common.c @@ -39,6 +39,9 @@ #define MAIN_LCD #endif +#define HAS_BACKDROP ((defined(MAIN_LCD) && LCD_DEPTH > 1) \ + || (!defined(MAIN_LCD) && LCD_REMOTE_DEPTH > 1)) + #if defined(MAIN_LCD) && defined(HAVE_LCD_COLOR) /* Fill a rectangle with a gradient */ static void lcd_gradient_rect(int x1, int x2, int y, unsigned h, @@ -370,7 +373,10 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string, s->len = utf8length(string); s->offset = offset; s->startx = x * LCDFN(getstringsize)(" ", NULL, NULL); - s->backward = false; + s->backward = false; +#if HAS_BACKDROP + s->backdrop = (char*)LCDFN(get_backdrop()); +#endif LCDFN(scroll_info).lines++; } @@ -399,6 +405,9 @@ void LCDFN(scroll_fn)(void) int index; int xpos, ypos; struct viewport* old_vp = current_vp; +#if HAS_BACKDROP + FBFN(data*) old_backdrop = LCDFN(get_backdrop)(); +#endif for ( index = 0; index < LCDFN(scroll_info).lines; index++ ) { s = &LCDFN(scroll_info).scroll[index]; @@ -408,7 +417,9 @@ void LCDFN(scroll_fn)(void) continue; LCDFN(set_viewport)(s->vp); - +#if HAS_BACKDROP + LCDFN(set_backdrop)((FBFN(data*))s->backdrop); +#endif if (s->backward) s->offset -= LCDFN(scroll_info).step; else @@ -442,5 +453,8 @@ void LCDFN(scroll_fn)(void) LCDFN(update_viewport_rect)(xpos, ypos, current_vp->width - xpos, pf->height); } +#if HAS_BACKDROP + LCDFN(set_backdrop)(old_backdrop); +#endif LCDFN(set_viewport)(old_vp); } diff --git a/firmware/export/scroll_engine.h b/firmware/export/scroll_engine.h index 0fcb06af81..838926af57 100644 --- a/firmware/export/scroll_engine.h +++ b/firmware/export/scroll_engine.h @@ -55,6 +55,9 @@ struct scrollinfo int offset; int startx; #ifdef HAVE_LCD_BITMAP +#if LCD_DEPTH > 1 || (defined(HAVE_LCD_REMOTE) && LCD_REMOTE_DEPTH > 1) + char *backdrop; +#endif int width; /* length of line in pixels */ int style; /* line style */ #endif/* HAVE_LCD_BITMAP */ -- cgit v1.2.3