From f75bf6bb8f92249601c5624095ac694cc486c6f2 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Thu, 18 Jun 2020 21:02:37 +0300 Subject: [PATCH] Default filter mode improvements. --- od-win32/win32_scaler.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/od-win32/win32_scaler.cpp b/od-win32/win32_scaler.cpp index e2ed47ff..e7916353 100644 --- a/od-win32/win32_scaler.cpp +++ b/od-win32/win32_scaler.cpp @@ -303,13 +303,24 @@ void getfilterrect2(int monid, RECT *sr, RECT *dr, RECT *zr, int dst_width, int oscalemode = scalemode = AUTOSCALE_NONE; } + srcratio = 4.0f / 3.0f; + if (!specialmode && scalemode == AUTOSCALE_STATIC_AUTO) { - scalemode = AUTOSCALE_STATIC_NOMINAL; - filter_aspect = -1; + int w = (dst_width / 2) << currprefs.gfx_resolution; + int h = (dst_height / 2) << currprefs.gfx_vresolution; + filter_aspect = 0; keep_aspect = 0; + if (w >= 640 && w <= 800 && h >= 480 && h <= 600) { + scalemode = AUTOSCALE_NONE; + } else { + float dstratio = 1.0f * dst_width / dst_height; + scalemode = AUTOSCALE_STATIC_NOMINAL; + if (dstratio > srcratio + 0.1 || dstratio < srcratio - 0.1) { + filter_aspect = -1; + } + } } - srcratio = 4.0f / 3.0f; if (filter_aspect > 0) { dstratio = (filter_aspect / ASPECTMULT) * 1.0f / (filter_aspect & (ASPECTMULT - 1)); } else if (filter_aspect < 0) { -- 2.47.3