aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/engine/object.cpp')
-rw-r--r--engines/sci/engine/object.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/engines/sci/engine/object.cpp b/engines/sci/engine/object.cpp
index 78e216cdb5..de028392ea 100644
--- a/engines/sci/engine/object.cpp
+++ b/engines/sci/engine/object.cpp
@@ -112,7 +112,7 @@ bool Object::relocateSci0Sci21(SegmentId segment, int location, size_t scriptSiz
return relocateBlock(_variables, getPos().offset, segment, location, scriptSize);
}
-bool Object::relocateSci3(SegmentId segment, int location, int offset, size_t scriptSize) {
+bool Object::relocateSci3(SegmentId segment, uint32 location, int offset, size_t scriptSize) {
assert(_propertyOffsetsSci3);
for (uint i = 0; i < _variables.size(); ++i) {
@@ -153,7 +153,7 @@ void Object::initSpecies(SegManager *segMan, reg_t addr) {
if (speciesOffset == 0xffff) // -1
setSpeciesSelector(NULL_REG); // no species
else
- setSpeciesSelector(segMan->getClassAddress(speciesOffset, SCRIPT_GET_LOCK, addr));
+ setSpeciesSelector(segMan->getClassAddress(speciesOffset, SCRIPT_GET_LOCK, addr.segment));
}
void Object::initSuperClass(SegManager *segMan, reg_t addr) {
@@ -162,7 +162,7 @@ void Object::initSuperClass(SegManager *segMan, reg_t addr) {
if (superClassOffset == 0xffff) // -1
setSuperClassSelector(NULL_REG); // no superclass
else
- setSuperClassSelector(segMan->getClassAddress(superClassOffset, SCRIPT_GET_LOCK, addr));
+ setSuperClassSelector(segMan->getClassAddress(superClassOffset, SCRIPT_GET_LOCK, addr.segment));
}
bool Object::initBaseObject(SegManager *segMan, reg_t addr, bool doInitSuperClass) {
@@ -286,7 +286,7 @@ void Object::initSelectorsSci3(const byte *buf) {
_variables.resize(properties);
uint16 *propertyIds = (uint16 *)malloc(sizeof(uint16) * properties);
// uint16 *methodOffsets = (uint16 *)malloc(sizeof(uint16) * 2 * methods);
- uint16 *propertyOffsets = (uint16 *)malloc(sizeof(uint16) * properties);
+ uint32 *propertyOffsets = (uint32 *)malloc(sizeof(uint32) * properties);
int propertyCounter = 0;
int methodCounter = 0;
@@ -314,7 +314,8 @@ void Object::initSelectorsSci3(const byte *buf) {
WRITE_SCI11ENDIAN_UINT16(&propertyIds[propertyCounter],
groupBaseId + bit);
_variables[propertyCounter] = make_reg(0, value);
- propertyOffsets[propertyCounter] = (seeker + bit * 2) - buf;
+ uint32 propertyOffset = (seeker + bit * 2) - buf;
+ propertyOffsets[propertyCounter] = propertyOffset;
++propertyCounter;
} else if (value != 0xffff) { // Method
_baseMethod.push_back(groupBaseId + bit);