[Scummvm-git-logs] scummvm master -> 0ef1cf7be99a7b41776e0afdf2560af2ed44a601

neuromancer noreply at scummvm.org
Wed Dec 10 18:27:43 UTC 2025


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

Summary:
0ef1cf7be9 PRIVATE: Resume background music after pausing


Commit: 0ef1cf7be99a7b41776e0afdf2560af2ed44a601
    https://github.com/scummvm/scummvm/commit/0ef1cf7be99a7b41776e0afdf2560af2ed44a601
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2025-12-10T19:27:40+01:00

Commit Message:
PRIVATE: Resume background music after pausing

Fixes bug #16351

Changed paths:
    engines/private/private.cpp
    engines/private/private.h
    engines/private/savegame.h


diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index 4de87538983..a093ebcf75c 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -911,6 +911,9 @@ void PrivateEngine::selectPauseGame(Common::Point mousePos) {
 					_videoDecoder->pauseVideo(true);
 					_pausedVideo = _videoDecoder;
 				}
+
+				_pausedBackgroundSound = _backgroundSound;
+
 				_compositeSurface->fillRect(_screenRect, 0);
 				_compositeSurface->setPalette(_framePalette, 0, 256);
 				_origin = Common::Point(kOriginZero[0], kOriginZero[1]);
@@ -936,6 +939,11 @@ void PrivateEngine::resumeGame() {
 		_videoDecoder->pauseVideo(false);
 		_needToDrawScreenFrame = true;
 	}
+
+	if (!_pausedBackgroundSound.empty()) {
+		playSound(_pausedBackgroundSound, 0, false, true);
+		_pausedBackgroundSound.clear();
+	}
 }
 
 
@@ -1909,6 +1917,8 @@ void PrivateEngine::restartGame() {
 	_AMRadio.clear();
 	_policeRadio.clear();
 	_phones.clear();
+	_backgroundSound.clear();
+	_pausedBackgroundSound.clear();
 
 	// Movies
 	_repeatedMovieExit = "";
@@ -2089,6 +2099,13 @@ Common::Error PrivateEngine::loadGameStream(Common::SeekableReadStream *stream)
 	else
 		_nextSetting = getPauseMovieSetting();
 
+	// Sounds
+	if (meta.version >= 4) {
+		_pausedBackgroundSound = stream->readString();
+	} else {
+		_pausedBackgroundSound.clear();
+	}
+
 	return Common::kNoError;
 }
 
@@ -2235,6 +2252,10 @@ Common::Error PrivateEngine::saveGameStream(Common::WriteStream *stream, bool is
 	else
 		stream->writeUint32LE(0);
 
+	// Sounds
+	stream->writeString(_pausedBackgroundSound);
+	stream->writeByte(0);
+
 	return Common::kNoError;
 }
 
@@ -2275,6 +2296,7 @@ void PrivateEngine::playSound(const Common::String &name, uint loops, bool stopO
 	if (background) {
 		_mixer->stopHandle(_bgSoundHandle);
 		sh = &_bgSoundHandle;
+		_backgroundSound = name;
 	} else {
 		_mixer->stopHandle(_fgSoundHandle);
 		_mixer->stopHandle(_phoneCallSoundHandle);
@@ -2498,6 +2520,7 @@ void PrivateEngine::stopSound(bool all) {
 
 	if (all) {
 		_mixer->stopHandle(_bgSoundHandle);
+		_backgroundSound.clear();
 	}
 }
 
diff --git a/engines/private/private.h b/engines/private/private.h
index 510813f0ead..e1ee30be906 100644
--- a/engines/private/private.h
+++ b/engines/private/private.h
@@ -444,6 +444,8 @@ public:
 	bool isSoundActive();
 	void waitForSoundToStop();
 	bool _noStopSounds;
+	Common::String _backgroundSound;
+	Common::String _pausedBackgroundSound;
 
 	Common::String getPaperShuffleSound();
 	Common::String _globalAudioPath;
diff --git a/engines/private/savegame.h b/engines/private/savegame.h
index f606d9fb823..a6f59d437d3 100644
--- a/engines/private/savegame.h
+++ b/engines/private/savegame.h
@@ -36,13 +36,14 @@ namespace Private {
 //
 // Version - new/changed feature
 // =============================
+//       4 - _pausedBackgroundSound (December 2025)
 //       3 - Radio detailed state (December 2025)
 //       2 - Phone clip detailed state (December 2025)
 //       1 - Metadata header and more game state (November 2025)
 //
 // Earlier versions did not have a header and not supported.
 
-const uint16 kCurrentSavegameVersion = 3;
+const uint16 kCurrentSavegameVersion = 4;
 const uint16 kMinimumSavegameVersion = 3;
 
 struct SavegameMetadata {




More information about the Scummvm-git-logs mailing list