From fb451fb20374fdf5a3d636e75116daf41aeeecbc Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 24 Dec 2016 01:41:59 +0000 Subject: [PATCH] Add an OPENRA_DISPLAY_SCALE environment variable for linux. --- OpenRA.Platforms.Default/Sdl2GraphicsDevice.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/OpenRA.Platforms.Default/Sdl2GraphicsDevice.cs b/OpenRA.Platforms.Default/Sdl2GraphicsDevice.cs index 51b51f6293..7b743e2aaa 100644 --- a/OpenRA.Platforms.Default/Sdl2GraphicsDevice.cs +++ b/OpenRA.Platforms.Default/Sdl2GraphicsDevice.cs @@ -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);