Module: wine Branch: master Commit: c0d770de9eb88a7ff91e416dce1bd6d9db252f54 URL: http://source.winehq.org/git/wine.git/?a=commit;h=c0d770de9eb88a7ff91e416dce...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Wed Sep 10 11:08:51 2008 +0200
d3d9: GetDepthStencilSurface returns D3DERR_NOTFOUND when no depth stencil is present.
---
dlls/d3d9/device.c | 13 +++++-------- 1 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index ddeaca3..b12e562 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -737,15 +737,12 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetDepthStencilSurface(LPDIRECT3DDE
EnterCriticalSection(&d3d9_cs); hr = IWineD3DDevice_GetDepthStencilSurface(This->WineD3DDevice,&pZStencilSurface); - if(hr == D3D_OK) { - if(pZStencilSurface != NULL){ - IWineD3DSurface_GetParent(pZStencilSurface,(IUnknown**)ppZStencilSurface); - IWineD3DSurface_Release(pZStencilSurface); - } else { - *ppZStencilSurface = NULL; - } + if (hr == WINED3D_OK) { + IWineD3DSurface_GetParent(pZStencilSurface,(IUnknown**)ppZStencilSurface); + IWineD3DSurface_Release(pZStencilSurface); } else { - WARN("Call to IWineD3DDevice_GetDepthStencilSurface failed\n"); + if (hr != WINED3DERR_NOTFOUND) + WARN("Call to IWineD3DDevice_GetDepthStencilSurface failed with 0x%08x\n", hr); *ppZStencilSurface = NULL; } LeaveCriticalSection(&d3d9_cs);