diff options
author | Max Horn | 2009-05-21 21:50:11 +0000 |
---|---|---|
committer | Max Horn | 2009-05-21 21:50:11 +0000 |
commit | b4312540701c172fc80b50c0be03fd92ab530aeb (patch) | |
tree | e0c0c719fc8d94d0776a37376b400f7d2e43f911 /engines/sci/engine | |
parent | 4c1754127612778a8bf8e28f28b80ad20918049b (diff) | |
download | scummvm-rg350-b4312540701c172fc80b50c0be03fd92ab530aeb.tar.gz scummvm-rg350-b4312540701c172fc80b50c0be03fd92ab530aeb.tar.bz2 scummvm-rg350-b4312540701c172fc80b50c0be03fd92ab530aeb.zip |
SCI: Removed the 'save_dir' gui hack
svn-id: r40772
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/game.cpp | 4 | ||||
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 16 | ||||
-rw-r--r-- | engines/sci/engine/kmisc.cpp | 13 | ||||
-rw-r--r-- | engines/sci/engine/savegame.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/scriptdebug.cpp | 4 | ||||
-rw-r--r-- | engines/sci/engine/state.cpp | 4 | ||||
-rw-r--r-- | engines/sci/engine/state.h | 4 |
7 files changed, 1 insertions, 46 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp index a8244df0ed..b5160df12b 100644 --- a/engines/sci/engine/game.cpp +++ b/engines/sci/engine/game.cpp @@ -422,9 +422,6 @@ int script_init_engine(EngineState *s, sci_version_t version) { str->value[0].offset = 0; - s->save_dir_copy = make_reg(s->sys_strings_segment, SYS_STRING_SAVEDIR); - s->save_dir_edit_offset = 0; - s->r_acc = s->r_prev = NULL_REG; s->r_amp_rest = 0; @@ -477,7 +474,6 @@ void script_set_gamestate_save_dir(EngineState *s, reg_t path) { void script_free_vm_memory(EngineState *s) { sciprintf("Freeing VM memory\n"); - s->save_dir_copy_buf = NULL; s->_classtable.clear(); diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 9180eaa91b..a0bb426584 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -1427,10 +1427,6 @@ reg_t kEditControl(EngineState *s, int funct_nr, int argc, reg_t *argv) { return s->r_acc; } - if (text_pos == s->save_dir_copy) { - max = MAX_SAVE_DIR_SIZE - 1; - display_offset = s->save_dir_edit_offset; - } textlen = strlen(text); cursor += display_offset; @@ -1544,9 +1540,6 @@ reg_t kEditControl(EngineState *s, int funct_nr, int argc, reg_t *argv) { if (max_displayed < max) update_cursor_limits(&display_offset, &cursor, max_displayed); - if (text_pos == s->save_dir_copy) - s->save_dir_edit_offset = display_offset; - cursor -= display_offset; PUT_SEL32V(event, claimed, 1); @@ -1599,10 +1592,6 @@ static void _k_draw_control(EngineState *s, reg_t obj, int inverse) { int cursor; int max; - if (text_pos == s->save_dir_copy) { - SCIkdebug(SCIkGRAPHICS, "Displaying the save_dir copy\n"); - } - switch (type) { case K_CONTROL_BUTTON: SCIkdebug(SCIkGRAPHICS, "drawing button %04x:%04x to %d,%d\n", PRINT_REG(obj), x, y); @@ -1628,10 +1617,7 @@ static void _k_draw_control(EngineState *s, reg_t obj, int inverse) { if (cursor > (signed)strlen(text)) cursor = strlen(text); - if (text_pos == s->save_dir_copy) - update_cursor_limits(&s->save_dir_edit_offset, &cursor, max); - - update_cursor_limits(&s->save_dir_edit_offset, &cursor, max); +// update_cursor_limits(&s->save_dir_edit_offset, &cursor, max); FIXME: get rid of this? ADD_TO_CURRENT_PICTURE_PORT(sciw_new_edit_control(s->port, obj, area, text, font_nr, (unsigned)cursor, (int8)inverse)); break; diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp index 864bb516dd..8c1bddff52 100644 --- a/engines/sci/engine/kmisc.cpp +++ b/engines/sci/engine/kmisc.cpp @@ -34,12 +34,7 @@ namespace Sci { -char *old_save_dir; // FIXME get rid of this - reg_t kRestartGame(EngineState *s, int funct_nr, int argc, reg_t *argv) { - char *deref_save_dir = (char*)kernel_dereference_bulk_pointer(s, s->save_dir_copy, 1); - - old_save_dir = strdup(deref_save_dir); s->restarting_flags |= SCI_GAME_IS_RESTARTING_NOW; s->restarting_flags &= ~SCI_GAME_WAS_RESTARTED_AT_LEAST_ONCE; // This appears to help s->_executionStack.resize(s->execution_stack_base + 1); @@ -51,14 +46,6 @@ reg_t kRestartGame(EngineState *s, int funct_nr, int argc, reg_t *argv) { ** Returns the restarting_flag in acc */ reg_t kGameIsRestarting(EngineState *s, int funct_nr, int argc, reg_t *argv) { - char *deref_save_dir = (char*)kernel_dereference_bulk_pointer(s, s->save_dir_copy, 1); - - if (old_save_dir && deref_save_dir) { - strcpy(deref_save_dir, old_save_dir); - free(old_save_dir); - old_save_dir = NULL; - } - s->r_acc = make_reg(0, (s->restarting_flags & SCI_GAME_WAS_RESTARTED)); if (argc) { // Only happens during replay diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index bc097acf42..c950837780 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -796,8 +796,6 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { retval->game_obj = s->game_obj; retval->script_000 = retval->seg_manager->getScript(script_get_segment(s, 0, SCRIPT_GET_DONT_LOAD)); retval->gc_countdown = GC_INTERVAL - 1; - retval->save_dir_copy = make_reg(s->sys_strings_segment, SYS_STRING_SAVEDIR); - retval->save_dir_edit_offset = 0; retval->sys_strings_segment = find_unique_seg_by_type(retval->seg_manager, MEM_OBJ_SYS_STRINGS); retval->sys_strings = (SystemStrings *)GET_SEGMENT(*retval->seg_manager, retval->sys_strings_segment, MEM_OBJ_SYS_STRINGS); diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index dc15b12aea..0b86a411cf 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -1121,18 +1121,14 @@ int c_restore_game(EngineState *s, const Common::Array<cmd_param_t> &cmdParams) } } -extern char *old_save_dir; - int c_restart_game(EngineState *s, const Common::Array<cmd_param_t> &cmdParams) { unsigned int i; - char *deref_save_dir = (char*)kernel_dereference_bulk_pointer(s, s->save_dir_copy, 1); if (!s) { sciprintf("Not in debug state\n"); return 1; } - old_save_dir = strdup(deref_save_dir); for (i = 0; i < cmdParams.size(); i++) { if ((strcmp(cmdParams[0].str, "-r") == 0) || (strcmp(cmdParams[0].str, "--replay") == 0)) s->restarting_flags |= SCI_GAME_WAS_RESTARTED_AT_LEAST_ONCE; diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp index e57230387d..320c69ce4c 100644 --- a/engines/sci/engine/state.cpp +++ b/engines/sci/engine/state.cpp @@ -57,10 +57,6 @@ EngineState::EngineState() : _dirseeker(this) { game_time = 0; - save_dir_copy = NULL_REG; - save_dir_edit_offset = 0; - save_dir_copy_buf = 0; - mouse_pointer_view = 0; mouse_pointer_loop = 0; mouse_pointer_cel = 0; diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h index 40749cb0fd..c559a7c64c 100644 --- a/engines/sci/engine/state.h +++ b/engines/sci/engine/state.h @@ -150,10 +150,6 @@ public: long game_time; /**< Counted at 60 ticks per second, reset during start time */ - reg_t save_dir_copy; /**< Last copy of the save dir */ - int save_dir_edit_offset; /**< For kEdit(): Display offset for editing the savedir */ - char *save_dir_copy_buf; /**< Temp savedir buffer for kEdit() */ - int mouse_pointer_view; /**< Mouse pointer resource, or -1 if disabled */ int mouse_pointer_loop; /**< Mouse pointer resource, or -1 if disabled */ int mouse_pointer_cel; /**< Mouse pointer resource, or -1 if disabled */ |