aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/game.cpp
diff options
context:
space:
mode:
authorMax Horn2009-03-24 17:42:12 +0000
committerMax Horn2009-03-24 17:42:12 +0000
commit1e94b9cd3c7cd889d6b3cd0d8a9aa1b28f2cdda6 (patch)
tree10023b0d5a55d9e10f6bc9634746e0cbac0567d8 /engines/sci/engine/game.cpp
parent65b96f6a1bf1f4ca8a062f785996306dabbfedf3 (diff)
downloadscummvm-rg350-1e94b9cd3c7cd889d6b3cd0d8a9aa1b28f2cdda6.tar.gz
scummvm-rg350-1e94b9cd3c7cd889d6b3cd0d8a9aa1b28f2cdda6.tar.bz2
scummvm-rg350-1e94b9cd3c7cd889d6b3cd0d8a9aa1b28f2cdda6.zip
SCI: Rewrote vocabulary code to use a Common::HashMap<String,ResultWord>
svn-id: r39671
Diffstat (limited to 'engines/sci/engine/game.cpp')
-rw-r--r--engines/sci/engine/game.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index 97843041ed..304752235b 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -48,7 +48,7 @@ static int _init_vocabulary(EngineState *s) { // initialize vocabulary and relat
sciprintf("Initializing vocabulary\n");
- if ((s->resmgr->_sciVersion < SCI_VERSION_01_VGA) && (s->parser_words = vocab_get_words(s->resmgr, &(s->parser_words_nr)))) {
+ if ((s->resmgr->_sciVersion < SCI_VERSION_01_VGA) && vocab_get_words(s->resmgr, s->_parserWords)) {
vocab_get_suffixes(s->resmgr, s->_parserSuffixes);
if ((s->parser_branches = vocab_get_branches(s->resmgr, &(s->parser_branches_nr))))
// Now build a GNF grammar out of this
@@ -76,12 +76,10 @@ extern int _allocd_rules;
static void _free_vocabulary(EngineState *s) {
sciprintf("Freeing vocabulary\n");
- if (s->parser_words) {
- vocab_free_words(s->parser_words, s->parser_words_nr);
- vocab_free_suffixes(s->resmgr, s->_parserSuffixes);
- vocab_free_branches(s->parser_branches);
- vocab_free_rule_list(s->parser_rules);
- }
+ s->_parserWords.clear();
+ vocab_free_suffixes(s->resmgr, s->_parserSuffixes);
+ vocab_free_branches(s->parser_branches);
+ vocab_free_rule_list(s->parser_rules);
s->_selectorNames.clear();
vocabulary_free_knames(s->kernel_names);