[haiku-commits] r41875 - haiku/trunk/src/kits/device

  • From: mmlr@xxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 3 Jun 2011 13:58:10 +0200 (CEST)

Author: mmlr
Date: 2011-06-03 13:58:09 +0200 (Fri, 03 Jun 2011)
New Revision: 41875
Changeset: https://dev.haiku-os.org/changeset/41875

Modified:
   haiku/trunk/src/kits/device/Joystick.cpp
Log:
I was mislead by the legacy joystick structure data type for the axis values
(which is uint32), but the legacy BJoystick axis values are just the same int16
as the ones in extended mode, so nothing has to be done besides assigning them.


Modified: haiku/trunk/src/kits/device/Joystick.cpp
===================================================================
--- haiku/trunk/src/kits/device/Joystick.cpp    2011-06-03 10:30:03 UTC (rev 
41874)
+++ haiku/trunk/src/kits/device/Joystick.cpp    2011-06-03 11:58:09 UTC (rev 
41875)
@@ -521,9 +521,8 @@
 
                // fill in the legacy values for the first stick
                timestamp = extendedJoystick->timestamp;
-               horizontal = (uint32)((int32)extendedJoystick->axes[0] + 32768);
-               vertical = (uint32)((int32)extendedJoystick->axes[1] + 32768);
-                       // TODO: if we really want to go that far: scale the 
value correctly
+               horizontal = extendedJoystick->axes[0];
+               vertical = extendedJoystick->axes[1];
                button1 = (extendedJoystick->buttons & 1) == 0;
                button2 = (extendedJoystick->buttons & 2) == 0;
        }


Other related posts:

  • » [haiku-commits] r41875 - haiku/trunk/src/kits/device - mmlr