From 890122475f1277c4ebea6a39721fcd8a2b5f5087 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 15 Mar 2017 20:25:33 +0000 Subject: DIRECTOR: Improvements to the event sequence --- engines/director/events.cpp | 7 +++---- engines/director/score.cpp | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/director') diff --git a/engines/director/events.cpp b/engines/director/events.cpp index 32fe58859e..cb9e1773ec 100644 --- a/engines/director/events.cpp +++ b/engines/director/events.cpp @@ -49,10 +49,6 @@ void DirectorEngine::processEvents() { Frame *currentFrame = sc->_frames[sc->getCurrentFrame()]; uint16 spriteId = 0; - // TODO: re-instate when we know which script to run. - //if (currentFrame > 0) - // _lingo->processEvent(kEventIdle, currentFrame - 1); - Common::Point pos; while (g_system->getMillis() < endTime) { @@ -131,6 +127,9 @@ void DirectorEngine::processEvents() { g_system->updateScreen(); g_system->delayMillis(10); + + if (currentFrame > 0) + _lingo->processEvent(kEventIdle, kFrameScript, sc->getCurrentFrame()); } } diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 97152f818c..14ab831d16 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -1065,7 +1065,6 @@ void Score::update() { // Enter and exit from previous frame (Director 4) _lingo->processEvent(kEventEnterFrame, kFrameScript, _frames[_currentFrame]->_actionId); - _lingo->processEvent(kEventExitFrame, 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 @@ -1133,6 +1132,8 @@ void Score::update() { } } + _lingo->processEvent(kEventExitFrame, kFrameScript, _frames[_currentFrame]->_actionId); + _nextFrameTime = g_system->getMillis() + (float)_currentFrameRate / 60 * 1000; } -- cgit v1.2.3