add "sleep" setting for CnC1

This commit is contained in:
FunkyFr3sh 2018-09-11 14:20:40 +02:00
parent 77ac049c41
commit 79fe86062f
4 changed files with 16 additions and 3 deletions

View file

@ -1118,6 +1118,7 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk
GetPrivateProfileStringA("ddraw", "screenshotKey", "G", tmp, sizeof(tmp), SettingsIniPath);
ddraw->screenshotKey = toupper(tmp[0]);
This->sleep = GetPrivateProfileIntA("ddraw", "sleep", 0, SettingsIniPath);
This->render.maxfps = GetPrivateProfileIntA("ddraw", "maxfps", 0, SettingsIniPath);
This->render.width = GetPrivateProfileIntA("ddraw", "width", 0, SettingsIniPath);
This->render.height = GetPrivateProfileIntA("ddraw", "height", 0, SettingsIniPath);

View file

@ -178,7 +178,12 @@ HRESULT __stdcall ddraw_surface_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestR
ResetEvent(ddraw->render.ev);
}
else
SwitchToThread();
{
if (ddraw->sleep > 0)
Sleep(ddraw->sleep);
else
SwitchToThread();
}
}
return DD_OK;
@ -265,7 +270,13 @@ HRESULT __stdcall ddraw_surface_Flip(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWS
WaitForSingleObject(ddraw->render.ev, INFINITE);
}
else
SwitchToThread();
{
if (ddraw->sleep > 0)
Sleep(ddraw->sleep);
else
SwitchToThread();
}
}
return DD_OK;