aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorColin Snover2017-02-08 21:45:40 -0600
committerColin Snover2017-04-23 13:07:25 -0500
commit82994609177c30b69f2be155670253b63469d876 (patch)
treea66918a96ef8103bb22d718780f94b08f2827111 /engines
parent5c5e485ff0a48b4aee279ae746941339d881914c (diff)
downloadscummvm-rg350-82994609177c30b69f2be155670253b63469d876.tar.gz
scummvm-rg350-82994609177c30b69f2be155670253b63469d876.tar.bz2
scummvm-rg350-82994609177c30b69f2be155670253b63469d876.zip
SCI32: Hook up mustSetViewVisible for SCI3
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/object.cpp25
-rw-r--r--engines/sci/engine/object.h4
-rw-r--r--engines/sci/engine/selector.cpp11
3 files changed, 29 insertions, 11 deletions
diff --git a/engines/sci/engine/object.cpp b/engines/sci/engine/object.cpp
index 2c1ab2a44a..621810d856 100644
--- a/engines/sci/engine/object.cpp
+++ b/engines/sci/engine/object.cpp
@@ -24,6 +24,9 @@
#include "sci/engine/kernel.h"
#include "sci/engine/object.h"
#include "sci/engine/seg_manager.h"
+#ifdef ENABLE_SCI32
+#include "sci/engine/features.h"
+#endif
namespace Sci {
@@ -247,6 +250,28 @@ bool Object::initBaseObject(SegManager *segMan, reg_t addr, bool doInitSuperClas
const int EXTRA_GROUPS = 3;
+#ifdef ENABLE_SCI32
+bool Object::mustSetViewVisible(const int index) const {
+ if (getSciVersion() == SCI_VERSION_3) {
+ if ((uint)index < getVarCount()) {
+ return _mustSetViewVisible[getVarSelector(index) >> 5];
+ }
+ return false;
+ } else {
+ int minIndex, maxIndex;
+ if (g_sci->_features->usesAlternateSelectors()) {
+ minIndex = 24;
+ maxIndex = 43;
+ } else {
+ minIndex = 26;
+ maxIndex = 44;
+ }
+
+ return index >= minIndex && index <= maxIndex;
+ }
+}
+#endif
+
void Object::initSelectorsSci3(const SciSpan<const byte> &buf) {
const SciSpan<const byte> groupInfo = _baseObj.subspan(16);
const SciSpan<const byte> selectorBase = groupInfo.subspan(EXTRA_GROUPS * 32 * 2);
diff --git a/engines/sci/engine/object.h b/engines/sci/engine/object.h
index dca7e97e81..20b1e01776 100644
--- a/engines/sci/engine/object.h
+++ b/engines/sci/engine/object.h
@@ -295,7 +295,9 @@ public:
bool initBaseObject(SegManager *segMan, reg_t addr, bool doInitSuperClass = true);
void syncBaseObject(const SciSpan<const byte> &ptr) { _baseObj = ptr; }
- bool mustSetViewVisibleSci3(int selector) const { return _mustSetViewVisible[selector/32]; }
+#ifdef ENABLE_SCI32
+ bool mustSetViewVisible(int selector) const;
+#endif
private:
void initSelectorsSci3(const SciSpan<const byte> &buf);
diff --git a/engines/sci/engine/selector.cpp b/engines/sci/engine/selector.cpp
index 5bfc73b801..7f509f3968 100644
--- a/engines/sci/engine/selector.cpp
+++ b/engines/sci/engine/selector.cpp
@@ -231,16 +231,7 @@ reg_t readSelector(SegManager *segMan, reg_t object, Selector selectorId) {
#ifdef ENABLE_SCI32
void updateInfoFlagViewVisible(Object *obj, int index) {
- int minIndex, maxIndex;
- if (g_sci->_features->usesAlternateSelectors()) {
- minIndex = 24;
- maxIndex = 43;
- } else {
- minIndex = 26;
- maxIndex = 44;
- }
-
- if (index >= minIndex && index <= maxIndex && getSciVersion() >= SCI_VERSION_2) {
+ if (getSciVersion() >= SCI_VERSION_2 && obj->mustSetViewVisible(index)) {
obj->setInfoSelectorFlag(kInfoFlagViewVisible);
}
}