Browse Source

engine: client: implement HL25's cl_fixmodelinterpolationartifacts cvar

pull/2/head
Alibek Omarov 11 months ago
parent
commit
18136e5320
  1. 6
      engine/client/cl_frame.c
  2. 4
      engine/client/cl_main.c
  3. 1
      engine/client/client.h

6
engine/client/cl_frame.c

@ -1228,7 +1228,13 @@ void CL_LinkPacketEntities( frame_t *frame ) @@ -1228,7 +1228,13 @@ void CL_LinkPacketEntities( frame_t *frame )
#else
if( ent->lastmove >= cl.time )
{
float at = ent->curstate.animtime;
CL_ResetLatchedVars( ent, true );
if( cl_fixmodelinterpolationartifacts.value )
ent->latched.prevanimtime = ent->curstate.animtime = at;
VectorCopy( ent->curstate.origin, ent->latched.prevorigin );
VectorCopy( ent->curstate.angles, ent->latched.prevangles );

4
engine/client/cl_main.c

@ -78,6 +78,8 @@ CVAR_DEFINE_AUTO( cl_trace_events, "0", FCVAR_ARCHIVE|FCVAR_CHEAT, "enable event @@ -78,6 +78,8 @@ CVAR_DEFINE_AUTO( cl_trace_events, "0", FCVAR_ARCHIVE|FCVAR_CHEAT, "enable event
static CVAR_DEFINE_AUTO( cl_nat, "0", 0, "show servers running under NAT" );
CVAR_DEFINE_AUTO( hud_utf8, "0", FCVAR_ARCHIVE, "Use utf-8 encoding for hud text" );
CVAR_DEFINE_AUTO( ui_renderworld, "0", FCVAR_ARCHIVE, "render world when UI is visible" );
static CVAR_DEFINE_AUTO( cl_maxframetime, "0", 0, "set deadline timer for client rendering to catch freezes" );
CVAR_DEFINE_AUTO( cl_fixmodelinterpolationartifacts, "1", 0, "try to fix up models interpolation on a moving platforms (monsters on trains for example)" );
//
// userinfo
@ -87,7 +89,6 @@ static CVAR_DEFINE_AUTO( model, "", FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_FILTERABL @@ -87,7 +89,6 @@ static CVAR_DEFINE_AUTO( model, "", FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_FILTERABL
static CVAR_DEFINE_AUTO( topcolor, "0", FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_FILTERABLE, "player top color" );
static CVAR_DEFINE_AUTO( bottomcolor, "0", FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_FILTERABLE, "player bottom color" );
CVAR_DEFINE_AUTO( rate, "3500", FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_FILTERABLE, "player network rate" );
static CVAR_DEFINE_AUTO( cl_maxframetime, "0", 0, "set deadline timer for client rendering to catch freezes" );
client_t cl;
client_static_t cls;
@ -2919,6 +2920,7 @@ void CL_InitLocal( void ) @@ -2919,6 +2920,7 @@ void CL_InitLocal( void )
Cvar_Get( "lastdemo", "", FCVAR_ARCHIVE, "last played demo" );
Cvar_RegisterVariable( &ui_renderworld );
Cvar_RegisterVariable( &cl_maxframetime );
Cvar_RegisterVariable( &cl_fixmodelinterpolationartifacts );
// these two added to shut up CS 1.5 about 'unknown' commands
Cvar_Get( "lightgamma", "1", FCVAR_ARCHIVE, "ambient lighting level (legacy, unused)" );

1
engine/client/client.h

@ -700,6 +700,7 @@ extern convar_t rate; @@ -700,6 +700,7 @@ extern convar_t rate;
extern convar_t m_ignore;
extern convar_t r_showtree;
extern convar_t ui_renderworld;
extern convar_t cl_fixmodelinterpolationartifacts;
//=============================================================================

Loading…
Cancel
Save