Module: wine Branch: master Commit: 789fed5095f067350a451fa9b1783b0fd13ba9ab URL: http://source.winehq.org/git/wine.git/?a=commit;h=789fed5095f067350a451fa9b1...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Wed Dec 9 11:51:16 2009 +0100
d3d8: Forward the volume's GetDevice() to the texture instead of the wined3d volume.
---
dlls/d3d8/volume.c | 23 ++++++++++++++--------- 1 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/dlls/d3d8/volume.c b/dlls/d3d8/volume.c index 8948997..8e8dc60 100644 --- a/dlls/d3d8/volume.c +++ b/dlls/d3d8/volume.c @@ -94,19 +94,24 @@ static ULONG WINAPI IDirect3DVolume8Impl_Release(LPDIRECT3DVOLUME8 iface) { }
/* IDirect3DVolume8 Interface follow: */ -static HRESULT WINAPI IDirect3DVolume8Impl_GetDevice(LPDIRECT3DVOLUME8 iface, IDirect3DDevice8 **ppDevice) { +static HRESULT WINAPI IDirect3DVolume8Impl_GetDevice(IDirect3DVolume8 *iface, IDirect3DDevice8 **device) +{ IDirect3DVolume8Impl *This = (IDirect3DVolume8Impl *)iface; - IWineD3DDevice *myDevice = NULL; + IDirect3DResource8 *resource; + HRESULT hr;
- TRACE("iface %p, device %p.\n", iface, ppDevice); + TRACE("iface %p, device %p.\n", iface, device);
- wined3d_mutex_lock(); - IWineD3DVolume_GetDevice(This->wineD3DVolume, &myDevice); - IWineD3DDevice_GetParent(myDevice, (IUnknown **)ppDevice); - IWineD3DDevice_Release(myDevice); - wined3d_mutex_unlock(); + hr = IUnknown_QueryInterface(This->forwardReference, &IID_IDirect3DResource8, (void **)&resource); + if (SUCCEEDED(hr)) + { + hr = IDirect3DResource8_GetDevice(resource, device); + IDirect3DResource8_Release(resource);
- return D3D_OK; + TRACE("Returning device %p.\n", *device); + } + + return hr; }
static HRESULT WINAPI IDirect3DVolume8Impl_SetPrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid, CONST void *pData, DWORD SizeOfData, DWORD Flags) {