mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
WinRT: fixed build error in latest XInput code
This change has also been tested as buildable + runnable on Win32 + MSVC 2015, 2013, 2012, and 2010. It may fix similar build errors (in XInput code) that are appearing in MingW builds (on buildbot).
This commit is contained in:
parent
f09d3750ea
commit
dc804c0e1a
@ -118,11 +118,11 @@ typedef struct
|
|||||||
XINPUT_GAMEPAD_EX Gamepad;
|
XINPUT_GAMEPAD_EX Gamepad;
|
||||||
} XINPUT_STATE_EX;
|
} XINPUT_STATE_EX;
|
||||||
|
|
||||||
typedef struct _XINPUT_BATTERY_INFORMATION
|
typedef struct
|
||||||
{
|
{
|
||||||
BYTE BatteryType;
|
BYTE BatteryType;
|
||||||
BYTE BatteryLevel;
|
BYTE BatteryLevel;
|
||||||
} XINPUT_BATTERY_INFORMATION, *PXINPUT_BATTERY_INFORMATION;
|
} XINPUT_BATTERY_INFORMATION_EX;
|
||||||
|
|
||||||
/* Forward decl's for XInput API's we load dynamically and use if available */
|
/* Forward decl's for XInput API's we load dynamically and use if available */
|
||||||
typedef DWORD (WINAPI *XInputGetState_t)
|
typedef DWORD (WINAPI *XInputGetState_t)
|
||||||
@ -148,7 +148,7 @@ typedef DWORD (WINAPI *XInputGetBatteryInformation_t)
|
|||||||
(
|
(
|
||||||
_In_ DWORD dwUserIndex,
|
_In_ DWORD dwUserIndex,
|
||||||
_In_ BYTE devType,
|
_In_ BYTE devType,
|
||||||
_Out_ XINPUT_BATTERY_INFORMATION *pBatteryInformation
|
_Out_ XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation
|
||||||
);
|
);
|
||||||
|
|
||||||
extern int WIN_LoadXInputDLL(void);
|
extern int WIN_LoadXInputDLL(void);
|
||||||
|
@ -222,7 +222,7 @@ SDL_XINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickde
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
UpdateXInputJoystickBatteryInformation(SDL_Joystick * joystick, XINPUT_BATTERY_INFORMATION *pBatteryInformation)
|
UpdateXInputJoystickBatteryInformation(SDL_Joystick * joystick, XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation)
|
||||||
{
|
{
|
||||||
if ( pBatteryInformation->BatteryType != BATTERY_TYPE_UNKNOWN )
|
if ( pBatteryInformation->BatteryType != BATTERY_TYPE_UNKNOWN )
|
||||||
{
|
{
|
||||||
@ -253,7 +253,7 @@ UpdateXInputJoystickBatteryInformation(SDL_Joystick * joystick, XINPUT_BATTERY_I
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
UpdateXInputJoystickState_OLD(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState, XINPUT_BATTERY_INFORMATION *pBatteryInformation)
|
UpdateXInputJoystickState_OLD(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState, XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation)
|
||||||
{
|
{
|
||||||
static WORD s_XInputButtons[] = {
|
static WORD s_XInputButtons[] = {
|
||||||
XINPUT_GAMEPAD_DPAD_UP, XINPUT_GAMEPAD_DPAD_DOWN, XINPUT_GAMEPAD_DPAD_LEFT, XINPUT_GAMEPAD_DPAD_RIGHT,
|
XINPUT_GAMEPAD_DPAD_UP, XINPUT_GAMEPAD_DPAD_DOWN, XINPUT_GAMEPAD_DPAD_LEFT, XINPUT_GAMEPAD_DPAD_RIGHT,
|
||||||
@ -280,7 +280,7 @@ UpdateXInputJoystickState_OLD(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputS
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
UpdateXInputJoystickState(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState, XINPUT_BATTERY_INFORMATION *pBatteryInformation)
|
UpdateXInputJoystickState(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState, XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation)
|
||||||
{
|
{
|
||||||
static WORD s_XInputButtons[] = {
|
static WORD s_XInputButtons[] = {
|
||||||
XINPUT_GAMEPAD_A, XINPUT_GAMEPAD_B, XINPUT_GAMEPAD_X, XINPUT_GAMEPAD_Y,
|
XINPUT_GAMEPAD_A, XINPUT_GAMEPAD_B, XINPUT_GAMEPAD_X, XINPUT_GAMEPAD_Y,
|
||||||
@ -325,7 +325,7 @@ SDL_XINPUT_JoystickUpdate(SDL_Joystick * joystick)
|
|||||||
{
|
{
|
||||||
HRESULT result;
|
HRESULT result;
|
||||||
XINPUT_STATE_EX XInputState;
|
XINPUT_STATE_EX XInputState;
|
||||||
XINPUT_BATTERY_INFORMATION XBatteryInformation;
|
XINPUT_BATTERY_INFORMATION_EX XBatteryInformation;
|
||||||
|
|
||||||
if (!XINPUTGETSTATE)
|
if (!XINPUTGETSTATE)
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user