From 7d1dc8b2d54ada305e4e2caa38debf35a171c52d Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sat, 22 Jan 2022 21:00:54 +0100 Subject: [PATCH] Get rid of ancient workaround ...that probably negatively impacted performance or something else --- source/Irrlicht/os.cpp | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/source/Irrlicht/os.cpp b/source/Irrlicht/os.cpp index 68420573..d26830db 100644 --- a/source/Irrlicht/os.cpp +++ b/source/Irrlicht/os.cpp @@ -94,16 +94,9 @@ namespace os static LARGE_INTEGER HighPerformanceFreq; static BOOL HighPerformanceTimerSupport = FALSE; - static BOOL MultiCore = FALSE; void Timer::initTimer(bool usePerformanceTimer) { -#if !defined(_WIN32_WCE) && !defined (_IRR_XBOX_PLATFORM_) - // workaround for hires timer on multiple core systems, bios bugs result in bad hires timers. - SYSTEM_INFO sysinfo; - GetSystemInfo(&sysinfo); - MultiCore = (sysinfo.dwNumberOfProcessors > 1); -#endif if (usePerformanceTimer) HighPerformanceTimerSupport = QueryPerformanceFrequency(&HighPerformanceFreq); else @@ -115,24 +108,11 @@ namespace os { if (HighPerformanceTimerSupport) { -#if !defined(_WIN32_WCE) && !defined (_IRR_XBOX_PLATFORM_) - // Avoid potential timing inaccuracies across multiple cores by - // temporarily setting the affinity of this process to one core. - DWORD_PTR affinityMask=0; - if(MultiCore) - affinityMask = SetThreadAffinityMask(GetCurrentThread(), 1); -#endif LARGE_INTEGER nTime; BOOL queriedOK = QueryPerformanceCounter(&nTime); -#if !defined(_WIN32_WCE) && !defined (_IRR_XBOX_PLATFORM_) - // Restore the true affinity. - if(MultiCore) - (void)SetThreadAffinityMask(GetCurrentThread(), affinityMask); -#endif if(queriedOK) return u32((nTime.QuadPart) * 1000 / HighPerformanceFreq.QuadPart); - } return GetTickCount();