Call core_poll at top of runloop_iterate only once
This commit is contained in:
parent
ce61db1473
commit
e02cfe8cb0
42
retroarch.c
42
retroarch.c
|
@ -2334,31 +2334,27 @@ static enum runloop_state runloop_check_state(
|
||||||
if (menu_is_alive)
|
if (menu_is_alive)
|
||||||
{
|
{
|
||||||
menu_ctx_iterate_t iter;
|
menu_ctx_iterate_t iter;
|
||||||
core_poll();
|
enum menu_action action = (enum menu_action)menu_event(current_input, trigger_input);
|
||||||
|
bool focused = pause_nonactive ? is_focused : true;
|
||||||
|
|
||||||
{
|
focused = focused && !ui_companion_is_on_foreground();
|
||||||
enum menu_action action = (enum menu_action)menu_event(current_input, trigger_input);
|
|
||||||
bool focused = pause_nonactive ? is_focused : true;
|
|
||||||
|
|
||||||
focused = focused && !ui_companion_is_on_foreground();
|
iter.action = action;
|
||||||
|
|
||||||
iter.action = action;
|
if (!menu_driver_iterate(&iter))
|
||||||
|
rarch_menu_running_finished();
|
||||||
|
|
||||||
if (!menu_driver_iterate(&iter))
|
if (focused || !runloop_idle)
|
||||||
rarch_menu_running_finished();
|
menu_driver_render(runloop_idle, rarch_is_inited,
|
||||||
|
(current_core_type == CORE_TYPE_DUMMY)
|
||||||
|
)
|
||||||
|
;
|
||||||
|
|
||||||
if (focused || !runloop_idle)
|
if (!focused)
|
||||||
menu_driver_render(runloop_idle, rarch_is_inited,
|
return RUNLOOP_STATE_SLEEP;
|
||||||
(current_core_type == CORE_TYPE_DUMMY)
|
|
||||||
)
|
|
||||||
;
|
|
||||||
|
|
||||||
if (!focused)
|
if (action == MENU_ACTION_QUIT && !menu_driver_is_binding_state())
|
||||||
return RUNLOOP_STATE_SLEEP;
|
return RUNLOOP_STATE_QUIT;
|
||||||
|
|
||||||
if (action == MENU_ACTION_QUIT && !menu_driver_is_binding_state())
|
|
||||||
return RUNLOOP_STATE_QUIT;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2666,8 +2662,11 @@ int runloop_iterate(unsigned *sleep_ms)
|
||||||
bool menu_is_alive = false;
|
bool menu_is_alive = false;
|
||||||
#endif
|
#endif
|
||||||
unsigned max_users = *(input_driver_get_uint(INPUT_ACTION_MAX_USERS));
|
unsigned max_users = *(input_driver_get_uint(INPUT_ACTION_MAX_USERS));
|
||||||
uint64_t current_input =
|
uint64_t current_input = 0;
|
||||||
|
|
||||||
|
core_poll();
|
||||||
|
|
||||||
|
current_input =
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
menu_is_alive ?
|
menu_is_alive ?
|
||||||
input_menu_keys_pressed(settings, old_input,
|
input_menu_keys_pressed(settings, old_input,
|
||||||
|
@ -2719,16 +2718,13 @@ int runloop_iterate(unsigned *sleep_ms)
|
||||||
command_event(CMD_EVENT_QUIT, NULL);
|
command_event(CMD_EVENT_QUIT, NULL);
|
||||||
return -1;
|
return -1;
|
||||||
case RUNLOOP_STATE_SLEEP:
|
case RUNLOOP_STATE_SLEEP:
|
||||||
core_poll();
|
|
||||||
runloop_netplay_pause();
|
runloop_netplay_pause();
|
||||||
*sleep_ms = 10;
|
*sleep_ms = 10;
|
||||||
return 1;
|
return 1;
|
||||||
case RUNLOOP_STATE_END:
|
case RUNLOOP_STATE_END:
|
||||||
core_poll();
|
|
||||||
runloop_netplay_pause();
|
runloop_netplay_pause();
|
||||||
goto end;
|
goto end;
|
||||||
case RUNLOOP_STATE_MENU_ITERATE:
|
case RUNLOOP_STATE_MENU_ITERATE:
|
||||||
core_poll();
|
|
||||||
runloop_netplay_pause();
|
runloop_netplay_pause();
|
||||||
return 0;
|
return 0;
|
||||||
case RUNLOOP_STATE_ITERATE:
|
case RUNLOOP_STATE_ITERATE:
|
||||||
|
|
Loading…
Reference in New Issue