aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
};