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 1371

Summary: DX Joystick Axis Ordering with Patch
Product: SDL Reporter: Alex Nankervis <anankervis>
Component: joystickAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: anankervis
Version: HG 2.0   
Hardware: x86   
OS: Windows 7   
Attachments: diff

Description Alex Nankervis 2012-01-15 11:19:45 UTC
Created attachment 772 [details]
diff

DirectX joysticks can enumerate their axis out of order. This results in some joysticks having vertical/horizontal swapped, for example (vertical axis gets assigned to axis0). Joysticks that I've tested with this problem: XBOX 360 controller, Logitech Extreme 3D Pro.

Attached is a diff that fixes this by sorting the DX joystick objects by their data offsets into the DX data structs. This puts the joystick objects into a standard ordering (X axis -> axis0, Y axis -> axis1, and so on).
Comment 1 Sam Lantinga 2012-01-15 12:49:10 UTC
Looks good, thanks!
http://hg.libsdl.org/SDL/rev/c36934808194