aboutsummaryrefslogtreecommitdiff
path: root/engines/director/lingo/lingo-events.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/director/lingo/lingo-events.cpp')
-rw-r--r--engines/director/lingo/lingo-events.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index fe64b80e29..ab3b62aa50 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -34,9 +34,9 @@ struct EventHandlerType {
const char *name;
} static const eventHandlerDescs[] = {
{ kEventPrepareMovie, "prepareMovie" },
- { kEventStartMovie, "startMovie" }, // D3?
- { kEventStepMovie, "stepMovie" }, // D3?
- { kEventStopMovie, "stopMovie" }, // D3?
+ { kEventStartMovie, "startMovie" }, // D3
+ { kEventStepMovie, "stepMovie" }, // D3
+ { kEventStopMovie, "stopMovie" }, // D3
{ kEventNew, "newSprite" },
{ kEventBeginSprite, "beginSprite" },
@@ -44,7 +44,7 @@ struct EventHandlerType {
{ kEventEnterFrame, "enterFrame" }, // D4
{ kEventPrepareFrame, "prepareFrame" },
- { kEventIdle, "idle" },
+ { kEventIdle, "idle" }, // D3
{ kEventStepFrame, "stepFrame"},
{ kEventExitFrame, "exitFrame" }, // D4
@@ -58,8 +58,8 @@ struct EventHandlerType {
{ kEventKeyUp, "keyUp" }, // D4
{ kEventKeyDown, "keyDown" }, // D2 w D4 (as when from D2)
- { kEventMouseUp, "mouseUp" }, // D2 w D3?
- { kEventMouseDown, "mouseDown" }, // D2 w D3?
+ { kEventMouseUp, "mouseUp" }, // D2 w D3
+ { kEventMouseDown, "mouseDown" }, // D2 w D3
{ kEventRightMouseDown, "rightMouseDown" },
{ kEventRightMouseUp, "rightMouseUp" },
{ kEventMouseEnter, "mouseEnter" },
@@ -200,8 +200,9 @@ void Lingo::runMovieScript(LEvent event) {
if (_dontPassEvent)
return;
- for (uint i = 0; i < _scriptContexts[kMovieScript].size(); i++) {
- processEvent(event, kMovieScript, i);
+ for (ScriptContextHash::iterator it = _scriptContexts[kMovieScript].begin();
+ it != _scriptContexts[kMovieScript].end(); ++it) {
+ processEvent(event, kMovieScript, it->_key);
// TODO: How do know which script handles the message?
}
debugC(9, kDebugEvents, "STUB: processEvent(event, kMovieScript, ?)");
@@ -243,12 +244,13 @@ void Lingo::processFrameEvent(LEvent event) {
void Lingo::processGenericEvent(LEvent event) {
// Movie Script
int id = -1;
- if (event == kEventStart || event == kEventPrepareMovie)
+ if (event == kEventStart || event == kEventPrepareMovie ||
+ event == kEventStartMovie || event == kEventStopMovie)
id = 0;
else
- warning("STUB: processGenericEvent called for something else than kEventStart or kEventPrepareMovie, additional logic probably needed");
+ warning("STUB: processGenericEvent called for unprocessed event, additional logic probably needed");
- processEvent(event, kMovieScript, id);
+ runMovieScript(event);
}
void Lingo::processSpriteEvent(LEvent event) {