Browse Source

engine: add new engine feature ENGINE_STEP_POSHISTORY_LERP that enables CStrike's MOVETYPE_STEP lerp based on position history

pull/2/head
Alibek Omarov 12 months ago
parent
commit
49f972a7c9
  1. 5
      common/enginefeatures.h
  2. 7
      engine/client/cl_frame.c

5
common/enginefeatures.h

@ -27,6 +27,8 @@ GNU General Public License for more details.
#define ENGINE_COMPUTE_STUDIO_LERP (1<<7) // enable MOVETYPE_STEP lerping back in engine #define ENGINE_COMPUTE_STUDIO_LERP (1<<7) // enable MOVETYPE_STEP lerping back in engine
#define ENGINE_LINEAR_GAMMA_SPACE (1<<8) // disable influence of gamma/brightness cvars to textures/lightmaps, for mods with custom renderer #define ENGINE_LINEAR_GAMMA_SPACE (1<<8) // disable influence of gamma/brightness cvars to textures/lightmaps, for mods with custom renderer
#define ENGINE_STEP_POSHISTORY_LERP (1U<<31) // enable MOVETYPE_STEP interpolation based on position history. Incompatible with ENGINE_COMPUTE_STUDIO_LERP!
// adjust the mask when features will be added or removed // adjust the mask when features will be added or removed
#define ENGINE_FEATURES_MASK \ #define ENGINE_FEATURES_MASK \
( ENGINE_WRITE_LARGE_COORD \ ( ENGINE_WRITE_LARGE_COORD \
@ -37,6 +39,7 @@ GNU General Public License for more details.
| ENGINE_COMPENSATE_QUAKE_BUG \ | ENGINE_COMPENSATE_QUAKE_BUG \
| ENGINE_IMPROVED_LINETRACE \ | ENGINE_IMPROVED_LINETRACE \
| ENGINE_COMPUTE_STUDIO_LERP \ | ENGINE_COMPUTE_STUDIO_LERP \
| ENGINE_LINEAR_GAMMA_SPACE ) | ENGINE_LINEAR_GAMMA_SPACE \
| ENGINE_STEP_POSHISTORY_LERP )
#endif//FEATURES_H #endif//FEATURES_H

7
engine/client/cl_frame.c

@ -189,7 +189,7 @@ CL_ParametricMove
check for parametrical moved entities check for parametrical moved entities
================== ==================
*/ */
qboolean CL_ParametricMove( cl_entity_t *ent ) static qboolean CL_ParametricMove( cl_entity_t *ent )
{ {
float frac, dt, t; float frac, dt, t;
vec3_t delta; vec3_t delta;
@ -1279,7 +1279,10 @@ void CL_LinkPacketEntities( frame_t *frame )
if ( !CL_InterpolateModel( ent )) if ( !CL_InterpolateModel( ent ))
continue; continue;
} }
else if( ent->curstate.movetype == MOVETYPE_STEP && !NET_IsLocalAddress( cls.netchan.remote_address )) // a1ba: in GoldSrc this is done for cstrike and czero
// but let modders use this as an engine feature
else if( FBitSet( host.features, ENGINE_STEP_POSHISTORY_LERP ) &&
ent->curstate.movetype == MOVETYPE_STEP && !NET_IsLocalAddress( cls.netchan.remote_address ))
{ {
if( !CL_InterpolateModel( ent )) if( !CL_InterpolateModel( ent ))
continue; continue;

Loading…
Cancel
Save