DD hack to pause music during a wipe

This commit is contained in:
mazmazz 2018-12-06 07:08:18 -05:00
parent 7852e418d5
commit 8933601507
2 changed files with 25 additions and 0 deletions

View file

@ -27,6 +27,10 @@
#include "d_main.h"
#include "m_misc.h" // movie mode
#ifdef _WINDOWS
#include "s_sound.h" // DD music hack
#endif
#ifdef HWRENDER
#include "hardware/hw_main.h"
#endif
@ -337,6 +341,16 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu)
UINT8 wipeframe = 0;
fademask_t *fmask;
#ifdef _WINDOWS
boolean waspaused = false;
// DD HACK: Music doesn't work during wipes, so halt it before the wipe starts
if (S_MusicPlaying() && !S_MusicPaused())
{
S_PauseAudio();
waspaused = true;
}
#endif
paldiv = FixedDiv(257<<FRACBITS, 11<<FRACBITS);
// Init the wipe
@ -375,5 +389,11 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu)
M_SaveFrame();
}
WipeInAction = false;
#ifdef _WINDOWS
// DD HACK: Music doesn't work during wipes, so resume it after the wipe ends
if (waspaused)
S_ResumeAudio();
#endif
#endif
}

View file

@ -2712,6 +2712,11 @@ boolean P_SetupLevel(boolean skipprecip)
tic_t endtime = starttime + (3*TICRATE)/2;
tic_t nowtime;
#if defined(_WINDOWS)
// DD hack: Music doesn't work when wiping.
// Stop music now because we do a second wipe after a delay
S_StopMusic();
#endif
S_StartSound(NULL, sfx_s3kaf);
F_WipeStartScreen();