From e2e7ecf350a4d085f6f58052f55ba29e8fe77718 Mon Sep 17 00:00:00 2001 From: Teruaki Kawashima Date: Wed, 5 Aug 2009 14:29:29 +0000 Subject: 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 --- apps/plugins/pacbox/pacbox.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'apps/plugins/pacbox') diff --git a/apps/plugins/pacbox/pacbox.c b/apps/plugins/pacbox/pacbox.c index e7b92c38cf..0e3343252f 100644 --- a/apps/plugins/pacbox/pacbox.c +++ b/apps/plugins/pacbox/pacbox.c @@ -29,6 +29,7 @@ #include "pacbox.h" #include "pacbox_lcd.h" #include "lib/configfile.h" +#include "lib/playback_control.h" PLUGIN_HEADER PLUGIN_IRAM_DECLARE @@ -78,9 +79,9 @@ static bool loadFile( const char * name, unsigned char * buf, int len ) if( fd < 0 ) { return false; } - + int n = rb->read( fd, buf, len); - + rb->close( fd ); if( n != len ) { @@ -174,7 +175,8 @@ static bool pacbox_menu(void) MENUITEM_STRINGLIST(menu, "Pacbox Menu", NULL, "Difficulty", "Pacmen Per Game", "Bonus Life", - "Ghost Names", "Display FPS", "Restart", "Quit"); + "Ghost Names", "Display FPS", + "Playback Control", "Restart", "Quit"); rb->button_clear_queue(); @@ -220,10 +222,13 @@ static bool pacbox_menu(void) } break; case 4: /* Show FPS */ - rb->set_option("Display FPS",&settings.showfps,INT, + rb->set_option("Display FPS",&settings.showfps,INT, noyes, 2, NULL); break; - case 5: /* Restart */ + case 5: /* playback control */ + playback_control(NULL); + break; + case 6: /* Restart */ need_restart=true; menu_quit=1; break; @@ -323,7 +328,7 @@ static int gameProc( void ) yield_counter = 0; rb->yield (); } - + /* The following functions render the Pacman screen from the contents of the video and color ram. We first update the background, and then draw the Sprites on top. @@ -343,10 +348,10 @@ static int gameProc( void ) rb->lcd_update(); - /* Keep the framerate at Pacman's 60fps */ + /* Keep the framerate at Pacman's 60fps */ end_time = start_time + (video_frames*HZ)/FPS; while (TIME_BEFORE(*rb->current_tick,end_time)) { - rb->sleep(1); + rb->sleep(1); } } } -- cgit v1.2.3