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