diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-04-19 18:57:52 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-04-19 18:57:52 +0400 |
commit | 7dbc9dc719c3eb0823e4f9e7ae94a479f9427ea7 (patch) | |
tree | abaae0ea91ef351379f72f00c31f5a67ae0865af /source/gameengine/GameLogic | |
parent | 8d2cb5bea44f4245dd17f2d82cbd0251d8090fd5 (diff) |
BGE Python API cleanup - no functionality changes
- comments to PyObjectPlus.h
- remove unused/commented junk.
- renamed PyDestructor to py_base_dealloc for consistency
- all the PyTypeObject's were still using the sizeof() their class, can use sizeof(PyObjectPlus_Proxy) now which is smaller too.
Diffstat (limited to 'source/gameengine/GameLogic')
21 files changed, 44 insertions, 48 deletions
diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp index 171d3fbc265..251a586308e 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp @@ -113,9 +113,9 @@ PyTypeObject SCA_2DFilterActuator::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_2DFilterActuator", - sizeof(SCA_2DFilterActuator), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, diff --git a/source/gameengine/GameLogic/SCA_ANDController.cpp b/source/gameengine/GameLogic/SCA_ANDController.cpp index cb62e2b5a1d..1cb03f375cb 100644 --- a/source/gameengine/GameLogic/SCA_ANDController.cpp +++ b/source/gameengine/GameLogic/SCA_ANDController.cpp @@ -110,9 +110,9 @@ PyTypeObject SCA_ANDController::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_ANDController", - sizeof(SCA_ANDController), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp index 99f3788ad2e..c51555a02b4 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp @@ -125,9 +125,9 @@ PyTypeObject SCA_ActuatorSensor::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_ActuatorSensor", - sizeof(SCA_ActuatorSensor), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp index a7b0e5a14d2..b7ecb0233a1 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp @@ -108,9 +108,9 @@ PyTypeObject SCA_AlwaysSensor::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_AlwaysSensor", - sizeof(SCA_AlwaysSensor), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.cpp b/source/gameengine/GameLogic/SCA_DelaySensor.cpp index 3f08f301dc1..dad85a435c8 100644 --- a/source/gameengine/GameLogic/SCA_DelaySensor.cpp +++ b/source/gameengine/GameLogic/SCA_DelaySensor.cpp @@ -134,9 +134,9 @@ PyTypeObject SCA_DelaySensor::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_DelaySensor", - sizeof(SCA_DelaySensor), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index 7fa55cfb1ee..1ae78321959 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -220,9 +220,9 @@ PyTypeObject SCA_ILogicBrick::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_ILogicBrick", - sizeof(SCA_ILogicBrick), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp index d1ce377316b..75804525e7a 100644 --- a/source/gameengine/GameLogic/SCA_IObject.cpp +++ b/source/gameengine/GameLogic/SCA_IObject.cpp @@ -378,9 +378,9 @@ PyTypeObject SCA_IObject::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_IObject", - sizeof(SCA_IObject), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index 3c21cf66e09..269038db4f9 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -396,9 +396,9 @@ PyTypeObject SCA_ISensor::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_ISensor", - sizeof(SCA_ISensor), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index 9cf850ceb3e..087fb036fae 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -269,9 +269,9 @@ PyTypeObject SCA_JoystickSensor::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_JoystickSensor", - sizeof(SCA_JoystickSensor), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index 0bf19360b15..3e19c880c4d 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -615,9 +615,9 @@ PyTypeObject SCA_KeyboardSensor::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_KeyboardSensor", - sizeof(SCA_KeyboardSensor), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index 86e64491f6a..0c30f503068 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -303,9 +303,9 @@ PyTypeObject SCA_MouseSensor::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_MouseSensor", - sizeof(SCA_MouseSensor), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, diff --git a/source/gameengine/GameLogic/SCA_NANDController.cpp b/source/gameengine/GameLogic/SCA_NANDController.cpp index bddd5f4d3ab..703c9c1bbaf 100644 --- a/source/gameengine/GameLogic/SCA_NANDController.cpp +++ b/source/gameengine/GameLogic/SCA_NANDController.cpp @@ -110,9 +110,9 @@ PyTypeObject SCA_NANDController::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_NANDController", - sizeof(SCA_NANDController), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, diff --git a/source/gameengine/GameLogic/SCA_NORController.cpp b/source/gameengine/GameLogic/SCA_NORController.cpp index 3ee073523c3..06acae5a81a 100644 --- a/source/gameengine/GameLogic/SCA_NORController.cpp +++ b/source/gameengine/GameLogic/SCA_NORController.cpp @@ -110,9 +110,9 @@ PyTypeObject SCA_NORController::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_NORController", - sizeof(SCA_NORController), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, diff --git a/source/gameengine/GameLogic/SCA_ORController.cpp b/source/gameengine/GameLogic/SCA_ORController.cpp index 91d5e56d4f3..319ff04f776 100644 --- a/source/gameengine/GameLogic/SCA_ORController.cpp +++ b/source/gameengine/GameLogic/SCA_ORController.cpp @@ -102,9 +102,9 @@ PyTypeObject SCA_ORController::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_ORController", - sizeof(SCA_ORController), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp index 9dbdc0e89d1..4bcb59d0812 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp @@ -236,9 +236,9 @@ PyTypeObject SCA_PropertyActuator::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_PropertyActuator", - sizeof(SCA_PropertyActuator), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index 9ae7be16b12..5c8a14db563 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -309,9 +309,9 @@ PyTypeObject SCA_PropertySensor::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_PropertySensor", - sizeof(SCA_PropertySensor), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 687ae421af1..0d096385fa9 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -227,9 +227,9 @@ PyTypeObject SCA_PythonController::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_PythonController", - sizeof(SCA_PythonController), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, @@ -441,9 +441,7 @@ SCA_PythonController::PyGetSensor(PyObject* self, PyObject* value) } } - char emsg[96]; - PyOS_snprintf( emsg, sizeof( emsg ), "Unable to find requested sensor \"%s\"", scriptArg ); - PyErr_SetString(PyExc_AttributeError, emsg); + PyErr_Format(PyExc_AttributeError, "Unable to find requested sensor \"%s\"", scriptArg); return NULL; } @@ -470,9 +468,7 @@ SCA_PythonController::PyGetActuator(PyObject* self, PyObject* value) } } - char emsg[96]; - PyOS_snprintf( emsg, sizeof( emsg ), "Unable to find requested actuator \"%s\"", scriptArg ); - PyErr_SetString(PyExc_AttributeError, emsg); + PyErr_Format(PyExc_AttributeError, "Unable to find requested actuator \"%s\"", scriptArg); return NULL; } diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp index d5d993c4ba6..7a3fdc862f6 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp @@ -315,9 +315,9 @@ PyTypeObject SCA_RandomActuator::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_RandomActuator", - sizeof(SCA_RandomActuator), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index 3179c8522f9..b0bc518825b 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -130,9 +130,9 @@ PyTypeObject SCA_RandomSensor::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_RandomSensor", - sizeof(SCA_RandomSensor), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, diff --git a/source/gameengine/GameLogic/SCA_XNORController.cpp b/source/gameengine/GameLogic/SCA_XNORController.cpp index 10757e1c935..e9bb37ee958 100644 --- a/source/gameengine/GameLogic/SCA_XNORController.cpp +++ b/source/gameengine/GameLogic/SCA_XNORController.cpp @@ -114,9 +114,9 @@ PyTypeObject SCA_XNORController::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_XNORController", - sizeof(SCA_XNORController), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, diff --git a/source/gameengine/GameLogic/SCA_XORController.cpp b/source/gameengine/GameLogic/SCA_XORController.cpp index d2290fe207a..791a139975f 100644 --- a/source/gameengine/GameLogic/SCA_XORController.cpp +++ b/source/gameengine/GameLogic/SCA_XORController.cpp @@ -114,9 +114,9 @@ PyTypeObject SCA_XORController::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_XORController", - sizeof(SCA_XORController), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, |