aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/scumm/file.cpp')
-rw-r--r--engines/scumm/file.cpp39
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 -