Allow mods to customise the default rendering scale.

This commit is contained in:
Paul Chote
2022-12-22 08:40:59 +13:00
committed by Matthias Mailänder
parent e21f94f36a
commit 6d438a9d61
8 changed files with 59 additions and 50 deletions

View File

@@ -227,14 +227,14 @@ namespace OpenRA.Graphics
var vd = graphicSettings.ViewportDistance;
if (viewportSizes.AllowNativeZoom && vd == WorldViewport.Native)
minZoom = 1;
minZoom = viewportSizes.DefaultScale;
else
{
var range = viewportSizes.GetSizeRange(vd);
minZoom = CalculateMinimumZoom(range.X, range.Y);
minZoom = CalculateMinimumZoom(range.X, range.Y) * viewportSizes.DefaultScale;
}
maxZoom = Math.Min(minZoom * viewportSizes.MaxZoomScale, Game.Renderer.NativeResolution.Height * 1f / viewportSizes.MaxZoomWindowHeight);
maxZoom = Math.Min(minZoom * viewportSizes.MaxZoomScale, Game.Renderer.NativeResolution.Height * viewportSizes.DefaultScale / viewportSizes.MaxZoomWindowHeight);
if (unlockMinZoom)
{

View File

@@ -19,6 +19,7 @@ namespace OpenRA
public readonly int2 MediumWindowHeights = new int2(600, 900);
public readonly int2 FarWindowHeights = new int2(900, 1300);
public readonly float DefaultScale = 1.0f;
public readonly float MaxZoomScale = 2.0f;
public readonly int MaxZoomWindowHeight = 240;
public readonly bool AllowNativeZoom = true;