From 641ff5e9b744922f2631689df19a62d9fad5af08 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 28 Oct 2007 03:34:10 +0000 Subject: Sound is now paused when displaying menu dialogs svn-id: r29272 --- engines/lure/game.cpp | 11 +++++++++-- engines/lure/surface.cpp | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/engines/lure/game.cpp b/engines/lure/game.cpp index b4b983bf8f..aaeca3a8bd 100644 --- a/engines/lure/game.cpp +++ b/engines/lure/game.cpp @@ -839,6 +839,7 @@ void Game::doShowCredits() { Mouse &mouse = Mouse::getReference(); Screen &screen = Screen::getReference(); + Sound.pause(); mouse.cursorOff(); Palette p(CREDITS_RESOURCE_ID - 1); Surface *s = Surface::getScreen(CREDITS_RESOURCE_ID); @@ -851,16 +852,21 @@ void Game::doShowCredits() { screen.resetPalette(); screen.update(); mouse.cursorOn(); + Sound.resume(); } void Game::doQuit() { + Sound.pause(); if (getYN()) Events::getReference().quitFlag = true; + Sound.resume(); } void Game::doRestart() { + Sound.pause(); if (getYN()) setState(GS_RESTART); + Sound.resume(); } void Game::doTextSpeed() { @@ -878,8 +884,9 @@ void Game::doSound() { _soundFlag = !_soundFlag; menu.getMenu(2).entries()[2] = sl.getString(_soundFlag ? S_SOUND_ON : S_SOUND_OFF); - // Stop all currently playing sounds - Sound.killSounds(); + if (!_soundFlag) + // Stop all currently playing sounds + Sound.killSounds(); } void Game::handleBootParam(int value) { diff --git a/engines/lure/surface.cpp b/engines/lure/surface.cpp index e2a987ab5d..31d1ecf107 100644 --- a/engines/lure/surface.cpp +++ b/engines/lure/surface.cpp @@ -719,6 +719,7 @@ bool SaveRestoreDialog::show(bool saveDialog) { s->copyTo(&screen.screen(), SAVE_DIALOG_X, SAVE_DIALOG_Y); screen.update(); mouse.pushCursorNum(CURSOR_ARROW); + Sound.pause(); bool abortFlag = false; bool doneFlag = false; @@ -801,6 +802,8 @@ bool SaveRestoreDialog::show(bool saveDialog) { doneFlag = true; } + Sound.resume(); + if (doneFlag) { // Handle save or restore if (saveDialog) -- cgit v1.2.3