[Scummvm-git-logs] scummvm master -> 40f57bd67b6cc3c5b106b0f6f297d466f90dc972

dreammaster noreply at scummvm.org
Sun Aug 6 23:03:24 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:
40f57bd67b TINSEL: Increase MAX_SOUNDREELS to 10, bump up savegame version


Commit: 40f57bd67b6cc3c5b106b0f6f297d466f90dc972
    https://github.com/scummvm/scummvm/commit/40f57bd67b6cc3c5b106b0f6f297d466f90dc972
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-08-06T16:03:01-07:00

Commit Message:
TINSEL: Increase MAX_SOUNDREELS to 10, bump up savegame version

Changed paths:
    NEWS.md
    engines/tinsel/play.h
    engines/tinsel/saveload.cpp


diff --git a/NEWS.md b/NEWS.md
index 75326cdcede..a248365675f 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -53,6 +53,9 @@ For a more comprehensive changelog of the latest experimental code, see:
  Sword2:
    - Added support for Chinese translation.
 
+ Tinsel:
+   - Fix running out of soundreels error.
+
  TwinE:
    - Added support for Japanese translation.
 
diff --git a/engines/tinsel/play.h b/engines/tinsel/play.h
index 1017b9e1ac0..d936e768b74 100644
--- a/engines/tinsel/play.h
+++ b/engines/tinsel/play.h
@@ -29,7 +29,7 @@
 
 namespace Tinsel {
 
-#define MAX_SOUNDREELS	5
+#define MAX_SOUNDREELS	10
 
 struct SOUNDREELS {
 	SCNHANDLE hFilm;	// The 'film'
diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp
index dd31e6f67f6..6b01a2640e3 100644
--- a/engines/tinsel/saveload.cpp
+++ b/engines/tinsel/saveload.cpp
@@ -54,7 +54,7 @@ namespace Tinsel {
  * only saves/loads those which are valid for the version of the savegame
  * which is being loaded/saved currently.
  */
-#define CURRENT_VER 3
+#define CURRENT_VER 4
 
 //----------------- EXTERN FUNCTIONS --------------------
 
@@ -337,7 +337,9 @@ static void syncSavedData(Common::Serializer &s, SAVED_DATA &sd, int numInterp,
 		s.syncAsSint32LE(sd.SavedScrollFocus);
 		for (int i = 0; i < numSystemVars; ++i)
 			s.syncAsSint32LE(sd.SavedSystemVars[i]);
-		for (int i = 0; i < MAX_SOUNDREELS; ++i)
+
+		int numReels = s.getVersion() >= 4 ? MAX_SOUNDREELS : 5;
+		for (int i = 0; i < numReels; ++i)
 			syncSoundReel(s, sd.SavedSoundReels[i]);
 	}
 }
@@ -519,6 +521,7 @@ static bool DoRestore() {
 		return false;
 	}
 
+	s.setVersion(hdr.ver);
 	if (hdr.ver >= 3)
 		_vm->setTotalPlayTime(hdr.playTime);
 	else
@@ -656,6 +659,7 @@ static void DoSave() {
 		return;
 	}
 
+	s.setVersion(hdr.ver);
 	DoSync(s, hdr.numInterpreters, SV_TOPVALID);
 
 	// Write out the special Id for Discworld savegames




More information about the Scummvm-git-logs mailing list