diff options
author | Paul Gilbert | 2012-11-17 15:13:52 +1100 |
---|---|---|
committer | Paul Gilbert | 2012-11-17 15:13:52 +1100 |
commit | 848dcbcf0993f7bb15d16db4d65daaa0d4ffaf82 (patch) | |
tree | 29e3ebd8d5ccf6991aa323031a7a0a90d46739e5 /engines/hopkins/files.cpp | |
parent | 60c46fe386ad5f927ceda75912af5bd8b5ed563c (diff) | |
download | scummvm-rg350-848dcbcf0993f7bb15d16db4d65daaa0d4ffaf82.tar.gz scummvm-rg350-848dcbcf0993f7bb15d16db4d65daaa0d4ffaf82.tar.bz2 scummvm-rg350-848dcbcf0993f7bb15d16db4d65daaa0d4ffaf82.zip |
HOPKINS: Properly implemented CONSTRUIT_FICHIER for animations.
The game has separate folders for selected animations at different resolutions.
Diffstat (limited to 'engines/hopkins/files.cpp')
-rw-r--r-- | engines/hopkins/files.cpp | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/engines/hopkins/files.cpp b/engines/hopkins/files.cpp index aafa56691f..daa618d7c2 100644 --- a/engines/hopkins/files.cpp +++ b/engines/hopkins/files.cpp @@ -134,16 +134,43 @@ int FileManager::CONSTRUIT_SYSTEM(const Common::String &file) { return _vm->_globals.NFICHIER.size(); } -// Build File -void FileManager::CONSTRUIT_FICHIER(const Common::String &hop, const Common::String &file) { - // At this point, the original program did a big switch statement to determine - // whether to preprend the CD or installed directory path into REPJEU +void FileManager::CONSTRUIT_FICHIER(const Common::String &folder, const Common::String &file) { + Common::String folderToUse = folder; - if (hop[0] == 'A' && hop[1] == 'N' && hop[2] == 'N') { - error("TODO: CONSTRUIT_FICHIER"); + // A lot of the code in the original engine based on COPIE_SEQ was used to determine + // whether a file resided on the CD or hard disk. Since the ScummVM implementatoin + // requires all the files in the same location, we only need to do a somewhat simpler + // check for animations that don't exist in the ANM folder, but rather in special + // sub-folders depending on the physical screen resolution being used. + + if (folder == "ANM") { + switch (_vm->_globals.SVGA) { + case 1: + if (TEST_REP(folderToUse, file)) + folderToUse = "TSVGA"; + break; + case 2: + if (TEST_REP(folderToUse, file)) + folderToUse = "SVGA"; + break; + case 3: + if (TEST_REP(folderToUse, file)) + folderToUse = "VGA"; + break; + default: + break; + } } - _vm->_globals.NFICHIER = Common::String::format("%s/%s", hop.c_str(), file.c_str()); + _vm->_globals.NFICHIER = Common::String::format("%s/%s", folderToUse.c_str(), file.c_str()); +} + +bool FileManager::TEST_REP(const Common::String &folder, const Common::String &file) { + Common::String filename = folder.empty() ? file : + Common::String::format("%s/%s", folder.c_str(), file.c_str()); + + Common::File f; + return !f.exists(filename); } // Free File |