1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-15 14:09:06 +00:00

Allow obj_addChild() to specify front or back order

This commit is contained in:
fgenesis 2015-01-14 21:49:04 +01:00
parent 4b32c4364f
commit f54d341242

View file

@ -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);