mirror of
https://github.com/libretro/RetroArch
synced 2025-01-27 03:35:22 +00:00
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;
|
||||
}
|
||||
|
||||
input_joypad_poll(joypad);
|
||||
if (joypad)
|
||||
joypad->poll();
|
||||
|
||||
for (i = 0; i < MAX_PLAYERS; i++)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
input_joypad_poll(joypad);
|
||||
if (joypad)
|
||||
joypad->poll();
|
||||
|
||||
g_current_input_data.pad_buttons[0] |= apple_input_get_icade_buttons();
|
||||
|
||||
g_current_input_data.mouse_delta[0] = 0;
|
||||
|
@ -201,7 +201,8 @@ static void dinput_poll(void *data)
|
||||
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)
|
||||
|
@ -120,12 +120,6 @@ const rarch_joypad_driver_t *input_joypad_init_first(void)
|
||||
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)
|
||||
{
|
||||
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,
|
||||
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);
|
||||
|
||||
extern const rarch_joypad_driver_t dinput_joypad;
|
||||
|
@ -222,7 +222,8 @@ static void linuxraw_input_poll(void *data)
|
||||
linuxraw->state[c] = pressed;
|
||||
}
|
||||
|
||||
input_joypad_poll(linuxraw->joypad);
|
||||
if (linuxraw->joypad)
|
||||
linuxraw->joypad->poll();
|
||||
}
|
||||
|
||||
static uint64_t linuxraw_get_capabilities(void *data)
|
||||
|
@ -263,7 +263,8 @@ static void sdl_input_poll(void *data)
|
||||
SDL_PumpEvents();
|
||||
sdl_input_t *sdl = (sdl_input_t*)data;
|
||||
|
||||
input_joypad_poll(sdl->joypad);
|
||||
if (sdl->joypad)
|
||||
sdl->joypad->poll();
|
||||
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)
|
||||
|
@ -283,7 +283,9 @@ static void x_input_poll(void *data)
|
||||
memset(x11->state, 0, sizeof(x11->state));
|
||||
|
||||
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)
|
||||
|
@ -78,7 +78,9 @@ static void poll_joypad(const rarch_joypad_driver_t *driver,
|
||||
struct poll_data *data)
|
||||
{
|
||||
unsigned i;
|
||||
input_joypad_poll(driver);
|
||||
|
||||
if (driver)
|
||||
driver->poll();
|
||||
|
||||
for (i = 0; i < MAX_BUTTONS; i++)
|
||||
data->buttons[i] = input_joypad_button_raw(driver, pad, i);
|
||||
|
Loading…
x
Reference in New Issue
Block a user