mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
Add singlecpu ini var for CPU0 affinity forcing
This commit is contained in:
parent
3c79b4aa4b
commit
c6dfae327e
9
main.c
9
main.c
@ -690,6 +690,8 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk
|
|||||||
"vhack=false\n"
|
"vhack=false\n"
|
||||||
"; switch between OpenGL (opengl) and software (gdi) renderers, latter supports less features but might be faster depending on the GPU\n"
|
"; switch between OpenGL (opengl) and software (gdi) renderers, latter supports less features but might be faster depending on the GPU\n"
|
||||||
"renderer=gdi\n"
|
"renderer=gdi\n"
|
||||||
|
"; force CPU0 affinity, avoids crashes with RA, *might* have a performance impact\n"
|
||||||
|
"singlecpu=true\n"
|
||||||
, fh);
|
, fh);
|
||||||
fclose(fh);
|
fclose(fh);
|
||||||
}
|
}
|
||||||
@ -819,6 +821,13 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk
|
|||||||
This->renderer = render_main;
|
This->renderer = render_main;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GetPrivateProfileStringA("ddraw", "singlecpu", "true", tmp, sizeof(tmp), ini_path);
|
||||||
|
if (tolower(tmp[0]) == 'y' || tolower(tmp[0]) == 't' || tolower(tmp[0]) == 'e' || tmp[0] == '1')
|
||||||
|
{
|
||||||
|
printf("DirectDrawCreate: Setting CPU0 affinity\n");
|
||||||
|
SetProcessAffinityMask(GetCurrentProcess(), 1);
|
||||||
|
}
|
||||||
|
|
||||||
/* last minute check for cnc-plugin */
|
/* last minute check for cnc-plugin */
|
||||||
if (GetEnvironmentVariable("DDRAW_WINDOW", tmp, sizeof(tmp)) > 0)
|
if (GetEnvironmentVariable("DDRAW_WINDOW", tmp, sizeof(tmp)) > 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user