[Scummvm-git-logs] scummvm master -> 35daa692aff1cb2d6aa0cbca3480fa8c50be55c6

antoniou79 antoniou at cti.gr
Fri May 31 15:56:29 CEST 2019


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

Summary:
3557570c4c BLADERUNNER: Set gate to UG18 as locked only in Hard mode
2b2c8d6f93 BLADERUNNER: Add areas in HC01 for animoids comment
35daa692af BLADERUNNER: Fix bad timer initialization for actors after LOAD


Commit: 3557570c4c5e584338eb489686224c4dfca31c2b
    https://github.com/scummvm/scummvm/commit/3557570c4c5e584338eb489686224c4dfca31c2b
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2019-05-31T16:43:10+03:00

Commit Message:
BLADERUNNER: Set gate to UG18 as locked only in Hard mode

This as before is only for the enhanced version

Changed paths:
    engines/bladerunner/script/scene/ug13.cpp


diff --git a/engines/bladerunner/script/scene/ug13.cpp b/engines/bladerunner/script/scene/ug13.cpp
index ea4e4f5..239c32d 100644
--- a/engines/bladerunner/script/scene/ug13.cpp
+++ b/engines/bladerunner/script/scene/ug13.cpp
@@ -234,11 +234,11 @@ bool SceneScriptUG13::ClickedOnExit(int exitId) {
 			Loop_Actor_Travel_Stairs(kActorMcCoy, 11, true, kAnimationModeIdle);
 			Footstep_Sound_Override_Off();
 			// This path is unreachable in the original game
-			// TEST maybe restore this condition. Probably occurs before meeting with Guzza is set
-			if (_vm->_cutContent) {
+			// Restore this condition only for hard mode. Probably occurs before meeting with Guzza is set
+			if (_vm->_cutContent && Query_Difficulty_Level() == kGameDifficultyHard) {
 				if (!Game_Flag_Query(kFlagCallWithGuzza)) {
 					// Passage to UG18 is locked
-					// This two lines of dialogue is not in the code of the original game
+					// These lines of dialogue are not in the code of the original game
 					if (Actor_Query_Goal_Number(kActorTransient) == 391
 					    || Actor_Query_Goal_Number(kActorTransient) == 395
 					    || Actor_Query_Goal_Number(kActorTransient) == 599


Commit: 2b2c8d6f9390229c7dd9a5cc805641979bea6b64
    https://github.com/scummvm/scummvm/commit/2b2c8d6f9390229c7dd9a5cc805641979bea6b64
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2019-05-31T16:43:10+03:00

Commit Message:
BLADERUNNER: Add areas in HC01 for animoids comment

Changed paths:
    engines/bladerunner/game_constants.h
    engines/bladerunner/script/scene/hc01.cpp


diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index 1fe3767..f802969 100644
--- a/engines/bladerunner/game_constants.h
+++ b/engines/bladerunner/game_constants.h
@@ -551,7 +551,7 @@ enum Flags {
 	kFlagHC04toHC02 = 109,
 	kFlagHC02toHC04 = 110,
 	kFlagPS07KleinTalkClues = 111,
-	// 112 is never used
+	kFlagMcCoyCommentsOnAnimoids = 112,  // Re-purposed. Original: 112 is never used
 	kFlagScorpionsInAR02 = 113,   // Re-purposed. Original: 113 is never used
 	kFlagRC03toRC01 = 114,
 	kFlagRC01toRC03 = 115,
diff --git a/engines/bladerunner/script/scene/hc01.cpp b/engines/bladerunner/script/scene/hc01.cpp
index 5c25d92..5fa6721 100644
--- a/engines/bladerunner/script/scene/hc01.cpp
+++ b/engines/bladerunner/script/scene/hc01.cpp
@@ -39,6 +39,10 @@ void SceneScriptHC01::InitializeScene() {
 		Scene_Exit_Add_2D_Exit(1, 394, 229, 485, 371, 1);
 	}
 	Scene_Exit_Add_2D_Exit(2, 117, 0, 286, 319, 0);
+	if (_vm->_cutContent && !Game_Flag_Query(kFlagMcCoyCommentsOnAnimoids)) {
+		Scene_2D_Region_Add(0, 110, 385, 200, 450); // cage 1
+		Scene_2D_Region_Add(1, 20, 249, 110, 319);  // cage 2
+	}
 
 	Ambient_Sounds_Add_Looping_Sound(kSfxRAINAWN1, 50, 50, 0);
 	Ambient_Sounds_Add_Looping_Sound(kSfxHCLOOP1,  50, 50, 0);
@@ -191,6 +195,18 @@ bool SceneScriptHC01::ClickedOnExit(int exitId) {
 }
 
 bool SceneScriptHC01::ClickedOn2DRegion(int region) {
+	if (_vm->_cutContent) {
+		if (!Game_Flag_Query(kFlagMcCoyCommentsOnAnimoids) && (region == 0 || region == 1) ) {
+			Game_Flag_Set(kFlagMcCoyCommentsOnAnimoids);
+			//Actor_Face_Heading(kActorMcCoy, 389, false);
+			Actor_Face_XYZ(kActorMcCoy, 740.89f, 60.29f, 220.12f, true);
+			Actor_Voice_Over(890, kActorVoiceOver);
+			Actor_Voice_Over(900, kActorVoiceOver);
+			Scene_2D_Region_Remove(0);
+			Scene_2D_Region_Remove(1);
+			return true;
+		}
+	}
 	return false;
 }
 


Commit: 35daa692aff1cb2d6aa0cbca3480fa8c50be55c6
    https://github.com/scummvm/scummvm/commit/35daa692aff1cb2d6aa0cbca3480fa8c50be55c6
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2019-05-31T16:43:10+03:00

Commit Message:
BLADERUNNER: Fix bad timer initialization for actors after LOAD

Changed paths:
    engines/bladerunner/actor.cpp
    engines/bladerunner/bladerunner.cpp
    engines/bladerunner/time.cpp
    engines/bladerunner/time.h


diff --git a/engines/bladerunner/actor.cpp b/engines/bladerunner/actor.cpp
index 1c87d8e..dd5650c 100644
--- a/engines/bladerunner/actor.cpp
+++ b/engines/bladerunner/actor.cpp
@@ -255,7 +255,9 @@ void Actor::timerUpdate(int timerId) {
 	if (_timersLeft[timerId] <= 0) {
 		switch (timerId) {
 		case kActorTimerAIScriptCustomTask0:
+			// fall through
 		case kActorTimerAIScriptCustomTask1:
+			// fall through
 		case kActorTimerAIScriptCustomTask2:
 			if (!_vm->_aiScripts->isInsideScript() && !_vm->_sceneScript->isInsideScript()) {
 				_vm->_aiScripts->timerExpired(_id, timerId);
@@ -1397,6 +1399,7 @@ void Actor::save(SaveFileWriteStream &f) {
 
 	uint32 now = _vm->_time->getPauseStart();
 	for (int i = 0; i < kActorTimers; ++i) {
+		// this effectively stores the next timeDiff to be applied to timer i (in timerUpdate)
 		f.writeInt(now - _timersLast[i]);
 	}
 
diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index 6fc8dda..3d20423 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -254,7 +254,12 @@ Common::Error BladeRunnerEngine::loadGameState(int slot) {
 	if (!BladeRunner::SaveFileManager::readHeader(*saveFile, header)) {
 		error("Invalid savegame");
 	}
+
 	setTotalPlayTime(header._playTime);
+	// this essentially does something similar with setTotalPlayTime
+	// reseting and updating Blade Runner's _pauseStart and offset before starting a loaded game
+	_time->resetPauseStart();
+
 	loadGame(*saveFile);
 
 	delete saveFile;
@@ -336,8 +341,17 @@ Common::Error BladeRunnerEngine::run() {
 			// end of additional code for gracefully handling end-game
 
 			if (ConfMan.hasKey("save_slot") && ConfMan.getInt("save_slot") != -1) {
+				// when loading from ScummVM main menu, we should emulate
+				// the Kia pause/resume in order to get a valid "current" time when the game
+				// is actually loaded (assuming delays can be introduced by a popup warning dialogue)
+				if(!_time->isLocked()) {
+					_time->pause();
+				}
 				loadGameState(ConfMan.getInt("save_slot"));
 				ConfMan.set("save_slot", "-1");
+				if(_time->isLocked()) {
+					_time->resume();
+				}
 			} else if (hasSavegames) {
 				_kia->_forceOpen = true;
 				_kia->open(kKIASectionLoad);
@@ -402,7 +416,6 @@ bool BladeRunnerEngine::startup(bool hasSavegames) {
 	_surfaceBack.create(640, 480, screenPixelFormat());
 
 	_time = new Time(this);
-
 	// Try to load the SUBTITLES.MIX first, before Startup.MIX
 	// allows overriding any identically named resources (such as the original font files and as a bonus also the TRE files for the UI and dialogue menu)
 	_subtitles = new Subtitles(this);
@@ -972,6 +985,8 @@ void BladeRunnerEngine::gameTick() {
 	_overlays->tick();
 
 	if (!inDialogueMenu) {
+		// TODO This is probably responsible for actors getting stuck in place
+		// after reaching a waypoint when dialoge menu is open
 		actorsUpdate();
 	}
 
diff --git a/engines/bladerunner/time.cpp b/engines/bladerunner/time.cpp
index 5d82a0c..ff7b6a7 100644
--- a/engines/bladerunner/time.cpp
+++ b/engines/bladerunner/time.cpp
@@ -70,4 +70,13 @@ bool Time::isLocked() {
 	return _pauseCount > 0;
 }
 
+// To be called before loading a new game, since
+// the offset should be reset to zero and _pauseStart should be current() (ie currentSystem() - _start)
+// TODO Explore if it would make sense to only use the Engine methods for time accounting (pauseEngine, get/setTotalPlatTime)
+//      or do we need separated/independent time accounting and pausing?
+void Time::resetPauseStart() {
+	_offset = 0;
+	_pauseStart = current();
+}
+
 } // End of namespace BladeRunner
diff --git a/engines/bladerunner/time.h b/engines/bladerunner/time.h
index 4e372ea..48fa23a 100644
--- a/engines/bladerunner/time.h
+++ b/engines/bladerunner/time.h
@@ -44,6 +44,7 @@ public:
 	int  getPauseStart();
 	int  resume();
 	bool isLocked();
+	void resetPauseStart();
 };
 
 } // End of namespace BladeRunner





More information about the Scummvm-git-logs mailing list