[Scummvm-git-logs] scummvm master -> 9d6ae2a33ff842e1089eabea5ec271f45916e51b

Tkachov Tkachov at users.noreply.github.com
Wed Aug 31 07:36:46 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:
9d6ae2a33f DS, N64: Fix SaveFileManagers


Commit: 9d6ae2a33ff842e1089eabea5ec271f45916e51b
    https://github.com/scummvm/scummvm/commit/9d6ae2a33ff842e1089eabea5ec271f45916e51b
Author: Alexander Tkachev (alexander at tkachov.ru)
Date: 2016-08-31T12:33:57+06:00

Commit Message:
DS, N64: Fix SaveFileManagers

Added updateSavefilesList() and openRawFile() stubs. It should build
fine now, I guess.

Changed paths:
    backends/platform/ds/arm9/source/gbampsave.cpp
    backends/platform/ds/arm9/source/gbampsave.h
    backends/platform/n64/framfs_save_manager.h
    backends/platform/n64/pakfs_save_manager.h



diff --git a/backends/platform/ds/arm9/source/gbampsave.cpp b/backends/platform/ds/arm9/source/gbampsave.cpp
index 236ec55..3b4fb45 100644
--- a/backends/platform/ds/arm9/source/gbampsave.cpp
+++ b/backends/platform/ds/arm9/source/gbampsave.cpp
@@ -45,6 +45,17 @@ static Common::String getSavePath() {
 // GBAMP Save File Manager
 //////////////////////////
 
+void GBAMPSaveFileManager::updateSavefilesList(Common::StringArray &lockedFiles) {
+	// TODO: implement this
+	// in this method manager should remember lockedFiles
+	// these files must not be opened for loading or saving, or listed by listSavefiles()
+}
+
+Common::InSaveFile *GBAMPSaveFileManager::openRawFile(const Common::String &filename) {
+	// TODO: make sure it returns raw file, not uncompressed save contents
+	return openForLoading(filename);
+}
+
 Common::OutSaveFile *GBAMPSaveFileManager::openForSaving(const Common::String &filename, bool compress) {
 	Common::String fileSpec = getSavePath();
 	if (fileSpec.lastChar() != '/')
diff --git a/backends/platform/ds/arm9/source/gbampsave.h b/backends/platform/ds/arm9/source/gbampsave.h
index d86db2e..d30e3ab 100644
--- a/backends/platform/ds/arm9/source/gbampsave.h
+++ b/backends/platform/ds/arm9/source/gbampsave.h
@@ -27,6 +27,9 @@
 
 class GBAMPSaveFileManager : public Common::SaveFileManager {
 public:
+	virtual void updateSavefilesList(Common::StringArray &lockedFiles);
+	virtual Common::InSaveFile *openRawFile(const Common::String &filename);
+	
 	virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true);
 	virtual Common::InSaveFile *openForLoading(const Common::String &filename);
 
diff --git a/backends/platform/n64/framfs_save_manager.h b/backends/platform/n64/framfs_save_manager.h
index f240428..4696794 100644
--- a/backends/platform/n64/framfs_save_manager.h
+++ b/backends/platform/n64/framfs_save_manager.h
@@ -102,6 +102,21 @@ public:
 
 class FRAMSaveManager : public Common::SaveFileManager {
 public:
+	virtual void updateSavefilesList(Common::StringArray &lockedFiles) {
+		// this method is used to lock saves while cloud syncing
+		// as there is no network on N64, this method wouldn't be used
+		// thus it's not implemtented
+	}
+
+	virtual Common::InSaveFile *openRawFile(const Common::String &filename) {
+		InFRAMSave *s = new InFRAMSave();
+		if (s->readSaveGame(filename.c_str())) {
+			return s;
+		} else {
+			delete s;
+			return 0;
+		}
+	}
 
 	virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true) {
 		OutFRAMSave *s = new OutFRAMSave(filename.c_str());
diff --git a/backends/platform/n64/pakfs_save_manager.h b/backends/platform/n64/pakfs_save_manager.h
index 16b6330..f69d910 100644
--- a/backends/platform/n64/pakfs_save_manager.h
+++ b/backends/platform/n64/pakfs_save_manager.h
@@ -104,6 +104,21 @@ public:
 
 class PAKSaveManager : public Common::SaveFileManager {
 public:
+	virtual void updateSavefilesList(Common::StringArray &lockedFiles) {
+		// this method is used to lock saves while cloud syncing
+		// as there is no network on N64, this method wouldn't be used
+		// thus it's not implemtented
+	}
+
+	virtual Common::InSaveFile *openRawFile(const Common::String &filename) {
+		InPAKSave *s = new InPAKSave();
+		if (s->readSaveGame(filename.c_str())) {
+			return s;
+		} else {
+			delete s;
+			return NULL;
+		}
+	}
 
 	virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true) {
 		OutPAKSave *s = new OutPAKSave(filename.c_str());





More information about the Scummvm-git-logs mailing list