[Scummvm-git-logs] scummvm master -> 9bcac28b88a8a0733687d54191c6277ad2241063
bluegr
bluegr at gmail.com
Tue Oct 26 00:55:04 UTC 2021
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
aacf47c46e GROOVIE: Cleanup, fixes and comments for the beehive mini-game
9bcac28b88 GROOVIE: Allow the intro videos to be skipped for 11H
Commit: aacf47c46eeda58d8949fca4ee680bdf716abbef
https://github.com/scummvm/scummvm/commit/aacf47c46eeda58d8949fca4ee680bdf716abbef
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2021-10-26T03:53:25+03:00
Commit Message:
GROOVIE: Cleanup, fixes and comments for the beehive mini-game
Changed paths:
engines/groovie/logic/beehive.cpp
engines/groovie/logic/beehive.h
diff --git a/engines/groovie/logic/beehive.cpp b/engines/groovie/logic/beehive.cpp
index 6638ed2bfb..832ea92753 100644
--- a/engines/groovie/logic/beehive.cpp
+++ b/engines/groovie/logic/beehive.cpp
@@ -30,12 +30,6 @@ extern const int8 beehiveLogicTable1[368];
extern const int8 beehiveLogicTable2[800];
}
-BeehiveGame::BeehiveGame() {
-}
-
-BeehiveGame::~BeehiveGame() {
-}
-
void BeehiveGame::run(byte *scriptVariables) {
int8 *hexagons = (int8 *)scriptVariables + 25;
int8 *hexDifference = (int8 *)scriptVariables + 13;
@@ -52,8 +46,8 @@ void BeehiveGame::run(byte *scriptVariables) {
int8 tempState[64];
switch (op) {
- case 0: // init board's hexagons
- memset(_beehiveState, 0, 60);
+ case 0: // Init board's hexagons
+ memset(_beehiveState, 0, HEXCOUNT);
_beehiveState[0] = kBeehiveColorYellow;
_beehiveState[4] = kBeehiveColorRed;
_beehiveState[34] = kBeehiveColorYellow;
@@ -63,7 +57,7 @@ void BeehiveGame::run(byte *scriptVariables) {
return;
case 1:
- memset(hexagons, 0, 60);
+ memset(hexagons, 0, HEXCOUNT);
scriptVariables[85] = 0;
sub02(&v22, tempState);
if (v22) {
@@ -74,17 +68,17 @@ void BeehiveGame::run(byte *scriptVariables) {
}
return;
- case 2:
- memset(hexagons, 0, 60);
+ case 2: // Player clicks on a honey-filled (source) hexagon
+ memset(hexagons, 0, HEXCOUNT);
scriptVariables[85] = 0;
v24 = 10 * scriptVariables[0] + scriptVariables[1];
- sub18(v24, &v22, tempState);
+ selectSourceHexagon(v24, &v22, tempState);
for (int j = 0; j < v22; j++)
scriptVariables[tempState[j] + 25] = kBeehiveColorRed;
scriptVariables[v24 + 25] = kBeehiveColorRed;
return;
- case 3:
+ case 3: // Player moves into an empty (destination) hexagon
scriptVariables[24] = 1;
scriptVariables[4] = 2;
v24 = 10 * scriptVariables[0] + scriptVariables[1];
@@ -94,14 +88,14 @@ void BeehiveGame::run(byte *scriptVariables) {
sub04(v24, v22, (int8 *)scriptVariables);
return;
- case 4:
+ case 4: // Stauf plays
scriptVariables[24] = 1;
scriptVariables[4] = 1;
sub08(&v24, &v22, hexDifference, &v21, (int8 *)scriptVariables + 16, (int8 *)scriptVariables + 17);
// Execute method tail
break;
- case 5:
+ case 5: // Calculate board state after every move
if (scriptVariables[24] == 1) {
scriptVariables[0] = scriptVariables[2];
scriptVariables[1] = scriptVariables[3];
@@ -178,7 +172,7 @@ void BeehiveGame::sub02(int8 *a1, int8 *a2) {
}
if (!*a1) {
- for (int i = 0; i < 61; ++i)
+ for (int i = 0; i < HEXCOUNT; ++i)
if (!_beehiveState[i])
_beehiveState[i] = 1;
}
@@ -284,7 +278,7 @@ void BeehiveGame::sub07(int8 *a1, int8 *a2, int8 *a3, int8 *a4, int8 *a5, int8 *
&& (*a4 = 1, calcMove(_beehiveState, -125, -1, 4, 1, params) == 125)) {
*a1 = -1;
*a2 = -1;
- for (int i = 0; i < 61; ++i) {
+ for (int i = 0; i < HEXCOUNT; ++i) {
if (!_beehiveState[i])
_beehiveState[i] = 1;
}
@@ -304,7 +298,7 @@ void BeehiveGame::sub08(int8 *a1, int8 *a2, int8 *a3, int8 *a4, int8 *a5, int8 *
&& (*a4 = 1, calcMove(_beehiveState, 125, 1, 4, 1, params) == -125)) {
*a1 = -1;
*a2 = -1;
- for (int i = 0; i < 61; ++i) {
+ for (int i = 0; i < HEXCOUNT; ++i) {
if (!_beehiveState[i])
_beehiveState[i] = -1;
}
@@ -462,7 +456,7 @@ void BeehiveGame::sub17(int8 *beehiveState, int8 a2, int8 *a3, int8 *a4, int8 *a
}
}
-void BeehiveGame::sub18(int8 a1, int8 *a2, int8 *a3) {
+void BeehiveGame::selectSourceHexagon(int8 a1, int8 *a2, int8 *a3) {
*a2 = 0;
for (int i = 0; i < 6; i++) {
@@ -501,7 +495,7 @@ int8 BeehiveGame::calcMove(int8 *beehiveState, int8 a2, int8 a3, int8 depth, int
if (sub11(beehiveState, &v15, &v14, &v13, a3, a5, params2)) {
do {
- for (int i = 0; i < 61; i++)
+ for (int i = 0; i < HEXCOUNT; i++)
state[i] = beehiveState[i];
sub15(state, a3, params2);
@@ -542,14 +536,14 @@ int8 BeehiveGame::getHexDifference() {
int8 BeehiveGame::getTotal(int8 *hexagons) {
int8 result = 0;
- for (int i = 0; i < 61; i++)
+ for (int i = 0; i < HEXCOUNT; i++)
result += hexagons[i];
return result;
}
int8 BeehiveGame::findCell(int8 *beehiveState, int8 *pos, int8 key) {
- for (int i = *pos + 1; i < 61; i++) {
+ for (int i = *pos + 1; i < HEXCOUNT; i++) {
if (beehiveState[i] == key) {
*pos = i;
return 1;
diff --git a/engines/groovie/logic/beehive.h b/engines/groovie/logic/beehive.h
index 137776164d..c549a20a17 100644
--- a/engines/groovie/logic/beehive.h
+++ b/engines/groovie/logic/beehive.h
@@ -38,8 +38,8 @@ namespace Groovie {
*/
class BeehiveGame {
public:
- BeehiveGame();
- ~BeehiveGame();
+ BeehiveGame() {}
+ ~BeehiveGame() {}
void run(byte *scriptVariables);
@@ -54,14 +54,15 @@ private:
void sub15(int8 *beehiveState, int8 a2, int8 *a3);
void sub16(int8 a1, int8 a2, int8 *a3, int8 *a4, int8 *a5);
void sub17(int8 *beehiveState, int8 a2, int8 *a3, int8 *a4, int8 *a5);
- void sub18(int8 a1, int8 *a2, int8 *a3);
+ void selectSourceHexagon(int8 a1, int8 *a2, int8 *a3);
int8 sub19(int8 a1, int8 a2);
int8 getHexDifference();
int8 getTotal(int8 *hexagons);
int8 calcMove(int8 *beehiveState, int8 a2, int8 a3, int8 depth, int a5, int8 *a6);
int8 findCell(int8 *beehiveState, int8 *pos, int8 key);
- int8 _beehiveState[61];
+ #define HEXCOUNT 61
+ int8 _beehiveState[HEXCOUNT];
};
Commit: 9bcac28b88a8a0733687d54191c6277ad2241063
https://github.com/scummvm/scummvm/commit/9bcac28b88a8a0733687d54191c6277ad2241063
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2021-10-26T03:54:05+03:00
Commit Message:
GROOVIE: Allow the intro videos to be skipped for 11H
Changed paths:
engines/groovie/script.cpp
diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp
index a2f01cf9b6..4822e642d3 100644
--- a/engines/groovie/script.cpp
+++ b/engines/groovie/script.cpp
@@ -1989,6 +1989,12 @@ void Script::o2_setbackgroundsong() {
void Script::o2_videofromref() {
uint32 fileref = readScript32bits();
+ // Skip the 11th Hour intro videos on right mouse click, instead of
+ // fast-forwarding them. This has the same effect as pressing 'p' twice in
+ // the skulls screen after the Groovie logo
+ if (_version == kGroovieT11H && fileref == 4926 && fileref != _videoRef)
+ _videoSkipAddress = 1417;
+
// Show the debug information just when starting the playback
if (fileref != _videoRef) {
debugC(1, kDebugScript, "Groovie::Script: VIDEOFROMREF(0x%08X) (Not fully imp): Play video file from ref", fileref);
More information about the Scummvm-git-logs
mailing list