diff options
author | Paul Gilbert | 2016-03-16 21:01:01 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-03-16 21:01:01 -0400 |
commit | 6be64df2f0c0bf50e551187c2ba989d756f2dd36 (patch) | |
tree | 0d5286ac9a8e50b34fa25a3f4bb6eb9fcf53af9f /engines/titanic/files_manager.cpp | |
parent | 8ec499c177d88e11930b8550c47c352d65dc603a (diff) | |
download | scummvm-rg350-6be64df2f0c0bf50e551187c2ba989d756f2dd36.tar.gz scummvm-rg350-6be64df2f0c0bf50e551187c2ba989d756f2dd36.tar.bz2 scummvm-rg350-6be64df2f0c0bf50e551187c2ba989d756f2dd36.zip |
TITANIC: Implemented overall surface loading method
Diffstat (limited to 'engines/titanic/files_manager.cpp')
-rw-r--r-- | engines/titanic/files_manager.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/engines/titanic/files_manager.cpp b/engines/titanic/files_manager.cpp index b7562b638a..662a882e3e 100644 --- a/engines/titanic/files_manager.cpp +++ b/engines/titanic/files_manager.cpp @@ -31,35 +31,35 @@ CFilesManager::CFilesManager() : _gameManager(nullptr), _field18(0), _field1C(0), _field3C(0) { } -bool CFilesManager::fn1(const CString &name) { +bool CFilesManager::fileExists(const CString &name) { + Common::File f; + return f.exists(name); +} + +bool CFilesManager::scanForFile(const CString &name) { if (name.empty()) - return 0; + return false; - CString str = name; - str.toLowercase(); + CString filename = name; + filename.toLowercase(); - if (str[0] == 'z' || str[0] == 'y') { - return 1; - } else if (str[0] < 'a' || str[0] > 'c') { - return 0; - } + if (filename[0] == 'y' || filename[0] == 'z') + return true; + else if (filename[0] < 'a' || filename[0] > 'c') + return false; - CString tempStr = str; - int idx = tempStr.indexOf('#'); + CString fname = filename; + int idx = fname.indexOf('#'); if (idx >= 0) { - tempStr = tempStr.left(idx); - str = str.c_str() + idx + 1; - str += ".st"; + fname = fname.left(idx); + fname += ".st"; } - - - return true; -} - -bool CFilesManager::fileExists(const CString &name) { - Common::File f; - return f.exists(name); + // The original had a bunch of code here handling determining + // which asset path, if any, the filename was present for, + // and storing the "active asset path" it was found on. + // This is redundant for ScummVM, which takes care of the paths + return fileExists(fname); } } // End of namespace Titanic |