]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
RTG mode overlay support.
authorToni Wilen <twilen@winuae.net>
Sun, 8 Dec 2019 16:48:10 +0000 (18:48 +0200)
committerToni Wilen <twilen@winuae.net>
Sun, 8 Dec 2019 16:48:10 +0000 (18:48 +0200)
od-win32/direct3d.cpp
od-win32/direct3d.h
od-win32/direct3d11.cpp
od-win32/win32_scaler.cpp

index 0e7a519a40b0e3c1ddc7505e9adeb4ea41bc2c6c..ec91a4e5cf7ee10701d647bdf848c6e69e81c62c 100644 (file)
@@ -1769,7 +1769,7 @@ static int createmask2texture (struct d3dstruct *d3d, const TCHAR *filename)
                d3d->mask2textureled_power_dim->Release();
        d3d->mask2textureled_power_dim = NULL;
 
-       if (filename[0] == 0 || WIN32GFX_IsPicassoScreen(mon))
+       if (filename[0] == 0)
                return 0;
 
        zf = NULL;
@@ -2111,7 +2111,7 @@ end:
        return 0;
 }
 
-static bool xD3D_getscalerect(int monid, float *mx, float *my, float *sx, float *sy)
+static bool xD3D_getscalerect(int monid, float *mx, float *my, float *sx, float *sy, int width, int height)
 {
        struct d3dstruct *d3d = &d3ddata[monid];
        struct vidbuf_description *vidinfo = &adisplays[monid].gfxvidinfo;
@@ -2122,8 +2122,8 @@ static bool xD3D_getscalerect(int monid, float *mx, float *my, float *sx, float
        float mw = d3d->mask2rect.right - d3d->mask2rect.left;
        float mh = d3d->mask2rect.bottom - d3d->mask2rect.top;
 
-       float mxt = (float)mw / vidinfo->outbuffer->inwidth2;
-       float myt = (float)mh / vidinfo->outbuffer->inheight2;
+       float mxt = (float)mw / width;
+       float myt = (float)mh / height;
 
        *mx = d3d->mask2texture_minusx / mxt;
        *my = d3d->mask2texture_minusy / myt;
index 17d5f90086193c31c542249bfa6cb8e7298a8f43..fd420e840b617adc8641a5b39135fe6cdd8bfefd 100644 (file)
@@ -29,7 +29,7 @@ extern float(*D3D_getrefreshrate)(int);
 extern void(*D3D_restore)(int, bool);
 extern void(*D3D_resize)(int, int);
 extern void(*D3D_change)(int, int);
-extern bool(*D3D_getscalerect)(int, float *mx, float *my, float *sx, float *sy);
+extern bool(*D3D_getscalerect)(int, float *mx, float *my, float *sx, float *sy, int width, int height);
 extern bool(*D3D_run)(int);
 extern int(*D3D_debug)(int, int);
 extern void(*D3D_led)(int, int, int);
index 2d349e59ebf63b6dd6cf6190caf7af050c403408..79c6db7d8536d54ecebbf81c34624342d2aa9053 100644 (file)
@@ -62,7 +62,7 @@ float (*D3D_getrefreshrate)(int);
 void(*D3D_restore)(int, bool);
 void(*D3D_resize)(int, int);
 void (*D3D_change)(int, int);
-bool(*D3D_getscalerect)(int, float *mx, float *my, float *sx, float *sy);
+bool(*D3D_getscalerect)(int, float *mx, float *my, float *sx, float *sy, int width, int height);
 bool(*D3D_run)(int);
 int(*D3D_debug)(int, int);
 void(*D3D_led)(int, int, int);
@@ -2485,7 +2485,7 @@ static int createmask2texture(struct d3d11struct *d3d, const TCHAR *filename)
        freesprite(&d3d->mask2textureled_power_dim);
        freesprite(&d3d->blanksprite);
 
-       if (filename[0] == 0 || WIN32GFX_IsPicassoScreen(mon))
+       if (filename[0] == 0)
                return 0;
 
        zf = NULL;
@@ -5072,7 +5072,7 @@ static uae_u8 *xD3D_setcursorsurface(int monid, int *pitch)
        }
 }
 
-static bool xD3D11_getscalerect(int monid, float *mx, float *my, float *sx, float *sy)
+static bool xD3D11_getscalerect(int monid, float *mx, float *my, float *sx, float *sy, int width, int height)
 {
        struct d3d11struct *d3d = &d3d11data[monid];
        struct vidbuf_description *vidinfo = &adisplays[monid].gfxvidinfo;
@@ -5082,8 +5082,8 @@ static bool xD3D11_getscalerect(int monid, float *mx, float *my, float *sx, floa
        float mw = d3d->mask2rect.right - d3d->mask2rect.left;
        float mh = d3d->mask2rect.bottom - d3d->mask2rect.top;
 
-       float mxt = (float)mw / vidinfo->outbuffer->inwidth2;
-       float myt = (float)mh / vidinfo->outbuffer->inheight2;
+       float mxt = (float)mw / width;
+       float myt = (float)mh / height;
 
        *mx = d3d->mask2texture_minusx / mxt;
        *my = d3d->mask2texture_minusy / myt;
index 955378f0844b4e371b2014c5ab4e4697faa46893..ed6f685976a6b915a145183b665d855ef26d129e 100644 (file)
@@ -257,6 +257,10 @@ void getfilterrect2(int monid, RECT *sr, RECT *dr, RECT *zr, int dst_width, int
 
        if (mon->screen_is_picasso) {
                getrtgfilterrect2(monid, sr, dr, zr, dst_width, dst_height);
+               if (D3D_getscalerect && D3D_getscalerect(monid, &mrmx, &mrmy, &mrsx, &mrsy, dst_width, dst_height)) {
+                       sizeoffset(dr, zr, mrmx, mrmy);
+                       OffsetRect(dr, mrsx, mrsy);
+               }
                return;
        }
 
@@ -270,7 +274,7 @@ void getfilterrect2(int monid, RECT *sr, RECT *dr, RECT *zr, int dst_width, int
        extrah = -ahs * (filter_vert_zoom - currprefs.gf[ad->picasso_on].gfx_filteroverlay_overscan * 10) / 2.0f;
 
        extraw2 = 0;
-       if (D3D_getscalerect && D3D_getscalerect(0, &mrmx, &mrmy, &mrsx, &mrsy)) {
+       if (D3D_getscalerect && D3D_getscalerect(monid, &mrmx, &mrmy, &mrsx, &mrsy, avidinfo->outbuffer->inwidth2, avidinfo->outbuffer->inheight2)) {
                extraw2 = mrmx;
                //extrah -= mrmy;
        }
@@ -704,7 +708,7 @@ cont:
 
 end:
 
-       if (D3D_getscalerect && D3D_getscalerect(0, &mrmx, &mrmy, &mrsx, &mrsy)) {
+       if (D3D_getscalerect && D3D_getscalerect(monid, &mrmx, &mrmy, &mrsx, &mrsy, avidinfo->outbuffer->inwidth2, avidinfo->outbuffer->inheight2)) {
                sizeoffset (dr, zr, mrmx, mrmy);
                OffsetRect (dr, mrsx, mrsy);
        }