mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
Fix issue #72 (where closed captioning jingles didn't account for pausing).
This commit is contained in:
parent
7fb2e6633e
commit
f0ce22edb6
2 changed files with 24 additions and 14 deletions
|
@ -959,21 +959,27 @@ void S_UpdateSounds(void)
|
|||
notinlevel:
|
||||
I_UpdateSound();
|
||||
|
||||
for (i = 0; i < NUMCAPTIONS; i++) // update captions
|
||||
{
|
||||
if (!closedcaptions[i].s)
|
||||
continue;
|
||||
boolean gamestopped = (paused || P_AutoPause());
|
||||
for (i = 0; i < NUMCAPTIONS; i++) // update captions
|
||||
{
|
||||
if (!closedcaptions[i].s)
|
||||
continue;
|
||||
|
||||
if (!(--closedcaptions[i].t))
|
||||
{
|
||||
closedcaptions[i].c = NULL;
|
||||
closedcaptions[i].s = NULL;
|
||||
}
|
||||
else if (closedcaptions[i].c && !I_SoundIsPlaying(closedcaptions[i].c->handle))
|
||||
{
|
||||
closedcaptions[i].c = NULL;
|
||||
if (closedcaptions[i].t > CAPTIONFADETICS)
|
||||
closedcaptions[i].t = CAPTIONFADETICS;
|
||||
if (i == 0 && (closedcaptions[0].s-S_sfx == sfx_None) && gamestopped)
|
||||
continue;
|
||||
|
||||
if (!(--closedcaptions[i].t))
|
||||
{
|
||||
closedcaptions[i].c = NULL;
|
||||
closedcaptions[i].s = NULL;
|
||||
}
|
||||
else if (closedcaptions[i].c && !I_SoundIsPlaying(closedcaptions[i].c->handle))
|
||||
{
|
||||
closedcaptions[i].c = NULL;
|
||||
if (closedcaptions[i].t > CAPTIONFADETICS)
|
||||
closedcaptions[i].t = CAPTIONFADETICS;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "i_sound.h" // closed captions
|
||||
#include "s_sound.h" // ditto
|
||||
#include "g_game.h" // ditto
|
||||
#include "p_local.h" // P_AutoPause()
|
||||
|
||||
|
||||
#if defined (USEASM) && !defined (NORUSEASM)//&& (!defined (_MSC_VER) || (_MSC_VER <= 1200))
|
||||
|
@ -444,6 +445,7 @@ void SCR_DisplayTicRate(void)
|
|||
void SCR_ClosedCaptions(void)
|
||||
{
|
||||
UINT8 i;
|
||||
boolean gamestopped = (paused || P_AutoPause());
|
||||
|
||||
for (i = 0; i < NUMCAPTIONS; i++)
|
||||
{
|
||||
|
@ -454,7 +456,9 @@ void SCR_ClosedCaptions(void)
|
|||
if (!closedcaptions[i].s)
|
||||
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;
|
||||
|
||||
flags = V_NOSCALESTART|V_ALLOWLOWERCASE;
|
||||
|
|
Loading…
Reference in a new issue