diff options
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/game.cpp | 6 | ||||
-rw-r--r-- | engines/sci/engine/savegame.cpp | 6 | ||||
-rw-r--r-- | engines/sci/engine/script.cpp | 16 | ||||
-rw-r--r-- | engines/sci/engine/script.h | 24 | ||||
-rw-r--r-- | engines/sci/engine/vm.cpp | 18 |
5 files changed, 35 insertions, 35 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp index 787e372694..aaa9b38a78 100644 --- a/engines/sci/engine/game.cpp +++ b/engines/sci/engine/game.cpp @@ -331,7 +331,7 @@ static int create_class_table_sci0(EngineState *s) { while (seeker < script->size) { unsigned int lastseeker = seeker; objtype = (int16)READ_LE_UINT16(script->data + seeker); - if (objtype == sci_obj_class || objtype == sci_obj_terminator) + if (objtype == SCI_OBJ_CLASS || objtype == SCI_OBJ_TERMINATOR) break; seeker += (int16)READ_LE_UINT16(script->data + seeker + 2); if (seeker <= lastseeker) { @@ -340,7 +340,7 @@ static int create_class_table_sci0(EngineState *s) { } } - if (objtype == sci_obj_class) { + if (objtype == SCI_OBJ_CLASS) { int sugg_script; seeker -= SCRIPT_OBJECT_MAGIC_OFFSET; // Adjust position; script home is base +8 bytes @@ -372,7 +372,7 @@ static int create_class_table_sci0(EngineState *s) { seeker += (int16)READ_LE_UINT16(script->data + seeker + 2); // Move to next } - } while (objtype != sci_obj_terminator && seeker <= script->size); + } while (objtype != SCI_OBJ_TERMINATOR && seeker <= script->size); } } diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 4a9f7613b2..9fc2c98320 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -579,9 +579,9 @@ static void reconstruct_scripts(EngineState *s, SegManager *self) { Script *scr = (Script *)mobj; load_script(s, i); - scr->locals_block = scr->locals_segment == 0 ? NULL : (LocalVariables *)(s->seg_manager->_heap[scr->locals_segment]); - scr->export_table = (uint16 *) find_unique_script_block(s, scr->buf, sci_obj_exports); - scr->synonyms = find_unique_script_block(s, scr->buf, sci_obj_synonyms); + scr->locals_block = (scr->locals_segment == 0) ? NULL : (LocalVariables *)(s->seg_manager->_heap[scr->locals_segment]); + scr->export_table = (uint16 *) find_unique_script_block(s, scr->buf, SCI_OBJ_EXPORTS); + scr->synonyms = find_unique_script_block(s, scr->buf, SCI_OBJ_SYNONYMS); scr->_codeBlocks.clear(); if (!self->isSci1_1) diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp index 8998fc2fe7..828ea1f14d 100644 --- a/engines/sci/engine/script.cpp +++ b/engines/sci/engine/script.cpp @@ -339,11 +339,11 @@ void script_dissect(ResourceManager *resmgr, int res_no, const Common::StringLis objectctr[objtype]++; switch (objtype) { - case sci_obj_object: + case SCI_OBJ_OBJECT: script_dump_object((char *)script->data, seeker, objsize, selectorNames); break; - case sci_obj_code: { + case SCI_OBJ_CODE: { sciprintf("Code\n"); Common::hexdump(script->data + seeker, objsize - 4, 16, seeker); }; @@ -355,7 +355,7 @@ void script_dissect(ResourceManager *resmgr, int res_no, const Common::StringLis }; break; - case sci_obj_said: { + case SCI_OBJ_SAID: { sciprintf("Said\n"); Common::hexdump(script->data + seeker, objsize - 4, 16, seeker); @@ -406,7 +406,7 @@ void script_dissect(ResourceManager *resmgr, int res_no, const Common::StringLis } break; - case sci_obj_strings: { + case SCI_OBJ_STRINGS: { sciprintf("Strings\n"); while (script->data [seeker]) { sciprintf("%04x: %s\n", seeker, script->data + seeker); @@ -416,17 +416,17 @@ void script_dissect(ResourceManager *resmgr, int res_no, const Common::StringLis }; break; - case sci_obj_class: + case SCI_OBJ_CLASS: script_dump_class((char *)script->data, seeker, objsize, selectorNames); break; - case sci_obj_exports: { + case SCI_OBJ_EXPORTS: { sciprintf("Exports\n"); Common::hexdump((unsigned char *)script->data + seeker, objsize - 4, 16, seeker); }; break; - case sci_obj_pointers: { + case SCI_OBJ_POINTERS: { sciprintf("Pointers\n"); Common::hexdump(script->data + seeker, objsize - 4, 16, seeker); }; @@ -438,7 +438,7 @@ void script_dissect(ResourceManager *resmgr, int res_no, const Common::StringLis }; break; - case sci_obj_localvars: { + case SCI_OBJ_LOCALVARS: { sciprintf("Local vars\n"); Common::hexdump(script->data + seeker, objsize - 4, 16, seeker); }; diff --git a/engines/sci/engine/script.h b/engines/sci/engine/script.h index 8d6e635bc9..ddbcef2147 100644 --- a/engines/sci/engine/script.h +++ b/engines/sci/engine/script.h @@ -37,18 +37,18 @@ class ResourceManager; #define SCI_SCRIPTS_NR 1000 -enum script_object_types { - sci_obj_terminator, - sci_obj_object, - sci_obj_code, - sci_obj_synonyms, - sci_obj_said, - sci_obj_strings, - sci_obj_class, - sci_obj_exports, - sci_obj_pointers, - sci_obj_preload_text, /* This is really just a flag. */ - sci_obj_localvars +enum ScriptObjectTypes { + SCI_OBJ_TERMINATOR, + SCI_OBJ_OBJECT, + SCI_OBJ_CODE, + SCI_OBJ_SYNONYMS, + SCI_OBJ_SAID, + SCI_OBJ_STRINGS, + SCI_OBJ_CLASS, + SCI_OBJ_EXPORTS, + SCI_OBJ_POINTERS, + SCI_OBJ_PRELOAD_TEXT, /* This is really just a flag. */ + SCI_OBJ_LOCALVARS }; void script_dissect(ResourceManager *resmgr, int res_no, const Common::StringList &selectorNames); diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index b32d4c5ff8..ed5ebba44c 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -1766,21 +1766,21 @@ int script_instantiate_sci0(EngineState *s, int script_nr) { addr = data_base; switch (objtype) { - case sci_obj_exports: { + case SCI_OBJ_EXPORTS: { s->seg_manager->setExportTableOffset(data_base.offset, reg.segment, SEG_ID); } break; - case sci_obj_synonyms: + case SCI_OBJ_SYNONYMS: s->seg_manager->setSynonymsOffset(addr.offset, reg.segment, SEG_ID); // +4 is to step over the header s->seg_manager->setSynonymsNr((objlength) / 4, reg.segment, SEG_ID); break; - case sci_obj_localvars: + case SCI_OBJ_LOCALVARS: s->seg_manager->scriptInitialiseLocals(data_base); break; - case sci_obj_class: { + case SCI_OBJ_CLASS: { int classpos = addr.offset - SCRIPT_OBJECT_MAGIC_OFFSET; int species; reg_tmp.offset = addr.offset - SCRIPT_OBJECT_MAGIC_OFFSET; @@ -1821,11 +1821,11 @@ int script_instantiate_sci0(EngineState *s, int script_nr) { addr = reg; switch (objtype) { - case sci_obj_code: + case SCI_OBJ_CODE: s->seg_manager->scriptAddCodeBlock(addr); break; - case sci_obj_object: - case sci_obj_class: { // object or class? + case SCI_OBJ_OBJECT: + case SCI_OBJ_CLASS: { // object or class? Object *obj = s->seg_manager->scriptObjInit(s, addr); Object *base_obj; @@ -1840,7 +1840,7 @@ int script_instantiate_sci0(EngineState *s, int script_nr) { obj->_variables[SCRIPT_SUPERCLASS_SELECTOR] = INST_LOOKUP_CLASS(obj->_variables[SCRIPT_SUPERCLASS_SELECTOR].offset); } // if object or class break; - case sci_obj_pointers: // A relocation table + case SCI_OBJ_POINTERS: // A relocation table relocation = addr.offset; break; @@ -1916,7 +1916,7 @@ void script_uninstantiate_sci0(EngineState *s, int script_nr, SegmentId seg) { reg.offset += 4; // Step over header - if ((objtype == sci_obj_object) || (objtype == sci_obj_class)) { // object or class? + if ((objtype == SCI_OBJ_OBJECT) || (objtype == SCI_OBJ_CLASS)) { // object or class? int superclass; reg.offset -= SCRIPT_OBJECT_MAGIC_OFFSET; |