aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2009-10-01 17:30:10 +0000
committerWillem Jan Palenstijn2009-10-01 17:30:10 +0000
commit876a28d26170e8fee5256767b1bf984c77900f18 (patch)
tree2a29ff4133f229ad0e6733db424dc6f6bd105a9f /engines
parenta6b2e9255fff6bf079115ba8aa7fa6dd9069cfed (diff)
downloadscummvm-rg350-876a28d26170e8fee5256767b1bf984c77900f18.tar.gz
scummvm-rg350-876a28d26170e8fee5256767b1bf984c77900f18.tar.bz2
scummvm-rg350-876a28d26170e8fee5256767b1bf984c77900f18.zip
SCI: cleanup
svn-id: r44528
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kmenu.cpp30
-rw-r--r--engines/sci/engine/kstring.cpp11
2 files changed, 22 insertions, 19 deletions
diff --git a/engines/sci/engine/kmenu.cpp b/engines/sci/engine/kmenu.cpp
index 92eefd542f..d0a33f62a6 100644
--- a/engines/sci/engine/kmenu.cpp
+++ b/engines/sci/engine/kmenu.cpp
@@ -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);
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp
index 2fd0d1c715..fd84f96897 100644
--- a/engines/sci/engine/kstring.cpp
+++ b/engines/sci/engine/kstring.cpp
@@ -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