]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Use 32-bit color depth if D3D11 mode.
authorToni Wilen <twilen@winuae.net>
Wed, 20 Dec 2017 17:42:29 +0000 (19:42 +0200)
committerToni Wilen <twilen@winuae.net>
Wed, 20 Dec 2017 17:42:29 +0000 (19:42 +0200)
od-win32/win32.cpp
od-win32/win32gfx.cpp

index 36f74c49c6fda96df5b52d608d7c7f209be441ed..0132f613450bcbed024a4ce17cbb0264ae4a2ca2 100644 (file)
@@ -3771,6 +3771,8 @@ void target_default_options (struct uae_prefs *p, int type)
                p->win32_commandpathend[0] = 0;
                p->win32_statusbar = 1;
                p->gfx_api = os_win7 ? 2 : (os_vista ? 1 : 0);
+               if (p->gfx_api > 1)
+                       p->color_mode = 5;
                if (p->gf[APMODE_NATIVE].gfx_filter == 0 && p->gfx_api)
                        p->gf[APMODE_NATIVE].gfx_filter = 1;
                if (p->gf[APMODE_RTG].gfx_filter == 0 && p->gfx_api)
index 00aa9cedd14a0aceba8b946ec0e84c107dd9fce6..eb2cecd2f810288e82a0da3733103b2c27194532 100644 (file)
@@ -4063,7 +4063,7 @@ double vblank_calibrate (double approx_vblank, bool waitonly)
                                vsdetect++;
                }
                if (vsdetect >= detectcnt / 2) {
-                       write_log (L"Forced vsync detected, switching to double buffered\n");
+                       write_log (_T("Forced vsync detected, switching to double buffered\n"));
                        changed_prefs.gfx_apmode[0].gfx_backbuffers = 1;
                }
        }
@@ -4490,6 +4490,7 @@ static BOOL doInit (void)
        int tmp_depth;
        int ret = 0;
 
+retry:
        remembered_vblank = -1;
        if (wasfullwindow_a == 0)
                wasfullwindow_a = currprefs.gfx_apmode[0].gfx_fullscreen == GFX_FULLWINDOW ? 1 : -1;
@@ -4653,6 +4654,11 @@ static BOOL doInit (void)
                if (err) {
                        if (currprefs.gfx_api == 2) {
                                D3D_free(true);
+                               if (err[0] == 0 && currprefs.color_mode != 5) {
+                                       changed_prefs.color_mode = currprefs.color_mode = 5;
+                                       update_gfxparams();
+                                       goto retry;
+                               }
                                changed_prefs.gfx_api = currprefs.gfx_api = 1;
                                d3d_select(&currprefs);
                                error_log(_T("Direct3D11 failed to initialize, falling back to Direct3D9."));