Merge pull request #13127 from obrakmann/fix13099_disableDpiScalingSetting
Add a setting to disable DPI scaling on Windows systems
This commit is contained in:
@@ -118,6 +118,9 @@ namespace OpenRA
|
|||||||
[Desc("At which frames per second to cap the framerate.")]
|
[Desc("At which frames per second to cap the framerate.")]
|
||||||
public int MaxFramerate = 60;
|
public int MaxFramerate = 60;
|
||||||
|
|
||||||
|
[Desc("Disable high resolution DPI scaling on Windows operating systems.")]
|
||||||
|
public bool DisableWindowsDPIScaling = false;
|
||||||
|
|
||||||
public int BatchSize = 8192;
|
public int BatchSize = 8192;
|
||||||
public int SheetSize = 2048;
|
public int SheetSize = 2048;
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace OpenRA.Platforms.Default
|
|||||||
WindowSize = windowSize;
|
WindowSize = windowSize;
|
||||||
|
|
||||||
// Disable legacy scaling on Windows
|
// Disable legacy scaling on Windows
|
||||||
if (Platform.CurrentPlatform == PlatformType.Windows)
|
if (Platform.CurrentPlatform == PlatformType.Windows && !Game.Settings.Graphics.DisableWindowsDPIScaling)
|
||||||
SetProcessDPIAware();
|
SetProcessDPIAware();
|
||||||
|
|
||||||
SDL.SDL_Init(SDL.SDL_INIT_NOPARACHUTE | SDL.SDL_INIT_VIDEO);
|
SDL.SDL_Init(SDL.SDL_INIT_NOPARACHUTE | SDL.SDL_INIT_VIDEO);
|
||||||
@@ -82,7 +82,7 @@ namespace OpenRA.Platforms.Default
|
|||||||
else if (Platform.CurrentPlatform == PlatformType.Windows)
|
else if (Platform.CurrentPlatform == PlatformType.Windows)
|
||||||
{
|
{
|
||||||
float ddpi, hdpi, vdpi;
|
float ddpi, hdpi, vdpi;
|
||||||
if (SDL.SDL_GetDisplayDPI(0, out ddpi, out hdpi, out vdpi) == 0)
|
if (!Game.Settings.Graphics.DisableWindowsDPIScaling && SDL.SDL_GetDisplayDPI(0, out ddpi, out hdpi, out vdpi) == 0)
|
||||||
{
|
{
|
||||||
WindowScale = ddpi / 96;
|
WindowScale = ddpi / 96;
|
||||||
WindowSize = new Size((int)(SurfaceSize.Width / WindowScale), (int)(SurfaceSize.Height / WindowScale));
|
WindowSize = new Size((int)(SurfaceSize.Width / WindowScale), (int)(SurfaceSize.Height / WindowScale));
|
||||||
|
|||||||
Reference in New Issue
Block a user