mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-25 10:07:47 +01:00
some experimental code for Capitalism2/CapLab
This commit is contained in:
parent
d7ad443d92
commit
442b6c3f57
@ -15,6 +15,15 @@
|
||||
HRESULT dds_AddAttachedSurface(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWSURFACE lpDDSurface)
|
||||
{
|
||||
IDirectDrawSurface_AddRef(lpDDSurface);
|
||||
|
||||
if (g_ddraw->backbuffer && !This->backbuffer)
|
||||
{
|
||||
IDirectDrawSurfaceImpl* surface = (IDirectDrawSurfaceImpl*)lpDDSurface;
|
||||
surface->caps |= DDSCAPS_BACKBUFFER;
|
||||
|
||||
This->backbuffer = surface;
|
||||
}
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
@ -671,8 +680,6 @@ HRESULT dds_EnumAttachedSurfaces(IDirectDrawSurfaceImpl *This, LPVOID lpContext,
|
||||
}
|
||||
|
||||
HRESULT dds_Flip(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWSURFACE surface, DWORD flags)
|
||||
{
|
||||
if(This->caps & DDSCAPS_PRIMARYSURFACE && g_ddraw->render.run)
|
||||
{
|
||||
if (This->backbuffer)
|
||||
{
|
||||
@ -687,6 +694,8 @@ HRESULT dds_Flip(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWSURFACE surface, DWOR
|
||||
LeaveCriticalSection(&g_ddraw->cs);
|
||||
}
|
||||
|
||||
if (This->caps & DDSCAPS_PRIMARYSURFACE && g_ddraw->render.run)
|
||||
{
|
||||
This->last_flip_tick = timeGetTime();
|
||||
|
||||
InterlockedExchange(&g_ddraw->render.surface_updated, TRUE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user