remove python2.x support
[blender.git] / source / gameengine / GameLogic / SCA_IObject.cpp
index 2b87a7c15268f5301e273d20597500375eff07cc..2bffd029bd4d980606b4357d524c1579604b1a9b 100644 (file)
 MT_Point3 SCA_IObject::m_sDummy=MT_Point3(0,0,0);
 SG_QList SCA_IObject::m_activeBookmarkedControllers;
 
-SCA_IObject::SCA_IObject(PyTypeObject* T): CValue(T), m_initState(0), m_state(0)
+SCA_IObject::SCA_IObject():
+       CValue(),
+       m_initState(0),
+       m_state(0),
+       m_firstState(NULL)
 {
        m_suspended = false;
 }
@@ -217,51 +221,6 @@ SCA_IActuator* SCA_IObject::FindActuator(const STR_String& actuatorname)
 }
 
 
-
-#if 0
-const MT_Point3& SCA_IObject::ConvertPythonPylist(PyObject* pylist)
-{
-       bool error = false;
-       m_sDummy = MT_Vector3(0,0,0);
-       if (pylist->ob_type == &CListValue::Type)
-       {
-               CListValue* listval = (CListValue*) pylist;
-               int numelem = listval->GetCount();
-               if ( numelem <= 3)
-               {
-                       int index;
-                       for (index = 0;index<numelem;index++)
-                       {
-                               m_sDummy[index] = listval->GetValue(index)->GetNumber();
-                       }
-               }       else
-               {
-                       error = true;
-               }
-               
-       } else
-       {
-               
-               // assert the list is long enough...
-               int numitems = PyList_Size(pylist);
-               if (numitems <= 3)
-               {
-                       int index;
-                       for (index=0;index<numitems;index++)
-                       {
-                               m_sDummy[index] = PyFloat_AsDouble(PyList_GetItem(pylist,index));
-                       }
-               }
-               else
-               {
-                       error = true;
-               }
-
-       }
-       return m_sDummy;
-}
-#endif
-
 void SCA_IObject::Suspend()
 {
        if ((!m_ignore_activity_culling) 
@@ -329,13 +288,7 @@ void SCA_IObject::SetState(unsigned int state)
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_IObject::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
        PyVarObject_HEAD_INIT(NULL, 0)
-#else
-       /* python 2.5 and below */
-       PyObject_HEAD_INIT( NULL )  /* required py macro */
-       0,                          /* ob_size */
-#endif
        "SCA_IObject",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -345,23 +298,17 @@ PyTypeObject SCA_IObject::Type = {
        0,
        0,
        py_base_repr,
-       0,0,0,0,0,0,
-       py_base_getattro,
-       py_base_setattro,
        0,0,0,0,0,0,0,0,0,
-       Methods
-};
-
-
-
-PyParentObject SCA_IObject::Parents[] = {
-       &SCA_IObject::Type,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
        &CValue::Type,
-       NULL
+       0,0,0,0,0,0,
+       py_base_new
 };
 
-
-
 PyMethodDef SCA_IObject::Methods[] = {
        //{"setOrientation", (PyCFunction) SCA_IObject::sPySetOrientation, METH_VARARGS},
        //{"getOrientation", (PyCFunction) SCA_IObject::sPyGetOrientation, METH_VARARGS},
@@ -371,12 +318,3 @@ PyMethodDef SCA_IObject::Methods[] = {
 PyAttributeDef SCA_IObject::Attributes[] = {
        { NULL }        //Sentinel
 };
-
-
-PyObject* SCA_IObject::py_getattro(PyObject *attr) {
-       py_getattro_up(CValue);
-}
-
-PyObject* SCA_IObject::py_getattro_dict() {
-       py_getattro_dict_up(CValue);
-}