From 41575a63acdac7f9977708e9e55bc510af5e2ee8 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 20 Jan 2018 17:59:59 +0100 Subject: [PATCH] (XDK joypad) Cleanups --- input/drivers_joypad/xdk_joypad.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/input/drivers_joypad/xdk_joypad.c b/input/drivers_joypad/xdk_joypad.c index 4048eda468..91bac9ae1b 100644 --- a/input/drivers_joypad/xdk_joypad.c +++ b/input/drivers_joypad/xdk_joypad.c @@ -199,14 +199,17 @@ static void xdk_joypad_poll(void) * the device handle will be NULL. */ if (XInputPoll(gamepads[port]) != ERROR_SUCCESS) continue; - - if (XInputGetState(gamepads[port], &state_tmp) != ERROR_SUCCESS) - continue; -#elif defined(_XBOX360) - if (XInputGetState(port, &state_tmp) == ERROR_DEVICE_NOT_CONNECTED) - continue; #endif + if (XInputGetState( +#ifdef _XBOX + gamepads[port] +#else + port +#endif + , &state_tmp) == ERROR_DEVICE_NOT_CONNECTED) + continue; + state_cur = &pad_state[port]; *state_cur = 0;