Skip to content

Commit

Permalink
Removed hack - use xinputNotInstalled as a flag instead of reusing pX…
Browse files Browse the repository at this point in the history
…InputEnable
  • Loading branch information
CookiePLMonster authored and turtleli committed Nov 8, 2018
1 parent c280d69 commit b8b6a55
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/LilyPad/XInputEnum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ _XInputEnable pXInputEnable = 0;
_XInputGetStateEx pXInputGetStateEx = 0;
_XInputGetExtended pXInputGetExtended = 0;
_XInputSetState pXInputSetState = 0;
static bool xinputNotInstalled = false;

static int xInputActiveCount = 0;

Expand Down Expand Up @@ -269,9 +270,8 @@ void EnumXInputDevices()
{
wchar_t temp[30];
if (!pXInputSetState) {
// Also used as flag to indicute XInput not installed, so
// don't repeatedly try to load it.
if (pXInputEnable)
// XInput not installed, so don't repeatedly try to load it.
if (xinputNotInstalled)
return;

// Prefer XInput 1.3 since SCP only has an XInput 1.3 wrapper right now.
Expand All @@ -292,7 +292,7 @@ void EnumXInputDevices()
}
}
if (!pXInputSetState) {
pXInputEnable = (_XInputEnable)-1;
xinputNotInstalled = true;
return;
}
}
Expand Down

0 comments on commit b8b6a55

Please sign in to comment.