From d5963baecf33f9cc4cae235e515f71f122517795 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Wed, 20 Dec 2017 19:42:29 +0200 Subject: [PATCH] Use 32-bit color depth if D3D11 mode. --- od-win32/win32.cpp | 2 ++ od-win32/win32gfx.cpp | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index 36f74c49..0132f613 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -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) diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 00aa9ced..eb2cecd2 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -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.")); -- 2.47.3