[Scummvm-git-logs] scummvm master -> 5a1a0963001c5dfbcf771f3e6dc836fadf946078
sev-
noreply at scummvm.org
Sat Jun 4 12:16:09 UTC 2022
This automated email contains information about 6 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
8d13da7dc1 DIRECTOR: Added possibility to provide extra search path, use it for mcluhan
1fc4cc60fc DIRECTOR: Enhanced debug output for makePathRelative
1823539136 DIRECTOR: Allow test directories for existence
3d3a47d931 DIRECTOR: LINGO: Fix b_getNthFileNameInFolder after conversion to Common::Path
2efadfaac6 JANITORIAL: Remove trailing spaces
5a1a096300 DIRECTOR: LINGO: Fix crash in internal debugger for D4+
Commit: 8d13da7dc18b87b902236b5d855934d27bfa8b45
https://github.com/scummvm/scummvm/commit/8d13da7dc18b87b902236b5d855934d27bfa8b45
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-06-04T14:15:46+02:00
Commit Message:
DIRECTOR: Added possibility to provide extra search path, use it for mcluhan
Changed paths:
engines/director/director.h
engines/director/game-quirks.cpp
engines/director/util.cpp
diff --git a/engines/director/director.h b/engines/director/director.h
index a3f5de40a62..e272721f971 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -270,6 +270,7 @@ public:
bool _skipFrameAdvance;
bool _centerStage;
char _dirSeparator;
+ Common::List<Common::String> _extraSearchPath;
Common::HashMap<Common::String, Archive *, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _openResFiles;
Common::Array<Graphics::WinCursorGroup *> _winCursor;
diff --git a/engines/director/game-quirks.cpp b/engines/director/game-quirks.cpp
index a04f028cc1a..3391d38d49b 100644
--- a/engines/director/game-quirks.cpp
+++ b/engines/director/game-quirks.cpp
@@ -37,6 +37,11 @@ static void quirkWarlock() {
SearchMan.addDirectory(g_director->_gameDataDir.getPath(), g_director->_gameDataDir, 0, 5);
}
+static void quirkMcLuhan() {
+ // TODO. Read fonts from MCLUHAN/SYSTEM directory
+ g_director->_extraSearchPath.push_back("mcluhan\\");
+}
+
struct Quirk {
const char *target;
Common::Platform platform;
@@ -45,6 +50,7 @@ struct Quirk {
{ "lzone", Common::kPlatformWindows, &quirkLzone },
{ "mediaband", Common::kPlatformUnknown, &quirkMediaband },
{ "warlock", Common::kPlatformUnknown, &quirkWarlock },
+ { "mcluhan", Common::kPlatformWindows, &quirkMcLuhan },
{ nullptr, Common::kPlatformUnknown, nullptr }
};
diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index 21fa38bff44..1fe52e58a37 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -458,6 +458,14 @@ Common::String pathMakeRelative(Common::String path, bool recursive, bool addext
}
}
+ for (auto i = g_director->_extraSearchPath.begin(); i != g_director->_extraSearchPath.end(); ++i) {
+ debug(9, "pathMakeRelative(): extraSearchPath: %s", i->c_str());
+
+ foundPath = wrappedPathMakeRelative(*i + path, recursive, addexts, directory);
+ if (testPath(foundPath))
+ return foundPath;
+ }
+
return wrappedPathMakeRelative(path, recursive, addexts, directory);
}
Commit: 1fc4cc60fcc08da8e75b9f3b78a4173ab51ba8b5
https://github.com/scummvm/scummvm/commit/1fc4cc60fcc08da8e75b9f3b78a4173ab51ba8b5
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-06-04T14:15:46+02:00
Commit Message:
DIRECTOR: Enhanced debug output for makePathRelative
Changed paths:
engines/director/util.cpp
diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index 1fe52e58a37..2817a4616b7 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -398,6 +398,8 @@ bool testPath(Common::String &path, bool directory) {
if (SearchMan.hasFile(Common::Path(path, g_director->_dirSeparator)))
return true;
+ debug(9, "testPath: %s dir: %d", path.c_str(), directory);
+
// check for the game data dir
if (!path.contains(g_director->_dirSeparator) && path.equalsIgnoreCase(d.getName())) {
if (!directory)
@@ -433,9 +435,12 @@ bool testPath(Common::String &path, bool directory) {
break;
}
}
- if (!exists)
+ if (!exists) {
+ debug(9, "testPath: Not exists");
return false;
+ }
}
+ debug(9, "testPath: ***** HAVE MATCH");
// write back path with correct case
path = newPath;
return true;
@@ -455,6 +460,8 @@ Common::String pathMakeRelative(Common::String path, bool recursive, bool addext
foundPath = wrappedPathMakeRelative(searchIn + path, recursive, addexts, directory);
if (testPath(foundPath))
return foundPath;
+
+ debug(9, "pathMakeRelative(): -- searchPath not found: %s", foundPath.c_str());
}
}
@@ -464,6 +471,8 @@ Common::String pathMakeRelative(Common::String path, bool recursive, bool addext
foundPath = wrappedPathMakeRelative(*i + path, recursive, addexts, directory);
if (testPath(foundPath))
return foundPath;
+
+ debug(9, "pathMakeRelative(): -- extraSearchPath not found: %s", foundPath.c_str());
}
return wrappedPathMakeRelative(path, recursive, addexts, directory);
@@ -477,17 +486,17 @@ Common::String wrappedPathMakeRelative(Common::String path, bool recursive, bool
Common::String initialPath(path);
- debug(9, "pathMakeRelative(): s0 %s -> %s", path.c_str(), initialPath.c_str());
+ debug(9, "wrappedPathMakeRelative(): s0 %s -> %s", path.c_str(), initialPath.c_str());
if (recursive) // first level
initialPath = convertPath(initialPath);
- debug(9, "pathMakeRelative(): s1 %s -> %s", path.c_str(), initialPath.c_str());
+ debug(9, "wrappedPathMakeRelative(): s1 %s -> %s", path.c_str(), initialPath.c_str());
initialPath = Common::normalizePath(g_director->getCurrentPath() + initialPath, g_director->_dirSeparator);
Common::String convPath = initialPath;
- debug(9, "pathMakeRelative(): s2 %s", convPath.c_str());
+ debug(9, "wrappedPathMakeRelative(): s2 %s", convPath.c_str());
// Strip the leading whitespace from the path
initialPath.trim();
@@ -495,6 +504,8 @@ Common::String wrappedPathMakeRelative(Common::String path, bool recursive, bool
if (testPath(initialPath, directory))
return initialPath;
+ debug(9, "wrappedPathMakeRelative(): s2.1 -- not found %s", initialPath.c_str());
+
// Now try to search the file
bool opened = false;
@@ -502,19 +513,21 @@ Common::String wrappedPathMakeRelative(Common::String path, bool recursive, bool
int pos = convPath.find(g_director->_dirSeparator);
convPath = Common::String(&convPath.c_str()[pos + 1]);
- debug(9, "pathMakeRelative(): s3 try %s", convPath.c_str());
+ debug(9, "wrappedPathMakeRelative(): s3 try %s", convPath.c_str());
if (!testPath(convPath, directory)) {
// If we were supplied with parh with subdirectories,
// attempt to combine it with the current movie path at every iteration
Common::String locPath = Common::normalizePath(g_director->getCurrentPath() + convPath, g_director->_dirSeparator);
- debug(9, "pathMakeRelative(): s3.1 try %s", locPath.c_str());
+ debug(9, "wrappedPathMakeRelative(): s3.1 try %s", locPath.c_str());
- if (!testPath(locPath, directory))
+ if (!testPath(locPath, directory)) {
+ debug(9, "wrappedPathMakeRelative(): s3.1 -- not found %s", locPath.c_str());
continue;
+ }
}
- debug(9, "pathMakeRelative(): s3 converted %s -> %s", path.c_str(), convPath.c_str());
+ debug(9, "wrappedPathMakeRelative(): s3 converted %s -> %s", path.c_str(), convPath.c_str());
opened = true;
@@ -525,22 +538,26 @@ Common::String wrappedPathMakeRelative(Common::String path, bool recursive, bool
// Try stripping all of the characters not allowed in FAT
convPath = stripMacPath(initialPath.c_str());
- debug(9, "pathMakeRelative(): s4 %s", convPath.c_str());
+ debug(9, "wrappedPathMakeRelative(): s4 %s", convPath.c_str());
if (testPath(initialPath, directory))
return initialPath;
+ debug(9, "wrappedPathMakeRelative(): s4.1 -- not found %s", initialPath.c_str());
+
// Now try to search the file
while (convPath.contains(g_director->_dirSeparator)) {
int pos = convPath.find(g_director->_dirSeparator);
convPath = Common::String(&convPath.c_str()[pos + 1]);
- debug(9, "pathMakeRelative(): s5 try %s", convPath.c_str());
+ debug(9, "wrappedPathMakeRelative(): s5 try %s", convPath.c_str());
- if (!testPath(convPath, directory))
+ if (!testPath(convPath, directory)) {
+ debug(9, "wrappedPathMakeRelative(): s5 -- not found %s", convPath.c_str());
continue;
+ }
- debug(9, "pathMakeRelative(): s5 converted %s -> %s", path.c_str(), convPath.c_str());
+ debug(9, "wrappedPathMakeRelative(): s5 converted %s -> %s", path.c_str(), convPath.c_str());
opened = true;
@@ -580,11 +597,13 @@ Common::String wrappedPathMakeRelative(Common::String path, bool recursive, bool
Common::String ext = component.substr(component.size() - 4);
Common::String newpath = convPath + convertMacFilename(nameWithoutExt.c_str()) + ext;
- debug(9, "pathMakeRelative(): s6 %s -> try %s", initialPath.c_str(), newpath.c_str());
+ debug(9, "wrappedPathMakeRelative(): s6 %s -> try %s", initialPath.c_str(), newpath.c_str());
Common::String res = wrappedPathMakeRelative(newpath, false, false);
if (testPath(res))
return res;
+
+ debug(9, "wrappedPathMakeRelative(): s6 -- not found %s", res.c_str());
}
}
Commit: 1823539136a680e40153108542db4b8f3481e6ca
https://github.com/scummvm/scummvm/commit/1823539136a680e40153108542db4b8f3481e6ca
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-06-04T14:15:46+02:00
Commit Message:
DIRECTOR: Allow test directories for existence
Changed paths:
engines/director/util.cpp
diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index 2817a4616b7..312331151c0 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -417,7 +417,7 @@ bool testPath(Common::String &path, bool directory) {
fslist.clear();
Common::FSNode::ListMode mode = Common::FSNode::kListDirectoriesOnly;
if (directory_list.empty() && !directory) {
- mode = Common::FSNode::kListFilesOnly;
+ mode = Common::FSNode::kListAll;
}
d.getChildren(fslist, mode);
Commit: 3d3a47d93198f9bcdfa1303abfaa55df3a237261
https://github.com/scummvm/scummvm/commit/3d3a47d93198f9bcdfa1303abfaa55df3a237261
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-06-04T14:15:46+02:00
Commit Message:
DIRECTOR: LINGO: Fix b_getNthFileNameInFolder after conversion to Common::Path
Changed paths:
engines/director/lingo/lingo-builtins.cpp
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index e317a16b730..a91c29cb4e6 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -1079,7 +1079,7 @@ void LB::b_getNthFileNameInFolder(int nargs) {
// for directory, we either return the correct path, which we can access recursively.
// or we get a wrong path, which will lead us to a non-exist file node
- Common::StringTokenizer directory_list(path, "/");
+ Common::StringTokenizer directory_list(path, Common::String(g_director->_dirSeparator));
Common::FSNode d = Common::FSNode(*g_director->getGameDataDir());
while (d.exists() && !directory_list.empty()) {
d = d.getChild(directory_list.nextToken());
Commit: 2efadfaac670d2ddd789d81e776551023746d161
https://github.com/scummvm/scummvm/commit/2efadfaac670d2ddd789d81e776551023746d161
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-06-04T14:15:47+02:00
Commit Message:
JANITORIAL: Remove trailing spaces
Changed paths:
engines/director/lingo/lingo-codegen.cpp
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp
index 7e97073f881..f92f9f81e2e 100644
--- a/engines/director/lingo/lingo-codegen.cpp
+++ b/engines/director/lingo/lingo-codegen.cpp
@@ -377,18 +377,18 @@ void LingoCompiler::registerFactory(Common::String &name) {
void LingoCompiler::updateLoopJumps(uint nextTargetPos, uint exitTargetPos) {
if (!_currentLoop)
return;
-
+
for (uint i = 0; i < _currentLoop->nextRepeats.size(); i++) {
uint nextRepeatPos = _currentLoop->nextRepeats[i];
inst jmpOffset = nullptr;
WRITE_UINT32(&jmpOffset, nextTargetPos - nextRepeatPos);
- (*_currentAssembly)[nextRepeatPos + 1] = jmpOffset;
+ (*_currentAssembly)[nextRepeatPos + 1] = jmpOffset;
}
for (uint i = 0; i < _currentLoop->exitRepeats.size(); i++) {
uint exitRepeatPos = _currentLoop->exitRepeats[i];
inst jmpOffset = nullptr;
WRITE_UINT32(&jmpOffset, exitTargetPos - exitRepeatPos);
- (*_currentAssembly)[exitRepeatPos + 1] = jmpOffset;
+ (*_currentAssembly)[exitRepeatPos + 1] = jmpOffset;
}
}
@@ -559,7 +559,7 @@ bool LingoCompiler::visitCmdNode(CmdNode *node) {
bool LingoCompiler::visitPutIntoNode(PutIntoNode *node) {
if (node->var->type == kVarNode) {
- registerMethodVar(*static_cast<VarNode *>(node->var)->name);
+ registerMethodVar(*static_cast<VarNode *>(node->var)->name);
}
COMPILE(node->val);
COMPILE_REF(node->var);
@@ -571,7 +571,7 @@ bool LingoCompiler::visitPutIntoNode(PutIntoNode *node) {
bool LingoCompiler::visitPutAfterNode(PutAfterNode *node) {
if (node->var->type == kVarNode) {
- registerMethodVar(*static_cast<VarNode *>(node->var)->name);
+ registerMethodVar(*static_cast<VarNode *>(node->var)->name);
}
COMPILE(node->val);
COMPILE_REF(node->var);
@@ -583,7 +583,7 @@ bool LingoCompiler::visitPutAfterNode(PutAfterNode *node) {
bool LingoCompiler::visitPutBeforeNode(PutBeforeNode *node) {
if (node->var->type == kVarNode) {
- registerMethodVar(*static_cast<VarNode *>(node->var)->name);
+ registerMethodVar(*static_cast<VarNode *>(node->var)->name);
}
COMPILE(node->val);
COMPILE_REF(node->var);
@@ -756,7 +756,7 @@ bool LingoCompiler::visitSetNode(SetNode *node) {
}
if (node->var->type == kVarNode) {
- registerMethodVar(*static_cast<VarNode *>(node->var)->name);
+ registerMethodVar(*static_cast<VarNode *>(node->var)->name);
}
COMPILE(node->val);
COMPILE_REF(node->var);
@@ -937,7 +937,7 @@ bool LingoCompiler::visitRepeatWithInNode(RepeatWithInNode *node) {
codeInt(0);
code1(LC::c_stackpeek); // get array size
codeInt(2);
- code1(LC::c_le);
+ code1(LC::c_le);
uint jzPos = _currentAssembly->size();
code2(LC::c_jumpifz, nullptr);
Commit: 5a1a0963001c5dfbcf771f3e6dc836fadf946078
https://github.com/scummvm/scummvm/commit/5a1a0963001c5dfbcf771f3e6dc836fadf946078
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-06-04T14:15:47+02:00
Commit Message:
DIRECTOR: LINGO: Fix crash in internal debugger for D4+
Changed paths:
engines/director/lingo/lingo-codegen.cpp
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp
index f92f9f81e2e..dea6357c78d 100644
--- a/engines/director/lingo/lingo-codegen.cpp
+++ b/engines/director/lingo/lingo-codegen.cpp
@@ -1137,7 +1137,7 @@ bool LingoCompiler::visitFuncNode(FuncNode *node) {
/* VarNode */
bool LingoCompiler::visitVarNode(VarNode *node) {
- if (g_director->getVersion() < 400 || g_director->getCurrentMovie()->_allowOutdatedLingo) {
+ if (g_director->getVersion() < 400 || (g_director->getCurrentMovie() && g_director->getCurrentMovie()->_allowOutdatedLingo)) {
int val = castNumToNum(node->name->c_str());
if (val != -1) {
code1(LC::c_intpush);
More information about the Scummvm-git-logs
mailing list