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

hg/feature/gsoc2013-dfighter
kaetemi 12 years ago
parent 1c9c2eeded
commit 6404f8eafa

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

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

Loading…
Cancel
Save