mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-28 15:11:55 +00:00
DD hack to pause music during a wipe
This commit is contained in:
parent
7852e418d5
commit
8933601507
2 changed files with 25 additions and 0 deletions
20
src/f_wipe.c
20
src/f_wipe.c
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue