mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-15 06:04:49 +01:00
some Twisted Metal experiments
This commit is contained in:
parent
4283065d93
commit
2c629cbe55
@ -51,6 +51,7 @@ typedef struct IDirectDrawSurfaceImpl
|
||||
HDC hDC;
|
||||
DDCOLORKEY colorKey;
|
||||
DWORD lastFlipTick;
|
||||
DWORD lastBltTick;
|
||||
|
||||
} IDirectDrawSurfaceImpl;
|
||||
|
||||
|
@ -462,8 +462,6 @@ static void CreateSettingsIni()
|
||||
"[TWISTED]\n"
|
||||
"renderer=gdi\n"
|
||||
"maxgameticks=25\n"
|
||||
"maxfps=60\n"
|
||||
"forcefps=true\n"
|
||||
"\n"
|
||||
"; Twisted Metal 2\n"
|
||||
"[Tm2]\n"
|
||||
|
@ -466,6 +466,8 @@ HRESULT __stdcall ddraw_surface_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestR
|
||||
|
||||
if (!(This->flags & DDSD_BACKBUFFERCOUNT) || This->lastFlipTick + FLIP_REDRAW_TIMEOUT < timeGetTime())
|
||||
{
|
||||
This->lastBltTick = timeGetTime();
|
||||
|
||||
ReleaseSemaphore(ddraw->render.sem, 1, NULL);
|
||||
SwitchToThread();
|
||||
|
||||
@ -604,7 +606,10 @@ HRESULT __stdcall ddraw_surface_BltFast(IDirectDrawSurfaceImpl *This, DWORD dst_
|
||||
{
|
||||
InterlockedExchange(&ddraw->render.surfaceUpdated, TRUE);
|
||||
|
||||
if (!(This->flags & DDSD_BACKBUFFERCOUNT) || This->lastFlipTick + FLIP_REDRAW_TIMEOUT < timeGetTime())
|
||||
DWORD time = timeGetTime();
|
||||
|
||||
if (!(This->flags & DDSD_BACKBUFFERCOUNT) ||
|
||||
(This->lastFlipTick + FLIP_REDRAW_TIMEOUT < time && This->lastBltTick + FLIP_REDRAW_TIMEOUT < time))
|
||||
{
|
||||
ReleaseSemaphore(ddraw->render.sem, 1, NULL);
|
||||
}
|
||||
@ -1025,7 +1030,10 @@ HRESULT __stdcall ddraw_surface_Unlock(IDirectDrawSurfaceImpl *This, LPVOID lpRe
|
||||
{
|
||||
InterlockedExchange(&ddraw->render.surfaceUpdated, TRUE);
|
||||
|
||||
if (!(This->flags & DDSD_BACKBUFFERCOUNT) || This->lastFlipTick + FLIP_REDRAW_TIMEOUT < timeGetTime())
|
||||
DWORD time = timeGetTime();
|
||||
|
||||
if (!(This->flags & DDSD_BACKBUFFERCOUNT) ||
|
||||
(This->lastFlipTick + FLIP_REDRAW_TIMEOUT < time && This->lastBltTick + FLIP_REDRAW_TIMEOUT < time))
|
||||
{
|
||||
ReleaseSemaphore(ddraw->render.sem, 1, NULL);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user