d3d9: Having a NULL rendertarget isn't a failure.
This commit is contained in:
parent
5654544725
commit
59268f7924
|
@ -851,8 +851,8 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetRenderTarget(LPDIRECT3DDEVICE9EX
|
||||||
|
|
||||||
static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTarget(LPDIRECT3DDEVICE9EX iface, DWORD RenderTargetIndex, IDirect3DSurface9 **ppRenderTarget) {
|
static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTarget(LPDIRECT3DDEVICE9EX iface, DWORD RenderTargetIndex, IDirect3DSurface9 **ppRenderTarget) {
|
||||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||||
HRESULT hr = D3D_OK;
|
|
||||||
IWineD3DSurface *pRenderTarget;
|
IWineD3DSurface *pRenderTarget;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
TRACE("(%p) Relay\n" , This);
|
TRACE("(%p) Relay\n" , This);
|
||||||
|
|
||||||
|
@ -863,13 +863,20 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTarget(LPDIRECT3DDEVICE9EX
|
||||||
EnterCriticalSection(&d3d9_cs);
|
EnterCriticalSection(&d3d9_cs);
|
||||||
hr=IWineD3DDevice_GetRenderTarget(This->WineD3DDevice,RenderTargetIndex,&pRenderTarget);
|
hr=IWineD3DDevice_GetRenderTarget(This->WineD3DDevice,RenderTargetIndex,&pRenderTarget);
|
||||||
|
|
||||||
if (hr == D3D_OK && pRenderTarget != NULL) {
|
if (FAILED(hr))
|
||||||
IWineD3DSurface_GetParent(pRenderTarget,(IUnknown**)ppRenderTarget);
|
{
|
||||||
IWineD3DSurface_Release(pRenderTarget);
|
FIXME("Call to IWineD3DDevice_GetRenderTarget failed, hr %#x\n", hr);
|
||||||
} else {
|
}
|
||||||
FIXME("Call to IWineD3DDevice_GetRenderTarget failed\n");
|
else if (!pRenderTarget)
|
||||||
|
{
|
||||||
*ppRenderTarget = NULL;
|
*ppRenderTarget = NULL;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IWineD3DSurface_GetParent(pRenderTarget, (IUnknown **)ppRenderTarget);
|
||||||
|
IWineD3DSurface_Release(pRenderTarget);
|
||||||
|
}
|
||||||
|
|
||||||
LeaveCriticalSection(&d3d9_cs);
|
LeaveCriticalSection(&d3d9_cs);
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
|
Loading…
Reference in New Issue