From fe85bdd0401e92e82e39461d023bad34fe056c38 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 24 May 2009 23:43:10 +0000 Subject: - BGE Py API, any py function/attribute that took a KX_GameObject would not accept a KX_Light or KX_Camera (bad oversight on my part) - Typo in occlusion variable init "m_buffer == NULL;" -> "m_buffer = NULL;" CcdPhysicsEnvironment.cpp and CcdPhysicsController.cpp had too many warnings, fixed most of them. --- source/gameengine/Ketsji/KX_GameObject.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source/gameengine/Ketsji/KX_GameObject.cpp') diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 3740972ba29..f1c3fb89df2 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -49,6 +49,8 @@ typedef unsigned long uint_ptr; #include "RAS_IPolygonMaterial.h" #include "KX_BlenderMaterial.h" #include "KX_GameObject.h" +#include "KX_Camera.h" // only for their ::Type +#include "KX_Light.h" // only for their ::Type #include "RAS_MeshObject.h" #include "KX_MeshProxy.h" #include "KX_PolyProxy.h" @@ -2757,6 +2759,7 @@ void KX_GameObject::Relink(GEN_Map *map_parameter) } } + bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py_none_ok, const char *error_prefix) { if (value==NULL) { @@ -2787,7 +2790,10 @@ bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py } } - if (PyObject_TypeCheck(value, &KX_GameObject::Type)) { + if ( PyObject_TypeCheck(value, &KX_GameObject::Type) || + PyObject_TypeCheck(value, &KX_LightObject::Type) || + PyObject_TypeCheck(value, &KX_Camera::Type) ) + { *object = static_castBGE_PROXY_REF(value); /* sets the error */ -- cgit v1.2.3