SCI: cleanup

svn-id: r44528
This commit is contained in:
Willem Jan Palenstijn 2009-10-01 17:30:10 +00:00
parent a6b2e9255f
commit 876a28d261
2 changed files with 22 additions and 19 deletions

View File

@ -135,6 +135,12 @@ reg_t kMenuSelect(EngineState *s, int argc, reg_t *argv) {
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 @@ reg_t kMenuSelect(EngineState *s, int argc, reg_t *argv) {
!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);

View File

@ -83,6 +83,11 @@ reg_t kSaid(EngineState *s, int argc, reg_t *argv) {
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 @@ reg_t kSaid(EngineState *s, int argc, reg_t *argv) {
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