better fix for VC6 "can't cast u64 to double"

This commit is contained in:
Chris Danford
2005-07-23 00:33:17 +00:00
parent 371bc33f47
commit e4677c9f8b
+4 -2
View File
@@ -45,8 +45,10 @@ float RageTimer::GetTimeSinceStart( bool bAccurate )
{
uint64_t usecs = GetTime( bAccurate );
usecs -= g_iStartTime;
uint32_t ret = usecs / 1000000;
return (float)ret;
// HACK: VC6 can't cast u64 to a double, but it can cast a i64 to a double.
// We can afford to lose one bit of precision since these numbers will
// never overflow a 64 int.
return (int64_t)usecs / 1000000.f;
}
void RageTimer::Touch()