Backport polling updates - mouse smoothness was broken in cores
This commit is contained in:
parent
dfae380f33
commit
1cdd0e47cb
20
retroarch.c
20
retroarch.c
|
@ -161,6 +161,7 @@ enum
|
||||||
enum runloop_state
|
enum runloop_state
|
||||||
{
|
{
|
||||||
RUNLOOP_STATE_ITERATE = 0,
|
RUNLOOP_STATE_ITERATE = 0,
|
||||||
|
RUNLOOP_STATE_POLLED_AND_SLEEP,
|
||||||
RUNLOOP_STATE_SLEEP,
|
RUNLOOP_STATE_SLEEP,
|
||||||
RUNLOOP_STATE_MENU_ITERATE,
|
RUNLOOP_STATE_MENU_ITERATE,
|
||||||
RUNLOOP_STATE_END,
|
RUNLOOP_STATE_END,
|
||||||
|
@ -2468,6 +2469,10 @@ static enum runloop_state runloop_check_state(
|
||||||
{
|
{
|
||||||
static uint64_t old_input = 0;
|
static uint64_t old_input = 0;
|
||||||
menu_ctx_iterate_t iter;
|
menu_ctx_iterate_t iter;
|
||||||
|
|
||||||
|
retro_ctx.poll_cb();
|
||||||
|
|
||||||
|
{
|
||||||
uint64_t trigger_input = current_input & ~old_input;
|
uint64_t trigger_input = current_input & ~old_input;
|
||||||
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;
|
||||||
|
@ -2488,13 +2493,17 @@ static enum runloop_state runloop_check_state(
|
||||||
old_input = current_input;
|
old_input = current_input;
|
||||||
|
|
||||||
if (!focused)
|
if (!focused)
|
||||||
return RUNLOOP_STATE_SLEEP;
|
return RUNLOOP_STATE_POLLED_AND_SLEEP;
|
||||||
|
|
||||||
if (action == MENU_ACTION_QUIT && !menu_driver_binding_state)
|
if (action == MENU_ACTION_QUIT && !menu_driver_binding_state)
|
||||||
return RUNLOOP_STATE_QUIT;
|
return RUNLOOP_STATE_QUIT;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
if (runloop_idle)
|
||||||
|
return RUNLOOP_STATE_POLLED_AND_SLEEP;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
if (runloop_idle)
|
if (runloop_idle)
|
||||||
return RUNLOOP_STATE_SLEEP;
|
return RUNLOOP_STATE_SLEEP;
|
||||||
|
|
||||||
|
@ -2953,8 +2962,6 @@ int runloop_iterate(unsigned *sleep_ms)
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
unsigned max_users = *(input_driver_get_uint(INPUT_ACTION_MAX_USERS));
|
unsigned max_users = *(input_driver_get_uint(INPUT_ACTION_MAX_USERS));
|
||||||
|
|
||||||
retro_ctx.poll_cb();
|
|
||||||
|
|
||||||
if (runloop_frame_time.callback)
|
if (runloop_frame_time.callback)
|
||||||
{
|
{
|
||||||
/* Updates frame timing if frame timing callback is in use by the core.
|
/* Updates frame timing if frame timing callback is in use by the core.
|
||||||
|
@ -2991,7 +2998,12 @@ int runloop_iterate(unsigned *sleep_ms)
|
||||||
frame_limit_last_time = 0.0;
|
frame_limit_last_time = 0.0;
|
||||||
command_event(CMD_EVENT_QUIT, NULL);
|
command_event(CMD_EVENT_QUIT, NULL);
|
||||||
return -1;
|
return -1;
|
||||||
|
case RUNLOOP_STATE_POLLED_AND_SLEEP:
|
||||||
|
runloop_netplay_pause();
|
||||||
|
*sleep_ms = 10;
|
||||||
|
return 1;
|
||||||
case RUNLOOP_STATE_SLEEP:
|
case RUNLOOP_STATE_SLEEP:
|
||||||
|
retro_ctx.poll_cb();
|
||||||
runloop_netplay_pause();
|
runloop_netplay_pause();
|
||||||
*sleep_ms = 10;
|
*sleep_ms = 10;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue