Skip to content
Permalink
Browse files

Call XInputGetState only when XInputGetExtended is not

  • Loading branch information...
CookiePLMonster authored and turtleli committed Oct 29, 2018
1 parent a3c6ad6 commit c280d69d6f3aa26d65428dcee07de3cf02ae609f
Showing with 6 additions and 5 deletions.
  1. +6 −5 plugins/LilyPad/XInputEnum.cpp
@@ -161,13 +161,14 @@ class XInputDevice : public Device
{
if (!active)
return 0;
XINPUT_STATE state;
if (ERROR_SUCCESS != pXInputGetStateEx(index, &state)) {
Deactivate();
return 0;
}
SCP_EXTN pressure;
if (!pXInputGetExtended || (ERROR_SUCCESS != pXInputGetExtended(index, &pressure))) {
XINPUT_STATE state;
if (ERROR_SUCCESS != pXInputGetStateEx(index, &state)) {
Deactivate();
return 0;
}

int buttons = state.Gamepad.wButtons;
for (int i = 0; i < 15; i++) {
physicalControlState[i] = ((buttons >> physicalControls[i].id) & 1) << 16;

0 comments on commit c280d69

Please sign in to comment.
You can’t perform that action at this time.