aboutsummaryrefslogtreecommitdiff
path: root/engines/startrek/saveload.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2019-05-27 19:39:29 +0300
committerFilippos Karapetis2019-05-27 19:39:29 +0300
commitdaf2f07e6bf21e20b7f8d809aadbe2928ad16fcc (patch)
treea9cccf752c2ef9977fca747758027365703146df /engines/startrek/saveload.cpp
parent88855082373113a4fad3745006a9efc261051a26 (diff)
downloadscummvm-rg350-daf2f07e6bf21e20b7f8d809aadbe2928ad16fcc.tar.gz
scummvm-rg350-daf2f07e6bf21e20b7f8d809aadbe2928ad16fcc.tar.bz2
scummvm-rg350-daf2f07e6bf21e20b7f8d809aadbe2928ad16fcc.zip
STARTREK: Use Common::String for animation strings
Diffstat (limited to 'engines/startrek/saveload.cpp')
-rw-r--r--engines/startrek/saveload.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/engines/startrek/saveload.cpp b/engines/startrek/saveload.cpp
index 52bb7cbb47..7966537fd5 100644
--- a/engines/startrek/saveload.cpp
+++ b/engines/startrek/saveload.cpp
@@ -237,6 +237,8 @@ bool StarTrekEngine::saveOrLoadGameData(Common::SeekableReadStream *in, Common::
ser.syncAsUint32LE(_roomFrameCounter);
ser.syncAsUint32LE(_frameIndex); // FIXME: redundant
+ byte filler = 0;
+
// Serialize the "actor" class
for (int i = 0; i < NUM_ACTORS; i++) {
Actor *a = &_actorList[i];
@@ -258,7 +260,10 @@ bool StarTrekEngine::saveOrLoadGameData(Common::SeekableReadStream *in, Common::
ser.syncAsUint16LE(a->field62);
ser.syncAsUint16LE(a->triggerActionWhenAnimFinished);
ser.syncAsUint16LE(a->finishedAnimActionParam);
- ser.syncBytes((byte *)a->animationString2, 8);
+ ser.syncString(a->animationString2);
+ filler = 0;
+ for (uint i = 0; i < 8 - a->animationString2.size() - 1; ++i)
+ ser.syncAsByte(filler); // make sure that exactly 8 bytes are synced
ser.syncAsUint16LE(a->field70);
ser.syncAsUint16LE(a->field72);
ser.syncAsUint16LE(a->field74);
@@ -276,7 +281,10 @@ bool StarTrekEngine::saveOrLoadGameData(Common::SeekableReadStream *in, Common::
ser.syncAsByte(a->direction);
ser.syncAsUint16LE(a->field94);
ser.syncAsUint16LE(a->field96);
- ser.syncBytes((byte *)a->animationString, 10);
+ ser.syncString(a->animationString);
+ filler = 0;
+ for (uint i = 0; i < 10 - a->animationString.size() - 1; ++i)
+ ser.syncAsByte(filler); // make sure that exactly 10 bytes are synced
ser.syncAsUint16LE(a->fielda2);
ser.syncAsUint16LE(a->fielda4);
ser.syncAsUint16LE(a->fielda6);