aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/director/lingo/lingo.cpp22
-rw-r--r--engines/director/lingo/lingo.h2
-rw-r--r--engines/director/score.h1
3 files changed, 24 insertions, 1 deletions
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index 529738043c..3b0456d956 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -248,11 +248,31 @@ void Lingo::executeScript(ScriptType type, uint16 id) {
cleanLocalVars();
}
+ScriptType Lingo::event2script(LEvent ev) {
+ if (_vm->getVersion() < 4) {
+ switch (ev) {
+ //case kEventStartMovie: // We are precompiling it now
+ // return kMovieScript;
+ case kEventEnterFrame:
+ return kFrameScript;
+ default:
+ return kNoneScript;
+ }
+ }
+
+ return kNoneScript;
+}
+
void Lingo::processEvent(LEvent event, int entityId) {
if (!_eventHandlerTypes.contains(event))
error("processEvent: Unknown event %d for entity %d", event, entityId);
- debug(2, "STUB: processEvent(%s) for %d", _eventHandlerTypes[event], entityId);
+ ScriptType st = event2script(event);
+
+ if (st != kNoneScript)
+ executeScript(st, entityId + 1);
+ else
+ debug(2, "STUB: processEvent(%s) for %d", _eventHandlerTypes[event], entityId);
}
int Lingo::alignTypes(Datum &d1, Datum &d2) {
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index a921f49e4b..4dd00417b8 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -176,6 +176,8 @@ public:
void printStack(const char *s);
Common::String decodeInstruction(int pc, int *newPC = NULL);
+ ScriptType event2script(LEvent ev);
+
void processEvent(LEvent event, int entityId);
void initBuiltIns();
diff --git a/engines/director/score.h b/engines/director/score.h
index 11f885d492..8ddbed0bd5 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -58,6 +58,7 @@ enum ScriptType {
kMovieScript = 0,
kSpriteScript = 1,
kFrameScript = 2,
+ kNoneScript = -1,
kMaxScriptType = 2
};