Commit 59268f79 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d9: Having a NULL rendertarget isn't a failure.

parent 56545447
......@@ -851,8 +851,8 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetRenderTarget(LPDIRECT3DDEVICE9EX
static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTarget(LPDIRECT3DDEVICE9EX iface, DWORD RenderTargetIndex, IDirect3DSurface9 **ppRenderTarget) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
HRESULT hr = D3D_OK;
IWineD3DSurface *pRenderTarget;
HRESULT hr;
TRACE("(%p) Relay\n" , This);
......@@ -863,13 +863,20 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTarget(LPDIRECT3DDEVICE9EX
EnterCriticalSection(&d3d9_cs);
hr=IWineD3DDevice_GetRenderTarget(This->WineD3DDevice,RenderTargetIndex,&pRenderTarget);
if (hr == D3D_OK && pRenderTarget != NULL) {
IWineD3DSurface_GetParent(pRenderTarget,(IUnknown**)ppRenderTarget);
IWineD3DSurface_Release(pRenderTarget);
} else {
FIXME("Call to IWineD3DDevice_GetRenderTarget failed\n");
if (FAILED(hr))
{
FIXME("Call to IWineD3DDevice_GetRenderTarget failed, hr %#x\n", hr);
}
else if (!pRenderTarget)
{
*ppRenderTarget = NULL;
}
else
{
IWineD3DSurface_GetParent(pRenderTarget, (IUnknown **)ppRenderTarget);
IWineD3DSurface_Release(pRenderTarget);
}
LeaveCriticalSection(&d3d9_cs);
return hr;
......
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