Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/Ketsji/KX_VehicleWrapper.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_VehicleWrapper.cpp68
1 files changed, 22 insertions, 46 deletions
diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
index 8146d04a878..1f46cbf53be 100644
--- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
+++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
@@ -16,8 +16,8 @@
KX_VehicleWrapper::KX_VehicleWrapper(
PHY_IVehicle* vehicle,
- PHY_IPhysicsEnvironment* physenv,PyTypeObject *T) :
- PyObjectPlus(T),
+ PHY_IPhysicsEnvironment* physenv) :
+ PyObjectPlus(),
m_vehicle(vehicle),
m_physenv(physenv)
{
@@ -127,13 +127,13 @@ PyObject* KX_VehicleWrapper::PyGetWheelOrientationQuaternion(PyObject* args)
PyObject* KX_VehicleWrapper::PyGetNumWheels(PyObject* args)
{
- return PyInt_FromLong(m_vehicle->GetNumWheels());
+ return PyLong_FromSsize_t(m_vehicle->GetNumWheels());
}
PyObject* KX_VehicleWrapper::PyGetConstraintId(PyObject* args)
{
- return PyInt_FromLong(m_vehicle->GetUserConstraintId());
+ return PyLong_FromSsize_t(m_vehicle->GetUserConstraintId());
}
@@ -264,7 +264,7 @@ PyObject* KX_VehicleWrapper::PySetSteeringValue(PyObject* args)
PyObject* KX_VehicleWrapper::PyGetConstraintType(PyObject* args)
{
- return PyInt_FromLong(m_vehicle->GetUserConstraintType());
+ return PyLong_FromSsize_t(m_vehicle->GetUserConstraintType());
}
@@ -273,51 +273,27 @@ 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,
- py_base_getattro,
- py_base_setattro,
- 0,0,0,0,0,0,0,0,0,
- Methods
-};
-
-PyParentObject KX_VehicleWrapper::Parents[] = {
- &KX_VehicleWrapper::Type,
+ "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,
- NULL
-};
-
-PyObject* KX_VehicleWrapper::py_getattro(PyObject *attr)
-{
- //here you can search for existing data members (like mass,friction etc.)
- py_getattro_up(PyObjectPlus);
-}
-
-PyObject* KX_VehicleWrapper::py_getattro_dict() {
- py_getattro_dict_up(PyObjectPlus);
-}
-
-int KX_VehicleWrapper::py_setattro(PyObject *attr,PyObject* value)
-{
- py_setattro_up(PyObjectPlus);
+ 0,0,0,0,0,0,
+ py_base_new
};
-
PyMethodDef KX_VehicleWrapper::Methods[] = {
{"addWheel",(PyCFunction) KX_VehicleWrapper::sPyAddWheel, METH_VARARGS},
{"getNumWheels",(PyCFunction) KX_VehicleWrapper::sPyGetNumWheels, METH_VARARGS},