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

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

@ -134,24 +134,9 @@ void updateClientTime();
// update smoothed time (useful for sky animation) // update smoothed time (useful for sky animation)
void updateSmoothedTime(); void updateSmoothedTime();
inline TTime ryzomGetLocalTime () inline NLMISC::TTime ryzomGetLocalTime()
{ {
#ifdef NL_OS_WINDOWS return NLMISC::CTime::getLocalTimeHR();
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
} }
inline NLMISC::TTicks ryzomGetPerformanceTime() inline NLMISC::TTicks ryzomGetPerformanceTime()

Loading…
Cancel
Save