It's RageDisplay::EndFrame()'s job to give up CPU between frames. Currently,
we're doing this partially in EndFrame (in FrameLimitBeforeVsync and/or the actual vblank wait), and partially in RunGameLoop. These serve the same purpose, so merge them. (The renderer itself should have more control over this, but this is an improvement.)
This commit is contained in:
@@ -179,17 +179,6 @@ void GameLoop::RunGameLoop()
|
||||
* Render
|
||||
*/
|
||||
SCREENMAN->Draw();
|
||||
|
||||
/* If we don't have focus, give up lots of CPU. */
|
||||
// XXX: do this in DISPLAY EndFrame?
|
||||
if( !HOOKS->AppHasFocus() )
|
||||
usleep( 10000 );// 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
|
||||
usleep( 1000 ); // give some time to other processes and threads
|
||||
#endif
|
||||
}
|
||||
|
||||
if( ChangeAppPri() )
|
||||
|
||||
Reference in New Issue
Block a user