[Scummvm-git-logs] scummvm master -> 94cee9dead9e3bbea7dc7350c4071848d03c5325
dreammaster
dreammaster at scummvm.org
Sun Sep 18 18:07:42 CEST 2016
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
94cee9dead XEEN: Stop audio if intro sequence aborted
Commit: 94cee9dead9e3bbea7dc7350c4071848d03c5325
https://github.com/scummvm/scummvm/commit/94cee9dead9e3bbea7dc7350c4071848d03c5325
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-09-18T12:07:34-04:00
Commit Message:
XEEN: Stop audio if intro sequence aborted
Changed paths:
engines/xeen/music.cpp
engines/xeen/sound.cpp
engines/xeen/sound.h
engines/xeen/xeen.cpp
diff --git a/engines/xeen/music.cpp b/engines/xeen/music.cpp
index ef6bb62..ba6ba17 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 64858df..3896fec 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 71d44e6..c45d4e4 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 a07bf1b..76eb1b6 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())
More information about the Scummvm-git-logs
mailing list