games and screensavers are now in submenus

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1142 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Hak 2002-06-24 08:51:28 +00:00
parent bb5579e838
commit 3827d4764b
5 changed files with 161 additions and 12 deletions

52
apps/games_menu.c Normal file
View file

@ -0,0 +1,52 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2002 Robert Hak
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifdef HAVE_LCD_BITMAP
#include "config.h"
#include <stdio.h>
#include <stdbool.h>
#include "lcd.h"
#include "menu.h"
#include "games_menu.h"
#include "button.h"
#include "kernel.h"
#include "sprintf.h"
#include "sokoban.h"
extern void tetris(void);
enum { Tetris, Sokoban, numgames };
void games_menu(void)
{
int m;
struct menu_items items[] = {
{ Tetris, "Tetris", tetris },
{ Sokoban, "Sokoban", sokoban },
};
m=menu_init( items, sizeof items / sizeof(struct menu_items) );
menu_run(m);
menu_exit(m);
}
#endif

24
apps/games_menu.h Normal file
View file

@ -0,0 +1,24 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2002 Robert Hak
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef _GAMES_MENU_H
#define _GAMES_MENU_H
void games_menu(void);
#endif

View file

@ -32,12 +32,10 @@
#include "playlist.h"
#ifdef HAVE_LCD_BITMAP
#include "games_menu.h"
#include "screensavers_menu.h"
#include "bmp.h"
#include "icons.h"
#include "boxes.h"
#include "sokoban.h"
extern void tetris(void);
extern void bounce(void);
#endif
int show_logo( void )
@ -198,19 +196,17 @@ void main_menu(void)
{
int m;
enum {
Tetris, Boxes, Bounce, Sokoban, Version, Sound, Scroll, Shuffle
Games, Screensavers, Version, Sound, Scroll, Shuffle
};
/* main menu */
struct menu_items items[] = {
{ Shuffle, "Shuffle", shuffle },
{ Sound, "Sound", sound_menu },
{ Scroll, "Scroll speed", scroll_speed },
{ Shuffle, "Shuffle", shuffle },
{ Sound, "Sound", sound_menu },
{ Scroll, "Scroll speed", scroll_speed },
#ifdef HAVE_LCD_BITMAP
{ Tetris, "Tetris", tetris },
{ Boxes, "Boxes", boxes },
{ Bounce, "Bounce", bounce },
{ Sokoban, "Sokoban", sokoban },
{ Games, "Games", games_menu },
{ Screensavers, "Screensavers", screensavers_menu },
#endif
{ Version, "Version", show_credits },
};

52
apps/screensavers_menu.c Normal file
View file

@ -0,0 +1,52 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2002 Robert Hak
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifdef HAVE_LCD_BITMAP
#include "config.h"
#include <stdio.h>
#include <stdbool.h>
#include "lcd.h"
#include "menu.h"
#include "screensavers_menu.h"
#include "button.h"
#include "kernel.h"
#include "sprintf.h"
#include "boxes.h"
extern void bounce(void);
enum { Boxes, Bounce, numsavers };
void screensavers_menu(void)
{
int m;
struct menu_items items[] = {
{ Boxes, "Boxes", boxes },
{ Bounce, "Bounce", bounce },
};
m=menu_init( items, sizeof items / sizeof(struct menu_items) );
menu_run(m);
menu_exit(m);
}
#endif

25
apps/screensavers_menu.h Normal file
View file

@ -0,0 +1,25 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2002 Robert Hak
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef _SCREENSAVERS_MENU_H
#define _SCREENSAVERS_MENU_H
void screensavers_menu(void);
#endif