[Scummvm-git-logs] scummvm master -> 238c38d1fad2d772aa2219264e72bf7a8f0d4f9c

dreammaster noreply at scummvm.org
Sat Nov 9 05:30:58 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:
238c38d1fa M4: RIDDLE: Fix entering room 207 alley


Commit: 238c38d1fad2d772aa2219264e72bf7a8f0d4f9c
    https://github.com/scummvm/scummvm/commit/238c38d1fad2d772aa2219264e72bf7a8f0d4f9c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2024-11-08T21:30:47-08:00

Commit Message:
M4: RIDDLE: Fix entering room 207 alley

Changed paths:
    engines/m4/graphics/gr_series.cpp
    engines/m4/graphics/gr_series.h
    engines/m4/riddle/rooms/section2/room203.cpp
    engines/m4/riddle/rooms/section2/room207.cpp
    engines/m4/riddle/rooms/section2/section2.cpp
    engines/m4/riddle/rooms/section2/section2.h


diff --git a/engines/m4/graphics/gr_series.cpp b/engines/m4/graphics/gr_series.cpp
index a1d3cd5ccb1..d30ac1af791 100644
--- a/engines/m4/graphics/gr_series.cpp
+++ b/engines/m4/graphics/gr_series.cpp
@@ -328,11 +328,12 @@ machine *series_plain_play(const char *seriesName, int32 loopCount, uint32 flags
 }
 
 machine *series_play_xy(const char *seriesName, int loopCount, int flags,
-		int x, int y, int scale, int depth, int layer, int frameRate) {
-	// TODO: proper implementation
-	warning("TODO: series_play_xy");
-	return series_play(seriesName, layer, flags, -1, frameRate, loopCount,
-		scale, x, y);
+		int x, int y, int scale, int layer, int frameRate, int trigger) {
+	if (loopCount == 1)
+		loopCount = 0;
+
+	return series_play(seriesName, layer, flags, trigger, frameRate,
+		loopCount, scale, x, y);
 }
 
 machine *series_simple_play(const char *seriesName, frac16 layer, bool stickWhenDone) {
diff --git a/engines/m4/graphics/gr_series.h b/engines/m4/graphics/gr_series.h
index 994a47609d6..2984832c9ec 100644
--- a/engines/m4/graphics/gr_series.h
+++ b/engines/m4/graphics/gr_series.h
@@ -115,7 +115,7 @@ machine *series_ranged_play_xy(const char *seriesName, int loopCount, int flags,
 machine *series_plain_play(const char *seriesName, int32 loopCount, uint32 flags,
 	int32 s, int32 layer, int32 frameRate, int32 trigger = -1, bool stickWhenDone = false);
 machine *series_play_xy(const char *seriesName, int loopCount, int flags,
-	int x, int y, int scale, int depth, int layer, int frameRate);
+	int x, int y, int scale, int layer, int frameRate, int trigger);
 
 machine *series_stream(const char *seriesName, int32 frameRate, int32 layer, int32 trigger);
 bool series_stream_break_on_frame(machine *m, int32 frameNum, int32 trigger);
diff --git a/engines/m4/riddle/rooms/section2/room203.cpp b/engines/m4/riddle/rooms/section2/room203.cpp
index d681b10b1cc..5baf36e2cd7 100644
--- a/engines/m4/riddle/rooms/section2/room203.cpp
+++ b/engines/m4/riddle/rooms/section2/room203.cpp
@@ -50,11 +50,6 @@ const char *SNORMAL2_NAMES[] = { "203s02" };
 const int16 SSHADOW2_DIRS[] = { 250, -1 };
 const char *SSHADOW2_NAMES[] = { "203ssh02" };
 
-const int16 PEASANT_NORMAL_DIRS[] = { 240, -1 };
-const char *PEASANT_NORMAL_NAMES[] = { "pesky walk pos3" };
-const int16 PEASANT_SHADOW_DIRS[] = { 250, -1 };
-const char *PEASANT_SHADOW_NAMES[] = { "shadow pesky walk pos3" };
-
 
 void Room203::init() {
 	if (_G(game).previous_room != KERNEL_RESTORING_GAME)
@@ -329,6 +324,9 @@ void Room203::init() {
 void Room203::daemon() {
 	int frame;
 
+	if (_G(kernel).trigger < 9999)
+		warning("%d", _G(kernel).trigger);
+
 	if (keyCheck() && _gkShould == 0 && _G(game_buff_ptr)->x1 >= 380) {
 		_gkShould = 1;
 		_G(kernel).call_daemon_every_loop = false;
@@ -1078,7 +1076,7 @@ void Room203::daemon() {
 				terminateMachineAndNull(_peasant);
 				terminateMachineAndNull(_peasantShadow);
 				_peasant = triggerMachineByHash_3000(8, 6,
-					*PEASANT_NORMAL_DIRS, *PEASANT_SHADOW_DIRS,
+					*S2_PEASANT_NORMAL_DIRS, *S2_PEASANT_SHADOW_DIRS,
 					763, 325, 3, triggerMachineByHashCallback3000, "pp_walking");
 				sendWSMessage_10000(_peasant, 1200, 332, 2, 120, 1);
 				_peasantMode = 4054;
@@ -1117,7 +1115,7 @@ void Room203::daemon() {
 				terminateMachineAndNull(_peasant);
 				terminateMachineAndNull(_peasantShadow);
 				_peasant = triggerMachineByHash_3000(8, 6,
-					*PEASANT_NORMAL_DIRS, *PEASANT_SHADOW_DIRS,
+					*S2_PEASANT_NORMAL_DIRS, *S2_PEASANT_SHADOW_DIRS,
 					763, 325, 3, triggerMachineByHashCallback3000, "pp_walk");
 				sendWSMessage_10000(_peasant, 932, 325, 3, 121, 1);
 				_peasantShould = 4115;
@@ -1167,7 +1165,7 @@ void Room203::daemon() {
 				terminateMachineAndNull(_peasant);
 				terminateMachineAndNull(_peasantShadow);
 				_peasant = triggerMachineByHash_3000(8, 6,
-					*PEASANT_NORMAL_DIRS, *PEASANT_SHADOW_DIRS,
+					*S2_PEASANT_NORMAL_DIRS, *S2_PEASANT_SHADOW_DIRS,
 					727, 325, 9, triggerMachineByHashCallback3000, "pp_walking");
 				sendWSMessage_10000(_peasant, 436, 332, 9, 121, 1);
 				_peasantShould = 4119;
@@ -1228,7 +1226,7 @@ void Room203::daemon() {
 				terminateMachineAndNull(_peasant);
 				terminateMachineAndNull(_peasantShadow);
 				_peasant = triggerMachineByHash_3000(8, 6,
-					*PEASANT_NORMAL_DIRS, *PEASANT_SHADOW_DIRS, 436, 332, 3,
+					*S2_PEASANT_NORMAL_DIRS, *S2_PEASANT_SHADOW_DIRS, 436, 332, 3,
 					triggerMachineByHashCallback3000, "pp_walking");
 				sendWSMessage_10000(_peasant, 727, 325, 3, 121, 1);
 				_peasantShould = 4177;
@@ -1288,7 +1286,7 @@ void Room203::daemon() {
 				terminateMachineAndNull(_peasant);
 				terminateMachineAndNull(_peasantShadow);
 				_peasant = triggerMachineByHash_3000(8, 6,
-					*PEASANT_NORMAL_DIRS, *PEASANT_SHADOW_DIRS, 932, 325, 9,
+					*S2_PEASANT_NORMAL_DIRS, *S2_PEASANT_SHADOW_DIRS, 932, 325, 9,
 					triggerMachineByHashCallback3000, "pp_walking");
 				sendWSMessage_10000(_peasant, 763, 325, 9, 121, 1);
 				_peasantShould = 4164;
@@ -1336,7 +1334,7 @@ void Room203::daemon() {
 				terminateMachineAndNull(_peasant);
 				terminateMachineAndNull(_peasantShadow);
 				_peasant = triggerMachineByHash_3000(8, 6,
-					*PEASANT_NORMAL_DIRS, *PEASANT_SHADOW_DIRS, 968, 325, 3,
+					*S2_PEASANT_NORMAL_DIRS, *S2_PEASANT_SHADOW_DIRS, 968, 325, 3,
 					triggerMachineByHashCallback3000, "pp_walking");
 				sendWSMessage_10000(_peasant, 1082, 322, 3, 121, 1);
 				_peasantShould = 4168;
@@ -1399,7 +1397,7 @@ void Room203::daemon() {
 				terminateMachineAndNull(_peasant);
 				terminateMachineAndNull(_peasantShadow);
 				_peasant = triggerMachineByHash_3000(8, 6,
-					*PEASANT_NORMAL_DIRS, *PEASANT_SHADOW_DIRS, 1082, 322, 9,
+					*S2_PEASANT_NORMAL_DIRS, *S2_PEASANT_SHADOW_DIRS, 1082, 322, 9,
 					triggerMachineByHashCallback3000, "pp_walking");
 				sendWSMessage_10000(_peasant, 968, 325, 9, 121, 1);
 				_peasantShould = 4144;
@@ -1450,7 +1448,7 @@ void Room203::daemon() {
 				terminateMachineAndNull(_peasant);
 				terminateMachineAndNull(_peasantShadow);
 				_peasant = triggerMachineByHash_3000(8, 6,
-					*PEASANT_NORMAL_DIRS, *PEASANT_SHADOW_DIRS, 1118, 322, 3,
+					*S2_PEASANT_NORMAL_DIRS, *S2_PEASANT_SHADOW_DIRS, 1118, 322, 3,
 					triggerMachineByHashCallback3000, "pp_walking");
 				sendWSMessage_10000(_peasant, 1200, 332, 2, 121, 1);
 				_peasantShould = 4148;
@@ -2268,8 +2266,8 @@ void Room203::daemon() {
 			hotspot_set_active("PEASANT", false);
 			hotspot_set_active("SOLDIER'S HELMET", false);
 		} else {
-			ws_walk_load_walker_series(PEASANT_NORMAL_DIRS, PEASANT_NORMAL_NAMES);
-			ws_walk_load_shadow_series(PEASANT_SHADOW_DIRS, PEASANT_SHADOW_NAMES);
+			ws_walk_load_walker_series(S2_PEASANT_NORMAL_DIRS, S2_PEASANT_NORMAL_NAMES);
+			ws_walk_load_shadow_series(S2_PEASANT_SHADOW_DIRS, S2_PEASANT_SHADOW_NAMES);
 			_peasantRocks = series_load("peasant rocks 5frames");
 			_peasantRocksShadow = series_load("shadow pesky rock loop");
 			_peasantSquat3 = series_load("peasant 3 to squat");
@@ -2447,8 +2445,8 @@ void Room203::daemon() {
 
 		_peasantRocks = series_load("peasant rocks 5frames");
 		_peasantRocksShadow = series_load("shadow pesky rock loop");
-		ws_walk_load_walker_series(PEASANT_NORMAL_DIRS, PEASANT_NORMAL_NAMES);
-		ws_walk_load_shadow_series(PEASANT_SHADOW_DIRS, PEASANT_SHADOW_NAMES);
+		ws_walk_load_walker_series(S2_PEASANT_NORMAL_DIRS, S2_PEASANT_NORMAL_NAMES);
+		ws_walk_load_shadow_series(S2_PEASANT_SHADOW_DIRS, S2_PEASANT_SHADOW_NAMES);
 
 		_peasantMode = 4050;
 		_peasantShould = 4091;
@@ -2586,6 +2584,7 @@ void Room203::pre_parser() {
 
 	if (lookFlag && player_said("ALLEY WALL") && _G(kernel).trigger == -1) {
 		_G(player).resetWalk();
+		_G(kernel).trigger_mode = KT_PARSE;
 		ws_walk(710, 300, nullptr, 230, 11);
 		_G(kernel).trigger_mode = KT_PREPARSE;
 	}
@@ -2655,7 +2654,7 @@ void Room203::parser() {
 		default:
 			break;
 		}
-	} else if (player_said("gatekeeper")) {
+	} else if (player_said("pass", "gatekeeper")) {
 		switch (_G(kernel).trigger) {
 		case -1:
 			player_set_commands_allowed(false);
diff --git a/engines/m4/riddle/rooms/section2/room207.cpp b/engines/m4/riddle/rooms/section2/room207.cpp
index 338bb09e686..f9aa6252f97 100644
--- a/engines/m4/riddle/rooms/section2/room207.cpp
+++ b/engines/m4/riddle/rooms/section2/room207.cpp
@@ -133,9 +133,10 @@ void Room207::init() {
 		if (_G(flags[V061]) == 0) {
 			player_set_commands_allowed(false);
 			_peasant3ToSquatSeries = series_load("peasant 3 to squat", -1, nullptr);
-			ws_walk_load_walker_series(S2_DIRS1, S2_NAMES1, false);
-			ws_walk_load_walker_series(S2_DIRS2, S2_NAMES2, false);
-			_ppWalkerMach = triggerMachineByHash_3000(8, 6, *S2_DIRS1, *S2_DIRS2, 660, 367, 9, triggerMachineByHashCallback3000, "pp walker");
+			ws_walk_load_walker_series(S2_PEASANT_NORMAL_DIRS, S2_PEASANT_NORMAL_NAMES);
+			ws_walk_load_shadow_series(S2_PEASANT_SHADOW_DIRS, S2_PEASANT_SHADOW_NAMES);
+
+			_ppWalkerMach = triggerMachineByHash_3000(8, 6, *S2_PEASANT_NORMAL_DIRS, *S2_PEASANT_SHADOW_DIRS, 660, 367, 9, triggerMachineByHashCallback3000, "pp walker");
 			sendWSMessage_10000(_ppWalkerMach, 562, 359, 9, 10, 1);
 		}
 
@@ -1130,7 +1131,9 @@ void Room207::daemon() {
 	case 11:
 		series_play_xy("shadow pesky rock loop", -1, 0, 514, 367, 97, 3849, 300, -1);
 		_ppSquatMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 514, 367, 97, 3840, false, triggerMachineByHashCallback, "pp squat");
-		sendWSMessage_10000(1, _ppSquatMach, 1, _peskyRockLoopSeries, 20, 101, _peskyRockLoopSeries, 20, 20, 0);
+		sendWSMessage_10000(1, _ppSquatMach, _peskyRockLoopSeries, 1, 20, 101,
+			_peskyRockLoopSeries, 20, 20, 0);
+		player_set_commands_allowed(true);
 		_field8E = 0;
 		_field92 = 0;
 
diff --git a/engines/m4/riddle/rooms/section2/section2.cpp b/engines/m4/riddle/rooms/section2/section2.cpp
index 8e24aa41619..1bb255dd156 100644
--- a/engines/m4/riddle/rooms/section2/section2.cpp
+++ b/engines/m4/riddle/rooms/section2/section2.cpp
@@ -26,11 +26,6 @@ namespace M4 {
 namespace Riddle {
 namespace Rooms {
 
-const int16 S2_DIRS1[] = {240, -1};
-const char *S2_NAMES1[] = { "pesky walk pos3" };
-const int16 S2_DIRS2[] = {250, -1};
-const char *S2_NAMES2[] = { "shadow pesky walk pos3" };
-
 const int16 S2_MEI_NORMAL_DIRS[] = { 220, 221, 222, 223, 224, -1 };
 const char *S2_MEI_NORMAL_NAMES[] = {
 	"mei chen trek walk pos1",
diff --git a/engines/m4/riddle/rooms/section2/section2.h b/engines/m4/riddle/rooms/section2/section2.h
index 29e56b79578..5f815e9b9fb 100644
--- a/engines/m4/riddle/rooms/section2/section2.h
+++ b/engines/m4/riddle/rooms/section2/section2.h
@@ -34,12 +34,6 @@ namespace M4 {
 namespace Riddle {
 namespace Rooms {
 
-extern const int16 S2_DIRS1[];
-extern const char *S2_NAMES1[];
-
-extern const int16 S2_DIRS2[];
-extern const char *S2_NAMES2[];
-
 extern const int16 S2_MEI_NORMAL_DIRS[];
 extern const char *S2_MEI_NORMAL_NAMES[];
 extern const int16 S2_MEI_SHADOW_DIRS[];




More information about the Scummvm-git-logs mailing list