diff options
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp | 14 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp | 3 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_Camera.cpp | 8 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_GameObject.cpp | 9 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_MeshProxy.cpp | 12 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp | 12 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_PyConstraintBinding.cpp | 63 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 20 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_VehicleWrapper.cpp | 33 |
9 files changed, 162 insertions, 12 deletions
diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp index 3ade810c394..85921ae75ca 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp @@ -158,6 +158,9 @@ PyObject* KX_NetworkMessageActuator::PySetToPropName( if (PyArg_ParseTuple(args, "s", &ToPropName)) { m_toPropName = ToPropName; } + else { + return NULL; + } Py_Return; } @@ -173,7 +176,10 @@ PyObject* KX_NetworkMessageActuator::PySetSubject( if (PyArg_ParseTuple(args, "s", &Subject)) { m_subject = Subject; } - + else { + return NULL; + } + Py_Return; } @@ -188,6 +194,9 @@ PyObject* KX_NetworkMessageActuator::PySetBodyType( if (PyArg_ParseTuple(args, "i", &BodyType)) { m_bodyType = BodyType; } + else { + return NULL; + } Py_Return; } @@ -203,6 +212,9 @@ PyObject* KX_NetworkMessageActuator::PySetBody( if (PyArg_ParseTuple(args, "s", &Body)) { m_body = Body; } + else { + return NULL; + } Py_Return; } diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp index e320453b7aa..944a9bc5e90 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp @@ -228,6 +228,9 @@ PyObject* KX_NetworkMessageSensor::PySetSubjectFilterText( { m_subject = Subject; } + else { + return NULL; + } Py_Return; } diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 27e47d72bbe..3830d422138 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -588,7 +588,7 @@ KX_PYMETHODDEF_DOC(KX_Camera, sphereInsideFrustum, PyErr_SetString(PyExc_TypeError, "sphereInsideFrustum: Expected arguments: (center, radius)"); - Py_Return; + return NULL; } KX_PYMETHODDEF_DOC(KX_Camera, boxInsideFrustum, @@ -766,6 +766,10 @@ KX_PYMETHODDEF_DOC(KX_Camera, enableViewport, else EnableViewport(false); } + else { + return NULL; + } + Py_Return; } @@ -777,6 +781,8 @@ KX_PYMETHODDEF_DOC(KX_Camera, setViewport, if (PyArg_ParseTuple(args,"iiii",&left, &bottom, &right, &top)) { SetViewport(left, bottom, right, top); + } else { + return NULL; } Py_Return; } diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index fb636b23082..0ad08a4e8a6 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1008,6 +1008,9 @@ PyObject* KX_GameObject::PyGetVelocity(PyObject* self, if (pypos) PyVecTo(pypos, point); } + else { + return NULL; + } if (m_pPhysicsController1) { @@ -1096,6 +1099,10 @@ PyObject* KX_GameObject::PySetParent(PyObject* self, this->SetParent(scene, obj); } + else { + return NULL; + } + Py_Return; } @@ -1122,7 +1129,7 @@ PyObject* KX_GameObject::PyGetMesh(PyObject* self, return meshproxy; } } - Py_Return; + return NULL; } diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index 5c8fef1fca0..c7a251751cd 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -157,6 +157,9 @@ PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* self, { matname = m_meshobj->GetMaterialName(matid); } + else { + return NULL; + } return PyString_FromString(matname.Ptr()); @@ -174,6 +177,9 @@ PyObject* KX_MeshProxy::PyGetTextureName(PyObject* self, { matname = m_meshobj->GetTextureName(matid); } + else { + return NULL; + } return PyString_FromString(matname.Ptr()); @@ -195,6 +201,9 @@ PyObject* KX_MeshProxy::PyGetVertexArrayLength(PyObject* self, length = m_meshobj->GetVertexArrayLength(mat); } } + else { + return NULL; + } return PyInt_FromLong(length); @@ -217,6 +226,9 @@ PyObject* KX_MeshProxy::PyGetVertex(PyObject* self, vertexob = new KX_VertexProxy(this, vertex); } } + else { + return NULL; + } return vertexob; diff --git a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp index 27cfaefc076..2df4c6a9980 100644 --- a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp +++ b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp @@ -58,6 +58,9 @@ PyObject* KX_PhysicsObjectWrapper::PySetPosition(PyObject* self, { m_ctrl->setPosition(x,y,z); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -72,6 +75,9 @@ PyObject* KX_PhysicsObjectWrapper::PySetLinearVelocity(PyObject* self, { m_ctrl->SetLinearVelocity(x,y,z,local != 0); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -85,6 +91,9 @@ PyObject* KX_PhysicsObjectWrapper::PySetAngularVelocity(PyObject* self, { m_ctrl->SetAngularVelocity(x,y,z,local != 0); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -97,6 +106,9 @@ PyObject* KX_PhysicsObjectWrapper::PySetActive(PyObject* self, { m_ctrl->SetActive(active!=0); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp index 172882ff18d..c01d6a632a3 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp @@ -82,12 +82,15 @@ static PyObject* gPySetGravity(PyObject* self, PyObject* kwds) { float x,y,z; - int len = PyTuple_Size(args); - if ((len == 3) && PyArg_ParseTuple(args,"fff",&x,&y,&z)) + if (PyArg_ParseTuple(args,"fff",&x,&y,&z)) { if (PHY_GetActiveEnvironment()) PHY_GetActiveEnvironment()->setGravity(x,y,z); } + else { + return NULL; + } + Py_INCREF(Py_None); return Py_None; } @@ -105,6 +108,10 @@ static PyObject* gPySetDebugMode(PyObject* self, } } + else { + return NULL; + } + Py_INCREF(Py_None); return Py_None; } @@ -122,6 +129,9 @@ static PyObject* gPySetNumTimeSubSteps(PyObject* self, PHY_GetActiveEnvironment()->setNumTimeSubSteps(substep); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -138,6 +148,9 @@ static PyObject* gPySetNumIterations(PyObject* self, PHY_GetActiveEnvironment()->setNumIterations(iter); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -155,6 +168,9 @@ static PyObject* gPySetDeactivationTime(PyObject* self, PHY_GetActiveEnvironment()->setDeactivationTime(deactive_time); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -171,6 +187,9 @@ static PyObject* gPySetDeactivationLinearTreshold(PyObject* self, PHY_GetActiveEnvironment()->setDeactivationLinearTreshold( linearDeactivationTreshold); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -187,6 +206,9 @@ static PyObject* gPySetDeactivationAngularTreshold(PyObject* self, PHY_GetActiveEnvironment()->setDeactivationAngularTreshold( angularDeactivationTreshold); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -202,6 +224,9 @@ static PyObject* gPySetContactBreakingTreshold(PyObject* self, PHY_GetActiveEnvironment()->setContactBreakingTreshold( contactBreakingTreshold); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -218,6 +243,9 @@ static PyObject* gPySetCcdMode(PyObject* self, PHY_GetActiveEnvironment()->setCcdMode( ccdMode); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -233,6 +261,9 @@ static PyObject* gPySetSorConstant(PyObject* self, PHY_GetActiveEnvironment()->setSolverSorConstant( sor); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -248,6 +279,9 @@ static PyObject* gPySetSolverTau(PyObject* self, PHY_GetActiveEnvironment()->setSolverTau( tau); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -264,6 +298,9 @@ static PyObject* gPySetSolverDamping(PyObject* self, PHY_GetActiveEnvironment()->setSolverDamping( damping); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -279,6 +316,9 @@ static PyObject* gPySetLinearAirDamping(PyObject* self, PHY_GetActiveEnvironment()->setLinearAirDamping( damping); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -295,6 +335,9 @@ static PyObject* gPySetUseEpa(PyObject* self, PHY_GetActiveEnvironment()->setUseEpa(epa); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } static PyObject* gPySetSolverType(PyObject* self, @@ -309,6 +352,9 @@ static PyObject* gPySetSolverType(PyObject* self, PHY_GetActiveEnvironment()->setSolverType(solverType); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -338,6 +384,9 @@ static PyObject* gPyGetVehicleConstraint(PyObject* self, } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -395,6 +444,9 @@ static PyObject* gPyCreateConstraint(PyObject* self, } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -421,6 +473,9 @@ static PyObject* gPyGetAppliedImpulse(PyObject* self, appliedImpulse = PHY_GetActiveEnvironment()->getAppliedImpulse(constraintid); } } + else { + return NULL; + } return PyFloat_FromDouble(appliedImpulse); } @@ -443,6 +498,10 @@ static PyObject* gPyRemoveConstraint(PyObject* self, PHY_GetActiveEnvironment()->removeConstraint(constraintid); } } + else { + return NULL; + } + Py_INCREF(Py_None); return Py_None; } diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index a80a7f04e8f..8ad4e0fc743 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -453,7 +453,7 @@ static PyObject* gPyEnableVisibility(PyObject*, } else { - Py_Return; + return NULL; } Py_Return; } @@ -477,6 +477,9 @@ static PyObject* gPyShowMouse(PyObject*, gp_Canvas->SetMouseState(RAS_ICanvas::MOUSE_INVISIBLE); } } + else { + return NULL; + } Py_Return; } @@ -493,6 +496,9 @@ static PyObject* gPySetMousePosition(PyObject*, if (gp_Canvas) gp_Canvas->SetMousePosition(x,y); } + else { + return NULL; + } Py_Return; } @@ -596,6 +602,9 @@ static PyObject* gPySetMistStart(PyObject*, gp_Rasterizer->SetFogStart(miststart); } } + else { + return NULL; + } Py_Return; } @@ -614,6 +623,9 @@ static PyObject* gPySetMistEnd(PyObject*, gp_Rasterizer->SetFogEnd(mistend); } } + else { + return NULL; + } Py_Return; } @@ -651,6 +663,9 @@ static PyObject* gPyMakeScreenshot(PyObject*, gp_Canvas->MakeScreenShot(filename); } } + else { + return NULL; + } Py_Return; } @@ -666,6 +681,9 @@ static PyObject* gPyEnableMotionBlur(PyObject*, gp_Rasterizer->EnableMotionBlur(motionblurvalue); } } + else { + return NULL; + } Py_Return; } diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp index fba2ecc223b..7e8160a4d67 100644 --- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp +++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp @@ -68,6 +68,8 @@ PyObject* KX_VehicleWrapper::PyAddWheel(PyObject* self, printf("attempt for addWheel: suspensionRestLength%f wheelRadius %f, hasSteering:%d\n",suspensionRestLength,wheelRadius,hasSteering); m_vehicle->AddWheel(motionState,aPos,aDir,aAxle,suspensionRestLength,wheelRadius,hasSteering); + } else { + return NULL; } Py_INCREF(Py_None); return Py_None; @@ -90,8 +92,7 @@ PyObject* KX_VehicleWrapper::PyGetWheelPosition(PyObject* self, MT_Vector3 pos(position[0],position[1],position[2]); return PyObjectFrom(pos); } - Py_INCREF(Py_None); - return Py_None; + return NULL; } PyObject* KX_VehicleWrapper::PyGetWheelRotation(PyObject* self, @@ -103,8 +104,7 @@ PyObject* KX_VehicleWrapper::PyGetWheelRotation(PyObject* self, { return PyFloat_FromDouble(m_vehicle->GetWheelRotation(wheelIndex)); } - Py_INCREF(Py_None); - return Py_None; + return NULL; } PyObject* KX_VehicleWrapper::PyGetWheelOrientationQuaternion(PyObject* self, @@ -120,8 +120,7 @@ PyObject* KX_VehicleWrapper::PyGetWheelOrientationQuaternion(PyObject* self, MT_Matrix3x3 ornmat(quatorn); return PyObjectFrom(ornmat); } - Py_INCREF(Py_None); - return Py_None; + return NULL; } @@ -155,6 +154,9 @@ PyObject* KX_VehicleWrapper::PyApplyEngineForce(PyObject* self, force *= -1.f;//someone reverse some conventions inside Bullet (axle winding) m_vehicle->ApplyEngineForce(force,wheelIndex); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -170,6 +172,9 @@ PyObject* KX_VehicleWrapper::PySetTyreFriction(PyObject* self, { m_vehicle->SetWheelFriction(wheelFriction,wheelIndex); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -185,6 +190,9 @@ PyObject* KX_VehicleWrapper::PySetSuspensionStiffness(PyObject* self, { m_vehicle->SetSuspensionStiffness(suspensionStiffness,wheelIndex); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -199,6 +207,8 @@ PyObject* KX_VehicleWrapper::PySetSuspensionDamping(PyObject* self, if (PyArg_ParseTuple(args,"fi",&suspensionDamping,&wheelIndex)) { m_vehicle->SetSuspensionDamping(suspensionDamping,wheelIndex); + } else { + return NULL; } Py_INCREF(Py_None); return Py_None; @@ -214,6 +224,8 @@ PyObject* KX_VehicleWrapper::PySetSuspensionCompression(PyObject* self, if (PyArg_ParseTuple(args,"fi",&suspensionCompression,&wheelIndex)) { m_vehicle->SetSuspensionCompression(suspensionCompression,wheelIndex); + } else { + return NULL; } Py_INCREF(Py_None); return Py_None; @@ -230,6 +242,9 @@ PyObject* KX_VehicleWrapper::PySetRollInfluence(PyObject* self, { m_vehicle->SetRollInfluence(rollInfluence,wheelIndex); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -246,6 +261,9 @@ PyObject* KX_VehicleWrapper::PyApplyBraking(PyObject* self, { m_vehicle->ApplyBraking(braking,wheelIndex); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -264,6 +282,9 @@ PyObject* KX_VehicleWrapper::PySetSteeringValue(PyObject* self, { m_vehicle->SetSteeringValue(steeringValue,wheelIndex); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } |