From 7d67d5e9986eb5e79bca96205544acd5b44b4be2 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Tue, 10 Oct 2017 07:23:05 -0400 Subject: [PATCH] - fixed possible erroneous comparison, also fixed a couple compiler warnings in the process --- src/r_videoscale.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/r_videoscale.cpp b/src/r_videoscale.cpp index 0bffc91bf..ff8e7eb28 100644 --- a/src/r_videoscale.cpp +++ b/src/r_videoscale.cpp @@ -80,7 +80,7 @@ int ViewportScaledWidth(int width, int height) if (isOutOfBounds(vid_scalemode)) vid_scalemode = 0; if (vid_cropaspect && height > 0) - width = (width/height > ActiveRatio(width, height)) ? height * ActiveRatio(width, height) : width; + width = ((float)width/height > ActiveRatio(width, height)) ? (int)(height * ActiveRatio(width, height)) : width; return vScaleTable[vid_scalemode].GetScaledWidth((int)((float)width * vid_scalefactor)); } @@ -89,7 +89,7 @@ int ViewportScaledHeight(int width, int height) if (isOutOfBounds(vid_scalemode)) vid_scalemode = 0; if (vid_cropaspect && height > 0) - height = (width/height < ActiveRatio(width, height)) ? width / ActiveRatio(width, height) : height; + height = ((float)width/height < ActiveRatio(width, height)) ? (int)(width / ActiveRatio(width, height)) : height; return vScaleTable[vid_scalemode].GetScaledHeight((int)((float)height * vid_scalefactor)); }