Commit 7027e9b2 authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

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: 's avatarBruno Jesus <00cpxxx@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 4712c65f
......@@ -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++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment