Refactor away input_joypad_poll - trivial wrapper function

This commit is contained in:
twinaphex 2014-08-03 00:44:07 +02:00
parent 1ce72b3859
commit b76a2c2cee
10 changed files with 20 additions and 15 deletions

View File

@ -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++)

View File

@ -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;

View File

@ -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)

View File

@ -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)

View File

@ -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;

View File

@ -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)

View File

@ -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);
}

View File

@ -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)

View File

@ -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)

View File

@ -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);