[Scummvm-git-logs] scummvm master -> d9d84c3b6261e58c6315f0cf9c8ae8e6db8e41fd
neuromancer
neuromancer at users.noreply.github.com
Wed Nov 10 19:36:02 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:
52ccbeaf0b HYPNO: added HE release of spider-man
d9d84c3b62 HYPNO: added support for intro videos in talks + code refactoring
Commit: 52ccbeaf0bdca4de4f4e3f8e156422efd9af7819
https://github.com/scummvm/scummvm/commit/52ccbeaf0bdca4de4f4e3f8e156422efd9af7819
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2021-11-10T20:35:45+01:00
Commit Message:
HYPNO: added HE release of spider-man
Changed paths:
engines/hypno/detection.cpp
diff --git a/engines/hypno/detection.cpp b/engines/hypno/detection.cpp
index fd74e52c17..b24205637c 100644
--- a/engines/hypno/detection.cpp
+++ b/engines/hypno/detection.cpp
@@ -70,6 +70,16 @@ static const ADGameDescription gameDescriptions[] = {
ADGF_UNSTABLE,
GUIO1(GUIO_NOMIDI)
},
+ {
+ "sinistersix", // HE release
+ 0,
+ AD_ENTRY2s("SPIDER.EXE", "dbd912d6f6724c6d44775fc19cfa8ca0", 483359,
+ "MISSIONS.LIB", "585704e26094cbaf14fbee90798e8d5d", 119945),
+ Common::HE_ISR,
+ Common::kPlatformDOS,
+ ADGF_UNSTABLE,
+ GUIO1(GUIO_NOMIDI)
+ },
{
"wetlands", // Wetlands Demo Disc (November 1995)
"Demo",
Commit: d9d84c3b6261e58c6315f0cf9c8ae8e6db8e41fd
https://github.com/scummvm/scummvm/commit/d9d84c3b6261e58c6315f0cf9c8ae8e6db8e41fd
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2021-11-10T20:35:45+01:00
Commit Message:
HYPNO: added support for intro videos in talks + code refactoring
Changed paths:
engines/hypno/grammar.h
engines/hypno/grammar_mis.cpp
engines/hypno/grammar_mis.y
engines/hypno/hypno.cpp
engines/hypno/hypno.h
engines/hypno/spider/talk.cpp
diff --git a/engines/hypno/grammar.h b/engines/hypno/grammar.h
index c163ce46f7..6dc1d8b6f8 100644
--- a/engines/hypno/grammar.h
+++ b/engines/hypno/grammar.h
@@ -261,6 +261,8 @@ public:
TalkCommands commands;
bool active;
bool escape;
+ Common::Point introPos;
+ Filename intro;
Common::Point boxPos;
Filename background;
Common::Point backgroundPos;
diff --git a/engines/hypno/grammar_mis.cpp b/engines/hypno/grammar_mis.cpp
index 17485cbea9..ee1a3d48ee 100644
--- a/engines/hypno/grammar_mis.cpp
+++ b/engines/hypno/grammar_mis.cpp
@@ -524,8 +524,8 @@ static const yytype_uint16 yyrline[] =
0, 74, 74, 77, 84, 85, 89, 101, 107, 122,
128, 129, 136, 143, 149, 155, 161, 168, 175, 182,
188, 194, 200, 206, 209, 216, 219, 220, 224, 227,
- 230, 234, 235, 240, 246, 247, 253, 259, 265, 272,
- 279, 285, 290, 291, 294, 295, 298, 299, 302, 303
+ 230, 234, 238, 243, 249, 250, 256, 262, 268, 275,
+ 282, 288, 293, 294, 297, 298, 301, 302, 305, 306
};
#endif
@@ -1647,72 +1647,75 @@ yyreduce:
case 31:
#line 234 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- { debugC(1, kHypnoDebugParser, "INTRO %s %d %d", (yyvsp[-2].s), (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1652 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+ {
+ talk_action->intro = (yyvsp[-2].s);
+ talk_action->introPos = Common::Point((yyvsp[-1].i), (yyvsp[0].i));
+ debugC(1, kHypnoDebugParser, "INTRO %s %d %d", (yyvsp[-2].s), (yyvsp[-1].i), (yyvsp[0].i)); }
+#line 1655 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
break;
case 32:
-#line 235 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
+#line 238 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
{
// Unsure how this is different from second
talk_action->second = (yyvsp[-2].s);
talk_action->secondPos = Common::Point((yyvsp[-1].i), (yyvsp[0].i));
debugC(1, kHypnoDebugParser, "DEFAULT %s %d %d", (yyvsp[-2].s), (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1662 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1665 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
break;
case 33:
-#line 240 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
+#line 243 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
{
TalkCommand talk_cmd;
talk_cmd.command = "G";
talk_cmd.path = (yyvsp[-1].s)+2;
talk_action->commands.push_back(talk_cmd);
debugC(1, kHypnoDebugParser, "%s", (yyvsp[-1].s)); }
-#line 1673 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1676 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
break;
case 34:
-#line 246 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
+#line 249 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
{ debugC(1, kHypnoDebugParser, "%s", (yyvsp[-1].s)); }
-#line 1679 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1682 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
break;
case 35:
-#line 247 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
+#line 250 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
{
TalkCommand talk_cmd;
talk_cmd.command = "F";
talk_cmd.num = atoi((yyvsp[-1].s)+2)-1;
talk_action->commands.push_back(talk_cmd);
debugC(1, kHypnoDebugParser, "%s", (yyvsp[-1].s)); }
-#line 1690 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1693 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
break;
case 36:
-#line 253 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
+#line 256 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
{
TalkCommand talk_cmd;
talk_cmd.command = "A";
talk_cmd.num = atoi((yyvsp[-1].s)+2)-1;
talk_action->commands.push_back(talk_cmd);
debugC(1, kHypnoDebugParser, "|A%d", talk_cmd.num); }
-#line 1701 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1704 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
break;
case 37:
-#line 259 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
+#line 262 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
{
TalkCommand talk_cmd;
talk_cmd.command = "D";
talk_cmd.num = atoi((yyvsp[-1].s)+2)-1;
talk_action->commands.push_back(talk_cmd);
debugC(1, kHypnoDebugParser, "%s", (yyvsp[-1].s)); }
-#line 1712 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1715 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
break;
case 38:
-#line 265 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
+#line 268 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
{
TalkCommand talk_cmd;
talk_cmd.command = "P";
@@ -1720,11 +1723,11 @@ yyreduce:
talk_cmd.position = Common::Point((yyvsp[-2].i), (yyvsp[-1].i));
talk_action->commands.push_back(talk_cmd);
debugC(1, kHypnoDebugParser, "%s %d %d", (yyvsp[-3].s), (yyvsp[-2].i), (yyvsp[-1].i)); }
-#line 1724 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1727 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
break;
case 39:
-#line 272 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
+#line 275 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
{
TalkCommand talk_cmd;
talk_cmd.command = "I";
@@ -1732,74 +1735,74 @@ yyreduce:
talk_cmd.position = Common::Point((yyvsp[-2].i), (yyvsp[-1].i));
talk_action->commands.push_back(talk_cmd);
debugC(1, kHypnoDebugParser, "%s %d %d", (yyvsp[-3].s), (yyvsp[-2].i), (yyvsp[-1].i)); }
-#line 1736 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1739 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
break;
case 40:
-#line 279 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
+#line 282 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
{
TalkCommand talk_cmd;
talk_cmd.command = "S";
talk_cmd.variable = (yyvsp[-1].s)+2;
talk_action->commands.push_back(talk_cmd);
debugC(1, kHypnoDebugParser, "%s", (yyvsp[-1].s)); }
-#line 1747 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1750 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
break;
case 41:
-#line 285 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
+#line 288 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
{
TalkCommand talk_cmd;
talk_cmd.command = "L";
talk_action->commands.push_back(talk_cmd);
debugC(1, kHypnoDebugParser, "|L"); }
-#line 1757 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1760 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
break;
case 42:
-#line 290 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
+#line 293 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
{ debugC(1, kHypnoDebugParser, "|E"); }
-#line 1763 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1766 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
break;
case 44:
-#line 294 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
+#line 297 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
{ (yyval.s) = (yyvsp[0].s); debugC(1, kHypnoDebugParser, "name: %s", (yyvsp[0].s)); }
-#line 1769 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1772 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
break;
case 45:
-#line 295 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
+#line 298 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
{ (yyval.s) = scumm_strdup(""); }
-#line 1775 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1778 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
break;
case 46:
-#line 298 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
+#line 301 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
{ (yyval.s) = (yyvsp[0].s); debugC(1, kHypnoDebugParser, "flag: %s", (yyvsp[0].s)); }
-#line 1781 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1784 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
break;
case 47:
-#line 299 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
+#line 302 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
{ (yyval.s) = scumm_strdup(""); }
-#line 1787 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1790 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
break;
case 48:
-#line 302 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
+#line 305 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
{ (yyval.s) = (yyvsp[0].s); debugC(1, kHypnoDebugParser, "switch %s", (yyvsp[0].s)); }
-#line 1793 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1796 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
break;
case 49:
-#line 303 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
+#line 306 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
{ (yyval.s) = scumm_strdup(""); }
-#line 1799 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1802 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
break;
-#line 1803 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1806 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
diff --git a/engines/hypno/grammar_mis.y b/engines/hypno/grammar_mis.y
index 89576b76be..09d3864a06 100644
--- a/engines/hypno/grammar_mis.y
+++ b/engines/hypno/grammar_mis.y
@@ -231,7 +231,10 @@ talk: INACTOK talk {
talk_action->second = $2;
talk_action->secondPos = Common::Point($3, $4);
debugC(1, kHypnoDebugParser, "SECOND %s %d %d", $2, $3, $4); }
- | INTROTOK FILENAME NUM NUM { debugC(1, kHypnoDebugParser, "INTRO %s %d %d", $2, $3, $4); }
+ | INTROTOK FILENAME NUM NUM {
+ talk_action->intro = $2;
+ talk_action->introPos = Common::Point($3, $4);
+ debugC(1, kHypnoDebugParser, "INTRO %s %d %d", $2, $3, $4); }
| DEFAULTTOK FILENAME NUM NUM {
// Unsure how this is different from second
talk_action->second = $2;
diff --git a/engines/hypno/hypno.cpp b/engines/hypno/hypno.cpp
index a0b313548a..fa3d914697 100644
--- a/engines/hypno/hypno.cpp
+++ b/engines/hypno/hypno.cpp
@@ -185,19 +185,27 @@ void HypnoEngine::runLevel(Common::String &name) {
}
}
-void HypnoEngine::runIntro(MVideo &video) {
+void HypnoEngine::runIntros(Videos &videos) {
+ debugC(1, kHypnoDebugScene, "Starting run intros with %d videos!", videos.size());
Common::Event event;
stopSound();
- disableCursor();
- playVideo(video);
+ defaultCursor();
+
+ for (Videos::iterator it = videos.begin(); it != videos.end(); ++it) {
+ playVideo(*it);
+ }
- while (!shouldQuit() && video.decoder) {
+ while (!shouldQuit()) {
while (g_system->getEventManager()->pollEvent(event)) {
// Events
switch (event.type) {
case Common::EVENT_KEYDOWN:
if (event.kbd.keycode == Common::KEYCODE_ESCAPE) {
- skipVideo(video);
+ for (Videos::iterator it = videos.begin(); it != videos.end(); ++it) {
+ if (it->decoder)
+ skipVideo(*it);
+ }
+ videos.clear();
}
break;
@@ -205,21 +213,38 @@ void HypnoEngine::runIntro(MVideo &video) {
break;
}
}
-
- if (video.decoder) {
- if (video.decoder->endOfVideo()) {
- skipVideo(video);
- } else if (video.decoder->needsUpdate()) {
- updateScreen(video);
- drawScreen();
+ bool playing = false;
+ for (Videos::iterator it = videos.begin(); it != videos.end(); ++it) {
+ assert(!it->loop);
+ if (it->decoder) {
+ if (it->decoder->endOfVideo()) {
+ it->decoder->close();
+ delete it->decoder;
+ it->decoder = nullptr;
+ } else {
+ playing = true;
+ if (it->decoder->needsUpdate()) {
+ drawScreen();
+ updateScreen(*it);
+ }
+ }
}
}
-
+ if (!playing) {
+ debugC(1, kHypnoDebugScene, "Not playing anymore!");
+ break;
+ }
g_system->updateScreen();
g_system->delayMillis(10);
}
}
+void HypnoEngine::runIntro(MVideo &video) {
+ Videos tmp;
+ tmp.push_back(video);
+ runIntros(tmp);
+}
+
void HypnoEngine::runCode(Code *code) { error("Function \"%s\" not implemented", __FUNCTION__); }
void HypnoEngine::showCredits() { error("Function \"%s\" not implemented", __FUNCTION__); }
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index a762aaf415..211d356946 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -137,7 +137,6 @@ public:
void changeCursor(const Common::String &cursor);
// Actions
- void runIntro(MVideo &video);
void runMenu(Hotspots hs);
void runBackground(Background *a);
void runOverlay(Overlay *a);
@@ -163,6 +162,8 @@ public:
void drawScreen();
// intros
+ void runIntro(MVideo &video);
+ void runIntros(Videos &videos);
Common::HashMap<Filename, bool> _intros;
// levels
diff --git a/engines/hypno/spider/talk.cpp b/engines/hypno/spider/talk.cpp
index da534dbffc..c8be9aea53 100644
--- a/engines/hypno/spider/talk.cpp
+++ b/engines/hypno/spider/talk.cpp
@@ -27,13 +27,14 @@ namespace Hypno {
void SpiderEngine::showConversation() {
debugC(1, kHypnoDebugScene, "Showing conversation");
- uint32 x;
- uint32 y;
+ uint32 x = 0;
+ uint32 y = 0;
Graphics::Surface *speaker = decodeFrame("dialog/speaker3.smk", 0);
bool activeFound = false;
// First iteration on the talk commands
- for (Actions::const_iterator itt = _conversation.begin(); itt != _conversation.end(); ++itt) {
+ Videos videos;
+ for (Actions::iterator itt = _conversation.begin(); itt != _conversation.end(); ++itt) {
Talk *a = (Talk *)*itt;
if (a->boxPos != Common::Point(0, 0)) {
if (!(x == 0 && x == y))
@@ -42,6 +43,15 @@ void SpiderEngine::showConversation() {
x = a->boxPos.x;
y = a->boxPos.y;
}
+ if (!a->intro.empty() && !_intros.contains(a->intro)) {
+ videos.push_back(MVideo(a->intro, a->introPos, false, false, false));
+ _intros[a->intro] = true;
+ }
+ }
+
+ if (videos.size() > 0) {
+ runIntros(videos);
+ videos.clear();
}
if (x == 0 && x == y)
@@ -78,19 +88,31 @@ void SpiderEngine::showConversation() {
if (!activeFound) {
debugC(1, kHypnoDebugScene, "No active item was found in the current conversation");
// Final iteration on the talk commands
+ bool shouldEscape = false;
for (Actions::const_iterator it = _conversation.begin(); it != _conversation.end(); ++it) {
Talk *a = (Talk *)*it;
if (!a->second.empty()) {
debugC(1, kHypnoDebugScene, "Adding %s to play after the conversation ends", a->second.c_str());
- _nextParallelVideoToPlay.push_back(MVideo(a->second, a->secondPos, false, false, false));
+ videos.push_back(MVideo(a->second, a->secondPos, false, false, false));
}
if (a->escape) {
- _nextSequentialVideoToPlay = _escapeSequentialVideoToPlay;
- _escapeSequentialVideoToPlay.clear();
+ shouldEscape = true;
}
}
+
+ if (videos.size() > 0) {
+ runIntros(videos);
+ videos.clear();
+ }
+
debugC(1, kHypnoDebugScene, "Clearing conversation");
_conversation.clear();
+
+ if (shouldEscape) {
+ runIntros(_escapeSequentialVideoToPlay);
+ _escapeSequentialVideoToPlay.clear();
+ }
+
drawScreen();
}
speaker->free();
More information about the Scummvm-git-logs
mailing list