mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
input_common.c - small cleanups
This commit is contained in:
parent
191f0b6383
commit
eeda9df418
@ -126,10 +126,9 @@ const rarch_joypad_driver_t *input_joypad_init_first(void)
|
|||||||
const char *input_joypad_name(const rarch_joypad_driver_t *driver,
|
const char *input_joypad_name(const rarch_joypad_driver_t *driver,
|
||||||
unsigned joypad)
|
unsigned joypad)
|
||||||
{
|
{
|
||||||
if (!driver)
|
if (driver)
|
||||||
return NULL;
|
return driver->name(joypad);
|
||||||
|
return NULL;
|
||||||
return driver->name(joypad);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool input_joypad_set_rumble(const rarch_joypad_driver_t *driver,
|
bool input_joypad_set_rumble(const rarch_joypad_driver_t *driver,
|
||||||
@ -234,29 +233,26 @@ int16_t input_joypad_analog(const rarch_joypad_driver_t *driver,
|
|||||||
int16_t input_joypad_axis_raw(const rarch_joypad_driver_t *driver,
|
int16_t input_joypad_axis_raw(const rarch_joypad_driver_t *driver,
|
||||||
unsigned joypad, unsigned axis)
|
unsigned joypad, unsigned axis)
|
||||||
{
|
{
|
||||||
if (!driver)
|
if (driver)
|
||||||
return 0;
|
return driver->axis(joypad, AXIS_POS(axis)) +
|
||||||
|
driver->axis(joypad, AXIS_NEG(axis));
|
||||||
return driver->axis(joypad, AXIS_POS(axis)) +
|
return 0;
|
||||||
driver->axis(joypad, AXIS_NEG(axis));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool input_joypad_button_raw(const rarch_joypad_driver_t *driver,
|
bool input_joypad_button_raw(const rarch_joypad_driver_t *driver,
|
||||||
unsigned joypad, unsigned button)
|
unsigned joypad, unsigned button)
|
||||||
{
|
{
|
||||||
if (!driver)
|
if (driver)
|
||||||
return false;
|
return driver->button(joypad, button);
|
||||||
|
return false;
|
||||||
return driver->button(joypad, button);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool input_joypad_hat_raw(const rarch_joypad_driver_t *driver,
|
bool input_joypad_hat_raw(const rarch_joypad_driver_t *driver,
|
||||||
unsigned joypad, unsigned hat_dir, unsigned hat)
|
unsigned joypad, unsigned hat_dir, unsigned hat)
|
||||||
{
|
{
|
||||||
if (!driver)
|
if (driver)
|
||||||
return false;
|
return driver->button(joypad, HAT_MAP(hat, hat_dir));
|
||||||
|
return false;
|
||||||
return driver->button(joypad, HAT_MAP(hat, hat_dir));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef IS_RETROLAUNCH
|
#ifndef IS_RETROLAUNCH
|
||||||
|
Loading…
x
Reference in New Issue
Block a user