From 30e429b4e4500329a98dca269a970d73fb5e5359 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Fri, 3 Jun 2011 11:58:09 +0000 Subject: [PATCH] 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 --- src/kits/device/Joystick.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/kits/device/Joystick.cpp b/src/kits/device/Joystick.cpp index 3d5d27f2af..45e5dc8010 100644 --- a/src/kits/device/Joystick.cpp +++ b/src/kits/device/Joystick.cpp @@ -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; }