diff options
author | Paul Gilbert | 2012-10-24 22:49:32 +1100 |
---|---|---|
committer | Paul Gilbert | 2012-10-24 22:49:32 +1100 |
commit | 38b5cf1efe0ab75c7100714fb886a704a4661fda (patch) | |
tree | a35af9dab0bacca80859f8510d3c57b2d1bc9582 /engines/hopkins/files.cpp | |
parent | 9827c4023c252272afb8497dd1b16c897fef4e0c (diff) | |
download | scummvm-rg350-38b5cf1efe0ab75c7100714fb886a704a4661fda.tar.gz scummvm-rg350-38b5cf1efe0ab75c7100714fb886a704a4661fda.tar.bz2 scummvm-rg350-38b5cf1efe0ab75c7100714fb886a704a4661fda.zip |
HOPKINS: Created new SaveFileManager class to handle save file related code
Diffstat (limited to 'engines/hopkins/files.cpp')
-rw-r--r-- | engines/hopkins/files.cpp | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/engines/hopkins/files.cpp b/engines/hopkins/files.cpp index 151a9a84f8..79b672ca33 100644 --- a/engines/hopkins/files.cpp +++ b/engines/hopkins/files.cpp @@ -38,32 +38,6 @@ void FileManager::setParent(HopkinsEngine *vm) { _vm = vm; } -void FileManager::initSaves() { - Common::String dataFilename = "HISCORE.DAT"; - byte data[100]; - Common::fill(&data[0], &data[100], 0); - - SAUVE_FICHIER(dataFilename, data, 100); -} - -// Save File -bool FileManager::SAUVE_FICHIER(const Common::String &file, const void *buf, size_t n) { - return bsave(file, buf, n); -} - -bool FileManager::bsave(const Common::String &file, const void *buf, size_t n) { - Common::OutSaveFile *f = g_system->getSavefileManager()->openForSaving(file); - - if (f) { - size_t bytesWritten = f->write(buf, n); - f->finalize(); - delete f; - - return bytesWritten == n; - } else - return false; -} - // Load INI File void FileManager::Chage_Inifile(Common::StringMap &iniParams) { // TODO: Review whether we can do something cleaner with ScummVM initialisation than @@ -342,6 +316,7 @@ uint32 FileManager::FLONG(const Common::String &filename) { // Build Linux Common::String FileManager::CONSTRUIT_LINUX(const Common::String &file) { + _vm->_globals.NFICHIER = file; return file; } |