diff --git a/engines/glk/quest/geas_file.cpp b/engines/glk/quest/geas_file.cpp index 3df61c4e3a9..ec7ef606273 100644 --- a/engines/glk/quest/geas_file.cpp +++ b/engines/glk/quest/geas_file.cpp @@ -32,9 +32,6 @@ namespace Quest { void report_error(const String &s); -// FIXME: This requires global constructor -reserved_words obj_tag_property("look", "examine", "speak", "take", "alias", "prefix", "suffix", "detail", "displaytype", "gender", "article", "hidden", "invisible", (char *) nullptr); - // FIXME: This requires global constructor //reserved_words room_tag_property("look", "alias", "prefix", "indescription", "description", "north", "south", "east", "west", "northwest", "northeast", "southeast", "southwest", "up", "down", "out", (char *) NULL); @@ -96,18 +93,19 @@ bool GeasFile::obj_has_property(String objname, String propname) const { //Set GeasFile::get_obj_keys (String obj) const Set GeasFile::get_obj_keys(String obj) const { //Set rv; + reserved_words obj_tag_property("look", "examine", "speak", "take", "alias", "prefix", "suffix", "detail", "displaytype", "gender", "article", "hidden", "invisible", (char *) nullptr); Set rv; - get_obj_keys(obj, rv); + get_obj_keys(obj, rv, obj_tag_property); return rv; } -void GeasFile::get_obj_keys(String obj, Set &rv) const { +void GeasFile::get_obj_keys(String obj, Set &rv, const reserved_words &obj_tag_property) const { cerr << "get_obj_keys (gf, <" << obj << ">)\n"; //Set rv; uint c1, c2; String tok, line; - reserved_words *rw = nullptr; + const reserved_words *rw = nullptr; const GeasBlock *gb = find_by_name("object", obj); rw = &obj_tag_property; diff --git a/engines/glk/quest/geas_file.h b/engines/glk/quest/geas_file.h index 4810fc5f153..b0edcae6325 100644 --- a/engines/glk/quest/geas_file.h +++ b/engines/glk/quest/geas_file.h @@ -80,7 +80,7 @@ struct GeasFile { const GeasBlock &block(String type, uint index) const; uint size(String type) const; - void read_into(const Common::Array &, String, uint, bool, const reserved_words &, const reserved_words &); + void read_into(const Common::Array &, String, uint, bool, const reserved_words &, const reserved_words &, const reserved_words &); @@ -98,7 +98,7 @@ struct GeasFile { bool type_of_type(String subtype, String supertype) const; Set get_obj_keys(String obj) const; - void get_obj_keys(String, Set &) const; + void get_obj_keys(String, Set &, const reserved_words &obj_tag_property) const; void get_type_keys(String, Set &) const; bool obj_has_action(String objname, String propname) const; diff --git a/engines/glk/quest/read_file.cpp b/engines/glk/quest/read_file.cpp index c9258e2068d..a75e5ad1588 100644 --- a/engines/glk/quest/read_file.cpp +++ b/engines/glk/quest/read_file.cpp @@ -131,13 +131,11 @@ bool is_end_define(String s) { extern Common::Array split_lines(String data); -// FIXME: This requires global constructor -reserved_words dir_tag_property("north", "south", "east", "west", "northwest", "northeast", "southeast", "southwest", "up", "down", "out", (char *) nullptr); - void GeasFile::read_into(const Common::Array &in_data, String in_parent, uint cur_line, bool recurse, const reserved_words &props, - const reserved_words &actions) { + const reserved_words &actions, + const reserved_words &dir_tag_property) { //cerr << "r_i: Reading in from" << cur_line << ": " << in_data[cur_line] << endl; //output.push_back (GeasBlock()); //GeasBlock &out_block = output[output.size() - 1]; @@ -302,6 +300,7 @@ GeasFile::GeasFile(const Common::Array &v, GeasInterface *_gi) : gi(_gi) reserved_words recursive_passes("game", "room", (char *) nullptr), object_passes("game", "room", "objects", (char *) nullptr); + reserved_words dir_tag_property("north", "south", "east", "west", "northwest", "northeast", "southeast", "southwest", "up", "down", "out", (char *) nullptr); //Common::Array outv; for (uint pass = 0; pass < sizeof(pass_names) / sizeof(*pass_names); @@ -333,14 +332,14 @@ GeasFile::GeasFile(const Common::Array &v, GeasInterface *_gi) : gi(_gi) // SENSITIVE? if (blocktype == this_pass) - read_into(v, "", i, recursive, props, actions); + read_into(v, "", i, recursive, props, actions, dir_tag_property); } else if (depth == 2 && blocktype == this_pass) { // SENSITIVE? if (this_pass == "object" && parenttype == "room") - read_into(v, parentname, i, false, props, actions); + read_into(v, parentname, i, false, props, actions, dir_tag_property); // SENSITIVE? else if (this_pass == "variable" && parenttype == "game") - read_into(v, "", i, false, props, actions); + read_into(v, "", i, false, props, actions, dir_tag_property); } } else if (is_end_define(v[i])) -- depth;