mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-11 17:05:41 +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:
parent
266c0023da
commit
5f9ea7edeb
4 changed files with 11 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue