aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobia Tesan2017-06-20 19:02:22 +0200
committerEugene Sandulenko2017-07-05 08:35:33 +0200
commit252c890bf5c60a451354cae17e6a9f90fe4a7ef6 (patch)
treed32e9f5c245a2b9aef630c0deaf76c0007763871
parented66169adf760dc46d76e39b04f98d150dc73b98 (diff)
downloadscummvm-rg350-252c890bf5c60a451354cae17e6a9f90fe4a7ef6.tar.gz
scummvm-rg350-252c890bf5c60a451354cae17e6a9f90fe4a7ef6.tar.bz2
scummvm-rg350-252c890bf5c60a451354cae17e6a9f90fe4a7ef6.zip
DIRECTOR: Add Lingo::PrimaryEventHandler
-rw-r--r--engines/director/lingo/lingo-events.cpp33
-rw-r--r--engines/director/lingo/lingo.h1
2 files changed, 34 insertions, 0 deletions
diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index 3b49121dee..e8f26c137d 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -105,6 +105,39 @@ Symbol *Lingo::getHandler(Common::String &name) {
return _handlers[entityIndex];
}
+void Lingo::primaryEventHandler(LEvent event) {
+ /* When an event occurs the message [...] is first sent to a
+ * primary event handler: [... if exists it is executed] and the
+ * event is passed on to other objects unless you explicitly stop
+ * the message by including the dontPassEventCommand in the script
+ * [D4 docs page 77]
+ */
+ debugC(3, kDebugLingoExec, "STUB: primary event handler (%s) not implemented", _eventHandlerTypes[event]);
+ switch (event) {
+ case kEventMouseDown:
+ case kEventMouseUp:
+ case kEventKeyUp:
+ case kEventKeyDown:
+ case kEventTimeout:
+ // TODO
+ break;
+ default:
+ /* N.B.: No primary event handlers for events other than
+ * keyup, keydown, mouseup, mousedown, timeout
+ * [see: www.columbia.edu/itc/visualarts/r4110/s2001/handouts
+ * /03_03_Event_Hierarchy.pdf]
+ */
+ warning("primaryEventHandler() on event other than mouseDown, mouseUp, keyUp, keyDown, timeout");
+ }
+#ifdef DEBUG_DONTPASSEVENT
+ // #define DEBUG_DONTPASSEVENT to simulate raising of the dontPassEvent flag
+ g_lingo->dontPassEvent = true;
+ debugC(3, kDebugLingoExec, "STUB: primaryEventHandler raising dontPassEvent");
+#else
+ debugC(3, kDebugLingoExec, "STUB: primaryEventHandler not raising dontPassEvent");
+#endif
+}
+
void Lingo::processInputEvent(LEvent event) {
// Primary Event handler
// Score Script
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index b0a014db52..acb086ad50 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -193,6 +193,7 @@ private:
// lingo-events.cpp
private:
void initEventHandlerTypes();
+ void primaryEventHandler(LEvent event);
void processInputEvent(LEvent event);
void processFrameEvent(LEvent event);
void processGenericEvent(LEvent event);