[Scummvm-git-logs] scummvm master -> 5f9ca0644fc1d9038e142ec273600b943b1f1641

Strangerke noreply at scummvm.org
Wed Dec 25 09:06:13 UTC 2024


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:
5f9ca0644f M4: RIDDLE: Room 204,303,709: Add weird globals in room 709, move those from rooms to globals


Commit: 5f9ca0644fc1d9038e142ec273600b943b1f1641
    https://github.com/scummvm/scummvm/commit/5f9ca0644fc1d9038e142ec273600b943b1f1641
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-12-25T10:06:04+01:00

Commit Message:
M4: RIDDLE: Room 204,303,709: Add weird globals in room 709, move those from rooms to globals

Changed paths:
    engines/m4/riddle/rooms/section2/room204.cpp
    engines/m4/riddle/rooms/section2/room204.h
    engines/m4/riddle/rooms/section3/room303.cpp
    engines/m4/riddle/rooms/section3/room303.h
    engines/m4/riddle/rooms/section7/room709.cpp
    engines/m4/riddle/rooms/section7/room709.h
    engines/m4/riddle/vars.h


diff --git a/engines/m4/riddle/rooms/section2/room204.cpp b/engines/m4/riddle/rooms/section2/room204.cpp
index b9c5e1cbcdc..28f58d4396f 100644
--- a/engines/m4/riddle/rooms/section2/room204.cpp
+++ b/engines/m4/riddle/rooms/section2/room204.cpp
@@ -330,11 +330,11 @@ void Room204::parser() {
 				break;
 
 			case 3:
-				if (_dword1A1898 >= 1) {
-					_dword1A1898 = 0;
+				if (_G(204_dword1A1898) >= 1) {
+					_G(204_dword1A1898) = 0;
 					sendWSMessage_150000(_mcMach, 4);
 				} else {
-					++_dword1A1898;
+					++_G(204_dword1A1898);
 				}
 
 				break;
@@ -971,10 +971,10 @@ void Room204::parser() {
 			break;
 
 		case 8:
-			if (_dword1A1898 < 1) {
-				++_dword1A1898;
+			if (_G(204_dword1A1898) < 1) {
+				++_G(204_dword1A1898);
 			} else {
-				_dword1A1898 = 0;
+				_G(204_dword1A1898) = 0;
 				sendWSMessage_150000(_mcMach, 9);
 			}
 
@@ -2894,7 +2894,6 @@ void Room204::daemon() {
 
 void Room204::syncGame(Common::Serializer &s) {
 	s.syncAsSint32LE(_dword1A189C);
-	s.syncAsSint32LE(_dword1A1898);
 }
 
 void Room204::initWalkerSeries() {
diff --git a/engines/m4/riddle/rooms/section2/room204.h b/engines/m4/riddle/rooms/section2/room204.h
index 3e054f953a1..8491c1533e7 100644
--- a/engines/m4/riddle/rooms/section2/room204.h
+++ b/engines/m4/riddle/rooms/section2/room204.h
@@ -55,7 +55,6 @@ private:
 	void setWalkerDestX();
 
 	int32 _dword1A189C = 0;
-	int32 _dword1A1898 = 0;
 
 	int32 _field4 = 0;
 	int32 _field10 = 0;
diff --git a/engines/m4/riddle/rooms/section3/room303.cpp b/engines/m4/riddle/rooms/section3/room303.cpp
index 06bc50c32cc..554528cc5db 100644
--- a/engines/m4/riddle/rooms/section3/room303.cpp
+++ b/engines/m4/riddle/rooms/section3/room303.cpp
@@ -1130,9 +1130,9 @@ void Room303::daemon() {
 		}
 
 		if (_G(MouseState).ButtonState) {
-			_btnFlag = true;
-		} else if (_btnFlag) {
-			_btnFlag = false;
+			_G(room303_btnFlag) = true;
+		} else if (_G(room303_btnFlag)) {
+			_G(room303_btnFlag) = false;
 
 			disable_player_commands_and_fade_init(55);
 		}
diff --git a/engines/m4/riddle/rooms/section3/room303.h b/engines/m4/riddle/rooms/section3/room303.h
index e5dadc79863..35a5551c55c 100644
--- a/engines/m4/riddle/rooms/section3/room303.h
+++ b/engines/m4/riddle/rooms/section3/room303.h
@@ -79,7 +79,6 @@ private:
 	int _suitTalk1 = 0;
 
 	int _ctr1 = 0;
-	bool _btnFlag = false;
 
 	static void escapePressed(void *, void *);
 
diff --git a/engines/m4/riddle/rooms/section7/room709.cpp b/engines/m4/riddle/rooms/section7/room709.cpp
index 7d49cabfedb..27237163f08 100644
--- a/engines/m4/riddle/rooms/section7/room709.cpp
+++ b/engines/m4/riddle/rooms/section7/room709.cpp
@@ -83,7 +83,7 @@ void Room709::init() {
 
 	resetMaze();
 
-	_chiselActiveFl = 0;
+	_chiselActiveFl = false;
 	_incenseBurnerActiveFl = 0;
 
 	hotspot_set_active(_G(currentSceneDef).hotspots, "Incense Burner", false);
@@ -477,13 +477,17 @@ void Room709::init() {
 	_maze709Arr[98]._straightIndex = 87;
 	_maze709Arr[98]._rightActive = 1;
 	_maze709Arr[98]._rightIndex = 99;
-	_btnFlag = 1;
-
+	
+	_G(room303_btnFlag) = true;
+	_G(global301) = 88;
+	_G(flag1) = 1;
+	_G(204_dword1A1898) = 98;
+	
 	switch (_G(game).previous_room) {
 	case KERNEL_RESTORING_GAME:
 		digi_preload("950_s41", -1);
 		if (_mazeCurrIndex == 97 && inv_object_is_here("CHISEL")) {
-			_chiselActiveFl = 1;
+			_chiselActiveFl = true;
 			_709ChiselMach = series_place_sprite("709 CHISEL", 0, 0, 0, 100, 3840);
 			hotspot_set_active(_G(currentSceneDef).hotspots, "Chisel", true);
 		}
@@ -999,7 +1003,7 @@ void Room709::daemon() {
 		if (_mazeCurrIndex == 97) {
 			inv_give_to_player("CHISEL");
 			terminateMachine(_709ChiselMach);
-			_chiselActiveFl = 0;
+			_chiselActiveFl = false;
 			hotspot_set_active(_G(currentSceneDef).hotspots, "Chisel", false);
 			kernel_examine_inventory_object("PING CHISEL", _G(master_palette), 5, 1, 163, 203, -1, nullptr, -1);
 			digi_play("709R03", 1, 255, 12, -1);
@@ -1036,13 +1040,13 @@ void Room709::daemon() {
 		ws_demand_location(_G(my_walker), 410, 300);
 		ws_demand_facing(_G(my_walker), 9);
 		_mazeCurrIndex = _maze709Arr[_mazeCurrIndex]._leftIndex;
-		if (_chiselActiveFl == 1) {
+		if (_chiselActiveFl) {
 			hotspot_set_active(_G(currentSceneDef).hotspots, "Chisel", false);
 			terminateMachine(_709ChiselMach);
 		}
 
 		if (_mazeCurrIndex == 97 && inv_object_is_here("CHISEL")) {
-			_chiselActiveFl = 1;
+			_chiselActiveFl = true;
 			_709ChiselMach = series_place_sprite("709 CHISEL", 0, 0, 0, 100, 3840);
 			hotspot_set_active(_G(currentSceneDef).hotspots, "Chisel", true);
 		}
@@ -1096,13 +1100,13 @@ void Room709::daemon() {
 		ws_demand_location(_G(my_walker), 230, 300);
 		ws_demand_facing(_G(my_walker), 3);
 		_mazeCurrIndex = _maze709Arr[_mazeCurrIndex]._rightIndex;
-		if (_chiselActiveFl == 1) {
+		if (_chiselActiveFl) {
 			hotspot_set_active(_G(currentSceneDef).hotspots, "Chisel", false);
 			terminateMachine(_709ChiselMach);
 		}
 
 		if (_mazeCurrIndex == 97 && inv_object_is_here("Chisel")) {
-			_chiselActiveFl = 1;
+			_chiselActiveFl = true;
 			_709ChiselMach = series_place_sprite("709 CHISEL", 0,0,0,100,3840);
 			hotspot_set_active(_G(currentSceneDef).hotspots, "Chisel", true);
 		}
@@ -1151,13 +1155,13 @@ void Room709::daemon() {
 		ws_demand_location(_G(my_walker), 320, 400);
 		ws_demand_facing(_G(my_walker), 1);
 		_mazeCurrIndex = _maze709Arr[_mazeCurrIndex]._straightIndex;
-		if (_chiselActiveFl == 1) {
+		if (_chiselActiveFl) {
 			hotspot_set_active(_G(currentSceneDef).hotspots, "Chisel", false);
 			terminateMachine(_709ChiselMach);
 		}
 
 		if (_mazeCurrIndex == 97 && inv_object_is_here("Chisel")) {
-			_chiselActiveFl = 1;
+			_chiselActiveFl = true;
 			_709ChiselMach = series_place_sprite("709 CHISEL", 0, 0, 0, 100, 3840);
 			hotspot_set_active(_G(currentSceneDef).hotspots, "Chisel", true);
 		}
@@ -1215,13 +1219,13 @@ void Room709::daemon() {
 			_G(game).new_room = 710;
 		}
 
-		if (_chiselActiveFl == 1) {
+		if (_chiselActiveFl) {
 			hotspot_set_active(_G(currentSceneDef).hotspots, "Chisel", false);
 			terminateMachine(_709ChiselMach);
 		}
 
 		if (_mazeCurrIndex == 97 && inv_object_is_here("Chisel")) {
-			_chiselActiveFl = 1;
+			_chiselActiveFl = true;
 			_709ChiselMach = series_place_sprite("709 CHISEL", 0, 0, 0, 100, 3840);
 			hotspot_set_active(_G(currentSceneDef).hotspots, "Chisel", true);
 		}
diff --git a/engines/m4/riddle/rooms/section7/room709.h b/engines/m4/riddle/rooms/section7/room709.h
index 69200157c77..bbdf8f80ddd 100644
--- a/engines/m4/riddle/rooms/section7/room709.h
+++ b/engines/m4/riddle/rooms/section7/room709.h
@@ -52,16 +52,15 @@ public:
 	void syncGame(Common::Serializer &s) override;
 
 private:
-	int32 _chiselActiveFl = 0;
+	bool _chiselActiveFl = false;
 	int32 _incenseBurnerActiveFl = 0;
-	int32 _pullRightFl = 0;
 	int32 _pullCenterFl = 0;
-	int32 _pullNearFl = 0;
 	int32 _pullLeftFl = 0;
-	int32 _btnFlag = 0;
+	int32 _pullNearFl = 0;
+	int32 _pullRightFl = 0;
 
 	int32 _mazeCurrIndex = 0;
-	
+
 	int32 _709NearDoorLiteSeries = 0;
 	int32 _709rpro1Series = 0;
 	int32 _709rpro2Series = 0;
@@ -73,12 +72,12 @@ private:
 	int32 _ripTrekHeadTurnPos1Series = 0;
 	int32 _ripTrekLowReachPos2Series = 0;
 
+	machine *_709ChiselMach = nullptr;
 	machine *_709IncenseHolderMach = nullptr;
 	machine *_709rpro5Mach = nullptr;
 	machine *_709rpro6Mach = nullptr;
 	machine *_709rpro7Mach = nullptr;
 	machine *_709rpro8Mach = nullptr;
-	machine *_709ChiselMach = nullptr;
 	machine *_ripPullMach = nullptr;
 	machine *_ripPullMach02 = nullptr;
 	machine *_ripPullMach03 = nullptr;
diff --git a/engines/m4/riddle/vars.h b/engines/m4/riddle/vars.h
index 7ce50c4cddf..372f1176c53 100644
--- a/engines/m4/riddle/vars.h
+++ b/engines/m4/riddle/vars.h
@@ -51,7 +51,9 @@ public:
 	Riddle::GUI::Interface _interface;
 	bool _menuSystemInitialized = false;
 	int _global301 = 0;
+	bool _room303_btnFlag = false;
 	int _flag1 = 0;
+	int _204_dword1A1898 = 0;
 	bool _kittyScreaming = false;
 	bool _spleenSpraying = false;
 	Common::String _string1;




More information about the Scummvm-git-logs mailing list