Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/Expressions')
-rw-r--r--source/gameengine/Expressions/ListValue.cpp12
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.cpp2
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.h50
-rw-r--r--source/gameengine/Expressions/Value.cpp4
4 files changed, 29 insertions, 39 deletions
diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp
index 4e14ce35eb9..5c7e6a4383e 100644
--- a/source/gameengine/Expressions/ListValue.cpp
+++ b/source/gameengine/Expressions/ListValue.cpp
@@ -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());
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;
@@ -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;
@@ -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);
diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp
index 3c414c6b16d..da761bd22cb 100644
--- a/source/gameengine/Expressions/PyObjectPlus.cpp
+++ b/source/gameengine/Expressions/PyObjectPlus.cpp
@@ -780,7 +780,7 @@ bool PyObjectPlus::isA(const char *mytypename) // check typename of each parent
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)) {
return PyBool_FromLong(isA((PyTypeObject *)value));
diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h
index 9f30e6570ee..370717a919b 100644
--- a/source/gameengine/Expressions/PyObjectPlus.h
+++ b/source/gameengine/Expressions/PyObjectPlus.h
@@ -180,62 +180,54 @@ typedef struct {
* macro is one that also requires a documentation string
*/
#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) { \
- PyObjectPlus *self_plus= BGE_PROXY_REF(self); \
- return ((class_name*)self_plus)->Py##method_name(self, args, kwds); \
+ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args, kwds); \
}; \
#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) { \
- PyObjectPlus *self_plus= BGE_PROXY_REF(self); \
- return ((class_name*)self_plus)->Py##method_name(self, args); \
+ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args); \
}; \
#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) { \
- PyObjectPlus *self_plus= BGE_PROXY_REF(self); \
- return ((class_name*)self_plus)->Py##method_name(self); \
+ return ((class_name*)BGE_PROXY_REF(self))->Py##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) { \
- PyObjectPlus *self_plus= ((PyObjectPlus_Proxy *)self)->ref; \
- return ((class_name*) self_plus)->Py##method_name(self, value); \
+ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(value); \
}; \
#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) { \
- PyObjectPlus *self_plus= BGE_PROXY_REF(self); \
- return ((class_name*)self_plus)->Py##method_name(self, args, kwds); \
+ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args, kwds); \
}; \
static const char method_name##_doc[]; \
#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) { \
- PyObjectPlus *self_plus= BGE_PROXY_REF(self); \
- return ((class_name*)self_plus)->Py##method_name(self, args); \
+ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args); \
}; \
static const char method_name##_doc[]; \
#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) { \
- PyObjectPlus *self_plus= BGE_PROXY_REF(self); \
- return ((class_name*)self_plus)->Py##method_name(self, value); \
+ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(value); \
}; \
static const char method_name##_doc[]; \
#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) { \
- PyObjectPlus *self_plus= BGE_PROXY_REF(self); \
- return ((class_name*)self_plus)->Py##method_name(self); \
+ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(); \
}; \
static const char method_name##_doc[]; \
@@ -258,19 +250,19 @@ typedef struct {
*/
#define KX_PYMETHODDEF_DOC(class_name, method_name, 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) \
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) \
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) \
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
@@ -453,8 +445,6 @@ public:
* which we cant use because we have our own subclass system */
bool isA(PyTypeObject *T);
bool isA(const char *mytypename);
- PyObject *PyisA(PyObject *value);
- //static PyObject *sPy_isA(PyObject *self, PyObject *value);
KX_PYMETHOD_O(PyObjectPlus,isA);
diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp
index 17813d0ab52..ca46d782992 100644
--- a/source/gameengine/Expressions/Value.cpp
+++ b/source/gameengine/Expressions/Value.cpp
@@ -67,7 +67,7 @@ PyMethodDef CValue::Methods[] = {
{NULL,NULL} //Sentinel
};
-PyObject* CValue::PyGetName(PyObject* self)
+PyObject* CValue::PyGetName()
{
return PyString_FromString(this->GetName());
}
@@ -797,7 +797,7 @@ void CValue::ShowDeprecationWarning(const char* old_way,const char* new_way)
PyObject *getframe, *frame;
PyObject *f_lineno, *f_code, *co_filename;
- getframe = PySys_GetObject("_getframe"); // borrowed
+ getframe = PySys_GetObject((char *)"_getframe"); // borrowed
if (getframe) {
frame = PyObject_CallObject(getframe, NULL);
if (frame) {