mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-12 03:56:20 +00:00
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.
This commit is contained in:
parent
a4856ca1ba
commit
d814ddda90
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user