[Scummvm-git-logs] scummvm master -> 4d5683fb8d0a515ba0212a1b5f71246f095219e2

Strangerke noreply at scummvm.org
Wed Mar 19 06:47:04 UTC 2025


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:
4d5683fb8d M4: RIDDLE: Rework code in Room 996 (Journal)


Commit: 4d5683fb8d0a515ba0212a1b5f71246f095219e2
    https://github.com/scummvm/scummvm/commit/4d5683fb8d0a515ba0212a1b5f71246f095219e2
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-03-19T07:46:53+01:00

Commit Message:
M4: RIDDLE: Rework code in Room 996 (Journal)

Changed paths:
    engines/m4/riddle/rooms/section9/room996.cpp
    engines/m4/riddle/rooms/section9/room996.h


diff --git a/engines/m4/riddle/rooms/section9/room996.cpp b/engines/m4/riddle/rooms/section9/room996.cpp
index 79d70b10b4d..9adb5184863 100644
--- a/engines/m4/riddle/rooms/section9/room996.cpp
+++ b/engines/m4/riddle/rooms/section9/room996.cpp
@@ -27,11 +27,6 @@ namespace M4 {
 namespace Riddle {
 namespace Rooms {
 
-Room996::Room996() : Room() {
-	for (int i = 0; i < 13; ++i)
-		_flagArray[i] = 0;
-}
-
 void Room996::preload() {
 	_G(player).walker_in_this_scene = false;
 }
@@ -40,43 +35,41 @@ void Room996::init() {
 	digi_preload("950_s56", -1);
 	interface_hide();
 	series_show("996mark", 0, 16, -1, -1, 0, 100, 0, 0);
-	_flagArray[12] = 1;
+	_journalIndex = 1;
 	if (_G(flags)[V290]) {
 		_roomStates_loop0 = series_show("996 Charcoal Page", 256, 16, -1, -1, 0, 100, 0, 0);
 		digi_preload("205r13a", -1);
 		digi_play("205r13a", 1, 255, -1, 205);
 		hotspot_set_active(_G(currentSceneDef).hotspots, "FORWARD", false);
 		hotspot_set_active(_G(currentSceneDef).hotspots, "BACK", false);
+	} else if (player_been_here(205)) {
+		_roomStates_loop0 = series_show("996 RIPPED OUT PAGE", 256, 16, -1, -1, 0, 100, 0, 0);
+		hotspot_set_active(_G(currentSceneDef).hotspots, "FORWARD", false);
+		hotspot_set_active(_G(currentSceneDef).hotspots, "BACK", false);
 	} else {
-		if (player_been_here(205)) {
-			_roomStates_loop0 = series_show("996 RIPPED OUT PAGE", 256, 16, -1, -1, 0, 100, 0, 0);
-			hotspot_set_active(_G(currentSceneDef).hotspots, "FORWARD", false);
-			hotspot_set_active(_G(currentSceneDef).hotspots, "BACK", false);
-		} else {
-			if (_G(flags)[V280]) {
-				_roomStates_tt = series_show("996 Peru Pictograph Snake", 256, 16, -1, -1, 0, 100, 0, 0);
-
-				if (_G(flags)[V148]) {
-					_roomStates_field4 = series_show("996 Peru Pictograph Condor", 256, 16, -1, -1, 0, 100, 0, 0);
-				} else {
-					_roomStates_field4 = series_show("996 Peru Pictograph Spider", 256, 16, -1, -1, 0, 100, -13, -87);
-				}
-
-				if (_G(flags)[V156]) {
-					_roomStates_pu = series_show("996 Peru Pictos Solved Spider", 256, 16, -1, -1, 0, 100, 0, 0);
-				} else {
-					_roomStates_field8 = series_show("996 Peru Pictograph Spider", 256, 16, -1, -1, 0, 100, 0, 0);
-				}
-
-				if (_G(flags)[V283]) {
-					_roomStates_untie = series_show("996 Peru Pictograph Monkey", 256, 16, -1, -1, 0, 100, 0, 0);
-				} else {
-					_roomStates_untie = series_show("996 Peru Pictograph Spider", 256, 16, -1, -1, 0, 100, -21, 71);
-				}
+		if (_G(flags)[V280]) {
+			_roomStates_tt = series_show("996 Peru Pictograph Snake", 256, 16, -1, -1, 0, 100, 0, 0);
+
+			if (_G(flags)[V148]) {
+				_roomStates_field4 = series_show("996 Peru Pictograph Condor", 256, 16, -1, -1, 0, 100, 0, 0);
+			} else {
+				_roomStates_field4 = series_show("996 Peru Pictograph Spider", 256, 16, -1, -1, 0, 100, -13, -87);
 			}
 
-			hotspot_set_active(_G(currentSceneDef).hotspots, "BACK", false);
+			if (_G(flags)[V156]) {
+				_roomStates_pu = series_show("996 Peru Pictos Solved Spider", 256, 16, -1, -1, 0, 100, 0, 0);
+			} else {
+				_roomStates_field8 = series_show("996 Peru Pictograph Spider", 256, 16, -1, -1, 0, 100, 0, 0);
+			}
+
+			if (_G(flags)[V283]) {
+				_roomStates_untie = series_show("996 Peru Pictograph Monkey", 256, 16, -1, -1, 0, 100, 0, 0);
+			} else {
+				_roomStates_untie = series_show("996 Peru Pictograph Spider", 256, 16, -1, -1, 0, 100, -21, 71);
+			}
 		}
+
+		hotspot_set_active(_G(currentSceneDef).hotspots, "BACK", false);
 	}
 
 	for (int i = 1; i < 12; ++i)
@@ -128,38 +121,38 @@ void Room996::init() {
 		_flagArray[index] = 9;
 	}
 
-	_flagArray[12] = 1;
+	_journalIndex = 1;
 	_moveValue = 0;
 }
 
 void Room996::pre_parser() {
-	if (player_said("forward", nullptr, nullptr) && (_flagArray[12] != 3)) {
+	if (player_said("forward", nullptr, nullptr) && (_journalIndex != 3)) {
 		digi_play("950_s56", 1, 255, -1, 950);
-		++_flagArray[12];
+		++_journalIndex;
 	}
 
-	if (player_said("back", nullptr, nullptr) && (_flagArray[12] != 3)) {
+	if (player_said("back", nullptr, nullptr) && (_journalIndex != 3)) {
 		digi_play("950_s56", 1, 255, -1, 950);
-		--_flagArray[12];
+		--_journalIndex;
 	}
 
-	if (player_said("forward", nullptr, nullptr) && (_flagArray[12] == 3) && (_flagArray[1] == 0)) {
-		++_flagArray[12];
+	if (player_said("forward", nullptr, nullptr) && (_journalIndex == 3) && (_flagArray[1] == 0)) {
+		++_journalIndex;
 	}
 
-	if (player_said("forward", nullptr, nullptr) && (_flagArray[12] == 4) && (_G(flags)[V047] == 0)) {
-		++_flagArray[12];
+	if (player_said("forward", nullptr, nullptr) && (_journalIndex == 4) && (_G(flags)[V047] == 0)) {
+		++_journalIndex;
 	}
 
-	if (player_said("back", nullptr, nullptr) && (_flagArray[12] == 4) && (_G(flags)[V047] == 0)) {
-		--_flagArray[12];
+	if (player_said("back", nullptr, nullptr) && (_journalIndex == 4) && (_G(flags)[V047] == 0)) {
+		--_journalIndex;
 	}
 
-	if (player_said("back", nullptr, nullptr) && (_flagArray[12] == 3) && (_flagArray[1] == 0)) {
-		--_flagArray[12];
+	if (player_said("back", nullptr, nullptr) && (_journalIndex == 3) && (_flagArray[1] == 0)) {
+		--_journalIndex;
 	}
 
-	_flagArray[12] = CLIP(_flagArray[12], (int32)1, (int32)5);
+	_journalIndex = CLIP(_journalIndex, (int32)1, (int32)5);
 
 	_G(player).need_to_walk = false;
 	_G(player).ready_to_walk = true;
@@ -188,7 +181,7 @@ void Room996::parser() {
 		}
 	}
 
-	switch (_flagArray[12]) {
+	switch (_journalIndex) {
 	case 1:
 		if (_G(kernel).trigger == -1) {
 			hotspot_set_active(_G(currentSceneDef).hotspots, "FORWARD", true);
@@ -276,13 +269,13 @@ void Room996::parser() {
 			}
 
 			if (_moveValue == 0) {
-				_flagArray[12] = 2;
+				_journalIndex = 2;
 				digi_play("950_s56", 1, 255, -1, 950);
 			} else if (_flagArray[_moveValue] == 0) {
 				if (_G(flags)[V047])
-					_flagArray[12] = 4;
+					_journalIndex = 4;
 				else if (_G(flags)[V196] || _G(flags)[V201] || _G(flags)[V207] || _G(flags)[V208] || _G(flags)[V209])
-					_flagArray[12] = 5;
+					_journalIndex = 5;
 			}
 
 			if (_flagArray[_moveValue] != 0 || _G(flags)[V047] || _G(flags)[V196] || _G(flags)[V201] || _G(flags)[V207] || _G(flags)[V208] || _G(flags)[V209])
@@ -290,14 +283,14 @@ void Room996::parser() {
 			else
 				hotspot_set_active(_G(currentSceneDef).hotspots, "forward", false);
 
-			if (_flagArray[12] == 4) {
+			if (_journalIndex == 4) {
 				if (_G(flags)[V196] || _G(flags)[V201] || _G(flags)[V207] || _G(flags)[V208] || _G(flags)[V209])
 					hotspot_set_active(_G(currentSceneDef).hotspots, "forward", true);
 				else
 					hotspot_set_active(_G(currentSceneDef).hotspots, "forward", false);
 			}
 
-			if (_flagArray[12] == 5)
+			if (_journalIndex == 5)
 				hotspot_set_active(_G(currentSceneDef).hotspots, "forward", false);
 
 			terminateMachine(_roomStates_ripTalker);
diff --git a/engines/m4/riddle/rooms/section9/room996.h b/engines/m4/riddle/rooms/section9/room996.h
index 5019ea5030f..cf63ceaf075 100644
--- a/engines/m4/riddle/rooms/section9/room996.h
+++ b/engines/m4/riddle/rooms/section9/room996.h
@@ -31,7 +31,7 @@ namespace Rooms {
 
 class Room996 : public Room {
 public:
-	Room996();
+	Room996() : Room() {}
 	~Room996() override {}
 
 	void preload() override;
@@ -41,7 +41,8 @@ public:
 	void daemon() override;
 
 private:
-	int32 _flagArray[13];
+	int32 _flagArray[12] = {};
+	int32 _journalIndex = 1;
 	int32 _moveValue = 0;
 	bool _check201Fl = false;
 	bool _check207Fl = false;




More information about the Scummvm-git-logs mailing list