We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 478 - Reported min/max value for coolie hats not used.
Summary: Reported min/max value for coolie hats not used.
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.0
Hardware: PowerPC Mac OS X (All)
: P2 minor
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-14 15:51 UTC by Julian Raschke
Modified: 2007-12-29 11:45 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Raschke 2007-08-14 15:51:34 UTC
Hi,

the OS X/Darwin coolie hat code assumes that all hats start at 0 and go to either 3 or 7. I have a gamepad that reports the range as 1 to 8. It can be made to work by subtracting 'min' from the reported element value, then switch()ing on it. Also, the checks for a 4- or 8-way coolie hat need to be changed from
if (max == 7)
to
if (max-min == 7)
and the same for 3, respectively.

Of course, I can't guarantee that this will break an even more exotic gamepad (one returning wrong min/max values) — but for mine, it worked.

Julian
Comment 1 Sam Lantinga 2007-12-29 11:45:36 UTC
This is fixed with revision 3490.  Thanks!