mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-06 06:43:36 +00:00
Fix System::currentTimeMillis() not returning correct numbers for linux and preventing the game tick, which then broke the input system.
This commit is contained in:
parent
c7ede72c91
commit
2ca66673b4
|
|
@ -101,10 +101,9 @@ __int64 System::currentTimeMillis()
|
|||
#elif defined(__linux__)
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
long long unix_time = tv.tv_sec;
|
||||
long long file_time = (unix_time + 11644473600LL) * 10000000LL + tv.tv_usec * 10;
|
||||
|
||||
return file_time;
|
||||
// Convert to milliseconds since unix epoch instead of windows file time
|
||||
// time is expecting calculation to be between 10-30 ms.
|
||||
return (int64_t)tv.tv_sec * 1000LL + tv.tv_sec / 1000;
|
||||
#else
|
||||
|
||||
SYSTEMTIME UTCSysTime;
|
||||
|
|
|
|||
Loading…
Reference in a new issue