diff options
author | Eugene Sandulenko | 2016-08-25 17:45:44 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-25 18:16:15 +0200 |
commit | 7e0899f5d4d3876da5aa9a6b724c16e2e08f257b (patch) | |
tree | ce8ece440eeda8e2d5eb45f09615bc63f3e2b9a8 /engines | |
parent | b3e24c25184e5594e461f452c23a0d173f1168e8 (diff) | |
download | scummvm-rg350-7e0899f5d4d3876da5aa9a6b724c16e2e08f257b.tar.gz scummvm-rg350-7e0899f5d4d3876da5aa9a6b724c16e2e08f257b.tar.bz2 scummvm-rg350-7e0899f5d4d3876da5aa9a6b724c16e2e08f257b.zip |
DIRECTOR: Start executing frame scripts
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/lingo/lingo.cpp | 22 | ||||
-rw-r--r-- | engines/director/lingo/lingo.h | 2 | ||||
-rw-r--r-- | engines/director/score.h | 1 |
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 }; |