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

This commit is contained in:
kaetemi 2012-07-27 22:35:26 +02:00
parent 1c9c2eeded
commit 6404f8eafa
2 changed files with 7 additions and 19 deletions

View file

@ -687,6 +687,9 @@ void prelogInit()
_control87 (_EM_INVALID|_EM_DENORMAL/*|_EM_ZERODIVIDE|_EM_OVERFLOW*/|_EM_UNDERFLOW|_EM_INEXACT, _MCW_EM);
#endif // NL_OS_WINDOWS
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

View file

@ -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()