Don't call idSoundHardware::Update() if s_noSound idCVar is set

This commit is contained in:
SRSaunders 2025-02-14 00:06:05 -05:00
parent 67c6537991
commit 397ba0b8ec
3 changed files with 10 additions and 6 deletions

View file

@ -379,9 +379,7 @@ idSoundHardware_OpenAL::Update
*/
void idSoundHardware_OpenAL::Update()
{
extern idCVar s_noSound;
if( openalDevice == NULL && !s_noSound.GetBool() )
if( openalDevice == NULL )
{
int nowTime = Sys_Milliseconds();
if( lastResetTime + 1000 < nowTime )

View file

@ -341,7 +341,10 @@ void idSoundSystemLocal::Render()
currentSoundWorld->Update();
}
hardware.Update();
if( !s_noSound.GetBool() )
{
hardware.Update();
}
// The sound system doesn't use game time or anything like that because the sounds are decoded in real time.
soundTime = Sys_Milliseconds();
@ -375,7 +378,11 @@ void idSoundSystemLocal::StopAllSounds()
sw->StopAllSounds();
}
}
hardware.Update();
if( !s_noSound.GetBool() )
{
hardware.Update();
}
}
/*

View file

@ -44,7 +44,6 @@ idCVar s_doorDistanceAdd( "s_doorDistanceAdd", "150", CVAR_FLOAT, "reduce sound
idCVar s_drawSounds( "s_drawSounds", "0", CVAR_INTEGER, "", 0, 2, idCmdSystem::ArgCompletion_Integer<0, 2> );
idCVar s_showVoices( "s_showVoices", "0", CVAR_BOOL, "show active voices" );
idCVar s_volume_dB( "s_volume_dB", "0", CVAR_ARCHIVE | CVAR_FLOAT, "volume in dB" );
extern idCVar s_noSound;
/*
========================