Create RARCH_INPUT_CTL_DESTROY

This commit is contained in:
twinaphex 2015-11-25 18:49:37 +01:00
parent 73ce9c0d23
commit 9643edfac7
3 changed files with 7 additions and 11 deletions

View File

@ -467,6 +467,6 @@ void uninit_drivers(int flags)
video_driver_ctl(RARCH_DISPLAY_CTL_DEINIT, NULL);
if ((flags & DRIVER_INPUT) && !driver->input_data_own)
input_driver_destroy();
input_driver_ctl(RARCH_INPUT_CTL_DESTROY, NULL);
}

View File

@ -208,14 +208,6 @@ void input_driver_set(const input_driver_t **input, void **input_data)
driver->input_data_own = true;
}
void input_driver_destroy(void)
{
driver_t *driver = driver_get_ptr();
if (driver)
driver->input_data = NULL;
}
void input_driver_keyboard_mapping_set_block(bool value)
{
driver_t *driver = driver_get_ptr();
@ -277,6 +269,11 @@ bool input_driver_ctl(enum rarch_input_ctl_state state, void *data)
return false;
driver->input->free(driver->input_data);
return true;
case RARCH_INPUT_CTL_DESTROY:
if (!driver)
return false;
driver->input_data = NULL;
return true;
case RARCH_INPUT_CTL_GRAB_STDIN:
if (input->grab_stdin)
return input->grab_stdin(driver->input_data);

View File

@ -51,6 +51,7 @@ enum rarch_input_ctl_state
RARCH_INPUT_CTL_NONE = 0,
RARCH_INPUT_CTL_INIT,
RARCH_INPUT_CTL_DEINIT,
RARCH_INPUT_CTL_DESTROY,
RARCH_INPUT_CTL_FIND_DRIVER,
RARCH_INPUT_CTL_GRAB_STDIN,
RARCH_INPUT_CTL_KB_MAPPING_IS_BLOCKED
@ -171,8 +172,6 @@ const input_device_driver_t * input_driver_get_sec_joypad_driver(void);
bool input_driver_grab_mouse(bool state);
void input_driver_destroy(void);
void input_driver_keyboard_mapping_set_block(bool value);
const input_driver_t *input_get_ptr(void *data);