mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-15 06:04:49 +01:00
add workaround for westwood nox
This commit is contained in:
parent
b1ac125817
commit
b62b435c37
1
inc/dd.h
1
inc/dd.h
@ -175,6 +175,7 @@ typedef struct CNCDDRAW
|
||||
RECT bnet_win_rect;
|
||||
POINT bnet_pos;
|
||||
void* last_freed_palette; /* Dungeon Keeper hack */
|
||||
void* last_freed_surface; /* Nox hack */
|
||||
BOOL child_window_exists;
|
||||
BOOL got_child_windows;
|
||||
DWORD last_set_window_pos_tick; /* WINE hack */
|
||||
|
@ -111,8 +111,10 @@ ULONG __stdcall IDirectDrawSurface__Release(IDirectDrawSurfaceImpl* This)
|
||||
if (This->mapping)
|
||||
CloseHandle(This->mapping);
|
||||
|
||||
if (This->backbuffer)
|
||||
if (This->backbuffer && (!g_ddraw || (void*)This->backbuffer != g_ddraw->last_freed_surface))
|
||||
{
|
||||
IDirectDrawSurface_Release(This->backbuffer);
|
||||
}
|
||||
|
||||
if (This->clipper)
|
||||
IDirectDrawClipper_Release(This->clipper);
|
||||
@ -124,6 +126,9 @@ ULONG __stdcall IDirectDrawSurface__Release(IDirectDrawSurfaceImpl* This)
|
||||
|
||||
DeleteCriticalSection(&This->cs);
|
||||
|
||||
if (g_ddraw)
|
||||
g_ddraw->last_freed_surface = This;
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user