| Summary: | HapticOpenFromJoystick() problems in 2.0.4 | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Joe Thompson <mini_joe> |
| Component: | haptic | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | icculus, mat.lau, mini_joe |
| Version: | HG 2.1 | ||
| Hardware: | x86_64 | ||
| OS: | Windows 7 | ||
| Attachments: | Proposed patch for 3021 | ||
|
Description
Joe Thompson
2015-06-16 04:07:37 UTC
Assigning Edgar's bugs to me. --ryan. Created attachment 2470 [details]
Proposed patch for 3021
I have attached a proposed patch for this issue. When using SDL_HapticOpenFromJoystick(), the original code did not (re)enumerate the axes. This returned a new haptic device with 0 axes. Later, when a new effect is created, SDL_SYS_SetDirection() would set the flags to include DIEFF_SPHERICAL, regardless of what the caller actually set. (see Line 566 in SDL_dinputhaptic.c). This would cause the SDL_HapticNewEffect() to fail (or interpret the coordinates incorreclty.) The patch moves the call to IDirectInputDevice8_EnumObjects() outside of the if() block so that the axes are (re)enumerated for the new haptic device. Note: For steering wheels it is common for the joystick to have multiple axes (ie steering, throttle, brake), but the haptic portion of the joystick usually only applies to steering. Joe I edited the title of this bug to reflect the fact that the issue is not isolated to the Release Candidate. Cheers, Joe I ran into the same issue with a Logitech Driving Force GT wheel. The proposed patch fixes it. Fixed, thanks! https://hg.libsdl.org/SDL/rev/ac6a748250f4 |