[Scummvm-git-logs] scummvm master -> 3c3fd1b3421e9bef82051557fc448f454b31ea97

neuromancer noreply at scummvm.org
Sat Jun 11 07:49:50 UTC 2022


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:
a80cd2a111 HYPNO: fixed palette handling when the arcade sequence is not starting in the first frame
3c3fd1b342 HYPNO: added initial implementation of showing stats in boyz


Commit: a80cd2a111ffbcad29579fead2083db13b5c5986
    https://github.com/scummvm/scummvm/commit/a80cd2a111ffbcad29579fead2083db13b5c5986
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-06-11T09:50:22+02:00

Commit Message:
HYPNO: fixed palette handling when the arcade sequence is not starting in the first frame

Changed paths:
    engines/hypno/arcade.cpp


diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index 54dbb43b5a2..b602ec60957 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -250,11 +250,10 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 	}
 	_currentPalette = arc->backgroundPalette;
 	loadPalette(_currentPalette);
-
-	if (segments[_segmentIdx].start > 1) {
-		int start = segments[_segmentIdx].start;
-		_background->decoder->forceSeekToFrame(start);
-		_masks->decoder->forceSeekToFrame(start);
+	int firstFrame = segments[_segmentIdx].start;
+	if (firstFrame > 1) {
+		_background->decoder->forceSeekToFrame(firstFrame);
+		_masks->decoder->forceSeekToFrame(firstFrame);
 		segments[_segmentIdx].start = 1;
 	}
 
@@ -349,7 +348,7 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 
 		if (needsUpdate) {
 			getPlayerPosition(true);
-			if (_background->decoder->getCurFrame() > 0)
+			if (_background->decoder->getCurFrame() > firstFrame)
 				drawScreen();
 			updateScreen(*_background);
 			if (!arc->maskVideo.empty() && _masks->decoder->needsUpdate())


Commit: 3c3fd1b3421e9bef82051557fc448f454b31ea97
    https://github.com/scummvm/scummvm/commit/3c3fd1b3421e9bef82051557fc448f454b31ea97
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-06-11T09:50:22+02:00

Commit Message:
HYPNO: added initial implementation of showing stats in boyz

Changed paths:
    engines/hypno/boyz/arcade.cpp
    engines/hypno/boyz/hard.cpp
    engines/hypno/hypno.h


diff --git a/engines/hypno/boyz/arcade.cpp b/engines/hypno/boyz/arcade.cpp
index bf4b34468d4..1cdaddf5119 100644
--- a/engines/hypno/boyz/arcade.cpp
+++ b/engines/hypno/boyz/arcade.cpp
@@ -92,6 +92,35 @@ void BoyzEngine::runAfterArcade(ArcadeShooting *arc) {
 		return;
 	}
 
+	if (_currentLevel == lastLevelTerritory(_currentLevel)) {
+		byte *palette;
+		int territory = getTerritory(_currentLevel) + 1;
+		Graphics::Surface *stats = decodeFrame("preload/stats.smk", territory, &palette);
+		loadPalette(palette, 0, 256);
+		drawImage(*stats, 0, 0, true);
+		drawString("scifi08.fgx", Common::String::format("%d", _targetsDestroyed + _targetsMissed), 240, 40, 0, kHypnoColorWhiteOrBlue);
+		drawString("scifi08.fgx", Common::String::format("%d", _targetsDestroyed), 240, 54, 0, kHypnoColorWhiteOrBlue);
+		drawString("scifi08.fgx", Common::String::format("%d", _shootsFired), 240, 77, 0, kHypnoColorWhiteOrBlue);
+		drawString("scifi08.fgx", Common::String::format("%d", accuracyRatio()), 240, 92, 0, kHypnoColorWhiteOrBlue);
+		drawString("scifi08.fgx", Common::String::format("%d", -uint32(-1) - _lives), 240, 117, 0, kHypnoColorWhiteOrBlue);
+
+		bool cont = true;
+		while (!shouldQuit() && cont) {
+			Common::Event event;
+			while (g_system->getEventManager()->pollEvent(event)) {
+				switch (event.type) {
+					case Common::EVENT_KEYDOWN:
+					cont = false;
+					break;
+					default:
+					break;
+				}
+			}
+			drawScreen();
+			g_system->delayMillis(10);
+		}
+	}
+
 	_previousHealth = _health;
 	_sceneState[Common::String::format("GS_SEQ_%d", _levelId)] = 1;
 }
diff --git a/engines/hypno/boyz/hard.cpp b/engines/hypno/boyz/hard.cpp
index fe33ab80781..16889327739 100644
--- a/engines/hypno/boyz/hard.cpp
+++ b/engines/hypno/boyz/hard.cpp
@@ -336,6 +336,21 @@ void BoyzEngine::showCredits() {
 	runIntro(c2);
 }
 
+int BoyzEngine::getTerritory(const Common::String &level) {
+	if (Common::matchString(level.c_str(), "c1#.mi_"))
+		return 1;
+	else if (Common::matchString(level.c_str(), "c2#.mi_"))
+		return 2;
+	else if (Common::matchString(level.c_str(), "c3#.mi_"))
+		return 3;
+	else if (Common::matchString(level.c_str(), "c4#.mi_"))
+		return 4;
+	else if (Common::matchString(level.c_str(), "c5#.mi_"))
+		return 5;
+	else
+		error("Invalid territory for level %s", level.c_str());
+}
+
 Common::String BoyzEngine::firstLevelTerritory(const Common::String &level) {
 	if (Common::matchString(level.c_str(), "c1#.mi_"))
 		return "c19.mi_";
@@ -351,4 +366,19 @@ Common::String BoyzEngine::firstLevelTerritory(const Common::String &level) {
 		error("Invalid territory for level %s", level.c_str());
 }
 
+Common::String BoyzEngine::lastLevelTerritory(const Common::String &level) {
+	if (Common::matchString(level.c_str(), "c1#.mi_"))
+		return "c18.mi_";
+	else if (Common::matchString(level.c_str(), "c2#.mi_"))
+		return "c22.mi_";
+	else if (Common::matchString(level.c_str(), "c3#.mi_"))
+		return "c38.mi_";
+	else if (Common::matchString(level.c_str(), "c4#.mi_"))
+		return "c42.mi_";
+	else if (Common::matchString(level.c_str(), "c5#.mi_"))
+		return "c59.mi_";
+	else
+		error("Invalid territory for level %s", level.c_str());
+}
+
 } // End of namespace Hypno
\ No newline at end of file
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 5f200285cb2..ae94675d668 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -599,6 +599,8 @@ public:
 	void runCheckC5(Code *code);
 	void runDifficultyMenu(Code *code);
 	void endCredits(Code *code);
+	int getTerritory(const Common::String &level);
+	Common::String lastLevelTerritory(const Common::String &level);
 	Common::String firstLevelTerritory(const Common::String &level);
 
 	void loadSceneState(Common::SeekableReadStream *stream);




More information about the Scummvm-git-logs mailing list