diff options
| author | Peter D'Hoye <peter.dhoye@gmail.com> | 2008-06-28 20:45:21 +0000 |
|---|---|---|
| committer | Peter D'Hoye <peter.dhoye@gmail.com> | 2008-06-28 20:45:21 +0000 |
| commit | 205f3df7816a1eea9c812ea285d74a4f8ecfad2a (patch) | |
| tree | 356be7b807a4407b7e243ec57da4d5068fe09ab1 /apps/gui/splash.c | |
| parent | 3d240f1e2a34e616c2aba22b58ea78de7f277127 (diff) | |
| download | rockbox-205f3df7816a1eea9c812ea285d74a4f8ecfad2a.zip rockbox-205f3df7816a1eea9c812ea285d74a4f8ecfad2a.tar.gz rockbox-205f3df7816a1eea9c812ea285d74a4f8ecfad2a.tar.bz2 rockbox-205f3df7816a1eea9c812ea285d74a4f8ecfad2a.tar.xz | |
Remove a viewport ambiguity by changing the screens width/heigth members into lcdwidth/lcdheight. Normal usercode should always use getwidth()/getheigth() as that returns the viewport width/height. Fixes issues that would have appeared in many places when introducing viewports with sizes != lcd sizes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17857 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/splash.c')
| -rw-r--r-- | apps/gui/splash.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/gui/splash.c b/apps/gui/splash.c index 0405c05..b4b451e 100644 --- a/apps/gui/splash.c +++ b/apps/gui/splash.c @@ -91,14 +91,14 @@ static void splash(struct screen * screen, const char *fmt, va_list ap) #endif if (lastbreak) { - if (x + (next - lastbreak) * space_w + w > screen->width) + if (x + (next - lastbreak) * space_w + w > screen->lcdwidth) { /* too wide, wrap */ widths[line] = x; #ifdef HAVE_LCD_BITMAP if (x > maxw) maxw = x; #endif - if ((y + h > screen->height) || (line >= (MAXLINES-1))) + if ((y + h > screen->lcdheight) || (line >= (MAXLINES-1))) break; /* screen full or out of lines */ x = 0; y += h; @@ -132,8 +132,8 @@ static void splash(struct screen * screen, const char *fmt, va_list ap) #ifdef HAVE_LCD_BITMAP /* If we center the display, then just clear the box we need and put a nice little frame and put the text in there! */ - y = (screen->height - y) / 2; /* height => y start position */ - x = (screen->width - maxw) / 2 - 2; + y = (screen->lcdheight - y) / 2; /* height => y start position */ + x = (screen->lcdwidth - maxw) / 2 - 2; #if LCD_DEPTH > 1 if (screen->depth > 1) @@ -147,7 +147,7 @@ static void splash(struct screen * screen, const char *fmt, va_list ap) #endif 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->lcdheight-y*2+4); #if LCD_DEPTH > 1 if (screen->depth > 1) @@ -156,7 +156,7 @@ static void splash(struct screen * screen, const char *fmt, va_list ap) #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->lcdheight-y*2+4); #else /* HAVE_LCD_CHARCELLS */ y = 0; /* vertical centering on 2 lines would be silly */ x = 0; @@ -167,7 +167,7 @@ static void splash(struct screen * screen, const char *fmt, va_list ap) for (i = 0; i <= line; i++) { - x = MAX((screen->width - widths[i]) / 2, 0); + x = MAX((screen->lcdwidth - widths[i]) / 2, 0); #ifdef HAVE_LCD_BITMAP screen->putsxy(x, y, lines[i]); |