From dec7875a6e23212021e4d9080330a42832dfe02a Mon Sep 17 00:00:00 2001
From: Edward Rudd <urkle@outoforder.cc>
Date: Tue, 15 Jun 2021 01:40:19 +0000
Subject: [PATCH] update SDL soruce to 2.0.14

---
 source/src/joystick/hidapi/SDL_hidapijoystick_c.h |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/source/src/joystick/hidapi/SDL_hidapijoystick_c.h b/source/src/joystick/hidapi/SDL_hidapijoystick_c.h
index 562e8fa..5af5b08 100644
--- a/source/src/joystick/hidapi/SDL_hidapijoystick_c.h
+++ b/source/src/joystick/hidapi/SDL_hidapijoystick_c.h
@@ -32,22 +32,11 @@
 
 /* This is the full set of HIDAPI drivers available */
 #define SDL_JOYSTICK_HIDAPI_PS4
+#define SDL_JOYSTICK_HIDAPI_PS5
 #define SDL_JOYSTICK_HIDAPI_SWITCH
 #define SDL_JOYSTICK_HIDAPI_XBOX360
 #define SDL_JOYSTICK_HIDAPI_XBOXONE
 #define SDL_JOYSTICK_HIDAPI_GAMECUBE
-
-#ifdef __WINDOWS__
-/* On Windows, Xbox One controllers are handled by the Xbox 360 driver */
-#undef SDL_JOYSTICK_HIDAPI_XBOXONE
-/* It turns out HIDAPI for Xbox controllers doesn't allow background input */
-#undef SDL_JOYSTICK_HIDAPI_XBOX360
-#endif
-
-#ifdef __MACOSX__
-/* On Mac OS X, Xbox One controllers are handled by the Xbox 360 driver */
-#undef SDL_JOYSTICK_HIDAPI_XBOXONE
-#endif
 
 #if defined(__IPHONEOS__) || defined(__TVOS__) || defined(__ANDROID__)
 /* Very basic Steam Controller support on mobile devices */
@@ -67,6 +56,7 @@
     Uint16 vendor_id;
     Uint16 product_id;
     Uint16 version;
+    char *serial;
     SDL_JoystickGUID guid;
     int interface_number;   /* Available on Windows and Linux */
     int interface_class;
@@ -86,6 +76,9 @@
     /* Used during scanning for device changes */
     SDL_bool seen;
 
+    /* Used to flag that the device is being updated */
+    SDL_bool updating;
+
     struct _SDL_HIDAPI_Device *next;
 } SDL_HIDAPI_Device;
 
@@ -101,6 +94,10 @@
     SDL_bool (*UpdateDevice)(SDL_HIDAPI_Device *device);
     SDL_bool (*OpenJoystick)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick);
     int (*RumbleJoystick)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble);
+    int (*RumbleJoystickTriggers)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble);
+    SDL_bool (*HasJoystickLED)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick);
+    int (*SetJoystickLED)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
+    int (*SetJoystickSensorsEnabled)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled);
     void (*CloseJoystick)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick);
     void (*FreeDevice)(SDL_HIDAPI_Device *device);
 
@@ -109,6 +106,7 @@
 
 /* HIDAPI device support */
 extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverPS4;
+extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverPS5;
 extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverSteam;
 extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverSwitch;
 extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverXbox360;
@@ -123,6 +121,8 @@
 extern SDL_bool HIDAPI_JoystickConnected(SDL_HIDAPI_Device *device, SDL_JoystickID *pJoystickID);
 extern void HIDAPI_JoystickDisconnected(SDL_HIDAPI_Device *device, SDL_JoystickID joystickID);
 
+extern void HIDAPI_DumpPacket(const char *prefix, Uint8 *data, int size);
+
 #endif /* SDL_JOYSTICK_HIDAPI_H */
 
 /* vi: set ts=4 sw=4 expandtab: */

--
Gitblit v1.9.3