# HG changeset patch # User Ethan Lee # Date 1544124378 18000 # Thu Dec 06 14:26:18 2018 -0500 # Node ID d5ed4df47ec92e0ea9b6de96942511c22d768e67 # Parent b442834306a8d9143a9d3e8ed976c7d661594e55 Linux Haptic: Fix periodic.magnitude value diff -r b442834306a8 -r d5ed4df47ec9 src/haptic/linux/SDL_syshaptic.c --- a/src/haptic/linux/SDL_syshaptic.c Thu Dec 06 09:09:05 2018 -0800 +++ b/src/haptic/linux/SDL_syshaptic.c Thu Dec 06 14:26:18 2018 -0500 @@ -801,8 +801,7 @@ 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;