aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/dc
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/dc')
-rw-r--r--backends/platform/dc/dc-fs.cpp1
-rw-r--r--backends/platform/dc/vmsave.cpp23
2 files changed, 19 insertions, 5 deletions
diff --git a/backends/platform/dc/dc-fs.cpp b/backends/platform/dc/dc-fs.cpp
index 77fe4143dd..4bd7e5a777 100644
--- a/backends/platform/dc/dc-fs.cpp
+++ b/backends/platform/dc/dc-fs.cpp
@@ -57,6 +57,7 @@ public:
virtual Common::SeekableReadStream *createReadStream();
virtual Common::WriteStream *createWriteStream() { return 0; }
+ virtual bool create(bool isDirectory) { return false; }
static AbstractFSNode *makeFileNodePath(const Common::String &path);
};
diff --git a/backends/platform/dc/vmsave.cpp b/backends/platform/dc/vmsave.cpp
index d896ba1299..5e8f50ca89 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();