fix DeleteAttachedSurface and add some NULL checks
This commit is contained in:
parent
442b6c3f57
commit
63c4e6ff57
1 changed files with 15 additions and 7 deletions
|
@ -14,6 +14,8 @@
|
|||
|
||||
HRESULT dds_AddAttachedSurface(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWSURFACE lpDDSurface)
|
||||
{
|
||||
if (lpDDSurface)
|
||||
{
|
||||
IDirectDrawSurface_AddRef(lpDDSurface);
|
||||
|
||||
if (g_ddraw->backbuffer && !This->backbuffer)
|
||||
|
@ -23,6 +25,7 @@ HRESULT dds_AddAttachedSurface(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWSURFACE
|
|||
|
||||
This->backbuffer = surface;
|
||||
}
|
||||
}
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
@ -611,7 +614,12 @@ HRESULT dds_BltFast(IDirectDrawSurfaceImpl *This, DWORD dst_x, DWORD dst_y, LPDI
|
|||
|
||||
HRESULT dds_DeleteAttachedSurface(IDirectDrawSurfaceImpl *This, DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSurface)
|
||||
{
|
||||
if (lpDDSurface)
|
||||
{
|
||||
IDirectDrawSurface_Release(lpDDSurface);
|
||||
This->backbuffer = NULL;
|
||||
}
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue