From 902a140f3e8058c582496296c7c1e0c55b243dda Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 3 Jul 2014 00:13:33 +0300 Subject: SCUMM: Add support for Steam versions of Indy 3, Indy 4, Loom and Dig Many Thanks to Ben Castricum for the original patch --- engines/scumm/scumm.cpp | 47 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 34c231e5d4..8c0325934d 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1026,6 +1026,35 @@ Common::Error ScummEngine::init() { } #endif + // Extra directories needed for the Steam versions + if (_filenamePattern.genMethod == kGenDiskNumSteam || _filenamePattern.genMethod == kGenRoomNumSteam) { + if (_game.platform == Common::kPlatformWindows) { + switch (_game.id) { + case GID_INDY3 : + SearchMan.addSubDirectoryMatching(gameDataDir, "indy3"); + break; + case GID_INDY4 : + SearchMan.addSubDirectoryMatching(gameDataDir, "atlantis"); + break; + case GID_LOOM : + SearchMan.addSubDirectoryMatching(gameDataDir, "loom"); + break; +#ifdef ENABLE_SCUMM_7_8 + case GID_DIG : + SearchMan.addSubDirectoryMatching(gameDataDir, "dig"); + SearchMan.addSubDirectoryMatching(gameDataDir, "dig/video"); + break; +#endif + default: + break; + } + } else { + SearchMan.addSubDirectoryMatching(gameDataDir, "Contents"); + SearchMan.addSubDirectoryMatching(gameDataDir, "Contents/MacOS"); + SearchMan.addSubDirectoryMatching(gameDataDir, "Contents/Resources"); + SearchMan.addSubDirectoryMatching(gameDataDir, "Contents/Resources/video"); + } + } // The kGenUnchanged method is only used for 'container files', i.e. files // that contain the real game files bundled together in an archive format. @@ -1126,15 +1155,25 @@ Common::Error ScummEngine::init() { error("Couldn't find known subfile inside container file '%s'", _containerFile.c_str()); _fileHandle->close(); - } else { error("kGenUnchanged used with unsupported platform"); } } else { - // Regular access, no container file involved - _fileHandle = new ScummFile(); + if (_filenamePattern.genMethod == kGenDiskNumSteam || _filenamePattern.genMethod == kGenRoomNumSteam) { + // Steam game versions have the index file embedded in the main executable + _fileHandle = new ScummSteamFile(_game); + } else { + // Regular access, no container file involved + _fileHandle = new ScummFile(); + } } + // Steam Win and Mac versions share the same DOS data files. We show Windows or Mac + // for the platform the detector, but internally we force the platform to DOS, so that + // the code for handling the original DOS data files is used. + if (_filenamePattern.genMethod == kGenDiskNumSteam || _filenamePattern.genMethod == kGenRoomNumSteam) + _game.platform = Common::kPlatformDOS; + // Load CJK font, if present // Load it earlier so _useCJKMode variable could be set loadCJKFont(); @@ -1218,7 +1257,7 @@ Common::Error ScummEngine::init() { void ScummEngine::setupScumm() { // On some systems it's not safe to run CD audio games from the CD. - if (_game.features & GF_AUDIOTRACKS) { + if (_game.features & GF_AUDIOTRACKS && !Common::File::exists("CDDA.SOU")) { checkCD(); int cd_num = ConfMan.getInt("cdrom"); -- cgit v1.2.3