From 9744fc615ca646f3d963675905c07d18bd0fa62d Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 23 Feb 2009 03:04:52 +0000 Subject: SCI: Changed selector name table to a Common::StringList svn-id: r38805 --- engines/sci/engine/scriptconsole.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'engines/sci/engine/scriptconsole.cpp') diff --git a/engines/sci/engine/scriptconsole.cpp b/engines/sci/engine/scriptconsole.cpp index c352f2ae9d..b81b2794d3 100644 --- a/engines/sci/engine/scriptconsole.cpp +++ b/engines/sci/engine/scriptconsole.cpp @@ -1010,28 +1010,22 @@ static int c_hexgrep(EngineState *s) { } static int c_selectornames(EngineState * s) { - int namectr; - char **snames = NULL; - int seeker = 0; + Common::StringList selectorNames; if (NULL == s) { sciprintf("console.c: c_selectornames(): NULL passed for parameter s\n"); return -1; } - snames = vocabulary_get_snames(s->resmgr, &namectr, s ? s->version : 0); - - if (!snames) { + if (!vocabulary_get_snames(s->resmgr, s ? s->version : 0, selectorNames)) { sciprintf("No selector name table found!\n"); return 1; } sciprintf("Selector names in numeric order:\n"); - while (snames[seeker]) { - sciprintf("%03x: %s\n", seeker, snames[seeker]); - seeker++; + for (uint seeker = 0; seeker < selectorNames.size(); seeker++) { + sciprintf("%03x: %s\n", seeker, selectorNames[seeker].c_str()); } - vocabulary_free_snames(snames); return 0; } @@ -1066,7 +1060,7 @@ static int c_dissectscript(EngineState * s) { return -1; } - script_dissect(s->resmgr, cmd_params[0].val, s->selector_names, s->selector_names_nr); + script_dissect(s->resmgr, cmd_params[0].val, s->_selectorNames); return 0; } -- cgit v1.2.3