Give up CPU on all archs when we don't have focus.

This commit is contained in:
Glenn Maynard
2003-08-29 04:44:03 +00:00
parent bef0031552
commit 7d208b71c0
+7 -5
View File
@@ -879,12 +879,14 @@ static void GameLoop()
*/ */
SCREENMAN->Draw(); SCREENMAN->Draw();
/* This is unneeded in OS X. The OS handles all of this for us. */ /* If we don't have focus, give up lots of CPU. */
#if !defined(DARWIN) if( !g_bHasFocus )
if(g_bHasFocus)
SDL_Delay( 1 ); // give some time to other processes and threads
else
SDL_Delay( 10 );// give some time to other processes and threads SDL_Delay( 10 );// give some time to other processes and threads
#if defined(_WINDOWS)
/* In Windows, we want to give up some CPU for other threads. Most OS's do
* this more intelligently. */
else
SDL_Delay( 1 ); // give some time to other processes and threads
#endif #endif
} }
} }