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.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41875 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2011-06-03 11:58:09 +00:00
parent 1291377a6e
commit 30e429b4e4
+2 -3
View File
@@ -521,9 +521,8 @@ BJoystick::Update()
// 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;
}