aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2017-03-20 19:35:29 +0100
committerEugene Sandulenko2017-03-20 19:55:34 +0100
commitccc6cbfb9106d17777422aa4b3c10d19d5330328 (patch)
tree6f78e43c072cf8aaf9b2bfafb44b0e0cc0fed47a
parent7843e12cad82f9a70a82f80b1104893fcffdc7ad (diff)
downloadscummvm-rg350-ccc6cbfb9106d17777422aa4b3c10d19d5330328.tar.gz
scummvm-rg350-ccc6cbfb9106d17777422aa4b3c10d19d5330328.tar.bz2
scummvm-rg350-ccc6cbfb9106d17777422aa4b3c10d19d5330328.zip
DIRECTOR: Fix event processing for generic events
-rw-r--r--engines/director/events.cpp8
-rw-r--r--engines/director/lingo/lingo.cpp4
-rw-r--r--engines/director/score.cpp1
3 files changed, 7 insertions, 6 deletions
diff --git a/engines/director/events.cpp b/engines/director/events.cpp
index e60af2244b..5021018dc1 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -88,14 +88,14 @@ void DirectorEngine::processEvents() {
if (getVersion() > 3) {
// TODO: check that this is the order of script execution!
- _lingo->processEvent(kEventMouseUp, kCastScript, currentFrame->_sprites[spriteId]->_castId);
- _lingo->processEvent(kEventMouseUp, kSpriteScript, currentFrame->_sprites[spriteId]->_scriptId);
+ _lingo->processEvent(kEventNone, kCastScript, currentFrame->_sprites[spriteId]->_castId);
+ _lingo->processEvent(kEventNone, kSpriteScript, currentFrame->_sprites[spriteId]->_scriptId);
} else {
// Frame script overrides sprite script
if (!currentFrame->_sprites[spriteId]->_scriptId)
- _lingo->processEvent(kEventMouseUp, kSpriteScript, currentFrame->_sprites[spriteId]->_castId + 1024);
+ _lingo->processEvent(kEventNone, kSpriteScript, currentFrame->_sprites[spriteId]->_castId + 1024);
else
- _lingo->processEvent(kEventMouseUp, kFrameScript, currentFrame->_sprites[spriteId]->_scriptId);
+ _lingo->processEvent(kEventNone, kFrameScript, currentFrame->_sprites[spriteId]->_scriptId);
}
sc->_currentMouseDownSpriteId = 0;
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index a51ff222c7..482531d455 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -309,12 +309,12 @@ void Lingo::processEvent(LEvent event, ScriptType st, int entityId) {
if (_handlers.contains(ENTITY_INDEX(event, entityId))) {
debugC(1, kDebugEvents, "Lingo::processEvent(%s, %s, %d), _eventHandler", _eventHandlerTypes[event], scriptType2str(st), entityId);
call(_eventHandlerTypes[event], 0); // D4+ Events
- } else if (_scripts[st].contains(entityId)) {
+ } else if (event == kEventNone && _scripts[st].contains(entityId)) {
debugC(1, kDebugEvents, "Lingo::processEvent(%s, %s, %d), script", _eventHandlerTypes[event], scriptType2str(st), entityId);
executeScript(st, entityId); // D3 list of scripts.
} else {
- debugC(3, kDebugLingoExec, "STUB: processEvent(%s) for %d", _eventHandlerTypes[event], entityId);
+ //debugC(3, kDebugLingoExec, "STUB: processEvent(%s) for %d", _eventHandlerTypes[event], entityId);
}
}
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 4f19ba78f9..c744a91299 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -1093,6 +1093,7 @@ void Score::update() {
// Enter and exit from previous frame (Director 4)
_lingo->processEvent(kEventEnterFrame, kFrameScript, _frames[_currentFrame]->_actionId);
+ _lingo->processEvent(kEventNone, kFrameScript, _frames[_currentFrame]->_actionId);
// TODO Director 6 - another order
// TODO Director 6 step: send beginSprite event to any sprites whose span begin in the upcoming frame