Commit 90bf1f2e authored by Lionel Ulmer's avatar Lionel Ulmer Committed by Alexandre Julliard

Combine texturing for D3D3 and 7 by thunking 3 to 7.

parent 49e119f9
......@@ -453,9 +453,9 @@ Main_IDirect3DDeviceImpl_7_GetTexture(LPDIRECT3DDEVICE7 iface,
}
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 @@ Main_IDirect3DDeviceImpl_3_GetTexture(LPDIRECT3DDEVICE3 iface,
}
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 @@ Thunk_IDirect3DDeviceImpl_1_EnumTextureFormats(LPDIRECT3DDEVICE iface,
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));
}
......@@ -206,9 +206,9 @@ Main_IDirect3DDeviceImpl_7_GetTexture(LPDIRECT3DDEVICE7 iface,
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 @@ Main_IDirect3DDeviceImpl_3_GetTexture(LPDIRECT3DDEVICE3 iface,
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 @@ HRESULT WINAPI
Thunk_IDirect3DDeviceImpl_1_EnumTextureFormats(LPDIRECT3DDEVICE iface,
LPD3DENUMTEXTUREFORMATSCALLBACK lpD3DEnumTextureProc,
LPVOID lpArg);
HRESULT WINAPI
Thunk_IDirect3DDeviceImpl_3_SetTexture(LPDIRECT3DDEVICE3 iface,
DWORD dwStage,
LPDIRECT3DTEXTURE2 lpTexture2);
......@@ -1282,11 +1282,11 @@ GL_IDirect3DDeviceImpl_7_3T_SetTextureStageState(LPDIRECT3DDEVICE7 iface,
}
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);
......@@ -1301,11 +1301,11 @@ GL_IDirect3DDeviceImpl_3_SetTexture(LPDIRECT3DDEVICE3 iface,
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);
......@@ -1375,7 +1375,7 @@ ICOM_VTABLE(IDirect3DDevice7) VTABLE_IDirect3DDevice7 =
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,
......@@ -1443,7 +1443,7 @@ ICOM_VTABLE(IDirect3DDevice3) VTABLE_IDirect3DDevice3 =
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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment