There is the code in the Quake 2 main game loop implementation:
I'm wondering about the line:
base = timeGetTime() & 0xffff0000
Why are they applying the
0xffff0000
mask on the retrieved time?
Why not to use just:
???
What is the role of that mask?
Code:
if (!initialized)
{ // let base retain 16 bits of effectively random data
base = timeGetTime() & 0xffff0000;
initialized = true;
}
curtime = timeGetTime() - base;Quote:
base = timeGetTime() & 0xffff0000
Quote:
0xffff0000
Why not to use just:
Code:
if (!initialized)
{ // let base retain 16 bits of effectively random data
initialTime = timeGetTime();
initialized = true;
}
curtime = timeGetTime() - initialTime;What is the role of that mask?