From: Toni Wilen Date: Sun, 8 Dec 2019 16:48:10 +0000 (+0200) Subject: RTG mode overlay support. X-Git-Tag: 4300~15 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=e313ec9c01eaf698ccfcc21f8bae07fb046a7338;p=francis%2Fwinuae.git RTG mode overlay support. --- diff --git a/od-win32/direct3d.cpp b/od-win32/direct3d.cpp index 0e7a519a..ec91a4e5 100644 --- a/od-win32/direct3d.cpp +++ b/od-win32/direct3d.cpp @@ -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; diff --git a/od-win32/direct3d.h b/od-win32/direct3d.h index 17d5f900..fd420e84 100644 --- a/od-win32/direct3d.h +++ b/od-win32/direct3d.h @@ -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); diff --git a/od-win32/direct3d11.cpp b/od-win32/direct3d11.cpp index 2d349e59..79c6db7d 100644 --- a/od-win32/direct3d11.cpp +++ b/od-win32/direct3d11.cpp @@ -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; diff --git a/od-win32/win32_scaler.cpp b/od-win32/win32_scaler.cpp index 955378f0..ed6f6859 100644 --- a/od-win32/win32_scaler.cpp +++ b/od-win32/win32_scaler.cpp @@ -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); }