nel_misc_CTime_ticksToSecond_fix_mac_os_x_THE_WORKING_ONE.patch

rti, 05/12/2010 11:58 am

Download (701 Bytes)

b/code/nel/src/misc/time_nl.cpp Wed May 12 11:54:24 2010 +0200
222 222
	else
223 223
#elif defined(NL_OS_MAC)
224 224
	{
225
		static mach_timebase_info_data_t tbInfo;
226
		if(tbInfo.denom == 0) mach_timebase_info(&tbInfo);
227
		return double(ticks * tbInfo.numer / tbInfo.denom)/1000000.0;
225
		static double factor = 0.0;
226
		if (factor == 0.0)
227
		{
228
			mach_timebase_info_data_t tbInfo;
229
			mach_timebase_info(&tbInfo);
230
			factor = 1000000000.0 * (double)tbInfo.numer / (double)tbInfo.denom;
231
		}
232
		return double(ticks / factor);
228 233
	}
229 234
#endif // NL_OS_WINDOWS
230 235
	{