[Scummvm-git-logs] scummvm master -> 838aea9635b54469f7f9c42f93e1251bc55c95a7
sev-
sev at scummvm.org
Tue Feb 25 09:44:46 UTC 2020
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:
b505afe041 DIRECTOR: Plug Win->Mac path translator. Warlock-win works!
8aeeec6fee DIRECTOR: Hid noisy warning
838aea9635 DIRECTOR: Added debug output
Commit: b505afe0417b9dab1e560c1d62d892b93d967966
https://github.com/scummvm/scummvm/commit/b505afe0417b9dab1e560c1d62d892b93d967966
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-02-25T10:13:24+01:00
Commit Message:
DIRECTOR: Plug Win->Mac path translator. Warlock-win works!
Changed paths:
engines/director/lingo/lingo-funcs.cpp
engines/director/util.cpp
engines/director/util.h
diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp
index 07dd6527e5..26e11b7970 100644
--- a/engines/director/lingo/lingo-funcs.cpp
+++ b/engines/director/lingo/lingo-funcs.cpp
@@ -213,7 +213,7 @@ void Lingo::func_goto(Datum &frame, Datum &movie) {
}
}
- debug(1, "func_goto: '%s' -> '%s' -> '%s' -> '%s", movie.u.s->c_str(), convertPath(*movie.u.s).c_str(),
+ debug(1, "func_goto: '%s' -> '%s' -> '%s' -> '%s'", movie.u.s->c_str(), convertPath(*movie.u.s).c_str(),
movieFilename.c_str(), cleanedFilename.c_str());
if (!fileExists) {
diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index 718491651e..6c662173f3 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -149,7 +149,7 @@ Common::String getPath(Common::String path, Common::String cwd) {
return cwd; // The path is not altered
}
-Common::String pathMakeRelative(Common::String path) {
+Common::String pathMakeRelative(Common::String path, bool recursive) {
Common::String initialPath = Common::normalizePath(g_director->getCurrentPath() + convertPath(path), '/');
Common::File f;
Common::String convPath = initialPath;
@@ -173,8 +173,39 @@ Common::String pathMakeRelative(Common::String path) {
break;
}
- if (!opened)
+ if (!opened && recursive) {
+ // Hmmm. We couldn't find the path as is.
+ // Let's try to translate file path into 8.3 format
+ if (g_director->getPlatform() == Common::kPlatformWindows && g_director->getVersion() < 4) {
+ convPath.clear();
+ const char *ptr = initialPath.c_str();
+ Common::String component;
+
+ while (*ptr) {
+ if (*ptr == '/') {
+ if (component.equals(".")) {
+ convPath += component;
+ } else {
+ convPath += convertMacFilename(component.c_str());
+ }
+
+ component.clear();
+ convPath += '/';
+ } else {
+ component += *ptr;
+ }
+
+ ptr++;
+ }
+
+ convPath += convertMacFilename(component.c_str()) + ".MMM";
+
+ return pathMakeRelative(convPath, false);
+ }
+
+
return initialPath; // Anyway nothing good is happening
+ }
f.close();
@@ -263,7 +294,7 @@ Common::String convertMacFilename(const char *name) {
while (numDigits)
res += digits[numDigits--];
- return res + ".MMM";
+ return res;
}
} // End of namespace Director
diff --git a/engines/director/util.h b/engines/director/util.h
index b8c25a7158..a31fcf4952 100644
--- a/engines/director/util.h
+++ b/engines/director/util.h
@@ -38,7 +38,7 @@ Common::String convertPath(Common::String &path);
Common::String getPath(Common::String path, Common::String cwd);
-Common::String pathMakeRelative(Common::String path);
+Common::String pathMakeRelative(Common::String path, bool recursive = true);
Common::String convertMacFilename(const char *name);
Commit: 8aeeec6feeccbdb7377b13dd53a0cdbb79f3de67
https://github.com/scummvm/scummvm/commit/8aeeec6feeccbdb7377b13dd53a0cdbb79f3de67
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-02-25T10:15:12+01:00
Commit Message:
DIRECTOR: Hid noisy warning
Changed paths:
engines/director/frame.cpp
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index fff66122e4..00158d56e2 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -140,7 +140,8 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) {
_soundType2 = stream->readByte();
} else {
stream->read(unk, 3);
- warning("Frame::readChannels(): unk1: %x unk2: %x unk3: %x", unk[0], unk[1], unk[2]);
+ if (unk[0] != 0 || unk[1] != 0 || unk[2] != 0)
+ warning("Frame::readChannels(): unk1: %x unk2: %x unk3: %x", unk[0], unk[1], unk[2]);
}
_skipFrameFlag = stream->readByte();
_blend = stream->readByte();
Commit: 838aea9635b54469f7f9c42f93e1251bc55c95a7
https://github.com/scummvm/scummvm/commit/838aea9635b54469f7f9c42f93e1251bc55c95a7
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-02-25T10:20:24+01:00
Commit Message:
DIRECTOR: Added debug output
Changed paths:
engines/director/util.cpp
diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index 6c662173f3..44c2be83df 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -166,7 +166,7 @@ Common::String pathMakeRelative(Common::String path, bool recursive) {
if (!f.open(convPath))
continue;
- warning("pathMakeRelative(): Path converted %s -> %s", path.c_str(), convPath.c_str());
+ debug(2, "pathMakeRelative(): Path converted %s -> %s", path.c_str(), convPath.c_str());
opened = true;
@@ -200,6 +200,8 @@ Common::String pathMakeRelative(Common::String path, bool recursive) {
convPath += convertMacFilename(component.c_str()) + ".MMM";
+ debug(2, "pathMakeRelative(): Trying %s -> %s", path.c_str(), convPath.c_str());
+
return pathMakeRelative(convPath, false);
}
More information about the Scummvm-git-logs
mailing list