[D3D 51] Some more functions fleshed out.

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

 



Changelog:
 - implemented GetTexture
 - semi-stubbed ValidateTexture
 - fixed some errors in logging

-- 
		 Lionel Ulmer - http://www.bbrox.org/
--- /home/ulmer/Wine/wine_base//dlls/ddraw/d3ddevice/main.c	2002-12-25 21:26:29.000000000 +0100
+++ /home/ulmer/Wine/wine_work//dlls/ddraw/d3ddevice/main.c	2002-12-25 22:09:54.000000000 +0100
@@ -468,12 +468,23 @@
 }
 
 HRESULT WINAPI
-Main_IDirect3DDeviceImpl_7_GetTexture(LPDIRECT3DDEVICE7 iface,
-                                      DWORD dwStage,
-                                      LPDIRECTDRAWSURFACE7* lpTexture)
+Main_IDirect3DDeviceImpl_7_3T_GetTexture(LPDIRECT3DDEVICE7 iface,
+					 DWORD dwStage,
+					 LPDIRECTDRAWSURFACE7* lpTexture)
 {
     ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
-    FIXME("(%p/%p)->(%08lx,%p): stub!\n", This, iface, dwStage, lpTexture);
+    TRACE("(%p/%p)->(%08lx,%p)\n", This, iface, dwStage, lpTexture);
+
+    if (This->current_texture[dwStage] != NULL) {
+        *lpTexture = ICOM_INTERFACE(This->current_texture[dwStage], IDirectDrawSurface7);
+    } else {
+        *lpTexture = NULL;
+    }
+
+    TRACE(" returning interface at %p (for implementation at %p).\n", *lpTexture, This->current_texture[dwStage]);
+
+    /* Note: should this method increase the reference count for this ?? */
+
     return DD_OK;
 }
 
@@ -514,7 +525,11 @@
                                              LPDWORD lpdwPasses)
 {
     ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
-    FIXME("(%p/%p)->(%p): stub!\n", This, iface, lpdwPasses);
+    FIXME("(%p/%p)->(%p): semi-stub!\n", This, iface, lpdwPasses);
+
+    /* For the moment, we have a VERY good hardware which does everything in one pass :-) */
+    *lpdwPasses = 1;
+
     return DD_OK;
 }
 
@@ -833,16 +848,6 @@
 }
 
 HRESULT WINAPI
-Main_IDirect3DDeviceImpl_3_GetTexture(LPDIRECT3DDEVICE3 iface,
-                                      DWORD dwStage,
-                                      LPDIRECT3DTEXTURE2* lplpTexture2)
-{
-    ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
-    FIXME("(%p/%p)->(%08lx,%p): stub!\n", This, iface, dwStage, lplpTexture2);
-    return DD_OK;
-}
-
-HRESULT WINAPI
 Main_IDirect3DDeviceImpl_2_SwapTextureHandles(LPDIRECT3DDEVICE2 iface,
                                               LPDIRECT3DTEXTURE2 lpD3DTex1,
                                               LPDIRECT3DTEXTURE2 lpD3DTex2)
@@ -1783,3 +1788,23 @@
 						   dwIndexCount,
 						   dwFlags);
 }
+
+HRESULT WINAPI
+Thunk_IDirect3DDeviceImpl_3_GetTexture(LPDIRECT3DDEVICE3 iface,
+				       DWORD dwStage,
+				       LPDIRECT3DTEXTURE2* lplpTexture2)
+{
+    HRESULT ret;
+    LPDIRECTDRAWSURFACE7 ret_val;
+
+    TRACE("(%p)->(%ld,%p) thunking to IDirect3DDevice7 interface.\n", iface, dwStage, lplpTexture2);
+    ret = IDirect3DDevice7_GetTexture(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
+				      dwStage,
+				      &ret_val);
+
+    *lplpTexture2 = COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7, IDirect3DTexture2, ret_val);
+
+    TRACE(" returning interface %p.\n", *lplpTexture2);
+    
+    return ret;
+}
--- /home/ulmer/Wine/wine_base//dlls/ddraw/d3ddevice/mesa.c	2002-12-25 21:56:08.000000000 +0100
+++ /home/ulmer/Wine/wine_work//dlls/ddraw/d3ddevice/mesa.c	2002-12-25 22:05:42.000000000 +0100
@@ -1358,7 +1358,7 @@
 		    gl_state = GL_LINEAR;
 		    break;
 		default:
-		    if (TRACE_ON(ddraw)) DPRINTF(" state unhandled.\n");
+		    if (TRACE_ON(ddraw)) DPRINTF(" state unhandled (%ld).\n", dwState);
 		    gl_state = GL_LINEAR;
 		    break;
 	    }
@@ -1377,7 +1377,7 @@
 		    gl_state = GL_LINEAR;
 		    break;
 		default:
-		    if (TRACE_ON(ddraw)) DPRINTF(" state unhandled.\n");
+		    if (TRACE_ON(ddraw)) DPRINTF(" state unhandled (%ld).\n", dwState);
 		    gl_state = GL_LINEAR;
 		    break;
 	    }
@@ -1393,7 +1393,7 @@
 	        case D3DTADDRESS_WRAP:   if (TRACE_ON(ddraw)) DPRINTF("D3DTADDRESS_WRAP\n"); arg = GL_REPEAT; break;
 	        case D3DTADDRESS_CLAMP:  if (TRACE_ON(ddraw)) DPRINTF("D3DTADDRESS_CLAMP\n"); arg = GL_CLAMP; break;
 	        case D3DTADDRESS_BORDER: if (TRACE_ON(ddraw)) DPRINTF("D3DTADDRESS_BORDER\n"); arg = GL_CLAMP_TO_EDGE; break;
-	        default: ERR("Unhandled TEXTUREADDRESS mode %ld !\n", dwState);
+	        default: DPRINTF(" state unhandled (%ld).\n", dwState);
 	    }
 	    if ((d3dTexStageStateType == D3DTSS_ADDRESS) ||
 		(d3dTexStageStateType == D3DTSS_ADDRESSU))
@@ -1503,7 +1503,7 @@
     XCAST(DrawPrimitiveVB) GL_IDirect3DDeviceImpl_7_3T_DrawPrimitiveVB,
     XCAST(DrawIndexedPrimitiveVB) GL_IDirect3DDeviceImpl_7_3T_DrawIndexedPrimitiveVB,
     XCAST(ComputeSphereVisibility) Main_IDirect3DDeviceImpl_7_3T_ComputeSphereVisibility,
-    XCAST(GetTexture) Main_IDirect3DDeviceImpl_7_GetTexture,
+    XCAST(GetTexture) Main_IDirect3DDeviceImpl_7_3T_GetTexture,
     XCAST(SetTexture) GL_IDirect3DDeviceImpl_7_3T_SetTexture,
     XCAST(GetTextureStageState) Main_IDirect3DDeviceImpl_7_3T_GetTextureStageState,
     XCAST(SetTextureStageState) GL_IDirect3DDeviceImpl_7_3T_SetTextureStageState,
@@ -1571,7 +1571,7 @@
     XCAST(DrawPrimitiveVB) Thunk_IDirect3DDeviceImpl_3_DrawPrimitiveVB,
     XCAST(DrawIndexedPrimitiveVB) Thunk_IDirect3DDeviceImpl_3_DrawIndexedPrimitiveVB,
     XCAST(ComputeSphereVisibility) Thunk_IDirect3DDeviceImpl_3_ComputeSphereVisibility,
-    XCAST(GetTexture) Main_IDirect3DDeviceImpl_3_GetTexture,
+    XCAST(GetTexture) Thunk_IDirect3DDeviceImpl_3_GetTexture,
     XCAST(SetTexture) Thunk_IDirect3DDeviceImpl_3_SetTexture,
     XCAST(GetTextureStageState) Thunk_IDirect3DDeviceImpl_3_GetTextureStageState,
     XCAST(SetTextureStageState) Thunk_IDirect3DDeviceImpl_3_SetTextureStageState,
--- /home/ulmer/Wine/wine_base//dlls/ddraw/d3ddevice/main.h	2002-12-25 21:26:29.000000000 +0100
+++ /home/ulmer/Wine/wine_work//dlls/ddraw/d3ddevice/main.h	2002-12-25 22:06:11.000000000 +0100
@@ -201,9 +201,9 @@
                                                       LPDWORD lpdwReturnValues);
 
 HRESULT WINAPI
-Main_IDirect3DDeviceImpl_7_GetTexture(LPDIRECT3DDEVICE7 iface,
-                                      DWORD dwStage,
-                                      LPDIRECTDRAWSURFACE7* lpTexture);
+Main_IDirect3DDeviceImpl_7_3T_GetTexture(LPDIRECT3DDEVICE7 iface,
+					 DWORD dwStage,
+					 LPDIRECTDRAWSURFACE7* lpTexture);
 
 HRESULT WINAPI
 Main_IDirect3DDeviceImpl_7_3T_SetTexture(LPDIRECT3DDEVICE7 iface,
@@ -345,11 +345,6 @@
                                             DWORD dwLightState);
 
 HRESULT WINAPI
-Main_IDirect3DDeviceImpl_3_GetTexture(LPDIRECT3DDEVICE3 iface,
-                                      DWORD dwStage,
-                                      LPDIRECT3DTEXTURE2* lplpTexture2);
-
-HRESULT WINAPI
 Main_IDirect3DDeviceImpl_2_SwapTextureHandles(LPDIRECT3DDEVICE2 iface,
                                               LPDIRECT3DTEXTURE2 lpD3DTex1,
                                               LPDIRECT3DTEXTURE2 lpD3DTex2);
@@ -757,3 +752,9 @@
 						   LPWORD lpwIndices,
 						   DWORD dwIndexCount,
 						   DWORD dwFlags);
+
+HRESULT WINAPI
+Thunk_IDirect3DDeviceImpl_3_GetTexture(LPDIRECT3DDEVICE3 iface,
+				       DWORD dwStage,
+				       LPDIRECT3DTEXTURE2* lplpTexture2);
+

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

  Powered by Linux