add source-sdk-2013

This commit is contained in:
nillerusr
2022-03-01 23:00:42 +03:00
parent 88b8830e8b
commit edc8d6c584
3288 changed files with 3734 additions and 1062458 deletions

View File

@@ -50,10 +50,6 @@
#include "sourcevr/isourcevirtualreality.h"
#include "client_virtualreality.h"
#ifdef TF_CLIENT_DLL
#include "tf_gamerules.h"
#endif
#if defined USES_ECON_ITEMS
#include "econ_wearable.h"
#endif
@@ -115,7 +111,7 @@ ConVar spec_freeze_distance_min( "spec_freeze_distance_min", "96", FCVAR_CHEAT,
ConVar spec_freeze_distance_max( "spec_freeze_distance_max", "200", FCVAR_CHEAT, "Maximum random distance from the target to stop when framing them in observer freeze cam." );
#endif
static ConVar cl_first_person_uses_world_model ( "cl_first_person_uses_world_model", "0", FCVAR_NONE, "Causes the third person model to be drawn instead of the view model" );
static ConVar cl_first_person_uses_world_model ( "cl_first_person_uses_world_model", "0", FCVAR_ARCHIVE, "Causes the third person model to be drawn instead of the view model" );
ConVar demo_fov_override( "demo_fov_override", "0", FCVAR_CLIENTDLL | FCVAR_DONTRECORD, "If nonzero, this value will be used to override FOV during demo playback." );
@@ -126,9 +122,6 @@ ConVar demo_fov_override( "demo_fov_override", "0", FCVAR_CLIENTDLL | FCVAR_DONT
ConVar cl_meathook_neck_pivot_ingame_up( "cl_meathook_neck_pivot_ingame_up", "7.0" );
ConVar cl_meathook_neck_pivot_ingame_fwd( "cl_meathook_neck_pivot_ingame_fwd", "3.0" );
static ConVar cl_clean_textures_on_death( "cl_clean_textures_on_death", "0", FCVAR_DEVELOPMENTONLY, "If enabled, attempts to purge unused textures every time a freeze cam is shown" );
void RecvProxy_LocalVelocityX( const CRecvProxyData *pData, void *pStruct, void *pOut );
void RecvProxy_LocalVelocityY( const CRecvProxyData *pData, void *pStruct, void *pOut );
void RecvProxy_LocalVelocityZ( const CRecvProxyData *pData, void *pStruct, void *pOut );
@@ -345,7 +338,6 @@ BEGIN_PREDICTION_DATA_NO_BASE( CPlayerLocalData )
DEFINE_PRED_FIELD_TOL( m_flFallVelocity, FIELD_FLOAT, FTYPEDESC_INSENDTABLE, 0.5f ),
// DEFINE_PRED_FIELD( m_nOldButtons, FIELD_INTEGER, FTYPEDESC_INSENDTABLE ),
DEFINE_FIELD( m_nOldButtons, FIELD_INTEGER ),
DEFINE_FIELD( m_flOldForwardMove, FIELD_FLOAT ),
DEFINE_PRED_FIELD( m_flStepSize, FIELD_FLOAT, FTYPEDESC_INSENDTABLE ),
DEFINE_FIELD( m_flFOVRate, FIELD_FLOAT ),
@@ -444,7 +436,6 @@ C_BasePlayer::C_BasePlayer() : m_iv_vecViewOffset( "C_BasePlayer::m_iv_vecViewOf
m_bFiredWeapon = false;
m_nForceVisionFilterFlags = 0;
m_nLocalPlayerVisionFlags = 0;
ListenForGameEvent( "base_player_teleported" );
}
@@ -473,8 +464,8 @@ void C_BasePlayer::Spawn( void )
ClearFlags();
AddFlag( FL_CLIENT );
int fEffects = GetEffects() & EF_NOSHADOW;
SetEffects( fEffects );
int effects = GetEffects() & EF_NOSHADOW;
SetEffects( effects );
m_iFOV = 0; // init field of view.
@@ -550,7 +541,6 @@ CBaseEntity *C_BasePlayer::GetObserverTarget() const // returns players target o
case OBS_MODE_FIXED: // view from a fixed camera position
case OBS_MODE_IN_EYE: // follow a player in first person view
case OBS_MODE_CHASE: // follow a player in third person view
case OBS_MODE_POI: // PASSTIME point of interest - game objective, big fight, anything interesting
case OBS_MODE_ROAMING: // free roaming
return m_hObserverTarget;
break;
@@ -645,7 +635,6 @@ int C_BasePlayer::GetObserverMode() const
case OBS_MODE_FIXED: // view from a fixed camera position
case OBS_MODE_IN_EYE: // follow a player in first person view
case OBS_MODE_CHASE: // follow a player in third person view
case OBS_MODE_POI: // PASSTIME point of interest - game objective, big fight, anything interesting
case OBS_MODE_ROAMING: // free roaming
return m_iObserverMode;
break;
@@ -722,8 +711,8 @@ void C_BasePlayer::FireGameEvent( IGameEvent *event )
{
if ( FStrEq( event->GetName(), "base_player_teleported" ) )
{
const int index_ = event->GetInt( "entindex" );
if ( index_ == entindex() && IsLocalPlayer() )
const int index = event->GetInt( "entindex" );
if ( index == entindex() && IsLocalPlayer() )
{
// In VR, we want to make sure our head and body
// are aligned after we teleport.
@@ -891,10 +880,6 @@ void C_BasePlayer::PostDataUpdate( DataUpdateType_t updateType )
// Force the sound mixer to the freezecam mixer
ConVar *pVar = (ConVar *)cvar->FindVar( "snd_soundmixer" );
pVar->SetValue( "FreezeCam_Only" );
// When we start, give unused textures an opportunity to unload
if ( cl_clean_textures_on_death.GetBool() )
g_pMaterialSystem->UncacheUnusedMaterials( false );
}
else if ( m_bWasFreezeFraming && GetObserverMode() != OBS_MODE_FREEZECAM )
{
@@ -912,14 +897,6 @@ void C_BasePlayer::PostDataUpdate( DataUpdateType_t updateType )
m_nForceVisionFilterFlags = 0;
CalculateVisionUsingCurrentFlags();
}
// force calculate vision when the local vision flags changed
int nCurrentLocalPlayerVisionFlags = GetLocalPlayerVisionFilterFlags();
if ( m_nLocalPlayerVisionFlags != nCurrentLocalPlayerVisionFlags )
{
CalculateVisionUsingCurrentFlags();
m_nLocalPlayerVisionFlags = nCurrentLocalPlayerVisionFlags;
}
}
// If we are updated while paused, allow the player origin to be snapped by the
@@ -1594,11 +1571,11 @@ void C_BasePlayer::CalcRoamingView(Vector& eyeOrigin, QAngle& eyeAngles, float&
if ( spec_track.GetInt() > 0 )
{
C_BaseEntity *pTarget = ClientEntityList().GetBaseEntity( spec_track.GetInt() );
C_BaseEntity *target = ClientEntityList().GetBaseEntity( spec_track.GetInt() );
if ( pTarget )
if ( target )
{
Vector v = pTarget->GetAbsOrigin(); v.z += 54;
Vector v = target->GetAbsOrigin(); v.z += 54;
QAngle a; VectorAngles( v - eyeOrigin, a );
NormalizeAngles( a );
@@ -1892,14 +1869,6 @@ void C_BasePlayer::ThirdPersonSwitch( bool bThirdperson )
{
return false;
}
#ifdef TF_CLIENT_DLL
if ( TFGameRules() && TFGameRules()->IsCompetitiveMode() && TFGameRules()->PlayersAreOnMatchSummaryStage() )
{
return false;
}
#endif
int ObserverMode = pLocalPlayer->GetObserverMode();
if ( ( ObserverMode == OBS_MODE_NONE ) || ( ObserverMode == OBS_MODE_IN_EYE ) )
{
@@ -2109,7 +2078,7 @@ void C_BasePlayer::GetToolRecordingState( KeyValues *msg )
// then this code can (should!) be removed
if ( state.m_bThirdPerson )
{
const Vector& cam_ofs = g_ThirdPersonManager.GetCameraOffsetAngles();
Vector cam_ofs = g_ThirdPersonManager.GetCameraOffsetAngles();
QAngle camAngles;
camAngles[ PITCH ] = cam_ofs[ PITCH ];
@@ -2164,11 +2133,11 @@ void C_BasePlayer::Simulate()
// Consider using GetRenderedWeaponModel() instead - it will get the
// viewmodel or the active weapon as appropriate.
//-----------------------------------------------------------------------------
C_BaseViewModel *C_BasePlayer::GetViewModel( int index_ /*= 0*/, bool bObserverOK )
C_BaseViewModel *C_BasePlayer::GetViewModel( int index /*= 0*/, bool bObserverOK )
{
Assert( index_ >= 0 && index_ < MAX_VIEWMODELS );
Assert( index >= 0 && index < MAX_VIEWMODELS );
C_BaseViewModel *vm = m_hViewModel[index_];
C_BaseViewModel *vm = m_hViewModel[ index ];
if ( bObserverOK && GetObserverMode() == OBS_MODE_IN_EYE )
{
@@ -2177,7 +2146,7 @@ C_BaseViewModel *C_BasePlayer::GetViewModel( int index_ /*= 0*/, bool bObserverO
// get the targets viewmodel unless the target is an observer itself
if ( target && target != this && !target->IsObserver() )
{
vm = target->GetViewModel( index_ );
vm = target->GetViewModel( index );
}
}
@@ -2625,7 +2594,7 @@ void C_BasePlayer::NotePredictionError( const Vector &vDelta )
// offset curtime and setup bones at that time using fake interpolation
// fake interpolation means we don't have reliable interpolation history (the local player doesn't animate locally)
// so we just modify cycle and origin directly and use that as a fake guess
bool C_BasePlayer::ForceSetupBonesAtTimeFakeInterpolation( matrix3x4_t *pBonesOut, float curtimeOffset )
void C_BasePlayer::ForceSetupBonesAtTimeFakeInterpolation( matrix3x4_t *pBonesOut, float curtimeOffset )
{
// we don't have any interpolation data, so fake it
float cycle = m_flCycle;
@@ -2640,37 +2609,30 @@ bool C_BasePlayer::ForceSetupBonesAtTimeFakeInterpolation( matrix3x4_t *pBonesOu
m_flCycle = fmod( 10 + cycle + m_flPlaybackRate * curtimeOffset, 1.0f );
SetLocalOrigin( origin + curtimeOffset * GetLocalVelocity() );
// Setup bone state to extrapolate physics velocity
bool bSuccess = SetupBones( pBonesOut, MAXSTUDIOBONES, BONE_USED_BY_ANYTHING, gpGlobals->curtime + curtimeOffset );
SetupBones( pBonesOut, MAXSTUDIOBONES, BONE_USED_BY_ANYTHING, gpGlobals->curtime + curtimeOffset );
m_flCycle = cycle;
SetLocalOrigin( origin );
return bSuccess;
}
bool C_BasePlayer::GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matrix3x4_t *pDeltaBones1, matrix3x4_t *pCurrentBones, float boneDt )
void C_BasePlayer::GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matrix3x4_t *pDeltaBones1, matrix3x4_t *pCurrentBones, float boneDt )
{
if ( !IsLocalPlayer() )
return BaseClass::GetRagdollInitBoneArrays(pDeltaBones0, pDeltaBones1, pCurrentBones, boneDt);
bool bSuccess = true;
if ( !ForceSetupBonesAtTimeFakeInterpolation( pDeltaBones0, -boneDt ) )
bSuccess = false;
if ( !ForceSetupBonesAtTimeFakeInterpolation( pDeltaBones1, 0 ) )
bSuccess = false;
{
BaseClass::GetRagdollInitBoneArrays(pDeltaBones0, pDeltaBones1, pCurrentBones, boneDt);
return;
}
ForceSetupBonesAtTimeFakeInterpolation( pDeltaBones0, -boneDt );
ForceSetupBonesAtTimeFakeInterpolation( pDeltaBones1, 0 );
float ragdollCreateTime = PhysGetSyncCreateTime();
if ( ragdollCreateTime != gpGlobals->curtime )
{
if ( !ForceSetupBonesAtTimeFakeInterpolation( pCurrentBones, ragdollCreateTime - gpGlobals->curtime ) )
bSuccess = false;
ForceSetupBonesAtTimeFakeInterpolation( pCurrentBones, ragdollCreateTime - gpGlobals->curtime );
}
else
{
if ( !SetupBones( pCurrentBones, MAXSTUDIOBONES, BONE_USED_BY_ANYTHING, gpGlobals->curtime ) )
bSuccess = false;
SetupBones( pCurrentBones, MAXSTUDIOBONES, BONE_USED_BY_ANYTHING, gpGlobals->curtime );
}
return bSuccess;
}
@@ -2846,7 +2808,16 @@ bool C_BasePlayer::GetSteamID( CSteamID *pID )
{
if ( pi.friendsID && steamapicontext && steamapicontext->SteamUtils() )
{
pID->InstancedSet( pi.friendsID, 1, GetUniverse(), k_EAccountTypeIndividual );
#if 1 // new
static EUniverse universe = k_EUniverseInvalid;
if ( universe == k_EUniverseInvalid )
universe = steamapicontext->SteamUtils()->GetConnectedUniverse();
pID->InstancedSet( pi.friendsID, 1, universe, k_EAccountTypeIndividual );
#else // old
pID->InstancedSet( pi.friendsID, 1, steamapicontext->SteamUtils()->GetConnectedUniverse(), k_EAccountTypeIndividual );
#endif
return true;
}
@@ -2867,7 +2838,6 @@ void C_BasePlayer::UpdateWearables( void )
{
pItem->ValidateModelIndex();
pItem->UpdateVisibility();
pItem->CreateShadow();
}
}
}