Pull out game loop initialization from OpenRA.Program into OpenRA.Game and exception handling into its own class under OpenRA.Game/Support

This commit is contained in:
Pavel Penev
2017-11-27 18:17:54 +02:00
committed by reaperrr
parent f249554b4f
commit bd67bd24c0
4 changed files with 107 additions and 99 deletions

View File

@@ -249,7 +249,14 @@ namespace OpenRA
Settings = new Settings(Platform.ResolvePath(Path.Combine("^", "settings.yaml")), args);
}
internal static void Initialize(Arguments args)
public static RunStatus InitializeAndRun(string[] args)
{
Initialize(new Arguments(args));
GC.Collect();
return Run();
}
static void Initialize(Arguments args)
{
Console.WriteLine("Platform is {0}", Platform.CurrentPlatform);
@@ -790,7 +797,7 @@ namespace OpenRA
}
}
internal static RunStatus Run()
static RunStatus Run()
{
if (Settings.Graphics.MaxFramerate < 1)
{