[Scummvm-git-logs] scummvm master -> 15d85c2f00f700df2e547e4181685e4368d55a8b

bluegr noreply at scummvm.org
Mon Sep 11 20:16:45 UTC 2023


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:
15d85c2f00 TINSEL: Initialize remaining sound reels when loading old save


Commit: 15d85c2f00f700df2e547e4181685e4368d55a8b
    https://github.com/scummvm/scummvm/commit/15d85c2f00f700df2e547e4181685e4368d55a8b
Author: PushmePullyu (127053144+PushmePullyu at users.noreply.github.com)
Date: 2023-09-11T23:16:41+03:00

Commit Message:
TINSEL: Initialize remaining sound reels when loading old save

Changed paths:
    engines/tinsel/saveload.cpp


diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp
index 6b01a2640e3..7ed00a73ea3 100644
--- a/engines/tinsel/saveload.cpp
+++ b/engines/tinsel/saveload.cpp
@@ -341,6 +341,11 @@ static void syncSavedData(Common::Serializer &s, SAVED_DATA &sd, int numInterp,
 		int numReels = s.getVersion() >= 4 ? MAX_SOUNDREELS : 5;
 		for (int i = 0; i < numReels; ++i)
 			syncSoundReel(s, sd.SavedSoundReels[i]);
+		// For old saves we zero the remaining sound reels
+		if (s.isLoading() && numReels < MAX_SOUNDREELS) {
+			const auto reelSize = sizeof sd.SavedSoundReels[0];
+			memset(&sd.SavedSoundReels[numReels], 0, reelSize * (MAX_SOUNDREELS - numReels));
+		}
 	}
 }
 




More information about the Scummvm-git-logs mailing list