diff options
author | Filippos Karapetis | 2009-06-02 07:59:04 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-06-02 07:59:04 +0000 |
commit | d405b2880b537b1bac189f4e2a4b83d22b8a3d7a (patch) | |
tree | f01e949bd4e1234f17165c6289396f88522ce4f9 /engines/sci | |
parent | 7b31585e39ffc7afa5a9269aa4b5f659b0b056c3 (diff) | |
download | scummvm-rg350-d405b2880b537b1bac189f4e2a4b83d22b8a3d7a.tar.gz scummvm-rg350-d405b2880b537b1bac189f4e2a4b83d22b8a3d7a.tar.bz2 scummvm-rg350-d405b2880b537b1bac189f4e2a4b83d22b8a3d7a.zip |
Removed some unused variables from the engine state
svn-id: r41123
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/game.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 55 | ||||
-rw-r--r-- | engines/sci/engine/kstring.cpp | 5 | ||||
-rw-r--r-- | engines/sci/engine/savegame.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/state.cpp | 3 | ||||
-rw-r--r-- | engines/sci/engine/state.h | 5 | ||||
-rw-r--r-- | engines/sci/sci.cpp | 2 |
7 files changed, 25 insertions, 49 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp index c9445e44d1..d29feac3a8 100644 --- a/engines/sci/engine/game.cpp +++ b/engines/sci/engine/game.cpp @@ -370,8 +370,6 @@ int script_init_engine(EngineState *s, sci_version_t version) { s->_executionStack.clear(); // Start without any execution stack s->execution_stack_base = -1; // No vm is running yet - s->parser_lastmatch_word = SAID_NO_MATCH; - s->_kernel = new Kernel(s->resmgr, (s->flags & GF_SCI0_OLD)); s->_vocabulary = new Vocabulary(s->resmgr); diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 2ce71c911d..ae0b2a6d6b 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -2567,8 +2567,6 @@ reg_t kNewWindow(EngineState *s, int funct_nr, int argc, reg_t *argv) { #define K_ANIMATE_SCROLL_DOWN 0x2a #define K_ANIMATE_SCROLL_UP 0x2b -#define K_ANIMATE_OPEN_SIMPLE 100 // No animation - #define GRAPH_BLANK_BOX(s, x, y, xl, yl, color) GFX_ASSERT(gfxop_fill_box(s->gfx_state, \ gfx_rect(x, (((y) < 10)? 10 : (y)), xl, (((y) < 10)? ((y) - 10) : 0) + (yl)), s->ega_colors[color])); @@ -2576,6 +2574,7 @@ reg_t kNewWindow(EngineState *s, int funct_nr, int argc, reg_t *argv) { gfx_rect(x, (((y) < 10)? 10 : (y)) - 10, xl, (((y) < 10)? ((y) - 10) : 0) + (yl)), Common::Point(x, ((y) < 10)? 10 : (y) ))); static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t *argv) { + long animation_delay = 5; int i, remaining_checkers; int update_counter; int granularity0 = s->animation_granularity << 1; @@ -2604,9 +2603,6 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * gfxop_enable_dirty_frames(s->gfx_state); - if (s->animation_delay < 1) - s->pic_animate = K_ANIMATE_OPEN_SIMPLE; - switch (s->pic_animate) { case K_ANIMATE_BORDER_CLOSE_H_CENTER_OPEN_H : for (i = 0; i < 159 + granularity1; i += granularity1) { @@ -2614,7 +2610,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * gfxop_update(s->gfx_state); GRAPH_BLANK_BOX(s, 319 - i, 10, granularity1, 190, 0); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, s->animation_delay / 1000); + gfxop_sleep(s->gfx_state, animation_delay / 1000); process_sound_events(s); } GRAPH_BLANK_BOX(s, 0, 10, 320, 190, 0); @@ -2626,7 +2622,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * gfxop_update(s->gfx_state); GRAPH_UPDATE_BOX(s, 319 - i, 10, granularity1, 190); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, s->animation_delay / 1000); + gfxop_sleep(s->gfx_state, animation_delay / 1000); process_sound_events(s); } break; @@ -2639,7 +2635,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * gfxop_update(s->gfx_state); GRAPH_BLANK_BOX(s, 0, 199 - i, 320, granularity2, 0); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, 2 * s->animation_delay / 1000); + gfxop_sleep(s->gfx_state, 2 * animation_delay / 1000); process_sound_events(s); } GRAPH_BLANK_BOX(s, 0, 10, 320, 190, 0); @@ -2651,7 +2647,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * gfxop_update(s->gfx_state); GRAPH_UPDATE_BOX(s, 0, 199 - i, 320, granularity2); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, 2 * s->animation_delay / 1000); + gfxop_sleep(s->gfx_state, 2 * animation_delay / 1000); process_sound_events(s); } break; @@ -2662,7 +2658,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * for (i = 0; i < 319 + granularity0; i += granularity0) { GRAPH_BLANK_BOX(s, i, 10, granularity0, 190, 0); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, s->animation_delay / 2 / 1000); + gfxop_sleep(s->gfx_state, animation_delay / 2 / 1000); process_sound_events(s); } GRAPH_BLANK_BOX(s, 0, 10, 320, 190, 0); @@ -2671,7 +2667,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * for (i = 319; i >= 1 - granularity0; i -= granularity0) { GRAPH_UPDATE_BOX(s, i, 10, granularity0, 190); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, s->animation_delay / 2 / 1000); + gfxop_sleep(s->gfx_state, animation_delay / 2 / 1000); process_sound_events(s); } break; @@ -2682,7 +2678,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * for (i = 319; i >= 1 - granularity0; i -= granularity0) { GRAPH_BLANK_BOX(s, i, 10, granularity0, 190, 0); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, s->animation_delay / 2 / 1000); + gfxop_sleep(s->gfx_state, animation_delay / 2 / 1000); process_sound_events(s); } GRAPH_BLANK_BOX(s, 0, 10, 320, 190, 0); @@ -2692,7 +2688,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * for (i = 0; i < 319 + granularity0; i += granularity0) { GRAPH_UPDATE_BOX(s, i, 10, granularity0, 190); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, s->animation_delay / 2 / 1000); + gfxop_sleep(s->gfx_state, animation_delay / 2 / 1000); process_sound_events(s); } break; @@ -2703,7 +2699,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * for (i = 10; i < 199 + granularity1; i += granularity1) { GRAPH_BLANK_BOX(s, 0, i, 320, granularity1, 0); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, s->animation_delay / 1000); + gfxop_sleep(s->gfx_state, animation_delay / 1000); process_sound_events(s); } GRAPH_BLANK_BOX(s, 0, 10, 320, 190, 0); @@ -2713,7 +2709,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * for (i = 199; i >= 11 - granularity1; i -= granularity1) { GRAPH_UPDATE_BOX(s, 0, i, 320, granularity1); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, s->animation_delay / 1000); + gfxop_sleep(s->gfx_state, animation_delay / 1000); process_sound_events(s); } break; @@ -2724,7 +2720,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * for (i = 199; i >= 11 - granularity1; i -= granularity1) { GRAPH_BLANK_BOX(s, 0, i, 320, granularity1, 0); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, s->animation_delay / 1000); + gfxop_sleep(s->gfx_state, animation_delay / 1000); process_sound_events(s); } GRAPH_BLANK_BOX(s, 0, 10, 320, 190, 0); @@ -2734,7 +2730,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * for (i = 10; i < 199 + granularity1; i += granularity1) { GRAPH_UPDATE_BOX(s, 0, i, 320, granularity1); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, s->animation_delay / 1000); + gfxop_sleep(s->gfx_state, animation_delay / 1000); process_sound_events(s); } break; @@ -2759,7 +2755,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * GRAPH_BLANK_BOX(s, width, 200 - height_l - height, 320 - 2 * width, height_l, 0); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, 4 * s->animation_delay / 1000); + gfxop_sleep(s->gfx_state, 4 * animation_delay / 1000); process_sound_events(s); } @@ -2782,7 +2778,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * GRAPH_UPDATE_BOX(s, width, 200 - height_l - height, 320 - 2 * width, height_l); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, 4 * s->animation_delay / 1000); + gfxop_sleep(s->gfx_state, 4 * animation_delay / 1000); process_sound_events(s); } @@ -2807,7 +2803,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * GRAPH_BLANK_BOX(s, width, 200 - height_l - height, 320 - 2 * width, height_l, 0); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, 7 * s->animation_delay / 1000); + gfxop_sleep(s->gfx_state, 7 * animation_delay / 1000); process_sound_events(s); } @@ -2830,7 +2826,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * GRAPH_UPDATE_BOX(s, width, 200 - height_l - height, 320 - 2 * width, height_l); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, 7 * s->animation_delay / 1000); + gfxop_sleep(s->gfx_state, 7 * animation_delay / 1000); process_sound_events(s); } break; @@ -2865,7 +2861,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * } if (remaining_checkers & 1) { - gfxop_sleep(s->gfx_state, s->animation_delay / 4 / 1000); + gfxop_sleep(s->gfx_state, animation_delay / 4 / 1000); } --remaining_checkers; @@ -2897,7 +2893,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * } if (remaining_checkers & 1) { - gfxop_sleep(s->gfx_state, s->animation_delay / 4 / 1000); + gfxop_sleep(s->gfx_state, animation_delay / 4 / 1000); } --remaining_checkers; @@ -2912,7 +2908,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * GFX_ASSERT(gfxop_draw_pixmap(s->gfx_state, newscreen, gfx_rect(320 - i, 0, i, 190), Common::Point(0, 10))); GFX_ASSERT(gfxop_draw_pixmap(s->gfx_state, s->old_screen, gfx_rect(0, 0, 320 - i, 190), Common::Point(i, 10))); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, (s->animation_delay >> 3) / 1000); + gfxop_sleep(s->gfx_state, (animation_delay >> 3) / 1000); } GRAPH_UPDATE_BOX(s, 0, 10, 320, 190); break; @@ -2923,7 +2919,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * GFX_ASSERT(gfxop_draw_pixmap(s->gfx_state, newscreen, gfx_rect(0, 0, i, 190), Common::Point(319 - i, 10))); GFX_ASSERT(gfxop_draw_pixmap(s->gfx_state, s->old_screen, gfx_rect(i, 0, 320 - i, 190), Common::Point(0, 10))); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, (s->animation_delay >> 3) / 1000); + gfxop_sleep(s->gfx_state, (animation_delay >> 3) / 1000); } GRAPH_UPDATE_BOX(s, 0, 10, 320, 190); break; @@ -2934,7 +2930,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * GFX_ASSERT(gfxop_draw_pixmap(s->gfx_state, newscreen, gfx_rect(0, 190 - i, 320, i), Common::Point(0, 10))); GFX_ASSERT(gfxop_draw_pixmap(s->gfx_state, s->old_screen, gfx_rect(0, 0, 320, 190 - i), Common::Point(0, 10 + i))); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, (s->animation_delay >> 3) / 1000); + gfxop_sleep(s->gfx_state, (animation_delay >> 3) / 1000); } GRAPH_UPDATE_BOX(s, 0, 10, 320, 190); break; @@ -2945,14 +2941,13 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * GFX_ASSERT(gfxop_draw_pixmap(s->gfx_state, newscreen, gfx_rect(0, 0, 320, i), Common::Point(0, 200 - i))); GFX_ASSERT(gfxop_draw_pixmap(s->gfx_state, s->old_screen, gfx_rect(0, i, 320, 190 - i), Common::Point(0, 10))); gfxop_update(s->gfx_state); - gfxop_sleep(s->gfx_state, (s->animation_delay >> 3) / 1000); + gfxop_sleep(s->gfx_state, (animation_delay >> 3) / 1000); } GRAPH_UPDATE_BOX(s, 0, 10, 320, 190); break; default: - if (s->pic_animate != K_ANIMATE_OPEN_SIMPLE) - warning("Unknown opening animation 0x%02x", s->pic_animate); + warning("Unknown opening animation 0x%02x", s->pic_animate); GRAPH_UPDATE_BOX(s, 0, 10, 320, 190); } @@ -2963,7 +2958,7 @@ static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t * } reg_t kAnimate(EngineState *s, int funct_nr, int argc, reg_t *argv) { - // Animations are supposed to take a maximum of s->animation_delay milliseconds. + // Animations are supposed to take a maximum of animation_delay milliseconds. reg_t cast_list_ref = KP_ALT(0, NULL_REG); int cycle = (KP_ALT(1, NULL_REG)).offset; List *cast_list = NULL; diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index 88f7a3fc94..20f0f4793b 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -120,10 +120,7 @@ reg_t kSaid(EngineState *s, int funct_nr, int argc, reg_t *argv) { if (new_lastmatch != SAID_PARTIAL_MATCH) PUT_SEL32V(s->parser_event, claimed, 1); - s->parser_lastmatch_word = new_lastmatch; - } else { - s->parser_lastmatch_word = SAID_NO_MATCH; return NULL_REG; } return s->r_acc; @@ -196,8 +193,6 @@ reg_t kParse(EngineState *s, int funct_nr, int argc, reg_t *argv) { s->parser_event = event; - s->parser_lastmatch_word = SAID_NO_MATCH; - if (s->parser_valid == 2) { sciprintf("Parsing skipped: Parser in simparse mode\n"); return s->r_acc; diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 6be00653a5..aa93355e1a 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -777,7 +777,6 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { // Now copy all current state information // Graphics and input state: - retval->animation_delay = s->animation_delay; retval->animation_granularity = s->animation_granularity; retval->gfx_state = s->gfx_state; retval->old_screen = 0; @@ -845,7 +844,6 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { retval->bp_list = s->bp_list; retval->kernel_opt_flags = 0; - retval->have_mouse_flag = 1; retval->successor = NULL; retval->pic_priority_table = (int *)gfxop_get_pic_metainfo(retval->gfx_state); diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp index c6797edfff..5936c4fedb 100644 --- a/engines/sci/engine/state.cpp +++ b/engines/sci/engine/state.cpp @@ -42,7 +42,6 @@ EngineState::EngineState() : _dirseeker(this) { sound_mute = 0; restarting_flags = 0; - have_mouse_flag = 0; pic_not_valid = 0; pic_is_new = 0; @@ -72,7 +71,6 @@ EngineState::EngineState() : _dirseeker(this) { drop_views = 0; - animation_delay = 0; animation_granularity = 0; _menubar = 0; @@ -104,7 +102,6 @@ EngineState::EngineState() : _dirseeker(this) { parser_event = NULL_REG; script_000 = 0; - parser_lastmatch_word = 0; bp_list = 0; have_bp = 0; sys_strings_segment = 0; diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h index 6f22527f28..b0cb5fb396 100644 --- a/engines/sci/engine/state.h +++ b/engines/sci/engine/state.h @@ -133,7 +133,6 @@ public: unsigned int sound_mute; /**< 0 = not, else == saved value */ byte restarting_flags; /**< Flags used for restarting */ - byte have_mouse_flag; /**< Do we have a hardware pointing device? */ byte pic_not_valid; /**< Is 0 if the background picture is "valid" */ byte pic_is_new; /**< New pic was loaded or port was opened */ @@ -162,10 +161,8 @@ public: int pic_animate; /**< The animation used by Animate() to display the picture */ GfxList *dyn_views; /**< Pointers to pic and dynamic view lists */ - GfxList *drop_views; /**< A list Animate() can dump dropped dynviews into */ - long animation_delay; /**< A delay factor for pic opening animations. Defaults to 500. */ int animation_granularity; /**< Number of animation steps to perform betwen updates for transition animations */ Menubar *_menubar; /**< The menu bar */ @@ -213,8 +210,6 @@ public: uint16 currentRoomNumber() const { return KP_UINT(script_000->locals_block->_locals[13]); } - int parser_lastmatch_word; /**< Position of the input word the parser last matched on, or SAID_NO_MATCH */ - /* Debugger data: */ Breakpoint *bp_list; /**< List of breakpoints */ int have_bp; /**< Bit mask specifying which types of breakpoints are used in bp_list */ diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index b9a3a4bbfc..a7e2541792 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -200,8 +200,6 @@ Common::Error SciEngine::run() { GfxState gfx_state; gfx_state.driver = &gfx_driver_scummvm; - gamestate->have_mouse_flag = 1; - gamestate->animation_delay = 5; gamestate->animation_granularity = 4; gamestate->gfx_state = &gfx_state; |