[Scummvm-cvs-logs] SF.net SVN: scummvm:[41123] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Jun 2 09:59:04 CEST 2009


Revision: 41123
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41123&view=rev
Author:   thebluegr
Date:     2009-06-02 07:59:04 +0000 (Tue, 02 Jun 2009)

Log Message:
-----------
Removed some unused variables from the engine state

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/game.cpp
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/kstring.cpp
    scummvm/trunk/engines/sci/engine/savegame.cpp
    scummvm/trunk/engines/sci/engine/state.cpp
    scummvm/trunk/engines/sci/engine/state.h
    scummvm/trunk/engines/sci/sci.cpp

Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp	2009-06-02 06:19:41 UTC (rev 41122)
+++ scummvm/trunk/engines/sci/engine/game.cpp	2009-06-02 07:59:04 UTC (rev 41123)
@@ -370,8 +370,6 @@
 	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);
 

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-06-02 06:19:41 UTC (rev 41122)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-06-02 07:59:04 UTC (rev 41123)
@@ -2567,8 +2567,6 @@
 #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 @@
 	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 @@
 
 	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 @@
 			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 @@
 			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 @@
 			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 @@
 			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 @@
 		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 @@
 		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 @@
 		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 @@
 		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 @@
 		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 @@
 		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 @@
 		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 @@
 		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 @@
 			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 @@
 			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 @@
 			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 @@
 			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 @@
 			}
 
 			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 @@
 			}
 
 			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 @@
 			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 @@
 			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 @@
 			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 @@
 			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 @@
 }
 
 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;

Modified: scummvm/trunk/engines/sci/engine/kstring.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kstring.cpp	2009-06-02 06:19:41 UTC (rev 41122)
+++ scummvm/trunk/engines/sci/engine/kstring.cpp	2009-06-02 07:59:04 UTC (rev 41123)
@@ -120,10 +120,7 @@
 		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 @@
 
 	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;

Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp	2009-06-02 06:19:41 UTC (rev 41122)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp	2009-06-02 07:59:04 UTC (rev 41123)
@@ -777,7 +777,6 @@
 
 	// 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 @@
 	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);

Modified: scummvm/trunk/engines/sci/engine/state.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/state.cpp	2009-06-02 06:19:41 UTC (rev 41122)
+++ scummvm/trunk/engines/sci/engine/state.cpp	2009-06-02 07:59:04 UTC (rev 41123)
@@ -42,7 +42,6 @@
 	sound_mute = 0;
 
 	restarting_flags = 0;
-	have_mouse_flag = 0;
 
 	pic_not_valid = 0;
 	pic_is_new = 0;
@@ -72,7 +71,6 @@
 
 	drop_views = 0;
 
-	animation_delay = 0;
 	animation_granularity = 0;
 
 	_menubar = 0;
@@ -104,7 +102,6 @@
 	parser_event = NULL_REG;
 	script_000 = 0;
 
-	parser_lastmatch_word = 0;
 	bp_list = 0;
 	have_bp = 0;
 	sys_strings_segment = 0;

Modified: scummvm/trunk/engines/sci/engine/state.h
===================================================================
--- scummvm/trunk/engines/sci/engine/state.h	2009-06-02 06:19:41 UTC (rev 41122)
+++ scummvm/trunk/engines/sci/engine/state.h	2009-06-02 07:59:04 UTC (rev 41123)
@@ -133,7 +133,6 @@
 	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 @@
 	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 @@
 
 	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 */

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2009-06-02 06:19:41 UTC (rev 41122)
+++ scummvm/trunk/engines/sci/sci.cpp	2009-06-02 07:59:04 UTC (rev 41123)
@@ -200,8 +200,6 @@
 	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;
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list