From db37f4b8fb533a8bc979a1694899e038ef8630af Mon Sep 17 00:00:00 2001 From: myT Date: Fri, 19 Jan 2018 07:10:56 +0100 Subject: [PATCH] removed the "unfocused client" sleep path from the Windows main loop --- code/win32/win_main.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/code/win32/win_main.cpp b/code/win32/win_main.cpp index bf8b654..b538c31 100644 --- a/code/win32/win_main.cpp +++ b/code/win32/win_main.cpp @@ -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