From 6b9f3b5f5c8d918585e01461a6202ae3df2df621 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 28 Jun 2009 11:22:26 +0000 Subject: BGE Python API Remove the last of the odd C++/python wrapper code from http://www.python.org/doc/PyCPP.html (~1998) * Use python subclasses rather then having fake subclassing through get/set attributes calling parent types. * PyObject getset arrays are created while initializing the types, converted from our own attribute arrays. This way python deals with subclasses and we dont have to define getattro or setattro functions for each type. * GameObjects and Scenes no longer have attribute access to properties. only dictionary style access - ob['prop'] * remove each class's get/set/dir functions. * remove isA() methods, can use PyObject_TypeCheck() in C and issubclass() in python. * remove Parents[] array for each C++ class, was only used for isA() and wasnt correct in quite a few cases. * remove PyTypeObject that was being passed as the last argument to each class (the parent classes too). TODO - * Light and VertexProxy need to be converted to using attributes. * memory for getset arrays is never freed, not that bad since its will only allocates once. --- source/gameengine/Ketsji/KX_Light.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'source/gameengine/Ketsji/KX_Light.h') diff --git a/source/gameengine/Ketsji/KX_Light.h b/source/gameengine/Ketsji/KX_Light.h index 358c705080a..0b7ccbe81ab 100644 --- a/source/gameengine/Ketsji/KX_Light.h +++ b/source/gameengine/Ketsji/KX_Light.h @@ -49,7 +49,7 @@ protected: Scene* m_blenderscene; public: - KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks,class RAS_IRenderTools* rendertools,const struct RAS_LightObject& lightobj, bool glsl, PyTypeObject *T = &Type); + KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks,class RAS_IRenderTools* rendertools,const struct RAS_LightObject& lightobj, bool glsl); virtual ~KX_LightObject(); virtual CValue* GetReplica(); RAS_LightObject* GetLightData() { return &m_lightobj;} @@ -64,10 +64,6 @@ public: void BindShadowBuffer(class RAS_IRasterizer *ras, class KX_Camera *cam, class MT_Transform& camtrans); void UnbindShadowBuffer(class RAS_IRasterizer *ras); void Update(); - - virtual PyObject* py_getattro(PyObject *attr); /* lens, near, far, projection_matrix */ - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *pyvalue); /* attributes */ static PyObject* pyattr_get_color(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); -- cgit v1.2.3