[Scummvm-git-logs] scummvm master -> d814ddda906bebcdf10be1d6cb674a4fdceab873
mistydemeo
noreply at scummvm.org
Fri Jun 9 05:48:25 UTC 2023
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:
d814ddda90 DIRECTOR: revert changes to openResFile
Commit: d814ddda906bebcdf10be1d6cb674a4fdceab873
https://github.com/scummvm/scummvm/commit/d814ddda906bebcdf10be1d6cb674a4fdceab873
Author: Misty De Meo (mistydemeo at gmail.com)
Date: 2023-06-08T22:48:21-07:00
Commit Message:
DIRECTOR: revert changes to openResFile
In 6e47994fc793f122768565185b1d6c6052aca2d9, openResFile was changed
to use the new `openArchive` method. However, that method tries to
treat the file as a Director archive and it may not be. This broke,
for example, loading external cursors via `openResFile`. This reverts
to the previous behaviour.
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 2803afc27b6..ea11f38ecf6 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -1240,13 +1240,19 @@ void LB::b_openDA(int nargs) {
void LB::b_openResFile(int nargs) {
Datum d = g_lingo->pop();
Common::String resPath = g_director->getCurrentWindow()->getCurrentPath() + d.asString();
- resPath = pathMakeRelative(resPath);
+
+ if (g_director->getPlatform() == Common::kPlatformWindows) {
+ warning("STUB: BUILDBOT: b_openResFile(%s) on Windows", d.asString().c_str());
+ return;
+ }
if (!g_director->_allOpenResFiles.contains(resPath)) {
- Archive *arch = g_director->openArchive(resPath);
- if (arch) {
- // Track responsibility. closeResFile may only close resource files opened by openResFile.
+ MacArchive *arch = new MacArchive();
+ if (arch->openFile(pathMakeRelative(resPath))) {
g_director->_openResFiles.setVal(resPath, arch);
+ g_director->_allOpenResFiles.setVal(resPath, arch);
+ } else {
+ delete arch;
}
}
}
More information about the Scummvm-git-logs
mailing list