[D3D 37] Added texturing for D3D7

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

 



Changelog:
  Combine texturing for D3D3 and 7 by thunking 3 to 7

-- 
		 Lionel Ulmer - http://www.bbrox.org/
--- /home/ulmer/Wine/wine_base//dlls/ddraw/d3ddevice/main.c	2002-12-22 22:20:29.000000000 +0100
+++ /home/ulmer/Wine/wine_work//dlls/ddraw/d3ddevice/main.c	2002-12-23 15:21:50.000000000 +0100
@@ -453,9 +453,9 @@
 }
 
 HRESULT WINAPI
-Main_IDirect3DDeviceImpl_7_SetTexture(LPDIRECT3DDEVICE7 iface,
-                                      DWORD dwStage,
-                                      LPDIRECTDRAWSURFACE7 lpTexture)
+Main_IDirect3DDeviceImpl_7_3T_SetTexture(LPDIRECT3DDEVICE7 iface,
+					 DWORD dwStage,
+					 LPDIRECTDRAWSURFACE7 lpTexture)
 {
     ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
     FIXME("(%p/%p)->(%08lx,%p): stub!\n", This, iface, dwStage, lpTexture);
@@ -827,16 +827,6 @@
 }
 
 HRESULT WINAPI
-Main_IDirect3DDeviceImpl_3_SetTexture(LPDIRECT3DDEVICE3 iface,
-                                      DWORD dwStage,
-                                      LPDIRECT3DTEXTURE2 lpTexture2)
-{
-    ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
-    FIXME("(%p/%p)->(%08lx,%p): stub!\n", This, iface, dwStage, lpTexture2);
-    return DD_OK;
-}
-
-HRESULT WINAPI
 Main_IDirect3DDeviceImpl_2_SwapTextureHandles(LPDIRECT3DDEVICE2 iface,
                                               LPDIRECT3DTEXTURE2 lpD3DTex1,
                                               LPDIRECT3DTEXTURE2 lpD3DTex2)
@@ -1728,3 +1718,14 @@
                                                lpD3DEnumTextureProc,
                                                lpArg);
 }
+
+HRESULT WINAPI
+Thunk_IDirect3DDeviceImpl_3_SetTexture(LPDIRECT3DDEVICE3 iface,
+				       DWORD dwStage,
+				       LPDIRECT3DTEXTURE2 lpTexture2)
+{
+    TRACE("(%p)->(%ld,%p) thunking to IDirect3DDevice7 interface.\n", iface, dwStage, lpTexture2);
+    return IDirect3DDevice7_SetTexture(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
+				       dwStage,
+				       COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirect3DTexture2, IDirectDrawSurface7, lpTexture2));
+}
--- /home/ulmer/Wine/wine_base//dlls/ddraw/d3ddevice/mesa.c	2002-12-23 15:23:55.000000000 +0100
+++ /home/ulmer/Wine/wine_work//dlls/ddraw/d3ddevice/mesa.c	2002-12-23 15:06:01.000000000 +0100
@@ -1285,11 +1285,11 @@
 }
 
 HRESULT WINAPI
-GL_IDirect3DDeviceImpl_3_SetTexture(LPDIRECT3DDEVICE3 iface,
-				    DWORD dwStage,
-				    LPDIRECT3DTEXTURE2 lpTexture2)
+GL_IDirect3DDeviceImpl_7_3T_SetTexture(LPDIRECT3DDEVICE7 iface,
+				       DWORD dwStage,
+				       LPDIRECTDRAWSURFACE7 lpTexture2)
 {
-    ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
+    ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
     
     TRACE("(%p/%p)->(%08lx,%p)\n", This, iface, dwStage, lpTexture2);
     
@@ -1304,11 +1304,11 @@
 	glBindTexture(GL_TEXTURE_2D, 0);
         glDisable(GL_TEXTURE_2D);
     } else {
-        IDirectDrawSurfaceImpl *tex_impl = ICOM_OBJECT(IDirectDrawSurfaceImpl, IDirect3DTexture2, lpTexture2);
+        IDirectDrawSurfaceImpl *tex_impl = ICOM_OBJECT(IDirectDrawSurfaceImpl, IDirectDrawSurface7, lpTexture2);
 	IDirect3DTextureGLImpl *tex_glimpl = (IDirect3DTextureGLImpl *) tex_impl->tex_private;
 	
 	This->current_texture[dwStage] = tex_impl;
-	IDirectDrawSurface7_AddRef(ICOM_INTERFACE(tex_impl, IDirectDrawSurface7));
+	IDirectDrawSurface7_AddRef(ICOM_INTERFACE(tex_impl, IDirectDrawSurface7)); /* Not sure about this either */
 
 	TRACE(" activating OpenGL texture %d.\n", tex_glimpl->tex_name);
 	
@@ -1378,7 +1378,7 @@
     XCAST(DrawIndexedPrimitiveVB) Main_IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB,
     XCAST(ComputeSphereVisibility) Main_IDirect3DDeviceImpl_7_3T_ComputeSphereVisibility,
     XCAST(GetTexture) Main_IDirect3DDeviceImpl_7_GetTexture,
-    XCAST(SetTexture) Main_IDirect3DDeviceImpl_7_SetTexture,
+    XCAST(SetTexture) GL_IDirect3DDeviceImpl_7_3T_SetTexture,
     XCAST(GetTextureStageState) Main_IDirect3DDeviceImpl_7_3T_GetTextureStageState,
     XCAST(SetTextureStageState) GL_IDirect3DDeviceImpl_7_3T_SetTextureStageState,
     XCAST(ValidateDevice) Main_IDirect3DDeviceImpl_7_3T_ValidateDevice,
@@ -1446,7 +1446,7 @@
     XCAST(DrawIndexedPrimitiveVB) Main_IDirect3DDeviceImpl_3_DrawIndexedPrimitiveVB,
     XCAST(ComputeSphereVisibility) Thunk_IDirect3DDeviceImpl_3_ComputeSphereVisibility,
     XCAST(GetTexture) Main_IDirect3DDeviceImpl_3_GetTexture,
-    XCAST(SetTexture) GL_IDirect3DDeviceImpl_3_SetTexture,
+    XCAST(SetTexture) Thunk_IDirect3DDeviceImpl_3_SetTexture,
     XCAST(GetTextureStageState) Thunk_IDirect3DDeviceImpl_3_GetTextureStageState,
     XCAST(SetTextureStageState) Thunk_IDirect3DDeviceImpl_3_SetTextureStageState,
     XCAST(ValidateDevice) Thunk_IDirect3DDeviceImpl_3_ValidateDevice,
--- /home/ulmer/Wine/wine_base//dlls/ddraw/d3ddevice/main.h	2002-11-21 22:04:16.000000000 +0100
+++ /home/ulmer/Wine/wine_work//dlls/ddraw/d3ddevice/main.h	2002-12-23 15:04:16.000000000 +0100
@@ -206,9 +206,9 @@
                                       LPDIRECTDRAWSURFACE7* lpTexture);
 
 HRESULT WINAPI
-Main_IDirect3DDeviceImpl_7_SetTexture(LPDIRECT3DDEVICE7 iface,
-                                      DWORD dwStage,
-                                      LPDIRECTDRAWSURFACE7 lpTexture);
+Main_IDirect3DDeviceImpl_7_3T_SetTexture(LPDIRECT3DDEVICE7 iface,
+					 DWORD dwStage,
+					 LPDIRECTDRAWSURFACE7 lpTexture);
 
 HRESULT WINAPI
 Main_IDirect3DDeviceImpl_7_3T_GetTextureStageState(LPDIRECT3DDEVICE7 iface,
@@ -366,11 +366,6 @@
                                       LPDIRECT3DTEXTURE2* lplpTexture2);
 
 HRESULT WINAPI
-Main_IDirect3DDeviceImpl_3_SetTexture(LPDIRECT3DDEVICE3 iface,
-                                      DWORD dwStage,
-                                      LPDIRECT3DTEXTURE2 lpTexture2);
-
-HRESULT WINAPI
 Main_IDirect3DDeviceImpl_2_SwapTextureHandles(LPDIRECT3DDEVICE2 iface,
                                               LPDIRECT3DTEXTURE2 lpD3DTex1,
                                               LPDIRECT3DTEXTURE2 lpD3DTex2);
@@ -757,3 +752,8 @@
 Thunk_IDirect3DDeviceImpl_1_EnumTextureFormats(LPDIRECT3DDEVICE iface,
                                                LPD3DENUMTEXTUREFORMATSCALLBACK lpD3DEnumTextureProc,
                                                LPVOID lpArg);
+
+HRESULT WINAPI
+Thunk_IDirect3DDeviceImpl_3_SetTexture(LPDIRECT3DDEVICE3 iface,
+				       DWORD dwStage,
+				       LPDIRECT3DTEXTURE2 lpTexture2);

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

  Powered by Linux