[Scummvm-git-logs] scummvm master -> 1383f07e1c0bd0148fc20f9297ec4eb68847ac1b

neuromancer noreply at scummvm.org
Wed Feb 23 19:31:11 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:
ce7886ab67 VIDEO: improved how forceSeekToFrame handles videos when frame to seek is close to the start of the video
cae814de9b HYPNO: correctly parse frame information to display complete attack and death animations
3f1410b7eb HYPNO: cheats are working again in arcade sequences
6e8bea39ba HYPNO: correctly render death sequence using the O command
1383f07e1c HYPNO: remove unused local variables in shoot


Commit: ce7886ab6799a9e4a35c7e18f8d55a3a679061aa
    https://github.com/scummvm/scummvm/commit/ce7886ab6799a9e4a35c7e18f8d55a3a679061aa
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-02-23T20:30:24+01:00

Commit Message:
VIDEO: improved how forceSeekToFrame handles videos when frame to seek is close to the start of the video

Changed paths:
    video/smk_decoder.cpp


diff --git a/video/smk_decoder.cpp b/video/smk_decoder.cpp
index b6e3bf832fd..5a08775d497 100644
--- a/video/smk_decoder.cpp
+++ b/video/smk_decoder.cpp
@@ -428,12 +428,11 @@ bool SmackerDecoder::rewind() {
 }
 
 void SmackerDecoder::forceSeekToFrame(uint frame) {
-	if (frame < 10) {
-		rewind();
-		return;
-	}
-
-	const uint seekFrame = MAX<uint>(frame - 10, 0);
+	uint seekFrame;
+	if (frame >= 10)
+		seekFrame = MAX<uint>(frame - 10, 0);
+	else
+		seekFrame = 0;
 
 	if (!isVideoLoaded())
 		return;


Commit: cae814de9b0e53c00f53704c585babd3c23b2b7b
    https://github.com/scummvm/scummvm/commit/cae814de9b0e53c00f53704c585babd3c23b2b7b
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-02-23T20:30:24+01:00

Commit Message:
HYPNO: correctly parse frame information to display complete attack and death animations

Changed paths:
    engines/hypno/arcade.cpp
    engines/hypno/grammar.h
    engines/hypno/grammar_arc.cpp
    engines/hypno/grammar_arc.y


diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index ca17d524c08..508012770bc 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -411,8 +411,11 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 							s.video = new MVideo(it->animation, it->position, true, false, false);
 							playVideo(*s.video);
 							s.video->currentFrame = s.video->decoder->decodeNextFrame(); // Skip the first frame
-							if (s.attackFrames.size() == 0)
-								s.attackFrames.push_back(s.explosionFrames.back()-3);
+							if (s.attackFrames.size() == 0) {
+								uint32 lastFrame = s.explosionFrames.back().lastFrame(); 
+								s.attackFrames.push_back(lastFrame - 3);
+							}
+							s.lastFrame = s.bodyFrames[s.bodyFrames.size() - 1].lastFrame();
 							loadPalette(s.video->decoder->getPalette() + 3*s.paletteOffset, s.paletteOffset, s.paletteSize);
 							_shoots.push_back(s);
 							playSound(_soundPath + arc->enemySound, 1);
@@ -427,19 +430,21 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 
 		for (Shoots::iterator it = _shoots.begin(); it != _shoots.end(); ++it) {
 			if (it->video && it->video->decoder) {
-				uint32 attackFrame = it->attackFrames.front();
 				int frame = it->video->decoder->getCurFrame();
-				if (frame > 0 && frame >= (int)(attackFrame - 1) && !it->destroyed) {
-					_health = _health - it->attackWeight;
-					hitPlayer();
-					it->attackFrames.pop_front();
+				if (it->attackFrames.size() > 0) {
+					uint32 attackFrame = it->attackFrames.front();
+					if (frame > 0 && frame >= (int)(attackFrame - 1) && !it->destroyed) {
+						_health = _health - it->attackWeight;
+						hitPlayer();
+						it->attackFrames.pop_front();
+					}
 				}
 
-				uint32 explosionFrame = it->explosionFrames.back();
-				if (frame > 0 && frame >= (int)(explosionFrame - 3) && !it->destroyed) {
+				uint32 bodyLastFrame = it->bodyFrames[it->bodyFrames.size() - 1].lastFrame();
+				if (frame > 0 && frame >= (int)(bodyLastFrame - 3) && !it->destroyed) {
 					// No need to pop attackFrames or explosionFrames
 					skipVideo(*it->video);
-				} else if (frame > 0 && frame >= (int)(it->video->decoder->getFrameCount() - 2)) {
+				} else if (frame > 0 && frame >= (int)(it->lastFrame)) {
 					skipVideo(*it->video);
 					shootsToRemove.push_back(i);
 				} else if (it->video->decoder->needsUpdate() && needsUpdate) {
@@ -536,17 +541,20 @@ void HypnoEngine::shoot(const Common::Point &mousePos) {
 			int h = _shoots[i].video->decoder->getHeight();
 			_shoots[i].video->position = Common::Point(mousePos.x - w / 2, mousePos.y - h / 2);
 
-			uint32 explosionFrame = *_shoots[i].explosionFrames.begin();
 			int currentFrame = _shoots[i].video->decoder->getCurFrame();
-			for (Common::List<uint32>::iterator it = _shoots[i].explosionFrames.begin(); it != _shoots[i].explosionFrames.end(); ++it) {
-				if (int(explosionFrame) >= currentFrame)
+			uint32 explosionIdx;
+			for (explosionIdx = 0; explosionIdx < _shoots[i].bodyFrames.size(); explosionIdx++) {
+				if (int(_shoots[i].bodyFrames[explosionIdx].lastFrame()) >= currentFrame)
 					break;
-				explosionFrame = *it;
 			}
+			if (explosionIdx > 0)
+				explosionIdx = explosionIdx - 1;
+
+			uint32 explosionStartFrame = _shoots[i].explosionFrames[explosionIdx].start;
+			uint32 explosionLastFrame = _shoots[i].explosionFrames[explosionIdx].lastFrame();
 			_objKillsCount[_objIdx] = _objKillsCount[_objIdx] + _shoots[i].objKillsCount;
-			if (_shoots[i].video->decoder->getFrameCount() < explosionFrame + 12)
-				explosionFrame = _shoots[i].video->decoder->getFrameCount() - 12;
-			_shoots[i].video->decoder->forceSeekToFrame(explosionFrame + 2);
+			_shoots[i].video->decoder->forceSeekToFrame(explosionStartFrame - 2);
+			_shoots[i].lastFrame = explosionLastFrame - 2;
 		} else {
 			byte p[3] = {0x00, 0x00, 0x00}; // Always black?
 			assert(_shoots[i].paletteSize == 1 || _shoots[i].paletteSize == 0);
diff --git a/engines/hypno/grammar.h b/engines/hypno/grammar.h
index 78955ae5303..280e0f2691d 100644
--- a/engines/hypno/grammar.h
+++ b/engines/hypno/grammar.h
@@ -353,6 +353,20 @@ public:
 	Hotspots hots;
 };
 
+class FrameInfo {
+public:
+	FrameInfo(uint32 start_, uint32 length_) {
+		start = start_;
+		length = length_;
+	}
+
+	uint32 lastFrame() {
+		return start + length;
+	}
+	uint32 start;
+	uint32 length;
+};
+
 class Shoot {
 public:
 	Shoot() {
@@ -367,6 +381,7 @@ public:
 		objMissesCount = 0;
 		animation = "NONE";
 		explosionAnimation = "";
+		lastFrame = 1024;
 	}
 	Common::String name;
 	Filename animation;
@@ -391,7 +406,9 @@ public:
 
 	MVideo *video;
 	Common::List<uint32> attackFrames;
-	Common::List<uint32> explosionFrames;
+	Common::Array<FrameInfo> bodyFrames;
+	Common::Array<FrameInfo> explosionFrames;
+	uint32 lastFrame;
 	Filename explosionAnimation;
 	bool destroyed;
 };
diff --git a/engines/hypno/grammar_arc.cpp b/engines/hypno/grammar_arc.cpp
index 1b5d1b3c6a5..14860e3479f 100644
--- a/engines/hypno/grammar_arc.cpp
+++ b/engines/hypno/grammar_arc.cpp
@@ -580,8 +580,8 @@ static const yytype_int16 yyrline[] =
      204,   209,   214,   220,   225,   230,   235,   242,   243,   246,
      247,   248,   251,   259,   264,   269,   273,   277,   281,   285,
      289,   293,   297,   301,   305,   309,   313,   317,   321,   325,
-     329,   333,   336,   340,   345,   349,   350,   354,   358,   361,
-     362,   365,   366,   369,   373,   380,   381
+     329,   333,   336,   340,   345,   349,   354,   359,   363,   366,
+     367,   370,   371,   374,   378,   385,   386
 };
 #endif
 
@@ -1761,75 +1761,80 @@ yyreduce:
 
   case 65: /* bline: BNTOK NUM NUM  */
 #line 349 "engines/hypno/grammar_arc.y"
-                        { debugC(1, kHypnoDebugParser, "BN %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1766 "engines/hypno/grammar_arc.cpp"
+                        { 
+		FrameInfo fi((yyvsp[0].i), (yyvsp[-1].i));
+		shoot->bodyFrames.push_back(fi);
+		debugC(1, kHypnoDebugParser, "BN %d %d", (yyvsp[-1].i), (yyvsp[0].i)); 
+	}
+#line 1770 "engines/hypno/grammar_arc.cpp"
     break;
 
   case 66: /* bline: KNTOK NUM NUM  */
-#line 350 "engines/hypno/grammar_arc.y"
-                        { 
-		shoot->explosionFrames.push_front((yyvsp[0].i));
+#line 354 "engines/hypno/grammar_arc.y"
+                        {
+		FrameInfo fi((yyvsp[0].i), (yyvsp[-1].i));
+		shoot->explosionFrames.push_back(fi);
 		debugC(1, kHypnoDebugParser, "KN %d %d", (yyvsp[-1].i), (yyvsp[0].i));
 	}
-#line 1775 "engines/hypno/grammar_arc.cpp"
+#line 1780 "engines/hypno/grammar_arc.cpp"
     break;
 
   case 67: /* bline: P0TOK NUM NUM  */
-#line 354 "engines/hypno/grammar_arc.y"
+#line 359 "engines/hypno/grammar_arc.y"
                         { 
 		shoot->paletteSize = (yyvsp[-1].i);
 		shoot->paletteOffset = (yyvsp[0].i);
 		debugC(1, kHypnoDebugParser, "P0 %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1784 "engines/hypno/grammar_arc.cpp"
+#line 1789 "engines/hypno/grammar_arc.cpp"
     break;
 
   case 68: /* bline: OTOK NUM NUM  */
-#line 358 "engines/hypno/grammar_arc.y"
+#line 363 "engines/hypno/grammar_arc.y"
                        { 
 		debugC(1, kHypnoDebugParser, "O %d %d", (yyvsp[-1].i), (yyvsp[0].i)); 
 	}
-#line 1792 "engines/hypno/grammar_arc.cpp"
+#line 1797 "engines/hypno/grammar_arc.cpp"
     break;
 
   case 69: /* bline: CTOK NUM  */
-#line 361 "engines/hypno/grammar_arc.y"
+#line 366 "engines/hypno/grammar_arc.y"
                     { debugC(1, kHypnoDebugParser, "C %d", (yyvsp[0].i)); }
-#line 1798 "engines/hypno/grammar_arc.cpp"
+#line 1803 "engines/hypno/grammar_arc.cpp"
     break;
 
   case 70: /* bline: HTOK NUM  */
-#line 362 "engines/hypno/grammar_arc.y"
+#line 367 "engines/hypno/grammar_arc.y"
                     {
 		shoot->attackFrames.push_back((yyvsp[0].i)); 
 		debugC(1, kHypnoDebugParser, "H %d", (yyvsp[0].i)); }
-#line 1806 "engines/hypno/grammar_arc.cpp"
+#line 1811 "engines/hypno/grammar_arc.cpp"
     break;
 
   case 71: /* bline: VTOK NUM  */
-#line 365 "engines/hypno/grammar_arc.y"
+#line 370 "engines/hypno/grammar_arc.y"
                     { debugC(1, kHypnoDebugParser, "V %d", (yyvsp[0].i)); }
-#line 1812 "engines/hypno/grammar_arc.cpp"
+#line 1817 "engines/hypno/grammar_arc.cpp"
     break;
 
   case 72: /* bline: WTOK NUM  */
-#line 366 "engines/hypno/grammar_arc.y"
+#line 371 "engines/hypno/grammar_arc.y"
                     {
 		shoot->attackWeight = (yyvsp[0].i);  
 		debugC(1, kHypnoDebugParser, "W %d", (yyvsp[0].i)); }
-#line 1820 "engines/hypno/grammar_arc.cpp"
+#line 1825 "engines/hypno/grammar_arc.cpp"
     break;
 
   case 73: /* bline: DTOK NUM  */
-#line 369 "engines/hypno/grammar_arc.y"
+#line 374 "engines/hypno/grammar_arc.y"
                     {
 		shoot->pointsToShoot = (yyvsp[0].i);  
 		debugC(1, kHypnoDebugParser, "D %d", (yyvsp[0].i)); 
 	}
-#line 1829 "engines/hypno/grammar_arc.cpp"
+#line 1834 "engines/hypno/grammar_arc.cpp"
     break;
 
   case 74: /* bline: SNTOK FILENAME enc  */
-#line 373 "engines/hypno/grammar_arc.y"
+#line 378 "engines/hypno/grammar_arc.y"
                              { 
 		if (Common::String("S1") == (yyvsp[-2].s))
 			shoot->deathSound = (yyvsp[-1].s);
@@ -1837,28 +1842,28 @@ yyreduce:
 			shoot->hitSound = (yyvsp[-1].s);
 		 
 		debugC(1, kHypnoDebugParser, "SN %s", (yyvsp[-1].s)); }
-#line 1841 "engines/hypno/grammar_arc.cpp"
+#line 1846 "engines/hypno/grammar_arc.cpp"
     break;
 
   case 75: /* bline: NTOK  */
-#line 380 "engines/hypno/grammar_arc.y"
+#line 385 "engines/hypno/grammar_arc.y"
                { debugC(1, kHypnoDebugParser, "N"); }
-#line 1847 "engines/hypno/grammar_arc.cpp"
+#line 1852 "engines/hypno/grammar_arc.cpp"
     break;
 
   case 76: /* bline: ZTOK  */
-#line 381 "engines/hypno/grammar_arc.y"
+#line 386 "engines/hypno/grammar_arc.y"
                {
 		g_parsedArc->shoots.push_back(*shoot); 
 		//delete shoot; 
 		//shoot = nullptr;
 		debugC(1, kHypnoDebugParser, "Z"); 
 	}
-#line 1858 "engines/hypno/grammar_arc.cpp"
+#line 1863 "engines/hypno/grammar_arc.cpp"
     break;
 
 
-#line 1862 "engines/hypno/grammar_arc.cpp"
+#line 1867 "engines/hypno/grammar_arc.cpp"
 
       default: break;
     }
diff --git a/engines/hypno/grammar_arc.y b/engines/hypno/grammar_arc.y
index 29fe3befa6a..42a9cc3d69b 100644
--- a/engines/hypno/grammar_arc.y
+++ b/engines/hypno/grammar_arc.y
@@ -346,9 +346,14 @@ bline: FNTOK FILENAME {
 		shoot->objKillsCount = $2;
 		shoot->objMissesCount = $3;
 		debugC(1, kHypnoDebugParser, "R0/1 %d %d", $2, $3); }
-	| BNTOK NUM NUM { debugC(1, kHypnoDebugParser, "BN %d %d", $2, $3); }
-	| KNTOK NUM NUM { 
-		shoot->explosionFrames.push_front($3);
+	| BNTOK NUM NUM { 
+		FrameInfo fi($3, $2);
+		shoot->bodyFrames.push_back(fi);
+		debugC(1, kHypnoDebugParser, "BN %d %d", $2, $3); 
+	}
+	| KNTOK NUM NUM {
+		FrameInfo fi($3, $2);
+		shoot->explosionFrames.push_back(fi);
 		debugC(1, kHypnoDebugParser, "KN %d %d", $2, $3);
 	}
 	| P0TOK NUM NUM { 


Commit: 3f1410b7eb65fbc449169d0f0fc40cf7100a0bc1
    https://github.com/scummvm/scummvm/commit/3f1410b7eb65fbc449169d0f0fc40cf7100a0bc1
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-02-23T20:30:24+01:00

Commit Message:
HYPNO: cheats are working again in arcade sequences

Changed paths:
    engines/hypno/arcade.cpp


diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index 508012770bc..e60746c31e9 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -235,7 +235,6 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 	debugC(1, kHypnoDebugArcade, "Using frame delay: %d", arc->frameDelay);
 
 	Common::Event event;
-	bool levelComplete = false;
 	while (!shouldQuit()) {
 		//debug("frame: %d", background.decoder->getCurFrame());
 		needsUpdate = background.decoder->needsUpdate();
@@ -353,10 +352,10 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 				needsUpdate = true;
 				continue;
 			} else 
-				levelComplete = true;
+				_skipLevel = true;
 		}
 
-		if (segments[_segmentIdx].end || levelComplete) {
+		if (segments[_segmentIdx].end || _skipLevel) {
 			skipVideo(background);
 			// Objectives
 			if ((_objKillsCount[_objIdx] > 0 || _objMissesCount[_objIdx] > 0) && !_skipLevel) {


Commit: 6e8bea39bac30e354377045e80de258edb9cab40
    https://github.com/scummvm/scummvm/commit/6e8bea39bac30e354377045e80de258edb9cab40
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-02-23T20:30:24+01:00

Commit Message:
HYPNO: correctly render death sequence using the O command

Changed paths:
    engines/hypno/arcade.cpp
    engines/hypno/grammar.h
    engines/hypno/grammar_arc.cpp
    engines/hypno/grammar_arc.y


diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index e60746c31e9..a67daa0c5ee 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -538,7 +538,8 @@ void HypnoEngine::shoot(const Common::Point &mousePos) {
 		if (_shoots[i].animation != "NONE") {
 			int w = _shoots[i].video->decoder->getWidth();
 			int h = _shoots[i].video->decoder->getHeight();
-			_shoots[i].video->position = Common::Point(mousePos.x - w / 2, mousePos.y - h / 2);
+			if (_shoots[i].deathPosition.x != 0 && _shoots[i].deathPosition.y != 0)
+				_shoots[i].video->position = Common::Point(mousePos.x, mousePos.y) - _shoots[i].deathPosition;
 
 			int currentFrame = _shoots[i].video->decoder->getCurFrame();
 			uint32 explosionIdx;
diff --git a/engines/hypno/grammar.h b/engines/hypno/grammar.h
index 280e0f2691d..edb37f27a88 100644
--- a/engines/hypno/grammar.h
+++ b/engines/hypno/grammar.h
@@ -387,6 +387,8 @@ public:
 	Filename animation;
 	Filename startSound;
 	Common::Point position;
+	Common::Point deathPosition;
+
 
 	uint32 timesToShoot;
 	uint32 pointsToShoot;
diff --git a/engines/hypno/grammar_arc.cpp b/engines/hypno/grammar_arc.cpp
index 14860e3479f..66d0731f864 100644
--- a/engines/hypno/grammar_arc.cpp
+++ b/engines/hypno/grammar_arc.cpp
@@ -580,8 +580,8 @@ static const yytype_int16 yyrline[] =
      204,   209,   214,   220,   225,   230,   235,   242,   243,   246,
      247,   248,   251,   259,   264,   269,   273,   277,   281,   285,
      289,   293,   297,   301,   305,   309,   313,   317,   321,   325,
-     329,   333,   336,   340,   345,   349,   354,   359,   363,   366,
-     367,   370,   371,   374,   378,   385,   386
+     329,   333,   336,   340,   345,   349,   354,   359,   363,   369,
+     370,   373,   374,   377,   381,   388,   389
 };
 #endif
 
@@ -1790,51 +1790,54 @@ yyreduce:
 
   case 68: /* bline: OTOK NUM NUM  */
 #line 363 "engines/hypno/grammar_arc.y"
-                       { 
+                       {
+		if ((yyvsp[-1].i) == 0 && (yyvsp[0].i) == 0)
+			error("Invalid O command (0, 0)");
+		shoot->deathPosition = Common::Point((yyvsp[-1].i), (yyvsp[0].i));
 		debugC(1, kHypnoDebugParser, "O %d %d", (yyvsp[-1].i), (yyvsp[0].i)); 
 	}
-#line 1797 "engines/hypno/grammar_arc.cpp"
+#line 1800 "engines/hypno/grammar_arc.cpp"
     break;
 
   case 69: /* bline: CTOK NUM  */
-#line 366 "engines/hypno/grammar_arc.y"
+#line 369 "engines/hypno/grammar_arc.y"
                     { debugC(1, kHypnoDebugParser, "C %d", (yyvsp[0].i)); }
-#line 1803 "engines/hypno/grammar_arc.cpp"
+#line 1806 "engines/hypno/grammar_arc.cpp"
     break;
 
   case 70: /* bline: HTOK NUM  */
-#line 367 "engines/hypno/grammar_arc.y"
+#line 370 "engines/hypno/grammar_arc.y"
                     {
 		shoot->attackFrames.push_back((yyvsp[0].i)); 
 		debugC(1, kHypnoDebugParser, "H %d", (yyvsp[0].i)); }
-#line 1811 "engines/hypno/grammar_arc.cpp"
+#line 1814 "engines/hypno/grammar_arc.cpp"
     break;
 
   case 71: /* bline: VTOK NUM  */
-#line 370 "engines/hypno/grammar_arc.y"
+#line 373 "engines/hypno/grammar_arc.y"
                     { debugC(1, kHypnoDebugParser, "V %d", (yyvsp[0].i)); }
-#line 1817 "engines/hypno/grammar_arc.cpp"
+#line 1820 "engines/hypno/grammar_arc.cpp"
     break;
 
   case 72: /* bline: WTOK NUM  */
-#line 371 "engines/hypno/grammar_arc.y"
+#line 374 "engines/hypno/grammar_arc.y"
                     {
 		shoot->attackWeight = (yyvsp[0].i);  
 		debugC(1, kHypnoDebugParser, "W %d", (yyvsp[0].i)); }
-#line 1825 "engines/hypno/grammar_arc.cpp"
+#line 1828 "engines/hypno/grammar_arc.cpp"
     break;
 
   case 73: /* bline: DTOK NUM  */
-#line 374 "engines/hypno/grammar_arc.y"
+#line 377 "engines/hypno/grammar_arc.y"
                     {
 		shoot->pointsToShoot = (yyvsp[0].i);  
 		debugC(1, kHypnoDebugParser, "D %d", (yyvsp[0].i)); 
 	}
-#line 1834 "engines/hypno/grammar_arc.cpp"
+#line 1837 "engines/hypno/grammar_arc.cpp"
     break;
 
   case 74: /* bline: SNTOK FILENAME enc  */
-#line 378 "engines/hypno/grammar_arc.y"
+#line 381 "engines/hypno/grammar_arc.y"
                              { 
 		if (Common::String("S1") == (yyvsp[-2].s))
 			shoot->deathSound = (yyvsp[-1].s);
@@ -1842,28 +1845,28 @@ yyreduce:
 			shoot->hitSound = (yyvsp[-1].s);
 		 
 		debugC(1, kHypnoDebugParser, "SN %s", (yyvsp[-1].s)); }
-#line 1846 "engines/hypno/grammar_arc.cpp"
+#line 1849 "engines/hypno/grammar_arc.cpp"
     break;
 
   case 75: /* bline: NTOK  */
-#line 385 "engines/hypno/grammar_arc.y"
+#line 388 "engines/hypno/grammar_arc.y"
                { debugC(1, kHypnoDebugParser, "N"); }
-#line 1852 "engines/hypno/grammar_arc.cpp"
+#line 1855 "engines/hypno/grammar_arc.cpp"
     break;
 
   case 76: /* bline: ZTOK  */
-#line 386 "engines/hypno/grammar_arc.y"
+#line 389 "engines/hypno/grammar_arc.y"
                {
 		g_parsedArc->shoots.push_back(*shoot); 
 		//delete shoot; 
 		//shoot = nullptr;
 		debugC(1, kHypnoDebugParser, "Z"); 
 	}
-#line 1863 "engines/hypno/grammar_arc.cpp"
+#line 1866 "engines/hypno/grammar_arc.cpp"
     break;
 
 
-#line 1867 "engines/hypno/grammar_arc.cpp"
+#line 1870 "engines/hypno/grammar_arc.cpp"
 
       default: break;
     }
diff --git a/engines/hypno/grammar_arc.y b/engines/hypno/grammar_arc.y
index 42a9cc3d69b..866a2a4b4e7 100644
--- a/engines/hypno/grammar_arc.y
+++ b/engines/hypno/grammar_arc.y
@@ -360,7 +360,10 @@ bline: FNTOK FILENAME {
 		shoot->paletteSize = $2;
 		shoot->paletteOffset = $3;
 		debugC(1, kHypnoDebugParser, "P0 %d %d", $2, $3); }
-	| OTOK NUM NUM { 
+	| OTOK NUM NUM {
+		if ($2 == 0 && $3 == 0)
+			error("Invalid O command (0, 0)");
+		shoot->deathPosition = Common::Point($2, $3);
 		debugC(1, kHypnoDebugParser, "O %d %d", $2, $3); 
 	}
 	| CTOK NUM  { debugC(1, kHypnoDebugParser, "C %d", $2); } 


Commit: 1383f07e1c0bd0148fc20f9297ec4eb68847ac1b
    https://github.com/scummvm/scummvm/commit/1383f07e1c0bd0148fc20f9297ec4eb68847ac1b
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-02-23T20:31:17+01:00

Commit Message:
HYPNO: remove unused local variables in shoot

Changed paths:
    engines/hypno/arcade.cpp


diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index a67daa0c5ee..3e6f9b3acd0 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -536,8 +536,6 @@ void HypnoEngine::shoot(const Common::Point &mousePos) {
 		_shoots[i].destroyed = true;
 
 		if (_shoots[i].animation != "NONE") {
-			int w = _shoots[i].video->decoder->getWidth();
-			int h = _shoots[i].video->decoder->getHeight();
 			if (_shoots[i].deathPosition.x != 0 && _shoots[i].deathPosition.y != 0)
 				_shoots[i].video->position = Common::Point(mousePos.x, mousePos.y) - _shoots[i].deathPosition;
 




More information about the Scummvm-git-logs mailing list