mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-28 05:11:34 +00:00
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:
parent
76be77b93a
commit
b330dc2394
3 changed files with 5 additions and 2 deletions
|
@ -3955,6 +3955,7 @@ static void Command_RestartAudio_f(void)
|
|||
return;
|
||||
|
||||
S_StopMusic();
|
||||
S_StopSounds();
|
||||
I_ShutdownMusic();
|
||||
I_ShutdownSound();
|
||||
I_StartupSound();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue