Skip to content

Commit

Permalink
(input_driver.c) Cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Apr 11, 2015
1 parent 3eed6fd commit 341579f
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions input/input_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,31 +258,32 @@ void input_driver_poll(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
&& driver->input
&& driver->input->get_joypad_driver)
return driver->input->get_joypad_driver(driver->input_data);
if (input->get_joypad_driver)
return input->get_joypad_driver(driver->input_data);
return NULL;
}

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)
return driver->input->get_capabilities(driver->input_data);
if (input->get_capabilities)
return input->get_capabilities(driver->input_data);
return 0;
}

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 false;
Expand Down

0 comments on commit 341579f

Please sign in to comment.