[Scummvm-git-logs] scummvm master -> ac3e2eab27e27c7a73eb9b8be2f7f5b24a55f1dd
sev-
noreply at scummvm.org
Wed Jun 7 23:21:16 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ac3e2eab27 DIRECTOR: Enable mAtFrame hook for future director versions
Commit: ac3e2eab27e27c7a73eb9b8be2f7f5b24a55f1dd
https://github.com/scummvm/scummvm/commit/ac3e2eab27e27c7a73eb9b8be2f7f5b24a55f1dd
Author: Harishankar Kumar (hari01584 at gmail.com)
Date: 2023-06-08T01:21:09+02:00
Commit Message:
DIRECTOR: Enable mAtFrame hook for future director versions
Starting D4, actorList is implemented and all the documentation
points to the use of it, however with testing it has been found
that the support for mAtFrame is never removed, both of these
can be used in parallel, hence adding support for mAtFrame hook
in future director versions.
`Hierarchical Bird` of 'theapartment4' which is built for director 4
uses legacy mAtFrame hook.
Changed paths:
engines/director/lingo/lingo.cpp
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index d25ed674633..3839f2bd668 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -1412,27 +1412,32 @@ void Lingo::executeImmediateScripts(Frame *frame) {
}
void Lingo::executePerFrameHook(int frame, int subframe) {
- if (_vm->getVersion() < 400) {
- if (_perFrameHook.type == OBJECT) {
- Symbol method = _perFrameHook.u.obj->getMethod("mAtFrame");
- if (method.type != VOIDSYM) {
- debugC(1, kDebugLingoExec, "Executing perFrameHook : <%s>(mAtFrame, %d, %d)", _perFrameHook.asString(true).c_str(), frame, subframe);
- push(_perFrameHook);
- push(frame);
- push(subframe);
- LC::call(method, 3, false);
+ // Execute perFrameHook and actorList stepFrame, if any is available
+ // Starting D4, stepFrame of each objects in actorList is executed
+ // however the support for legacy mAtFrame is still there. (in future versions)
+ if (_perFrameHook.type == OBJECT) {
+ Symbol method = _perFrameHook.u.obj->getMethod("mAtFrame");
+ if (method.type != VOIDSYM) {
+ debugC(1, kDebugLingoExec, "Executing perFrameHook : <%s>(mAtFrame, %d, %d)", _perFrameHook.asString(true).c_str(), frame, subframe);
+ push(_perFrameHook);
+ push(frame);
+ push(subframe);
+ LC::call(method, 3, false);
+ execute();
+ }
+ }
+
+ if (_vm->getVersion() >= 400) {
+ if (_actorList.u.farr->arr.size() > 0 && _vm->getVersion() >= 400) {
+ for (uint i = 0; i < _actorList.u.farr->arr.size(); i++) {
+ Datum actor = _actorList.u.farr->arr[i];
+ Symbol method = actor.u.obj->getMethod("stepFrame");
+ if (method.nargs == 1)
+ push(actor);
+ LC::call(method, method.nargs, false);
execute();
}
}
- } else if (_actorList.u.farr->arr.size() > 0) {
- for (uint i = 0; i < _actorList.u.farr->arr.size(); i++) {
- Datum actor = _actorList.u.farr->arr[i];
- Symbol method = actor.u.obj->getMethod("stepFrame");
- if (method.nargs == 1)
- push(actor);
- LC::call(method, method.nargs, false);
- execute();
- }
}
}
More information about the Scummvm-git-logs
mailing list