From 24d42b74a771c244dc663565aef1d09565086d65 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sun, 22 Jul 2018 18:07:59 -0400 Subject: [PATCH] - fixed: use `templates.h` function for minimal value check # Conflicts: # src/r_videoscale.cpp --- src/r_videoscale.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/r_videoscale.cpp b/src/r_videoscale.cpp index 9e0497197..ef34fa9be 100644 --- a/src/r_videoscale.cpp +++ b/src/r_videoscale.cpp @@ -25,6 +25,7 @@ #include "c_dispatch.h" #include "c_cvars.h" #include "v_video.h" +#include "templates.h" #define NUMSCALEMODES 6 @@ -101,18 +102,13 @@ bool ViewportLinearScale() return (vid_scalefactor > 1.0) ? true : vScaleTable[vid_scalemode].isLinear; } -inline int max(int a, int b) -{ - return (a > b) ? a : b; -} - int ViewportScaledWidth(int width, int height) { if (isOutOfBounds(vid_scalemode)) vid_scalemode = 0; if (vid_cropaspect && height > 0) width = ((float)width/height > ActiveRatio(width, height)) ? (int)(height * ActiveRatio(width, height)) : width; - return max(160, vScaleTable[vid_scalemode].GetScaledWidth((int)((float)width * vid_scalefactor))); + return (int)MAX((int32_t)160, (int32_t)vScaleTable[vid_scalemode].GetScaledWidth((int)((float)width * vid_scalefactor))); } int ViewportScaledHeight(int width, int height) @@ -121,7 +117,7 @@ int ViewportScaledHeight(int width, int height) vid_scalemode = 0; if (vid_cropaspect && height > 0) height = ((float)width/height < ActiveRatio(width, height)) ? (int)(width / ActiveRatio(width, height)) : height; - return max(100, vScaleTable[vid_scalemode].GetScaledHeight((int)((float)height * vid_scalefactor))); + return (int)MAX((int32_t)100, (int32_t)vScaleTable[vid_scalemode].GetScaledHeight((int)((float)height * vid_scalefactor))); } bool ViewportIsScaled43()