diff options
author | Max Horn | 2009-05-28 10:28:51 +0000 |
---|---|---|
committer | Max Horn | 2009-05-28 10:28:51 +0000 |
commit | 78b3c80b11e1cee50e6aaef48525b3ea56c35663 (patch) | |
tree | c5eedbf44be0d73f7ee295ff970ed2ec5c6c01b5 | |
parent | f0e69a7d0bd5881bf574c4bcbed159c4f7addecd (diff) | |
download | scummvm-rg350-78b3c80b11e1cee50e6aaef48525b3ea56c35663.tar.gz scummvm-rg350-78b3c80b11e1cee50e6aaef48525b3ea56c35663.tar.bz2 scummvm-rg350-78b3c80b11e1cee50e6aaef48525b3ea56c35663.zip |
SCI: Turned vocab_version into a static var, and added several FIXMEs related to it (either vocab_version needs to become a member of EngineState/SciEngine, or we need to derive its value e.g. from the game version/flags, if that's possible)
svn-id: r40955
-rw-r--r-- | engines/sci/vocabulary.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/engines/sci/vocabulary.cpp b/engines/sci/vocabulary.cpp index 96b01b4c38..d823a7432c 100644 --- a/engines/sci/vocabulary.cpp +++ b/engines/sci/vocabulary.cpp @@ -32,7 +32,7 @@ namespace Sci { -int vocab_version; +static int vocab_version; // FIXME: Avoid static vars #define VOCAB_RESOURCE_PARSE_TREE_BRANCHES vocab_version == 1 ? \ VOCAB_RESOURCE_SCI1_PARSE_TREE_BRANCHES : \ @@ -239,6 +239,8 @@ const char *vocab_get_any_group_word(int group, const WordMap &words) { } bool vocab_get_suffixes(ResourceManager *resmgr, SuffixList &suffixes) { + // FIXME: This call relies on vocab_version being set, which is done by vocab_get_words. + // So vocab_get_words *must* be called before vocab_get_branches gets called Resource *resource = resmgr->findResource(kResourceTypeVocab, VOCAB_RESOURCE_SUFFIX_VOCAB, 1); unsigned int seeker = 1; @@ -274,6 +276,8 @@ bool vocab_get_suffixes(ResourceManager *resmgr, SuffixList &suffixes) { } void vocab_free_suffixes(ResourceManager *resmgr, SuffixList &suffixes) { + // FIXME: This call relies on vocab_version being set, which is done by vocab_get_words. + // So vocab_get_words *must* be called before vocab_get_branches gets called resmgr->unlockResource(resmgr->findResource(kResourceTypeVocab, VOCAB_RESOURCE_SUFFIX_VOCAB, 0), VOCAB_RESOURCE_SUFFIX_VOCAB, kResourceTypeVocab); @@ -281,6 +285,8 @@ void vocab_free_suffixes(ResourceManager *resmgr, SuffixList &suffixes) { } bool vocab_get_branches(ResourceManager * resmgr, Common::Array<parse_tree_branch_t> &branches) { + // FIXME: This call relies on vocab_version being set, which is done by vocab_get_words. + // So vocab_get_words *must* be called before vocab_get_branches gets called Resource *resource = resmgr->findResource(kResourceTypeVocab, VOCAB_RESOURCE_PARSE_TREE_BRANCHES, 0); branches.clear(); |