[Scummvm-git-logs] scummvm master -> ea1a4ed679d19e976a04598998364f4a3b4df049

neuromancer noreply at scummvm.org
Mon Dec 20 10:52:03 UTC 2021


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:
ea1a4ed679 HYPNO: implemented file cabinet and fixed more scenes in spider


Commit: ea1a4ed679d19e976a04598998364f4a3b4df049
    https://github.com/scummvm/scummvm/commit/ea1a4ed679d19e976a04598998364f4a3b4df049
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2021-12-20T11:50:47+01:00

Commit Message:
HYPNO: implemented file cabinet and fixed more scenes in spider

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


diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 013423aed5..c96c4453b7 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -301,6 +301,7 @@ private:
 	void runFusePanel(Code *code);
 	void runRecept(Code *code);
 	void runOffice(Code *code);
+	void runFileCabinet(Code *code);
 
 	bool isFuseRust = true;
 	bool isFuseUnreadable = false;
diff --git a/engines/hypno/spider/hard.cpp b/engines/hypno/spider/hard.cpp
index a79600e3f5..a7eb319581 100644
--- a/engines/hypno/spider/hard.cpp
+++ b/engines/hypno/spider/hard.cpp
@@ -37,6 +37,8 @@ void SpiderEngine::runCode(Code *code) {
 		runRecept(code);
 	else if (code->name == "<office>")
 		runOffice(code);
+	else if (code->name == "<file_cabinet>") 
+		runFileCabinet(code);
 	else if (code->name == "<credits>")
 		showCredits();
 	else
@@ -416,8 +418,8 @@ void SpiderEngine::runFusePanel(Code *code) {
 					break;
 
 				if (fuses.contains(mousePos)) {
-				    int x = (mousePos.x - 364) / (235 / 2.);
-				    int y = (mousePos.y - 54) / (355 / 10.);
+					int x = (mousePos.x - 364) / (235 / 2.);
+					int y = (mousePos.y - 54) / (355 / 10.);
 					int s = 10* x + y + 1;
 
 					if (s == 1) {
@@ -447,6 +449,100 @@ void SpiderEngine::runFusePanel(Code *code) {
 	}
 }
 
+void SpiderEngine::runFileCabinet(Code *code) {
+	changeScreenMode("640x480");
+	Common::Point mousePos;
+	Common::Event event;
+
+	uint32 comb[6] = {};
+	Common::Rect sel[6];
+
+	sel[0] = Common::Rect(16, 176, 91, 301);
+	sel[1] = Common::Rect(108, 176, 183, 301);
+
+	sel[2] = Common::Rect(232, 176, 306, 301);
+	sel[3] = Common::Rect(324, 176, 400, 301);
+
+	sel[4] = Common::Rect(453, 176, 526, 301);
+	sel[5] = Common::Rect(545, 176, 618, 301);
+
+	Common::String intro = "spider/cine/spv040s.smk"; 
+	if (!_intros.contains(intro)) {
+		MVideo v(intro, Common::Point(0, 0), false, false, false);
+		runIntro(v);
+		_intros[intro] = true;
+	}
+
+	Frames nums = decodeFrames("spider/int_alof/combo.smk");
+	if (nums.size() != 10)
+		error("Invalid number of digits: %d", nums.size());
+
+	defaultCursor();
+	Common::Rect back(0, 446, 640, 480);
+	loadImage("spider/int_alof/combobg.smk", 0, 0, false);
+	for (int i = 0; i < 6; i++) {
+		drawImage(*nums[comb[i]], sel[i].left, sel[i].top, true);
+	}
+
+	while (!shouldQuit()) {
+
+		while (g_system->getEventManager()->pollEvent(event)) {
+			mousePos = g_system->getEventManager()->getMousePos();
+			// Events
+			switch (event.type) {
+
+			case Common::EVENT_QUIT:
+			case Common::EVENT_RETURN_TO_LAUNCHER:
+				break;
+
+			case Common::EVENT_LBUTTONDOWN:
+				if (back.contains(mousePos)) {
+					if (comb[0] == 3 && comb[1] == 2 && comb[2] == 5 && comb[3] == 7 && comb[4] == 0 && comb[5] == 1) {
+						MVideo v("spider/cine/file0000.smk", Common::Point(0, 0), false, false, false);
+						runIntro(v);
+						_sceneState["GS_SWITCH0"] = 1;
+					}
+
+					_nextLevel = code->levelIfWin;
+					return;
+				}
+
+				for (int i = 0; i < 6; i++) {
+					if (sel[i].contains(mousePos))
+						comb[i] = (comb[i] + 1) % 10;
+				}
+
+				loadImage("spider/int_alof/combobg.smk", 0, 0, false);
+				for (int i = 0; i < 6; i++) {
+					drawImage(*nums[comb[i]], sel[i].left, sel[i].top, true);
+				}
+				break;
+
+			case Common::EVENT_RBUTTONDOWN:
+				for (int i = 0; i < 6; i++)
+					if (sel[i].contains(mousePos)) {
+						if (comb[i] == 0)
+							comb[i] = 9;
+						else
+							comb[i] = comb[i] - 1;
+					}
+
+				loadImage("spider/int_alof/combobg.smk", 0, 0, false);
+				for (int i = 0; i < 6; i++) {
+					drawImage(*nums[comb[i]], sel[i].left, sel[i].top, true);
+				}
+				break;
+
+
+			default:
+				break;
+			}
+		}
+
+		drawScreen();
+		g_system->delayMillis(10);
+	}
+}
 
 void SpiderEngine::showCredits() {
 	changeScreenMode("640x480");
diff --git a/engines/hypno/spider/spider.cpp b/engines/hypno/spider/spider.cpp
index 799c2e7d4c..c055d0fd2b 100644
--- a/engines/hypno/spider/spider.cpp
+++ b/engines/hypno/spider/spider.cpp
@@ -220,8 +220,25 @@ void SpiderEngine::loadAssetsFullGame() {
 	cl = new ChangeLevel("<fuse_panel>");
 	sc->hots[3].actions.push_back(cl);
 
+	Code *file_cabinet = new Code();
+	file_cabinet->name = "<file_cabinet>";
+	file_cabinet->levelIfWin = "<alveroff_selector>";
+	_levels["<file_cabinet>"] = file_cabinet;
+
 	loadSceneLevel("alverofh.mi_", "", prefix);
 	loadSceneLevel("alveroff.mi_", "", prefix);
+	sc = (Scene *) _levels["alveroff.mi_"];
+
+	cl = new ChangeLevel("<tape>");
+	sc->hots[2].actions.push_back(cl);
+
+	cl = new ChangeLevel("<file_cabinet>");
+	sc->hots[3].actions.push_back(cl);
+
+	Transition *tape = new Transition("decide4.mi_");
+	_levels["<tape>"] = tape;
+	_levels["<tape>"]->intros.push_back("spider/cine/iaos001s.smk");
+
 	Transition *alveroff_selector = new Transition("alveroff.mi_", "alverofh.mi_");
 	_levels["<alveroff_selector>"] = alveroff_selector;
 
@@ -259,13 +276,20 @@ void SpiderEngine::loadAssetsFullGame() {
 
 	loadSceneLevel("decide4.mi_", "", prefix);
 	sc = (Scene *) _levels["decide4.mi_"];
+	sc->intros.push_back("cine/apts006s.smk");
 	cl = new ChangeLevel("ball1.mi_");
 	sc->hots[2].actions.push_back(cl);
 	cl = new ChangeLevel("c5"); // depens on the difficulty
 	sc->hots[4].actions.push_back(cl);
 
-	loadArcadeLevel("c5.mi_", "factory1.mi_", prefix);
-	loadArcadeLevel("c5h.mi_", "factory1.mi_", prefix);
+	loadArcadeLevel("c5.mi_", "<trans_apt_6>", prefix);
+	_levels["c5.mi_"]->intros.push_back("cine/ctss001s.smk");
+	loadArcadeLevel("c5h.mi_", "<trans_apt_6>", prefix);
+	_levels["c5h.mi_"]->intros.push_back("cine/ctss001s.smk");
+
+	Transition *trans_apt_6 = new Transition("factory1.mi_");
+	trans_apt_6->intros.push_back("spider/cine/apts06as.smk");
+	_levels["<trans_apt_6>"] = trans_apt_6;
 
 	loadSceneLevel("ball1.mi_", "<note>", prefix);
 	loadSceneLevel("ball2.mi_", "balcony.mi_", prefix);
@@ -277,9 +301,12 @@ void SpiderEngine::loadAssetsFullGame() {
 	_levels["<note>"] = note;
 
 	loadSceneLevel("factory1.mi_", "intercom.mi_", prefix);
+	_levels["factory1.mi_"]->intros.push_back("cine/swc003s.smk");
 	loadSceneLevel("intercom.mi_", "c3", prefix);
 
 	loadArcadeLevel("c3.mi_", "", prefix);
+	_levels["c3.mi_"]->intros.push_back("cine/ctss001s.smk");
+
 	loadArcadeLevel("c3h.mi_", "", prefix);
 
 	loadSceneLevel("movie2.mi_", "", prefix);




More information about the Scummvm-git-logs mailing list