diff options
author | Johannes Schickel | 2014-07-05 13:35:34 +0200 |
---|---|---|
committer | Johannes Schickel | 2014-07-05 13:35:34 +0200 |
commit | b77412a9a07e58a21dd430e28cf34210d4648fd0 (patch) | |
tree | a0ca26a89ddcfb81e8da4e8361352e1e62e926e6 /engines/scumm/file.cpp | |
parent | 48564efc8812aef644144cb368d65a8d14a4397f (diff) | |
parent | 53d3ee07df6eea863e93620ab4a406eb24fbfef1 (diff) | |
download | scummvm-rg350-b77412a9a07e58a21dd430e28cf34210d4648fd0.tar.gz scummvm-rg350-b77412a9a07e58a21dd430e28cf34210d4648fd0.tar.bz2 scummvm-rg350-b77412a9a07e58a21dd430e28cf34210d4648fd0.zip |
Merge pull request #470 from bluegr/Lucasarts_Steam
SCUMM: Add support for Steam versions of Indy 3, Indy 4, Loom and Dig
Diffstat (limited to 'engines/scumm/file.cpp')
-rw-r--r-- | engines/scumm/file.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/engines/scumm/file.cpp b/engines/scumm/file.cpp index 9c161ff1cc..21b0e594bf 100644 --- a/engines/scumm/file.cpp +++ b/engines/scumm/file.cpp @@ -29,6 +29,22 @@ namespace Scumm { +// The following table includes all the index files, which are embedded in the +// main game executables in Steam versions. +const SteamIndexFile steamIndexFiles[] = { + { GID_INDY3, Common::kPlatformWindows, "%02d.LFL", "00.LFL", "Indiana Jones and the Last Crusade.exe", 162056, 6295 }, + { GID_INDY3, Common::kPlatformMacintosh, "%02d.LFL", "00.LFL", "The Last Crusade", 150368, 6295 }, + { GID_INDY4, Common::kPlatformWindows, "atlantis.%03d", "ATLANTIS.000", "Indiana Jones and the Fate of Atlantis.exe", 224336, 12035 }, + { GID_INDY4, Common::kPlatformMacintosh, "atlantis.%03d", "ATLANTIS.000", "The Fate of Atlantis", 260224, 12035 }, + { GID_LOOM, Common::kPlatformWindows, "%03d.LFL", "000.LFL", "Loom.exe", 187248, 8307 }, + { GID_LOOM, Common::kPlatformMacintosh, "%03d.LFL", "000.LFL", "Loom", 170464, 8307 }, +#ifdef ENABLE_SCUMM_7_8 + { GID_DIG, Common::kPlatformWindows, "dig.la%d", "DIG.LA0", "The Dig.exe", 340632, 16304 }, + { GID_DIG, Common::kPlatformMacintosh, "dig.la%d", "DIG.LA0", "The Dig", 339744, 16304 }, +#endif + { 0, Common::kPlatformUnknown, "", "", "", 0, 0 } +}; + #pragma mark - #pragma mark --- ScummFile --- #pragma mark - @@ -185,6 +201,29 @@ uint32 ScummFile::read(void *dataPtr, uint32 dataSize) { } #pragma mark - +#pragma mark --- ScummSteamFile --- +#pragma mark - +bool ScummSteamFile::open(const Common::String &filename) { + for (const SteamIndexFile *indexFile = steamIndexFiles; indexFile->len; ++indexFile) { + if (indexFile->id == _steamGame.id && indexFile->platform == _steamGame.platform && filename.equalsIgnoreCase(indexFile->indexFileName)) + return openWithSubRange(indexFile->executableName, indexFile->start, indexFile->len); + } + + // Regular non-bundled file + return ScummFile::open(filename); +} + +bool ScummSteamFile::openWithSubRange(const Common::String &filename, int32 subFileStart, int32 subFileLen) { + if (ScummFile::open(filename)) { + _subFileStart = subFileStart; + _subFileLen = subFileLen; + seek(0, SEEK_SET); + return true; + } else + return false; +} + +#pragma mark - #pragma mark --- ScummDiskImage --- #pragma mark - |