Commit f5bf3630 authored by Tim Schumacher's avatar Tim Schumacher Committed by Alexandre Julliard

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: 's avatarTim Schumacher <timschumi@gmx.de> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 8bc52f52
......@@ -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;
......
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