From e14233ae03e0c26c76e21a51989724cf2369e4ca Mon Sep 17 00:00:00 2001 From: Lionel Ulmer Date: Wed, 4 Jun 2003 23:39:13 +0000 Subject: [PATCH] - Viewport hack to get some old D3D1 games to work - TRACEing fix --- dlls/ddraw/d3ddevice/main.c | 4 +++- dlls/ddraw/d3dviewport.c | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dlls/ddraw/d3ddevice/main.c b/dlls/ddraw/d3ddevice/main.c index 25b34baa1ea..9c4d566a533 100644 --- a/dlls/ddraw/d3ddevice/main.c +++ b/dlls/ddraw/d3ddevice/main.c @@ -1380,7 +1380,9 @@ Main_IDirect3DDeviceImpl_1_SetMatrix(LPDIRECT3DDEVICE iface, 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; diff --git a/dlls/ddraw/d3dviewport.c b/dlls/ddraw/d3dviewport.c index 24931640652..6262a6ba358 100644 --- a/dlls/ddraw/d3dviewport.c +++ b/dlls/ddraw/d3dviewport.c @@ -185,6 +185,13 @@ Main_IDirect3DViewportImpl_3_2_1_SetViewport(LPDIRECT3DVIEWPORT3 iface, 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; }