Change the global timing in main() from milli- to microseconds.

This is a no-op for now. We need this to get a much higher precision
when calculating the frame times. This changes the fixedtime cvar from
milli- to microseconds.
This commit is contained in:
Yamagi Burmeister 2017-09-06 09:09:17 +02:00
parent f16242e923
commit a0aa1c87c7
2 changed files with 5 additions and 5 deletions

View File

@ -38,7 +38,7 @@ qboolean is_portable;
int
main(int argc, char **argv)
{
int time, oldtime, newtime;
long long time, oldtime, newtime;
int verLen, i;
const char* versionString;
@ -134,7 +134,7 @@ main(int argc, char **argv)
/* Do not delay reads on stdin*/
fcntl(fileno(stdin), F_SETFL, fcntl(fileno(stdin), F_GETFL, NULL) | FNDELAY);
oldtime = Sys_Milliseconds();
oldtime = Sys_Microseconds();
t.tv_sec = 0;
/* The legendary Quake II mainloop */
@ -149,10 +149,10 @@ main(int argc, char **argv)
nanosleep(&t, NULL);
#endif
newtime = Sys_Milliseconds();
newtime = Sys_Microseconds();
time = newtime - oldtime;
}
while (time < 1);
while (time < 1000);
Qcommon_Frame(time);
oldtime = newtime;

View File

@ -388,7 +388,7 @@ Qcommon_Frame(int msec)
time_between = Sys_Milliseconds();
}
CL_Frame(msec);
CL_Frame(msec / 1000);
if (host_speeds->value)
{