mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2025-02-17 01:11:20 +00:00
removed the "unfocused client" sleep path from the Windows main loop
This commit is contained in:
parent
608ed06410
commit
db37f4b8fb
1 changed files with 3 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue