[Scummvm-cvs-logs] scummvm master -> 3d373281b440d5d139fbb01ef1ffa0ad0a76b3e8

bluegr bluegr at gmail.com
Wed Jun 26 11:43:13 CEST 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
3d373281b4 NEVERHOOD: Stop sound updates while the main menu is active


Commit: 3d373281b440d5d139fbb01ef1ffa0ad0a76b3e8
    https://github.com/scummvm/scummvm/commit/3d373281b440d5d139fbb01ef1ffa0ad0a76b3e8
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-06-26T02:42:10-07:00

Commit Message:
NEVERHOOD: Stop sound updates while the main menu is active

Changed paths:
    engines/neverhood/menumodule.cpp
    engines/neverhood/neverhood.cpp
    engines/neverhood/neverhood.h



diff --git a/engines/neverhood/menumodule.cpp b/engines/neverhood/menumodule.cpp
index 368bfd6..accdaca 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 57fce58..d60d8b7 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 18f2cc9..39bc9ce 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;
 
 };
 






More information about the Scummvm-git-logs mailing list