[Scummvm-git-logs] scummvm master -> 75058809aab438e42dc56a3d4f95e1b8bd140d32
djsrv
dservilla at gmail.com
Mon Jun 29 16:51:58 UTC 2020
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
b43e1fdb13 DIRECTOR: LINGO: Add 2-3 event delegation
dfc06bbe21 DIRECTOR: LINGO: Add version checks for more events
75058809aa DIRECTOR: LINGO: Remove kEventStart
Commit: b43e1fdb13a5441b1b2ead7430dc9b59e5de4663
https://github.com/scummvm/scummvm/commit/b43e1fdb13a5441b1b2ead7430dc9b59e5de4663
Author: djsrv (dservilla at gmail.com)
Date: 2020-06-29T12:48:40-04:00
Commit Message:
DIRECTOR: LINGO: Add 2-3 event delegation
Changed paths:
engines/director/lingo/lingo-events.cpp
diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index fe0f4d6f07..88db8146bf 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -236,41 +236,66 @@ void Lingo::registerEvent(LEvent event, int spriteId) {
break;
}
- /* Now queue any objects that responds to this event, in order of precedence.
- * (Sprite -> Cast Member -> Frame -> Movie)
- * Once one of these objects handles the event, any event handlers queued
- * for the same event will be ignored unless the pass command was called.
- */
- switch (event) {
- case kEventKeyUp:
- case kEventKeyDown:
- case kEventMouseUp:
- case kEventMouseDown:
- case kEventBeginSprite:
- if (spriteId) {
- queueSpriteEvent(event, eventId, spriteId);
+ if (_vm->getVersion() <= 3) {
+ // In D2-3, specific objects handle each event, with no passing
+ switch(event) {
+ case kEventMouseUp:
+ case kEventMouseDown:
+ if (spriteId) {
+ queueSpriteEvent(event, eventId, spriteId);
+ }
+ break;
+
+ case kEventEnterFrame:
+ queueFrameEvent(event, eventId);
+ break;
+
+ case kEventIdle:
+ case kEventStartUp:
+ case kEventStartMovie:
+ case kEventStepMovie:
+ case kEventStopMovie:
+ queueMovieEvent(event, eventId);
+ break;
+
+ default:
+ warning("registerEvent: Unhandled event %s", _eventHandlerTypes[event]);
}
- // fall through
-
- case kEventIdle:
- case kEventEnterFrame:
- case kEventExitFrame:
- case kEventNone:
- queueFrameEvent(event, eventId);
- // fall through
-
- case kEventStart:
- case kEventStartUp:
- case kEventStartMovie:
- case kEventStepMovie:
- case kEventStopMovie:
- case kEventTimeout:
- case kEventPrepareMovie:
- queueMovieEvent(event, eventId);
- break;
+ } else {
+ /* In D4+, queue any objects that responds to this event, in order of precedence.
+ * (Sprite -> Cast Member -> Frame -> Movie)
+ * Once one of these objects handles the event, any event handlers queued
+ * for the same event will be ignored unless the pass command was called.
+ */
+ switch (event) {
+ case kEventKeyUp:
+ case kEventKeyDown:
+ case kEventMouseUp:
+ case kEventMouseDown:
+ case kEventBeginSprite:
+ if (spriteId) {
+ queueSpriteEvent(event, eventId, spriteId);
+ }
+ // fall through
- default:
- warning("registerEvent: Unhandled event %s", _eventHandlerTypes[event]);
+ case kEventIdle:
+ case kEventEnterFrame:
+ case kEventExitFrame:
+ queueFrameEvent(event, eventId);
+ // fall through
+
+ case kEventStart:
+ case kEventStartUp:
+ case kEventStartMovie:
+ case kEventStopMovie:
+ case kEventTimeout:
+ case kEventPrepareMovie:
+ queueMovieEvent(event, eventId);
+ break;
+
+ default:
+ warning("registerEvent: Unhandled event %s", _eventHandlerTypes[event]);
+ }
}
if (oldQueueSize == _eventQueue.size()) {
Commit: dfc06bbe21b2e3c37670e22244f2aaede985ba3f
https://github.com/scummvm/scummvm/commit/dfc06bbe21b2e3c37670e22244f2aaede985ba3f
Author: djsrv (dservilla at gmail.com)
Date: 2020-06-29T12:50:37-04:00
Commit Message:
DIRECTOR: LINGO: Add version checks for more events
Changed paths:
engines/director/events.cpp
engines/director/score.cpp
diff --git a/engines/director/events.cpp b/engines/director/events.cpp
index b4783f1782..2aa69ffa99 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -161,7 +161,7 @@ void DirectorEngine::processEvents(bool bufferLingoEvents) {
g_system->updateScreen();
g_system->delayMillis(10);
- if (sc->getCurrentFrame() > 0 && !sc->_stopPlay && _lingo->getEventCount() == 0)
+ if (getVersion() >= 3 && sc->getCurrentFrame() > 0 && !sc->_stopPlay && _lingo->getEventCount() == 0)
_lingo->registerEvent(kEventIdle);
if (!bufferLingoEvents)
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index d0d7557742..dba19a86bc 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -385,7 +385,8 @@ void Score::startLoop() {
for (uint i = 0; i < _frames[1]->_sprites.size(); i++)
_channels.push_back(new Channel(_frames[1]->_sprites[i]));
- _lingo->processEvent(kEventStartMovie);
+ if (_vm->getVersion() >= 3)
+ _lingo->processEvent(kEventStartMovie);
_maskSurface->clear(1);
while (!_stopPlay) {
@@ -416,7 +417,8 @@ void Score::startLoop() {
screenShot();
}
- _lingo->processEvent(kEventStopMovie);
+ if (_vm->getVersion() >= 3)
+ _lingo->processEvent(kEventStopMovie);
_lingo->executePerFrameHook(-1, 0);
}
@@ -441,10 +443,12 @@ void Score::update() {
// of _nextFrame so it doesn't get wiped.
if (_vm->_skipFrameAdvance) {
uint16 nextFrameCache = _nextFrame;
- _lingo->processEvent(kEventExitFrame);
+ if (_vm->getVersion() >= 4)
+ _lingo->processEvent(kEventExitFrame);
_nextFrame = nextFrameCache;
} else {
- _lingo->processEvent(kEventExitFrame);
+ if (_vm->getVersion() >= 4)
+ _lingo->processEvent(kEventExitFrame);
}
// If there is a transition, the perFrameHook is called
Commit: 75058809aab438e42dc56a3d4f95e1b8bd140d32
https://github.com/scummvm/scummvm/commit/75058809aab438e42dc56a3d4f95e1b8bd140d32
Author: djsrv (dservilla at gmail.com)
Date: 2020-06-29T12:50:46-04:00
Commit Message:
DIRECTOR: LINGO: Remove kEventStart
Changed paths:
engines/director/lingo/lingo-events.cpp
engines/director/resource.cpp
engines/director/types.h
diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index 88db8146bf..b5d0546320 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -54,7 +54,6 @@ struct EventHandlerType {
{ kEventResizeWindow, "resizeWindow" },
{ kEventOpenWindow, "openWindow" },
{ kEventCloseWindow, "closeWindow" },
- { kEventStart, "start" },
{ kEventKeyUp, "keyUp" }, // D4
{ kEventKeyDown, "keyDown" }, // D2 w D4 (as when from D2)
@@ -284,7 +283,6 @@ void Lingo::registerEvent(LEvent event, int spriteId) {
queueFrameEvent(event, eventId);
// fall through
- case kEventStart:
case kEventStartUp:
case kEventStartMovie:
case kEventStopMovie:
diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index fc84f2e6a3..dbe3cee44d 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -91,8 +91,6 @@ void DirectorEngine::loadEXE(const Common::String movie) {
if (!exeStream)
error("Failed to open EXE '%s'", getEXEName().c_str());
- _lingo->processEvent(kEventStart);
-
uint32 initialTag = exeStream->readUint32LE();
if (initialTag == MKTAG('R', 'I', 'F', 'X') || initialTag == MKTAG('X', 'F', 'I', 'R')) {
// we've encountered a movie saved from Director, not a projector.
diff --git a/engines/director/types.h b/engines/director/types.h
index aa0bd8a901..278954f2d4 100644
--- a/engines/director/types.h
+++ b/engines/director/types.h
@@ -196,7 +196,6 @@ enum LEvent {
kEventMouseUpOutSide,
kEventMouseWithin,
- kEventStart,
kEventStartUp
};
More information about the Scummvm-git-logs
mailing list