diff options
author | Robert Hak <adiamas@rockbox.org> | 2002-05-31 07:04:13 +0000 |
---|---|---|
committer | Robert Hak <adiamas@rockbox.org> | 2002-05-31 07:04:13 +0000 |
commit | 6ae63b78e29610bd5e80bde8317e33e81e48a977 (patch) | |
tree | 1da083005670cee9ebf29c8163e60e423bd38cf1 /apps/main_menu.c | |
parent | b66890fc52e0d944d8f3b99e9f5618a4c10bad90 (diff) | |
download | rockbox-6ae63b78e29610bd5e80bde8317e33e81e48a977.tar.gz rockbox-6ae63b78e29610bd5e80bde8317e33e81e48a977.zip |
merged the splash screen and version info
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@838 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/main_menu.c')
-rw-r--r-- | apps/main_menu.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/apps/main_menu.c b/apps/main_menu.c index e98aa89233..961cd0be4f 100644 --- a/apps/main_menu.c +++ b/apps/main_menu.c | |||
@@ -34,14 +34,14 @@ | |||
34 | extern void tetris(void); | 34 | extern void tetris(void); |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | int show_logo(void) | 37 | int show_logo( void ) |
38 | { | 38 | { |
39 | #ifdef HAVE_LCD_BITMAP | 39 | #ifdef HAVE_LCD_BITMAP |
40 | unsigned char buffer[112 * 8]; | 40 | unsigned char buffer[112 * 8]; |
41 | char version[32]; | ||
41 | 42 | ||
42 | int failure; | 43 | int failure; |
43 | int width=0; | 44 | int height, width, font_h, font_w; |
44 | int height=0; | ||
45 | 45 | ||
46 | failure = read_bmp_file("/rockbox112.bmp", &width, &height, buffer); | 46 | failure = read_bmp_file("/rockbox112.bmp", &width, &height, buffer); |
47 | 47 | ||
@@ -58,20 +58,31 @@ int show_logo(void) | |||
58 | 58 | ||
59 | lcd_clear_display(); | 59 | lcd_clear_display(); |
60 | 60 | ||
61 | for(i=0, eline=0; i< height; i+=8, eline++) { | 61 | for(i=0, eline=0; i < height; i+=8, eline++) { |
62 | /* the bitmap function doesn't work with full-height bitmaps | 62 | /* the bitmap function doesn't work with full-height bitmaps |
63 | so we "stripe" the logo output */ | 63 | so we "stripe" the logo output */ |
64 | lcd_bitmap(&buffer[eline*width], 0, 10+i, width, | 64 | lcd_bitmap(&buffer[eline*width], 0, 10+i, width, |
65 | (height-i)>8?8:height-i, false); | 65 | (height-i)>8?8:height-i, false); |
66 | } | 66 | } |
67 | } | 67 | } |
68 | lcd_update(); | ||
69 | 68 | ||
69 | snprintf(version, sizeof(version), "Ver. %s", appsversion); | ||
70 | lcd_getfontsize(0, &font_w, &font_h); | ||
71 | |||
72 | /* lcd_puts needs line height in Chars on screen not pixels */ | ||
73 | width = ((LCD_WIDTH/font_w) - strlen(version)) / 2; | ||
74 | height = ((height+10)/font_h)+1; | ||
75 | |||
76 | lcd_puts(width, height, version); | ||
70 | #else | 77 | #else |
71 | char *rockbox = "ROCKbox!"; | 78 | char *rockbox = "ROCKbox!"; |
72 | lcd_puts(0, 0, rockbox); | 79 | lcd_puts(0, 0, rockbox); |
80 | lcd_puts(0, 1, appsversion); | ||
73 | #endif | 81 | #endif |
74 | 82 | ||
83 | lcd_update(); | ||
84 | |||
85 | |||
75 | return 0; | 86 | return 0; |
76 | } | 87 | } |
77 | 88 | ||
@@ -80,14 +91,6 @@ void show_splash(void) | |||
80 | if (show_logo() != 0) | 91 | if (show_logo() != 0) |
81 | return; | 92 | return; |
82 | 93 | ||
83 | sleep(HZ*2); | ||
84 | } | ||
85 | |||
86 | void version(void) | ||
87 | { | ||
88 | lcd_clear_display(); | ||
89 | lcd_puts(0,0,appsversion); | ||
90 | lcd_update(); | ||
91 | button_get(true); | 94 | button_get(true); |
92 | } | 95 | } |
93 | 96 | ||
@@ -95,7 +98,7 @@ void main_menu(void) | |||
95 | { | 98 | { |
96 | int m; | 99 | int m; |
97 | enum { | 100 | enum { |
98 | Tetris, Screen_Saver, Splash, Credits, Sound, Version | 101 | Tetris, Screen_Saver, Splash, Credits, Sound |
99 | }; | 102 | }; |
100 | 103 | ||
101 | /* main menu */ | 104 | /* main menu */ |
@@ -107,10 +110,12 @@ void main_menu(void) | |||
107 | #endif | 110 | #endif |
108 | { Splash, "Splash", show_splash }, | 111 | { Splash, "Splash", show_splash }, |
109 | { Credits, "Credits", show_credits }, | 112 | { Credits, "Credits", show_credits }, |
110 | { Version, "Version", version } | ||
111 | }; | 113 | }; |
112 | 114 | ||
113 | m=menu_init( items, sizeof items / sizeof(struct menu_items) ); | 115 | m=menu_init( items, sizeof items / sizeof(struct menu_items) ); |
114 | menu_run(m); | 116 | menu_run(m); |
115 | menu_exit(m); | 117 | menu_exit(m); |
116 | } | 118 | } |
119 | |||
120 | |||
121 | |||