diff --git a/src/xrEngine/device.cpp b/src/xrEngine/device.cpp index 1f7622df24e..63f2c218874 100644 --- a/src/xrEngine/device.cpp +++ b/src/xrEngine/device.cpp @@ -68,7 +68,33 @@ bool CRenderDevice::RenderBegin() } void CRenderDevice::Clear() { GEnv.Render->Clear(); } -extern void CheckPrivilegySlowdown(); + +namespace +{ +void CheckPrivilegySlowdown() +{ +#ifndef MASTER_GOLD + const auto slowdownthread = +[](void*) + { + for (;;) + { + if (Device.GetStats().fFPS < 30) + Sleep(1); + if (Device.mt_bMustExit || !pSettings || !Console || !pInput) + return; + } + }; + + if (strstr(Core.Params, "-slowdown")) + Threading::SpawnThread(slowdownthread, "slowdown", 0, nullptr); + if (strstr(Core.Params, "-slowdown2x")) + { + Threading::SpawnThread(slowdownthread, "slowdown", 0, nullptr); + Threading::SpawnThread(slowdownthread, "slowdown", 0, nullptr); + } +#endif +} +} void CRenderDevice::RenderEnd(void) { diff --git a/src/xrEngine/main.cpp b/src/xrEngine/main.cpp index ba7712b008d..9ead4c77a0c 100644 --- a/src/xrEngine/main.cpp +++ b/src/xrEngine/main.cpp @@ -195,29 +195,6 @@ void execUserScript() Console->ExecuteScript(Console->ConfigFile); } -void slowdownthread(void*) -{ - for (;;) - { - if (Device.GetStats().fFPS < 30) - Sleep(1); - if (Device.mt_bMustExit || !pSettings || !Console || !pInput) - return; - } -} -void CheckPrivilegySlowdown() -{ -#ifdef DEBUG - if (strstr(Core.Params, "-slowdown")) - Threading::SpawnThread(slowdownthread, "slowdown", 0, 0); - if (strstr(Core.Params, "-slowdown2x")) - { - Threading::SpawnThread(slowdownthread, "slowdown", 0, 0); - Threading::SpawnThread(slowdownthread, "slowdown", 0, 0); - } -#endif -} - ENGINE_API void Startup() { InitSoundDeviceList();