1
0
Fork 0
forked from len0rd/rockbox

More visual annoyance fixes. Backdrops no longer show though on centered splash screens.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11213 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2006-10-13 11:53:57 +00:00
parent 3a8ad7fe7e
commit e627e35439

View file

@ -39,7 +39,7 @@
#endif #endif
static void splash(struct screen * screen, bool center, static void splash(struct screen * screen, bool center,
const char *fmt, va_list ap) const char *fmt, va_list ap)
{ {
char splash_buf[MAXBUFFER]; char splash_buf[MAXBUFFER];
@ -56,7 +56,6 @@ static void splash(struct screen * screen, bool center,
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
int maxw = 0; int maxw = 0;
#if LCD_DEPTH > 1 #if LCD_DEPTH > 1
unsigned prevbg = 0;
unsigned prevfg = 0; unsigned prevfg = 0;
#endif #endif
@ -64,7 +63,7 @@ static void splash(struct screen * screen, bool center,
#else /* HAVE_LCD_CHARCELLS */ #else /* HAVE_LCD_CHARCELLS */
space_w = h = 1; space_w = h = 1;
screen->double_height (false); screen->double_height (false);
#endif #endif
y = h; y = h;
@ -76,7 +75,7 @@ static void splash(struct screen * screen, bool center,
next = strtok_r(splash_buf, " ", &store); next = strtok_r(splash_buf, " ", &store);
if (!next) if (!next)
return; /* nothing to display */ return; /* nothing to display */
lines[0] = next; lines[0] = next;
while (true) while (true)
{ {
@ -132,18 +131,27 @@ static void splash(struct screen * screen, bool center,
{ {
y = (screen->height - y) / 2; /* height => y start position */ y = (screen->height - y) / 2; /* height => y start position */
x = (screen->width - maxw) / 2 - 2; x = (screen->width - maxw) / 2 - 2;
#if LCD_DEPTH > 1 #if LCD_DEPTH > 1
if (screen->depth > 1) if (screen->depth > 1)
{ {
prevbg = screen->get_background();
prevfg = screen->get_foreground(); prevfg = screen->get_foreground();
screen->set_background(LCD_LIGHTGRAY); screen->set_drawmode(DRMODE_FG);
screen->set_foreground(LCD_BLACK); screen->set_foreground(LCD_LIGHTGRAY);
} }
else
#endif #endif
screen->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); screen->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
screen->fillrect(x, y-2, maxw+4, screen->height-y*2+4); screen->fillrect(x, y-2, maxw+4, screen->height-y*2+4);
screen->set_drawmode(DRMODE_SOLID);
#if LCD_DEPTH > 1
if (screen->depth > 1)
screen->set_foreground(LCD_BLACK);
else
#endif
screen->set_drawmode(DRMODE_SOLID);
screen->drawrect(x, y-2, maxw+4, screen->height-y*2+4); screen->drawrect(x, y-2, maxw+4, screen->height-y*2+4);
} }
else else
@ -174,10 +182,10 @@ static void splash(struct screen * screen, bool center,
} }
#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH > 1) #if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH > 1)
if (center && (screen->depth > 1)) if (center && screen->depth > 1)
{ {
screen->set_background(prevbg);
screen->set_foreground(prevfg); screen->set_foreground(prevfg);
screen->set_drawmode(DRMODE_SOLID);
} }
#endif #endif
#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR) #if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)