Re-added WinRT support until we're sure that it's no longer being used

This commit is contained in:
Sam Lantinga
2022-11-23 10:41:43 -08:00
parent d5572559a5
commit a635a485bc
92 changed files with 8410 additions and 164 deletions

View File

@@ -46,7 +46,11 @@ static char *s_arrXInputDevicePath[XUSER_MAX_COUNT];
static SDL_bool
SDL_XInputUseOldJoystickMapping()
{
#if defined(__XBOXONE__) || defined(__XBOXSERIES__)
#ifdef __WINRT__
/* TODO: remove this __WINRT__ block, but only after integrating with UWP/WinRT's HID API */
/* FIXME: Why are Win8/10 different here? -flibit */
return (NTDDI_VERSION < NTDDI_WIN10);
#elif defined(__XBOXONE__) || defined(__XBOXSERIES__)
return SDL_FALSE;
#else
static int s_XInputUseOldJoystickMapping = -1;
@@ -129,7 +133,7 @@ GetXInputName(const Uint8 userid, BYTE SubType)
static void
GuessXInputDevice(Uint8 userid, Uint16 *pVID, Uint16 *pPID, Uint16 *pVersion)
{
#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) /* TODO: remove this ifndef __WINRT__ block, but only after integrating with UWP/WinRT's HID API */
#if !defined(__WINRT__) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) /* TODO: remove this ifndef __WINRT__ block, but only after integrating with UWP/WinRT's HID API */
PRAWINPUTDEVICELIST devices = NULL;
UINT i, j, device_count = 0;
@@ -227,7 +231,7 @@ GuessXInputDevice(Uint8 userid, Uint16 *pVID, Uint16 *pPID, Uint16 *pVersion)
}
}
SDL_free(devices);
#endif
#endif /* !__WINRT__ */
/* The device wasn't in the raw HID device list, it's probably Bluetooth */
*pVID = 0x045e; /* Microsoft */