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 - DX Joystick Axis Ordering with Patch
Summary: DX Joystick Axis Ordering with Patch
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.0
Hardware: x86 Windows 7
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-15 11:19 UTC by Alex Nankervis
Modified: 2012-01-15 12:49 UTC (History)
1 user (show)

See Also:


Attachments
diff (2.19 KB, application/octet-stream)
2012-01-15 11:19 UTC, Alex Nankervis
Details

Note You need to log in before you can comment on or make changes to this bug.
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