From 3af8918e1a0888d46df13eff088104dce4c88974 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 22 Apr 2009 17:54:11 +0000 Subject: SCI: Changed kfunct_table to a Common::Array svn-id: r40080 --- engines/sci/engine/game.cpp | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'engines/sci/engine/game.cpp') diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp index 39f1b2135b..a955b0058b 100644 --- a/engines/sci/engine/game.cpp +++ b/engines/sci/engine/game.cpp @@ -68,22 +68,6 @@ static int _init_vocabulary(EngineState *s) { // initialize vocabulary and relat extern int _allocd_rules; -static void _free_vocabulary(EngineState *s) { - sciprintf("Freeing vocabulary\n"); - - 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(); - s->_kernelNames.clear(); - vocabulary_free_opcodes(s->opcodes); - s->opcodes = NULL; - - s->opcodes = NULL; -} - static void _sci1_alloc_system_colors(EngineState *s) { gfx_color_t black = { PaletteEntry(0, 0, 0), 0, 0, 0, GFX_MASK_VISUAL }; gfxop_set_system_color(s->gfx_state, 0, &black); @@ -537,17 +521,22 @@ void script_free_vm_memory(EngineState *s) { s->_fileHandles.resize(5); } -extern void free_kfunct_tables(EngineState *s); -// From kernel.c - void script_free_engine(EngineState *s) { script_free_vm_memory(s); sciprintf("Freeing state-dependant data\n"); - free_kfunct_tables(s); + s->_kfuncTable.clear(); + + s->_parserWords.clear(); + vocab_free_suffixes(s->resmgr, s->_parserSuffixes); + vocab_free_branches(s->parser_branches); + vocab_free_rule_list(s->parser_rules); - _free_vocabulary(s); + s->_selectorNames.clear(); + s->_kernelNames.clear(); + vocabulary_free_opcodes(s->opcodes); + s->opcodes = NULL; } void script_free_breakpoints(EngineState *s) { -- cgit v1.2.3