From ebb31cd8b26835b9103733e0b383bce8c0e2534a Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 22 Jul 2020 02:55:01 +1000 Subject: [PATCH] Rough support for vid_conwidthauto --- qcsrc/menu/xonotic/slider_resolution.qc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/qcsrc/menu/xonotic/slider_resolution.qc b/qcsrc/menu/xonotic/slider_resolution.qc index 9a55f8840..70b108ae3 100644 --- a/qcsrc/menu/xonotic/slider_resolution.qc +++ b/qcsrc/menu/xonotic/slider_resolution.qc @@ -1,6 +1,8 @@ #include "slider_resolution.qh" /* private static */ float XonoticResolutionSlider_DataHasChanged; +/* attrib */ float vid_conwidth; +/* attrib */ float vid_conheight; // Updates cvars (to be called by menu.qc at startup or on detected res change) float updateConwidths(float width, float height, float pixelheight) @@ -19,6 +21,20 @@ float updateConwidths(float width, float height, float pixelheight) cvar_set("_menu_vid_pixelheight", ftos(pixelheight)); cvar_set("_menu_vid_desktopfullscreen", cvar_string("vid_desktopfullscreen")); + // engine is handling conwidth calculations! + if((cvar_type("vid_conwidthauto") & CVAR_TYPEFLAG_ENGINE) && cvar("vid_conwidthauto")) + { + if(vid_conwidth != cvar("vid_conwidth") || vid_conheight != cvar("vid_conheight")) + { + // Please reload resolutions list and such stuff. + XonoticResolutionSlider_DataHasChanged = true; + vid_conwidth = cvar("vid_conwidth"); + vid_conheight = cvar("vid_conheight"); + return 1; + } + return 0; // No recalculation + } + r_x = width; r_y = height; r_z = pixelheight; -- 2.39.2