diff options
author | Paul Gilbert | 2016-09-18 10:22:49 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-09-18 10:22:49 -0400 |
commit | a39da343b7dd0ea69c481c3f0a5346a9134ae736 (patch) | |
tree | 95a738f2e4500982900a5fcd156564d62edef6c1 /engines/xeen/files.cpp | |
parent | 2bec9c5a0cfc9f339ce04460c9d6bd3b8633f1b2 (diff) | |
download | scummvm-rg350-a39da343b7dd0ea69c481c3f0a5346a9134ae736.tar.gz scummvm-rg350-a39da343b7dd0ea69c481c3f0a5346a9134ae736.tar.bz2 scummvm-rg350-a39da343b7dd0ea69c481c3f0a5346a9134ae736.zip |
XEEN: Support switching between fx & game music, fx fixes
Diffstat (limited to 'engines/xeen/files.cpp')
-rw-r--r-- | engines/xeen/files.cpp | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/engines/xeen/files.cpp b/engines/xeen/files.cpp index 443a296bd4..b928677aac 100644 --- a/engines/xeen/files.cpp +++ b/engines/xeen/files.cpp @@ -189,6 +189,7 @@ FileManager::FileManager(XeenEngine *vm) { Common::File f; int sideNum = 0; + File::_currentArchive = ANY_ARCHIVE; _isDarkCc = vm->getGameID() == GType_DarkSide; _archives[0] = _archives[1] = _archives[2] = nullptr; @@ -207,8 +208,6 @@ FileManager::FileManager(XeenEngine *vm) { _archives[2] = new CCArchive("intro.cc", "intro", true); SearchMan.add("intro", _archives[2]); } - - File::_currentArchive = GAME_ARCHIVE; } void FileManager::setGameCc(bool isDarkCc) { @@ -220,11 +219,20 @@ void FileManager::setGameCc(bool isDarkCc) { ArchiveType File::_currentArchive; +File::File(const Common::String &filename) { + File::open(filename); +} + +File::File(const Common::String &filename, ArchiveType archiveType) { + File::open(filename, archiveType); +} + +File::File(const Common::String &filename, Common::Archive &archive) { + File::open(filename, archive); +} + bool File::open(const Common::String &filename) { - CCArchive &arc = *FileManager::_archives[_currentArchive]; - if (!Common::File::open(filename)) - error("Could not open file - %s", filename.c_str()); - return true; + return File::open(filename, _currentArchive); } bool File::open(const Common::String &filename, ArchiveType archiveType) { @@ -232,7 +240,10 @@ bool File::open(const Common::String &filename, ArchiveType archiveType) { Common::File::open(filename); } else { CCArchive &archive = *FileManager::_archives[archiveType]; - Common::File::open(filename, archive); + if (!Common::File::open(filename, archive)) + // If not in the designated archive, try opening from any archive, + // or as a standalone file in the filesystem + Common::File::open(filename); } if (!isOpen()) @@ -243,6 +254,7 @@ bool File::open(const Common::String &filename, ArchiveType archiveType) { bool File::open(const Common::String &filename, Common::Archive &archive) { if (!Common::File::open(filename, archive)) error("Could not open file - %s", filename.c_str()); + return true; } Common::String File::readString() { |