aboutsummaryrefslogtreecommitdiff
path: root/engines/macventure/world.cpp
diff options
context:
space:
mode:
authorBorja Lorente2016-06-18 00:27:35 +0200
committerBorja Lorente2016-08-14 18:28:47 +0200
commit9b052d0a973971a50b4f0df918489e0fc6dd9fdb (patch)
tree08fab6eb09c8799ef5cf636f4a88d2ff7d511a24 /engines/macventure/world.cpp
parente8725ae068a51fb6ccdfd9f7d2bd4e8e7a12f40a (diff)
downloadscummvm-rg350-9b052d0a973971a50b4f0df918489e0fc6dd9fdb.tar.gz
scummvm-rg350-9b052d0a973971a50b4f0df918489e0fc6dd9fdb.tar.bz2
scummvm-rg350-9b052d0a973971a50b4f0df918489e0fc6dd9fdb.zip
MACVENTURE: Add untested script engine
Diffstat (limited to 'engines/macventure/world.cpp')
-rw-r--r--engines/macventure/world.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/engines/macventure/world.cpp b/engines/macventure/world.cpp
index feb8c0b7be..2cd50ff82a 100644
--- a/engines/macventure/world.cpp
+++ b/engines/macventure/world.cpp
@@ -1,4 +1,5 @@
#include "macventure/world.h"
+#include "macventure/macventure.h"
#include "common/file.h"
@@ -82,6 +83,25 @@ bool MacVenture::World::isObjActive(ObjID obj) {
return false;
}
+Common::Array<ObjID> World::getFamily(ObjID objID, bool recursive) {
+ Common::Array<ObjID> res;
+ res.push_back(objID);
+ res.push_back(getChildren(objID, recursive));
+ return res;
+}
+
+Common::Array<ObjID> World::getChildren(ObjID objID, bool recursive) {
+ Common::Array<ObjID> res;
+ ObjID child = _relations[objID * 2];
+ while (child) {
+ res.push_back(child);
+ if (!recursive)
+ res.push_back(getChildren(child, false));
+ child = _relations[child * 2 + 1];
+ }
+ return Common::Array<ObjID>();
+}
+
bool World::loadStartGameFileName() {
Common::SeekableReadStream *res;