(input_driver.c) Cleanups

This commit is contained in:
twinaphex 2015-04-11 08:17:55 +02:00
parent 3eed6fd464
commit 341579f7b6

View File

@ -258,31 +258,32 @@ void input_driver_poll(void)
const rarch_joypad_driver_t * input_driver_get_joypad_driver(void) const rarch_joypad_driver_t * input_driver_get_joypad_driver(void)
{ {
driver_t *driver = driver_get_ptr(); driver_t *driver = driver_get_ptr();
const input_driver_t *input = input_get_ptr(driver);
if (driver if (input->get_joypad_driver)
&& driver->input return input->get_joypad_driver(driver->input_data);
&& driver->input->get_joypad_driver)
return driver->input->get_joypad_driver(driver->input_data);
return NULL; return NULL;
} }
uint64_t input_driver_get_capabilities(void) uint64_t input_driver_get_capabilities(void)
{ {
driver_t *driver = driver_get_ptr(); driver_t *driver = driver_get_ptr();
const input_driver_t *input = input_get_ptr(driver);
if (driver && driver->input) if (input->get_capabilities)
return driver->input->get_capabilities(driver->input_data); return input->get_capabilities(driver->input_data);
return 0; return 0;
} }
bool input_driver_grab_mouse(bool state) bool input_driver_grab_mouse(bool state)
{ {
driver_t *driver = driver_get_ptr(); driver_t *driver = driver_get_ptr();
const input_driver_t *input = input_get_ptr(driver);
if (driver && driver->input) if (input->grab_mouse)
{ {
driver->input->grab_mouse(driver->input_data, state); input->grab_mouse(driver->input_data, state);
return true; return true;
} }
return false; return false;