summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-02-03 07:03:48 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-02-03 07:03:48 +0000
commit0a16a99a696545fec80643cee6aae5d1b65869d7 (patch)
treee1d4de3259ebb61507ae99d02ccdd3d3d9906c7b /firmware
parenteb30ca2a1e78aa2304365af3890f435e5dd57ad8 (diff)
downloadrockbox-0a16a99a696545fec80643cee6aae5d1b65869d7.tar.gz
rockbox-0a16a99a696545fec80643cee6aae5d1b65869d7.zip
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
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/lcd-bitmap-common.c18
-rw-r--r--firmware/export/scroll_engine.h3
2 files changed, 19 insertions, 2 deletions
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 @@
39#define MAIN_LCD 39#define MAIN_LCD
40#endif 40#endif
41 41
42#define HAS_BACKDROP ((defined(MAIN_LCD) && LCD_DEPTH > 1) \
43 || (!defined(MAIN_LCD) && LCD_REMOTE_DEPTH > 1))
44
42#if defined(MAIN_LCD) && defined(HAVE_LCD_COLOR) 45#if defined(MAIN_LCD) && defined(HAVE_LCD_COLOR)
43/* Fill a rectangle with a gradient */ 46/* Fill a rectangle with a gradient */
44static void lcd_gradient_rect(int x1, int x2, int y, unsigned h, 47static 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,
370 s->len = utf8length(string); 373 s->len = utf8length(string);
371 s->offset = offset; 374 s->offset = offset;
372 s->startx = x * LCDFN(getstringsize)(" ", NULL, NULL); 375 s->startx = x * LCDFN(getstringsize)(" ", NULL, NULL);
373 s->backward = false; 376 s->backward = false;
377#if HAS_BACKDROP
378 s->backdrop = (char*)LCDFN(get_backdrop());
379#endif
374 380
375 LCDFN(scroll_info).lines++; 381 LCDFN(scroll_info).lines++;
376} 382}
@@ -399,6 +405,9 @@ void LCDFN(scroll_fn)(void)
399 int index; 405 int index;
400 int xpos, ypos; 406 int xpos, ypos;
401 struct viewport* old_vp = current_vp; 407 struct viewport* old_vp = current_vp;
408#if HAS_BACKDROP
409 FBFN(data*) old_backdrop = LCDFN(get_backdrop)();
410#endif
402 411
403 for ( index = 0; index < LCDFN(scroll_info).lines; index++ ) { 412 for ( index = 0; index < LCDFN(scroll_info).lines; index++ ) {
404 s = &LCDFN(scroll_info).scroll[index]; 413 s = &LCDFN(scroll_info).scroll[index];
@@ -408,7 +417,9 @@ void LCDFN(scroll_fn)(void)
408 continue; 417 continue;
409 418
410 LCDFN(set_viewport)(s->vp); 419 LCDFN(set_viewport)(s->vp);
411 420#if HAS_BACKDROP
421 LCDFN(set_backdrop)((FBFN(data*))s->backdrop);
422#endif
412 if (s->backward) 423 if (s->backward)
413 s->offset -= LCDFN(scroll_info).step; 424 s->offset -= LCDFN(scroll_info).step;
414 else 425 else
@@ -442,5 +453,8 @@ void LCDFN(scroll_fn)(void)
442 LCDFN(update_viewport_rect)(xpos, ypos, current_vp->width - xpos, 453 LCDFN(update_viewport_rect)(xpos, ypos, current_vp->width - xpos,
443 pf->height); 454 pf->height);
444 } 455 }
456#if HAS_BACKDROP
457 LCDFN(set_backdrop)(old_backdrop);
458#endif
445 LCDFN(set_viewport)(old_vp); 459 LCDFN(set_viewport)(old_vp);
446} 460}
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
55 int offset; 55 int offset;
56 int startx; 56 int startx;
57#ifdef HAVE_LCD_BITMAP 57#ifdef HAVE_LCD_BITMAP
58#if LCD_DEPTH > 1 || (defined(HAVE_LCD_REMOTE) && LCD_REMOTE_DEPTH > 1)
59 char *backdrop;
60#endif
58 int width; /* length of line in pixels */ 61 int width; /* length of line in pixels */
59 int style; /* line style */ 62 int style; /* line style */
60#endif/* HAVE_LCD_BITMAP */ 63#endif/* HAVE_LCD_BITMAP */