BGE Python API cleanup - no functionality changes
authorCampbell Barton <ideasman42@gmail.com>
Sun, 19 Apr 2009 14:57:52 +0000 (14:57 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 19 Apr 2009 14:57:52 +0000 (14:57 +0000)
- comments to PyObjectPlus.h
- remove unused/commented junk.
- renamed PyDestructor to py_base_dealloc for consistency
- all the PyTypeObject's were still using the sizeof() their class, can use sizeof(PyObjectPlus_Proxy) now which is smaller too.

63 files changed:
source/gameengine/Converter/BL_ActionActuator.cpp
source/gameengine/Converter/BL_ShapeActionActuator.cpp
source/gameengine/Expressions/ListValue.cpp
source/gameengine/Expressions/PyObjectPlus.cpp
source/gameengine/Expressions/PyObjectPlus.h
source/gameengine/Expressions/Value.cpp
source/gameengine/GameLogic/SCA_2DFilterActuator.cpp
source/gameengine/GameLogic/SCA_ANDController.cpp
source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
source/gameengine/GameLogic/SCA_AlwaysSensor.cpp
source/gameengine/GameLogic/SCA_DelaySensor.cpp
source/gameengine/GameLogic/SCA_ILogicBrick.cpp
source/gameengine/GameLogic/SCA_IObject.cpp
source/gameengine/GameLogic/SCA_ISensor.cpp
source/gameengine/GameLogic/SCA_JoystickSensor.cpp
source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
source/gameengine/GameLogic/SCA_MouseSensor.cpp
source/gameengine/GameLogic/SCA_NANDController.cpp
source/gameengine/GameLogic/SCA_NORController.cpp
source/gameengine/GameLogic/SCA_ORController.cpp
source/gameengine/GameLogic/SCA_PropertyActuator.cpp
source/gameengine/GameLogic/SCA_PropertySensor.cpp
source/gameengine/GameLogic/SCA_PythonController.cpp
source/gameengine/GameLogic/SCA_RandomActuator.cpp
source/gameengine/GameLogic/SCA_RandomSensor.cpp
source/gameengine/GameLogic/SCA_XNORController.cpp
source/gameengine/GameLogic/SCA_XORController.cpp
source/gameengine/Ketsji/BL_Shader.cpp
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp
source/gameengine/Ketsji/KX_BlenderMaterial.cpp
source/gameengine/Ketsji/KX_CDActuator.cpp
source/gameengine/Ketsji/KX_Camera.cpp
source/gameengine/Ketsji/KX_CameraActuator.cpp
source/gameengine/Ketsji/KX_ConstraintActuator.cpp
source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
source/gameengine/Ketsji/KX_GameActuator.cpp
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_IpoActuator.cpp
source/gameengine/Ketsji/KX_Light.cpp
source/gameengine/Ketsji/KX_MeshProxy.cpp
source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
source/gameengine/Ketsji/KX_NearSensor.cpp
source/gameengine/Ketsji/KX_ObjectActuator.cpp
source/gameengine/Ketsji/KX_ParentActuator.cpp
source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp
source/gameengine/Ketsji/KX_PolyProxy.cpp
source/gameengine/Ketsji/KX_PolygonMaterial.cpp
source/gameengine/Ketsji/KX_RadarSensor.cpp
source/gameengine/Ketsji/KX_RaySensor.cpp
source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp
source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp
source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
source/gameengine/Ketsji/KX_Scene.cpp
source/gameengine/Ketsji/KX_SceneActuator.cpp
source/gameengine/Ketsji/KX_SoundActuator.cpp
source/gameengine/Ketsji/KX_StateActuator.cpp
source/gameengine/Ketsji/KX_TouchSensor.cpp
source/gameengine/Ketsji/KX_TrackToActuator.cpp
source/gameengine/Ketsji/KX_VehicleWrapper.cpp
source/gameengine/Ketsji/KX_VertexProxy.cpp
source/gameengine/Ketsji/KX_VisibilityActuator.cpp

index 960eafd..530a74d 100644 (file)
@@ -968,9 +968,9 @@ PyTypeObject BL_ActionActuator::Type = {
        PyObject_HEAD_INIT(NULL)
                0,
                "BL_ActionActuator",
-               sizeof(BL_ActionActuator),
+               sizeof(PyObjectPlus_Proxy),
                0,
-               PyDestructor,
+               py_base_dealloc,
                0,
                0,
                0,
index 0d35b26..783fdd8 100644 (file)
@@ -423,9 +423,9 @@ PyTypeObject BL_ShapeActionActuator::Type = {
        PyObject_HEAD_INIT(NULL)
                0,
                "BL_ShapeActionActuator",
-               sizeof(BL_ShapeActionActuator),
+               sizeof(PyObjectPlus_Proxy),
                0,
-               PyDestructor,
+               py_base_dealloc,
                0,
                0,
                0,
index eaed2b5..5bb1eb0 100644 (file)
@@ -223,10 +223,10 @@ PyTypeObject CListValue::Type = {
        PyObject_HEAD_INIT(NULL)
        0,                              /*ob_size*/
        "CListValue",                   /*tp_name*/
-       sizeof(CListValue),             /*tp_basicsize*/
+       sizeof(PyObjectPlus_Proxy), /*tp_basicsize*/
        0,                              /*tp_itemsize*/
        /* methods */
-       PyDestructor,                   /*tp_dealloc*/
+       py_base_dealloc,                        /*tp_dealloc*/
        0,                              /*tp_print*/
        0,                      /*tp_getattr*/
        0,                      /*tp_setattr*/
index 2c5ba3f..3c414c6 100644 (file)
@@ -59,10 +59,10 @@ PyTypeObject PyObjectPlus::Type = {
        PyObject_HEAD_INIT(NULL)
        0,                              /*ob_size*/
        "PyObjectPlus",                 /*tp_name*/
-       sizeof(PyObjectPlus),           /*tp_basicsize*/
+       sizeof(PyObjectPlus_Proxy),             /*tp_basicsize*/
        0,                              /*tp_itemsize*/
        /* methods */
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
@@ -85,7 +85,7 @@ PyObjectPlus::~PyObjectPlus()
 //     assert(ob_refcnt==0);
 }
 
-void PyObjectPlus::PyDestructor(PyObject *self)                                // python wrapper
+void PyObjectPlus::py_base_dealloc(PyObject *self)                             // python wrapper
 {
        PyObjectPlus *self_plus= BGE_PROXY_REF(self);
        if(self_plus) {
@@ -108,7 +108,7 @@ PyObjectPlus::PyObjectPlus(PyTypeObject *T)                                 // constructor
  * PyObjectPlus Methods        -- Every class, even the abstract one should have a Methods
 ------------------------------*/
 PyMethodDef PyObjectPlus::Methods[] = {
-  {"isA",               (PyCFunction) sPy_isA,                 METH_O},
+  {"isA",               (PyCFunction) sPyisA,                  METH_O},
   {NULL, NULL}         /* Sentinel */
 };
 
@@ -130,6 +130,49 @@ PyParentObject PyObjectPlus::Parents[] = {&PyObjectPlus::Type, NULL};
 /*------------------------------
  * PyObjectPlus attributes     -- attributes
 ------------------------------*/
+
+
+/* This should be the entry in Type since it takes the C++ class from PyObjectPlus_Proxy */
+PyObject *PyObjectPlus::py_base_getattro(PyObject * self, PyObject *attr)
+{
+       PyObjectPlus *self_plus= BGE_PROXY_REF(self);
+       if(self_plus==NULL) {
+               if(!strcmp("isValid", PyString_AsString(attr))) {
+                       Py_RETURN_TRUE;
+               }
+               PyErr_SetString(PyExc_RuntimeError, BGE_PROXY_ERROR_MSG);
+               return NULL;
+       }
+       return self_plus->py_getattro(attr); 
+}
+
+/* This should be the entry in Type since it takes the C++ class from PyObjectPlus_Proxy */
+int PyObjectPlus::py_base_setattro(PyObject *self, PyObject *attr, PyObject *value)
+{
+       PyObjectPlus *self_plus= BGE_PROXY_REF(self);
+       if(self_plus==NULL) {
+               PyErr_SetString(PyExc_RuntimeError, BGE_PROXY_ERROR_MSG);
+               return -1;
+       }
+       
+       if (value==NULL)
+               return self_plus->py_delattro(attr);
+       
+       return self_plus->py_setattro(attr, value); 
+}
+
+PyObject *PyObjectPlus::py_base_repr(PyObject *self)                   // This should be the entry in Type.
+{
+       
+       PyObjectPlus *self_plus= BGE_PROXY_REF(self);
+       if(self_plus==NULL) {
+               PyErr_SetString(PyExc_RuntimeError, BGE_PROXY_ERROR_MSG);
+               return NULL;
+       }
+       
+       return self_plus->py_repr();  
+}
+
 PyObject *PyObjectPlus::py_getattro(PyObject* attr)
 {
        PyObject *descr = PyDict_GetItem(Type.tp_dict, attr); \
@@ -151,8 +194,6 @@ PyObject *PyObjectPlus::py_getattro(PyObject* attr)
                }
                /* end py_getattro_up copy */
        }
-  //if (streq(attr, "type"))
-  //  return Py_BuildValue("s", (*(GetParents()))->tp_name);
 }
 
 int PyObjectPlus::py_delattro(PyObject* attr)
@@ -163,8 +204,6 @@ int PyObjectPlus::py_delattro(PyObject* attr)
 
 int PyObjectPlus::py_setattro(PyObject *attr, PyObject* value)
 {
-       //return PyObject::py_setattro(attr,value);
-       //cerr << "Unknown attribute" << endl;
        PyErr_SetString(PyExc_AttributeError, "attribute cant be set");
        return PY_SET_ATTR_MISSING;
 }
@@ -275,20 +314,6 @@ PyObject *PyObjectPlus::py_get_attrdef(void *self, const PyAttributeDef *attrdef
        }
 }
 
-#if 0
-PyObject *PyObjectPlus::py_getattro_self(const PyAttributeDef attrlist[], void *self, PyObject *attr)
-{
-       char *attr_str= PyString_AsString(attr);
-       const PyAttributeDef *attrdef;
-       
-       for (attrdef=attrlist; attrdef->m_name != NULL; attrdef++)
-               if (!strcmp(attr_str, attrdef->m_name))
-                       return py_get_attrdef(self, attrdef);
-       
-       return NULL;
-}
-#endif
-
 int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyObject *value)
 {
        void *undoBuffer = NULL;
@@ -714,29 +739,7 @@ int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyOb
        return 0;       
 }
 
-#if 0
-int PyObjectPlus::py_setattro_self(const PyAttributeDef attrlist[], void *self, PyObject *attr, PyObject *value)
-{
-       const PyAttributeDef *attrdef;
-       char *attr_str= PyString_AsString(attr);
 
-       for (attrdef=attrlist; attrdef->m_name != NULL; attrdef++)
-       {
-               if (!strcmp(attr_str, attrdef->m_name))
-               {
-                       if (attrdef->m_access == KX_PYATTRIBUTE_RO ||
-                               attrdef->m_type == KX_PYATTRIBUTE_TYPE_DUMMY)
-                       {
-                               PyErr_SetString(PyExc_AttributeError, "property is read-only");
-                               return PY_SET_ATTR_FAIL;
-                       }
-                       
-                       return py_set_attrdef(self, attrdef, value);
-               }
-       }
-       return PY_SET_ATTR_MISSING;                     
-}
-#endif
 
 /*------------------------------
  * PyObjectPlus repr           -- representations
@@ -777,7 +780,7 @@ bool PyObjectPlus::isA(const char *mytypename)              // check typename of each parent
        return false;
 }
 
-PyObject *PyObjectPlus::Py_isA(PyObject *value)                // Python wrapper for isA
+PyObject *PyObjectPlus::PyisA(PyObject *self, PyObject *value)         // Python wrapper for isA
 {
        if (PyType_Check(value)) {
                return PyBool_FromLong(isA((PyTypeObject *)value));
index 3be9a2f..9f30e65 100644 (file)
    also in api2_2x/gen_utils.h 
 */
 #ifndef Py_RETURN_NONE
-#define Py_RETURN_NONE  return Py_BuildValue("O", Py_None)
+#define Py_RETURN_NONE  return Py_INCREF(Py_None), Py_None
 #endif
 #ifndef Py_RETURN_FALSE
-#define Py_RETURN_FALSE  return PyBool_FromLong(0)
+#define Py_RETURN_FALSE  return Py_INCREF(Py_False), Py_False
 #endif
 #ifndef Py_RETURN_TRUE
-#define Py_RETURN_TRUE  return PyBool_FromLong(1)
+#define Py_RETURN_TRUE  return Py_INCREF(Py_True), Py_True
 #endif
 
 /*  for pre Py 2.5 */
@@ -92,7 +92,7 @@ typedef struct {
 #define BGE_PROXY_PYOWNS(_self) (((PyObjectPlus_Proxy *)_self)->py_owns)
 
 /* Note, sometimes we dont care what BGE type this is as long as its a proxy */
-#define BGE_PROXY_CHECK_TYPE(_self) ((_self)->ob_type->tp_dealloc == PyDestructor)
+#define BGE_PROXY_CHECK_TYPE(_self) ((_self)->ob_type->tp_dealloc == py_base_dealloc)
 
 
                                                                // This must be the first line of each 
@@ -429,80 +429,34 @@ public:
        PyObject *m_proxy; /* actually a PyObjectPlus_Proxy */
        
        virtual ~PyObjectPlus();                                        // destructor
-       static void PyDestructor(PyObject *self);                               // python wrapper
        
-//     void INCREF(void) {
-//               Py_INCREF(this);
-//       };                            // incref method
-//     void DECREF(void) {
-//               Py_DECREF(this);
-//       };                            // decref method
+       /* These static functions are referenced by ALL PyObjectPlus_Proxy types
+        * they take the C++ reference from the PyObjectPlus_Proxy and call
+        * its own virtual py_getattro, py_setattro etc. functions.
+        */
+       static void                     py_base_dealloc(PyObject *self);
+       static  PyObject*               py_base_getattro(PyObject * self, PyObject *attr);
+       static  int                     py_base_setattro(PyObject *self, PyObject *attr, PyObject *value);
+       static PyObject*                py_base_repr(PyObject *self);
+
+       /* These are all virtual python methods that are defined in each class
+        * Our own fake subclassing calls these on each class, then calls the parent */
+       virtual PyObject*               py_getattro(PyObject *attr);
+       virtual int                     py_delattro(PyObject *attr);
+       virtual int                     py_setattro(PyObject *attr, PyObject *value);
+       virtual PyObject*               py_repr(void);
+
+       static PyObject*                py_get_attrdef(void *self, const PyAttributeDef *attrdef);
+       static int                              py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyObject *value);
        
-       virtual PyObject *py_getattro(PyObject *attr);                  // py_getattro method
-       static  PyObject *py_base_getattro(PyObject * self, PyObject *attr)     // This should be the entry in Type. 
-       {
-               PyObjectPlus *self_plus= BGE_PROXY_REF(self);
-               if(self_plus==NULL) {
-                       if(!strcmp("isValid", PyString_AsString(attr))) {
-                               Py_RETURN_TRUE;
-                       }
-                       PyErr_SetString(PyExc_RuntimeError, "data has been removed");
-                       return NULL;
-               }
-               return self_plus->py_getattro(attr); 
-       }
-       
-       static PyObject*        py_get_attrdef(void *self, const PyAttributeDef *attrdef);
-       static int                      py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyObject *value);
-       
-#if 0
-       static PyObject *py_getattro_self(const PyAttributeDef attrlist[], void *self, PyObject *attr);
-       static int py_setattro_self(const PyAttributeDef attrlist[], void *self, PyObject *attr, PyObject *value);
-#endif
-       
-       virtual int py_delattro(PyObject *attr);
-       virtual int py_setattro(PyObject *attr, PyObject *value);               // py_setattro method
-       static  int py_base_setattro(PyObject *self, PyObject *attr, PyObject *value) // the PyType should reference this
-       {
-               PyObjectPlus *self_plus= BGE_PROXY_REF(self);
-               if(self_plus==NULL) {
-                       PyErr_SetString(PyExc_RuntimeError, "data has been removed");
-                       return -1;
-               }
-               
-               if (value==NULL)
-                       return self_plus->py_delattro(attr);
-               
-               return self_plus->py_setattro(attr, value); 
-       }
-       
-       virtual PyObject *py_repr(void);                                // py_repr method
-       static  PyObject *py_base_repr(PyObject *self)                  // This should be the entry in Type.
-       {
-               
-               PyObjectPlus *self_plus= BGE_PROXY_REF(self);
-               if(self_plus==NULL) {
-                       PyErr_SetString(PyExc_RuntimeError, "data has been removed");
-                       return NULL;
-               }
-               
-               return self_plus->py_repr();  
-       }
-       
-                                                                       // isA methods
+       /* isA() methods, shonky replacement for pythons issubclass()
+        * which we cant use because we have our own subclass system  */
        bool isA(PyTypeObject *T);
        bool isA(const char *mytypename);
-       PyObject *Py_isA(PyObject *value);
-       static PyObject *sPy_isA(PyObject *self, PyObject *value)
-       {
-               PyObjectPlus *self_plus= BGE_PROXY_REF(self);
-               if(self_plus==NULL) {
-                       PyErr_SetString(PyExc_RuntimeError, "data has been removed");
-                       return NULL;
-               }
-               
-               return self_plus->Py_isA(value);
-       }
+       PyObject *PyisA(PyObject *value);
+       //static PyObject *sPy_isA(PyObject *self, PyObject *value);
+       
+       KX_PYMETHOD_O(PyObjectPlus,isA);
        
        /* Kindof dumb, always returns True, the false case is checked for, before this function gets accessed */
        static PyObject*        pyattr_get_is_valid(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
index 7958c16..17813d0 100644 (file)
@@ -40,9 +40,9 @@ PyTypeObject CValue::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "CValue",
-       sizeof(CValue),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 171d3fb..251a586 100644 (file)
@@ -113,9 +113,9 @@ PyTypeObject SCA_2DFilterActuator::Type = {
         PyObject_HEAD_INIT(NULL)
         0,
         "SCA_2DFilterActuator",
-        sizeof(SCA_2DFilterActuator),
+        sizeof(PyObjectPlus_Proxy),
         0,
-               PyDestructor,
+               py_base_dealloc,
                0,
                0,
                0,
index cb62e2b..1cb03f3 100644 (file)
@@ -110,9 +110,9 @@ PyTypeObject SCA_ANDController::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "SCA_ANDController",
-       sizeof(SCA_ANDController),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 99f3788..c51555a 100644 (file)
@@ -125,9 +125,9 @@ PyTypeObject SCA_ActuatorSensor::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "SCA_ActuatorSensor",
-       sizeof(SCA_ActuatorSensor),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index a7b0e5a..b7ecb02 100644 (file)
@@ -108,9 +108,9 @@ PyTypeObject SCA_AlwaysSensor::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "SCA_AlwaysSensor",
-       sizeof(SCA_AlwaysSensor),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 3f08f30..dad85a4 100644 (file)
@@ -134,9 +134,9 @@ PyTypeObject SCA_DelaySensor::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "SCA_DelaySensor",
-       sizeof(SCA_DelaySensor),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 7fa55cf..1ae7832 100644 (file)
@@ -220,9 +220,9 @@ PyTypeObject SCA_ILogicBrick::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "SCA_ILogicBrick",
-       sizeof(SCA_ILogicBrick),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index d1ce377..7580452 100644 (file)
@@ -378,9 +378,9 @@ PyTypeObject SCA_IObject::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "SCA_IObject",
-       sizeof(SCA_IObject),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 3c21cf6..269038d 100644 (file)
@@ -396,9 +396,9 @@ PyTypeObject SCA_ISensor::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "SCA_ISensor",
-       sizeof(SCA_ISensor),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 9cf850c..087fb03 100644 (file)
@@ -269,9 +269,9 @@ PyTypeObject SCA_JoystickSensor::Type = {
        PyObject_HEAD_INIT(NULL)
                0,
                "SCA_JoystickSensor",
-               sizeof(SCA_JoystickSensor),
+               sizeof(PyObjectPlus_Proxy),
                0,
-               PyDestructor,
+               py_base_dealloc,
                0,
                0,
                0,
index 0bf1936..3e19c88 100644 (file)
@@ -615,9 +615,9 @@ PyTypeObject SCA_KeyboardSensor::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "SCA_KeyboardSensor",
-       sizeof(SCA_KeyboardSensor),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 86e6449..0c30f50 100644 (file)
@@ -303,9 +303,9 @@ PyTypeObject SCA_MouseSensor::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "SCA_MouseSensor",
-       sizeof(SCA_MouseSensor),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index bddd5f4..703c9c1 100644 (file)
@@ -110,9 +110,9 @@ PyTypeObject SCA_NANDController::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "SCA_NANDController",
-       sizeof(SCA_NANDController),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 3ee0735..06acae5 100644 (file)
@@ -110,9 +110,9 @@ PyTypeObject SCA_NORController::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "SCA_NORController",
-       sizeof(SCA_NORController),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 91d5e56..319ff04 100644 (file)
@@ -102,9 +102,9 @@ PyTypeObject SCA_ORController::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "SCA_ORController",
-       sizeof(SCA_ORController),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 9dbdc0e..4bcb59d 100644 (file)
@@ -236,9 +236,9 @@ PyTypeObject SCA_PropertyActuator::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "SCA_PropertyActuator",
-       sizeof(SCA_PropertyActuator),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 9ae7be1..5c8a14d 100644 (file)
@@ -309,9 +309,9 @@ PyTypeObject SCA_PropertySensor::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "SCA_PropertySensor",
-       sizeof(SCA_PropertySensor),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 687ae42..0d09638 100644 (file)
@@ -227,9 +227,9 @@ PyTypeObject SCA_PythonController::Type = {
        PyObject_HEAD_INIT(NULL)
                0,
                "SCA_PythonController",
-               sizeof(SCA_PythonController),
+               sizeof(PyObjectPlus_Proxy),
                0,
-               PyDestructor,
+               py_base_dealloc,
                0,
                0,
                0,
@@ -441,9 +441,7 @@ SCA_PythonController::PyGetSensor(PyObject* self, PyObject* value)
                }
        }
        
-       char emsg[96];
-       PyOS_snprintf( emsg, sizeof( emsg ), "Unable to find requested sensor \"%s\"", scriptArg );
-       PyErr_SetString(PyExc_AttributeError, emsg);
+       PyErr_Format(PyExc_AttributeError, "Unable to find requested sensor \"%s\"", scriptArg);
        return NULL;
 }
 
@@ -470,9 +468,7 @@ SCA_PythonController::PyGetActuator(PyObject* self, PyObject* value)
                }
        }
        
-       char emsg[96];
-       PyOS_snprintf( emsg, sizeof( emsg ), "Unable to find requested actuator \"%s\"", scriptArg );
-       PyErr_SetString(PyExc_AttributeError, emsg);
+       PyErr_Format(PyExc_AttributeError, "Unable to find requested actuator \"%s\"", scriptArg);
        return NULL;
 }
 
index d5d993c..7a3fdc8 100644 (file)
@@ -315,9 +315,9 @@ PyTypeObject SCA_RandomActuator::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "SCA_RandomActuator",
-       sizeof(SCA_RandomActuator),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 3179c85..b0bc518 100644 (file)
@@ -130,9 +130,9 @@ PyTypeObject SCA_RandomSensor::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "SCA_RandomSensor",
-       sizeof(SCA_RandomSensor),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 10757e1..e9bb37e 100644 (file)
@@ -114,9 +114,9 @@ PyTypeObject SCA_XNORController::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "SCA_XNORController",
-       sizeof(SCA_XNORController),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index d2290fe..791a139 100644 (file)
@@ -114,9 +114,9 @@ PyTypeObject SCA_XORController::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "SCA_XORController",
-       sizeof(SCA_XORController),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index aae4fd7..01b6805 100644 (file)
@@ -775,9 +775,9 @@ PyTypeObject BL_Shader::Type = {
        PyObject_HEAD_INIT(NULL)
                0,
                "BL_Shader",
-               sizeof(BL_Shader),
+               sizeof(PyObjectPlus_Proxy),
                0,
-               PyDestructor,
+               py_base_dealloc,
                0,
                0,
                0,
index d6d5969..c3b27d4 100644 (file)
@@ -108,9 +108,9 @@ PyTypeObject KX_NetworkMessageActuator::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_NetworkMessageActuator",
-       sizeof(KX_NetworkMessageActuator),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 8aca2e3..9fd3045 100644 (file)
@@ -171,9 +171,9 @@ PyTypeObject KX_NetworkMessageSensor::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_NetworkMessageSensor",
-       sizeof(KX_NetworkMessageSensor),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index bdad21f..6722cd2 100644 (file)
@@ -756,9 +756,9 @@ PyTypeObject KX_BlenderMaterial::Type = {
        PyObject_HEAD_INIT(NULL)
                0,
                "KX_BlenderMaterial",
-               sizeof(KX_BlenderMaterial),
+               sizeof(PyObjectPlus_Proxy),
                0,
-               PyDestructor,
+               py_base_dealloc,
                0,
                0,
                0,
index c3d2865..56610f2 100644 (file)
@@ -161,9 +161,9 @@ PyTypeObject KX_CDActuator::Type = {
        PyObject_HEAD_INIT(NULL)
                0,
                "KX_SoundActuator",
-               sizeof(KX_CDActuator),
+               sizeof(PyObjectPlus_Proxy),
                0,
-               PyDestructor,
+               py_base_dealloc,
                0,
                0,
                0,
index daa3705..db8186e 100644 (file)
@@ -509,9 +509,9 @@ PyTypeObject KX_Camera::Type = {
        PyObject_HEAD_INIT(NULL)
                0,
                "KX_Camera",
-               sizeof(KX_Camera),
+               sizeof(PyObjectPlus_Proxy),
                0,
-               PyDestructor,
+               py_base_dealloc,
                0,
                0,
                0,
index a1159db..35165af 100644 (file)
@@ -374,9 +374,9 @@ PyTypeObject KX_CameraActuator::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_CameraActuator",
-       sizeof(KX_CameraActuator),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 3b8b4a9..fc15568 100644 (file)
@@ -569,9 +569,9 @@ PyTypeObject KX_ConstraintActuator::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_ConstraintActuator",
-       sizeof(KX_ConstraintActuator),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 6f4d970..d557758 100644 (file)
@@ -72,9 +72,9 @@ PyTypeObject KX_ConstraintWrapper::Type = {
        PyObject_HEAD_INIT(NULL)
                0,
                "KX_ConstraintWrapper",
-               sizeof(KX_ConstraintWrapper),
+               sizeof(PyObjectPlus_Proxy),
                0,
-               PyDestructor,
+               py_base_dealloc,
                0,
                0,
                0,
index cef8749..215c30d 100644 (file)
@@ -211,9 +211,9 @@ PyTypeObject KX_GameActuator::Type = {
        PyObject_HEAD_INIT(NULL)
                0,
                "KX_GameActuator",
-               sizeof(KX_GameActuator),
+               sizeof(PyObjectPlus_Proxy),
                0,
-               PyDestructor,
+               py_base_dealloc,
                0,
                0,
                0,
index 402c242..60d2fb0 100644 (file)
@@ -1367,9 +1367,9 @@ PyTypeObject KX_GameObject::Type = {
        PyObject_HEAD_INIT(NULL)
                0,
                "KX_GameObject",
-               sizeof(KX_GameObject),
+               sizeof(PyObjectPlus_Proxy),
                0,
-               PyDestructor,
+               py_base_dealloc,
                0,
                0,
                0,
index 644f8ac..558b77c 100644 (file)
@@ -416,9 +416,9 @@ PyTypeObject KX_IpoActuator::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_IpoActuator",
-       sizeof(KX_IpoActuator),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 29033c2..713838c 100644 (file)
@@ -328,9 +328,9 @@ PyTypeObject KX_LightObject::Type = {
        PyObject_HEAD_INIT(NULL)
                0,
                "KX_LightObject",
-               sizeof(KX_LightObject),
+               sizeof(PyObjectPlus_Proxy),
                0,
-               PyDestructor,
+               py_base_dealloc,
                0,
                0,
                0,
index 09e1993..8ce5e88 100644 (file)
@@ -49,9 +49,9 @@ PyTypeObject KX_MeshProxy::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_MeshProxy",
-       sizeof(KX_MeshProxy),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index e1b89eb..b59f18b 100644 (file)
@@ -338,9 +338,9 @@ PyTypeObject KX_MouseFocusSensor::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_MouseFocusSensor",
-       sizeof(KX_MouseFocusSensor),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index b9d1939..0489b70 100644 (file)
@@ -289,9 +289,9 @@ PyTypeObject KX_NearSensor::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_NearSensor",
-       sizeof(KX_NearSensor),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 0ea0517..4f18907 100644 (file)
@@ -280,9 +280,9 @@ PyTypeObject KX_ObjectActuator::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_ObjectActuator",
-       sizeof(KX_ObjectActuator),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index a667b45..5263dd7 100644 (file)
@@ -142,9 +142,9 @@ PyTypeObject KX_ParentActuator::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_ParentActuator",
-       sizeof(KX_ParentActuator),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 9da8619..f000d07 100644 (file)
@@ -124,9 +124,9 @@ PyTypeObject KX_PhysicsObjectWrapper::Type = {
        PyObject_HEAD_INIT(NULL)
                0,
                "KX_PhysicsObjectWrapper",
-               sizeof(KX_PhysicsObjectWrapper),
+               sizeof(PyObjectPlus_Proxy),
                0,
-               PyDestructor,
+               py_base_dealloc,
                0,
                0,
                0,
index c03d585..e227ba0 100644 (file)
@@ -42,9 +42,9 @@ PyTypeObject KX_PolyProxy::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_PolyProxy",
-       sizeof(KX_PolyProxy),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index bf1fbe3..46d0448 100644 (file)
@@ -211,9 +211,9 @@ PyTypeObject KX_PolygonMaterial::Type = {
        PyObject_HEAD_INIT(NULL)
                0,
                "KX_PolygonMaterial",
-               sizeof(KX_PolygonMaterial),
+               sizeof(PyObjectPlus_Proxy),
                0,
-               PyDestructor,
+               py_base_dealloc,
                0,
                0,
                0,
index b9abe69..40af3b2 100644 (file)
@@ -254,9 +254,9 @@ PyTypeObject KX_RadarSensor::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_RadarSensor",
-       sizeof(KX_RadarSensor),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 9dfc824..080a217 100644 (file)
@@ -324,9 +324,9 @@ PyTypeObject KX_RaySensor::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_RaySensor",
-       sizeof(KX_RaySensor),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 975e6d9..1ab4bd2 100644 (file)
@@ -170,9 +170,9 @@ PyTypeObject KX_SCA_AddObjectActuator::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_SCA_AddObjectActuator",
-       sizeof(KX_SCA_AddObjectActuator),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index e03b153..9c9cdcd 100644 (file)
@@ -54,9 +54,9 @@ KX_SCA_DynamicActuator::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_SCA_DynamicActuator",
-       sizeof(KX_SCA_DynamicActuator),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 0db9e1c..3b42577 100644 (file)
@@ -97,9 +97,9 @@ PyTypeObject KX_SCA_EndObjectActuator::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_SCA_EndObjectActuator",
-       sizeof(KX_SCA_EndObjectActuator),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 999b017..b678b14 100644 (file)
@@ -56,9 +56,9 @@ KX_SCA_ReplaceMeshActuator::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_SCA_ReplaceMeshActuator",
-       sizeof(KX_SCA_ReplaceMeshActuator),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index d8d6f21..96f2f3e 100644 (file)
@@ -1582,9 +1582,9 @@ PyTypeObject KX_Scene::Type = {
        PyObject_HEAD_INIT(NULL)
                0,
                "KX_Scene",
-               sizeof(KX_Scene),
+               sizeof(PyObjectPlus_Proxy),
                0,
-               PyDestructor,
+               py_base_dealloc,
                0,
                0,
                0,
index b52cc81..414251d 100644 (file)
@@ -229,9 +229,9 @@ PyTypeObject KX_SceneActuator::Type = {
        PyObject_HEAD_INIT(NULL)
                0,
                "KX_SceneActuator",
-               sizeof(KX_SceneActuator),
+               sizeof(PyObjectPlus_Proxy),
                0,
-               PyDestructor,
+               py_base_dealloc,
                0,
                0,
                0,
index 6381c43..d7449c7 100644 (file)
@@ -237,9 +237,9 @@ PyTypeObject KX_SoundActuator::Type = {
        PyObject_HEAD_INIT(NULL)
                0,
                "KX_SoundActuator",
-               sizeof(KX_SoundActuator),
+               sizeof(PyObjectPlus_Proxy),
                0,
-               PyDestructor,
+               py_base_dealloc,
                0,
                0,
                0,
index a251a98..3cfa40c 100644 (file)
@@ -112,9 +112,9 @@ PyTypeObject KX_StateActuator::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_StateActuator",
-       sizeof(KX_StateActuator),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 7265ade..79da498 100644 (file)
@@ -245,9 +245,9 @@ PyTypeObject KX_TouchSensor::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_TouchSensor",
-       sizeof(KX_TouchSensor),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 5ea08f8..6c522b3 100644 (file)
@@ -428,9 +428,9 @@ PyTypeObject KX_TrackToActuator::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_TrackToActuator",
-       sizeof(KX_TrackToActuator),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index 0ba55fe..558b284 100644 (file)
@@ -305,9 +305,9 @@ PyTypeObject KX_VehicleWrapper::Type = {
        PyObject_HEAD_INIT(NULL)
                0,
                "KX_VehicleWrapper",
-               sizeof(KX_VehicleWrapper),
+               sizeof(PyObjectPlus_Proxy),
                0,
-               PyDestructor,
+               py_base_dealloc,
                0,
                0,
                0,
index 6a160df..4954e94 100644 (file)
@@ -40,9 +40,9 @@ PyTypeObject KX_VertexProxy::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_VertexProxy",
-       sizeof(KX_VertexProxy),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,
index fceb0b5..6d984f0 100644 (file)
@@ -97,9 +97,9 @@ PyTypeObject KX_VisibilityActuator::Type = {
        PyObject_HEAD_INIT(NULL)
        0,
        "KX_VisibilityActuator",
-       sizeof(KX_VisibilityActuator),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
        0,
        0,