[Scummvm-git-logs] scummvm master -> 659fdfaf9ec6fa0ca7a7397221977105f201349c

dreammaster dreammaster at scummvm.org
Tue Aug 8 01:20:14 CEST 2017


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:
659fdfaf9e VOYEUR: Workaround original game using invalid hotspot Ids


Commit: 659fdfaf9ec6fa0ca7a7397221977105f201349c
    https://github.com/scummvm/scummvm/commit/659fdfaf9ec6fa0ca7a7397221977105f201349c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-08-07T19:20:05-04:00

Commit Message:
VOYEUR: Workaround original game using invalid hotspot Ids

Changed paths:
    engines/voyeur/data.cpp
    engines/voyeur/data.h
    engines/voyeur/voyeur.cpp
    engines/voyeur/voyeur.h


diff --git a/engines/voyeur/data.cpp b/engines/voyeur/data.cpp
index 4d6e324..a9cfa02 100644
--- a/engines/voyeur/data.cpp
+++ b/engines/voyeur/data.cpp
@@ -43,7 +43,7 @@ SVoy::SVoy(VoyeurEngine *vm):_vm(vm) {
 	_abortInterface = false;
 	_isAM = false;
 	Common::fill(&_phoneCallsReceived[0], &_phoneCallsReceived[5], false);
-	Common::fill(&_roomHotspotsEnabled[0], &_roomHotspotsEnabled[20], false);
+	Common::fill(&_roomHotspotsEnabled[0], &_roomHotspotsEnabled[32], false);
 	_victimMurdered = false;
 
 	_audioVisualStartTime = 0;
@@ -118,7 +118,8 @@ void SVoy::synchronize(Common::Serializer &s) {
 	_audioHotspotTimes.synchronize(s);
 	_evidenceHotspotTimes.synchronize(s);
 
-	for (int idx = 0; idx < 20; ++idx) {
+	int count = s.getVersion() == 1 ? 20 : 32;
+	for (int idx = 0; idx < count; ++idx) {
 		s.syncAsByte(_roomHotspotsEnabled[idx]);
 	}
 
diff --git a/engines/voyeur/data.h b/engines/voyeur/data.h
index a18ad84..e7bdb63 100644
--- a/engines/voyeur/data.h
+++ b/engines/voyeur/data.h
@@ -113,7 +113,7 @@ public:
 	bool _abortInterface;
 	bool _isAM;
 	bool _phoneCallsReceived[5];
-	bool _roomHotspotsEnabled[20];
+	bool _roomHotspotsEnabled[32];
 	bool _victimMurdered;
 
 	int _aptLoadMode;
diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp
index 01b76a7..7f2f0e3 100644
--- a/engines/voyeur/voyeur.cpp
+++ b/engines/voyeur/voyeur.cpp
@@ -793,6 +793,7 @@ void VoyeurEngine::loadGame(int slot) {
 		header._thumbnail->free();
 	delete header._thumbnail;
 
+	serializer.setVersion(header._version);
 	synchronize(serializer);
 
 	delete saveFile;
@@ -821,6 +822,7 @@ Common::Error VoyeurEngine::saveGameState(int slot, const Common::String &desc)
 	Common::Serializer serializer(NULL, saveFile);
 
 	// Synchronise the data
+	serializer.setVersion(VOYEUR_SAVEGAME_VERSION);
 	synchronize(serializer);
 
 	saveFile->finalize();
diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h
index 9cda85f..dcd82b2 100644
--- a/engines/voyeur/voyeur.h
+++ b/engines/voyeur/voyeur.h
@@ -296,7 +296,7 @@ public:
 	void showEndingNews();
 };
 
-#define VOYEUR_SAVEGAME_VERSION 1
+#define VOYEUR_SAVEGAME_VERSION 2
 
 /**
  * Header for Voyeur savegame files





More information about the Scummvm-git-logs mailing list