- made a few adjustments to the clean factor calculation so that on large screens the smaller factor gets preferred.

Without such tweaking the menu scale tends to get a bit too large on some screen sizes.
This commit is contained in:
Christoph Oelckers 2017-03-19 18:38:16 +01:00
parent 5327deee43
commit c237af2b02

View file

@ -1394,6 +1394,12 @@ void V_CalcCleanFacs (int designwidth, int designheight, int realwidth, int real
int cheight;
int cx1, cy1, cx2, cy2;
// For larger screems always use at least a 16:9 ratio for clean factor calculation, even if the actual ratio is narrower.
if (realwidth > 1280 && (double)realwidth / realheight < 16./9)
{
realheight = realwidth * 9 / 16;
}
ratio = ActiveRatio(realwidth, realheight);
if (AspectTallerThanWide(ratio))
{
@ -1411,7 +1417,7 @@ void V_CalcCleanFacs (int designwidth, int designheight, int realwidth, int real
cy1 = MAX(cheight / designheight, 1);
cx2 = MAX(realwidth / designwidth, 1);
cy2 = MAX(realheight / designheight, 1);
if (abs(cx1 - cy1) <= abs(cx2 - cy2) || cx1 >= 4)
if (abs(cx1 - cy1) <= abs(cx2 - cy2) || MAX(cx1, cx2) >= 4)
{ // e.g. 640x360 looks better with this.
*cleanx = cx1;
*cleany = cy1;