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.
This commit is contained in:
Ken Thomases 2014-01-27 13:32:02 -06:00 committed by Alexandre Julliard
parent e3fa52a636
commit 35d8c56333
1 changed files with 4 additions and 0 deletions

View File

@ -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", 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); 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(); wined3d_mutex_lock();
hr = wined3d_check_device_type(d3d9->wined3d, adapter, device_type, wined3dformat_from_d3dformat(display_format), hr = wined3d_check_device_type(d3d9->wined3d, adapter, device_type, wined3dformat_from_d3dformat(display_format),
wined3dformat_from_d3dformat(backbuffer_format), windowed); wined3dformat_from_d3dformat(backbuffer_format), windowed);