Stefan Dösinger : d3d: Filter R8G8B8 in d3d8 and d3d9.
Alexandre Julliard
julliard at winehq.org
Fri Aug 7 08:49:34 CDT 2009
Module: wine
Branch: master
Commit: 296573caae8388830a0972615e763e2a44d66c7e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=296573caae8388830a0972615e763e2a44d66c7e
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Wed Aug 5 20:55:51 2009 +0200
d3d: Filter R8G8B8 in d3d8 and d3d9.
---
dlls/d3d8/directx.c | 8 ++++++++
dlls/d3d9/directx.c | 12 ++++++++++++
dlls/wined3d/directx.c | 12 ------------
3 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c
index 33abe84..c50c4b2 100644
--- a/dlls/d3d8/directx.c
+++ b/dlls/d3d8/directx.c
@@ -195,6 +195,14 @@ static HRESULT WINAPI IDirect3D8Impl_CheckDeviceFormat (LPDIRECT3D8 i
WINED3DRESOURCETYPE WineD3DRType;
TRACE("(%p)->(%d, %d, %d, %08x, %d, %d)\n", This, Adapter, DeviceType, AdapterFormat, Usage, RType, CheckFormat);
+ if(CheckFormat == D3DFMT_R8G8B8)
+ {
+ /* See comment in dlls/d3d9/directx.c, IDirect3D9Impl_CheckDeviceFormat for details */
+ WARN("D3DFMT_R8G8B8 is not available on windows, returning D3DERR_NOTAVAILABLE\n");
+ return D3DERR_NOTAVAILABLE;
+ }
+
+
switch(RType) {
case D3DRTYPE_VERTEXBUFFER:
case D3DRTYPE_INDEXBUFFER:
diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c
index bee2e4f..57039c5 100644
--- a/dlls/d3d9/directx.c
+++ b/dlls/d3d9/directx.c
@@ -199,6 +199,18 @@ static HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormat(LPDIRECT3D9EX iface,
WINED3DRESOURCETYPE WineD3DRType;
TRACE("%p\n", This);
+ /* This format is nothing special and it is supported perfectly.
+ * However, ati and nvidia driver on windows do not mark this format as
+ * supported (tested with the dxCapsViewer) and pretending to
+ * support this format uncovers a bug in Battlefield 1942 (fonts are missing)
+ * So do the same as Windows drivers and pretend not to support it on dx8 and 9
+ */
+ if(CheckFormat == D3DFMT_R8G8B8)
+ {
+ WARN("D3DFMT_R8G8B8 is not available on windows, returning D3DERR_NOTAVAILABLE\n");
+ return D3DERR_NOTAVAILABLE;
+ }
+
switch(RType) {
case D3DRTYPE_VERTEXBUFFER:
case D3DRTYPE_INDEXBUFFER:
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index de37df1..554dc5e 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -3644,18 +3644,6 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
return WINED3DERR_NOTAVAILABLE;
}
- /* This format is nothing special and it is supported perfectly.
- * However, ati and nvidia driver on windows do not mark this format as
- * supported (tested with the dxCapsViewer) and pretending to
- * support this format uncovers a bug in Battlefield 1942 (fonts are missing)
- * So do the same as Windows drivers and pretend not to support it on dx8 and 9
- * Enable it on dx7. It will need additional checking on dx10 when we support it.
- */
- if(This->dxVersion > 7 && CheckFormat == WINED3DFMT_R8G8B8) {
- TRACE_(d3d_caps)("[FAILED]\n");
- return WINED3DERR_NOTAVAILABLE;
- }
-
/* When the UsageCaps exactly matches Usage return WINED3D_OK except for the situation in which
* WINED3DUSAGE_AUTOGENMIPMAP isn't around, then WINED3DOK_NOAUTOGEN is returned if all the other
* usage flags match. */
More information about the wine-cvs
mailing list