DC: Fix VMSaveManager
* updateSavefilesList() stub; * openRawFile(); * Common::OutSaveFile in openForSaving(); * OutVMSave derived from WriteStream.
This commit is contained in:
parent
7f913c831d
commit
a6bcd207fc
1 changed files with 18 additions and 5 deletions
|
@ -266,7 +266,7 @@ public:
|
||||||
{ return ::readSaveGame(buffer, _size, filename); }
|
{ return ::readSaveGame(buffer, _size, filename); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class OutVMSave : public Common::OutSaveFile {
|
class OutVMSave : public Common::WriteStream {
|
||||||
private:
|
private:
|
||||||
char *buffer;
|
char *buffer;
|
||||||
int _pos, size, committed;
|
int _pos, size, committed;
|
||||||
|
@ -293,10 +293,23 @@ public:
|
||||||
|
|
||||||
class VMSaveManager : public Common::SaveFileManager {
|
class VMSaveManager : public Common::SaveFileManager {
|
||||||
public:
|
public:
|
||||||
|
virtual void updateSavefilesList(Common::StringArray &lockedFiles) {
|
||||||
|
// TODO: implement this (locks files, preventing them from being listed, saved or loaded)
|
||||||
|
}
|
||||||
|
|
||||||
|
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) {
|
virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true) {
|
||||||
OutVMSave *s = new OutVMSave(filename.c_str());
|
OutVMSave *s = new OutVMSave(filename.c_str());
|
||||||
return compress ? Common::wrapCompressedWriteStream(s) : s;
|
return new Common::OutSaveFile(compress ? Common::wrapCompressedWriteStream(s) : s);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Common::InSaveFile *openForLoading(const Common::String &filename) {
|
virtual Common::InSaveFile *openForLoading(const Common::String &filename) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue