Commit 5ab0126f authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

dinput: Fix phase conversion on periodic effects.

Based on idea by Elias Vanderstuyft. Signed-off-by: 's avatarBruno Jesus <00cpxxx@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 305d89f1
......@@ -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;
......
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