]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Bordercolor config entry
authorToni Wilen <twilen@winuae.net>
Sat, 4 Jan 2025 11:10:50 +0000 (13:10 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 4 Jan 2025 11:10:50 +0000 (13:10 +0200)
cfgfile.cpp
include/options.h
od-win32/direct3d.cpp
od-win32/direct3d11.cpp

index 9e0813b5043b7f74b6427c88be2a9f644c9692ac..8016288bbe60a52d4aae94bbed3892915c010a87 100644 (file)
@@ -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)
index 8c8b1c7495da86a6b88b5bb75f132395e61e4b5f..6d838bde1ac381da3654ae6d9410ffbd69152288 100644 (file)
@@ -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];
 
index 7a9575e4ac244c14d6e782fda2248e8c2eb2f2c8..ae495d98998c8ea710b5d07a03ac9a13dd7fcf10 100644 (file)
@@ -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)
index 0fcbc052afbe4ac7b46958980aea11315acd8426..e843796d97395aa9a997a279e2d7ad7e053ae7ee 100644 (file)
@@ -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)