From 0b6e24f7e731abe8ac75be044f75cf86a865c9b5 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Thu, 6 Dec 2018 14:26:18 -0500 Subject: [PATCH] Linux Haptic: Fix periodic.magnitude value --- src/haptic/linux/SDL_syshaptic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/haptic/linux/SDL_syshaptic.c b/src/haptic/linux/SDL_syshaptic.c index 4e4f8a5f2f5d0..71533b46568a6 100644 --- a/src/haptic/linux/SDL_syshaptic.c +++ b/src/haptic/linux/SDL_syshaptic.c @@ -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;