Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2008-07-22 20:44:35 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2008-07-22 20:44:35 +0400
commit1abe753bf0b05cd30785d2ccc6cca64026c2f893 (patch)
tree3029db980c675c6ebf5ab68aaa780a19971645e1 /source/gameengine/Ketsji
parent32d10bca2bd5e3abe853ca9b9d1c001886b28f84 (diff)
BGE patch: update KX_GameObject::getChildren() to use CListValue instead of python list (allows name search keep refcount consistent)
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index d40fa1e2446..185f456c83a 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -1306,18 +1306,18 @@ PyObject* KX_GameObject::PyRemoveParent(PyObject* self)
}
-static void walk_children(SG_Node* node, PyObject *list, bool recursive)
+static void walk_children(SG_Node* node, CListValue* list, bool recursive)
{
NodeList& children = node->GetSGChildren();
for (NodeList::iterator childit = children.begin();!(childit==children.end());++childit)
{
SG_Node* childnode = (*childit);
- KX_GameObject* childobj = (KX_GameObject*)childnode->GetSGClientObject();
+ CValue* childobj = (CValue*)childnode->GetSGClientObject();
if (childobj != NULL) // This is a GameObject
{
// add to the list
- PyList_Append(list, (PyObject *)childobj);
+ list->Add(childobj->AddRef());
}
// if the childobj is NULL then this may be an inverse parent link
@@ -1330,14 +1330,14 @@ static void walk_children(SG_Node* node, PyObject *list, bool recursive)
PyObject* KX_GameObject::PyGetChildren(PyObject* self)
{
- PyObject * list = PyList_New(0);
+ CListValue* list = new CListValue();
walk_children(m_pSGNode, list, 0);
return list;
}
PyObject* KX_GameObject::PyGetChildrenRecursive(PyObject* self)
{
- PyObject * list = PyList_New(0);
+ CListValue* list = new CListValue();
walk_children(m_pSGNode, list, 1);
return list;
}