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:
parent
8bc52f5250
commit
f5bf3630db
|
@ -678,6 +678,8 @@ static DWORD WINAPI ff_input_thread(void *param)
|
||||||
DWORD flags = DIEP_AXES | DIEP_DIRECTION | DIEP_NORESTART;
|
DWORD flags = DIEP_AXES | DIEP_DIRECTION | DIEP_NORESTART;
|
||||||
RECT r;
|
RECT r;
|
||||||
|
|
||||||
|
Sleep(TEST_POLL_TIME);
|
||||||
|
|
||||||
/* Skip this if we have no effects */
|
/* Skip this if we have no effects */
|
||||||
if (joy->num_effects == 0 || chosen_effect < 0) continue;
|
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);
|
IDirectInputEffect_Start(joy->effects[chosen_effect].effect, 1, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Sleep(TEST_POLL_TIME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue