[D3D] Some hacks for D3D1 games

Lionel Ulmer lionel.ulmer at free.fr
Tue Jun 3 11:30:39 CDT 2003


Well, when doing proper Viewport support for DungeonSiege, I broke all D3D1
games... The reason is the following :

AvP puts this :
trace:ddraw:GL_IDirect3DDeviceImpl_7_SetViewport     - dvMinZ = 0.000000 dvMaxZ = 0.000000

MotoRacer2 puts this :
trace:ddraw:GL_IDirect3DDeviceImpl_7_SetViewport     - dvMinZ = 1.000000 dvMaxZ = 65535.000000

And these values are both obviously wrong. So I suppose that these values
were not actually used in D3D1 (or if they were, they were used for
something else than OpenGL use them for :-) ).

So I override them with the default 0.0 / 1.0 values (which was what the
code did before my Viewport change in D3D7).

Changelog:
 - Viewport hack to get some old D3D1 games to work
 - TRACEing fix

-- 
		 Lionel Ulmer - http://www.bbrox.org/
-------------- next part --------------
--- dlls/ddraw_CVS/d3ddevice/main.c	Sun Jun  1 20:56:09 2003
+++ dlls/ddraw/d3ddevice/main.c	Tue Jun  3 18:20:02 2003
@@ -1380,7 +1380,9 @@
     ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
     TRACE("(%p/%p)->(%08lx,%p)\n", This, iface, (DWORD) D3DMatHandle, lpD3DMatrix);
 
-    dump_D3DMATRIX(lpD3DMatrix);
+    if (TRACE_ON(ddraw)) {
+	dump_D3DMATRIX(lpD3DMatrix);
+    }
     *((D3DMATRIX *) D3DMatHandle) = *lpD3DMatrix;   
     
     return DD_OK;
--- dlls/ddraw_CVS/d3dviewport.c	Sun Jun  1 20:56:09 2003
+++ dlls/ddraw/d3dviewport.c	Tue Jun  3 18:09:13 2003
@@ -185,6 +185,13 @@
     This->use_vp2 = 0;
     memset(&(This->viewports.vp1), 0, sizeof(This->viewports.vp1));
     memcpy(&(This->viewports.vp1), lpData, lpData->dwSize);
+
+    /* Tests on two games shows that these values are never used properly so overide
+       them with proper ones :-)
+    */
+    This->viewports.vp1.dvMinZ = 0.0;
+    This->viewports.vp1.dvMaxZ = 1.0;
+    
     return DD_OK;
 }
 


More information about the wine-patches mailing list