From deba4dcf0d2a2de10c0f542f7562ef9212a835d4 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 28 Apr 2017 22:46:21 +0100 Subject: [PATCH] Made updating the captions a part of S_UpdateSound(), not SCR_ClosedCaptions() (which really should have been render-only all along). --- src/s_sound.c | 29 ++++++++++++++++++++++++----- src/screen.c | 20 -------------------- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index 3993d7f98..6ac886034 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -813,6 +813,7 @@ static INT32 actualmidimusicvolume; void S_UpdateSounds(void) { INT32 audible, cnum, volume, sep, pitch; + UINT8 i; channel_t *c; listener_t listener; @@ -840,9 +841,7 @@ void S_UpdateSounds(void) I_UpdateMumble(NULL, listener); #endif - // Stop cutting FMOD out. WE'RE sick of it. - I_UpdateSound(); - return; + goto notinlevel; } if (dedicated || nosound) @@ -881,8 +880,7 @@ void S_UpdateSounds(void) if (hws_mode != HWS_DEFAULT_MODE) { HW3S_UpdateSources(); - I_UpdateSound(); - return; + goto notinlevel; } #endif @@ -970,7 +968,28 @@ void S_UpdateSounds(void) } } +notinlevel: I_UpdateSound(); + + for (i = 0; i < NUMCAPTIONS; i++) // update captions + { + boolean cond = (closedcaptions[i].c && I_SoundIsPlaying(closedcaptions[i].c->handle)); + + if (closedcaptions[i].t <= TICRATE) + closedcaptions[i].t--; + if (cond || (closedcaptions[i].s && closedcaptions[i].t)) + { + if (!cond) + closedcaptions[i].c = NULL; + } + + if (!closedcaptions[i].t) + { + closedcaptions[i].c = NULL; + closedcaptions[i].s = NULL; + closedcaptions[i].t = 0; + } + } } void S_SetSfxVolume(INT32 volume) diff --git a/src/screen.c b/src/screen.c index 1c37f8a07..477225869 100644 --- a/src/screen.c +++ b/src/screen.c @@ -442,26 +442,6 @@ void SCR_ClosedCaptions(void) { UINT8 i; - for (i = 0; i < NUMCAPTIONS; i++) - { - boolean cond = (closedcaptions[i].c && I_SoundIsPlaying(closedcaptions[i].c->handle)); - - if (closedcaptions[i].t <= TICRATE) - closedcaptions[i].t--; - if (cond || (closedcaptions[i].s && closedcaptions[i].t)) - { - if (!cond) - closedcaptions[i].c = NULL; - } - - if (!closedcaptions[i].t) - { - closedcaptions[i].c = NULL; - closedcaptions[i].s = NULL; - closedcaptions[i].t = 0; - } - } - for (i = 0; i < NUMCAPTIONS; i++) { if (closedcaptions[i].s)