diff options
Diffstat (limited to 'source/gameengine/GameLogic/SCA_ActuatorSensor.cpp')
-rw-r--r-- | source/gameengine/GameLogic/SCA_ActuatorSensor.cpp | 82 |
1 files changed, 9 insertions, 73 deletions
diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp index 4dad65c5a25..428362a0a24 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp @@ -40,9 +40,8 @@ SCA_ActuatorSensor::SCA_ActuatorSensor(SCA_EventManager* eventmgr, SCA_IObject* gameobj, - const STR_String& actname, - PyTypeObject* T ) - : SCA_ISensor(gameobj,eventmgr,T), + const STR_String& actname) + : SCA_ISensor(gameobj,eventmgr), m_checkactname(actname) { m_actuator = GetParent()->FindActuator(m_checkactname); @@ -122,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, @@ -138,26 +131,18 @@ PyTypeObject SCA_ActuatorSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_ActuatorSensor::Parents[] = { - &SCA_ActuatorSensor::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; 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}, - //<----- Deprecated {NULL,NULL} //Sentinel }; @@ -166,18 +151,6 @@ PyAttributeDef SCA_ActuatorSensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_ActuatorSensor::py_getattro(PyObject *attr) { - py_getattro_up(SCA_ISensor); -} - -PyObject* SCA_ActuatorSensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int SCA_ActuatorSensor::py_setattro(PyObject *attr, PyObject *value) { - py_setattro_up(SCA_ISensor); -} - int SCA_ActuatorSensor::CheckActuator(void *self, const PyAttributeDef*) { SCA_ActuatorSensor* sensor = reinterpret_cast<SCA_ActuatorSensor*>(self); @@ -190,41 +163,4 @@ int SCA_ActuatorSensor::CheckActuator(void *self, const PyAttributeDef*) return 1; } -/* 3. getActuator */ -const char SCA_ActuatorSensor::GetActuator_doc[] = -"getActuator()\n" -"\tReturn the Actuator with which the sensor operates.\n"; -PyObject* SCA_ActuatorSensor::PyGetActuator() -{ - ShowDeprecationWarning("getActuator()", "the actuator property"); - return PyString_FromString(m_checkactname); -} - -/* 4. setActuator */ -const char SCA_ActuatorSensor::SetActuator_doc[] = -"setActuator(name)\n" -"\t- name: string\n" -"\tSets the Actuator with which to operate. If there is no Actuator\n" -"\tof this name, the call is ignored.\n"; -PyObject* SCA_ActuatorSensor::PySetActuator(PyObject* args) -{ - ShowDeprecationWarning("setActuator()", "the actuator property"); - /* We should query whether the name exists. Or should we create a prop */ - /* on the fly? */ - char *actNameArg = NULL; - - if (!PyArg_ParseTuple(args, "s:setActuator", &actNameArg)) { - return NULL; - } - - SCA_IActuator* act = GetParent()->FindActuator(STR_String(actNameArg)); - if (act) { - m_checkactname = actNameArg; - m_actuator = act; - } else { - ; /* error: bad actuator name */ - } - Py_RETURN_NONE; -} - /* eof */ |