diff options
author | Max Horn | 2002-07-02 20:57:27 +0000 |
---|---|---|
committer | Max Horn | 2002-07-02 20:57:27 +0000 |
commit | b827dadf6e8217dbd2baad7bd21e7f8c32db818d (patch) | |
tree | e1d17a3acdd1b445a9f45ca486fc3f062d474a08 /saveload.cpp | |
parent | 910afa35664840f57ad29dc655377ee25a0239d1 (diff) | |
download | scummvm-rg350-b827dadf6e8217dbd2baad7bd21e7f8c32db818d.tar.gz scummvm-rg350-b827dadf6e8217dbd2baad7bd21e7f8c32db818d.tar.bz2 scummvm-rg350-b827dadf6e8217dbd2baad7bd21e7f8c32db818d.zip |
added saveload.h; moved some stuff out of scumm.h into saveload.h/.cpp (no need why other code has to see this)
svn-id: r4450
Diffstat (limited to 'saveload.cpp')
-rw-r--r-- | saveload.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/saveload.cpp b/saveload.cpp index 269e63312f..d8029d2259 100644 --- a/saveload.cpp +++ b/saveload.cpp @@ -26,6 +26,7 @@ #include "sound/imuse.h" #include "actor.h" #include "config-file.h" +#include "saveload.h" struct SaveGameHeader { uint32 type; @@ -34,6 +35,46 @@ struct SaveGameHeader { char name[32]; }; +struct SaveLoadEntry { + uint32 offs; + uint8 type; + uint8 size; +}; + +typedef int SerializerSaveReference(void *me, byte type, void *ref); +typedef void *SerializerLoadReference(void *me, byte type, int ref); + +struct Serializer { + SerializerStream _saveLoadStream; + + union { + SerializerSaveReference *_save_ref; + SerializerLoadReference *_load_ref; + void *_saveload_ref; + }; + void *_ref_me; + + bool _saveOrLoad; + + void saveLoadBytes(void *b, int len); + void saveLoadArrayOf(void *b, int len, int datasize, byte filetype); + void saveLoadEntries(void *d, const SaveLoadEntry *sle); + void saveLoadArrayOf(void *b, int num, int datasize, const SaveLoadEntry *sle); + + void saveUint32(uint32 d); + void saveWord(uint16 d); + void saveByte(byte b); + + byte loadByte(); + uint16 loadWord(); + uint32 loadUint32(); + + bool isSaving() { return _saveOrLoad; } + + bool checkEOFLoadStream(); + +}; + // Support for "old" savegames (made with 2501 CVS build) // Can be useful for other ports too :) |