[PATCH 1/5] d3d8: Make CheckDeviceType() fail for display formats other than D3DFMT_X8R8G8B8 and D3DFMT_R5G6B5 in full-screen.

Matteo Bruni mbruni at codeweavers.com
Thu Feb 11 09:10:45 CST 2016


Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
This is essentially the same as 35d8c5633332d6175ea3925b7df3d7f7d9921083
but for d3d8. Without this one the next patch fails a test in
device.c:test_display_formats().

 dlls/d3d8/directx.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c
index 7388bf3..863e596 100644
--- a/dlls/d3d8/directx.c
+++ b/dlls/d3d8/directx.c
@@ -220,6 +220,9 @@ static HRESULT WINAPI d3d8_CheckDeviceType(IDirect3D8 *iface, UINT adapter, D3DD
     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);
 
+    if (!windowed && display_format != D3DFMT_X8R8G8B8 && display_format != D3DFMT_R5G6B5)
+        return WINED3DERR_NOTAVAILABLE;
+
     wined3d_mutex_lock();
     hr = wined3d_check_device_type(d3d8->wined3d, adapter, device_type, wined3dformat_from_d3dformat(display_format),
             wined3dformat_from_d3dformat(backbuffer_format), windowed);
-- 
2.4.10




More information about the wine-patches mailing list