[Scummvm-git-logs] scummvm master -> f9941771fbc01cff7947c885cd6db60ffe161b9c

athrxx noreply at scummvm.org
Mon Oct 14 20:49:12 UTC 2024


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:
f9941771fb SCUMM: fix pauseEngineIntern


Commit: f9941771fbc01cff7947c885cd6db60ffe161b9c
    https://github.com/scummvm/scummvm/commit/f9941771fbc01cff7947c885cd6db60ffe161b9c
Author: athrxx (athrxx at scummvm.org)
Date: 2024-10-14T22:48:01+02:00

Commit Message:
SCUMM: fix pauseEngineIntern

There was a mismatch of sound pause and
unpause counts. In particular, there was more
pausing than unpausing. So the mixer could
get stuck permanently.

I noticed this when loading from the GMM
and getting the sound driver incompatibility
warning dialog.

Changed paths:
    engines/scumm/scumm.cpp
    engines/scumm/scumm.h


diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index efd20af588c..acda5a6f563 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -3964,9 +3964,10 @@ bool ScummEngine::startManiac() {
 void ScummEngine::pauseEngineIntern(bool pause) {
 	if (pause) {
 		// Pause sound & video
-		if (_sound && canPauseSoundsDuringSave()) {
-			_oldSoundsPaused = _sound->_soundsPaused;
+		_needsSoundUnpause = false;
+		if (_sound && canPauseSoundsDuringSave() && !_sound->_soundsPaused) {
 			_sound->pauseSounds(true);
+			_needsSoundUnpause = true;
 		}
 	} else {
 #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
@@ -3981,8 +3982,8 @@ void ScummEngine::pauseEngineIntern(bool pause) {
 		_system->updateScreen();
 
 		// Resume sound & video
-		if (_sound && canPauseSoundsDuringSave())
-			_sound->pauseSounds(_oldSoundsPaused);
+		if (_sound && canPauseSoundsDuringSave() && _needsSoundUnpause)
+			_sound->pauseSounds(false);
 	}
 }
 
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 7610b569cee..c91783e0b30 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -567,7 +567,7 @@ public:
 protected:
 	VirtualMachineState vm;
 
-	bool _oldSoundsPaused = false;
+	bool _needsSoundUnpause = false;
 
 public:
 	// Constructor / Destructor




More information about the Scummvm-git-logs mailing list