Matteo Bruni : d3d8: Return failure in CheckDeviceFormat() for unsupported adapter formats.
Alexandre Julliard
julliard at winehq.org
Fri Mar 8 19:41:10 CST 2019
Module: wine
Branch: master
Commit: ff92a993ad63f6ed94cd1dd873aa578ba46c5979
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ff92a993ad63f6ed94cd1dd873aa578ba46c5979
Author: Matteo Bruni <mbruni at codeweavers.com>
Date: Thu Mar 7 21:14:59 2019 +0100
d3d8: Return failure in CheckDeviceFormat() for unsupported adapter formats.
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3d8/directx.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c
index 09188cc..f78ff3e 100644
--- a/dlls/d3d8/directx.c
+++ b/dlls/d3d8/directx.c
@@ -242,10 +242,11 @@ static HRESULT WINAPI d3d8_CheckDeviceFormat(IDirect3D8 *iface, UINT adapter, D3
TRACE("iface %p, adapter %u, device_type %#x, adapter_format %#x, usage %#x, resource_type %#x, format %#x.\n",
iface, adapter, device_type, adapter_format, usage, resource_type, format);
- if (!adapter_format)
+ if (adapter_format != D3DFMT_X8R8G8B8 && adapter_format != D3DFMT_R5G6B5
+ && adapter_format != D3DFMT_X1R5G5B5)
{
WARN("Invalid adapter format.\n");
- return D3DERR_INVALIDCALL;
+ return adapter_format ? D3DERR_NOTAVAILABLE : D3DERR_INVALIDCALL;
}
bind_flags = wined3d_bind_flags_from_d3d8_usage(usage);
More information about the wine-cvs
mailing list