Skip to content

Commit f5864bf

Browse files
committed
ragdoll optimizations
use new sound defaults
1 parent 7b2cc23 commit f5864bf

File tree

2 files changed

+28
-10
lines changed

2 files changed

+28
-10
lines changed

engine/audio/private/snd_dma.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,8 @@ static ConVar volume( "volume", "1.0", FCVAR_ARCHIVE | FCVAR_ARCHIVE_XBOX, "Soun
461461
// user configurable music volume
462462
ConVar snd_musicvolume( "snd_musicvolume", "1.0", FCVAR_ARCHIVE | FCVAR_ARCHIVE_XBOX, "Music volume", true, 0.0f, true, 1.0f );
463463

464-
ConVar snd_mixahead( "snd_mixahead", "0.1", FCVAR_ARCHIVE );
465-
ConVar snd_mix_async( "snd_mix_async", "0" );
464+
ConVar snd_mixahead( "snd_mixahead", "0.0666667", FCVAR_ARCHIVE );
465+
ConVar snd_mix_async( "snd_mix_async", "1" );
466466
#ifdef _DEBUG
467467
static ConCommand snd_mixvol("snd_mixvol", MXR_DebugSetMixGroupVolume, "Set named Mixgroup to mix volume.");
468468
#endif

game/client/tf/c_tf_player.cpp

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,6 +1619,9 @@ bool C_TFRagdoll::IsRagdollVisible()
16191619
#define DISSOLVE_FADE_OUT_START_TIME 2.0f
16201620
#define DISSOLVE_FADE_OUT_END_TIME 2.0f
16211621

1622+
extern ConVar g_ragdoll_lvfadespeed;
1623+
extern ConVar g_ragdoll_fadespeed;
1624+
16221625
void C_TFRagdoll::ClientThink( void )
16231626
{
16241627
SetNextClientThink( CLIENT_THINK_ALWAYS );
@@ -1760,9 +1763,16 @@ void C_TFRagdoll::ClientThink( void )
17601763
if ( m_bFadingOut == true )
17611764
{
17621765
int iAlpha = GetRenderColor().a;
1763-
int iFadeSpeed = 600.0f;
1766+
int iFadeSpeed = (g_RagdollLVManager.IsLowViolence()) ? g_ragdoll_lvfadespeed.GetInt() : g_ragdoll_fadespeed.GetInt();
17641767

1765-
iAlpha = MAX( iAlpha - ( iFadeSpeed * gpGlobals->frametime ), 0 );
1768+
if (iFadeSpeed < 1)
1769+
{
1770+
iAlpha = 0;
1771+
}
1772+
else
1773+
{
1774+
iAlpha = MAX(iAlpha - (iFadeSpeed * gpGlobals->frametime), 0);
1775+
}
17661776

17671777
SetRenderMode( kRenderTransAlpha );
17681778
SetRenderColorA( iAlpha );
@@ -1782,14 +1792,22 @@ void C_TFRagdoll::ClientThink( void )
17821792
{
17831793
m_bFadingOut = true;
17841794
float flDelay = cl_ragdoll_fade_time.GetFloat() * 0.33f;
1785-
m_fDeathTime = gpGlobals->curtime + flDelay;
17861795

17871796
RemoveAllDecals();
1788-
}
17891797

1790-
// Fade out after the specified delay.
1791-
StartFadeOut( cl_ragdoll_fade_time.GetFloat() * 0.33f );
1792-
return;
1798+
if (flDelay > 0.01f)
1799+
{
1800+
m_fDeathTime = gpGlobals->curtime + flDelay;
1801+
return;
1802+
}
1803+
m_fDeathTime = -1;
1804+
}
1805+
else
1806+
{
1807+
// Fade out after the specified delay.
1808+
StartFadeOut(cl_ragdoll_fade_time.GetFloat() * 0.33f);
1809+
return;
1810+
}
17931811
}
17941812

17951813
// Remove us if our death time has passed.
@@ -8001,7 +8019,7 @@ void C_TFPlayer::DropWearable( C_TFWearable *pItem, const breakablepropparams_t
80018019
}
80028020

80038021
pEntity->m_nSkin = m_nSkin;
8004-
pEntity->StartFadeOut( 15.0f );
8022+
pEntity->StartFadeOut( cl_ragdoll_fade_time.GetFloat());
80058023

80068024
IPhysicsObject *pPhysicsObject = pEntity->VPhysicsGetObject();
80078025
if ( !pPhysicsObject )

0 commit comments

Comments
 (0)