From af9f4056510f248c4c9c1335167853bb455e8cc0 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Tue, 16 Jun 2009 04:25:21 +0000 Subject: Accept FS#10094 by Teruaki Kawashima: Replace the old menu API with the "new" one (a very long time overdue so huge thanks for the work.) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21306 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/fireworks.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'apps/plugins/fireworks.c') diff --git a/apps/plugins/fireworks.c b/apps/plugins/fireworks.c index 168a67baa9..d237007460 100644 --- a/apps/plugins/fireworks.c +++ b/apps/plugins/fireworks.c @@ -19,7 +19,6 @@ * ****************************************************************************/ #include "plugin.h" -#include "lib/oldmenuapi.h" #include "lib/helper.h" #include "lib/playback_control.h" @@ -287,17 +286,10 @@ static const struct opt_items fps_settings[9] = { int fps_values[9] = { 20, 25, 30, 35, 40, 45, 50, 55, 60 }; -static const struct menu_item items[] = { - { "Start Demo", NULL }, - { "Auto-Fire", NULL }, - { "Particles Per Firework", NULL }, - { "Particle Life", NULL }, - { "Gravity", NULL }, - { "Show Rockets", NULL }, - { "FPS (Speed)", NULL }, - { "Playback Control", NULL }, - { "Quit", NULL } -}; +MENUITEM_STRINGLIST(menu, "Fireworks Menu", NULL, + "Start Demo", "Auto-Fire", "Particles Per Firework", + "Particle Life", "Gravity", "Show Rockets", + "FPS (Speed)", "Playback Control", "Quit"); /* called on startup. initializes all variables, etc */ void init_all(void) @@ -348,7 +340,7 @@ void init_rocket(int rocket) /* startup/configuration menu. */ void fireworks_menu(void) { - int m, result; + int selected = 0, result; bool menu_quit = false; rb->lcd_setfont(FONT_UI); @@ -359,14 +351,11 @@ void fireworks_menu(void) rb->lcd_clear_display(); rb->lcd_update(); - m = menu_init(items, sizeof(items) / sizeof(*items), - NULL, NULL, NULL, NULL); - rb->button_clear_queue(); while(!menu_quit) { - result = menu_show(m); + result = rb->do_menu(&menu, &selected, NULL, false); switch(result) { @@ -419,8 +408,6 @@ void fireworks_menu(void) break; } } - - menu_exit(m); } /* this is the plugin entry point */ -- cgit v1.2.3