Removed hack - use xinputNotInstalled as a flag instead of reusing pXInputEnable

This commit is contained in:
Silent 2018-11-08 10:28:16 +01:00 committed by Jonathan Li
parent c280d69d6f
commit b8b6a55952
1 changed files with 4 additions and 4 deletions

View File

@ -70,6 +70,7 @@ _XInputEnable pXInputEnable = 0;
_XInputGetStateEx pXInputGetStateEx = 0; _XInputGetStateEx pXInputGetStateEx = 0;
_XInputGetExtended pXInputGetExtended = 0; _XInputGetExtended pXInputGetExtended = 0;
_XInputSetState pXInputSetState = 0; _XInputSetState pXInputSetState = 0;
static bool xinputNotInstalled = false;
static int xInputActiveCount = 0; static int xInputActiveCount = 0;
@ -269,9 +270,8 @@ void EnumXInputDevices()
{ {
wchar_t temp[30]; wchar_t temp[30];
if (!pXInputSetState) { if (!pXInputSetState) {
// Also used as flag to indicute XInput not installed, so // XInput not installed, so don't repeatedly try to load it.
// don't repeatedly try to load it. if (xinputNotInstalled)
if (pXInputEnable)
return; return;
// Prefer XInput 1.3 since SCP only has an XInput 1.3 wrapper right now. // Prefer XInput 1.3 since SCP only has an XInput 1.3 wrapper right now.
@ -292,7 +292,7 @@ void EnumXInputDevices()
} }
} }
if (!pXInputSetState) { if (!pXInputSetState) {
pXInputEnable = (_XInputEnable)-1; xinputNotInstalled = true;
return; return;
} }
} }