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

Summary: Reported min/max value for coolie hats not used.
Product: SDL Reporter: Julian Raschke <julian>
Component: joystickAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: minor    
Priority: P2    
Version: HG 2.0   
Hardware: PowerPC   
OS: Mac OS X (All)   

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!