summaryrefslogtreecommitdiff
path: root/apps/main_menu.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-05-31 12:32:00 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-05-31 12:32:00 +0000
commit97dcb445e4f7761ccfa7f9ae16addb3189cd975f (patch)
treefd7c077604c7f04c14b5eb23cb148b3493165dc8 /apps/main_menu.c
parent9ea1f1a3a5076ebfe038c268d4eba34d8986d627 (diff)
now uses the internal image/bitmap/icon called rockbox112x37 if there's no
available bitmap using the appropriate file name! git-svn-id: svn://svn.rockbox.org/rockbox/trunk@857 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/main_menu.c')
-rw-r--r--apps/main_menu.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/apps/main_menu.c b/apps/main_menu.c
index 5689d54e4d..1b5a4afff2 100644
--- a/apps/main_menu.c
+++ b/apps/main_menu.c
@@ -30,6 +30,7 @@
#ifdef HAVE_LCD_BITMAP
#include "bmp.h"
+#include "icons.h"
#include "screensaver.h"
extern void tetris(void);
#endif
@@ -43,20 +44,28 @@ int show_logo( void )
int failure;
int height, width, font_h, font_w;
+ int i;
+ int eline;
+
failure = read_bmp_file("/rockbox112.bmp", &width, &height, buffer);
debugf("read_bmp_file() returned %d, width %d height %d\n",
failure, width, height);
- if (failure) {
- debugf("Unable to find \"/rockbox112.bmp\"\n");
- return -1;
- } else {
+ lcd_clear_display();
- int i;
- int eline;
+ if (failure) {
+ unsigned char *ptr=rockbox112x37;
+ for(i=0; i < 37; i+=8) {
+ /* the bitmap function doesn't work with full-height bitmaps
+ so we "stripe" the logo output */
+ lcd_bitmap(ptr, 0, 10+i, 112, (37-i)>8?8:37-i, false);
+ ptr += 112;
+ }
+ height = 37;
- lcd_clear_display();
+ }
+ else {
for(i=0, eline=0; i < height; i+=8, eline++) {
/* the bitmap function doesn't work with full-height bitmaps
@@ -70,6 +79,8 @@ int show_logo( void )
lcd_getfontsize(0, &font_w, &font_h);
lcd_putsxy((LCD_WIDTH/2) - ((strlen(version)*font_w)/2),
height+10+font_h, version, 0);
+ lcd_update();
+
#else
char *rockbox = "ROCKbox!";
lcd_clear_display();
@@ -80,8 +91,6 @@ int show_logo( void )
lcd_puts(0, 1, appsversion);
#endif
- lcd_update();
-
return 0;
}