diff options
author | Lars Skovlund | 2010-11-18 17:38:56 +0000 |
---|---|---|
committer | Lars Skovlund | 2010-11-18 17:38:56 +0000 |
commit | 487feb38433aa6a704dcac5f7b8288ba81772078 (patch) | |
tree | 0729131d3107c087d81e5ce8338e205b55b17d2a /engines/sci/engine | |
parent | 316ba2e6a9ed8a3856ff216017ad8d5025b6314e (diff) | |
download | scummvm-rg350-487feb38433aa6a704dcac5f7b8288ba81772078.tar.gz scummvm-rg350-487feb38433aa6a704dcac5f7b8288ba81772078.tar.bz2 scummvm-rg350-487feb38433aa6a704dcac5f7b8288ba81772078.zip |
Get rid of a const_cast.
svn-id: r54333
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/segment.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/segment.h | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp index b2eac9f7aa..547eb20182 100644 --- a/engines/sci/engine/segment.cpp +++ b/engines/sci/engine/segment.cpp @@ -398,6 +398,8 @@ void Object::init(byte *buf, reg_t obj_pos, bool initVariables) { if (getSciVersion() <= SCI_VERSION_2_1) { for (uint i = 0; i < _variables.size(); i++) _variables[i] = make_reg(0, READ_SCI11ENDIAN_UINT16(data + (i * 2))); + } else { + infoSelectorSci3 = make_reg(0, READ_SCI11ENDIAN_UINT16(_baseObj + 10)); } } } diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h index 40fd385275..b23cf88bef 100644 --- a/engines/sci/engine/segment.h +++ b/engines/sci/engine/segment.h @@ -270,14 +270,14 @@ public: if (getSciVersion() <= SCI_VERSION_2_1) return _variables[_offset + 2]; else // SCI3 - return make_reg(0, READ_SCI11ENDIAN_UINT16(_baseObj + 10)); + return infoSelectorSci3; } void setInfoSelector(reg_t info) { if (getSciVersion() <= SCI_VERSION_2_1) _variables[_offset + 2] = info; else // SCI3 - WRITE_SCI11ENDIAN_UINT16(const_cast<byte*>(_baseObj + 10), info.offset); + infoSelectorSci3 = info; } // No setter for the -info- selector @@ -406,6 +406,7 @@ private: uint16 _offset; reg_t _pos; /**< Object offset within its script; for clones, this is their base */ reg_t _superClassPosSci3; /**< reg_t pointing to superclass for SCI3 */ + reg_t infoSelectorSci3; /**< reg_t containing info "selector" for SCI3 */ }; /** Data stack */ |