diff options
author | Filippos Karapetis | 2010-06-03 10:16:21 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-06-03 10:16:21 +0000 |
commit | 86b452d36cb781c24e1b167dd6cef768b7c6286b (patch) | |
tree | 97a66ac538ca14982f082d4ca93c5c90c98f4a6c /engines/sci/engine/segment.cpp | |
parent | 86dcc28342021933f04ff3542932fc8823ff2360 (diff) | |
download | scummvm-rg350-86b452d36cb781c24e1b167dd6cef768b7c6286b.tar.gz scummvm-rg350-86b452d36cb781c24e1b167dd6cef768b7c6286b.tar.bz2 scummvm-rg350-86b452d36cb781c24e1b167dd6cef768b7c6286b.zip |
Moved several object-related defines inside vm.h into segment.h, where the Object class resides. Also, removed several unused defines
svn-id: r49406
Diffstat (limited to 'engines/sci/engine/segment.cpp')
-rw-r--r-- | engines/sci/engine/segment.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp index 988ee67741..0e0a759d4b 100644 --- a/engines/sci/engine/segment.cpp +++ b/engines/sci/engine/segment.cpp @@ -240,7 +240,7 @@ Object *Script::scriptObjInit(reg_t obj_pos, bool fullObjectInit) { obj = allocateObject(obj_pos.offset); - VERIFY(obj_pos.offset + SCRIPT_FUNCTAREAPTR_OFFSET < (int)_bufSize, "Function area pointer stored beyond end of script\n"); + VERIFY(obj_pos.offset + kOffsetFunctionArea < (int)_bufSize, "Function area pointer stored beyond end of script\n"); obj->init(_buf, obj_pos, fullObjectInit); @@ -693,9 +693,9 @@ void Object::init(byte *buf, reg_t obj_pos, bool initVariables) { _pos = obj_pos; if (getSciVersion() < SCI_VERSION_1_1) { - _variables.resize(READ_LE_UINT16(data + SCRIPT_SELECTORCTR_OFFSET)); + _variables.resize(READ_LE_UINT16(data + kOffsetSelectorCounter)); _baseVars = (const uint16 *)(_baseObj + _variables.size() * 2); - _baseMethod = (const uint16 *)(data + READ_LE_UINT16(data + SCRIPT_FUNCTAREAPTR_OFFSET)); + _baseMethod = (const uint16 *)(data + READ_LE_UINT16(data + kOffsetFunctionArea)); _methodCount = READ_LE_UINT16(_baseMethod - 1); } else { _variables.resize(READ_SCI11ENDIAN_UINT16(data + 2)); @@ -720,7 +720,7 @@ int Object::locateVarSelector(SegManager *segMan, Selector slc) const { if (getSciVersion() < SCI_VERSION_1_1) { varnum = getVarCount(); - int selector_name_offset = varnum * 2 + SCRIPT_SELECTOR_OFFSET; + int selector_name_offset = varnum * 2 + kOffsetSelectorSegment; buf = _baseObj + selector_name_offset; } else { const Object *obj = getClass(segMan); @@ -749,11 +749,11 @@ int Object::propertyOffsetToId(SegManager *segMan, int propertyOffset) const { } if (getSciVersion() < SCI_VERSION_1_1) { - const byte *selectoroffset = ((const byte *)(_baseObj)) + SCRIPT_SELECTOR_OFFSET + selectors * 2; + const byte *selectoroffset = ((const byte *)(_baseObj)) + kOffsetSelectorSegment + selectors * 2; return READ_SCI11ENDIAN_UINT16(selectoroffset + propertyOffset); } else { const Object *obj = this; - if (!(getInfoSelector().offset & SCRIPT_INFO_CLASS)) + if (!isClass()) obj = segMan->getObject(getSuperClassSelector()); return READ_SCI11ENDIAN_UINT16((const byte *)obj->_baseVars + propertyOffset); |