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

neuromancer noreply at scummvm.org
Wed Apr 13 11:28:28 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:
e8f34aece5 HYPNO: removed usage of background local variable in shoot
99eaf0b092 HYPNO: removed usage of background local variable in missed target functions
fab6e0c7c8 HYPNO: fixed missing tranparent effect in spider demo


Commit: e8f34aece565c91233814ebe6999d78dcf58aab1
    https://github.com/scummvm/scummvm/commit/e8f34aece565c91233814ebe6999d78dcf58aab1
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-04-13T13:28:46+02:00

Commit Message:
HYPNO: removed usage of background local variable in shoot

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 462a502ff84..8e475568899 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -549,7 +549,7 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 
 		if (needsUpdate) {
 			if (shootingPrimary || shootingSecondary) {
-				shoot(mousePos, arc, *_background);
+				shoot(mousePos, arc);
 				drawShoot(mousePos);
 				shootingPrimary = false;
 			}
@@ -621,11 +621,11 @@ void HypnoEngine::drawCursorArcade(const Common::Point &mousePos) {
 
 bool HypnoEngine::clickedPrimaryShoot(const Common::Point &mousePos) { return true; }
 
-void HypnoEngine::shoot(const Common::Point &mousePos, ArcadeShooting *arc, MVideo &background) {
+void HypnoEngine::shoot(const Common::Point &mousePos, ArcadeShooting *arc) {
 	incShotsFired();
 	int i = detectTarget(mousePos);
 	if (i < 0) {
-		missNoTarget(arc, background);
+		missNoTarget(arc, *_background);
 	} else {
 		if (!_shoots[i].hitSound.empty())
 			playSound(_soundPath + _shoots[i].hitSound, 1);
@@ -674,25 +674,25 @@ void HypnoEngine::shoot(const Common::Point &mousePos, ArcadeShooting *arc, MVid
 				_shoots[i].video->position = Common::Point(position.x - w / 2, position.y - h / 2);
 				_shoots[i].lastFrame = explosionLastFrame - 1;
 			} else if (_objIdx == 0 && !arc->hitBoss1Video.empty()) {
-				background.decoder->pauseVideo(true);
+				_background->decoder->pauseVideo(true);
 				MVideo video(arc->hitBoss1Video, Common::Point(0, 0), false, true, false);
 				disableCursor();
 				runIntro(video);
 				// Should be currentPalette?
 				loadPalette(arc->backgroundPalette);
-				background.decoder->pauseVideo(false);
-				updateScreen(background);
+				_background->decoder->pauseVideo(false);
+				updateScreen(*_background);
 				drawScreen();
 				if (!_music.empty())
 					playSound(_music, 0, arc->musicRate); // restore music
 			} else if (_objIdx == 1 && !arc->hitBoss2Video.empty()) {
-				background.decoder->pauseVideo(true);
+				_background->decoder->pauseVideo(true);
 				MVideo video(arc->hitBoss2Video, Common::Point(0, 0), false, true, false);
 				runIntro(video);
 				// Should be currentPalette?
 				loadPalette(arc->backgroundPalette);
-				background.decoder->pauseVideo(false);
-				updateScreen(background);
+				_background->decoder->pauseVideo(false);
+				updateScreen(*_background);
 				drawScreen();
 				drawCursorArcade(mousePos);
 				if (!_music.empty())
diff --git a/engines/hypno/boyz/arcade.cpp b/engines/hypno/boyz/arcade.cpp
index 6c37210f841..cecd351b66f 100644
--- a/engines/hypno/boyz/arcade.cpp
+++ b/engines/hypno/boyz/arcade.cpp
@@ -142,7 +142,7 @@ int BoyzEngine::detectTarget(const Common::Point &mousePos) {
 	return -1;
 }
 
-void BoyzEngine::shoot(const Common::Point &mousePos, ArcadeShooting *arc, MVideo &background) {
+void BoyzEngine::shoot(const Common::Point &mousePos, ArcadeShooting *arc) {
 	if (_currentMode == NonInteractive) {
 		return;
 	}
@@ -151,7 +151,7 @@ void BoyzEngine::shoot(const Common::Point &mousePos, ArcadeShooting *arc, MVide
 	incShotsFired();
 	int i = detectTarget(mousePos);
 	if (i < 0) {
-		missNoTarget(arc, background);
+		missNoTarget(arc, *_background);
 	} else {
 		if (!_shoots[i].hitSound.empty())
 			playSound(_soundPath + _shoots[i].hitSound, 1);
@@ -164,7 +164,7 @@ void BoyzEngine::shoot(const Common::Point &mousePos, ArcadeShooting *arc, MVide
 		incScore(_shoots[i].pointsToShoot);
 		incBonus(_shoots[i].pointsToShoot);
 		_shoots[i].destroyed = true;
-		background.decoder->forceSeekToFrame(_shoots[i].explosionFrames[0].start - 3);
+		_background->decoder->forceSeekToFrame(_shoots[i].explosionFrames[0].start - 3);
 		_masks->decoder->forceSeekToFrame(_shoots[i].explosionFrames[0].start - 3);
 		_shoots.clear();
 		changeCursor(_crosshairsActive[_currentWeapon], _crosshairsPalette, true);
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 90feb17f869..2ad3441e10e 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -247,7 +247,7 @@ public:
 	virtual bool clickedPrimaryShoot(const Common::Point &mousePos);
 	virtual bool clickedSecondaryShoot(const Common::Point &mousePos);
 	virtual void drawShoot(const Common::Point &mousePos);
-	virtual void shoot(const Common::Point &mousePos, ArcadeShooting *arc, MVideo &background);
+	virtual void shoot(const Common::Point &mousePos, ArcadeShooting *arc);
 	virtual void hitPlayer();
 	virtual void missedTarget(Shoot *s, ArcadeShooting *arc, MVideo &background);
 	virtual void missNoTarget(ArcadeShooting *arc, MVideo &background);
@@ -489,7 +489,7 @@ public:
 	void runAfterArcade(ArcadeShooting *arc) override;
 	int detectTarget(const Common::Point &mousePos) override;
 	void drawCursorArcade(const Common::Point &mousePos) override;
-	void shoot(const Common::Point &mousePos, ArcadeShooting *arc, MVideo &background) override;
+	void shoot(const Common::Point &mousePos, ArcadeShooting *arc) override;
 
 	void missedTarget(Shoot *s, ArcadeShooting *arc, MVideo &background) override;
 	void drawHealth() override;


Commit: 99eaf0b092f26429ac1e1f9aa6b5967a5c6458ac
    https://github.com/scummvm/scummvm/commit/99eaf0b092f26429ac1e1f9aa6b5967a5c6458ac
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-04-13T13:28:46+02:00

Commit Message:
HYPNO: removed usage of background local variable in missed target functions

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


diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index 8e475568899..3e2079dec99 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -161,8 +161,8 @@ void HypnoEngine::drawPlayer() { error("Function \"%s\" not implemented", __FUNC
 void HypnoEngine::drawHealth() { error("Function \"%s\" not implemented", __FUNCTION__); }
 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, MVideo &background) {}
-void HypnoEngine::missNoTarget(ArcadeShooting *arc, MVideo &background) {}
+void HypnoEngine::missedTarget(Shoot *s, ArcadeShooting *arc) {}
+void HypnoEngine::missNoTarget(ArcadeShooting *arc) {}
 
 void HypnoEngine::runBeforeArcade(ArcadeShooting *arc) {}
 void HypnoEngine::runAfterArcade(ArcadeShooting *arc) {}
@@ -513,7 +513,7 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 
 				uint32 bodyLastFrame = it->bodyFrames[it->bodyFrames.size() - 1].lastFrame();
 				if (frame > 0 && frame >= (int)(bodyLastFrame - 3) && !it->destroyed) {
-					missedTarget(it, arc, *_background);
+					missedTarget(it, arc);
 					incTargetsMissed();
 					// No need to pop attackFrames or explosionFrames
 					skipVideo(*it->video);
@@ -528,7 +528,7 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 				uint32 bodyLastFrame = it->bodyFrames[it->bodyFrames.size() - 1].lastFrame();
 				if (frame > it->startFrame && frame - it->startFrame > bodyLastFrame)
 					if (!it->destroyed) {
-						missedTarget(it, arc, *_background);
+						missedTarget(it, arc);
 						shootsToRemove.push_back(i);
 					}
 			}
@@ -625,7 +625,7 @@ void HypnoEngine::shoot(const Common::Point &mousePos, ArcadeShooting *arc) {
 	incShotsFired();
 	int i = detectTarget(mousePos);
 	if (i < 0) {
-		missNoTarget(arc, *_background);
+		missNoTarget(arc);
 	} else {
 		if (!_shoots[i].hitSound.empty())
 			playSound(_soundPath + _shoots[i].hitSound, 1);
diff --git a/engines/hypno/boyz/arcade.cpp b/engines/hypno/boyz/arcade.cpp
index cecd351b66f..dac1adb2b10 100644
--- a/engines/hypno/boyz/arcade.cpp
+++ b/engines/hypno/boyz/arcade.cpp
@@ -151,7 +151,7 @@ void BoyzEngine::shoot(const Common::Point &mousePos, ArcadeShooting *arc) {
 	incShotsFired();
 	int i = detectTarget(mousePos);
 	if (i < 0) {
-		missNoTarget(arc, *_background);
+		missNoTarget(arc);
 	} else {
 		if (!_shoots[i].hitSound.empty())
 			playSound(_soundPath + _shoots[i].hitSound, 1);
@@ -171,19 +171,19 @@ void BoyzEngine::shoot(const Common::Point &mousePos, ArcadeShooting *arc) {
 	}
 }
 
-void BoyzEngine::missedTarget(Shoot *s, ArcadeShooting *arc, MVideo &background) {
+void BoyzEngine::missedTarget(Shoot *s, ArcadeShooting *arc) {
 	hitPlayer();
 	if (s->missedAnimation == 0)
 		return;
 	else if (s->missedAnimation == uint32(-1)) {
-		uint32 last = background.decoder->getFrameCount()-1;
-		background.decoder->forceSeekToFrame(last);
+		uint32 last = _background->decoder->getFrameCount()-1;
+		_background->decoder->forceSeekToFrame(last);
 		_masks->decoder->forceSeekToFrame(last);
 		return;
 	}
 
 	s->missedAnimation = s->missedAnimation + 3;
-	background.decoder->forceSeekToFrame(s->missedAnimation);
+	_background->decoder->forceSeekToFrame(s->missedAnimation);
 	_masks->decoder->forceSeekToFrame(s->missedAnimation);
 }
 
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 2ad3441e10e..0c4cb6e0675 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -249,8 +249,8 @@ public:
 	virtual void drawShoot(const Common::Point &mousePos);
 	virtual void shoot(const Common::Point &mousePos, ArcadeShooting *arc);
 	virtual void hitPlayer();
-	virtual void missedTarget(Shoot *s, ArcadeShooting *arc, MVideo &background);
-	virtual void missNoTarget(ArcadeShooting *arc, MVideo &background);
+	virtual void missedTarget(Shoot *s, ArcadeShooting *arc);
+	virtual void missNoTarget(ArcadeShooting *arc);
 	virtual byte *getTargetColor(Common::String name, int levelId);
 
 	// Segments
@@ -373,8 +373,8 @@ public:
 	void hitPlayer() override;
 	void drawCursorArcade(const Common::Point &mousePos) override;
 	Common::Point computeTargetPosition(const Common::Point &mousePos) override;
-	void missedTarget(Shoot *s, ArcadeShooting *arc, MVideo &background) override;
-	void missNoTarget(ArcadeShooting *arc, MVideo &background) override;
+	void missedTarget(Shoot *s, ArcadeShooting *arc) override;
+	void missNoTarget(ArcadeShooting *arc) override;
 
 	void runCode(Code *code) override;
 	Common::String findNextLevel(const Common::String &level) override;
@@ -491,7 +491,7 @@ public:
 	void drawCursorArcade(const Common::Point &mousePos) override;
 	void shoot(const Common::Point &mousePos, ArcadeShooting *arc) override;
 
-	void missedTarget(Shoot *s, ArcadeShooting *arc, MVideo &background) override;
+	void missedTarget(Shoot *s, ArcadeShooting *arc) override;
 	void drawHealth() override;
 	void drawShoot(const Common::Point &target) override;
 	void hitPlayer() override;
diff --git a/engines/hypno/wet/arcade.cpp b/engines/hypno/wet/arcade.cpp
index 70eb8c5216d..f35a0032151 100644
--- a/engines/hypno/wet/arcade.cpp
+++ b/engines/hypno/wet/arcade.cpp
@@ -481,27 +481,27 @@ bool WetEngine::clickedSecondaryShoot(const Common::Point &mousePos) {
 	return clickedPrimaryShoot(mousePos);
 }
 
-void WetEngine::missedTarget(Shoot *s, ArcadeShooting *arc, MVideo &background) {
+void WetEngine::missedTarget(Shoot *s, ArcadeShooting *arc) {
 	if (s->name == "SP_SWITCH_R" || s->name == "SP_SWITCH_L") {
 		_health = 0;
 	} else if (s->name == "SP_LIZARD1") {
 		_health = _health - 15;
-		background.decoder->pauseVideo(true);
+		_background->decoder->pauseVideo(true);
 		MVideo video(arc->additionalVideo, Common::Point(0, 0), false, true, false);
 		runIntro(video);
 		loadPalette(arc->backgroundPalette);
-		background.decoder->pauseVideo(false);
-		updateScreen(background);
+		_background->decoder->pauseVideo(false);
+		updateScreen(*_background);
 		drawScreen();
 	} else if (_levelId == 60 && s->name == "DOOR1") {
 		_health = 0;
-		background.decoder->pauseVideo(true);
+		_background->decoder->pauseVideo(true);
 		// In the last level, the hit boss video is used to store this ending
 		MVideo video(arc->hitBoss1Video, Common::Point(0, 0), false, true, false);
 		runIntro(video);
 		loadPalette(arc->backgroundPalette);
-		background.decoder->pauseVideo(false);
-		updateScreen(background);
+		_background->decoder->pauseVideo(false);
+		updateScreen(*_background);
 		drawScreen();
 		_skipDefeatVideo = true;
 	} else if (s->attackFrames.empty()) {
@@ -510,31 +510,31 @@ void WetEngine::missedTarget(Shoot *s, ArcadeShooting *arc, MVideo &background)
 	}
 }
 
-void WetEngine::missNoTarget(ArcadeShooting *arc, MVideo &background) {
+void WetEngine::missNoTarget(ArcadeShooting *arc) {
 	for (int i = _shoots.size() - 1; i >= 0; --i) {
 		Shoot *it = &_shoots[i];
 		if ((it->name == "SP_BOSS" || it->name == "SP_BOSS1") && !arc->missBoss1Video.empty()) {
-			background.decoder->pauseVideo(true);
+			_background->decoder->pauseVideo(true);
 			MVideo video(arc->missBoss1Video, Common::Point(0, 0), false, true, false);
 			disableCursor();
 			runIntro(video);
 			// Should be currentPalette?
 			loadPalette(arc->backgroundPalette);
-			background.decoder->pauseVideo(false);
-			updateScreen(background);
+			_background->decoder->pauseVideo(false);
+			updateScreen(*_background);
 			drawScreen();
 			if (!_music.empty())
 				playSound(_music, 0, arc->musicRate); // restore music
 			break;
 		} else if (it->name == "SP_BOSS2" && !arc->missBoss2Video.empty()) {
-			background.decoder->pauseVideo(true);
+			_background->decoder->pauseVideo(true);
 			MVideo video(arc->missBoss2Video, Common::Point(0, 0), false, true, false);
 			disableCursor();
 			runIntro(video);
 			// Should be currentPalette?
 			loadPalette(arc->backgroundPalette);
-			background.decoder->pauseVideo(false);
-			updateScreen(background);
+			_background->decoder->pauseVideo(false);
+			updateScreen(*_background);
 			drawScreen();
 			if (!_music.empty())
 				playSound(_music, 0, arc->musicRate); // restore music


Commit: fab6e0c7c8bd10a89c22faba1168c1caf6a1e2d4
    https://github.com/scummvm/scummvm/commit/fab6e0c7c8bd10a89c22faba1168c1caf6a1e2d4
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-04-13T13:28:46+02:00

Commit Message:
HYPNO: fixed missing tranparent effect in spider demo

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


diff --git a/engines/hypno/spider/hard.cpp b/engines/hypno/spider/hard.cpp
index 2fcfb80443d..06a76d96e15 100644
--- a/engines/hypno/spider/hard.cpp
+++ b/engines/hypno/spider/hard.cpp
@@ -92,13 +92,17 @@ void SpiderEngine::runMatrix(Code *code) {
 	delete v;
 	Graphics::Surface *menu;
 	Common::Rect menuArea(0, 0, 0, 0);
-	if (isDemo()) // No hints in demo
+	bool transparent;
+	if (isDemo()) { // No hints in demo
 		menu = decodeFrame("int_main/resume.smk", 0);
-	else
+		transparent = true;
+	} else {
 		menu = decodeFrame("int_main/hint1.smk", 0);
+		transparent = false;
+	}
 
 	menuArea = Common::Rect(0, 0, menu->w, menu->h);
-	drawImage(*menu, 0, 0, false);
+	drawImage(*menu, 0, 0, transparent);
 
 	while (!shouldQuit() && _nextLevel.empty()) {
 




More information about the Scummvm-git-logs mailing list