Emulator Issues #6491
closed
SDL_HAPTIC_SQUARE not decleared in final SDL 2.0 release.
Added by phire over 11 years ago.
Relates to performance:
No
Relates to maintainability:
No
Description
Dolphin doesn't compile with the final release of SDL 2.0
/home/phire/projects/dolphin-emu/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp:135: error: 'SDL_HAPTIC_SQUARE' was not declared in this scope
if (supported_effects & SDL_HAPTIC_SQUARE)
^
From SDL_haptic.h:
/**
* \brief Left/Right effect supported.
*
* Haptic effect for direct control over high/low frequency motors.
*
* \sa SDL_HapticLeftRight
* \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry,
* we ran out of bits, and this is important for XInput devices.
*/
#define SDL_HAPTIC_LEFTRIGHT (1<<2)
/* !!! FIXME: put this back when we have more bits in 2.1 */
/*#define SDL_HAPTIC_SQUARE (1<<2)*/
- Status changed from New to Accepted
- Priority set to Urgent
- Milestone set to Current
- Operating system N/A added
I need to do more testing with the SDL 2.0 release - we want to make sure Dolphin 4.0 will interact well with it.
The name of SDL_HAPTIC_SQUARE was changed to SDL_HAPTIC_LEFTRIGHT as per commit 7621 of SDL 2.0
The attached patch makes that simple fix and it builds and runs great for me.
It seems a comment should be added about why this is being changed. According to the header, this is a problem specific to this 2.0 release and should be fixed in coming versions.
No, that don't seem right.
SDL_HAPTIC_SQUARE (a motor generating a square wave) was replaced with SDL_HAPTIC_LEFTRIGHT (a low frequency linear actuator, used to shift weight from one side of the controller to the other), a completely different capability.
They ran out of bits to describe capabilities and decided LEFTRIGHT was more important than SQUARE.
Would probably be better to do something along the lines of adding an #ifdef SDL_HAPTIC_SQUARE around the blocks of code which use it, that way it will still work on older versions of SDL and possibly newer versions once they add support back in.
Um so what should one use instead of SDL_HAPTIC_SQUARE ?
SDL_HAPTIC_SQUARE is effectively disabled in this release of SDL without an alternative. PhireN's suggestion sounds reasonable, can we see a patch for that?
(Hi, I'm the person that disabled SDL_HAPTIC_SQUARE.)
We needed a way to map Microsoft's XInput API to the haptic subsystem...it only lets you power the two motors in the X360 controller at different speeds. Normally we would just add another capability bit, but as was noted, we didn't have any left and couldn't break the ABI for existing games by moving from 16 to 32 bits.
We felt it was less risky (although not awesome) to pick an effect people weren't likely to be using.
If you are legitimately in need of SDL_HAPTIC_SQUARE, you should use SDL_HAPTIC_SINE and maybe increase the magnitude a little...it's close enough in most cases.
This wasn't an ideal solution, and we apologize for the inconvenience. We'll fix this in 2.1, when we can break the ABI again, but that's some time out still.
--ryan.
- Status changed from Accepted to Fixed
Fixed by revision c3065ecb6697. Thanks for the info, Ryan.
Also available in: Atom
PDF