Call core_poll at top of runloop_iterate only once

This commit is contained in:
twinaphex 2017-05-20 22:55:12 +02:00
parent ce61db1473
commit e02cfe8cb0
1 changed files with 19 additions and 23 deletions

View File

@ -2334,9 +2334,6 @@ 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); enum menu_action action = (enum menu_action)menu_event(current_input, trigger_input);
bool focused = pause_nonactive ? is_focused : true; bool focused = pause_nonactive ? is_focused : true;
@ -2359,7 +2356,6 @@ static enum runloop_state runloop_check_state(
if (action == MENU_ACTION_QUIT && !menu_driver_is_binding_state()) if (action == MENU_ACTION_QUIT && !menu_driver_is_binding_state())
return RUNLOOP_STATE_QUIT; return RUNLOOP_STATE_QUIT;
} }
}
#endif #endif
if (runloop_idle) if (runloop_idle)
@ -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: