Fix broken controller/joystick button and axis events
authorWuzzy <Wuzzy2@mail.ru>
Fri, 20 Jul 2018 14:33:41 +0200
changeset 13523 122e08d45caa
parent 13522 873b7d32bc97
child 13524 1232ab8206d4
Fix broken controller/joystick button and axis events The problem were bad records in SDLh.pas
hedgewars/SDLh.pas
--- a/hedgewars/SDLh.pas	Fri Jul 20 12:51:16 2018 +0200
+++ b/hedgewars/SDLh.pas	Fri Jul 20 14:33:41 2018 +0200
@@ -553,6 +553,7 @@
     TSDL_FingerId = Int64;
     TSDL_Keycode = LongInt;
     TSDL_Scancode = LongInt;
+    TSDL_JoystickID = LongInt;
 
     TSDL_eventaction = (SDL_ADDEVENT, SDL_PEEPEVENT, SDL_GETEVENT);
 
@@ -765,7 +766,7 @@
     TSDL_ControllerAxisEvent = record
         type_: LongWord;
         timestamp: LongWord;
-        which: LongInt;
+        which: TSDL_JoystickID;
         axis, padding1, padding2, padding3: Byte;
         value: SmallInt;
         padding4: Word;
@@ -774,14 +775,14 @@
     TSDL_ControllerButtonEvent = record
         type_: LongWord;
         timestamp: LongWord;
-        which: LongInt;
+        which: TSDL_JoystickID;
         button, states, padding1, padding2: Byte;
         end;
 
     TSDL_ControllerDeviceEvent = record
         type_: LongWord;
         timestamp: LongWord;
-        which: SmallInt;
+        which: LongInt;
         end;
 
     TSDL_JoyDeviceEvent = TSDL_ControllerDeviceEvent;
@@ -829,17 +830,17 @@
     TSDL_JoyAxisEvent = record
         type_: LongWord;
         timestamp: LongWord;
-        which: LongWord;
+        which: TSDL_JoystickID;
         axis: Byte;
         padding1, padding2, padding3: Byte;
-        value: LongInt;
+        value: SmallInt;
         padding4: Word;
         end;
 
     TSDL_JoyBallEvent = record
         type_: LongWord;
         timestamp: LongWord;
-        which: LongWord;
+        which: TSDL_JoystickID;
         ball: Byte;
         padding1, padding2, padding3: Byte;
         xrel, yrel: SmallInt;
@@ -848,7 +849,7 @@
     TSDL_JoyHatEvent = record
         type_: LongWord;
         timestamp: LongWord;
-        which: LongWord;
+        which: TSDL_JoystickID;
         hat: Byte;
         value: Byte;
         padding1, padding2: Byte;
@@ -857,10 +858,11 @@
     TSDL_JoyButtonEvent = record
         type_: LongWord;
         timestamp: LongWord;
-        which: Byte;
+        which: TSDL_JoystickID;
         button: Byte;
         state: Byte;
         padding1: Byte;
+        padding2: Byte;
         end;
 
     TSDL_QuitEvent = record