Skip to content
Permalink
Browse files

DIRECTOR: Fix event processing for generic events

  • Loading branch information
sev- committed Mar 20, 2017
1 parent 7843e12 commit ccc6cbfb9106d17777422aa4b3c10d19d5330328
Showing with 7 additions and 6 deletions.
  1. +4 −4 engines/director/events.cpp
  2. +2 −2 engines/director/lingo/lingo.cpp
  3. +1 −0 engines/director/score.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;
@@ -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);
}
}

@@ -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

0 comments on commit ccc6cbf

Please sign in to comment.
You can’t perform that action at this time.