|
|
@ -241,6 +241,11 @@ void CL_SignonReply( void ) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float CL_LerpInterval( void ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return max( cl_interp->value, 1.f / cl_updaterate->value ); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
=============== |
|
|
|
=============== |
|
|
|
CL_LerpPoint |
|
|
|
CL_LerpPoint |
|
|
@ -291,7 +296,8 @@ static float CL_LerpPoint( void ) |
|
|
|
if( cl_interp->value > 0.001f ) |
|
|
|
if( cl_interp->value > 0.001f ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// manual lerp value (goldsrc mode)
|
|
|
|
// manual lerp value (goldsrc mode)
|
|
|
|
frac = ( cl.time - cl.mtime[1] ) / cl_interp->value; |
|
|
|
float td = max( 0.f, cl.time - cl.mtime[0] ); |
|
|
|
|
|
|
|
frac = td / CL_LerpInterval(); |
|
|
|
} |
|
|
|
} |
|
|
|
else if( server_frametime > 0.001f ) |
|
|
|
else if( server_frametime > 0.001f ) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -339,10 +345,10 @@ Validate interpolation cvars, calc interpolation window |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void CL_ComputeClientInterpolationAmount( usercmd_t *cmd ) |
|
|
|
void CL_ComputeClientInterpolationAmount( usercmd_t *cmd ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int min_interp = MIN_EX_INTERP; |
|
|
|
const float epsilon = 0.001f; // to avoid float invalid comparision
|
|
|
|
int max_interp = MAX_EX_INTERP; |
|
|
|
float min_interp = MIN_EX_INTERP; |
|
|
|
int interpolation_msec; |
|
|
|
float max_interp = MAX_EX_INTERP; |
|
|
|
qboolean forced = false; |
|
|
|
float interpolation_time; |
|
|
|
|
|
|
|
|
|
|
|
if( cl_updaterate->value < MIN_UPDATERATE ) |
|
|
|
if( cl_updaterate->value < MIN_UPDATERATE ) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -357,29 +363,24 @@ void CL_ComputeClientInterpolationAmount( usercmd_t *cmd ) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if( cls.spectator ) |
|
|
|
if( cls.spectator ) |
|
|
|
max_interp = 200; |
|
|
|
max_interp = 0.2f; |
|
|
|
|
|
|
|
|
|
|
|
min_interp = 1000.0f / cl_updaterate->value; |
|
|
|
min_interp = 1.0f / cl_updaterate->value; |
|
|
|
min_interp = Q_max( 1, min_interp ); |
|
|
|
interpolation_time = CL_LerpInterval( ); |
|
|
|
interpolation_msec = cl_interp->value * 1000.0f; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(( interpolation_msec + 1 ) < min_interp ) |
|
|
|
if( (cl_interp->value + epsilon) < min_interp ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Con_Printf( "ex_interp forced up to %i msec\n", interpolation_msec ); |
|
|
|
Con_Printf( "ex_interp forced up to %.1f msec\n", min_interp * 1000.f ); |
|
|
|
interpolation_msec = min_interp; |
|
|
|
Cvar_SetValue( "ex_interp", min_interp ); |
|
|
|
forced = true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else if(( interpolation_msec - 1 ) > max_interp ) |
|
|
|
else if( (cl_interp->value - epsilon) > max_interp ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Con_Printf( "ex_interp forced down to %i msec\n", interpolation_msec ); |
|
|
|
Con_Printf( "ex_interp forced down to %.1f msec\n", max_interp * 1000.f ); |
|
|
|
interpolation_msec = max_interp; |
|
|
|
Cvar_SetValue( "ex_interp", max_interp ); |
|
|
|
forced = true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if( forced ) Cvar_SetValue( "ex_interp", (float)interpolation_msec * 0.001f ); |
|
|
|
interpolation_time = bound( min_interp, interpolation_time, max_interp ); |
|
|
|
interpolation_msec = bound( min_interp, interpolation_msec, max_interp ); |
|
|
|
cmd->lerp_msec = CL_DriftInterpolationAmount( interpolation_time * 1000 ); |
|
|
|
|
|
|
|
|
|
|
|
cmd->lerp_msec = CL_DriftInterpolationAmount( interpolation_msec ); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|