diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/lure/game.cpp | 8 | ||||
-rw-r--r-- | engines/lure/game.h | 1 | ||||
-rw-r--r-- | engines/lure/sound.cpp | 4 |
3 files changed, 12 insertions, 1 deletions
diff --git a/engines/lure/game.cpp b/engines/lure/game.cpp index 2f95bcb01c..b4b983bf8f 100644 --- a/engines/lure/game.cpp +++ b/engines/lure/game.cpp @@ -877,7 +877,9 @@ void Game::doSound() { _soundFlag = !_soundFlag; menu.getMenu(2).entries()[2] = sl.getString(_soundFlag ? S_SOUND_ON : S_SOUND_OFF); - Sound.setVolume(_soundFlag ? DEFAULT_VOLUME : 0); + + // Stop all currently playing sounds + Sound.killSounds(); } void Game::handleBootParam(int value) { @@ -980,6 +982,7 @@ bool Game::getYN() { void Game::saveToStream(WriteStream *stream) { stream->writeByte(_fastTextFlag); + stream->writeByte(_soundFlag); } void Game::loadFromStream(ReadStream *stream) { @@ -988,6 +991,9 @@ void Game::loadFromStream(ReadStream *stream) { _fastTextFlag = stream->readByte() != 0; menu.getMenu(2).entries()[1] = sl.getString(_fastTextFlag ? S_FAST_TEXT : S_SLOW_TEXT); + + _soundFlag = stream->readByte() != 0; + menu.getMenu(2).entries()[2] = sl.getString(_soundFlag ? S_SOUND_ON : S_SOUND_OFF); } diff --git a/engines/lure/game.h b/engines/lure/game.h index bb7c2d6d7e..078fe9b3ee 100644 --- a/engines/lure/game.h +++ b/engines/lure/game.h @@ -79,6 +79,7 @@ public: void setState(uint8 flags) { _state = flags; } bool &preloadFlag() { return _preloadFlag; } bool fastTextFlag() { return _fastTextFlag; } + bool soundFlag() { return _soundFlag; } // Menu item support methods void doDebugMenu(); diff --git a/engines/lure/sound.cpp b/engines/lure/sound.cpp index 5da2519c72..850b549519 100644 --- a/engines/lure/sound.cpp +++ b/engines/lure/sound.cpp @@ -365,6 +365,10 @@ void SoundManager::musicInterface_Play(uint8 soundNumber, uint8 channelNumber) { // Only play sounds if a sound driver is active return; + if (!Game::getReference().soundFlag()) + // Don't play sounds if sound is turned off + return; + uint32 dataOfs = READ_LE_UINT32(_soundData->data() + soundNum * 4 + 2); uint8 *soundStart = _soundData->data() + dataOfs; uint32 dataSize; |