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

neuromancer noreply at scummvm.org
Sat Apr 16 14:06:21 UTC 2022


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

Summary:
d2c43dd225 HYPNO: redraw menu in spider after conversations
81e256d079 HYPNO: refactor some code into drawAmmo
2c1f8c6d19 HYPNO: load more levels in boyz
ea3bafb784 HYPNO: added ammo count and proper secondary shoot in wet


Commit: d2c43dd2255426de47d0f3d42c8197af7b11eb42
    https://github.com/scummvm/scummvm/commit/d2c43dd2255426de47d0f3d42c8197af7b11eb42
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-04-16T16:05:47+02:00

Commit Message:
HYPNO: redraw menu in spider after conversations

Changed paths:
    engines/hypno/actions.cpp
    engines/hypno/hypno.h
    engines/hypno/scene.cpp


diff --git a/engines/hypno/actions.cpp b/engines/hypno/actions.cpp
index add5cd9262e..8841c0c412e 100644
--- a/engines/hypno/actions.cpp
+++ b/engines/hypno/actions.cpp
@@ -28,11 +28,11 @@ namespace Hypno {
 
 // Actions
 
-void HypnoEngine::runMenu(Hotspots *hs) {
+void HypnoEngine::runMenu(Hotspots *hs, bool only_menu) {
 	Hotspot *h = hs->begin();
 	assert(h->type == MakeMenu);
 	debugC(1, kHypnoDebugScene, "hotspot actions size: %d", h->actions.size());
-	for (Actions::const_iterator itt = h->actions.begin(); itt != h->actions.end(); ++itt) {
+	for (Actions::const_iterator itt = h->actions.begin(); !only_menu && itt != h->actions.end(); ++itt) {
 		Action *action = *itt;
 		switch (action->type) {
 		case QuitAction:
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index b2a5a8c139f..9018f44710a 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -173,7 +173,7 @@ public:
 	void changeCursor(const Graphics::Surface &entry, byte *palette, bool centerCursor = false);
 
 	// Actions
-	void runMenu(Hotspots *hs);
+	void runMenu(Hotspots *hs, bool only_menu = false);
 	void runBackground(Background *a);
 	void runOverlay(Overlay *a);
 	void runMice(Mice *a);
diff --git a/engines/hypno/scene.cpp b/engines/hypno/scene.cpp
index 4dac0737bf5..f81a7c6bf72 100644
--- a/engines/hypno/scene.cpp
+++ b/engines/hypno/scene.cpp
@@ -365,6 +365,7 @@ void HypnoEngine::runScene(Scene *scene) {
 			_nextParallelVideoToPlay.empty() &&
 			_videosPlaying.empty()) {
 			showConversation();
+			runMenu(stack.back(), true);
 			drawScreen();
 			_refreshConversation = false;
 		}


Commit: 81e256d0799d9585c2092a3040b415ec1ad3ae6c
    https://github.com/scummvm/scummvm/commit/81e256d0799d9585c2092a3040b415ec1ad3ae6c
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-04-16T16:05:47+02:00

Commit Message:
HYPNO: refactor some code into drawAmmo

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


diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index c9d4daf58b9..8cdf08b581b 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -159,6 +159,7 @@ void HypnoEngine::loadArcadeLevel(const Common::String &arclevel, const Common::
 
 void HypnoEngine::drawPlayer() { error("Function \"%s\" not implemented", __FUNCTION__); }
 void HypnoEngine::drawHealth() { error("Function \"%s\" not implemented", __FUNCTION__); }
+void HypnoEngine::drawAmmo() {}
 void HypnoEngine::drawShoot(const Common::Point &target) { error("Function \"%s\" not implemented", __FUNCTION__); }
 void HypnoEngine::hitPlayer() { error("Function \"%s\" not implemented", __FUNCTION__); }
 void HypnoEngine::missedTarget(Shoot *s, ArcadeShooting *arc) {}
@@ -532,6 +533,7 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 
 			drawPlayer();
 			drawHealth();
+			drawAmmo();
 		}
 
 		g_system->delayMillis(arc->frameDelay);
diff --git a/engines/hypno/boyz/arcade.cpp b/engines/hypno/boyz/arcade.cpp
index dac1adb2b10..2ffcd5b3aed 100644
--- a/engines/hypno/boyz/arcade.cpp
+++ b/engines/hypno/boyz/arcade.cpp
@@ -94,18 +94,21 @@ void BoyzEngine::drawPlayer() {
 void BoyzEngine::drawHealth() {
 	updateFromScript();
 
-	// Health
 	Common::Rect healthBarBox(0, 0, _healthBar[_currentActor].w, _healthBar[_currentActor].h/2);
 	uint32 c = kHypnoColorWhite; // white
 	_compositeSurface->fillRect(healthBarBox, c);
 	drawImage(_healthBar[_currentActor], 0, 0, true);
+}
+
+void BoyzEngine::drawAmmo() {
+	updateFromScript();
 
-	// Ammo
 	Common::Rect ammoBarBox(320 - _ammoBar[_currentActor].w, 0, 320, _ammoBar[_currentActor].h/2);
-	c = kHypnoColorGreen; // green
+	uint32 c = kHypnoColorGreen; // green
 	_compositeSurface->fillRect(ammoBarBox, c);
 	drawImage(_ammoBar[_currentActor], 320 - _ammoBar[_currentActor].w, 0, true);
 }
+
 void BoyzEngine::hitPlayer() {
 	uint32 c = kHypnoColorRed; // red
 	_compositeSurface->fillRect(Common::Rect(0, 0, _screenW, _screenH), c);
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 9018f44710a..50442a3ec8d 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -293,6 +293,7 @@ public:
 	virtual void drawCursorArcade(const Common::Point &mousePos);
 	virtual void drawPlayer();
 	virtual void drawHealth();
+	virtual void drawAmmo();
 	int _health;
 	int _maxHealth;
 	int _score;
@@ -501,6 +502,7 @@ public:
 
 	void missedTarget(Shoot *s, ArcadeShooting *arc) override;
 	void drawHealth() override;
+	void drawAmmo() override;
 	void drawShoot(const Common::Point &target) override;
 	void hitPlayer() override;
 	void drawPlayer() override;


Commit: 2c1f8c6d19c46b3e32135eb5a6f8ccc5d84bda2a
    https://github.com/scummvm/scummvm/commit/2c1f8c6d19c46b3e32135eb5a6f8ccc5d84bda2a
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-04-16T16:05:47+02:00

Commit Message:
HYPNO: load more levels in boyz

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


diff --git a/engines/hypno/boyz/boyz.cpp b/engines/hypno/boyz/boyz.cpp
index e4af91ce13b..0500f67481b 100644
--- a/engines/hypno/boyz/boyz.cpp
+++ b/engines/hypno/boyz/boyz.cpp
@@ -45,6 +45,8 @@ 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_", "??", "");
 
 	loadLib("sound/", "misc/sound.lib", true);
 


Commit: ea3bafb78430c58b581d1a55d20612d61169526b
    https://github.com/scummvm/scummvm/commit/ea3bafb78430c58b581d1a55d20612d61169526b
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-04-16T16:05:48+02:00

Commit Message:
HYPNO: added ammo count and proper secondary shoot in wet

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


diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index 8cdf08b581b..531e0d97d96 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -525,10 +525,15 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 		}
 
 		if (needsUpdate) {
-			if (shootingPrimary || shootingSecondary) {
+			if (shootingPrimary) {
 				shoot(mousePos, arc);
 				drawShoot(mousePos);
 				shootingPrimary = false;
+			} else if (shootingSecondary) {
+				shoot(mousePos, arc);
+				if (_background->decoder->getCurFrame() % 2 == 0)
+					drawShoot(mousePos);
+				shootingSecondary = clickedSecondaryShoot(mousePos);
 			}
 
 			drawPlayer();
diff --git a/engines/hypno/boyz/arcade.cpp b/engines/hypno/boyz/arcade.cpp
index 2ffcd5b3aed..81e1e7e18cf 100644
--- a/engines/hypno/boyz/arcade.cpp
+++ b/engines/hypno/boyz/arcade.cpp
@@ -95,7 +95,7 @@ void BoyzEngine::drawHealth() {
 	updateFromScript();
 
 	Common::Rect healthBarBox(0, 0, _healthBar[_currentActor].w, _healthBar[_currentActor].h/2);
-	uint32 c = kHypnoColorWhite; // white
+	uint32 c = kHypnoColorWhiteOrBlue; // white
 	_compositeSurface->fillRect(healthBarBox, c);
 	drawImage(_healthBar[_currentActor], 0, 0, true);
 }
diff --git a/engines/hypno/hypno.cpp b/engines/hypno/hypno.cpp
index 16bf5788f3b..593c2cd0790 100644
--- a/engines/hypno/hypno.cpp
+++ b/engines/hypno/hypno.cpp
@@ -54,8 +54,7 @@ HypnoEngine::HypnoEngine(OSystem *syst, const ADGameDescription *gd)
 	  _playerFrameIdx(0), _playerFrameSep(0), _refreshConversation(false),
 	  _countdown(0), _timerStarted(false), _score(0), _lives(0),
 	  _defaultCursor(""), _checkpoint(""), _skipDefeatVideo(false),
-	  _background(nullptr),
-	  _masks(nullptr),
+	  _background(nullptr), _masks(nullptr), _ammo(0), _maxAmmo(0),
 	  _screenW(0), _screenH(0) { // Every games initializes its own resolution
 	_rnd = new Common::RandomSource("hypno");
 
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 50442a3ec8d..169ddccfef9 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -73,7 +73,7 @@ enum HypnoColors {
 	kHypnoNoColor = -1,
 	kHypnoColorRed = 250,
 	kHypnoColorGreen = 251,
-	kHypnoColorWhite = 252,
+	kHypnoColorWhiteOrBlue = 252,
 	kHypnoColorYellow = 253,
 	kHypnoColorBlack = 254,
 	kHypnoColorCyan = 255
@@ -296,6 +296,10 @@ public:
 	virtual void drawAmmo();
 	int _health;
 	int _maxHealth;
+
+	int _ammo;
+	int _maxAmmo;
+
 	int _score;
 	int _bonus;
 	int _lives;
@@ -347,6 +351,7 @@ struct chapterEntry {
 	int energyPos[2];
 	int scorePos[2];
 	int objectivesPos[2];
+	int ammoPos[2];
 	int targetColor;
 };
 
@@ -371,6 +376,7 @@ public:
 	void drawShoot(const Common::Point &target) override;
 	void drawPlayer() override;
 	void drawHealth() override;
+	void drawAmmo() override;
 	void hitPlayer() override;
 	void drawCursorArcade(const Common::Point &mousePos) override;
 	Common::Point computeTargetPosition(const Common::Point &mousePos) override;
diff --git a/engines/hypno/wet/arcade.cpp b/engines/hypno/wet/arcade.cpp
index 6393cc046a7..789d457b15f 100644
--- a/engines/hypno/wet/arcade.cpp
+++ b/engines/hypno/wet/arcade.cpp
@@ -464,6 +464,9 @@ void WetEngine::runBeforeArcade(ArcadeShooting *arc) {
 	}
 
 	_playerFrameIdx = -1;
+
+	_ammo = 150;
+	_maxAmmo = 150;
 }
 
 void WetEngine::pressedKey(const int keycode) {
@@ -498,6 +501,10 @@ void WetEngine::drawCursorArcade(const Common::Point &mousePos) {
 }
 
 bool WetEngine::clickedSecondaryShoot(const Common::Point &mousePos) {
+	if (_ammo <= 0)
+		return false;
+
+	_ammo--;
 	incShotsFired();
 	return clickedPrimaryShoot(mousePos);
 }
@@ -660,6 +667,21 @@ void WetEngine::drawHealth() {
 	}
 }
 
+void WetEngine::drawAmmo() {
+	const chapterEntry *entry = _chapterTable[_levelId];
+	if (entry->ammoPos[0] == 0 && entry->ammoPos[1] == 0)
+		return;
+
+	int d = (13 * (_maxAmmo - _ammo) / _maxAmmo);
+	if (d >= 13)
+		return;
+	Common::Point p(entry->ammoPos[0], entry->ammoPos[1]);
+	Common::Rect r = Common::Rect(p.x, p.y + d, p.x + 15, p.y + 13);
+	uint32 c = kHypnoColorWhiteOrBlue; // blue
+	_compositeSurface->fillRect(r, c);
+}
+
+
 byte *WetEngine::getTargetColor(Common::String name, int levelId) {
 	if (name == "BOSS1" ||  name == "BOSS2" || name == "BOSS3" || name == "BOSS4")
 		return getPalette(kHypnoColorGreen);
diff --git a/engines/hypno/wet/wet.cpp b/engines/hypno/wet/wet.cpp
index 7ed712fd14e..1b7235b4b0e 100644
--- a/engines/hypno/wet/wet.cpp
+++ b/engines/hypno/wet/wet.cpp
@@ -28,27 +28,27 @@
 namespace Hypno {
 
 static const chapterEntry rawChapterTable[] = {
-	{11, {44, 172}, {218, 172}, {0,   0},   kHypnoColorRed}, 	// c11
-	{10, {19, 3},   {246, 3}, 	{246, 11},  kHypnoNoColor}, 	// c10
-	{21, {70, 160}, {180, 160}, {220, 185}, kHypnoColorYellow}, // c21
-	{22, {70, 160}, {180, 160}, {220, 185}, kHypnoColorGreen}, 	// c22
-	{23, {70, 160}, {180, 160}, {220, 185}, kHypnoColorCyan}, 	// c23
-	{20, {128, 150}, {238, 150},{0,   0},   kHypnoColorCyan}, 	// c20
-	{31, {70, 160}, {180, 160}, {220, 185}, kHypnoColorGreen}, 	// c31
-	{32, {70, 160}, {180, 160}, {220, 185}, kHypnoColorRed}, 	// c32
-	{33, {70, 160}, {180, 160}, {220, 185}, kHypnoColorRed}, 	// c33
-	{30, {19, 3},   {246, 3}, 	{246, 11},  kHypnoColorRed}, 	// c30
-	{41, {70, 160}, {180, 160}, {220, 185}, kHypnoColorRed}, 	// c41
-	{42, {70, 160}, {180, 160}, {220, 185}, kHypnoColorRed}, 	// c42
-	{43, {70, 160}, {180, 160}, {220, 185}, kHypnoColorRed}, 	// c43
-	{44, {70, 160}, {180, 160}, {220, 185}, kHypnoColorRed}, 	// c44
-	{40, {19, 3},   {246, 3}, 	{246, 11},  kHypnoColorRed}, 	// c40
-	{51, {60, 167}, {190, 167}, {135, 187}, kHypnoColorRed}, 	// c51
-	{52, {60, 167}, {190, 167}, {135, 187}, kHypnoColorRed}, 	// c52
-	{50, {19, 3},   {246, 3}, 	{246, 11},  kHypnoColorRed}, 	// c50 (fixed)
-	{61, {63, 167}, {187, 167}, {192, 188}, kHypnoColorRed}, 	// c61
-	{60, {63, 167}, {187, 167}, {192, 188}, kHypnoColorRed}, 	// c60
-	{0,  {0,  0},   {0,   0},   {0,   0},   kHypnoColorRed}    	// NULL
+	{11, {44, 172}, {218, 172}, {0,   0},   {127, 172}, kHypnoColorRed}, 	// c11
+	{10, {19, 3},   {246, 3}, 	{246, 11},  {2, 2},     kHypnoNoColor}, 	// c10
+	{21, {70, 160}, {180, 160}, {220, 185}, {44, 162},  kHypnoColorYellow}, // c21
+	{22, {70, 160}, {180, 160}, {220, 185}, {44, 162},  kHypnoColorGreen}, 	// c22
+	{23, {70, 160}, {180, 160}, {220, 185}, {44, 162},  kHypnoColorCyan}, 	// c23
+	{20, {128, 150}, {238, 150},{0,   0},   {0, 0},     kHypnoColorCyan}, 	// c20
+	{31, {70, 160}, {180, 160}, {220, 185}, {44, 162},  kHypnoColorGreen}, 	// c31
+	{32, {70, 160}, {180, 160}, {220, 185}, {44, 162},  kHypnoColorRed}, 	// c32
+	{33, {70, 160}, {180, 160}, {220, 185}, {44, 162},  kHypnoColorRed}, 	// c33
+	{30, {19, 3},   {246, 3}, 	{246, 11},  {0, 0},     kHypnoColorRed}, 	// c30
+	{41, {70, 160}, {180, 160}, {220, 185}, {0, 0},     kHypnoColorRed}, 	// c41
+	{42, {70, 160}, {180, 160}, {220, 185}, {0, 0},     kHypnoColorRed}, 	// c42
+	{43, {70, 160}, {180, 160}, {220, 185}, {0, 0},     kHypnoColorRed}, 	// c43
+	{44, {70, 160}, {180, 160}, {220, 185}, {0, 0},     kHypnoColorRed}, 	// c44
+	{40, {19, 3},   {246, 3}, 	{246, 11},  {0, 0},     kHypnoColorRed}, 	// c40
+	{51, {60, 167}, {190, 167}, {135, 187}, {0, 0},     kHypnoColorRed}, 	// c51
+	{52, {60, 167}, {190, 167}, {135, 187}, {0, 0},     kHypnoColorRed}, 	// c52
+	{50, {19, 3},   {246, 3}, 	{246, 11},  {0, 0},     kHypnoColorRed}, 	// c50 (fixed)
+	{61, {63, 167}, {187, 167}, {192, 188}, {152, 185}, kHypnoColorRed}, 	// c61
+	{60, {63, 167}, {187, 167}, {192, 188}, {152, 185}, kHypnoColorRed}, 	// c60
+	{0,  {0,  0},   {0,   0},   {0,   0},   {0, 0},     kHypnoColorRed}    	// NULL
 };
 
 WetEngine::WetEngine(OSystem *syst, const ADGameDescription *gd) : HypnoEngine(syst, gd) {




More information about the Scummvm-git-logs mailing list