BGE Python API

removed redundant (PyObject *self) argument from python functions that are not exposed to python directly.
This commit is contained in:
2009-04-19 17:29:07 +00:00
parent fe08da3b4c
commit 6bc162e679
70 changed files with 545 additions and 748 deletions

View File

@@ -423,8 +423,7 @@ const char BL_ActionActuator::GetAction_doc[] =
"getAction()\n" "getAction()\n"
"\tReturns a string containing the name of the current action.\n"; "\tReturns a string containing the name of the current action.\n";
PyObject* BL_ActionActuator::PyGetAction(PyObject* self, PyObject* BL_ActionActuator::PyGetAction(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
ShowDeprecationWarning("getAction()", "the action property"); ShowDeprecationWarning("getAction()", "the action property");
@@ -439,8 +438,7 @@ const char BL_ActionActuator::GetProperty_doc[] =
"getProperty()\n" "getProperty()\n"
"\tReturns the name of the property to be used in FromProp mode.\n"; "\tReturns the name of the property to be used in FromProp mode.\n";
PyObject* BL_ActionActuator::PyGetProperty(PyObject* self, PyObject* BL_ActionActuator::PyGetProperty(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
ShowDeprecationWarning("getProperty()", "the property property"); ShowDeprecationWarning("getProperty()", "the property property");
@@ -456,8 +454,7 @@ const char BL_ActionActuator::GetFrameProperty_doc[] =
"getFrameProperty()\n" "getFrameProperty()\n"
"\tReturns the name of the property, that is set to the current frame number.\n"; "\tReturns the name of the property, that is set to the current frame number.\n";
PyObject* BL_ActionActuator::PyGetFrameProperty(PyObject* self, PyObject* BL_ActionActuator::PyGetFrameProperty(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
ShowDeprecationWarning("getFrameProperty()", "the frameProperty property"); ShowDeprecationWarning("getFrameProperty()", "the frameProperty property");
@@ -473,8 +470,7 @@ const char BL_ActionActuator::GetFrame_doc[] =
"getFrame()\n" "getFrame()\n"
"\tReturns the current frame number.\n"; "\tReturns the current frame number.\n";
PyObject* BL_ActionActuator::PyGetFrame(PyObject* self, PyObject* BL_ActionActuator::PyGetFrame(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
ShowDeprecationWarning("getFrame()", "the frame property"); ShowDeprecationWarning("getFrame()", "the frame property");
@@ -490,8 +486,7 @@ const char BL_ActionActuator::GetEnd_doc[] =
"getEnd()\n" "getEnd()\n"
"\tReturns the last frame of the action.\n"; "\tReturns the last frame of the action.\n";
PyObject* BL_ActionActuator::PyGetEnd(PyObject* self, PyObject* BL_ActionActuator::PyGetEnd(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
ShowDeprecationWarning("getEnd()", "the end property"); ShowDeprecationWarning("getEnd()", "the end property");
@@ -507,8 +502,7 @@ const char BL_ActionActuator::GetStart_doc[] =
"getStart()\n" "getStart()\n"
"\tReturns the starting frame of the action.\n"; "\tReturns the starting frame of the action.\n";
PyObject* BL_ActionActuator::PyGetStart(PyObject* self, PyObject* BL_ActionActuator::PyGetStart(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
ShowDeprecationWarning("getStart()", "the start property"); ShowDeprecationWarning("getStart()", "the start property");
@@ -525,8 +519,7 @@ const char BL_ActionActuator::GetBlendin_doc[] =
"\tReturns the number of interpolation animation frames to be\n" "\tReturns the number of interpolation animation frames to be\n"
"\tgenerated when this actuator is triggered.\n"; "\tgenerated when this actuator is triggered.\n";
PyObject* BL_ActionActuator::PyGetBlendin(PyObject* self, PyObject* BL_ActionActuator::PyGetBlendin(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
ShowDeprecationWarning("getBlendin()", "the blendin property"); ShowDeprecationWarning("getBlendin()", "the blendin property");
@@ -543,8 +536,7 @@ const char BL_ActionActuator::GetPriority_doc[] =
"\tReturns the priority for this actuator. Actuators with lower\n" "\tReturns the priority for this actuator. Actuators with lower\n"
"\tPriority numbers will override actuators with higher numbers.\n"; "\tPriority numbers will override actuators with higher numbers.\n";
PyObject* BL_ActionActuator::PyGetPriority(PyObject* self, PyObject* BL_ActionActuator::PyGetPriority(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
ShowDeprecationWarning("getPriority()", "the priority property"); ShowDeprecationWarning("getPriority()", "the priority property");
@@ -565,8 +557,7 @@ const char BL_ActionActuator::SetAction_doc[] =
"\t unchanged. If reset is not specified, the timer will" "\t unchanged. If reset is not specified, the timer will"
"\t be reset.\n"; "\t be reset.\n";
PyObject* BL_ActionActuator::PySetAction(PyObject* self, PyObject* BL_ActionActuator::PySetAction(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
ShowDeprecationWarning("setAction()", "the action property"); ShowDeprecationWarning("setAction()", "the action property");
@@ -601,8 +592,7 @@ const char BL_ActionActuator::SetStart_doc[] =
"setStart(start)\n" "setStart(start)\n"
"\t - start : Specifies the starting frame of the animation.\n"; "\t - start : Specifies the starting frame of the animation.\n";
PyObject* BL_ActionActuator::PySetStart(PyObject* self, PyObject* BL_ActionActuator::PySetStart(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
ShowDeprecationWarning("setStart()", "the start property"); ShowDeprecationWarning("setStart()", "the start property");
@@ -624,8 +614,7 @@ const char BL_ActionActuator::SetEnd_doc[] =
"setEnd(end)\n" "setEnd(end)\n"
"\t - end : Specifies the ending frame of the animation.\n"; "\t - end : Specifies the ending frame of the animation.\n";
PyObject* BL_ActionActuator::PySetEnd(PyObject* self, PyObject* BL_ActionActuator::PySetEnd(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
ShowDeprecationWarning("setEnd()", "the end property"); ShowDeprecationWarning("setEnd()", "the end property");
@@ -648,8 +637,7 @@ const char BL_ActionActuator::SetBlendin_doc[] =
"\t - blendin : Specifies the number of frames of animation to generate\n" "\t - blendin : Specifies the number of frames of animation to generate\n"
"\t when making transitions between actions.\n"; "\t when making transitions between actions.\n";
PyObject* BL_ActionActuator::PySetBlendin(PyObject* self, PyObject* BL_ActionActuator::PySetBlendin(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
ShowDeprecationWarning("setBlendin()", "the blendin property"); ShowDeprecationWarning("setBlendin()", "the blendin property");
@@ -673,8 +661,7 @@ const char BL_ActionActuator::SetBlendtime_doc[] =
"\t used when generating transitions between actions. This\n" "\t used when generating transitions between actions. This\n"
"\t parameter must be in the range from 0.0 to 1.0.\n"; "\t parameter must be in the range from 0.0 to 1.0.\n";
PyObject* BL_ActionActuator::PySetBlendtime(PyObject* self, PyObject* BL_ActionActuator::PySetBlendtime(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
ShowDeprecationWarning("setBlendtime()", "the blendtime property"); ShowDeprecationWarning("setBlendtime()", "the blendtime property");
@@ -702,8 +689,7 @@ const char BL_ActionActuator::SetPriority_doc[] =
"\t priority numbers will override actuators with higher\n" "\t priority numbers will override actuators with higher\n"
"\t numbers.\n"; "\t numbers.\n";
PyObject* BL_ActionActuator::PySetPriority(PyObject* self, PyObject* BL_ActionActuator::PySetPriority(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
ShowDeprecationWarning("setPriority()", "the priority property"); ShowDeprecationWarning("setPriority()", "the priority property");
@@ -725,8 +711,7 @@ const char BL_ActionActuator::SetFrame_doc[] =
"setFrame(frame)\n" "setFrame(frame)\n"
"\t - frame : Specifies the new current frame for the animation\n"; "\t - frame : Specifies the new current frame for the animation\n";
PyObject* BL_ActionActuator::PySetFrame(PyObject* self, PyObject* BL_ActionActuator::PySetFrame(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
ShowDeprecationWarning("setFrame()", "the frame property"); ShowDeprecationWarning("setFrame()", "the frame property");
@@ -753,8 +738,7 @@ const char BL_ActionActuator::SetProperty_doc[] =
"\t - prop : A string specifying the property name to be used in\n" "\t - prop : A string specifying the property name to be used in\n"
"\t FromProp playback mode.\n"; "\t FromProp playback mode.\n";
PyObject* BL_ActionActuator::PySetProperty(PyObject* self, PyObject* BL_ActionActuator::PySetProperty(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
ShowDeprecationWarning("setProperty()", "the property property"); ShowDeprecationWarning("setProperty()", "the property property");
@@ -776,8 +760,7 @@ const char BL_ActionActuator::SetFrameProperty_doc[] =
"setFrameProperty(prop)\n" "setFrameProperty(prop)\n"
"\t - prop : A string specifying the property of the frame set up update.\n"; "\t - prop : A string specifying the property of the frame set up update.\n";
PyObject* BL_ActionActuator::PySetFrameProperty(PyObject* self, PyObject* BL_ActionActuator::PySetFrameProperty(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
ShowDeprecationWarning("setFrameProperty()", "the frameProperty property"); ShowDeprecationWarning("setFrameProperty()", "the frameProperty property");
@@ -795,8 +778,7 @@ PyObject* BL_ActionActuator::PySetFrameProperty(PyObject* self,
} }
/* /*
PyObject* BL_ActionActuator::PyGetChannel(PyObject* self, PyObject* BL_ActionActuator::PyGetChannel(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
char *string; char *string;
@@ -816,8 +798,7 @@ PyObject* BL_ActionActuator::PyGetChannel(PyObject* self,
const char BL_ActionActuator::GetType_doc[] = const char BL_ActionActuator::GetType_doc[] =
"getType()\n" "getType()\n"
"\tReturns the operation mode of the actuator.\n"; "\tReturns the operation mode of the actuator.\n";
PyObject* BL_ActionActuator::PyGetType(PyObject* self, PyObject* BL_ActionActuator::PyGetType(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
ShowDeprecationWarning("getType()", "the type property"); ShowDeprecationWarning("getType()", "the type property");
@@ -829,8 +810,7 @@ const char BL_ActionActuator::SetType_doc[] =
"setType(mode)\n" "setType(mode)\n"
"\t - mode: Play (0), Flipper (2), LoopStop (3), LoopEnd (4) or Property (6)\n" "\t - mode: Play (0), Flipper (2), LoopStop (3), LoopEnd (4) or Property (6)\n"
"\tSet the operation mode of the actuator.\n"; "\tSet the operation mode of the actuator.\n";
PyObject* BL_ActionActuator::PySetType(PyObject* self, PyObject* BL_ActionActuator::PySetType(PyObject* args,
PyObject* args,
PyObject* kwds) { PyObject* kwds) {
ShowDeprecationWarning("setType()", "the type property"); ShowDeprecationWarning("setType()", "the type property");
@@ -854,13 +834,13 @@ PyObject* BL_ActionActuator::PySetType(PyObject* self,
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* BL_ActionActuator::PyGetContinue(PyObject* self) { PyObject* BL_ActionActuator::PyGetContinue() {
ShowDeprecationWarning("getContinue()", "the continue property"); ShowDeprecationWarning("getContinue()", "the continue property");
return PyInt_FromLong((long)(m_end_reset==0)); return PyInt_FromLong((long)(m_end_reset==0));
} }
PyObject* BL_ActionActuator::PySetContinue(PyObject* self, PyObject* value) { PyObject* BL_ActionActuator::PySetContinue(PyObject* value) {
ShowDeprecationWarning("setContinue()", "the continue property"); ShowDeprecationWarning("setContinue()", "the continue property");
int param = PyObject_IsTrue( value ); int param = PyObject_IsTrue( value );

View File

@@ -498,7 +498,7 @@ const char BL_ShapeActionActuator::GetAction_doc[] =
"getAction()\n" "getAction()\n"
"\tReturns a string containing the name of the current action.\n"; "\tReturns a string containing the name of the current action.\n";
PyObject* BL_ShapeActionActuator::PyGetAction(PyObject* self) { PyObject* BL_ShapeActionActuator::PyGetAction() {
ShowDeprecationWarning("getAction()", "the action property"); ShowDeprecationWarning("getAction()", "the action property");
if (m_action){ if (m_action){
return PyString_FromString(m_action->id.name+2); return PyString_FromString(m_action->id.name+2);
@@ -511,7 +511,7 @@ const char BL_ShapeActionActuator::GetProperty_doc[] =
"getProperty()\n" "getProperty()\n"
"\tReturns the name of the property to be used in FromProp mode.\n"; "\tReturns the name of the property to be used in FromProp mode.\n";
PyObject* BL_ShapeActionActuator::PyGetProperty(PyObject* self) { PyObject* BL_ShapeActionActuator::PyGetProperty() {
ShowDeprecationWarning("getProperty()", "the property property"); ShowDeprecationWarning("getProperty()", "the property property");
PyObject *result; PyObject *result;
@@ -525,7 +525,7 @@ const char BL_ShapeActionActuator::GetFrame_doc[] =
"getFrame()\n" "getFrame()\n"
"\tReturns the current frame number.\n"; "\tReturns the current frame number.\n";
PyObject* BL_ShapeActionActuator::PyGetFrame(PyObject* self) { PyObject* BL_ShapeActionActuator::PyGetFrame() {
ShowDeprecationWarning("getFrame()", "the frame property"); ShowDeprecationWarning("getFrame()", "the frame property");
PyObject *result; PyObject *result;
@@ -539,7 +539,7 @@ const char BL_ShapeActionActuator::GetEnd_doc[] =
"getEnd()\n" "getEnd()\n"
"\tReturns the last frame of the action.\n"; "\tReturns the last frame of the action.\n";
PyObject* BL_ShapeActionActuator::PyGetEnd(PyObject* self) { PyObject* BL_ShapeActionActuator::PyGetEnd() {
ShowDeprecationWarning("getEnd()", "the end property"); ShowDeprecationWarning("getEnd()", "the end property");
PyObject *result; PyObject *result;
@@ -553,7 +553,7 @@ const char BL_ShapeActionActuator::GetStart_doc[] =
"getStart()\n" "getStart()\n"
"\tReturns the starting frame of the action.\n"; "\tReturns the starting frame of the action.\n";
PyObject* BL_ShapeActionActuator::PyGetStart(PyObject* self) { PyObject* BL_ShapeActionActuator::PyGetStart() {
ShowDeprecationWarning("getStart()", "the start property"); ShowDeprecationWarning("getStart()", "the start property");
PyObject *result; PyObject *result;
@@ -568,7 +568,7 @@ const char BL_ShapeActionActuator::GetBlendin_doc[] =
"\tReturns the number of interpolation animation frames to be\n" "\tReturns the number of interpolation animation frames to be\n"
"\tgenerated when this actuator is triggered.\n"; "\tgenerated when this actuator is triggered.\n";
PyObject* BL_ShapeActionActuator::PyGetBlendin(PyObject* self) { PyObject* BL_ShapeActionActuator::PyGetBlendin() {
ShowDeprecationWarning("getBlendin()", "the blendin property"); ShowDeprecationWarning("getBlendin()", "the blendin property");
PyObject *result; PyObject *result;
@@ -583,7 +583,7 @@ const char BL_ShapeActionActuator::GetPriority_doc[] =
"\tReturns the priority for this actuator. Actuators with lower\n" "\tReturns the priority for this actuator. Actuators with lower\n"
"\tPriority numbers will override actuators with higher numbers.\n"; "\tPriority numbers will override actuators with higher numbers.\n";
PyObject* BL_ShapeActionActuator::PyGetPriority(PyObject* self) { PyObject* BL_ShapeActionActuator::PyGetPriority() {
ShowDeprecationWarning("getPriority()", "the priority property"); ShowDeprecationWarning("getPriority()", "the priority property");
PyObject *result; PyObject *result;
@@ -603,9 +603,7 @@ const char BL_ShapeActionActuator::SetAction_doc[] =
"\t unchanged. If reset is not specified, the timer will" "\t unchanged. If reset is not specified, the timer will"
"\t be reset.\n"; "\t be reset.\n";
PyObject* BL_ShapeActionActuator::PySetAction(PyObject* self, PyObject* BL_ShapeActionActuator::PySetAction(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setAction()", "the action property"); ShowDeprecationWarning("setAction()", "the action property");
char *string; char *string;
int reset = 1; int reset = 1;
@@ -638,9 +636,7 @@ const char BL_ShapeActionActuator::SetStart_doc[] =
"setStart(start)\n" "setStart(start)\n"
"\t - start : Specifies the starting frame of the animation.\n"; "\t - start : Specifies the starting frame of the animation.\n";
PyObject* BL_ShapeActionActuator::PySetStart(PyObject* self, PyObject* BL_ShapeActionActuator::PySetStart(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setStart()", "the start property"); ShowDeprecationWarning("setStart()", "the start property");
float start; float start;
@@ -660,9 +656,7 @@ const char BL_ShapeActionActuator::SetEnd_doc[] =
"setEnd(end)\n" "setEnd(end)\n"
"\t - end : Specifies the ending frame of the animation.\n"; "\t - end : Specifies the ending frame of the animation.\n";
PyObject* BL_ShapeActionActuator::PySetEnd(PyObject* self, PyObject* BL_ShapeActionActuator::PySetEnd(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setEnd()", "the end property"); ShowDeprecationWarning("setEnd()", "the end property");
float end; float end;
@@ -683,9 +677,7 @@ const char BL_ShapeActionActuator::SetBlendin_doc[] =
"\t - blendin : Specifies the number of frames of animation to generate\n" "\t - blendin : Specifies the number of frames of animation to generate\n"
"\t when making transitions between actions.\n"; "\t when making transitions between actions.\n";
PyObject* BL_ShapeActionActuator::PySetBlendin(PyObject* self, PyObject* BL_ShapeActionActuator::PySetBlendin(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setBlendin()", "the blendin property"); ShowDeprecationWarning("setBlendin()", "the blendin property");
float blendin; float blendin;
@@ -707,9 +699,7 @@ const char BL_ShapeActionActuator::SetBlendtime_doc[] =
"\t used when generating transitions between actions. This\n" "\t used when generating transitions between actions. This\n"
"\t parameter must be in the range from 0.0 to 1.0.\n"; "\t parameter must be in the range from 0.0 to 1.0.\n";
PyObject* BL_ShapeActionActuator::PySetBlendtime(PyObject* self, PyObject* BL_ShapeActionActuator::PySetBlendtime(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setBlendtime()", "the blendTime property"); ShowDeprecationWarning("setBlendtime()", "the blendTime property");
float blendframe; float blendframe;
@@ -735,9 +725,7 @@ const char BL_ShapeActionActuator::SetPriority_doc[] =
"\t priority numbers will override actuators with higher\n" "\t priority numbers will override actuators with higher\n"
"\t numbers.\n"; "\t numbers.\n";
PyObject* BL_ShapeActionActuator::PySetPriority(PyObject* self, PyObject* BL_ShapeActionActuator::PySetPriority(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setPriority()", "the priority property"); ShowDeprecationWarning("setPriority()", "the priority property");
int priority; int priority;
@@ -757,7 +745,7 @@ const char BL_ShapeActionActuator::GetFrameProperty_doc[] =
"getFrameProperty()\n" "getFrameProperty()\n"
"\tReturns the name of the property, that is set to the current frame number.\n"; "\tReturns the name of the property, that is set to the current frame number.\n";
PyObject* BL_ShapeActionActuator::PyGetFrameProperty(PyObject* self) { PyObject* BL_ShapeActionActuator::PyGetFrameProperty() {
ShowDeprecationWarning("getFrameProperty()", "the frameProperty property"); ShowDeprecationWarning("getFrameProperty()", "the frameProperty property");
PyObject *result; PyObject *result;
@@ -772,9 +760,7 @@ const char BL_ShapeActionActuator::SetFrame_doc[] =
"setFrame(frame)\n" "setFrame(frame)\n"
"\t - frame : Specifies the new current frame for the animation\n"; "\t - frame : Specifies the new current frame for the animation\n";
PyObject* BL_ShapeActionActuator::PySetFrame(PyObject* self, PyObject* BL_ShapeActionActuator::PySetFrame(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setFrame()", "the frame property"); ShowDeprecationWarning("setFrame()", "the frame property");
float frame; float frame;
@@ -799,9 +785,7 @@ const char BL_ShapeActionActuator::SetProperty_doc[] =
"\t - prop : A string specifying the property name to be used in\n" "\t - prop : A string specifying the property name to be used in\n"
"\t FromProp playback mode.\n"; "\t FromProp playback mode.\n";
PyObject* BL_ShapeActionActuator::PySetProperty(PyObject* self, PyObject* BL_ShapeActionActuator::PySetProperty(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setProperty()", "the property property"); ShowDeprecationWarning("setProperty()", "the property property");
char *string; char *string;
@@ -821,9 +805,7 @@ const char BL_ShapeActionActuator::SetFrameProperty_doc[] =
"setFrameProperty(prop)\n" "setFrameProperty(prop)\n"
"\t - prop : A string specifying the property of the frame set up update.\n"; "\t - prop : A string specifying the property of the frame set up update.\n";
PyObject* BL_ShapeActionActuator::PySetFrameProperty(PyObject* self, PyObject* BL_ShapeActionActuator::PySetFrameProperty(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setFrameProperty()", "the frameProperty property"); ShowDeprecationWarning("setFrameProperty()", "the frameProperty property");
char *string; char *string;
@@ -842,7 +824,7 @@ PyObject* BL_ShapeActionActuator::PySetFrameProperty(PyObject* self,
const char BL_ShapeActionActuator::GetType_doc[] = const char BL_ShapeActionActuator::GetType_doc[] =
"getType()\n" "getType()\n"
"\tReturns the operation mode of the actuator.\n"; "\tReturns the operation mode of the actuator.\n";
PyObject* BL_ShapeActionActuator::PyGetType(PyObject* self) { PyObject* BL_ShapeActionActuator::PyGetType() {
ShowDeprecationWarning("getType()", "the type property"); ShowDeprecationWarning("getType()", "the type property");
return Py_BuildValue("h", m_playtype); return Py_BuildValue("h", m_playtype);
} }
@@ -852,9 +834,7 @@ const char BL_ShapeActionActuator::SetType_doc[] =
"setType(mode)\n" "setType(mode)\n"
"\t - mode: Play (0), Flipper (2), LoopStop (3), LoopEnd (4) or Property (6)\n" "\t - mode: Play (0), Flipper (2), LoopStop (3), LoopEnd (4) or Property (6)\n"
"\tSet the operation mode of the actuator.\n"; "\tSet the operation mode of the actuator.\n";
PyObject* BL_ShapeActionActuator::PySetType(PyObject* self, PyObject* BL_ShapeActionActuator::PySetType(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setType()", "the type property"); ShowDeprecationWarning("setType()", "the type property");
short typeArg; short typeArg;

View File

@@ -83,16 +83,16 @@ public:
bAction* GetAction() { return m_action; } bAction* GetAction() { return m_action; }
void SetAction(bAction* act) { m_action= act; } void SetAction(bAction* act) { m_action= act; }
KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetAction); KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetAction);
KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetBlendin); KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetBlendin);
KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetPriority); KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetPriority);
KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetStart); KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetStart);
KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetEnd); KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetEnd);
KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetFrame); KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetFrame);
KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetProperty); KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetProperty);
KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetFrameProperty); KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetFrameProperty);
KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetBlendtime); KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetBlendtime);
KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetChannel); KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetChannel);
KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetAction); KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetAction);
KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetBlendin); KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetBlendin);
@@ -104,7 +104,7 @@ public:
KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetFrameProperty); KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetFrameProperty);
// KX_PYMETHOD(BL_ActionActuator,GetChannel); // KX_PYMETHOD(BL_ActionActuator,GetChannel);
KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetType); KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetType);
KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetType); KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetType);
virtual PyObject* py_getattro(PyObject* attr); virtual PyObject* py_getattro(PyObject* attr);
virtual int py_setattro(PyObject* attr, PyObject* value); virtual int py_setattro(PyObject* attr, PyObject* value);

View File

@@ -438,14 +438,14 @@ void CListValue::MergeList(CListValue *otherlist)
PyObject* CListValue::Pyappend(PyObject* self, PyObject* value) PyObject* CListValue::Pyappend(PyObject* value)
{ {
return listvalue_buffer_concat(self, value); return listvalue_buffer_concat(m_proxy, value); /* m_proxy is the same as self */
} }
PyObject* CListValue::Pyreverse(PyObject* self) PyObject* CListValue::Pyreverse()
{ {
std::reverse(m_pValueArray.begin(),m_pValueArray.end()); std::reverse(m_pValueArray.begin(),m_pValueArray.end());
Py_RETURN_NONE; Py_RETURN_NONE;
@@ -474,7 +474,7 @@ bool CListValue::CheckEqual(CValue* first,CValue* second)
PyObject* CListValue::Pyindex(PyObject* self, PyObject *value) PyObject* CListValue::Pyindex(PyObject *value)
{ {
PyObject* result = NULL; PyObject* result = NULL;
@@ -503,7 +503,7 @@ PyObject* CListValue::Pyindex(PyObject* self, PyObject *value)
PyObject* CListValue::Pycount(PyObject* self, PyObject* value) PyObject* CListValue::Pycount(PyObject* value)
{ {
int numfound = 0; int numfound = 0;
@@ -530,7 +530,7 @@ PyObject* CListValue::Pycount(PyObject* self, PyObject* value)
PyObject* CListValue::Pyfrom_id(PyObject* self, PyObject* value) PyObject* CListValue::Pyfrom_id(PyObject* value)
{ {
uintptr_t id= (uintptr_t)PyLong_AsVoidPtr(value); uintptr_t id= (uintptr_t)PyLong_AsVoidPtr(value);

View File

@@ -780,7 +780,7 @@ bool PyObjectPlus::isA(const char *mytypename) // check typename of each parent
return false; return false;
} }
PyObject *PyObjectPlus::PyisA(PyObject *self, PyObject *value) // Python wrapper for isA PyObject *PyObjectPlus::PyisA(PyObject *value) // Python wrapper for isA
{ {
if (PyType_Check(value)) { if (PyType_Check(value)) {
return PyBool_FromLong(isA((PyTypeObject *)value)); return PyBool_FromLong(isA((PyTypeObject *)value));

View File

@@ -180,62 +180,54 @@ typedef struct {
* macro is one that also requires a documentation string * macro is one that also requires a documentation string
*/ */
#define KX_PYMETHOD(class_name, method_name) \ #define KX_PYMETHOD(class_name, method_name) \
PyObject* Py##method_name(PyObject* self, PyObject* args, PyObject* kwds); \ PyObject* Py##method_name(PyObject* args, PyObject* kwds); \
static PyObject* sPy##method_name( PyObject* self, PyObject* args, PyObject* kwds) { \ static PyObject* sPy##method_name( PyObject* self, PyObject* args, PyObject* kwds) { \
PyObjectPlus *self_plus= BGE_PROXY_REF(self); \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args, kwds); \
return ((class_name*)self_plus)->Py##method_name(self, args, kwds); \
}; \ }; \
#define KX_PYMETHOD_VARARGS(class_name, method_name) \ #define KX_PYMETHOD_VARARGS(class_name, method_name) \
PyObject* Py##method_name(PyObject* self, PyObject* args); \ PyObject* Py##method_name(PyObject* args); \
static PyObject* sPy##method_name( PyObject* self, PyObject* args) { \ static PyObject* sPy##method_name( PyObject* self, PyObject* args) { \
PyObjectPlus *self_plus= BGE_PROXY_REF(self); \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args); \
return ((class_name*)self_plus)->Py##method_name(self, args); \
}; \ }; \
#define KX_PYMETHOD_NOARGS(class_name, method_name) \ #define KX_PYMETHOD_NOARGS(class_name, method_name) \
PyObject* Py##method_name(PyObject* self); \ PyObject* Py##method_name(); \
static PyObject* sPy##method_name( PyObject* self) { \ static PyObject* sPy##method_name( PyObject* self) { \
PyObjectPlus *self_plus= BGE_PROXY_REF(self); \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(); \
return ((class_name*)self_plus)->Py##method_name(self); \
}; \ }; \
#define KX_PYMETHOD_O(class_name, method_name) \ #define KX_PYMETHOD_O(class_name, method_name) \
PyObject* Py##method_name(PyObject* self, PyObject* value); \ PyObject* Py##method_name(PyObject* value); \
static PyObject* sPy##method_name( PyObject* self, PyObject* value) { \ static PyObject* sPy##method_name( PyObject* self, PyObject* value) { \
PyObjectPlus *self_plus= ((PyObjectPlus_Proxy *)self)->ref; \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(value); \
return ((class_name*) self_plus)->Py##method_name(self, value); \
}; \ }; \
#define KX_PYMETHOD_DOC(class_name, method_name) \ #define KX_PYMETHOD_DOC(class_name, method_name) \
PyObject* Py##method_name(PyObject* self, PyObject* args, PyObject* kwds); \ PyObject* Py##method_name(PyObject* args, PyObject* kwds); \
static PyObject* sPy##method_name( PyObject* self, PyObject* args, PyObject* kwds) { \ static PyObject* sPy##method_name( PyObject* self, PyObject* args, PyObject* kwds) { \
PyObjectPlus *self_plus= BGE_PROXY_REF(self); \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args, kwds); \
return ((class_name*)self_plus)->Py##method_name(self, args, kwds); \
}; \ }; \
static const char method_name##_doc[]; \ static const char method_name##_doc[]; \
#define KX_PYMETHOD_DOC_VARARGS(class_name, method_name) \ #define KX_PYMETHOD_DOC_VARARGS(class_name, method_name) \
PyObject* Py##method_name(PyObject* self, PyObject* args); \ PyObject* Py##method_name(PyObject* args); \
static PyObject* sPy##method_name( PyObject* self, PyObject* args) { \ static PyObject* sPy##method_name( PyObject* self, PyObject* args) { \
PyObjectPlus *self_plus= BGE_PROXY_REF(self); \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args); \
return ((class_name*)self_plus)->Py##method_name(self, args); \
}; \ }; \
static const char method_name##_doc[]; \ static const char method_name##_doc[]; \
#define KX_PYMETHOD_DOC_O(class_name, method_name) \ #define KX_PYMETHOD_DOC_O(class_name, method_name) \
PyObject* Py##method_name(PyObject* self, PyObject* value); \ PyObject* Py##method_name(PyObject* value); \
static PyObject* sPy##method_name( PyObject* self, PyObject* value) { \ static PyObject* sPy##method_name( PyObject* self, PyObject* value) { \
PyObjectPlus *self_plus= BGE_PROXY_REF(self); \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(value); \
return ((class_name*)self_plus)->Py##method_name(self, value); \
}; \ }; \
static const char method_name##_doc[]; \ static const char method_name##_doc[]; \
#define KX_PYMETHOD_DOC_NOARGS(class_name, method_name) \ #define KX_PYMETHOD_DOC_NOARGS(class_name, method_name) \
PyObject* Py##method_name(PyObject* self); \ PyObject* Py##method_name(); \
static PyObject* sPy##method_name( PyObject* self) { \ static PyObject* sPy##method_name( PyObject* self) { \
PyObjectPlus *self_plus= BGE_PROXY_REF(self); \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(); \
return ((class_name*)self_plus)->Py##method_name(self); \
}; \ }; \
static const char method_name##_doc[]; \ static const char method_name##_doc[]; \
@@ -258,19 +250,19 @@ typedef struct {
*/ */
#define KX_PYMETHODDEF_DOC(class_name, method_name, doc_string) \ #define KX_PYMETHODDEF_DOC(class_name, method_name, doc_string) \
const char class_name::method_name##_doc[] = doc_string; \ const char class_name::method_name##_doc[] = doc_string; \
PyObject* class_name::Py##method_name(PyObject* self, PyObject* args, PyObject*) PyObject* class_name::Py##method_name(PyObject* args, PyObject*)
#define KX_PYMETHODDEF_DOC_VARARGS(class_name, method_name, doc_string) \ #define KX_PYMETHODDEF_DOC_VARARGS(class_name, method_name, doc_string) \
const char class_name::method_name##_doc[] = doc_string; \ const char class_name::method_name##_doc[] = doc_string; \
PyObject* class_name::Py##method_name(PyObject* self, PyObject* args) PyObject* class_name::Py##method_name(PyObject* args)
#define KX_PYMETHODDEF_DOC_O(class_name, method_name, doc_string) \ #define KX_PYMETHODDEF_DOC_O(class_name, method_name, doc_string) \
const char class_name::method_name##_doc[] = doc_string; \ const char class_name::method_name##_doc[] = doc_string; \
PyObject* class_name::Py##method_name(PyObject* self, PyObject* value) PyObject* class_name::Py##method_name(PyObject* value)
#define KX_PYMETHODDEF_DOC_NOARGS(class_name, method_name, doc_string) \ #define KX_PYMETHODDEF_DOC_NOARGS(class_name, method_name, doc_string) \
const char class_name::method_name##_doc[] = doc_string; \ const char class_name::method_name##_doc[] = doc_string; \
PyObject* class_name::Py##method_name(PyObject* self) PyObject* class_name::Py##method_name()
/** /**
* Attribute management * Attribute management
@@ -453,8 +445,6 @@ public:
* which we cant use because we have our own subclass system */ * which we cant use because we have our own subclass system */
bool isA(PyTypeObject *T); bool isA(PyTypeObject *T);
bool isA(const char *mytypename); bool isA(const char *mytypename);
PyObject *PyisA(PyObject *value);
//static PyObject *sPy_isA(PyObject *self, PyObject *value);
KX_PYMETHOD_O(PyObjectPlus,isA); KX_PYMETHOD_O(PyObjectPlus,isA);

View File

@@ -67,7 +67,7 @@ PyMethodDef CValue::Methods[] = {
{NULL,NULL} //Sentinel {NULL,NULL} //Sentinel
}; };
PyObject* CValue::PyGetName(PyObject* self) PyObject* CValue::PyGetName()
{ {
return PyString_FromString(this->GetName()); return PyString_FromString(this->GetName());
} }
@@ -797,7 +797,7 @@ void CValue::ShowDeprecationWarning(const char* old_way,const char* new_way)
PyObject *getframe, *frame; PyObject *getframe, *frame;
PyObject *f_lineno, *f_code, *co_filename; PyObject *f_lineno, *f_code, *co_filename;
getframe = PySys_GetObject("_getframe"); // borrowed getframe = PySys_GetObject((char *)"_getframe"); // borrowed
if (getframe) { if (getframe) {
frame = PyObject_CallObject(getframe, NULL); frame = PyObject_CallObject(getframe, NULL);
if (frame) { if (frame) {

View File

@@ -185,7 +185,7 @@ int SCA_ActuatorSensor::CheckActuator(void *self, const PyAttributeDef*)
const char SCA_ActuatorSensor::GetActuator_doc[] = const char SCA_ActuatorSensor::GetActuator_doc[] =
"getActuator()\n" "getActuator()\n"
"\tReturn the Actuator with which the sensor operates.\n"; "\tReturn the Actuator with which the sensor operates.\n";
PyObject* SCA_ActuatorSensor::PyGetActuator(PyObject* self) PyObject* SCA_ActuatorSensor::PyGetActuator()
{ {
ShowDeprecationWarning("getActuator()", "the actuator property"); ShowDeprecationWarning("getActuator()", "the actuator property");
return PyString_FromString(m_checkactname); return PyString_FromString(m_checkactname);
@@ -197,7 +197,7 @@ const char SCA_ActuatorSensor::SetActuator_doc[] =
"\t- name: string\n" "\t- name: string\n"
"\tSets the Actuator with which to operate. If there is no Actuator\n" "\tSets the Actuator with which to operate. If there is no Actuator\n"
"\tof this name, the call is ignored.\n"; "\tof this name, the call is ignored.\n";
PyObject* SCA_ActuatorSensor::PySetActuator(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_ActuatorSensor::PySetActuator(PyObject* args)
{ {
ShowDeprecationWarning("setActuator()", "the actuator property"); ShowDeprecationWarning("setActuator()", "the actuator property");
/* We should query whether the name exists. Or should we create a prop */ /* We should query whether the name exists. Or should we create a prop */

View File

@@ -65,7 +65,7 @@ public:
virtual int py_setattro(PyObject *attr, PyObject *value); virtual int py_setattro(PyObject *attr, PyObject *value);
/* 3. setProperty */ /* 3. setProperty */
KX_PYMETHOD_DOC(SCA_ActuatorSensor,SetActuator); KX_PYMETHOD_DOC_VARARGS(SCA_ActuatorSensor,SetActuator);
/* 4. getProperty */ /* 4. getProperty */
KX_PYMETHOD_DOC_NOARGS(SCA_ActuatorSensor,GetActuator); KX_PYMETHOD_DOC_NOARGS(SCA_ActuatorSensor,GetActuator);

View File

@@ -192,7 +192,7 @@ const char SCA_DelaySensor::SetDelay_doc[] =
"\t- delay: length of the initial OFF period as number of frame\n" "\t- delay: length of the initial OFF period as number of frame\n"
"\t 0 for immediate trigger\n" "\t 0 for immediate trigger\n"
"\tSet the initial delay before the positive trigger\n"; "\tSet the initial delay before the positive trigger\n";
PyObject* SCA_DelaySensor::PySetDelay(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_DelaySensor::PySetDelay(PyObject* args)
{ {
ShowDeprecationWarning("setDelay()", "the delay property"); ShowDeprecationWarning("setDelay()", "the delay property");
int delay; int delay;
@@ -214,7 +214,7 @@ const char SCA_DelaySensor::SetDuration_doc[] =
"\t 0 for no ON period\n" "\t 0 for no ON period\n"
"\tSet the duration of the ON pulse after initial delay.\n" "\tSet the duration of the ON pulse after initial delay.\n"
"\tIf > 0, a negative trigger is fired at the end of the ON pulse.\n"; "\tIf > 0, a negative trigger is fired at the end of the ON pulse.\n";
PyObject* SCA_DelaySensor::PySetDuration(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_DelaySensor::PySetDuration(PyObject* args)
{ {
ShowDeprecationWarning("setDuration()", "the duration property"); ShowDeprecationWarning("setDuration()", "the duration property");
int duration; int duration;
@@ -235,7 +235,7 @@ const char SCA_DelaySensor::SetRepeat_doc[] =
"\t- repeat: 1 if the initial OFF-ON cycle should be repeated indefinately\n" "\t- repeat: 1 if the initial OFF-ON cycle should be repeated indefinately\n"
"\t 0 if the initial OFF-ON cycle should run only once\n" "\t 0 if the initial OFF-ON cycle should run only once\n"
"\tSet the sensor repeat mode\n"; "\tSet the sensor repeat mode\n";
PyObject* SCA_DelaySensor::PySetRepeat(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_DelaySensor::PySetRepeat(PyObject* args)
{ {
ShowDeprecationWarning("setRepeat()", "the repeat property"); ShowDeprecationWarning("setRepeat()", "the repeat property");
int repeat; int repeat;
@@ -250,7 +250,7 @@ PyObject* SCA_DelaySensor::PySetRepeat(PyObject* self, PyObject* args, PyObject*
const char SCA_DelaySensor::GetDelay_doc[] = const char SCA_DelaySensor::GetDelay_doc[] =
"getDelay()\n" "getDelay()\n"
"\tReturn the delay parameter value\n"; "\tReturn the delay parameter value\n";
PyObject* SCA_DelaySensor::PyGetDelay(PyObject* self) PyObject* SCA_DelaySensor::PyGetDelay()
{ {
ShowDeprecationWarning("getDelay()", "the delay property"); ShowDeprecationWarning("getDelay()", "the delay property");
return PyInt_FromLong(m_delay); return PyInt_FromLong(m_delay);
@@ -259,7 +259,7 @@ PyObject* SCA_DelaySensor::PyGetDelay(PyObject* self)
const char SCA_DelaySensor::GetDuration_doc[] = const char SCA_DelaySensor::GetDuration_doc[] =
"getDuration()\n" "getDuration()\n"
"\tReturn the duration parameter value\n"; "\tReturn the duration parameter value\n";
PyObject* SCA_DelaySensor::PyGetDuration(PyObject* self) PyObject* SCA_DelaySensor::PyGetDuration()
{ {
ShowDeprecationWarning("getDuration()", "the duration property"); ShowDeprecationWarning("getDuration()", "the duration property");
return PyInt_FromLong(m_duration); return PyInt_FromLong(m_duration);
@@ -268,7 +268,7 @@ PyObject* SCA_DelaySensor::PyGetDuration(PyObject* self)
const char SCA_DelaySensor::GetRepeat_doc[] = const char SCA_DelaySensor::GetRepeat_doc[] =
"getRepeat()\n" "getRepeat()\n"
"\tReturn the repeat parameter value\n"; "\tReturn the repeat parameter value\n";
PyObject* SCA_DelaySensor::PyGetRepeat(PyObject* self) PyObject* SCA_DelaySensor::PyGetRepeat()
{ {
ShowDeprecationWarning("getRepeat()", "the repeat property"); ShowDeprecationWarning("getRepeat()", "the repeat property");
return BoolToPyArg(m_repeat); return BoolToPyArg(m_repeat);

View File

@@ -64,9 +64,9 @@ public:
virtual int py_setattro(PyObject *attr, PyObject *value); virtual int py_setattro(PyObject *attr, PyObject *value);
/* setProperty */ /* setProperty */
KX_PYMETHOD_DOC(SCA_DelaySensor,SetDelay); KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetDelay);
KX_PYMETHOD_DOC(SCA_DelaySensor,SetDuration); KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetDuration);
KX_PYMETHOD_DOC(SCA_DelaySensor,SetRepeat); KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetRepeat);
/* getProperty */ /* getProperty */
KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetDelay); KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetDelay);
KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetDuration); KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetDuration);

View File

@@ -289,7 +289,7 @@ int SCA_ILogicBrick::py_setattro(PyObject *attr, PyObject *value)
} }
PyObject* SCA_ILogicBrick::PyGetOwner(PyObject* self) PyObject* SCA_ILogicBrick::PyGetOwner()
{ {
CValue* parent = GetParent(); CValue* parent = GetParent();
if (parent) if (parent)
@@ -303,9 +303,7 @@ PyObject* SCA_ILogicBrick::PyGetOwner(PyObject* self)
PyObject* SCA_ILogicBrick::PySetExecutePriority(PyObject* self, PyObject* SCA_ILogicBrick::PySetExecutePriority(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
ShowDeprecationWarning("setExecutePriority()", "the executePriority property"); ShowDeprecationWarning("setExecutePriority()", "the executePriority property");
@@ -322,7 +320,7 @@ PyObject* SCA_ILogicBrick::PySetExecutePriority(PyObject* self,
PyObject* SCA_ILogicBrick::PyGetExecutePriority(PyObject* self) PyObject* SCA_ILogicBrick::PyGetExecutePriority()
{ {
ShowDeprecationWarning("getExecutePriority()", "the executePriority property"); ShowDeprecationWarning("getExecutePriority()", "the executePriority property");
return PyInt_FromLong(m_Execute_Ueber_Priority); return PyInt_FromLong(m_Execute_Ueber_Priority);

View File

@@ -88,7 +88,7 @@ public:
// python methods // python methods
KX_PYMETHOD_NOARGS(SCA_ILogicBrick,GetOwner); KX_PYMETHOD_NOARGS(SCA_ILogicBrick,GetOwner);
KX_PYMETHOD(SCA_ILogicBrick,SetExecutePriority); KX_PYMETHOD_VARARGS(SCA_ILogicBrick,SetExecutePriority);
KX_PYMETHOD_NOARGS(SCA_ILogicBrick,GetExecutePriority); KX_PYMETHOD_NOARGS(SCA_ILogicBrick,GetExecutePriority);
// check that attribute is a property // check that attribute is a property

View File

@@ -218,7 +218,7 @@ void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr, CValue* event)
const char SCA_ISensor::IsPositive_doc[] = const char SCA_ISensor::IsPositive_doc[] =
"isPositive()\n" "isPositive()\n"
"\tReturns whether the sensor is in an active state.\n"; "\tReturns whether the sensor is in an active state.\n";
PyObject* SCA_ISensor::PyIsPositive(PyObject* self) PyObject* SCA_ISensor::PyIsPositive()
{ {
ShowDeprecationWarning("isPositive()", "the read-only positive property"); ShowDeprecationWarning("isPositive()", "the read-only positive property");
int retval = IsPositiveTrigger(); int retval = IsPositiveTrigger();
@@ -228,7 +228,7 @@ PyObject* SCA_ISensor::PyIsPositive(PyObject* self)
const char SCA_ISensor::IsTriggered_doc[] = const char SCA_ISensor::IsTriggered_doc[] =
"isTriggered()\n" "isTriggered()\n"
"\tReturns whether the sensor has triggered the current controller.\n"; "\tReturns whether the sensor has triggered the current controller.\n";
PyObject* SCA_ISensor::PyIsTriggered(PyObject* self) PyObject* SCA_ISensor::PyIsTriggered()
{ {
ShowDeprecationWarning("isTriggered()", "the read-only triggered property"); ShowDeprecationWarning("isTriggered()", "the read-only triggered property");
// check with the current controller // check with the current controller
@@ -244,7 +244,7 @@ PyObject* SCA_ISensor::PyIsTriggered(PyObject* self)
const char SCA_ISensor::GetUsePosPulseMode_doc[] = const char SCA_ISensor::GetUsePosPulseMode_doc[] =
"getUsePosPulseMode()\n" "getUsePosPulseMode()\n"
"\tReturns whether positive pulse mode is active.\n"; "\tReturns whether positive pulse mode is active.\n";
PyObject* SCA_ISensor::PyGetUsePosPulseMode(PyObject* self) PyObject* SCA_ISensor::PyGetUsePosPulseMode()
{ {
ShowDeprecationWarning("getUsePosPulseMode()", "the usePosPulseMode property"); ShowDeprecationWarning("getUsePosPulseMode()", "the usePosPulseMode property");
return BoolToPyArg(m_pos_pulsemode); return BoolToPyArg(m_pos_pulsemode);
@@ -258,7 +258,7 @@ const char SCA_ISensor::SetUsePosPulseMode_doc[] =
"\t - pulse? : Pulse when a positive event occurs?\n" "\t - pulse? : Pulse when a positive event occurs?\n"
"\t (KX_TRUE, KX_FALSE)\n" "\t (KX_TRUE, KX_FALSE)\n"
"\tSet whether to do pulsing when positive pulses occur.\n"; "\tSet whether to do pulsing when positive pulses occur.\n";
PyObject* SCA_ISensor::PySetUsePosPulseMode(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_ISensor::PySetUsePosPulseMode(PyObject* args)
{ {
ShowDeprecationWarning("setUsePosPulseMode()", "the usePosPulseMode property"); ShowDeprecationWarning("setUsePosPulseMode()", "the usePosPulseMode property");
int pyarg = 0; int pyarg = 0;
@@ -273,7 +273,7 @@ PyObject* SCA_ISensor::PySetUsePosPulseMode(PyObject* self, PyObject* args, PyOb
const char SCA_ISensor::GetFrequency_doc[] = const char SCA_ISensor::GetFrequency_doc[] =
"getFrequency()\n" "getFrequency()\n"
"\tReturns the frequency of the updates in pulse mode.\n" ; "\tReturns the frequency of the updates in pulse mode.\n" ;
PyObject* SCA_ISensor::PyGetFrequency(PyObject* self) PyObject* SCA_ISensor::PyGetFrequency()
{ {
ShowDeprecationWarning("getFrequency()", "the frequency property"); ShowDeprecationWarning("getFrequency()", "the frequency property");
return PyInt_FromLong(m_pulse_frequency); return PyInt_FromLong(m_pulse_frequency);
@@ -287,7 +287,7 @@ const char SCA_ISensor::SetFrequency_doc[] =
"\t- pulse_frequency: The frequency of the updates in pulse mode (integer)" "\t- pulse_frequency: The frequency of the updates in pulse mode (integer)"
"\tSet the frequency of the updates in pulse mode.\n" "\tSet the frequency of the updates in pulse mode.\n"
"\tIf the frequency is negative, it is set to 0.\n" ; "\tIf the frequency is negative, it is set to 0.\n" ;
PyObject* SCA_ISensor::PySetFrequency(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_ISensor::PySetFrequency(PyObject* args)
{ {
ShowDeprecationWarning("setFrequency()", "the frequency property"); ShowDeprecationWarning("setFrequency()", "the frequency property");
int pulse_frequencyArg = 0; int pulse_frequencyArg = 0;
@@ -310,7 +310,7 @@ PyObject* SCA_ISensor::PySetFrequency(PyObject* self, PyObject* args, PyObject*
const char SCA_ISensor::GetInvert_doc[] = const char SCA_ISensor::GetInvert_doc[] =
"getInvert()\n" "getInvert()\n"
"\tReturns whether or not pulses from this sensor are inverted.\n" ; "\tReturns whether or not pulses from this sensor are inverted.\n" ;
PyObject* SCA_ISensor::PyGetInvert(PyObject* self) PyObject* SCA_ISensor::PyGetInvert()
{ {
ShowDeprecationWarning("getInvert()", "the invert property"); ShowDeprecationWarning("getInvert()", "the invert property");
return BoolToPyArg(m_invert); return BoolToPyArg(m_invert);
@@ -320,7 +320,7 @@ const char SCA_ISensor::SetInvert_doc[] =
"setInvert(invert?)\n" "setInvert(invert?)\n"
"\t- invert?: Invert the event-values? (KX_TRUE, KX_FALSE)\n" "\t- invert?: Invert the event-values? (KX_TRUE, KX_FALSE)\n"
"\tSet whether to invert pulses.\n"; "\tSet whether to invert pulses.\n";
PyObject* SCA_ISensor::PySetInvert(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_ISensor::PySetInvert(PyObject* args)
{ {
ShowDeprecationWarning("setInvert()", "the invert property"); ShowDeprecationWarning("setInvert()", "the invert property");
int pyarg = 0; int pyarg = 0;
@@ -336,7 +336,7 @@ const char SCA_ISensor::GetLevel_doc[] =
"\tA level detector will immediately generate a pulse, negative or positive\n" "\tA level detector will immediately generate a pulse, negative or positive\n"
"\tdepending on the sensor condition, as soon as the state is activated.\n" "\tdepending on the sensor condition, as soon as the state is activated.\n"
"\tA edge detector will wait for a state change before generating a pulse.\n"; "\tA edge detector will wait for a state change before generating a pulse.\n";
PyObject* SCA_ISensor::PyGetLevel(PyObject* self) PyObject* SCA_ISensor::PyGetLevel()
{ {
ShowDeprecationWarning("getLevel()", "the level property"); ShowDeprecationWarning("getLevel()", "the level property");
return BoolToPyArg(m_level); return BoolToPyArg(m_level);
@@ -346,7 +346,7 @@ const char SCA_ISensor::SetLevel_doc[] =
"setLevel(level?)\n" "setLevel(level?)\n"
"\t- level?: Detect level instead of edge? (KX_TRUE, KX_FALSE)\n" "\t- level?: Detect level instead of edge? (KX_TRUE, KX_FALSE)\n"
"\tSet whether to detect level or edge transition when entering a state.\n"; "\tSet whether to detect level or edge transition when entering a state.\n";
PyObject* SCA_ISensor::PySetLevel(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_ISensor::PySetLevel(PyObject* args)
{ {
ShowDeprecationWarning("setLevel()", "the level property"); ShowDeprecationWarning("setLevel()", "the level property");
int pyarg = 0; int pyarg = 0;
@@ -358,7 +358,7 @@ PyObject* SCA_ISensor::PySetLevel(PyObject* self, PyObject* args, PyObject* kwds
const char SCA_ISensor::GetUseNegPulseMode_doc[] = const char SCA_ISensor::GetUseNegPulseMode_doc[] =
"getUseNegPulseMode()\n" "getUseNegPulseMode()\n"
"\tReturns whether negative pulse mode is active.\n"; "\tReturns whether negative pulse mode is active.\n";
PyObject* SCA_ISensor::PyGetUseNegPulseMode(PyObject* self) PyObject* SCA_ISensor::PyGetUseNegPulseMode()
{ {
ShowDeprecationWarning("getUseNegPulseMode()", "the useNegPulseMode property"); ShowDeprecationWarning("getUseNegPulseMode()", "the useNegPulseMode property");
return BoolToPyArg(m_neg_pulsemode); return BoolToPyArg(m_neg_pulsemode);
@@ -369,7 +369,7 @@ const char SCA_ISensor::SetUseNegPulseMode_doc[] =
"\t - pulse? : Pulse when a negative event occurs?\n" "\t - pulse? : Pulse when a negative event occurs?\n"
"\t (KX_TRUE, KX_FALSE)\n" "\t (KX_TRUE, KX_FALSE)\n"
"\tSet whether to do pulsing when negative pulses occur.\n"; "\tSet whether to do pulsing when negative pulses occur.\n";
PyObject* SCA_ISensor::PySetUseNegPulseMode(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_ISensor::PySetUseNegPulseMode(PyObject* args)
{ {
ShowDeprecationWarning("setUseNegPulseMode()", "the useNegPulseMode property"); ShowDeprecationWarning("setUseNegPulseMode()", "the useNegPulseMode property");
int pyarg = 0; int pyarg = 0;

View File

@@ -143,15 +143,15 @@ public:
KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,IsPositive); KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,IsPositive);
KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,IsTriggered); KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,IsTriggered);
KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetUsePosPulseMode); KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetUsePosPulseMode);
KX_PYMETHOD_DOC(SCA_ISensor,SetUsePosPulseMode); KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetUsePosPulseMode);
KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetFrequency); KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetFrequency);
KX_PYMETHOD_DOC(SCA_ISensor,SetFrequency); KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetFrequency);
KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetUseNegPulseMode); KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetUseNegPulseMode);
KX_PYMETHOD_DOC(SCA_ISensor,SetUseNegPulseMode); KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetUseNegPulseMode);
KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetInvert); KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetInvert);
KX_PYMETHOD_DOC(SCA_ISensor,SetInvert); KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetInvert);
KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetLevel); KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetLevel);
KX_PYMETHOD_DOC(SCA_ISensor,SetLevel); KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetLevel);
//<------ //<------
KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,reset); KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,reset);

View File

@@ -349,7 +349,7 @@ int SCA_JoystickSensor::py_setattro(PyObject *attr, PyObject *value)
const char SCA_JoystickSensor::GetIndex_doc[] = const char SCA_JoystickSensor::GetIndex_doc[] =
"getIndex\n" "getIndex\n"
"\tReturns the joystick index to use.\n"; "\tReturns the joystick index to use.\n";
PyObject* SCA_JoystickSensor::PyGetIndex( PyObject* self ) { PyObject* SCA_JoystickSensor::PyGetIndex( ) {
ShowDeprecationWarning("getIndex()", "the index property"); ShowDeprecationWarning("getIndex()", "the index property");
return PyInt_FromLong(m_joyindex); return PyInt_FromLong(m_joyindex);
} }
@@ -359,7 +359,7 @@ PyObject* SCA_JoystickSensor::PyGetIndex( PyObject* self ) {
const char SCA_JoystickSensor::SetIndex_doc[] = const char SCA_JoystickSensor::SetIndex_doc[] =
"setIndex\n" "setIndex\n"
"\tSets the joystick index to use.\n"; "\tSets the joystick index to use.\n";
PyObject* SCA_JoystickSensor::PySetIndex( PyObject* self, PyObject* value ) { PyObject* SCA_JoystickSensor::PySetIndex( PyObject* value ) {
ShowDeprecationWarning("setIndex()", "the index property"); ShowDeprecationWarning("setIndex()", "the index property");
int index = PyInt_AsLong( value ); /* -1 on error, will raise an error in this case */ int index = PyInt_AsLong( value ); /* -1 on error, will raise an error in this case */
if (index < 0 || index >= JOYINDEX_MAX) { if (index < 0 || index >= JOYINDEX_MAX) {
@@ -375,7 +375,7 @@ PyObject* SCA_JoystickSensor::PySetIndex( PyObject* self, PyObject* value ) {
const char SCA_JoystickSensor::GetAxis_doc[] = const char SCA_JoystickSensor::GetAxis_doc[] =
"getAxis\n" "getAxis\n"
"\tReturns the current axis this sensor reacts to.\n"; "\tReturns the current axis this sensor reacts to.\n";
PyObject* SCA_JoystickSensor::PyGetAxis( PyObject* self) { PyObject* SCA_JoystickSensor::PyGetAxis( ) {
ShowDeprecationWarning("getAxis()", "the axis property"); ShowDeprecationWarning("getAxis()", "the axis property");
return Py_BuildValue("[ii]",m_axis, m_axisf); return Py_BuildValue("[ii]",m_axis, m_axisf);
} }
@@ -385,7 +385,7 @@ PyObject* SCA_JoystickSensor::PyGetAxis( PyObject* self) {
const char SCA_JoystickSensor::SetAxis_doc[] = const char SCA_JoystickSensor::SetAxis_doc[] =
"setAxis\n" "setAxis\n"
"\tSets the current axis this sensor reacts to.\n"; "\tSets the current axis this sensor reacts to.\n";
PyObject* SCA_JoystickSensor::PySetAxis( PyObject* self, PyObject* args ) { PyObject* SCA_JoystickSensor::PySetAxis( PyObject* args ) {
ShowDeprecationWarning("setAxis()", "the axis property"); ShowDeprecationWarning("setAxis()", "the axis property");
int axis,axisflag; int axis,axisflag;
@@ -402,7 +402,7 @@ PyObject* SCA_JoystickSensor::PySetAxis( PyObject* self, PyObject* args ) {
const char SCA_JoystickSensor::GetAxisValue_doc[] = const char SCA_JoystickSensor::GetAxisValue_doc[] =
"getAxisValue\n" "getAxisValue\n"
"\tReturns a list of the values for the current state of each axis.\n"; "\tReturns a list of the values for the current state of each axis.\n";
PyObject* SCA_JoystickSensor::PyGetAxisValue( PyObject* self) { PyObject* SCA_JoystickSensor::PyGetAxisValue( ) {
ShowDeprecationWarning("getAxisValue()", "the axisPosition property"); ShowDeprecationWarning("getAxisValue()", "the axisPosition property");
SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
@@ -421,7 +421,7 @@ PyObject* SCA_JoystickSensor::PyGetAxisValue( PyObject* self) {
const char SCA_JoystickSensor::GetThreshold_doc[] = const char SCA_JoystickSensor::GetThreshold_doc[] =
"getThreshold\n" "getThreshold\n"
"\tReturns the threshold of the axis.\n"; "\tReturns the threshold of the axis.\n";
PyObject* SCA_JoystickSensor::PyGetThreshold( PyObject* self) { PyObject* SCA_JoystickSensor::PyGetThreshold( ) {
ShowDeprecationWarning("getThreshold()", "the threshold property"); ShowDeprecationWarning("getThreshold()", "the threshold property");
return PyInt_FromLong(m_precision); return PyInt_FromLong(m_precision);
} }
@@ -431,7 +431,7 @@ PyObject* SCA_JoystickSensor::PyGetThreshold( PyObject* self) {
const char SCA_JoystickSensor::SetThreshold_doc[] = const char SCA_JoystickSensor::SetThreshold_doc[] =
"setThreshold\n" "setThreshold\n"
"\tSets the threshold of the axis.\n"; "\tSets the threshold of the axis.\n";
PyObject* SCA_JoystickSensor::PySetThreshold( PyObject* self, PyObject* args ) { PyObject* SCA_JoystickSensor::PySetThreshold( PyObject* args ) {
ShowDeprecationWarning("setThreshold()", "the threshold property"); ShowDeprecationWarning("setThreshold()", "the threshold property");
int thresh; int thresh;
if(!PyArg_ParseTuple(args, "i:setThreshold", &thresh)){ if(!PyArg_ParseTuple(args, "i:setThreshold", &thresh)){
@@ -445,7 +445,7 @@ PyObject* SCA_JoystickSensor::PySetThreshold( PyObject* self, PyObject* args ) {
const char SCA_JoystickSensor::GetButton_doc[] = const char SCA_JoystickSensor::GetButton_doc[] =
"getButton\n" "getButton\n"
"\tReturns the current button this sensor is checking.\n"; "\tReturns the current button this sensor is checking.\n";
PyObject* SCA_JoystickSensor::PyGetButton( PyObject* self) { PyObject* SCA_JoystickSensor::PyGetButton( ) {
ShowDeprecationWarning("getButton()", "the button property"); ShowDeprecationWarning("getButton()", "the button property");
return PyInt_FromLong(m_button); return PyInt_FromLong(m_button);
} }
@@ -454,7 +454,7 @@ PyObject* SCA_JoystickSensor::PyGetButton( PyObject* self) {
const char SCA_JoystickSensor::SetButton_doc[] = const char SCA_JoystickSensor::SetButton_doc[] =
"setButton\n" "setButton\n"
"\tSets the button the sensor reacts to.\n"; "\tSets the button the sensor reacts to.\n";
PyObject* SCA_JoystickSensor::PySetButton( PyObject* self, PyObject* value ) { PyObject* SCA_JoystickSensor::PySetButton( PyObject* value ) {
ShowDeprecationWarning("setButton()", "the button property"); ShowDeprecationWarning("setButton()", "the button property");
int button = PyInt_AsLong(value); int button = PyInt_AsLong(value);
if(button==-1 && PyErr_Occurred()) { if(button==-1 && PyErr_Occurred()) {
@@ -469,16 +469,16 @@ PyObject* SCA_JoystickSensor::PySetButton( PyObject* self, PyObject* value ) {
const char SCA_JoystickSensor::GetButtonValue_doc[] = const char SCA_JoystickSensor::GetButtonValue_doc[] =
"getButtonValue\n" "getButtonValue\n"
"\tReturns a list containing the indicies of the current pressed state of each button.\n"; "\tReturns a list containing the indicies of the current pressed state of each button.\n";
PyObject* SCA_JoystickSensor::PyGetButtonValue( PyObject* self) { PyObject* SCA_JoystickSensor::PyGetButtonValue( ) {
ShowDeprecationWarning("getButtonValue()", "getButtonActiveList"); ShowDeprecationWarning("getButtonValue()", "getButtonActiveList");
return PyGetButtonActiveList(self); return PyGetButtonActiveList( );
} }
/* get button active list -------------------------------------------------- */ /* get button active list -------------------------------------------------- */
const char SCA_JoystickSensor::GetButtonActiveList_doc[] = const char SCA_JoystickSensor::GetButtonActiveList_doc[] =
"getButtonActiveList\n" "getButtonActiveList\n"
"\tReturns a list containing the indicies of the button currently pressed.\n"; "\tReturns a list containing the indicies of the button currently pressed.\n";
PyObject* SCA_JoystickSensor::PyGetButtonActiveList( PyObject* self) { PyObject* SCA_JoystickSensor::PyGetButtonActiveList( ) {
SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
PyObject *ls = PyList_New(0); PyObject *ls = PyList_New(0);
PyObject *value; PyObject *value;
@@ -500,7 +500,7 @@ PyObject* SCA_JoystickSensor::PyGetButtonActiveList( PyObject* self) {
const char SCA_JoystickSensor::GetButtonStatus_doc[] = const char SCA_JoystickSensor::GetButtonStatus_doc[] =
"getButtonStatus(buttonIndex)\n" "getButtonStatus(buttonIndex)\n"
"\tReturns a bool of the current pressed state of the specified button.\n"; "\tReturns a bool of the current pressed state of the specified button.\n";
PyObject* SCA_JoystickSensor::PyGetButtonStatus( PyObject* self, PyObject* args ) { PyObject* SCA_JoystickSensor::PyGetButtonStatus( PyObject* args ) {
SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
int index; int index;
@@ -517,7 +517,7 @@ PyObject* SCA_JoystickSensor::PyGetButtonStatus( PyObject* self, PyObject* args
const char SCA_JoystickSensor::GetHat_doc[] = const char SCA_JoystickSensor::GetHat_doc[] =
"getHat\n" "getHat\n"
"\tReturns the current direction of the hat.\n"; "\tReturns the current direction of the hat.\n";
PyObject* SCA_JoystickSensor::PyGetHat( PyObject* self ) { PyObject* SCA_JoystickSensor::PyGetHat( ) {
ShowDeprecationWarning("getHat()", "the hat property"); ShowDeprecationWarning("getHat()", "the hat property");
return Py_BuildValue("[ii]",m_hat, m_hatf); return Py_BuildValue("[ii]",m_hat, m_hatf);
} }
@@ -527,7 +527,7 @@ PyObject* SCA_JoystickSensor::PyGetHat( PyObject* self ) {
const char SCA_JoystickSensor::SetHat_doc[] = const char SCA_JoystickSensor::SetHat_doc[] =
"setHat\n" "setHat\n"
"\tSets the hat the sensor reacts to.\n"; "\tSets the hat the sensor reacts to.\n";
PyObject* SCA_JoystickSensor::PySetHat( PyObject* self, PyObject* args ) { PyObject* SCA_JoystickSensor::PySetHat( PyObject* args ) {
ShowDeprecationWarning("setHat()", "the hat property"); ShowDeprecationWarning("setHat()", "the hat property");
int hat,hatflag; int hat,hatflag;
if(!PyArg_ParseTuple(args, "ii:setHat", &hat, &hatflag)){ if(!PyArg_ParseTuple(args, "ii:setHat", &hat, &hatflag)){
@@ -543,7 +543,7 @@ PyObject* SCA_JoystickSensor::PySetHat( PyObject* self, PyObject* args ) {
const char SCA_JoystickSensor::NumberOfAxes_doc[] = const char SCA_JoystickSensor::NumberOfAxes_doc[] =
"getNumAxes\n" "getNumAxes\n"
"\tReturns the number of axes .\n"; "\tReturns the number of axes .\n";
PyObject* SCA_JoystickSensor::PyNumberOfAxes( PyObject* self ) { PyObject* SCA_JoystickSensor::PyNumberOfAxes( ) {
ShowDeprecationWarning("getNumAxes()", "the numAxis property"); ShowDeprecationWarning("getNumAxes()", "the numAxis property");
SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
// when the joystick is null their is 0 exis still. dumb but scripters should use isConnected() // when the joystick is null their is 0 exis still. dumb but scripters should use isConnected()
@@ -554,7 +554,7 @@ PyObject* SCA_JoystickSensor::PyNumberOfAxes( PyObject* self ) {
const char SCA_JoystickSensor::NumberOfButtons_doc[] = const char SCA_JoystickSensor::NumberOfButtons_doc[] =
"getNumButtons\n" "getNumButtons\n"
"\tReturns the number of buttons .\n"; "\tReturns the number of buttons .\n";
PyObject* SCA_JoystickSensor::PyNumberOfButtons( PyObject* self ) { PyObject* SCA_JoystickSensor::PyNumberOfButtons( ) {
ShowDeprecationWarning("getNumButtons()", "the numButtons property"); ShowDeprecationWarning("getNumButtons()", "the numButtons property");
SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
return PyInt_FromLong( joy ? joy->GetNumberOfButtons() : 0 ); return PyInt_FromLong( joy ? joy->GetNumberOfButtons() : 0 );
@@ -564,7 +564,7 @@ PyObject* SCA_JoystickSensor::PyNumberOfButtons( PyObject* self ) {
const char SCA_JoystickSensor::NumberOfHats_doc[] = const char SCA_JoystickSensor::NumberOfHats_doc[] =
"getNumHats\n" "getNumHats\n"
"\tReturns the number of hats .\n"; "\tReturns the number of hats .\n";
PyObject* SCA_JoystickSensor::PyNumberOfHats( PyObject* self ) { PyObject* SCA_JoystickSensor::PyNumberOfHats( ) {
ShowDeprecationWarning("getNumHats()", "the numHats property"); ShowDeprecationWarning("getNumHats()", "the numHats property");
SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
return PyInt_FromLong( joy ? joy->GetNumberOfHats() : 0 ); return PyInt_FromLong( joy ? joy->GetNumberOfHats() : 0 );
@@ -573,7 +573,7 @@ PyObject* SCA_JoystickSensor::PyNumberOfHats( PyObject* self ) {
const char SCA_JoystickSensor::Connected_doc[] = const char SCA_JoystickSensor::Connected_doc[] =
"getConnected\n" "getConnected\n"
"\tReturns True if a joystick is connected at this joysticks index.\n"; "\tReturns True if a joystick is connected at this joysticks index.\n";
PyObject* SCA_JoystickSensor::PyConnected( PyObject* self ) { PyObject* SCA_JoystickSensor::PyConnected( ) {
ShowDeprecationWarning("getConnected()", "the connected property"); ShowDeprecationWarning("getConnected()", "the connected property");
SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
return PyBool_FromLong( joy ? joy->Connected() : 0 ); return PyBool_FromLong( joy ? joy->Connected() : 0 );

View File

@@ -412,7 +412,7 @@ void SCA_KeyboardSensor::LogKeystrokes(void)
const char SCA_KeyboardSensor::GetKey_doc[] = const char SCA_KeyboardSensor::GetKey_doc[] =
"getKey()\n" "getKey()\n"
"\tReturn the code of the key this sensor is listening to.\n" ; "\tReturn the code of the key this sensor is listening to.\n" ;
PyObject* SCA_KeyboardSensor::PyGetKey(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_KeyboardSensor::PyGetKey()
{ {
ShowDeprecationWarning("getKey()", "the key property"); ShowDeprecationWarning("getKey()", "the key property");
return PyInt_FromLong(m_hotkey); return PyInt_FromLong(m_hotkey);
@@ -423,7 +423,7 @@ const char SCA_KeyboardSensor::SetKey_doc[] =
"setKey(keycode)\n" "setKey(keycode)\n"
"\t- keycode: any code from GameKeys\n" "\t- keycode: any code from GameKeys\n"
"\tSet the key this sensor should listen to.\n" ; "\tSet the key this sensor should listen to.\n" ;
PyObject* SCA_KeyboardSensor::PySetKey(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_KeyboardSensor::PySetKey(PyObject* args)
{ {
ShowDeprecationWarning("setKey()", "the key property"); ShowDeprecationWarning("setKey()", "the key property");
int keyCode; int keyCode;
@@ -444,7 +444,7 @@ const char SCA_KeyboardSensor::GetHold1_doc[] =
"getHold1()\n" "getHold1()\n"
"\tReturn the code of the first key modifier to the key this \n" "\tReturn the code of the first key modifier to the key this \n"
"\tsensor is listening to.\n" ; "\tsensor is listening to.\n" ;
PyObject* SCA_KeyboardSensor::PyGetHold1(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_KeyboardSensor::PyGetHold1()
{ {
ShowDeprecationWarning("getHold1()", "the hold1 property"); ShowDeprecationWarning("getHold1()", "the hold1 property");
return PyInt_FromLong(m_qual); return PyInt_FromLong(m_qual);
@@ -455,7 +455,7 @@ const char SCA_KeyboardSensor::SetHold1_doc[] =
"setHold1(keycode)\n" "setHold1(keycode)\n"
"\t- keycode: any code from GameKeys\n" "\t- keycode: any code from GameKeys\n"
"\tSet the first modifier to the key this sensor should listen to.\n" ; "\tSet the first modifier to the key this sensor should listen to.\n" ;
PyObject* SCA_KeyboardSensor::PySetHold1(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_KeyboardSensor::PySetHold1(PyObject* args)
{ {
ShowDeprecationWarning("setHold1()", "the hold1 property"); ShowDeprecationWarning("setHold1()", "the hold1 property");
int keyCode; int keyCode;
@@ -476,7 +476,7 @@ const char SCA_KeyboardSensor::GetHold2_doc[] =
"getHold2()\n" "getHold2()\n"
"\tReturn the code of the second key modifier to the key this \n" "\tReturn the code of the second key modifier to the key this \n"
"\tsensor is listening to.\n" ; "\tsensor is listening to.\n" ;
PyObject* SCA_KeyboardSensor::PyGetHold2(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_KeyboardSensor::PyGetHold2()
{ {
ShowDeprecationWarning("getHold2()", "the hold2 property"); ShowDeprecationWarning("getHold2()", "the hold2 property");
return PyInt_FromLong(m_qual2); return PyInt_FromLong(m_qual2);
@@ -487,7 +487,7 @@ const char SCA_KeyboardSensor::SetHold2_doc[] =
"setHold2(keycode)\n" "setHold2(keycode)\n"
"\t- keycode: any code from GameKeys\n" "\t- keycode: any code from GameKeys\n"
"\tSet the first modifier to the key this sensor should listen to.\n" ; "\tSet the first modifier to the key this sensor should listen to.\n" ;
PyObject* SCA_KeyboardSensor::PySetHold2(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_KeyboardSensor::PySetHold2(PyObject* args)
{ {
ShowDeprecationWarning("setHold2()", "the hold2 property"); ShowDeprecationWarning("setHold2()", "the hold2 property");
int keyCode; int keyCode;
@@ -508,7 +508,7 @@ const char SCA_KeyboardSensor::GetPressedKeys_doc[] =
"getPressedKeys()\n" "getPressedKeys()\n"
"\tGet a list of pressed keys that have either been pressed, or just released this frame.\n" ; "\tGet a list of pressed keys that have either been pressed, or just released this frame.\n" ;
PyObject* SCA_KeyboardSensor::PyGetPressedKeys(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_KeyboardSensor::PyGetPressedKeys()
{ {
ShowDeprecationWarning("getPressedKeys()", "events"); ShowDeprecationWarning("getPressedKeys()", "events");
@@ -549,7 +549,7 @@ const char SCA_KeyboardSensor::GetCurrentlyPressedKeys_doc[] =
"getCurrentlyPressedKeys()\n" "getCurrentlyPressedKeys()\n"
"\tGet a list of keys that are currently pressed.\n" ; "\tGet a list of keys that are currently pressed.\n" ;
PyObject* SCA_KeyboardSensor::PyGetCurrentlyPressedKeys(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_KeyboardSensor::PyGetCurrentlyPressedKeys()
{ {
ShowDeprecationWarning("getCurrentlyPressedKeys()", "events"); ShowDeprecationWarning("getCurrentlyPressedKeys()", "events");
@@ -640,14 +640,14 @@ PyParentObject SCA_KeyboardSensor::Parents[] = {
PyMethodDef SCA_KeyboardSensor::Methods[] = { PyMethodDef SCA_KeyboardSensor::Methods[] = {
//Deprecated functions ------> //Deprecated functions ------>
{"getKey", (PyCFunction) SCA_KeyboardSensor::sPyGetKey, METH_VARARGS, (PY_METHODCHAR)GetKey_doc}, {"getKey", (PyCFunction) SCA_KeyboardSensor::sPyGetKey, METH_NOARGS, (PY_METHODCHAR)GetKey_doc},
{"setKey", (PyCFunction) SCA_KeyboardSensor::sPySetKey, METH_VARARGS, (PY_METHODCHAR)SetKey_doc}, {"setKey", (PyCFunction) SCA_KeyboardSensor::sPySetKey, METH_VARARGS, (PY_METHODCHAR)SetKey_doc},
{"getHold1", (PyCFunction) SCA_KeyboardSensor::sPyGetHold1, METH_VARARGS, (PY_METHODCHAR)GetHold1_doc}, {"getHold1", (PyCFunction) SCA_KeyboardSensor::sPyGetHold1, METH_NOARGS, (PY_METHODCHAR)GetHold1_doc},
{"setHold1", (PyCFunction) SCA_KeyboardSensor::sPySetHold1, METH_VARARGS, (PY_METHODCHAR)SetHold1_doc}, {"setHold1", (PyCFunction) SCA_KeyboardSensor::sPySetHold1, METH_VARARGS, (PY_METHODCHAR)SetHold1_doc},
{"getHold2", (PyCFunction) SCA_KeyboardSensor::sPyGetHold2, METH_VARARGS, (PY_METHODCHAR)GetHold2_doc}, {"getHold2", (PyCFunction) SCA_KeyboardSensor::sPyGetHold2, METH_NOARGS, (PY_METHODCHAR)GetHold2_doc},
{"setHold2", (PyCFunction) SCA_KeyboardSensor::sPySetHold2, METH_VARARGS, (PY_METHODCHAR)SetHold2_doc}, {"setHold2", (PyCFunction) SCA_KeyboardSensor::sPySetHold2, METH_VARARGS, (PY_METHODCHAR)SetHold2_doc},
{"getPressedKeys", (PyCFunction) SCA_KeyboardSensor::sPyGetPressedKeys, METH_VARARGS, (PY_METHODCHAR)GetPressedKeys_doc}, {"getPressedKeys", (PyCFunction) SCA_KeyboardSensor::sPyGetPressedKeys, METH_NOARGS, (PY_METHODCHAR)GetPressedKeys_doc},
{"getCurrentlyPressedKeys", (PyCFunction) SCA_KeyboardSensor::sPyGetCurrentlyPressedKeys, METH_VARARGS, (PY_METHODCHAR)GetCurrentlyPressedKeys_doc}, {"getCurrentlyPressedKeys", (PyCFunction) SCA_KeyboardSensor::sPyGetCurrentlyPressedKeys, METH_NOARGS, (PY_METHODCHAR)GetCurrentlyPressedKeys_doc},
//<----- Deprecated //<----- Deprecated
KX_PYMETHODTABLE_O(SCA_KeyboardSensor, getKeyStatus), KX_PYMETHODTABLE_O(SCA_KeyboardSensor, getKeyStatus),
{NULL,NULL} //Sentinel {NULL,NULL} //Sentinel

View File

@@ -115,21 +115,21 @@ public:
//Deprecated functions -----> //Deprecated functions ----->
/** 1. GetKey : check which key this sensor looks at */ /** 1. GetKey : check which key this sensor looks at */
KX_PYMETHOD_DOC(SCA_KeyboardSensor,GetKey); KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetKey);
/** 2. SetKey: change the key to look at */ /** 2. SetKey: change the key to look at */
KX_PYMETHOD_DOC(SCA_KeyboardSensor,SetKey); KX_PYMETHOD_DOC_VARARGS(SCA_KeyboardSensor,SetKey);
/** 3. GetHold1 : set the first bucky bit */ /** 3. GetHold1 : set the first bucky bit */
KX_PYMETHOD_DOC(SCA_KeyboardSensor,GetHold1); KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetHold1);
/** 4. SetHold1: change the first bucky bit */ /** 4. SetHold1: change the first bucky bit */
KX_PYMETHOD_DOC(SCA_KeyboardSensor,SetHold1); KX_PYMETHOD_DOC_VARARGS(SCA_KeyboardSensor,SetHold1);
/** 5. GetHold2 : set the second bucky bit */ /** 5. GetHold2 : set the second bucky bit */
KX_PYMETHOD_DOC(SCA_KeyboardSensor,GetHold2); KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetHold2);
/** 6. SetHold2: change the second bucky bit */ /** 6. SetHold2: change the second bucky bit */
KX_PYMETHOD_DOC(SCA_KeyboardSensor,SetHold2); KX_PYMETHOD_DOC_VARARGS(SCA_KeyboardSensor,SetHold2);
/** 9. GetPressedKeys: */ /** 9. GetPressedKeys: */
KX_PYMETHOD_DOC(SCA_KeyboardSensor,GetPressedKeys); KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetPressedKeys);
/** 9. GetCurrrentlyPressedKeys: */ /** 9. GetCurrrentlyPressedKeys: */
KX_PYMETHOD_DOC(SCA_KeyboardSensor,GetCurrentlyPressedKeys); KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetCurrentlyPressedKeys);
// <------ // <------
// KeyEvents: // KeyEvents:

View File

@@ -252,9 +252,7 @@ const char SCA_MouseSensor::GetXPosition_doc[] =
"\tReturns the x-coordinate of the mouse sensor, in frame coordinates.\n" "\tReturns the x-coordinate of the mouse sensor, in frame coordinates.\n"
"\tThe lower-left corner is the origin. The coordinate is given in\n" "\tThe lower-left corner is the origin. The coordinate is given in\n"
"\tpixels\n"; "\tpixels\n";
PyObject* SCA_MouseSensor::PyGetXPosition(PyObject* self, PyObject* SCA_MouseSensor::PyGetXPosition() {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("getXPosition()", "the position property"); ShowDeprecationWarning("getXPosition()", "the position property");
return PyInt_FromLong(m_x); return PyInt_FromLong(m_x);
} }
@@ -265,9 +263,7 @@ const char SCA_MouseSensor::GetYPosition_doc[] =
"\tReturns the y-coordinate of the mouse sensor, in frame coordinates.\n" "\tReturns the y-coordinate of the mouse sensor, in frame coordinates.\n"
"\tThe lower-left corner is the origin. The coordinate is given in\n" "\tThe lower-left corner is the origin. The coordinate is given in\n"
"\tpixels\n"; "\tpixels\n";
PyObject* SCA_MouseSensor::PyGetYPosition(PyObject* self, PyObject* SCA_MouseSensor::PyGetYPosition() {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("getYPosition()", "the position property"); ShowDeprecationWarning("getYPosition()", "the position property");
return PyInt_FromLong(m_y); return PyInt_FromLong(m_y);
} }

View File

@@ -114,9 +114,9 @@ class SCA_MouseSensor : public SCA_ISensor
//Deprecated functions -----> //Deprecated functions ----->
/* read x-coordinate */ /* read x-coordinate */
KX_PYMETHOD_DOC(SCA_MouseSensor,GetXPosition); KX_PYMETHOD_DOC_NOARGS(SCA_MouseSensor,GetXPosition);
/* read y-coordinate */ /* read y-coordinate */
KX_PYMETHOD_DOC(SCA_MouseSensor,GetYPosition); KX_PYMETHOD_DOC_NOARGS(SCA_MouseSensor,GetYPosition);
//<----- deprecated //<----- deprecated
// get button status // get button status

View File

@@ -289,7 +289,7 @@ const char SCA_PropertyActuator::SetProperty_doc[] =
"\t- name: string\n" "\t- name: string\n"
"\tSet the property on which to operate. If there is no property\n" "\tSet the property on which to operate. If there is no property\n"
"\tof this name, the call is ignored.\n"; "\tof this name, the call is ignored.\n";
PyObject* SCA_PropertyActuator::PySetProperty(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_PropertyActuator::PySetProperty(PyObject* args, PyObject* kwds)
{ {
ShowDeprecationWarning("setProperty()", "the 'property' property"); ShowDeprecationWarning("setProperty()", "the 'property' property");
/* Check whether the name exists first ! */ /* Check whether the name exists first ! */
@@ -314,7 +314,7 @@ PyObject* SCA_PropertyActuator::PySetProperty(PyObject* self, PyObject* args, Py
const char SCA_PropertyActuator::GetProperty_doc[] = const char SCA_PropertyActuator::GetProperty_doc[] =
"getProperty(name)\n" "getProperty(name)\n"
"\tReturn the property on which the actuator operates.\n"; "\tReturn the property on which the actuator operates.\n";
PyObject* SCA_PropertyActuator::PyGetProperty(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_PropertyActuator::PyGetProperty(PyObject* args, PyObject* kwds)
{ {
ShowDeprecationWarning("getProperty()", "the 'property' property"); ShowDeprecationWarning("getProperty()", "the 'property' property");
return PyString_FromString(m_propname); return PyString_FromString(m_propname);
@@ -327,7 +327,7 @@ const char SCA_PropertyActuator::SetValue_doc[] =
"\tSet the value with which the actuator operates. If the value\n" "\tSet the value with which the actuator operates. If the value\n"
"\tis not compatible with the type of the property, the subsequent\n" "\tis not compatible with the type of the property, the subsequent\n"
"\t action is ignored.\n"; "\t action is ignored.\n";
PyObject* SCA_PropertyActuator::PySetValue(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_PropertyActuator::PySetValue(PyObject* args, PyObject* kwds)
{ {
ShowDeprecationWarning("setValue()", "the value property"); ShowDeprecationWarning("setValue()", "the value property");
char *valArg; char *valArg;
@@ -344,7 +344,7 @@ PyObject* SCA_PropertyActuator::PySetValue(PyObject* self, PyObject* args, PyObj
const char SCA_PropertyActuator::GetValue_doc[] = const char SCA_PropertyActuator::GetValue_doc[] =
"getValue()\n" "getValue()\n"
"\tReturns the value with which the actuator operates.\n"; "\tReturns the value with which the actuator operates.\n";
PyObject* SCA_PropertyActuator::PyGetValue(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_PropertyActuator::PyGetValue(PyObject* args, PyObject* kwds)
{ {
ShowDeprecationWarning("getValue()", "the value property"); ShowDeprecationWarning("getValue()", "the value property");
return PyString_FromString(m_exprtxt); return PyString_FromString(m_exprtxt);

View File

@@ -334,11 +334,11 @@ PyParentObject SCA_PropertySensor::Parents[] = {
PyMethodDef SCA_PropertySensor::Methods[] = { PyMethodDef SCA_PropertySensor::Methods[] = {
//Deprecated functions ------> //Deprecated functions ------>
{"getType", (PyCFunction) SCA_PropertySensor::sPyGetType, METH_VARARGS, (PY_METHODCHAR)GetType_doc}, {"getType", (PyCFunction) SCA_PropertySensor::sPyGetType, METH_NOARGS, (PY_METHODCHAR)GetType_doc},
{"setType", (PyCFunction) SCA_PropertySensor::sPySetType, METH_VARARGS, (PY_METHODCHAR)SetType_doc}, {"setType", (PyCFunction) SCA_PropertySensor::sPySetType, METH_VARARGS, (PY_METHODCHAR)SetType_doc},
{"getProperty", (PyCFunction) SCA_PropertySensor::sPyGetProperty, METH_VARARGS, (PY_METHODCHAR)GetProperty_doc}, {"getProperty", (PyCFunction) SCA_PropertySensor::sPyGetProperty, METH_NOARGS, (PY_METHODCHAR)GetProperty_doc},
{"setProperty", (PyCFunction) SCA_PropertySensor::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc}, {"setProperty", (PyCFunction) SCA_PropertySensor::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
{"getValue", (PyCFunction) SCA_PropertySensor::sPyGetValue, METH_VARARGS, (PY_METHODCHAR)GetValue_doc}, {"getValue", (PyCFunction) SCA_PropertySensor::sPyGetValue, METH_NOARGS, (PY_METHODCHAR)GetValue_doc},
{"setValue", (PyCFunction) SCA_PropertySensor::sPySetValue, METH_VARARGS, (PY_METHODCHAR)SetValue_doc}, {"setValue", (PyCFunction) SCA_PropertySensor::sPySetValue, METH_VARARGS, (PY_METHODCHAR)SetValue_doc},
//<----- Deprecated //<----- Deprecated
{NULL,NULL} //Sentinel {NULL,NULL} //Sentinel
@@ -364,7 +364,7 @@ int SCA_PropertySensor::py_setattro(PyObject *attr, PyObject *value) {
const char SCA_PropertySensor::GetType_doc[] = const char SCA_PropertySensor::GetType_doc[] =
"getType()\n" "getType()\n"
"\tReturns the type of check this sensor performs.\n"; "\tReturns the type of check this sensor performs.\n";
PyObject* SCA_PropertySensor::PyGetType(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_PropertySensor::PyGetType()
{ {
ShowDeprecationWarning("getType()", "the type property"); ShowDeprecationWarning("getType()", "the type property");
return PyInt_FromLong(m_checktype); return PyInt_FromLong(m_checktype);
@@ -377,7 +377,7 @@ const char SCA_PropertySensor::SetType_doc[] =
"\t KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED,\n" "\t KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED,\n"
"\t or KX_PROPSENSOR_EXPRESSION.\n" "\t or KX_PROPSENSOR_EXPRESSION.\n"
"\tSet the type of check to perform.\n"; "\tSet the type of check to perform.\n";
PyObject* SCA_PropertySensor::PySetType(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_PropertySensor::PySetType(PyObject* args)
{ {
ShowDeprecationWarning("setType()", "the type property"); ShowDeprecationWarning("setType()", "the type property");
int typeArg; int typeArg;
@@ -398,7 +398,7 @@ PyObject* SCA_PropertySensor::PySetType(PyObject* self, PyObject* args, PyObject
const char SCA_PropertySensor::GetProperty_doc[] = const char SCA_PropertySensor::GetProperty_doc[] =
"getProperty()\n" "getProperty()\n"
"\tReturn the property with which the sensor operates.\n"; "\tReturn the property with which the sensor operates.\n";
PyObject* SCA_PropertySensor::PyGetProperty(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_PropertySensor::PyGetProperty()
{ {
ShowDeprecationWarning("getProperty()", "the 'property' property"); ShowDeprecationWarning("getProperty()", "the 'property' property");
return PyString_FromString(m_checkpropname); return PyString_FromString(m_checkpropname);
@@ -410,7 +410,7 @@ const char SCA_PropertySensor::SetProperty_doc[] =
"\t- name: string\n" "\t- name: string\n"
"\tSets the property with which to operate. If there is no property\n" "\tSets the property with which to operate. If there is no property\n"
"\tof this name, the call is ignored.\n"; "\tof this name, the call is ignored.\n";
PyObject* SCA_PropertySensor::PySetProperty(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_PropertySensor::PySetProperty(PyObject* args)
{ {
ShowDeprecationWarning("setProperty()", "the 'property' property"); ShowDeprecationWarning("setProperty()", "the 'property' property");
/* We should query whether the name exists. Or should we create a prop */ /* We should query whether the name exists. Or should we create a prop */
@@ -435,7 +435,7 @@ PyObject* SCA_PropertySensor::PySetProperty(PyObject* self, PyObject* args, PyOb
const char SCA_PropertySensor::GetValue_doc[] = const char SCA_PropertySensor::GetValue_doc[] =
"getValue()\n" "getValue()\n"
"\tReturns the value with which the sensor operates.\n"; "\tReturns the value with which the sensor operates.\n";
PyObject* SCA_PropertySensor::PyGetValue(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_PropertySensor::PyGetValue()
{ {
ShowDeprecationWarning("getValue()", "the value property"); ShowDeprecationWarning("getValue()", "the value property");
return PyString_FromString(m_checkpropval); return PyString_FromString(m_checkpropval);
@@ -448,7 +448,7 @@ const char SCA_PropertySensor::SetValue_doc[] =
"\tSet the value with which the sensor operates. If the value\n" "\tSet the value with which the sensor operates. If the value\n"
"\tis not compatible with the type of the property, the subsequent\n" "\tis not compatible with the type of the property, the subsequent\n"
"\t action is ignored.\n"; "\t action is ignored.\n";
PyObject* SCA_PropertySensor::PySetValue(PyObject* self, PyObject* args, PyObject* kwds) PyObject* SCA_PropertySensor::PySetValue(PyObject* args)
{ {
ShowDeprecationWarning("setValue()", "the value property"); ShowDeprecationWarning("setValue()", "the value property");
/* Here, we need to check whether the value is 'valid' for this property.*/ /* Here, we need to check whether the value is 'valid' for this property.*/
@@ -460,7 +460,7 @@ PyObject* SCA_PropertySensor::PySetValue(PyObject* self, PyObject* args, PyObjec
} }
STR_String oldval = m_checkpropval; STR_String oldval = m_checkpropval;
m_checkpropval = propValArg; m_checkpropval = propValArg;
if (validValueForProperty(self, NULL)) { if (validValueForProperty(m_proxy, NULL)) {
m_checkpropval = oldval; m_checkpropval = oldval;
return NULL; return NULL;
} }

View File

@@ -93,17 +93,17 @@ public:
virtual int py_setattro(PyObject *attr, PyObject *value); virtual int py_setattro(PyObject *attr, PyObject *value);
/* 1. getType */ /* 1. getType */
KX_PYMETHOD_DOC(SCA_PropertySensor,GetType); KX_PYMETHOD_DOC_NOARGS(SCA_PropertySensor,GetType);
/* 2. setType */ /* 2. setType */
KX_PYMETHOD_DOC(SCA_PropertySensor,SetType); KX_PYMETHOD_DOC_VARARGS(SCA_PropertySensor,SetType);
/* 3. setProperty */ /* 3. setProperty */
KX_PYMETHOD_DOC(SCA_PropertySensor,SetProperty); KX_PYMETHOD_DOC_VARARGS(SCA_PropertySensor,SetProperty);
/* 4. getProperty */ /* 4. getProperty */
KX_PYMETHOD_DOC(SCA_PropertySensor,GetProperty); KX_PYMETHOD_DOC_NOARGS(SCA_PropertySensor,GetProperty);
/* 5. getValue */ /* 5. getValue */
KX_PYMETHOD_DOC(SCA_PropertySensor,GetValue); KX_PYMETHOD_DOC_NOARGS(SCA_PropertySensor,GetValue);
/* 6. setValue */ /* 6. setValue */
KX_PYMETHOD_DOC(SCA_PropertySensor,SetValue); KX_PYMETHOD_DOC_VARARGS(SCA_PropertySensor,SetValue);
/** /**
* Test whether this is a sensible value (type check) * Test whether this is a sensible value (type check)
*/ */

View File

@@ -154,8 +154,8 @@ int SCA_PythonController::IsTriggered(class SCA_ISensor* sensor)
static const char* sPyGetCurrentController__doc__; static const char* sPyGetCurrentController__doc__;
#endif #endif
/* warning, self is not the SCA_PythonController, its a PyObjectPlus_Proxy */
PyObject* SCA_PythonController::sPyGetCurrentController(PyObject* self) PyObject* SCA_PythonController::sPyGetCurrentController(PyObject *self)
{ {
return m_sCurrentController->GetProxy(); return m_sCurrentController->GetProxy();
} }
@@ -197,12 +197,9 @@ SCA_IActuator* SCA_PythonController::LinkedActuatorFromPy(PyObject *value)
static const char* sPyAddActiveActuator__doc__; static const char* sPyAddActiveActuator__doc__;
#endif #endif
PyObject* SCA_PythonController::sPyAddActiveActuator( /* warning, self is not the SCA_PythonController, its a PyObjectPlus_Proxy */
PyObject* SCA_PythonController::sPyAddActiveActuator(PyObject* self, PyObject* args)
PyObject* self,
PyObject* args)
{ {
PyObject* ob1; PyObject* ob1;
int activate; int activate;
if (!PyArg_ParseTuple(args, "Oi:addActiveActuator", &ob1,&activate)) if (!PyArg_ParseTuple(args, "Oi:addActiveActuator", &ob1,&activate))
@@ -384,7 +381,7 @@ int SCA_PythonController::py_setattro(PyObject *attr, PyObject *value)
py_setattro_up(SCA_IController); py_setattro_up(SCA_IController);
} }
PyObject* SCA_PythonController::PyActivate(PyObject* self, PyObject *value) PyObject* SCA_PythonController::PyActivate(PyObject *value)
{ {
SCA_IActuator* actu = LinkedActuatorFromPy(value); SCA_IActuator* actu = LinkedActuatorFromPy(value);
if(actu==NULL) if(actu==NULL)
@@ -396,7 +393,7 @@ PyObject* SCA_PythonController::PyActivate(PyObject* self, PyObject *value)
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* SCA_PythonController::PyDeActivate(PyObject* self, PyObject *value) PyObject* SCA_PythonController::PyDeActivate(PyObject *value)
{ {
SCA_IActuator* actu = LinkedActuatorFromPy(value); SCA_IActuator* actu = LinkedActuatorFromPy(value);
if(actu==NULL) if(actu==NULL)
@@ -408,7 +405,7 @@ PyObject* SCA_PythonController::PyDeActivate(PyObject* self, PyObject *value)
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* SCA_PythonController::PyGetActuators(PyObject* self) PyObject* SCA_PythonController::PyGetActuators()
{ {
PyObject* resultlist = PyList_New(m_linkedactuators.size()); PyObject* resultlist = PyList_New(m_linkedactuators.size());
for (unsigned int index=0;index<m_linkedactuators.size();index++) for (unsigned int index=0;index<m_linkedactuators.size();index++)
@@ -422,7 +419,7 @@ PyObject* SCA_PythonController::PyGetActuators(PyObject* self)
const char SCA_PythonController::GetSensor_doc[] = const char SCA_PythonController::GetSensor_doc[] =
"GetSensor (char sensorname) return linked sensor that is named [sensorname]\n"; "GetSensor (char sensorname) return linked sensor that is named [sensorname]\n";
PyObject* PyObject*
SCA_PythonController::PyGetSensor(PyObject* self, PyObject* value) SCA_PythonController::PyGetSensor(PyObject* value)
{ {
char *scriptArg = PyString_AsString(value); char *scriptArg = PyString_AsString(value);
@@ -450,7 +447,7 @@ SCA_PythonController::PyGetSensor(PyObject* self, PyObject* value)
const char SCA_PythonController::GetActuator_doc[] = const char SCA_PythonController::GetActuator_doc[] =
"GetActuator (char sensorname) return linked actuator that is named [actuatorname]\n"; "GetActuator (char sensorname) return linked actuator that is named [actuatorname]\n";
PyObject* PyObject*
SCA_PythonController::PyGetActuator(PyObject* self, PyObject* value) SCA_PythonController::PyGetActuator(PyObject* value)
{ {
char *scriptArg = PyString_AsString(value); char *scriptArg = PyString_AsString(value);
@@ -475,7 +472,7 @@ SCA_PythonController::PyGetActuator(PyObject* self, PyObject* value)
const char SCA_PythonController::GetSensors_doc[] = "getSensors returns a list of all attached sensors"; const char SCA_PythonController::GetSensors_doc[] = "getSensors returns a list of all attached sensors";
PyObject* PyObject*
SCA_PythonController::PyGetSensors(PyObject* self) SCA_PythonController::PyGetSensors()
{ {
PyObject* resultlist = PyList_New(m_linkedsensors.size()); PyObject* resultlist = PyList_New(m_linkedsensors.size());
for (unsigned int index=0;index<m_linkedsensors.size();index++) for (unsigned int index=0;index<m_linkedsensors.size();index++)
@@ -487,14 +484,14 @@ SCA_PythonController::PyGetSensors(PyObject* self)
} }
/* 1. getScript */ /* 1. getScript */
PyObject* SCA_PythonController::PyGetScript(PyObject* self) PyObject* SCA_PythonController::PyGetScript()
{ {
ShowDeprecationWarning("getScript()", "the script property"); ShowDeprecationWarning("getScript()", "the script property");
return PyString_FromString(m_scriptText); return PyString_FromString(m_scriptText);
} }
/* 2. setScript */ /* 2. setScript */
PyObject* SCA_PythonController::PySetScript(PyObject* self, PyObject* value) PyObject* SCA_PythonController::PySetScript(PyObject* value)
{ {
char *scriptArg = PyString_AsString(value); char *scriptArg = PyString_AsString(value);
@@ -514,7 +511,7 @@ PyObject* SCA_PythonController::PySetScript(PyObject* self, PyObject* value)
} }
/* 1. getScript */ /* 1. getScript */
PyObject* SCA_PythonController::PyGetState(PyObject* self) PyObject* SCA_PythonController::PyGetState()
{ {
ShowDeprecationWarning("getState()", "the state property"); ShowDeprecationWarning("getState()", "the state property");
return PyInt_FromLong(m_statemask); return PyInt_FromLong(m_statemask);

View File

@@ -341,12 +341,12 @@ PyParentObject SCA_RandomActuator::Parents[] = {
PyMethodDef SCA_RandomActuator::Methods[] = { PyMethodDef SCA_RandomActuator::Methods[] = {
//Deprecated functions ------> //Deprecated functions ------>
{"setSeed", (PyCFunction) SCA_RandomActuator::sPySetSeed, METH_VARARGS, (PY_METHODCHAR)SetSeed_doc}, {"setSeed", (PyCFunction) SCA_RandomActuator::sPySetSeed, METH_VARARGS, (PY_METHODCHAR)SetSeed_doc},
{"getSeed", (PyCFunction) SCA_RandomActuator::sPyGetSeed, METH_VARARGS, (PY_METHODCHAR)GetSeed_doc}, {"getSeed", (PyCFunction) SCA_RandomActuator::sPyGetSeed, METH_NOARGS, (PY_METHODCHAR)GetSeed_doc},
{"getPara1", (PyCFunction) SCA_RandomActuator::sPyGetPara1, METH_VARARGS, (PY_METHODCHAR)GetPara1_doc}, {"getPara1", (PyCFunction) SCA_RandomActuator::sPyGetPara1, METH_NOARGS, (PY_METHODCHAR)GetPara1_doc},
{"getPara2", (PyCFunction) SCA_RandomActuator::sPyGetPara2, METH_VARARGS, (PY_METHODCHAR)GetPara2_doc}, {"getPara2", (PyCFunction) SCA_RandomActuator::sPyGetPara2, METH_NOARGS, (PY_METHODCHAR)GetPara2_doc},
{"getDistribution", (PyCFunction) SCA_RandomActuator::sPyGetDistribution, METH_VARARGS, (PY_METHODCHAR)GetDistribution_doc}, {"getDistribution", (PyCFunction) SCA_RandomActuator::sPyGetDistribution, METH_NOARGS, (PY_METHODCHAR)GetDistribution_doc},
{"setProperty", (PyCFunction) SCA_RandomActuator::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc}, {"setProperty", (PyCFunction) SCA_RandomActuator::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
{"getProperty", (PyCFunction) SCA_RandomActuator::sPyGetProperty, METH_VARARGS, (PY_METHODCHAR)GetProperty_doc}, {"getProperty", (PyCFunction) SCA_RandomActuator::sPyGetProperty, METH_NOARGS, (PY_METHODCHAR)GetProperty_doc},
//<----- Deprecated //<----- Deprecated
KX_PYMETHODTABLE(SCA_RandomActuator, setBoolConst), KX_PYMETHODTABLE(SCA_RandomActuator, setBoolConst),
KX_PYMETHODTABLE_NOARGS(SCA_RandomActuator, setBoolUniform), KX_PYMETHODTABLE_NOARGS(SCA_RandomActuator, setBoolUniform),
@@ -407,7 +407,7 @@ const char SCA_RandomActuator::SetSeed_doc[] =
"\tSet the initial seed of the generator. Equal seeds produce\n" "\tSet the initial seed of the generator. Equal seeds produce\n"
"\tequal series. If the seed is 0, the generator will produce\n" "\tequal series. If the seed is 0, the generator will produce\n"
"\tthe same value on every call.\n"; "\tthe same value on every call.\n";
PyObject* SCA_RandomActuator::PySetSeed(PyObject* self, PyObject* args, PyObject* kwds) { PyObject* SCA_RandomActuator::PySetSeed(PyObject* args) {
ShowDeprecationWarning("setSeed()", "the seed property"); ShowDeprecationWarning("setSeed()", "the seed property");
long seedArg; long seedArg;
if(!PyArg_ParseTuple(args, "i:setSeed", &seedArg)) { if(!PyArg_ParseTuple(args, "i:setSeed", &seedArg)) {
@@ -423,7 +423,8 @@ const char SCA_RandomActuator::GetSeed_doc[] =
"getSeed()\n" "getSeed()\n"
"\tReturns the initial seed of the generator. Equal seeds produce\n" "\tReturns the initial seed of the generator. Equal seeds produce\n"
"\tequal series.\n"; "\tequal series.\n";
PyObject* SCA_RandomActuator::PyGetSeed(PyObject* self, PyObject* args, PyObject* kwds) { PyObject* SCA_RandomActuator::PyGetSeed()
{
ShowDeprecationWarning("getSeed()", "the seed property"); ShowDeprecationWarning("getSeed()", "the seed property");
return PyInt_FromLong(m_base->GetSeed()); return PyInt_FromLong(m_base->GetSeed());
} }
@@ -434,7 +435,8 @@ const char SCA_RandomActuator::GetPara1_doc[] =
"\tReturns the first parameter of the active distribution. Refer\n" "\tReturns the first parameter of the active distribution. Refer\n"
"\tto the documentation of the generator types for the meaning\n" "\tto the documentation of the generator types for the meaning\n"
"\tof this value."; "\tof this value.";
PyObject* SCA_RandomActuator::PyGetPara1(PyObject* self, PyObject* args, PyObject* kwds) { PyObject* SCA_RandomActuator::PyGetPara1()
{
ShowDeprecationWarning("getPara1()", "the para1 property"); ShowDeprecationWarning("getPara1()", "the para1 property");
return PyFloat_FromDouble(m_parameter1); return PyFloat_FromDouble(m_parameter1);
} }
@@ -445,7 +447,8 @@ const char SCA_RandomActuator::GetPara2_doc[] =
"\tReturns the first parameter of the active distribution. Refer\n" "\tReturns the first parameter of the active distribution. Refer\n"
"\tto the documentation of the generator types for the meaning\n" "\tto the documentation of the generator types for the meaning\n"
"\tof this value."; "\tof this value.";
PyObject* SCA_RandomActuator::PyGetPara2(PyObject* self, PyObject* args, PyObject* kwds) { PyObject* SCA_RandomActuator::PyGetPara2()
{
ShowDeprecationWarning("getPara2()", "the para2 property"); ShowDeprecationWarning("getPara2()", "the para2 property");
return PyFloat_FromDouble(m_parameter2); return PyFloat_FromDouble(m_parameter2);
} }
@@ -454,7 +457,8 @@ PyObject* SCA_RandomActuator::PyGetPara2(PyObject* self, PyObject* args, PyObjec
const char SCA_RandomActuator::GetDistribution_doc[] = const char SCA_RandomActuator::GetDistribution_doc[] =
"getDistribution()\n" "getDistribution()\n"
"\tReturns the type of the active distribution.\n"; "\tReturns the type of the active distribution.\n";
PyObject* SCA_RandomActuator::PyGetDistribution(PyObject* self, PyObject* args, PyObject* kwds) { PyObject* SCA_RandomActuator::PyGetDistribution()
{
ShowDeprecationWarning("getDistribution()", "the distribution property"); ShowDeprecationWarning("getDistribution()", "the distribution property");
return PyInt_FromLong(m_distribution); return PyInt_FromLong(m_distribution);
} }
@@ -465,7 +469,7 @@ const char SCA_RandomActuator::SetProperty_doc[] =
"\t- name: string\n" "\t- name: string\n"
"\tSet the property to which the random value is assigned. If the \n" "\tSet the property to which the random value is assigned. If the \n"
"\tgenerator and property types do not match, the assignment is ignored.\n"; "\tgenerator and property types do not match, the assignment is ignored.\n";
PyObject* SCA_RandomActuator::PySetProperty(PyObject* self, PyObject* args, PyObject* kwds) { PyObject* SCA_RandomActuator::PySetProperty(PyObject* args) {
ShowDeprecationWarning("setProperty()", "the 'property' property"); ShowDeprecationWarning("setProperty()", "the 'property' property");
char *nameArg; char *nameArg;
if (!PyArg_ParseTuple(args, "s:setProperty", &nameArg)) { if (!PyArg_ParseTuple(args, "s:setProperty", &nameArg)) {
@@ -488,7 +492,8 @@ const char SCA_RandomActuator::GetProperty_doc[] =
"getProperty(name)\n" "getProperty(name)\n"
"\tReturn the property to which the random value is assigned. If the \n" "\tReturn the property to which the random value is assigned. If the \n"
"\tgenerator and property types do not match, the assignment is ignored.\n"; "\tgenerator and property types do not match, the assignment is ignored.\n";
PyObject* SCA_RandomActuator::PyGetProperty(PyObject* self, PyObject* args, PyObject* kwds) { PyObject* SCA_RandomActuator::PyGetProperty()
{
ShowDeprecationWarning("getProperty()", "the 'property' property"); ShowDeprecationWarning("getProperty()", "the 'property' property");
return PyString_FromString(m_propname); return PyString_FromString(m_propname);
} }

View File

@@ -103,13 +103,13 @@ class SCA_RandomActuator : public SCA_IActuator
static int pyattr_set_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); static int pyattr_set_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
// Deprecated methods -----> // Deprecated methods ----->
KX_PYMETHOD_DOC(SCA_RandomActuator,SetSeed); KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator,SetSeed);
KX_PYMETHOD_DOC(SCA_RandomActuator,GetSeed); KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetSeed);
KX_PYMETHOD_DOC(SCA_RandomActuator,GetPara1); KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetPara1);
KX_PYMETHOD_DOC(SCA_RandomActuator,GetPara2); KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetPara2);
KX_PYMETHOD_DOC(SCA_RandomActuator,GetDistribution); KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetDistribution);
KX_PYMETHOD_DOC(SCA_RandomActuator,SetProperty); KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator,SetProperty);
KX_PYMETHOD_DOC(SCA_RandomActuator,GetProperty); KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetProperty);
// <----- // <-----
KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator, setBoolConst); KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator, setBoolConst);

View File

@@ -155,8 +155,8 @@ PyParentObject SCA_RandomSensor::Parents[] = {
PyMethodDef SCA_RandomSensor::Methods[] = { PyMethodDef SCA_RandomSensor::Methods[] = {
{"setSeed", (PyCFunction) SCA_RandomSensor::sPySetSeed, METH_VARARGS, (PY_METHODCHAR)SetSeed_doc}, {"setSeed", (PyCFunction) SCA_RandomSensor::sPySetSeed, METH_VARARGS, (PY_METHODCHAR)SetSeed_doc},
{"getSeed", (PyCFunction) SCA_RandomSensor::sPyGetSeed, METH_VARARGS, (PY_METHODCHAR)GetSeed_doc}, {"getSeed", (PyCFunction) SCA_RandomSensor::sPyGetSeed, METH_NOARGS, (PY_METHODCHAR)GetSeed_doc},
{"getLastDraw", (PyCFunction) SCA_RandomSensor::sPyGetLastDraw, METH_VARARGS, (PY_METHODCHAR)GetLastDraw_doc}, {"getLastDraw", (PyCFunction) SCA_RandomSensor::sPyGetLastDraw, METH_NOARGS, (PY_METHODCHAR)GetLastDraw_doc},
{NULL,NULL} //Sentinel {NULL,NULL} //Sentinel
}; };
@@ -182,7 +182,7 @@ const char SCA_RandomSensor::SetSeed_doc[] =
"\tSet the initial seed of the generator. Equal seeds produce\n" "\tSet the initial seed of the generator. Equal seeds produce\n"
"\tequal series. If the seed is 0, the generator will produce\n" "\tequal series. If the seed is 0, the generator will produce\n"
"\tthe same value on every call.\n"; "\tthe same value on every call.\n";
PyObject* SCA_RandomSensor::PySetSeed(PyObject* self, PyObject* args, PyObject* kwds) { PyObject* SCA_RandomSensor::PySetSeed(PyObject* args) {
ShowDeprecationWarning("setSeed()", "the seed property"); ShowDeprecationWarning("setSeed()", "the seed property");
long seedArg; long seedArg;
if(!PyArg_ParseTuple(args, "i:setSeed", &seedArg)) { if(!PyArg_ParseTuple(args, "i:setSeed", &seedArg)) {
@@ -199,7 +199,7 @@ const char SCA_RandomSensor::GetSeed_doc[] =
"getSeed()\n" "getSeed()\n"
"\tReturns the initial seed of the generator. Equal seeds produce\n" "\tReturns the initial seed of the generator. Equal seeds produce\n"
"\tequal series.\n"; "\tequal series.\n";
PyObject* SCA_RandomSensor::PyGetSeed(PyObject* self, PyObject* args, PyObject* kwds) { PyObject* SCA_RandomSensor::PyGetSeed() {
ShowDeprecationWarning("getSeed()", "the seed property"); ShowDeprecationWarning("getSeed()", "the seed property");
return PyInt_FromLong(m_basegenerator->GetSeed()); return PyInt_FromLong(m_basegenerator->GetSeed());
} }
@@ -208,7 +208,7 @@ PyObject* SCA_RandomSensor::PyGetSeed(PyObject* self, PyObject* args, PyObject*
const char SCA_RandomSensor::GetLastDraw_doc[] = const char SCA_RandomSensor::GetLastDraw_doc[] =
"getLastDraw()\n" "getLastDraw()\n"
"\tReturn the last value that was drawn.\n"; "\tReturn the last value that was drawn.\n";
PyObject* SCA_RandomSensor::PyGetLastDraw(PyObject* self, PyObject* args, PyObject* kwds) { PyObject* SCA_RandomSensor::PyGetLastDraw() {
ShowDeprecationWarning("getLastDraw()", "the lastDraw property"); ShowDeprecationWarning("getLastDraw()", "the lastDraw property");
return PyInt_FromLong(m_lastdraw); return PyInt_FromLong(m_lastdraw);
} }

View File

@@ -64,11 +64,11 @@ public:
virtual int py_setattro(PyObject *attr, PyObject *value); virtual int py_setattro(PyObject *attr, PyObject *value);
/* 1. setSeed */ /* 1. setSeed */
KX_PYMETHOD_DOC(SCA_RandomSensor,SetSeed); KX_PYMETHOD_DOC_VARARGS(SCA_RandomSensor,SetSeed);
/* 2. getSeed */ /* 2. getSeed */
KX_PYMETHOD_DOC(SCA_RandomSensor,GetSeed); KX_PYMETHOD_DOC_NOARGS(SCA_RandomSensor,GetSeed);
/* 3. getSeed */ /* 3. getLastDraw */
KX_PYMETHOD_DOC(SCA_RandomSensor,GetLastDraw); KX_PYMETHOD_DOC_NOARGS(SCA_RandomSensor,GetLastDraw);
static PyObject* pyattr_get_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_set_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); static int pyattr_set_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);

View File

@@ -164,7 +164,6 @@ int KX_NetworkMessageActuator::py_setattro(PyObject *attr, PyObject *value) {
// Deprecated -----> // Deprecated ----->
// 1. SetToPropName // 1. SetToPropName
PyObject* KX_NetworkMessageActuator::PySetToPropName( PyObject* KX_NetworkMessageActuator::PySetToPropName(
PyObject* self,
PyObject* args, PyObject* args,
PyObject* kwds) PyObject* kwds)
{ {
@@ -183,7 +182,6 @@ PyObject* KX_NetworkMessageActuator::PySetToPropName(
// 2. SetSubject // 2. SetSubject
PyObject* KX_NetworkMessageActuator::PySetSubject( PyObject* KX_NetworkMessageActuator::PySetSubject(
PyObject* self,
PyObject* args, PyObject* args,
PyObject* kwds) PyObject* kwds)
{ {
@@ -202,7 +200,6 @@ PyObject* KX_NetworkMessageActuator::PySetSubject(
// 3. SetBodyType // 3. SetBodyType
PyObject* KX_NetworkMessageActuator::PySetBodyType( PyObject* KX_NetworkMessageActuator::PySetBodyType(
PyObject* self,
PyObject* args, PyObject* args,
PyObject* kwds) PyObject* kwds)
{ {
@@ -221,7 +218,6 @@ PyObject* KX_NetworkMessageActuator::PySetBodyType(
// 4. SetBody // 4. SetBody
PyObject* KX_NetworkMessageActuator::PySetBody( PyObject* KX_NetworkMessageActuator::PySetBody(
PyObject* self,
PyObject* args, PyObject* args,
PyObject* kwds) PyObject* kwds)
{ {

View File

@@ -257,7 +257,7 @@ const char KX_NetworkMessageSensor::SetSubjectFilterText_doc[] =
"\tsetSubjectFilterText(value)\n" "\tsetSubjectFilterText(value)\n"
"\tChange the message subject text that this sensor is listening to.\n"; "\tChange the message subject text that this sensor is listening to.\n";
PyObject* KX_NetworkMessageSensor::PySetSubjectFilterText( PyObject* self, PyObject* value) PyObject* KX_NetworkMessageSensor::PySetSubjectFilterText(PyObject* value)
{ {
ShowDeprecationWarning("setSubjectFilterText()", "subject"); ShowDeprecationWarning("setSubjectFilterText()", "subject");
char* Subject = PyString_AsString(value); char* Subject = PyString_AsString(value);
@@ -275,7 +275,7 @@ const char KX_NetworkMessageSensor::GetFrameMessageCount_doc[] =
"\tgetFrameMessageCount()\n" "\tgetFrameMessageCount()\n"
"\tGet the number of messages received since the last frame.\n"; "\tGet the number of messages received since the last frame.\n";
PyObject* KX_NetworkMessageSensor::PyGetFrameMessageCount( PyObject* ) PyObject* KX_NetworkMessageSensor::PyGetFrameMessageCount()
{ {
ShowDeprecationWarning("getFrameMessageCount()", "frameMessageCount"); ShowDeprecationWarning("getFrameMessageCount()", "frameMessageCount");
return PyInt_FromLong(long(m_frame_message_count)); return PyInt_FromLong(long(m_frame_message_count));
@@ -286,7 +286,7 @@ const char KX_NetworkMessageSensor::GetBodies_doc[] =
"\tgetBodies()\n" "\tgetBodies()\n"
"\tGet the list of message bodies.\n"; "\tGet the list of message bodies.\n";
PyObject* KX_NetworkMessageSensor::PyGetBodies( PyObject* ) PyObject* KX_NetworkMessageSensor::PyGetBodies()
{ {
ShowDeprecationWarning("getBodies()", "bodies"); ShowDeprecationWarning("getBodies()", "bodies");
if (m_BodyList) { if (m_BodyList) {
@@ -301,7 +301,7 @@ const char KX_NetworkMessageSensor::GetSubject_doc[] =
"\tgetSubject()\n" "\tgetSubject()\n"
"\tGet the subject: field of the message sensor.\n"; "\tGet the subject: field of the message sensor.\n";
PyObject* KX_NetworkMessageSensor::PyGetSubject( PyObject* ) PyObject* KX_NetworkMessageSensor::PyGetSubject()
{ {
ShowDeprecationWarning("getSubject()", "subject"); ShowDeprecationWarning("getSubject()", "subject");
return PyString_FromString(m_subject ? m_subject : ""); return PyString_FromString(m_subject ? m_subject : "");
@@ -312,7 +312,7 @@ const char KX_NetworkMessageSensor::GetSubjects_doc[] =
"\tgetSubjects()\n" "\tgetSubjects()\n"
"\tGet list of message subjects.\n"; "\tGet list of message subjects.\n";
PyObject* KX_NetworkMessageSensor::PyGetSubjects( PyObject* ) PyObject* KX_NetworkMessageSensor::PyGetSubjects()
{ {
ShowDeprecationWarning("getSubjects()", "subjects"); ShowDeprecationWarning("getSubjects()", "subjects");
if (m_SubjectList) { if (m_SubjectList) {

View File

@@ -289,7 +289,7 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_CDActuator, playAll,
} }
// Deprecated -----> // Deprecated ----->
PyObject* KX_CDActuator::PySetGain(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_CDActuator::PySetGain(PyObject* args)
{ {
float gain = 1.0; float gain = 1.0;
ShowDeprecationWarning("setGain()", "the volume property"); ShowDeprecationWarning("setGain()", "the volume property");
@@ -303,7 +303,7 @@ PyObject* KX_CDActuator::PySetGain(PyObject* self, PyObject* args, PyObject* kwd
PyObject* KX_CDActuator::PyGetGain(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_CDActuator::PyGetGain(PyObject* args)
{ {
float gain = SND_CDObject::Instance()->GetGain(); float gain = SND_CDObject::Instance()->GetGain();
ShowDeprecationWarning("getGain()", "the volume property"); ShowDeprecationWarning("getGain()", "the volume property");

View File

@@ -85,8 +85,8 @@ public:
virtual int py_setattro(PyObject *attr, PyObject *value); virtual int py_setattro(PyObject *attr, PyObject *value);
// Deprecated -----> // Deprecated ----->
KX_PYMETHOD(KX_CDActuator,SetGain); KX_PYMETHOD_VARARGS(KX_CDActuator,SetGain);
KX_PYMETHOD(KX_CDActuator,GetGain); KX_PYMETHOD_VARARGS(KX_CDActuator,GetGain);
// <----- // <-----
KX_PYMETHOD_DOC_NOARGS(KX_CDActuator, startCD); KX_PYMETHOD_DOC_NOARGS(KX_CDActuator, startCD);

View File

@@ -408,7 +408,7 @@ PyMethodDef KX_CameraActuator::Methods[] = {
{"setHeight",(PyCFunction) KX_CameraActuator::sPySetHeight, METH_VARARGS, (PY_METHODCHAR)SetHeight_doc}, {"setHeight",(PyCFunction) KX_CameraActuator::sPySetHeight, METH_VARARGS, (PY_METHODCHAR)SetHeight_doc},
{"getHeight",(PyCFunction) KX_CameraActuator::sPyGetHeight, METH_NOARGS, (PY_METHODCHAR)GetHeight_doc}, {"getHeight",(PyCFunction) KX_CameraActuator::sPyGetHeight, METH_NOARGS, (PY_METHODCHAR)GetHeight_doc},
{"setXY" ,(PyCFunction) KX_CameraActuator::sPySetXY, METH_VARARGS, (PY_METHODCHAR)SetXY_doc}, {"setXY" ,(PyCFunction) KX_CameraActuator::sPySetXY, METH_VARARGS, (PY_METHODCHAR)SetXY_doc},
{"getXY" ,(PyCFunction) KX_CameraActuator::sPyGetXY, METH_VARARGS, (PY_METHODCHAR)GetXY_doc}, {"getXY" ,(PyCFunction) KX_CameraActuator::sPyGetXY, METH_NOARGS, (PY_METHODCHAR)GetXY_doc},
{NULL,NULL,NULL,NULL} //Sentinel {NULL,NULL,NULL,NULL} //Sentinel
}; };
@@ -434,7 +434,7 @@ const char KX_CameraActuator::GetObject_doc[] =
"getObject(name_only = 1)\n" "getObject(name_only = 1)\n"
"name_only - optional arg, when true will return the KX_GameObject rather then its name\n" "name_only - optional arg, when true will return the KX_GameObject rather then its name\n"
"\tReturns the object this sensor reacts to.\n"; "\tReturns the object this sensor reacts to.\n";
PyObject* KX_CameraActuator::PyGetObject(PyObject* self, PyObject* args) PyObject* KX_CameraActuator::PyGetObject(PyObject* args)
{ {
int ret_name_only = 1; int ret_name_only = 1;
@@ -456,7 +456,7 @@ const char KX_CameraActuator::SetObject_doc[] =
"setObject(object)\n" "setObject(object)\n"
"\t- object: KX_GameObject, string or None\n" "\t- object: KX_GameObject, string or None\n"
"\tSets the object this sensor reacts to.\n"; "\tSets the object this sensor reacts to.\n";
PyObject* KX_CameraActuator::PySetObject(PyObject* self, PyObject* value) PyObject* KX_CameraActuator::PySetObject(PyObject* value)
{ {
KX_GameObject *gameobj; KX_GameObject *gameobj;
@@ -479,9 +479,7 @@ PyObject* KX_CameraActuator::PySetObject(PyObject* self, PyObject* value)
const char KX_CameraActuator::GetMin_doc[] = const char KX_CameraActuator::GetMin_doc[] =
"getMin\n" "getMin\n"
"\tReturns the minimum value set in the Min: field.\n"; "\tReturns the minimum value set in the Min: field.\n";
PyObject* KX_CameraActuator::PyGetMin(PyObject* self, PyObject* KX_CameraActuator::PyGetMin()
PyObject* args,
PyObject* kwds)
{ {
ShowDeprecationWarning("getMin()", "the min property"); ShowDeprecationWarning("getMin()", "the min property");
return PyFloat_FromDouble(m_minHeight); return PyFloat_FromDouble(m_minHeight);
@@ -490,9 +488,7 @@ PyObject* KX_CameraActuator::PyGetMin(PyObject* self,
const char KX_CameraActuator::SetMin_doc[] = const char KX_CameraActuator::SetMin_doc[] =
"setMin\n" "setMin\n"
"\tSets the minimum value.\n"; "\tSets the minimum value.\n";
PyObject* KX_CameraActuator::PySetMin(PyObject* self, PyObject* KX_CameraActuator::PySetMin(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
ShowDeprecationWarning("setMin()", "the min property"); ShowDeprecationWarning("setMin()", "the min property");
float min; float min;
@@ -507,9 +503,7 @@ PyObject* KX_CameraActuator::PySetMin(PyObject* self,
const char KX_CameraActuator::GetMax_doc[] = const char KX_CameraActuator::GetMax_doc[] =
"getMax\n" "getMax\n"
"\tReturns the maximum value set in the Max: field.\n"; "\tReturns the maximum value set in the Max: field.\n";
PyObject* KX_CameraActuator::PyGetMax(PyObject* self, PyObject* KX_CameraActuator::PyGetMax()
PyObject* args,
PyObject* kwds)
{ {
ShowDeprecationWarning("getMax()", "the max property"); ShowDeprecationWarning("getMax()", "the max property");
return PyFloat_FromDouble(m_maxHeight); return PyFloat_FromDouble(m_maxHeight);
@@ -518,9 +512,7 @@ PyObject* KX_CameraActuator::PyGetMax(PyObject* self,
const char KX_CameraActuator::SetMax_doc[] = const char KX_CameraActuator::SetMax_doc[] =
"setMax\n" "setMax\n"
"\tSets the maximum value.\n"; "\tSets the maximum value.\n";
PyObject* KX_CameraActuator::PySetMax(PyObject* self, PyObject* KX_CameraActuator::PySetMax(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
ShowDeprecationWarning("getMax()", "the max property"); ShowDeprecationWarning("getMax()", "the max property");
float max; float max;
@@ -535,9 +527,7 @@ PyObject* KX_CameraActuator::PySetMax(PyObject* self,
const char KX_CameraActuator::GetHeight_doc[] = const char KX_CameraActuator::GetHeight_doc[] =
"getHeight\n" "getHeight\n"
"\tReturns the height value set in the height: field.\n"; "\tReturns the height value set in the height: field.\n";
PyObject* KX_CameraActuator::PyGetHeight(PyObject* self, PyObject* KX_CameraActuator::PyGetHeight()
PyObject* args,
PyObject* kwds)
{ {
ShowDeprecationWarning("getHeight()", "the height property"); ShowDeprecationWarning("getHeight()", "the height property");
return PyFloat_FromDouble(m_height); return PyFloat_FromDouble(m_height);
@@ -546,9 +536,7 @@ PyObject* KX_CameraActuator::PyGetHeight(PyObject* self,
const char KX_CameraActuator::SetHeight_doc[] = const char KX_CameraActuator::SetHeight_doc[] =
"setHeight\n" "setHeight\n"
"\tSets the height value.\n"; "\tSets the height value.\n";
PyObject* KX_CameraActuator::PySetHeight(PyObject* self, PyObject* KX_CameraActuator::PySetHeight(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
ShowDeprecationWarning("getHeight()", "the height property"); ShowDeprecationWarning("getHeight()", "the height property");
float height; float height;
@@ -564,9 +552,7 @@ const char KX_CameraActuator::SetXY_doc[] =
"setXY\n" "setXY\n"
"\tSets axis the camera tries to get behind.\n" "\tSets axis the camera tries to get behind.\n"
"\t1=x, 0=y\n"; "\t1=x, 0=y\n";
PyObject* KX_CameraActuator::PySetXY(PyObject* self, PyObject* KX_CameraActuator::PySetXY(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
ShowDeprecationWarning("setXY()", "the xy property"); ShowDeprecationWarning("setXY()", "the xy property");
int value; int value;
@@ -583,9 +569,7 @@ const char KX_CameraActuator::GetXY_doc[] =
"getXY\n" "getXY\n"
"\tGets the axis the camera tries to get behind.\n" "\tGets the axis the camera tries to get behind.\n"
"\tTrue = X, False = Y\n"; "\tTrue = X, False = Y\n";
PyObject* KX_CameraActuator::PyGetXY(PyObject* self, PyObject* KX_CameraActuator::PyGetXY()
PyObject* args,
PyObject* kwds)
{ {
ShowDeprecationWarning("getXY()", "the xy property"); ShowDeprecationWarning("getXY()", "the xy property");
return PyInt_FromLong(m_x); return PyInt_FromLong(m_x);

View File

@@ -127,14 +127,14 @@ private :
KX_PYMETHOD_DOC_O(KX_CameraActuator,SetObject); KX_PYMETHOD_DOC_O(KX_CameraActuator,SetObject);
/* get current object */ /* get current object */
KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,GetObject); KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,GetObject);
KX_PYMETHOD_DOC(KX_CameraActuator,SetMin); KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetMin);
KX_PYMETHOD_DOC(KX_CameraActuator,GetMin); KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetMin);
KX_PYMETHOD_DOC(KX_CameraActuator,SetMax); KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetMax);
KX_PYMETHOD_DOC(KX_CameraActuator,GetMax); KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetMax);
KX_PYMETHOD_DOC(KX_CameraActuator,SetHeight); KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetHeight);
KX_PYMETHOD_DOC(KX_CameraActuator,GetHeight); KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetHeight);
KX_PYMETHOD_DOC(KX_CameraActuator,SetXY); KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetXY);
KX_PYMETHOD_DOC(KX_CameraActuator,GetXY); KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetXY);
static PyObject* pyattr_get_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_set_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); static int pyattr_set_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);

View File

@@ -665,9 +665,7 @@ const char KX_ConstraintActuator::SetDamp_doc[] =
"\t- duration: integer\n" "\t- duration: integer\n"
"\tSets the time constant of the orientation and distance constraint.\n" "\tSets the time constant of the orientation and distance constraint.\n"
"\tIf the duration is negative, it is set to 0.\n"; "\tIf the duration is negative, it is set to 0.\n";
PyObject* KX_ConstraintActuator::PySetDamp(PyObject* self, PyObject* KX_ConstraintActuator::PySetDamp(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setDamp()", "the damp property"); ShowDeprecationWarning("setDamp()", "the damp property");
int dampArg; int dampArg;
if(!PyArg_ParseTuple(args, "i:setDamp", &dampArg)) { if(!PyArg_ParseTuple(args, "i:setDamp", &dampArg)) {
@@ -683,7 +681,7 @@ PyObject* KX_ConstraintActuator::PySetDamp(PyObject* self,
const char KX_ConstraintActuator::GetDamp_doc[] = const char KX_ConstraintActuator::GetDamp_doc[] =
"getDamp()\n" "getDamp()\n"
"\tReturns the damping parameter.\n"; "\tReturns the damping parameter.\n";
PyObject* KX_ConstraintActuator::PyGetDamp(PyObject* self){ PyObject* KX_ConstraintActuator::PyGetDamp(){
ShowDeprecationWarning("getDamp()", "the damp property"); ShowDeprecationWarning("getDamp()", "the damp property");
return PyInt_FromLong(m_posDampTime); return PyInt_FromLong(m_posDampTime);
} }
@@ -694,9 +692,7 @@ const char KX_ConstraintActuator::SetRotDamp_doc[] =
"\t- duration: integer\n" "\t- duration: integer\n"
"\tSets the time constant of the orientation constraint.\n" "\tSets the time constant of the orientation constraint.\n"
"\tIf the duration is negative, it is set to 0.\n"; "\tIf the duration is negative, it is set to 0.\n";
PyObject* KX_ConstraintActuator::PySetRotDamp(PyObject* self, PyObject* KX_ConstraintActuator::PySetRotDamp(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setRotDamp()", "the rotDamp property"); ShowDeprecationWarning("setRotDamp()", "the rotDamp property");
int dampArg; int dampArg;
if(!PyArg_ParseTuple(args, "i:setRotDamp", &dampArg)) { if(!PyArg_ParseTuple(args, "i:setRotDamp", &dampArg)) {
@@ -712,7 +708,7 @@ PyObject* KX_ConstraintActuator::PySetRotDamp(PyObject* self,
const char KX_ConstraintActuator::GetRotDamp_doc[] = const char KX_ConstraintActuator::GetRotDamp_doc[] =
"getRotDamp()\n" "getRotDamp()\n"
"\tReturns the damping time for application of the constraint.\n"; "\tReturns the damping time for application of the constraint.\n";
PyObject* KX_ConstraintActuator::PyGetRotDamp(PyObject* self){ PyObject* KX_ConstraintActuator::PyGetRotDamp(){
ShowDeprecationWarning("getRotDamp()", "the rotDamp property"); ShowDeprecationWarning("getRotDamp()", "the rotDamp property");
return PyInt_FromLong(m_rotDampTime); return PyInt_FromLong(m_rotDampTime);
} }
@@ -722,9 +718,7 @@ const char KX_ConstraintActuator::SetDirection_doc[] =
"setDirection(vector)\n" "setDirection(vector)\n"
"\t- vector: 3-tuple\n" "\t- vector: 3-tuple\n"
"\tSets the reference direction in world coordinate for the orientation constraint.\n"; "\tSets the reference direction in world coordinate for the orientation constraint.\n";
PyObject* KX_ConstraintActuator::PySetDirection(PyObject* self, PyObject* KX_ConstraintActuator::PySetDirection(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setDirection()", "the direction property"); ShowDeprecationWarning("setDirection()", "the direction property");
float x, y, z; float x, y, z;
MT_Scalar len; MT_Scalar len;
@@ -752,7 +746,7 @@ PyObject* KX_ConstraintActuator::PySetDirection(PyObject* self,
const char KX_ConstraintActuator::GetDirection_doc[] = const char KX_ConstraintActuator::GetDirection_doc[] =
"getDirection()\n" "getDirection()\n"
"\tReturns the reference direction of the orientation constraint as a 3-tuple.\n"; "\tReturns the reference direction of the orientation constraint as a 3-tuple.\n";
PyObject* KX_ConstraintActuator::PyGetDirection(PyObject* self){ PyObject* KX_ConstraintActuator::PyGetDirection(){
ShowDeprecationWarning("getDirection()", "the direction property"); ShowDeprecationWarning("getDirection()", "the direction property");
PyObject *retVal = PyList_New(3); PyObject *retVal = PyList_New(3);
@@ -772,9 +766,7 @@ const char KX_ConstraintActuator::SetOption_doc[] =
"\t\t128 : Detect material rather than property\n" "\t\t128 : Detect material rather than property\n"
"\t\t256 : No deactivation if ray does not hit target\n" "\t\t256 : No deactivation if ray does not hit target\n"
"\t\t512 : Activate distance control\n"; "\t\t512 : Activate distance control\n";
PyObject* KX_ConstraintActuator::PySetOption(PyObject* self, PyObject* KX_ConstraintActuator::PySetOption(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setOption()", "the option property"); ShowDeprecationWarning("setOption()", "the option property");
int option; int option;
if(!PyArg_ParseTuple(args, "i:setOption", &option)) { if(!PyArg_ParseTuple(args, "i:setOption", &option)) {
@@ -789,7 +781,7 @@ PyObject* KX_ConstraintActuator::PySetOption(PyObject* self,
const char KX_ConstraintActuator::GetOption_doc[] = const char KX_ConstraintActuator::GetOption_doc[] =
"getOption()\n" "getOption()\n"
"\tReturns the option parameter.\n"; "\tReturns the option parameter.\n";
PyObject* KX_ConstraintActuator::PyGetOption(PyObject* self){ PyObject* KX_ConstraintActuator::PyGetOption(){
ShowDeprecationWarning("getOption()", "the option property"); ShowDeprecationWarning("getOption()", "the option property");
return PyInt_FromLong(m_option); return PyInt_FromLong(m_option);
} }
@@ -801,9 +793,7 @@ const char KX_ConstraintActuator::SetTime_doc[] =
"\tSets the activation time of the actuator.\n" "\tSets the activation time of the actuator.\n"
"\tThe actuator disables itself after this many frame.\n" "\tThe actuator disables itself after this many frame.\n"
"\tIf set to 0 or negative, the actuator is not limited in time.\n"; "\tIf set to 0 or negative, the actuator is not limited in time.\n";
PyObject* KX_ConstraintActuator::PySetTime(PyObject* self, PyObject* KX_ConstraintActuator::PySetTime(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setTime()", "the time property"); ShowDeprecationWarning("setTime()", "the time property");
int t; int t;
if(!PyArg_ParseTuple(args, "i:setTime", &t)) { if(!PyArg_ParseTuple(args, "i:setTime", &t)) {
@@ -820,7 +810,7 @@ PyObject* KX_ConstraintActuator::PySetTime(PyObject* self,
const char KX_ConstraintActuator::GetTime_doc[] = const char KX_ConstraintActuator::GetTime_doc[] =
"getTime()\n" "getTime()\n"
"\tReturns the time parameter.\n"; "\tReturns the time parameter.\n";
PyObject* KX_ConstraintActuator::PyGetTime(PyObject* self){ PyObject* KX_ConstraintActuator::PyGetTime(){
ShowDeprecationWarning("getTime()", "the time property"); ShowDeprecationWarning("getTime()", "the time property");
return PyInt_FromLong(m_activeTime); return PyInt_FromLong(m_activeTime);
} }
@@ -831,9 +821,7 @@ const char KX_ConstraintActuator::SetProperty_doc[] =
"\t- property: string\n" "\t- property: string\n"
"\tSets the name of the property or material for the ray detection of the distance constraint.\n" "\tSets the name of the property or material for the ray detection of the distance constraint.\n"
"\tIf empty, the ray will detect any collisioning object.\n"; "\tIf empty, the ray will detect any collisioning object.\n";
PyObject* KX_ConstraintActuator::PySetProperty(PyObject* self, PyObject* KX_ConstraintActuator::PySetProperty(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setProperty()", "the 'property' property"); ShowDeprecationWarning("setProperty()", "the 'property' property");
char *property; char *property;
if (!PyArg_ParseTuple(args, "s:setProperty", &property)) { if (!PyArg_ParseTuple(args, "s:setProperty", &property)) {
@@ -851,7 +839,7 @@ PyObject* KX_ConstraintActuator::PySetProperty(PyObject* self,
const char KX_ConstraintActuator::GetProperty_doc[] = const char KX_ConstraintActuator::GetProperty_doc[] =
"getProperty()\n" "getProperty()\n"
"\tReturns the property parameter.\n"; "\tReturns the property parameter.\n";
PyObject* KX_ConstraintActuator::PyGetProperty(PyObject* self){ PyObject* KX_ConstraintActuator::PyGetProperty(){
ShowDeprecationWarning("getProperty()", "the 'property' property"); ShowDeprecationWarning("getProperty()", "the 'property' property");
return PyString_FromString(m_property.Ptr()); return PyString_FromString(m_property.Ptr());
} }
@@ -867,9 +855,7 @@ const char KX_ConstraintActuator::SetMin_doc[] =
"\t- lower_bound: float\n" "\t- lower_bound: float\n"
"\tSets the lower value of the interval to which the value\n" "\tSets the lower value of the interval to which the value\n"
"\tis clipped.\n"; "\tis clipped.\n";
PyObject* KX_ConstraintActuator::PySetMin(PyObject* self, PyObject* KX_ConstraintActuator::PySetMin(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setMin() or setDistance()", "the min or distance property"); ShowDeprecationWarning("setMin() or setDistance()", "the min or distance property");
float minArg; float minArg;
if(!PyArg_ParseTuple(args, "f:setMin", &minArg)) { if(!PyArg_ParseTuple(args, "f:setMin", &minArg)) {
@@ -898,7 +884,7 @@ const char KX_ConstraintActuator::GetMin_doc[] =
"getMin()\n" "getMin()\n"
"\tReturns the lower value of the interval to which the value\n" "\tReturns the lower value of the interval to which the value\n"
"\tis clipped.\n"; "\tis clipped.\n";
PyObject* KX_ConstraintActuator::PyGetMin(PyObject* self) { PyObject* KX_ConstraintActuator::PyGetMin() {
ShowDeprecationWarning("getMin() or getDistance()", "the min or distance property"); ShowDeprecationWarning("getMin() or getDistance()", "the min or distance property");
return PyFloat_FromDouble(m_minimumBound); return PyFloat_FromDouble(m_minimumBound);
} }
@@ -914,9 +900,7 @@ const char KX_ConstraintActuator::SetMax_doc[] =
"\t- upper_bound: float\n" "\t- upper_bound: float\n"
"\tSets the upper value of the interval to which the value\n" "\tSets the upper value of the interval to which the value\n"
"\tis clipped.\n"; "\tis clipped.\n";
PyObject* KX_ConstraintActuator::PySetMax(PyObject* self, PyObject* KX_ConstraintActuator::PySetMax(PyObject* args){
PyObject* args,
PyObject* kwds){
ShowDeprecationWarning("setMax() or setRayLength()", "the max or rayLength property"); ShowDeprecationWarning("setMax() or setRayLength()", "the max or rayLength property");
float maxArg; float maxArg;
if(!PyArg_ParseTuple(args, "f:setMax", &maxArg)) { if(!PyArg_ParseTuple(args, "f:setMax", &maxArg)) {
@@ -945,7 +929,7 @@ const char KX_ConstraintActuator::GetMax_doc[] =
"getMax()\n" "getMax()\n"
"\tReturns the upper value of the interval to which the value\n" "\tReturns the upper value of the interval to which the value\n"
"\tis clipped.\n"; "\tis clipped.\n";
PyObject* KX_ConstraintActuator::PyGetMax(PyObject* self) { PyObject* KX_ConstraintActuator::PyGetMax() {
ShowDeprecationWarning("getMax() or getRayLength()", "the max or rayLength property"); ShowDeprecationWarning("getMax() or getRayLength()", "the max or rayLength property");
return PyFloat_FromDouble(m_maximumBound); return PyFloat_FromDouble(m_maximumBound);
} }
@@ -969,9 +953,7 @@ const char KX_ConstraintActuator::SetLimit_doc[] =
"\t 14 : Align Y axis\n" "\t 14 : Align Y axis\n"
"\t 15 : Align Z axis\n" "\t 15 : Align Z axis\n"
"\tSets the type of constraint.\n"; "\tSets the type of constraint.\n";
PyObject* KX_ConstraintActuator::PySetLimit(PyObject* self, PyObject* KX_ConstraintActuator::PySetLimit(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setLimit()", "the limit property"); ShowDeprecationWarning("setLimit()", "the limit property");
int locrotArg; int locrotArg;
if(!PyArg_ParseTuple(args, "i:setLimit", &locrotArg)) { if(!PyArg_ParseTuple(args, "i:setLimit", &locrotArg)) {
@@ -986,7 +968,7 @@ PyObject* KX_ConstraintActuator::PySetLimit(PyObject* self,
const char KX_ConstraintActuator::GetLimit_doc[] = const char KX_ConstraintActuator::GetLimit_doc[] =
"getLimit()\n" "getLimit()\n"
"\tReturns the type of constraint.\n"; "\tReturns the type of constraint.\n";
PyObject* KX_ConstraintActuator::PyGetLimit(PyObject* self) { PyObject* KX_ConstraintActuator::PyGetLimit() {
ShowDeprecationWarning("setLimit()", "the limit property"); ShowDeprecationWarning("setLimit()", "the limit property");
return PyInt_FromLong(m_locrot); return PyInt_FromLong(m_locrot);
} }

View File

@@ -149,27 +149,27 @@ protected:
static int pyattr_check_direction(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_check_direction(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_check_min(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_check_min(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
KX_PYMETHOD_DOC(KX_ConstraintActuator,SetDamp); KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetDamp);
KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetDamp); KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetDamp);
KX_PYMETHOD_DOC(KX_ConstraintActuator,SetRotDamp); KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetRotDamp);
KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetRotDamp); KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetRotDamp);
KX_PYMETHOD_DOC(KX_ConstraintActuator,SetDirection); KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetDirection);
KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetDirection); KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetDirection);
KX_PYMETHOD_DOC(KX_ConstraintActuator,SetOption); KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetOption);
KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetOption); KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetOption);
KX_PYMETHOD_DOC(KX_ConstraintActuator,SetTime); KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetTime);
KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetTime); KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetTime);
KX_PYMETHOD_DOC(KX_ConstraintActuator,SetProperty); KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetProperty);
KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetProperty); KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetProperty);
KX_PYMETHOD_DOC(KX_ConstraintActuator,SetMin); KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetMin);
KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetMin); KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetMin);
static const char SetDistance_doc[]; static const char SetDistance_doc[];
static const char GetDistance_doc[]; static const char GetDistance_doc[];
KX_PYMETHOD_DOC(KX_ConstraintActuator,SetMax); KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetMax);
KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetMax); KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetMax);
static const char SetRayLength_doc[]; static const char SetRayLength_doc[];
static const char GetRayLength_doc[]; static const char GetRayLength_doc[];
KX_PYMETHOD_DOC(KX_ConstraintActuator,SetLimit); KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetLimit);
KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetLimit); KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetLimit);
}; };

View File

@@ -49,17 +49,12 @@ KX_ConstraintWrapper::~KX_ConstraintWrapper()
{ {
} }
//python integration methods //python integration methods
PyObject* KX_ConstraintWrapper::PyTestMethod(PyObject* self, PyObject* KX_ConstraintWrapper::PyTestMethod(PyObject* args, PyObject* kwds)
PyObject* args,
PyObject* kwds)
{ {
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* KX_ConstraintWrapper::PyGetConstraintId(PyObject* self, PyObject* KX_ConstraintWrapper::PyGetConstraintId(PyObject* args, PyObject* kwds)
PyObject* args,
PyObject* kwds)
{ {
return PyInt_FromLong(m_constraintId); return PyInt_FromLong(m_constraintId);
} }

View File

@@ -270,7 +270,7 @@ int KX_GameActuator::py_setattro(PyObject *attr, PyObject *value)
const char KX_GameActuator::GetFile_doc[] = const char KX_GameActuator::GetFile_doc[] =
"getFile()\n" "getFile()\n"
"get the name of the file to start.\n"; "get the name of the file to start.\n";
PyObject* KX_GameActuator::PyGetFile(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_GameActuator::PyGetFile(PyObject* args, PyObject* kwds)
{ {
ShowDeprecationWarning("getFile()", "the file property"); ShowDeprecationWarning("getFile()", "the file property");
return PyString_FromString(m_filename); return PyString_FromString(m_filename);
@@ -280,7 +280,7 @@ PyObject* KX_GameActuator::PyGetFile(PyObject* self, PyObject* args, PyObject* k
const char KX_GameActuator::SetFile_doc[] = const char KX_GameActuator::SetFile_doc[] =
"setFile(name)\n" "setFile(name)\n"
"set the name of the file to start.\n"; "set the name of the file to start.\n";
PyObject* KX_GameActuator::PySetFile(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_GameActuator::PySetFile(PyObject* args, PyObject* kwds)
{ {
char* new_file; char* new_file;

View File

@@ -1179,7 +1179,7 @@ bool KX_GameObject::ConvertPythonVectorArgs(PyObject* args,
} }
*/ */
PyObject* KX_GameObject::PyReplaceMesh(PyObject* self, PyObject* value) PyObject* KX_GameObject::PyReplaceMesh(PyObject* value)
{ {
KX_Scene *scene = KX_GetActiveScene(); KX_Scene *scene = KX_GetActiveScene();
char* meshname; char* meshname;
@@ -1201,7 +1201,7 @@ PyObject* KX_GameObject::PyReplaceMesh(PyObject* self, PyObject* value)
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* KX_GameObject::PyEndObject(PyObject* self) PyObject* KX_GameObject::PyEndObject()
{ {
KX_Scene *scene = KX_GetActiveScene(); KX_Scene *scene = KX_GetActiveScene();
@@ -1212,7 +1212,7 @@ PyObject* KX_GameObject::PyEndObject(PyObject* self)
} }
PyObject* KX_GameObject::PyGetPosition(PyObject* self) PyObject* KX_GameObject::PyGetPosition()
{ {
ShowDeprecationWarning("getPosition()", "the position property"); ShowDeprecationWarning("getPosition()", "the position property");
return PyObjectFrom(NodeGetWorldPosition()); return PyObjectFrom(NodeGetWorldPosition());
@@ -1701,7 +1701,7 @@ PyObject* KX_GameObject::pyattr_get_meshes(void *self_v, const KX_PYATTRIBUTE_DE
PyObject *meshes= PyList_New(self->m_meshes.size()); PyObject *meshes= PyList_New(self->m_meshes.size());
int i; int i;
for(i=0; i < self->m_meshes.size(); i++) for(i=0; i < (int)self->m_meshes.size(); i++)
{ {
KX_MeshProxy* meshproxy = new KX_MeshProxy(self->m_meshes[i]); KX_MeshProxy* meshproxy = new KX_MeshProxy(self->m_meshes[i]);
PyList_SET_ITEM(meshes, i, meshproxy->GetProxy()); PyList_SET_ITEM(meshes, i, meshproxy->GetProxy());
@@ -1871,7 +1871,7 @@ int KX_GameObject::py_delattro(PyObject *attr)
} }
PyObject* KX_GameObject::PyApplyForce(PyObject* self, PyObject* args) PyObject* KX_GameObject::PyApplyForce(PyObject* args)
{ {
int local = 0; int local = 0;
PyObject* pyvect; PyObject* pyvect;
@@ -1886,7 +1886,7 @@ PyObject* KX_GameObject::PyApplyForce(PyObject* self, PyObject* args)
return NULL; return NULL;
} }
PyObject* KX_GameObject::PyApplyTorque(PyObject* self, PyObject* args) PyObject* KX_GameObject::PyApplyTorque(PyObject* args)
{ {
int local = 0; int local = 0;
PyObject* pyvect; PyObject* pyvect;
@@ -1901,7 +1901,7 @@ PyObject* KX_GameObject::PyApplyTorque(PyObject* self, PyObject* args)
return NULL; return NULL;
} }
PyObject* KX_GameObject::PyApplyRotation(PyObject* self, PyObject* args) PyObject* KX_GameObject::PyApplyRotation(PyObject* args)
{ {
int local = 0; int local = 0;
PyObject* pyvect; PyObject* pyvect;
@@ -1916,7 +1916,7 @@ PyObject* KX_GameObject::PyApplyRotation(PyObject* self, PyObject* args)
return NULL; return NULL;
} }
PyObject* KX_GameObject::PyApplyMovement(PyObject* self, PyObject* args) PyObject* KX_GameObject::PyApplyMovement(PyObject* args)
{ {
int local = 0; int local = 0;
PyObject* pyvect; PyObject* pyvect;
@@ -1931,7 +1931,7 @@ PyObject* KX_GameObject::PyApplyMovement(PyObject* self, PyObject* args)
return NULL; return NULL;
} }
PyObject* KX_GameObject::PyGetLinearVelocity(PyObject* self, PyObject* args) PyObject* KX_GameObject::PyGetLinearVelocity(PyObject* args)
{ {
// only can get the velocity if we have a physics object connected to us... // only can get the velocity if we have a physics object connected to us...
int local = 0; int local = 0;
@@ -1945,7 +1945,7 @@ PyObject* KX_GameObject::PyGetLinearVelocity(PyObject* self, PyObject* args)
} }
} }
PyObject* KX_GameObject::PySetLinearVelocity(PyObject* self, PyObject* args) PyObject* KX_GameObject::PySetLinearVelocity(PyObject* args)
{ {
int local = 0; int local = 0;
PyObject* pyvect; PyObject* pyvect;
@@ -1960,7 +1960,7 @@ PyObject* KX_GameObject::PySetLinearVelocity(PyObject* self, PyObject* args)
return NULL; return NULL;
} }
PyObject* KX_GameObject::PyGetAngularVelocity(PyObject* self, PyObject* args) PyObject* KX_GameObject::PyGetAngularVelocity(PyObject* args)
{ {
// only can get the velocity if we have a physics object connected to us... // only can get the velocity if we have a physics object connected to us...
int local = 0; int local = 0;
@@ -1974,7 +1974,7 @@ PyObject* KX_GameObject::PyGetAngularVelocity(PyObject* self, PyObject* args)
} }
} }
PyObject* KX_GameObject::PySetAngularVelocity(PyObject* self, PyObject* args) PyObject* KX_GameObject::PySetAngularVelocity(PyObject* args)
{ {
int local = 0; int local = 0;
PyObject* pyvect; PyObject* pyvect;
@@ -1989,7 +1989,7 @@ PyObject* KX_GameObject::PySetAngularVelocity(PyObject* self, PyObject* args)
return NULL; return NULL;
} }
PyObject* KX_GameObject::PySetVisible(PyObject* self, PyObject* args) PyObject* KX_GameObject::PySetVisible(PyObject* args)
{ {
int visible, recursive = 0; int visible, recursive = 0;
if (!PyArg_ParseTuple(args,"i|i:setVisible",&visible, &recursive)) if (!PyArg_ParseTuple(args,"i|i:setVisible",&visible, &recursive))
@@ -2001,7 +2001,7 @@ PyObject* KX_GameObject::PySetVisible(PyObject* self, PyObject* args)
} }
PyObject* KX_GameObject::PySetOcclusion(PyObject* self, PyObject* args) PyObject* KX_GameObject::PySetOcclusion(PyObject* args)
{ {
int occlusion, recursive = 0; int occlusion, recursive = 0;
if (!PyArg_ParseTuple(args,"i|i:setOcclusion",&occlusion, &recursive)) if (!PyArg_ParseTuple(args,"i|i:setOcclusion",&occlusion, &recursive))
@@ -2011,13 +2011,13 @@ PyObject* KX_GameObject::PySetOcclusion(PyObject* self, PyObject* args)
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* KX_GameObject::PyGetVisible(PyObject* self) PyObject* KX_GameObject::PyGetVisible()
{ {
ShowDeprecationWarning("getVisible()", "the visible property"); ShowDeprecationWarning("getVisible()", "the visible property");
return PyInt_FromLong(m_bVisible); return PyInt_FromLong(m_bVisible);
} }
PyObject* KX_GameObject::PyGetState(PyObject* self) PyObject* KX_GameObject::PyGetState()
{ {
ShowDeprecationWarning("getState()", "the state property"); ShowDeprecationWarning("getState()", "the state property");
int state = 0; int state = 0;
@@ -2025,7 +2025,7 @@ PyObject* KX_GameObject::PyGetState(PyObject* self)
return PyInt_FromLong(state); return PyInt_FromLong(state);
} }
PyObject* KX_GameObject::PySetState(PyObject* self, PyObject* value) PyObject* KX_GameObject::PySetState(PyObject* value)
{ {
ShowDeprecationWarning("setState()", "the state property"); ShowDeprecationWarning("setState()", "the state property");
int state_i = PyInt_AsLong(value); int state_i = PyInt_AsLong(value);
@@ -2046,7 +2046,7 @@ PyObject* KX_GameObject::PySetState(PyObject* self, PyObject* value)
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* KX_GameObject::PyGetVelocity(PyObject* self, PyObject* args) PyObject* KX_GameObject::PyGetVelocity(PyObject* args)
{ {
// only can get the velocity if we have a physics object connected to us... // only can get the velocity if we have a physics object connected to us...
MT_Point3 point(0.0,0.0,0.0); MT_Point3 point(0.0,0.0,0.0);
@@ -2072,13 +2072,13 @@ PyObject* KX_GameObject::PyGetVelocity(PyObject* self, PyObject* args)
PyObject* KX_GameObject::PyGetMass(PyObject* self) PyObject* KX_GameObject::PyGetMass()
{ {
ShowDeprecationWarning("getMass()", "the mass property"); ShowDeprecationWarning("getMass()", "the mass property");
return PyFloat_FromDouble((GetPhysicsController() != NULL) ? GetPhysicsController()->GetMass() : 0.0f); return PyFloat_FromDouble((GetPhysicsController() != NULL) ? GetPhysicsController()->GetMass() : 0.0f);
} }
PyObject* KX_GameObject::PyGetReactionForce(PyObject* self) PyObject* KX_GameObject::PyGetReactionForce()
{ {
// only can get the velocity if we have a physics object connected to us... // only can get the velocity if we have a physics object connected to us...
@@ -2095,7 +2095,7 @@ PyObject* KX_GameObject::PyGetReactionForce(PyObject* self)
PyObject* KX_GameObject::PyEnableRigidBody(PyObject* self) PyObject* KX_GameObject::PyEnableRigidBody()
{ {
if(GetPhysicsController()) if(GetPhysicsController())
GetPhysicsController()->setRigidBody(true); GetPhysicsController()->setRigidBody(true);
@@ -2105,7 +2105,7 @@ PyObject* KX_GameObject::PyEnableRigidBody(PyObject* self)
PyObject* KX_GameObject::PyDisableRigidBody(PyObject* self) PyObject* KX_GameObject::PyDisableRigidBody()
{ {
if(GetPhysicsController()) if(GetPhysicsController())
GetPhysicsController()->setRigidBody(false); GetPhysicsController()->setRigidBody(false);
@@ -2115,7 +2115,7 @@ PyObject* KX_GameObject::PyDisableRigidBody(PyObject* self)
PyObject* KX_GameObject::PyGetParent(PyObject* self) PyObject* KX_GameObject::PyGetParent()
{ {
ShowDeprecationWarning("getParent()", "the parent property"); ShowDeprecationWarning("getParent()", "the parent property");
KX_GameObject* parent = this->GetParent(); KX_GameObject* parent = this->GetParent();
@@ -2124,7 +2124,7 @@ PyObject* KX_GameObject::PyGetParent(PyObject* self)
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* KX_GameObject::PySetParent(PyObject* self, PyObject* value) PyObject* KX_GameObject::PySetParent(PyObject* value)
{ {
KX_GameObject *obj; KX_GameObject *obj;
if (!ConvertPythonToGameObject(value, &obj, false)) if (!ConvertPythonToGameObject(value, &obj, false))
@@ -2134,24 +2134,24 @@ PyObject* KX_GameObject::PySetParent(PyObject* self, PyObject* value)
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* KX_GameObject::PyRemoveParent(PyObject* self) PyObject* KX_GameObject::PyRemoveParent()
{ {
KX_Scene *scene = KX_GetActiveScene(); KX_Scene *scene = KX_GetActiveScene();
this->RemoveParent(scene); this->RemoveParent(scene);
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* KX_GameObject::PyGetChildren(PyObject* self) PyObject* KX_GameObject::PyGetChildren()
{ {
return GetChildren()->NewProxy(true); return GetChildren()->NewProxy(true);
} }
PyObject* KX_GameObject::PyGetChildrenRecursive(PyObject* self) PyObject* KX_GameObject::PyGetChildrenRecursive()
{ {
return GetChildrenRecursive()->NewProxy(true); return GetChildrenRecursive()->NewProxy(true);
} }
PyObject* KX_GameObject::PyGetMesh(PyObject* self, PyObject* args) PyObject* KX_GameObject::PyGetMesh(PyObject* args)
{ {
ShowDeprecationWarning("getMesh()", "the meshes property"); ShowDeprecationWarning("getMesh()", "the meshes property");
@@ -2173,7 +2173,7 @@ PyObject* KX_GameObject::PyGetMesh(PyObject* self, PyObject* args)
PyObject* KX_GameObject::PySetCollisionMargin(PyObject* self, PyObject* value) PyObject* KX_GameObject::PySetCollisionMargin(PyObject* value)
{ {
float collisionMargin = PyFloat_AsDouble(value); float collisionMargin = PyFloat_AsDouble(value);
@@ -2193,7 +2193,7 @@ PyObject* KX_GameObject::PySetCollisionMargin(PyObject* self, PyObject* value)
PyObject* KX_GameObject::PyApplyImpulse(PyObject* self, PyObject* args) PyObject* KX_GameObject::PyApplyImpulse(PyObject* args)
{ {
PyObject* pyattach; PyObject* pyattach;
PyObject* pyimpulse; PyObject* pyimpulse;
@@ -2220,7 +2220,7 @@ PyObject* KX_GameObject::PyApplyImpulse(PyObject* self, PyObject* args)
PyObject* KX_GameObject::PySuspendDynamics(PyObject* self) PyObject* KX_GameObject::PySuspendDynamics()
{ {
SuspendDynamics(); SuspendDynamics();
Py_RETURN_NONE; Py_RETURN_NONE;
@@ -2228,7 +2228,7 @@ PyObject* KX_GameObject::PySuspendDynamics(PyObject* self)
PyObject* KX_GameObject::PyRestoreDynamics(PyObject* self) PyObject* KX_GameObject::PyRestoreDynamics()
{ {
RestoreDynamics(); RestoreDynamics();
Py_RETURN_NONE; Py_RETURN_NONE;
@@ -2236,7 +2236,7 @@ PyObject* KX_GameObject::PyRestoreDynamics(PyObject* self)
PyObject* KX_GameObject::PyGetOrientation(PyObject* self) //keywords PyObject* KX_GameObject::PyGetOrientation() //keywords
{ {
ShowDeprecationWarning("getOrientation()", "the orientation property"); ShowDeprecationWarning("getOrientation()", "the orientation property");
return PyObjectFrom(NodeGetWorldOrientation()); return PyObjectFrom(NodeGetWorldOrientation());
@@ -2244,7 +2244,7 @@ PyObject* KX_GameObject::PyGetOrientation(PyObject* self) //keywords
PyObject* KX_GameObject::PySetOrientation(PyObject* self, PyObject* value) PyObject* KX_GameObject::PySetOrientation(PyObject* value)
{ {
ShowDeprecationWarning("setOrientation()", "the orientation property"); ShowDeprecationWarning("setOrientation()", "the orientation property");
MT_Matrix3x3 matrix; MT_Matrix3x3 matrix;
@@ -2266,7 +2266,7 @@ PyObject* KX_GameObject::PySetOrientation(PyObject* self, PyObject* value)
return NULL; return NULL;
} }
PyObject* KX_GameObject::PyAlignAxisToVect(PyObject* self, PyObject* args) PyObject* KX_GameObject::PyAlignAxisToVect(PyObject* args)
{ {
PyObject* pyvect; PyObject* pyvect;
int axis = 2; //z axis is the default int axis = 2; //z axis is the default
@@ -2288,7 +2288,7 @@ PyObject* KX_GameObject::PyAlignAxisToVect(PyObject* self, PyObject* args)
return NULL; return NULL;
} }
PyObject* KX_GameObject::PyGetAxisVect(PyObject* self, PyObject* value) PyObject* KX_GameObject::PyGetAxisVect(PyObject* value)
{ {
MT_Vector3 vect; MT_Vector3 vect;
if (PyVecTo(value, vect)) if (PyVecTo(value, vect))
@@ -2298,7 +2298,7 @@ PyObject* KX_GameObject::PyGetAxisVect(PyObject* self, PyObject* value)
return NULL; return NULL;
} }
PyObject* KX_GameObject::PySetPosition(PyObject* self, PyObject* value) PyObject* KX_GameObject::PySetPosition(PyObject* value)
{ {
ShowDeprecationWarning("setPosition()", "the position property"); ShowDeprecationWarning("setPosition()", "the position property");
MT_Point3 pos; MT_Point3 pos;
@@ -2312,7 +2312,7 @@ PyObject* KX_GameObject::PySetPosition(PyObject* self, PyObject* value)
return NULL; return NULL;
} }
PyObject* KX_GameObject::PySetWorldPosition(PyObject* self, PyObject* value) PyObject* KX_GameObject::PySetWorldPosition(PyObject* value)
{ {
MT_Point3 pos; MT_Point3 pos;
if (PyVecTo(value, pos)) if (PyVecTo(value, pos))
@@ -2325,7 +2325,7 @@ PyObject* KX_GameObject::PySetWorldPosition(PyObject* self, PyObject* value)
return NULL; return NULL;
} }
PyObject* KX_GameObject::PyGetPhysicsId(PyObject* self) PyObject* KX_GameObject::PyGetPhysicsId()
{ {
KX_IPhysicsController* ctrl = GetPhysicsController(); KX_IPhysicsController* ctrl = GetPhysicsController();
uint_ptr physid=0; uint_ptr physid=0;
@@ -2336,7 +2336,7 @@ PyObject* KX_GameObject::PyGetPhysicsId(PyObject* self)
return PyInt_FromLong((long)physid); return PyInt_FromLong((long)physid);
} }
PyObject* KX_GameObject::PyGetPropertyNames(PyObject* self) PyObject* KX_GameObject::PyGetPropertyNames()
{ {
PyObject *list= ConvertKeysToPython(); PyObject *list= ConvertKeysToPython();

View File

@@ -490,9 +490,7 @@ const char KX_IpoActuator::Set_doc[] =
"\t - endframe : last frame to use (int)\n" "\t - endframe : last frame to use (int)\n"
"\t - mode? : special mode (0=normal, 1=interpret location as force, 2=additive)" "\t - mode? : special mode (0=normal, 1=interpret location as force, 2=additive)"
"\tSet the properties of the actuator.\n"; "\tSet the properties of the actuator.\n";
PyObject* KX_IpoActuator::PySet(PyObject* self, PyObject* KX_IpoActuator::PySet(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("set()", "a number properties"); ShowDeprecationWarning("set()", "a number properties");
@@ -533,9 +531,7 @@ const char KX_IpoActuator::SetProperty_doc[] =
"setProperty(propname)\n" "setProperty(propname)\n"
"\t - propname: name of the property (string)\n" "\t - propname: name of the property (string)\n"
"\tSet the property to be used in FromProp mode.\n"; "\tSet the property to be used in FromProp mode.\n";
PyObject* KX_IpoActuator::PySetProperty(PyObject* self, PyObject* KX_IpoActuator::PySetProperty(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setProperty()", "the propName property"); ShowDeprecationWarning("setProperty()", "the propName property");
@@ -556,9 +552,7 @@ const char KX_IpoActuator::SetStart_doc[] =
"setStart(frame)\n" "setStart(frame)\n"
"\t - frame: first frame to use (int)\n" "\t - frame: first frame to use (int)\n"
"\tSet the frame from which the ipo starts playing.\n"; "\tSet the frame from which the ipo starts playing.\n";
PyObject* KX_IpoActuator::PySetStart(PyObject* self, PyObject* KX_IpoActuator::PySetStart(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setStart()", "the startFrame property"); ShowDeprecationWarning("setStart()", "the startFrame property");
@@ -575,7 +569,7 @@ PyObject* KX_IpoActuator::PySetStart(PyObject* self,
const char KX_IpoActuator::GetStart_doc[] = const char KX_IpoActuator::GetStart_doc[] =
"getStart()\n" "getStart()\n"
"\tReturns the frame from which the ipo starts playing.\n"; "\tReturns the frame from which the ipo starts playing.\n";
PyObject* KX_IpoActuator::PyGetStart(PyObject* self) { PyObject* KX_IpoActuator::PyGetStart() {
ShowDeprecationWarning("getStart()", "the startFrame property"); ShowDeprecationWarning("getStart()", "the startFrame property");
return PyFloat_FromDouble(m_startframe); return PyFloat_FromDouble(m_startframe);
} }
@@ -585,9 +579,7 @@ const char KX_IpoActuator::SetEnd_doc[] =
"setEnd(frame)\n" "setEnd(frame)\n"
"\t - frame: last frame to use (int)\n" "\t - frame: last frame to use (int)\n"
"\tSet the frame at which the ipo stops playing.\n"; "\tSet the frame at which the ipo stops playing.\n";
PyObject* KX_IpoActuator::PySetEnd(PyObject* self, PyObject* KX_IpoActuator::PySetEnd(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setEnd()", "the endFrame property"); ShowDeprecationWarning("setEnd()", "the endFrame property");
float endArg; float endArg;
if(!PyArg_ParseTuple(args, "f:setEnd", &endArg)) { if(!PyArg_ParseTuple(args, "f:setEnd", &endArg)) {
@@ -602,7 +594,7 @@ PyObject* KX_IpoActuator::PySetEnd(PyObject* self,
const char KX_IpoActuator::GetEnd_doc[] = const char KX_IpoActuator::GetEnd_doc[] =
"getEnd()\n" "getEnd()\n"
"\tReturns the frame at which the ipo stops playing.\n"; "\tReturns the frame at which the ipo stops playing.\n";
PyObject* KX_IpoActuator::PyGetEnd(PyObject* self) { PyObject* KX_IpoActuator::PyGetEnd() {
ShowDeprecationWarning("getEnd()", "the endFrame property"); ShowDeprecationWarning("getEnd()", "the endFrame property");
return PyFloat_FromDouble(m_endframe); return PyFloat_FromDouble(m_endframe);
} }
@@ -612,9 +604,7 @@ const char KX_IpoActuator::SetIpoAsForce_doc[] =
"setIpoAsForce(force?)\n" "setIpoAsForce(force?)\n"
"\t - force? : interpret this ipo as a force? (KX_TRUE, KX_FALSE)\n" "\t - force? : interpret this ipo as a force? (KX_TRUE, KX_FALSE)\n"
"\tSet whether to interpret the ipo as a force rather than a displacement.\n"; "\tSet whether to interpret the ipo as a force rather than a displacement.\n";
PyObject* KX_IpoActuator::PySetIpoAsForce(PyObject* self, PyObject* KX_IpoActuator::PySetIpoAsForce(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setIpoAsForce()", "the useIpoAsForce property"); ShowDeprecationWarning("setIpoAsForce()", "the useIpoAsForce property");
int boolArg; int boolArg;
@@ -632,7 +622,7 @@ PyObject* KX_IpoActuator::PySetIpoAsForce(PyObject* self,
const char KX_IpoActuator::GetIpoAsForce_doc[] = const char KX_IpoActuator::GetIpoAsForce_doc[] =
"getIpoAsForce()\n" "getIpoAsForce()\n"
"\tReturns whether to interpret the ipo as a force rather than a displacement.\n"; "\tReturns whether to interpret the ipo as a force rather than a displacement.\n";
PyObject* KX_IpoActuator::PyGetIpoAsForce(PyObject* self) { PyObject* KX_IpoActuator::PyGetIpoAsForce() {
ShowDeprecationWarning("getIpoAsForce()", "the useIpoAsForce property"); ShowDeprecationWarning("getIpoAsForce()", "the useIpoAsForce property");
return BoolToPyArg(m_ipo_as_force); return BoolToPyArg(m_ipo_as_force);
} }
@@ -642,9 +632,7 @@ const char KX_IpoActuator::SetIpoAdd_doc[] =
"setIpoAdd(add?)\n" "setIpoAdd(add?)\n"
"\t - add? : add flag (KX_TRUE, KX_FALSE)\n" "\t - add? : add flag (KX_TRUE, KX_FALSE)\n"
"\tSet whether to interpret the ipo as additive rather than absolute.\n"; "\tSet whether to interpret the ipo as additive rather than absolute.\n";
PyObject* KX_IpoActuator::PySetIpoAdd(PyObject* self, PyObject* KX_IpoActuator::PySetIpoAdd(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setIpoAdd()", "the useIpoAdd property"); ShowDeprecationWarning("setIpoAdd()", "the useIpoAdd property");
int boolArg; int boolArg;
@@ -662,7 +650,7 @@ PyObject* KX_IpoActuator::PySetIpoAdd(PyObject* self,
const char KX_IpoActuator::GetIpoAdd_doc[] = const char KX_IpoActuator::GetIpoAdd_doc[] =
"getIpoAsAdd()\n" "getIpoAsAdd()\n"
"\tReturns whether to interpret the ipo as additive rather than absolute.\n"; "\tReturns whether to interpret the ipo as additive rather than absolute.\n";
PyObject* KX_IpoActuator::PyGetIpoAdd(PyObject* self) { PyObject* KX_IpoActuator::PyGetIpoAdd() {
ShowDeprecationWarning("getIpoAdd()", "the useIpoAdd property"); ShowDeprecationWarning("getIpoAdd()", "the useIpoAdd property");
return BoolToPyArg(m_ipo_add); return BoolToPyArg(m_ipo_add);
} }
@@ -672,9 +660,7 @@ const char KX_IpoActuator::SetType_doc[] =
"setType(mode)\n" "setType(mode)\n"
"\t - mode: Play, PingPong, Flipper, LoopStop, LoopEnd or FromProp (string)\n" "\t - mode: Play, PingPong, Flipper, LoopStop, LoopEnd or FromProp (string)\n"
"\tSet the operation mode of the actuator.\n"; "\tSet the operation mode of the actuator.\n";
PyObject* KX_IpoActuator::PySetType(PyObject* self, PyObject* KX_IpoActuator::PySetType(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setType()", "the type property"); ShowDeprecationWarning("setType()", "the type property");
int typeArg; int typeArg;
@@ -693,7 +679,7 @@ PyObject* KX_IpoActuator::PySetType(PyObject* self,
const char KX_IpoActuator::GetType_doc[] = const char KX_IpoActuator::GetType_doc[] =
"getType()\n" "getType()\n"
"\tReturns the operation mode of the actuator.\n"; "\tReturns the operation mode of the actuator.\n";
PyObject* KX_IpoActuator::PyGetType(PyObject* self) { PyObject* KX_IpoActuator::PyGetType() {
ShowDeprecationWarning("getType()", "the type property"); ShowDeprecationWarning("getType()", "the type property");
return PyInt_FromLong(m_type); return PyInt_FromLong(m_type);
} }
@@ -705,9 +691,7 @@ const char KX_IpoActuator::SetForceIpoActsLocal_doc[] =
"\t coordinates? (KX_TRUE, KX_FALSE)\n" "\t coordinates? (KX_TRUE, KX_FALSE)\n"
"\tSet whether to apply the force in the object's local\n" "\tSet whether to apply the force in the object's local\n"
"\tcoordinates rather than the world global coordinates.\n"; "\tcoordinates rather than the world global coordinates.\n";
PyObject* KX_IpoActuator::PySetForceIpoActsLocal(PyObject* self, PyObject* KX_IpoActuator::PySetForceIpoActsLocal(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setForceIpoActsLocal()", "the useIpoLocal property"); ShowDeprecationWarning("setForceIpoActsLocal()", "the useIpoLocal property");
int boolArg; int boolArg;
@@ -724,7 +708,7 @@ const char KX_IpoActuator::GetForceIpoActsLocal_doc[] =
"getForceIpoActsLocal()\n" "getForceIpoActsLocal()\n"
"\tReturn whether to apply the force in the object's local\n" "\tReturn whether to apply the force in the object's local\n"
"\tcoordinates rather than the world global coordinates.\n"; "\tcoordinates rather than the world global coordinates.\n";
PyObject* KX_IpoActuator::PyGetForceIpoActsLocal(PyObject* self) { PyObject* KX_IpoActuator::PyGetForceIpoActsLocal() {
ShowDeprecationWarning("getForceIpoActsLocal()", "the useIpoLocal property"); ShowDeprecationWarning("getForceIpoActsLocal()", "the useIpoLocal property");
return BoolToPyArg(m_ipo_local); return BoolToPyArg(m_ipo_local);
} }

View File

@@ -145,20 +145,20 @@ public:
virtual int py_setattro(PyObject *attr, PyObject *value); virtual int py_setattro(PyObject *attr, PyObject *value);
//KX_PYMETHOD_DOC //KX_PYMETHOD_DOC
KX_PYMETHOD_DOC(KX_IpoActuator,Set); KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,Set);
KX_PYMETHOD_DOC(KX_IpoActuator,SetProperty); KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetProperty);
/* KX_PYMETHOD_DOC(KX_IpoActuator,SetKey2Key); */ /* KX_PYMETHOD_DOC(KX_IpoActuator,SetKey2Key); */
KX_PYMETHOD_DOC(KX_IpoActuator,SetStart); KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetStart);
KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetStart); KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetStart);
KX_PYMETHOD_DOC(KX_IpoActuator,SetEnd); KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetEnd);
KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetEnd); KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetEnd);
KX_PYMETHOD_DOC(KX_IpoActuator,SetIpoAsForce); KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetIpoAsForce);
KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetIpoAsForce); KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetIpoAsForce);
KX_PYMETHOD_DOC(KX_IpoActuator,SetIpoAdd); KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetIpoAdd);
KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetIpoAdd); KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetIpoAdd);
KX_PYMETHOD_DOC(KX_IpoActuator,SetType); KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetType);
KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetType); KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetType);
KX_PYMETHOD_DOC(KX_IpoActuator,SetForceIpoActsLocal); KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetForceIpoActsLocal);
KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetForceIpoActsLocal); KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetForceIpoActsLocal);
}; };

View File

@@ -139,25 +139,21 @@ void KX_MeshProxy::ReplicaSetName(STR_String name) {};
// stuff for python integration // stuff for python integration
PyObject* KX_MeshProxy::PyGetNumMaterials(PyObject* self, PyObject* KX_MeshProxy::PyGetNumMaterials(PyObject* args, PyObject* kwds)
PyObject* args,
PyObject* kwds)
{ {
int num = m_meshobj->NumMaterials(); int num = m_meshobj->NumMaterials();
ShowDeprecationWarning("getNumMaterials()", "the numMaterials property"); ShowDeprecationWarning("getNumMaterials()", "the numMaterials property");
return PyInt_FromLong(num); return PyInt_FromLong(num);
} }
PyObject* KX_MeshProxy::PyGetNumPolygons(PyObject* self) PyObject* KX_MeshProxy::PyGetNumPolygons()
{ {
int num = m_meshobj->NumPolygons(); int num = m_meshobj->NumPolygons();
ShowDeprecationWarning("getNumPolygons()", "the numPolygons property"); ShowDeprecationWarning("getNumPolygons()", "the numPolygons property");
return PyInt_FromLong(num); return PyInt_FromLong(num);
} }
PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* self, PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* args, PyObject* kwds)
PyObject* args,
PyObject* kwds)
{ {
int matid= 1; int matid= 1;
STR_String matname; STR_String matname;
@@ -175,9 +171,7 @@ PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* self,
} }
PyObject* KX_MeshProxy::PyGetTextureName(PyObject* self, PyObject* KX_MeshProxy::PyGetTextureName(PyObject* args, PyObject* kwds)
PyObject* args,
PyObject* kwds)
{ {
int matid= 1; int matid= 1;
STR_String matname; STR_String matname;
@@ -194,9 +188,7 @@ PyObject* KX_MeshProxy::PyGetTextureName(PyObject* self,
} }
PyObject* KX_MeshProxy::PyGetVertexArrayLength(PyObject* self, PyObject* KX_MeshProxy::PyGetVertexArrayLength(PyObject* args, PyObject* kwds)
PyObject* args,
PyObject* kwds)
{ {
int matid= 0; int matid= 0;
int length = 0; int length = 0;
@@ -219,9 +211,7 @@ PyObject* KX_MeshProxy::PyGetVertexArrayLength(PyObject* self,
} }
PyObject* KX_MeshProxy::PyGetVertex(PyObject* self, PyObject* KX_MeshProxy::PyGetVertex(PyObject* args, PyObject* kwds)
PyObject* args,
PyObject* kwds)
{ {
int vertexindex= 1; int vertexindex= 1;
int matindex= 1; int matindex= 1;
@@ -243,9 +233,7 @@ PyObject* KX_MeshProxy::PyGetVertex(PyObject* self,
} }
PyObject* KX_MeshProxy::PyGetPolygon(PyObject* self, PyObject* KX_MeshProxy::PyGetPolygon(PyObject* args, PyObject* kwds)
PyObject* args,
PyObject* kwds)
{ {
int polyindex= 1; int polyindex= 1;
PyObject* polyob = NULL; PyObject* polyob = NULL;

View File

@@ -391,7 +391,7 @@ PyObject* KX_MouseFocusSensor::py_getattro(PyObject *attr) {
const char KX_MouseFocusSensor::GetHitObject_doc[] = const char KX_MouseFocusSensor::GetHitObject_doc[] =
"getHitObject()\n" "getHitObject()\n"
"\tReturns the object that was hit by this ray.\n"; "\tReturns the object that was hit by this ray.\n";
PyObject* KX_MouseFocusSensor::PyGetHitObject(PyObject* self) PyObject* KX_MouseFocusSensor::PyGetHitObject()
{ {
ShowDeprecationWarning("GetHitObject()", "the hitObject property"); ShowDeprecationWarning("GetHitObject()", "the hitObject property");
@@ -405,7 +405,7 @@ PyObject* KX_MouseFocusSensor::PyGetHitObject(PyObject* self)
const char KX_MouseFocusSensor::GetHitPosition_doc[] = const char KX_MouseFocusSensor::GetHitPosition_doc[] =
"getHitPosition()\n" "getHitPosition()\n"
"\tReturns the position (in worldcoordinates) where the object was hit by this ray.\n"; "\tReturns the position (in worldcoordinates) where the object was hit by this ray.\n";
PyObject* KX_MouseFocusSensor::PyGetHitPosition(PyObject* self) PyObject* KX_MouseFocusSensor::PyGetHitPosition()
{ {
ShowDeprecationWarning("getHitPosition()", "the hitPosition property"); ShowDeprecationWarning("getHitPosition()", "the hitPosition property");
@@ -415,7 +415,7 @@ PyObject* KX_MouseFocusSensor::PyGetHitPosition(PyObject* self)
const char KX_MouseFocusSensor::GetRayDirection_doc[] = const char KX_MouseFocusSensor::GetRayDirection_doc[] =
"getRayDirection()\n" "getRayDirection()\n"
"\tReturns the direction from the ray (in worldcoordinates) .\n"; "\tReturns the direction from the ray (in worldcoordinates) .\n";
PyObject* KX_MouseFocusSensor::PyGetRayDirection(PyObject* self) PyObject* KX_MouseFocusSensor::PyGetRayDirection()
{ {
ShowDeprecationWarning("getRayDirection()", "the rayDirection property"); ShowDeprecationWarning("getRayDirection()", "the rayDirection property");
@@ -428,7 +428,7 @@ PyObject* KX_MouseFocusSensor::PyGetRayDirection(PyObject* self)
const char KX_MouseFocusSensor::GetHitNormal_doc[] = const char KX_MouseFocusSensor::GetHitNormal_doc[] =
"getHitNormal()\n" "getHitNormal()\n"
"\tReturns the normal (in worldcoordinates) at the point of collision where the object was hit by this ray.\n"; "\tReturns the normal (in worldcoordinates) at the point of collision where the object was hit by this ray.\n";
PyObject* KX_MouseFocusSensor::PyGetHitNormal(PyObject* self) PyObject* KX_MouseFocusSensor::PyGetHitNormal()
{ {
ShowDeprecationWarning("getHitNormal()", "the hitNormal property"); ShowDeprecationWarning("getHitNormal()", "the hitNormal property");
@@ -441,7 +441,7 @@ const char KX_MouseFocusSensor::GetRayTarget_doc[] =
"getRayTarget()\n" "getRayTarget()\n"
"\tReturns the target of the ray that seeks the focus object,\n" "\tReturns the target of the ray that seeks the focus object,\n"
"\tin worldcoordinates."; "\tin worldcoordinates.";
PyObject* KX_MouseFocusSensor::PyGetRayTarget(PyObject* self) PyObject* KX_MouseFocusSensor::PyGetRayTarget()
{ {
ShowDeprecationWarning("getRayTarget()", "the rayTarget property"); ShowDeprecationWarning("getRayTarget()", "the rayTarget property");
@@ -453,7 +453,7 @@ const char KX_MouseFocusSensor::GetRaySource_doc[] =
"getRaySource()\n" "getRaySource()\n"
"\tReturns the source of the ray that seeks the focus object,\n" "\tReturns the source of the ray that seeks the focus object,\n"
"\tin worldcoordinates."; "\tin worldcoordinates.";
PyObject* KX_MouseFocusSensor::PyGetRaySource(PyObject* self) PyObject* KX_MouseFocusSensor::PyGetRaySource()
{ {
ShowDeprecationWarning("getRaySource()", "the raySource property"); ShowDeprecationWarning("getRaySource()", "the raySource property");

View File

@@ -344,7 +344,7 @@ PyObject* KX_ObjectActuator::py_getattro(PyObject *attr) {
/* Removed! */ /* Removed! */
/* 2. getForce */ /* 2. getForce */
PyObject* KX_ObjectActuator::PyGetForce(PyObject* self) PyObject* KX_ObjectActuator::PyGetForce()
{ {
PyObject *retVal = PyList_New(4); PyObject *retVal = PyList_New(4);
@@ -356,9 +356,7 @@ PyObject* KX_ObjectActuator::PyGetForce(PyObject* self)
return retVal; return retVal;
} }
/* 3. setForce */ /* 3. setForce */
PyObject* KX_ObjectActuator::PySetForce(PyObject* self, PyObject* KX_ObjectActuator::PySetForce(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
float vecArg[3]; float vecArg[3];
int bToggle = 0; int bToggle = 0;
@@ -373,7 +371,7 @@ PyObject* KX_ObjectActuator::PySetForce(PyObject* self,
} }
/* 4. getTorque */ /* 4. getTorque */
PyObject* KX_ObjectActuator::PyGetTorque(PyObject* self) PyObject* KX_ObjectActuator::PyGetTorque()
{ {
PyObject *retVal = PyList_New(4); PyObject *retVal = PyList_New(4);
@@ -385,9 +383,7 @@ PyObject* KX_ObjectActuator::PyGetTorque(PyObject* self)
return retVal; return retVal;
} }
/* 5. setTorque */ /* 5. setTorque */
PyObject* KX_ObjectActuator::PySetTorque(PyObject* self, PyObject* KX_ObjectActuator::PySetTorque(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
float vecArg[3]; float vecArg[3];
int bToggle = 0; int bToggle = 0;
@@ -402,7 +398,7 @@ PyObject* KX_ObjectActuator::PySetTorque(PyObject* self,
} }
/* 6. getDLoc */ /* 6. getDLoc */
PyObject* KX_ObjectActuator::PyGetDLoc(PyObject* self) PyObject* KX_ObjectActuator::PyGetDLoc()
{ {
PyObject *retVal = PyList_New(4); PyObject *retVal = PyList_New(4);
@@ -414,9 +410,7 @@ PyObject* KX_ObjectActuator::PyGetDLoc(PyObject* self)
return retVal; return retVal;
} }
/* 7. setDLoc */ /* 7. setDLoc */
PyObject* KX_ObjectActuator::PySetDLoc(PyObject* self, PyObject* KX_ObjectActuator::PySetDLoc(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
float vecArg[3]; float vecArg[3];
int bToggle = 0; int bToggle = 0;
@@ -431,7 +425,7 @@ PyObject* KX_ObjectActuator::PySetDLoc(PyObject* self,
} }
/* 8. getDRot */ /* 8. getDRot */
PyObject* KX_ObjectActuator::PyGetDRot(PyObject* self) PyObject* KX_ObjectActuator::PyGetDRot()
{ {
PyObject *retVal = PyList_New(4); PyObject *retVal = PyList_New(4);
@@ -443,9 +437,7 @@ PyObject* KX_ObjectActuator::PyGetDRot(PyObject* self)
return retVal; return retVal;
} }
/* 9. setDRot */ /* 9. setDRot */
PyObject* KX_ObjectActuator::PySetDRot(PyObject* self, PyObject* KX_ObjectActuator::PySetDRot(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
float vecArg[3]; float vecArg[3];
int bToggle = 0; int bToggle = 0;
@@ -460,7 +452,7 @@ PyObject* KX_ObjectActuator::PySetDRot(PyObject* self,
} }
/* 10. getLinearVelocity */ /* 10. getLinearVelocity */
PyObject* KX_ObjectActuator::PyGetLinearVelocity(PyObject* self) { PyObject* KX_ObjectActuator::PyGetLinearVelocity() {
PyObject *retVal = PyList_New(4); PyObject *retVal = PyList_New(4);
PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_linear_velocity[0])); PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_linear_velocity[0]));
@@ -472,9 +464,7 @@ PyObject* KX_ObjectActuator::PyGetLinearVelocity(PyObject* self) {
} }
/* 11. setLinearVelocity */ /* 11. setLinearVelocity */
PyObject* KX_ObjectActuator::PySetLinearVelocity(PyObject* self, PyObject* KX_ObjectActuator::PySetLinearVelocity(PyObject* args) {
PyObject* args,
PyObject* kwds) {
float vecArg[3]; float vecArg[3];
int bToggle = 0; int bToggle = 0;
if (!PyArg_ParseTuple(args, "fffi:setLinearVelocity", &vecArg[0], &vecArg[1], if (!PyArg_ParseTuple(args, "fffi:setLinearVelocity", &vecArg[0], &vecArg[1],
@@ -489,7 +479,7 @@ PyObject* KX_ObjectActuator::PySetLinearVelocity(PyObject* self,
/* 12. getAngularVelocity */ /* 12. getAngularVelocity */
PyObject* KX_ObjectActuator::PyGetAngularVelocity(PyObject* self) { PyObject* KX_ObjectActuator::PyGetAngularVelocity() {
PyObject *retVal = PyList_New(4); PyObject *retVal = PyList_New(4);
PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_angular_velocity[0])); PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_angular_velocity[0]));
@@ -500,9 +490,7 @@ PyObject* KX_ObjectActuator::PyGetAngularVelocity(PyObject* self) {
return retVal; return retVal;
} }
/* 13. setAngularVelocity */ /* 13. setAngularVelocity */
PyObject* KX_ObjectActuator::PySetAngularVelocity(PyObject* self, PyObject* KX_ObjectActuator::PySetAngularVelocity(PyObject* args) {
PyObject* args,
PyObject* kwds) {
float vecArg[3]; float vecArg[3];
int bToggle = 0; int bToggle = 0;
if (!PyArg_ParseTuple(args, "fffi:setAngularVelocity", &vecArg[0], &vecArg[1], if (!PyArg_ParseTuple(args, "fffi:setAngularVelocity", &vecArg[0], &vecArg[1],
@@ -516,9 +504,7 @@ PyObject* KX_ObjectActuator::PySetAngularVelocity(PyObject* self,
} }
/* 13. setDamping */ /* 13. setDamping */
PyObject* KX_ObjectActuator::PySetDamping(PyObject* self, PyObject* KX_ObjectActuator::PySetDamping(PyObject* args) {
PyObject* args,
PyObject* kwds) {
int damping = 0; int damping = 0;
if (!PyArg_ParseTuple(args, "i:setDamping", &damping) || damping < 0 || damping > 1000) { if (!PyArg_ParseTuple(args, "i:setDamping", &damping) || damping < 0 || damping > 1000) {
return NULL; return NULL;
@@ -528,11 +514,11 @@ PyObject* KX_ObjectActuator::PySetDamping(PyObject* self,
} }
/* 13. getVelocityDamping */ /* 13. getVelocityDamping */
PyObject* KX_ObjectActuator::PyGetDamping(PyObject* self) { PyObject* KX_ObjectActuator::PyGetDamping() {
return Py_BuildValue("i",m_damping); return Py_BuildValue("i",m_damping);
} }
/* 6. getForceLimitX */ /* 6. getForceLimitX */
PyObject* KX_ObjectActuator::PyGetForceLimitX(PyObject* self) PyObject* KX_ObjectActuator::PyGetForceLimitX()
{ {
PyObject *retVal = PyList_New(3); PyObject *retVal = PyList_New(3);
@@ -543,9 +529,7 @@ PyObject* KX_ObjectActuator::PyGetForceLimitX(PyObject* self)
return retVal; return retVal;
} }
/* 7. setForceLimitX */ /* 7. setForceLimitX */
PyObject* KX_ObjectActuator::PySetForceLimitX(PyObject* self, PyObject* KX_ObjectActuator::PySetForceLimitX(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
float vecArg[2]; float vecArg[2];
int bToggle = 0; int bToggle = 0;
@@ -559,7 +543,7 @@ PyObject* KX_ObjectActuator::PySetForceLimitX(PyObject* self,
} }
/* 6. getForceLimitY */ /* 6. getForceLimitY */
PyObject* KX_ObjectActuator::PyGetForceLimitY(PyObject* self) PyObject* KX_ObjectActuator::PyGetForceLimitY()
{ {
PyObject *retVal = PyList_New(3); PyObject *retVal = PyList_New(3);
@@ -570,9 +554,7 @@ PyObject* KX_ObjectActuator::PyGetForceLimitY(PyObject* self)
return retVal; return retVal;
} }
/* 7. setForceLimitY */ /* 7. setForceLimitY */
PyObject* KX_ObjectActuator::PySetForceLimitY(PyObject* self, PyObject* KX_ObjectActuator::PySetForceLimitY(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
float vecArg[2]; float vecArg[2];
int bToggle = 0; int bToggle = 0;
@@ -586,7 +568,7 @@ PyObject* KX_ObjectActuator::PySetForceLimitY(PyObject* self,
} }
/* 6. getForceLimitZ */ /* 6. getForceLimitZ */
PyObject* KX_ObjectActuator::PyGetForceLimitZ(PyObject* self) PyObject* KX_ObjectActuator::PyGetForceLimitZ()
{ {
PyObject *retVal = PyList_New(3); PyObject *retVal = PyList_New(3);
@@ -597,9 +579,7 @@ PyObject* KX_ObjectActuator::PyGetForceLimitZ(PyObject* self)
return retVal; return retVal;
} }
/* 7. setForceLimitZ */ /* 7. setForceLimitZ */
PyObject* KX_ObjectActuator::PySetForceLimitZ(PyObject* self, PyObject* KX_ObjectActuator::PySetForceLimitZ(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
float vecArg[2]; float vecArg[2];
int bToggle = 0; int bToggle = 0;
@@ -613,7 +593,7 @@ PyObject* KX_ObjectActuator::PySetForceLimitZ(PyObject* self,
} }
/* 4. getPID */ /* 4. getPID */
PyObject* KX_ObjectActuator::PyGetPID(PyObject* self) PyObject* KX_ObjectActuator::PyGetPID()
{ {
PyObject *retVal = PyList_New(3); PyObject *retVal = PyList_New(3);
@@ -624,9 +604,7 @@ PyObject* KX_ObjectActuator::PyGetPID(PyObject* self)
return retVal; return retVal;
} }
/* 5. setPID */ /* 5. setPID */
PyObject* KX_ObjectActuator::PySetPID(PyObject* self, PyObject* KX_ObjectActuator::PySetPID(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
float vecArg[3]; float vecArg[3];
if (!PyArg_ParseTuple(args, "fff:setPID", &vecArg[0], &vecArg[1], &vecArg[2])) { if (!PyArg_ParseTuple(args, "fff:setPID", &vecArg[0], &vecArg[1], &vecArg[2])) {

View File

@@ -156,27 +156,27 @@ public:
virtual PyObject* py_getattro(PyObject *attr); virtual PyObject* py_getattro(PyObject *attr);
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForce); KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForce);
KX_PYMETHOD(KX_ObjectActuator,SetForce); KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForce);
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetTorque); KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetTorque);
KX_PYMETHOD(KX_ObjectActuator,SetTorque); KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetTorque);
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDLoc); KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDLoc);
KX_PYMETHOD(KX_ObjectActuator,SetDLoc); KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetDLoc);
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDRot); KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDRot);
KX_PYMETHOD(KX_ObjectActuator,SetDRot); KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetDRot);
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetLinearVelocity); KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetLinearVelocity);
KX_PYMETHOD(KX_ObjectActuator,SetLinearVelocity); KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetLinearVelocity);
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetAngularVelocity); KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetAngularVelocity);
KX_PYMETHOD(KX_ObjectActuator,SetAngularVelocity); KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetAngularVelocity);
KX_PYMETHOD(KX_ObjectActuator,SetDamping); KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetDamping);
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDamping); KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDamping);
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitX); KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitX);
KX_PYMETHOD(KX_ObjectActuator,SetForceLimitX); KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForceLimitX);
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitY); KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitY);
KX_PYMETHOD(KX_ObjectActuator,SetForceLimitY); KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForceLimitY);
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitZ); KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitZ);
KX_PYMETHOD(KX_ObjectActuator,SetForceLimitZ); KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForceLimitZ);
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetPID); KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetPID);
KX_PYMETHOD(KX_ObjectActuator,SetPID); KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetPID);
}; };
#endif //__KX_OBJECTACTUATOR #endif //__KX_OBJECTACTUATOR

View File

@@ -221,7 +221,7 @@ const char KX_ParentActuator::SetObject_doc[] =
"setObject(object)\n" "setObject(object)\n"
"\t- object: KX_GameObject, string or None\n" "\t- object: KX_GameObject, string or None\n"
"\tSet the object to set as parent.\n"; "\tSet the object to set as parent.\n";
PyObject* KX_ParentActuator::PySetObject(PyObject* self, PyObject* value) { PyObject* KX_ParentActuator::PySetObject(PyObject* value) {
KX_GameObject *gameobj; KX_GameObject *gameobj;
ShowDeprecationWarning("setObject()", "the object property"); ShowDeprecationWarning("setObject()", "the object property");
@@ -246,7 +246,7 @@ const char KX_ParentActuator::GetObject_doc[] =
"getObject(name_only = 1)\n" "getObject(name_only = 1)\n"
"name_only - optional arg, when true will return the KX_GameObject rather then its name\n" "name_only - optional arg, when true will return the KX_GameObject rather then its name\n"
"\tReturns the object that is set to.\n"; "\tReturns the object that is set to.\n";
PyObject* KX_ParentActuator::PyGetObject(PyObject* self, PyObject* args) PyObject* KX_ParentActuator::PyGetObject(PyObject* args)
{ {
int ret_name_only = 1; int ret_name_only = 1;

View File

@@ -51,9 +51,7 @@ KX_PhysicsObjectWrapper::~KX_PhysicsObjectWrapper()
} }
PyObject* KX_PhysicsObjectWrapper::PySetPosition(PyObject* self, PyObject* KX_PhysicsObjectWrapper::PySetPosition(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
float x,y,z; float x,y,z;
if (PyArg_ParseTuple(args,"fff:setPosition",&x,&y,&z)) if (PyArg_ParseTuple(args,"fff:setPosition",&x,&y,&z))
@@ -67,9 +65,7 @@ PyObject* KX_PhysicsObjectWrapper::PySetPosition(PyObject* self,
} }
PyObject* KX_PhysicsObjectWrapper::PySetLinearVelocity(PyObject* self, PyObject* KX_PhysicsObjectWrapper::PySetLinearVelocity(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
float x,y,z; float x,y,z;
int local; int local;
@@ -83,9 +79,7 @@ PyObject* KX_PhysicsObjectWrapper::PySetLinearVelocity(PyObject* self,
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* KX_PhysicsObjectWrapper::PySetAngularVelocity(PyObject* self, PyObject* KX_PhysicsObjectWrapper::PySetAngularVelocity(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
float x,y,z; float x,y,z;
int local; int local;
@@ -99,9 +93,7 @@ PyObject* KX_PhysicsObjectWrapper::PySetAngularVelocity(PyObject* self,
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* KX_PhysicsObjectWrapper::PySetActive(PyObject* self, PyObject* KX_PhysicsObjectWrapper::PySetActive(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
int active; int active;
if (PyArg_ParseTuple(args,"i:setActive",&active)) if (PyArg_ParseTuple(args,"i:setActive",&active))

View File

@@ -42,10 +42,10 @@ public:
KX_PhysicsObjectWrapper(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsEnvironment* physenv,PyTypeObject *T = &Type); KX_PhysicsObjectWrapper(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsEnvironment* physenv,PyTypeObject *T = &Type);
virtual ~KX_PhysicsObjectWrapper(); virtual ~KX_PhysicsObjectWrapper();
KX_PYMETHOD(KX_PhysicsObjectWrapper , SetPosition); KX_PYMETHOD_VARARGS(KX_PhysicsObjectWrapper,SetPosition);
KX_PYMETHOD(KX_PhysicsObjectWrapper,SetLinearVelocity); KX_PYMETHOD_VARARGS(KX_PhysicsObjectWrapper,SetLinearVelocity);
KX_PYMETHOD(KX_PhysicsObjectWrapper,SetAngularVelocity); KX_PYMETHOD_VARARGS(KX_PhysicsObjectWrapper,SetAngularVelocity);
KX_PYMETHOD(KX_PhysicsObjectWrapper,SetActive); KX_PYMETHOD_VARARGS(KX_PhysicsObjectWrapper,SetActive);
private: private:
class PHY_IPhysicsController* m_ctrl; class PHY_IPhysicsController* m_ctrl;

View File

@@ -123,7 +123,7 @@ PyObject* KX_PolyProxy::py_getattro(PyObject *attr)
// the one of the polygon // the one of the polygon
RAS_MaterialBucket* polyBucket = m_polygon->GetMaterial(); RAS_MaterialBucket* polyBucket = m_polygon->GetMaterial();
unsigned int matid; unsigned int matid;
for (matid=0; matid<m_mesh->NumMaterials(); matid++) for (matid=0; matid<(unsigned int)m_mesh->NumMaterials(); matid++)
{ {
RAS_MeshMaterial* meshMat = m_mesh->GetMeshMaterial(matid); RAS_MeshMaterial* meshMat = m_mesh->GetMeshMaterial(matid);
if (meshMat->m_bucket == polyBucket) if (meshMat->m_bucket == polyBucket)
@@ -189,7 +189,7 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMaterialIndex,
{ {
RAS_MaterialBucket* polyBucket = m_polygon->GetMaterial(); RAS_MaterialBucket* polyBucket = m_polygon->GetMaterial();
unsigned int matid; unsigned int matid;
for (matid=0; matid<m_mesh->NumMaterials(); matid++) for (matid=0; matid<(unsigned int)m_mesh->NumMaterials(); matid++)
{ {
RAS_MeshMaterial* meshMat = m_mesh->GetMeshMaterial(matid); RAS_MeshMaterial* meshMat = m_mesh->GetMeshMaterial(matid);
if (meshMat->m_bucket == polyBucket) if (meshMat->m_bucket == polyBucket)

View File

@@ -183,9 +183,9 @@ from = Name of object to sned the string from";
static PyObject* gPySendMessage(PyObject*, PyObject* args) static PyObject* gPySendMessage(PyObject*, PyObject* args)
{ {
char* subject; char* subject;
char* body = ""; char* body = (char *)"";
char* to = ""; char* to = (char *)"";
char* from = ""; char* from = (char *)"";
if (!PyArg_ParseTuple(args, "s|sss:sendMessage", &subject, &body, &to, &from)) if (!PyArg_ParseTuple(args, "s|sss:sendMessage", &subject, &body, &to, &from))
return NULL; return NULL;
@@ -1422,7 +1422,7 @@ static void clearGameModules()
/* Note, user modules could still reference these modules /* Note, user modules could still reference these modules
* but since the dict's are cleared their members wont be accessible */ * but since the dict's are cleared their members wont be accessible */
PyObject *modules= PySys_GetObject("modules"); PyObject *modules= PySys_GetObject((char *)"modules");
clearModule(modules, "Expression"); clearModule(modules, "Expression");
clearModule(modules, "CValue"); clearModule(modules, "CValue");
clearModule(modules, "PhysicsConstraints"); clearModule(modules, "PhysicsConstraints");

View File

@@ -160,7 +160,7 @@ void initPyTypes(void)
/* For now just do PyType_Ready */ /* For now just do PyType_Ready */
PyObject *mod= PyModule_New("GameTypes"); PyObject *mod= PyModule_New("GameTypes");
PyObject *dict= PyModule_GetDict(mod); PyObject *dict= PyModule_GetDict(mod);
PyDict_SetItemString(PySys_GetObject("modules"), "GameTypes", mod); PyDict_SetItemString(PySys_GetObject((char *)"modules"), (char *)"GameTypes", mod);
Py_DECREF(mod); Py_DECREF(mod);
PyType_Ready_Attr(dict, BL_ActionActuator); PyType_Ready_Attr(dict, BL_ActionActuator);

View File

@@ -207,7 +207,7 @@ const char KX_RadarSensor::GetConeOrigin_doc[] =
"getConeOrigin()\n" "getConeOrigin()\n"
"\tReturns the origin of the cone with which to test. The origin\n" "\tReturns the origin of the cone with which to test. The origin\n"
"\tis in the middle of the cone."; "\tis in the middle of the cone.";
PyObject* KX_RadarSensor::PyGetConeOrigin(PyObject* self) { PyObject* KX_RadarSensor::PyGetConeOrigin() {
ShowDeprecationWarning("getConeOrigin()", "the coneOrigin property"); ShowDeprecationWarning("getConeOrigin()", "the coneOrigin property");
PyObject *retVal = PyList_New(3); PyObject *retVal = PyList_New(3);
@@ -223,7 +223,7 @@ PyObject* KX_RadarSensor::PyGetConeOrigin(PyObject* self) {
const char KX_RadarSensor::GetConeTarget_doc[] = const char KX_RadarSensor::GetConeTarget_doc[] =
"getConeTarget()\n" "getConeTarget()\n"
"\tReturns the center of the bottom face of the cone with which to test.\n"; "\tReturns the center of the bottom face of the cone with which to test.\n";
PyObject* KX_RadarSensor::PyGetConeTarget(PyObject* self) { PyObject* KX_RadarSensor::PyGetConeTarget() {
ShowDeprecationWarning("getConeTarget()", "the coneTarget property"); ShowDeprecationWarning("getConeTarget()", "the coneTarget property");
PyObject *retVal = PyList_New(3); PyObject *retVal = PyList_New(3);
@@ -239,7 +239,7 @@ PyObject* KX_RadarSensor::PyGetConeTarget(PyObject* self) {
const char KX_RadarSensor::GetConeHeight_doc[] = const char KX_RadarSensor::GetConeHeight_doc[] =
"getConeHeight()\n" "getConeHeight()\n"
"\tReturns the height of the cone with which to test.\n"; "\tReturns the height of the cone with which to test.\n";
PyObject* KX_RadarSensor::PyGetConeHeight(PyObject* self) { PyObject* KX_RadarSensor::PyGetConeHeight() {
ShowDeprecationWarning("getConeHeight()", "the distance property"); ShowDeprecationWarning("getConeHeight()", "the distance property");

View File

@@ -384,7 +384,7 @@ PyObject* KX_RaySensor::pyattr_get_hitobject(void *self_v, const KX_PYATTRIBUTE_
const char KX_RaySensor::GetHitObject_doc[] = const char KX_RaySensor::GetHitObject_doc[] =
"getHitObject()\n" "getHitObject()\n"
"\tReturns the name of the object that was hit by this ray.\n"; "\tReturns the name of the object that was hit by this ray.\n";
PyObject* KX_RaySensor::PyGetHitObject(PyObject* self) PyObject* KX_RaySensor::PyGetHitObject()
{ {
ShowDeprecationWarning("getHitObject()", "the hitObject property"); ShowDeprecationWarning("getHitObject()", "the hitObject property");
if (m_hitObject) if (m_hitObject)
@@ -398,7 +398,7 @@ PyObject* KX_RaySensor::PyGetHitObject(PyObject* self)
const char KX_RaySensor::GetHitPosition_doc[] = const char KX_RaySensor::GetHitPosition_doc[] =
"getHitPosition()\n" "getHitPosition()\n"
"\tReturns the position (in worldcoordinates) where the object was hit by this ray.\n"; "\tReturns the position (in worldcoordinates) where the object was hit by this ray.\n";
PyObject* KX_RaySensor::PyGetHitPosition(PyObject* self) PyObject* KX_RaySensor::PyGetHitPosition()
{ {
ShowDeprecationWarning("getHitPosition()", "the hitPosition property"); ShowDeprecationWarning("getHitPosition()", "the hitPosition property");
@@ -414,7 +414,7 @@ PyObject* KX_RaySensor::PyGetHitPosition(PyObject* self)
const char KX_RaySensor::GetRayDirection_doc[] = const char KX_RaySensor::GetRayDirection_doc[] =
"getRayDirection()\n" "getRayDirection()\n"
"\tReturns the direction from the ray (in worldcoordinates) .\n"; "\tReturns the direction from the ray (in worldcoordinates) .\n";
PyObject* KX_RaySensor::PyGetRayDirection(PyObject* self) PyObject* KX_RaySensor::PyGetRayDirection()
{ {
ShowDeprecationWarning("getRayDirection()", "the rayDirection property"); ShowDeprecationWarning("getRayDirection()", "the rayDirection property");
@@ -430,7 +430,7 @@ PyObject* KX_RaySensor::PyGetRayDirection(PyObject* self)
const char KX_RaySensor::GetHitNormal_doc[] = const char KX_RaySensor::GetHitNormal_doc[] =
"getHitNormal()\n" "getHitNormal()\n"
"\tReturns the normal (in worldcoordinates) of the object at the location where the object was hit by this ray.\n"; "\tReturns the normal (in worldcoordinates) of the object at the location where the object was hit by this ray.\n";
PyObject* KX_RaySensor::PyGetHitNormal(PyObject* self) PyObject* KX_RaySensor::PyGetHitNormal()
{ {
ShowDeprecationWarning("getHitNormal()", "the hitNormal property"); ShowDeprecationWarning("getHitNormal()", "the hitNormal property");

View File

@@ -271,7 +271,7 @@ const char KX_SCA_AddObjectActuator::SetObject_doc[] =
"\t- object: KX_GameObject, string or None\n" "\t- object: KX_GameObject, string or None\n"
"\tSets the object that will be added. There has to be an object\n" "\tSets the object that will be added. There has to be an object\n"
"\tof this name. If not, this function does nothing.\n"; "\tof this name. If not, this function does nothing.\n";
PyObject* KX_SCA_AddObjectActuator::PySetObject(PyObject* self, PyObject* value) PyObject* KX_SCA_AddObjectActuator::PySetObject(PyObject* value)
{ {
KX_GameObject *gameobj; KX_GameObject *gameobj;
@@ -300,7 +300,7 @@ const char KX_SCA_AddObjectActuator::SetTime_doc[] =
"\tIf the duration is negative, it is set to 0.\n"; "\tIf the duration is negative, it is set to 0.\n";
PyObject* KX_SCA_AddObjectActuator::PySetTime(PyObject* self, PyObject* value) PyObject* KX_SCA_AddObjectActuator::PySetTime(PyObject* value)
{ {
ShowDeprecationWarning("setTime()", "the time property"); ShowDeprecationWarning("setTime()", "the time property");
int deltatime = PyInt_AsLong(value); int deltatime = PyInt_AsLong(value);
@@ -323,7 +323,7 @@ const char KX_SCA_AddObjectActuator::GetTime_doc[] =
"\tReturns the lifetime of the object that will be added.\n"; "\tReturns the lifetime of the object that will be added.\n";
PyObject* KX_SCA_AddObjectActuator::PyGetTime(PyObject* self) PyObject* KX_SCA_AddObjectActuator::PyGetTime()
{ {
ShowDeprecationWarning("getTime()", "the time property"); ShowDeprecationWarning("getTime()", "the time property");
return PyInt_FromLong(m_timeProp); return PyInt_FromLong(m_timeProp);
@@ -335,7 +335,7 @@ const char KX_SCA_AddObjectActuator::GetObject_doc[] =
"getObject(name_only = 1)\n" "getObject(name_only = 1)\n"
"name_only - optional arg, when true will return the KX_GameObject rather then its name\n" "name_only - optional arg, when true will return the KX_GameObject rather then its name\n"
"\tReturns the name of the object that will be added.\n"; "\tReturns the name of the object that will be added.\n";
PyObject* KX_SCA_AddObjectActuator::PyGetObject(PyObject* self, PyObject* args) PyObject* KX_SCA_AddObjectActuator::PyGetObject(PyObject* args)
{ {
int ret_name_only = 1; int ret_name_only = 1;
@@ -361,7 +361,7 @@ const char KX_SCA_AddObjectActuator::GetLinearVelocity_doc[] =
"\tReturns the linear velocity that will be assigned to \n" "\tReturns the linear velocity that will be assigned to \n"
"\tthe created object.\n"; "\tthe created object.\n";
PyObject* KX_SCA_AddObjectActuator::PyGetLinearVelocity(PyObject* self) PyObject* KX_SCA_AddObjectActuator::PyGetLinearVelocity()
{ {
ShowDeprecationWarning("getLinearVelocity()", "the linearVelocity property"); ShowDeprecationWarning("getLinearVelocity()", "the linearVelocity property");
PyObject *retVal = PyList_New(3); PyObject *retVal = PyList_New(3);
@@ -384,7 +384,7 @@ const char KX_SCA_AddObjectActuator::SetLinearVelocity_doc[] =
"\t- local: bool\n" "\t- local: bool\n"
"\tAssign this velocity to the created object. \n"; "\tAssign this velocity to the created object. \n";
PyObject* KX_SCA_AddObjectActuator::PySetLinearVelocity(PyObject* self, PyObject* args) PyObject* KX_SCA_AddObjectActuator::PySetLinearVelocity(PyObject* args)
{ {
ShowDeprecationWarning("setLinearVelocity()", "the linearVelocity property"); ShowDeprecationWarning("setLinearVelocity()", "the linearVelocity property");
@@ -404,7 +404,7 @@ const char KX_SCA_AddObjectActuator::GetAngularVelocity_doc[] =
"\tReturns the angular velocity that will be assigned to \n" "\tReturns the angular velocity that will be assigned to \n"
"\tthe created object.\n"; "\tthe created object.\n";
PyObject* KX_SCA_AddObjectActuator::PyGetAngularVelocity(PyObject* self) PyObject* KX_SCA_AddObjectActuator::PyGetAngularVelocity()
{ {
ShowDeprecationWarning("getAngularVelocity()", "the angularVelocity property"); ShowDeprecationWarning("getAngularVelocity()", "the angularVelocity property");
PyObject *retVal = PyList_New(3); PyObject *retVal = PyList_New(3);
@@ -427,7 +427,7 @@ const char KX_SCA_AddObjectActuator::SetAngularVelocity_doc[] =
"\t- local: bool\n" "\t- local: bool\n"
"\tAssign this angular velocity to the created object. \n"; "\tAssign this angular velocity to the created object. \n";
PyObject* KX_SCA_AddObjectActuator::PySetAngularVelocity(PyObject* self, PyObject* args) PyObject* KX_SCA_AddObjectActuator::PySetAngularVelocity(PyObject* args)
{ {
ShowDeprecationWarning("setAngularVelocity()", "the angularVelocity property"); ShowDeprecationWarning("setAngularVelocity()", "the angularVelocity property");
@@ -468,7 +468,7 @@ void KX_SCA_AddObjectActuator::InstantAddObject()
} }
} }
PyObject* KX_SCA_AddObjectActuator::PyInstantAddObject(PyObject* self) PyObject* KX_SCA_AddObjectActuator::PyInstantAddObject()
{ {
InstantAddObject(); InstantAddObject();
@@ -483,7 +483,7 @@ const char KX_SCA_AddObjectActuator::GetLastCreatedObject_doc[] =
"\tReturn the last created object. \n"; "\tReturn the last created object. \n";
PyObject* KX_SCA_AddObjectActuator::PyGetLastCreatedObject(PyObject* self) PyObject* KX_SCA_AddObjectActuator::PyGetLastCreatedObject()
{ {
ShowDeprecationWarning("getLastCreatedObject()", "the objectLastCreated property"); ShowDeprecationWarning("getLastCreatedObject()", "the objectLastCreated property");
SCA_IObject* result = this->GetLastCreatedObject(); SCA_IObject* result = this->GetLastCreatedObject();

View File

@@ -141,7 +141,7 @@ const char KX_SCA_ReplaceMeshActuator::SetMesh_doc[] =
"\t- name: string or None\n" "\t- name: string or None\n"
"\tSet the mesh that will be substituted for the current one.\n"; "\tSet the mesh that will be substituted for the current one.\n";
PyObject* KX_SCA_ReplaceMeshActuator::PySetMesh(PyObject* self, PyObject* value) PyObject* KX_SCA_ReplaceMeshActuator::PySetMesh(PyObject* value)
{ {
ShowDeprecationWarning("setMesh()", "the mesh property"); ShowDeprecationWarning("setMesh()", "the mesh property");
if (value == Py_None) { if (value == Py_None) {

View File

@@ -263,9 +263,9 @@ PyMethodDef KX_SceneActuator::Methods[] =
{"setUseRestart", (PyCFunction) KX_SceneActuator::sPySetUseRestart, METH_VARARGS, (PY_METHODCHAR)SetUseRestart_doc}, {"setUseRestart", (PyCFunction) KX_SceneActuator::sPySetUseRestart, METH_VARARGS, (PY_METHODCHAR)SetUseRestart_doc},
{"setScene", (PyCFunction) KX_SceneActuator::sPySetScene, METH_VARARGS, (PY_METHODCHAR)SetScene_doc}, {"setScene", (PyCFunction) KX_SceneActuator::sPySetScene, METH_VARARGS, (PY_METHODCHAR)SetScene_doc},
{"setCamera", (PyCFunction) KX_SceneActuator::sPySetCamera, METH_VARARGS, (PY_METHODCHAR)SetCamera_doc}, {"setCamera", (PyCFunction) KX_SceneActuator::sPySetCamera, METH_VARARGS, (PY_METHODCHAR)SetCamera_doc},
{"getUseRestart", (PyCFunction) KX_SceneActuator::sPyGetUseRestart, METH_VARARGS, (PY_METHODCHAR)GetUseRestart_doc}, {"getUseRestart", (PyCFunction) KX_SceneActuator::sPyGetUseRestart, METH_NOARGS, (PY_METHODCHAR)GetUseRestart_doc},
{"getScene", (PyCFunction) KX_SceneActuator::sPyGetScene, METH_VARARGS, (PY_METHODCHAR)GetScene_doc}, {"getScene", (PyCFunction) KX_SceneActuator::sPyGetScene, METH_NOARGS, (PY_METHODCHAR)GetScene_doc},
{"getCamera", (PyCFunction) KX_SceneActuator::sPyGetCamera, METH_VARARGS, (PY_METHODCHAR)GetCamera_doc}, {"getCamera", (PyCFunction) KX_SceneActuator::sPyGetCamera, METH_NOARGS, (PY_METHODCHAR)GetCamera_doc},
//<----- Deprecated //<----- Deprecated
{NULL,NULL} //Sentinel {NULL,NULL} //Sentinel
}; };
@@ -353,9 +353,7 @@ const char KX_SceneActuator::SetUseRestart_doc[] =
"setUseRestart(flag)\n" "setUseRestart(flag)\n"
"\t- flag: 0 or 1.\n" "\t- flag: 0 or 1.\n"
"\tSet flag to 1 to restart the scene.\n" ; "\tSet flag to 1 to restart the scene.\n" ;
PyObject* KX_SceneActuator::PySetUseRestart(PyObject* self, PyObject* KX_SceneActuator::PySetUseRestart(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
ShowDeprecationWarning("setUseRestart()", "(no replacement)"); ShowDeprecationWarning("setUseRestart()", "(no replacement)");
int boolArg; int boolArg;
@@ -376,9 +374,7 @@ PyObject* KX_SceneActuator::PySetUseRestart(PyObject* self,
const char KX_SceneActuator::GetUseRestart_doc[] = const char KX_SceneActuator::GetUseRestart_doc[] =
"getUseRestart()\n" "getUseRestart()\n"
"\tReturn whether the scene will be restarted.\n" ; "\tReturn whether the scene will be restarted.\n" ;
PyObject* KX_SceneActuator::PyGetUseRestart(PyObject* self, PyObject* KX_SceneActuator::PyGetUseRestart()
PyObject* args,
PyObject* kwds)
{ {
ShowDeprecationWarning("getUseRestart()", "(no replacement)"); ShowDeprecationWarning("getUseRestart()", "(no replacement)");
return PyInt_FromLong(!(m_restart == 0)); return PyInt_FromLong(!(m_restart == 0));
@@ -391,9 +387,7 @@ const char KX_SceneActuator::SetScene_doc[] =
"setScene(scene)\n" "setScene(scene)\n"
"\t- scene: string\n" "\t- scene: string\n"
"\tSet the name of scene the actuator will switch to.\n" ; "\tSet the name of scene the actuator will switch to.\n" ;
PyObject* KX_SceneActuator::PySetScene(PyObject* self, PyObject* KX_SceneActuator::PySetScene(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
ShowDeprecationWarning("setScene()", "the scene property"); ShowDeprecationWarning("setScene()", "the scene property");
/* one argument: a scene, ignore the rest */ /* one argument: a scene, ignore the rest */
@@ -416,9 +410,7 @@ PyObject* KX_SceneActuator::PySetScene(PyObject* self,
const char KX_SceneActuator::GetScene_doc[] = const char KX_SceneActuator::GetScene_doc[] =
"getScene()\n" "getScene()\n"
"\tReturn the name of the scene the actuator wants to switch to.\n" ; "\tReturn the name of the scene the actuator wants to switch to.\n" ;
PyObject* KX_SceneActuator::PyGetScene(PyObject* self, PyObject* KX_SceneActuator::PyGetScene()
PyObject* args,
PyObject* kwds)
{ {
ShowDeprecationWarning("getScene()", "the scene property"); ShowDeprecationWarning("getScene()", "the scene property");
return PyString_FromString(m_nextSceneName); return PyString_FromString(m_nextSceneName);
@@ -431,9 +423,7 @@ const char KX_SceneActuator::SetCamera_doc[] =
"setCamera(camera)\n" "setCamera(camera)\n"
"\t- camera: string\n" "\t- camera: string\n"
"\tSet the camera to switch to.\n" ; "\tSet the camera to switch to.\n" ;
PyObject* KX_SceneActuator::PySetCamera(PyObject* self, PyObject* KX_SceneActuator::PySetCamera(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
ShowDeprecationWarning("setCamera()", "the camera property"); ShowDeprecationWarning("setCamera()", "the camera property");
PyObject *cam; PyObject *cam;
@@ -483,9 +473,7 @@ PyObject* KX_SceneActuator::PySetCamera(PyObject* self,
const char KX_SceneActuator::GetCamera_doc[] = const char KX_SceneActuator::GetCamera_doc[] =
"getCamera()\n" "getCamera()\n"
"\tReturn the name of the camera to switch to.\n" ; "\tReturn the name of the camera to switch to.\n" ;
PyObject* KX_SceneActuator::PyGetCamera(PyObject* self, PyObject* KX_SceneActuator::PyGetCamera()
PyObject* args,
PyObject* kwds)
{ {
ShowDeprecationWarning("getCamera()", "the camera property"); ShowDeprecationWarning("getCamera()", "the camera property");
if (m_camera) { if (m_camera) {

View File

@@ -99,17 +99,17 @@ class KX_SceneActuator : public SCA_IActuator
/* Removed */ /* Removed */
/* 2. setUseRestart: */ /* 2. setUseRestart: */
KX_PYMETHOD_DOC(KX_SceneActuator,SetUseRestart); KX_PYMETHOD_DOC_VARARGS(KX_SceneActuator,SetUseRestart);
/* 3. getUseRestart: */ /* 3. getUseRestart: */
KX_PYMETHOD_DOC(KX_SceneActuator,GetUseRestart); KX_PYMETHOD_DOC_NOARGS(KX_SceneActuator,GetUseRestart);
/* 4. setScene: */ /* 4. setScene: */
KX_PYMETHOD_DOC(KX_SceneActuator,SetScene); KX_PYMETHOD_DOC_VARARGS(KX_SceneActuator,SetScene);
/* 5. getScene: */ /* 5. getScene: */
KX_PYMETHOD_DOC(KX_SceneActuator,GetScene); KX_PYMETHOD_DOC_NOARGS(KX_SceneActuator,GetScene);
/* 6. setCamera: */ /* 6. setCamera: */
KX_PYMETHOD_DOC(KX_SceneActuator,SetCamera); KX_PYMETHOD_DOC_VARARGS(KX_SceneActuator,SetCamera);
/* 7. getCamera: */ /* 7. getCamera: */
KX_PYMETHOD_DOC(KX_SceneActuator,GetCamera); KX_PYMETHOD_DOC_NOARGS(KX_SceneActuator,GetCamera);
static PyObject* pyattr_get_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_set_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); static int pyattr_set_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);

View File

@@ -267,20 +267,20 @@ PyParentObject KX_SoundActuator::Parents[] = {
PyMethodDef KX_SoundActuator::Methods[] = { PyMethodDef KX_SoundActuator::Methods[] = {
// Deprecated -----> // Deprecated ----->
{"setFilename", (PyCFunction) KX_SoundActuator::sPySetFilename, METH_VARARGS,NULL}, {"setFilename", (PyCFunction) KX_SoundActuator::sPySetFilename, METH_VARARGS,NULL},
{"getFilename", (PyCFunction) KX_SoundActuator::sPyGetFilename, METH_VARARGS,NULL}, {"getFilename", (PyCFunction) KX_SoundActuator::sPyGetFilename, METH_NOARGS,NULL},
{"setGain",(PyCFunction) KX_SoundActuator::sPySetGain,METH_VARARGS,NULL}, {"setGain",(PyCFunction) KX_SoundActuator::sPySetGain,METH_VARARGS,NULL},
{"getGain",(PyCFunction) KX_SoundActuator::sPyGetGain,METH_VARARGS,NULL}, {"getGain",(PyCFunction) KX_SoundActuator::sPyGetGain,METH_NOARGS,NULL},
{"setPitch",(PyCFunction) KX_SoundActuator::sPySetPitch,METH_VARARGS,NULL}, {"setPitch",(PyCFunction) KX_SoundActuator::sPySetPitch,METH_VARARGS,NULL},
{"getPitch",(PyCFunction) KX_SoundActuator::sPyGetPitch,METH_VARARGS,NULL}, {"getPitch",(PyCFunction) KX_SoundActuator::sPyGetPitch,METH_NOARGS,NULL},
{"setRollOffFactor",(PyCFunction) KX_SoundActuator::sPySetRollOffFactor,METH_VARARGS,NULL}, {"setRollOffFactor",(PyCFunction) KX_SoundActuator::sPySetRollOffFactor,METH_VARARGS,NULL},
{"getRollOffFactor",(PyCFunction) KX_SoundActuator::sPyGetRollOffFactor,METH_VARARGS,NULL}, {"getRollOffFactor",(PyCFunction) KX_SoundActuator::sPyGetRollOffFactor,METH_NOARGS,NULL},
{"setLooping",(PyCFunction) KX_SoundActuator::sPySetLooping,METH_VARARGS,NULL}, {"setLooping",(PyCFunction) KX_SoundActuator::sPySetLooping,METH_VARARGS,NULL},
{"getLooping",(PyCFunction) KX_SoundActuator::sPyGetLooping,METH_VARARGS,NULL}, {"getLooping",(PyCFunction) KX_SoundActuator::sPyGetLooping,METH_NOARGS,NULL},
{"setPosition",(PyCFunction) KX_SoundActuator::sPySetPosition,METH_VARARGS,NULL}, {"setPosition",(PyCFunction) KX_SoundActuator::sPySetPosition,METH_VARARGS,NULL},
{"setVelocity",(PyCFunction) KX_SoundActuator::sPySetVelocity,METH_VARARGS,NULL}, {"setVelocity",(PyCFunction) KX_SoundActuator::sPySetVelocity,METH_VARARGS,NULL},
{"setOrientation",(PyCFunction) KX_SoundActuator::sPySetOrientation,METH_VARARGS,NULL}, {"setOrientation",(PyCFunction) KX_SoundActuator::sPySetOrientation,METH_VARARGS,NULL},
{"setType",(PyCFunction) KX_SoundActuator::sPySetType,METH_VARARGS,NULL}, {"setType",(PyCFunction) KX_SoundActuator::sPySetType,METH_VARARGS,NULL},
{"getType",(PyCFunction) KX_SoundActuator::sPyGetType,METH_VARARGS,NULL}, {"getType",(PyCFunction) KX_SoundActuator::sPyGetType,METH_NOARGS,NULL},
// <----- // <-----
KX_PYMETHODTABLE_NOARGS(KX_SoundActuator, startSound), KX_PYMETHODTABLE_NOARGS(KX_SoundActuator, startSound),
@@ -587,7 +587,7 @@ int KX_SoundActuator::pyattr_set_orientation(void *self, const struct KX_PYATTRI
} }
// Deprecated -----> // Deprecated ----->
PyObject* KX_SoundActuator::PySetFilename(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_SoundActuator::PySetFilename(PyObject* args)
{ {
char *soundName = NULL; char *soundName = NULL;
ShowDeprecationWarning("setFilename()", "the filename property"); ShowDeprecationWarning("setFilename()", "the filename property");
@@ -599,7 +599,7 @@ PyObject* KX_SoundActuator::PySetFilename(PyObject* self, PyObject* args, PyObje
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* KX_SoundActuator::PyGetFilename(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_SoundActuator::PyGetFilename()
{ {
ShowDeprecationWarning("getFilename()", "the filename property"); ShowDeprecationWarning("getFilename()", "the filename property");
if (!m_soundObject) if (!m_soundObject)
@@ -616,7 +616,7 @@ PyObject* KX_SoundActuator::PyGetFilename(PyObject* self, PyObject* args, PyObje
return PyString_FromString(name); return PyString_FromString(name);
} }
PyObject* KX_SoundActuator::PySetGain(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_SoundActuator::PySetGain(PyObject* args)
{ {
ShowDeprecationWarning("setGain()", "the volume property"); ShowDeprecationWarning("setGain()", "the volume property");
float gain = 1.0; float gain = 1.0;
@@ -631,7 +631,7 @@ PyObject* KX_SoundActuator::PySetGain(PyObject* self, PyObject* args, PyObject*
PyObject* KX_SoundActuator::PyGetGain(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_SoundActuator::PyGetGain()
{ {
ShowDeprecationWarning("getGain()", "the volume property"); ShowDeprecationWarning("getGain()", "the volume property");
float gain = (m_soundObject) ? m_soundObject->GetGain() : 1.0f; float gain = (m_soundObject) ? m_soundObject->GetGain() : 1.0f;
@@ -642,7 +642,7 @@ PyObject* KX_SoundActuator::PyGetGain(PyObject* self, PyObject* args, PyObject*
PyObject* KX_SoundActuator::PySetPitch(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_SoundActuator::PySetPitch(PyObject* args)
{ {
ShowDeprecationWarning("setPitch()", "the pitch property"); ShowDeprecationWarning("setPitch()", "the pitch property");
float pitch = 1.0; float pitch = 1.0;
@@ -657,7 +657,7 @@ PyObject* KX_SoundActuator::PySetPitch(PyObject* self, PyObject* args, PyObject*
PyObject* KX_SoundActuator::PyGetPitch(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_SoundActuator::PyGetPitch()
{ {
ShowDeprecationWarning("getPitch()", "the pitch property"); ShowDeprecationWarning("getPitch()", "the pitch property");
float pitch = (m_soundObject) ? m_soundObject->GetPitch() : 1.0; float pitch = (m_soundObject) ? m_soundObject->GetPitch() : 1.0;
@@ -668,7 +668,7 @@ PyObject* KX_SoundActuator::PyGetPitch(PyObject* self, PyObject* args, PyObject*
PyObject* KX_SoundActuator::PySetRollOffFactor(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_SoundActuator::PySetRollOffFactor(PyObject* args)
{ {
ShowDeprecationWarning("setRollOffFactor()", "the rollOffFactor property"); ShowDeprecationWarning("setRollOffFactor()", "the rollOffFactor property");
float rollofffactor = 1.0; float rollofffactor = 1.0;
@@ -683,7 +683,7 @@ PyObject* KX_SoundActuator::PySetRollOffFactor(PyObject* self, PyObject* args, P
PyObject* KX_SoundActuator::PyGetRollOffFactor(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_SoundActuator::PyGetRollOffFactor()
{ {
ShowDeprecationWarning("getRollOffFactor()", "the rollOffFactor property"); ShowDeprecationWarning("getRollOffFactor()", "the rollOffFactor property");
float rollofffactor = (m_soundObject) ? m_soundObject->GetRollOffFactor() : 1.0; float rollofffactor = (m_soundObject) ? m_soundObject->GetRollOffFactor() : 1.0;
@@ -694,7 +694,7 @@ PyObject* KX_SoundActuator::PyGetRollOffFactor(PyObject* self, PyObject* args, P
PyObject* KX_SoundActuator::PySetLooping(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_SoundActuator::PySetLooping(PyObject* args)
{ {
ShowDeprecationWarning("setLooping()", "the looping property"); ShowDeprecationWarning("setLooping()", "the looping property");
bool looping = 1; bool looping = 1;
@@ -709,7 +709,7 @@ PyObject* KX_SoundActuator::PySetLooping(PyObject* self, PyObject* args, PyObjec
PyObject* KX_SoundActuator::PyGetLooping(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_SoundActuator::PyGetLooping()
{ {
ShowDeprecationWarning("getLooping()", "the looping property"); ShowDeprecationWarning("getLooping()", "the looping property");
int looping = (m_soundObject) ? m_soundObject->GetLoopMode() : (int)SND_LOOP_OFF; int looping = (m_soundObject) ? m_soundObject->GetLoopMode() : (int)SND_LOOP_OFF;
@@ -720,7 +720,7 @@ PyObject* KX_SoundActuator::PyGetLooping(PyObject* self, PyObject* args, PyObjec
PyObject* KX_SoundActuator::PySetPosition(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_SoundActuator::PySetPosition(PyObject* args)
{ {
MT_Point3 pos; MT_Point3 pos;
ShowDeprecationWarning("setPosition()", "the position property"); ShowDeprecationWarning("setPosition()", "the position property");
@@ -739,7 +739,7 @@ PyObject* KX_SoundActuator::PySetPosition(PyObject* self, PyObject* args, PyObje
PyObject* KX_SoundActuator::PySetVelocity(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_SoundActuator::PySetVelocity(PyObject* args)
{ {
MT_Vector3 vel; MT_Vector3 vel;
ShowDeprecationWarning("setVelocity()", "the velocity property"); ShowDeprecationWarning("setVelocity()", "the velocity property");
@@ -758,7 +758,7 @@ PyObject* KX_SoundActuator::PySetVelocity(PyObject* self, PyObject* args, PyObje
PyObject* KX_SoundActuator::PySetOrientation(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_SoundActuator::PySetOrientation(PyObject* args)
{ {
MT_Matrix3x3 ori; MT_Matrix3x3 ori;
ShowDeprecationWarning("setOrientation()", "the orientation property"); ShowDeprecationWarning("setOrientation()", "the orientation property");
@@ -781,7 +781,7 @@ PyObject* KX_SoundActuator::PySetOrientation(PyObject* self, PyObject* args, PyO
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* KX_SoundActuator::PySetType(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_SoundActuator::PySetType(PyObject* args)
{ {
int typeArg; int typeArg;
ShowDeprecationWarning("setType()", "the type property"); ShowDeprecationWarning("setType()", "the type property");
@@ -798,7 +798,7 @@ PyObject* KX_SoundActuator::PySetType(PyObject* self, PyObject* args, PyObject*
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* KX_SoundActuator::PyGetType(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_SoundActuator::PyGetType()
{ {
ShowDeprecationWarning("getType()", "the type property"); ShowDeprecationWarning("getType()", "the type property");
return PyInt_FromLong(m_type); return PyInt_FromLong(m_type);

View File

@@ -108,21 +108,21 @@ public:
static PyObject* pyattr_get_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
// Deprecated -----> // Deprecated ----->
KX_PYMETHOD(KX_SoundActuator,SetFilename); KX_PYMETHOD_VARARGS(KX_SoundActuator,SetFilename);
KX_PYMETHOD(KX_SoundActuator,GetFilename); KX_PYMETHOD_NOARGS(KX_SoundActuator,GetFilename);
KX_PYMETHOD(KX_SoundActuator,SetGain); KX_PYMETHOD_VARARGS(KX_SoundActuator,SetGain);
KX_PYMETHOD(KX_SoundActuator,GetGain); KX_PYMETHOD_NOARGS(KX_SoundActuator,GetGain);
KX_PYMETHOD(KX_SoundActuator,SetPitch); KX_PYMETHOD_VARARGS(KX_SoundActuator,SetPitch);
KX_PYMETHOD(KX_SoundActuator,GetPitch); KX_PYMETHOD_NOARGS(KX_SoundActuator,GetPitch);
KX_PYMETHOD(KX_SoundActuator,SetRollOffFactor); KX_PYMETHOD_VARARGS(KX_SoundActuator,SetRollOffFactor);
KX_PYMETHOD(KX_SoundActuator,GetRollOffFactor); KX_PYMETHOD_NOARGS(KX_SoundActuator,GetRollOffFactor);
KX_PYMETHOD(KX_SoundActuator,SetLooping); KX_PYMETHOD_VARARGS(KX_SoundActuator,SetLooping);
KX_PYMETHOD(KX_SoundActuator,GetLooping); KX_PYMETHOD_NOARGS(KX_SoundActuator,GetLooping);
KX_PYMETHOD(KX_SoundActuator,SetPosition); KX_PYMETHOD_VARARGS(KX_SoundActuator,SetPosition);
KX_PYMETHOD(KX_SoundActuator,SetVelocity); KX_PYMETHOD_VARARGS(KX_SoundActuator,SetVelocity);
KX_PYMETHOD(KX_SoundActuator,SetOrientation); KX_PYMETHOD_VARARGS(KX_SoundActuator,SetOrientation);
KX_PYMETHOD(KX_SoundActuator,SetType); KX_PYMETHOD_VARARGS(KX_SoundActuator,SetType);
KX_PYMETHOD(KX_SoundActuator,GetType); KX_PYMETHOD_NOARGS(KX_SoundActuator,GetType);
// <----- // <-----
}; };

View File

@@ -173,9 +173,7 @@ KX_StateActuator::SetOperation_doc[] =
"\tUse setMask() to specify the bits that will be modified.\n"; "\tUse setMask() to specify the bits that will be modified.\n";
PyObject* PyObject*
KX_StateActuator::PySetOperation(PyObject* self, KX_StateActuator::PySetOperation(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setOperation()", "the operation property"); ShowDeprecationWarning("setOperation()", "the operation property");
int oper; int oper;
@@ -199,9 +197,7 @@ KX_StateActuator::SetMask_doc[] =
"\twhich copies the value to the object state.\n"; "\twhich copies the value to the object state.\n";
PyObject* PyObject*
KX_StateActuator::PySetMask(PyObject* self, KX_StateActuator::PySetMask(PyObject* args) {
PyObject* args,
PyObject* kwds) {
ShowDeprecationWarning("setMask()", "the mask property"); ShowDeprecationWarning("setMask()", "the mask property");
int mask; int mask;

View File

@@ -78,8 +78,8 @@ class KX_StateActuator : public SCA_IActuator
virtual PyObject* py_getattro(PyObject *attr); virtual PyObject* py_getattro(PyObject *attr);
virtual int py_setattro(PyObject *attr, PyObject* value); virtual int py_setattro(PyObject *attr, PyObject* value);
//KX_PYMETHOD_DOC //KX_PYMETHOD_DOC
KX_PYMETHOD_DOC(KX_StateActuator,SetOperation); KX_PYMETHOD_DOC_VARARGS(KX_StateActuator,SetOperation);
KX_PYMETHOD_DOC(KX_StateActuator,SetMask); KX_PYMETHOD_DOC_VARARGS(KX_StateActuator,SetMask);
}; };
#endif #endif

View File

@@ -310,7 +310,7 @@ const char KX_TouchSensor::SetProperty_doc[] =
"\tSet the property or material to collide with. Use\n" "\tSet the property or material to collide with. Use\n"
"\tsetTouchMaterial() to switch between properties and\n" "\tsetTouchMaterial() to switch between properties and\n"
"\tmaterials."; "\tmaterials.";
PyObject* KX_TouchSensor::PySetProperty(PyObject* self, PyObject* value) PyObject* KX_TouchSensor::PySetProperty(PyObject* value)
{ {
ShowDeprecationWarning("setProperty()", "the propertyName property"); ShowDeprecationWarning("setProperty()", "the propertyName property");
char *nameArg= PyString_AsString(value); char *nameArg= PyString_AsString(value);
@@ -328,14 +328,14 @@ const char KX_TouchSensor::GetProperty_doc[] =
"\tReturns the property or material to collide with. Use\n" "\tReturns the property or material to collide with. Use\n"
"\tgetTouchMaterial() to find out whether this sensor\n" "\tgetTouchMaterial() to find out whether this sensor\n"
"\tlooks for properties or materials."; "\tlooks for properties or materials.";
PyObject* KX_TouchSensor::PyGetProperty(PyObject* self) { PyObject* KX_TouchSensor::PyGetProperty() {
return PyString_FromString(m_touchedpropname); return PyString_FromString(m_touchedpropname);
} }
const char KX_TouchSensor::GetHitObject_doc[] = const char KX_TouchSensor::GetHitObject_doc[] =
"getHitObject()\n" "getHitObject()\n"
; ;
PyObject* KX_TouchSensor::PyGetHitObject(PyObject* self) PyObject* KX_TouchSensor::PyGetHitObject()
{ {
ShowDeprecationWarning("getHitObject()", "the objectHit property"); ShowDeprecationWarning("getHitObject()", "the objectHit property");
/* to do: do Py_IncRef if the object is already known in Python */ /* to do: do Py_IncRef if the object is already known in Python */
@@ -351,7 +351,7 @@ const char KX_TouchSensor::GetHitObjectList_doc[] =
"getHitObjectList()\n" "getHitObjectList()\n"
"\tReturn a list of the objects this object collided with,\n" "\tReturn a list of the objects this object collided with,\n"
"\tbut only those matching the property/material condition.\n"; "\tbut only those matching the property/material condition.\n";
PyObject* KX_TouchSensor::PyGetHitObjectList(PyObject* self) PyObject* KX_TouchSensor::PyGetHitObjectList()
{ {
ShowDeprecationWarning("getHitObjectList()", "the objectHitList property"); ShowDeprecationWarning("getHitObjectList()", "the objectHitList property");
/* to do: do Py_IncRef if the object is already known in Python */ /* to do: do Py_IncRef if the object is already known in Python */
@@ -367,7 +367,7 @@ const char KX_TouchSensor::GetTouchMaterial_doc[] =
"getTouchMaterial()\n" "getTouchMaterial()\n"
"\tReturns KX_TRUE if this sensor looks for a specific material,\n" "\tReturns KX_TRUE if this sensor looks for a specific material,\n"
"\tKX_FALSE if it looks for a specific property.\n" ; "\tKX_FALSE if it looks for a specific property.\n" ;
PyObject* KX_TouchSensor::PyGetTouchMaterial(PyObject* self) PyObject* KX_TouchSensor::PyGetTouchMaterial()
{ {
ShowDeprecationWarning("getTouchMaterial()", "the materialCheck property"); ShowDeprecationWarning("getTouchMaterial()", "the materialCheck property");
return PyInt_FromLong(m_bFindMaterial); return PyInt_FromLong(m_bFindMaterial);
@@ -380,7 +380,7 @@ const char KX_TouchSensor::SetTouchMaterial_doc[] =
"\t- flag: KX_TRUE or KX_FALSE.\n" "\t- flag: KX_TRUE or KX_FALSE.\n"
"\tSet flag to KX_TRUE to switch on positive pulse mode,\n" "\tSet flag to KX_TRUE to switch on positive pulse mode,\n"
"\tKX_FALSE to switch off positive pulse mode.\n" ; "\tKX_FALSE to switch off positive pulse mode.\n" ;
PyObject* KX_TouchSensor::PySetTouchMaterial(PyObject* self, PyObject *value) PyObject* KX_TouchSensor::PySetTouchMaterial(PyObject *value)
{ {
int pulseArg = PyInt_AsLong(value); int pulseArg = PyInt_AsLong(value);

View File

@@ -458,9 +458,9 @@ PyParentObject KX_TrackToActuator::Parents[] = {
PyMethodDef KX_TrackToActuator::Methods[] = { PyMethodDef KX_TrackToActuator::Methods[] = {
// ---> deprecated // ---> deprecated
{"setTime", (PyCFunction) KX_TrackToActuator::sPySetTime, METH_VARARGS, (PY_METHODCHAR)SetTime_doc}, {"setTime", (PyCFunction) KX_TrackToActuator::sPySetTime, METH_VARARGS, (PY_METHODCHAR)SetTime_doc},
{"getTime", (PyCFunction) KX_TrackToActuator::sPyGetTime, METH_VARARGS, (PY_METHODCHAR)GetTime_doc}, {"getTime", (PyCFunction) KX_TrackToActuator::sPyGetTime, METH_NOARGS, (PY_METHODCHAR)GetTime_doc},
{"setUse3D", (PyCFunction) KX_TrackToActuator::sPySetUse3D, METH_VARARGS, (PY_METHODCHAR)SetUse3D_doc}, {"setUse3D", (PyCFunction) KX_TrackToActuator::sPySetUse3D, METH_VARARGS, (PY_METHODCHAR)SetUse3D_doc},
{"getUse3D", (PyCFunction) KX_TrackToActuator::sPyGetUse3D, METH_VARARGS, (PY_METHODCHAR)GetUse3D_doc}, {"getUse3D", (PyCFunction) KX_TrackToActuator::sPyGetUse3D, METH_NOARGS, (PY_METHODCHAR)GetUse3D_doc},
{"setObject", (PyCFunction) KX_TrackToActuator::sPySetObject, METH_O, (PY_METHODCHAR)SetObject_doc}, {"setObject", (PyCFunction) KX_TrackToActuator::sPySetObject, METH_O, (PY_METHODCHAR)SetObject_doc},
{"getObject", (PyCFunction) KX_TrackToActuator::sPyGetObject, METH_VARARGS, (PY_METHODCHAR)GetObject_doc}, {"getObject", (PyCFunction) KX_TrackToActuator::sPyGetObject, METH_VARARGS, (PY_METHODCHAR)GetObject_doc},
@@ -519,7 +519,7 @@ const char KX_TrackToActuator::SetObject_doc[] =
"setObject(object)\n" "setObject(object)\n"
"\t- object: KX_GameObject, string or None\n" "\t- object: KX_GameObject, string or None\n"
"\tSet the object to track with the parent of this actuator.\n"; "\tSet the object to track with the parent of this actuator.\n";
PyObject* KX_TrackToActuator::PySetObject(PyObject* self, PyObject* value) PyObject* KX_TrackToActuator::PySetObject(PyObject* value)
{ {
KX_GameObject *gameobj; KX_GameObject *gameobj;
@@ -545,7 +545,7 @@ const char KX_TrackToActuator::GetObject_doc[] =
"getObject(name_only = 1)\n" "getObject(name_only = 1)\n"
"name_only - optional arg, when true will return the KX_GameObject rather then its name\n" "name_only - optional arg, when true will return the KX_GameObject rather then its name\n"
"\tReturns the object to track with the parent of this actuator\n"; "\tReturns the object to track with the parent of this actuator\n";
PyObject* KX_TrackToActuator::PyGetObject(PyObject* self, PyObject* args) PyObject* KX_TrackToActuator::PyGetObject(PyObject* args)
{ {
int ret_name_only = 1; int ret_name_only = 1;
@@ -570,7 +570,7 @@ const char KX_TrackToActuator::SetTime_doc[] =
"setTime(time)\n" "setTime(time)\n"
"\t- time: integer\n" "\t- time: integer\n"
"\tSet the time in frames with which to delay the tracking motion.\n"; "\tSet the time in frames with which to delay the tracking motion.\n";
PyObject* KX_TrackToActuator::PySetTime(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_TrackToActuator::PySetTime(PyObject* args)
{ {
ShowDeprecationWarning("setTime()", "the timer property"); ShowDeprecationWarning("setTime()", "the timer property");
int timeArg; int timeArg;
@@ -592,7 +592,7 @@ const char KX_TrackToActuator::GetTime_doc[] =
"getTime()\n" "getTime()\n"
"\t- time: integer\n" "\t- time: integer\n"
"\tReturn the time in frames with which the tracking motion is delayed.\n"; "\tReturn the time in frames with which the tracking motion is delayed.\n";
PyObject* KX_TrackToActuator::PyGetTime(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_TrackToActuator::PyGetTime()
{ {
ShowDeprecationWarning("getTime()", "the timer property"); ShowDeprecationWarning("getTime()", "the timer property");
return PyInt_FromLong(m_time); return PyInt_FromLong(m_time);
@@ -604,7 +604,7 @@ PyObject* KX_TrackToActuator::PyGetTime(PyObject* self, PyObject* args, PyObject
const char KX_TrackToActuator::GetUse3D_doc[] = const char KX_TrackToActuator::GetUse3D_doc[] =
"getUse3D()\n" "getUse3D()\n"
"\tReturns 1 if the motion is allowed to extend in the z-direction.\n"; "\tReturns 1 if the motion is allowed to extend in the z-direction.\n";
PyObject* KX_TrackToActuator::PyGetUse3D(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_TrackToActuator::PyGetUse3D()
{ {
ShowDeprecationWarning("setTime()", "the use3D property"); ShowDeprecationWarning("setTime()", "the use3D property");
return PyInt_FromLong(!(m_allow3D == 0)); return PyInt_FromLong(!(m_allow3D == 0));
@@ -618,7 +618,7 @@ const char KX_TrackToActuator::SetUse3D_doc[] =
"\t- value: 0 or 1\n" "\t- value: 0 or 1\n"
"\tSet to 1 to allow the tracking motion to extend in the z-direction,\n" "\tSet to 1 to allow the tracking motion to extend in the z-direction,\n"
"\tset to 0 to lock the tracking motion to the x-y plane.\n"; "\tset to 0 to lock the tracking motion to the x-y plane.\n";
PyObject* KX_TrackToActuator::PySetUse3D(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_TrackToActuator::PySetUse3D(PyObject* args)
{ {
ShowDeprecationWarning("setTime()", "the use3D property"); ShowDeprecationWarning("setTime()", "the use3D property");
int boolArg; int boolArg;

View File

@@ -84,13 +84,13 @@ class KX_TrackToActuator : public SCA_IActuator
/* 2. getObject */ /* 2. getObject */
KX_PYMETHOD_DOC_VARARGS(KX_TrackToActuator,GetObject); KX_PYMETHOD_DOC_VARARGS(KX_TrackToActuator,GetObject);
/* 3. setTime */ /* 3. setTime */
KX_PYMETHOD_DOC(KX_TrackToActuator,SetTime); KX_PYMETHOD_DOC_VARARGS(KX_TrackToActuator,SetTime);
/* 4. getTime */ /* 4. getTime */
KX_PYMETHOD_DOC(KX_TrackToActuator,GetTime); KX_PYMETHOD_DOC_NOARGS(KX_TrackToActuator,GetTime);
/* 5. getUse3D */ /* 5. getUse3D */
KX_PYMETHOD_DOC(KX_TrackToActuator,GetUse3D); KX_PYMETHOD_DOC_NOARGS(KX_TrackToActuator,GetUse3D);
/* 6. setUse3D */ /* 6. setUse3D */
KX_PYMETHOD_DOC(KX_TrackToActuator,SetUse3D); KX_PYMETHOD_DOC_VARARGS(KX_TrackToActuator,SetUse3D);
}; /* end of class KX_TrackToActuator : public KX_EditObjectActuator */ }; /* end of class KX_TrackToActuator : public KX_EditObjectActuator */

View File

@@ -35,9 +35,7 @@ KX_VehicleWrapper::~KX_VehicleWrapper()
} }
PyObject* KX_VehicleWrapper::PyAddWheel(PyObject* self, PyObject* KX_VehicleWrapper::PyAddWheel(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
PyObject* pylistPos,*pylistDir,*pylistAxleDir; PyObject* pylistPos,*pylistDir,*pylistAxleDir;
@@ -85,9 +83,7 @@ PyObject* KX_VehicleWrapper::PyAddWheel(PyObject* self,
PyObject* KX_VehicleWrapper::PyGetWheelPosition(PyObject* self, PyObject* KX_VehicleWrapper::PyGetWheelPosition(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
int wheelIndex; int wheelIndex;
@@ -102,9 +98,7 @@ PyObject* KX_VehicleWrapper::PyGetWheelPosition(PyObject* self,
return NULL; return NULL;
} }
PyObject* KX_VehicleWrapper::PyGetWheelRotation(PyObject* self, PyObject* KX_VehicleWrapper::PyGetWheelRotation(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
int wheelIndex; int wheelIndex;
if (PyArg_ParseTuple(args,"i:getWheelRotation",&wheelIndex)) if (PyArg_ParseTuple(args,"i:getWheelRotation",&wheelIndex))
@@ -114,9 +108,7 @@ PyObject* KX_VehicleWrapper::PyGetWheelRotation(PyObject* self,
return NULL; return NULL;
} }
PyObject* KX_VehicleWrapper::PyGetWheelOrientationQuaternion(PyObject* self, PyObject* KX_VehicleWrapper::PyGetWheelOrientationQuaternion(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
int wheelIndex; int wheelIndex;
if (PyArg_ParseTuple(args,"i:getWheelOrientationQuaternion",&wheelIndex)) if (PyArg_ParseTuple(args,"i:getWheelOrientationQuaternion",&wheelIndex))
@@ -132,26 +124,20 @@ PyObject* KX_VehicleWrapper::PyGetWheelOrientationQuaternion(PyObject* self,
} }
PyObject* KX_VehicleWrapper::PyGetNumWheels(PyObject* self, PyObject* KX_VehicleWrapper::PyGetNumWheels(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
return PyInt_FromLong(m_vehicle->GetNumWheels()); return PyInt_FromLong(m_vehicle->GetNumWheels());
} }
PyObject* KX_VehicleWrapper::PyGetConstraintId(PyObject* self, PyObject* KX_VehicleWrapper::PyGetConstraintId(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
return PyInt_FromLong(m_vehicle->GetUserConstraintId()); return PyInt_FromLong(m_vehicle->GetUserConstraintId());
} }
PyObject* KX_VehicleWrapper::PyApplyEngineForce(PyObject* self, PyObject* KX_VehicleWrapper::PyApplyEngineForce(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
float force; float force;
int wheelIndex; int wheelIndex;
@@ -167,9 +153,7 @@ PyObject* KX_VehicleWrapper::PyApplyEngineForce(PyObject* self,
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* KX_VehicleWrapper::PySetTyreFriction(PyObject* self, PyObject* KX_VehicleWrapper::PySetTyreFriction(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
float wheelFriction; float wheelFriction;
int wheelIndex; int wheelIndex;
@@ -184,9 +168,7 @@ PyObject* KX_VehicleWrapper::PySetTyreFriction(PyObject* self,
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* KX_VehicleWrapper::PySetSuspensionStiffness(PyObject* self, PyObject* KX_VehicleWrapper::PySetSuspensionStiffness(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
float suspensionStiffness; float suspensionStiffness;
int wheelIndex; int wheelIndex;
@@ -201,9 +183,7 @@ PyObject* KX_VehicleWrapper::PySetSuspensionStiffness(PyObject* self,
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* KX_VehicleWrapper::PySetSuspensionDamping(PyObject* self, PyObject* KX_VehicleWrapper::PySetSuspensionDamping(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
float suspensionDamping; float suspensionDamping;
int wheelIndex; int wheelIndex;
@@ -217,9 +197,7 @@ PyObject* KX_VehicleWrapper::PySetSuspensionDamping(PyObject* self,
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* KX_VehicleWrapper::PySetSuspensionCompression(PyObject* self, PyObject* KX_VehicleWrapper::PySetSuspensionCompression(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
float suspensionCompression; float suspensionCompression;
int wheelIndex; int wheelIndex;
@@ -233,9 +211,7 @@ PyObject* KX_VehicleWrapper::PySetSuspensionCompression(PyObject* self,
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* KX_VehicleWrapper::PySetRollInfluence(PyObject* self, PyObject* KX_VehicleWrapper::PySetRollInfluence(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
float rollInfluence; float rollInfluence;
int wheelIndex; int wheelIndex;
@@ -251,9 +227,7 @@ PyObject* KX_VehicleWrapper::PySetRollInfluence(PyObject* self,
} }
PyObject* KX_VehicleWrapper::PyApplyBraking(PyObject* self, PyObject* KX_VehicleWrapper::PyApplyBraking(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
float braking; float braking;
int wheelIndex; int wheelIndex;
@@ -271,9 +245,7 @@ PyObject* KX_VehicleWrapper::PyApplyBraking(PyObject* self,
PyObject* KX_VehicleWrapper::PySetSteeringValue(PyObject* self, PyObject* KX_VehicleWrapper::PySetSteeringValue(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
float steeringValue; float steeringValue;
int wheelIndex; int wheelIndex;
@@ -289,9 +261,7 @@ PyObject* KX_VehicleWrapper::PySetSteeringValue(PyObject* self,
} }
PyObject* KX_VehicleWrapper::PyGetConstraintType(PyObject* self, PyObject* KX_VehicleWrapper::PyGetConstraintType(PyObject* args)
PyObject* args,
PyObject* kwds)
{ {
return PyInt_FromLong(m_vehicle->GetUserConstraintType()); return PyInt_FromLong(m_vehicle->GetUserConstraintType());
} }

View File

@@ -23,31 +23,31 @@ public:
int getConstraintId(); int getConstraintId();
KX_PYMETHOD(KX_VehicleWrapper,AddWheel); KX_PYMETHOD_VARARGS(KX_VehicleWrapper,AddWheel);
KX_PYMETHOD(KX_VehicleWrapper,GetNumWheels); KX_PYMETHOD_VARARGS(KX_VehicleWrapper,GetNumWheels);
KX_PYMETHOD(KX_VehicleWrapper,GetWheelOrientationQuaternion); KX_PYMETHOD_VARARGS(KX_VehicleWrapper,GetWheelOrientationQuaternion);
KX_PYMETHOD(KX_VehicleWrapper,GetWheelRotation); KX_PYMETHOD_VARARGS(KX_VehicleWrapper,GetWheelRotation);
KX_PYMETHOD(KX_VehicleWrapper,GetWheelPosition); KX_PYMETHOD_VARARGS(KX_VehicleWrapper,GetWheelPosition);
KX_PYMETHOD(KX_VehicleWrapper,GetConstraintId); KX_PYMETHOD_VARARGS(KX_VehicleWrapper,GetConstraintId);
KX_PYMETHOD(KX_VehicleWrapper,GetConstraintType); KX_PYMETHOD_VARARGS(KX_VehicleWrapper,GetConstraintType);
KX_PYMETHOD(KX_VehicleWrapper,SetSteeringValue); KX_PYMETHOD_VARARGS(KX_VehicleWrapper,SetSteeringValue);
KX_PYMETHOD(KX_VehicleWrapper,ApplyEngineForce); KX_PYMETHOD_VARARGS(KX_VehicleWrapper,ApplyEngineForce);
KX_PYMETHOD(KX_VehicleWrapper,ApplyBraking); KX_PYMETHOD_VARARGS(KX_VehicleWrapper,ApplyBraking);
KX_PYMETHOD(KX_VehicleWrapper,SetTyreFriction); KX_PYMETHOD_VARARGS(KX_VehicleWrapper,SetTyreFriction);
KX_PYMETHOD(KX_VehicleWrapper,SetSuspensionStiffness); KX_PYMETHOD_VARARGS(KX_VehicleWrapper,SetSuspensionStiffness);
KX_PYMETHOD(KX_VehicleWrapper,SetSuspensionDamping); KX_PYMETHOD_VARARGS(KX_VehicleWrapper,SetSuspensionDamping);
KX_PYMETHOD(KX_VehicleWrapper,SetSuspensionCompression); KX_PYMETHOD_VARARGS(KX_VehicleWrapper,SetSuspensionCompression);
KX_PYMETHOD(KX_VehicleWrapper,SetRollInfluence); KX_PYMETHOD_VARARGS(KX_VehicleWrapper,SetRollInfluence);
private: private:

View File

@@ -341,12 +341,12 @@ void KX_VertexProxy::ReplicaSetName(STR_String) {};
// stuff for python integration // stuff for python integration
PyObject* KX_VertexProxy::PyGetXYZ(PyObject*) PyObject* KX_VertexProxy::PyGetXYZ()
{ {
return PyObjectFrom(MT_Point3(m_vertex->getXYZ())); return PyObjectFrom(MT_Point3(m_vertex->getXYZ()));
} }
PyObject* KX_VertexProxy::PySetXYZ(PyObject*, PyObject* value) PyObject* KX_VertexProxy::PySetXYZ(PyObject* value)
{ {
MT_Point3 vec; MT_Point3 vec;
if (!PyVecTo(value, vec)) if (!PyVecTo(value, vec))
@@ -357,12 +357,12 @@ PyObject* KX_VertexProxy::PySetXYZ(PyObject*, PyObject* value)
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* KX_VertexProxy::PyGetNormal(PyObject*) PyObject* KX_VertexProxy::PyGetNormal()
{ {
return PyObjectFrom(MT_Vector3(m_vertex->getNormal())); return PyObjectFrom(MT_Vector3(m_vertex->getNormal()));
} }
PyObject* KX_VertexProxy::PySetNormal(PyObject*, PyObject* value) PyObject* KX_VertexProxy::PySetNormal(PyObject* value)
{ {
MT_Vector3 vec; MT_Vector3 vec;
if (!PyVecTo(value, vec)) if (!PyVecTo(value, vec))
@@ -374,13 +374,13 @@ PyObject* KX_VertexProxy::PySetNormal(PyObject*, PyObject* value)
} }
PyObject* KX_VertexProxy::PyGetRGBA(PyObject*) PyObject* KX_VertexProxy::PyGetRGBA()
{ {
int *rgba = (int *) m_vertex->getRGBA(); int *rgba = (int *) m_vertex->getRGBA();
return PyInt_FromLong(*rgba); return PyInt_FromLong(*rgba);
} }
PyObject* KX_VertexProxy::PySetRGBA(PyObject*, PyObject* value) PyObject* KX_VertexProxy::PySetRGBA(PyObject* value)
{ {
if PyInt_Check(value) { if PyInt_Check(value) {
int rgba = PyInt_AsLong(value); int rgba = PyInt_AsLong(value);
@@ -403,12 +403,12 @@ PyObject* KX_VertexProxy::PySetRGBA(PyObject*, PyObject* value)
} }
PyObject* KX_VertexProxy::PyGetUV(PyObject*) PyObject* KX_VertexProxy::PyGetUV()
{ {
return PyObjectFrom(MT_Vector2(m_vertex->getUV1())); return PyObjectFrom(MT_Vector2(m_vertex->getUV1()));
} }
PyObject* KX_VertexProxy::PySetUV(PyObject*, PyObject* value) PyObject* KX_VertexProxy::PySetUV(PyObject* value)
{ {
MT_Point2 vec; MT_Point2 vec;
if (!PyVecTo(value, vec)) if (!PyVecTo(value, vec))
@@ -419,12 +419,12 @@ PyObject* KX_VertexProxy::PySetUV(PyObject*, PyObject* value)
Py_RETURN_NONE; Py_RETURN_NONE;
} }
PyObject* KX_VertexProxy::PyGetUV2(PyObject*) PyObject* KX_VertexProxy::PyGetUV2()
{ {
return PyObjectFrom(MT_Vector2(m_vertex->getUV2())); return PyObjectFrom(MT_Vector2(m_vertex->getUV2()));
} }
PyObject* KX_VertexProxy::PySetUV2(PyObject*, PyObject* args) PyObject* KX_VertexProxy::PySetUV2(PyObject* args)
{ {
MT_Point2 vec; MT_Point2 vec;
unsigned int unit=0; unsigned int unit=0;

View File

@@ -157,9 +157,7 @@ KX_VisibilityActuator::SetVisible_doc[] =
"\tSet the properties of the actuator.\n"; "\tSet the properties of the actuator.\n";
PyObject* PyObject*
KX_VisibilityActuator::PySetVisible(PyObject* self, KX_VisibilityActuator::PySetVisible(PyObject* args) {
PyObject* args,
PyObject* kwds) {
int vis; int vis;
ShowDeprecationWarning("SetVisible()", "the visible property"); ShowDeprecationWarning("SetVisible()", "the visible property");

View File

@@ -73,7 +73,7 @@ class KX_VisibilityActuator : public SCA_IActuator
virtual int py_setattro(PyObject *attr, PyObject *value); virtual int py_setattro(PyObject *attr, PyObject *value);
// Deprecated -----> // Deprecated ----->
KX_PYMETHOD_DOC(KX_VisibilityActuator,SetVisible); KX_PYMETHOD_DOC_VARARGS(KX_VisibilityActuator,SetVisible);
// <----- // <-----

View File

@@ -107,7 +107,7 @@ public:
} }
CcdShapeConstructionInfo* GetChildShape(int i) CcdShapeConstructionInfo* GetChildShape(int i)
{ {
if (i < 0 || i >= m_shapeArray.size()) if (i < 0 || i >= (int)m_shapeArray.size())
return NULL; return NULL;
return m_shapeArray.at(i); return m_shapeArray.at(i);
@@ -116,7 +116,7 @@ public:
{ {
if (shapeInfo == NULL) if (shapeInfo == NULL)
return -1; return -1;
for (int i=0; i<m_shapeArray.size(); i++) for (int i=0; i<(int)m_shapeArray.size(); i++)
{ {
CcdShapeConstructionInfo* childInfo = m_shapeArray.at(i); CcdShapeConstructionInfo* childInfo = m_shapeArray.at(i);
if ((userData == NULL || userData == childInfo->m_userData) && if ((userData == NULL || userData == childInfo->m_userData) &&
@@ -130,10 +130,10 @@ public:
bool RemoveChildShape(int i) bool RemoveChildShape(int i)
{ {
if (i < 0 || i >= m_shapeArray.size()) if (i < 0 || i >= (int)m_shapeArray.size())
return false; return false;
m_shapeArray.at(i)->Release(); m_shapeArray.at(i)->Release();
if (i < m_shapeArray.size()-1) if (i < (int)m_shapeArray.size()-1)
m_shapeArray[i] = m_shapeArray.back(); m_shapeArray[i] = m_shapeArray.back();
m_shapeArray.pop_back(); m_shapeArray.pop_back();
return true; return true;