From 64dc9513aed1ab016bbe9a57abe99b00897c3a08 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 30 Sep 2013 00:09:40 +0200 Subject: [PATCH] (RMenu/RGUI) Get rid of MODE_MENU_INGAME_EXIT --- frontend/menu/menu_settings.c | 11 +---------- frontend/menu/rgui.c | 4 ---- frontend/menu/rmenu.c | 15 ++++----------- general.h | 1 - 4 files changed, 5 insertions(+), 26 deletions(-) diff --git a/frontend/menu/menu_settings.c b/frontend/menu/menu_settings.c index 2604aabdda..4226434aaf 100644 --- a/frontend/menu/menu_settings.c +++ b/frontend/menu/menu_settings.c @@ -119,9 +119,6 @@ int menu_set_settings(unsigned setting, unsigned action) else rarch_load_state(); g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME); -#ifdef HAVE_RMENU - g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME_EXIT); -#endif return -1; } else if (action == RGUI_ACTION_START) @@ -201,12 +198,9 @@ int menu_set_settings(unsigned setting, unsigned action) } break; case RGUI_SETTINGS_RESUME_GAME: - if (action == RGUI_ACTION_OK && (g_extern.main_is_init)) + if (action == RGUI_ACTION_OK) { g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME); -#ifdef HAVE_RMENU - g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME_EXIT); -#endif return -1; } break; @@ -214,9 +208,6 @@ int menu_set_settings(unsigned setting, unsigned action) if (action == RGUI_ACTION_OK) { g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME); -#ifdef HAVE_RMENU - g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME_EXIT); -#endif return -1; } break; diff --git a/frontend/menu/rgui.c b/frontend/menu/rgui.c index 3f3445c7f9..ca7e783523 100644 --- a/frontend/menu/rgui.c +++ b/frontend/menu/rgui.c @@ -1490,14 +1490,10 @@ int rgui_input_postprocess(void *data, uint64_t old_state) g_extern.main_is_init && !g_extern.libretro_dummy) { - g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME_EXIT); g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME); ret = -1; } - if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_INGAME_EXIT)) - g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_INGAME_EXIT); - if (ret < 0) { unsigned type = 0; diff --git a/frontend/menu/rmenu.c b/frontend/menu/rmenu.c index f262dd8fc1..9b1bdd9c8e 100644 --- a/frontend/menu/rmenu.c +++ b/frontend/menu/rmenu.c @@ -1240,7 +1240,7 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t menu_stack_push(INGAME_MENU_SCREENSHOT, false); break; case INGAME_MENU_RETURN_TO_GAME: - return menu_set_settings(RGUI_SETTINGS_VIDEO_ROTATION, action); + return menu_set_settings(RGUI_SETTINGS_RESUME_GAME, action); case INGAME_MENU_CHANGE_GAME: if (action == RGUI_ACTION_OK) menu_stack_push(FILE_BROWSER_MENU, false); @@ -1254,7 +1254,6 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t { rarch_game_reset(); g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME); - g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME_EXIT); return -1; } break; @@ -1270,7 +1269,6 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t if (action == RGUI_ACTION_OK) { g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME); - g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME_EXIT); g_extern.lifecycle_mode_state |= (1ULL << MODE_EXITSPAWN); g_extern.lifecycle_mode_state |= (1ULL << MODE_EXITSPAWN_MULTIMAN); return -1; @@ -1981,7 +1979,6 @@ static int select_setting(void *data, uint64_t action) case RGUI_ACTION_CANCEL: if (rgui->menu_type == INGAME_MENU) { - g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME_EXIT); g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME); return -1; } @@ -2262,9 +2259,7 @@ int rgui_input_postprocess(void *data, uint64_t old_state) if ((rgui->trigger_state & (1ULL << RARCH_MENU_TOGGLE)) && g_extern.main_is_init) { - g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME_EXIT); g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME); - ret = -1; } @@ -2274,11 +2269,6 @@ int rgui_input_postprocess(void *data, uint64_t old_state) if (quit) ret = -1; - if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_INGAME_EXIT)) - { - menu_stack_pop(rgui->menu_type); - g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_INGAME_EXIT); - } return ret; } @@ -2358,6 +2348,9 @@ static int rgui_iterate(void *data, unsigned action) if (ret == 0) render_text(rgui); + if (ret == -1) + menu_stack_pop(rgui->menu_type); + return ret; } diff --git a/general.h b/general.h index 2cb5417253..cb287166d6 100644 --- a/general.h +++ b/general.h @@ -113,7 +113,6 @@ enum menu_enums MODE_MENU_WIDESCREEN, MODE_MENU_HD, MODE_MENU_PREINIT, - MODE_MENU_INGAME_EXIT, MODE_INFO_DRAW, MODE_FPS_DRAW, MODE_EXTLAUNCH_MULTIMAN,