diff --git a/assets/scripts/root.toy b/assets/scripts/root.toy index 02eb4d6..f83756d 100644 --- a/assets/scripts/root.toy +++ b/assets/scripts/root.toy @@ -1,14 +1,14 @@ import standard; import engine; -fn makeChild(parent: opaque, fname: string, init: bool) { +fn _makeChild(parent: opaque, fname: string, init: bool) { var child: opaque = loadNode(fname); if (init) { - initNode(child); + child.initNode(); } - pushNode(parent, child); + parent.pushNode(child); } //root node can load the whole scene, and essentially act as the scene object @@ -16,12 +16,12 @@ fn onInit(node: opaque) { print "root.toy:onInit() called"; //make a child - makeChild(node, "assets/scripts/child.toy", true); //indicate whether to call "init" on the new node or not - makeChild(node, "assets/scripts/child.toy", false); - makeChild(node, "assets/scripts/child.toy", false); + node.makeChild("assets/scripts/child.toy", true); //indicate whether to call "init" on the new node or not + node.makeChild("assets/scripts/child.toy", false); + node.makeChild("assets/scripts/child.toy", false); //actually, grab that first node and free it - freeChildNode(node, 0); //must be done from the parent node, so it's pointer can be nullified + node.freeChildNode(0); //must be done from the parent node, so it's pointer can be nullified } fn onStep(node: opaque) { diff --git a/core/lib_engine.c b/core/lib_engine.c index b4608c9..3b351fe 100644 --- a/core/lib_engine.c +++ b/core/lib_engine.c @@ -421,11 +421,11 @@ int hookEngine(Interpreter* interpreter, Literal identifier, Literal alias) { {"initWindow", nativeInitWindow}, {"loadRootNode", nativeLoadRootNode}, {"loadNode", nativeLoadNode}, - {"initNode", nativeInitNode}, + {"_initNode", nativeInitNode}, // {"freeNode", nativeFreeNode}, - {"freeChildNode", nativeFreeChildNode}, - {"pushNode", nativePushNode}, - {"getNode", nativeGetNode}, + {"_freeChildNode", nativeFreeChildNode}, + {"_pushNode", nativePushNode}, + {"_getNode", nativeGetNode}, {NULL, NULL} };