diff --git a/src/encryptedarg.cpp b/src/encryptedarg.cpp index 01a020f..e7a018c 100644 --- a/src/encryptedarg.cpp +++ b/src/encryptedarg.cpp @@ -10,12 +10,16 @@ #endif #if defined(Q_OS_MAC) -// this is pretty much what wine does :-0 +// taken from XIV-on-Mac, apparently Wine changed this? uint32_t TickCount() { - struct mach_timebase_info convfact; - mach_timebase_info(&convfact); + struct mach_timebase_info timebase; + mach_timebase_info(&timebase); - return (mach_absolute_time() * convfact.numer) / (convfact.denom * 1000000); + auto machtime = mach_continuous_time(); + auto numer = uint64_t (timebase.numer); + auto denom = uint64_t(timebase.denom); + auto monotonic_time = machtime * numer / denom / 100; + return monotonic_time / 10000; } #endif