[Scummvm-git-logs] scummvm master -> f8a52eacc2c88c0758662456a012e17fe77f8ca0
elasota
noreply at scummvm.org
Sat Jul 2 18:22:25 UTC 2022
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:
f8a52eacc2 MTROPOLIS: Implement subsection attribute
Commit: f8a52eacc2c88c0758662456a012e17fe77f8ca0
https://github.com/scummvm/scummvm/commit/f8a52eacc2c88c0758662456a012e17fe77f8ca0
Author: elasota (ejlasota at gmail.com)
Date: 2022-07-02T14:21:56-04:00
Commit Message:
MTROPOLIS: Implement subsection attribute
Changed paths:
engines/mtropolis/runtime.cpp
diff --git a/engines/mtropolis/runtime.cpp b/engines/mtropolis/runtime.cpp
index 305dc51ae23..aaa8fca432f 100644
--- a/engines/mtropolis/runtime.cpp
+++ b/engines/mtropolis/runtime.cpp
@@ -2641,15 +2641,46 @@ bool Structural::readAttribute(MiniscriptThread *thread, DynamicValue &result, c
Structural *parent = static_cast<Structural *>(possibleScene)->getParent();
if (parent->isSubsection())
break;
- else
+ else {
possibleScene = parent;
+ continue;
+ }
}
+
+ assert(false);
+ break;
}
if (possibleScene)
result.setObject(possibleScene->getSelfReference());
else
result.clear();
return true;
+ } else if (attrib == "subsection") {
+ result.clear();
+
+ RuntimeObject *possibleSubsection = this;
+ while (possibleSubsection) {
+ if (possibleSubsection->isSubsection())
+ break;
+
+ if (possibleSubsection->isModifier()) {
+ possibleSubsection = static_cast<Modifier *>(possibleSubsection)->getParent().lock().get();
+ continue;
+ }
+
+ if (possibleSubsection->isStructural()) {
+ possibleSubsection = static_cast<Structural *>(possibleSubsection)->getParent();
+ continue;
+ }
+
+ assert(false);
+ break;
+ }
+ if (possibleSubsection)
+ result.setObject(possibleSubsection->getSelfReference());
+ else
+ result.clear();
+ return true;
}
// Traverse children (modifiers must be first)
More information about the Scummvm-git-logs
mailing list