aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2017-03-14 09:25:45 +0100
committerEugene Sandulenko2017-03-14 09:26:20 +0100
commit6ce4f58f891b25f266143176ab4d252bb2e650f8 (patch)
tree938a8ae6a7cb6d400ad62938c9058abacd6dd42d
parentf981e228c15e88a0be1d9f4df068be6de5fde43c (diff)
downloadscummvm-rg350-6ce4f58f891b25f266143176ab4d252bb2e650f8.tar.gz
scummvm-rg350-6ce4f58f891b25f266143176ab4d252bb2e650f8.tar.bz2
scummvm-rg350-6ce4f58f891b25f266143176ab4d252bb2e650f8.zip
DIRECTOR: Execute immediate scripts on frame load
-rw-r--r--engines/director/events.cpp4
-rw-r--r--engines/director/frame.cpp9
-rw-r--r--engines/director/frame.h1
-rw-r--r--engines/director/score.cpp2
4 files changed, 16 insertions, 0 deletions
diff --git a/engines/director/events.cpp b/engines/director/events.cpp
index 9030fee881..32fe58859e 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -75,6 +75,10 @@ void DirectorEngine::processEvents() {
_lingo->processEvent(kEventMouseDown, kCastScript, currentFrame->_sprites[spriteId]->_castId);
_lingo->processEvent(kEventMouseDown, kSpriteScript, currentFrame->_sprites[spriteId]->_scriptId);
}
+
+ if (currentFrame->_sprites[spriteId]->_moveable) {
+ warning("Moveable");
+ }
break;
case Common::EVENT_LBUTTONUP:
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index f19c3221ab..cceecdd579 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -36,6 +36,7 @@
#include "director/score.h"
#include "director/sprite.h"
#include "director/util.h"
+#include "director/lingo/lingo.h"
namespace Director {
@@ -539,6 +540,14 @@ void Frame::playTransition(Score *score) {
}
}
+void Frame::executeImmediateScripts() {
+ for (uint16 i = 0; i < CHANNEL_COUNT; i++) {
+ if (_vm->getCurrentScore()->_immediateActions.contains(_sprites[i]->_scriptId)) {
+ g_lingo->processEvent(kEventMouseUp, kFrameScript, _sprites[i]->_scriptId);
+ }
+ }
+}
+
void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) {
for (uint16 i = 0; i < CHANNEL_COUNT; i++) {
if (_sprites[i]->_enabled) {
diff --git a/engines/director/frame.h b/engines/director/frame.h
index 575d6fdbdd..e2a4a1f37b 100644
--- a/engines/director/frame.h
+++ b/engines/director/frame.h
@@ -121,6 +121,7 @@ public:
uint16 getSpriteIDFromPos(Common::Point pos);
bool checkSpriteIntersection(uint16 spriteId, Common::Point pos);
+ void executeImmediateScripts();
private:
void playTransition(Score *score);
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 4fc946d5c5..97152f818c 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -1061,6 +1061,8 @@ void Score::update() {
_surface->clear();
_surface->copyFrom(*_trailSurface);
+ _frames[_currentFrame]->executeImmediateScripts();
+
// Enter and exit from previous frame (Director 4)
_lingo->processEvent(kEventEnterFrame, kFrameScript, _frames[_currentFrame]->_actionId);
_lingo->processEvent(kEventExitFrame, kFrameScript, _frames[_currentFrame]->_actionId);