joy.cpl: Fix high CPU load in FF test window.

If no effects are in the effects list, the loop in ff_input_thread
is immediately restarted, skipping the poll interval. This causes an
incredibly high refresh rate, which maxes out at least one CPU core.

Signed-off-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Tim Schumacher 2019-05-19 00:43:17 +02:00 committed by Alexandre Julliard
parent 8bc52f5250
commit f5bf3630db
1 changed files with 2 additions and 2 deletions

View File

@ -678,6 +678,8 @@ static DWORD WINAPI ff_input_thread(void *param)
DWORD flags = DIEP_AXES | DIEP_DIRECTION | DIEP_NORESTART;
RECT r;
Sleep(TEST_POLL_TIME);
/* Skip this if we have no effects */
if (joy->num_effects == 0 || chosen_effect < 0) continue;
@ -702,8 +704,6 @@ static DWORD WINAPI ff_input_thread(void *param)
IDirectInputEffect_Start(joy->effects[chosen_effect].effect, 1, 0);
break;
}
Sleep(TEST_POLL_TIME);
}
return 0;