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
This commit is contained in:
Jonathan Gordon 2010-02-03 07:03:48 +00:00
parent eb30ca2a1e
commit 0a16a99a69
3 changed files with 20 additions and 3 deletions

View file

@ -1007,7 +1007,7 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode)
#endif
#if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)
display->backdrop_show(data->backdrop);
display->backdrop_show(data->backdrop);
#endif

View file

@ -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,
@ -371,6 +374,9 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
s->offset = offset;
s->startx = x * LCDFN(getstringsize)(" ", NULL, NULL);
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);
}

View file

@ -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 */