]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Auto-adjust horizontal/vertical multiplier if default filter mode.
authorToni Wilen <twilen@winuae.net>
Sat, 29 Jan 2022 19:19:34 +0000 (21:19 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 29 Jan 2022 19:19:34 +0000 (21:19 +0200)
od-win32/win32_scaler.cpp

index cbe104aac0a025b95ee33e2aded588a7783ac726..3b0948c0ca9af4b93ba252ae608b3bb91efdfdb2 100644 (file)
@@ -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) {