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

neuromancer noreply at scummvm.org
Sun Jan 23 10:55:22 UTC 2022


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:
c96cc514fe HYPNO: improved parsing of shoot list in arcade sequences


Commit: c96cc514fec80fd0d691e046f88ef5e48ddcf21c
    https://github.com/scummvm/scummvm/commit/c96cc514fec80fd0d691e046f88ef5e48ddcf21c
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-23T11:55:21+01:00

Commit Message:
HYPNO: improved parsing of shoot list in arcade sequences

Changed paths:
    engines/hypno/arcade.cpp


diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index 530436bfd66..da9a2594602 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -64,8 +64,21 @@ 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");
+	// Preparsing
+	Common::String pdata;
+	Common::StringTokenizer lines(data, "\n");
 	Common::String t;
+	while (!lines.empty()) {
+		t = lines.nextToken();
+		if (t[0] == ';')
+			continue;
+		if (t.size() == 0)
+			continue;
+		pdata += "\n" + t;
+	}
+
+	// Parsing
+	Common::StringTokenizer tok(pdata, " ,.\t");
 	Common::String n;
 	ShootInfo si;
 	ShootSequence seq;
@@ -81,6 +94,8 @@ ShootSequence HypnoEngine::parseShootList(const Common::String &filename, const
 		Common::replace(n, "\nZ\n", "");
 		si.name = n;
 		si.timestamp = atoi(t.c_str());
+		if (si.timestamp == 0)
+			error("Error at parsing '%s'", n.c_str());
 		seq.push_back(si);
 		debugC(1, kHypnoDebugParser, "%d -> %s", si.timestamp, si.name.c_str());
 	}




More information about the Scummvm-git-logs mailing list