1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-25 10:07:47 +01:00

fix DeleteAttachedSurface and add some NULL checks

This commit is contained in:
FunkyFr3sh 2021-05-06 01:24:07 +02:00
parent 442b6c3f57
commit 63c4e6ff57

View File

@ -13,6 +13,8 @@
HRESULT dds_AddAttachedSurface(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWSURFACE lpDDSurface)
{
if (lpDDSurface)
{
IDirectDrawSurface_AddRef(lpDDSurface);
@ -23,6 +25,7 @@ HRESULT dds_AddAttachedSurface(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWSURFACE
This->backbuffer = surface;
}
}
return DD_OK;
}
@ -610,8 +613,13 @@ 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;
}