XEEN: Stop audio if intro sequence aborted

This commit is contained in:
Paul Gilbert 2016-09-18 12:07:34 -04:00
parent 5e133cdd34
commit 94cee9dead
4 changed files with 15 additions and 5 deletions

View File

@ -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) {

View File

@ -61,4 +61,10 @@ bool Sound::isPlaying() const {
return _mixer->isSoundHandleActive(_soundHandle);
}
void Sound::stopAllAudio() {
stopSong();
stopFX();
stopSound();
}
} // End of namespace Xeen

View File

@ -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

View File

@ -124,6 +124,7 @@ Common::Error XeenEngine::run() {
if (shouldQuit())
return Common::kNoError;
File::setCurrentArchive(GAME_ARCHIVE);
_sound->stopAllAudio();
showMainMenu();
if (shouldQuit())