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

neuromancer noreply at scummvm.org
Thu May 5 21:30:05 UTC 2022


This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
fd415adf75 HYPNO: fixed typo in original copyright message
e80408dcf1 HYPNO: fixed platform for boyz
88ac203086 HYPNO: initial implementation of checkTransition in boyz
d00378114f HYPNO: added intro logos and re-ordered levels in boyz
e377f6d44b HYPNO: font loading and basic profile menu in boyz


Commit: fd415adf758699c5e47099bdc1daba9c46f92718
    https://github.com/scummvm/scummvm/commit/fd415adf758699c5e47099bdc1daba9c46f92718
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-05-05T23:22:58+02:00

Commit Message:
HYPNO: fixed typo in original copyright message

Changed paths:
    engines/hypno/detection.cpp


diff --git a/engines/hypno/detection.cpp b/engines/hypno/detection.cpp
index 77d24c3d4e8..00d23af011d 100644
--- a/engines/hypno/detection.cpp
+++ b/engines/hypno/detection.cpp
@@ -295,7 +295,7 @@ public:
 	const char *getOriginalCopyright() const override {
 		return	"Marvel Comics Spider-Man: The Sinister Six (C) Brooklyn Multimedia\n"
 				"Wetlands (C) Hypnotix, Inc.\n"
-				"Soldier Bozy (C) Hypnotix, Inc., Motion Picture Corporation of America Interactive";
+				"Soldier Boyz (C) Hypnotix, Inc., Motion Picture Corporation of America Interactive";
 	}
 
 	const DebugChannelDef *getDebugChannels() const override {


Commit: e80408dcf13e45a85aa83133cf844f6514b38fbb
    https://github.com/scummvm/scummvm/commit/e80408dcf13e45a85aa83133cf844f6514b38fbb
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-05-05T23:22:58+02:00

Commit Message:
HYPNO: fixed platform for boyz

Changed paths:
    engines/hypno/detection.cpp


diff --git a/engines/hypno/detection.cpp b/engines/hypno/detection.cpp
index 00d23af011d..e35767487b2 100644
--- a/engines/hypno/detection.cpp
+++ b/engines/hypno/detection.cpp
@@ -208,7 +208,7 @@ static const ADGameDescription gameDescriptions[] = {
 		AD_ENTRY2s("boyz.exe", "bac1d734f2606dbdd0816dfa7a5cf518", 263347,
 					"setup.exe", "bac1d734f2606dbdd0816dfa7a5cf518", 160740),
 		Common::EN_USA,
-		Common::kPlatformWindows,
+		Common::kPlatformDOS,
 		ADGF_UNSTABLE,
 		GUIO1(GUIO_NOMIDI)
 	},


Commit: 88ac20308627d3dd9cf13dd532ba26873777285c
    https://github.com/scummvm/scummvm/commit/88ac20308627d3dd9cf13dd532ba26873777285c
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-05-05T23:22:58+02:00

Commit Message:
HYPNO: initial implementation of checkTransition in boyz

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


diff --git a/engines/hypno/boyz/arcade.cpp b/engines/hypno/boyz/arcade.cpp
index 81e1e7e18cf..9c17c240dad 100644
--- a/engines/hypno/boyz/arcade.cpp
+++ b/engines/hypno/boyz/arcade.cpp
@@ -135,6 +135,39 @@ void BoyzEngine::findNextSegment(ArcadeShooting *arc) {
 	_segmentIdx = _segmentIdx + 1;
 }
 
+bool BoyzEngine::checkTransition(ArcadeTransitions &transitions, ArcadeShooting *arc) {
+	ArcadeTransition at = *transitions.begin();
+	int ttime = at.time;
+	if (_background->decoder->getCurFrame() > ttime) {
+		if (!at.video.empty()) {
+			_background->decoder->pauseVideo(true);
+			debugC(1, kHypnoDebugArcade, "Playing transition %s", at.video.c_str());
+			MVideo video(at.video, Common::Point(0, 0), false, true, false);
+			disableCursor();
+			runIntro(video);
+
+			if (!at.palette.empty())
+				_currentPalette = at.palette;
+
+			loadPalette(_currentPalette);
+			_background->decoder->pauseVideo(false);
+			drawPlayer();
+			updateScreen(*_background);
+			drawScreen();
+			drawCursorArcade(g_system->getEventManager()->getMousePos());
+		} else if (!at.sound.empty()) {
+			playSound(at.sound, 1);
+		} else
+			error ("Invalid transition at %d", ttime);
+
+		transitions.pop_front();
+		if (!_music.empty())
+			playSound(_music, 0, arc->musicRate); // restore music
+		return true;
+	}
+	return false;
+}
+
 int BoyzEngine::detectTarget(const Common::Point &mousePos) {
 	Common::Point target = computeTargetPosition(mousePos);
 	assert(_shoots.size() <= 1);
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 1f827c2f337..49eac99b721 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -547,6 +547,7 @@ public:
 	void drawPlayer() override;
 	void findNextSegment(ArcadeShooting *arc) override;
 	void initSegment(ArcadeShooting *arc) override;
+	bool checkTransition(ArcadeTransitions &transitions, ArcadeShooting *arc) override;
 
 	private:
 	Graphics::Surface _healthBar[6];


Commit: d00378114f05ae25653e54ea3bea308d327d55fb
    https://github.com/scummvm/scummvm/commit/d00378114f05ae25653e54ea3bea308d327d55fb
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-05-05T23:22:58+02:00

Commit Message:
HYPNO: added intro logos and re-ordered levels in boyz

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


diff --git a/engines/hypno/boyz/boyz.cpp b/engines/hypno/boyz/boyz.cpp
index aaa3c2a331a..505f64ae76f 100644
--- a/engines/hypno/boyz/boyz.cpp
+++ b/engines/hypno/boyz/boyz.cpp
@@ -41,6 +41,15 @@ void BoyzEngine::loadAssets() {
 	Common::ArchiveMemberList files;
 	if (missions->listMembers(files) == 0)
 		error("Failed to load any files from missions.lib");
+
+	Transition *logos = new Transition("c19.mi_");
+	logos->intros.push_back("intro/dclogos.smk");
+	logos->intros.push_back("intro/mplogos.smk");
+	logos->intros.push_back("intro/hyplogos.smk");
+	logos->intros.push_back("intro/sblogos.smk");
+	_levels["<start>"] = logos;
+
+	loadArcadeLevel("c19.mi_", "c11.mi_", "??", "");
 	loadArcadeLevel("c11.mi_", "c12.mi_", "??", "");
 	loadArcadeLevel("c12.mi_", "c14.mi_", "??", "");
 	//loadArcadeLevel("c13.mi_", "??", "??", "");
@@ -48,8 +57,7 @@ void BoyzEngine::loadAssets() {
 	loadArcadeLevel("c15.mi_", "c16.mi_", "??", "");
 	loadArcadeLevel("c16.mi_", "c17.mi_", "??", "");
 	loadArcadeLevel("c17.mi_", "c18.mi_", "??", "");
-	loadArcadeLevel("c18.mi_", "c19.mi_", "??", "");
-	loadArcadeLevel("c19.mi_", "c21.mi_", "??", "");
+	loadArcadeLevel("c18.mi_", "c21.mi_", "??", "");
 
 	loadLib("sound/", "misc/sound.lib", true);
 
@@ -159,7 +167,13 @@ void BoyzEngine::loadAssets() {
 
 	targets->free();
 	delete targets;
-	_nextLevel = "c11.mi_";
+	_nextLevel = "<start>";
+}
+
+Common::String BoyzEngine::findNextLevel(const Transition *trans) {
+	if (trans->nextLevel.empty())
+		error("Invalid transition!");
+	return trans->nextLevel;
 }
 
 Common::String BoyzEngine::findNextLevel(const Common::String &level) { return level; }
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 49eac99b721..22684ebf4fb 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -532,6 +532,7 @@ public:
 	BoyzEngine(OSystem *syst, const ADGameDescription *gd);
 	void loadAssets() override;
 	Common::String findNextLevel(const Common::String &level) override;
+	Common::String findNextLevel(const Transition *trans) override;
 
 	void runBeforeArcade(ArcadeShooting *arc) override;
 	void runAfterArcade(ArcadeShooting *arc) override;


Commit: e377f6d44bb96f71b145efb8fb2ef2fb964a4bec
    https://github.com/scummvm/scummvm/commit/e377f6d44bb96f71b145efb8fb2ef2fb964a4bec
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-05-05T23:22:58+02:00

Commit Message:
HYPNO: font loading and basic profile menu in boyz

Changed paths:
  A engines/hypno/boyz/hard.cpp
    engines/hypno/boyz/boyz.cpp
    engines/hypno/hypno.h
    engines/hypno/module.mk


diff --git a/engines/hypno/boyz/boyz.cpp b/engines/hypno/boyz/boyz.cpp
index 505f64ae76f..514dd7f3c27 100644
--- a/engines/hypno/boyz/boyz.cpp
+++ b/engines/hypno/boyz/boyz.cpp
@@ -42,13 +42,17 @@ void BoyzEngine::loadAssets() {
 	if (missions->listMembers(files) == 0)
 		error("Failed to load any files from missions.lib");
 
-	Transition *logos = new Transition("c19.mi_");
+	Transition *logos = new Transition("<main_menu>");
 	logos->intros.push_back("intro/dclogos.smk");
 	logos->intros.push_back("intro/mplogos.smk");
 	logos->intros.push_back("intro/hyplogos.smk");
 	logos->intros.push_back("intro/sblogos.smk");
 	_levels["<start>"] = logos;
 
+	Code *menu = new Code("<main_menu>");
+	_levels["<main_menu>"] = menu;
+	_levels["<main_menu>"]->levelIfWin = "c19.mi_";
+
 	loadArcadeLevel("c19.mi_", "c11.mi_", "??", "");
 	loadArcadeLevel("c11.mi_", "c12.mi_", "??", "");
 	loadArcadeLevel("c12.mi_", "c14.mi_", "??", "");
@@ -167,9 +171,82 @@ void BoyzEngine::loadAssets() {
 
 	targets->free();
 	delete targets;
+
+	loadLib("", "misc/fonts.lib", true);
+	loadFonts();
+
 	_nextLevel = "<start>";
 }
 
+void BoyzEngine::loadFonts() {
+	Common::File file;
+
+	if (!file.open("block05.fgx"))
+		error("Cannot open font");
+
+	byte *font = (byte *)malloc(file.size());
+	file.read(font, file.size());
+
+	_font05.set_size(file.size()*8);
+	_font05.set_bits((byte *)font);
+
+	file.close();
+	free(font);
+	if (!file.open("scifi08.fgx"))
+		error("Cannot open font");
+
+	font = (byte *)malloc(file.size());
+	file.read(font, file.size());
+
+	_font08.set_size(file.size()*8);
+	_font08.set_bits((byte *)font);
+
+	free(font);
+}
+
+void BoyzEngine::drawString(const Common::String &font, const Common::String &str, int x, int y, int w, uint32 color) {
+	int offset = 0;
+	if (font == "block05.fgx") {
+		for (uint32 c = 0; c < str.size(); c++) {
+
+			offset = 0;
+			if (str[c] == ':')
+				offset = 1;
+			else if (str[c] == '.')
+				offset = 4;
+
+			for (int i = 0; i < 5; i++) {
+				for (int j = 0; j < 5; j++) {
+					if (!_font05.get(275 + 40*str[c] + j*8 + i))
+						_compositeSurface->setPixel(x + 5 - i + 6*c, offset + y + j, color);
+				}
+			}
+		}
+	} else if (font == "scifi08.fgx") {
+		for (uint32 c = 0; c < str.size(); c++) {
+			if (str[c] == 0)
+				continue;
+			assert(str[c] >= 32);
+			offset = 0;
+			if (str[c] == 't')
+				offset = 0;
+			else if (str[c] == 'i' || str[c] == '%')
+				offset = 1;
+			else if (Common::isLower(str[c]) || str[c] == ':')
+				offset = 2;
+
+			for (int i = 0; i < 6; i++) {
+				for (int j = 0; j < 8; j++) {
+					if (!_font08.get(1554 + 72*(str[c]-32) + j*8 + i))
+						_compositeSurface->setPixel(x + 6 - i + 7*c, offset + y + j, color);
+				}
+			}
+		}
+	} else
+		error("Invalid font: '%s'", font.c_str());
+}
+
+
 Common::String BoyzEngine::findNextLevel(const Transition *trans) {
 	if (trans->nextLevel.empty())
 		error("Invalid transition!");
diff --git a/engines/hypno/boyz/hard.cpp b/engines/hypno/boyz/hard.cpp
new file mode 100644
index 00000000000..7a69e23d5c3
--- /dev/null
+++ b/engines/hypno/boyz/hard.cpp
@@ -0,0 +1,89 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/bitarray.h"
+#include "gui/message.h"
+#include "common/events.h"
+#include "common/config-manager.h"
+#include "common/savefile.h"
+
+#include "hypno/hypno.h"
+
+namespace Hypno {
+
+void BoyzEngine::runCode(Code *code) {
+	if (code->name == "<main_menu>")
+		runMainMenu(code);
+	else
+		error("invalid hardcoded level: %s", code->name.c_str());
+}
+
+void BoyzEngine::runMainMenu(Code *code) {
+	Common::Event event;
+	byte *palette;
+	Graphics::Surface *menu = decodeFrame("preload/mainmenu.smk", 0, &palette);
+	loadPalette(palette, 0, 256);
+
+	drawImage(*menu, 0, 0, false);
+	_name.clear();
+	bool cont = true;
+    uint32 c = kHypnoColorWhiteOrBlue; // white
+	while (!shouldQuit() && cont) {
+		while (g_system->getEventManager()->pollEvent(event)) {
+			// Events
+			switch (event.type) {
+
+			case Common::EVENT_QUIT:
+			case Common::EVENT_RETURN_TO_LAUNCHER:
+				break;
+
+			case Common::EVENT_KEYDOWN:
+				if (event.kbd.keycode == Common::KEYCODE_BACKSPACE)
+					_name.deleteLastChar();
+				else if (event.kbd.keycode == Common::KEYCODE_RETURN && !_name.empty()) {
+					cont = false;
+				}
+				else if (Common::isAlpha(event.kbd.keycode)) {
+					playSound("sound/m_choice.raw", 1);
+					_name = _name + char(event.kbd.keycode - 32);
+				}
+
+				drawImage(*menu, 0, 0, false);
+				drawString("block05.fgx", _name, 130, 57, 170, c);
+				break;
+
+			default:
+				break;
+			}
+		}
+
+		drawScreen();
+		g_system->delayMillis(10);
+	}
+
+	_name.toLowercase();
+
+	_nextLevel = code->levelIfWin;
+	menu->free();
+	delete menu;
+}
+
+} // End of namespace Hypno
\ No newline at end of file
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 22684ebf4fb..580d311dce1 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -530,7 +530,9 @@ private:
 class BoyzEngine : public HypnoEngine {
 public:
 	BoyzEngine(OSystem *syst, const ADGameDescription *gd);
+	Common::String _name;
 	void loadAssets() override;
+	void runCode(Code *code) override;
 	Common::String findNextLevel(const Common::String &level) override;
 	Common::String findNextLevel(const Transition *trans) override;
 
@@ -550,7 +552,12 @@ public:
 	void initSegment(ArcadeShooting *arc) override;
 	bool checkTransition(ArcadeTransitions &transitions, ArcadeShooting *arc) override;
 
+	void loadFonts() override;
+	void drawString(const Filename &name, const Common::String &str, int x, int y, int w, uint32 c) override;
+
 	private:
+	void runMainMenu(Code *code);
+
 	Graphics::Surface _healthBar[6];
 	Graphics::Surface _ammoBar[6];
 	Graphics::Surface _portrait[6];
@@ -569,6 +576,8 @@ public:
 	uint32 _currentActor;
 	uint32 _currentWeapon;
 
+	Common::BitArray _font05;
+	Common::BitArray _font08;
 };
 
 } // End of namespace Hypno
diff --git a/engines/hypno/module.mk b/engines/hypno/module.mk
index 1d1c0569bc3..898a0c859fd 100644
--- a/engines/hypno/module.mk
+++ b/engines/hypno/module.mk
@@ -4,6 +4,7 @@ MODULE_OBJS := \
 	actions.o \
 	arcade.o \
 	boyz/arcade.o \
+	boyz/hard.o \
 	boyz/boyz.o \
 	cursors.o \
 	grammar_mis.o \




More information about the Scummvm-git-logs mailing list