From 7027e9b268e30b64ee9fe336dca19a1b1e1794bd Mon Sep 17 00:00:00 2001 From: Bruno Jesus <00cpxxx@gmail.com> Date: Thu, 25 Aug 2016 17:39:03 -0300 Subject: [PATCH] dinput: Fix saturation range on condition effects. Based on ideas by Elias Vanderstuyft. The saturation is unsigned short, so the limit is 0xffff, not 0x7fff. Signed-off-by: Bruno Jesus <00cpxxx@gmail.com> Signed-off-by: Alexandre Julliard --- dlls/dinput/effect_linuxinput.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/dinput/effect_linuxinput.c b/dlls/dinput/effect_linuxinput.c index 82e5bb5847e..10151058fe5 100644 --- a/dlls/dinput/effect_linuxinput.c +++ b/dlls/dinput/effect_linuxinput.c @@ -680,8 +680,8 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters( cond[i].center = (int)(factor[i] * (tsp[j].lOffset / 10) * 32); cond[i].right_coeff = (int)(factor[i] * (tsp[j].lPositiveCoefficient / 10) * 32); cond[i].left_coeff = (int)(factor[i] * (tsp[j].lNegativeCoefficient / 10) * 32); - cond[i].right_saturation = (int)(factor[i] * (tsp[j].dwPositiveSaturation / 10) * 32); - cond[i].left_saturation = (int)(factor[i] * (tsp[j].dwNegativeSaturation / 10) * 32); + cond[i].right_saturation = (int)(factor[i] * (tsp[j].dwPositiveSaturation / 10) * 65); + cond[i].left_saturation = (int)(factor[i] * (tsp[j].dwNegativeSaturation / 10) * 65); cond[i].deadband = (int)(factor[i] * (tsp[j].lDeadBand / 10) * 32); if (sources == 2) j++;