aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorLars Skovlund2016-02-27 09:47:05 +0100
committerLars Skovlund2016-02-29 16:00:13 +0100
commita375cbf42b0ceb89bc01ab701b476975c94f58df (patch)
treeda94896ff92e613c2eeb187773f4a1ede2009faa /engines
parent98878d69b80fdf004145f356b29d1cfaff68590e (diff)
downloadscummvm-rg350-a375cbf42b0ceb89bc01ab701b476975c94f58df.tar.gz
scummvm-rg350-a375cbf42b0ceb89bc01ab701b476975c94f58df.tar.bz2
scummvm-rg350-a375cbf42b0ceb89bc01ab701b476975c94f58df.zip
SCI3: Collect bits for managing kInfoFlagViewVisible
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/object.cpp8
-rw-r--r--engines/sci/engine/object.h3
2 files changed, 9 insertions, 2 deletions
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);
diff --git a/engines/sci/engine/object.h b/engines/sci/engine/object.h
index cc9f5ebb52..a7be170f4f 100644
--- a/engines/sci/engine/object.h
+++ b/engines/sci/engine/object.h
@@ -262,6 +262,8 @@ public:
bool initBaseObject(SegManager *segMan, reg_t addr, bool doInitSuperClass = true);
void syncBaseObject(const byte *ptr) { _baseObj = ptr; }
+ bool mustSetViewVisibleSci3(int selector) const { return _mustSetViewVisible[selector/32]; }
+
private:
void initSelectorsSci3(const byte *buf);
@@ -278,6 +280,7 @@ private:
reg_t _superClassPosSci3; /**< reg_t pointing to superclass for SCI3 */
reg_t _speciesSelectorSci3; /**< reg_t containing species "selector" for SCI3 */
reg_t _infoSelectorSci3; /**< reg_t containing info "selector" for SCI3 */
+ Common::Array<bool> _mustSetViewVisible; /** cached bit of info to make lookup fast, SCI3 only */
};