SCI: Constify Object::_baseVars
This may have to be undone if we ever want to start free'ing _baseVars again.
This commit is contained in:
parent
587811d852
commit
8615cecfe0
2 changed files with 3 additions and 3 deletions
|
@ -58,14 +58,14 @@ void Object::init(byte *buf, reg_t obj_pos, bool initVariables) {
|
|||
|
||||
if (getSciVersion() <= SCI_VERSION_1_LATE) {
|
||||
_variables.resize(READ_LE_UINT16(data + kOffsetSelectorCounter));
|
||||
_baseVars = (uint16 *)(_baseObj + _variables.size() * 2);
|
||||
_baseVars = (const uint16 *)(_baseObj + _variables.size() * 2);
|
||||
_methodCount = READ_LE_UINT16(data + READ_LE_UINT16(data + kOffsetFunctionArea) - 2);
|
||||
for (int i = 0; i < _methodCount * 2 + 2; ++i) {
|
||||
_baseMethod.push_back(READ_SCI11ENDIAN_UINT16(data + READ_LE_UINT16(data + kOffsetFunctionArea) + i * 2));
|
||||
}
|
||||
} else if (getSciVersion() >= SCI_VERSION_1_1 && getSciVersion() <= SCI_VERSION_2_1) {
|
||||
_variables.resize(READ_SCI11ENDIAN_UINT16(data + 2));
|
||||
_baseVars = (uint16 *)(buf + READ_SCI11ENDIAN_UINT16(data + 4));
|
||||
_baseVars = (const uint16 *)(buf + READ_SCI11ENDIAN_UINT16(data + 4));
|
||||
_methodCount = READ_SCI11ENDIAN_UINT16(buf + READ_SCI11ENDIAN_UINT16(data + 6));
|
||||
for (int i = 0; i < _methodCount * 2 + 3; ++i) {
|
||||
_baseMethod.push_back(READ_SCI11ENDIAN_UINT16(buf + READ_SCI11ENDIAN_UINT16(data + 6) + i * 2));
|
||||
|
|
|
@ -236,7 +236,7 @@ private:
|
|||
void initSelectorsSci3(const byte *buf);
|
||||
|
||||
const byte *_baseObj; /**< base + object offset within base */
|
||||
uint16 *_baseVars; /**< Pointer to the varselector area for this object */
|
||||
const uint16 *_baseVars; /**< Pointer to the varselector area for this object */
|
||||
Common::Array<uint16> _baseMethod; /**< Pointer to the method selector area for this object */
|
||||
uint16 *_propertyOffsetsSci3; /**< This is used to enable relocation of property valuesa in SCI3 */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue