aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise
diff options
context:
space:
mode:
authorMax Horn2009-03-24 11:30:37 +0000
committerMax Horn2009-03-24 11:30:37 +0000
commit48d73ff6bf7f3c25ba9060f7d1717cbf044ff53f (patch)
treec88e09830d7d6414496bf5da7d3fa4a31cfa6628 /engines/cruise
parentc1ff3aec3e8e5ca9606c9b43d720dc564ad5815d (diff)
downloadscummvm-rg350-48d73ff6bf7f3c25ba9060f7d1717cbf044ff53f.tar.gz
scummvm-rg350-48d73ff6bf7f3c25ba9060f7d1717cbf044ff53f.tar.bz2
scummvm-rg350-48d73ff6bf7f3c25ba9060f7d1717cbf044ff53f.zip
CRUISE: Fixed bug when loading backgroundIncrustStruct::saveWidth (don't divide by 2, rather *multiply* by 2); also some cleanup
svn-id: r39657
Diffstat (limited to 'engines/cruise')
-rw-r--r--engines/cruise/saveload.cpp42
1 files changed, 12 insertions, 30 deletions
diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp
index d66441948f..2cee1fc11d 100644
--- a/engines/cruise/saveload.cpp
+++ b/engines/cruise/saveload.cpp
@@ -74,16 +74,7 @@ static void syncBasicInfo(Common::Serializer &s) {
s.syncAsSint16LE(narratorIdx);
s.syncAsSint16LE(aniX);
s.syncAsSint16LE(aniY);
-
- if (s.isSaving()) {
- uint16 v = animationStart ? 1 : 0;
- s.syncAsUint16LE(v);
- } else {
- uint16 v;
- s.syncAsUint16LE(v);
- animationStart = v != 0;
- }
-
+ s.syncAsUint16LE(animationStart);
s.syncAsSint16LE(masterScreen);
s.syncAsSint16LE(switchPal);
s.syncAsSint16LE(scroll);
@@ -134,6 +125,7 @@ static void syncSoundList(Common::Serializer &s) {
static void syncFilesDatabase(Common::Serializer &s) {
uint8 dummyVal = 0;
+ uint32 tmp;
for (int i = 0; i < NUM_FILE_ENTRIES; i++) {
dataFileEntry &fe = filesDatabase[i];
@@ -144,13 +136,10 @@ static void syncFilesDatabase(Common::Serializer &s) {
s.syncAsUint16LE(fe.height);
// TODO: Have a look at the saving/loading of this pointer
+ tmp = (fe.subData.ptr) ? 1 : 0;
+ s.syncAsUint32LE(tmp);
if (s.isLoading()) {
- uint32 v;
- s.syncAsUint32LE(v);
- fe.subData.ptr = (uint8 *)v;
- } else {
- uint32 v = (fe.subData.ptr) ? 1 : 0;
- s.syncAsUint32LE(v);
+ fe.subData.ptr = (uint8 *)tmp;
}
s.syncAsSint16LE(fe.subData.index);
@@ -160,13 +149,10 @@ static void syncFilesDatabase(Common::Serializer &s) {
s.syncAsSint16LE(fe.subData.transparency);
// TODO: Have a look at the saving/loading of this pointer
+ tmp = (fe.subData.ptrMask) ? 1 : 0;
+ s.syncAsUint32LE(tmp);
if (s.isLoading()) {
- uint32 v;
- s.syncAsUint32LE(v);
- fe.subData.ptrMask = (uint8 *)v;
- } else {
- uint32 v = (fe.subData.ptrMask) ? 1 : 0;
- s.syncAsUint32LE(v);
+ fe.subData.ptrMask = (uint8 *)tmp;
}
s.syncAsUint16LE(fe.subData.resourceType);
@@ -428,14 +414,10 @@ static void syncIncrust(Common::Serializer &s) {
s.syncAsSint16LE(t->scriptOverlayIdx);
s.syncAsUint32LE(dummyLong);
- if (s.isSaving()) {
- int v = t->saveWidth / 2;
- s.syncAsSint16LE(v);
- } else {
- int v;
- s.syncAsSint16LE(v);
- t->saveWidth = v / 2;
- }
+ int tmp = t->saveWidth / 2;
+ s.syncAsSint16LE(tmp);
+ t->saveWidth = tmp * 2;
+
s.syncAsSint16LE(t->saveHeight);
s.syncAsSint16LE(t->saveSize);
s.syncAsSint16LE(t->savedX);