diff options
author | Einar Johan Trøan Sømåen | 2012-06-16 02:14:35 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-06-16 04:26:56 +0200 |
commit | 3d4495d1ceb7e4e6fbb4dafa2df388804f2bf783 (patch) | |
tree | b0c2fcf11f07d5377392d6b118a157168c8baa21 /engines/wintermute/Base/BFileManager.cpp | |
parent | b8a7266c4ea5a49cff7576fb21c13d1cf40b9e1e (diff) | |
download | scummvm-rg350-3d4495d1ceb7e4e6fbb4dafa2df388804f2bf783.tar.gz scummvm-rg350-3d4495d1ceb7e4e6fbb4dafa2df388804f2bf783.tar.bz2 scummvm-rg350-3d4495d1ceb7e4e6fbb4dafa2df388804f2bf783.zip |
WINTERMUTE: A first attempt at getting savegames to work.
Diffstat (limited to 'engines/wintermute/Base/BFileManager.cpp')
-rw-r--r-- | engines/wintermute/Base/BFileManager.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/engines/wintermute/Base/BFileManager.cpp b/engines/wintermute/Base/BFileManager.cpp index 1848595c19..990375ef73 100644 --- a/engines/wintermute/Base/BFileManager.cpp +++ b/engines/wintermute/Base/BFileManager.cpp @@ -43,6 +43,7 @@ #include "engines/wintermute/dcpackage.h"
#include "engines/wintermute/utils/utils.h"
#include "engines/wintermute/PlatformSDL.h"
+#include "engines/wintermute/wintermute.h"
#include "common/str.h"
#include "common/textconsole.h"
#include "common/util.h"
@@ -50,6 +51,7 @@ #include "common/system.h"
#include "common/fs.h"
#include "common/file.h"
+#include "common/savefile.h"
namespace WinterMute {
@@ -156,11 +158,23 @@ byte *CBFileManager::ReadWholeFile(const Common::String &Filename, uint32 *Size, return buffer;
}
+Common::SeekableReadStream *CBFileManager::loadSaveGame(const Common::String &filename) {
+ Common::SaveFileManager *saveMan = g_wintermute->getSaveFileMan();
+ Common::InSaveFile *file = saveMan->openForLoading(filename);
+ return file;
+}
//////////////////////////////////////////////////////////////////////////
HRESULT CBFileManager::SaveFile(const Common::String &Filename, byte *Buffer, uint32 BufferSize, bool Compressed, byte *PrefixBuffer, uint32 PrefixSize) {
// TODO
warning("Implement SaveFile");
+
+ Common::SaveFileManager *saveMan = g_wintermute->getSaveFileMan();
+ Common::OutSaveFile *file = saveMan->openForSaving(Filename);
+ file->write(PrefixBuffer, PrefixSize);
+ file->write(Buffer, BufferSize);
+ file->finalize();
+ delete file;
#if 0
RestoreCurrentDir();
|