removed the "unfocused client" sleep path from the Windows main loop

This commit is contained in:
myT 2018-01-19 07:10:56 +01:00
parent 608ed06410
commit db37f4b8fb

View file

@ -746,21 +746,12 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
}
#ifndef DEDICATED
if (!com_dedicated->integer)
if ( !com_dedicated->integer )
Sys_InitInput();
#endif
int totalMsec = 0, countMsec = 0;
#endif
// main game loop
while (qtrue) {
// if running as a client but not focused, sleep a bit
// (servers have their own sleep path)
if ( !g_wv.activeApp && com_dedicated && !com_dedicated->integer )
Sleep( 5 );
int startTime = Sys_Milliseconds();
for (;;) {
#ifndef DEDICATED
// make sure mouse and joystick are only called once a frame
IN_Frame();
@ -769,9 +760,6 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
// run the game
Com_Frame();
totalMsec += Sys_Milliseconds() - startTime;
countMsec++;
}
// never gets here