Refactor away input_joypad_poll - trivial wrapper function
This commit is contained in:
parent
1ce72b3859
commit
b76a2c2cee
|
@ -171,7 +171,9 @@ void menu_poll_bind_state(struct menu_bind_state *state)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
input_joypad_poll(joypad);
|
if (joypad)
|
||||||
|
joypad->poll();
|
||||||
|
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_PLAYERS; i++)
|
||||||
{
|
{
|
||||||
for (b = 0; b < MENU_MAX_BUTTONS; b++)
|
for (b = 0; b < MENU_MAX_BUTTONS; b++)
|
||||||
|
|
|
@ -512,7 +512,9 @@ static void apple_input_poll(void *data)
|
||||||
&g_current_input_data.touches[i].full_x, &g_current_input_data.touches[i].full_y);
|
&g_current_input_data.touches[i].full_x, &g_current_input_data.touches[i].full_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
input_joypad_poll(joypad);
|
if (joypad)
|
||||||
|
joypad->poll();
|
||||||
|
|
||||||
g_current_input_data.pad_buttons[0] |= apple_input_get_icade_buttons();
|
g_current_input_data.pad_buttons[0] |= apple_input_get_icade_buttons();
|
||||||
|
|
||||||
g_current_input_data.mouse_delta[0] = 0;
|
g_current_input_data.mouse_delta[0] = 0;
|
||||||
|
|
|
@ -201,7 +201,8 @@ static void dinput_poll(void *data)
|
||||||
di->mouse_y = point.y;
|
di->mouse_y = point.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
input_joypad_poll(di->joypad);
|
if (di->joypad)
|
||||||
|
di->joypad->poll();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool dinput_keyboard_pressed(struct dinput_input *di, unsigned key)
|
static bool dinput_keyboard_pressed(struct dinput_input *di, unsigned key)
|
||||||
|
|
|
@ -120,12 +120,6 @@ const rarch_joypad_driver_t *input_joypad_init_first(void)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void input_joypad_poll(const rarch_joypad_driver_t *driver)
|
|
||||||
{
|
|
||||||
if (driver)
|
|
||||||
driver->poll();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *input_joypad_name(const rarch_joypad_driver_t *driver, unsigned joypad)
|
const char *input_joypad_name(const rarch_joypad_driver_t *driver, unsigned joypad)
|
||||||
{
|
{
|
||||||
if (!driver)
|
if (!driver)
|
||||||
|
|
|
@ -97,7 +97,6 @@ bool input_joypad_button_raw(const rarch_joypad_driver_t *driver,
|
||||||
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);
|
||||||
|
|
||||||
void input_joypad_poll(const rarch_joypad_driver_t *driver);
|
|
||||||
const char *input_joypad_name(const rarch_joypad_driver_t *driver, unsigned joypad);
|
const char *input_joypad_name(const rarch_joypad_driver_t *driver, unsigned joypad);
|
||||||
|
|
||||||
extern const rarch_joypad_driver_t dinput_joypad;
|
extern const rarch_joypad_driver_t dinput_joypad;
|
||||||
|
|
|
@ -222,7 +222,8 @@ static void linuxraw_input_poll(void *data)
|
||||||
linuxraw->state[c] = pressed;
|
linuxraw->state[c] = pressed;
|
||||||
}
|
}
|
||||||
|
|
||||||
input_joypad_poll(linuxraw->joypad);
|
if (linuxraw->joypad)
|
||||||
|
linuxraw->joypad->poll();
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint64_t linuxraw_get_capabilities(void *data)
|
static uint64_t linuxraw_get_capabilities(void *data)
|
||||||
|
|
|
@ -263,7 +263,8 @@ static void sdl_input_poll(void *data)
|
||||||
SDL_PumpEvents();
|
SDL_PumpEvents();
|
||||||
sdl_input_t *sdl = (sdl_input_t*)data;
|
sdl_input_t *sdl = (sdl_input_t*)data;
|
||||||
|
|
||||||
input_joypad_poll(sdl->joypad);
|
if (sdl->joypad)
|
||||||
|
sdl->joypad->poll();
|
||||||
sdl_poll_mouse(sdl);
|
sdl_poll_mouse(sdl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -442,7 +442,8 @@ static void udev_input_poll(void *data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input_joypad_poll(udev->joypad);
|
if (udev->joypad)
|
||||||
|
udev->joypad->poll();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int16_t udev_mouse_state(udev_input_t *udev, unsigned id)
|
static int16_t udev_mouse_state(udev_input_t *udev, unsigned id)
|
||||||
|
|
|
@ -283,7 +283,9 @@ static void x_input_poll(void *data)
|
||||||
memset(x11->state, 0, sizeof(x11->state));
|
memset(x11->state, 0, sizeof(x11->state));
|
||||||
|
|
||||||
x_input_poll_mouse(x11);
|
x_input_poll_mouse(x11);
|
||||||
input_joypad_poll(x11->joypad);
|
|
||||||
|
if (x11->joypad)
|
||||||
|
x11->joypad->poll();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void x_grab_mouse(void *data, bool state)
|
static void x_grab_mouse(void *data, bool state)
|
||||||
|
|
|
@ -78,7 +78,9 @@ static void poll_joypad(const rarch_joypad_driver_t *driver,
|
||||||
struct poll_data *data)
|
struct poll_data *data)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
input_joypad_poll(driver);
|
|
||||||
|
if (driver)
|
||||||
|
driver->poll();
|
||||||
|
|
||||||
for (i = 0; i < MAX_BUTTONS; i++)
|
for (i = 0; i < MAX_BUTTONS; i++)
|
||||||
data->buttons[i] = input_joypad_button_raw(driver, pad, i);
|
data->buttons[i] = input_joypad_button_raw(driver, pad, i);
|
||||||
|
|
Loading…
Reference in New Issue