[D3D 68] Fix some dumb game (1/2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Changelog:
 - added enumeration of the Reference device (some games seems to need
   it to work and they want it enumerated first..)
 - some comments about potential problems with Z masking

-- 
		 Lionel Ulmer - http://www.bbrox.org/
--- /home/ulmer/Wine/wine_base//dlls/ddraw/d3ddevice/mesa.c	2002-12-30 11:19:27.000000000 +0100
+++ /home/ulmer/Wine/wine_work//dlls/ddraw/d3ddevice/mesa.c	2002-12-30 20:20:33.000000000 +0100
@@ -272,12 +272,22 @@
 HRESULT d3ddevice_enumerate(LPD3DENUMDEVICESCALLBACK cb, LPVOID context)
 {
     D3DDEVICEDESC d1, d2;
-
+    HRESULT ret_value;
+    
     fill_opengl_caps(&d1);
     d2 = d1;
 
+    TRACE(" enumerating OpenGL D3DDevice interface using reference IID (IID %s).\n", debugstr_guid(&IID_IDirect3DRefDevice));
+    ret_value = cb((LPIID) &IID_IDirect3DRefDevice, "WINE Reference Direct3DX using OpenGL", "direct3d", &d1, &d2, context);
+    if (ret_value != D3DENUMRET_OK)
+        return ret_value;
+
     TRACE(" enumerating OpenGL D3DDevice interface (IID %s).\n", debugstr_guid(&IID_D3DDEVICE_OpenGL));
-    return cb((LPIID) &IID_D3DDEVICE_OpenGL, "WINE Direct3DX using OpenGL", "direct3d", &d1, &d2, context);
+    ret_value = cb((LPIID) &IID_D3DDEVICE_OpenGL, "WINE Direct3DX using OpenGL", "direct3d", &d1, &d2, context);
+    if (ret_value != D3DENUMRET_OK)
+        return ret_value;
+    
+    return D3DENUMRET_OK;
 }
 
 HRESULT d3ddevice_enumerate7(LPD3DENUMDEVICESCALLBACK7 cb, LPVOID context)
@@ -479,8 +489,9 @@
     }
     if (lpD3DDFS->dwFlags & D3DFDS_GUID) {
         TRACE(" trying to match guid %s.\n", debugstr_guid(&(lpD3DDFS->guid)));
-	if ((IsEqualGUID( &IID_D3DDEVICE_OpenGL, &(lpD3DDFS->guid)) == 0) &&
-	    (IsEqualGUID(&IID_IDirect3DHALDevice, &(lpD3DDFS->guid)) == 0)) {
+	if ((IsEqualGUID(&IID_D3DDEVICE_OpenGL, &(lpD3DDFS->guid)) == 0) &&
+	    (IsEqualGUID(&IID_IDirect3DHALDevice, &(lpD3DDFS->guid)) == 0) &&
+	    (IsEqualGUID(&IID_IDirect3DRefDevice, &(lpD3DDFS->guid)) == 0)) {
 	    TRACE(" no match for this GUID.\n");
 	    return DDERR_INVALIDPARAMS;
 	}
--- /home/ulmer/Wine/wine_base//dlls/ddraw/mesa.c	2002-12-29 15:16:14.000000000 +0100
+++ /home/ulmer/Wine/wine_work//dlls/ddraw/mesa.c	2002-12-29 18:43:55.000000000 +0100
@@ -135,10 +135,18 @@
 	        break;
 
 	    case D3DRENDERSTATE_ZENABLE:          /*  7 */
-	        if (dwRenderState)
+	        /* To investigate : in OpenGL, if we disable the depth test, the Z buffer will NOT be
+		   updated either.. No idea about what happens in D3D.
+		   
+		   Maybe replacing the Z function by ALWAYS would be a better idea. */
+	        if (dwRenderState == D3DZB_TRUE)
 		    glEnable(GL_DEPTH_TEST);
-		else
+		else if (dwRenderState == D3DZB_FALSE)
 		    glDisable(GL_DEPTH_TEST);
+		else {
+		    glEnable(GL_DEPTH_TEST);
+		    WARN(" w-buffering not supported.\n");
+		}
 	        break;
 
 	    case D3DRENDERSTATE_FILLMODE:           /*  8 */
--- /home/ulmer/Wine/wine_base//dlls/ddraw/direct3d/mesa.c	2002-12-29 09:28:51.000000000 +0100
+++ /home/ulmer/Wine/wine_work//dlls/ddraw/direct3d/mesa.c	2002-12-30 20:21:51.000000000 +0100
@@ -131,7 +131,8 @@
     if ((iid == NULL) ||
 	(IsEqualGUID(&IID_D3DDEVICE_OpenGL, iid)) ||
 	(IsEqualGUID(&IID_IDirect3DHALDevice, iid)) ||
-	(IsEqualGUID(&IID_IDirect3DTnLHalDevice, iid))) {
+	(IsEqualGUID(&IID_IDirect3DTnLHalDevice, iid)) ||
+	(IsEqualGUID(&IID_IDirect3DRefDevice, iid))) {
         switch (interface) {
 	    case 1:
 		*obj = ICOM_INTERFACE(lpd3ddev, IDirect3DDevice);

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux