From 71e927020c5b53bb04b132b1d6cb52785009451c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 23 Mar 2015 03:17:43 +0100 Subject: [PATCH] Create input_driver_poll --- input/input_driver.c | 7 +++++++ input/input_driver.h | 2 ++ libretro_version_1.c | 2 +- retroarch.c | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/input/input_driver.c b/input/input_driver.c index ed6789b100..844b8d6a23 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -224,3 +224,10 @@ int16_t input_driver_state(const struct retro_keybind **retro_keybinds, port, device, index, id); return 0; } + +void input_driver_poll(void) +{ + driver_t *driver = driver_get_ptr(); + if (driver->input && driver->input_data && driver->input->poll) + driver->input->poll(driver->input_data); +} diff --git a/input/input_driver.h b/input/input_driver.h index 0a64a994ef..c4d43840ca 100644 --- a/input/input_driver.h +++ b/input/input_driver.h @@ -140,6 +140,8 @@ retro_input_t input_driver_keys_pressed(void); int16_t input_driver_state(const struct retro_keybind **retro_keybinds, unsigned port, unsigned device, unsigned index, unsigned id); +void input_driver_poll(void); + #ifdef __cplusplus } #endif diff --git a/libretro_version_1.c b/libretro_version_1.c index 3f0144960c..308f52c5d5 100644 --- a/libretro_version_1.c +++ b/libretro_version_1.c @@ -643,7 +643,7 @@ static void input_poll(void) driver_t *driver = driver_get_ptr(); settings_t *settings = config_get_ptr(); - driver->input->poll(driver->input_data); + input_driver_poll(); #ifdef HAVE_OVERLAY if (driver->overlay) diff --git a/retroarch.c b/retroarch.c index 210101fc15..800eeaba9a 100644 --- a/retroarch.c +++ b/retroarch.c @@ -2405,7 +2405,7 @@ bool rarch_main_command(unsigned cmd) driver->video_cache_context = false; /* Poll input to avoid possibly stale data to corrupt things. */ - driver->input->poll(driver->input_data); + input_driver_poll(); #ifdef HAVE_MENU runloop->frames.video.current.menu.framebuf.dirty = true;