aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2013-06-26 12:40:54 +0300
committerFilippos Karapetis2013-06-26 12:42:10 +0300
commit3d373281b440d5d139fbb01ef1ffa0ad0a76b3e8 (patch)
tree0334907c1000feb29a908067e8f274f8ced143f8 /engines
parente26fb8e7d239052d9645aa0bfb75500ddc3aa132 (diff)
downloadscummvm-rg350-3d373281b440d5d139fbb01ef1ffa0ad0a76b3e8.tar.gz
scummvm-rg350-3d373281b440d5d139fbb01ef1ffa0ad0a76b3e8.tar.bz2
scummvm-rg350-3d373281b440d5d139fbb01ef1ffa0ad0a76b3e8.zip
NEVERHOOD: Stop sound updates while the main menu is active
Diffstat (limited to 'engines')
-rw-r--r--engines/neverhood/menumodule.cpp2
-rw-r--r--engines/neverhood/neverhood.cpp11
-rw-r--r--engines/neverhood/neverhood.h5
3 files changed, 14 insertions, 4 deletions
diff --git a/engines/neverhood/menumodule.cpp b/engines/neverhood/menumodule.cpp
index 368bfd60a7..accdaca63f 100644
--- a/engines/neverhood/menumodule.cpp
+++ b/engines/neverhood/menumodule.cpp
@@ -73,12 +73,14 @@ MenuModule::MenuModule(NeverhoodEngine *vm, Module *parentModule, int which)
_savedPaletteData = _vm->_screen->getPaletteData();
_vm->_mixer->pauseAll(true);
+ _vm->toggleSoundUpdate(false);
createScene(MAIN_MENU, -1);
}
MenuModule::~MenuModule() {
_vm->_mixer->pauseAll(false);
+ _vm->toggleSoundUpdate(true);
_vm->_screen->setPaletteData(_savedPaletteData);
}
diff --git a/engines/neverhood/neverhood.cpp b/engines/neverhood/neverhood.cpp
index 57fce58b94..d60d8b760f 100644
--- a/engines/neverhood/neverhood.cpp
+++ b/engines/neverhood/neverhood.cpp
@@ -105,7 +105,8 @@ Common::Error NeverhoodEngine::run() {
_gameModule = new GameModule(this);
_isSaveAllowed = true;
-
+ _updateSound = true;
+
if (isDemo()) {
// Adjust this navigation list for the demo version
NavigationList *navigationList = _staticData->getNavigationList(0x004B67E8);
@@ -186,8 +187,12 @@ void NeverhoodEngine::mainLoop() {
_screen->update();
nextFrameTime = _screen->getNextFrameTime();
};
- _soundMan->update();
- _audioResourceMan->updateMusic();
+
+ if (_updateSound) {
+ _soundMan->update();
+ _audioResourceMan->updateMusic();
+ }
+
_system->updateScreen();
_system->delayMillis(10);
}
diff --git a/engines/neverhood/neverhood.h b/engines/neverhood/neverhood.h
index 18f2cc9f64..39bc9cef2c 100644
--- a/engines/neverhood/neverhood.h
+++ b/engines/neverhood/neverhood.h
@@ -134,7 +134,10 @@ public:
int16 getMouseY() const { return _mouseY; }
NPoint getMousePos();
-public:
+ void toggleSoundUpdate(bool state) { _updateSound = state; }
+
+private:
+ bool _updateSound;
};