Implement Sys_Milliseconds

This function was taken from ioQuakeII and refactored to match Yamagi
Quake II
This commit is contained in:
Yamagi Burmeister 2012-06-03 14:19:30 +02:00
parent 5908432bba
commit a6f22f0f5a

View file

@ -40,6 +40,7 @@
#define MAX_NUM_ARGVS 128 #define MAX_NUM_ARGVS 128
int curtime;
int starttime; int starttime;
qboolean ActiveApp; qboolean ActiveApp;
qboolean Minimized; qboolean Minimized;
@ -484,6 +485,27 @@ ParseCommandLine(LPSTR lpCmdLine)
} }
} }
/* ======================================================================= */
int
Sys_Milliseconds(void)
{
static int base;
static qboolean initialized = false;
if (!initialized)
{ /* let base retain 16 bits of effectively random data */
base = timeGetTime() & 0xffff0000;
initialized = true;
}
curtime = timeGetTime() - base;
return curtime;
}
/* ======================================================================= */
/* /*
* Windows main function. Containts the * Windows main function. Containts the
* initialization code and the main loop * initialization code and the main loop