diff options
author | Colin Snover | 2017-05-20 20:32:27 -0500 |
---|---|---|
committer | Colin Snover | 2017-05-20 21:14:18 -0500 |
commit | eda836f21a3331e5a3a1e3c3965081f64a6e64eb (patch) | |
tree | bdef14d5ef39a35415fce32ac057e2ec0dda1426 /engines/sci/engine/object.cpp | |
parent | 71630a7cb242d208518bb9ff19e414211edae74c (diff) | |
download | scummvm-rg350-eda836f21a3331e5a3a1e3c3965081f64a6e64eb.tar.gz scummvm-rg350-eda836f21a3331e5a3a1e3c3965081f64a6e64eb.tar.bz2 scummvm-rg350-eda836f21a3331e5a3a1e3c3965081f64a6e64eb.zip |
SCI: Nitpicky cleanup of some magic numbers and what-not-why comments
Diffstat (limited to 'engines/sci/engine/object.cpp')
-rw-r--r-- | engines/sci/engine/object.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/sci/engine/object.cpp b/engines/sci/engine/object.cpp index 079106ff12..0ab8449323 100644 --- a/engines/sci/engine/object.cpp +++ b/engines/sci/engine/object.cpp @@ -54,8 +54,8 @@ void Object::init(const SciSpan<const byte> &buf, reg_t obj_pos, bool initVariab } _methodCount = data.getUint16LEAt(header.getUint16LEAt(kOffsetHeaderFunctionArea) - 2); - for (int i = 0; i < _methodCount * 2 + 2; ++i) { - _baseMethod.push_back(data.getUint16SEAt(header.getUint16LEAt(kOffsetHeaderFunctionArea) + i * 2)); + for (uint i = 0; i < _methodCount * sizeof(uint16) + 2; ++i) { + _baseMethod.push_back(data.getUint16SEAt(header.getUint16LEAt(kOffsetHeaderFunctionArea) + i * sizeof(uint16))); } } else if (getSciVersion() >= SCI_VERSION_1_1 && getSciVersion() <= SCI_VERSION_2_1_LATE) { _variables.resize(data.getUint16SEAt(2)); @@ -72,8 +72,8 @@ void Object::init(const SciSpan<const byte> &buf, reg_t obj_pos, bool initVariab } _methodCount = buf.getUint16SEAt(data.getUint16SEAt(6)); - for (int i = 0; i < _methodCount * 2 + 3; ++i) { - _baseMethod.push_back(buf.getUint16SEAt(data.getUint16SEAt(6) + i * 2)); + for (uint i = 0; i < _methodCount * sizeof(uint16) + 3; ++i) { + _baseMethod.push_back(buf.getUint16SEAt(data.getUint16SEAt(6) + i * sizeof(uint16))); } #ifdef ENABLE_SCI32 } else if (getSciVersion() == SCI_VERSION_3) { @@ -90,7 +90,7 @@ void Object::init(const SciSpan<const byte> &buf, reg_t obj_pos, bool initVariab { #endif for (uint i = 0; i < _variables.size(); i++) - _variables[i] = make_reg(0, data.getUint16SEAt(i * 2)); + _variables[i] = make_reg(0, data.getUint16SEAt(i * sizeof(uint16))); } } } |