add "sleep" setting for CnC1
This commit is contained in:
parent
77ac049c41
commit
79fe86062f
4 changed files with 16 additions and 3 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue