aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorFilippos Karapetis2009-08-26 09:36:54 +0000
committerFilippos Karapetis2009-08-26 09:36:54 +0000
commit6e469002dd465fbf3d1fbccc0a186189b918df59 (patch)
tree1815a4e9802a20eb4e824c7ace7ce54a4c189003 /engines/sci/engine
parent6a50e6dc7fc139285118a1daec6b6a5904efb74b (diff)
downloadscummvm-rg350-6e469002dd465fbf3d1fbccc0a186189b918df59.tar.gz
scummvm-rg350-6e469002dd465fbf3d1fbccc0a186189b918df59.tar.bz2
scummvm-rg350-6e469002dd465fbf3d1fbccc0a186189b918df59.zip
Formatting
svn-id: r43754
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/vm.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index f1b6889096..f05a290d94 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -1624,7 +1624,8 @@ int script_instantiate_sci0(ResourceManager *resourceManager, SegManager *segMan
reg_t addr;
reg.offset += objlength; // Step over the last checked object
objtype = scr->getHeap(reg.offset);
- if (!objtype) break;
+ if (!objtype)
+ break;
objlength = scr->getHeap(reg.offset + 2);
@@ -1670,6 +1671,7 @@ int script_instantiate_sci0(ResourceManager *resourceManager, SegManager *segMan
break;
}
} while (objtype != 0);
+
// And now a second pass to adjust objects and class pointers, and the general pointers
objlength = 0;
@@ -1679,7 +1681,9 @@ int script_instantiate_sci0(ResourceManager *resourceManager, SegManager *segMan
reg_t addr;
reg.offset += objlength; // Step over the last checked object
objtype = scr->getHeap(reg.offset);
- if (!objtype) break;
+ if (!objtype)
+ break;
+
objlength = scr->getHeap(reg.offset + 2);
reg.offset += 4; // Step over header
@@ -1715,7 +1719,7 @@ int script_instantiate_sci0(ResourceManager *resourceManager, SegManager *segMan
reg.offset -= 4; // Step back on header
- } while ((objtype != 0) && (((unsigned)reg.offset) < script->size - 2));
+ } while (objtype != 0 && reg.offset < script->size - 2);
if (relocation >= 0)
segManager->scriptRelocate(make_reg(reg.segment, relocation));