summaryrefslogtreecommitdiffstats
path: root/apps/plugins/snake.c
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2009-08-05 14:29:29 +0000
committerTeruaki Kawashima <teru@rockbox.org>2009-08-05 14:29:29 +0000
commite2e7ecf350a4d085f6f58052f55ba29e8fe77718 (patch)
treed5abd6a205b9d32cb11e1c2d0ea08602812248d4 /apps/plugins/snake.c
parenteac0a5b840571a11b181fdfd463be61aca466976 (diff)
downloadrockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.tar.gz
rockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.tar.bz2
rockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.zip
add playback control to more menu of plugins.
although it doesn't make much sense for some plugins like dice as the menu is only shown when you start that plugin. change star plugin to go back to menu when exit game instead of closing plugin so that above change makes useful. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22171 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/snake.c')
-rw-r--r--apps/plugins/snake.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/apps/plugins/snake.c b/apps/plugins/snake.c
index 739fce9a3e..8cba920840 100644
--- a/apps/plugins/snake.c
+++ b/apps/plugins/snake.c
@@ -34,6 +34,7 @@ dir is the current direction of the snake - 0=up, 1=right, 2=down, 3=left;
#include "plugin.h"
#ifdef HAVE_LCD_BITMAP
+#include "lib/playback_control.h"
PLUGIN_HEADER
@@ -393,7 +394,7 @@ void game (void) {
rb->sleep(HZ/level);
button=rb->button_get(false);
-
+
#ifdef HAS_BUTTON_HOLD
if (rb->button_hold())
button = SNAKE_PLAYPAUSE;
@@ -445,23 +446,28 @@ void game_init(void) {
apple=false;
snakelength=4;
score=0;
- board[11][7]=1;
-
- MENUITEM_STRINGLIST(menu,"Snake Menu",NULL,"Start New Game","Starting Level",
- "Quit");
-
+ board[11][7]=1;
+
+ MENUITEM_STRINGLIST(menu, "Snake Menu", NULL,
+ "Start New Game", "Starting Level",
+ "Playback Control", "Quit");
+
while (!menu_quit) {
switch(rb->do_menu(&menu, &selection, NULL, false))
{
case 0:
menu_quit = true; /* start playing */
break;
-
+
case 1:
rb->set_int("Starting Level", "", UNIT_INT, &level, NULL,
1, 1, 9, NULL );
break;
-
+
+ case 2:
+ playback_control(NULL);
+ break;
+
default:
dead=1; /* quit program */
menu_quit = true;