From 1e94b9cd3c7cd889d6b3cd0d8a9aa1b28f2cdda6 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 24 Mar 2009 17:42:12 +0000 Subject: SCI: Rewrote vocabulary code to use a Common::HashMap svn-id: r39671 --- engines/sci/engine/game.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'engines/sci/engine/game.cpp') 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); -- cgit v1.2.3