Move static inline functions over to input_bind_dialog.c - were

not used elsewhere
This commit is contained in:
twinaphex 2020-01-01 10:53:36 +01:00
parent 55de2803a4
commit 7c63889b26
2 changed files with 27 additions and 50 deletions

View File

@ -362,56 +362,6 @@ int16_t input_joypad_analog(const input_device_driver_t *driver,
bool input_joypad_set_rumble(const input_device_driver_t *driver,
unsigned port, enum retro_rumble_effect effect, uint16_t strength);
/**
* input_joypad_axis_raw:
* @drv : Input device driver handle.
* @port : Joystick number.
* @axis : Identifier of axis.
*
* Checks if axis (@axis) was being pressed by user
* with joystick number @port.
*
* Returns: true (1) if axis was pressed, otherwise
* false (0).
**/
static INLINE int16_t input_joypad_axis_raw(
const input_device_driver_t *drv,
unsigned port, unsigned axis)
{
if (!drv)
return 0;
return drv->axis(port, AXIS_POS(axis)) +
drv->axis(port, AXIS_NEG(axis));
}
/**
* input_joypad_button_raw:
* @drv : Input device driver handle.
* @port : Joystick number.
* @button : Identifier of key.
*
* Checks if key (@button) was being pressed by user
* with joystick number @port.
*
* Returns: true (1) if key was pressed, otherwise
* false (0).
**/
static INLINE bool input_joypad_button_raw(const input_device_driver_t *drv,
unsigned port, unsigned button)
{
if (!drv)
return false;
return drv && drv->button(port, button);
}
static INLINE bool input_joypad_hat_raw(const input_device_driver_t *drv,
unsigned port, unsigned hat_dir, unsigned hat)
{
if (!drv)
return false;
return drv->button(port, HAT_MAP(hat, hat_dir));
}
/**
* input_pad_connect:
* @port : Joystick number.

View File

@ -69,6 +69,33 @@ struct menu_bind_state
static unsigned menu_bind_port = 0;
static struct menu_bind_state menu_input_binds = {0};
static bool input_joypad_button_raw(const input_device_driver_t *drv,
unsigned port, unsigned button)
{
if (!drv)
return false;
return drv && drv->button(port, button);
}
static int16_t input_joypad_axis_raw(
const input_device_driver_t *drv,
unsigned port, unsigned axis)
{
if (!drv)
return 0;
return drv->axis(port, AXIS_POS(axis)) +
drv->axis(port, AXIS_NEG(axis));
}
static bool input_joypad_hat_raw(const input_device_driver_t *drv,
unsigned port, unsigned hat_dir, unsigned hat)
{
if (!drv)
return false;
return drv->button(port, HAT_MAP(hat, hat_dir));
}
static bool menu_input_key_bind_custom_bind_keyboard_cb(
void *data, unsigned code)
{