[Scummvm-git-logs] scummvm master -> c876f6d8a1ba28cb9fefad7da901c040ef2bfe6d
dreammaster
noreply at scummvm.org
Tue Dec 26 23:27:58 UTC 2023
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:
d5c0bd423e M4: Clarifying gerbil flag and state variable
619839295f M4: Fix gerbils firing in upper cage level
c876f6d8a1 M4: Simplify mouse wheel click cursor toggle
Commit: d5c0bd423ea7c346a647f20d9038f25fa1dcb70e
https://github.com/scummvm/scummvm/commit/d5c0bd423ea7c346a647f20d9038f25fa1dcb70e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-12-26T13:27:42-10:00
Commit Message:
M4: Clarifying gerbil flag and state variable
Changed paths:
engines/m4/burger/burger.cpp
engines/m4/burger/flags.cpp
engines/m4/burger/flags.h
engines/m4/burger/rooms/section6/room602.cpp
engines/m4/burger/rooms/section6/room603.cpp
engines/m4/burger/rooms/section6/room604.cpp
engines/m4/burger/rooms/section6/room609.cpp
engines/m4/burger/rooms/section6/section6.cpp
engines/m4/burger/rooms/section6/section6.h
engines/m4/burger/rooms/section6/section6_room.cpp
diff --git a/engines/m4/burger/burger.cpp b/engines/m4/burger/burger.cpp
index dd4214418e6..dbb1e701e45 100644
--- a/engines/m4/burger/burger.cpp
+++ b/engines/m4/burger/burger.cpp
@@ -589,7 +589,7 @@ void BurgerEngine::testDone2() {
_G(flags)[V242]++;
_G(flags)[kSecondTestPassed] = 1;
- _G(flags)[V243] = 6007;
+ _G(flags)[kHampsterState] = 6007;
_G(flags)[V244] = 6004;
_G(flags)[V245] = 10031;
_G(flags)[V246] = 0;
diff --git a/engines/m4/burger/flags.cpp b/engines/m4/burger/flags.cpp
index f4a3e27c349..82883dcad87 100644
--- a/engines/m4/burger/flags.cpp
+++ b/engines/m4/burger/flags.cpp
@@ -225,7 +225,7 @@ void Flags::reset2() {
if ((*this)[V277] == 6003)
inv_give_to_player("PANTYHOSE");
- (*this)[V243] = 6000;
+ (*this)[kHampsterState] = 6000;
(*this)[V244] = 6000;
(*this)[V245] = 10027;
(*this)[V246] = 0;
diff --git a/engines/m4/burger/flags.h b/engines/m4/burger/flags.h
index a5fec751d84..7ccf1b5a733 100644
--- a/engines/m4/burger/flags.h
+++ b/engines/m4/burger/flags.h
@@ -277,7 +277,7 @@ enum {
V240 = 240,
kSecondTestPassed = 241,
V242 = 242,
- V243 = 243,
+ kHampsterState = 243,
V244 = 244,
V245 = 245,
V246 = 246,
diff --git a/engines/m4/burger/rooms/section6/room602.cpp b/engines/m4/burger/rooms/section6/room602.cpp
index fc755bc5611..2c576e9178e 100644
--- a/engines/m4/burger/rooms/section6/room602.cpp
+++ b/engines/m4/burger/rooms/section6/room602.cpp
@@ -357,12 +357,12 @@ void Room602::init() {
kernel_trigger_dispatch_now(6013);
}
- if (_G(flags)[V243] == 6006) {
+ if (_G(flags)[kHampsterState] == 6006) {
_series4 = series_load("602mg01");
_series5 = series_load("602mg01s");
_series6 = series_load("602mg02");
_series7 = series_load("602mg02s");
- Section6::_state3 = 6001;
+ Section6::_gerbilState = 6001;
kernel_timing_trigger(60, 6011);
}
@@ -412,7 +412,7 @@ void Room602::init() {
if (_G(game).room_id == 612) {
_G(flags)[V277] = 6001;
- _G(flags)[V243] = 6007;
+ _G(flags)[kHampsterState] = 6007;
_G(flags)[V244] = 6004;
_G(flags)[V245] = 10031;
_G(flags)[V248] = 1;
@@ -422,11 +422,11 @@ void Room602::init() {
break;
}
- if (_G(flags)[V243] == 6006)
+ if (_G(flags)[kHampsterState] == 6006)
Section6::_state4 = 5;
- if (_G(flags)[V243] == 6007)
+ if (_G(flags)[kHampsterState] == 6007)
Section6::_state4 = 9;
- else if (_G(flags)[V243] == 6000)
+ else if (_G(flags)[kHampsterState] == 6000)
Section6::_state4 = 2;
kernel_trigger_dispatch_now(6014);
@@ -707,14 +707,14 @@ void Room602::daemon() {
break;
case 6011:
- switch (Section6::_state3) {
+ switch (Section6::_gerbilState) {
case 49:
series_unload(_series4);
series_unload(_series5);
_G(flags)[V266] = 1;
Section6::_state4 = 6;
kernel_trigger_dispatch_now(6014);
- Section6::_state3 = 50;
+ Section6::_gerbilState = 50;
series_play_with_breaks(PLAY12, "602mg02", 0xc00, 6011, 3, 6, 100, 0, 0);
break;
@@ -725,10 +725,10 @@ void Room602::daemon() {
if (_G(player_info).x < 511 || _G(player_info).y < 322) {
term_message("Wilbur is gonna die");
- Section6::_state3 = 6005;
+ Section6::_gerbilState = 6005;
} else {
term_message("Wilbur is safe");
- Section6::_state3 = 51;
+ Section6::_gerbilState = 51;
}
_G(kernel).continue_handling_trigger = true;
@@ -738,7 +738,7 @@ void Room602::daemon() {
case 51:
_G(flags)[V266] = 0;
- _G(flags)[V243] = 6007;
+ _G(flags)[kHampsterState] = 6007;
_G(flags)[V277] = 6001;
_G(flags)[V244] = 6004;
_G(flags)[V245] = 10031;
@@ -748,7 +748,7 @@ void Room602::daemon() {
break;
case 6001:
- Section6::_state3 = 6002;
+ Section6::_gerbilState = 6002;
_sectionMachine1 = series_play("602mg01", 0xc00, 0, 6011, 8, 0, 100, 0, 0, 0, 67);
_sectionMachine2 = series_play("602mg01s", 0xc01, 0, -1, 8, 0, 100, 0, 0, 0, 67);
break;
@@ -760,7 +760,7 @@ void Room602::daemon() {
_sectionMachine1 = series_play("602mg01", 0xc00, 0, 6011, 8, 0, 100, 0, 0, 68, -1);
_sectionMachine2 = series_play("602mg01s", 0xc01, 0, -1, 8, 0, 100, 0, 0, 68, -1);
- Section6::_state3 = (_G(flags)[V245] == 10028) ? 49 : 6004;
+ Section6::_gerbilState = (_G(flags)[V245] == 10028) ? 49 : 6004;
break;
case 6004:
@@ -865,7 +865,7 @@ void Room602::daemon() {
player_set_commands_allowed(false);
digi_stop(1);
- if (_G(flags)[V243] == 6006) {
+ if (_G(flags)[kHampsterState] == 6006) {
Walker::unloadSprites();
} else {
@@ -1290,7 +1290,7 @@ void Room602::pre_parser() {
hotspot_set_active("DOOR", true);
hotspot_set_active("EXIT", false);
- } else if (_G(flags)[V243] == 6006 && (player_said("GEAR", "TUBE") || player_said("CLIMB IN"))) {
+ } else if (_G(flags)[kHampsterState] == 6006 && (player_said("GEAR", "TUBE") || player_said("CLIMB IN"))) {
wilbur_speech("600w003");
intr_cancel_sentence();
diff --git a/engines/m4/burger/rooms/section6/room603.cpp b/engines/m4/burger/rooms/section6/room603.cpp
index 4f88aec89e7..da42a2455fd 100644
--- a/engines/m4/burger/rooms/section6/room603.cpp
+++ b/engines/m4/burger/rooms/section6/room603.cpp
@@ -199,14 +199,13 @@ void Room603::init() {
kernel_trigger_dispatch_now(6013);
}
- if (_G(flags)[V243] == 6000) {
+ if (_G(flags)[kHampsterState] == 6000) {
Section6::_state4 = 1;
kernel_trigger_dispatch_now(6014);
}
- if (_G(flags)[V243] == 6006) {
+ if (_G(flags)[kHampsterState] == 6006) {
_series2 = series_load("603mg01");
- Section6::_state3 = 6002;
- Section6::_state3 = 6001;
+ Section6::_gerbilState = 6001;
kernel_timing_trigger(60, 6011);
}
@@ -232,12 +231,12 @@ void Room603::init() {
break;
}
- if (_G(flags)[V243] == 6006)
+ if (_G(flags)[kHampsterState] == 6006)
Section6::_state4 = 5;
- if (_G(flags)[V243] == 6007)
+ if (_G(flags)[kHampsterState] == 6007)
Section6::_state4 = 8;
- else if (_G(flags)[V243] == 6000)
+ else if (_G(flags)[kHampsterState] == 6000)
Section6::_state4 = 1;
kernel_trigger_dispatch_now(6014);
@@ -333,9 +332,9 @@ void Room603::daemon() {
break;
case 6011:
- switch (Section6::_state3) {
+ switch (Section6::_gerbilState) {
case 6001:
- Section6::_state3 = 6002;
+ Section6::_gerbilState = 6002;
_sectionMachine1 = series_play("603mg01", 0xdff, 0, 6011, 8, 0, 100, 0, 0, 0, 84);
_sectionMachine2 = series_play("603mg01s", 0xe00, 0, -1, 8, 0, 100, 0, 0, 0, 84);
break;
@@ -343,14 +342,14 @@ void Room603::daemon() {
case 6002:
Section6::_state4 = 4;
kernel_trigger_dispatch_now(6014);
- Section6::_state3 = 6003;
+ Section6::_gerbilState = 6003;
_sectionMachine1 = series_play("603mg01", 0xdff, 0, 6011, 8, 0, 100, 0, 0, 85, -1);
_sectionMachine2 = series_play("603mg01s", 0xe00, 0, -1, 8, 0, 100, 0, 0, 85, -1);
break;
case 6003:
- Section6::_state3 = (_G(flags)[V245] == 10029) ? 6005 : 6004;
+ Section6::_gerbilState = (_G(flags)[V245] == 10029) ? 6005 : 6004;
series_play("603mg01", 0xdff, 0, -1, -1, 95);
_sectionMachine2 = series_play("603mg01s", 0xe00, 0, -1, -1, 95);
kernel_trigger_dispatch_now(6011);
@@ -404,7 +403,7 @@ void Room603::daemon() {
ws_hide_walker();
Section6::_state2 = 1;
- if (_G(flags)[V243] == 6007) {
+ if (_G(flags)[kHampsterState] == 6007) {
series_play_with_breaks(PLAY4, "603wi01", 0xdff, 6010, 3);
} else {
series_play_with_breaks(PLAY4, "603wi01", 0xdff, 6002, 3);
@@ -426,7 +425,7 @@ void Room603::daemon() {
player_set_commands_allowed(false);
ws_hide_walker();
Section6::_state2 = 2;
- if (_G(flags)[V243] == 6007) {
+ if (_G(flags)[kHampsterState] == 6007) {
series_play_with_breaks(PLAY6, "603wi05", 0xdff, 6010, 3);
} else {
series_play_with_breaks(PLAY6, "603wi05", 0xdff, 6002, 3);
@@ -503,7 +502,7 @@ void Room603::daemon() {
break;
case 15:
- if (_G(flags)[V243] != 6006) {
+ if (_G(flags)[kHampsterState] != 6006) {
_G(wilbur_should) = 10001;
player_set_commands_allowed(false);
ws_demand_facing(2);
@@ -516,7 +515,7 @@ void Room603::daemon() {
case 16:
_G(wilbur_should) = 10001;
- if (_G(flags)[V243] == 6007) {
+ if (_G(flags)[kHampsterState] == 6007) {
wilbur_speech(_G(flags)[V279] ? "603w016" : "603w015");
} else {
kernel_trigger_dispatch_now(0);
@@ -587,7 +586,7 @@ void Room603::daemon() {
void Room603::pre_parser() {
_G(kernel).trigger_mode = KT_DAEMON;
- if (_G(flags)[V243] == 6000 && (player_said("TUBE ") || player_said("TUBE "))) {
+ if (_G(flags)[kHampsterState] == 6000 && (player_said("TUBE ") || player_said("TUBE "))) {
term_message("Can't leave through back tube as gerbils are in the way.");
wilbur_speech("600w003");
intr_cancel_sentence();
@@ -612,7 +611,7 @@ void Room603::pre_parser() {
player_hotspot_walk_override(226, 301, 2, kCHANGE_WILBUR_ANIMATION);
} else if (player_said("WATER DISH") || player_said("WATER")) {
- if (_G(flags)[V243] == 6006) {
+ if (_G(flags)[kHampsterState] == 6006) {
wilbur_speech("600w003");
intr_cancel_sentence();
} else if (player_said("KIBBLE")) {
diff --git a/engines/m4/burger/rooms/section6/room604.cpp b/engines/m4/burger/rooms/section6/room604.cpp
index 60542e62655..a4cc9194aba 100644
--- a/engines/m4/burger/rooms/section6/room604.cpp
+++ b/engines/m4/burger/rooms/section6/room604.cpp
@@ -184,15 +184,15 @@ void Room604::init() {
kernel_trigger_dispatch_now(6013);
}
- if (_G(flags)[V243] == 6006) {
+ if (_G(flags)[kHampsterState] == 6006) {
_G(wilbur_should) = 18;
- Section6::_state3 = 6004;
+ Section6::_gerbilState = 6004;
series_stream("604mg06", 4, 0xc00, 6011);
series_play("604mg06s", 4, 0xc80);
player_set_commands_allowed(false);
}
- switch (_G(flags)[V243]) {
+ switch (_G(flags)[kHampsterState]) {
case 6000:
Section6::_state4 = 0;
break;
@@ -313,21 +313,21 @@ void Room604::daemon() {
break;
case 6011:
- switch (Section6::_state3) {
+ switch (Section6::_gerbilState) {
case 22:
break;
case 23:
- _G(flags)[V243] = 6006;
+ _G(flags)[kHampsterState] = 6006;
_sectionMachine1 = series_play("604mg04", 0xcff, 0, 6011, 8, 0, 100, 0, 0, 0, 50);
_sectionMachine2 = series_play("604mg04s", 0xd00, 0, -1, 8, 0, 100, 0, 0, 0, 50);
Section6::_state4 = 3;
kernel_trigger_dispatch_now(6014);
- Section6::_state3 = 24;
+ Section6::_gerbilState = 24;
break;
case 24:
- Section6::_state3 = 6003;
+ Section6::_gerbilState = 6003;
Section6::_state4 = 4;
kernel_trigger_dispatch_now(6014);
_sectionMachine1 = series_play("604mg04", 0xcff, 0, 6011, 8, 0, 100, 0, 0, 51, -1);
@@ -335,7 +335,7 @@ void Room604::daemon() {
break;
case 6003:
- Section6::_state3 = _G(flags)[V245] == 10030 ? 6005 : 6004;
+ Section6::_gerbilState = _G(flags)[V245] == 10030 ? 6005 : 6004;
_sectionMachine1 = series_show("604mg04", 0xcff, 0, -1, -1, 83, 100, 0, 0);
_sectionMachine2 = series_show("604mg04s", 0xd00, 0, -1, -1, 83, 100, 0, 0);
break;
@@ -386,11 +386,11 @@ void Room604::daemon() {
break;
case 10008:
- if (_G(flags)[V243] == 6000) {
+ if (_G(flags)[kHampsterState] == 6000) {
_G(flags)[V002] = 1;
- _G(flags)[V243] = 6006;
+ _G(flags)[kHampsterState] = 6006;
_G(flags)[V248] = 1;
- Section6::_state3 = 23;
+ Section6::_gerbilState = 23;
kernel_trigger_dispatch_now(6011);
_G(wilbur_should) = 10001;
}
@@ -445,7 +445,7 @@ void Room604::daemon() {
ws_demand_facing(7);
ws_hide_walker();
- if (_G(flags)[V243] == 6007) {
+ if (_G(flags)[kHampsterState] == 6007) {
series_play_with_breaks(PLAY3, "604wi07", 0xc80, 6010, 3);
} else {
series_play_with_breaks(PLAY3, "604wi07", 0xc80, 6002, 3);
@@ -459,10 +459,10 @@ void Room604::daemon() {
ws_hide_walker();
player_set_commands_allowed(false);
- if (_G(flags)[V243] == 6006) {
+ if (_G(flags)[kHampsterState] == 6006) {
Section6::_state4 = 5;
kernel_trigger_dispatch_now(6014);
- Section6::_state3 = 6004;
+ Section6::_gerbilState = 6004;
series_stream("604mg06", 4, 0xc80, 6011);
series_play("604mg06s", 4, 0xc80, 0, -1);
series_play_with_breaks(PLAY4, "604wi08", 0x4ff, kCHANGE_WILBUR_ANIMATION, 3);
@@ -499,11 +499,11 @@ void Room604::daemon() {
player_set_commands_allowed(false);
series_play_with_breaks(PLAY10, "604wi11", 0xa00, kCHANGE_WILBUR_ANIMATION, 3);
- if (_G(flags)[V274] == 0 && _G(flags)[V243] == 600) {
- _G(flags)[V243] = 6006;
+ if (_G(flags)[V274] == 0 && _G(flags)[kHampsterState] == 600) {
+ _G(flags)[kHampsterState] = 6006;
_G(flags)[V248] = 1;
term_message("The gerbils awaken");
- Section6::_state3 = 23;
+ Section6::_gerbilState = 23;
kernel_trigger_dispatch_now(6011);
}
break;
@@ -520,9 +520,9 @@ void Room604::daemon() {
break;
case 12:
- if (_G(flags)[V243] == 6000) {
- _G(flags)[V243] = 6006;
- Section6::_state3 = 23;
+ if (_G(flags)[kHampsterState] == 6000) {
+ _G(flags)[kHampsterState] = 6006;
+ Section6::_gerbilState = 23;
kernel_trigger_dispatch_now(6011);
}
@@ -568,7 +568,7 @@ void Room604::daemon() {
break;
case 17:
- if (_G(flags)[V243] == 6000) {
+ if (_G(flags)[kHampsterState] == 6000) {
if (_G(flags)[V248]) {
_G(wilbur_should) = 11;
player_set_commands_allowed(false);
@@ -599,7 +599,7 @@ void Room604::daemon() {
break;
case 20:
- Section6::_state3 = 23;
+ Section6::_gerbilState = 23;
kernel_trigger_dispatch_now(6011);
ws_unhide_walker();
@@ -623,7 +623,7 @@ void Room604::daemon() {
break;
case 10003:
- if (_G(flags)[V243] == 6000) {
+ if (_G(flags)[kHampsterState] == 6000) {
series_load("604mg04");
series_load("604mg04s");
}
@@ -665,7 +665,7 @@ void Room604::daemon() {
void Room604::pre_parser() {
_G(kernel).trigger_mode = KT_DAEMON;
- if (_G(flags)[V243] == 6006 && player_said("TUBE ")) {
+ if (_G(flags)[kHampsterState] == 6006 && player_said("TUBE ")) {
intr_cancel_sentence();
wilbur_speech("600w003");
@@ -712,7 +712,7 @@ void Room604::parser() {
} else if (player_said("GEAR", "WOOD SHAVINGS")) {
player_set_commands_allowed(false);
- if (_G(flags)[V243] == 6000) {
+ if (_G(flags)[kHampsterState] == 6000) {
_G(wilbur_should) = 9;
wilbur_speech(_G(flags)[V248] ? "604w013" : "604w011",
kCHANGE_WILBUR_ANIMATION);
@@ -742,7 +742,7 @@ void Room604::parser() {
} else if (player_said("LOOK AT", "WOOD SHAVINGS")) {
if (_G(flags)[V248] == 0) {
wilbur_speech("604w007");
- } else if (_G(flags)[V243] == 6000) {
+ } else if (_G(flags)[kHampsterState] == 6000) {
wilbur_speech("604w008");
} else {
wilbur_speech("604w005");
diff --git a/engines/m4/burger/rooms/section6/room609.cpp b/engines/m4/burger/rooms/section6/room609.cpp
index 583de7b20a9..a39652bc0a5 100644
--- a/engines/m4/burger/rooms/section6/room609.cpp
+++ b/engines/m4/burger/rooms/section6/room609.cpp
@@ -48,7 +48,7 @@ void Room609::preload() {
void Room609::init() {
_G(flags)[V277] = 6001;
- _G(flags)[V243] = 6007;
+ _G(flags)[kHampsterState] = 6007;
kernel_trigger_dispatch_now(1);
}
diff --git a/engines/m4/burger/rooms/section6/section6.cpp b/engines/m4/burger/rooms/section6/section6.cpp
index 93d1b996f03..4fa818bc4c3 100644
--- a/engines/m4/burger/rooms/section6/section6.cpp
+++ b/engines/m4/burger/rooms/section6/section6.cpp
@@ -36,7 +36,7 @@ static const seriesPlayBreak PLAY1[] = {
int Section6::_state1;
int Section6::_state2;
-int Section6::_state3;
+int Section6::_gerbilState;
int Section6::_state4;
int Section6::_savedX;
int Section6::_series603;
@@ -55,7 +55,7 @@ Section6::Section6() : Rooms::Section() {
_state1 = 6000;
_state2 = 3;
- _state3 = 0;
+ _gerbilState = 0;
_state4 = 0;
_savedX = 0;
_series603 = 0;
@@ -83,14 +83,14 @@ void Section6::daemon() {
break;
case 6011:
- if (_state3 == 6005)
+ if (_gerbilState == 6005)
kernel_trigger_dispatch_now(6006);
break;
case 6013:
switch (_state1) {
case 6001:
- if (_G(flags)[V243] == 6000) {
+ if (_G(flags)[kHampsterState] == 6000) {
if (_G(game).room_id == 602)
_state4 = 2;
if (_G(game).room_id == 603)
@@ -111,7 +111,7 @@ void Section6::daemon() {
if (_G(game).room_id == 604)
_G(flags)[V245] = 10030;
- if (_G(flags)[V243] == 6000) {
+ if (_G(flags)[kHampsterState] == 6000) {
if (_G(game).room_id == 602)
_state4 = 2;
if (_G(game).room_id == 603)
@@ -158,7 +158,7 @@ void Section6::daemon() {
}
break;
- case 1:
+ case 1:
if (_G(flags)[V245] == 10029) {
term_message("** Ambience: Gerbils snoring with grasshoppers! 60 **");
_val1 = 6002;
@@ -270,10 +270,10 @@ void Section6::daemon() {
series_load("602hop_2");
series_load("602hop_3");
- if (_G(flags)[V243] == 6006)
+ if (_G(flags)[kHampsterState] == 6006)
digi_preload("600_007");
- if (_G(flags)[V243] == 6000) {
+ if (_G(flags)[kHampsterState] == 6000) {
if (_G(game).room_id == 602)
digi_preload("602_003");
if (_G(game).room_id == 603)
@@ -305,7 +305,7 @@ void Section6::daemon() {
break;
case 604:
- if (_G(flags)[V243] == 6006) {
+ if (_G(flags)[kHampsterState] == 6006) {
_G(wilbur_should) = 10002;
player_set_commands_allowed(true);
} else {
@@ -364,7 +364,7 @@ void Section6::parser() {
_G(wilbur_should) = 6000;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
- } else if (player_said("RAY GUN", "GERBILS") && _G(flags)[V243] == 6006) {
+ } else if (player_said("RAY GUN", "GERBILS") && _G(flags)[kHampsterState] == 6006) {
_G(flags)[V247] = 1;
term_message("Taking gun out to shoot gerbils...");
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
diff --git a/engines/m4/burger/rooms/section6/section6.h b/engines/m4/burger/rooms/section6/section6.h
index 1d285e4da85..575dd14bd04 100644
--- a/engines/m4/burger/rooms/section6/section6.h
+++ b/engines/m4/burger/rooms/section6/section6.h
@@ -60,7 +60,7 @@ private:
public:
static int _state1;
static int _state2;
- static int _state3;
+ static int _gerbilState;
static int _state4;
static int _savedX;
static int _series603;
diff --git a/engines/m4/burger/rooms/section6/section6_room.cpp b/engines/m4/burger/rooms/section6/section6_room.cpp
index 3cb7b2760e8..352269fcd61 100644
--- a/engines/m4/burger/rooms/section6/section6_room.cpp
+++ b/engines/m4/burger/rooms/section6/section6_room.cpp
@@ -44,7 +44,7 @@ HotSpotRec *Section6Room::custom_hotspot_which(int32 x, int32 y) {
if (hotspot)
return &_wilburHotspot;
- if (_G(flags)[V243] != 6006 || !_gerbilTable ||
+ if (_G(flags)[kHampsterState] != 6006 || !_gerbilTable ||
!verifyMachineExists(_sectionMachine1) ||
(_G(game).room_id != 602 && _G(game).room_id != 603 &&
_G(game).room_id != 604))
Commit: 619839295f40c1485afdc40aa2df36f68ed18fe3
https://github.com/scummvm/scummvm/commit/619839295f40c1485afdc40aa2df36f68ed18fe3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-12-26T13:27:42-10:00
Commit Message:
M4: Fix gerbils firing in upper cage level
Changed paths:
engines/m4/burger/rooms/section6/room604.cpp
diff --git a/engines/m4/burger/rooms/section6/room604.cpp b/engines/m4/burger/rooms/section6/room604.cpp
index a4cc9194aba..351af26de97 100644
--- a/engines/m4/burger/rooms/section6/room604.cpp
+++ b/engines/m4/burger/rooms/section6/room604.cpp
@@ -27,6 +27,10 @@ namespace M4 {
namespace Burger {
namespace Rooms {
+enum {
+ kCHANGE_GERBILS_ANIMATION = 6011
+};
+
static const char *SAID[][4] = {
{ "WOOD SHAVINGS", nullptr, "604w010", nullptr },
{ "ASHES", "604w015", "604w016", "604w016" },
@@ -187,7 +191,7 @@ void Room604::init() {
if (_G(flags)[kHampsterState] == 6006) {
_G(wilbur_should) = 18;
Section6::_gerbilState = 6004;
- series_stream("604mg06", 4, 0xc00, 6011);
+ series_stream("604mg06", 4, 0xc00, kCHANGE_GERBILS_ANIMATION);
series_play("604mg06s", 4, 0xc80);
player_set_commands_allowed(false);
}
@@ -312,14 +316,14 @@ void Room604::daemon() {
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, 9);
break;
- case 6011:
+ case kCHANGE_GERBILS_ANIMATION:
switch (Section6::_gerbilState) {
case 22:
break;
case 23:
_G(flags)[kHampsterState] = 6006;
- _sectionMachine1 = series_play("604mg04", 0xcff, 0, 6011, 8, 0, 100, 0, 0, 0, 50);
+ _sectionMachine1 = series_play("604mg04", 0xcff, 0, kCHANGE_GERBILS_ANIMATION, 8, 0, 100, 0, 0, 0, 50);
_sectionMachine2 = series_play("604mg04s", 0xd00, 0, -1, 8, 0, 100, 0, 0, 0, 50);
Section6::_state4 = 3;
kernel_trigger_dispatch_now(6014);
@@ -330,7 +334,7 @@ void Room604::daemon() {
Section6::_gerbilState = 6003;
Section6::_state4 = 4;
kernel_trigger_dispatch_now(6014);
- _sectionMachine1 = series_play("604mg04", 0xcff, 0, 6011, 8, 0, 100, 0, 0, 51, -1);
+ _sectionMachine1 = series_play("604mg04", 0xcff, 0, kCHANGE_GERBILS_ANIMATION, 8, 0, 100, 0, 0, 51, -1);
_sectionMachine2 = series_play("604mg04s", 0xd00, 0, -1, 8, 0, 100, 0, 0, 51, -1);
break;
@@ -338,6 +342,7 @@ void Room604::daemon() {
Section6::_gerbilState = _G(flags)[V245] == 10030 ? 6005 : 6004;
_sectionMachine1 = series_show("604mg04", 0xcff, 0, -1, -1, 83, 100, 0, 0);
_sectionMachine2 = series_show("604mg04s", 0xd00, 0, -1, -1, 83, 100, 0, 0);
+ kernel_trigger_dispatch_now(kCHANGE_GERBILS_ANIMATION);
break;
case 6004:
@@ -391,7 +396,7 @@ void Room604::daemon() {
_G(flags)[kHampsterState] = 6006;
_G(flags)[V248] = 1;
Section6::_gerbilState = 23;
- kernel_trigger_dispatch_now(6011);
+ kernel_trigger_dispatch_now(kCHANGE_GERBILS_ANIMATION);
_G(wilbur_should) = 10001;
}
break;
@@ -463,7 +468,7 @@ void Room604::daemon() {
Section6::_state4 = 5;
kernel_trigger_dispatch_now(6014);
Section6::_gerbilState = 6004;
- series_stream("604mg06", 4, 0xc80, 6011);
+ series_stream("604mg06", 4, 0xc80, kCHANGE_GERBILS_ANIMATION);
series_play("604mg06s", 4, 0xc80, 0, -1);
series_play_with_breaks(PLAY4, "604wi08", 0x4ff, kCHANGE_WILBUR_ANIMATION, 3);
} else {
@@ -504,7 +509,7 @@ void Room604::daemon() {
_G(flags)[V248] = 1;
term_message("The gerbils awaken");
Section6::_gerbilState = 23;
- kernel_trigger_dispatch_now(6011);
+ kernel_trigger_dispatch_now(kCHANGE_GERBILS_ANIMATION);
}
break;
@@ -523,7 +528,7 @@ void Room604::daemon() {
if (_G(flags)[kHampsterState] == 6000) {
_G(flags)[kHampsterState] = 6006;
Section6::_gerbilState = 23;
- kernel_trigger_dispatch_now(6011);
+ kernel_trigger_dispatch_now(kCHANGE_GERBILS_ANIMATION);
}
_G(wilbur_should) = 10001;
@@ -600,7 +605,7 @@ void Room604::daemon() {
case 20:
Section6::_gerbilState = 23;
- kernel_trigger_dispatch_now(6011);
+ kernel_trigger_dispatch_now(kCHANGE_GERBILS_ANIMATION);
ws_unhide_walker();
if (_G(flags)[V248]) {
Commit: c876f6d8a1ba28cb9fefad7da901c040ef2bfe6d
https://github.com/scummvm/scummvm/commit/c876f6d8a1ba28cb9fefad7da901c040ef2bfe6d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-12-26T13:27:43-10:00
Commit Message:
M4: Simplify mouse wheel click cursor toggle
It now toggles the cursor between Walk and Use, which is more
convenient for doing stuff
Changed paths:
engines/m4/burger/hotkeys.cpp
engines/m4/burger/hotkeys.h
engines/m4/riddle/hotkeys.cpp
engines/m4/riddle/hotkeys.h
diff --git a/engines/m4/burger/hotkeys.cpp b/engines/m4/burger/hotkeys.cpp
index b4542baeafb..9c66d3b6141 100644
--- a/engines/m4/burger/hotkeys.cpp
+++ b/engines/m4/burger/hotkeys.cpp
@@ -74,13 +74,7 @@ void Hotkeys::toggle_through_cursors(CursorChange cursChange) {
break;
case CURSCHANGE_TOGGLE:
- if (_G(cursor_state) == kARROW) {
- newCursor = _priorCursor;
- _priorCursor = _G(cursor_state);
- } else {
- newCursor = kARROW;
- _priorCursor = _G(cursor_state);
- }
+ newCursor = (_G(cursor_state) == kARROW) ? kUSE : kARROW;
break;
default:
diff --git a/engines/m4/burger/hotkeys.h b/engines/m4/burger/hotkeys.h
index e34ebae2673..24fc39b8898 100644
--- a/engines/m4/burger/hotkeys.h
+++ b/engines/m4/burger/hotkeys.h
@@ -33,7 +33,6 @@ namespace Burger {
struct Hotkeys : public M4::Hotkeys {
private:
static Dialog *_versionDialog;
- cursor_states _priorCursor = kARROW;
private:
static void t_cb(void *, void *);
diff --git a/engines/m4/riddle/hotkeys.cpp b/engines/m4/riddle/hotkeys.cpp
index 48a1cce2473..2341997bee0 100644
--- a/engines/m4/riddle/hotkeys.cpp
+++ b/engines/m4/riddle/hotkeys.cpp
@@ -63,13 +63,7 @@ void Hotkeys::toggle_through_cursors(CursorChange cursChange) {
break;
case CURSCHANGE_TOGGLE:
- if (_G(cursor_state) == kARROW) {
- newCursor = _priorCursor;
- _priorCursor = _G(cursor_state);
- } else {
- newCursor = kARROW;
- _priorCursor = _G(cursor_state);
- }
+ newCursor = (_G(cursor_state) == kARROW) ? kUSE : kARROW;
break;
default:
diff --git a/engines/m4/riddle/hotkeys.h b/engines/m4/riddle/hotkeys.h
index 0a195b029c4..145021c2c2e 100644
--- a/engines/m4/riddle/hotkeys.h
+++ b/engines/m4/riddle/hotkeys.h
@@ -31,9 +31,6 @@ namespace M4 {
namespace Riddle {
struct Hotkeys : public M4::Hotkeys {
-private:
- cursor_states _priorCursor = kARROW;
-
public:
static void t_cb(void *, void *);
static void u_cb(void *, void *);
More information about the Scummvm-git-logs
mailing list