Skip to content

Commit

Permalink
SCI: Constify Object::_baseVars
Browse files Browse the repository at this point in the history
This may have to be undone if we ever want to start free'ing _baseVars again.
  • Loading branch information
fingolfin committed May 25, 2011
1 parent 587811d commit 8615cec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions engines/sci/engine/object.cpp
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion engines/sci/engine/object.h
Expand Up @@ -236,7 +236,7 @@ class Object {
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 */

Expand Down

0 comments on commit 8615cec

Please sign in to comment.