mirror of https://github.com/encounter/SDL.git
Linux Haptic: Fix periodic.magnitude value
This commit is contained in:
parent
39e8e3951c
commit
0b6e24f7e7
|
@ -801,8 +801,7 @@ SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src)
|
|||
else if (periodic->type == SDL_HAPTIC_SAWTOOTHDOWN)
|
||||
dest->u.periodic.waveform = FF_SAW_DOWN;
|
||||
dest->u.periodic.period = CLAMP(periodic->period);
|
||||
/* Linux expects 0-65535, so multiply by 2 */
|
||||
dest->u.periodic.magnitude = CLAMP(periodic->magnitude) * 2;
|
||||
dest->u.periodic.magnitude = periodic->magnitude;
|
||||
dest->u.periodic.offset = periodic->offset;
|
||||
/* Linux phase is defined in interval "[0x0000, 0x10000[", corresponds with "[0deg, 360deg[" phase shift. */
|
||||
dest->u.periodic.phase = ((Uint32)periodic->phase * 0x10000U) / 36000;
|
||||
|
|
Loading…
Reference in New Issue