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

neuromancer noreply at scummvm.org
Sun Nov 28 21:34:12 UTC 2021


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

Summary:
a9e8ee893a HYPNO: improved arcade parsing and added more scenes in spider


Commit: a9e8ee893a1e361c259890033e56e6e62be4205a
    https://github.com/scummvm/scummvm/commit/a9e8ee893a1e361c259890033e56e6e62be4205a
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2021-11-28T22:33:04+01:00

Commit Message:
HYPNO: improved arcade parsing and added more scenes in spider

Changed paths:
    engines/hypno/arcade.cpp
    engines/hypno/grammar_arc.cpp
    engines/hypno/grammar_arc.y
    engines/hypno/hypno.h
    engines/hypno/lexer_arc.cpp
    engines/hypno/libfile.cpp
    engines/hypno/spider/arcade.cpp
    engines/hypno/spider/spider.cpp


diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index 18f41fcf66..0ec21cc5e6 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -65,7 +65,7 @@ void HypnoEngine::parseArcadeShooting(const Common::String &prefix, const Common
 
 ShootSequence HypnoEngine::parseShootList(const Common::String &filename, const Common::String &data) {
 	debugC(1, kHypnoDebugParser, "Parsing %s", filename.c_str());
-	Common::StringTokenizer tok(data, " ,\t");
+	Common::StringTokenizer tok(data, " ,.\t");
 	Common::String t;
 	Common::String n;
 	ShootInfo si;
@@ -105,9 +105,17 @@ void HypnoEngine::drawHealth() { error("Function \"%s\" not implemented", __FUNC
 void HypnoEngine::drawShoot(const Common::Point &target) { error("Function \"%s\" not implemented", __FUNCTION__); }
 
 void HypnoEngine::hitPlayer() {
-	// if the player is hit, play the hit animation
-	if (_playerFrameIdx < _playerFrameSep)
-		_playerFrameIdx = _playerFrameSep;
+	if ( _playerFrameSep < _playerFrames.size()){
+		if (_playerFrameIdx < _playerFrameSep)
+			_playerFrameIdx = _playerFrameSep;
+	} else {
+		uint32 red = _pixelFormat.ARGBToColor(1, 255, 0, 0);
+		_compositeSurface->fillRect(Common::Rect(0, 0, 640, 480), red);
+		drawScreen();
+	}
+	//if (!_hitSound.empty())
+	//	playSound(_soundPath + _hitSound, 1);
+
 }
 
 void HypnoEngine::runArcade(ArcadeShooting *arc) {
@@ -119,6 +127,7 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 	_font = FontMan.getFontByUsage(Graphics::FontManager::kConsoleFont);
 	_levelId = arc->id;
 	_shootSound = arc->shootSound;
+	_hitSound = arc->hitSound;
 	_score = 0;
 	_health = arc->health;
 	_maxHealth = _health;
@@ -178,13 +187,13 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 					_currentPlayerPosition = PlayerLeft;
 				} else if (event.kbd.keycode == Common::KEYCODE_DOWN) {
 					_lastPlayerPosition = _currentPlayerPosition;
-					_currentPlayerPosition = PlayerDown;
+					_currentPlayerPosition = PlayerBottom;
 				} else if (event.kbd.keycode == Common::KEYCODE_RIGHT) {
 					_lastPlayerPosition = _currentPlayerPosition;
 					_currentPlayerPosition = PlayerRight;
 				} else if (event.kbd.keycode == Common::KEYCODE_UP) {
 					_lastPlayerPosition = _currentPlayerPosition;
-					_currentPlayerPosition = PlayerUp;
+					_currentPlayerPosition = PlayerTop;
 				}
 				break;
 
@@ -253,13 +262,22 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 			if ((int)si.timestamp <= background.decoder->getCurFrame()) {
 				shootSequence.pop_front();
 				for (Shoots::iterator it = arc->shoots.begin(); it != arc->shoots.end(); ++it) {
-					if (it->name == si.name && it->animation != "NONE") {
-						Shoot s = *it;
-						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
-						_shoots.push_back(s);
-						playSound(_soundPath + arc->enemySound, 1);
+					if (it->name == si.name) {
+
+						if (it->animation == "NONE") {
+							if (it->name[0] == _currentPlayerPosition) {
+								_health = _health - it->attackWeight;
+								hitPlayer();
+							}
+
+						} else {
+							Shoot s = *it;
+							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
+							_shoots.push_back(s);
+							playSound(_soundPath + arc->enemySound, 1);
+						}
 					}
 				}
 			}
diff --git a/engines/hypno/grammar_arc.cpp b/engines/hypno/grammar_arc.cpp
index 9d214e6a8f..68397f39e9 100644
--- a/engines/hypno/grammar_arc.cpp
+++ b/engines/hypno/grammar_arc.cpp
@@ -509,11 +509,11 @@ static const yytype_uint16 yyrline[] =
 {
        0,    76,    76,    76,    77,    80,    81,    82,    85,    88,
       89,    90,    91,    92,    93,    94,    95,   100,   105,   106,
-     110,   111,   115,   116,   130,   140,   141,   142,   147,   148,
-     151,   152,   153,   156,   161,   166,   171,   175,   179,   183,
-     187,   191,   195,   199,   203,   207,   211,   215,   219,   223,
-     227,   231,   235,   238,   242,   243,   244,   249,   250,   253,
-     254,   257,   260,   264,   271,   272
+     110,   111,   115,   116,   130,   142,   143,   144,   149,   150,
+     153,   154,   155,   158,   163,   168,   173,   177,   181,   185,
+     189,   193,   197,   201,   205,   209,   213,   217,   221,   225,
+     229,   233,   237,   240,   244,   245,   246,   251,   252,   255,
+     256,   259,   262,   266,   273,   274
 };
 #endif
 
@@ -1498,294 +1498,296 @@ yyreduce:
 			g_parsedArc->music = (yyvsp[-1].s);
 		else if (Common::String("S1") == (yyvsp[-2].s))
 			g_parsedArc->shootSound = (yyvsp[-1].s);
+		else if (Common::String("S2") == (yyvsp[-2].s))
+			g_parsedArc->hitSound = (yyvsp[-1].s);
 		else if (Common::String("S4") == (yyvsp[-2].s))
 			g_parsedArc->enemySound = (yyvsp[-1].s); 
 
 		debugC(1, kHypnoDebugParser, "SN %s", (yyvsp[-1].s)); 
 	}
-#line 1507 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1509 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 25:
-#line 140 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 142 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { debugC(1, kHypnoDebugParser, "HE %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1513 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1515 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 26:
-#line 141 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 143 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { debugC(1, kHypnoDebugParser, "HE %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1519 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1521 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 27:
-#line 142 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 144 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     {
 		debugC(1, kHypnoDebugParser, "H %d %d", (yyvsp[-1].i), (yyvsp[0].i)); 
 	}
-#line 1527 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1529 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 33:
-#line 156 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 158 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { 
 		shoot = new Shoot();
 		shoot->animation = (yyvsp[0].s);
 		debugC(1, kHypnoDebugParser, "FN %s", (yyvsp[0].s)); 
 	}
-#line 1537 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1539 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 34:
-#line 161 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 163 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { 
 		shoot = new Shoot();
 		shoot->animation = "NONE";
 		debugC(1, kHypnoDebugParser, "FN NONE"); 
 	}
-#line 1547 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1549 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 35:
-#line 166 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 168 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { 
 		shoot = new Shoot();
 		shoot->animation = (yyvsp[0].s);
 		debugC(1, kHypnoDebugParser, "FN %s", (yyvsp[0].s)); 
 	}
-#line 1557 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1559 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 36:
-#line 171 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 173 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { 
 		shoot->name = (yyvsp[0].s);
 		debugC(1, kHypnoDebugParser, "I %s", (yyvsp[0].s)); 
 	}
-#line 1566 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1568 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 37:
-#line 175 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 177 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     {  // Workaround for NAME == B1
 		shoot->name = (yyvsp[0].s);
 		debugC(1, kHypnoDebugParser, "I %s", (yyvsp[0].s)); 
 	}
-#line 1575 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1577 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 38:
-#line 179 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 181 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { // Workaround for NAME == A
 		shoot->name = "A";
 		debugC(1, kHypnoDebugParser, "I A"); 
 	}
-#line 1584 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1586 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 39:
-#line 183 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 185 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { // Workaround for NAME == C
 		shoot->name = "C";
 		debugC(1, kHypnoDebugParser, "I C"); 
 	}
-#line 1593 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1595 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 40:
-#line 187 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 189 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { // Workaround for NAME == D
 		shoot->name = "D";
 		debugC(1, kHypnoDebugParser, "I D"); 
 	}
-#line 1602 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1604 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 41:
-#line 191 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 193 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { // Workaround for NAME == F
 		shoot->name = "F";
 		debugC(1, kHypnoDebugParser, "I F"); 
 	}
-#line 1611 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1613 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 42:
-#line 195 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 197 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { // Workaround for NAME == H
 		shoot->name = "H";
 		debugC(1, kHypnoDebugParser, "I H"); 
 	}
-#line 1620 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1622 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 43:
-#line 199 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 201 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { // Workaround for NAME == I
 		shoot->name = "I";
 		debugC(1, kHypnoDebugParser, "I I"); 
 	}
-#line 1629 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1631 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 44:
-#line 203 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 205 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { // Workaround for NAME == I
 		shoot->name = "J";
 		debugC(1, kHypnoDebugParser, "I J"); 
 	}
-#line 1638 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1640 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 45:
-#line 207 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 209 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { // Workaround for NAME == N
 		shoot->name = "N";
 		debugC(1, kHypnoDebugParser, "I N"); 
 	}
-#line 1647 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1649 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 46:
-#line 211 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 213 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { // Workaround for NAME == O
 		shoot->name = "O";
 		debugC(1, kHypnoDebugParser, "I O"); 
 	}
-#line 1656 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1658 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 47:
-#line 215 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 217 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { // Workaround for NAME == P
 		shoot->name = "P";
 		debugC(1, kHypnoDebugParser, "I P"); 
 	}
-#line 1665 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1667 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 48:
-#line 219 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 221 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { // Workaround for NAME == Q
 		shoot->name = "Q";
 		debugC(1, kHypnoDebugParser, "I Q"); 
 	}
-#line 1674 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1676 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 49:
-#line 223 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 225 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { // Workaround for NAME == R
 		shoot->name = "R";
 		debugC(1, kHypnoDebugParser, "I R"); 
 	}
-#line 1683 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1685 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 50:
-#line 227 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 229 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     {  // Workaround for NAME == S1
 		shoot->name = (yyvsp[0].s);
 		debugC(1, kHypnoDebugParser, "I %s", (yyvsp[0].s)); 
 	}
-#line 1692 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1694 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 51:
-#line 231 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 233 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { // Workaround for NAME == T
 		shoot->name = "T";
 		debugC(1, kHypnoDebugParser, "I T"); 
 	}
-#line 1701 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1703 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 52:
-#line 235 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 237 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     {
 		debugC(1, kHypnoDebugParser, "J %d", (yyvsp[0].i)); 
 	}
-#line 1709 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1711 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 53:
-#line 238 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 240 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { 
 		shoot->position = Common::Point((yyvsp[-1].i), (yyvsp[0].i));
 		debugC(1, kHypnoDebugParser, "A0 %d %d", (yyvsp[-1].i), (yyvsp[0].i)); 
 	}
-#line 1718 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1720 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 54:
-#line 242 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 244 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { debugC(1, kHypnoDebugParser, "R %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1724 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1726 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 55:
-#line 243 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 245 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { debugC(1, kHypnoDebugParser, "BN %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1730 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1732 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 56:
-#line 244 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 246 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { 
 		//if (Common::String("K0") == $1)
 		shoot->explosionFrame = (yyvsp[0].i);
 		debugC(1, kHypnoDebugParser, "KN %d %d", (yyvsp[-1].i), (yyvsp[0].i));
 	}
-#line 1740 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1742 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 57:
-#line 249 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 251 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { debugC(1, kHypnoDebugParser, "P0 %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1746 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1748 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 58:
-#line 250 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 252 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { 
 		debugC(1, kHypnoDebugParser, "O %d %d", (yyvsp[-1].i), (yyvsp[0].i)); 
 	}
-#line 1754 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1756 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 59:
-#line 253 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 255 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { debugC(1, kHypnoDebugParser, "C %d", (yyvsp[0].i)); }
-#line 1760 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1762 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 60:
-#line 254 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 256 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     {
 		shoot->attackFrame = (yyvsp[0].i); 
 		debugC(1, kHypnoDebugParser, "H %d", (yyvsp[0].i)); }
-#line 1768 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1770 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 61:
-#line 257 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 259 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     {
 		shoot->attackWeight = (yyvsp[0].i);  
 		debugC(1, kHypnoDebugParser, "W %d", (yyvsp[0].i)); }
-#line 1776 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1778 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 62:
-#line 260 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 262 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     {
 		shoot->pointsToShoot = (yyvsp[0].i);  
 		debugC(1, kHypnoDebugParser, "D %d", (yyvsp[0].i)); 
 	}
-#line 1785 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1787 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 63:
-#line 264 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 266 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { 
 		if (Common::String("S1") == (yyvsp[-2].s))
 			shoot->deathSound = (yyvsp[-1].s);
@@ -1793,28 +1795,28 @@ yyreduce:
 			shoot->hitSound = (yyvsp[-1].s);
 		 
 		debugC(1, kHypnoDebugParser, "SN %s", (yyvsp[-1].s)); }
-#line 1797 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1799 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 64:
-#line 271 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 273 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     { debugC(1, kHypnoDebugParser, "N"); }
-#line 1803 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1805 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
   case 65:
-#line 272 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
+#line 274 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
     {
 		g_parsedArc->shoots.push_back(*shoot); 
 		//delete shoot; 
 		//shoot = nullptr;
 		debugC(1, kHypnoDebugParser, "Z"); 
 	}
-#line 1814 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1816 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
     break;
 
 
-#line 1818 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1820 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
diff --git a/engines/hypno/grammar_arc.y b/engines/hypno/grammar_arc.y
index af4e13927f..9e19740c5e 100644
--- a/engines/hypno/grammar_arc.y
+++ b/engines/hypno/grammar_arc.y
@@ -132,6 +132,8 @@ hline: 	CTOK NUM {
 			g_parsedArc->music = $2;
 		else if (Common::String("S1") == $1)
 			g_parsedArc->shootSound = $2;
+		else if (Common::String("S2") == $1)
+			g_parsedArc->hitSound = $2;
 		else if (Common::String("S4") == $1)
 			g_parsedArc->enemySound = $2; 
 
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index e2b1675c27..14b7f6879f 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -62,10 +62,10 @@ typedef Common::Array<Graphics::Surface *> Frames;
 // Player positions
 
 enum PlayerPosition {
-	PlayerUp,
-	PlayerDown,
-	PlayerLeft,
-	PlayerRight
+	PlayerTop = 'T',
+	PlayerBottom = 'B',
+	PlayerLeft = 'L',
+	PlayerRight = 'R'
 };
 
 class HypnoEngine : public Engine {
@@ -216,13 +216,14 @@ public:
 	virtual void hitPlayer();
 	Common::String _difficulty; 
 
-	void drawCursorArcade(const Common::Point &mousePos);
+	virtual void drawCursorArcade(const Common::Point &mousePos);
 	virtual void drawPlayer();
 	virtual void drawHealth();
 	int _health;
 	int _maxHealth;
 	int _score;
 	Filename _shootSound;
+	Filename _hitSound;
 	Shoots _shoots;
 	Frames _playerFrames;
 	int _playerFrameIdx;
@@ -282,6 +283,7 @@ public:
 	void loadAssetsFullGame();
 	void showCredits() override;
 
+	void drawCursorArcade(const Common::Point &mousePos) override;
 	void drawShoot(const Common::Point &target) override;
 	void drawPlayer() override;
 	void drawHealth() override;
diff --git a/engines/hypno/lexer_arc.cpp b/engines/hypno/lexer_arc.cpp
index 81a4771ce7..e9c5106850 100644
--- a/engines/hypno/lexer_arc.cpp
+++ b/engines/hypno/lexer_arc.cpp
@@ -527,7 +527,7 @@ struct yy_buffer_state
 /* Stack of input buffers. */
 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = nullptr; /**< Stack as an array. */
+static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
 
 /* We provide macros for accessing buffer states in case in the
  * future we want to put the buffer states in a more general
@@ -549,7 +549,7 @@ static int yy_n_chars;		/* number of characters read into yy_ch_buf */
 int yyleng;
 
 /* Points to current character in buffer. */
-static char *yy_c_buf_p = nullptr;
+static char *yy_c_buf_p = NULL;
 static int yy_init = 0;		/* whether we need to initialize */
 static int yy_start = 0;	/* start state number */
 
@@ -606,7 +606,7 @@ void yyfree ( void *  );
 #define YY_SKIP_YYWRAP
 typedef flex_uint8_t YY_CHAR;
 
-FILE *yyin = nullptr, *yyout = nullptr;
+FILE *yyin = NULL, *yyout = NULL;
 
 typedef int yy_state_type;
 
@@ -1530,7 +1530,7 @@ static int yy_get_next_buffer (void)
 				}
 			else
 				/* Can't grow it, we don't own it. */
-				b->yy_ch_buf = nullptr;
+				b->yy_ch_buf = NULL;
 
 			if ( ! b->yy_ch_buf )
 				YY_FATAL_ERROR(
@@ -1834,7 +1834,7 @@ static void yy_load_buffer_state  (void)
 		return;
 
 	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) nullptr;
+		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
 
 	if ( b->yy_is_our_buffer )
 		yyfree( (void *) b->yy_ch_buf  );
@@ -1905,7 +1905,7 @@ static void yy_load_buffer_state  (void)
  */
 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
 {
-    	if (new_buffer == nullptr)
+    	if (new_buffer == NULL)
 		return;
 
 	yyensure_buffer_stack();
@@ -1939,7 +1939,7 @@ void yypop_buffer_state (void)
 		return;
 
 	yy_delete_buffer(YY_CURRENT_BUFFER );
-	YY_CURRENT_BUFFER_LVALUE = nullptr;
+	YY_CURRENT_BUFFER_LVALUE = NULL;
 	if ((yy_buffer_stack_top) > 0)
 		--(yy_buffer_stack_top);
 
@@ -2009,7 +2009,7 @@ YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
 	     base[size-1] != YY_END_OF_BUFFER_CHAR )
 		/* They forgot to leave room for the EOB's. */
-		return nullptr;
+		return NULL;
 
 	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
 	if ( ! b )
@@ -2018,7 +2018,7 @@ YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
 	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
 	b->yy_buf_pos = b->yy_ch_buf = base;
 	b->yy_is_our_buffer = 0;
-	b->yy_input_file = nullptr;
+	b->yy_input_file = NULL;
 	b->yy_n_chars = b->yy_buf_size;
 	b->yy_is_interactive = 0;
 	b->yy_at_bol = 1;
@@ -2197,10 +2197,10 @@ static int yy_init_globals (void)
     /* We do not touch yylineno unless the option is enabled. */
     yylineno =  1;
     
-    (yy_buffer_stack) = nullptr;
+    (yy_buffer_stack) = NULL;
     (yy_buffer_stack_top) = 0;
     (yy_buffer_stack_max) = 0;
-    (yy_c_buf_p) = nullptr;
+    (yy_c_buf_p) = NULL;
     (yy_init) = 0;
     (yy_start) = 0;
 
@@ -2209,8 +2209,8 @@ static int yy_init_globals (void)
     yyin = stdin;
     yyout = stdout;
 #else
-    yyin = nullptr;
-    yyout = nullptr;
+    yyin = NULL;
+    yyout = NULL;
 #endif
 
     /* For future reference: Set errno on error, since we are called by
@@ -2226,13 +2226,13 @@ int yylex_destroy  (void)
     /* Pop the buffer stack, destroying each element. */
 	while(YY_CURRENT_BUFFER){
 		yy_delete_buffer( YY_CURRENT_BUFFER  );
-		YY_CURRENT_BUFFER_LVALUE = nullptr;
+		YY_CURRENT_BUFFER_LVALUE = NULL;
 		yypop_buffer_state();
 	}
 
 	/* Destroy the stack itself. */
 	yyfree((yy_buffer_stack) );
-	(yy_buffer_stack) = nullptr;
+	(yy_buffer_stack) = NULL;
 
     /* Reset the globals. This is important in a non-reentrant scanner so the next time
      * yylex() is called, initialization will occur. */
diff --git a/engines/hypno/libfile.cpp b/engines/hypno/libfile.cpp
index 326dfb6248..eaafe964f5 100644
--- a/engines/hypno/libfile.cpp
+++ b/engines/hypno/libfile.cpp
@@ -45,7 +45,7 @@ bool LibFile::open(const Common::String &prefix, const Common::String &filename,
 		uint32 start = libfile.size();
 		FileEntry f;
 		libfile.seek(offset);
-		debugC(1, kHypnoDebugParser, "parsing at offset %d", offset);
+		debugC(1, kHypnoDebugParser, "parsing at offset %d with size %li", offset, libfile.size());
 		while (true) {
 			f.name = "";
 			f.data.clear();
@@ -55,7 +55,7 @@ bool LibFile::open(const Common::String &prefix, const Common::String &filename,
 					f.name += tolower(char(b));
 			}
 
-			if (!Common::isAlpha(*f.name.c_str()))
+			if (!Common::isAlnum(*f.name.c_str()))
 				break;
 
 			debugC(1, kHypnoDebugParser, "file: %s", f.name.c_str());
diff --git a/engines/hypno/spider/arcade.cpp b/engines/hypno/spider/arcade.cpp
index af7fc5f12d..20ed1d5cac 100644
--- a/engines/hypno/spider/arcade.cpp
+++ b/engines/hypno/spider/arcade.cpp
@@ -61,7 +61,8 @@ void SpiderEngine::drawPlayer() {
 	uint32 ox = 0;
 	uint32 oy = 0;
 
-	if (_arcadeMode == "YC") {
+	if (_arcadeMode == "YC" || _arcadeMode == "YD") {
+		disableCursor(); // Not sure this a good place
 		ox = 0;
 		oy = 0;
 
@@ -72,11 +73,11 @@ void SpiderEngine::drawPlayer() {
 			switch(_lastPlayerPosition) {
 				case PlayerLeft:
 					switch(_currentPlayerPosition) {
-						case PlayerUp:
+						case PlayerTop:
 							_lastPlayerPosition = _currentPlayerPosition;
 							_playerFrameIdx = 1;
 						break;
-						case PlayerDown:
+						case PlayerBottom:
 							_lastPlayerPosition = _currentPlayerPosition;
 							_playerFrameIdx = 13;
 						break;
@@ -88,11 +89,11 @@ void SpiderEngine::drawPlayer() {
 				break;
 				case PlayerRight:
 					switch(_currentPlayerPosition) {
-						case PlayerUp:
+						case PlayerTop:
 							_lastPlayerPosition = _currentPlayerPosition;
 							_playerFrameIdx = 5;
 						break;
-						case PlayerDown:
+						case PlayerBottom:
 							_lastPlayerPosition = _currentPlayerPosition;
 							_playerFrameIdx = 17;
 						break;
@@ -102,9 +103,9 @@ void SpiderEngine::drawPlayer() {
 						break;
 					}
 				break;
-				case PlayerDown:
+				case PlayerBottom:
 					switch(_currentPlayerPosition) {
-						case PlayerUp:
+						case PlayerTop:
 							_lastPlayerPosition = _currentPlayerPosition;
 							_playerFrameIdx = 9;
 						break;
@@ -118,9 +119,9 @@ void SpiderEngine::drawPlayer() {
 						break;
 					}
 				break;
-				case PlayerUp:
+				case PlayerTop:
 					switch(_currentPlayerPosition) {
-						case PlayerDown:
+						case PlayerBottom:
 							_playerFrameIdx = 21;
 						break;
 						case PlayerLeft:
@@ -161,6 +162,12 @@ void SpiderEngine::drawPlayer() {
 	drawImage(*_playerFrames[_playerFrameIdx], ox, oy, true);
 }
 
+void SpiderEngine::drawCursorArcade(const Common::Point &mousePos) {
+	if (_arcadeMode != "YC") {
+		HypnoEngine::drawCursorArcade(mousePos);
+	}
+}
+
 void SpiderEngine::drawHealth() {
 	Common::Rect r;
 	uint32 c;
diff --git a/engines/hypno/spider/spider.cpp b/engines/hypno/spider/spider.cpp
index 3a7d1a42af..680feb48ff 100644
--- a/engines/hypno/spider/spider.cpp
+++ b/engines/hypno/spider/spider.cpp
@@ -106,6 +106,10 @@ void SpiderEngine::loadAssetsFullGame() {
 	_levels["c1.mi_"]->intros.push_back("cine/ross002s.smk");
 	_levels["c1.mi_"]->levelIfLose = "<over_apt_1>";
 
+	loadArcadeLevel("c1h.mi_", "<trans_apt_1>", prefix);
+	_levels["c1h.mi_"]->intros.push_back("cine/ross002s.smk");
+	_levels["c1h.mi_"]->levelIfLose = "<over_apt_1>";
+
 	// Hardcoded levels
 	Code *matrix = new Code();
 	matrix->name = "<puz_matr>";
@@ -144,7 +148,7 @@ void SpiderEngine::loadAssetsFullGame() {
 	sc = (Scene *) _levels["decide3.mi_"];
 	cl = new ChangeLevel("alofintr.mi_");
 	sc->hots[2].actions.push_back(cl);
-	cl = new ChangeLevel("c2"); // depens on the difficulty
+	cl = new ChangeLevel("c4"); // depens on the difficulty
 	sc->hots[4].actions.push_back(cl);
 
 	loadSceneLevel("int_roof.mi_", "", prefix);
@@ -174,7 +178,6 @@ void SpiderEngine::loadAssetsFullGame() {
 	sc->hots[2].actions.push_back(cl);
 
 	loadSceneLevel("alverofh.mi_", "", prefix);
-	loadSceneLevel("intercom.mi_", "", prefix);
 	loadSceneLevel("recept.mi_", "", prefix);
 
 	sc = (Scene *) _levels["recept.mi_"];
@@ -183,15 +186,32 @@ void SpiderEngine::loadAssetsFullGame() {
 
 	loadSceneLevel("alveroff.mi_", "", prefix);
 
+	loadArcadeLevel("c4.mi_", "c2", prefix);
+	loadArcadeLevel("c2.mi_", "decide4.mi_", prefix);
+	loadArcadeLevel("c4h.mi_", "c2", prefix);
+	loadArcadeLevel("c2h.mi_", "decide4.mi_", prefix);
+
+	loadSceneLevel("decide4.mi_", "", prefix);
+	sc = (Scene *) _levels["decide4.mi_"];
+	cl = new ChangeLevel("ball1.mi_");
+	sc->hots[2].actions.push_back(cl);
+	cl = new ChangeLevel("c5"); // depens on the difficulty
+	sc->hots[4].actions.push_back(cl);
+
+	loadArcadeLevel("c5.mi_", "factory1.mi_", prefix);
+	loadArcadeLevel("c5h.mi_", "factory1.mi_", prefix);
+
 	loadSceneLevel("ball1.mi_", "<note>", prefix);
 	loadSceneLevel("ball2.mi_", "balcony.mi_", prefix);
-	loadSceneLevel("balcony.mi_", "", prefix);
+	loadSceneLevel("balcony.mi_", "factory1.mi_", prefix);
 
 	Code *note = new Code();
 	note->name = "<note>";
 	note->levelIfWin = "ball2.mi_";
 	_levels["<note>"] = note;
 
+	loadSceneLevel("factory1.mi_", "intercom.mi_", prefix);
+	loadSceneLevel("intercom.mi_", "", prefix);
 	//_levels["buspuz.mi_"]->intros.push_back("cine/ppv001s.smk");
 
 	// Transition *bus_transition = new Transition("buspuz.mi_");
@@ -204,10 +224,7 @@ void SpiderEngine::loadAssetsFullGame() {
 	// _levels["<bank_hard>"] = bankHard;
 
 	// Easy arcade levels
-	loadArcadeLevel("c2.mi_", "", prefix);
 	loadArcadeLevel("c3.mi_", "", prefix);
-	loadArcadeLevel("c4.mi_", "", prefix);
-	loadArcadeLevel("c5.mi_", "", prefix);
 	//loadArcadeLevel("c6.mi_", "", "spider");
 	// No c7 level?
 	loadArcadeLevel("c8.mi_", "", prefix);
@@ -218,11 +235,8 @@ void SpiderEngine::loadAssetsFullGame() {
 	loadArcadeLevel("c13.mi_", "", prefix);
 
 	// // Hard arcade levels
-	loadArcadeLevel("c1h.mi_", "", prefix);
-	loadArcadeLevel("c2h.mi_", "", prefix);
 	loadArcadeLevel("c3h.mi_", "", prefix);
-	loadArcadeLevel("c4h.mi_", "", prefix);
-	loadArcadeLevel("c5h.mi_", "", prefix);
+
 	//loadArcadeLevel("c6h.mi_", "", "spider");
 	// No c7h level?
 	loadArcadeLevel("c8h.mi_", "", prefix);




More information about the Scummvm-git-logs mailing list