DDRAW: Order Z-buffer formats by depth buffer bit depths in
IDirect3DImpl_7_EnumZBufferFormats
H. Verbeet
hverbeet at gmail.com
Sun Jul 30 16:28:24 CDT 2006
Recent changes to IDirect3DImpl_7_EnumZBufferFormats changed the order
in which we report Z-buffer formats. However, some applications expect
the the formats to be enumerated in a certain order. BattleZone II
expects the 16-bit depth formats to be enumerated before the 24 and 32
ones. This patch orders the formats with depth buffer bit depth. This
fixes a regression in BattleZone II (full version, the demo doesn't
appear to have the problem).
Changelog:
- Order Z-buffer formats by depth buffer bit depths in
IDirect3DImpl_7_EnumZBufferFormats
-------------- next part --------------
diff --git a/dlls/ddraw/direct3d.c b/dlls/ddraw/direct3d.c
index 19c2e8c..db9fa7d 100644
--- a/dlls/ddraw/direct3d.c
+++ b/dlls/ddraw/direct3d.c
@@ -1053,13 +1053,15 @@ IDirect3DImpl_7_EnumZBufferFormats(IDire
HRESULT hr;
int i;
+ /* Order matters. Specifically, BattleZone II (full version) expects the
+ * 16-bit depth formats to be listed before the 24 and 32 ones. */
WINED3DFORMAT FormatList[] = {
- WINED3DFMT_D32,
WINED3DFMT_D15S1,
- WINED3DFMT_D24S8,
+ WINED3DFMT_D16,
WINED3DFMT_D24X8,
WINED3DFMT_D24X4S4,
- WINED3DFMT_D16
+ WINED3DFMT_D24S8,
+ WINED3DFMT_D32
};
TRACE("(%p)->(%s,%p,%p): Relay\n", iface, debugstr_guid(refiidDevice), Callback, Context);
More information about the wine-patches
mailing list