From 4a427694acdf663dfbe93d9c79466f7ee00288d2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 26 Feb 2019 00:07:09 +0100 Subject: [PATCH] - changed calculation of the scaling value for the option menu. This was already far too generous and caused space problems, but with localization these became a lot worse, so now it will try to allocate at least 640 virtual pixels for the menu width and only go below that for small resolution ranges where the smaller value would result in too small text. --- src/v_video.cpp | 38 +++++++++----------------------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/src/v_video.cpp b/src/v_video.cpp index b971a9eb32..1d913d180f 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -547,36 +547,16 @@ void V_UpdateModeSize (int width, int height) CleanHeight = height / CleanYfac; assert(CleanWidth >= 320 && CleanHeight >= 200); - if (width < 800 || width >= 960) - { - if (cx1 < cx2) - { - // Special case in which we don't need to scale down. - CleanXfac_1 = - CleanYfac_1 = cx1; - } - else - { - CleanXfac_1 = MAX(CleanXfac - 1, 1); - CleanYfac_1 = MAX(CleanYfac - 1, 1); - // On larger screens this is not enough so make sure it's at most 3/4 of the screen's width - while (CleanXfac_1 * 320 > screen->GetWidth()*3/4 && CleanXfac_1 > 2) - { - CleanXfac_1--; - CleanYfac_1--; - } - } - CleanWidth_1 = width / CleanXfac_1; - CleanHeight_1 = height / CleanYfac_1; - } - else // if the width is between 800 and 960 the ratio between the screensize and CleanXFac-1 becomes too large. - { - CleanXfac_1 = CleanXfac; - CleanYfac_1 = CleanYfac; - CleanWidth_1 = CleanWidth; - CleanHeight_1 = CleanHeight; - } + int w = screen->GetWidth(); + int factor; + if (w < 640) factor = 1; + else if (w >= 1024 && w < 1280) factor = 2; + else if (w >= 1600 && w < 1920) factor = 3; + else factor = w / 640; + CleanXfac_1 = CleanYfac_1 = factor; + CleanWidth_1 = width / CleanXfac_1; + CleanHeight_1 = height / CleanYfac_1; DisplayWidth = width; DisplayHeight = height;