Browse Source

Extend window focus mute to cinematic audio

pull/3964/head
staphen 4 years ago committed by Anders Jenbo
parent
commit
a7bca3a1ec
  1. 5
      Source/diablo.cpp
  2. 16
      Source/storm/storm_svid.cpp
  3. 2
      Source/storm/storm_svid.h

5
Source/diablo.cpp

@ -63,6 +63,7 @@
#include "sound.h"
#include "stores.h"
#include "storm/storm_net.hpp"
#include "storm/storm_svid.h"
#include "themes.h"
#include "town.h"
#include "towners.h"
@ -1829,7 +1830,7 @@ bool MinimizePaused = false;
void diablo_focus_pause()
{
if (gbIsMultiplayer || MinimizePaused) {
if (!movie_playing && (gbIsMultiplayer || MinimizePaused)) {
return;
}
@ -1841,6 +1842,7 @@ void diablo_focus_pause()
LastMouseButtonAction = MouseActionType::None;
}
SVidMute();
music_mute();
MinimizePaused = true;
@ -1852,6 +1854,7 @@ void diablo_focus_unpause()
PauseMode = 0;
}
SVidUnmute();
music_unmute();
MinimizePaused = false;

16
Source/storm/storm_svid.cpp

@ -393,4 +393,20 @@ void SVidPlayEnd()
#endif
}
void SVidMute()
{
#ifndef NOSOUND
if (SVidAudioStream)
SVidAudioStream->mute();
#endif
}
void SVidUnmute()
{
#ifndef NOSOUND
if (SVidAudioStream)
SVidAudioStream->unmute();
#endif
}
} // namespace devilution

2
Source/storm/storm_svid.h

@ -5,5 +5,7 @@ namespace devilution {
bool SVidPlayBegin(const char *filename, int flags);
bool SVidPlayContinue();
void SVidPlayEnd();
void SVidMute();
void SVidUnmute();
} // namespace devilution

Loading…
Cancel
Save