Made updating the captions a part of S_UpdateSound(), not SCR_ClosedCaptions() (which really should have been render-only all along).

This commit is contained in:
toasterbabe 2017-04-28 22:46:21 +01:00
parent 2d9c37d800
commit deba4dcf0d
2 changed files with 24 additions and 25 deletions

View file

@ -813,6 +813,7 @@ 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;
@ -840,9 +841,7 @@ void S_UpdateSounds(void)
I_UpdateMumble(NULL, listener); I_UpdateMumble(NULL, listener);
#endif #endif
// Stop cutting FMOD out. WE'RE sick of it. goto notinlevel;
I_UpdateSound();
return;
} }
if (dedicated || nosound) if (dedicated || nosound)
@ -881,8 +880,7 @@ void S_UpdateSounds(void)
if (hws_mode != HWS_DEFAULT_MODE) if (hws_mode != HWS_DEFAULT_MODE)
{ {
HW3S_UpdateSources(); HW3S_UpdateSources();
I_UpdateSound(); goto notinlevel;
return;
} }
#endif #endif
@ -970,7 +968,28 @@ void S_UpdateSounds(void)
} }
} }
notinlevel:
I_UpdateSound(); 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) void S_SetSfxVolume(INT32 volume)

View file

@ -442,26 +442,6 @@ void SCR_ClosedCaptions(void)
{ {
UINT8 i; 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++) for (i = 0; i < NUMCAPTIONS; i++)
{ {
if (closedcaptions[i].s) if (closedcaptions[i].s)