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

This commit is contained in:
Lionel Ulmer 2002-12-24 00:53:50 +00:00 committed by Alexandre Julliard
parent 49e119f95f
commit 90bf1f2ea8
3 changed files with 30 additions and 29 deletions

View File

@ -453,9 +453,9 @@ Main_IDirect3DDeviceImpl_7_GetTexture(LPDIRECT3DDEVICE7 iface,
} }
HRESULT WINAPI HRESULT WINAPI
Main_IDirect3DDeviceImpl_7_SetTexture(LPDIRECT3DDEVICE7 iface, Main_IDirect3DDeviceImpl_7_3T_SetTexture(LPDIRECT3DDEVICE7 iface,
DWORD dwStage, DWORD dwStage,
LPDIRECTDRAWSURFACE7 lpTexture) LPDIRECTDRAWSURFACE7 lpTexture)
{ {
ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface); ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
FIXME("(%p/%p)->(%08lx,%p): stub!\n", This, iface, dwStage, lpTexture); FIXME("(%p/%p)->(%08lx,%p): stub!\n", This, iface, dwStage, lpTexture);
@ -826,16 +826,6 @@ Main_IDirect3DDeviceImpl_3_GetTexture(LPDIRECT3DDEVICE3 iface,
return DD_OK; return DD_OK;
} }
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 HRESULT WINAPI
Main_IDirect3DDeviceImpl_2_SwapTextureHandles(LPDIRECT3DDEVICE2 iface, Main_IDirect3DDeviceImpl_2_SwapTextureHandles(LPDIRECT3DDEVICE2 iface,
LPDIRECT3DTEXTURE2 lpD3DTex1, LPDIRECT3DTEXTURE2 lpD3DTex1,
@ -1728,3 +1718,14 @@ Thunk_IDirect3DDeviceImpl_1_EnumTextureFormats(LPDIRECT3DDEVICE iface,
lpD3DEnumTextureProc, lpD3DEnumTextureProc,
lpArg); 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));
}

View File

@ -206,9 +206,9 @@ Main_IDirect3DDeviceImpl_7_GetTexture(LPDIRECT3DDEVICE7 iface,
LPDIRECTDRAWSURFACE7* lpTexture); LPDIRECTDRAWSURFACE7* lpTexture);
HRESULT WINAPI HRESULT WINAPI
Main_IDirect3DDeviceImpl_7_SetTexture(LPDIRECT3DDEVICE7 iface, Main_IDirect3DDeviceImpl_7_3T_SetTexture(LPDIRECT3DDEVICE7 iface,
DWORD dwStage, DWORD dwStage,
LPDIRECTDRAWSURFACE7 lpTexture); LPDIRECTDRAWSURFACE7 lpTexture);
HRESULT WINAPI HRESULT WINAPI
Main_IDirect3DDeviceImpl_7_3T_GetTextureStageState(LPDIRECT3DDEVICE7 iface, Main_IDirect3DDeviceImpl_7_3T_GetTextureStageState(LPDIRECT3DDEVICE7 iface,
@ -365,11 +365,6 @@ Main_IDirect3DDeviceImpl_3_GetTexture(LPDIRECT3DDEVICE3 iface,
DWORD dwStage, DWORD dwStage,
LPDIRECT3DTEXTURE2* lplpTexture2); LPDIRECT3DTEXTURE2* lplpTexture2);
HRESULT WINAPI
Main_IDirect3DDeviceImpl_3_SetTexture(LPDIRECT3DDEVICE3 iface,
DWORD dwStage,
LPDIRECT3DTEXTURE2 lpTexture2);
HRESULT WINAPI HRESULT WINAPI
Main_IDirect3DDeviceImpl_2_SwapTextureHandles(LPDIRECT3DDEVICE2 iface, Main_IDirect3DDeviceImpl_2_SwapTextureHandles(LPDIRECT3DDEVICE2 iface,
LPDIRECT3DTEXTURE2 lpD3DTex1, LPDIRECT3DTEXTURE2 lpD3DTex1,
@ -757,3 +752,8 @@ HRESULT WINAPI
Thunk_IDirect3DDeviceImpl_1_EnumTextureFormats(LPDIRECT3DDEVICE iface, Thunk_IDirect3DDeviceImpl_1_EnumTextureFormats(LPDIRECT3DDEVICE iface,
LPD3DENUMTEXTUREFORMATSCALLBACK lpD3DEnumTextureProc, LPD3DENUMTEXTUREFORMATSCALLBACK lpD3DEnumTextureProc,
LPVOID lpArg); LPVOID lpArg);
HRESULT WINAPI
Thunk_IDirect3DDeviceImpl_3_SetTexture(LPDIRECT3DDEVICE3 iface,
DWORD dwStage,
LPDIRECT3DTEXTURE2 lpTexture2);

View File

@ -1282,11 +1282,11 @@ GL_IDirect3DDeviceImpl_7_3T_SetTextureStageState(LPDIRECT3DDEVICE7 iface,
} }
HRESULT WINAPI HRESULT WINAPI
GL_IDirect3DDeviceImpl_3_SetTexture(LPDIRECT3DDEVICE3 iface, GL_IDirect3DDeviceImpl_7_3T_SetTexture(LPDIRECT3DDEVICE7 iface,
DWORD dwStage, DWORD dwStage,
LPDIRECT3DTEXTURE2 lpTexture2) LPDIRECTDRAWSURFACE7 lpTexture2)
{ {
ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface); ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
TRACE("(%p/%p)->(%08lx,%p)\n", This, iface, dwStage, lpTexture2); 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); glBindTexture(GL_TEXTURE_2D, 0);
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);
} else { } 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; IDirect3DTextureGLImpl *tex_glimpl = (IDirect3DTextureGLImpl *) tex_impl->tex_private;
This->current_texture[dwStage] = tex_impl; 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); 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(DrawIndexedPrimitiveVB) Main_IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB,
XCAST(ComputeSphereVisibility) Main_IDirect3DDeviceImpl_7_3T_ComputeSphereVisibility, XCAST(ComputeSphereVisibility) Main_IDirect3DDeviceImpl_7_3T_ComputeSphereVisibility,
XCAST(GetTexture) Main_IDirect3DDeviceImpl_7_GetTexture, 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(GetTextureStageState) Main_IDirect3DDeviceImpl_7_3T_GetTextureStageState,
XCAST(SetTextureStageState) GL_IDirect3DDeviceImpl_7_3T_SetTextureStageState, XCAST(SetTextureStageState) GL_IDirect3DDeviceImpl_7_3T_SetTextureStageState,
XCAST(ValidateDevice) Main_IDirect3DDeviceImpl_7_3T_ValidateDevice, XCAST(ValidateDevice) Main_IDirect3DDeviceImpl_7_3T_ValidateDevice,
@ -1443,7 +1443,7 @@ ICOM_VTABLE(IDirect3DDevice3) VTABLE_IDirect3DDevice3 =
XCAST(DrawIndexedPrimitiveVB) Main_IDirect3DDeviceImpl_3_DrawIndexedPrimitiveVB, XCAST(DrawIndexedPrimitiveVB) Main_IDirect3DDeviceImpl_3_DrawIndexedPrimitiveVB,
XCAST(ComputeSphereVisibility) Thunk_IDirect3DDeviceImpl_3_ComputeSphereVisibility, XCAST(ComputeSphereVisibility) Thunk_IDirect3DDeviceImpl_3_ComputeSphereVisibility,
XCAST(GetTexture) Main_IDirect3DDeviceImpl_3_GetTexture, 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(GetTextureStageState) Thunk_IDirect3DDeviceImpl_3_GetTextureStageState,
XCAST(SetTextureStageState) Thunk_IDirect3DDeviceImpl_3_SetTextureStageState, XCAST(SetTextureStageState) Thunk_IDirect3DDeviceImpl_3_SetTextureStageState,
XCAST(ValidateDevice) Thunk_IDirect3DDeviceImpl_3_ValidateDevice, XCAST(ValidateDevice) Thunk_IDirect3DDeviceImpl_3_ValidateDevice,