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