diff options
author | Robert Hak <adiamas@rockbox.org> | 2002-06-24 08:51:28 +0000 |
---|---|---|
committer | Robert Hak <adiamas@rockbox.org> | 2002-06-24 08:51:28 +0000 |
commit | 3827d4764b306f70a955dd39c9e96dd2c29debc8 (patch) | |
tree | afe3ddfe613dad2189294346b55abf99d3e1c315 | |
parent | bb5579e83824273cee9bb30fc220b62890937bce (diff) | |
download | rockbox-3827d4764b306f70a955dd39c9e96dd2c29debc8.tar.gz rockbox-3827d4764b306f70a955dd39c9e96dd2c29debc8.zip |
games and screensavers are now in submenus
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1142 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/games_menu.c | 52 | ||||
-rw-r--r-- | apps/games_menu.h | 24 | ||||
-rw-r--r-- | apps/main_menu.c | 20 | ||||
-rw-r--r-- | apps/screensavers_menu.c | 52 | ||||
-rw-r--r-- | apps/screensavers_menu.h | 25 |
5 files changed, 161 insertions, 12 deletions
diff --git a/apps/games_menu.c b/apps/games_menu.c new file mode 100644 index 0000000000..caee2b464c --- /dev/null +++ b/apps/games_menu.c | |||
@@ -0,0 +1,52 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 Robert Hak | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifdef HAVE_LCD_BITMAP | ||
20 | |||
21 | #include "config.h" | ||
22 | #include <stdio.h> | ||
23 | #include <stdbool.h> | ||
24 | #include "lcd.h" | ||
25 | #include "menu.h" | ||
26 | #include "games_menu.h" | ||
27 | #include "button.h" | ||
28 | #include "kernel.h" | ||
29 | #include "sprintf.h" | ||
30 | |||
31 | #include "sokoban.h" | ||
32 | extern void tetris(void); | ||
33 | |||
34 | enum { Tetris, Sokoban, numgames }; | ||
35 | |||
36 | void games_menu(void) | ||
37 | { | ||
38 | int m; | ||
39 | |||
40 | struct menu_items items[] = { | ||
41 | { Tetris, "Tetris", tetris }, | ||
42 | { Sokoban, "Sokoban", sokoban }, | ||
43 | }; | ||
44 | |||
45 | m=menu_init( items, sizeof items / sizeof(struct menu_items) ); | ||
46 | menu_run(m); | ||
47 | menu_exit(m); | ||
48 | } | ||
49 | |||
50 | #endif | ||
51 | |||
52 | |||
diff --git a/apps/games_menu.h b/apps/games_menu.h new file mode 100644 index 0000000000..861c27bfac --- /dev/null +++ b/apps/games_menu.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 Robert Hak | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef _GAMES_MENU_H | ||
20 | #define _GAMES_MENU_H | ||
21 | |||
22 | void games_menu(void); | ||
23 | |||
24 | #endif | ||
diff --git a/apps/main_menu.c b/apps/main_menu.c index fb286eca98..4b150f0b08 100644 --- a/apps/main_menu.c +++ b/apps/main_menu.c | |||
@@ -32,12 +32,10 @@ | |||
32 | #include "playlist.h" | 32 | #include "playlist.h" |
33 | 33 | ||
34 | #ifdef HAVE_LCD_BITMAP | 34 | #ifdef HAVE_LCD_BITMAP |
35 | #include "games_menu.h" | ||
36 | #include "screensavers_menu.h" | ||
35 | #include "bmp.h" | 37 | #include "bmp.h" |
36 | #include "icons.h" | 38 | #include "icons.h" |
37 | #include "boxes.h" | ||
38 | #include "sokoban.h" | ||
39 | extern void tetris(void); | ||
40 | extern void bounce(void); | ||
41 | #endif | 39 | #endif |
42 | 40 | ||
43 | int show_logo( void ) | 41 | int show_logo( void ) |
@@ -198,19 +196,17 @@ void main_menu(void) | |||
198 | { | 196 | { |
199 | int m; | 197 | int m; |
200 | enum { | 198 | enum { |
201 | Tetris, Boxes, Bounce, Sokoban, Version, Sound, Scroll, Shuffle | 199 | Games, Screensavers, Version, Sound, Scroll, Shuffle |
202 | }; | 200 | }; |
203 | 201 | ||
204 | /* main menu */ | 202 | /* main menu */ |
205 | struct menu_items items[] = { | 203 | struct menu_items items[] = { |
206 | { Shuffle, "Shuffle", shuffle }, | 204 | { Shuffle, "Shuffle", shuffle }, |
207 | { Sound, "Sound", sound_menu }, | 205 | { Sound, "Sound", sound_menu }, |
208 | { Scroll, "Scroll speed", scroll_speed }, | 206 | { Scroll, "Scroll speed", scroll_speed }, |
209 | #ifdef HAVE_LCD_BITMAP | 207 | #ifdef HAVE_LCD_BITMAP |
210 | { Tetris, "Tetris", tetris }, | 208 | { Games, "Games", games_menu }, |
211 | { Boxes, "Boxes", boxes }, | 209 | { Screensavers, "Screensavers", screensavers_menu }, |
212 | { Bounce, "Bounce", bounce }, | ||
213 | { Sokoban, "Sokoban", sokoban }, | ||
214 | #endif | 210 | #endif |
215 | { Version, "Version", show_credits }, | 211 | { Version, "Version", show_credits }, |
216 | }; | 212 | }; |
diff --git a/apps/screensavers_menu.c b/apps/screensavers_menu.c new file mode 100644 index 0000000000..e7dc031e12 --- /dev/null +++ b/apps/screensavers_menu.c | |||
@@ -0,0 +1,52 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 Robert Hak | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifdef HAVE_LCD_BITMAP | ||
20 | |||
21 | #include "config.h" | ||
22 | #include <stdio.h> | ||
23 | #include <stdbool.h> | ||
24 | #include "lcd.h" | ||
25 | #include "menu.h" | ||
26 | #include "screensavers_menu.h" | ||
27 | #include "button.h" | ||
28 | #include "kernel.h" | ||
29 | #include "sprintf.h" | ||
30 | |||
31 | #include "boxes.h" | ||
32 | extern void bounce(void); | ||
33 | |||
34 | enum { Boxes, Bounce, numsavers }; | ||
35 | |||
36 | void screensavers_menu(void) | ||
37 | { | ||
38 | int m; | ||
39 | |||
40 | struct menu_items items[] = { | ||
41 | { Boxes, "Boxes", boxes }, | ||
42 | { Bounce, "Bounce", bounce }, | ||
43 | }; | ||
44 | |||
45 | m=menu_init( items, sizeof items / sizeof(struct menu_items) ); | ||
46 | menu_run(m); | ||
47 | menu_exit(m); | ||
48 | } | ||
49 | |||
50 | #endif | ||
51 | |||
52 | |||
diff --git a/apps/screensavers_menu.h b/apps/screensavers_menu.h new file mode 100644 index 0000000000..42a40cf826 --- /dev/null +++ b/apps/screensavers_menu.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 Robert Hak | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef _SCREENSAVERS_MENU_H | ||
20 | #define _SCREENSAVERS_MENU_H | ||
21 | |||
22 | void screensavers_menu(void); | ||
23 | |||
24 | #endif | ||
25 | |||