Ken Thomases : d3d9: Make CheckDeviceType() fail for display formats other than D3DFMT_X8R8G8B8 and D3DFMT_R5G6B5 in full-screen.

Alexandre Julliard julliard at winehq.org
Tue Jan 28 13:33:26 CST 2014


Module: wine
Branch: master
Commit: 35d8c5633332d6175ea3925b7df3d7f7d9921083
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=35d8c5633332d6175ea3925b7df3d7f7d9921083

Author: Ken Thomases <ken at codeweavers.com>
Date:   Mon Jan 27 13:32:02 2014 -0600

d3d9: Make CheckDeviceType() fail for display formats other than D3DFMT_X8R8G8B8 and D3DFMT_R5G6B5 in full-screen.

The adapter mode functions already enforce this, and tests show
CheckDeviceType() should fail for full-screen mode with display formats for
which there are no adapter modes.

---

 dlls/d3d9/directx.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c
index 537e6af..e73051d 100644
--- a/dlls/d3d9/directx.c
+++ b/dlls/d3d9/directx.c
@@ -232,6 +232,10 @@ static HRESULT WINAPI d3d9_CheckDeviceType(IDirect3D9Ex *iface, UINT adapter, D3
     TRACE("iface %p, adapter %u, device_type %#x, display_format %#x, backbuffer_format %#x, windowed %#x.\n",
             iface, adapter, device_type, display_format, backbuffer_format, windowed);
 
+    /* Others than that not supported by d3d9, but reported by wined3d for ddraw. Filter them out. */
+    if (!windowed && display_format != D3DFMT_X8R8G8B8 && display_format != D3DFMT_R5G6B5)
+        return WINED3DERR_NOTAVAILABLE;
+
     wined3d_mutex_lock();
     hr = wined3d_check_device_type(d3d9->wined3d, adapter, device_type, wined3dformat_from_d3dformat(display_format),
             wined3dformat_from_d3dformat(backbuffer_format), windowed);




More information about the wine-cvs mailing list