aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/alan3/acode.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2019-07-04 11:40:59 -0700
committerPaul Gilbert2019-07-06 15:27:09 -0700
commit87a86c0fb61add346a368c27407be990c2827c4c (patch)
treee553b87b3f9c2d2ff4350de0f561f3249f5df43d /engines/glk/alan3/acode.cpp
parentc5214f6d349df9bc4ec088bbbca3543e47b22744 (diff)
downloadscummvm-rg350-87a86c0fb61add346a368c27407be990c2827c4c.tar.gz
scummvm-rg350-87a86c0fb61add346a368c27407be990c2827c4c.tar.bz2
scummvm-rg350-87a86c0fb61add346a368c27407be990c2827c4c.zip
GLK: ALAN3: Merge saving & loading code, loading fixes
Diffstat (limited to 'engines/glk/alan3/acode.cpp')
-rw-r--r--engines/glk/alan3/acode.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/engines/glk/alan3/acode.cpp b/engines/glk/alan3/acode.cpp
index 3dbfaa5cc0..4d41e0fc43 100644
--- a/engines/glk/alan3/acode.cpp
+++ b/engines/glk/alan3/acode.cpp
@@ -26,9 +26,20 @@ namespace Glk {
namespace Alan3 {
void AttributeEntry::synchronize(Common::Serializer &s) {
- s.syncAsSint32LE(code);
- s.syncAsSint32LE(value);
- s.syncAsSint32LE(id);
+ // We have to do some annoying temporary copy of the fields to get around gcc
+ // errors about getting references to fields of packed structures
+ Aint c = code;
+ Aptr v = value;
+ Aaddr i = id;
+ s.syncAsSint32LE(c);
+ s.syncAsSint32LE(v);
+ s.syncAsSint32LE(i);
+
+ if (s.isLoading()) {
+ code = c;
+ value = v;
+ id = i;
+ }
}
} // End of namespace Alan3