diff options
author | Travis Howell | 2005-11-19 03:37:34 +0000 |
---|---|---|
committer | Travis Howell | 2005-11-19 03:37:34 +0000 |
commit | 463b30f707f622d6777f1e94c9375a34850845e9 (patch) | |
tree | 0fb9f6b7367eb97031e2fc1874cd81983627755f /scumm | |
parent | 5f472a4f6cb1bedc5d0abbfb2977e676114ba52f (diff) | |
download | scummvm-rg350-463b30f707f622d6777f1e94c9375a34850845e9.tar.gz scummvm-rg350-463b30f707f622d6777f1e94c9375a34850845e9.tar.bz2 scummvm-rg350-463b30f707f622d6777f1e94c9375a34850845e9.zip |
Fix the bundled Macintosh version of FT demo.
Filename substitution should only be checked for resource files, not other data files.
svn-id: r19659
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/resource.cpp | 36 | ||||
-rw-r--r-- | scumm/scumm.cpp | 2 | ||||
-rw-r--r-- | scumm/scumm.h | 2 |
3 files changed, 20 insertions, 20 deletions
diff --git a/scumm/resource.cpp b/scumm/resource.cpp index 5d516fae3e..a2ad0988e5 100644 --- a/scumm/resource.cpp +++ b/scumm/resource.cpp @@ -230,7 +230,7 @@ void ScummEngine::readRoomsOffsets() { } } -bool ScummEngine::openFile(BaseScummFile &file, const char *filename) { +bool ScummEngine::openFile(BaseScummFile &file, const char *filename, bool resourceFile) { bool result = false; if (!_containerFile.isEmpty()) { @@ -245,27 +245,29 @@ bool ScummEngine::openFile(BaseScummFile &file, const char *filename) { // Some Mac demos (i.e. DOTT) have bundled file names different // from target name. dottdemo.000 vs tentacle.000. So we should // substitute those names too - if (_substResFileNameIndexBundle == 0) { - int substLastIndex = 0; + if (resourceFile == true) { + if (_substResFileNameIndexBundle == 0) { + int substLastIndex = 0; - while (substLastIndex != -1) { - if (file.openSubFile(name)) - break; + while (substLastIndex != -1) { + if (file.openSubFile(name)) + break; - substLastIndex = generateSubstResFileName(filename, name, sizeof(name), substLastIndex + 1); - } + substLastIndex = generateSubstResFileName(filename, name, sizeof(name), substLastIndex + 1); + } - if (substLastIndex == 0) - substLastIndex = -1; + if (substLastIndex == 0) + substLastIndex = -1; - _substResFileNameIndexBundle = substLastIndex; + _substResFileNameIndexBundle = substLastIndex; - if (substLastIndex != -1) - debug(5, "Generated substitute in Mac bundle: [%s -> %s]", filename, name); - } + if (substLastIndex != -1) + debug(5, "Generated substitute in Mac bundle: [%s -> %s]", filename, name); + } - if (_substResFileNameIndexBundle != -1) - generateSubstResFileName(filename, name, sizeof(name), _substResFileNameIndexBundle); + if (_substResFileNameIndexBundle != -1) + generateSubstResFileName(filename, name, sizeof(name), _substResFileNameIndexBundle); + } result = file.openSubFile(name); } @@ -281,7 +283,7 @@ bool ScummEngine::openFile(BaseScummFile &file, const char *filename) { bool ScummEngine::openResourceFile(const char *filename, byte encByte) { debugC(DEBUG_GENERAL, "openResourceFile(%s)", filename); - if (openFile(*_fileHandle, filename)) { + if (openFile(*_fileHandle, filename, true)) { _fileHandle->setEnc(encByte); return true; } diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index f201de6c07..8e5dd25736 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -717,8 +717,6 @@ static SubstResFileNames substResFileNameTable[] = { { "ft.la0", "Full Throttle Demo Data", kGenAsIs }, { "ft.la0", "Vollgas Data", kGenAsIs }, { "ft.la0", "Vollgas Demo Data", kGenAsIs }, - { "ft.la0", "ft.000", kGenAsIs }, // Is this target used? - { "ft.la0", "ftdemo.la0", kGenAsIs }, { "ft", "ftdemo", kGenPC }, #endif #ifndef DISABLE_HE diff --git a/scumm/scumm.h b/scumm/scumm.h index 9e7822cf65..a14d4aa6f5 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -691,7 +691,7 @@ public: /** The name of the (macintosh/rescumm style) container file, if any. */ Common::String _containerFile; - bool openFile(BaseScummFile &file, const char *filename); + bool openFile(BaseScummFile &file, const char *filename, bool resourceFile = false); protected: int _resourceHeaderSize; |