There is the code in the Quake 2 main game loop implementation:
if (!initialized) { // let base retain 16 bits of effectively random data base = timeGetTime() & 0xffff0000; initialized = true; } curtime = timeGetTime() - base;
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:
base = timeGetTime() & 0xffff0000
0xffff0000
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?
Log in to post a comment.
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 the0xffff0000
mask on the retrieved time? Why not to use just:???
What is the role of that mask?