aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2009-08-28 10:13:03 +0000
committerFilippos Karapetis2009-08-28 10:13:03 +0000
commitaf2668145a0dc0a7175b71ce05304f80fb607209 (patch)
tree68cbb87fcdfc3f1293a08903824f8098c3532295
parent97c2a8cb8961d2c438b2b6efc305d9c136d9a16c (diff)
downloadscummvm-rg350-af2668145a0dc0a7175b71ce05304f80fb607209.tar.gz
scummvm-rg350-af2668145a0dc0a7175b71ce05304f80fb607209.tar.bz2
scummvm-rg350-af2668145a0dc0a7175b71ce05304f80fb607209.zip
- Removed the unused selectors "prevSignal", "who" and "distance" from the quick access selector array
- Added the "motionCue" and "egoMoveSpeed" selectors to the selector array, to limit the places where findSelector() is used only in debugging functions - Reordered the selector initialization in mapSelectors(), so that their order matches the order found in vocab.997 svn-id: r43779
-rw-r--r--engines/sci/engine/kernel.cpp4
-rw-r--r--engines/sci/engine/script.cpp124
-rw-r--r--engines/sci/engine/vm.h7
3 files changed, 80 insertions, 55 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 19dfd0ada9..ebb1dfdb65 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -397,7 +397,7 @@ void Kernel::detectSciFeatures() {
if (version == SCI_VERSION_0_EARLY) {
features |= kFeatureOldScriptHeader | kFeatureOldGfxFunctions;
} else if (version == SCI_VERSION_0_LATE) {
- if (findSelector("motionCue") == -1)
+ if (_selectorMap.motionCue == -1)
features |= kFeatureOldGfxFunctions;
}
@@ -407,7 +407,7 @@ void Kernel::detectSciFeatures() {
features |= kFeatureLofsAbsolute;
} else if (version == SCI_VERSION_1_EARLY) {
// Use heuristic
- if (findSelector("egoMoveSpeed") != -1)
+ if (_selectorMap.egoMoveSpeed != -1)
features |= kFeatureLofsAbsolute;
}
diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp
index a21b70968a..1534208d62 100644
--- a/engines/sci/engine/script.cpp
+++ b/engines/sci/engine/script.cpp
@@ -127,75 +127,101 @@ void script_adjust_opcode_formats(SciVersion version) {
#endif
void Kernel::mapSelectors() {
- FIND_SELECTOR(init);
- FIND_SELECTOR(play);
- FIND_SELECTOR(replay);
- FIND_SELECTOR(x);
+ // species
+ // superClass
+ // -info-
FIND_SELECTOR(y);
- FIND_SELECTOR(z);
- FIND_SELECTOR(priority);
+ FIND_SELECTOR(x);
FIND_SELECTOR(view);
FIND_SELECTOR(loop);
FIND_SELECTOR(cel);
- FIND_SELECTOR(brLeft);
- FIND_SELECTOR(brRight);
- FIND_SELECTOR(brTop);
- FIND_SELECTOR(brBottom);
- FIND_SELECTOR(xStep);
- FIND_SELECTOR(yStep);
- FIND_SELECTOR(nsBottom);
+ FIND_SELECTOR(underBits);
FIND_SELECTOR(nsTop);
FIND_SELECTOR(nsLeft);
+ FIND_SELECTOR(nsBottom);
+ FIND_SELECTOR(lsTop);
+ FIND_SELECTOR(lsLeft);
+ FIND_SELECTOR(lsBottom);
+ FIND_SELECTOR(lsRight);
FIND_SELECTOR(nsRight);
- FIND_SELECTOR(font);
+ FIND_SELECTOR(signal);
+ FIND_SELECTOR(illegalBits);
+ FIND_SELECTOR(brTop);
+ FIND_SELECTOR(brLeft);
+ FIND_SELECTOR(brBottom);
+ FIND_SELECTOR(brRight);
+ // name
+ // key
+ // time
FIND_SELECTOR(text);
- FIND_SELECTOR(type);
+ FIND_SELECTOR(elements);
+ // color
+ // back
+ FIND_SELECTOR(mode);
+ // style
FIND_SELECTOR(state);
- FIND_SELECTOR(doit);
- FIND_SELECTOR2(delete_, "delete");
- FIND_SELECTOR(signal);
- FIND_SELECTOR(underBits);
- FIND_SELECTOR(canBeHere);
+ FIND_SELECTOR(font);
+ FIND_SELECTOR(type);
+ // window
+ FIND_SELECTOR(cursor);
+ FIND_SELECTOR(max);
+ // mark
+ // who
+ FIND_SELECTOR(message);
+ // edit
+ FIND_SELECTOR(play);
+ FIND_SELECTOR(number);
+ FIND_SELECTOR(handle); // nodePtr
FIND_SELECTOR(client);
FIND_SELECTOR(dx);
FIND_SELECTOR(dy);
- FIND_SELECTOR(xStep);
- FIND_SELECTOR(yStep);
FIND_SELECTOR2(b_movCnt, "b-moveCnt");
FIND_SELECTOR2(b_i1, "b-i1");
FIND_SELECTOR2(b_i2, "b-i2");
FIND_SELECTOR2(b_di, "b-di");
FIND_SELECTOR2(b_xAxis, "b-xAxis");
FIND_SELECTOR2(b_incr, "b-incr");
- FIND_SELECTOR(completed);
- FIND_SELECTOR(illegalBits);
- FIND_SELECTOR(dispose);
- FIND_SELECTOR(prevSignal);
- FIND_SELECTOR(message);
+ FIND_SELECTOR(xStep);
+ FIND_SELECTOR(yStep);
+ FIND_SELECTOR(moveSpeed);
+ FIND_SELECTOR(canBeHere); // cantBeHere
+ FIND_SELECTOR(heading);
+ FIND_SELECTOR(mover);
+ FIND_SELECTOR(doit);
+ FIND_SELECTOR(isBlocked);
+ FIND_SELECTOR(looper);
+ FIND_SELECTOR(priority);
FIND_SELECTOR(modifiers);
- FIND_SELECTOR(cue);
- FIND_SELECTOR(owner);
- FIND_SELECTOR(handle);
- FIND_SELECTOR(number);
- FIND_SELECTOR(max);
- FIND_SELECTOR(cursor);
- FIND_SELECTOR(claimed);
+ FIND_SELECTOR(replay);
+ // setPri
+ // at
+ // next
+ // done
+ // width
FIND_SELECTOR(wordFail);
FIND_SELECTOR(syntaxFail);
- FIND_SELECTOR(cycler);
- FIND_SELECTOR(elements);
- FIND_SELECTOR(lsTop);
- FIND_SELECTOR(lsBottom);
- FIND_SELECTOR(lsLeft);
- FIND_SELECTOR(lsRight);
- FIND_SELECTOR(who);
- FIND_SELECTOR(distance);
- FIND_SELECTOR(mover);
- FIND_SELECTOR(looper);
- FIND_SELECTOR(isBlocked);
- FIND_SELECTOR(heading);
- FIND_SELECTOR(mode);
+ // semanticFail
+ // pragmaFail
+ // said
+ FIND_SELECTOR(claimed);
+ // value
+ // save
+ // restore
+ // title
+ // button
+ // icon
+ // draw
+ FIND_SELECTOR2(delete_, "delete");
+ FIND_SELECTOR(z);
+ // -----------------------------
+ FIND_SELECTOR(init);
+ FIND_SELECTOR(dispose);
+ FIND_SELECTOR(size);
FIND_SELECTOR(caller);
+ FIND_SELECTOR(cue);
+ FIND_SELECTOR(owner);
+ FIND_SELECTOR(completed);
+ FIND_SELECTOR(cycler);
FIND_SELECTOR(moveDone);
FIND_SELECTOR(vol);
FIND_SELECTOR(pri);
@@ -203,9 +229,7 @@ void Kernel::mapSelectors() {
FIND_SELECTOR(sec);
FIND_SELECTOR(frame);
FIND_SELECTOR(dataInc);
- FIND_SELECTOR(size);
FIND_SELECTOR(palette);
- FIND_SELECTOR(moveSpeed);
FIND_SELECTOR(cantBeHere);
FIND_SELECTOR(nodePtr);
FIND_SELECTOR(flags);
@@ -215,6 +239,8 @@ void Kernel::mapSelectors() {
FIND_SELECTOR(printLang);
FIND_SELECTOR(subtitleLang);
FIND_SELECTOR(parseLang);
+ FIND_SELECTOR(motionCue);
+ FIND_SELECTOR(egoMoveSpeed);
}
void Kernel::dumpScriptObject(char *data, int seeker, int objsize) {
diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h
index 5e88a323e5..a514b12370 100644
--- a/engines/sci/engine/vm.h
+++ b/engines/sci/engine/vm.h
@@ -152,8 +152,6 @@ struct selector_map_t {
Selector illegalBits; /**< Used by CanBeHere */
Selector dispose;
- Selector prevSignal; /**< Used by DoSound */
-
Selector message, modifiers; /**< Used by GetEvent */
Selector owner, handle;
@@ -171,8 +169,6 @@ struct selector_map_t {
Selector lsTop, lsBottom, lsRight, lsLeft; /**< Used by Animate() subfunctions and scroll list controls */
- Selector who, distance; /**< Used for 'chasing' movers */
-
Selector looper, mover, isBlocked, heading; /**< Used in DoAvoider */
Selector caller, moveDone, moveSpeed; /**< Used for DoBresen */
@@ -193,6 +189,9 @@ struct selector_map_t {
Selector nodePtr;
Selector flags;
+ Selector motionCue; /**< Used to determine if a game is using old gfx functions or not */
+ Selector egoMoveSpeed; /**< Used to determine if a game is using absolute lofs parameters */
+
Selector points; /**< Used by AvoidPath() */
Selector syncCue; /**< Used by DoSync() */