From 0dd760724e37b70bfaade2c34c12e34fab4d4b71 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Tue, 29 Dec 2015 01:44:11 +0100 Subject: SCI32: split up SCI2.1 into EARLY/MIDDLE/LATE - Detection works via signatures (couldn't find a better way) - new kString subcalls were introduced SCI2.1 LATE - kString now has signatures and is split via subcall table - kString fix, so that KQ7 doesn't crash, when starting a chapter - Sci2StringFunctionType removed, because no longer needed --- engines/sci/engine/object.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/sci/engine/object.cpp') diff --git a/engines/sci/engine/object.cpp b/engines/sci/engine/object.cpp index eeff45163d..0626c084c1 100644 --- a/engines/sci/engine/object.cpp +++ b/engines/sci/engine/object.cpp @@ -45,7 +45,7 @@ static bool relocateBlock(Common::Array &block, int block_location, Segme return false; } block[idx].setSegment(segment); // Perform relocation - if (getSciVersion() >= SCI_VERSION_1_1 && getSciVersion() <= SCI_VERSION_2_1) + if (getSciVersion() >= SCI_VERSION_1_1 && getSciVersion() <= SCI_VERSION_2_1_LATE) block[idx].incOffset(scriptSize); return true; @@ -63,7 +63,7 @@ void Object::init(byte *buf, reg_t obj_pos, bool initVariables) { 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) { + } else if (getSciVersion() >= SCI_VERSION_1_1 && getSciVersion() <= SCI_VERSION_2_1_LATE) { _variables.resize(READ_SCI11ENDIAN_UINT16(data + 2)); _baseVars = (const uint16 *)(buf + READ_SCI11ENDIAN_UINT16(data + 4)); _methodCount = READ_SCI11ENDIAN_UINT16(buf + READ_SCI11ENDIAN_UINT16(data + 6)); @@ -75,7 +75,7 @@ void Object::init(byte *buf, reg_t obj_pos, bool initVariables) { } if (initVariables) { - if (getSciVersion() <= SCI_VERSION_2_1) { + if (getSciVersion() <= SCI_VERSION_2_1_LATE) { for (uint i = 0; i < _variables.size(); i++) _variables[i] = make_reg(0, READ_SCI11ENDIAN_UINT16(data + (i * 2))); } else { @@ -92,7 +92,7 @@ int Object::locateVarSelector(SegManager *segMan, Selector slc) const { const byte *buf = 0; uint varnum = 0; - if (getSciVersion() <= SCI_VERSION_2_1) { + if (getSciVersion() <= SCI_VERSION_2_1_LATE) { const Object *obj = getClass(segMan); varnum = getSciVersion() <= SCI_VERSION_1_LATE ? getVarCount() : obj->getVariable(1).toUint16(); buf = (const byte *)obj->_baseVars; -- cgit v1.2.3 From a375cbf42b0ceb89bc01ab701b476975c94f58df Mon Sep 17 00:00:00 2001 From: Lars Skovlund Date: Sat, 27 Feb 2016 09:47:05 +0100 Subject: SCI3: Collect bits for managing kInfoFlagViewVisible --- engines/sci/engine/object.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'engines/sci/engine/object.cpp') diff --git a/engines/sci/engine/object.cpp b/engines/sci/engine/object.cpp index 0626c084c1..65c85a8e1b 100644 --- a/engines/sci/engine/object.cpp +++ b/engines/sci/engine/object.cpp @@ -255,6 +255,8 @@ void Object::initSelectorsSci3(const byte *buf) { if (g_sci->getKernel()->getSelectorNamesSize() % 32) ++groups; + _mustSetViewVisible.resize(groups); + methods = properties = 0; // Selectors are divided into groups of 32, of which the first @@ -270,7 +272,9 @@ void Object::initSelectorsSci3(const byte *buf) { // This object actually has selectors belonging to this group int typeMask = READ_SCI11ENDIAN_UINT32(seeker); - for (int bit = 2; bit < 32; ++bit) { + _mustSetViewVisible[groupNr] = !!(typeMask & 1); + + for (int bit = 2; bit < 32; ++bit) { int value = READ_SCI11ENDIAN_UINT16(seeker + bit * 2); if (typeMask & (1 << bit)) { // Property ++properties; @@ -281,7 +285,7 @@ void Object::initSelectorsSci3(const byte *buf) { } } - } + } else _mustSetViewVisible[groupNr] = false; } _variables.resize(properties); -- cgit v1.2.3 From e317958d4cdfb5d4cfe934c577be8f06e8689565 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 1 Mar 2016 01:23:55 +0200 Subject: SCI: Remove superfluous cast to boolean and fix code styling --- engines/sci/engine/object.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/sci/engine/object.cpp') diff --git a/engines/sci/engine/object.cpp b/engines/sci/engine/object.cpp index 65c85a8e1b..0566d6955f 100644 --- a/engines/sci/engine/object.cpp +++ b/engines/sci/engine/object.cpp @@ -272,7 +272,7 @@ void Object::initSelectorsSci3(const byte *buf) { // This object actually has selectors belonging to this group int typeMask = READ_SCI11ENDIAN_UINT32(seeker); - _mustSetViewVisible[groupNr] = !!(typeMask & 1); + _mustSetViewVisible[groupNr] = (typeMask & 1); for (int bit = 2; bit < 32; ++bit) { int value = READ_SCI11ENDIAN_UINT16(seeker + bit * 2); @@ -285,7 +285,8 @@ void Object::initSelectorsSci3(const byte *buf) { } } - } else _mustSetViewVisible[groupNr] = false; + } else + _mustSetViewVisible[groupNr] = false; } _variables.resize(properties); -- cgit v1.2.3