mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
Improvements in time accounting. Accurate to +-0.5ms, instead of -1,0 like
others. Based on Grievre's and zquake's code.
This commit is contained in:
parent
f8bc0ba9e2
commit
cb94d50500
1 changed files with 9 additions and 3 deletions
|
@ -566,6 +566,7 @@ static void
|
|||
CL_FinishMove (usercmd_t *cmd)
|
||||
{
|
||||
int ms, i;
|
||||
static double accum = 0.0;
|
||||
|
||||
// always dump the first two message, because it may contain leftover
|
||||
// inputs from the last level
|
||||
|
@ -588,9 +589,14 @@ CL_FinishMove (usercmd_t *cmd)
|
|||
// 1999-10-29 +USE fix by Maddes end
|
||||
|
||||
// send milliseconds of time to apply the move
|
||||
ms = host_frametime * 1000;
|
||||
if (ms > 250)
|
||||
accum += (host_frametime * 1000.0);
|
||||
ms = accum + 0.5;
|
||||
accum -= ms;
|
||||
|
||||
if (ms > 250) {
|
||||
ms = 100; // time was unreasonable
|
||||
accum = 0.0;
|
||||
}
|
||||
cmd->msec = ms;
|
||||
|
||||
VectorCopy (cl.viewangles, cmd->angles);
|
||||
|
|
Loading…
Reference in a new issue