From 153968dc7c0edea2b6ceb0c25b8a1ae07d3b076b Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sun, 2 May 2021 01:19:05 -0400 Subject: [PATCH] - change `vid_allowtrueultrawide` - -1 allows for any arbitrary ratio for hud aspects, 0 changed to old behavior (max 16:9), 1 changed to old behavior except at 21:9, 1 is now the default. - `vid_allowtrueultrawide` is now placed in game-specific config, instead of global. --- src/common/2d/v_draw.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/common/2d/v_draw.cpp b/src/common/2d/v_draw.cpp index 70bf53042..6672416da 100644 --- a/src/common/2d/v_draw.cpp +++ b/src/common/2d/v_draw.cpp @@ -50,7 +50,7 @@ CVAR(Bool, ui_screenborder_classic_scaling, true, CVAR_ARCHIVE) // nonsense that graphics should not be able to actually use that extra screen space. extern bool setsizeneeded; -CUSTOM_CVAR(Bool, vid_allowtrueultrawide, true, CVAR_GLOBALCONFIG|CVAR_ARCHIVE|CVAR_NOINITCALL) +CUSTOM_CVAR(Int, vid_allowtrueultrawide, 1, CVAR_ARCHIVE|CVAR_NOINITCALL) { setsizeneeded = true; } @@ -1263,11 +1263,20 @@ static void VirtualToRealCoords(F2DDrawer *drawer, double Width, double Height, { float myratio = float(handleaspect ? ActiveRatio (Width, Height) : (4.0 / 3.0)); - // if 21:9 AR, map to 16:9 for all callers. - // this allows for black bars and stops the stretching of fullscreen images - if ((myratio > 1.7f) && !vid_allowtrueultrawide) { - myratio = 16.0f / 9.0f; - } + // if 21:9 AR, map to 16:9 for all callers. + // this allows for black bars and stops the stretching of fullscreen images + + switch (vid_allowtrueultrawide) + { + case 1: + default: + myratio = MIN(64.0f / 27.0f, myratio); + break; + case 0: + myratio = MIN(16.0f / 9.0f, myratio); + case -1: + break; + } double right = x + w; double bottom = y + h;