From 4bc16462639e01fbf6f435330cbabe10321d91ae Mon Sep 17 00:00:00 2001 From: Karl Kurbjun Date: Mon, 3 Aug 2009 02:56:55 +0000 Subject: Clix: Make Clix respect the global touchscreen setting when in a menu. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22132 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/clix.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'apps/plugins/clix.c') diff --git a/apps/plugins/clix.c b/apps/plugins/clix.c index 5f9ad517ab..be60bdde7a 100644 --- a/apps/plugins/clix.c +++ b/apps/plugins/clix.c @@ -596,6 +596,8 @@ static int clix_menu(struct clix_game_state_t* state, bool ingame) { rb->button_clear_queue(); int choice = 0; + bool leave_menu=false; + int ret=0; _ingame = ingame; @@ -607,16 +609,26 @@ static int clix_menu(struct clix_game_state_t* state, bool ingame) "Playback Control", "Quit"); - while (true) { + /* Entering Menu, set the touchscreen to the global setting */ + rb->touchscreen_set_mode(rb->global_settings->touch_mode); + + while (!leave_menu) { + switch (rb->do_menu(&main_menu, &choice, NULL, false)) { case 0: - return 0; + leave_menu=true; + ret = 0; + break; case 1: clix_init(state); - return 0; + leave_menu=true; + ret = 0; + break; case 2: - if (clix_help()) - return 1; + if (clix_help()) { + leave_menu=true; + ret = 1; + } break; case 3: highscore_show(NUM_SCORES, highest, NUM_SCORES, true); @@ -626,11 +638,18 @@ static int clix_menu(struct clix_game_state_t* state, bool ingame) break; case 5: case MENU_ATTACHED_USB: - return 1; + leave_menu=true; + ret = 1; + break; default: break; } } + + /* Leaving the menu, set back to pointer mode */ + rb->touchscreen_set_mode(TOUCHSCREEN_POINT); + + return ret; } static int clix_handle_game(struct clix_game_state_t* state) -- cgit v1.2.3