[Scummvm-git-logs] scummvm master -> a6bcd207fcaaba50a1e76200b33cf9608756cc33

Tkachov Tkachov at users.noreply.github.com
Wed Aug 31 08:41:59 CEST 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a6bcd207fc DC: Fix VMSaveManager


Commit: a6bcd207fcaaba50a1e76200b33cf9608756cc33
    https://github.com/scummvm/scummvm/commit/a6bcd207fcaaba50a1e76200b33cf9608756cc33
Author: Alexander Tkachev (alexander at tkachov.ru)
Date: 2016-08-31T13:39:09+06:00

Commit Message:
DC: Fix VMSaveManager

* updateSavefilesList() stub;
* openRawFile();
* Common::OutSaveFile in openForSaving();
* OutVMSave derived from WriteStream.

Changed paths:
    backends/platform/dc/vmsave.cpp



diff --git a/backends/platform/dc/vmsave.cpp b/backends/platform/dc/vmsave.cpp
index d896ba1..5e8f50c 100644
--- a/backends/platform/dc/vmsave.cpp
+++ b/backends/platform/dc/vmsave.cpp
@@ -266,7 +266,7 @@ public:
   { return ::readSaveGame(buffer, _size, filename); }
 };
 
-class OutVMSave : public Common::OutSaveFile {
+class OutVMSave : public Common::WriteStream {
 private:
   char *buffer;
   int _pos, size, committed;
@@ -293,11 +293,24 @@ public:
 
 class VMSaveManager : public Common::SaveFileManager {
 public:
+	virtual void updateSavefilesList(Common::StringArray &lockedFiles) {
+		// TODO: implement this (locks files, preventing them from being listed, saved or loaded)
+	}
 
-  virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true) {
-	OutVMSave *s = new OutVMSave(filename.c_str());
-	return compress ? Common::wrapCompressedWriteStream(s) : s;
-  }
+	virtual Common::InSaveFile *openRawFile(const Common::String &filename) {
+		InVMSave *s = new InVMSave();
+		if (s->readSaveGame(filename.c_str())) {
+			return s;
+		} else {
+			delete s;
+			return NULL;
+		}
+	}
+
+	virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true) {
+		OutVMSave *s = new OutVMSave(filename.c_str());
+		return new Common::OutSaveFile(compress ? Common::wrapCompressedWriteStream(s) : s);
+	}
 
   virtual Common::InSaveFile *openForLoading(const Common::String &filename) {
 	InVMSave *s = new InVMSave();





More information about the Scummvm-git-logs mailing list