[Scummvm-git-logs] scummvm master -> 1c594b903b660e6dd2ce7ad60c8a6491e6db4a85

djsrv dservilla at gmail.com
Sat Aug 7 18:57:15 UTC 2021


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:
de0e03fa3d DIRECTOR: Remove filename cleaning in setNextMovie
c8db1de753 DIRECTOR: Don't put dots at beginning of path
1c594b903b DIRECTOR: Use Unicode version of toPrintable


Commit: de0e03fa3d8f909e19fbfd06612d9c4e2e63f565
    https://github.com/scummvm/scummvm/commit/de0e03fa3d8f909e19fbfd06612d9c4e2e63f565
Author: djsrv (dservilla at gmail.com)
Date: 2021-08-07T14:54:36-04:00

Commit Message:
DIRECTOR: Remove filename cleaning in setNextMovie

This is redundant.

Changed paths:
    engines/director/window.cpp


diff --git a/engines/director/window.cpp b/engines/director/window.cpp
index 79dbf8eebf..4d3850843f 100644
--- a/engines/director/window.cpp
+++ b/engines/director/window.cpp
@@ -402,44 +402,22 @@ void Window::setVisible(bool visible, bool silent) {
 
 bool Window::setNextMovie(Common::String &movieFilenameRaw) {
 	Common::String movieFilename = pathMakeRelative(movieFilenameRaw);
-	Common::String cleanedFilename;
 
 	bool fileExists = false;
-
-	if (_vm->getPlatform() == Common::kPlatformMacintosh) {
-		Common::MacResManager resMan;
-
-		for (const byte *p = (const byte *)movieFilename.c_str(); *p; p++)
-			if (*p >= 0x20 && *p <= 0x7f)
-				cleanedFilename += (char) *p;
-
-		if (resMan.open(Common::Path(movieFilename, _vm->_dirSeparator))) {
-			fileExists = true;
-			cleanedFilename = movieFilename;
-		} else if (!movieFilename.equals(cleanedFilename) && resMan.open(Common::Path(cleanedFilename, _vm->_dirSeparator))) {
-			fileExists = true;
-		}
-	} else {
-		Common::File file;
-		cleanedFilename = movieFilename + ".MMM";
-
-		if (file.open(Common::Path(movieFilename, _vm->_dirSeparator))) {
-			fileExists = true;
-			cleanedFilename = movieFilename;
-		} else if (!movieFilename.equals(cleanedFilename) && file.open(Common::Path(cleanedFilename, _vm->_dirSeparator))) {
-			fileExists = true;
-		}
+	Common::File file;
+	if (file.open(Common::Path(movieFilename, _vm->_dirSeparator))) {
+		fileExists = true;
+		file.close();
 	}
 
-	debug(1, "Window::setNextMovie: '%s' -> '%s' -> '%s' -> '%s'", movieFilenameRaw.c_str(), convertPath(movieFilenameRaw).c_str(),
-			movieFilename.c_str(), cleanedFilename.c_str());
+	debug(1, "Window::setNextMovie: '%s' -> '%s' -> '%s'", movieFilenameRaw.c_str(), convertPath(movieFilenameRaw).c_str(), movieFilename.c_str());
 
 	if (!fileExists) {
 		warning("Movie %s does not exist", movieFilename.c_str());
 		return false;
 	}
 
-	_nextMovie.movie = cleanedFilename;
+	_nextMovie.movie = movieFilename;
 	return true;
 }
 


Commit: c8db1de753e557601eabfcbadfda33f33b60d1b1
    https://github.com/scummvm/scummvm/commit/c8db1de753e557601eabfcbadfda33f33b60d1b1
Author: djsrv (dservilla at gmail.com)
Date: 2021-08-07T14:54:36-04:00

Commit Message:
DIRECTOR: Don't put dots at beginning of path

The dot is just eliminated in pathMakeRelative.

Changed paths:
    engines/director/util.cpp


diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index 9faec568fc..5b87937e55 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -229,21 +229,16 @@ Common::String convertPath(Common::String &path) {
 	uint32 idx = 0;
 
 	if (path.hasPrefix("::")) { // Parent directory
-		res = "..:";
 		idx = 2;
 	} else if (path.hasPrefix("@:")) { // Root of the game
-		res = ".:";
 		idx = 2;
 	} else if (path.size() >= 3
 					&& Common::isAlpha(path[0])
 					&& path[1] == ':'
 					&& path[2] == '\\') { // Windows drive letter
 		idx = 3;
-	} else {
-		res = ".:";
-
-		if (path[0] == ':')
-			idx = 1;
+	} else if (path[0] == ':') {
+		idx = 1;
 	}
 
 	while (idx < path.size()) {


Commit: 1c594b903b660e6dd2ce7ad60c8a6491e6db4a85
    https://github.com/scummvm/scummvm/commit/1c594b903b660e6dd2ce7ad60c8a6491e6db4a85
Author: djsrv (dservilla at gmail.com)
Date: 2021-08-07T14:54:36-04:00

Commit Message:
DIRECTOR: Use Unicode version of toPrintable

Changed paths:
    engines/director/cast.cpp
    engines/director/lingo/lingo.cpp
    engines/director/util.cpp
    engines/director/util.h
    engines/director/window.cpp


diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 229bbe50df..6d3b08372a 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -1110,7 +1110,7 @@ void Cast::loadCastInfo(Common::SeekableReadStreamEndian &stream, uint16 id) {
 	debugCN(4, kDebugLoading, "Cast::loadCastInfo(): castId: %s str(%d): '", numToCastNum(id), castInfo.strings.size());
 
 	for (uint i = 0; i < castInfo.strings.size(); i++) {
-		debugCN(4, kDebugLoading, "%s'", Common::toPrintable(castInfo.strings[i].readString()).c_str());
+		debugCN(4, kDebugLoading, "%s'", utf8ToPrintable(castInfo.strings[i].readString()).c_str());
 		if (i != castInfo.strings.size() - 1)
 			debugCN(4, kDebugLoading, ", '");
 	}
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index 2a2fb47309..db026f5e92 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -252,7 +252,7 @@ Symbol Lingo::getHandler(const Common::String &name) {
 
 void LingoArchive::addCode(const Common::U32String &code, ScriptType type, uint16 id, const char *scriptName) {
 	debugC(1, kDebugCompile, "Add code for type %s(%d) with id %d in '%s%s'\n"
-			"***********\n%s\n\n***********", scriptType2str(type), type, id, toPrintable(g_director->getCurrentPath()).c_str(), toPrintable(cast->getMacName()).c_str(), code.encode().c_str());
+			"***********\n%s\n\n***********", scriptType2str(type), type, id, utf8ToPrintable(g_director->getCurrentPath()).c_str(), utf8ToPrintable(cast->getMacName()).c_str(), code.encode().c_str());
 
 	if (getScriptContext(type, id)) {
 		// We can't undefine context data because it could be used in e.g. symbols.
diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index 5b87937e55..38490d2bb2 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -811,4 +811,8 @@ Common::String encodePathForDump(const Common::String &path) {
 	return punycode_encodepath(Common::Path(path, g_director->_dirSeparator)).toString();
 }
 
+Common::String utf8ToPrintable(const Common::String &str) {
+	return Common::toPrintable(Common::U32String(str));
+}
+
 } // End of namespace Director
diff --git a/engines/director/util.h b/engines/director/util.h
index 346f0a8bd0..7728076132 100644
--- a/engines/director/util.h
+++ b/engines/director/util.h
@@ -93,6 +93,8 @@ int compareStrings(const Common::String &s1, const Common::String &s2);
 
 Common::String encodePathForDump(const Common::String &path);
 
+Common::String utf8ToPrintable(const Common::String &str);
+
 } // End of namespace Director
 
 #endif
diff --git a/engines/director/window.cpp b/engines/director/window.cpp
index 4d3850843f..b8a15614b8 100644
--- a/engines/director/window.cpp
+++ b/engines/director/window.cpp
@@ -435,11 +435,11 @@ bool Window::step() {
 	// finish last movie
 	if (_currentMovie && _currentMovie->getScore()->_playState == kPlayStopped) {
 		debugC(3, kDebugEvents, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
-		debugC(3, kDebugEvents, "@@@@   Finishing movie '%s' in '%s'", toPrintable(_currentMovie->getMacName()).c_str(), _currentPath.c_str());
+		debugC(3, kDebugEvents, "@@@@   Finishing movie '%s' in '%s'", utf8ToPrintable(_currentMovie->getMacName()).c_str(), _currentPath.c_str());
 		debugC(3, kDebugEvents, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
 
 		_currentMovie->getScore()->stopPlay();
-		debugC(1, kDebugEvents, "Finished playback of movie '%s'", toPrintable(_currentMovie->getMacName()).c_str());
+		debugC(1, kDebugEvents, "Finished playback of movie '%s'", utf8ToPrintable(_currentMovie->getMacName()).c_str());
 
 		if (_vm->getGameGID() == GID_TESTALL) {
 			_nextMovie = getNextMovieFromQueue();
@@ -477,7 +477,7 @@ bool Window::step() {
 		_currentMovie->setArchive(mov);
 
 		debug(0, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
-		debug(0, "@@@@   Switching to movie '%s' in '%s'", toPrintable(_currentMovie->getMacName()).c_str(), _currentPath.c_str());
+		debug(0, "@@@@   Switching to movie '%s' in '%s'", utf8ToPrintable(_currentMovie->getMacName()).c_str(), _currentPath.c_str());
 		debug(0, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
 
 		g_lingo->resetLingo();
@@ -506,7 +506,7 @@ bool Window::step() {
 		case kPlayNotStarted:
 			{
 				debug(0, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
-				debug(0, "@@@@   Loading movie '%s' in '%s'", toPrintable(_currentMovie->getMacName()).c_str(), _currentPath.c_str());
+				debug(0, "@@@@   Loading movie '%s' in '%s'", utf8ToPrintable(_currentMovie->getMacName()).c_str(), _currentPath.c_str());
 				debug(0, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
 
 				bool goodMovie = _currentMovie->loadArchive();
@@ -536,7 +536,7 @@ bool Window::step() {
 			// fall through
 		case kPlayStarted:
 			debugC(3, kDebugEvents, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
-			debugC(3, kDebugEvents, "@@@@   Stepping movie '%s' in '%s'", toPrintable(_currentMovie->getMacName()).c_str(), _currentPath.c_str());
+			debugC(3, kDebugEvents, "@@@@   Stepping movie '%s' in '%s'", utf8ToPrintable(_currentMovie->getMacName()).c_str(), _currentPath.c_str());
 			debugC(3, kDebugEvents, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
 			_currentMovie->getScore()->step();
 			return true;




More information about the Scummvm-git-logs mailing list