aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress/game/savegame.h
diff options
context:
space:
mode:
authorLittleboy2012-07-30 16:44:32 -0400
committerLittleboy2012-07-30 18:36:26 -0400
commit4728505db288b8aa55453ada19fadde76d61ddb8 (patch)
treea8a5767dc15d961231213bace6011ab300aef909 /engines/lastexpress/game/savegame.h
parent5df2bd896247a59d6166c5f69b93355b66b5f920 (diff)
downloadscummvm-rg350-4728505db288b8aa55453ada19fadde76d61ddb8.tar.gz
scummvm-rg350-4728505db288b8aa55453ada19fadde76d61ddb8.tar.bz2
scummvm-rg350-4728505db288b8aa55453ada19fadde76d61ddb8.zip
LASTEXPRESS: Switch savegame reading to use new read method
- Disable savegame compression
Diffstat (limited to 'engines/lastexpress/game/savegame.h')
-rw-r--r--engines/lastexpress/game/savegame.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/engines/lastexpress/game/savegame.h b/engines/lastexpress/game/savegame.h
index a04c700fb6..dc16a16728 100644
--- a/engines/lastexpress/game/savegame.h
+++ b/engines/lastexpress/game/savegame.h
@@ -91,6 +91,7 @@ class LastExpressEngine;
class SavegameStream : public Common::MemoryWriteStreamDynamic, public Common::SeekableReadStream {
public:
SavegameStream() : MemoryWriteStreamDynamic(DisposeAfterUse::YES), _eos(false) {
+ _enableCompression = false;
_bufferOffset = -1;
_valueCount = 0;
_previousValue = 0;
@@ -106,15 +107,20 @@ public:
bool seek(int32 offset, int whence = SEEK_SET) { return MemoryWriteStreamDynamic::seek(offset, whence); }
bool eos() const { return _eos; }
uint32 read(void *dataPtr, uint32 dataSize);
+ uint32 write(const void *dataPtr, uint32 dataSize);
+ void process();
+
+private:
// Compressed data
- uint32 writeValue(const void *dataPtr, uint32 dataSize);
- uint32 readValue(void *dataPtr, uint32 dataSize);
+ uint32 writeCompressed(const void *dataPtr, uint32 dataSize);
+ uint32 readCompressed(void *dataPtr, uint32 dataSize);
private:
bool _eos;
// Compression handling
+ bool _enableCompression;
int _bufferOffset;
int _valueCount;
byte _previousValue;
@@ -284,8 +290,8 @@ private:
void writeEntry(SavegameType type, EntityIndex entity, uint32 val);
void readEntry(SavegameType *type, EntityIndex *entity, uint32 *val, bool keepIndex);
- uint32 writeValue(const char *name, Common::Functor1<Common::Serializer &, void> *function, uint size);
- uint32 readValue(const char *name, Common::Functor1<Common::Serializer &, void> *function, uint size);
+ uint32 writeValue(Common::Serializer &ser, const char *name, Common::Functor1<Common::Serializer &, void> *function, uint size);
+ uint32 readValue(Common::Serializer &ser, const char *name, Common::Functor1<Common::Serializer &, void> *function, uint size = 0);
SavegameEntryHeader *getEntry(uint32 index);