|
Bug? Joystick in OSX |
Trumgottist
Member #95
April 2000
|
Unless I'm doing something stupid, I think I've found a bug. The JOYSTICK_SIGNED / JOYSTICK_UNSIGNED flags seem to be improperly set. All my sticks report that they are signed, while some of them give position between 0 and 255. (Some give -128 to 128 as expected.) I test for the flag with if (joy[h].stick[c].flags & JOYFLAG_SIGNED) and check the status with joy[h].stick[c].axis[w].pos. That's right, isn't it? .
Edit 2: Correction. It doesn't need to be calibrated. (I did a mistake when checking that flag. Forgot the parentheses.) The original post still stands. In case it matters, I'm using a Thrustmaster Dual Power 3 gamepad and Allegro 4.2.1. --- Edit 3: I've been looking at the Allegro sources and, while I haven't tested anything yet, I think I've found the bug. In hidjoy.m in the macosx sources, in hid_joy_init, all axis are given the signed flag, while in hid_joy_poll HID_ELEMENT_STANDALONE_AXIS is given unsigned values. I'll try changing it and report back. --- Edit 4: Yep, that did it. Now I get values that work. -- Play my game: Frasse and the Peas of Kejick |
Peter Wang
Member #23
April 2000
|
Send a patch?
|
Trumgottist
Member #95
April 2000
|
How? -- Play my game: Frasse and the Peas of Kejick |
Matthew Leverton
Supreme Loser
January 1999
|
diff -wup oldfile newfile > foo.diff -w to ignore whitespace changes |
Elias
Member #358
May 2000
|
Or alternatively, get svn and do: svn co https://alleg.svn.sourceforge.net/svnroot/alleg/allegro/branches/4.2 svn diff filename > foo.diff
-- |
Trumgottist
Member #95
April 2000
|
Ok, thanks. I'll do that tomorrow. Edit: Done. -- Play my game: Frasse and the Peas of Kejick |
Peter Wang
Member #23
April 2000
|
I assume it's right and committed it.
|
|