1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

add hack for westwood nox

This commit is contained in:
FunkyFr3sh 2018-11-19 09:56:27 +01:00
parent 5d2d258d52
commit 650496065b

View File

@ -626,9 +626,15 @@ HRESULT __stdcall ddraw_surface_EnumAttachedSurfaces(IDirectDrawSurfaceImpl *Thi
static LPDDSURFACEDESC lpDDSurfaceDesc;
lpDDSurfaceDesc = (LPDDSURFACEDESC)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DDSURFACEDESC));
ddraw_surface_GetSurfaceDesc(This, lpDDSurfaceDesc);
This->caps |= DDSCAPS_BACKBUFFER; // Nox hack
lpEnumSurfacesCallback((LPDIRECTDRAWSURFACE)This, lpDDSurfaceDesc, lpContext);
HeapFree(GetProcessHeap(), 0, lpDDSurfaceDesc);
if ((This->caps & DDSCAPS_PRIMARYSURFACE) && (This->caps & DDSCAPS_FLIP) && !(This->caps & DDSCAPS_BACKBUFFER))
ddraw_surface_AddRef(This);
This->caps &= ~DDSCAPS_BACKBUFFER;
return DD_OK;
}
@ -675,7 +681,7 @@ HRESULT __stdcall ddraw_surface_GetAttachedSurface(IDirectDrawSurfaceImpl *This,
if ((This->caps & DDSCAPS_PRIMARYSURFACE) && (This->caps & DDSCAPS_FLIP) && (lpDdsCaps->dwCaps & DDSCAPS_BACKBUFFER))
{
This->Ref++;
ddraw_surface_AddRef(This);
*surface = (LPDIRECTDRAWSURFACE)This;
}