Add an OPENRA_DISPLAY_SCALE environment variable for linux.

This commit is contained in:
Paul Chote
2016-12-24 01:41:59 +00:00
parent 87b894ad8e
commit fb451fb203

View File

@@ -88,6 +88,16 @@ namespace OpenRA.Platforms.Default
WindowSize = new Size((int)(SurfaceSize.Width / WindowScale), (int)(SurfaceSize.Height / WindowScale));
}
}
else
{
float scale = 1;
var scaleVariable = Environment.GetEnvironmentVariable("OPENRA_DISPLAY_SCALE");
if (scaleVariable != null && float.TryParse(scaleVariable, out scale))
{
WindowScale = scale;
WindowSize = new Size((int)(SurfaceSize.Width / WindowScale), (int)(SurfaceSize.Height / WindowScale));
}
}
Console.WriteLine("Using window scale {0:F2}", WindowScale);