[Scummvm-git-logs] scummvm master -> 62e02ca0dadb114b4582d26275fd6b176f47b9ca

mduggan noreply at scummvm.org
Sat Mar 15 04:20:48 UTC 2025


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:
62e02ca0da DGDS: Unload music file before loading game


Commit: 62e02ca0dadb114b4582d26275fd6b176f47b9ca
    https://github.com/scummvm/scummvm/commit/62e02ca0dadb114b4582d26275fd6b176f47b9ca
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2025-03-15T15:18:48+11:00

Commit Message:
DGDS: Unload music file before loading game

This makes sure no matter which scene is loaded the music will be loaded fresh
and restarted.

Skip in Willy Beamish where there is only one music file that stays loaded.

This fixes #15795.

Changed paths:
    engines/dgds/dgds.cpp
    engines/dgds/sound.cpp


diff --git a/engines/dgds/dgds.cpp b/engines/dgds/dgds.cpp
index 0f8aa72329a..b185b08e373 100644
--- a/engines/dgds/dgds.cpp
+++ b/engines/dgds/dgds.cpp
@@ -922,6 +922,13 @@ Common::Error DgdsEngine::syncGame(Common::Serializer &s) {
 		setMouseCursor(kDgdsMouseGameDefault);
 		_soundPlayer->stopAllSfx();
 		_soundPlayer->stopMusic();
+		//
+		// Willy Beamish has a single music file that we load on game init and keep
+		// loaded. Others will load whatever music is needed in the scene init so
+		// we should unload here.
+		//
+		if (getGameId() != GID_WILLY)
+			_soundPlayer->unloadMusic();
 		_scene->unload();
 		_scene->setDragItem(nullptr);
 		_adsInterp->unload();
diff --git a/engines/dgds/sound.cpp b/engines/dgds/sound.cpp
index b93734dffd8..8d3529bb5c6 100644
--- a/engines/dgds/sound.cpp
+++ b/engines/dgds/sound.cpp
@@ -699,7 +699,7 @@ void Sound::unloadMusic() {
 	for (auto &data: _musicData)
 		delete [] data._data;
 	_musicData.clear();
-
+	_currentMusic.clear();
 	// Don't unload sfxData.
 }
 




More information about the Scummvm-git-logs mailing list