mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-22 20:51:31 +00:00
Implement Sys_Milliseconds
This function was taken from ioQuakeII and refactored to match Yamagi Quake II
This commit is contained in:
parent
5908432bba
commit
a6f22f0f5a
1 changed files with 22 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue