Don't call I_StartupSound in SFX toggle

* Mixer: make I_StartupSound return early if already set up
* Restartaudio: Add StopSFX call
This commit is contained in:
mazmazz 2018-09-14 16:39:10 -04:00
parent 76be77b93a
commit b330dc2394
3 changed files with 5 additions and 2 deletions

View File

@ -3955,6 +3955,7 @@ static void Command_RestartAudio_f(void)
return;
S_StopMusic();
S_StopSounds();
I_ShutdownMusic();
I_ShutdownSound();
I_StartupSound();

View File

@ -6953,7 +6953,6 @@ static void M_ToggleSFX(void)
if (sound_disabled)
{
sound_disabled = false;
I_StartupSound();
S_InitSfxChannels(cv_soundvolume.value);
S_StartSound(NULL, sfx_strpst);
M_StartMessage(M_GetText("SFX Enabled\n"), NULL, MM_NOTHING);

View File

@ -82,7 +82,10 @@ void I_StartupSound(void)
// EE inits audio first so we're following along.
if (SDL_WasInit(SDL_INIT_AUDIO) == SDL_INIT_AUDIO)
CONS_Printf("SDL Audio already started\n");
{
CONS_Debug(DBG_DETAILED, "SDL Audio already started\n");
return;
}
else if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0)
{
CONS_Alert(CONS_ERROR, "Error initializing SDL Audio: %s\n", SDL_GetError());