]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
RTG to non-lace switch filter change fix + cleanup.
authorToni Wilen <twilen@winuae.net>
Sun, 27 Nov 2022 08:45:40 +0000 (10:45 +0200)
committerToni Wilen <twilen@winuae.net>
Sun, 27 Nov 2022 08:45:40 +0000 (10:45 +0200)
drawing.cpp
include/options.h
od-win32/picasso96_win.cpp
od-win32/win32gfx.cpp

index 1bbe7541e2d806674118681ded3a728e7584a7f2..e90f586c917648232d88237cda87a6da5516c26d 100644 (file)
@@ -4862,10 +4862,10 @@ void check_prefs_picasso(void)
 
                if (!ad->picasso_on) {
                        clear_inhibit_frame(monid, IHF_PICASSO);
-                       ad->gf_index = ad->interlace_on ? 2 : 1;
+                       ad->gf_index = ad->interlace_on ? GF_INTERLACE : GF_NORMAL;
                } else {
                        set_inhibit_frame(monid, IHF_PICASSO);
-                       ad->gf_index = 1;
+                       ad->gf_index = GF_RTG;
                }
 
                gfx_set_picasso_state(monid, ad->picasso_on);
@@ -5134,9 +5134,9 @@ bool notice_interlace_seen (int monid, bool lace)
        }
 
        if (changed) {
-               if (currprefs.gf[2].enable && memcmp(&currprefs.gf[0], &currprefs.gf[2], sizeof(struct gfx_filterdata))) {
-                       changed_prefs.gf[0].changed = true;
-                       changed_prefs.gf[2].changed = true;
+               if (currprefs.gf[GF_INTERLACE].enable && memcmp(&currprefs.gf[GF_NORMAL], &currprefs.gf[GF_INTERLACE], sizeof(struct gfx_filterdata))) {
+                       changed_prefs.gf[GF_NORMAL].changed = true;
+                       changed_prefs.gf[GF_INTERLACE].changed = true;
                        if (ad->interlace_on != interlace_on) {
                                ad->interlace_on = interlace_on;
                                set_config_changed();
@@ -5148,12 +5148,12 @@ bool notice_interlace_seen (int monid, bool lace)
 
        if (!ad->picasso_on) {
                if (ad->interlace_on) {
-                       ad->gf_index = 2;
+                       ad->gf_index = GF_INTERLACE;
                } else {
-                       ad->gf_index = 0;
+                       ad->gf_index = GF_NORMAL;
                }
        } else {
-               ad->gf_index = 1;
+               ad->gf_index = GF_RTG;
        }
 
        return changed;
@@ -5269,7 +5269,7 @@ void drawing_init (void)
        if (!isrestore ()) {
                ad->picasso_on = 0;
                ad->picasso_requested_on = 0;
-               ad->gf_index = 0;
+               ad->gf_index = GF_NORMAL;
                gfx_set_picasso_state(0, 0);
        }
 #endif
index f173b811756e1641704cd812e3728dab744b3c81..164d113f4b96ae5790aa7d10a82de11d27583d99 100644 (file)
@@ -352,6 +352,9 @@ struct apmode
 
 
 #define MAX_FILTERDATA 3
+#define GF_NORMAL 0
+#define GF_RTG 1
+#define GF_INTERLACE 2
 struct gfx_filterdata
 {
        int enable;
index 17fcb4e372ea9e411ed8f68cae0ed3e4a7e9c6ad..46c253e042da88f2905780ea7b4b090ba18bb9ad 100644 (file)
@@ -826,8 +826,8 @@ static void mouseupdate(struct AmigaMonitor *mon)
        struct picasso96_state_struct *state = &picasso96_state[mon->monitor_id];
        int x = newcursor_x;
        int y = newcursor_y;
-       float mx = currprefs.gf[1].gfx_filter_horiz_zoom_mult;
-       float my = currprefs.gf[1].gfx_filter_vert_zoom_mult;
+       float mx = currprefs.gf[GF_RTG].gfx_filter_horiz_zoom_mult;
+       float my = currprefs.gf[GF_RTG].gfx_filter_vert_zoom_mult;
        int forced = 0;
 
        if (!hwsprite)
@@ -841,7 +841,7 @@ static void mouseupdate(struct AmigaMonitor *mon)
        }
 
        if (D3D_setcursor) {
-               if (currprefs.gf[1].gfx_filter_autoscale == RTG_MODE_CENTER) {
+               if (currprefs.gf[GF_RTG].gfx_filter_autoscale == RTG_MODE_CENTER) {
                        D3D_setcursor(mon->monitor_id, x, y, WIN32GFX_GetWidth(mon), WIN32GFX_GetHeight(mon), mx, my, cursorvisible, mon->scalepicasso == 2);
                } else {
                        D3D_setcursor(mon->monitor_id, x, y, state->Width, state->Height, mx, my, cursorvisible, false);
index 1261a437a139975fbd4f8e3bf07f0020eb62a041..d7a621a01ca36c9fb3304e79564ac2d772157b53 100644 (file)
@@ -1574,11 +1574,11 @@ void getrtgfilterrect2(int monid, RECT *sr, RECT *dr, RECT *zr, int *mode, int d
        if (!ad->picasso_on)
                return;
 
-       if (currprefs.gf[1].gfx_filter_horiz_zoom_mult > 0) {
-               picasso_offset_mx *= currprefs.gf[1].gfx_filter_horiz_zoom_mult;
+       if (currprefs.gf[GF_RTG].gfx_filter_horiz_zoom_mult > 0) {
+               picasso_offset_mx *= currprefs.gf[GF_RTG].gfx_filter_horiz_zoom_mult;
        }
-       if (currprefs.gf[1].gfx_filter_vert_zoom_mult > 0) {
-               picasso_offset_my *= currprefs.gf[1].gfx_filter_vert_zoom_mult;
+       if (currprefs.gf[GF_RTG].gfx_filter_vert_zoom_mult > 0) {
+               picasso_offset_my *= currprefs.gf[GF_RTG].gfx_filter_vert_zoom_mult;
        }
 
        if (!mon->scalepicasso)
@@ -1848,11 +1848,11 @@ static void update_gfxparams(struct AmigaMonitor *mon)
        if (mon->screen_is_picasso) {
                float mx = 1.0;
                float my = 1.0;
-               if (currprefs.gf[1].gfx_filter_horiz_zoom_mult > 0) {
-                       mx *= currprefs.gf[1].gfx_filter_horiz_zoom_mult;
+               if (currprefs.gf[GF_RTG].gfx_filter_horiz_zoom_mult > 0) {
+                       mx *= currprefs.gf[GF_RTG].gfx_filter_horiz_zoom_mult;
                }
-               if (currprefs.gf[1].gfx_filter_vert_zoom_mult > 0) {
-                       my *= currprefs.gf[1].gfx_filter_vert_zoom_mult;
+               if (currprefs.gf[GF_RTG].gfx_filter_vert_zoom_mult > 0) {
+                       my *= currprefs.gf[GF_RTG].gfx_filter_vert_zoom_mult;
                }
                mon->currentmode.current_width = (int)(state->Width * currprefs.rtg_horiz_zoom_mult * mx);
                mon->currentmode.current_height = (int)(state->Height * currprefs.rtg_vert_zoom_mult * my);
@@ -1902,14 +1902,14 @@ static void update_gfxparams(struct AmigaMonitor *mon)
        if (mon->screen_is_picasso) {
                bool diff = state->Width != mon->currentmode.native_width || state->Height != mon->currentmode.native_height;
                if (isfullscreen () < 0) {
-                       if ((currprefs.gf[1].gfx_filter_autoscale == RTG_MODE_CENTER || currprefs.gf[1].gfx_filter_autoscale == RTG_MODE_SCALE || currprefs.win32_rtgallowscaling) && diff) {
+                       if ((currprefs.gf[GF_RTG].gfx_filter_autoscale == RTG_MODE_CENTER || currprefs.gf[GF_RTG].gfx_filter_autoscale == RTG_MODE_SCALE || currprefs.win32_rtgallowscaling) && diff) {
                                mon->scalepicasso = RTG_MODE_SCALE;
                        }
-                       if (currprefs.gf[1].gfx_filter_autoscale == RTG_MODE_INTEGER_SCALE && diff) {
+                       if (currprefs.gf[GF_RTG].gfx_filter_autoscale == RTG_MODE_INTEGER_SCALE && diff) {
                                mon->scalepicasso = RTG_MODE_INTEGER_SCALE;
                        }
-                       if (currprefs.gf[1].gfx_filter_autoscale == RTG_MODE_CENTER && diff) {
-                               mon->scalepicasso = currprefs.gf[1].gfx_filter_autoscale;
+                       if (currprefs.gf[GF_RTG].gfx_filter_autoscale == RTG_MODE_CENTER && diff) {
+                               mon->scalepicasso = currprefs.gf[GF_RTG].gfx_filter_autoscale;
                        }
                        if (!mon->scalepicasso && currprefs.win32_rtgscaleaspectratio) {
                                mon->scalepicasso = -1;
@@ -1917,23 +1917,23 @@ static void update_gfxparams(struct AmigaMonitor *mon)
                } else if (isfullscreen () > 0) {
                        if (!canmatchdepth()) { // can't scale to different color depth
                                if (mon->currentmode.native_width > state->Width && mon->currentmode.native_height > state->Height) {
-                                       if (currprefs.gf[1].gfx_filter_autoscale)
+                                       if (currprefs.gf[GF_RTG].gfx_filter_autoscale)
                                                mon->scalepicasso = RTG_MODE_SCALE;
-                                       if (currprefs.gf[1].gfx_filter_autoscale == RTG_MODE_INTEGER_SCALE) {
+                                       if (currprefs.gf[GF_RTG].gfx_filter_autoscale == RTG_MODE_INTEGER_SCALE) {
                                                mon->scalepicasso = RTG_MODE_INTEGER_SCALE;
                                        }
                                }
-                               if (currprefs.gf[1].gfx_filter_autoscale == RTG_MODE_CENTER)
-                                       mon->scalepicasso = currprefs.gf[1].gfx_filter_autoscale;
+                               if (currprefs.gf[GF_RTG].gfx_filter_autoscale == RTG_MODE_CENTER)
+                                       mon->scalepicasso = currprefs.gf[GF_RTG].gfx_filter_autoscale;
                                if (!mon->scalepicasso && currprefs.win32_rtgscaleaspectratio)
                                        mon->scalepicasso = -1;
                        }
                } else if (isfullscreen () == 0) {
-                       if (currprefs.gf[1].gfx_filter_autoscale == RTG_MODE_INTEGER_SCALE) {
+                       if (currprefs.gf[GF_RTG].gfx_filter_autoscale == RTG_MODE_INTEGER_SCALE) {
                                mon->scalepicasso = RTG_MODE_INTEGER_SCALE;
                                mon->currentmode.current_width = currprefs.gfx_monitor[mon->monitor_id].gfx_size.width;
                                mon->currentmode.current_height = currprefs.gfx_monitor[mon->monitor_id].gfx_size.height;
-                       } else if (currprefs.gf[1].gfx_filter_autoscale == RTG_MODE_CENTER) {
+                       } else if (currprefs.gf[GF_RTG].gfx_filter_autoscale == RTG_MODE_CENTER) {
                                if (currprefs.gfx_monitor[mon->monitor_id].gfx_size.width < state->Width || currprefs.gfx_monitor[mon->monitor_id].gfx_size.height < state->Height) {
                                        if (!currprefs.win32_rtgallowscaling) {
                                                ;
@@ -1947,7 +1947,7 @@ static void update_gfxparams(struct AmigaMonitor *mon)
                                        mon->currentmode.current_width = currprefs.gfx_monitor[mon->monitor_id].gfx_size.width;
                                        mon->currentmode.current_height = currprefs.gfx_monitor[mon->monitor_id].gfx_size.height;
                                }
-                       } else if (currprefs.gf[1].gfx_filter_autoscale == RTG_MODE_SCALE) {
+                       } else if (currprefs.gf[GF_RTG].gfx_filter_autoscale == RTG_MODE_SCALE) {
                                if (currprefs.gfx_monitor[mon->monitor_id].gfx_size.width > state->Width || currprefs.gfx_monitor[mon->monitor_id].gfx_size.height > state->Height)
                                        mon->scalepicasso = RTG_MODE_SCALE;
                                if ((currprefs.gfx_monitor[mon->monitor_id].gfx_size.width != state->Width || currprefs.gfx_monitor[mon->monitor_id].gfx_size.height != state->Height) && currprefs.win32_rtgallowscaling) {
@@ -2905,7 +2905,7 @@ static int modeswitchneeded(struct AmigaMonitor *mon, struct winuae_currentmode
                        if (state->BytesPerPixel > 1 && state->BytesPerPixel * 8 != wc->current_depth && canmatchdepth())
                                return -1;
                        if (state->Width < wc->current_width && state->Height < wc->current_height) {
-                               if ((currprefs.gf[1].gfx_filter_autoscale == 1 || (currprefs.gf[1].gfx_filter_autoscale == 2 && currprefs.win32_rtgallowscaling)) && !canmatchdepth())
+                               if ((currprefs.gf[GF_RTG].gfx_filter_autoscale == 1 || (currprefs.gf[GF_RTG].gfx_filter_autoscale == 2 && currprefs.win32_rtgallowscaling)) && !canmatchdepth())
                                        return 0;
                        }
                        if (state->Width != wc->current_width ||
@@ -2933,7 +2933,7 @@ static int modeswitchneeded(struct AmigaMonitor *mon, struct winuae_currentmode
        } else {
                /* fullwindow to fullwindow */
                if (mon->screen_is_picasso) {
-                       if (currprefs.gf[1].gfx_filter_autoscale && ((wc->native_width > state->Width && wc->native_height >= state->Height) || (wc->native_height > state->Height && wc->native_width >= state->Width)))
+                       if (currprefs.gf[GF_RTG].gfx_filter_autoscale && ((wc->native_width > state->Width && wc->native_height >= state->Height) || (wc->native_height > state->Height && wc->native_width >= state->Width)))
                                return -1;
                        if (currprefs.win32_rtgallowscaling && (state->Width != wc->native_width || state->Height != wc->native_height))
                                return -1;