Create RARCH_INPUT_CTL_POLL

This commit is contained in:
twinaphex 2015-11-25 20:39:46 +01:00
parent df948215af
commit cb98cbc1bf
4 changed files with 10 additions and 8 deletions

View File

@ -1224,8 +1224,6 @@ bool event_command(enum event_command cmd)
{
const struct retro_hw_render_callback *hw_render =
(const struct retro_hw_render_callback*)video_driver_callback();
const input_driver_t *input = driver ?
(const input_driver_t*)driver->input : NULL;
driver->video_cache_context = hw_render->cache_context;
driver->video_cache_context_ack = false;
@ -1233,7 +1231,7 @@ bool event_command(enum event_command cmd)
driver->video_cache_context = false;
/* Poll input to avoid possibly stale data to corrupt things. */
input->poll(driver->input_data);
input_driver_ctl(RARCH_INPUT_CTL_POLL, NULL);
#ifdef HAVE_MENU
menu_display_ctl(MENU_DISPLAY_CTL_SET_FRAMEBUFFER_DIRTY_FLAG, NULL);

View File

@ -443,14 +443,14 @@ void input_get_bind_string(char *buf, const struct retro_keybind *bind,
**/
void input_poll(void)
{
#ifdef HAVE_COMMAND
driver_t *driver = driver_get_ptr();
#endif
#ifdef HAVE_OVERLAY
settings_t *settings = config_get_ptr();
const input_driver_t *input = driver ?
(const input_driver_t*)driver->input : NULL;
#endif
(void)settings;
input->poll(driver->input_data);
input_driver_ctl(RARCH_INPUT_CTL_POLL, NULL);
#ifdef HAVE_OVERLAY
input_poll_overlay(settings->input.overlay_opacity);

View File

@ -455,6 +455,9 @@ bool input_driver_ctl(enum rarch_input_ctl_state state, void *data)
switch (state)
{
case RARCH_INPUT_CTL_POLL:
input->poll(driver->input_data);
return true;
case RARCH_INPUT_CTL_INIT:
if (driver && driver->input)
driver->input_data = driver->input->init();

View File

@ -52,6 +52,7 @@ enum rarch_input_ctl_state
RARCH_INPUT_CTL_INIT,
RARCH_INPUT_CTL_DEINIT,
RARCH_INPUT_CTL_DESTROY,
RARCH_INPUT_CTL_POLL,
RARCH_INPUT_CTL_FIND_DRIVER,
RARCH_INPUT_CTL_GRAB_STDIN,
RARCH_INPUT_CTL_KB_MAPPING_IS_BLOCKED