diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-06-28 23:15:47 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-06-28 23:15:47 +0000 |
commit | 7e11acbce9b9a63c28ded055d02301175391e027 (patch) | |
tree | ea8d30e7281e8d720d6dc8ea51804e1749282697 /apps/screens.c | |
parent | c2bf5dfe12978b44d5d890a37f256c8d9f510660 (diff) | |
download | rockbox-7e11acbce9b9a63c28ded055d02301175391e027.tar.gz rockbox-7e11acbce9b9a63c28ded055d02301175391e027.zip |
Second part of graphics api rework. Bitmap drawing and text output converted; some code cleanup and more optimisations.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6906 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/screens.c')
-rw-r--r-- | apps/screens.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/apps/screens.c b/apps/screens.c index 6849384cda..04a32813d1 100644 --- a/apps/screens.c +++ b/apps/screens.c | |||
@@ -94,7 +94,9 @@ void usb_display_info(void) | |||
94 | 94 | ||
95 | #ifdef HAVE_LCD_BITMAP | 95 | #ifdef HAVE_LCD_BITMAP |
96 | /* Center bitmap on screen */ | 96 | /* Center bitmap on screen */ |
97 | lcd_bitmap(usb_logo, LCD_WIDTH/2-BMPWIDTH_usb_logo/2, LCD_HEIGHT/2-BMPHEIGHT_usb_logo/2, BMPWIDTH_usb_logo, BMPHEIGHT_usb_logo, false); | 97 | lcd_bitmap(usb_logo, LCD_WIDTH/2-BMPWIDTH_usb_logo/2, |
98 | LCD_HEIGHT/2-BMPHEIGHT_usb_logo/2, BMPWIDTH_usb_logo, | ||
99 | BMPHEIGHT_usb_logo); | ||
98 | status_draw(true); | 100 | status_draw(true); |
99 | lcd_update(); | 101 | lcd_update(); |
100 | #else | 102 | #else |
@@ -231,14 +233,16 @@ void charging_display_info(bool animate) | |||
231 | if (!animate) | 233 | if (!animate) |
232 | { /* draw the outline */ | 234 | { /* draw the outline */ |
233 | /* middle part */ | 235 | /* middle part */ |
234 | lcd_bitmap(charging_logo, pox_x, pox_y + 8, sizeof(charging_logo), 8, true); | 236 | lcd_bitmap(charging_logo, pox_x, pox_y + 8, sizeof(charging_logo), 8); |
237 | lcd_set_drawmode(DRMODE_FG); | ||
235 | /* upper line */ | 238 | /* upper line */ |
236 | charging_logo[0] = charging_logo[1] = 0x00; | 239 | charging_logo[0] = charging_logo[1] = 0x00; |
237 | memset(charging_logo+2, 0x80, 34); | 240 | memset(charging_logo+2, 0x80, 34); |
238 | lcd_bitmap(charging_logo, pox_x, pox_y, sizeof(charging_logo), 8, false); | 241 | lcd_bitmap(charging_logo, pox_x, pox_y, sizeof(charging_logo), 8); |
239 | /* lower line */ | 242 | /* lower line */ |
240 | memset(charging_logo+2, 0x01, 34); | 243 | memset(charging_logo+2, 0x01, 34); |
241 | lcd_bitmap(charging_logo, pox_x, pox_y + 16, sizeof(charging_logo), 8, false); | 244 | lcd_bitmap(charging_logo, pox_x, pox_y + 16, sizeof(charging_logo), 8); |
245 | lcd_set_drawmode(DRMODE_SOLID); | ||
242 | } | 246 | } |
243 | else | 247 | else |
244 | { /* animate the middle part */ | 248 | { /* animate the middle part */ |
@@ -253,7 +257,7 @@ void charging_display_info(bool animate) | |||
253 | charging_logo[i] = 0x01 << bitpos; | 257 | charging_logo[i] = 0x01 << bitpos; |
254 | } | 258 | } |
255 | } | 259 | } |
256 | lcd_bitmap(charging_logo, pox_x, pox_y + 8, sizeof(charging_logo), 8, true); | 260 | lcd_bitmap(charging_logo, pox_x, pox_y + 8, sizeof(charging_logo), 8); |
257 | phase++; | 261 | phase++; |
258 | } | 262 | } |
259 | lcd_update(); | 263 | lcd_update(); |
@@ -411,7 +415,7 @@ int pitch_screen(void) | |||
411 | lcd_getstringsize(ptr,&w,&h); | 415 | lcd_getstringsize(ptr,&w,&h); |
412 | lcd_putsxy((LCD_WIDTH-w)/2, 0, ptr); | 416 | lcd_putsxy((LCD_WIDTH-w)/2, 0, ptr); |
413 | lcd_bitmap(bitmap_icons_7x8[Icon_UpArrow], | 417 | lcd_bitmap(bitmap_icons_7x8[Icon_UpArrow], |
414 | LCD_WIDTH/2 - 3, h*2, 7, 8, true); | 418 | LCD_WIDTH/2 - 3, h*2, 7, 8); |
415 | 419 | ||
416 | snprintf(buf, sizeof buf, "%d.%d%%", pitch / 10, pitch % 10 ); | 420 | snprintf(buf, sizeof buf, "%d.%d%%", pitch / 10, pitch % 10 ); |
417 | lcd_getstringsize(buf,&w,&h); | 421 | lcd_getstringsize(buf,&w,&h); |
@@ -421,13 +425,13 @@ int pitch_screen(void) | |||
421 | lcd_getstringsize(ptr,&w,&h); | 425 | lcd_getstringsize(ptr,&w,&h); |
422 | lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h, ptr); | 426 | lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h, ptr); |
423 | lcd_bitmap(bitmap_icons_7x8[Icon_DownArrow], | 427 | lcd_bitmap(bitmap_icons_7x8[Icon_DownArrow], |
424 | LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8, true); | 428 | LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8); |
425 | 429 | ||
426 | ptr = str(LANG_PAUSE); | 430 | ptr = str(LANG_PAUSE); |
427 | lcd_getstringsize(ptr,&w,&h); | 431 | lcd_getstringsize(ptr,&w,&h); |
428 | lcd_putsxy((LCD_WIDTH-(w/2))/2, LCD_HEIGHT/2 - h/2, ptr); | 432 | lcd_putsxy((LCD_WIDTH-(w/2))/2, LCD_HEIGHT/2 - h/2, ptr); |
429 | lcd_bitmap(bitmap_icons_7x8[Icon_Pause], | 433 | lcd_bitmap(bitmap_icons_7x8[Icon_Pause], |
430 | (LCD_WIDTH-(w/2))/2-10, LCD_HEIGHT/2 - h/2, 7, 8, true); | 434 | (LCD_WIDTH-(w/2))/2-10, LCD_HEIGHT/2 - h/2, 7, 8); |
431 | 435 | ||
432 | lcd_update(); | 436 | lcd_update(); |
433 | } | 437 | } |
@@ -632,11 +636,11 @@ bool quick_screen(int context, int button) | |||
632 | } | 636 | } |
633 | 637 | ||
634 | lcd_bitmap(bitmap_icons_7x8[Icon_FastBackward], | 638 | lcd_bitmap(bitmap_icons_7x8[Icon_FastBackward], |
635 | LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8, true); | 639 | LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8); |
636 | lcd_bitmap(bitmap_icons_7x8[Icon_DownArrow], | 640 | lcd_bitmap(bitmap_icons_7x8[Icon_DownArrow], |
637 | LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8, true); | 641 | LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8); |
638 | lcd_bitmap(bitmap_icons_7x8[Icon_FastForward], | 642 | lcd_bitmap(bitmap_icons_7x8[Icon_FastForward], |
639 | LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8, true); | 643 | LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8); |
640 | 644 | ||
641 | lcd_update(); | 645 | lcd_update(); |
642 | key = button_get(true); | 646 | key = button_get(true); |