remove python2.x support
authorCampbell Barton <ideasman42@gmail.com>
Mon, 10 Aug 2009 00:07:34 +0000 (00:07 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 10 Aug 2009 00:07:34 +0000 (00:07 +0000)
106 files changed:
release/ui/buttons_material.py
release/ui/buttons_scene.py
release/ui/buttons_world.py
release/ui/space_console.py
source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c
source/blender/python/generic/BGL.c
source/blender/python/generic/BGL.h
source/blender/python/generic/Geometry.c
source/blender/python/generic/Geometry.h
source/blender/python/generic/Mathutils.c
source/blender/python/generic/Mathutils.h
source/blender/python/generic/bpy_internal_import.c
source/blender/python/generic/bpy_internal_import.h
source/blender/python/generic/euler.c
source/blender/python/generic/euler.h
source/blender/python/generic/matrix.c
source/blender/python/generic/quat.c
source/blender/python/generic/quat.h
source/blender/python/generic/vector.c
source/blender/python/generic/vector.h
source/blender/python/intern/bpy_compat.h [deleted file]
source/blender/python/intern/bpy_interface.c
source/blender/python/intern/bpy_operator.c
source/blender/python/intern/bpy_operator_wrap.c
source/blender/python/intern/bpy_rna.c
source/blender/python/intern/bpy_ui.c
source/blender/python/intern/bpy_util.c
source/blender/python/intern/bpy_util.h
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_IController.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_PyConstraintBinding.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Ketsji/KX_PythonSeq.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
source/gameengine/VideoTexture/FilterBlueScreen.cpp
source/gameengine/VideoTexture/FilterColor.cpp
source/gameengine/VideoTexture/FilterNormal.cpp
source/gameengine/VideoTexture/FilterSource.cpp
source/gameengine/VideoTexture/ImageBuff.cpp
source/gameengine/VideoTexture/ImageMix.cpp
source/gameengine/VideoTexture/ImageRender.cpp
source/gameengine/VideoTexture/ImageViewport.cpp
source/gameengine/VideoTexture/Texture.cpp
source/gameengine/VideoTexture/VideoFFmpeg.cpp
source/gameengine/VideoTexture/blendVideoTex.cpp

index bbb575a14e2715a0b5cba8ddc4fb84fd0c1aaaca..056bd5d6c10a929719f1bebbf17638b4ff51e703 100644 (file)
@@ -1,12 +1,6 @@
        
 import bpy
 
-# If python version is less than 2.4, try to get set stuff from module
-try:
-       set
-except:
-       from sets import Set as set
-
 class MaterialButtonsPanel(bpy.types.Panel):
        __space_type__ = "BUTTONS_WINDOW"
        __region_type__ = "WINDOW"
index 2d8dc0eab33b23abb7b78a33ab54573959d5c331..d5ae95a2fb66d37ab9b561161c991fee1168af01 100644 (file)
@@ -1,12 +1,6 @@
 
 import bpy
 
-# If python version is less than 2.4, try to get set stuff from module
-try:
-       set
-except:
-       from sets import Set as set
-
 class RenderButtonsPanel(bpy.types.Panel):
        __space_type__ = "BUTTONS_WINDOW"
        __region_type__ = "WINDOW"
index e44d71025112f91675bbf806009c57cfe0aa58f4..62c720d09d1988bf105c8e07e99c28452a489448 100644 (file)
@@ -1,12 +1,6 @@
 
 import bpy
 
-# If python version is less than 2.4, try to get set stuff from module
-try:
-       set
-except:
-       from sets import Set as set
-
 class WorldButtonsPanel(bpy.types.Panel):
        __space_type__ = "BUTTONS_WINDOW"
        __region_type__ = "WINDOW"
index 8814553e55f16a3fc85dc830c0f3c8b83ee9785b..2cf41a1f88f6df4284643bf24c8b0542d5e46193 100644 (file)
@@ -99,19 +99,9 @@ def get_console(console_id):
                
                console = code.InteractiveConsole(namespace)
                
-               if sys.version.startswith('3'):
-                       import io
-                       stdout = io.StringIO()
-                       stderr = io.StringIO()
-               elif sys.version.startswith('2.6'):
-                       import io
-                       stdout = io.BytesIO()  # Py2x support
-                       stderr = io.BytesIO()
-               else:
-                       import cStringIO
-                       stdout = cStringIO.StringIO()
-                       stderr = cStringIO.StringIO()
-
+               import io
+               stdout = io.StringIO()
+               stderr = io.StringIO()
        
                consoles[console_id]= namespace, console, stdout, stderr
                
index fbc56dfcc835da4973d1308b94d3f3a9b1100992..693a20b5b0fb6b74249a35cec5a9f22df6882922 100644 (file)
@@ -34,9 +34,7 @@
 #endif
 
 /* TODO, support python3.x */
-#if PY_VERSION_HEX >= 0x03000000
 #define DISABLE_PYTHON 1
-#endif
 
 #include "DNA_text_types.h"
 #include "BKE_text.h"
index de82781cf3a2fc449360d41526f3c618a3c8f5cd..2fd9130857f5927e219fb5f5dd37f6251d60e529 100644 (file)
@@ -83,13 +83,7 @@ static PyObject *Buffer_getattr( PyObject * self, char *name );
 static PyObject *Buffer_repr( PyObject * self );
 
 PyTypeObject buffer_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
        "buffer",               /*tp_name */
        sizeof( Buffer ),       /*tp_basicsize */
        0,                      /*tp_itemsize */
@@ -1090,7 +1084,6 @@ static struct PyMethodDef BGL_methods[] = {
        {NULL, NULL, 0, NULL}
 };
 
-#if (PY_VERSION_HEX >= 0x03000000)
 static struct PyModuleDef BGL_module_def = {
        PyModuleDef_HEAD_INIT,
        "BGL",  /* m_name */
@@ -1102,17 +1095,13 @@ static struct PyModuleDef BGL_module_def = {
        0,  /* m_clear */
        0,  /* m_free */
 };
-#endif
 
-PyObject *BGL_Init(const char *from) 
+
+PyObject *BGL_Init(void)
 {
        PyObject *mod, *dict, *item;
-#if (PY_VERSION_HEX >= 0x03000000)
        mod = PyModule_Create(&BGL_module_def);
        PyDict_SetItemString(PySys_GetObject("modules"), BGL_module_def.m_name, mod);
-#else
-       mod= Py_InitModule(from, BGL_methods);
-#endif
        dict= PyModule_GetDict(mod);
        
        if( PyType_Ready( &buffer_Type) < 0)
index 938c916bceafd12ccbf7198894bf700c6aea4075..a8c37bf3eddab830f4a1561aa7e4cc4bafc8e599 100644 (file)
@@ -42,9 +42,8 @@
 
 #include <Python.h>
 #include <GL/glew.h>
-#include "../intern/bpy_compat.h"
 
-PyObject *BGL_Init( const char *from );
+PyObject *BGL_Init(void);
 
 /*@ Buffer Object */
 /*@ For Python access to OpenGL functions requiring a pointer. */
index b4a34d30051e5bee8c7a5a6c42ad4c928fe96f60..70295d1c2d974b34220138611f35f85eacc46289 100644 (file)
@@ -78,7 +78,6 @@ struct PyMethodDef M_Geometry_methods[] = {
        {NULL, NULL, 0, NULL}
 };
 
-#if (PY_VERSION_HEX >= 0x03000000)
 static struct PyModuleDef M_Geometry_module_def = {
        PyModuleDef_HEAD_INIT,
        "Geometry",  /* m_name */
@@ -90,19 +89,14 @@ static struct PyModuleDef M_Geometry_module_def = {
        0,  /* m_clear */
        0,  /* m_free */
 };
-#endif
 
 /*----------------------------MODULE INIT-------------------------*/
-PyObject *Geometry_Init(const char *from)
+PyObject *Geometry_Init(void)
 {
        PyObject *submodule;
        
-#if (PY_VERSION_HEX >= 0x03000000)
        submodule = PyModule_Create(&M_Geometry_module_def);
        PyDict_SetItemString(PySys_GetObject("modules"), M_Geometry_module_def.m_name, submodule);
-#else
-       submodule = Py_InitModule3(from, M_Geometry_methods, M_Geometry_doc);
-#endif
        
        return (submodule);
 }
index ebfb054c54aa367e574c555d314b46e7b8bcf1d7..0e46c0d18db6fb4078321e07e266209fd5696ab6 100644 (file)
@@ -34,6 +34,6 @@
 #include <Python.h>
 #include "Mathutils.h"
 
-PyObject *Geometry_Init( const char *from );
+PyObject *Geometry_Init(void);
 
 #endif                         /* EXPP_Geometry_H */
index 5307765965585eb0d4c020c926608df014239215..f53fd66ba99a889d876290f0397ec1d42c6e9bd6 100644 (file)
@@ -94,7 +94,6 @@ struct PyMethodDef M_Mathutils_methods[] = {
 /*----------------------------MODULE INIT-------------------------*/
 /* from can be Blender.Mathutils or GameLogic.Mathutils for the BGE */
 
-#if (PY_VERSION_HEX >= 0x03000000)
 static struct PyModuleDef M_Mathutils_module_def = {
        PyModuleDef_HEAD_INIT,
        "Mathutils",  /* m_name */
@@ -106,21 +105,13 @@ static struct PyModuleDef M_Mathutils_module_def = {
        0,  /* m_clear */
        0,  /* m_free */
 };
-#endif
 
-PyObject *Mathutils_Init(const char *from)
+PyObject *Mathutils_Init(void)
 {
        PyObject *submodule;
 
        //seed the generator for the rand function
        BLI_srand((unsigned int) (PIL_check_seconds_timer() * 0x7FFFFFFF));
-
-#if (PY_VERSION_HEX < 0x03000000)
-       vector_Type.tp_flags |= Py_TPFLAGS_CHECKTYPES;
-       matrix_Type.tp_flags |= Py_TPFLAGS_CHECKTYPES;
-       euler_Type.tp_flags |= Py_TPFLAGS_CHECKTYPES;
-       quaternion_Type.tp_flags |= Py_TPFLAGS_CHECKTYPES;
-#endif
        
        if( PyType_Ready( &vector_Type ) < 0 )
                return NULL;
@@ -131,12 +122,8 @@ PyObject *Mathutils_Init(const char *from)
        if( PyType_Ready( &quaternion_Type ) < 0 )
                return NULL;
        
-#if (PY_VERSION_HEX >= 0x03000000)
        submodule = PyModule_Create(&M_Mathutils_module_def);
        PyDict_SetItemString(PySys_GetObject("modules"), M_Mathutils_module_def.m_name, submodule);
-#else
-       submodule = Py_InitModule3(from, M_Mathutils_methods, M_Mathutils_doc);
-#endif
        
        /* each type has its own new() function */
        PyModule_AddObject( submodule, "Vector",                (PyObject *)&vector_Type );
index 5bdd9d9cfe004fd15a2a922d5d542114eeed035a..ad67d2e511ef502223bb0f83e5b9cc5379e9e9fe 100644 (file)
@@ -32,7 +32,6 @@
 #define EXPP_Mathutils_H
 
 #include <Python.h>
-#include "../intern/bpy_compat.h"
 #include "vector.h"
 #include "matrix.h"
 #include "quat.h"
@@ -55,10 +54,7 @@ PyObject *BaseMathObject_getOwner( BaseMathObject * self, void * );
 PyObject *BaseMathObject_getWrapped( BaseMathObject *self, void * );
 void BaseMathObject_dealloc(BaseMathObject * self);
 
-
-
-
-PyObject *Mathutils_Init( const char * from );
+PyObject *Mathutils_Init(void);
 
 PyObject *quat_rotation(PyObject *arg1, PyObject *arg2);
 
index 073cb58f1c8e55a40b248248c22c97aa605325c8..05c846b16f5712a87b930299b751e03244ca2b01 100644 (file)
@@ -179,20 +179,12 @@ static PyObject *blender_import( PyObject * self, PyObject * args,  PyObject * k
        PyObject *newmodule;
        
        //PyObject_Print(args, stderr, 0);
-#if (PY_VERSION_HEX >= 0x02060000)
        int dummy_val; /* what does this do?*/
        static char *kwlist[] = {"name", "globals", "locals", "fromlist", "level", 0};
        
        if( !PyArg_ParseTupleAndKeywords( args, kw, "s|OOOi:bpy_import_meth", kwlist,
                               &name, &globals, &locals, &fromlist, &dummy_val) )
                return NULL;
-#else
-       static char *kwlist[] = {"name", "globals", "locals", "fromlist", 0};
-       
-       if( !PyArg_ParseTupleAndKeywords( args, kw, "s|OOO:bpy_import_meth", kwlist,
-                              &name, &globals, &locals, &fromlist ) )
-               return NULL;
-#endif
 
        /* import existing builtin modules or modules that have been imported alredy */
        newmodule = PyImport_ImportModuleEx( name, globals, locals, fromlist );
index aeeafb7c1c48fdc3cbadec7a468cfcff88e77b6d..c93d930dab03d0b04d9aae2879723523ef1caf2e 100644 (file)
@@ -32,7 +32,6 @@
 #define EXPP_bpy_import_h
 
 #include <Python.h>
-#include "../intern/bpy_compat.h"
 #include "compile.h"           /* for the PyCodeObject */
 #include "eval.h"              /* for PyEval_EvalCode */
 
index 69373b1aa360389e3fcd3993f996a54b463adb0a..c6aaee64ebe3b3791be403ba1bb64264b73fc84f 100644 (file)
@@ -547,13 +547,7 @@ static PyGetSetDef Euler_getseters[] = {
 
 //------------------PY_OBECT DEFINITION--------------------------
 PyTypeObject euler_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
        "euler",                                                //tp_name
        sizeof(EulerObject),                    //tp_basicsize
        0,                                                              //tp_itemsize
index a3706d53756ef8a47b362fcff3a3d2d47e045ce2..74d184fef81c70542d9b29a52430f9340641049a 100644 (file)
@@ -32,7 +32,6 @@
 #define EXPP_euler_h
 
 #include <Python.h>
-#include "../intern/bpy_compat.h"
 
 extern PyTypeObject euler_Type;
 #define EulerObject_Check(_v) PyObject_TypeCheck((_v), &euler_Type)
index 5bdbf80461816cc112a78de14077ada8d6a23116..d4153243516adb70df32077415bd28dbb8a5cf35 100644 (file)
@@ -998,8 +998,6 @@ static PySequenceMethods Matrix_SeqMethods = {
 };
 
 
-
-#if (PY_VERSION_HEX >= 0x03000000)
 static PyObject *Matrix_subscript(MatrixObject* self, PyObject* item)
 {
        if (PyIndex_Check(item)) {
@@ -1071,11 +1069,8 @@ static PyMappingMethods Matrix_AsMapping = {
        (binaryfunc)Matrix_subscript,
        (objobjargproc)Matrix_ass_subscript
 };
-#endif /*  (PY_VERSION_HEX >= 0x03000000) */
-
 
 
-#if (PY_VERSION_HEX >= 0x03000000)
 static PyNumberMethods Matrix_NumMethods = {
                (binaryfunc)    Matrix_add,     /*nb_add*/
                (binaryfunc)    Matrix_sub,     /*nb_subtract*/
@@ -1112,33 +1107,6 @@ static PyNumberMethods Matrix_NumMethods = {
                0,                              /* nb_inplace_true_divide */
                0,                              /* nb_index */
 };
-#else
-static PyNumberMethods Matrix_NumMethods = {
-       (binaryfunc) Matrix_add,                                /* __add__ */
-       (binaryfunc) Matrix_sub,                                /* __sub__ */
-       (binaryfunc) Matrix_mul,                                /* __mul__ */
-       (binaryfunc) 0,                                                 /* __div__ */
-       (binaryfunc) 0,                                                 /* __mod__ */
-       (binaryfunc) 0,                                                 /* __divmod__ */
-       (ternaryfunc) 0,                                                /* __pow__ */
-       (unaryfunc) 0,                                                  /* __neg__ */
-       (unaryfunc) 0,                                                  /* __pos__ */
-       (unaryfunc) 0,                                                  /* __abs__ */
-       (inquiry) 0,                                                    /* __nonzero__ */
-       (unaryfunc) Matrix_inv,                                 /* __invert__ */
-       (binaryfunc) 0,                                                 /* __lshift__ */
-       (binaryfunc) 0,                                                 /* __rshift__ */
-       (binaryfunc) 0,                                                 /* __and__ */
-       (binaryfunc) 0,                                                 /* __xor__ */
-       (binaryfunc) 0,                                                 /* __or__ */
-       /*(coercion)*/ 0,                                                       /* __coerce__ */
-       (unaryfunc) 0,                                                  /* __int__ */
-       (unaryfunc) 0,                                                  /* __long__ */
-       (unaryfunc) 0,                                                  /* __float__ */
-       (unaryfunc) 0,                                                  /* __oct__ */
-       (unaryfunc) 0,                                                  /* __hex__ */
-};
-#endif
 
 static PyObject *Matrix_getRowSize( MatrixObject * self, void *type )
 {
@@ -1164,13 +1132,7 @@ static PyGetSetDef Matrix_getseters[] = {
 
 /*------------------PY_OBECT DEFINITION--------------------------*/
 PyTypeObject matrix_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
        "matrix",                                               /*tp_name*/
        sizeof(MatrixObject),                   /*tp_basicsize*/
        0,                                                              /*tp_itemsize*/
@@ -1182,11 +1144,7 @@ PyTypeObject matrix_Type = {
        (reprfunc) Matrix_repr,                 /*tp_repr*/
        &Matrix_NumMethods,                             /*tp_as_number*/
        &Matrix_SeqMethods,                             /*tp_as_sequence*/
-#if (PY_VERSION_HEX >= 0x03000000)
        &Matrix_AsMapping,                              /*tp_as_mapping*/
-#else
-       0,
-#endif
        0,                                                              /*tp_hash*/
        0,                                                              /*tp_call*/
        0,                                                              /*tp_str*/
index a353f73c854755bc619620c47e20d8450d7a0eca..e06bee320311b5b2b5b15f5491e267134b3b0cfd 100644 (file)
@@ -620,7 +620,6 @@ static PySequenceMethods Quaternion_SeqMethods = {
        (ssizessizeobjargproc) Quaternion_ass_slice,    /* sq_ass_slice */
 };
 
-#if (PY_VERSION_HEX >= 0x03000000)
 static PyNumberMethods Quaternion_NumMethods = {
                (binaryfunc)    Quaternion_add, /*nb_add*/
                (binaryfunc)    Quaternion_sub, /*nb_subtract*/
@@ -657,33 +656,6 @@ static PyNumberMethods Quaternion_NumMethods = {
                0,                              /* nb_inplace_true_divide */
                0,                              /* nb_index */
 };
-#else
-static PyNumberMethods Quaternion_NumMethods = {
-       (binaryfunc) Quaternion_add,                            /* __add__ */
-       (binaryfunc) Quaternion_sub,                            /* __sub__ */
-       (binaryfunc) Quaternion_mul,                            /* __mul__ */
-       (binaryfunc) 0,                                                         /* __div__ */
-       (binaryfunc) 0,                                                         /* __mod__ */
-       (binaryfunc) 0,                                                         /* __divmod__ */
-       (ternaryfunc) 0,                                                        /* __pow__ */
-       (unaryfunc) 0,                                                          /* __neg__ */
-       (unaryfunc) 0,                                                          /* __pos__ */
-       (unaryfunc) 0,                                                          /* __abs__ */
-       (inquiry) 0,                                                            /* __nonzero__ */
-       (unaryfunc) 0,                                                          /* __invert__ */
-       (binaryfunc) 0,                                                         /* __lshift__ */
-       (binaryfunc) 0,                                                         /* __rshift__ */
-       (binaryfunc) 0,                                                         /* __and__ */
-       (binaryfunc) 0,                                                         /* __xor__ */
-       (binaryfunc) 0,                                                         /* __or__ */
-       /*(coercion)*/  0,                                                              /* __coerce__ */
-       (unaryfunc) 0,                                                          /* __int__ */
-       (unaryfunc) 0,                                                          /* __long__ */
-       (unaryfunc) 0,                                                          /* __float__ */
-       (unaryfunc) 0,                                                          /* __oct__ */
-       (unaryfunc) 0,                                                          /* __hex__ */
-};
-#endif
 
 static PyObject *Quaternion_getAxis( QuaternionObject * self, void *type )
 {
@@ -778,13 +750,7 @@ static PyGetSetDef Quaternion_getseters[] = {
 
 //------------------PY_OBECT DEFINITION--------------------------
 PyTypeObject quaternion_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
        "quaternion",                                           //tp_name
        sizeof(QuaternionObject),                       //tp_basicsize
        0,                                                              //tp_itemsize
index a7cfb7898b1eb9ccb705623941ecdca78697bc89..a1d01b4982d43bd4451036abef599d4af5557369 100644 (file)
@@ -32,7 +32,6 @@
 #define EXPP_quat_h
 
 #include <Python.h>
-#include "../intern/bpy_compat.h"
 
 extern PyTypeObject quaternion_Type;
 #define QuaternionObject_Check(_v) PyObject_TypeCheck((_v), &quaternion_Type)
index cf2396b30d452fbe9a54cf502f014e01ce4167a8..63bc2fbc7d1f60e7f52d9396fe41a25106583972 100644 (file)
@@ -1058,21 +1058,11 @@ static PySequenceMethods Vector_SeqMethods = {
        (binaryfunc) 0,                                                         /* sq_concat */
        (ssizeargfunc) 0,                                                       /* sq_repeat */
        (ssizeargfunc) Vector_item,                                     /* sq_item */
-#if (PY_VERSION_HEX < 0x03000000)
-       (ssizessizeargfunc) Vector_slice,                       /* sq_slice */ /* PY2 ONLY */
-#else
-       NULL,
-#endif
+       NULL,                                                                           /* py3 deprecated slice func */
        (ssizeobjargproc) Vector_ass_item,                      /* sq_ass_item */
-#if (PY_VERSION_HEX < 0x03000000)
-       (ssizessizeobjargproc) Vector_ass_slice,        /* sq_ass_slice */ /* PY2 ONLY */
-#else
-       NULL,
-#endif
+       NULL,                                                                           /* py3 deprecated slice assign func */
 };
 
-
-#if (PY_VERSION_HEX >= 0x03000000)
 static PyObject *Vector_subscript(VectorObject* self, PyObject* item)
 {
        if (PyIndex_Check(item)) {
@@ -1144,9 +1134,8 @@ static PyMappingMethods Vector_AsMapping = {
        (binaryfunc)Vector_subscript,
        (objobjargproc)Vector_ass_subscript
 };
-#endif /*  (PY_VERSION_HEX >= 0x03000000) */
-#if (PY_VERSION_HEX >= 0x03000000)
+
+
 static PyNumberMethods Vector_NumMethods = {
                (binaryfunc)    Vector_add,     /*nb_add*/
                (binaryfunc)    Vector_sub,     /*nb_subtract*/
@@ -1183,53 +1172,6 @@ static PyNumberMethods Vector_NumMethods = {
                Vector_idiv,    /* nb_inplace_true_divide */
                0,                      /* nb_index */
 };
-#else
-static PyNumberMethods Vector_NumMethods = {
-       (binaryfunc) Vector_add,                                        /* __add__ */
-       (binaryfunc) Vector_sub,                                        /* __sub__ */
-       (binaryfunc) Vector_mul,                                        /* __mul__ */
-       (binaryfunc) Vector_div,                                        /* __div__ */
-       (binaryfunc) NULL,                                                      /* __mod__ */
-       (binaryfunc) NULL,                                                      /* __divmod__ */
-       (ternaryfunc) NULL,                                                     /* __pow__ */
-       (unaryfunc) Vector_neg,                                         /* __neg__ */
-       (unaryfunc) NULL,                                                       /* __pos__ */
-       (unaryfunc) NULL,                                                       /* __abs__ */
-       (inquiry) NULL,                                                         /* __nonzero__ */
-       (unaryfunc) NULL,                                                       /* __invert__ */
-       (binaryfunc) NULL,                                                      /* __lshift__ */
-       (binaryfunc) NULL,                                                      /* __rshift__ */
-       (binaryfunc) NULL,                                                      /* __and__ */
-       (binaryfunc) NULL,                                                      /* __xor__ */
-       (binaryfunc) NULL,                                                      /* __or__ */
-       /*(coercion)*/ NULL,                                                    /* __coerce__ */
-       (unaryfunc) NULL,                                                       /* __int__ */
-       (unaryfunc) NULL,                                                       /* __long__ */
-       (unaryfunc) NULL,                                                       /* __float__ */
-       (unaryfunc) NULL,                                                       /* __oct__ */
-       (unaryfunc) NULL,                                                       /* __hex__ */
-       
-       /* Added in release 2.0 */
-       (binaryfunc) Vector_iadd,                                       /*__iadd__*/
-       (binaryfunc) Vector_isub,                                       /*__isub__*/
-       (binaryfunc) Vector_imul,                                       /*__imul__*/
-       (binaryfunc) Vector_idiv,                                       /*__idiv__*/
-       (binaryfunc) NULL,                                                      /*__imod__*/
-       (ternaryfunc) NULL,                                                     /*__ipow__*/
-       (binaryfunc) NULL,                                                      /*__ilshift__*/
-       (binaryfunc) NULL,                                                      /*__irshift__*/
-       (binaryfunc) NULL,                                                      /*__iand__*/
-       (binaryfunc) NULL,                                                      /*__ixor__*/
-       (binaryfunc) NULL,                                                      /*__ior__*/
-       /* Added in release 2.2 */
-       /* The following require the Py_TPFLAGS_HAVE_CLASS flag */
-       (binaryfunc) NULL,                                                      /*__floordiv__  __rfloordiv__*/
-       (binaryfunc) NULL,                                                      /*__truediv__ __rfloordiv__*/
-       (binaryfunc) NULL,                                                      /*__ifloordiv__*/
-       (binaryfunc) NULL,                                                      /*__itruediv__*/
-};
-#endif
 
 /*------------------PY_OBECT DEFINITION--------------------------*/
 
@@ -1872,13 +1814,7 @@ if len(unique) != len(items):
 */
 
 PyTypeObject vector_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
        /*  For printing, in format "<module>.<name>" */
        "vector",             /* char *tp_name; */
        sizeof( VectorObject ),         /* int tp_basicsize; */
@@ -1897,11 +1833,7 @@ PyTypeObject vector_Type = {
 
        &Vector_NumMethods,                       /* PyNumberMethods *tp_as_number; */
        &Vector_SeqMethods,                       /* PySequenceMethods *tp_as_sequence; */
-#if (PY_VERSION_HEX >= 0x03000000)
        &Vector_AsMapping,                       /* PyMappingMethods *tp_as_mapping; */
-#else
-       NULL,
-#endif
 
        /* More standard operations (here for binary compatibility) */
 
index f6babac7ed91ec5a00c9eaab0b18e9198ac3a2a3..a13ec0f80f3c26c05cbf59aafd4ce7cc4399c52c 100644 (file)
@@ -31,7 +31,6 @@
 #define EXPP_vector_h
 
 #include <Python.h>
-#include "../intern/bpy_compat.h"
 
 extern PyTypeObject vector_Type;
 #define VectorObject_Check(_v) PyObject_TypeCheck((_v), &vector_Type)
diff --git a/source/blender/python/intern/bpy_compat.h b/source/blender/python/intern/bpy_compat.h
deleted file mode 100644 (file)
index e999f57..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * Contributor(s): Campbell Barton
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/* This file is only to contain definitions to functions that enable
- * the python api to compile with different python versions.
- * no utility functions please
- */
-
-#ifndef BPY_COMPAT_H__
-#define BPY_COMPAT_H__
-
-/* if you are NOT using python 3.0 - define these */
-#if PY_VERSION_HEX < 0x03000000
-#define _PyUnicode_AsString PyString_AsString
-
-#undef PyUnicode_Check
-#define PyUnicode_Check PyString_Check
-
-#define PyLong_FromSsize_t PyInt_FromLong
-#define PyLong_AsSsize_t PyInt_AsLong
-
-#undef PyLong_Check
-#define PyLong_Check PyInt_Check
-
-
-#ifdef PyUnicode_FromString
-#undef PyUnicode_FromString
-#endif
-#define PyUnicode_FromString PyString_FromString
-
-#ifdef PyUnicode_FromFormat
-#undef PyUnicode_FromFormat
-#endif
-#define PyUnicode_FromFormat PyString_FromFormat
-
-#endif
-
-#ifndef Py_REFCNT
-#define Py_REFCNT(ob)          (((PyObject*)(ob))->ob_refcnt)
-#endif
-
-#ifndef Py_TYPE
-#define Py_TYPE(ob)            (((PyObject*)(ob))->ob_type)
-#endif
-
-#ifndef Py_TYPE
-#define Py_SIZE(ob)            (((PyVarObject*)(ob))->ob_size)
-#endif
-
-/* older then python 2.6 - define these */
-// #if (PY_VERSION_HEX < 0x02060000)
-// #endif
-
-/* older then python 2.5 - define these */
-#if (PY_VERSION_HEX < 0x02050000)
-#define Py_ssize_t ssize_t
-typedef Py_ssize_t (*lenfunc)(PyObject *);
-#ifndef Py_RETURN_NONE
-#define Py_RETURN_NONE return Py_BuildValue("O", Py_None)
-#endif
-#ifndef Py_RETURN_FALSE
-#define Py_RETURN_FALSE  return PyBool_FromLong(0) 
-#endif
-#ifndef Py_RETURN_TRUE
-#define Py_RETURN_TRUE  return PyBool_FromLong(1)
-#endif
-
-#define PyInt_FromSsize_t PyInt_FromLong
-#define PyNumber_AsSsize_t(ob, exc) PyInt_AsLong(ob)
-#define PyIndex_Check(ob) PyInt_Check(ob)
-
-
-#endif
-
-
-#if PY_VERSION_HEX < 0x03000000
-#ifndef ssizeargfunc
-#define ssizeargfunc intargfunc
-#endif
-
-#ifndef ssizessizeargfunc
-#define ssizessizeargfunc intintargfunc
-#endif
-
-#ifndef ssizeobjargproc
-#define ssizeobjargproc intobjargproc
-#endif
-
-#ifndef ssizessizeobjargproc
-#define ssizessizeobjargproc intintobjargproc
-#endif
-#endif
-
-
-
-/* defined in bpy_util.c */
-#if PY_VERSION_HEX < 0x03000000
-PyObject *Py_CmpToRich(int op, int cmp);
-#endif
-
-#ifndef Py_CmpToRich
-PyObject *Py_CmpToRich(int op, int cmp); /* bpy_util.c */
-#endif
-
-#endif /* BPY_COMPAT_H__ */
index 4fd4c9caf89d376e3b3fab25f34450c68aaf5895..e37e75ab80d3293b8dac0e078d9f12a33fef4d0b 100644 (file)
@@ -14,8 +14,6 @@
 #include "compile.h"           /* for the PyCodeObject */
 #include "eval.h"              /* for PyEval_EvalCode */
 
-#include "bpy_compat.h"
-
 #include "bpy_rna.h"
 #include "bpy_operator.h"
 #include "bpy_ui.h"
@@ -149,18 +147,11 @@ static void bpy_init_modules( void )
 
 
        /* stand alone utility modules not related to blender directly */
-       Geometry_Init("Geometry");
-       Mathutils_Init("Mathutils");
-       BGL_Init("BGL");
+       Geometry_Init();
+       Mathutils_Init();
+       BGL_Init();
 }
 
-#if (PY_VERSION_HEX < 0x02050000)
-PyObject *PyImport_ImportModuleLevel(char *name, void *a, void *b, void *c, int d)
-{
-       return PyImport_ImportModule(name);
-}
-#endif
-
 void BPY_update_modules( void )
 {
        PyObject *mod= PyImport_ImportModuleLevel("bpy", NULL, NULL, NULL, 0);
@@ -244,9 +235,7 @@ void BPY_start_python( int argc, char **argv )
 
        Py_Initialize(  );
        
-#if (PY_VERSION_HEX < 0x03000000)
-       PySys_SetArgv( argc, argv);
-#else
+       // PySys_SetArgv( argc, argv); // broken in py3, not a huge deal
        /* sigh, why do python guys not have a char** version anymore? :( */
        {
                int i;
@@ -258,7 +247,6 @@ void BPY_start_python( int argc, char **argv )
                PySys_SetObject("argv", py_argv);
                Py_DECREF(py_argv);
        }
-#endif
        
        /* Initialize thread support (also acquires lock) */
        PyEval_InitThreads();
index 034440d77ac9074281ff797b99b2534ba2328c57..e431f2a21e96810175c2f0d65b7d8e32d1128f5d 100644 (file)
@@ -30,7 +30,6 @@
 #include "bpy_operator.h"
 #include "bpy_operator_wrap.h"
 #include "bpy_rna.h" /* for setting arg props only - pyrna_py_to_prop() */
-#include "bpy_compat.h"
 #include "bpy_util.h"
 
 #include "WM_api.h"
index a0cbc4637a44c83fef1ccbc0f95019d217b5a85b..9a74bf0aee8af22e37dd943a38bcbd03e4a1e753 100644 (file)
@@ -37,7 +37,6 @@
 #include "RNA_define.h"
 
 #include "bpy_rna.h"
-#include "bpy_compat.h"
 #include "bpy_util.h"
 
 #include "../generic/bpy_internal_import.h" // our own imports
index c3fcb9a6036b002844c14665b20d2cf390ed13cc..6c959b9f42c3eeea44f0e289ebe42f079a3c0225 100644 (file)
@@ -23,7 +23,6 @@
  */
 
 #include "bpy_rna.h"
-#include "bpy_compat.h"
 #include "bpy_util.h"
 //#include "blendef.h"
 #include "BLI_dynstr.h"
@@ -904,10 +903,6 @@ static PyObject *prop_subscript_collection_str(BPy_PropertyRNA * self, char *key
 }
 /* static PyObject *prop_subscript_array_str(BPy_PropertyRNA * self, char *keyname) */
 
-
-
-
-#if PY_VERSION_HEX >= 0x03000000
 static PyObject *prop_subscript_collection_slice(BPy_PropertyRNA * self, int start, int stop)
 {
        PointerRNA newptr;
@@ -942,7 +937,6 @@ static PyObject *prop_subscript_array_slice(BPy_PropertyRNA * self, int start, i
 
        return list;
 }
-#endif
 
 static PyObject *prop_subscript_collection(BPy_PropertyRNA * self, PyObject *key)
 {
@@ -956,7 +950,6 @@ static PyObject *prop_subscript_collection(BPy_PropertyRNA * self, PyObject *key
 
                return prop_subscript_collection_int(self, i);
        }
-#if PY_VERSION_HEX >= 0x03000000
        else if (PySlice_Check(key)) {
                int len= RNA_property_collection_length(&self->ptr, self->prop);
                Py_ssize_t start, stop, step, slicelength;
@@ -975,7 +968,6 @@ static PyObject *prop_subscript_collection(BPy_PropertyRNA * self, PyObject *key
                        return NULL;
                }
        }
-#endif
        else {
                PyErr_Format(PyExc_TypeError, "invalid rna key, key must be a string or an int instead of %.200s instance.", Py_TYPE(key)->tp_name);
                return NULL;
@@ -993,7 +985,6 @@ static PyObject *prop_subscript_array(BPy_PropertyRNA * self, PyObject *key)
                        return NULL;
                return prop_subscript_array_int(self, PyLong_AsSsize_t(key));
        }
-#if PY_VERSION_HEX >= 0x03000000
        else if (PySlice_Check(key)) {
                int len= RNA_property_array_length(self->prop);
                Py_ssize_t start, stop, step, slicelength;
@@ -1012,7 +1003,6 @@ static PyObject *prop_subscript_array(BPy_PropertyRNA * self, PyObject *key)
                        return NULL;
                }
        }
-#endif
        else {
                PyErr_SetString(PyExc_AttributeError, "invalid key, key must be an int");
                return NULL;
@@ -1032,7 +1022,6 @@ static PyObject *pyrna_prop_subscript( BPy_PropertyRNA * self, PyObject *key )
 
 }
 
-#if PY_VERSION_HEX >= 0x03000000
 static int prop_subscript_ass_array_slice(BPy_PropertyRNA * self, int begin, int end, PyObject *value)
 {
        int count;
@@ -1049,7 +1038,6 @@ static int prop_subscript_ass_array_slice(BPy_PropertyRNA * self, int begin, int
 
        return 0;
 }
-#endif
 
 static int prop_subscript_ass_array_int(BPy_PropertyRNA * self, int keynum, PyObject *value)
 {
@@ -1087,7 +1075,6 @@ static int pyrna_prop_ass_subscript( BPy_PropertyRNA * self, PyObject *key, PyOb
 
                return prop_subscript_ass_array_int(self, i, value);
        }
-#if PY_VERSION_HEX >= 0x03000000
        else if (PySlice_Check(key)) {
                int len= RNA_property_array_length(self->prop);
                Py_ssize_t start, stop, step, slicelength;
@@ -1106,7 +1093,6 @@ static int pyrna_prop_ass_subscript( BPy_PropertyRNA * self, PyObject *key, PyOb
                        return -1;
                }
        }
-#endif
        else {
                PyErr_SetString(PyExc_AttributeError, "invalid key, key must be an int");
                return -1;
@@ -1458,7 +1444,7 @@ static PyObject *pyrna_prop_get(BPy_PropertyRNA *self, PyObject *args)
 }
 
 
-#if (PY_VERSION_HEX >= 0x03000000) /* foreach needs py3 */
+
 static void foreach_attr_type( BPy_PropertyRNA *self, char *attr,
                                                                        /* values to assign */
                                                                        RawPropertyType *raw_type, int *attr_tot, int *attr_signed )
@@ -1693,7 +1679,6 @@ static  PyObject *pyrna_prop_foreach_set(BPy_PropertyRNA *self, PyObject *args)
 {
        return foreach_getset(self, args, 1);
 }
-#endif /* #if (PY_VERSION_HEX >= 0x03000000) */
 
 /* A bit of a kludge, make a list out of a collection or array,
  * then return the lists iter function, not especially fast but convenient for now */
@@ -1744,11 +1729,10 @@ static struct PyMethodDef pyrna_prop_methods[] = {
        
        {"get", (PyCFunction)pyrna_prop_get, METH_VARARGS, NULL},
 
-#if (PY_VERSION_HEX >= 0x03000000)
        /* array accessor function */
        {"foreach_get", (PyCFunction)pyrna_prop_foreach_get, METH_VARARGS, NULL},
        {"foreach_set", (PyCFunction)pyrna_prop_foreach_set, METH_VARARGS, NULL},
-#endif
+
        {NULL, NULL, 0, NULL}
 };
 
@@ -2112,13 +2096,7 @@ static PyObject * pyrna_func_call(PyObject * self, PyObject *args, PyObject *kw)
 
 /*-----------------------BPy_StructRNA method def------------------------------*/
 PyTypeObject pyrna_struct_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
        "StructRNA",                    /* tp_name */
        sizeof( BPy_StructRNA ),        /* tp_basicsize */
        0,                      /* tp_itemsize */
@@ -2197,14 +2175,7 @@ PyTypeObject pyrna_struct_Type = {
 
 /*-----------------------BPy_PropertyRNA method def------------------------------*/
 PyTypeObject pyrna_prop_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
-       
        "PropertyRNA",          /* tp_name */
        sizeof( BPy_PropertyRNA ),                      /* tp_basicsize */
        0,                      /* tp_itemsize */
@@ -2555,7 +2526,6 @@ static struct PyMethodDef props_methods[] = {
        {NULL, NULL, 0, NULL}
 };
 
-#if PY_VERSION_HEX >= 0x03000000
 static struct PyModuleDef props_module = {
        PyModuleDef_HEAD_INIT,
        "bpy.props",
@@ -2564,16 +2534,11 @@ static struct PyModuleDef props_module = {
        props_methods,
        NULL, NULL, NULL, NULL
 };
-#endif
 
 PyObject *BPY_rna_props( void )
 {
        PyObject *submodule;
-#if PY_VERSION_HEX >= 0x03000000
        submodule= PyModule_Create(&props_module);
-#else /* Py2.x */
-       submodule= Py_InitModule3( "bpy.props", props_methods, "" );
-#endif
        
        /* INCREF since its its assumed that all these functions return the
         * module with a new ref like PyDict_New, since they are passed to
index 59e566b3b376dc5a3281a581360bcb0f1330ea38..af3588f458c9b4bb4f8ba8f880d188c42ab0eac3 100644 (file)
@@ -26,7 +26,6 @@
 #include "bpy_util.h"
 #include "bpy_rna.h" /* for rna buttons */
 #include "bpy_operator.h" /* for setting button operator properties */
-#include "bpy_compat.h"
 
 #include "WM_types.h" /* for WM_OP_INVOKE_DEFAULT & friends */
 
@@ -47,7 +46,6 @@ static struct PyMethodDef ui_methods[] = {
        {NULL, NULL, 0, NULL}
 };
 
-#if PY_VERSION_HEX >= 0x03000000
 static struct PyModuleDef ui_module = {
        PyModuleDef_HEAD_INIT,
        "bpy.ui",
@@ -56,16 +54,11 @@ static struct PyModuleDef ui_module = {
        ui_methods,
        NULL, NULL, NULL, NULL
 };
-#endif
 
 PyObject *BPY_ui_module( void )
 {
        PyObject *submodule, *mod;
-#if PY_VERSION_HEX >= 0x03000000
        submodule= PyModule_Create(&ui_module);
-#else /* Py2.x */
-       submodule= Py_InitModule3( "bpy.ui", ui_methods, "" );
-#endif
        
        /* INCREF since its its assumed that all these functions return the
         * module with a new ref like PyDict_New, since they are passed to
index 3084cc1f8712d26aadedc9e6942423118592a8d4..25967d96dabe8b2eb8a76341a113ed2d43be8ace 100644 (file)
@@ -373,11 +373,7 @@ PyObject *BPY_exception_buffer(void)
         * string_io = StringIO.StringIO()
         */
        
-#if PY_VERSION_HEX < 0x03000000
-       if(! (string_io_mod= PyImport_ImportModule("StringIO")) ) {
-#else
        if(! (string_io_mod= PyImport_ImportModule("io")) ) {
-#endif
                goto error_cleanup;
        } else if (! (string_io = PyObject_CallMethod(string_io_mod, "StringIO", NULL))) {
                goto error_cleanup;
index df204b7b90dc098a0d19e5b0816487a7a7310d63..6751ab59396971629c1fd9df145c3eb59dc86aaf 100644 (file)
 #ifndef BPY_UTIL_H
 #define BPY_UTIL_H
 
-#include "bpy_compat.h"
+#if PY_VERSION_HEX <  0x03010000
+#error Python versions below 3.1 are not supported anymore, you'll need to update your python.
+#endif
+
 #include "RNA_types.h" /* for EnumPropertyItem only */
 
 struct EnumPropertyItem;
index 30055a717e3c17151c3af949655f8936f5af64fb..5a3629cfcd33b78de323dbf9f5e1d8cf62b87382 100644 (file)
@@ -1006,56 +1006,50 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel,
 /* ------------------------------------------------------------------------- */
 
 PyTypeObject BL_ActionActuator::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
-               "BL_ActionActuator",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,0,0,0,0,0,0,0,0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &SCA_IActuator::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "BL_ActionActuator",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &SCA_IActuator::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 PyMethodDef BL_ActionActuator::Methods[] = {
        //Deprecated ----->
-       {"setAction", (PyCFunction) BL_ActionActuator::sPySetAction, METH_VARARGS, (PY_METHODCHAR)SetAction_doc},
-       {"setStart", (PyCFunction) BL_ActionActuator::sPySetStart, METH_VARARGS, (PY_METHODCHAR)SetStart_doc},
-       {"setEnd", (PyCFunction) BL_ActionActuator::sPySetEnd, METH_VARARGS, (PY_METHODCHAR)SetEnd_doc},
-       {"setBlendin", (PyCFunction) BL_ActionActuator::sPySetBlendin, METH_VARARGS, (PY_METHODCHAR)SetBlendin_doc},
-       {"setPriority", (PyCFunction) BL_ActionActuator::sPySetPriority, METH_VARARGS, (PY_METHODCHAR)SetPriority_doc},
-       {"setFrame", (PyCFunction) BL_ActionActuator::sPySetFrame, METH_VARARGS, (PY_METHODCHAR)SetFrame_doc},
-       {"setProperty", (PyCFunction) BL_ActionActuator::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
-       {"setFrameProperty", (PyCFunction) BL_ActionActuator::sPySetFrameProperty, METH_VARARGS, (PY_METHODCHAR)SetFrameProperty_doc},
-       {"setBlendtime", (PyCFunction) BL_ActionActuator::sPySetBlendtime, METH_VARARGS, (PY_METHODCHAR)SetBlendtime_doc},
-
-       {"getAction", (PyCFunction) BL_ActionActuator::sPyGetAction, METH_VARARGS, (PY_METHODCHAR)GetAction_doc},
-       {"getStart", (PyCFunction) BL_ActionActuator::sPyGetStart, METH_VARARGS, (PY_METHODCHAR)GetStart_doc},
-       {"getEnd", (PyCFunction) BL_ActionActuator::sPyGetEnd, METH_VARARGS, (PY_METHODCHAR)GetEnd_doc},
-       {"getBlendin", (PyCFunction) BL_ActionActuator::sPyGetBlendin, METH_VARARGS, (PY_METHODCHAR)GetBlendin_doc},
-       {"getPriority", (PyCFunction) BL_ActionActuator::sPyGetPriority, METH_VARARGS, (PY_METHODCHAR)GetPriority_doc},
-       {"getFrame", (PyCFunction) BL_ActionActuator::sPyGetFrame, METH_VARARGS, (PY_METHODCHAR)GetFrame_doc},
-       {"getProperty", (PyCFunction) BL_ActionActuator::sPyGetProperty, METH_VARARGS, (PY_METHODCHAR)GetProperty_doc},
-       {"getFrameProperty", (PyCFunction) BL_ActionActuator::sPyGetFrameProperty, METH_VARARGS, (PY_METHODCHAR)GetFrameProperty_doc},
+       {"setAction", (PyCFunction) BL_ActionActuator::sPySetAction, METH_VARARGS, (const char *)SetAction_doc},
+       {"setStart", (PyCFunction) BL_ActionActuator::sPySetStart, METH_VARARGS, (const char *)SetStart_doc},
+       {"setEnd", (PyCFunction) BL_ActionActuator::sPySetEnd, METH_VARARGS, (const char *)SetEnd_doc},
+       {"setBlendin", (PyCFunction) BL_ActionActuator::sPySetBlendin, METH_VARARGS, (const char *)SetBlendin_doc},
+       {"setPriority", (PyCFunction) BL_ActionActuator::sPySetPriority, METH_VARARGS, (const char *)SetPriority_doc},
+       {"setFrame", (PyCFunction) BL_ActionActuator::sPySetFrame, METH_VARARGS, (const char *)SetFrame_doc},
+       {"setProperty", (PyCFunction) BL_ActionActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc},
+       {"setFrameProperty", (PyCFunction) BL_ActionActuator::sPySetFrameProperty, METH_VARARGS, (const char *)SetFrameProperty_doc},
+       {"setBlendtime", (PyCFunction) BL_ActionActuator::sPySetBlendtime, METH_VARARGS, (const char *)SetBlendtime_doc},
+
+       {"getAction", (PyCFunction) BL_ActionActuator::sPyGetAction, METH_VARARGS, (const char *)GetAction_doc},
+       {"getStart", (PyCFunction) BL_ActionActuator::sPyGetStart, METH_VARARGS, (const char *)GetStart_doc},
+       {"getEnd", (PyCFunction) BL_ActionActuator::sPyGetEnd, METH_VARARGS, (const char *)GetEnd_doc},
+       {"getBlendin", (PyCFunction) BL_ActionActuator::sPyGetBlendin, METH_VARARGS, (const char *)GetBlendin_doc},
+       {"getPriority", (PyCFunction) BL_ActionActuator::sPyGetPriority, METH_VARARGS, (const char *)GetPriority_doc},
+       {"getFrame", (PyCFunction) BL_ActionActuator::sPyGetFrame, METH_VARARGS, (const char *)GetFrame_doc},
+       {"getProperty", (PyCFunction) BL_ActionActuator::sPyGetProperty, METH_VARARGS, (const char *)GetProperty_doc},
+       {"getFrameProperty", (PyCFunction) BL_ActionActuator::sPyGetFrameProperty, METH_VARARGS, (const char *)GetFrameProperty_doc},
        {"getChannel", (PyCFunction) BL_ActionActuator::sPyGetChannel, METH_O},
-       {"getType", (PyCFunction) BL_ActionActuator::sPyGetType, METH_VARARGS, (PY_METHODCHAR)GetType_doc},
-       {"setType", (PyCFunction) BL_ActionActuator::sPySetType, METH_VARARGS, (PY_METHODCHAR)SetType_doc},
+       {"getType", (PyCFunction) BL_ActionActuator::sPyGetType, METH_VARARGS, (const char *)GetType_doc},
+       {"setType", (PyCFunction) BL_ActionActuator::sPySetType, METH_VARARGS, (const char *)SetType_doc},
        {"getContinue", (PyCFunction) BL_ActionActuator::sPyGetContinue, METH_NOARGS, 0},       
        {"setContinue", (PyCFunction) BL_ActionActuator::sPySetContinue, METH_O, 0},
        //<------
index 970539777f49a845ae62d8145253e8608e58ff3f..4af9a6c83a965590637a55c55edab7b26141879a 100644 (file)
@@ -411,55 +411,49 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame)
 /* Integration hooks ------------------------------------------------------- */
 
 PyTypeObject BL_ShapeActionActuator::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
-               "BL_ShapeActionActuator",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,0,0,0,0,0,0,0,0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &SCA_IActuator::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "BL_ShapeActionActuator",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &SCA_IActuator::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 
 PyMethodDef BL_ShapeActionActuator::Methods[] = {
-       {"setAction", (PyCFunction) BL_ShapeActionActuator::sPySetAction, METH_VARARGS, (PY_METHODCHAR)SetAction_doc},
-       {"setStart", (PyCFunction) BL_ShapeActionActuator::sPySetStart, METH_VARARGS, (PY_METHODCHAR)SetStart_doc},
-       {"setEnd", (PyCFunction) BL_ShapeActionActuator::sPySetEnd, METH_VARARGS, (PY_METHODCHAR)SetEnd_doc},
-       {"setBlendin", (PyCFunction) BL_ShapeActionActuator::sPySetBlendin, METH_VARARGS, (PY_METHODCHAR)SetBlendin_doc},
-       {"setPriority", (PyCFunction) BL_ShapeActionActuator::sPySetPriority, METH_VARARGS, (PY_METHODCHAR)SetPriority_doc},
-       {"setFrame", (PyCFunction) BL_ShapeActionActuator::sPySetFrame, METH_VARARGS, (PY_METHODCHAR)SetFrame_doc},
-       {"setProperty", (PyCFunction) BL_ShapeActionActuator::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
-       {"setFrameProperty", (PyCFunction) BL_ShapeActionActuator::sPySetFrameProperty, METH_VARARGS, (PY_METHODCHAR)SetFrameProperty_doc},
-       {"setBlendtime", (PyCFunction) BL_ShapeActionActuator::sPySetBlendtime, METH_VARARGS, (PY_METHODCHAR)SetBlendtime_doc},
-
-       {"getAction", (PyCFunction) BL_ShapeActionActuator::sPyGetAction, METH_NOARGS, (PY_METHODCHAR)GetAction_doc},
-       {"getStart", (PyCFunction) BL_ShapeActionActuator::sPyGetStart, METH_NOARGS, (PY_METHODCHAR)GetStart_doc},
-       {"getEnd", (PyCFunction) BL_ShapeActionActuator::sPyGetEnd, METH_NOARGS, (PY_METHODCHAR)GetEnd_doc},
-       {"getBlendin", (PyCFunction) BL_ShapeActionActuator::sPyGetBlendin, METH_NOARGS, (PY_METHODCHAR)GetBlendin_doc},
-       {"getPriority", (PyCFunction) BL_ShapeActionActuator::sPyGetPriority, METH_NOARGS, (PY_METHODCHAR)GetPriority_doc},
-       {"getFrame", (PyCFunction) BL_ShapeActionActuator::sPyGetFrame, METH_NOARGS, (PY_METHODCHAR)GetFrame_doc},
-       {"getProperty", (PyCFunction) BL_ShapeActionActuator::sPyGetProperty, METH_NOARGS, (PY_METHODCHAR)GetProperty_doc},
-       {"getFrameProperty", (PyCFunction) BL_ShapeActionActuator::sPyGetFrameProperty, METH_NOARGS, (PY_METHODCHAR)GetFrameProperty_doc},
-       {"getType", (PyCFunction) BL_ShapeActionActuator::sPyGetType, METH_NOARGS, (PY_METHODCHAR)GetType_doc}, 
-       {"setType", (PyCFunction) BL_ShapeActionActuator::sPySetType, METH_NOARGS, (PY_METHODCHAR)SetType_doc},
+       {"setAction", (PyCFunction) BL_ShapeActionActuator::sPySetAction, METH_VARARGS, (const char *)SetAction_doc},
+       {"setStart", (PyCFunction) BL_ShapeActionActuator::sPySetStart, METH_VARARGS, (const char *)SetStart_doc},
+       {"setEnd", (PyCFunction) BL_ShapeActionActuator::sPySetEnd, METH_VARARGS, (const char *)SetEnd_doc},
+       {"setBlendin", (PyCFunction) BL_ShapeActionActuator::sPySetBlendin, METH_VARARGS, (const char *)SetBlendin_doc},
+       {"setPriority", (PyCFunction) BL_ShapeActionActuator::sPySetPriority, METH_VARARGS, (const char *)SetPriority_doc},
+       {"setFrame", (PyCFunction) BL_ShapeActionActuator::sPySetFrame, METH_VARARGS, (const char *)SetFrame_doc},
+       {"setProperty", (PyCFunction) BL_ShapeActionActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc},
+       {"setFrameProperty", (PyCFunction) BL_ShapeActionActuator::sPySetFrameProperty, METH_VARARGS, (const char *)SetFrameProperty_doc},
+       {"setBlendtime", (PyCFunction) BL_ShapeActionActuator::sPySetBlendtime, METH_VARARGS, (const char *)SetBlendtime_doc},
+
+       {"getAction", (PyCFunction) BL_ShapeActionActuator::sPyGetAction, METH_NOARGS, (const char *)GetAction_doc},
+       {"getStart", (PyCFunction) BL_ShapeActionActuator::sPyGetStart, METH_NOARGS, (const char *)GetStart_doc},
+       {"getEnd", (PyCFunction) BL_ShapeActionActuator::sPyGetEnd, METH_NOARGS, (const char *)GetEnd_doc},
+       {"getBlendin", (PyCFunction) BL_ShapeActionActuator::sPyGetBlendin, METH_NOARGS, (const char *)GetBlendin_doc},
+       {"getPriority", (PyCFunction) BL_ShapeActionActuator::sPyGetPriority, METH_NOARGS, (const char *)GetPriority_doc},
+       {"getFrame", (PyCFunction) BL_ShapeActionActuator::sPyGetFrame, METH_NOARGS, (const char *)GetFrame_doc},
+       {"getProperty", (PyCFunction) BL_ShapeActionActuator::sPyGetProperty, METH_NOARGS, (const char *)GetProperty_doc},
+       {"getFrameProperty", (PyCFunction) BL_ShapeActionActuator::sPyGetFrameProperty, METH_NOARGS, (const char *)GetFrameProperty_doc},
+       {"getType", (PyCFunction) BL_ShapeActionActuator::sPyGetType, METH_NOARGS, (const char *)GetType_doc},  
+       {"setType", (PyCFunction) BL_ShapeActionActuator::sPySetType, METH_NOARGS, (const char *)SetType_doc},
        {NULL,NULL} //Sentinel
 };
 
index 38b00dcc8fb000f81c24b1ee67833323d3ad0c50..5f45cdc48a26f6e8d4fef5a74d3785910cb1a756 100644 (file)
@@ -242,15 +242,10 @@ static  PySequenceMethods listvalue_as_sequence = {
        listvalue_buffer_concat, /*sq_concat*/
        NULL, /*sq_repeat*/
        listvalue_buffer_item, /*sq_item*/
-#if (PY_VERSION_HEX >= 0x03000000) // TODO, slicing in py3?
-       NULL,
-       NULL,
-       NULL,
-#else
-       listvalue_buffer_slice, /*sq_slice*/
+// TODO, slicing in py3
+       NULL, // listvalue_buffer_slice, /*sq_slice*/
        NULL, /*sq_ass_item*/
        NULL, /*sq_ass_slice*/
-#endif
        (objobjproc)listvalue_buffer_contains,  /* sq_contains */
 };
 
@@ -266,13 +261,7 @@ static  PyMappingMethods instance_as_mapping = {
 
 
 PyTypeObject CListValue::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
        "CListValue",                   /*tp_name*/
        sizeof(PyObjectPlus_Proxy), /*tp_basicsize*/
        0,                              /*tp_itemsize*/
index 04454f8232a47a81f113f97a5c4b6fdb3734c22c..5be703f0fa4dbc48de380e47861f37a936ce3e2d 100644 (file)
 
 
 PyTypeObject PyObjectPlus::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
        "PyObjectPlus",                 /*tp_name*/
        sizeof(PyObjectPlus_Proxy),             /*tp_basicsize*/
        0,                              /*tp_itemsize*/
index a18df9d36a9ccf894b588ea74e14b56fcef9a411..d68aa9f041007c5c17faa7901b240a81d6e6c7fa 100644 (file)
@@ -51,44 +51,6 @@ extern "C" {
 }
 #endif
 
-extern "C" {
-#include "../../blender/python/intern/bpy_compat.h"
-}
-
-
-/*
-   Py_RETURN_NONE
-   Python 2.4 macro.
-   defined here until we switch to 2.4
-   also in api2_2x/gen_utils.h 
-*/
-#ifndef Py_RETURN_NONE
-#define Py_RETURN_NONE  return Py_INCREF(Py_None), Py_None
-#endif
-#ifndef Py_RETURN_FALSE
-#define Py_RETURN_FALSE  return Py_INCREF(Py_False), Py_False
-#endif
-#ifndef Py_RETURN_TRUE
-#define Py_RETURN_TRUE  return Py_INCREF(Py_True), Py_True
-#endif
-
-/*  for pre Py 2.5 */
-#if PY_VERSION_HEX < 0x02050000
-typedef int Py_ssize_t;
-typedef Py_ssize_t (*lenfunc)(PyObject *);
-#define PY_SSIZE_T_MAX INT_MAX
-#define PY_SSIZE_T_MIN INT_MIN
-#define PY_METHODCHAR char *
-#else
-/* Py 2.5 and later */
-#define  intargfunc  ssizeargfunc
-#define intintargfunc  ssizessizeargfunc
-#define PY_METHODCHAR const char *
-#endif
-
-#include "descrobject.h"
-
-
 static inline void Py_Fatal(const char *M) {
        fprintf(stderr, "%s\n", M);
        exit(-1);
@@ -230,13 +192,13 @@ typedef struct {
  * Method table macro (with doc)
  */
 #define KX_PYMETHODTABLE(class_name, method_name) \
-       {#method_name , (PyCFunction) class_name::sPy##method_name, METH_VARARGS, (PY_METHODCHAR)class_name::method_name##_doc}
+       {#method_name , (PyCFunction) class_name::sPy##method_name, METH_VARARGS, (const char *)class_name::method_name##_doc}
 
 #define KX_PYMETHODTABLE_O(class_name, method_name) \
-       {#method_name , (PyCFunction) class_name::sPy##method_name, METH_O, (PY_METHODCHAR)class_name::method_name##_doc}
+       {#method_name , (PyCFunction) class_name::sPy##method_name, METH_O, (const char *)class_name::method_name##_doc}
 
 #define KX_PYMETHODTABLE_NOARGS(class_name, method_name) \
-       {#method_name , (PyCFunction) class_name::sPy##method_name, METH_NOARGS, (PY_METHODCHAR)class_name::method_name##_doc}
+       {#method_name , (PyCFunction) class_name::sPy##method_name, METH_NOARGS, (const char *)class_name::method_name##_doc}
 
 /**
  * Function implementation macro
index 2759b68b62e4e35353371a180fa42e16afac4e17..04bcc3a556141a1040f6b550d2be55bbde1a7c8e 100644 (file)
@@ -36,13 +36,7 @@ double CValue::m_sZeroVec[3] = {0.0,0.0,0.0};
 #ifndef NO_EXP_PYTHON_EMBEDDING
 
 PyTypeObject CValue::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
        "CValue",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -594,12 +588,6 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix)
        {
                vallie = new CFloatValue( (float)PyFloat_AsDouble(pyobj) );
        } else
-#if PY_VERSION_HEX < 0x03000000
-       if (PyInt_Check(pyobj))
-       {
-               vallie = new CIntValue( (cInt)PyInt_AS_LONG(pyobj) );
-       } else
-#endif
        if (PyLong_Check(pyobj))
        {
                vallie = new CIntValue( (cInt)PyLong_AsLongLong(pyobj) );
index 04d46e259d3b37309820fe154572f9a35085a133..9dfb5ddc38f938557054eaaf02f1108312ab88e8 100644 (file)
@@ -107,31 +107,25 @@ void SCA_2DFilterActuator::SetShaderText(const char *text)
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_2DFilterActuator::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_2DFilterActuator",
-        sizeof(PyObjectPlus_Proxy),
-        0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,0,0,0,0,0,0,0,0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &SCA_IActuator::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "SCA_2DFilterActuator",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &SCA_IActuator::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 PyMethodDef SCA_2DFilterActuator::Methods[] = {
index 78e1350428ed855f2b5dd2d3a96cfe72aac80d4e..ac9e238bd64262e0b45e7f951805c0bc352a15d3 100644 (file)
@@ -99,13 +99,7 @@ CValue* SCA_ANDController::GetReplica()
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_ANDController::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_ANDController",
        sizeof(PyObjectPlus_Proxy),
        0,
index bdcc923e1d9cd4ff05ddec980dc8e0e8ad4dbb02..11ea089270a32ff63969cb6a2860c59a046cff74 100644 (file)
@@ -121,13 +121,7 @@ void SCA_ActuatorSensor::Update()
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_ActuatorSensor::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_ActuatorSensor",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -150,8 +144,8 @@ PyTypeObject SCA_ActuatorSensor::Type = {
 
 PyMethodDef SCA_ActuatorSensor::Methods[] = {
        //Deprecated functions ------>
-       {"getActuator", (PyCFunction) SCA_ActuatorSensor::sPyGetActuator, METH_NOARGS, (PY_METHODCHAR)GetActuator_doc},
-       {"setActuator", (PyCFunction) SCA_ActuatorSensor::sPySetActuator, METH_VARARGS, (PY_METHODCHAR)SetActuator_doc},
+       {"getActuator", (PyCFunction) SCA_ActuatorSensor::sPyGetActuator, METH_NOARGS, (const char *)GetActuator_doc},
+       {"setActuator", (PyCFunction) SCA_ActuatorSensor::sPySetActuator, METH_VARARGS, (const char *)SetActuator_doc},
        //<----- Deprecated
        {NULL,NULL} //Sentinel
 };
index ddb54c580b89cdef631b35bfe270154dcb4cc079..35b035f646606de13b550b35b1cdd56629bd6dcf 100644 (file)
@@ -104,13 +104,7 @@ bool SCA_AlwaysSensor::Evaluate()
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_AlwaysSensor::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_AlwaysSensor",
        sizeof(PyObjectPlus_Proxy),
        0,
index 11c6996a0a15d0de2d61c0b0dfa34dded64d33d9..0d563db910e8219ce45f897fbcf25b9d67acca94 100644 (file)
@@ -130,13 +130,7 @@ bool SCA_DelaySensor::Evaluate()
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_DelaySensor::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_DelaySensor",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -160,13 +154,13 @@ PyTypeObject SCA_DelaySensor::Type = {
 PyMethodDef SCA_DelaySensor::Methods[] = {
        //Deprecated functions ------>
        /* setProperty */
-       {"setDelay", (PyCFunction) SCA_DelaySensor::sPySetDelay, METH_VARARGS, (PY_METHODCHAR)SetDelay_doc},
-       {"setDuration", (PyCFunction) SCA_DelaySensor::sPySetDuration, METH_VARARGS, (PY_METHODCHAR)SetDuration_doc},
-       {"setRepeat", (PyCFunction) SCA_DelaySensor::sPySetRepeat, METH_VARARGS, (PY_METHODCHAR)SetRepeat_doc},
+       {"setDelay", (PyCFunction) SCA_DelaySensor::sPySetDelay, METH_VARARGS, (const char *)SetDelay_doc},
+       {"setDuration", (PyCFunction) SCA_DelaySensor::sPySetDuration, METH_VARARGS, (const char *)SetDuration_doc},
+       {"setRepeat", (PyCFunction) SCA_DelaySensor::sPySetRepeat, METH_VARARGS, (const char *)SetRepeat_doc},
        /* getProperty */
-       {"getDelay", (PyCFunction) SCA_DelaySensor::sPyGetDelay, METH_NOARGS, (PY_METHODCHAR)GetDelay_doc},
-       {"getDuration", (PyCFunction) SCA_DelaySensor::sPyGetDuration, METH_NOARGS, (PY_METHODCHAR)GetDuration_doc},
-       {"getRepeat", (PyCFunction) SCA_DelaySensor::sPyGetRepeat, METH_NOARGS, (PY_METHODCHAR)GetRepeat_doc},
+       {"getDelay", (PyCFunction) SCA_DelaySensor::sPyGetDelay, METH_NOARGS, (const char *)GetDelay_doc},
+       {"getDuration", (PyCFunction) SCA_DelaySensor::sPyGetDuration, METH_NOARGS, (const char *)GetDuration_doc},
+       {"getRepeat", (PyCFunction) SCA_DelaySensor::sPyGetRepeat, METH_NOARGS, (const char *)GetRepeat_doc},
        //<----- Deprecated
        {NULL,NULL} //Sentinel
 };
index 7cbb728753a42c3f2ddb984a4331112e61d7e488..24c39563c2880aef666f3d162eb2dea7e1fa28c7 100644 (file)
@@ -199,31 +199,25 @@ void SCA_IController::ApplyState(unsigned int state)
 /* Python api */
 
 PyTypeObject SCA_IController::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_IController",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,0,0,0,0,0,0,0,0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &SCA_ILogicBrick::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "SCA_IController",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &SCA_ILogicBrick::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 PyMethodDef SCA_IController::Methods[] = {
index ccb79a2d49fd147727262afaafed451f8f6268df..2c64e02913d1ba7c294c6bba6bdc716b6f91ea07 100644 (file)
@@ -177,13 +177,7 @@ CValue* SCA_ILogicBrick::GetEvent()
 /* python stuff */
 
 PyTypeObject SCA_ILogicBrick::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_ILogicBrick",
        sizeof(PyObjectPlus_Proxy),
        0,
index 6cd11f9e5531b262dd7d55020f4969dd74d3e6c4..2bffd029bd4d980606b4357d524c1579604b1a9b 100644 (file)
@@ -288,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,
index 4c1e0bd01c41d2051b7fbaedf84f424e144e1c6e..b018124dccac27096d170f57d64a2d8acf7c499a 100644 (file)
@@ -472,13 +472,7 @@ KX_PYMETHODDEF_DOC_NOARGS(SCA_ISensor, reset,
 /* ----------------------------------------------- */
 
 PyTypeObject SCA_ISensor::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_ISensor",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -502,29 +496,29 @@ PyTypeObject SCA_ISensor::Type = {
 PyMethodDef SCA_ISensor::Methods[] = {
        //Deprecated functions ----->
        {"isPositive", (PyCFunction) SCA_ISensor::sPyIsPositive, 
-        METH_NOARGS, (PY_METHODCHAR)IsPositive_doc},
+        METH_NOARGS, (const char *)IsPositive_doc},
        {"isTriggered", (PyCFunction) SCA_ISensor::sPyIsTriggered, 
-        METH_VARARGS, (PY_METHODCHAR)IsTriggered_doc},
+        METH_VARARGS, (const char *)IsTriggered_doc},
        {"getUsePosPulseMode", (PyCFunction) SCA_ISensor::sPyGetUsePosPulseMode, 
-        METH_NOARGS, (PY_METHODCHAR)GetUsePosPulseMode_doc},
+        METH_NOARGS, (const char *)GetUsePosPulseMode_doc},
        {"setUsePosPulseMode", (PyCFunction) SCA_ISensor::sPySetUsePosPulseMode, 
-        METH_VARARGS, (PY_METHODCHAR)SetUsePosPulseMode_doc},
+        METH_VARARGS, (const char *)SetUsePosPulseMode_doc},
        {"getFrequency", (PyCFunction) SCA_ISensor::sPyGetFrequency, 
-        METH_NOARGS, (PY_METHODCHAR)GetFrequency_doc},
+        METH_NOARGS, (const char *)GetFrequency_doc},
        {"setFrequency", (PyCFunction) SCA_ISensor::sPySetFrequency, 
-        METH_VARARGS, (PY_METHODCHAR)SetFrequency_doc},
+        METH_VARARGS, (const char *)SetFrequency_doc},
        {"getUseNegPulseMode", (PyCFunction) SCA_ISensor::sPyGetUseNegPulseMode, 
-        METH_NOARGS, (PY_METHODCHAR)GetUseNegPulseMode_doc},
+        METH_NOARGS, (const char *)GetUseNegPulseMode_doc},
        {"setUseNegPulseMode", (PyCFunction) SCA_ISensor::sPySetUseNegPulseMode, 
-        METH_VARARGS, (PY_METHODCHAR)SetUseNegPulseMode_doc},
+        METH_VARARGS, (const char *)SetUseNegPulseMode_doc},
        {"getInvert", (PyCFunction) SCA_ISensor::sPyGetInvert, 
-        METH_NOARGS, (PY_METHODCHAR)GetInvert_doc},
+        METH_NOARGS, (const char *)GetInvert_doc},
        {"setInvert", (PyCFunction) SCA_ISensor::sPySetInvert, 
-        METH_VARARGS, (PY_METHODCHAR)SetInvert_doc},
+        METH_VARARGS, (const char *)SetInvert_doc},
        {"getLevel", (PyCFunction) SCA_ISensor::sPyGetLevel, 
-        METH_NOARGS, (PY_METHODCHAR)GetLevel_doc},
+        METH_NOARGS, (const char *)GetLevel_doc},
        {"setLevel", (PyCFunction) SCA_ISensor::sPySetLevel, 
-        METH_VARARGS, (PY_METHODCHAR)SetLevel_doc},
+        METH_VARARGS, (const char *)SetLevel_doc},
         //<----- Deprecated
        KX_PYMETHODTABLE_NOARGS(SCA_ISensor, reset),
        {NULL,NULL} //Sentinel
index f55921e648b1d6456942593e4054ae413240b8a8..02be7cd6a0846b11983e0021cfa0532bf50652b1 100644 (file)
@@ -252,54 +252,48 @@ bool SCA_JoystickSensor::isValid(SCA_JoystickSensor::KX_JOYSENSORMODE m)
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_JoystickSensor::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_JoystickSensor",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,0,0,0,0,0,0,0,0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &SCA_ISensor::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "SCA_JoystickSensor",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &SCA_ISensor::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 PyMethodDef SCA_JoystickSensor::Methods[] = {
        //Deprecated functions ------>
-       {"getIndex",     (PyCFunction) SCA_JoystickSensor::sPyGetIndex,         METH_NOARGS,    (PY_METHODCHAR)GetIndex_doc},
-       {"setIndex",     (PyCFunction) SCA_JoystickSensor::sPySetIndex,         METH_O,                 (PY_METHODCHAR)SetIndex_doc},
-       {"getAxis",      (PyCFunction) SCA_JoystickSensor::sPyGetAxis,          METH_NOARGS,    (PY_METHODCHAR)GetAxis_doc},
-       {"setAxis",      (PyCFunction) SCA_JoystickSensor::sPySetAxis,          METH_VARARGS,   (PY_METHODCHAR)SetAxis_doc},
-       {"getAxisValue", (PyCFunction) SCA_JoystickSensor::sPyGetAxisValue,     METH_NOARGS,    (PY_METHODCHAR)GetAxisValue_doc},
-       {"getThreshold", (PyCFunction) SCA_JoystickSensor::sPyGetThreshold, METH_NOARGS,        (PY_METHODCHAR)GetThreshold_doc},
-       {"setThreshold", (PyCFunction) SCA_JoystickSensor::sPySetThreshold, METH_VARARGS,       (PY_METHODCHAR)SetThreshold_doc},
-       {"getButton",    (PyCFunction) SCA_JoystickSensor::sPyGetButton,        METH_NOARGS,    (PY_METHODCHAR)GetButton_doc},
-       {"setButton",    (PyCFunction) SCA_JoystickSensor::sPySetButton,        METH_O,                 (PY_METHODCHAR)SetButton_doc},
-       {"getHat",               (PyCFunction) SCA_JoystickSensor::sPyGetHat,           METH_NOARGS,    (PY_METHODCHAR)GetHat_doc},
-       {"setHat",               (PyCFunction) SCA_JoystickSensor::sPySetHat,           METH_VARARGS,   (PY_METHODCHAR)SetHat_doc},
-       {"getNumAxes",   (PyCFunction) SCA_JoystickSensor::sPyNumberOfAxes,     METH_NOARGS,    (PY_METHODCHAR)NumberOfAxes_doc},
-       {"getNumButtons",(PyCFunction) SCA_JoystickSensor::sPyNumberOfButtons,METH_NOARGS,      (PY_METHODCHAR)NumberOfButtons_doc},
-       {"getNumHats",   (PyCFunction) SCA_JoystickSensor::sPyNumberOfHats,     METH_NOARGS,    (PY_METHODCHAR)NumberOfHats_doc},
-       {"isConnected", (PyCFunction) SCA_JoystickSensor::sPyConnected,         METH_NOARGS,    (PY_METHODCHAR)Connected_doc},
-       {"getButtonValue",(PyCFunction) SCA_JoystickSensor::sPyGetButtonValue,  METH_NOARGS,(PY_METHODCHAR)GetButtonValue_doc},
+       {"getIndex",     (PyCFunction) SCA_JoystickSensor::sPyGetIndex,         METH_NOARGS,    (const char *)GetIndex_doc},
+       {"setIndex",     (PyCFunction) SCA_JoystickSensor::sPySetIndex,         METH_O,                 (const char *)SetIndex_doc},
+       {"getAxis",      (PyCFunction) SCA_JoystickSensor::sPyGetAxis,          METH_NOARGS,    (const char *)GetAxis_doc},
+       {"setAxis",      (PyCFunction) SCA_JoystickSensor::sPySetAxis,          METH_VARARGS,   (const char *)SetAxis_doc},
+       {"getAxisValue", (PyCFunction) SCA_JoystickSensor::sPyGetAxisValue,     METH_NOARGS,    (const char *)GetAxisValue_doc},
+       {"getThreshold", (PyCFunction) SCA_JoystickSensor::sPyGetThreshold, METH_NOARGS,        (const char *)GetThreshold_doc},
+       {"setThreshold", (PyCFunction) SCA_JoystickSensor::sPySetThreshold, METH_VARARGS,       (const char *)SetThreshold_doc},
+       {"getButton",    (PyCFunction) SCA_JoystickSensor::sPyGetButton,        METH_NOARGS,    (const char *)GetButton_doc},
+       {"setButton",    (PyCFunction) SCA_JoystickSensor::sPySetButton,        METH_O,                 (const char *)SetButton_doc},
+       {"getHat",               (PyCFunction) SCA_JoystickSensor::sPyGetHat,           METH_NOARGS,    (const char *)GetHat_doc},
+       {"setHat",               (PyCFunction) SCA_JoystickSensor::sPySetHat,           METH_VARARGS,   (const char *)SetHat_doc},
+       {"getNumAxes",   (PyCFunction) SCA_JoystickSensor::sPyNumberOfAxes,     METH_NOARGS,    (const char *)NumberOfAxes_doc},
+       {"getNumButtons",(PyCFunction) SCA_JoystickSensor::sPyNumberOfButtons,METH_NOARGS,      (const char *)NumberOfButtons_doc},
+       {"getNumHats",   (PyCFunction) SCA_JoystickSensor::sPyNumberOfHats,     METH_NOARGS,    (const char *)NumberOfHats_doc},
+       {"isConnected", (PyCFunction) SCA_JoystickSensor::sPyConnected,         METH_NOARGS,    (const char *)Connected_doc},
+       {"getButtonValue",(PyCFunction) SCA_JoystickSensor::sPyGetButtonValue,  METH_NOARGS,(const char *)GetButtonValue_doc},
        //<----- Deprecated
-       {"getButtonActiveList",(PyCFunction) SCA_JoystickSensor::sPyGetButtonActiveList,        METH_NOARGS,(PY_METHODCHAR)GetButtonActiveList_doc},
-       {"getButtonStatus",(PyCFunction) SCA_JoystickSensor::sPyGetButtonStatus,        METH_VARARGS,(PY_METHODCHAR)GetButtonStatus_doc},
+       {"getButtonActiveList",(PyCFunction) SCA_JoystickSensor::sPyGetButtonActiveList,        METH_NOARGS,(const char *)GetButtonActiveList_doc},
+       {"getButtonStatus",(PyCFunction) SCA_JoystickSensor::sPyGetButtonStatus,        METH_VARARGS,(const char *)GetButtonStatus_doc},
        {NULL,NULL} //Sentinel
 };
 
index 999e34dfa368791b4c0332e9cb02136b0ef1ce87..f065452f8c60152ae170ca737092313ee5571939 100644 (file)
@@ -614,13 +614,7 @@ KX_PYMETHODDEF_DOC_O(SCA_KeyboardSensor, getKeyStatus,
 /* ------------------------------------------------------------------------- */
 
 PyTypeObject SCA_KeyboardSensor::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_KeyboardSensor",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -643,14 +637,14 @@ PyTypeObject SCA_KeyboardSensor::Type = {
 
 PyMethodDef SCA_KeyboardSensor::Methods[] = {
        //Deprecated functions ------>
-       {"getKey", (PyCFunction) SCA_KeyboardSensor::sPyGetKey, METH_NOARGS, (PY_METHODCHAR)GetKey_doc},
-       {"setKey", (PyCFunction) SCA_KeyboardSensor::sPySetKey, METH_VARARGS, (PY_METHODCHAR)SetKey_doc},
-       {"getHold1", (PyCFunction) SCA_KeyboardSensor::sPyGetHold1, METH_NOARGS, (PY_METHODCHAR)GetHold1_doc},
-       {"setHold1", (PyCFunction) SCA_KeyboardSensor::sPySetHold1, METH_VARARGS, (PY_METHODCHAR)SetHold1_doc},
-       {"getHold2", (PyCFunction) SCA_KeyboardSensor::sPyGetHold2, METH_NOARGS, (PY_METHODCHAR)GetHold2_doc},
-       {"setHold2", (PyCFunction) SCA_KeyboardSensor::sPySetHold2, METH_VARARGS, (PY_METHODCHAR)SetHold2_doc},
-       {"getPressedKeys", (PyCFunction) SCA_KeyboardSensor::sPyGetPressedKeys, METH_NOARGS, (PY_METHODCHAR)GetPressedKeys_doc},
-       {"getCurrentlyPressedKeys", (PyCFunction) SCA_KeyboardSensor::sPyGetCurrentlyPressedKeys, METH_NOARGS, (PY_METHODCHAR)GetCurrentlyPressedKeys_doc},
+       {"getKey", (PyCFunction) SCA_KeyboardSensor::sPyGetKey, METH_NOARGS, (const char *)GetKey_doc},
+       {"setKey", (PyCFunction) SCA_KeyboardSensor::sPySetKey, METH_VARARGS, (const char *)SetKey_doc},
+       {"getHold1", (PyCFunction) SCA_KeyboardSensor::sPyGetHold1, METH_NOARGS, (const char *)GetHold1_doc},
+       {"setHold1", (PyCFunction) SCA_KeyboardSensor::sPySetHold1, METH_VARARGS, (const char *)SetHold1_doc},
+       {"getHold2", (PyCFunction) SCA_KeyboardSensor::sPyGetHold2, METH_NOARGS, (const char *)GetHold2_doc},
+       {"setHold2", (PyCFunction) SCA_KeyboardSensor::sPySetHold2, METH_VARARGS, (const char *)SetHold2_doc},
+       {"getPressedKeys", (PyCFunction) SCA_KeyboardSensor::sPyGetPressedKeys, METH_NOARGS, (const char *)GetPressedKeys_doc},
+       {"getCurrentlyPressedKeys", (PyCFunction) SCA_KeyboardSensor::sPyGetCurrentlyPressedKeys, METH_NOARGS, (const char *)GetCurrentlyPressedKeys_doc},
        //<----- Deprecated
        KX_PYMETHODTABLE_O(SCA_KeyboardSensor, getKeyStatus),
        {NULL,NULL} //Sentinel
index 49fa19dce38832bfa6c9cb9d5016632b4007248c..c6703452337d360a55b8b51e58bf0111c58e86ae 100644 (file)
@@ -295,13 +295,7 @@ KX_PYMETHODDEF_DOC_O(SCA_MouseSensor, getButtonStatus,
 /* ------------------------------------------------------------------------- */
 
 PyTypeObject SCA_MouseSensor::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_MouseSensor",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -324,8 +318,8 @@ PyTypeObject SCA_MouseSensor::Type = {
 
 PyMethodDef SCA_MouseSensor::Methods[] = {
        //Deprecated functions ------>
-       {"getXPosition", (PyCFunction) SCA_MouseSensor::sPyGetXPosition, METH_VARARGS, (PY_METHODCHAR)GetXPosition_doc},
-       {"getYPosition", (PyCFunction) SCA_MouseSensor::sPyGetYPosition, METH_VARARGS, (PY_METHODCHAR)GetYPosition_doc},
+       {"getXPosition", (PyCFunction) SCA_MouseSensor::sPyGetXPosition, METH_VARARGS, (const char *)GetXPosition_doc},
+       {"getYPosition", (PyCFunction) SCA_MouseSensor::sPyGetYPosition, METH_VARARGS, (const char *)GetYPosition_doc},
        //<----- Deprecated
        KX_PYMETHODTABLE_O(SCA_MouseSensor, getButtonStatus),
        {NULL,NULL} //Sentinel
index c00e5d6e6179fbb9436382722b72c832ce65823e..c971c06fadd35e92bd8d50fabec6844f6297ca9c 100644 (file)
@@ -99,13 +99,7 @@ CValue* SCA_NANDController::GetReplica()
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_NANDController::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_NANDController",
        sizeof(PyObjectPlus_Proxy),
        0,
index 9762d44fd5dfb48af0681ed414669a55c8090647..7a8b09e4bec5694e11e338c5ece143a77142e91b 100644 (file)
@@ -99,13 +99,7 @@ CValue* SCA_NORController::GetReplica()
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_NORController::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_NORController",
        sizeof(PyObjectPlus_Proxy),
        0,
index a526dd8353cdf43de319be8758567a44a5ef6763..12e2f610986c10bc70b0ea508872d9f100abd1f1 100644 (file)
@@ -93,13 +93,7 @@ void SCA_ORController::Trigger(SCA_LogicManager* logicmgr)
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_ORController::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_ORController",
        sizeof(PyObjectPlus_Proxy),
        0,
index 215e30eceaf042b225ba7356e8ec14416e1fb913..5afb537c28a283a52871b09476fc8f03a9d970da 100644 (file)
@@ -228,13 +228,7 @@ void SCA_PropertyActuator::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map)
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_PropertyActuator::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_PropertyActuator",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -257,10 +251,10 @@ PyTypeObject SCA_PropertyActuator::Type = {
 
 PyMethodDef SCA_PropertyActuator::Methods[] = {
        //Deprecated functions ------>
-       {"setProperty", (PyCFunction) SCA_PropertyActuator::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
-       {"getProperty", (PyCFunction) SCA_PropertyActuator::sPyGetProperty, METH_VARARGS, (PY_METHODCHAR)GetProperty_doc},
-       {"setValue", (PyCFunction) SCA_PropertyActuator::sPySetValue, METH_VARARGS, (PY_METHODCHAR)SetValue_doc},
-       {"getValue", (PyCFunction) SCA_PropertyActuator::sPyGetValue, METH_VARARGS, (PY_METHODCHAR)GetValue_doc},
+       {"setProperty", (PyCFunction) SCA_PropertyActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc},
+       {"getProperty", (PyCFunction) SCA_PropertyActuator::sPyGetProperty, METH_VARARGS, (const char *)GetProperty_doc},
+       {"setValue", (PyCFunction) SCA_PropertyActuator::sPySetValue, METH_VARARGS, (const char *)SetValue_doc},
+       {"getValue", (PyCFunction) SCA_PropertyActuator::sPyGetValue, METH_VARARGS, (const char *)GetValue_doc},
        //<----- Deprecated
        {NULL,NULL} //Sentinel
 };
index 6d2e1a0aca512265813ad5eb0c39959425c879b4..96c769bd3d34bcd2869c96d3846549cb8894e6f7 100644 (file)
@@ -302,13 +302,7 @@ int SCA_PropertySensor::validValueForProperty(void *self, const PyAttributeDef*)
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_PropertySensor::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_PropertySensor",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -331,12 +325,12 @@ PyTypeObject SCA_PropertySensor::Type = {
 
 PyMethodDef SCA_PropertySensor::Methods[] = {
        //Deprecated functions ------>
-       {"getType", (PyCFunction) SCA_PropertySensor::sPyGetType, METH_NOARGS, (PY_METHODCHAR)GetType_doc},
-       {"setType", (PyCFunction) SCA_PropertySensor::sPySetType, METH_VARARGS, (PY_METHODCHAR)SetType_doc},
-       {"getProperty", (PyCFunction) SCA_PropertySensor::sPyGetProperty, METH_NOARGS, (PY_METHODCHAR)GetProperty_doc},
-       {"setProperty", (PyCFunction) SCA_PropertySensor::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
-       {"getValue", (PyCFunction) SCA_PropertySensor::sPyGetValue, METH_NOARGS, (PY_METHODCHAR)GetValue_doc},
-       {"setValue", (PyCFunction) SCA_PropertySensor::sPySetValue, METH_VARARGS, (PY_METHODCHAR)SetValue_doc},
+       {"getType", (PyCFunction) SCA_PropertySensor::sPyGetType, METH_NOARGS, (const char *)GetType_doc},
+       {"setType", (PyCFunction) SCA_PropertySensor::sPySetType, METH_VARARGS, (const char *)SetType_doc},
+       {"getProperty", (PyCFunction) SCA_PropertySensor::sPyGetProperty, METH_NOARGS, (const char *)GetProperty_doc},
+       {"setProperty", (PyCFunction) SCA_PropertySensor::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc},
+       {"getValue", (PyCFunction) SCA_PropertySensor::sPyGetValue, METH_NOARGS, (const char *)GetValue_doc},
+       {"setValue", (PyCFunction) SCA_PropertySensor::sPySetValue, METH_VARARGS, (const char *)SetValue_doc},
        //<----- Deprecated
        {NULL,NULL} //Sentinel
 };
index ffd95f00699b0b57ff88329da9f8cca1c4d5dd1e..8ece7fb4ae1680905c7803bff56ba8a614cc17fa 100644 (file)
@@ -227,31 +227,25 @@ const char* SCA_PythonController::sPyGetCurrentController__doc__ = "getCurrentCo
 const char* SCA_PythonController::sPyAddActiveActuator__doc__= "addActiveActuator(actuator,bool)";
 
 PyTypeObject SCA_PythonController::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_PythonController",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,0,0,0,0,0,0,0,0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &SCA_IController::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "SCA_PythonController",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &SCA_IController::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 PyMethodDef SCA_PythonController::Methods[] = {
index e903d10f9a5927e57b71775b7a2aeafb55c49b00..2b10f49137807116c7f5ff915af0cdf73eda837f 100644 (file)
@@ -315,13 +315,7 @@ void SCA_RandomActuator::enforceConstraints() {
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_RandomActuator::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_RandomActuator",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -344,13 +338,13 @@ PyTypeObject SCA_RandomActuator::Type = {
 
 PyMethodDef SCA_RandomActuator::Methods[] = {
        //Deprecated functions ------>
-       {"setSeed",         (PyCFunction) SCA_RandomActuator::sPySetSeed, METH_VARARGS, (PY_METHODCHAR)SetSeed_doc},
-       {"getSeed",         (PyCFunction) SCA_RandomActuator::sPyGetSeed, METH_NOARGS, (PY_METHODCHAR)GetSeed_doc},
-       {"getPara1",        (PyCFunction) SCA_RandomActuator::sPyGetPara1, METH_NOARGS, (PY_METHODCHAR)GetPara1_doc},
-       {"getPara2",        (PyCFunction) SCA_RandomActuator::sPyGetPara2, METH_NOARGS, (PY_METHODCHAR)GetPara2_doc},
-       {"getDistribution", (PyCFunction) SCA_RandomActuator::sPyGetDistribution, METH_NOARGS, (PY_METHODCHAR)GetDistribution_doc},
-       {"setProperty",     (PyCFunction) SCA_RandomActuator::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
-       {"getProperty",     (PyCFunction) SCA_RandomActuator::sPyGetProperty, METH_NOARGS, (PY_METHODCHAR)GetProperty_doc},
+       {"setSeed",         (PyCFunction) SCA_RandomActuator::sPySetSeed, METH_VARARGS, (const char *)SetSeed_doc},
+       {"getSeed",         (PyCFunction) SCA_RandomActuator::sPyGetSeed, METH_NOARGS, (const char *)GetSeed_doc},
+       {"getPara1",        (PyCFunction) SCA_RandomActuator::sPyGetPara1, METH_NOARGS, (const char *)GetPara1_doc},
+       {"getPara2",        (PyCFunction) SCA_RandomActuator::sPyGetPara2, METH_NOARGS, (const char *)GetPara2_doc},
+       {"getDistribution", (PyCFunction) SCA_RandomActuator::sPyGetDistribution, METH_NOARGS, (const char *)GetDistribution_doc},
+       {"setProperty",     (PyCFunction) SCA_RandomActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc},
+       {"getProperty",     (PyCFunction) SCA_RandomActuator::sPyGetProperty, METH_NOARGS, (const char *)GetProperty_doc},
        //<----- Deprecated
        KX_PYMETHODTABLE(SCA_RandomActuator, setBoolConst),
        KX_PYMETHODTABLE_NOARGS(SCA_RandomActuator, setBoolUniform),
index e036a77707e1040b2ef40094e7dee54f715dce75..a09d83289062d5e98a758d47893f2f6bd0d7ceae 100644 (file)
@@ -130,13 +130,7 @@ bool SCA_RandomSensor::Evaluate()
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_RandomSensor::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_RandomSensor",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -159,9 +153,9 @@ PyTypeObject SCA_RandomSensor::Type = {
 
 PyMethodDef SCA_RandomSensor::Methods[] = {
        //Deprecated functions ----->
-       {"setSeed",     (PyCFunction) SCA_RandomSensor::sPySetSeed, METH_VARARGS, (PY_METHODCHAR)SetSeed_doc},
-       {"getSeed",     (PyCFunction) SCA_RandomSensor::sPyGetSeed, METH_NOARGS, (PY_METHODCHAR)GetSeed_doc},
-       {"getLastDraw", (PyCFunction) SCA_RandomSensor::sPyGetLastDraw, METH_NOARGS, (PY_METHODCHAR)GetLastDraw_doc},
+       {"setSeed",     (PyCFunction) SCA_RandomSensor::sPySetSeed, METH_VARARGS, (const char *)SetSeed_doc},
+       {"getSeed",     (PyCFunction) SCA_RandomSensor::sPyGetSeed, METH_NOARGS, (const char *)GetSeed_doc},
+       {"getLastDraw", (PyCFunction) SCA_RandomSensor::sPyGetLastDraw, METH_NOARGS, (const char *)GetLastDraw_doc},
        //<----- Deprecated
        {NULL,NULL} //Sentinel
 };
index 527adc70cc692d7d6880e3670753236d9985c1eb..17350feb98b7b14bc5c032c314778571f2c798c7 100644 (file)
@@ -103,13 +103,7 @@ CValue* SCA_XNORController::GetReplica()
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_XNORController::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_XNORController",
        sizeof(PyObjectPlus_Proxy),
        0,
index c0916224fe6e6ea9b4ceeb1a9387955ab3a60e69..a6a7cc258970ae2e7c6f54a693b88d4267abd96e 100644 (file)
@@ -103,13 +103,7 @@ CValue* SCA_XORController::GetReplica()
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_XORController::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_XORController",
        sizeof(PyObjectPlus_Proxy),
        0,
index 8bde5dd3a511452b71ed4e17c8c3a86c0ed708c1..f548bcdaae1d467a40fea8d3d9db1d1d8442427b 100644 (file)
@@ -765,31 +765,25 @@ PyAttributeDef BL_Shader::Attributes[] = {
 };
 
 PyTypeObject BL_Shader::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
-               "BL_Shader",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,0,0,0,0,0,0,0,0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &PyObjectPlus::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "BL_Shader",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &PyObjectPlus::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 KX_PYMETHODDEF_DOC( BL_Shader, setSource," setSource(vertexProgram, fragmentProgram)" )
index de820ddaaae98131b99b739a3642eee162695cea..410cf308217cca273bcc7b9325d97a813cd0dea3 100644 (file)
@@ -101,13 +101,7 @@ CValue* KX_NetworkMessageActuator::GetReplica()
 
 /* Integration hooks -------------------------------------------------- */
 PyTypeObject KX_NetworkMessageActuator::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
        "KX_NetworkMessageActuator",
        sizeof(PyObjectPlus_Proxy),
        0,
index 78dda1f6db783be95bdf4234f6459876320092d3..7123277d4efce81fa48aeb32f57f525ed2f5123e 100644 (file)
@@ -165,13 +165,7 @@ bool KX_NetworkMessageSensor::IsPositiveTrigger()
 
 /* Integration hooks --------------------------------------------------- */
 PyTypeObject KX_NetworkMessageSensor::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
        "KX_NetworkMessageSensor",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -196,19 +190,19 @@ PyMethodDef KX_NetworkMessageSensor::Methods[] = {
        // Deprecated ----->
        {"setSubjectFilterText", (PyCFunction)
                KX_NetworkMessageSensor::sPySetSubjectFilterText, METH_O,
-               (PY_METHODCHAR)SetSubjectFilterText_doc},
+               (const char *)SetSubjectFilterText_doc},
        {"getFrameMessageCount", (PyCFunction)
                KX_NetworkMessageSensor::sPyGetFrameMessageCount, METH_NOARGS,
-               (PY_METHODCHAR)GetFrameMessageCount_doc},
+               (const char *)GetFrameMessageCount_doc},
        {"getBodies", (PyCFunction)
                KX_NetworkMessageSensor::sPyGetBodies, METH_NOARGS,
-               (PY_METHODCHAR)GetBodies_doc},
+               (const char *)GetBodies_doc},
        {"getSubject", (PyCFunction)
                KX_NetworkMessageSensor::sPyGetSubject, METH_NOARGS,
-               (PY_METHODCHAR)GetSubject_doc},
+               (const char *)GetSubject_doc},
        {"getSubjects", (PyCFunction)
                KX_NetworkMessageSensor::sPyGetSubjects, METH_NOARGS,
-               (PY_METHODCHAR)GetSubjects_doc},
+               (const char *)GetSubjects_doc},
        // <-----
        {NULL,NULL} //Sentinel
 };
index d93175ff35a03c52f5dbcbe1f19340cbccd0fee0..e2baf8afab000ababe20ab073b89e2a6babe5cc1 100644 (file)
@@ -794,31 +794,25 @@ PyAttributeDef KX_BlenderMaterial::Attributes[] = {
 };
 
 PyTypeObject KX_BlenderMaterial::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
-               "KX_BlenderMaterial",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,0,0,0,0,0,0,0,0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &PyObjectPlus::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "KX_BlenderMaterial",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &PyObjectPlus::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()")
index 0861a54d84857467b4841f6c7085fad251e1517f..27c33b68577f059ec44c3591314a19d176bdfed0 100644 (file)
@@ -102,31 +102,25 @@ bool KX_CDActuator::Update()
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_CDActuator::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
-               "KX_SoundActuator",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,0,0,0,0,0,0,0,0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &SCA_IActuator::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "KX_SoundActuator",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &SCA_IActuator::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 PyMethodDef KX_CDActuator::Methods[] = {
index f762699f780988cf6d96396477476de770457cd1..fd289a0b55ec200c079e7d3712cb309e3fa18424 100644 (file)
@@ -530,37 +530,31 @@ PyAttributeDef KX_Camera::Attributes[] = {
 };
 
 PyTypeObject KX_Camera::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
-               "KX_Camera",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,
-               &KX_GameObject::Sequence,
-               &KX_GameObject::Mapping,
-               0,0,0,
-               NULL,
-               NULL,
-               0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &KX_GameObject::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "KX_Camera",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,
+       &KX_GameObject::Sequence,
+       &KX_GameObject::Mapping,
+       0,0,0,
+       NULL,
+       NULL,
+       0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &KX_GameObject::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, sphereInsideFrustum,
index 3d3b68ed85d51361f11a93c3a4d2a5fadae223ec..faf0ca50407a0812431f624a6b47e2a1c13d611a 100644 (file)
@@ -368,13 +368,7 @@ bool KX_CameraActuator::string2axischoice(const char *axisString)
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_CameraActuator::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
        "KX_CameraActuator",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -397,16 +391,16 @@ PyTypeObject KX_CameraActuator::Type = {
 
 PyMethodDef KX_CameraActuator::Methods[] = {
        // ---> deprecated (all)
-       {"setObject",(PyCFunction) KX_CameraActuator::sPySetObject, METH_O,                     (PY_METHODCHAR)SetObject_doc},
-       {"getObject",(PyCFunction) KX_CameraActuator::sPyGetObject, METH_VARARGS,       (PY_METHODCHAR)GetObject_doc},
-       {"setMin"       ,(PyCFunction) KX_CameraActuator::sPySetMin,    METH_VARARGS,   (PY_METHODCHAR)SetMin_doc},
-       {"getMin"       ,(PyCFunction) KX_CameraActuator::sPyGetMin,    METH_NOARGS,    (PY_METHODCHAR)GetMin_doc},
-       {"setMax"       ,(PyCFunction) KX_CameraActuator::sPySetMax,    METH_VARARGS,   (PY_METHODCHAR)SetMax_doc},
-       {"getMax"       ,(PyCFunction) KX_CameraActuator::sPyGetMax,    METH_NOARGS,    (PY_METHODCHAR)GetMax_doc},
-       {"setHeight",(PyCFunction) KX_CameraActuator::sPySetHeight,     METH_VARARGS,   (PY_METHODCHAR)SetHeight_doc},
-       {"getHeight",(PyCFunction) KX_CameraActuator::sPyGetHeight,     METH_NOARGS,    (PY_METHODCHAR)GetHeight_doc},
-       {"setXY"        ,(PyCFunction) KX_CameraActuator::sPySetXY,             METH_VARARGS,   (PY_METHODCHAR)SetXY_doc},
-       {"getXY"        ,(PyCFunction) KX_CameraActuator::sPyGetXY,             METH_NOARGS,    (PY_METHODCHAR)GetXY_doc},
+       {"setObject",(PyCFunction) KX_CameraActuator::sPySetObject, METH_O,                     (const char *)SetObject_doc},
+       {"getObject",(PyCFunction) KX_CameraActuator::sPyGetObject, METH_VARARGS,       (const char *)GetObject_doc},
+       {"setMin"       ,(PyCFunction) KX_CameraActuator::sPySetMin,    METH_VARARGS,   (const char *)SetMin_doc},
+       {"getMin"       ,(PyCFunction) KX_CameraActuator::sPyGetMin,    METH_NOARGS,    (const char *)GetMin_doc},
+       {"setMax"       ,(PyCFunction) KX_CameraActuator::sPySetMax,    METH_VARARGS,   (const char *)SetMax_doc},
+       {"getMax"       ,(PyCFunction) KX_CameraActuator::sPyGetMax,    METH_NOARGS,    (const char *)GetMax_doc},
+       {"setHeight",(PyCFunction) KX_CameraActuator::sPySetHeight,     METH_VARARGS,   (const char *)SetHeight_doc},
+       {"getHeight",(PyCFunction) KX_CameraActuator::sPyGetHeight,     METH_NOARGS,    (const char *)GetHeight_doc},
+       {"setXY"        ,(PyCFunction) KX_CameraActuator::sPySetXY,             METH_VARARGS,   (const char *)SetXY_doc},
+       {"getXY"        ,(PyCFunction) KX_CameraActuator::sPyGetXY,             METH_NOARGS,    (const char *)GetXY_doc},
        {NULL,NULL,NULL,NULL} //Sentinel
 };
 
index 0d69da83081f8e8375642ef1bd1e1ce64a28ab9e..5f6244c3ab6323f343ffe02f8f1a7dd0e8939ca7 100644 (file)
@@ -565,13 +565,7 @@ bool KX_ConstraintActuator::IsValidMode(KX_ConstraintActuator::KX_CONSTRAINTTYPE
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_ConstraintActuator::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
        "KX_ConstraintActuator",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -594,28 +588,28 @@ PyTypeObject KX_ConstraintActuator::Type = {
 
 PyMethodDef KX_ConstraintActuator::Methods[] = {
        // Deprecated -->
-       {"setDamp", (PyCFunction) KX_ConstraintActuator::sPySetDamp, METH_VARARGS, (PY_METHODCHAR)SetDamp_doc},
-       {"getDamp", (PyCFunction) KX_ConstraintActuator::sPyGetDamp, METH_NOARGS, (PY_METHODCHAR)GetDamp_doc},
-       {"setRotDamp", (PyCFunction) KX_ConstraintActuator::sPySetRotDamp, METH_VARARGS, (PY_METHODCHAR)SetRotDamp_doc},
-       {"getRotDamp", (PyCFunction) KX_ConstraintActuator::sPyGetRotDamp, METH_NOARGS, (PY_METHODCHAR)GetRotDamp_doc},
-       {"setDirection", (PyCFunction) KX_ConstraintActuator::sPySetDirection, METH_VARARGS, (PY_METHODCHAR)SetDirection_doc},
-       {"getDirection", (PyCFunction) KX_ConstraintActuator::sPyGetDirection, METH_NOARGS, (PY_METHODCHAR)GetDirection_doc},
-       {"setOption", (PyCFunction) KX_ConstraintActuator::sPySetOption, METH_VARARGS, (PY_METHODCHAR)SetOption_doc},
-       {"getOption", (PyCFunction) KX_ConstraintActuator::sPyGetOption, METH_NOARGS, (PY_METHODCHAR)GetOption_doc},
-       {"setTime", (PyCFunction) KX_ConstraintActuator::sPySetTime, METH_VARARGS, (PY_METHODCHAR)SetTime_doc},
-       {"getTime", (PyCFunction) KX_ConstraintActuator::sPyGetTime, METH_NOARGS, (PY_METHODCHAR)GetTime_doc},
-       {"setProperty", (PyCFunction) KX_ConstraintActuator::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
-       {"getProperty", (PyCFunction) KX_ConstraintActuator::sPyGetProperty, METH_NOARGS, (PY_METHODCHAR)GetProperty_doc},
-       {"setMin", (PyCFunction) KX_ConstraintActuator::sPySetMin, METH_VARARGS, (PY_METHODCHAR)SetMin_doc},
-       {"getMin", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_NOARGS, (PY_METHODCHAR)GetMin_doc},
-       {"setDistance", (PyCFunction) KX_ConstraintActuator::sPySetMin, METH_VARARGS, (PY_METHODCHAR)SetDistance_doc},
-       {"getDistance", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_NOARGS, (PY_METHODCHAR)GetDistance_doc},
-       {"setMax", (PyCFunction) KX_ConstraintActuator::sPySetMax, METH_VARARGS, (PY_METHODCHAR)SetMax_doc},
-       {"getMax", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_NOARGS, (PY_METHODCHAR)GetMax_doc},
-       {"setRayLength", (PyCFunction) KX_ConstraintActuator::sPySetMax, METH_VARARGS, (PY_METHODCHAR)SetRayLength_doc},
-       {"getRayLength", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_NOARGS, (PY_METHODCHAR)GetRayLength_doc},
-       {"setLimit", (PyCFunction) KX_ConstraintActuator::sPySetLimit, METH_VARARGS, (PY_METHODCHAR)SetLimit_doc},
-       {"getLimit", (PyCFunction) KX_ConstraintActuator::sPyGetLimit, METH_NOARGS, (PY_METHODCHAR)GetLimit_doc},
+       {"setDamp", (PyCFunction) KX_ConstraintActuator::sPySetDamp, METH_VARARGS, (const char *)SetDamp_doc},
+       {"getDamp", (PyCFunction) KX_ConstraintActuator::sPyGetDamp, METH_NOARGS, (const char *)GetDamp_doc},
+       {"setRotDamp", (PyCFunction) KX_ConstraintActuator::sPySetRotDamp, METH_VARARGS, (const char *)SetRotDamp_doc},
+       {"getRotDamp", (PyCFunction) KX_ConstraintActuator::sPyGetRotDamp, METH_NOARGS, (const char *)GetRotDamp_doc},
+       {"setDirection", (PyCFunction) KX_ConstraintActuator::sPySetDirection, METH_VARARGS, (const char *)SetDirection_doc},
+       {"getDirection", (PyCFunction) KX_ConstraintActuator::sPyGetDirection, METH_NOARGS, (const char *)GetDirection_doc},
+       {"setOption", (PyCFunction) KX_ConstraintActuator::sPySetOption, METH_VARARGS, (const char *)SetOption_doc},
+       {"getOption", (PyCFunction) KX_ConstraintActuator::sPyGetOption, METH_NOARGS, (const char *)GetOption_doc},
+       {"setTime", (PyCFunction) KX_ConstraintActuator::sPySetTime, METH_VARARGS, (const char *)SetTime_doc},
+       {"getTime", (PyCFunction) KX_ConstraintActuator::sPyGetTime, METH_NOARGS, (const char *)GetTime_doc},
+       {"setProperty", (PyCFunction) KX_ConstraintActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc},
+       {"getProperty", (PyCFunction) KX_ConstraintActuator::sPyGetProperty, METH_NOARGS, (const char *)GetProperty_doc},
+       {"setMin", (PyCFunction) KX_ConstraintActuator::sPySetMin, METH_VARARGS, (const char *)SetMin_doc},
+       {"getMin", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_NOARGS, (const char *)GetMin_doc},
+       {"setDistance", (PyCFunction) KX_ConstraintActuator::sPySetMin, METH_VARARGS, (const char *)SetDistance_doc},
+       {"getDistance", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_NOARGS, (const char *)GetDistance_doc},
+       {"setMax", (PyCFunction) KX_ConstraintActuator::sPySetMax, METH_VARARGS, (const char *)SetMax_doc},
+       {"getMax", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_NOARGS, (const char *)GetMax_doc},
+       {"setRayLength", (PyCFunction) KX_ConstraintActuator::sPySetMax, METH_VARARGS, (const char *)SetRayLength_doc},
+       {"getRayLength", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_NOARGS, (const char *)GetRayLength_doc},
+       {"setLimit", (PyCFunction) KX_ConstraintActuator::sPySetLimit, METH_VARARGS, (const char *)SetLimit_doc},
+       {"getLimit", (PyCFunction) KX_ConstraintActuator::sPyGetLimit, METH_NOARGS, (const char *)GetLimit_doc},
        // <--
        {NULL,NULL} //Sentinel
 };
index ec7bb470235fbc0dab4616e0e47bb6f044e1e3dd..54e083b48f06d3faebe7cc07ff112294185c01bb 100644 (file)
@@ -83,31 +83,25 @@ PyObject* KX_ConstraintWrapper::PySetParam(PyObject* args, PyObject* kwds)
 
 //python specific stuff
 PyTypeObject KX_ConstraintWrapper::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
-               "KX_ConstraintWrapper",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,0,0,0,0,0,0,0,0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &PyObjectPlus::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "KX_ConstraintWrapper",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &PyObjectPlus::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 PyMethodDef KX_ConstraintWrapper::Methods[] = {
index 560c7fa4bb4c8d4b8616b809e6164b315c1756dd..3f67de1e9a9b8e136bd5e45541a35c9fc82836e7 100644 (file)
@@ -207,38 +207,32 @@ bool KX_GameActuator::Update()
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_GameActuator::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
-               "KX_GameActuator",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,0,0,0,0,0,0,0,0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &SCA_IActuator::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "KX_GameActuator",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &SCA_IActuator::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 PyMethodDef KX_GameActuator::Methods[] =
 {
        // Deprecated ----->
-       {"getFile",     (PyCFunction) KX_GameActuator::sPyGetFile, METH_VARARGS, (PY_METHODCHAR)GetFile_doc},
-       {"setFile", (PyCFunction) KX_GameActuator::sPySetFile, METH_VARARGS, (PY_METHODCHAR)SetFile_doc},
+       {"getFile",     (PyCFunction) KX_GameActuator::sPyGetFile, METH_VARARGS, (const char *)GetFile_doc},
+       {"setFile", (PyCFunction) KX_GameActuator::sPySetFile, METH_VARARGS, (const char *)SetFile_doc},
        // <-----
        {NULL,NULL} //Sentinel
 };
index fa3a336466c36fe1df8cf0338f5ae57f04b08e5c..146b83abd17f47914048e45c9ab0ea2da2315def 100644 (file)
@@ -1681,37 +1681,31 @@ PySequenceMethods KX_GameObject::Sequence = {
 };
 
 PyTypeObject KX_GameObject::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
-               "KX_GameObject",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,
-               &Sequence,
-               &Mapping,
-               0,0,0,
-               NULL,
-               NULL,
-               0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &SCA_IObject::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "KX_GameObject",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,
+       &Sequence,
+       &Mapping,
+       0,0,0,
+       NULL,
+       NULL,
+       0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &SCA_IObject::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 PyObject* KX_GameObject::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
index 73a370a1681639886d08fcb0159bc34d3d1c4b93..e4eaff4f401bbb616b9d32f590147f7ca4d2312b 100644 (file)
@@ -412,13 +412,7 @@ int KX_IpoActuator::string2mode(char* modename) {
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_IpoActuator::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
        "KX_IpoActuator",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -441,20 +435,20 @@ PyTypeObject KX_IpoActuator::Type = {
 
 PyMethodDef KX_IpoActuator::Methods[] = {
        // deprecated 
-       {"set", (PyCFunction) KX_IpoActuator::sPySet, METH_VARARGS, (PY_METHODCHAR)Set_doc},
-       {"setProperty", (PyCFunction) KX_IpoActuator::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
-       {"setStart", (PyCFunction) KX_IpoActuator::sPySetStart, METH_VARARGS, (PY_METHODCHAR)SetStart_doc},
-       {"getStart", (PyCFunction) KX_IpoActuator::sPyGetStart, METH_NOARGS, (PY_METHODCHAR)GetStart_doc},
-       {"setEnd", (PyCFunction) KX_IpoActuator::sPySetEnd, METH_VARARGS, (PY_METHODCHAR)SetEnd_doc},
-       {"getEnd", (PyCFunction) KX_IpoActuator::sPyGetEnd, METH_NOARGS, (PY_METHODCHAR)GetEnd_doc},
-       {"setIpoAsForce", (PyCFunction) KX_IpoActuator::sPySetIpoAsForce, METH_VARARGS, (PY_METHODCHAR)SetIpoAsForce_doc},
-       {"getIpoAsForce", (PyCFunction) KX_IpoActuator::sPyGetIpoAsForce, METH_NOARGS, (PY_METHODCHAR)GetIpoAsForce_doc},
-       {"setIpoAdd", (PyCFunction) KX_IpoActuator::sPySetIpoAdd, METH_VARARGS, (PY_METHODCHAR)SetIpoAdd_doc},
-       {"getIpoAdd", (PyCFunction) KX_IpoActuator::sPyGetIpoAdd, METH_NOARGS, (PY_METHODCHAR)GetIpoAdd_doc},
-       {"setForceIpoActsLocal", (PyCFunction) KX_IpoActuator::sPySetForceIpoActsLocal, METH_VARARGS, (PY_METHODCHAR)SetForceIpoActsLocal_doc},
-       {"getForceIpoActsLocal", (PyCFunction) KX_IpoActuator::sPyGetForceIpoActsLocal, METH_NOARGS, (PY_METHODCHAR)GetForceIpoActsLocal_doc},
-       {"setType", (PyCFunction) KX_IpoActuator::sPySetType, METH_VARARGS, (PY_METHODCHAR)SetType_doc},
-       {"getType", (PyCFunction) KX_IpoActuator::sPyGetType, METH_NOARGS, (PY_METHODCHAR)GetType_doc}, 
+       {"set", (PyCFunction) KX_IpoActuator::sPySet, METH_VARARGS, (const char *)Set_doc},
+       {"setProperty", (PyCFunction) KX_IpoActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc},
+       {"setStart", (PyCFunction) KX_IpoActuator::sPySetStart, METH_VARARGS, (const char *)SetStart_doc},
+       {"getStart", (PyCFunction) KX_IpoActuator::sPyGetStart, METH_NOARGS, (const char *)GetStart_doc},
+       {"setEnd", (PyCFunction) KX_IpoActuator::sPySetEnd, METH_VARARGS, (const char *)SetEnd_doc},
+       {"getEnd", (PyCFunction) KX_IpoActuator::sPyGetEnd, METH_NOARGS, (const char *)GetEnd_doc},
+       {"setIpoAsForce", (PyCFunction) KX_IpoActuator::sPySetIpoAsForce, METH_VARARGS, (const char *)SetIpoAsForce_doc},
+       {"getIpoAsForce", (PyCFunction) KX_IpoActuator::sPyGetIpoAsForce, METH_NOARGS, (const char *)GetIpoAsForce_doc},
+       {"setIpoAdd", (PyCFunction) KX_IpoActuator::sPySetIpoAdd, METH_VARARGS, (const char *)SetIpoAdd_doc},
+       {"getIpoAdd", (PyCFunction) KX_IpoActuator::sPyGetIpoAdd, METH_NOARGS, (const char *)GetIpoAdd_doc},
+       {"setForceIpoActsLocal", (PyCFunction) KX_IpoActuator::sPySetForceIpoActsLocal, METH_VARARGS, (const char *)SetForceIpoActsLocal_doc},
+       {"getForceIpoActsLocal", (PyCFunction) KX_IpoActuator::sPyGetForceIpoActsLocal, METH_NOARGS, (const char *)GetForceIpoActsLocal_doc},
+       {"setType", (PyCFunction) KX_IpoActuator::sPySetType, METH_VARARGS, (const char *)SetType_doc},
+       {"getType", (PyCFunction) KX_IpoActuator::sPyGetType, METH_NOARGS, (const char *)GetType_doc},  
        {NULL,NULL} //Sentinel
 };
 
index fb385f8a9a2cb039bca314c13f725f45d086e685..85c495bc2bd21d795f54cd11f342637e1f46f8f7 100644 (file)
@@ -269,37 +269,31 @@ void KX_LightObject::UnbindShadowBuffer(RAS_IRasterizer *ras)
 /* ------------------------------------------------------------------------- */
 
 PyTypeObject KX_LightObject::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
-               "KX_LightObject",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,
-               &KX_GameObject::Sequence,
-               &KX_GameObject::Mapping,
-               0,0,0,
-               NULL,
-               NULL,
-               0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &KX_GameObject::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "KX_LightObject",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,
+       &KX_GameObject::Sequence,
+       &KX_GameObject::Mapping,
+       0,0,0,
+       NULL,
+       NULL,
+       0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &KX_GameObject::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 PyMethodDef KX_LightObject::Methods[] = {
index ea9bc3e0fbc92348d650be26c99b7c4fd0049d54..e15847fe6c616acb67fe33fd7418fcb23160c2a4 100644 (file)
 #include "PyObjectPlus.h" 
 
 PyTypeObject KX_MeshProxy::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
        "KX_MeshProxy",
        sizeof(PyObjectPlus_Proxy),
        0,
index ba4b47cb03f033e852f4b08157865886e32bb264..58053e1038d3fbb80e2bdb954981f53fafc096dd 100644 (file)
@@ -339,13 +339,7 @@ const MT_Vector3& KX_MouseFocusSensor::HitNormal() const
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_MouseFocusSensor::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
        "KX_MouseFocusSensor",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -367,12 +361,12 @@ PyTypeObject KX_MouseFocusSensor::Type = {
 };
 
 PyMethodDef KX_MouseFocusSensor::Methods[] = {
-       {"getRayTarget", (PyCFunction) KX_MouseFocusSensor::sPyGetRayTarget, METH_NOARGS, (PY_METHODCHAR)GetRayTarget_doc},
-       {"getRaySource", (PyCFunction) KX_MouseFocusSensor::sPyGetRaySource, METH_NOARGS, (PY_METHODCHAR)GetRaySource_doc},
-       {"getHitObject",(PyCFunction) KX_MouseFocusSensor::sPyGetHitObject,METH_NOARGS, (PY_METHODCHAR)GetHitObject_doc},
-       {"getHitPosition",(PyCFunction) KX_MouseFocusSensor::sPyGetHitPosition,METH_NOARGS, (PY_METHODCHAR)GetHitPosition_doc},
-       {"getHitNormal",(PyCFunction) KX_MouseFocusSensor::sPyGetHitNormal,METH_NOARGS, (PY_METHODCHAR)GetHitNormal_doc},
-       {"getRayDirection",(PyCFunction) KX_MouseFocusSensor::sPyGetRayDirection,METH_NOARGS, (PY_METHODCHAR)GetRayDirection_doc},
+       {"getRayTarget", (PyCFunction) KX_MouseFocusSensor::sPyGetRayTarget, METH_NOARGS, (const char *)GetRayTarget_doc},
+       {"getRaySource", (PyCFunction) KX_MouseFocusSensor::sPyGetRaySource, METH_NOARGS, (const char *)GetRaySource_doc},
+       {"getHitObject",(PyCFunction) KX_MouseFocusSensor::sPyGetHitObject,METH_NOARGS, (const char *)GetHitObject_doc},
+       {"getHitPosition",(PyCFunction) KX_MouseFocusSensor::sPyGetHitPosition,METH_NOARGS, (const char *)GetHitPosition_doc},
+       {"getHitNormal",(PyCFunction) KX_MouseFocusSensor::sPyGetHitNormal,METH_NOARGS, (const char *)GetHitNormal_doc},
+       {"getRayDirection",(PyCFunction) KX_MouseFocusSensor::sPyGetRayDirection,METH_NOARGS, (const char *)GetRayDirection_doc},
 
        {NULL,NULL} //Sentinel
 };
index 6871aeebc7642a6862a43c64e5a62b035753c43c..f7baacdfa61d9bc113d772cb01b67c4c244b2fb4 100644 (file)
@@ -252,13 +252,7 @@ bool       KX_NearSensor::NewHandleCollision(void* obj1,void* obj2,const PHY_CollData
 /* ------------------------------------------------------------------------- */
 
 PyTypeObject KX_NearSensor::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
        "KX_NearSensor",
        sizeof(PyObjectPlus_Proxy),
        0,
index ae340d12be4119656091ede42bfc3440c88245bf..2ee30ee0bfaa489257398989b9788b94a333049f 100644 (file)
@@ -325,13 +325,7 @@ bool KX_ObjectActuator::isValid(KX_ObjectActuator::KX_OBJECT_ACT_VEC_TYPE type)
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_ObjectActuator::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
        "KX_ObjectActuator",
        sizeof(PyObjectPlus_Proxy),
        0,
index befa2aaff563ff05b1f051fbd4c1f6097596c39c..621aeea87be825d8ac7c80cb7a374d57ff9e68eb 100644 (file)
@@ -140,13 +140,7 @@ bool KX_ParentActuator::Update()
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_ParentActuator::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
        "KX_ParentActuator",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -169,8 +163,8 @@ PyTypeObject KX_ParentActuator::Type = {
 
 PyMethodDef KX_ParentActuator::Methods[] = {
        // Deprecated ----->
-       {"setObject", (PyCFunction) KX_ParentActuator::sPySetObject, METH_O, (PY_METHODCHAR)SetObject_doc},
-       {"getObject", (PyCFunction) KX_ParentActuator::sPyGetObject, METH_VARARGS, (PY_METHODCHAR)GetObject_doc},
+       {"setObject", (PyCFunction) KX_ParentActuator::sPySetObject, METH_O, (const char *)SetObject_doc},
+       {"getObject", (PyCFunction) KX_ParentActuator::sPyGetObject, METH_VARARGS, (const char *)GetObject_doc},
        // <-----
        {NULL,NULL} //Sentinel
 };
index 7bce311f1b61ef190db6f8925a9a4c9159e3c8f9..edb190026719d5895d07086b1e042bdd6711744d 100644 (file)
@@ -113,31 +113,25 @@ PyAttributeDef KX_PhysicsObjectWrapper::Attributes[] = {
 
 //python specific stuff
 PyTypeObject KX_PhysicsObjectWrapper::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
-               "KX_PhysicsObjectWrapper",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,0,0,0,0,0,0,0,0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &PyObjectPlus::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "KX_PhysicsObjectWrapper",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &PyObjectPlus::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 PyMethodDef KX_PhysicsObjectWrapper::Methods[] = {
index a1571b177566103d6b588c8c424195c00b3cd245..eae1894428ccbb556b6cd00045e3919d9d2a6cac 100644 (file)
 #include "KX_PyMath.h"
 
 PyTypeObject KX_PolyProxy::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
        "KX_PolyProxy",
        sizeof(PyObjectPlus_Proxy),
        0,
index a48d3f15bce24aa4bf3ee90ceeb13332fb19c95f..0590656eae54e24eb5fa0b0a274dd61f94afefab 100644 (file)
@@ -238,31 +238,25 @@ PyAttributeDef KX_PolygonMaterial::Attributes[] = {
 };
 
 PyTypeObject KX_PolygonMaterial::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
-               "KX_PolygonMaterial",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,0,0,0,0,0,0,0,0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &PyObjectPlus::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "KX_PolygonMaterial",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &PyObjectPlus::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 KX_PYMETHODDEF_DOC(KX_PolygonMaterial, setCustomMaterial, "setCustomMaterial(material)")
index 94e8d1fd5836a657a5d37542eca25456bff1b7cb..04cec3c910639e06fd9206b64dbf605e39721606 100644 (file)
@@ -542,62 +542,60 @@ static PyObject* gPyRemoveConstraint(PyObject* self,
 
 static struct PyMethodDef physicsconstraints_methods[] = {
   {"setGravity",(PyCFunction) gPySetGravity,
-   METH_VARARGS, (PY_METHODCHAR)gPySetGravity__doc__},
+   METH_VARARGS, (const char *)gPySetGravity__doc__},
   {"setDebugMode",(PyCFunction) gPySetDebugMode,
-   METH_VARARGS, (PY_METHODCHAR)gPySetDebugMode__doc__},
+   METH_VARARGS, (const char *)gPySetDebugMode__doc__},
 
    /// settings that influence quality of the rigidbody dynamics
   {"setNumIterations",(PyCFunction) gPySetNumIterations,
-   METH_VARARGS, (PY_METHODCHAR)gPySetNumIterations__doc__},
+   METH_VARARGS, (const char *)gPySetNumIterations__doc__},
 
    {"setNumTimeSubSteps",(PyCFunction) gPySetNumTimeSubSteps,
-   METH_VARARGS, (PY_METHODCHAR)gPySetNumTimeSubSteps__doc__},
+   METH_VARARGS, (const char *)gPySetNumTimeSubSteps__doc__},
 
   {"setDeactivationTime",(PyCFunction) gPySetDeactivationTime,
-   METH_VARARGS, (PY_METHODCHAR)gPySetDeactivationTime__doc__},
+   METH_VARARGS, (const char *)gPySetDeactivationTime__doc__},
 
   {"setDeactivationLinearTreshold",(PyCFunction) gPySetDeactivationLinearTreshold,
-   METH_VARARGS, (PY_METHODCHAR)gPySetDeactivationLinearTreshold__doc__},
+   METH_VARARGS, (const char *)gPySetDeactivationLinearTreshold__doc__},
   {"setDeactivationAngularTreshold",(PyCFunction) gPySetDeactivationAngularTreshold,
-   METH_VARARGS, (PY_METHODCHAR)gPySetDeactivationAngularTreshold__doc__},
+   METH_VARARGS, (const char *)gPySetDeactivationAngularTreshold__doc__},
 
    {"setContactBreakingTreshold",(PyCFunction) gPySetContactBreakingTreshold,
-   METH_VARARGS, (PY_METHODCHAR)gPySetContactBreakingTreshold__doc__},
+   METH_VARARGS, (const char *)gPySetContactBreakingTreshold__doc__},
      {"setCcdMode",(PyCFunction) gPySetCcdMode,
-   METH_VARARGS, (PY_METHODCHAR)gPySetCcdMode__doc__},
+   METH_VARARGS, (const char *)gPySetCcdMode__doc__},
      {"setSorConstant",(PyCFunction) gPySetSorConstant,
-   METH_VARARGS, (PY_METHODCHAR)gPySetSorConstant__doc__},
+   METH_VARARGS, (const char *)gPySetSorConstant__doc__},
        {"setSolverTau",(PyCFunction) gPySetSolverTau,
-   METH_VARARGS, (PY_METHODCHAR)gPySetSolverTau__doc__},
+   METH_VARARGS, (const char *)gPySetSolverTau__doc__},
         {"setSolverDamping",(PyCFunction) gPySetSolverDamping,
-   METH_VARARGS, (PY_METHODCHAR)gPySetSolverDamping__doc__},
+   METH_VARARGS, (const char *)gPySetSolverDamping__doc__},
 
          {"setLinearAirDamping",(PyCFunction) gPySetLinearAirDamping,
-   METH_VARARGS, (PY_METHODCHAR)gPySetLinearAirDamping__doc__},
+   METH_VARARGS, (const char *)gPySetLinearAirDamping__doc__},
 
     {"setUseEpa",(PyCFunction) gPySetUseEpa,
-   METH_VARARGS, (PY_METHODCHAR)gPySetUseEpa__doc__},
+   METH_VARARGS, (const char *)gPySetUseEpa__doc__},
        {"setSolverType",(PyCFunction) gPySetSolverType,
-   METH_VARARGS, (PY_METHODCHAR)gPySetSolverType__doc__},
+   METH_VARARGS, (const char *)gPySetSolverType__doc__},
 
 
   {"createConstraint",(PyCFunction) gPyCreateConstraint,
-   METH_VARARGS, (PY_METHODCHAR)gPyCreateConstraint__doc__},
+   METH_VARARGS, (const char *)gPyCreateConstraint__doc__},
      {"getVehicleConstraint",(PyCFunction) gPyGetVehicleConstraint,
-   METH_VARARGS, (PY_METHODCHAR)gPyGetVehicleConstraint__doc__},
+   METH_VARARGS, (const char *)gPyGetVehicleConstraint__doc__},
 
   {"removeConstraint",(PyCFunction) gPyRemoveConstraint,
-   METH_VARARGS, (PY_METHODCHAR)gPyRemoveConstraint__doc__},
+   METH_VARARGS, (const char *)gPyRemoveConstraint__doc__},
        {"getAppliedImpulse",(PyCFunction) gPyGetAppliedImpulse,
-   METH_VARARGS, (PY_METHODCHAR)gPyGetAppliedImpulse__doc__},
+   METH_VARARGS, (const char *)gPyGetAppliedImpulse__doc__},
 
 
    //sentinel
   { NULL, (PyCFunction) NULL, 0, NULL }
 };
 
-
-#if (PY_VERSION_HEX >= 0x03000000)
 static struct PyModuleDef PhysicsConstraints_module_def = {
        {}, /* m_base */
        "PhysicsConstraints",  /* m_name */
@@ -609,7 +607,6 @@ static struct PyModuleDef PhysicsConstraints_module_def = {
        0,  /* m_clear */
        0,  /* m_free */
 };
-#endif
 
 PyObject*      initPythonConstraintBinding()
 {
@@ -627,15 +624,9 @@ PyObject*  initPythonConstraintBinding()
        }
        else {
                PyErr_Clear();
-       
-#if (PY_VERSION_HEX >= 0x03000000)
+               
                m = PyModule_Create(&PhysicsConstraints_module_def);
                PyDict_SetItemString(PySys_GetObject("modules"), PhysicsConstraints_module_def.m_name, m);
-#else
-               m = Py_InitModule4("PhysicsConstraints", physicsconstraints_methods,
-                    PhysicsConstraints_module_documentation,
-                    (PyObject*)NULL,PYTHON_API_VERSION);
-#endif
        }
 
   // Add some symbolic constants to the module
index c41107602285bc4235a02f607b2770ffe4ab6832..d8027a4d9fc965078a1ebb5df972ebdc74058997 100644 (file)
@@ -525,34 +525,34 @@ static PyObject *gEvalExpression(PyObject*, PyObject* value)
 
 
 static struct PyMethodDef game_methods[] = {
-       {"expandPath", (PyCFunction)gPyExpandPath, METH_VARARGS, (PY_METHODCHAR)gPyExpandPath_doc},
-       {"sendMessage", (PyCFunction)gPySendMessage, METH_VARARGS, (PY_METHODCHAR)gPySendMessage_doc},
+       {"expandPath", (PyCFunction)gPyExpandPath, METH_VARARGS, (const char *)gPyExpandPath_doc},
+       {"sendMessage", (PyCFunction)gPySendMessage, METH_VARARGS, (const char *)gPySendMessage_doc},
        {"getCurrentController",
        (PyCFunction) SCA_PythonController::sPyGetCurrentController,
-       METH_NOARGS, (PY_METHODCHAR)SCA_PythonController::sPyGetCurrentController__doc__},
+       METH_NOARGS, (const char *)SCA_PythonController::sPyGetCurrentController__doc__},
        {"getCurrentScene", (PyCFunction) gPyGetCurrentScene,
-       METH_NOARGS, (PY_METHODCHAR)gPyGetCurrentScene_doc.Ptr()},
+       METH_NOARGS, (const char *)gPyGetCurrentScene_doc.Ptr()},
        {"getSceneList", (PyCFunction) gPyGetSceneList,
-       METH_NOARGS, (PY_METHODCHAR)gPyGetSceneList_doc.Ptr()},
+       METH_NOARGS, (const char *)gPyGetSceneList_doc.Ptr()},
        {"addActiveActuator",(PyCFunction) SCA_PythonController::sPyAddActiveActuator,
-       METH_VARARGS, (PY_METHODCHAR)SCA_PythonController::sPyAddActiveActuator__doc__},
+       METH_VARARGS, (const char *)SCA_PythonController::sPyAddActiveActuator__doc__},
        {"getRandomFloat",(PyCFunction) gPyGetRandomFloat,
-       METH_NOARGS, (PY_METHODCHAR)gPyGetRandomFloat_doc.Ptr()},
-       {"setGravity",(PyCFunction) gPySetGravity, METH_O, (PY_METHODCHAR)"set Gravitation"},
-       {"getSpectrum",(PyCFunction) gPyGetSpectrum, METH_NOARGS, (PY_METHODCHAR)"get audio spectrum"},
-       {"stopDSP",(PyCFunction) gPyStopDSP, METH_VARARGS, (PY_METHODCHAR)"stop using the audio dsp (for performance reasons)"},
-       {"getMaxLogicFrame", (PyCFunction) gPyGetMaxLogicFrame, METH_NOARGS, (PY_METHODCHAR)"Gets the max number of logic frame per render frame"},
-       {"setMaxLogicFrame", (PyCFunction) gPySetMaxLogicFrame, METH_VARARGS, (PY_METHODCHAR)"Sets the max number of logic frame per render frame"},
-       {"getMaxPhysicsFrame", (PyCFunction) gPyGetMaxPhysicsFrame, METH_NOARGS, (PY_METHODCHAR)"Gets the max number of physics frame per render frame"},
-       {"setMaxPhysicsFrame", (PyCFunction) gPySetMaxPhysicsFrame, METH_VARARGS, (PY_METHODCHAR)"Sets the max number of physics farme per render frame"},
-       {"getLogicTicRate", (PyCFunction) gPyGetLogicTicRate, METH_NOARGS, (PY_METHODCHAR)"Gets the logic tic rate"},
-       {"setLogicTicRate", (PyCFunction) gPySetLogicTicRate, METH_VARARGS, (PY_METHODCHAR)"Sets the logic tic rate"},
-       {"getPhysicsTicRate", (PyCFunction) gPyGetPhysicsTicRate, METH_NOARGS, (PY_METHODCHAR)"Gets the physics tic rate"},
-       {"setPhysicsTicRate", (PyCFunction) gPySetPhysicsTicRate, METH_VARARGS, (PY_METHODCHAR)"Sets the physics tic rate"},
-       {"getAverageFrameRate", (PyCFunction) gPyGetAverageFrameRate, METH_NOARGS, (PY_METHODCHAR)"Gets the estimated average frame rate"},
-       {"getBlendFileList", (PyCFunction)gPyGetBlendFileList, METH_VARARGS, (PY_METHODCHAR)"Gets a list of blend files in the same directory as the current blend file"},
-       {"PrintGLInfo", (PyCFunction)pyPrintExt, METH_NOARGS, (PY_METHODCHAR)"Prints GL Extension Info"},
-       {"EvalExpression", (PyCFunction)gEvalExpression, METH_O, (PY_METHODCHAR)"Evaluate a string as a game logic expression"},
+       METH_NOARGS, (const char *)gPyGetRandomFloat_doc.Ptr()},
+       {"setGravity",(PyCFunction) gPySetGravity, METH_O, (const char *)"set Gravitation"},
+       {"getSpectrum",(PyCFunction) gPyGetSpectrum, METH_NOARGS, (const char *)"get audio spectrum"},
+       {"stopDSP",(PyCFunction) gPyStopDSP, METH_VARARGS, (const char *)"stop using the audio dsp (for performance reasons)"},
+       {"getMaxLogicFrame", (PyCFunction) gPyGetMaxLogicFrame, METH_NOARGS, (const char *)"Gets the max number of logic frame per render frame"},
+       {"setMaxLogicFrame", (PyCFunction) gPySetMaxLogicFrame, METH_VARARGS, (const char *)"Sets the max number of logic frame per render frame"},
+       {"getMaxPhysicsFrame", (PyCFunction) gPyGetMaxPhysicsFrame, METH_NOARGS, (const char *)"Gets the max number of physics frame per render frame"},
+       {"setMaxPhysicsFrame", (PyCFunction) gPySetMaxPhysicsFrame, METH_VARARGS, (const char *)"Sets the max number of physics farme per render frame"},
+       {"getLogicTicRate", (PyCFunction) gPyGetLogicTicRate, METH_NOARGS, (const char *)"Gets the logic tic rate"},
+       {"setLogicTicRate", (PyCFunction) gPySetLogicTicRate, METH_VARARGS, (const char *)"Sets the logic tic rate"},
+       {"getPhysicsTicRate", (PyCFunction) gPyGetPhysicsTicRate, METH_NOARGS, (const char *)"Gets the physics tic rate"},
+       {"setPhysicsTicRate", (PyCFunction) gPySetPhysicsTicRate, METH_VARARGS, (const char *)"Sets the physics tic rate"},
+       {"getAverageFrameRate", (PyCFunction) gPyGetAverageFrameRate, METH_NOARGS, (const char *)"Gets the estimated average frame rate"},
+       {"getBlendFileList", (PyCFunction)gPyGetBlendFileList, METH_VARARGS, (const char *)"Gets a list of blend files in the same directory as the current blend file"},
+       {"PrintGLInfo", (PyCFunction)pyPrintExt, METH_NOARGS, (const char *)"Prints GL Extension Info"},
+       {"EvalExpression", (PyCFunction)gEvalExpression, METH_O, (const char *)"Evaluate a string as a game logic expression"},
        {NULL, (PyCFunction) NULL, 0, NULL }
 };
 
@@ -1019,7 +1019,6 @@ static char Rasterizer_module_documentation[] =
 "This is the Python API for the game engine of Rasterizer"
 ;
 
-#if (PY_VERSION_HEX >= 0x03000000)
 static struct PyModuleDef GameLogic_module_def = {
        {}, /* m_base */
        "GameLogic",  /* m_name */
@@ -1031,7 +1030,6 @@ static struct PyModuleDef GameLogic_module_def = {
        0,  /* m_clear */
        0,  /* m_free */
 };
-#endif
 
 PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack to get gravity hook
 {
@@ -1055,16 +1053,9 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
        }
        else {
                PyErr_Clear();
-               
                // Create the module and add the functions      
-#if (PY_VERSION_HEX >= 0x03000000)
                m = PyModule_Create(&GameLogic_module_def);
                PyDict_SetItemString(PySys_GetObject("modules"), GameLogic_module_def.m_name, m);
-#else
-               m = Py_InitModule4("GameLogic", game_methods,
-                                                  GameLogic_module_documentation,
-                                                  (PyObject*)NULL,PYTHON_API_VERSION);
-#endif
        }
        
        // Add some symbolic constants to the module
@@ -1346,18 +1337,11 @@ PyObject *KXpy_import(PyObject *self, PyObject *args)
        PyObject *locals = NULL;
        PyObject *fromlist = NULL;
        PyObject *l, *m, *n;
-
-#if (PY_VERSION_HEX >= 0x02060000)
-       int dummy_val; /* what does this do?*/
+       int level; /* not used yet */
        
        if (!PyArg_ParseTuple(args, "s|OOOi:m_import",
-               &name, &globals, &locals, &fromlist, &dummy_val))
+               &name, &globals, &locals, &fromlist, &level))
            return NULL;
-#else
-       if (!PyArg_ParseTuple(args, "s|OOO:m_import",
-               &name, &globals, &locals, &fromlist))
-           return NULL;
-#endif
 
        /* check for builtin modules */
        m = PyImport_AddModule("sys");
@@ -1614,7 +1598,7 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur
         */
        static bool first_time = true;
        
-#if (PY_VERSION_HEX < 0x03000000)
+#if 0 // TODO - py3
        STR_String pname = progname;
        Py_SetProgramName(pname.Ptr());
 #endif
@@ -1623,9 +1607,8 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur
        Py_Initialize();
        
        if(argv && first_time) { /* browser plugins dont currently set this */
-#if (PY_VERSION_HEX < 0x03000000)      
-               PySys_SetArgv(argc, argv);
-#else
+               // Until python support ascii again, we use our own.
+               // PySys_SetArgv(argc, argv);
                int i;
                PyObject *py_argv= PyList_New(argc);
 
@@ -1634,9 +1617,7 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur
 
                PySys_SetObject("argv", py_argv);
                Py_DECREF(py_argv);
-#endif
        }
-       //importBlenderModules()
        
        setSandbox(level);
        initPyTypes();
@@ -1670,7 +1651,7 @@ void exitGamePlayerPythonScripting()
  */
 PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLevel level, Main *maggie)
 {
-#if (PY_VERSION_HEX < 0x03000000)
+#if 0 // XXX TODO Py3
        STR_String pname = progname;
        Py_SetProgramName(pname.Ptr());
 #endif
@@ -1698,7 +1679,6 @@ void exitGamePythonScripting()
 }
 
 
-#if (PY_VERSION_HEX >= 0x03000000)
 static struct PyModuleDef Rasterizer_module_def = {
        {}, /* m_base */
        "Rasterizer",  /* m_name */
@@ -1710,7 +1690,6 @@ static struct PyModuleDef Rasterizer_module_def = {
        0,  /* m_clear */
        0,  /* m_free */
 };
-#endif
 
 PyObject* initRasterizer(RAS_IRasterizer* rasty,RAS_ICanvas* canvas)
 {
@@ -1733,14 +1712,8 @@ PyObject* initRasterizer(RAS_IRasterizer* rasty,RAS_ICanvas* canvas)
                PyErr_Clear();
        
                // Create the module and add the functions
-#if (PY_VERSION_HEX >= 0x03000000)
                m = PyModule_Create(&Rasterizer_module_def);
                PyDict_SetItemString(PySys_GetObject("modules"), Rasterizer_module_def.m_name, m);
-#else
-               m = Py_InitModule4("Rasterizer", rasterizer_methods,
-                    Rasterizer_module_documentation,
-                    (PyObject*)NULL,PYTHON_API_VERSION);
-#endif
        }
 
   // Add some symbolic constants to the module
@@ -1791,12 +1764,7 @@ static PyObject* gPyEventToString(PyObject*, PyObject* value)
        dict = PyModule_GetDict(mod);
        
        while (PyDict_Next(dict, &pos, &key, &val)) {
-#if (PY_VERSION_HEX >= 0x03000000)
                if (PyObject_RichCompareBool(value, val, Py_EQ)) {
-#else
-               if (PyObject_Compare(value, val)==0) {
-#endif
-                       
                        ret = key;
                        break;
                }
@@ -1832,13 +1800,11 @@ static PyObject* gPyEventToCharacter(PyObject*, PyObject* args)
 
 
 static struct PyMethodDef gamekeys_methods[] = {
-       {"EventToCharacter", (PyCFunction)gPyEventToCharacter, METH_VARARGS, (PY_METHODCHAR)gPyEventToCharacter_doc},
-       {"EventToString", (PyCFunction)gPyEventToString, METH_O, (PY_METHODCHAR)gPyEventToString_doc},
+       {"EventToCharacter", (PyCFunction)gPyEventToCharacter, METH_VARARGS, (const char *)gPyEventToCharacter_doc},
+       {"EventToString", (PyCFunction)gPyEventToString, METH_O, (const char *)gPyEventToString_doc},
        { NULL, (PyCFunction) NULL, 0, NULL }
 };
 
-
-#if (PY_VERSION_HEX >= 0x03000000)
 static struct PyModuleDef GameKeys_module_def = {
        {}, /* m_base */
        "GameKeys",  /* m_name */
@@ -1850,7 +1816,6 @@ static struct PyModuleDef GameKeys_module_def = {
        0,  /* m_clear */
        0,  /* m_free */
 };
-#endif
 
 PyObject* initGameKeys()
 {
@@ -1868,14 +1833,8 @@ PyObject* initGameKeys()
                PyErr_Clear();
        
                // Create the module and add the functions
-#if (PY_VERSION_HEX >= 0x03000000)
                m = PyModule_Create(&GameKeys_module_def);
                PyDict_SetItemString(PySys_GetObject("modules"), GameKeys_module_def.m_name, m);
-#else
-               m = Py_InitModule4("GameKeys", gamekeys_methods,
-                                          GameKeys_module_documentation,
-                                          (PyObject*)NULL,PYTHON_API_VERSION);
-#endif
        }
 
        // Add some symbolic constants to the module
@@ -2007,17 +1966,17 @@ PyObject* initGameKeys()
 
 PyObject* initMathutils()
 {
-       return Mathutils_Init("Mathutils"); // Use as a top level module in BGE
+       return Mathutils_Init();
 }
 
 PyObject* initGeometry()
 {
-       return Geometry_Init("Geometry"); // Use as a top level module in BGE
+       return Geometry_Init();
 }
 
 PyObject* initBGL()
 {
-       return BGL_Init("BGL"); // Use as a top level module in BGE
+       return BGL_Init();
 }
 
 void KX_SetActiveScene(class KX_Scene* scene)
@@ -2053,13 +2012,8 @@ int saveGamePythonConfig( char **marshal_buffer)
                                // PyObject_Print(pyGlobalDictMarshal, stderr, 0);
                                char *marshal_cstring;
                                
-#if PY_VERSION_HEX < 0x03000000
-                               marshal_cstring = _PyUnicode_AsString(pyGlobalDictMarshal);
-                               marshal_length= PyString_Size(pyGlobalDictMarshal);
-#else                  // py3 uses byte arrays
-                               marshal_cstring = PyBytes_AsString(pyGlobalDictMarshal);
+                               marshal_cstring = PyBytes_AsString(pyGlobalDictMarshal); // py3 uses byte arrays
                                marshal_length= PyBytes_Size(pyGlobalDictMarshal);
-#endif
                                *marshal_buffer = new char[marshal_length + 1];
                                memcpy(*marshal_buffer, marshal_cstring, marshal_length);
                                Py_DECREF(pyGlobalDictMarshal);
index 5b4d77156db67fa5e4699c57040ed157c5415e10..4fc5252de60677d16c06eb5785fd054057ecd5b2 100644 (file)
@@ -362,13 +362,7 @@ static PyObject *KX_PythonSeq_repr( KX_PythonSeq * self )
 /* Python KX_PythonSeq_Type structure definition:                               */
 /*****************************************************************************/
 PyTypeObject KX_PythonSeq_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
        /*  For printing, in format "<module>.<name>" */
        "KX_PythonSeq",           /* char *tp_name; */
        sizeof( KX_PythonSeq ),       /* int tp_basicsize; */
@@ -380,11 +374,8 @@ PyTypeObject KX_PythonSeq_Type = {
        NULL,                       /* printfunc tp_print; */
        NULL,                       /* getattrfunc tp_getattr; */
        NULL,                       /* setattrfunc tp_setattr; */
-#if PY_VERSION_HEX >= 0x03000000 // TODO - richcmp
-       NULL,
-#else
-       ( cmpfunc ) KX_PythonSeq_compare, /* cmpfunc tp_compare; */
-#endif
+       /* TODO, richcmp */
+       NULL, /* ( cmpfunc ) KX_PythonSeq_compare, /* cmpfunc tp_compare; */
        ( reprfunc ) KX_PythonSeq_repr,   /* reprfunc tp_repr; */
 
        /* Method suites for standard classes */
index 8ac94a324f2728551de88106c5a2770bcd5c42f2..d020a2544d2ee0c79237642ff86ddae3d7949c6d 100644 (file)
@@ -226,13 +226,7 @@ PyObject* KX_RadarSensor::PyGetConeHeight() {
 /* Python Integration Hooks                                                  */
 /* ------------------------------------------------------------------------- */
 PyTypeObject KX_RadarSensor::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
        "KX_RadarSensor",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -256,11 +250,11 @@ PyTypeObject KX_RadarSensor::Type = {
 PyMethodDef KX_RadarSensor::Methods[] = {
        //Deprecated ----->
        {"getConeOrigin", (PyCFunction) KX_RadarSensor::sPyGetConeOrigin, 
-        METH_VARARGS, (PY_METHODCHAR)GetConeOrigin_doc},
+        METH_VARARGS, (const char *)GetConeOrigin_doc},
        {"getConeTarget", (PyCFunction) KX_RadarSensor::sPyGetConeTarget, 
-        METH_VARARGS, (PY_METHODCHAR)GetConeTarget_doc},
+        METH_VARARGS, (const char *)GetConeTarget_doc},
        {"getConeHeight", (PyCFunction) KX_RadarSensor::sPyGetConeHeight, 
-        METH_VARARGS, (PY_METHODCHAR)GetConeHeight_doc},
+        METH_VARARGS, (const char *)GetConeHeight_doc},
         //<-----
        {NULL} //Sentinel
 };
index 3f27496df71217e7b1153c5e7a9fc98b19e7480c..8616145d709aff3ee8c6d907ce9d04a5f1865212 100644 (file)
@@ -319,13 +319,7 @@ bool KX_RaySensor::Evaluate()
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_RaySensor::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
        "KX_RaySensor",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -349,10 +343,10 @@ PyTypeObject KX_RaySensor::Type = {
 
 PyMethodDef KX_RaySensor::Methods[] = {
        // Deprecated ----->
-       {"getHitObject",(PyCFunction) KX_RaySensor::sPyGetHitObject,METH_NOARGS, (PY_METHODCHAR)GetHitObject_doc},
-       {"getHitPosition",(PyCFunction) KX_RaySensor::sPyGetHitPosition,METH_NOARGS, (PY_METHODCHAR)GetHitPosition_doc},
-       {"getHitNormal",(PyCFunction) KX_RaySensor::sPyGetHitNormal,METH_NOARGS, (PY_METHODCHAR)GetHitNormal_doc},
-       {"getRayDirection",(PyCFunction) KX_RaySensor::sPyGetRayDirection,METH_NOARGS, (PY_METHODCHAR)GetRayDirection_doc},
+       {"getHitObject",(PyCFunction) KX_RaySensor::sPyGetHitObject,METH_NOARGS, (const char *)GetHitObject_doc},
+       {"getHitPosition",(PyCFunction) KX_RaySensor::sPyGetHitPosition,METH_NOARGS, (const char *)GetHitPosition_doc},
+       {"getHitNormal",(PyCFunction) KX_RaySensor::sPyGetHitNormal,METH_NOARGS, (const char *)GetHitNormal_doc},
+       {"getRayDirection",(PyCFunction) KX_RaySensor::sPyGetRayDirection,METH_NOARGS, (const char *)GetRayDirection_doc},
        // <-----
        {NULL,NULL} //Sentinel
 };
index 239c4a0be6772985fe2d7daa72987c3dc75e3ebd..fffb0ac1220e15c1b7b48838d48b0b2683182ce0 100644 (file)
@@ -170,13 +170,7 @@ void KX_SCA_AddObjectActuator::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map)
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_SCA_AddObjectActuator::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
        "KX_SCA_AddObjectActuator",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -199,16 +193,16 @@ PyTypeObject KX_SCA_AddObjectActuator::Type = {
 
 PyMethodDef KX_SCA_AddObjectActuator::Methods[] = {
   // ---> deprecated
-  {"setTime", (PyCFunction) KX_SCA_AddObjectActuator::sPySetTime, METH_O, (PY_METHODCHAR)SetTime_doc},
-  {"getTime", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetTime, METH_NOARGS, (PY_METHODCHAR)GetTime_doc},
-  {"getLinearVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetLinearVelocity, METH_NOARGS, (PY_METHODCHAR)GetLinearVelocity_doc},
-  {"setLinearVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPySetLinearVelocity, METH_VARARGS, (PY_METHODCHAR)SetLinearVelocity_doc},
-  {"getAngularVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetAngularVelocity, METH_NOARGS, (PY_METHODCHAR)GetAngularVelocity_doc},
-  {"setAngularVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPySetAngularVelocity, METH_VARARGS, (PY_METHODCHAR)SetAngularVelocity_doc},
+  {"setTime", (PyCFunction) KX_SCA_AddObjectActuator::sPySetTime, METH_O, (const char *)SetTime_doc},
+  {"getTime", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetTime, METH_NOARGS, (const char *)GetTime_doc},
+  {"getLinearVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetLinearVelocity, METH_NOARGS, (const char *)GetLinearVelocity_doc},
+  {"setLinearVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPySetLinearVelocity, METH_VARARGS, (const char *)SetLinearVelocity_doc},
+  {"getAngularVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetAngularVelocity, METH_NOARGS, (const char *)GetAngularVelocity_doc},
+  {"setAngularVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPySetAngularVelocity, METH_VARARGS, (const char *)SetAngularVelocity_doc},
   {"getLastCreatedObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetLastCreatedObject, METH_NOARGS,"getLastCreatedObject() : get the object handle to the last created object\n"},
   {"instantAddObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyInstantAddObject, METH_NOARGS,"instantAddObject() : immediately add object without delay\n"},
-  {"setObject", (PyCFunction) KX_SCA_AddObjectActuator::sPySetObject, METH_O, (PY_METHODCHAR)SetObject_doc},
-  {"getObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetObject, METH_VARARGS, (PY_METHODCHAR)GetObject_doc},
+  {"setObject", (PyCFunction) KX_SCA_AddObjectActuator::sPySetObject, METH_O, (const char *)SetObject_doc},
+  {"getObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetObject, METH_VARARGS, (const char *)GetObject_doc},
   
   {NULL,NULL} //Sentinel
 };
index 423fd0db7f242b301683979731d85dbcd6478647..196c1915f72e2dc5152c20d1d8155e9e400c059f 100644 (file)
 /* Integration hooks ------------------------------------------------------- */
 
 PyTypeObject KX_SCA_DynamicActuator::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
        "KX_SCA_DynamicActuator",
        sizeof(PyObjectPlus_Proxy),
        0,
index 47c5c3aeeebee0e16bffbceb600e8a4ec00a428a..dd9d8015724e2234c71c6272160614bf0cf0706b 100644 (file)
@@ -91,13 +91,7 @@ CValue* KX_SCA_EndObjectActuator::GetReplica()
 /* ------------------------------------------------------------------------- */
 
 PyTypeObject KX_SCA_EndObjectActuator::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
        "KX_SCA_EndObjectActuator",
        sizeof(PyObjectPlus_Proxy),
        0,
index a19b18bf0e0a29d3916784a8c09e11db905c9591..0819ad996337834e8a8e3311e44eef9d2de4b351 100644 (file)
 /* Integration hooks ------------------------------------------------------- */
 
 PyTypeObject KX_SCA_ReplaceMeshActuator::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
        "KX_SCA_ReplaceMeshActuator",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -81,7 +75,7 @@ PyTypeObject KX_SCA_ReplaceMeshActuator::Type = {
 PyMethodDef KX_SCA_ReplaceMeshActuator::Methods[] = {
        KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, instantReplaceMesh),
        // Deprecated ----->
-       {"setMesh", (PyCFunction) KX_SCA_ReplaceMeshActuator::sPySetMesh, METH_O, (PY_METHODCHAR)SetMesh_doc},
+       {"setMesh", (PyCFunction) KX_SCA_ReplaceMeshActuator::sPySetMesh, METH_O, (const char *)SetMesh_doc},
        KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, getMesh),
        {NULL,NULL} //Sentinel
 };
index c45e4294d13db418045531fb01407dbe937c0c01..5c19911fe5837554f5f39deb0acb4938747effa4 100644 (file)
@@ -1605,31 +1605,25 @@ double KX_Scene::getSuspendedDelta()
 //Python
 
 PyTypeObject KX_Scene::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
-               "KX_Scene",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,0,0,0,0,0,0,0,0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &CValue::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "KX_Scene",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &CValue::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 PyMethodDef KX_Scene::Methods[] = {
index 5528e58ef775fefa6051e81c893e122460f6c3c9..a0b7664d63a6de6746dd487ce7e29c8f18986d61 100644 (file)
@@ -222,42 +222,36 @@ KX_Scene* KX_SceneActuator::FindScene(char * sceneName)
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_SceneActuator::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
-               "KX_SceneActuator",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,0,0,0,0,0,0,0,0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &SCA_IActuator::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "KX_SceneActuator",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &SCA_IActuator::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 PyMethodDef KX_SceneActuator::Methods[] =
 {
        //Deprecated functions ------>
-       {"setUseRestart", (PyCFunction) KX_SceneActuator::sPySetUseRestart, METH_VARARGS, (PY_METHODCHAR)SetUseRestart_doc},
-       {"setScene",      (PyCFunction) KX_SceneActuator::sPySetScene, METH_VARARGS, (PY_METHODCHAR)SetScene_doc},
-       {"setCamera",     (PyCFunction) KX_SceneActuator::sPySetCamera, METH_O, (PY_METHODCHAR)SetCamera_doc},
-       {"getUseRestart", (PyCFunction) KX_SceneActuator::sPyGetUseRestart, METH_NOARGS, (PY_METHODCHAR)GetUseRestart_doc},
-       {"getScene",      (PyCFunction) KX_SceneActuator::sPyGetScene, METH_NOARGS, (PY_METHODCHAR)GetScene_doc},
-       {"getCamera",     (PyCFunction) KX_SceneActuator::sPyGetCamera, METH_NOARGS, (PY_METHODCHAR)GetCamera_doc},
+       {"setUseRestart", (PyCFunction) KX_SceneActuator::sPySetUseRestart, METH_VARARGS, (const char *)SetUseRestart_doc},
+       {"setScene",      (PyCFunction) KX_SceneActuator::sPySetScene, METH_VARARGS, (const char *)SetScene_doc},
+       {"setCamera",     (PyCFunction) KX_SceneActuator::sPySetCamera, METH_O, (const char *)SetCamera_doc},
+       {"getUseRestart", (PyCFunction) KX_SceneActuator::sPyGetUseRestart, METH_NOARGS, (const char *)GetUseRestart_doc},
+       {"getScene",      (PyCFunction) KX_SceneActuator::sPyGetScene, METH_NOARGS, (const char *)GetScene_doc},
+       {"getCamera",     (PyCFunction) KX_SceneActuator::sPyGetCamera, METH_NOARGS, (const char *)GetCamera_doc},
        //<----- Deprecated
        {NULL,NULL} //Sentinel
 };
index db1788629eda5956181e7f55880aae67fa27eb6a..510d359dc8ebf0c782a07d03b90144f14ec8a3ac 100644 (file)
@@ -277,31 +277,25 @@ bool KX_SoundActuator::Update(double curtime, bool frame)
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_SoundActuator::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
-               "KX_SoundActuator",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,0,0,0,0,0,0,0,0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &SCA_IActuator::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "KX_SoundActuator",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &SCA_IActuator::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 PyMethodDef KX_SoundActuator::Methods[] = {
index 9815d6274aa4af3ebd303ee66f721eb9068cce49..09d95612cbb62784b538281f98b89e29e387c3df 100644 (file)
@@ -137,13 +137,7 @@ void KX_StateActuator::Activate(SG_DList& head)
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_StateActuator::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
        "KX_StateActuator",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -167,9 +161,9 @@ PyTypeObject KX_StateActuator::Type = {
 PyMethodDef KX_StateActuator::Methods[] = {
        // deprecated -->
        {"setOperation", (PyCFunction) KX_StateActuator::sPySetOperation, 
-        METH_VARARGS, (PY_METHODCHAR)SetOperation_doc},
+        METH_VARARGS, (const char *)SetOperation_doc},
        {"setMask", (PyCFunction) KX_StateActuator::sPySetMask, 
-        METH_VARARGS, (PY_METHODCHAR)SetMask_doc},
+        METH_VARARGS, (const char *)SetMask_doc},
         // <--
        {NULL,NULL} //Sentinel
 };
index b0cf172c27ad6981b5f97df87bc0203d3df4c0cb..bf8469f1ec93b60d603b306eaa7dd954becac6c8 100644 (file)
@@ -294,13 +294,7 @@ bool       KX_TouchSensor::NewHandleCollision(void*object1,void*object2,const PHY_Coll
 /* ------------------------------------------------------------------------- */
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_TouchSensor::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
        "KX_TouchSensor",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -324,13 +318,13 @@ PyTypeObject KX_TouchSensor::Type = {
 PyMethodDef KX_TouchSensor::Methods[] = {
        //Deprecated ----->
        {"setProperty", 
-        (PyCFunction) KX_TouchSensor::sPySetProperty,      METH_O, (PY_METHODCHAR)SetProperty_doc},
+        (PyCFunction) KX_TouchSensor::sPySetProperty,      METH_O, (const char *)SetProperty_doc},
        {"getProperty", 
-        (PyCFunction) KX_TouchSensor::sPyGetProperty,      METH_NOARGS, (PY_METHODCHAR)GetProperty_doc},
+        (PyCFunction) KX_TouchSensor::sPyGetProperty,      METH_NOARGS, (const char *)GetProperty_doc},
        {"getHitObject", 
-        (PyCFunction) KX_TouchSensor::sPyGetHitObject,     METH_NOARGS, (PY_METHODCHAR)GetHitObject_doc},
+        (PyCFunction) KX_TouchSensor::sPyGetHitObject,     METH_NOARGS, (const char *)GetHitObject_doc},
        {"getHitObjectList", 
-        (PyCFunction) KX_TouchSensor::sPyGetHitObjectList, METH_NOARGS, (PY_METHODCHAR)GetHitObjectList_doc},
+        (PyCFunction) KX_TouchSensor::sPyGetHitObjectList, METH_NOARGS, (const char *)GetHitObjectList_doc},
         //<-----
        {NULL,NULL} //Sentinel
 };
index e8a06d8d6194097645684084e4b8f37d7e651b68..b5b7e9de444e1d67a2ef0574bfde9489cd378175 100644 (file)
@@ -431,13 +431,7 @@ bool KX_TrackToActuator::Update(double curtime, bool frame)
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_TrackToActuator::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
        "KX_TrackToActuator",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -460,12 +454,12 @@ PyTypeObject KX_TrackToActuator::Type = {
 
 PyMethodDef KX_TrackToActuator::Methods[] = {
        // ---> deprecated
-       {"setTime", (PyCFunction) KX_TrackToActuator::sPySetTime, METH_VARARGS, (PY_METHODCHAR)SetTime_doc},
-       {"getTime", (PyCFunction) KX_TrackToActuator::sPyGetTime, METH_NOARGS, (PY_METHODCHAR)GetTime_doc},
-       {"setUse3D", (PyCFunction) KX_TrackToActuator::sPySetUse3D, METH_VARARGS, (PY_METHODCHAR)SetUse3D_doc},
-       {"getUse3D", (PyCFunction) KX_TrackToActuator::sPyGetUse3D, METH_NOARGS, (PY_METHODCHAR)GetUse3D_doc},
-       {"setObject", (PyCFunction) KX_TrackToActuator::sPySetObject, METH_O, (PY_METHODCHAR)SetObject_doc},
-       {"getObject", (PyCFunction) KX_TrackToActuator::sPyGetObject, METH_VARARGS, (PY_METHODCHAR)GetObject_doc},
+       {"setTime", (PyCFunction) KX_TrackToActuator::sPySetTime, METH_VARARGS, (const char *)SetTime_doc},
+       {"getTime", (PyCFunction) KX_TrackToActuator::sPyGetTime, METH_NOARGS, (const char *)GetTime_doc},
+       {"setUse3D", (PyCFunction) KX_TrackToActuator::sPySetUse3D, METH_VARARGS, (const char *)SetUse3D_doc},
+       {"getUse3D", (PyCFunction) KX_TrackToActuator::sPyGetUse3D, METH_NOARGS, (const char *)GetUse3D_doc},
+       {"setObject", (PyCFunction) KX_TrackToActuator::sPySetObject, METH_O, (const char *)SetObject_doc},
+       {"getObject", (PyCFunction) KX_TrackToActuator::sPyGetObject, METH_VARARGS, (const char *)GetObject_doc},
        
        {NULL,NULL} //Sentinel
 };
index 7001bfc8b7ee7872474ccc75af10890ee18624af..1f46cbf53be09a2240d0c3abc845fffd45e82421 100644 (file)
@@ -273,31 +273,25 @@ PyObject* KX_VehicleWrapper::PyGetConstraintType(PyObject* args)
 
 //python specific stuff
 PyTypeObject KX_VehicleWrapper::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
-               "KX_VehicleWrapper",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,0,0,0,0,0,0,0,0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &PyObjectPlus::Type,
-               0,0,0,0,0,0,
-               py_base_new
+       "KX_VehicleWrapper",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &PyObjectPlus::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 PyMethodDef KX_VehicleWrapper::Methods[] = {
index cb8c891969df773c74158de2c5d9cfc87098da7f..6a47dec181b79309bd42ec58fb263e64b6283c8c 100644 (file)
 #include "KX_PyMath.h"
 
 PyTypeObject KX_VertexProxy::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
        "KX_VertexProxy",
        sizeof(PyObjectPlus_Proxy),
        0,
index 3561ccde9d95f2ff51c0ce88b802fcfd53b45c4c..97c893c6caa5dca3829af732708a094b5f049475 100644 (file)
@@ -91,13 +91,7 @@ KX_VisibilityActuator::Update()
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_VisibilityActuator::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
        "KX_VisibilityActuator",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -121,7 +115,7 @@ PyTypeObject KX_VisibilityActuator::Type = {
 PyMethodDef KX_VisibilityActuator::Methods[] = {
        // Deprecated ----->
        {"set", (PyCFunction) KX_VisibilityActuator::sPySetVisible, METH_VARARGS,
-               (PY_METHODCHAR) SetVisible_doc},
+               (const char *) SetVisible_doc},
        // <-----
        {NULL,NULL} //Sentinel
 };
index 6d26e5b6d35c039f96b94a94ed506f1c25d08b16..2a624b2ccaac3edb2f391465943a4b9b66394c0b 100644 (file)
@@ -135,13 +135,7 @@ static PyGetSetDef filterBSGetSets[] =
 // define python type
 PyTypeObject FilterBlueScreenType =
 { 
-#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
        "VideoTexture.FilterBlueScreen",   /*tp_name*/
        sizeof(PyFilter),          /*tp_basicsize*/
        0,                         /*tp_itemsize*/
index eb86f520e027e24211bb38010f03fdd48fa8c4fc..e5d479747c469d0323b906102bfc6ecf74cf034f 100644 (file)
@@ -41,13 +41,7 @@ static PyGetSetDef filterGrayGetSets[] =
 // define python type
 PyTypeObject FilterGrayType =
 { 
-#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
        "VideoTexture.FilterGray",   /*tp_name*/
        sizeof(PyFilter),          /*tp_basicsize*/
        0,                         /*tp_itemsize*/
@@ -178,13 +172,7 @@ static PyGetSetDef filterColorGetSets[] =
 // define python type
 PyTypeObject FilterColorType =
 { 
-#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
        "VideoTexture.FilterColor",   /*tp_name*/
        sizeof(PyFilter),          /*tp_basicsize*/
        0,                         /*tp_itemsize*/
@@ -317,13 +305,7 @@ static PyGetSetDef filterLevelGetSets[] =
 // define python type
 PyTypeObject FilterLevelType =
 { 
-#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
        "VideoTexture.FilterLevel",   /*tp_name*/
        sizeof(PyFilter),          /*tp_basicsize*/
        0,                         /*tp_itemsize*/
index 002be6c3189ed0bc73131d436d06d5d6c644074f..d755e6294c9cdbca903a4155beaac238e0864761 100644 (file)
@@ -124,13 +124,7 @@ static PyGetSetDef filterNormalGetSets[] =
 // define python type
 PyTypeObject FilterNormalType =
 { 
-#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
        "VideoTexture.FilterNormal",   /*tp_name*/
        sizeof(PyFilter),          /*tp_basicsize*/
        0,                         /*tp_itemsize*/
index 4c75e14bbac1fc7b21a640cd0a3f7a74744f7928..4b67785edb3703b26d0fe43e8db5c9d424028307 100644 (file)
@@ -36,13 +36,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 // define python type
 PyTypeObject FilterRGB24Type =
 { 
-#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
        "VideoTexture.FilterRGB24",   /*tp_name*/
        sizeof(PyFilter),          /*tp_basicsize*/
        0,                         /*tp_itemsize*/
@@ -87,13 +81,7 @@ PyTypeObject FilterRGB24Type =
 // define python type
 PyTypeObject FilterRGBA32Type =
 { 
-#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
        "VideoTexture.FilterRGBA32",   /*tp_name*/
        sizeof(PyFilter),          /*tp_basicsize*/
        0,                         /*tp_itemsize*/
@@ -138,13 +126,7 @@ PyTypeObject FilterRGBA32Type =
 // define python type
 PyTypeObject FilterBGR24Type =
 { 
-#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
        "VideoTexture.FilterBGR24",   /*tp_name*/
        sizeof(PyFilter),          /*tp_basicsize*/
        0,                         /*tp_itemsize*/
index c7185660e833927d7147ee9ab13ce2640297ee72..9cd661a24225ac64c5f310863d14afc86f869a74 100644 (file)
@@ -122,13 +122,7 @@ static PyGetSetDef imageBuffGetSets[] =
 // define python type
 PyTypeObject ImageBuffType =
 { 
-#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
        "VideoTexture.ImageBuff",   /*tp_name*/
        sizeof(PyImage),          /*tp_basicsize*/
        0,                         /*tp_itemsize*/
index 067143e57bbce3a3a8f954f644b0aee64bcf91cb..2560467c3db4d08f7f85b7916945def3f7adb099 100644 (file)
@@ -166,13 +166,7 @@ static PyGetSetDef imageMixGetSets[] =
 // define python type
 PyTypeObject ImageMixType =
 { 
-#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
        "VideoTexture.ImageMix",   /*tp_name*/
        sizeof(PyImage),          /*tp_basicsize*/
        0,                         /*tp_itemsize*/
index d8be08e0eb55304488685ea70e6209aa026424b0..6e70bfb14a0bfe2c420701f03c47ad7cd943f497 100644 (file)
@@ -376,13 +376,7 @@ static PyGetSetDef imageRenderGetSets[] =
 // define python type
 PyTypeObject ImageRenderType =
 { 
-#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
        "VideoTexture.ImageRender",   /*tp_name*/
        sizeof(PyImage),          /*tp_basicsize*/
        0,                         /*tp_itemsize*/
@@ -715,13 +709,7 @@ ImageRender::ImageRender (KX_Scene * scene, KX_GameObject * observer, KX_GameObj
 // define python type
 PyTypeObject ImageMirrorType =
 { 
-#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
        "VideoTexture.ImageMirror",   /*tp_name*/
        sizeof(PyImage),          /*tp_basicsize*/
        0,                         /*tp_itemsize*/
index 55b143962805ddf571ff3fc44295d6c92692b59a..691a983970af9029b29d17ed977eab2f69882f96 100644 (file)
@@ -289,13 +289,7 @@ static PyGetSetDef imageViewportGetSets[] =
 // define python type
 PyTypeObject ImageViewportType =
 { 
-#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
        "VideoTexture.ImageViewport",   /*tp_name*/
        sizeof(PyImage),          /*tp_basicsize*/
        0,                         /*tp_itemsize*/
index f4105652f80284b2a88186e6764b08398e7e2208..04b39f0b05caecdae7d611744cf6599d34629d6a 100644 (file)
@@ -434,13 +434,7 @@ static PyGetSetDef textureGetSets[] =
 // class Texture declaration
 PyTypeObject TextureType =
 {
-#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
        "VideoTexture.Texture",   /*tp_name*/
        sizeof(Texture),           /*tp_basicsize*/
        0,                         /*tp_itemsize*/
index cf4ea88c1b5556ecb57dc6d715dba8d756ea2998..f21555a95c959d00e216ea9fbf2b333585497ddc 100644 (file)
@@ -1160,13 +1160,7 @@ static PyGetSetDef videoGetSets[] =
 // python type declaration
 PyTypeObject VideoFFmpegType =
 { 
-#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
        "VideoTexture.VideoFFmpeg",   /*tp_name*/
        sizeof(PyImage),          /*tp_basicsize*/
        0,                         /*tp_itemsize*/
@@ -1284,13 +1278,7 @@ static PyGetSetDef imageGetSets[] =
 // python type declaration
 PyTypeObject ImageFFmpegType =
 { 
-#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
        "VideoTexture.ImageFFmpeg",   /*tp_name*/
        sizeof(PyImage),          /*tp_basicsize*/
        0,                         /*tp_itemsize*/
index 22171f69321fd459ce7088c9ac599cc53b49f67f..998d63506b0d10ef28aa63d036eab030966e34c7 100644 (file)
@@ -159,8 +159,6 @@ static void registerAllTypes(void)
        pyFilterTypes.add(&FilterBGR24Type, "FilterBGR24");
 }
 
-
-#if (PY_VERSION_HEX >= 0x03000000)
 static struct PyModuleDef VideoTexture_module_def = {
        {}, /* m_base */
        "VideoTexture",  /* m_name */
@@ -172,7 +170,6 @@ static struct PyModuleDef VideoTexture_module_def = {
        0,  /* m_clear */
        0,  /* m_free */
 };
-#endif
 
 PyObject* initVideoTexture(void) 
 {
@@ -202,14 +199,8 @@ PyObject* initVideoTexture(void)
        else {
                PyErr_Clear();
        
-#if (PY_VERSION_HEX >= 0x03000000)
                m = PyModule_Create(&VideoTexture_module_def);
                PyDict_SetItemString(PySys_GetObject("modules"), VideoTexture_module_def.m_name, m);
-#else
-               m = Py_InitModule4("VideoTexture", moduleMethods,
-                       "Module that allows to play video files on textures in GameBlender.",
-                       (PyObject*)NULL,PYTHON_API_VERSION);
-#endif
        }
        
        if (m == NULL)