mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-26 10:29:23 +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)
|
HRESULT dds_AddAttachedSurface(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWSURFACE lpDDSurface)
|
||||||
{
|
{
|
||||||
IDirectDrawSurface_AddRef(lpDDSurface);
|
IDirectDrawSurface_AddRef(lpDDSurface);
|
||||||
|
|
||||||
|
if (g_ddraw->backbuffer && !This->backbuffer)
|
||||||
|
{
|
||||||
|
IDirectDrawSurfaceImpl* surface = (IDirectDrawSurfaceImpl*)lpDDSurface;
|
||||||
|
surface->caps |= DDSCAPS_BACKBUFFER;
|
||||||
|
|
||||||
|
This->backbuffer = surface;
|
||||||
|
}
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -672,8 +681,6 @@ HRESULT dds_EnumAttachedSurfaces(IDirectDrawSurfaceImpl *This, LPVOID lpContext,
|
|||||||
|
|
||||||
HRESULT dds_Flip(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWSURFACE surface, DWORD flags)
|
HRESULT dds_Flip(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWSURFACE surface, DWORD flags)
|
||||||
{
|
{
|
||||||
if(This->caps & DDSCAPS_PRIMARYSURFACE && g_ddraw->render.run)
|
|
||||||
{
|
|
||||||
if (This->backbuffer)
|
if (This->backbuffer)
|
||||||
{
|
{
|
||||||
EnterCriticalSection(&g_ddraw->cs);
|
EnterCriticalSection(&g_ddraw->cs);
|
||||||
@ -687,6 +694,8 @@ HRESULT dds_Flip(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWSURFACE surface, DWOR
|
|||||||
LeaveCriticalSection(&g_ddraw->cs);
|
LeaveCriticalSection(&g_ddraw->cs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (This->caps & DDSCAPS_PRIMARYSURFACE && g_ddraw->render.run)
|
||||||
|
{
|
||||||
This->last_flip_tick = timeGetTime();
|
This->last_flip_tick = timeGetTime();
|
||||||
|
|
||||||
InterlockedExchange(&g_ddraw->render.surface_updated, TRUE);
|
InterlockedExchange(&g_ddraw->render.surface_updated, TRUE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user