From f54d3412423c298afc47d7885b529606320d4e29 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Wed, 14 Jan 2015 21:49:04 +0100 Subject: [PATCH] Allow obj_addChild() to specify front or back order --- Aquaria/ScriptInterface.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Aquaria/ScriptInterface.cpp b/Aquaria/ScriptInterface.cpp index 4d6a5fa..965379a 100644 --- a/Aquaria/ScriptInterface.cpp +++ b/Aquaria/ScriptInterface.cpp @@ -1181,6 +1181,7 @@ luaFunc(obj_addChild) RenderObject *r = robj(L); RenderObject *which = robj(L, 2); bool takeOwnership = getBool(L, 3); + bool front = getBool(L, 4); if (r && which) { if (takeOwnership) @@ -1190,7 +1191,7 @@ luaFunc(obj_addChild) dsq->getState(dsq->game->name)->removeRenderObjectFromList(which); which->setStateDataObject(NULL); core->removeRenderObject(which, Core::DO_NOT_DESTROY_RENDER_OBJECT); - r->addChild(which, PM_POINTER); + r->addChild(which, PM_POINTER, RBP_NONE, front ? CHILD_FRONT : CHILD_BACK); } else r->addChild(which, PM_STATIC);