From 75da889c3edb66224bebc921d293c4ef85d6a6b1 Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Sun, 26 Apr 2009 19:14:50 +0000 Subject: [PATCH] Fix rounding errors with aspect correction Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3364 --- src/gui/render.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/render.cpp b/src/gui/render.cpp index cdd9cbfd..c25e6cac 100644 --- a/src/gui/render.cpp +++ b/src/gui/render.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: render.cpp,v 1.59 2009-04-26 18:24:36 qbix79 Exp $ */ +/* $Id: render.cpp,v 1.60 2009-04-26 19:14:50 harekiet Exp $ */ #include #include @@ -519,6 +519,12 @@ void RENDER_SetSize(Bitu width,Bitu height,Bitu bpp,float fps,double ratio,bool if (!width || !height || width > SCALER_MAXWIDTH || height > SCALER_MAXHEIGHT) { return; } + if ( ratio > 1 ) { + double target = height * ratio + 0.1; + ratio = target / height; + } else { + //This would alter the width of the screen, we don't care about rounding errors here + } render.src.width=width; render.src.height=height; render.src.bpp=bpp;