diff options
Diffstat (limited to 'engines/wintermute')
-rw-r--r-- | engines/wintermute/base/base_file_manager.cpp | 8 | ||||
-rw-r--r-- | engines/wintermute/base/file/base_savefile_manager_file.cpp | 10 | ||||
-rw-r--r-- | engines/wintermute/base/file/base_savefile_manager_file.h | 2 |
3 files changed, 20 insertions, 0 deletions
diff --git a/engines/wintermute/base/base_file_manager.cpp b/engines/wintermute/base/base_file_manager.cpp index 7ae499e368..cc74454f22 100644 --- a/engines/wintermute/base/base_file_manager.cpp +++ b/engines/wintermute/base/base_file_manager.cpp @@ -324,6 +324,9 @@ bool BaseFileManager::hasFile(const Common::String &filename) { int slot = atoi(filename.c_str() + 9); return pm.getSaveExists(slot); } + if (sfmFileExists(filename)) { + return true; + } if (diskFileExists(filename)) { return true; } @@ -395,6 +398,11 @@ Common::SeekableReadStream *BaseFileManager::openFileRaw(const Common::String &f return ret; } + ret = openSfmFile(filename); + if (ret) { + return ret; + } + ret = openDiskFile(filename); if (ret) { return ret; diff --git a/engines/wintermute/base/file/base_savefile_manager_file.cpp b/engines/wintermute/base/file/base_savefile_manager_file.cpp index 8bf684192a..d76053f58f 100644 --- a/engines/wintermute/base/file/base_savefile_manager_file.cpp +++ b/engines/wintermute/base/file/base_savefile_manager_file.cpp @@ -45,9 +45,19 @@ Common::String makeSfmFilename(const Common::String &filename) { return BaseEngine::instance().getGameTargetName() + "." + smFilename; } +bool sfmFileExists(const Common::String &filename) { + Common::String smFilename = makeSfmFilename(filename); + return g_system->getSavefileManager()->listSavefiles(smFilename).size() > 0; +} + Common::SeekableReadStream *openSfmFile(const Common::String &filename) { Common::String smFilename = makeSfmFilename(filename); return g_system->getSavefileManager()->openRawFile(smFilename); } +Common::WriteStream *openSfmFileForWrite(const Common::String &filename) { + Common::String smFilename = makeSfmFilename(filename); + return g_system->getSavefileManager()->openForSaving(smFilename, false); +} + } // End of namespace Wintermute diff --git a/engines/wintermute/base/file/base_savefile_manager_file.h b/engines/wintermute/base/file/base_savefile_manager_file.h index fb9e150503..2b129cf39a 100644 --- a/engines/wintermute/base/file/base_savefile_manager_file.h +++ b/engines/wintermute/base/file/base_savefile_manager_file.h @@ -33,7 +33,9 @@ namespace Wintermute { +Common::SeekableReadStream *openSfmFile(const Common::String &filename); Common::WriteStream *openSfmFileForWrite(const Common::String &filename); +bool sfmFileExists(const Common::String &filename); } // End of namespace Wintermute |