- replaced MIN/MAX in common code.

This commit is contained in:
Christoph Oelckers 2021-10-30 10:46:17 +02:00
commit eb69bbcae0
63 changed files with 200 additions and 236 deletions

View file

@ -293,11 +293,11 @@ static void ST_CalcCleanFacs(int designwidth, int designheight, int realwidth, i
}
// Use whichever pair of cwidth/cheight or width/height that produces less difference
// between CleanXfac and CleanYfac.
cx1 = MAX(cwidth / designwidth, 1);
cy1 = MAX(cheight / designheight, 1);
cx2 = MAX(realwidth / designwidth, 1);
cy2 = MAX(realheight / designheight, 1);
if (abs(cx1 - cy1) <= abs(cx2 - cy2) || MAX(cx1, cx2) >= 4)
cx1 = max(cwidth / designwidth, 1);
cy1 = max(cheight / designheight, 1);
cx2 = max(realwidth / designwidth, 1);
cy2 = max(realheight / designheight, 1);
if (abs(cx1 - cy1) <= abs(cx2 - cy2) || max(cx1, cx2) >= 4)
{ // e.g. 640x360 looks better with this.
*cleanx = cx1;
*cleany = cy1;
@ -489,7 +489,7 @@ void DStatusBarCore::DrawGraphic(FGameTexture* tex, double x, double y, int flag
if (boxwidth <= 0 || (boxheight > 0 && scale2 < scale1))
scale1 = scale2;
}
else scale1 = MIN(scale1, scale2);
else scale1 = min(scale1, scale2);
boxwidth = texwidth * scale1;
boxheight = texheight * scale1;