[Scummvm-git-logs] scummvm master -> 8be60bb257258750e996ede49289f5a351d3ddd9

antoniou79 a.antoniou79 at gmail.com
Mon May 31 10:26:01 UTC 2021


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:
8be60bb257 BLADERUNNER: Special mark for clues shared with Mainframe


Commit: 8be60bb257258750e996ede49289f5a351d3ddd9
    https://github.com/scummvm/scummvm/commit/8be60bb257258750e996ede49289f5a351d3ddd9
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2021-05-31T13:24:05+03:00

Commit Message:
BLADERUNNER: Special mark for clues shared with Mainframe

These changes are for Restored Content

The special mark is a different background color, and applies only in KIA when hacked with Bob's hack.
Also tweaked the Mainframe voiceover reporting "no clues transferred" to refer to both uploading and downloading
and only play once at the end (when applicable)

Changed paths:
    engines/bladerunner/actor.cpp
    engines/bladerunner/actor_clues.cpp
    engines/bladerunner/actor_clues.h
    engines/bladerunner/script/scene/ps06.cpp
    engines/bladerunner/ui/kia_section_clues.cpp
    engines/bladerunner/ui/kia_section_crimes.cpp
    engines/bladerunner/ui/kia_section_suspects.cpp
    engines/bladerunner/ui/ui_scroll_box.cpp


diff --git a/engines/bladerunner/actor.cpp b/engines/bladerunner/actor.cpp
index 9598043384..0beb1a8e94 100644
--- a/engines/bladerunner/actor.cpp
+++ b/engines/bladerunner/actor.cpp
@@ -1378,7 +1378,10 @@ bool Actor::hasClue(int clueId) const {
 	return _clues->isAcquired(clueId);
 }
 
-// This method is used exclusively for transfers from and to Mainframe
+// This method is used exclusively for transfers from and to Mainframe.
+// It copies clues from this actor (_id) to a target actor (actorId).
+// Keep in mind that actors other than McCoy can also transfer clues to Mainframe (eg. Steele)
+// or retrieve from Mainframe (eg. Klein)
 // see: ScriptBase::Actor_Clues_Transfer_New_From_Mainframe()
 //      ScriptBase::Actor_Clues_Transfer_New_To_Mainframe()
 // In Restored Content it will skip transfering clues that are Intangible (default clue type)
@@ -1397,8 +1400,30 @@ bool Actor::copyClues(int actorId) {
 			if (_id == BladeRunnerEngine::kActorVoiceOver) {
 				fromActorId = _clues->getFromActorId(clueId);
 			}
+			if (_vm->_cutContent
+			    && ((_id == BladeRunnerEngine::kActorVoiceOver && actorId == kActorMcCoy)
+			        || (_id == kActorMcCoy && actorId == BladeRunnerEngine::kActorVoiceOver) )) {
+				// when transfering a clue successfully between McCoy (playerActor) and Mainframe,
+				// we mark it as such, since if McCoy later marks it as hidden (with Bob's KIA hack)
+				// the player will have some indication that this clue is already on the mainframe.
+				// Hence manually hiding it would be pointless.
+				// This, however, cannot cover the case that someone else (eg. Steele) uploaded clues
+				// to the Mainframe, which McCoy had not yet tried to download.
+				// So, eg. if Steele uploaded clueA, and McCoy also somehow acquired clueA (without synching with Mainframe)
+				// then McCoy's KIA won't "know" that the Mainframe also has this clue, until he interacts / synchs with Mainframe
+				_vm->_playerActor->_clues->setSharedWithMainframe(clueId, true);
+			}
 			otherActor->acquireClue(clueId, false, fromActorId);
 			newCluesAcquired = true;
+		} else if (_vm->_cutContent
+		           && hasClue(clueId)
+		           && otherActor->hasClue(clueId)
+		           && _vm->_crimesDatabase->getAssetType(clueId) != kClueTypeIntangible
+		           && ((_id == BladeRunnerEngine::kActorVoiceOver && actorId == kActorMcCoy)
+		               || (_id == kActorMcCoy && actorId == BladeRunnerEngine::kActorVoiceOver) )
+		) {
+			// In Restored Content also mark clues that were not exchanged, because both parties already have them
+			_vm->_playerActor->_clues->setSharedWithMainframe(clueId, true);
 		}
 	}
 	return newCluesAcquired;
diff --git a/engines/bladerunner/actor_clues.cpp b/engines/bladerunner/actor_clues.cpp
index db6567c514..152ac55b03 100644
--- a/engines/bladerunner/actor_clues.cpp
+++ b/engines/bladerunner/actor_clues.cpp
@@ -289,6 +289,32 @@ void ActorClues::setViewed(int clueId, bool viewed) {
 	}
 }
 
+// Method for Restored Content
+// Checks whether a clue, which McCoy has, was shared between McCoy and Mainframe
+bool ActorClues::isSharedWithMainframe(int clueId) const {
+	int clueIndex = findClueIndex(clueId);
+	if (clueIndex == -1) {
+		return false;
+	}
+
+	return _clues[clueIndex].field4 & 0x01;
+}
+
+// Method for Restored Content
+// Marks a clue, which McCoy has, as shared between McCoy and Mainframe
+void ActorClues::setSharedWithMainframe(int clueId, bool value) {
+	int clueIndex = findClueIndex(clueId);
+	if (clueIndex == -1) {
+		return;
+	}
+
+	if (value) {
+		_clues[clueIndex].field4 |= 0x01;
+	} else {
+		_clues[clueIndex].field4 &= ~0x01;
+	}
+}
+
 bool ActorClues::isPrivate(int clueId) const {
 	int clueIndex = findClueIndex(clueId);
 	if (clueIndex == -1) {
@@ -369,7 +395,7 @@ void ActorClues::remove(int index) {
 	_clues[index].fromActorId = -1;
 
 	_clues[index].field3 = -1; // unused (but stored/restored)
-	_clues[index].field4 = 0;  // unused (but stored/restored)
+	_clues[index].field4 = 0;  // Restored Content: Use to mark if McCoy's clue was shared with Mainframe. original: unused (but stored/restored)
 	_clues[index].field5 = -1; // unused (but stored/restored)
 	_clues[index].field6 = 0;  // unused (but stored/restored)
 	_clues[index].field7 = -1; // unused (but stored/restored)
diff --git a/engines/bladerunner/actor_clues.h b/engines/bladerunner/actor_clues.h
index a2fdd68a4e..140dce5594 100644
--- a/engines/bladerunner/actor_clues.h
+++ b/engines/bladerunner/actor_clues.h
@@ -40,7 +40,7 @@ class ActorClues {
 		int weight;
 		int fromActorId;
 		int field3; // unused (but stored/restored)
-		int field4; // unused (but stored/restored)
+		int field4; // Used in Restored Content. Original: unused (but stored/restored)
 		int field5; // unused (but stored/restored)
 		int field6; // unused (but stored/restored)
 		int field7; // unused (but stored/restored)
@@ -86,6 +86,11 @@ public:
 	bool isPrivate(int clueId) const;
 	void setPrivate(int clueId, bool value);
 
+	// Restored Content method - Checks whether a clue, that McCoy has, was shared with Mainframe
+	bool isSharedWithMainframe(int clueId) const;
+	// Restored Content method - Marks a clue, that McCoy has, as shared with Mainframe
+	void setSharedWithMainframe(int clueId, bool value);
+
 	int getCount() const;
 	int getClueIdByIndex(int index) const;
 
diff --git a/engines/bladerunner/script/scene/ps06.cpp b/engines/bladerunner/script/scene/ps06.cpp
index 1b2477a201..4205569760 100644
--- a/engines/bladerunner/script/scene/ps06.cpp
+++ b/engines/bladerunner/script/scene/ps06.cpp
@@ -85,31 +85,42 @@ bool SceneScriptPS06::ClickedOn3DObject(const char *objectName, bool a2) {
 			Actor_Clues_Transfer_New_From_Mainframe(kActorMcCoy);
 			if (_vm->_cutContent) {
 				Actor_Clues_Transfer_New_From_Mainframe(kActorKlein);
+				// also play "new clues added" cue, since McCoy gets the registrations clues
+				Actor_Says(kActorAnsweringMachine, 360, kAnimationModeTalk);
 			}
 			return true;
 		} else {
-			bool transferedClues = Actor_Clues_Transfer_New_To_Mainframe(kActorMcCoy);
-			if (_vm->_cutContent && !transferedClues) {
-				Actor_Says(kActorAnsweringMachine, 370,  kAnimationModeTalk); // no clues transfered
-			} else {
+			bool uploadedClues = Actor_Clues_Transfer_New_To_Mainframe(kActorMcCoy);
+			if (!_vm->_cutContent || uploadedClues) {
 				if (_vm->_cutContent) {
 					Actor_Clues_Transfer_New_From_Mainframe(kActorKlein);
 				}
 				Ambient_Sounds_Play_Sound(kSfxDATALOAD, 50, 0, 0, 99);
-				Delay(2000);
+				if (_vm->_cutContent) {
+					Delay(800); // shorten delay in Restored Content mode
+				} else {
+					Delay(2000);
+				}
 			}
-			Actor_Says(kActorAnsweringMachine, 340,  kAnimationModeTalk);     // downloading clues
-			transferedClues = Actor_Clues_Transfer_New_From_Mainframe(kActorMcCoy);
-			if (_vm->_cutContent && !transferedClues) {
-				Actor_Says(kActorAnsweringMachine, 370,  kAnimationModeTalk); // no clues transfered
-			} else {
+			Actor_Says(kActorAnsweringMachine, 340,  kAnimationModeTalk);         // downloading clues
+			bool downloadedClues = Actor_Clues_Transfer_New_From_Mainframe(kActorMcCoy);
+			if (!_vm->_cutContent || downloadedClues) {
 				Ambient_Sounds_Play_Sound(kSfxDATALOAD, 50, 0, 0, 99);
-				Delay(2000);
+				if (_vm->_cutContent) {
+					Delay(800); // shorten delay in Restored Content mode
+				} else {
+					Delay(2000);
+				}
 			}
 			Ambient_Sounds_Play_Sound(kSfxBEEPNEAT, 80, 0, 0, 99);
 			Actor_Says(kActorAnsweringMachine, 350, kAnimationModeTalk);          // db transfer complete
-			if (_vm->_cutContent && transferedClues) {
-				Actor_Says(kActorAnsweringMachine, 360, kAnimationModeTalk);      // new clues added
+			if (_vm->_cutContent) {
+				if (downloadedClues) {
+					Actor_Says(kActorAnsweringMachine, 360, kAnimationModeTalk);  // new clues added
+				} else if (!uploadedClues && !downloadedClues) {
+					// Play the "No clues transfered" if overall no clues were exchanged
+					Actor_Says(kActorAnsweringMachine, 370,  kAnimationModeTalk); // no clues transfered
+				}
 			}
 			return true;
 		}
diff --git a/engines/bladerunner/ui/kia_section_clues.cpp b/engines/bladerunner/ui/kia_section_clues.cpp
index 08caf31cc3..66506802a5 100644
--- a/engines/bladerunner/ui/kia_section_clues.cpp
+++ b/engines/bladerunner/ui/kia_section_clues.cpp
@@ -403,6 +403,9 @@ void KIASectionClues::populateClues() {
 					if (_clues->isViewed(clueId)) {
 						flags &= ~0x20;
 					}
+					if (_vm->_cutContent && _clues->isSharedWithMainframe(clueId)) {
+						flags |= 0x40;
+					}
 #endif // BLADERUNNER_ORIGINAL_BUGS
 					_cluesScrollBox->addLine(_vm->_crimesDatabase->getClueText(clueId), clueId, flags);
 				}
diff --git a/engines/bladerunner/ui/kia_section_crimes.cpp b/engines/bladerunner/ui/kia_section_crimes.cpp
index 88ab6a580d..b3b69c1416 100644
--- a/engines/bladerunner/ui/kia_section_crimes.cpp
+++ b/engines/bladerunner/ui/kia_section_crimes.cpp
@@ -394,6 +394,9 @@ void KIASectionCrimes::populateVisibleClues() {
 				if (_clues->isViewed(clueId)) {
 					flags &= ~0x20;
 				}
+				if (_vm->_cutContent && _clues->isSharedWithMainframe(clueId)) {
+					flags |= 0x40;
+				}
 #endif // BLADERUNNER_ORIGINAL_BUGS
 				_cluesScrollBox->addLine(_vm->_crimesDatabase->getClueText(clueId), clueId, flags);
 			}
diff --git a/engines/bladerunner/ui/kia_section_suspects.cpp b/engines/bladerunner/ui/kia_section_suspects.cpp
index 90342b28b4..76f654cc86 100644
--- a/engines/bladerunner/ui/kia_section_suspects.cpp
+++ b/engines/bladerunner/ui/kia_section_suspects.cpp
@@ -456,6 +456,9 @@ void KIASectionSuspects::populateVisibleClues() {
 					if (_clues->isViewed(clueId)) {
 						flags &= ~0x20;
 					}
+					if (_vm->_cutContent && _clues->isSharedWithMainframe(clueId)) {
+						flags |= 0x40;
+					}
 #endif // BLADERUNNER_ORIGINAL_BUGS
 					_cluesScrollBox->addLine(_vm->_crimesDatabase->getClueText(clueId), clueId, flags);
 				}
diff --git a/engines/bladerunner/ui/ui_scroll_box.cpp b/engines/bladerunner/ui/ui_scroll_box.cpp
index 96ff857bf8..dd433c0c7d 100644
--- a/engines/bladerunner/ui/ui_scroll_box.cpp
+++ b/engines/bladerunner/ui/ui_scroll_box.cpp
@@ -605,12 +605,19 @@ void UIScrollBox::draw(Graphics::Surface &surface) {
 
 			if (_lines[i]->flags & 0x08) { // has background rectangle
 				int colorBackground = 0;
-				if (_style == 2) {
-					colorBackground = surface.format.RGBToColor(kTextBackgroundColors[colorIndex].r / 8, kTextBackgroundColors[colorIndex].g / 8, kTextBackgroundColors[colorIndex].b / 8);
-				} else if (_style > 0) {
-					colorBackground = surface.format.RGBToColor(kTextBackgroundColors[colorIndex].r, kTextBackgroundColors[colorIndex].g, kTextBackgroundColors[colorIndex].b);
+				if (_vm->_cutContent && (_lines[i]->flags & 0x40)) {
+					// A KIA clue marked as hidden/private, but already shared with Mainframe
+					// Note, proper hidden clues will not have this mark and will get colorBackground
+					// from below (case _style > 0)
+					colorBackground = surface.format.RGBToColor(80, 46, 22);
 				} else {
-					colorBackground = surface.format.RGBToColor(80, 56, 32);
+					if (_style == 2) {
+						colorBackground = surface.format.RGBToColor(kTextBackgroundColors[colorIndex].r / 8, kTextBackgroundColors[colorIndex].g / 8, kTextBackgroundColors[colorIndex].b / 8);
+					} else if (_style > 0) {
+						colorBackground = surface.format.RGBToColor(kTextBackgroundColors[colorIndex].r, kTextBackgroundColors[colorIndex].g, kTextBackgroundColors[colorIndex].b);
+					} else {
+						colorBackground = surface.format.RGBToColor(80, 56, 32);
+					}
 				}
 
 				if (_style == 2) {




More information about the Scummvm-git-logs mailing list