[PATCH 2/2] dinput: Fix saturation range on condition effects

Bruno Jesus 00cpxxx at gmail.com
Thu Aug 25 15:39:03 CDT 2016


Based on ideas by Elias Vanderstuyft.

The saturation is unsigned short, so the limit is 0xffff, not 0x7fff.

Signed-off-by: Bruno Jesus <00cpxxx at gmail.com>
---
 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 82e5bb5..1015105 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++;
-- 
2.9.3




More information about the wine-patches mailing list