aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-09-18 12:07:34 -0400
committerPaul Gilbert2016-09-18 12:07:34 -0400
commit94cee9dead9e3bbea7dc7350c4071848d03c5325 (patch)
tree8bbba942391d84705af4adc9c310733503810d53
parent5e133cdd344de7224edb260bd2c5531ab689e64a (diff)
downloadscummvm-rg350-94cee9dead9e3bbea7dc7350c4071848d03c5325.tar.gz
scummvm-rg350-94cee9dead9e3bbea7dc7350c4071848d03c5325.tar.bz2
scummvm-rg350-94cee9dead9e3bbea7dc7350c4071848d03c5325.zip
XEEN: Stop audio if intro sequence aborted
-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())