Take out MODE_MENu - and introduce g_extern.is_menu

This commit is contained in:
twinaphex 2014-09-25 06:33:28 +02:00
parent 15f82cb477
commit 00e605d9ba
9 changed files with 13 additions and 14 deletions

View File

@ -281,8 +281,8 @@ static void rgui_render(void)
size_t begin = 0; size_t begin = 0;
size_t end; size_t end;
if (driver.menu->need_refresh && if (driver.menu->need_refresh
(g_extern.lifecycle_state & (1ULL << MODE_MENU)) && g_extern.is_menu
&& !driver.menu->msg_force) && !driver.menu->msg_force)
return; return;

View File

@ -134,8 +134,7 @@ static void rmenu_render(void)
return; return;
} }
if (menu->need_refresh && if (menu->need_refresh && g_extern.is_menu
(g_extern.lifecycle_state & (1ULL << MODE_MENU))
&& !menu->msg_force) && !menu->msg_force)
return; return;

View File

@ -372,8 +372,7 @@ static void rmenu_xui_render(void)
unsigned menu_type = 0; unsigned menu_type = 0;
if (!driver.menu || driver.menu->need_refresh && if (!driver.menu || driver.menu->need_refresh &&
(g_extern.lifecycle_state & (1ULL << MODE_MENU)) g_extern.is_menu && !driver.menu->msg_force)
&& !driver.menu->msg_force)
return; return;
begin = driver.menu->selection_ptr; begin = driver.menu->selection_ptr;

View File

@ -148,7 +148,6 @@ enum action_state
enum menu_enums enum menu_enums
{ {
MODE_NONE = 0, MODE_NONE = 0,
MODE_MENU,
MODE_MENU_WIDESCREEN, MODE_MENU_WIDESCREEN,
MODE_MENU_HD, MODE_MENU_HD,
MODE_EXTLAUNCH_MULTIMAN, MODE_EXTLAUNCH_MULTIMAN,
@ -635,6 +634,7 @@ struct global
/* Pausing support. */ /* Pausing support. */
bool is_paused; bool is_paused;
bool is_oneshot; bool is_oneshot;
bool is_menu;
bool is_slowmotion; bool is_slowmotion;
/* Turbo support. */ /* Turbo support. */

View File

@ -1596,7 +1596,7 @@ static bool d3d_frame(void *data, const void *frame,
#endif #endif
#ifdef HAVE_MENU #ifdef HAVE_MENU
if (g_extern.lifecycle_state & (1ULL << MODE_MENU) if (g_extern.is_menu
&& driver.menu_ctx && driver.menu_ctx->frame) && driver.menu_ctx && driver.menu_ctx->frame)
driver.menu_ctx->frame(); driver.menu_ctx->frame();

View File

@ -1595,7 +1595,7 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
gl_set_prev_texture(gl, &tex_info); gl_set_prev_texture(gl, &tex_info);
#if defined(HAVE_MENU) #if defined(HAVE_MENU)
if ((g_extern.lifecycle_state & (1ULL << MODE_MENU)) if (g_extern.is_menu
&& driver.menu_ctx && driver.menu_ctx->frame) && driver.menu_ctx && driver.menu_ctx->frame)
driver.menu_ctx->frame(); driver.menu_ctx->frame();

View File

@ -490,7 +490,8 @@ static bool sdl2_gfx_frame(void *data, const void *frame, unsigned width,
SDL_RenderCopyEx(vid->renderer, vid->frame.tex, NULL, NULL, vid->rotation, NULL, SDL_FLIP_NONE); SDL_RenderCopyEx(vid->renderer, vid->frame.tex, NULL, NULL, vid->rotation, NULL, SDL_FLIP_NONE);
#ifdef HAVE_MENU #ifdef HAVE_MENU
if (g_extern.lifecycle_state & (1ULL << MODE_MENU) && driver.menu_ctx && driver.menu_ctx->frame) if (g_extern.is_menu
&& driver.menu_ctx && driver.menu_ctx->frame)
driver.menu_ctx->frame(); driver.menu_ctx->frame();
#endif #endif

View File

@ -109,7 +109,7 @@ static void ps3_input_poll(void *data)
*state_cur |= (state_tmp.button[CELL_PAD_BTN_OFFSET_DIGITAL2] & CELL_PAD_CTRL_TRIANGLE) ? (1ULL << RETRO_DEVICE_ID_JOYPAD_X) : 0; *state_cur |= (state_tmp.button[CELL_PAD_BTN_OFFSET_DIGITAL2] & CELL_PAD_CTRL_TRIANGLE) ? (1ULL << RETRO_DEVICE_ID_JOYPAD_X) : 0;
*state_cur |= (state_tmp.button[CELL_PAD_BTN_OFFSET_DIGITAL2] & CELL_PAD_CTRL_SQUARE) ? (1ULL << RETRO_DEVICE_ID_JOYPAD_Y) : 0; *state_cur |= (state_tmp.button[CELL_PAD_BTN_OFFSET_DIGITAL2] & CELL_PAD_CTRL_SQUARE) ? (1ULL << RETRO_DEVICE_ID_JOYPAD_Y) : 0;
if (*lifecycle_state & (1ULL << MODE_MENU)) if (g_extern.is_menu)
{ {
int value = 0; int value = 0;
if (cellSysutilGetSystemParamInt(CELL_SYSUTIL_SYSTEMPARAM_ID_ENTER_BUTTON_ASSIGN, &value) == 0) if (cellSysutilGetSystemParamInt(CELL_SYSUTIL_SYSTEMPARAM_ID_ENTER_BUTTON_ASSIGN, &value) == 0)

View File

@ -2849,10 +2849,10 @@ void rarch_main_set_state(unsigned cmd)
#endif #endif
break; break;
case RARCH_ACTION_STATE_MENU_RUNNING: case RARCH_ACTION_STATE_MENU_RUNNING:
g_extern.lifecycle_state |= (1ULL << MODE_MENU); g_extern.is_menu = true;
break; break;
case RARCH_ACTION_STATE_MENU_RUNNING_FINISHED: case RARCH_ACTION_STATE_MENU_RUNNING_FINISHED:
g_extern.lifecycle_state &= ~(1ULL << MODE_MENU); g_extern.is_menu = false;
break; break;
case RARCH_ACTION_STATE_EXITSPAWN: case RARCH_ACTION_STATE_EXITSPAWN:
g_extern.lifecycle_state |= (1ULL << MODE_EXITSPAWN); g_extern.lifecycle_state |= (1ULL << MODE_EXITSPAWN);
@ -3232,7 +3232,7 @@ bool rarch_main_iterate(void)
!driver.video->alive(driver.video_data)) !driver.video->alive(driver.video_data))
return false; return false;
if (g_extern.lifecycle_state & (1ULL << MODE_MENU)) if (g_extern.is_menu)
{ {
if (!menu_iterate(input, old_input, trigger_input)) if (!menu_iterate(input, old_input, trigger_input))
{ {