diff options
| author | Max Horn | 2009-05-20 17:52:33 +0000 |
|---|---|---|
| committer | Max Horn | 2009-05-20 17:52:33 +0000 |
| commit | 4c786a44c941268356b711c2f374eedf9b7e4db8 (patch) | |
| tree | 67a4bc647742f29f69feeac0edc93555b729270d /engines/sci/engine | |
| parent | 7d54385dea265b3fa26016a191fb6223203a5f27 (diff) | |
| download | scummvm-rg350-4c786a44c941268356b711c2f374eedf9b7e4db8.tar.gz scummvm-rg350-4c786a44c941268356b711c2f374eedf9b7e4db8.tar.bz2 scummvm-rg350-4c786a44c941268356b711c2f374eedf9b7e4db8.zip | |
SCI: Changed EngineState::opcodes to a Common::Array (maybe we shold just remove the relevant code completely, though, it seems useless, esp. as long as we hardcode the way we interpret every opcode
svn-id: r40740
Diffstat (limited to 'engines/sci/engine')
| -rw-r--r-- | engines/sci/engine/game.cpp | 5 | ||||
| -rw-r--r-- | engines/sci/engine/savegame.cpp | 2 | ||||
| -rw-r--r-- | engines/sci/engine/scriptdebug.cpp | 2 | ||||
| -rw-r--r-- | engines/sci/engine/state.cpp | 2 | ||||
| -rw-r--r-- | engines/sci/engine/state.h | 2 |
5 files changed, 5 insertions, 8 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp index 6fefa6ab96..eff320edfc 100644 --- a/engines/sci/engine/game.cpp +++ b/engines/sci/engine/game.cpp @@ -53,7 +53,7 @@ static int _init_vocabulary(EngineState *s) { // initialize vocabulary and relat s->parser_rules = NULL; } - s->opcodes = vocabulary_get_opcodes(s->resmgr); + vocabulary_get_opcodes(s->resmgr, s->_opcodes); if (!vocabulary_get_snames(s->resmgr, (s->flags & GF_SCI0_OLD), s->_selectorNames)) { sciprintf("_init_vocabulary(): Could not retrieve selector names (vocab.997)!\n"); @@ -500,8 +500,7 @@ void script_free_engine(EngineState *s) { s->_selectorNames.clear(); s->_kernelNames.clear(); - vocabulary_free_opcodes(s->opcodes); - s->opcodes = NULL; + s->_opcodes.clear(); } void script_free_breakpoints(EngineState *s) { diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 0e9fa28457..bca5df65b5 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -834,7 +834,7 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { retval->_selectorNames = s->_selectorNames; retval->_kernelNames = s->_kernelNames; retval->_kfuncTable = s->_kfuncTable; - retval->opcodes = s->opcodes; + retval->_opcodes = s->_opcodes; memcpy(&(retval->selector_map), &(s->selector_map), sizeof(selector_map_t)); diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 3407fc5b08..e7345b93b7 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -1302,7 +1302,7 @@ reg_t disassemble(EngineState *s, reg_t pos, int print_bw_tag, int print_bytecod if (print_bw_tag) sciprintf("[%c] ", opsize ? 'B' : 'W'); - sciprintf("%s", s->opcodes[opcode].name); + sciprintf("%s", s->_opcodes[opcode].name.c_str()); i = 0; while (g_opcode_formats[opcode][i]) { diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp index 03cd1dbbdf..e57230387d 100644 --- a/engines/sci/engine/state.cpp +++ b/engines/sci/engine/state.cpp @@ -136,8 +136,6 @@ EngineState::EngineState() : _dirseeker(this) { seg_manager = 0; gc_countdown = 0; - opcodes = 0; - memset(&selector_map, 0, sizeof(selector_map)); // FIXME: Remove this once/if we C++ify selector_map_t successor = 0; diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h index 476b2f9f00..e7755d3388 100644 --- a/engines/sci/engine/state.h +++ b/engines/sci/engine/state.h @@ -263,7 +263,7 @@ public: Common::Array<kfunct_sig_pair_t> _kfuncTable; /**< Table of kernel functions */ - opcode *opcodes; + Common::Array<opcode> _opcodes; selector_map_t selector_map; /**< Shortcut list for important selectors */ |
