Skip to content

Max GUI scale/Splitscreen HUD squish convars V2

This merge requests adds 3 new convars, related to HUD/GUI scaling:

  • "gui_maxscale" - The global max HUD/menu GUI/title screen logo scale multiplier. For example, a window size of 1920x1080 would by default have a GUI scale of 5, but this convar can limit it to less than 5 if a user wants, although not more than 5 unless the window size is increased.

  • "gui_maxscale_splitscreen" - The max HUD scale multiplier specifically for splitscreen graphics (anything with V_PERPLAYER while in splitscreen). Note that this is currently limited to no more than "gui_maxscale", but I don't see why one would want the HUD to be bigger in splitscreen, so that's probably fine.

  • "gui_squish_splitscreen" - Whether or not to squish the splitscreen HUD to half height, as in v2.2.0. Defaults to squishing.

Minor extra goodie: MAXGUISCALE is a new (non-Lua/-SOC-accessible) constant, defined at compile-time based on BASEVIDWIDTH/MAXVIDWIDTH and BASEVIDHEIGHT/MAXVIDHEIGHT, to avoid "6" being a magic number in GUI-scale-related contexts. There are likely many things that still use "6" instead of MAXGUISCALE, however.

The "maxscale" convars can range from 0 up to MAXGUISCALE, with 0 (the default) disabling the limit. The splitscreen HUD squishing is also enabled by default, matching v2.2.0 behaviour/appearance. Note that the "maxscale" convars are absolute multiplier limiters, not a ratio of the current window size, which is part of the reason that they're console-exclusive "advanced" things rather than something accessible through options menus.

I've tested this in both the Software and OpenGL renderers with local 64-bit builds, and all vanilla and Lua-based HUD/GUI drawing seems appropriately affected.

If you want to test this, a 64-bit build for Windows, built using MinGW64, based on commit 27285365, can be found here.

Version 2 "changelog": I made a merge request for this a day earlier too, however it had a big oversight in that splitscreen HUD wouldn't be aligned properly in "aspect-correct"/"green" resolutions when the GUI was at full scale. I've fixed that now, and everything now stays properly aligned in different aspect ratios and scalings. I've also linked to a 64-bit build of this, for easy download-and-test-ing if that's wanted.

Edited by Zwip-Zwap Zapony

Merge request reports