aboutsummaryrefslogtreecommitdiff
path: root/engines/director/lingo
diff options
context:
space:
mode:
authorstevenhoefel2017-01-12 14:08:53 +1100
committerstevenhoefel2017-01-12 14:08:53 +1100
commit1e47d4a13c591b35ebee848aeb9e7cfc41a8b67f (patch)
tree92fc1f5e41486b96a217949a7f4522f53fc3fd98 /engines/director/lingo
parent6cea9c4382e8f628415bb626b12cbdd09ca7ba1a (diff)
downloadscummvm-rg350-1e47d4a13c591b35ebee848aeb9e7cfc41a8b67f.tar.gz
scummvm-rg350-1e47d4a13c591b35ebee848aeb9e7cfc41a8b67f.tar.bz2
scummvm-rg350-1e47d4a13c591b35ebee848aeb9e7cfc41a8b67f.zip
DIRECTOR: D3 frame/sprite scripts. Categorise scripts into groups.
Diffstat (limited to 'engines/director/lingo')
-rw-r--r--engines/director/lingo/lingo.cpp14
-rw-r--r--engines/director/lingo/lingo.h2
2 files changed, 7 insertions, 9 deletions
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index 1fd4a43c3b..e6b4e11d49 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -282,8 +282,8 @@ Symbol *Lingo::getHandler(Common::String &name) {
return _handlers[entityIndex];
}
-void Lingo::processEvent(LEvent event, int entityId) {
- if (entityId <= 0)
+void Lingo::processEvent(LEvent event, ScriptType st, int entityId) {
+ if (entityId <= 0)
return;
_currentEntityId = entityId;
@@ -291,13 +291,11 @@ void Lingo::processEvent(LEvent event, int entityId) {
if (!_eventHandlerTypes.contains(event))
error("processEvent: Unknown event %d for entity %d", event, entityId);
- ScriptType st = event2script(event);
-
- if (st != kNoneScript) {
- executeScript(st, entityId + 1);
- } else if (_handlers.contains(ENTITY_INDEX(event, entityId))) {
- call(_eventHandlerTypes[event], 0);
+ if (_handlers.contains(ENTITY_INDEX(event, entityId))) {
+ call(_eventHandlerTypes[event], 0); //D4+ Events
pop();
+ } else if (_scripts[st].contains(entityId)) {
+ executeScript(st, entityId + 1); //D3 list of scripts.
} else {
debugC(8, kDebugLingoExec, "STUB: processEvent(%s) for %d", _eventHandlerTypes[event], entityId);
}
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index 41d0444a32..dc796d7760 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -181,7 +181,7 @@ public:
ScriptType event2script(LEvent ev);
Symbol *getHandler(Common::String &name);
- void processEvent(LEvent event, int entityId);
+ void processEvent(LEvent event, ScriptType st, int entityId);
void initBuiltIns();
void initFuncs();