Do not set cvars with S_SetSfxVolume or S_SetMusicVolume

Don't do this because in sdl/i_video.cpp,
S_InitMusicVolume is called to unmute music when the
window is refocused. Because I_StartupGraphics is called
before those cvars are added and it is an error to try to
set a cvar before it is added.
This commit is contained in:
James R 2023-02-14 01:06:08 -08:00
parent 9b08730281
commit c9ad926e76

View file

@ -989,7 +989,7 @@ void S_UpdateClosedCaptions(void)
void S_SetSfxVolume(INT32 volume)
{
CV_SetValue(&cv_soundvolume, volume);
//CV_SetValue(&cv_soundvolume, volume);
actualsfxvolume = cv_soundvolume.value * USER_VOLUME_SCALE;
#ifdef HW3SOUND
@ -2349,7 +2349,7 @@ void S_SetMusicVolume(INT32 digvolume)
if (digvolume < 0)
digvolume = cv_digmusicvolume.value;
CV_SetValue(&cv_digmusicvolume, digvolume);
//CV_SetValue(&cv_digmusicvolume, digvolume);
actualdigmusicvolume = cv_digmusicvolume.value * USER_VOLUME_SCALE;
I_SetMusicVolume(digvolume);
}