[Scummvm-cvs-logs] scummvm branch-1-8 -> 9ddd3ab067cd5bbb1b678de4896657cc49e12515

wjp wjp at usecode.org
Wed Mar 9 23:51:18 CET 2016


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

Summary:
2f65273b84 Revert "SCUMM: Fix detection of Maniac Mansion from within DoTT"
9ddd3ab067 SCUMM: Make DOTT/MM patch check less strict


Commit: 2f65273b84ff8ed41c0824596374dc83c6cd6c10
    https://github.com/scummvm/scummvm/commit/2f65273b84ff8ed41c0824596374dc83c6cd6c10
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2016-03-09T23:49:30+01:00

Commit Message:
Revert "SCUMM: Fix detection of Maniac Mansion from within DoTT"

This reverts commit 2cb1a23628a5aecd53715f7bede5297d39e7639b.

Changed paths:
    NEWS
    engines/scumm/scumm.cpp



diff --git a/NEWS b/NEWS
index d68cb89..cdae78c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,11 +1,6 @@
 For a more comprehensive changelog of the latest experimental code, see:
         https://github.com/scummvm/scummvm/commits/
 
-1.8.1 (XXXX-XX-XX)
- SCUMM:
-   - Fixed detection of Maniac Mansion from Day of the Tentacle in the Windows
-     version of ScummVM.
-
 1.8.0 (2016-03-04)
  New Games:
    - Added support for Rex Nebular and the Cosmic Gender Bender.
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 8d6214c..24d676a 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2608,31 +2608,13 @@ bool ScummEngine::startManiac() {
 		Common::ConfigManager::DomainMap::iterator iter = ConfMan.beginGameDomains();
 		for (; iter != ConfMan.endGameDomains(); ++iter) {
 			Common::ConfigManager::Domain &dom = iter->_value;
-			Common::String path1 = dom.getVal("path");
+			Common::String path = dom.getVal("path");
 
-			if (path1.hasPrefix(currentPath)) {
-				// In some ports (e.g. Windows), the "path" will end with a
-				// path separator. In others (e.g. Linux), it won't. And
-				// we have no way of knowing exactly what the separator
-				// is. The technical term for this is "annoying".
-
-				path1.erase(0, currentPath.size());
-
-				if (!path1.empty()) {
-					// If we've found the path we're looking for, all that
-					// remains now is the "maniac" part of it. If paths end
-					// with a separator, we'll have "maniac" followed by a
-					// separator. If they don't, we'll have a separator
-					// followed by "maniac".
-					Common::String path2 = path1;
-
-					path1.erase(0, 1);
-					path2.deleteLastChar();
-
-					if (path1.equalsIgnoreCase("maniac") || path2.equalsIgnoreCase("maniac")) {
-						maniacTarget = iter->_key;
-						break;
-					}
+			if (path.hasPrefix(currentPath)) {
+				path.erase(0, currentPath.size() + 1);
+				if (path.equalsIgnoreCase("maniac")) {
+					maniacTarget = iter->_key;
+					break;
 				}
 			}
 		}


Commit: 9ddd3ab067cd5bbb1b678de4896657cc49e12515
    https://github.com/scummvm/scummvm/commit/9ddd3ab067cd5bbb1b678de4896657cc49e12515
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2016-03-09T23:49:35+01:00

Commit Message:
SCUMM: Make DOTT/MM patch check less strict

The original check broke if either DOTT or MM had a trailing path
separator in the game path. The new check is too broad, but the risk of
false positives should be minimal.

The one in e11a370fe45aa96d240ff5f10e7263fdfc02bb01 would break if one
of the two had a separator, but not both.

Changed paths:
    engines/scumm/scumm.cpp



diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 24d676a..89d2d3d 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2611,8 +2611,12 @@ bool ScummEngine::startManiac() {
 			Common::String path = dom.getVal("path");
 
 			if (path.hasPrefix(currentPath)) {
-				path.erase(0, currentPath.size() + 1);
-				if (path.equalsIgnoreCase("maniac")) {
+				path.erase(0, currentPath.size());
+				// Do a case-insensitive non-path-mode match of the remainder.
+				// While strictly speaking it's too broad, this matchString
+				// ignores the presence or absence of trailing path separators
+				// in either currentPath or path.
+				if (path.matchString("*maniac*", true, false)) {
 					maniacTarget = iter->_key;
 					break;
 				}






More information about the Scummvm-git-logs mailing list