aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorFilippos Karapetis2009-05-31 02:37:24 +0000
committerFilippos Karapetis2009-05-31 02:37:24 +0000
commita4d13cef8c48eecb1f73f2d509437261a663ab05 (patch)
treeb4cbf2d09a3a7fb78f982168a513e63e790b8f78 /engines/sci/engine
parent896df6daf337bf83f27193918eb386321c4b0166 (diff)
downloadscummvm-rg350-a4d13cef8c48eecb1f73f2d509437261a663ab05.tar.gz
scummvm-rg350-a4d13cef8c48eecb1f73f2d509437261a663ab05.tar.bz2
scummvm-rg350-a4d13cef8c48eecb1f73f2d509437261a663ab05.zip
More objectification of the Vocabulary functions
svn-id: r41057
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/game.cpp8
-rw-r--r--engines/sci/engine/kernel.h8
-rw-r--r--engines/sci/engine/kgraphics.cpp20
-rw-r--r--engines/sci/engine/kmovement.cpp4
-rw-r--r--engines/sci/engine/kstring.cpp2
-rw-r--r--engines/sci/engine/savegame.cpp2
-rw-r--r--engines/sci/engine/script.cpp21
-rw-r--r--engines/sci/engine/script.h4
-rw-r--r--engines/sci/engine/scriptdebug.cpp18
-rw-r--r--engines/sci/engine/state.cpp2
-rw-r--r--engines/sci/engine/state.h4
-rw-r--r--engines/sci/engine/vm.cpp6
-rw-r--r--engines/sci/engine/vm.h4
13 files changed, 49 insertions, 54 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index 17284ca888..2bacadf769 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -370,11 +370,9 @@ int script_init_engine(EngineState *s, sci_version_t version) {
s->_executionStack.clear(); // Start without any execution stack
s->execution_stack_base = -1; // No vm is running yet
- s->_vocabulary = new Vocabulary(s); // TODO: delete
+ s->parser_lastmatch_word = SAID_NO_MATCH;
- // TODO: move this inside the Vocabulary constructor
- // Map a few special selectors for later use
- script_map_selectors(s, &(s->selector_map));
+ s->_vocabulary = new Vocabulary(s);
script_map_kernel(s);
// Maps the kernel functions
@@ -425,6 +423,8 @@ void script_free_engine(EngineState *s) {
s->_kfuncTable.clear();
vocab_free_rule_list(s->parser_rules);
+
+ delete s->_vocabulary;
}
void script_free_breakpoints(EngineState *s) {
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index c27b2aa210..cc13764fa0 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -49,7 +49,7 @@ extern int _debug_step_running;
/******************** Selector functionality ********************/
-#define GET_SEL32(_o_, _slc_) read_selector(s, _o_, s->selector_map._slc_, __FILE__, __LINE__)
+#define GET_SEL32(_o_, _slc_) read_selector(s, _o_, s->_vocabulary->_selectorMap._slc_, __FILE__, __LINE__)
#define GET_SEL32V(_o_, _slc_) (GET_SEL32(_o_, _slc_).offset)
#define GET_SEL32SV(_o_, _slc_) ((int16)(GET_SEL32(_o_, _slc_).offset))
/* Retrieves a selector from an object
@@ -60,8 +60,8 @@ extern int _debug_step_running;
** selector_map_t and mapped in script.c.
*/
-#define PUT_SEL32(_o_, _slc_, _val_) write_selector(s, _o_, s->selector_map._slc_, _val_, __FILE__, __LINE__)
-#define PUT_SEL32V(_o_, _slc_, _val_) write_selector(s, _o_, s->selector_map._slc_, make_reg(0, _val_), __FILE__, __LINE__)
+#define PUT_SEL32(_o_, _slc_, _val_) write_selector(s, _o_, s->_vocabulary->_selectorMap._slc_, _val_, __FILE__, __LINE__)
+#define PUT_SEL32V(_o_, _slc_, _val_) write_selector(s, _o_, s->_vocabulary->_selectorMap._slc_, make_reg(0, _val_), __FILE__, __LINE__)
/* Writes a selector value to an object
** Parameters: (reg_t) object: The address of the object which the selector should be written to
** (selector_name) selector: The selector to read
@@ -73,7 +73,7 @@ extern int _debug_step_running;
#define INV_SEL(_object_, _selector_, _noinvalid_) \
- s, _object_, s->selector_map._selector_, _noinvalid_, funct_nr, argv, argc, __FILE__, __LINE__
+ s, _object_, s->_vocabulary->_selectorMap._selector_, _noinvalid_, funct_nr, argv, argc, __FILE__, __LINE__
/* Kludge for use with invoke_selector(). Used for compatibility with compilers that can't
** handle vararg macros.
*/
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 5c7bbdf80f..aa5e3c3cc6 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -1076,7 +1076,7 @@ Common::Rect set_base(EngineState *s, reg_t object) {
x = GET_SEL32SV(object, x);
original_y = y = GET_SEL32SV(object, y);
- if (s->selector_map.z > -1)
+ if (s->_vocabulary->_selectorMap.z > -1)
z = GET_SEL32SV(object, z);
else
z = 0;
@@ -1130,7 +1130,7 @@ Common::Rect set_base(EngineState *s, reg_t object) {
void _k_base_setter(EngineState *s, reg_t object) {
Common::Rect absrect = set_base(s, object);
- if (lookup_selector(s, object, s->selector_map.brLeft, NULL, NULL) != kSelectorVariable)
+ if (lookup_selector(s, object, s->_vocabulary->_selectorMap.brLeft, NULL, NULL) != kSelectorVariable)
return; // non-fatal
// Note: there was a check here for a very old version of SCI, which supposedly needed
@@ -1211,7 +1211,7 @@ Common::Rect get_nsrect(EngineState *s, reg_t object, byte clip) {
x = GET_SEL32SV(object, x);
y = GET_SEL32SV(object, y);
- if (s->selector_map.z > -1)
+ if (s->_vocabulary->_selectorMap.z > -1)
z = GET_SEL32SV(object, z);
else
z = 0;
@@ -1235,7 +1235,7 @@ Common::Rect get_nsrect(EngineState *s, reg_t object, byte clip) {
static void _k_set_now_seen(EngineState *s, reg_t object) {
Common::Rect absrect = get_nsrect(s, object, 0);
- if (lookup_selector(s, object, s->selector_map.nsTop, NULL, NULL) != kSelectorVariable) {
+ if (lookup_selector(s, object, s->_vocabulary->_selectorMap.nsTop, NULL, NULL) != kSelectorVariable) {
return;
} // This isn't fatal
@@ -1720,7 +1720,7 @@ static void _k_view_list_do_postdraw(EngineState *s, GfxList *list) {
* if ((widget->signal & (_K_VIEW_SIG_FLAG_PRIVATE | _K_VIEW_SIG_FLAG_REMOVE | _K_VIEW_SIG_FLAG_NO_UPDATE)) == _K_VIEW_SIG_FLAG_PRIVATE) {
*/
if ((widget->signal & (_K_VIEW_SIG_FLAG_REMOVE | _K_VIEW_SIG_FLAG_NO_UPDATE)) == 0) {
- int has_nsrect = lookup_selector(s, obj, s->selector_map.nsBottom, NULL, NULL) == kSelectorVariable;
+ int has_nsrect = lookup_selector(s, obj, s->_vocabulary->_selectorMap.nsBottom, NULL, NULL) == kSelectorVariable;
if (has_nsrect) {
int temp;
@@ -1742,7 +1742,7 @@ static void _k_view_list_do_postdraw(EngineState *s, GfxList *list) {
}
#ifdef DEBUG_LSRECT
else
- fprintf(stderr, "Not lsRecting %04x:%04x because %d\n", PRINT_REG(obj), lookup_selector(s, obj, s->selector_map.nsBottom, NULL, NULL));
+ fprintf(stderr, "Not lsRecting %04x:%04x because %d\n", PRINT_REG(obj), lookup_selector(s, obj, s->_vocabulary->_selectorMap.nsBottom, NULL, NULL));
#endif
if (widget->signal & _K_VIEW_SIG_FLAG_HIDDEN)
@@ -1894,7 +1894,7 @@ static GfxDynView *_k_make_dynview_obj(EngineState *s, reg_t obj, int options, i
loop = oldloop = sign_extend_byte(GET_SEL32V(obj, loop));
cel = oldcel = sign_extend_byte(GET_SEL32V(obj, cel));
- if (s->selector_map.palette)
+ if (s->_vocabulary->_selectorMap.palette)
palette = GET_SEL32V(obj, palette);
else
palette = 0;
@@ -1916,14 +1916,14 @@ static GfxDynView *_k_make_dynview_obj(EngineState *s, reg_t obj, int options, i
PUT_SEL32V(obj, cel, cel);
}
- if (lookup_selector(s, obj, s->selector_map.underBits, &(under_bitsp), NULL) != kSelectorVariable) {
+ if (lookup_selector(s, obj, s->_vocabulary->_selectorMap.underBits, &(under_bitsp), NULL) != kSelectorVariable) {
under_bitsp = NULL;
under_bits = NULL_REG;
debugC(2, kDebugLevelGraphics, "Object at %04x:%04x has no underBits\n", PRINT_REG(obj));
} else
under_bits = *((reg_t *)under_bitsp);
- if (lookup_selector(s, obj, s->selector_map.signal, &(signalp), NULL) != kSelectorVariable) {
+ if (lookup_selector(s, obj, s->_vocabulary->_selectorMap.signal, &(signalp), NULL) != kSelectorVariable) {
signalp = NULL;
signal = 0;
debugC(2, kDebugLevelGraphics, "Object at %04x:%04x has no signal selector\n", PRINT_REG(obj));
@@ -2015,7 +2015,7 @@ static void _k_prepare_view_list(EngineState *s, GfxList *list, int options) {
while (view) {
reg_t obj = make_reg(view->_ID, view->_subID);
int priority, _priority;
- int has_nsrect = (view->_ID <= 0) ? 0 : lookup_selector(s, obj, s->selector_map.nsBottom, NULL, NULL) == kSelectorVariable;
+ int has_nsrect = (view->_ID <= 0) ? 0 : lookup_selector(s, obj, s->_vocabulary->_selectorMap.nsBottom, NULL, NULL) == kSelectorVariable;
int oldsignal = view->signal;
_k_set_now_seen(s, obj);
diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp
index 9b62792073..0410d36974 100644
--- a/engines/sci/engine/kmovement.cpp
+++ b/engines/sci/engine/kmovement.cpp
@@ -462,7 +462,7 @@ static void bresenham_autodetect(EngineState *s) {
return;
}
- if (lookup_selector(s, motion_class, s->selector_map.doit, NULL, &fptr) != kSelectorMethod) {
+ if (lookup_selector(s, motion_class, s->_vocabulary->_selectorMap.doit, NULL, &fptr) != kSelectorMethod) {
warning("bresenham_autodetect failed");
handle_movecnt = INCREMENT_MOVECNT; // Most games do this, so best guess
return;
@@ -557,7 +557,7 @@ reg_t kDoBresen(EngineState *s, int funct_nr, int argc, reg_t *argv) {
debugC(2, kDebugLevelBresen, "New data: (x,y)=(%d,%d), di=%d\n", x, y, bdi);
- if (s->selector_map.cantBeHere != -1)
+ if (s->_vocabulary->_selectorMap.cantBeHere != -1)
invoke_selector(INV_SEL(client, cantBeHere, 0), 0);
else
invoke_selector(INV_SEL(client, canBeHere, 0), 0);
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp
index 3c1b807848..d34670369b 100644
--- a/engines/sci/engine/kstring.cpp
+++ b/engines/sci/engine/kstring.cpp
@@ -203,7 +203,7 @@ reg_t kParse(EngineState *s, int funct_nr, int argc, reg_t *argv) {
return s->r_acc;
}
- bool res = vocab_tokenize_string(words, string, s->_vocabulary->_parserWords, s->_vocabulary->_parserSuffixes, &error);
+ bool res = s->_vocabulary->tokenizeString(words, string, &error);
s->parser_valid = 0; /* not valid */
if (res && !words.empty()) {
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 16c6eba0dd..fe6f0f1376 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -834,7 +834,7 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
retval->_kfuncTable = s->_kfuncTable;
retval->_vocabulary->_opcodes = s->_vocabulary->_opcodes;
- memcpy(&(retval->selector_map), &(s->selector_map), sizeof(selector_map_t));
+ memcpy(&(retval->_vocabulary->_selectorMap), &(s->_vocabulary->_selectorMap), sizeof(selector_map_t));
retval->parser_base = make_reg(s->sys_strings_segment, SYS_STRING_PARSER_BASE);
diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp
index cf364ebf21..34e4cf05b7 100644
--- a/engines/sci/engine/script.cpp
+++ b/engines/sci/engine/script.cpp
@@ -108,9 +108,9 @@ void script_adjust_opcode_formats(int res_version) {
}
}
-int script_find_selector(EngineState *s, const char *selectorname) {
- for (uint pos = 0; pos < s->_vocabulary->_selectorNames.size(); ++pos) {
- if (s->_vocabulary->_selectorNames[pos] == selectorname)
+int script_find_selector(Common::StringList *selectorNames, const char *selectorname) {
+ for (uint pos = 0; pos < selectorNames->size(); ++pos) {
+ if ((*selectorNames)[pos] == selectorname)
return pos;
}
@@ -119,10 +119,10 @@ int script_find_selector(EngineState *s, const char *selectorname) {
return -1;
}
-#define FIND_SELECTOR(_slc_) map->_slc_ = script_find_selector(s, #_slc_)
-#define FIND_SELECTOR2(_slc_, _slcstr_) map->_slc_ = script_find_selector(s, _slcstr_)
+#define FIND_SELECTOR(_slc_) map->_slc_ = script_find_selector(selectorNames, #_slc_)
+#define FIND_SELECTOR2(_slc_, _slcstr_) map->_slc_ = script_find_selector(selectorNames, _slcstr_)
-void script_map_selectors(EngineState *s, selector_map_t *map) {
+void script_map_selectors(Common::StringList *selectorNames, selector_map_t *map) {
FIND_SELECTOR(init);
FIND_SELECTOR(play);
FIND_SELECTOR(replay);
@@ -303,7 +303,7 @@ static void script_dump_class(char *data, int seeker, int objsize, const Common:
}
}
-void script_dissect(ResourceManager *resmgr, int res_no, WordMap &parserWords, const Common::StringList &selectorNames) {
+void script_dissect(ResourceManager *resmgr, int res_no, Vocabulary *vocab) {
int objectctr[11] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
unsigned int _seeker = 0;
Resource *script = resmgr->findResource(kResourceTypeScript, res_no, 0);
@@ -337,7 +337,7 @@ void script_dissect(ResourceManager *resmgr, int res_no, WordMap &parserWords, c
switch (objtype) {
case SCI_OBJ_OBJECT:
- script_dump_object((char *)script->data, seeker, objsize, selectorNames);
+ script_dump_object((char *)script->data, seeker, objsize, vocab->_selectorNames);
break;
case SCI_OBJ_CODE: {
@@ -396,8 +396,7 @@ void script_dissect(ResourceManager *resmgr, int res_no, WordMap &parserWords, c
}
} else {
nextitem = nextitem << 8 | script->data [seeker++];
- // TODO
- sciprintf("%s[%03x] ", vocab_get_any_group_word(nextitem, parserWords), nextitem);
+ sciprintf("%s[%03x] ", vocab->getAnyWordFromGroup(nextitem), nextitem);
}
}
sciprintf("\n");
@@ -415,7 +414,7 @@ void script_dissect(ResourceManager *resmgr, int res_no, WordMap &parserWords, c
break;
case SCI_OBJ_CLASS:
- script_dump_class((char *)script->data, seeker, objsize, selectorNames);
+ script_dump_class((char *)script->data, seeker, objsize, vocab->_selectorNames);
break;
case SCI_OBJ_EXPORTS: {
diff --git a/engines/sci/engine/script.h b/engines/sci/engine/script.h
index 037ba3a806..ab7ba7af80 100644
--- a/engines/sci/engine/script.h
+++ b/engines/sci/engine/script.h
@@ -51,7 +51,7 @@ enum ScriptObjectTypes {
SCI_OBJ_LOCALVARS
};
-void script_dissect(ResourceManager *resmgr, int res_no, WordMap &parserWords, const Common::StringList &selectorNames);
+void script_dissect(ResourceManager *resmgr, int res_no, Vocabulary *vocab);
/* Opcode formats as used by script.c */
enum opcode_format {
@@ -203,7 +203,7 @@ extern opcode_format g_opcode_formats[128][4];
void script_adjust_opcode_formats(int res_version);
-int script_find_selector(EngineState *s, const char *selector_name);
+int script_find_selector(Common::StringList *selectorNames, const char *selector_name);
/* Determines the selector ID of a selector by its name
** Parameters: (state_t *) s: VM state
** (char *) selector_name: Name of the selector to look up
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index 766d843876..9f29134b84 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -648,7 +648,7 @@ int c_parse(EngineState *s, const Common::Array<cmd_param_t> &cmdParams) {
string = cmdParams[0].str;
sciprintf("Parsing '%s'\n", string);
- bool res = vocab_tokenize_string(words, string, s->_vocabulary->_parserWords, s->_vocabulary->_parserSuffixes, &error);
+ bool res = s->_vocabulary->tokenizeString(words, string, &error);
if (res && !words.empty()) {
int syntax_fail = 0;
@@ -1232,10 +1232,10 @@ static int c_gfx_draw_viewobj(EngineState *s, const Common::Array<cmd_param_t> &
}
- is_view = (lookup_selector(s, pos, s->selector_map.x, NULL) == kSelectorVariable) &&
- (lookup_selector(s, pos, s->selector_map.brLeft, NULL) == kSelectorVariable) &&
- (lookup_selector(s, pos, s->selector_map.signal, NULL) == kSelectorVariable) &&
- (lookup_selector(s, pos, s->selector_map.nsTop, NULL) == kSelectorVariable);
+ is_view = (lookup_selector(s, pos, s->_vocabulary->_selectorMap.x, NULL) == kSelectorVariable) &&
+ (lookup_selector(s, pos, s->_vocabulary->_selectorMap.brLeft, NULL) == kSelectorVariable) &&
+ (lookup_selector(s, pos, s->_vocabulary->_selectorMap.signal, NULL) == kSelectorVariable) &&
+ (lookup_selector(s, pos, s->_vocabulary->_selectorMap.nsTop, NULL) == kSelectorVariable);
if (!is_view) {
sciprintf("Not a dynamic View object.\n");
@@ -1318,7 +1318,7 @@ static int c_disasm_addr(EngineState *s, const Common::Array<cmd_param_t> &cmdPa
static int c_disasm(EngineState *s, const Common::Array<cmd_param_t> &cmdParams) {
Object *obj = obj_get(s, cmdParams[0].reg);
- int selector_id = script_find_selector(s, cmdParams[1].str);
+ int selector_id = script_find_selector(&s->_vocabulary->_selectorNames, cmdParams[1].str);
reg_t addr;
if (!obj) {
@@ -1420,7 +1420,7 @@ static int c_send(EngineState *s, const Common::Array<cmd_param_t> &cmdParams) {
reg_t *vptr;
reg_t fptr;
- selector_id = script_find_selector(s, selector_name);
+ selector_id = script_find_selector(&s->_vocabulary->_selectorNames, selector_name);
if (selector_id < 0) {
sciprintf("Unknown selector: \"%s\"\n", selector_name);
@@ -1567,7 +1567,7 @@ static void viewobjinfo(EngineState *s, HeapPtr pos) {
int have_rects = 0;
Common::Rect nsrect, nsrect_clipped, brrect;
- if (lookup_selector(s, pos, s->selector_map.nsBottom, NULL) == kSelectorVariable) {
+ if (lookup_selector(s, pos, s->_vocabulary->_selectorMap.nsBottom, NULL) == kSelectorVariable) {
GETRECT(nsLeft, nsRight, nsBottom, nsTop);
GETRECT(lsLeft, lsRight, lsBottom, lsTop);
GETRECT(brLeft, brRight, brBottom, brTop);
@@ -1581,7 +1581,7 @@ static void viewobjinfo(EngineState *s, HeapPtr pos) {
x = GET_SELECTOR(pos, x);
y = GET_SELECTOR(pos, y);
priority = GET_SELECTOR(pos, priority);
- if (s->selector_map.z > 0) {
+ if (s->_vocabulary->_selectorMap.z > 0) {
z = GET_SELECTOR(pos, z);
sciprintf("(%d,%d,%d)\n", x, y, z);
} else
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index 10c8afd67f..68b706cfb4 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -121,8 +121,6 @@ EngineState::EngineState() : _dirseeker(this) {
seg_manager = 0;
gc_countdown = 0;
- memset(&selector_map, 0, sizeof(selector_map)); // FIXME: Remove this once/if we C++ify selector_map_t
-
successor = 0;
}
diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h
index db3e8f38c0..ee22a9e31d 100644
--- a/engines/sci/engine/state.h
+++ b/engines/sci/engine/state.h
@@ -242,8 +242,6 @@ public:
Common::Array<kfunct_sig_pair_t> _kfuncTable; /**< Table of kernel functions */
- selector_map_t selector_map; /**< Shortcut list for important selectors */
-
MessageState _msgState;
Vocabulary *_vocabulary;
@@ -260,7 +258,7 @@ public:
PaletteEntry get_pic_color(EngineState *s, int color);
static inline reg_t not_register(EngineState *s, reg_t r) {
- if (s->selector_map.cantBeHere != -1)
+ if (s->_vocabulary->_selectorMap.cantBeHere != -1)
return make_reg(0, !r.offset);
else
return r;
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index d57f9bc2f4..3fb7bbcdcc 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -1977,7 +1977,7 @@ static EngineState *_game_run(EngineState *s, int restoring) {
script_init_engine(s, s->version);
game_init(s);
sfx_reset_player();
- _init_stack_base_with_selector(s, s->selector_map.play);
+ _init_stack_base_with_selector(s, s->_vocabulary->_selectorMap.play);
send_selector(s, s->game_obj, s->game_obj, s->stack_base, 2, s->stack_base);
@@ -1997,7 +1997,7 @@ static EngineState *_game_run(EngineState *s, int restoring) {
sciprintf("Restarting with replay()\n");
s->_executionStack.clear(); // Restart with replay
- _init_stack_base_with_selector(s, s->selector_map.replay);
+ _init_stack_base_with_selector(s, s->_vocabulary->_selectorMap.replay);
send_selector(s, s->game_obj, s->game_obj, s->stack_base, 2, s->stack_base);
}
@@ -2018,7 +2018,7 @@ int game_run(EngineState **_s) {
EngineState *s = *_s;
sciprintf(" Calling %s::play()\n", s->_gameName.c_str());
- _init_stack_base_with_selector(s, s->selector_map.play); // Call the play selector
+ _init_stack_base_with_selector(s, s->_vocabulary->_selectorMap.play); // Call the play selector
// Now: Register the first element on the execution stack-
if (!send_selector(s, s->game_obj, s->game_obj, s->stack_base, 2, s->stack_base) || script_error_flag) {
diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h
index 736bdff47f..b4a2de4d23 100644
--- a/engines/sci/engine/vm.h
+++ b/engines/sci/engine/vm.h
@@ -1076,9 +1076,9 @@ void quit_vm();
** Returns : (void)
*/
-void script_map_selectors(EngineState *s, selector_map_t *map);
+void script_map_selectors(Common::StringList *selectorNames, selector_map_t *map);
/* Maps special selectors
-** Parameters: (EngineState *) s: The state from which the selector information should be taken
+** Parameters: (Common::StringList *) selectorNames: The selector information
** (selector_map_t *) map: Pointer to the selector map to map
** Returns : (void)
** Called by script_run();