From: Toni Wilen Date: Sat, 4 Jan 2025 11:10:50 +0000 (+0200) Subject: Bordercolor config entry X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=6ab498c0994c9dadbe67be9ae154dd7fc9cbc552;p=francis%2Fwinuae.git Bordercolor config entry --- diff --git a/cfgfile.cpp b/cfgfile.cpp index 9e0813b5..8016288b 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -2469,6 +2469,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_dwrite_strarr(f, _T("gfx_overscanmode"), overscanmodes, p->gfx_overscanmode); cfgfile_dwrite(f, _T("gfx_monitorblankdelay"), _T("%d"), p->gfx_monitorblankdelay); cfgfile_dwrite(f, _T("gfx_rotation"), _T("%d"), p->gfx_rotation); + cfgfile_dwrite (f, _T("gfx_bordercolor"), _T("%08x"), p->gfx_bordercolor); #ifdef GFXFILTER for (int j = 0; j < MAX_FILTERDATA; j++) { @@ -3692,6 +3693,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) || cfgfile_intval(option, value, _T("gfx_horizontal_extra"), &p->gfx_extrawidth, 1) || cfgfile_intval(option, value, _T("gfx_vertical_extra"), &p->gfx_extraheight, 1) || cfgfile_intval(option, value, _T("gfx_monitorblankdelay"), &p->gfx_monitorblankdelay, 1) + || cfgfile_intval(option, value, _T("gfx_bordercolor"), &p->gfx_bordercolor, 1) || cfgfile_intval (option, value, _T("floppy0sound"), &p->floppyslots[0].dfxclick, 1) || cfgfile_intval (option, value, _T("floppy1sound"), &p->floppyslots[1].dfxclick, 1) diff --git a/include/options.h b/include/options.h index 8c8b1c74..6d838bde 100644 --- a/include/options.h +++ b/include/options.h @@ -620,6 +620,7 @@ struct uae_prefs { int gfx_overscanmode; int gfx_monitorblankdelay; int gfx_rotation; + uae_u32 gfx_bordercolor; struct gfx_filterdata gf[3]; diff --git a/od-win32/direct3d.cpp b/od-win32/direct3d.cpp index 7a9575e4..ae495d98 100644 --- a/od-win32/direct3d.cpp +++ b/od-win32/direct3d.cpp @@ -3365,7 +3365,11 @@ static int xD3D_debug(int monid, int mode) static void clearrt(struct d3dstruct *d3d) { HRESULT hr; - uae_u8 color[4] = { 0, 0, 0, 0 }; + uae_u8 a = (currprefs.gfx_bordercolor >> 24) & 0xff; + uae_u8 r = (currprefs.gfx_bordercolor >> 16) & 0xff; + uae_u8 g = (currprefs.gfx_bordercolor >> 8) & 0xff; + uae_u8 b = (currprefs.gfx_bordercolor >> 0) & 0xff; + uae_u8 color[4] = { r, g, b, a }; if (noclear && cannoclear) { if (clearcnt > 3) diff --git a/od-win32/direct3d11.cpp b/od-win32/direct3d11.cpp index 0fcbc052..e843796d 100644 --- a/od-win32/direct3d11.cpp +++ b/od-win32/direct3d11.cpp @@ -4497,10 +4497,15 @@ static void clearrt(struct d3d11struct *d3d) { // Setup the color to clear the buffer to. float color[4]; - color[0] = 0; - color[1] = 0; - color[2] = 0; - color[3] = 0; + int a = (currprefs.gfx_bordercolor >> 24) & 0xff; + int r = (currprefs.gfx_bordercolor >> 16) & 0xff; + int g = (currprefs.gfx_bordercolor >> 8) & 0xff; + int b = (currprefs.gfx_bordercolor >> 0) & 0xff; + + color[3] = (float)a / 255.0f; + color[2] = (float)b / 255.0f; + color[1] = (float)g / 255.0f; + color[0] = (float)r / 255.0f; if (noclear && cannoclear) { if (clearcnt > 3)