add framelimiter as per Joseph_Vissarion's patch
This commit is contained in:
@@ -326,8 +326,20 @@ namespace OpenRA
|
||||
internal static void Run()
|
||||
{
|
||||
while (!quit)
|
||||
{
|
||||
var idealFrameTime = 1.0 / Settings.Graphics.MaxFramerate;
|
||||
var sw = new Stopwatch();
|
||||
|
||||
Tick( orderManager, viewport );
|
||||
|
||||
if (Settings.Graphics.CapFramerate)
|
||||
{
|
||||
var waitTime = idealFrameTime - sw.ElapsedTime();
|
||||
if (waitTime > 0)
|
||||
System.Threading.Thread.Sleep( TimeSpan.FromSeconds(waitTime) );
|
||||
}
|
||||
}
|
||||
|
||||
OnQuit();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user