dinput: Fix phase conversion on periodic effects.

Based on idea by Elias Vanderstuyft.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Bruno Jesus 2016-09-14 02:25:32 -03:00 committed by Alexandre Julliard
parent 305d89f1ed
commit 5ab0126f1d
1 changed files with 2 additions and 1 deletions

View File

@ -632,7 +632,8 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters(
This->effect.u.periodic.magnitude = (tsp->dwMagnitude / 10) * 32;
This->effect.u.periodic.offset = (tsp->lOffset / 10) * 32;
This->effect.u.periodic.phase = (tsp->dwPhase / 9) * 8; /* == (/ 36 * 32) */
/* phase ranges from 0 - 35999 in dinput and 0 - 65535 on linux */
This->effect.u.periodic.phase = (tsp->dwPhase / 36) * 65;
/* dinput uses microseconds, linux uses miliseconds */
if (tsp->dwPeriod <= 1000)
This->effect.u.periodic.period = 1;