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

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Thu Oct 1 19:30:13 CEST 2009


Revision: 44528
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44528&view=rev
Author:   wjpalenstijn
Date:     2009-10-01 17:30:10 +0000 (Thu, 01 Oct 2009)

Log Message:
-----------
SCI: cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kmenu.cpp
    scummvm/trunk/engines/sci/engine/kstring.cpp

Modified: scummvm/trunk/engines/sci/engine/kmenu.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmenu.cpp	2009-10-01 16:52:39 UTC (rev 44527)
+++ scummvm/trunk/engines/sci/engine/kmenu.cpp	2009-10-01 17:30:10 UTC (rev 44528)
@@ -135,6 +135,12 @@
 	int menu_mode = 0; /* Menu is active */
 	int mouse_down = 0;
 
+#ifdef DEBUG_PARSER
+	const int debug_parser = 1;
+#else
+	const int debug_parser = 0;
+#endif
+
 	gfxop_set_clip_zone(s->gfx_state, gfx_rect_fullscreen);
 
 	/* Check whether we can claim the event directly as a keyboard or said event */
@@ -157,20 +163,16 @@
 					          !item->_text.empty() ? item->_text.c_str() : "--bar--", item->_key, item->_modifiers,
 					          item->_type, item->_enabled ? "enabled" : "disabled");
 
-					if (((item->_type == MENU_TYPE_NORMAL)
-					        && (item->_enabled))
-					        && (((type == SCI_EVT_KEYBOARD) /* keyboard event */
-					             && item->matchKey(message, modifiers))
-					            || ((type == SCI_EVT_SAID) /* Said event */
-					                && (item->_flags & MENU_ATTRIBUTE_FLAGS_SAID)
-#ifdef DEBUG_PARSER
-					                && (said(s, item->_said, 1)
-#else
-					                && (said(s, item->_said, 0)
-#endif
-									!= SAID_NO_MATCH)
-					               )
-					           )
+					if ((item->_type == MENU_TYPE_NORMAL && item->_enabled)
+					    && ((type == SCI_EVT_KEYBOARD
+					           && item->matchKey(message, modifiers)
+					        )
+					      ||
+					        (type == SCI_EVT_SAID
+					           && (item->_flags & MENU_ATTRIBUTE_FLAGS_SAID)
+					           && said(s, item->_said, debug_parser) != SAID_NO_MATCH
+					        )
+					       )
 					   ) {
 						/* Claim the event */
 						debugC(2, kDebugLevelMenu, "Menu: Event CLAIMED for %d/%d\n", menuc, itemc);

Modified: scummvm/trunk/engines/sci/engine/kstring.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kstring.cpp	2009-10-01 16:52:39 UTC (rev 44527)
+++ scummvm/trunk/engines/sci/engine/kstring.cpp	2009-10-01 17:30:10 UTC (rev 44528)
@@ -83,6 +83,11 @@
 	reg_t heap_said_block = argv[0];
 	byte *said_block;
 	int new_lastmatch;
+#ifdef DEBUG_PARSER
+	const int debug_parser = 1;
+#else
+	const int debug_parser = 0;
+#endif
 
 	if (!heap_said_block.segment)
 		return NULL_REG;
@@ -103,11 +108,7 @@
 		return NULL_REG;
 	}
 
-#ifdef DEBUG_PARSER
-		new_lastmatch = said(s, said_block, 1);
-#else
-		new_lastmatch = said(s, said_block, 0);
-#endif
+	new_lastmatch = said(s, said_block, debug_parser);
 	if (new_lastmatch  != SAID_NO_MATCH) { /* Build and possibly display a parse tree */
 
 #ifdef DEBUG_PARSER


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