diff --git a/src/m_menu.c b/src/m_menu.c index b465adf55..183031d9f 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -8289,7 +8289,6 @@ static void M_ToggleSFX(INT32 choice) sound_disabled = true; S_StopSounds(); OP_SoundOptionsMenu[6].status = IT_GRAYEDOUT; - ResetCaptions(); //M_StartMessage(M_GetText("SFX Disabled\n"), NULL, MM_NOTHING); } } @@ -8845,6 +8844,8 @@ void M_QuitResponse(INT32 ch) return; if (!(netgame || cv_debug)) { + S_ResetCaptions(); + mrand = M_RandomKey(sizeof(quitsounds)/sizeof(INT32)); if (quitsounds[mrand]) S_StartSound(NULL, quitsounds[mrand]); diff --git a/src/s_sound.c b/src/s_sound.c index e9e61078b..3382a5d49 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -80,7 +80,7 @@ static consvar_t precachesound = {"precachesound", "Off", CV_SAVE, CV_OnOff, NUL // actual general (maximum) sound & music volume, saved into the config consvar_t cv_soundvolume = {"soundvolume", "31", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_closedcaptioning = {"closedcaptioning", "Off", CV_SAVE|CV_CALL, CV_OnOff, ResetCaptions, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_closedcaptioning = {"closedcaptioning", "Off", CV_SAVE|CV_CALL, CV_OnOff, S_ResetCaptions, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_digmusicvolume = {"digmusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_midimusicvolume = {"midimusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // number of channels available @@ -132,7 +132,7 @@ static INT32 numofchannels = 0; caption_t closedcaptions[NUMCAPTIONS]; -void ResetCaptions(void) +void S_ResetCaptions(void) { UINT8 i; for (i = 0; i < NUMCAPTIONS; i++) @@ -301,7 +301,7 @@ static void SetChannelsNum(void) for (i = 0; i < numofchannels; i++) channels[i].sfxinfo = 0; - ResetCaptions(); + S_ResetCaptions(); } @@ -344,6 +344,8 @@ void S_StopSounds(void) for (cnum = 0; cnum < numofchannels; cnum++) if (channels[cnum].sfxinfo) S_StopChannel(cnum); + + S_ResetCaptions(); } void S_StopSoundByID(void *origin, sfxenum_t sfx_id) diff --git a/src/s_sound.h b/src/s_sound.h index 724531072..4b9735480 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -22,8 +22,6 @@ // mask used to indicate sound origin is player item pickup #define PICKUP_SOUND 0x8000 -void ResetCaptions(void); - extern consvar_t stereoreverse; extern consvar_t cv_soundvolume, cv_closedcaptioning, cv_digmusicvolume, cv_midimusicvolume; extern consvar_t cv_numChannels; @@ -92,6 +90,7 @@ typedef struct { extern caption_t closedcaptions[NUMCAPTIONS]; void S_StartCaption(sfxenum_t sfx_id, INT32 cnum, UINT16 lifespan); +void S_ResetCaptions(void); // register sound vars and commands at game startup void S_RegisterSoundStuff(void);