--- rockbox/apps/plugins/brickmania.c 2009-03-07 23:29:51.443675841 +0100 +++ rockbox_changed/apps/plugins/brickmania.c 2009-03-08 14:47:53.391786881 +0100 @@ -26,6 +26,11 @@ PLUGIN_HEADER +enum menu_items { + BM_START, + BM_RESUME, + BM_QUIT +}; #if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) @@ -218,24 +223,6 @@ #define SCROLL_BACK(x) (0) #endif - -enum menu_items { - BM_START, - BM_RESUME, - BM_HELP, - BM_HIGHSCORE, - BM_PLAYBACK_CONTROL, - BM_QUIT -}; - -MENUITEM_STRINGLIST (main_menu, "Brickmania", NULL, - "Start", - "Resume", - "Help", - "High Score", - "Playback Control", - "Quit"); - #include "pluginbitmaps/brickmania_pads.h" #include "pluginbitmaps/brickmania_bricks.h" #include "pluginbitmaps/brickmania_powerups.h" @@ -872,61 +859,89 @@ #define HIGH_SCORE "brickmania.score" int game_menu(int when) { - /* clear any previous button presses (especially when coming from - * game over, but it doesn't hurt to do it always) - */ rb->button_clear_queue(); - int choice = 0; - - while (1) { - choice = rb->do_menu(&main_menu, &choice, NULL, false); - - switch (choice) { - case BM_START: - score=0; - vscore=0; - life=2; - cur_level=0; - int_game(1); - return choice; - - case BM_RESUME: - /* resume if we can */ - if (when==1) - return choice; - else - rb->splash(HZ/2, "Nothing to resume!"); - break; - - case BM_HELP: - if (help(when)==1) - return BM_QUIT; - else - return choice; - - case BM_HIGHSCORE: - rb->splashf(HZ*2, "High Score: %d", highscore); - break; - - case BM_PLAYBACK_CONTROL: - playback_control(NULL); - break; - - case BM_QUIT: - case MENU_ATTACHED_USB: - return BM_QUIT; - - case GO_TO_ROOT: - case GO_TO_PREVIOUS: - /* Resume if we can resume, otherwise quit */ - if (when==1) + + if (when==1) { + MENUITEM_STRINGLIST (main_menu, "Brickmania Menu", NULL, + "Resume Game", + "Restart Game", + "Help", + "High Score", + "Playback Control", + "Quit"); + + while (1) { + choice = rb->do_menu(&main_menu, &choice, NULL, false); + switch (choice) { + case 0: return BM_RESUME; - else + break; + case 1: + score=0; + vscore=0; + life=2; + cur_level=0; + int_game(1); + return BM_START; + break; + case 2: + if (help(when)==1) + return BM_QUIT; + else + return choice; + case 3: + rb->splashf(HZ*2, "High Score: %d", highscore); + break; + case 4: + playback_control(NULL); + break; + case 5: return BM_QUIT; - - default: - break; + case MENU_ATTACHED_USB: + return BM_QUIT; + default: + break; + } + } + } + else { + MENUITEM_STRINGLIST (main_menu, "Brickmania Menu", NULL, + "Start New Game", + "Help", + "High Score", + "Playback Control", + "Quit"); + + while (1) { + choice = rb->do_menu(&main_menu, &choice, NULL, false); + + switch (choice) { + case 0: + score=0; + vscore=0; + life=2; + cur_level=0; + int_game(1); + return BM_START; + case 1: + if (help(when)==1) + return BM_QUIT; + else + return choice; + case 2: + rb->splashf(HZ*2, "High Score: %d", highscore); + break; + case 3: + playback_control(NULL); + break; + case 4: + return BM_QUIT; + case MENU_ATTACHED_USB: + return BM_QUIT; + default: + break; + } } } }