Ver código fonte

Removed SDL_XInputVersion, which isn't used

Sam Lantinga 5 meses atrás
pai
commit
6430aed3dd
2 arquivos alterados com 0 adições e 13 exclusões
  1. 0 12
      src/core/windows/SDL_xinput.c
  2. 0 1
      src/core/windows/SDL_xinput.h

+ 0 - 12
src/core/windows/SDL_xinput.c

@@ -32,7 +32,6 @@ XInputSetState_t SDL_XInputSetState = NULL;
 XInputGetCapabilities_t SDL_XInputGetCapabilities = NULL;
 XInputGetCapabilitiesEx_t SDL_XInputGetCapabilitiesEx = NULL;
 XInputGetBatteryInformation_t SDL_XInputGetBatteryInformation = NULL;
-DWORD SDL_XInputVersion = 0;
 
 static HMODULE s_pXInputDLL = NULL;
 static int s_XInputDLLRefCount = 0;
@@ -54,9 +53,6 @@ bool WIN_LoadXInputDLL(void)
     SDL_XInputGetCapabilities = (XInputGetCapabilities_t)XInputGetCapabilities;
     SDL_XInputGetBatteryInformation = (XInputGetBatteryInformation_t)XInputGetBatteryInformation;
 
-    // XInput 1.4 ships with Windows 8 and 8.1:
-    SDL_XInputVersion = (1 << 16) | 4;
-
     return true;
 }
 
@@ -68,8 +64,6 @@ void WIN_UnloadXInputDLL(void)
 
 bool WIN_LoadXInputDLL(void)
 {
-    DWORD version = 0;
-
     if (s_pXInputDLL) {
         SDL_assert(s_XInputDLLRefCount > 0);
         s_XInputDLLRefCount++;
@@ -80,15 +74,10 @@ bool WIN_LoadXInputDLL(void)
      * This is XInput emulation over Windows.Gaming.Input, and has all the
      * limitations of that API (no devices at startup, no background input, etc.)
      */
-    version = (1 << 16) | 4;
     s_pXInputDLL = LoadLibrary(TEXT("XInput1_4.dll")); // 1.4 Ships with Windows 8.
     if (!s_pXInputDLL) {
-        version = (1 << 16) | 3;
         s_pXInputDLL = LoadLibrary(TEXT("XInput1_3.dll")); // 1.3 can be installed as a redistributable component.
     }
-    if (!s_pXInputDLL) {
-        s_pXInputDLL = LoadLibrary(TEXT("bin\\XInput1_3.dll"));
-    }
     if (!s_pXInputDLL) {
         // "9.1.0" Ships with Vista and Win7, and is more limited than 1.3+ (e.g. XInputGetStateEx is not available.)
         s_pXInputDLL = LoadLibrary(TEXT("XInput9_1_0.dll"));
@@ -98,7 +87,6 @@ bool WIN_LoadXInputDLL(void)
     }
 
     SDL_assert(s_XInputDLLRefCount == 0);
-    SDL_XInputVersion = version;
     s_XInputDLLRefCount = 1;
 
     // 100 is the ordinal for _XInputGetStateEx, which returns the same struct as XinputGetState, but with extra data in wButtons for the guide button, we think...

+ 0 - 1
src/core/windows/SDL_xinput.h

@@ -260,7 +260,6 @@ extern XInputSetState_t SDL_XInputSetState;
 extern XInputGetCapabilities_t SDL_XInputGetCapabilities;
 extern XInputGetCapabilitiesEx_t SDL_XInputGetCapabilitiesEx;
 extern XInputGetBatteryInformation_t SDL_XInputGetBatteryInformation;
-extern DWORD SDL_XInputVersion; // ((major << 16) & 0xFF00) | (minor & 0xFF)
 
 // Ends C function definitions when using C++
 #ifdef __cplusplus