From 97dcb445e4f7761ccfa7f9ae16addb3189cd975f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 31 May 2002 12:32:00 +0000 Subject: 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 --- apps/main_menu.c | 27 ++++++++++++++++++--------- 1 file 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; } -- cgit v1.2.3