mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-06 02:46:49 +00:00
DIRECTOR: Start executing frame scripts
This commit is contained in:
parent
b3e24c2518
commit
7e0899f5d4
@ -248,11 +248,31 @@ void Lingo::executeScript(ScriptType type, uint16 id) {
|
||||
cleanLocalVars();
|
||||
}
|
||||
|
||||
ScriptType Lingo::event2script(LEvent ev) {
|
||||
if (_vm->getVersion() < 4) {
|
||||
switch (ev) {
|
||||
//case kEventStartMovie: // We are precompiling it now
|
||||
// return kMovieScript;
|
||||
case kEventEnterFrame:
|
||||
return kFrameScript;
|
||||
default:
|
||||
return kNoneScript;
|
||||
}
|
||||
}
|
||||
|
||||
return kNoneScript;
|
||||
}
|
||||
|
||||
void Lingo::processEvent(LEvent event, int entityId) {
|
||||
if (!_eventHandlerTypes.contains(event))
|
||||
error("processEvent: Unknown event %d for entity %d", event, entityId);
|
||||
|
||||
debug(2, "STUB: processEvent(%s) for %d", _eventHandlerTypes[event], entityId);
|
||||
ScriptType st = event2script(event);
|
||||
|
||||
if (st != kNoneScript)
|
||||
executeScript(st, entityId + 1);
|
||||
else
|
||||
debug(2, "STUB: processEvent(%s) for %d", _eventHandlerTypes[event], entityId);
|
||||
}
|
||||
|
||||
int Lingo::alignTypes(Datum &d1, Datum &d2) {
|
||||
|
@ -176,6 +176,8 @@ public:
|
||||
void printStack(const char *s);
|
||||
Common::String decodeInstruction(int pc, int *newPC = NULL);
|
||||
|
||||
ScriptType event2script(LEvent ev);
|
||||
|
||||
void processEvent(LEvent event, int entityId);
|
||||
|
||||
void initBuiltIns();
|
||||
|
@ -58,6 +58,7 @@ enum ScriptType {
|
||||
kMovieScript = 0,
|
||||
kSpriteScript = 1,
|
||||
kFrameScript = 2,
|
||||
kNoneScript = -1,
|
||||
kMaxScriptType = 2
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user