From 79527727a47e14bfab8c92714a7e9c4ad2d4f8dd Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 27 Jul 2012 22:35:26 +0200 Subject: [PATCH] Changed: Use the high resolution local time function instead of the funky code when getting the local time in the client. Use the timer probe function to check if it is necessary to set the cpu mask in the client --- code/ryzom/client/src/init.cpp | 7 +++++-- code/ryzom/client/src/time_client.h | 19 ++----------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 11d01934f..bb2540824 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -686,8 +686,11 @@ void prelogInit() #ifdef NL_OS_WINDOWS _control87 (_EM_INVALID|_EM_DENORMAL/*|_EM_ZERODIVIDE|_EM_OVERFLOW*/|_EM_UNDERFLOW|_EM_INEXACT, _MCW_EM); #endif // NL_OS_WINDOWS - - setCPUMask(); + + CTime::CTimerInfo timerInfo; + NLMISC::CTime::probeTimerInfo(timerInfo); + if (timerInfo.RequiresSingleCore) // TODO: Also have a FV configuration value to force single core. + setCPUMask(); FPU_CHECKER_ONCE diff --git a/code/ryzom/client/src/time_client.h b/code/ryzom/client/src/time_client.h index 80b21195b..436cf1465 100644 --- a/code/ryzom/client/src/time_client.h +++ b/code/ryzom/client/src/time_client.h @@ -134,24 +134,9 @@ void updateClientTime(); // update smoothed time (useful for sky animation) void updateSmoothedTime(); -inline TTime ryzomGetLocalTime () +inline NLMISC::TTime ryzomGetLocalTime() { -#ifdef NL_OS_WINDOWS - if (ClientCfg.TimerMode == 0) - { - return (TTime)(NLMISC::CTime::ticksToSecond (NLMISC::CTime::getPerformanceTime()) * 1000.0); - } - else // if (ClientCfg.TimerMode == 1) - { - // Use 1 ms timer precision - timeBeginPeriod(1); - DWORD start = timeGetTime(); - timeEndPeriod(1); - return (TTime)start; - } -#else // NL_OS_WINDOWS - return (TTime)(NLMISC::CTime::ticksToSecond (NLMISC::CTime::getPerformanceTime()) * 1000.0); -#endif // NL_OS_WINDOWS + return NLMISC::CTime::getLocalTimeHR(); } inline NLMISC::TTicks ryzomGetPerformanceTime()