summaryrefslogtreecommitdiff
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
parent9ea1f1a3a5076ebfe038c268d4eba34d8986d627 (diff)
downloadrockbox-97dcb445e4f7761ccfa7f9ae16addb3189cd975f.tar.gz
rockbox-97dcb445e4f7761ccfa7f9ae16addb3189cd975f.zip
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
-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 @@
30 30
31#ifdef HAVE_LCD_BITMAP 31#ifdef HAVE_LCD_BITMAP
32#include "bmp.h" 32#include "bmp.h"
33#include "icons.h"
33#include "screensaver.h" 34#include "screensaver.h"
34extern void tetris(void); 35extern void tetris(void);
35#endif 36#endif
@@ -43,20 +44,28 @@ int show_logo( void )
43 int failure; 44 int failure;
44 int height, width, font_h, font_w; 45 int height, width, font_h, font_w;
45 46
47 int i;
48 int eline;
49
46 failure = read_bmp_file("/rockbox112.bmp", &width, &height, buffer); 50 failure = read_bmp_file("/rockbox112.bmp", &width, &height, buffer);
47 51
48 debugf("read_bmp_file() returned %d, width %d height %d\n", 52 debugf("read_bmp_file() returned %d, width %d height %d\n",
49 failure, width, height); 53 failure, width, height);
50 54
51 if (failure) { 55 lcd_clear_display();
52 debugf("Unable to find \"/rockbox112.bmp\"\n");
53 return -1;
54 } else {
55 56
56 int i; 57 if (failure) {
57 int eline; 58 unsigned char *ptr=rockbox112x37;
59 for(i=0; i < 37; i+=8) {
60 /* the bitmap function doesn't work with full-height bitmaps
61 so we "stripe" the logo output */
62 lcd_bitmap(ptr, 0, 10+i, 112, (37-i)>8?8:37-i, false);
63 ptr += 112;
64 }
65 height = 37;
58 66
59 lcd_clear_display(); 67 }
68 else {
60 69
61 for(i=0, eline=0; i < height; i+=8, eline++) { 70 for(i=0, eline=0; i < height; i+=8, eline++) {
62 /* the bitmap function doesn't work with full-height bitmaps 71 /* the bitmap function doesn't work with full-height bitmaps
@@ -70,6 +79,8 @@ int show_logo( void )
70 lcd_getfontsize(0, &font_w, &font_h); 79 lcd_getfontsize(0, &font_w, &font_h);
71 lcd_putsxy((LCD_WIDTH/2) - ((strlen(version)*font_w)/2), 80 lcd_putsxy((LCD_WIDTH/2) - ((strlen(version)*font_w)/2),
72 height+10+font_h, version, 0); 81 height+10+font_h, version, 0);
82 lcd_update();
83
73#else 84#else
74 char *rockbox = "ROCKbox!"; 85 char *rockbox = "ROCKbox!";
75 lcd_clear_display(); 86 lcd_clear_display();
@@ -80,8 +91,6 @@ int show_logo( void )
80 lcd_puts(0, 1, appsversion); 91 lcd_puts(0, 1, appsversion);
81#endif 92#endif
82 93
83 lcd_update();
84
85 return 0; 94 return 0;
86} 95}
87 96