Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void C_BaseEntity::InterpolateServerEntities()
- {
- VPROF_BUDGET( "C_BaseEntity::InterpolateServerEntities", VPROF_BUDGETGROUP_INTERPOLATION );
- s_bInterpolate = cl_interpolate.GetBool();
- // Don't interpolate during timedemo playback
- if ( engine->IsPlayingTimeDemo() )
- {
- s_bInterpolate = false;
- }
- // Don't interpolate, either, if we are timing out
- INetChannelInfo *nci = engine->GetNetChannelInfo();
- if ( nci && nci->GetTimeSinceLastReceived() > 0.5f )
- {
- s_bInterpolate = false;
- }
- if ( IsSimulatingOnAlternateTicks() != g_bWasSkipping ||
- IsEngineThreaded() != g_bWasThreaded ||
- cl_interp_threadmodeticks.GetInt() != g_nThreadModeTicks )
- {
- g_bWasSkipping = IsSimulatingOnAlternateTicks();
- g_bWasThreaded = IsEngineThreaded();
- g_nThreadModeTicks = cl_interp_threadmodeticks.GetInt();
- C_BaseEntityIterator iterator;
- C_BaseEntity *pEnt;
- while ( (pEnt = iterator.Next()) != NULL )
- {
- pEnt->Interp_UpdateInterpolationAmounts( pEnt->GetVarMapping() );
- }
- }
- // Enable extrapolation?
- CInterpolationContext context;
- context.SetLastTimeStamp( engine->GetLastTimeStamp() );
- if ( cl_extrapolate.GetBool() && !engine->IsPaused() )
- {
- context.EnableExtrapolation( true );
- }
- // Smoothly interpolate position for server entities.
- ProcessTeleportList();
- ProcessInterpolatedList();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement