diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-07-04 04:30:44 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-07-04 04:30:44 +0400 |
commit | bd74679a397efa82ac81386bf8da5877bd32dded (patch) | |
tree | 51c04dc6cba42850eff3f9df2ca27508904f154a /source | |
parent | 5c93e756823cda49466ce7e546268d551fb7de2f (diff) |
small changes to py funcs that can run 100s of times a second, so python wont generate empty args tuple when they are not needed.
Diffstat (limited to 'source')
-rw-r--r-- | source/gameengine/GameLogic/SCA_ILogicBrick.cpp | 12 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_ILogicBrick.h | 4 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_ISensor.cpp | 2 |
3 files changed, 7 insertions, 11 deletions
diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index 8423d06dfcd..f6efd485adb 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -242,8 +242,8 @@ PyParentObject SCA_ILogicBrick::Parents[] = { PyMethodDef SCA_ILogicBrick::Methods[] = { - {"getOwner", (PyCFunction) SCA_ILogicBrick::sPyGetOwner, METH_VARARGS}, - {"getExecutePriority", (PyCFunction) SCA_ILogicBrick::sPySetExecutePriority, METH_VARARGS}, + {"getOwner", (PyCFunction) SCA_ILogicBrick::sPyGetOwner, METH_NOARGS}, + {"getExecutePriority", (PyCFunction) SCA_ILogicBrick::sPySetExecutePriority, METH_NOARGS}, {"setExecutePriority", (PyCFunction) SCA_ILogicBrick::sPySetExecutePriority, METH_VARARGS}, {NULL,NULL} //Sentinel }; @@ -258,9 +258,7 @@ SCA_ILogicBrick::_getattr(const STR_String& attr) -PyObject* SCA_ILogicBrick::PyGetOwner(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* SCA_ILogicBrick::PyGetOwner(PyObject* self) { CValue* parent = GetParent(); if (parent) @@ -294,9 +292,7 @@ PyObject* SCA_ILogicBrick::PySetExecutePriority(PyObject* self, -PyObject* SCA_ILogicBrick::PyGetExecutePriority(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* SCA_ILogicBrick::PyGetExecutePriority(PyObject* self) { return PyInt_FromLong(m_Execute_Ueber_Priority); } diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.h b/source/gameengine/GameLogic/SCA_ILogicBrick.h index f359ee0911b..80bc6ae3b86 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.h +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.h @@ -82,9 +82,9 @@ public: // python methods - KX_PYMETHOD(SCA_ILogicBrick,GetOwner); + KX_PYMETHOD_NOARGS(SCA_ILogicBrick,GetOwner); KX_PYMETHOD(SCA_ILogicBrick,SetExecutePriority); - KX_PYMETHOD(SCA_ILogicBrick,GetExecutePriority); + KX_PYMETHOD_NOARGS(SCA_ILogicBrick,GetExecutePriority); enum KX_BOOL_TYPE { KX_BOOL_NODEF = 0, diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index 6cfae9d8919..1b163deb7bb 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -118,7 +118,7 @@ void SCA_ISensor::Resume() { } void SCA_ISensor::Init() { - printf("Sensor %s has no init function, please report this bug to Blender.org\n", m_name); + printf("Sensor %s has no init function, please report this bug to Blender.org\n", m_name.Ptr()); } void SCA_ISensor::DecLink() { |