[D3D 62] Reimplements SwapTextureHandles

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

 



This path reimplements SwapTextureHandles that have
been lost during the reorganization of the D3D code.

Modified files :
dlls/ddraw/d3ddevice/main.c
dlls/ddraw/d3ddevice/main.h
dlls/ddraw/d3ddevice/mesa.c

Changelog :
Reimplements SwapTextureHandles.

Christian Costa   titan.costa@wanadoo.fr

diff -u -r ../../winebase/wine/dlls/ddraw/d3ddevice/main.c dlls/ddraw/d3ddevice/main.c
--- ../../winebase/wine/dlls/ddraw/d3ddevice/main.c	Sun Dec 29 07:50:50 2002
+++ dlls/ddraw/d3ddevice/main.c	Sun Dec 29 08:38:53 2002
@@ -901,12 +901,20 @@
 }
 
 HRESULT WINAPI
-Main_IDirect3DDeviceImpl_2_SwapTextureHandles(LPDIRECT3DDEVICE2 iface,
-                                              LPDIRECT3DTEXTURE2 lpD3DTex1,
-                                              LPDIRECT3DTEXTURE2 lpD3DTex2)
+Main_IDirect3DDeviceImpl_2_1T_SwapTextureHandles(LPDIRECT3DDEVICE2 iface,
+                                                 LPDIRECT3DTEXTURE2 lpD3DTex1,
+                                                 LPDIRECT3DTEXTURE2 lpD3DTex2)
 {
     ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface);
-    FIXME("(%p/%p)->(%p,%p): stub!\n", This, iface, lpD3DTex1, lpD3DTex2);
+    IDirectDrawSurfaceImpl tmp,*surf1,*surf2;
+    TRACE("(%p/%p)->(%p,%p):\n", This, iface, lpD3DTex1, lpD3DTex2);
+
+    surf1 = ICOM_OBJECT(IDirectDrawSurfaceImpl,IDirect3DTexture2,lpD3DTex1);
+    surf2 = ICOM_OBJECT(IDirectDrawSurfaceImpl,IDirect3DTexture2,lpD3DTex2);
+    tmp = *surf1;
+    *surf1 = *surf2;
+    *surf2 = tmp;
+    
     return DD_OK;
 }
 
@@ -995,16 +1003,6 @@
 }
 
 HRESULT WINAPI
-Main_IDirect3DDeviceImpl_1_SwapTextureHandles(LPDIRECT3DDEVICE iface,
-                                              LPDIRECT3DTEXTURE lpD3Dtex1,
-                                              LPDIRECT3DTEXTURE lpD3DTex2)
-{
-    ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
-    FIXME("(%p/%p)->(%p,%p): stub!\n", This, iface, lpD3Dtex1, lpD3DTex2);
-    return DD_OK;
-}
-
-HRESULT WINAPI
 Main_IDirect3DDeviceImpl_1_CreateExecuteBuffer(LPDIRECT3DDEVICE iface,
                                                LPD3DEXECUTEBUFFERDESC lpDesc,
                                                LPDIRECT3DEXECUTEBUFFER* lplpDirect3DExecuteBuffer,
@@ -1667,6 +1665,17 @@
     return IDirect3DDevice3_GetCaps(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice3, iface),
                                     lpD3DHWDevDesc,
                                     lpD3DHELDevDesc);
+}
+
+HRESULT WINAPI
+Thunk_IDirect3DDeviceImpl_1_SwapTextureHandles(LPDIRECT3DDEVICE iface,
+                                              LPDIRECT3DTEXTURE lpD3DTex1,
+                                              LPDIRECT3DTEXTURE lpD3DTex2)
+{
+    TRACE("(%p)->(%p,%p) thunking to IDirect3DDevice2 interface.\n", iface, lpD3DTex1, lpD3DTex2);
+    return IDirect3DDevice2_SwapTextureHandles(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice2, iface),
+                                               COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirect3DTexture, IDirect3DTexture2, lpD3DTex1),
+                                               COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirect3DTexture, IDirect3DTexture2, lpD3DTex2));
 }
 
 HRESULT WINAPI
Only in dlls/ddraw/d3ddevice: main.c~
diff -u -r ../../winebase/wine/dlls/ddraw/d3ddevice/main.h dlls/ddraw/d3ddevice/main.h
--- ../../winebase/wine/dlls/ddraw/d3ddevice/main.h	Thu Dec 26 12:48:38 2002
+++ dlls/ddraw/d3ddevice/main.h	Sun Dec 29 08:42:03 2002
@@ -345,9 +345,9 @@
                                             DWORD dwLightState);
 
 HRESULT WINAPI
-Main_IDirect3DDeviceImpl_2_SwapTextureHandles(LPDIRECT3DDEVICE2 iface,
-                                              LPDIRECT3DTEXTURE2 lpD3DTex1,
-                                              LPDIRECT3DTEXTURE2 lpD3DTex2);
+Main_IDirect3DDeviceImpl_2_1T_SwapTextureHandles(LPDIRECT3DDEVICE2 iface,
+                                                 LPDIRECT3DTEXTURE2 lpD3DTex1,
+                                                 LPDIRECT3DTEXTURE2 lpD3DTex2);
 
 HRESULT WINAPI
 Main_IDirect3DDeviceImpl_2_1T_EnumTextureFormats(LPDIRECT3DDEVICE2 iface,
@@ -393,11 +393,6 @@
                                       LPD3DDEVICEDESC lpD3DDVDesc);
 
 HRESULT WINAPI
-Main_IDirect3DDeviceImpl_1_SwapTextureHandles(LPDIRECT3DDEVICE iface,
-                                              LPDIRECT3DTEXTURE lpD3Dtex1,
-                                              LPDIRECT3DTEXTURE lpD3DTex2);
-
-HRESULT WINAPI
 Main_IDirect3DDeviceImpl_1_CreateExecuteBuffer(LPDIRECT3DDEVICE iface,
                                                LPD3DEXECUTEBUFFERDESC lpDesc,
                                                LPDIRECT3DEXECUTEBUFFER* lplpDirect3DExecuteBuffer,
@@ -678,6 +673,11 @@
 Thunk_IDirect3DDeviceImpl_1_GetCaps(LPDIRECT3DDEVICE iface,
                                     LPD3DDEVICEDESC lpD3DHWDevDesc,
                                     LPD3DDEVICEDESC lpD3DHELDevDesc);
+
+HRESULT WINAPI
+Thunk_IDirect3DDeviceImpl_1_SwapTextureHandles(LPDIRECT3DDEVICE iface,
+                                               LPDIRECT3DTEXTURE lpD3Dtex1,
+                                               LPDIRECT3DTEXTURE lpD3DTex2);
 
 HRESULT WINAPI
 Thunk_IDirect3DDeviceImpl_2_GetStats(LPDIRECT3DDEVICE2 iface,
diff -u -r ../../winebase/wine/dlls/ddraw/d3ddevice/mesa.c dlls/ddraw/d3ddevice/mesa.c
--- ../../winebase/wine/dlls/ddraw/d3ddevice/mesa.c	Sun Dec 29 07:50:58 2002
+++ dlls/ddraw/d3ddevice/mesa.c	Sun Dec 29 08:48:19 2002
@@ -1697,7 +1697,7 @@
     XCAST(AddRef) Thunk_IDirect3DDeviceImpl_2_AddRef,
     XCAST(Release) Thunk_IDirect3DDeviceImpl_2_Release,
     XCAST(GetCaps) Thunk_IDirect3DDeviceImpl_2_GetCaps,
-    XCAST(SwapTextureHandles) Main_IDirect3DDeviceImpl_2_SwapTextureHandles,
+    XCAST(SwapTextureHandles) Main_IDirect3DDeviceImpl_2_1T_SwapTextureHandles,
     XCAST(GetStats) Thunk_IDirect3DDeviceImpl_2_GetStats,
     XCAST(AddViewport) Thunk_IDirect3DDeviceImpl_2_AddViewport,
     XCAST(DeleteViewport) Thunk_IDirect3DDeviceImpl_2_DeleteViewport,
@@ -1747,7 +1747,7 @@
     XCAST(Release) Thunk_IDirect3DDeviceImpl_1_Release,
     XCAST(Initialize) Main_IDirect3DDeviceImpl_1_Initialize,
     XCAST(GetCaps) Thunk_IDirect3DDeviceImpl_1_GetCaps,
-    XCAST(SwapTextureHandles) Main_IDirect3DDeviceImpl_1_SwapTextureHandles,
+    XCAST(SwapTextureHandles) Thunk_IDirect3DDeviceImpl_1_SwapTextureHandles,
     XCAST(CreateExecuteBuffer) GL_IDirect3DDeviceImpl_1_CreateExecuteBuffer,
     XCAST(GetStats) Thunk_IDirect3DDeviceImpl_1_GetStats,
     XCAST(Execute) Main_IDirect3DDeviceImpl_1_Execute,


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

  Powered by Linux