aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/xeen/music.cpp8
-rw-r--r--engines/xeen/sound.cpp6
-rw-r--r--engines/xeen/sound.h5
-rw-r--r--engines/xeen/xeen.cpp1
4 files changed, 15 insertions, 5 deletions
diff --git a/engines/xeen/music.cpp b/engines/xeen/music.cpp
index ef6bb6237a..ba6ba17c5e 100644
--- a/engines/xeen/music.cpp
+++ b/engines/xeen/music.cpp
@@ -212,11 +212,9 @@ void MusicDriver::playFX(uint effectId, const byte *data) {
}
void MusicDriver::stopFX() {
- if (_fxPlaying) {
- resetFX();
- _fxPlaying = false;
- _fxStartPtr = _fxDataPtr = nullptr;
- }
+ resetFX();
+ _fxPlaying = false;
+ _fxStartPtr = _fxDataPtr = nullptr;
}
void MusicDriver::playSong(const byte *data) {
diff --git a/engines/xeen/sound.cpp b/engines/xeen/sound.cpp
index 64858dfb1f..3896fec155 100644
--- a/engines/xeen/sound.cpp
+++ b/engines/xeen/sound.cpp
@@ -61,4 +61,10 @@ bool Sound::isPlaying() const {
return _mixer->isSoundHandleActive(_soundHandle);
}
+void Sound::stopAllAudio() {
+ stopSong();
+ stopFX();
+ stopSound();
+}
+
} // End of namespace Xeen
diff --git a/engines/xeen/sound.h b/engines/xeen/sound.h
index 71d44e694b..c45d4e4b95 100644
--- a/engines/xeen/sound.h
+++ b/engines/xeen/sound.h
@@ -61,6 +61,11 @@ public:
* @remarks In the original, passing 0 to playSound returned play status
*/
bool isPlaying() const;
+
+ /**
+ * Stops all playing music, FX, and sound samples
+ */
+ void stopAllAudio();
};
} // End of namespace Xeen
diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp
index a07bf1b8af..76eb1b6910 100644
--- a/engines/xeen/xeen.cpp
+++ b/engines/xeen/xeen.cpp
@@ -124,6 +124,7 @@ Common::Error XeenEngine::run() {
if (shouldQuit())
return Common::kNoError;
File::setCurrentArchive(GAME_ARCHIVE);
+ _sound->stopAllAudio();
showMainMenu();
if (shouldQuit())