From: Toni Wilen Date: Sat, 29 Jan 2022 19:19:34 +0000 (+0200) Subject: Auto-adjust horizontal/vertical multiplier if default filter mode. X-Git-Tag: 4910~6 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=bb18984d18f9faf5b22b187420d81efe0d0ad0a4;p=francis%2Fwinuae.git Auto-adjust horizontal/vertical multiplier if default filter mode. --- diff --git a/od-win32/win32_scaler.cpp b/od-win32/win32_scaler.cpp index cbe104aa..3b0948c0 100644 --- a/od-win32/win32_scaler.cpp +++ b/od-win32/win32_scaler.cpp @@ -222,6 +222,24 @@ static bool get_aspect(int monid, float *dstratiop, float *srcratiop, float *xmu return aspect; } +static int res_match(int w) +{ + if (currprefs.gfx_vresolution == VRES_NONDOUBLE) { + if (currprefs.gfx_resolution == RES_HIRES) { + w *= 2; + } else if (currprefs.gfx_resolution == RES_SUPERHIRES) { + w *= 4; + } + } else { + if (currprefs.gfx_resolution == RES_LORES) { + w /= 2; + } else if (currprefs.gfx_resolution == RES_SUPERHIRES) { + w *= 2; + } + } + return w; +} + void getfilterrect2(int monid, RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height, int aw, int ah, int scale, int temp_width, int temp_height) { struct AmigaMonitor *mon = &AMonitors[monid]; @@ -322,6 +340,7 @@ void getfilterrect2(int monid, RECT *sr, RECT *dr, RECT *zr, int dst_width, int filter_aspect = -1; } } + w = res_match(w); } if (filter_aspect > 0) { @@ -425,19 +444,7 @@ void getfilterrect2(int monid, RECT *sr, RECT *dr, RECT *zr, int dst_width, int filter_horiz_zoom_mult = 1.0; filter_vert_zoom_mult = 1.0; - if (currprefs.gfx_vresolution == VRES_NONDOUBLE) { - if (currprefs.gfx_resolution == RES_HIRES) { - maxw *= 2; - } else if (currprefs.gfx_resolution == RES_SUPERHIRES) { - maxw *= 4; - } - } else { - if (currprefs.gfx_resolution == RES_LORES) { - maxw /= 2; - } else if (currprefs.gfx_resolution == RES_SUPERHIRES) { - maxw *= 2; - } - } + maxw = res_match(maxw); double multadd = 1.0 / (1 << currprefs.gf[ad->picasso_on].gfx_filter_integerscalelimit); if (cw2 > maxw || ch2 > maxh) {