mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
add "sleep" setting for CnC1
This commit is contained in:
parent
77ac049c41
commit
79fe86062f
2
ddraw.rc
2
ddraw.rc
@ -2,7 +2,7 @@
|
|||||||
#define vxstr(a,b,c,d) str(a##.##b##.##c##.##d)
|
#define vxstr(a,b,c,d) str(a##.##b##.##c##.##d)
|
||||||
#define str(s) #s
|
#define str(s) #s
|
||||||
|
|
||||||
#define VERSION 1,1,9,1
|
#define VERSION 1,1,9,2
|
||||||
|
|
||||||
1 VERSIONINFO
|
1 VERSIONINFO
|
||||||
FILEVERSION VERSION
|
FILEVERSION VERSION
|
||||||
|
@ -98,6 +98,7 @@ typedef struct IDirectDrawImpl
|
|||||||
char shader[MAX_PATH];
|
char shader[MAX_PATH];
|
||||||
BOOL autorenderer;
|
BOOL autorenderer;
|
||||||
BOOL wine;
|
BOOL wine;
|
||||||
|
int sleep;
|
||||||
|
|
||||||
} IDirectDrawImpl;
|
} IDirectDrawImpl;
|
||||||
|
|
||||||
|
@ -1118,6 +1118,7 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk
|
|||||||
GetPrivateProfileStringA("ddraw", "screenshotKey", "G", tmp, sizeof(tmp), SettingsIniPath);
|
GetPrivateProfileStringA("ddraw", "screenshotKey", "G", tmp, sizeof(tmp), SettingsIniPath);
|
||||||
ddraw->screenshotKey = toupper(tmp[0]);
|
ddraw->screenshotKey = toupper(tmp[0]);
|
||||||
|
|
||||||
|
This->sleep = GetPrivateProfileIntA("ddraw", "sleep", 0, SettingsIniPath);
|
||||||
This->render.maxfps = GetPrivateProfileIntA("ddraw", "maxfps", 0, SettingsIniPath);
|
This->render.maxfps = GetPrivateProfileIntA("ddraw", "maxfps", 0, SettingsIniPath);
|
||||||
This->render.width = GetPrivateProfileIntA("ddraw", "width", 0, SettingsIniPath);
|
This->render.width = GetPrivateProfileIntA("ddraw", "width", 0, SettingsIniPath);
|
||||||
This->render.height = GetPrivateProfileIntA("ddraw", "height", 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);
|
ResetEvent(ddraw->render.ev);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
SwitchToThread();
|
{
|
||||||
|
if (ddraw->sleep > 0)
|
||||||
|
Sleep(ddraw->sleep);
|
||||||
|
else
|
||||||
|
SwitchToThread();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
@ -265,7 +270,13 @@ HRESULT __stdcall ddraw_surface_Flip(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWS
|
|||||||
WaitForSingleObject(ddraw->render.ev, INFINITE);
|
WaitForSingleObject(ddraw->render.ev, INFINITE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
SwitchToThread();
|
{
|
||||||
|
if (ddraw->sleep > 0)
|
||||||
|
Sleep(ddraw->sleep);
|
||||||
|
else
|
||||||
|
SwitchToThread();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user