From c79da6842e6748df82adec071cadd49381ac1dc0 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 11 Jan 2017 07:31:09 +0100 Subject: [PATCH] Found a better and clenaer way to flush input --- input/input_driver.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/input/input_driver.c b/input/input_driver.c index 268bd5f642..700448e499 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -268,6 +268,12 @@ void input_poll(void) rarch_joypad_info_t joypad_info; settings_t *settings = config_get_ptr(); unsigned max_users = settings->input.max_users; + + if (input_driver_flushing_input) + { + input_driver_flushing_input = false; + return; + } current_input->poll(current_input_data); @@ -607,18 +613,7 @@ static INLINE bool input_menu_keys_pressed_internal( #define input_keys_pressed_end() \ *trigger_input = ret & ~old_input; \ - *last_input = ret; \ - if (input_driver_flushing_input) \ - { \ - input_driver_flushing_input = false; \ - if (ret) \ - { \ - ret = 0; \ - if (runloop_paused) \ - BIT64_SET(ret, RARCH_PAUSE_TOGGLE); \ - input_driver_flushing_input = true; \ - } \ - } + *last_input = ret; /** * input_menu_keys_pressed: