[Scummvm-git-logs] scummvm branch-2-6 -> 363cfcce07b21cc9aea2a071431976756987b7ce

neuromancer noreply at scummvm.org
Tue Jun 21 07:25:13 UTC 2022


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:
3777be9207 HYPNO: update checkpoint after solving one puzzle in spider
12e6e3b0b4 HYPNO: update checkpoint after solving other puzzles in spider
363cfcce07 HYPNO: fix timer usage during bus puzzle (hard) in spider


Commit: 3777be9207eb796ff4911e12c58dfa769b37e683
    https://github.com/scummvm/scummvm/commit/3777be9207eb796ff4911e12c58dfa769b37e683
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-06-21T09:25:33+02:00

Commit Message:
HYPNO: update checkpoint after solving one puzzle in spider

Changed paths:
    engines/hypno/spider/hard.cpp


diff --git a/engines/hypno/spider/hard.cpp b/engines/hypno/spider/hard.cpp
index 2136b41a10b..6ccec657753 100644
--- a/engines/hypno/spider/hard.cpp
+++ b/engines/hypno/spider/hard.cpp
@@ -1117,6 +1117,7 @@ void SpiderEngine::runFuseBox(Code *code) {
 
 		if (hfound && vfound) {
 			_nextLevel = code->levelIfWin;
+			_checkpoint = _nextLevel;
 			return;
 		}
 


Commit: 12e6e3b0b43a998fe68f771ca282e3400843af33
    https://github.com/scummvm/scummvm/commit/12e6e3b0b43a998fe68f771ca282e3400843af33
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-06-21T09:25:33+02:00

Commit Message:
HYPNO: update checkpoint after solving other puzzles in spider

Changed paths:
    engines/hypno/spider/hard.cpp


diff --git a/engines/hypno/spider/hard.cpp b/engines/hypno/spider/hard.cpp
index 6ccec657753..8ebedbd4c82 100644
--- a/engines/hypno/spider/hard.cpp
+++ b/engines/hypno/spider/hard.cpp
@@ -179,6 +179,7 @@ void SpiderEngine::runMatrix(Code *code) {
 			}
 
 			_nextLevel = code->levelIfWin;
+			_checkpoint = _nextLevel;
 			return;
 		}
 
@@ -509,6 +510,7 @@ void SpiderEngine::runNote(Code *code) {
 			}
 
 			_nextLevel = code->levelIfWin;
+			_checkpoint = _nextLevel;
 			return;
 		}
 
@@ -894,8 +896,10 @@ void SpiderEngine::runLock(Code *code) {
 				} else if (act.contains(mousePos)) {
 					if (_sceneState["GS_PUZZLELEVEL"] == 0 && comb[0] == 4 && comb[1] == 0 && comb[2] == 3 && comb[3] == 1 && comb[4] == 2) {
 						_nextLevel = code->levelIfWin;
+						_checkpoint = _nextLevel;
 					} else if (_sceneState["GS_PUZZLELEVEL"] == 1 && comb[0] == 1 && comb[1] == 3 && comb[2] == 4 && comb[3] == 2 && comb[4] == 0) {
 					 	_nextLevel = code->levelIfWin;
+						_checkpoint = _nextLevel;
 					}
 				}
 


Commit: 363cfcce07b21cc9aea2a071431976756987b7ce
    https://github.com/scummvm/scummvm/commit/363cfcce07b21cc9aea2a071431976756987b7ce
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-06-21T09:25:34+02:00

Commit Message:
HYPNO: fix timer usage during bus puzzle (hard) in spider

Changed paths:
    engines/hypno/actions.cpp
    engines/hypno/grammar.h
    engines/hypno/grammar_mis.cpp
    engines/hypno/grammar_mis.y
    engines/hypno/hypno.cpp
    engines/hypno/hypno.h
    engines/hypno/scene.cpp
    engines/hypno/spider/hard.cpp
    engines/hypno/spider/spider.cpp


diff --git a/engines/hypno/actions.cpp b/engines/hypno/actions.cpp
index f54933d4c57..1f0555dadff 100644
--- a/engines/hypno/actions.cpp
+++ b/engines/hypno/actions.cpp
@@ -93,6 +93,8 @@ void HypnoEngine::runTimer(Timer *a) {
 		return; // Do not start another timer
 
 	uint32 delay = a->delay / 1000;
+	if (a->flag == "vus0")
+		_keepTimerDuringScenes = true;
 	debugC(1, kHypnoDebugScene, "Starting timer with %d secons", delay);
 
 	if (delay == 0 || !startCountdown(delay))
diff --git a/engines/hypno/grammar.h b/engines/hypno/grammar.h
index 0f6390ed14f..1ca8851efe6 100644
--- a/engines/hypno/grammar.h
+++ b/engines/hypno/grammar.h
@@ -137,11 +137,13 @@ public:
 
 class Timer : public Action {
 public:
-	Timer(uint32 delay_) {
+	Timer(uint32 delay_, Common::String flag_) {
 		type = TimerAction;
 		delay = delay_;
+		flag = flag_;
 	}
 	uint32 delay;
+	Common::String flag;
 };
 
 class Palette : public Action {
diff --git a/engines/hypno/grammar_mis.cpp b/engines/hypno/grammar_mis.cpp
index d4ce073c7cb..60840809da2 100644
--- a/engines/hypno/grammar_mis.cpp
+++ b/engines/hypno/grammar_mis.cpp
@@ -1334,11 +1334,11 @@ yyreduce:
   case 11: /* line: TIMETOK NUM mflag  */
 #line 148 "engines/hypno/grammar_mis.y"
                               {
-		Timer *a = new Timer((yyvsp[-1].i));
+		Timer *a = new Timer((yyvsp[-1].i), (yyvsp[0].s));
 		Hotspots *cur = stack->back();
 		Hotspot *hot = &cur->back();
 		hot->actions.push_back(a);
-		debugC(1, kHypnoDebugParser, "TIME %d", (yyvsp[-1].i)); }
+		debugC(1, kHypnoDebugParser, "TIME %d %s", (yyvsp[-1].i), (yyvsp[0].s)); }
 #line 1343 "engines/hypno/grammar_mis.cpp"
     break;
 
diff --git a/engines/hypno/grammar_mis.y b/engines/hypno/grammar_mis.y
index c6e8c122477..5ad0c8d5f9c 100644
--- a/engines/hypno/grammar_mis.y
+++ b/engines/hypno/grammar_mis.y
@@ -146,11 +146,11 @@ line: MENUTOK mflag mflag mflag {
 		hot->actions.push_back(a);
 		debugC(1, kHypnoDebugParser, "ESC SUBMENU"); }
 	|  TIMETOK NUM  mflag {
-		Timer *a = new Timer($2);
+		Timer *a = new Timer($2, $3);
 		Hotspots *cur = stack->back();
 		Hotspot *hot = &cur->back();
 		hot->actions.push_back(a);
-		debugC(1, kHypnoDebugParser, "TIME %d", $2); }
+		debugC(1, kHypnoDebugParser, "TIME %d %s", $2, $3); }
 	|  SWPTTOK NUM {
 		SwapPointer *a = new SwapPointer($2);
 		Hotspots *cur = stack->back();
diff --git a/engines/hypno/hypno.cpp b/engines/hypno/hypno.cpp
index 90911a6c896..01556395cde 100644
--- a/engines/hypno/hypno.cpp
+++ b/engines/hypno/hypno.cpp
@@ -56,7 +56,8 @@ HypnoEngine::HypnoEngine(OSystem *syst, const ADGameDescription *gd)
 	  _defaultCursor(""), _defaultCursorIdx(0),  _skipDefeatVideo(false),
 	  _background(nullptr), _masks(nullptr), _musicRate(0),
 	  _additionalVideo(nullptr), _ammo(0), _maxAmmo(0),
-	  _doNotStopSounds(false), _screenW(0), _screenH(0) { // Every games initializes its own resolution
+	  _doNotStopSounds(false), _screenW(0), _screenH(0), // Every games initializes its own resolution
+	  _keepTimerDuringScenes(false) {
 	_rnd = new Common::RandomSource("hypno");
 	_checkpoint = "";
 
@@ -625,6 +626,7 @@ bool HypnoEngine::startCountdown(uint32 delay) {
 
 void HypnoEngine::removeTimers() {
 	_timerStarted = false;
+	_keepTimerDuringScenes = false;
 	g_system->getTimerManager()->removeTimerProc(&alarmCallback);
 	g_system->getTimerManager()->removeTimerProc(&countdownCallback);
 }
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 8d3e5afba8d..c2a1392c40b 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -363,6 +363,7 @@ public:
 	// Timers
 	int32 _countdown;
 	bool _timerStarted;
+	bool _keepTimerDuringScenes;
 	bool startAlarm(uint32, Common::String *);
 	bool startCountdown(uint32);
 	void removeTimers();
diff --git a/engines/hypno/scene.cpp b/engines/hypno/scene.cpp
index f04774cfad3..2a45c8529a6 100644
--- a/engines/hypno/scene.cpp
+++ b/engines/hypno/scene.cpp
@@ -277,7 +277,6 @@ void HypnoEngine::runTransition(Transition *trans) {
 void HypnoEngine::runScene(Scene *scene) {
 	changeScreenMode(scene->resolution);
 	_refreshConversation = false;
-	_timerStarted = false;
 	Common::Event event;
 	Common::Point mousePos;
 	Common::List<uint32> videosToRemove;
@@ -298,7 +297,8 @@ void HypnoEngine::runScene(Scene *scene) {
 			if (lastCountdown == _countdown) {
 			} else if (_countdown > 0) {
 				uint32 c = 251; // red
-				runMenu(stack.back());
+				if (stack.size() > 0)
+					runMenu(stack.back());
 				uint32 minutes = _countdown / 60;
 				uint32 seconds = _countdown % 60;
 				drawString("console", Common::String::format("TIME: %d:%d", minutes, seconds), 80, 10, 60, c);
@@ -306,8 +306,10 @@ void HypnoEngine::runScene(Scene *scene) {
 			} else {
 				assert(!scene->levelIfLose.empty());
 				_nextLevel = scene->levelIfLose;
-				debugC(1, kHypnoDebugScene, "Finishing level and jumping to %s", _nextLevel.c_str());
+				debugC(1, kHypnoDebugScene, "Finishing level with timeout and jumping to %s", _nextLevel.c_str());
 				resetSceneState();
+				removeTimers();
+				_defaultCursorIdx = 0;
 				continue;
 			}
 			lastCountdown = _countdown;
@@ -557,7 +559,8 @@ void HypnoEngine::runScene(Scene *scene) {
 	_escapeSequentialVideoToPlay.clear();
 	_conversation.clear();
 
-	removeTimers();
+	if (!_keepTimerDuringScenes)
+		removeTimers();
 }
 
 void HypnoEngine::showConversation() { error("Function \"%s\" not implemented", __FUNCTION__); }
diff --git a/engines/hypno/spider/hard.cpp b/engines/hypno/spider/hard.cpp
index 8ebedbd4c82..e0802deadd3 100644
--- a/engines/hypno/spider/hard.cpp
+++ b/engines/hypno/spider/hard.cpp
@@ -240,6 +240,7 @@ void SpiderEngine::checkMixture(Code *code) {
 		}
 	}
 	_nextLevel = "<after_bus_hard>";
+	removeTimers();
 }
 
 void SpiderEngine::runNote(Code *code) {
diff --git a/engines/hypno/spider/spider.cpp b/engines/hypno/spider/spider.cpp
index ba907c59168..965e7181daa 100644
--- a/engines/hypno/spider/spider.cpp
+++ b/engines/hypno/spider/spider.cpp
@@ -324,9 +324,19 @@ void SpiderEngine::loadAssetsFullGame() {
 
 	loadSceneLevel("bushard2.mi_", "", prefix);
 	sc = (Scene *) _levels["bushard2.mi_"];
+	sc->levelIfLose = "<over_bus>";
 	Escape *escape = new Escape();
 
-	Hotspots *hs = sc->hots[1].smenu;
+	Hotspots *hs = &sc->hots;
+	Timer *tm = new Timer(600000, "vus0");
+	Actions ac = (*hs)[0].actions;
+	(*hs)[0].actions.clear();
+	(*hs)[0].actions.push_back(tm);
+
+	for (int i = 0; i < int(ac.size()); i++)
+		(*hs)[0].actions.push_back(ac[i]);
+
+	hs = sc->hots[1].smenu;
 	(*hs)[1].actions.push_back(escape);
 
 	cl = new ChangeLevel("<check_mixture>");
@@ -965,7 +975,7 @@ void SpiderEngine::loadAssetsFullGame() {
 
 	Transition *over_bus = new Transition("tryagain.mi_");
 	over_bus->intros.push_back("spider/cine/blcs002s.smk");
-	over_bus->intros.push_back("spider/cine/apt04as.smk");
+	over_bus->intros.push_back("spider/cine/apts04as.smk");
 	_levels["<over_bus>"] = over_bus;
 
 	Transition *over_octo1 = new Transition("tryagain.mi_");




More information about the Scummvm-git-logs mailing list