diff options
author | Colin Snover | 2017-06-07 13:07:27 -0500 |
---|---|---|
committer | Colin Snover | 2017-06-09 22:48:14 -0500 |
commit | cf98e16d902bcfb50910fe8e196991e5f2f48e1a (patch) | |
tree | 2b9e09226ed41aed0b052d899e6928cfc4780a53 /engines | |
parent | a2ead7c4a423fed5c53a785356b99ecd26d80732 (diff) | |
download | scummvm-rg350-cf98e16d902bcfb50910fe8e196991e5f2f48e1a.tar.gz scummvm-rg350-cf98e16d902bcfb50910fe8e196991e5f2f48e1a.tar.bz2 scummvm-rg350-cf98e16d902bcfb50910fe8e196991e5f2f48e1a.zip |
SCI: Add serialization for ResourceId
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/savegame.cpp | 6 | ||||
-rw-r--r-- | engines/sci/resource.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index de891b559e..bfd49578a0 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -71,6 +71,12 @@ void syncWithSerializer(Common::Serializer &s, Common::Serializable &obj) { obj.saveLoadWithSerializer(s); } +void syncWithSerializer(Common::Serializer &s, ResourceId &obj) { + s.syncAsByte(obj._type); + s.syncAsUint16LE(obj._number); + s.syncAsUint32LE(obj._tuple); +} + void syncWithSerializer(Common::Serializer &s, reg_t &obj) { // Segment and offset are accessed directly here s.syncAsUint16LE(obj._segment); diff --git a/engines/sci/resource.h b/engines/sci/resource.h index 3239a16081..878e2acd8b 100644 --- a/engines/sci/resource.h +++ b/engines/sci/resource.h @@ -164,6 +164,8 @@ class ResourceId { return string; } + friend void syncWithSerializer(Common::Serializer &s, ResourceId &obj); + public: ResourceId() : _type(kResourceTypeInvalid), _number(0), _tuple(0) { } |