Linux Haptic: Fix periodic.magnitude value
authorEthan Lee <flibitijibibo@flibitijibibo.com>
Thu, 06 Dec 2018 14:26:18 -0500
changeset 124701f8d0b1afe07
parent 12469 99d8b18acf8a
child 12471 ae081435ba86
Linux Haptic: Fix periodic.magnitude value
src/haptic/linux/SDL_syshaptic.c
     1.1 --- a/src/haptic/linux/SDL_syshaptic.c	Sat Dec 08 11:22:50 2018 -0800
     1.2 +++ b/src/haptic/linux/SDL_syshaptic.c	Thu Dec 06 14:26:18 2018 -0500
     1.3 @@ -801,8 +801,7 @@
     1.4          else if (periodic->type == SDL_HAPTIC_SAWTOOTHDOWN)
     1.5              dest->u.periodic.waveform = FF_SAW_DOWN;
     1.6          dest->u.periodic.period = CLAMP(periodic->period);
     1.7 -        /* Linux expects 0-65535, so multiply by 2 */
     1.8 -        dest->u.periodic.magnitude = CLAMP(periodic->magnitude) * 2;
     1.9 +        dest->u.periodic.magnitude = periodic->magnitude;
    1.10          dest->u.periodic.offset = periodic->offset;
    1.11          /* Linux phase is defined in interval "[0x0000, 0x10000[", corresponds with "[0deg, 360deg[" phase shift. */
    1.12          dest->u.periodic.phase = ((Uint32)periodic->phase * 0x10000U) / 36000;