[Scummvm-git-logs] scummvm master -> 7caca98ec3adff189c5511d8381454b8a11f7927

AndywinXp noreply at scummvm.org
Fri Jan 7 10:50:23 UTC 2022


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:
7caca98ec3 SCUMM: DiMUSE: Fix code duplication


Commit: 7caca98ec3adff189c5511d8381454b8a11f7927
    https://github.com/scummvm/scummvm/commit/7caca98ec3adff189c5511d8381454b8a11f7927
Author: Andrea Boscarino (andywinxp at gmail.com)
Date: 2022-01-07T11:50:20+01:00

Commit Message:
SCUMM: DiMUSE: Fix code duplication

This also fixes theoretical edge cases in which speech in COMI could not start because the syncPtr were still allocated.
The change has been tested with all supported games (and their demos), just for good measure.

Changed paths:
    engines/scumm/imuse_digi/dimuse_tracks.cpp


diff --git a/engines/scumm/imuse_digi/dimuse_tracks.cpp b/engines/scumm/imuse_digi/dimuse_tracks.cpp
index afcecb15843..7cc645bf094 100644
--- a/engines/scumm/imuse_digi/dimuse_tracks.cpp
+++ b/engines/scumm/imuse_digi/dimuse_tracks.cpp
@@ -238,11 +238,7 @@ int IMuseDigital::tracksStopSound(int soundId) {
 	IMuseDigiTrack *track = _trackList;
 	do {
 		if (track->soundId == soundId) {
-			removeTrackFromList(&_trackList, track);
-			dispatchRelease(track);
-			_fadesHandler->clearFadeStatus(track->soundId, -1);
-			_triggersHandler->clearTrigger(track->soundId, _emptyMarker, -1);
-			track->soundId = 0;
+			tracksClear(track);
 		}
 		track = track->next;
 	} while (track);
@@ -349,7 +345,7 @@ void IMuseDigital::tracksClear(IMuseDigiTrack *trackPtr) {
 	_fadesHandler->clearFadeStatus(trackPtr->soundId, -1);
 	_triggersHandler->clearTrigger(trackPtr->soundId, _emptyMarker, -1);
 
-	// Unlock the sound, if it's a SFX
+	// Unlock the sound, if it's loaded as a resource
 	if (trackPtr->soundId < 1000 && trackPtr->soundId) {
 		_vm->_res->unlock(rtSound, trackPtr->soundId);
 	}




More information about the Scummvm-git-logs mailing list