diff options
Diffstat (limited to 'engines/sci/engine/object.cpp')
-rw-r--r-- | engines/sci/engine/object.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/engines/sci/engine/object.cpp b/engines/sci/engine/object.cpp index de028392ea..b28026b71f 100644 --- a/engines/sci/engine/object.cpp +++ b/engines/sci/engine/object.cpp @@ -44,15 +44,15 @@ static bool relocateBlock(Common::Array<reg_t> &block, int block_location, Segme error("Attempt to relocate odd variable #%d.5e (relative to %04x)\n", idx, block_location); return false; } - block[idx].segment = segment; // Perform relocation + block[idx].setSegment(segment); // Perform relocation if (getSciVersion() >= SCI_VERSION_1_1 && getSciVersion() <= SCI_VERSION_2_1) - block[idx].offset += scriptSize; + block[idx].incOffset(scriptSize); return true; } void Object::init(byte *buf, reg_t obj_pos, bool initVariables) { - byte *data = buf + obj_pos.offset; + byte *data = buf + obj_pos.getOffset(); _baseObj = data; _pos = obj_pos; @@ -109,7 +109,7 @@ int Object::locateVarSelector(SegManager *segMan, Selector slc) const { } bool Object::relocateSci0Sci21(SegmentId segment, int location, size_t scriptSize) { - return relocateBlock(_variables, getPos().offset, segment, location, scriptSize); + return relocateBlock(_variables, getPos().getOffset(), segment, location, scriptSize); } bool Object::relocateSci3(SegmentId segment, uint32 location, int offset, size_t scriptSize) { @@ -117,8 +117,8 @@ bool Object::relocateSci3(SegmentId segment, uint32 location, int offset, size_t for (uint i = 0; i < _variables.size(); ++i) { if (location == _propertyOffsetsSci3[i]) { - _variables[i].segment = segment; - _variables[i].offset += offset; + _variables[i].setSegment(segment); + _variables[i].incOffset(offset); return true; } } @@ -148,21 +148,21 @@ int Object::propertyOffsetToId(SegManager *segMan, int propertyOffset) const { } void Object::initSpecies(SegManager *segMan, reg_t addr) { - uint16 speciesOffset = getSpeciesSelector().offset; + uint16 speciesOffset = getSpeciesSelector().getOffset(); if (speciesOffset == 0xffff) // -1 setSpeciesSelector(NULL_REG); // no species else - setSpeciesSelector(segMan->getClassAddress(speciesOffset, SCRIPT_GET_LOCK, addr.segment)); + setSpeciesSelector(segMan->getClassAddress(speciesOffset, SCRIPT_GET_LOCK, addr.getSegment())); } void Object::initSuperClass(SegManager *segMan, reg_t addr) { - uint16 superClassOffset = getSuperClassSelector().offset; + uint16 superClassOffset = getSuperClassSelector().getOffset(); if (superClassOffset == 0xffff) // -1 setSuperClassSelector(NULL_REG); // no superclass else - setSuperClassSelector(segMan->getClassAddress(superClassOffset, SCRIPT_GET_LOCK, addr.segment)); + setSuperClassSelector(segMan->getClassAddress(superClassOffset, SCRIPT_GET_LOCK, addr.getSegment())); } bool Object::initBaseObject(SegManager *segMan, reg_t addr, bool doInitSuperClass) { @@ -187,7 +187,7 @@ bool Object::initBaseObject(SegManager *segMan, reg_t addr, bool doInitSuperClas // The effect is that a number of its method selectors may be // treated as variable selectors, causing unpredictable effects. - int objScript = segMan->getScript(_pos.segment)->getScriptNumber(); + int objScript = segMan->getScript(_pos.getSegment())->getScriptNumber(); // We have to do a little bit of work to get the name of the object // before any relocations are done. @@ -196,7 +196,7 @@ bool Object::initBaseObject(SegManager *segMan, reg_t addr, bool doInitSuperClas if (nameReg.isNull()) { name = "<no name>"; } else { - nameReg.segment = _pos.segment; + nameReg.setSegment(_pos.getSegment()); name = segMan->derefString(nameReg); if (!name) name = "<invalid name>"; |