[Scummvm-git-logs] scummvm master -> 297ebb73e0e922c635397086cdca46cd8d00c74b

antoniou79 antoniou at cti.gr
Wed May 15 21:59:28 CEST 2019


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
2d992a4430 BLADERUNNER: Fix sounds persist after load or end state
297ebb73e0 BLADERUNNER: Warning if loading restored cut content save in original mode


Commit: 2d992a44309cfbe033d6a02c32db4183bf7ac978
    https://github.com/scummvm/scummvm/commit/2d992a44309cfbe033d6a02c32db4183bf7ac978
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2019-05-15T22:53:45+03:00

Commit Message:
BLADERUNNER: Fix sounds persist after load or end state

Loading a game with music from a scene with music would cause none of the music to be removed.

Also looping sounds would persist in the loading screen after a game-over state

Changed paths:
    engines/bladerunner/bladerunner.cpp


diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index 3d2a649..44a59e1 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -1863,6 +1863,14 @@ void BladeRunnerEngine::playerGainsControl() {
 void BladeRunnerEngine::playerDied() {
 	playerLosesControl();
 
+#if BLADERUNNER_ORIGINAL_BUGS
+#else
+	_ambientSounds->removeAllNonLoopingSounds(true);
+	_ambientSounds->removeAllLoopingSounds(4);
+	_music->stop(4);
+	_audioSpeech->stopSpeech();
+#endif // BLADERUNNER_ORIGINAL_BUGS
+
 	int timeWaitEnd = _time->current() + 5000;
 	while (_time->current() < timeWaitEnd) {
 		gameTick();
@@ -1946,8 +1954,15 @@ bool BladeRunnerEngine::loadGame(Common::SeekableReadStream &stream) {
 	SaveFileReadStream s(stream);
 
 	_ambientSounds->removeAllNonLoopingSounds(true);
+#if BLADERUNNER_ORIGINAL_BUGS
 	_ambientSounds->removeAllLoopingSounds(1);
 	_music->stop(2);
+#else
+	// loading into another game that also has music would
+	// two music tracks to overlap and none was stopped
+	_ambientSounds->removeAllLoopingSounds(0);
+	_music->stop(0);
+#endif // BLADERUNNER_ORIGINAL_BUGS
 	_audioSpeech->stopSpeech();
 	_actorDialogueQueue->flush(true, false);
 	_screenEffects->_entries.clear();


Commit: 297ebb73e0e922c635397086cdca46cd8d00c74b
    https://github.com/scummvm/scummvm/commit/297ebb73e0e922c635397086cdca46cd8d00c74b
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2019-05-15T22:53:45+03:00

Commit Message:
BLADERUNNER: Warning if loading restored cut content save in original mode

And vice versa. The game won't exit, it will continue loading but adjust the mode accordingly

Also added a incremental version number for the save games (as a global variable), for possible future use

Changed paths:
    engines/bladerunner/bladerunner.cpp
    engines/bladerunner/bladerunner.h
    engines/bladerunner/game_constants.h
    engines/bladerunner/script/init_script.cpp
    engines/bladerunner/script/scene/ct02.cpp
    engines/bladerunner/script/scene/ma04.cpp


diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index 44a59e1..8cd9df7 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -1985,12 +1985,36 @@ bool BladeRunnerEngine::loadGame(Common::SeekableReadStream &stream) {
 	_scene->_set->load(s);
 	for (uint i = 0; i != _gameInfo->getGlobalVarCount(); ++i) {
 		_gameVars[i] = s.readInt();
+		if (i == 3 && _gameVars[i] != kBladeRunnerScummVMVersion) {
+			warning("This game was saved using an older version of the engine (v%d), currently the engine is at v%d", _gameVars[i], kBladeRunnerScummVMVersion);
+		}
 	}
 	_music->load(s);
 	// _audioPlayer->load(s) // zero func
 	// _audioSpeech->load(s) // zero func
 	_combat->load(s);
 	_gameFlags->load(s);
+
+	if ((_gameFlags->query(kFlagGamePlayedInRestoredContentMode) && !_cutContent)
+	    || (!_gameFlags->query(kFlagGamePlayedInRestoredContentMode) && _cutContent)
+	){
+		Common::String warningMsg;
+		if (!_cutContent) {
+			warningMsg = "WARNING: This game was saved in Restored Cut Content mode, but you are playing in Original Content mode. The mode will be adjusted to Restored Cut Content for this session until you completely Quit the game.";
+		} else {
+			warningMsg = "WARNING: This game was saved in Original Content mode, but you are playing in Restored Cut Content mode. The mode will be adjusted to Original Content mode for this session until you completely Quit the game.";
+		}
+		GUI::MessageDialog dialog(warningMsg, "Continue", 0);
+		dialog.runModal();
+		_cutContent = !_cutContent;
+		// force a Key Up event, since we need it to remove the KIA
+		// but it's lost due to the modal dialogue
+		Common::EventManager *eventMan = _system->getEventManager();
+		Common::Event event;
+		event.type = Common::EVENT_KEYUP;
+		eventMan->pushEvent(event);
+	}
+
 	_items->load(s);
 	_sceneObjects->load(s);
 	_ambientSounds->load(s);
@@ -2018,7 +2042,6 @@ bool BladeRunnerEngine::loadGame(Common::SeekableReadStream &stream) {
 
 	_settings->setNewSetAndScene(_settings->getSet(), _settings->getScene());
 	_settings->setChapter(_settings->getChapter());
-
 	return true;
 }
 
diff --git a/engines/bladerunner/bladerunner.h b/engines/bladerunner/bladerunner.h
index 267001a..33ab032 100644
--- a/engines/bladerunner/bladerunner.h
+++ b/engines/bladerunner/bladerunner.h
@@ -110,6 +110,11 @@ public:
 	static const int kArchiveCount = 12; // +2 to original value (10) to accommodate for SUBTITLES.MIX and one extra resource file, to allow for capability of loading all VQAx.MIX and the MODE.MIX file (debug purposes)
 	static const int kActorCount = 100;
 	static const int kActorVoiceOver = kActorCount - 1;
+	// Incremental number to keep track of significant revisions of the ScummVM bladerunner engine
+	// that could potentially introduce incompatibilities with old save files or require special actions to restore compatibility
+	// This is stored in game global variable "kVariableGameVersion"
+	// Original (classic) save game files will have version number of 0
+	static const int kBladeRunnerScummVMVersion = 1; // 1: alpha testing (since May 15, 2019)
 
 	bool _gameIsRunning;
 	bool _windowIsActive;
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index 1670b19..c1163a8 100644
--- a/engines/bladerunner/game_constants.h
+++ b/engines/bladerunner/game_constants.h
@@ -441,7 +441,7 @@ enum SpinnerDestinations {
 enum Flags {
 	kFlagNotUsed0 = 0, // is never checked
 	kFlagRC02Entered = 1,
-	// 2 is never used
+	kFlagGamePlayedInRestoredContentMode = 2, // Re-purposed. Original: 2 is never used
 	kFlagRC01GotOfficersStatement = 3,
 	kFlagRC02Left = 4,
 	// 5 is never used
@@ -1174,7 +1174,8 @@ enum Flags {
 enum Variables {
 	kVariableChapter = 1,
 	kVariableChinyen = 2,
-	// variables 3 - 8 are not used
+	kVariableGameVersion = 3, // re-purposed, original: not used, so it would have value of 0 in the classic version
+	// variables 4 - 8 are not used
 	kVariablePoliceMazeScore = 9,
 	kVariablePoliceMazePS10TargetCounter = 10,
 	kVariablePoliceMazePS11TargetCounter = 11,
diff --git a/engines/bladerunner/script/init_script.cpp b/engines/bladerunner/script/init_script.cpp
index e60dbbf..aa16a3b 100644
--- a/engines/bladerunner/script/init_script.cpp
+++ b/engines/bladerunner/script/init_script.cpp
@@ -61,6 +61,7 @@ void InitScript::Init_Globals() {
 	Global_Variable_Set(kVariableGenericWalkerConfig, 2);
 	Global_Variable_Set(kVariableChapter, 1);
 	Global_Variable_Set(kVariableChinyen, 100);
+	Global_Variable_Set(kVariableGameVersion, _vm->kBladeRunnerScummVMVersion);
 
 	Set_Score(0, 0);
 	Set_Score(1, 64);
@@ -125,6 +126,10 @@ void InitScript::Init_Game_Flags() {
 
 	Game_Flag_Set(kFlagMcCoyInRunciters);
 	Game_Flag_Set(kFlagSpinnerAtRC01);
+
+	if (_vm->_cutContent) {
+		Game_Flag_Set(kFlagGamePlayedInRestoredContentMode);
+	}
 }
 
 void InitScript::Init_Clues() {
diff --git a/engines/bladerunner/script/scene/ct02.cpp b/engines/bladerunner/script/scene/ct02.cpp
index aef8e45..4657e3a 100644
--- a/engines/bladerunner/script/scene/ct02.cpp
+++ b/engines/bladerunner/script/scene/ct02.cpp
@@ -219,6 +219,9 @@ void SceneScriptCT02::dialogueWithZuben() {
 		Actor_Clue_Acquire(kActorMcCoy, kClueZubenRunsAway, true, -1);
 		Actor_Set_Goal_Number(kActorZuben, kGoalZubenCT02PushPot);
 		Game_Flag_Set(kFlagCT02PotTipped);
+		if (_vm->_cutContent) {
+			Game_Flag_Set(kFlagCT01TalkToHowieAfterZubenMissing);
+		}
 		Scene_Loop_Set_Default(kCT02LoopMainPotTipped);
 		Scene_Loop_Start_Special(kSceneLoopModeOnce, kCT02LoopTippingPot, true);
 	}
diff --git a/engines/bladerunner/script/scene/ma04.cpp b/engines/bladerunner/script/scene/ma04.cpp
index 9bf36a6..b196972 100644
--- a/engines/bladerunner/script/scene/ma04.cpp
+++ b/engines/bladerunner/script/scene/ma04.cpp
@@ -312,10 +312,6 @@ void SceneScriptMA04::PlayerWalkedIn() {
 		Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7199.0f, 955.0f, 1675.0f, 0, true, false, false);
 		Game_Flag_Set(kFlagChapter1Ending);
 
-		if (_vm->_cutContent) {
-			Game_Flag_Set(kFlagCT01TalkToHowieAfterZubenMissing);
-		}
-
 		Async_Actor_Walk_To_XYZ(kActorMcCoy, -7204.0f, 956.17f, 1568.0f, 0, false);
 		Set_Enter(kSetMA05, kSceneMA05);
 	}





More information about the Scummvm-git-logs mailing list