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 <julliard@winehq.org>
This commit is contained in:
Bruno Jesus 2016-08-25 17:39:03 -03:00 committed by Alexandre Julliard
parent 4712c65f5b
commit 7027e9b268
1 changed files with 2 additions and 2 deletions

View File

@ -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++;