mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 01:16:26 +00:00
Haptic: Deal with negative periodic magnitudes (thanks, Elias!).
A negative periodic magnitude doesn't exist in Windows' and MacOS' FF APIs The periodic magnitude parameter of the SDL Haptic API is based on the Linux FF API, so it means they are not directly compatible: 'dwMagnitude' is a 'DWORD', which is unsigned. Fixes Bugzilla #2701.
This commit is contained in:
@@ -122,7 +122,8 @@ main(int argc, char **argv)
|
||||
SDL_Log(" effect %d: Sine Wave\n", nefx);
|
||||
efx[nefx].type = SDL_HAPTIC_SINE;
|
||||
efx[nefx].periodic.period = 1000;
|
||||
efx[nefx].periodic.magnitude = 0x4000;
|
||||
efx[nefx].periodic.magnitude = -0x2000; /* Negative magnitude and ... */
|
||||
efx[nefx].periodic.phase = 18000; /* ... 180 degrees phase shift => cancel eachother */
|
||||
efx[nefx].periodic.length = 5000;
|
||||
efx[nefx].periodic.attack_length = 1000;
|
||||
efx[nefx].periodic.fade_length = 1000;
|
||||
|
Reference in New Issue
Block a user