mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
Merge branch 'cc-jingles' into 'master'
Fix stuck closed captioning with no audio See merge request STJr/SRB2Internal!555
This commit is contained in:
commit
e48dea4291
3 changed files with 23 additions and 20 deletions
|
@ -667,6 +667,7 @@ void D_SRB2Loop(void)
|
||||||
|
|
||||||
// consoleplayer -> displayplayer (hear sounds from viewpoint)
|
// consoleplayer -> displayplayer (hear sounds from viewpoint)
|
||||||
S_UpdateSounds(); // move positional sounds
|
S_UpdateSounds(); // move positional sounds
|
||||||
|
S_UpdateClosedCaptions();
|
||||||
|
|
||||||
// check for media change, loop music..
|
// check for media change, loop music..
|
||||||
I_UpdateCD();
|
I_UpdateCD();
|
||||||
|
|
|
@ -860,7 +860,6 @@ static INT32 actualmidimusicvolume;
|
||||||
void S_UpdateSounds(void)
|
void S_UpdateSounds(void)
|
||||||
{
|
{
|
||||||
INT32 audible, cnum, volume, sep, pitch;
|
INT32 audible, cnum, volume, sep, pitch;
|
||||||
UINT8 i;
|
|
||||||
channel_t *c;
|
channel_t *c;
|
||||||
|
|
||||||
listener_t listener;
|
listener_t listener;
|
||||||
|
@ -1017,28 +1016,30 @@ void S_UpdateSounds(void)
|
||||||
|
|
||||||
notinlevel:
|
notinlevel:
|
||||||
I_UpdateSound();
|
I_UpdateSound();
|
||||||
|
}
|
||||||
|
|
||||||
|
void S_UpdateClosedCaptions(void)
|
||||||
|
{
|
||||||
|
UINT8 i;
|
||||||
|
boolean gamestopped = (paused || P_AutoPause());
|
||||||
|
for (i = 0; i < NUMCAPTIONS; i++) // update captions
|
||||||
{
|
{
|
||||||
boolean gamestopped = (paused || P_AutoPause());
|
if (!closedcaptions[i].s)
|
||||||
for (i = 0; i < NUMCAPTIONS; i++) // update captions
|
continue;
|
||||||
|
|
||||||
|
if (i == 0 && (closedcaptions[0].s-S_sfx == sfx_None) && gamestopped)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!(--closedcaptions[i].t))
|
||||||
{
|
{
|
||||||
if (!closedcaptions[i].s)
|
closedcaptions[i].c = NULL;
|
||||||
continue;
|
closedcaptions[i].s = NULL;
|
||||||
|
}
|
||||||
if (i == 0 && (closedcaptions[0].s-S_sfx == sfx_None) && gamestopped)
|
else if (closedcaptions[i].c && !I_SoundIsPlaying(closedcaptions[i].c->handle))
|
||||||
continue;
|
{
|
||||||
|
closedcaptions[i].c = NULL;
|
||||||
if (!(--closedcaptions[i].t))
|
if (closedcaptions[i].t > CAPTIONFADETICS)
|
||||||
{
|
closedcaptions[i].t = CAPTIONFADETICS;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -303,6 +303,7 @@ boolean S_FadeOutStopMusic(UINT32 ms);
|
||||||
// Updates music & sounds
|
// Updates music & sounds
|
||||||
//
|
//
|
||||||
void S_UpdateSounds(void);
|
void S_UpdateSounds(void);
|
||||||
|
void S_UpdateClosedCaptions(void);
|
||||||
|
|
||||||
FUNCMATH fixed_t S_CalculateSoundDistance(fixed_t px1, fixed_t py1, fixed_t pz1, fixed_t px2, fixed_t py2, fixed_t pz2);
|
FUNCMATH fixed_t S_CalculateSoundDistance(fixed_t px1, fixed_t py1, fixed_t pz1, fixed_t px2, fixed_t py2, fixed_t pz2);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue