d3d8: Don't reapply the old DS if SetDepthStencilSurface failed.

This commit is contained in:
Stefan Dösinger 2011-04-25 16:51:27 +02:00 committed by Alexandre Julliard
parent 0036e438db
commit 463162b414
1 changed files with 3 additions and 1 deletions

View File

@ -1047,8 +1047,10 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetRenderTarget(IDirect3DDevice8 *ifa
{
hr = IWineD3DDevice_SetDepthStencilSurface(This->WineD3DDevice, pZSurface ? pZSurface->wineD3DSurface : NULL);
if (SUCCEEDED(hr) && pSurface)
{
hr = IWineD3DDevice_SetRenderTarget(This->WineD3DDevice, 0, pSurface->wineD3DSurface, TRUE);
if (FAILED(hr)) IWineD3DDevice_SetDepthStencilSurface(This->WineD3DDevice, original_ds);
if (FAILED(hr)) IWineD3DDevice_SetDepthStencilSurface(This->WineD3DDevice, original_ds);
}
}
if (original_ds) IWineD3DSurface_Release(original_ds);