Fix issue #72 (where closed captioning jingles didn't account for pausing).

This commit is contained in:
toasterbabe 2017-09-25 20:35:04 +01:00
parent 7fb2e6633e
commit f0ce22edb6
2 changed files with 24 additions and 14 deletions

View File

@ -959,21 +959,27 @@ void S_UpdateSounds(void)
notinlevel: notinlevel:
I_UpdateSound(); I_UpdateSound();
for (i = 0; i < NUMCAPTIONS; i++) // update captions
{ {
if (!closedcaptions[i].s) boolean gamestopped = (paused || P_AutoPause());
continue; for (i = 0; i < NUMCAPTIONS; i++) // update captions
{
if (!closedcaptions[i].s)
continue;
if (!(--closedcaptions[i].t)) if (i == 0 && (closedcaptions[0].s-S_sfx == sfx_None) && gamestopped)
{ continue;
closedcaptions[i].c = NULL;
closedcaptions[i].s = NULL; if (!(--closedcaptions[i].t))
} {
else if (closedcaptions[i].c && !I_SoundIsPlaying(closedcaptions[i].c->handle)) closedcaptions[i].c = NULL;
{ closedcaptions[i].s = NULL;
closedcaptions[i].c = NULL; }
if (closedcaptions[i].t > CAPTIONFADETICS) else if (closedcaptions[i].c && !I_SoundIsPlaying(closedcaptions[i].c->handle))
closedcaptions[i].t = CAPTIONFADETICS; {
closedcaptions[i].c = NULL;
if (closedcaptions[i].t > CAPTIONFADETICS)
closedcaptions[i].t = CAPTIONFADETICS;
}
} }
} }
} }

View File

@ -31,6 +31,7 @@
#include "i_sound.h" // closed captions #include "i_sound.h" // closed captions
#include "s_sound.h" // ditto #include "s_sound.h" // ditto
#include "g_game.h" // ditto #include "g_game.h" // ditto
#include "p_local.h" // P_AutoPause()
#if defined (USEASM) && !defined (NORUSEASM)//&& (!defined (_MSC_VER) || (_MSC_VER <= 1200)) #if defined (USEASM) && !defined (NORUSEASM)//&& (!defined (_MSC_VER) || (_MSC_VER <= 1200))
@ -444,6 +445,7 @@ void SCR_DisplayTicRate(void)
void SCR_ClosedCaptions(void) void SCR_ClosedCaptions(void)
{ {
UINT8 i; UINT8 i;
boolean gamestopped = (paused || P_AutoPause());
for (i = 0; i < NUMCAPTIONS; i++) for (i = 0; i < NUMCAPTIONS; i++)
{ {
@ -454,7 +456,9 @@ void SCR_ClosedCaptions(void)
if (!closedcaptions[i].s) if (!closedcaptions[i].s)
continue; continue;
if ((music = (closedcaptions[i].s-S_sfx == sfx_None)) && (closedcaptions[i].t < flashingtics) && (closedcaptions[i].t & 1)) music = (closedcaptions[i].s-S_sfx == sfx_None);
if (music && !gamestopped && (closedcaptions[i].t < flashingtics) && (closedcaptions[i].t & 1))
continue; continue;
flags = V_NOSCALESTART|V_ALLOWLOWERCASE; flags = V_NOSCALESTART|V_ALLOWLOWERCASE;