From 4c17f8e5de94f3abc65995e7a2964bb9e6ea7642 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 6 Nov 2011 01:39:36 +0000 Subject: PyUnicode_From_STR_String utility function which passes STR_String to PyUnicode_FromStringAndSize (saves a call to strlen). Also made CValue::ConvertKeysToPython use faster list creation and improved some of the macro formatting. --- source/gameengine/Converter/BL_ActionActuator.h | 6 +- source/gameengine/Converter/BL_ArmatureActuator.h | 2 +- .../gameengine/Converter/BL_ArmatureConstraint.h | 2 +- source/gameengine/Converter/BL_ArmatureObject.h | 2 +- .../gameengine/Converter/BL_ShapeActionActuator.h | 2 +- source/gameengine/Expressions/Expression.h | 32 ++- source/gameengine/Expressions/ListValue.h | 4 +- source/gameengine/Expressions/PyObjectPlus.cpp | 7 +- source/gameengine/Expressions/PyObjectPlus.h | 275 +++++++++++++-------- source/gameengine/Expressions/Value.cpp | 20 +- source/gameengine/Expressions/Value.h | 43 ++-- source/gameengine/GameLogic/SCA_2DFilterActuator.h | 2 +- source/gameengine/GameLogic/SCA_ANDController.h | 2 +- source/gameengine/GameLogic/SCA_ActuatorSensor.h | 2 +- source/gameengine/GameLogic/SCA_AlwaysSensor.h | 2 +- source/gameengine/GameLogic/SCA_DelaySensor.h | 2 +- .../GameLogic/SCA_ExpressionController.h | 2 +- source/gameengine/GameLogic/SCA_IController.h | 2 +- source/gameengine/GameLogic/SCA_ILogicBrick.h | 2 +- source/gameengine/GameLogic/SCA_IObject.h | 2 +- source/gameengine/GameLogic/SCA_ISensor.h | 2 +- source/gameengine/GameLogic/SCA_JoystickSensor.h | 6 +- source/gameengine/GameLogic/SCA_KeyboardSensor.h | 2 +- source/gameengine/GameLogic/SCA_MouseSensor.h | 2 +- source/gameengine/GameLogic/SCA_NANDController.h | 2 +- source/gameengine/GameLogic/SCA_NORController.h | 2 +- source/gameengine/GameLogic/SCA_ORController.h | 2 +- source/gameengine/GameLogic/SCA_PropertyActuator.h | 2 +- source/gameengine/GameLogic/SCA_PropertySensor.h | 2 +- .../gameengine/GameLogic/SCA_PythonController.cpp | 4 +- source/gameengine/GameLogic/SCA_PythonController.h | 2 +- source/gameengine/GameLogic/SCA_PythonKeyboard.h | 2 +- source/gameengine/GameLogic/SCA_PythonMouse.h | 2 +- source/gameengine/GameLogic/SCA_RandomActuator.h | 2 +- source/gameengine/GameLogic/SCA_RandomSensor.h | 2 +- source/gameengine/GameLogic/SCA_XNORController.h | 2 +- source/gameengine/GameLogic/SCA_XORController.h | 2 +- source/gameengine/Ketsji/BL_Shader.h | 2 +- .../Ketsji/KXNetwork/KX_NetworkMessageActuator.h | 2 +- .../Ketsji/KXNetwork/KX_NetworkMessageSensor.h | 2 +- source/gameengine/Ketsji/KX_ArmatureSensor.h | 2 +- source/gameengine/Ketsji/KX_BlenderMaterial.h | 2 +- source/gameengine/Ketsji/KX_Camera.h | 2 +- source/gameengine/Ketsji/KX_CameraActuator.h | 2 +- source/gameengine/Ketsji/KX_ConstraintActuator.h | 2 +- source/gameengine/Ketsji/KX_ConstraintWrapper.h | 2 +- source/gameengine/Ketsji/KX_FontObject.h | 2 +- source/gameengine/Ketsji/KX_GameActuator.h | 2 +- source/gameengine/Ketsji/KX_GameObject.cpp | 4 +- source/gameengine/Ketsji/KX_GameObject.h | 2 +- source/gameengine/Ketsji/KX_IpoActuator.h | 2 +- source/gameengine/Ketsji/KX_Light.h | 2 +- source/gameengine/Ketsji/KX_MeshProxy.cpp | 4 +- source/gameengine/Ketsji/KX_MeshProxy.h | 2 +- source/gameengine/Ketsji/KX_MouseFocusSensor.h | 2 +- source/gameengine/Ketsji/KX_NavMeshObject.h | 2 +- source/gameengine/Ketsji/KX_NearSensor.h | 2 +- source/gameengine/Ketsji/KX_ObjectActuator.h | 2 +- source/gameengine/Ketsji/KX_ParentActuator.h | 2 +- source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h | 2 +- source/gameengine/Ketsji/KX_PolyProxy.cpp | 4 +- source/gameengine/Ketsji/KX_PolyProxy.h | 2 +- source/gameengine/Ketsji/KX_PolygonMaterial.cpp | 4 +- source/gameengine/Ketsji/KX_PolygonMaterial.h | 2 +- source/gameengine/Ketsji/KX_RadarSensor.h | 2 +- source/gameengine/Ketsji/KX_RaySensor.h | 2 +- .../gameengine/Ketsji/KX_SCA_AddObjectActuator.h | 2 +- source/gameengine/Ketsji/KX_SCA_DynamicActuator.h | 2 +- .../gameengine/Ketsji/KX_SCA_EndObjectActuator.h | 2 +- .../gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h | 2 +- source/gameengine/Ketsji/KX_Scene.cpp | 2 +- source/gameengine/Ketsji/KX_Scene.h | 2 +- source/gameengine/Ketsji/KX_SceneActuator.h | 2 +- source/gameengine/Ketsji/KX_SoundActuator.h | 2 +- source/gameengine/Ketsji/KX_StateActuator.h | 2 +- source/gameengine/Ketsji/KX_SteeringActuator.h | 2 +- source/gameengine/Ketsji/KX_TouchSensor.h | 2 +- source/gameengine/Ketsji/KX_TrackToActuator.h | 2 +- source/gameengine/Ketsji/KX_VehicleWrapper.h | 2 +- source/gameengine/Ketsji/KX_VertexProxy.h | 2 +- source/gameengine/Ketsji/KX_VisibilityActuator.h | 2 +- 81 files changed, 317 insertions(+), 232 deletions(-) diff --git a/source/gameengine/Converter/BL_ActionActuator.h b/source/gameengine/Converter/BL_ActionActuator.h index 2fb774dad44..29300281bb5 100644 --- a/source/gameengine/Converter/BL_ActionActuator.h +++ b/source/gameengine/Converter/BL_ActionActuator.h @@ -40,7 +40,7 @@ class BL_ActionActuator : public SCA_IActuator { public: - Py_Header; + Py_Header BL_ActionActuator(SCA_IObject* gameobj, const STR_String& propname, const STR_String& framepropname, @@ -70,8 +70,8 @@ public: #ifdef WITH_PYTHON - KX_PYMETHOD_O(BL_ActionActuator,GetChannel); - KX_PYMETHOD_DOC(BL_ActionActuator,setChannel); + KX_PYMETHOD_O(BL_ActionActuator,GetChannel) + KX_PYMETHOD_DOC(BL_ActionActuator,setChannel) static PyObject* pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Converter/BL_ArmatureActuator.h b/source/gameengine/Converter/BL_ArmatureActuator.h index 8390444613c..344b76ec278 100644 --- a/source/gameengine/Converter/BL_ArmatureActuator.h +++ b/source/gameengine/Converter/BL_ArmatureActuator.h @@ -46,7 +46,7 @@ class BL_ArmatureActuator : public SCA_IActuator { - Py_Header; + Py_Header public: BL_ArmatureActuator(SCA_IObject* gameobj, int type, diff --git a/source/gameengine/Converter/BL_ArmatureConstraint.h b/source/gameengine/Converter/BL_ArmatureConstraint.h index 49a331e78a5..2abb36ff937 100644 --- a/source/gameengine/Converter/BL_ArmatureConstraint.h +++ b/source/gameengine/Converter/BL_ArmatureConstraint.h @@ -52,7 +52,7 @@ struct bPose; */ class BL_ArmatureConstraint : public PyObjectPlus { - Py_Header; + Py_Header private: struct bConstraint* m_constraint; diff --git a/source/gameengine/Converter/BL_ArmatureObject.h b/source/gameengine/Converter/BL_ArmatureObject.h index 9847558f708..745ffac0cb2 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.h +++ b/source/gameengine/Converter/BL_ArmatureObject.h @@ -51,7 +51,7 @@ class KX_BlenderSceneConverter; class BL_ArmatureObject : public KX_GameObject { - Py_Header; + Py_Header public: double GetLastFrame (); diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.h b/source/gameengine/Converter/BL_ShapeActionActuator.h index c4251b3c503..90f44acb672 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.h +++ b/source/gameengine/Converter/BL_ShapeActionActuator.h @@ -42,7 +42,7 @@ struct Key; class BL_ShapeActionActuator : public SCA_IActuator { public: - Py_Header; + Py_Header BL_ShapeActionActuator(SCA_IObject* gameobj, const STR_String& propname, const STR_String& framepropname, diff --git a/source/gameengine/Expressions/Expression.h b/source/gameengine/Expressions/Expression.h index 875bd758b68..b9232477c34 100644 --- a/source/gameengine/Expressions/Expression.h +++ b/source/gameengine/Expressions/Expression.h @@ -24,19 +24,25 @@ //extern int gRefCountExpr; // only for debugging purposes (detect mem.leaks) -#define PLUGIN_DECLARE_SERIAL_EXPRESSION(class_name,base_class_name) \ -public: \ - virtual base_class_name * Copy() { return new class_name; } \ - virtual bool EdSerialize(CompressorArchive& arch,class CFactoryManager* facmgr,bool bIsStoring); \ - virtual bool EdIdSerialize(CompressorArchive& arch,class CFactoryManager* facmgr,bool bIsStoring) \ -{ \ - if (bIsStoring) \ - { \ - unsigned char exprID = GetExpressionID(); \ - arch << exprID; \ - } \ - return true; \ -} \ +#define PLUGIN_DECLARE_SERIAL_EXPRESSION(class_name, base_class_name) \ +public: \ + virtual base_class_name * Copy() { \ + return new class_name; \ + } \ + virtual bool EdSerialize(CompressorArchive& arch, \ + class CFactoryManager* facmgr, \ + bool bIsStoring); \ + virtual bool EdIdSerialize(CompressorArchive& arch, \ + class CFactoryManager* facmgr, \ + bool bIsStoring) \ + { \ + if (bIsStoring) \ + { \ + unsigned char exprID = GetExpressionID(); \ + arch << exprID; \ + } \ + return true; \ + } \ diff --git a/source/gameengine/Expressions/ListValue.h b/source/gameengine/Expressions/ListValue.h index 76451215f82..26c11cccc7a 100644 --- a/source/gameengine/Expressions/ListValue.h +++ b/source/gameengine/Expressions/ListValue.h @@ -23,7 +23,7 @@ class CListValue : public CPropValue { - Py_Header; + Py_Header //PLUGIN_DECLARE_SERIAL (CListValue,CValue) public: @@ -58,7 +58,7 @@ public: void Resize(int num); void SetValue(int i,CValue* val); CValue* GetValue(int i){ assertd(i < m_pValueArray.size()); return m_pValueArray[i];} - int GetCount() { return m_pValueArray.size();}; + int GetCount() { return m_pValueArray.size(); } virtual const STR_String & GetText(); bool CheckEqual(CValue* first,CValue* second); diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 87f776a726e..f263bf15f02 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -470,7 +470,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef * case KX_PYATTRIBUTE_TYPE_STRING: { STR_String *val = reinterpret_cast(ptr); - return PyUnicode_FromString(*val); + return PyUnicode_From_STR_String(*val); } case KX_PYATTRIBUTE_TYPE_CHAR: { @@ -1171,6 +1171,11 @@ PyObject *PyObjectPlus::NewProxyPlus_Ext(PyObjectPlus *self, PyTypeObject *tp, v return self->m_proxy; } +PyObject *PyUnicode_From_STR_String(const STR_String& str) +{ + return PyUnicode_FromStringAndSize(str.ReadPtr(), str.Length()); +} + /////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////// /* deprecation warning management */ diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index f7bd1b91466..3e1c54b0cc7 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -29,11 +29,12 @@ * \ingroup expressions */ +#ifndef _PY_OBJECT_PLUS_H +#define _PY_OBJECT_PLUS_H + /* for now keep weakrefs optional */ #define USE_WEAKREFS -#ifndef _adr_py_lib_h_ // only process once, -#define _adr_py_lib_h_ // even if multiply included #ifndef __cplusplus // c++ only #error Must be compiled with C++ @@ -45,10 +46,6 @@ #include "SG_QList.h" #include -/*------------------------------ - * Python defines -------------------------------*/ - #ifdef WITH_PYTHON #ifdef USE_MATHUTILS extern "C" { @@ -110,7 +107,7 @@ typedef struct PyObjectPlus_Proxy { #define BGE_PROXY_PYOWNS(_self) (((PyObjectPlus_Proxy *)_self)->py_owns) #define BGE_PROXY_PYREF(_self) (((PyObjectPlus_Proxy *)_self)->py_ref) #ifdef USE_WEAKREFS - #define BGE_PROXY_WKREF(_self) (((PyObjectPlus_Proxy *)_self)->in_weakreflist) +# define BGE_PROXY_WKREF(_self) (((PyObjectPlus_Proxy *)_self)->in_weakreflist) #endif /* Note, sometimes we dont care what BGE type this is as long as its a proxy */ @@ -124,45 +121,61 @@ typedef struct PyObjectPlus_Proxy { // PyC++ class // AttributesPtr correspond to attributes of proxy generic pointer // each PyC++ class must be registered in KX_PythonInitTypes.cpp -#define __Py_Header \ - public: \ - static PyTypeObject Type; \ - static PyMethodDef Methods[]; \ - static PyAttributeDef Attributes[]; \ - virtual PyTypeObject *GetType(void) {return &Type;}; \ - virtual PyObject *GetProxy() {return GetProxyPlus_Ext(this, &Type, NULL);}; \ - virtual PyObject *NewProxy(bool py_owns) {return NewProxyPlus_Ext(this, &Type, NULL, py_owns);}; \ +#define __Py_Header \ +public: \ + static PyTypeObject Type; \ + static PyMethodDef Methods[]; \ + static PyAttributeDef Attributes[]; \ + virtual PyTypeObject *GetType(void) { \ + return &Type; \ + } \ + virtual PyObject *GetProxy() { \ + return GetProxyPlus_Ext(this, &Type, NULL); \ + } \ + virtual PyObject *NewProxy(bool py_owns) { \ + return NewProxyPlus_Ext(this, &Type, NULL, py_owns); \ + } \ // leave above line empty (macro)! // use this macro for class that use generic pointer in proxy // GetProxy() and NewProxy() must be defined to set the correct pointer in the proxy -#define __Py_HeaderPtr \ - public: \ - static PyTypeObject Type; \ - static PyMethodDef Methods[]; \ - static PyAttributeDef Attributes[]; \ - static PyAttributeDef AttributesPtr[]; \ - virtual PyTypeObject *GetType(void) {return &Type;}; \ - virtual PyObject *GetProxy(); \ - virtual PyObject *NewProxy(bool py_owns); \ +#define __Py_HeaderPtr \ +public: \ + static PyTypeObject Type; \ + static PyMethodDef Methods[]; \ + static PyAttributeDef Attributes[]; \ + static PyAttributeDef AttributesPtr[]; \ + virtual PyTypeObject *GetType(void) { \ + return &Type; \ + } \ + virtual PyObject *GetProxy(); \ + virtual PyObject *NewProxy(bool py_owns); \ // leave above line empty (macro)! #ifdef WITH_CXX_GUARDEDALLOC -#define Py_Header __Py_Header \ - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, Type.tp_name); } \ - void operator delete(void *mem) { MEM_freeN(mem); } \ +#define Py_Header __Py_Header \ + void *operator new(size_t num_bytes) { \ + return MEM_mallocN(num_bytes, Type.tp_name); \ + } \ + void operator delete(void *mem) { \ + MEM_freeN(mem); \ + } \ #else -#define Py_Header __Py_Header +# define Py_Header __Py_Header #endif #ifdef WITH_CXX_GUARDEDALLOC -#define Py_HeaderPtr __Py_HeaderPtr \ - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, Type.tp_name); } \ - void operator delete( void *mem ) { MEM_freeN(mem); } \ +#define Py_HeaderPtr __Py_HeaderPtr \ + void *operator new(size_t num_bytes) { \ + return MEM_mallocN(num_bytes, Type.tp_name); \ + } \ + void operator delete( void *mem ) { \ + MEM_freeN(mem); \ + } \ #else -#define Py_HeaderPtr __Py_HeaderPtr +# define Py_HeaderPtr __Py_HeaderPtr #endif /* @@ -180,65 +193,109 @@ typedef struct PyObjectPlus_Proxy { * These macros are helpfull when embedding Python routines. The second * macro is one that also requires a documentation string */ -#define KX_PYMETHOD(class_name, method_name) \ - PyObject* Py##method_name(PyObject* args, PyObject* kwds); \ - static PyObject* sPy##method_name( PyObject* self, PyObject* args, PyObject* kwds) { \ - if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "() - " BGE_PROXY_ERROR_MSG); return NULL; } \ - 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* args); \ - static PyObject* sPy##method_name( PyObject* self, PyObject* args) { \ - if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "() - " BGE_PROXY_ERROR_MSG); return NULL; } \ - return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args); \ - }; \ - -#define KX_PYMETHOD_NOARGS(class_name, method_name) \ - PyObject* Py##method_name(); \ - static PyObject* sPy##method_name( PyObject* self) { \ - if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "() - " BGE_PROXY_ERROR_MSG); return NULL; } \ - return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(); \ - }; \ - -#define KX_PYMETHOD_O(class_name, method_name) \ - PyObject* Py##method_name(PyObject* value); \ - static PyObject* sPy##method_name( PyObject* self, PyObject* value) { \ - if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "(value) - " BGE_PROXY_ERROR_MSG); return NULL; } \ - return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(value); \ - }; \ - -#define KX_PYMETHOD_DOC(class_name, method_name) \ - PyObject* Py##method_name(PyObject* args, PyObject* kwds); \ - static PyObject* sPy##method_name( PyObject* self, PyObject* args, PyObject* kwds) { \ - if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "(...) - " BGE_PROXY_ERROR_MSG); return NULL; } \ - 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* args); \ - static PyObject* sPy##method_name( PyObject* self, PyObject* args) { \ - if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "(...) - " BGE_PROXY_ERROR_MSG); return NULL; } \ - 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* value); \ - static PyObject* sPy##method_name( PyObject* self, PyObject* value) { \ - if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "(value) - " BGE_PROXY_ERROR_MSG); return NULL; } \ - 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(); \ - static PyObject* sPy##method_name( PyObject* self) { \ - if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "() - " BGE_PROXY_ERROR_MSG); return NULL; } \ - return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(); \ - }; \ - static const char method_name##_doc[]; \ +#define KX_PYMETHOD(class_name, method_name) \ + PyObject* Py##method_name(PyObject* args, PyObject* kwds); \ + static PyObject* \ + sPy##method_name(PyObject* self, PyObject* args, PyObject* kwds) { \ + if(BGE_PROXY_REF(self)==NULL) { \ + PyErr_SetString(PyExc_RuntimeError, \ + #class_name "." #method_name "() - " \ + BGE_PROXY_ERROR_MSG); \ + return NULL; \ + } \ + 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* args); \ + static PyObject* \ + sPy##method_name(PyObject* self, PyObject* args) { \ + if(BGE_PROXY_REF(self)==NULL) { \ + PyErr_SetString(PyExc_RuntimeError, \ + #class_name "." #method_name "() - " \ + BGE_PROXY_ERROR_MSG); return NULL; \ + } \ + return((class_name*)BGE_PROXY_REF(self))->Py##method_name(args); \ + } \ + +#define KX_PYMETHOD_NOARGS(class_name, method_name) \ + PyObject* Py##method_name(); \ + static PyObject* \ + sPy##method_name(PyObject* self) { \ + if(BGE_PROXY_REF(self)==NULL) { \ + PyErr_SetString(PyExc_RuntimeError, \ + #class_name "." #method_name "() - " \ + BGE_PROXY_ERROR_MSG); return NULL; \ + } \ + return((class_name*)BGE_PROXY_REF(self))->Py##method_name(); \ + } \ + +#define KX_PYMETHOD_O(class_name, method_name) \ + PyObject* Py##method_name(PyObject* value); \ + static PyObject* \ + sPy##method_name(PyObject* self, PyObject* value) { \ + if(BGE_PROXY_REF(self)==NULL) { \ + PyErr_SetString(PyExc_RuntimeError, \ + #class_name "." #method_name "(value) - " \ + BGE_PROXY_ERROR_MSG); return NULL; \ + } \ + return((class_name*)BGE_PROXY_REF(self))->Py##method_name(value); \ + } \ + +#define KX_PYMETHOD_DOC(class_name, method_name) \ + PyObject* Py##method_name(PyObject* args, PyObject* kwds); \ + static PyObject* \ + sPy##method_name(PyObject* self, PyObject* args, PyObject* kwds) { \ + if(BGE_PROXY_REF(self)==NULL) { \ + PyErr_SetString(PyExc_RuntimeError, \ + #class_name "." #method_name "(...) - " \ + BGE_PROXY_ERROR_MSG); return NULL; \ + } \ + 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* args); \ + static PyObject* \ + sPy##method_name(PyObject* self, PyObject* args) { \ + if(BGE_PROXY_REF(self)==NULL) { \ + PyErr_SetString(PyExc_RuntimeError, \ + #class_name "." #method_name "(...) - " \ + BGE_PROXY_ERROR_MSG); \ + return NULL; \ + } \ + 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* value); \ + static PyObject* \ + sPy##method_name(PyObject* self, PyObject* value) { \ + if(BGE_PROXY_REF(self)==NULL) { \ + PyErr_SetString(PyExc_RuntimeError, \ + #class_name "." #method_name "(value) - " \ + BGE_PROXY_ERROR_MSG); \ + return NULL; \ + } \ + 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(); \ + static PyObject* \ + sPy##method_name(PyObject* self) { \ + if(BGE_PROXY_REF(self)==NULL) { \ + PyErr_SetString(PyExc_RuntimeError, \ + #class_name "." #method_name "() - " \ + BGE_PROXY_ERROR_MSG); \ + return NULL; \ + } \ + return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(); \ + } \ + static const char method_name##_doc[]; \ /* The line above should remain empty */ @@ -290,7 +347,7 @@ enum KX_PYATTRIBUTE_TYPE { KX_PYATTRIBUTE_TYPE_FUNCTION, KX_PYATTRIBUTE_TYPE_VECTOR, KX_PYATTRIBUTE_TYPE_FLAG, - KX_PYATTRIBUTE_TYPE_CHAR, + KX_PYATTRIBUTE_TYPE_CHAR }; enum KX_PYATTRIBUTE_ACCESS { @@ -479,23 +536,31 @@ typedef PyTypeObject * PyParentObject; // Define the PyParent Object #else // WITH_PYTHON #ifdef WITH_CXX_GUARDEDALLOC -#define Py_Header \ - public: \ - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PyObjectPlus"); } \ - void operator delete( void *mem ) { MEM_freeN(mem); } \ +#define Py_Header \ +public: \ + void *operator new(size_t num_bytes) { \ + return MEM_mallocN(num_bytes, "GE:PyObjectPlus"); \ + } \ + void operator delete( void *mem ) { \ + MEM_freeN(mem); \ + } \ -#define Py_HeaderPtr \ - public: \ - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PyObjectPlusPtr"); } \ - void operator delete( void *mem ) { MEM_freeN(mem); } \ +#define Py_HeaderPtr \ +public: \ + void *operator new(size_t num_bytes) { \ + return MEM_mallocN(num_bytes, "GE:PyObjectPlusPtr"); \ + } \ + void operator delete( void *mem ) { \ + MEM_freeN(mem); \ + } \ #else // WITH_CXX_GUARDEDALLOC #define Py_Header \ - public: \ +public: \ #define Py_HeaderPtr \ - public: \ +public: \ #endif // WITH_CXX_GUARDEDALLOC @@ -515,7 +580,7 @@ typedef PyTypeObject * PyParentObject; // Define the PyParent Object // possibility to use them at SCA_ILogicBrick, CValue and PyObjectPlus level. class PyObjectPlus : public SG_QList { // The PyObjectPlus abstract class - Py_Header; // Always start with Py_Header + Py_Header // Always start with Py_Header public: PyObjectPlus(); @@ -580,6 +645,8 @@ public: #ifdef WITH_PYTHON PyObject *py_getattr_dict(PyObject *pydict, PyObject *tp_dict); + +PyObject *PyUnicode_From_STR_String(const STR_String& str); #endif -#endif // _adr_py_lib_h_ +#endif // _PY_OBJECT_PLUS_H diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 41c0850a779..91fdbb0dabc 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -532,7 +532,7 @@ PyAttributeDef CValue::Attributes[] = { PyObject * CValue::pyattr_get_name(void * self_v, const KX_PYATTRIBUTE_DEF * attrdef) { CValue * self = static_cast (self_v); - return PyUnicode_FromString(self->GetName()); + return PyUnicode_From_STR_String(self->GetName()); } CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix) @@ -596,22 +596,24 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix) } -PyObject* CValue::ConvertKeysToPython( void ) +PyObject* CValue::ConvertKeysToPython(void) { - PyObject *pylist = PyList_New( 0 ); - PyObject *pystr; - if (m_pNamedPropertyArray) { + PyObject *pylist= PyList_New(m_pNamedPropertyArray->size()); + Py_ssize_t i= 0; + std::map::iterator it; for (it= m_pNamedPropertyArray->begin(); (it != m_pNamedPropertyArray->end()); it++) { - pystr = PyUnicode_FromString( (*it).first ); - PyList_Append(pylist, pystr); - Py_DECREF( pystr ); + PyList_SET_ITEM(pylist, i++, PyUnicode_From_STR_String((*it).first)); } + + return pylist; + } + else { + return PyList_New(0); } - return pylist; } #endif // WITH_PYTHON diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index 955e688ad7b..f9697a55d3f 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -200,7 +200,7 @@ public: class CValue : public PyObjectPlus { -Py_Header; +Py_Header public: enum AllocationTYPE { STACKVALUE = 0, @@ -319,7 +319,7 @@ public: virtual const STR_String & GetText() = 0; virtual double GetNumber() = 0; - double* ZeroVector() { return m_sZeroVec; }; + double* ZeroVector() { return m_sZeroVec; } virtual double* GetVector3(bool bGetTransformedVec = false); virtual STR_String& GetName() = 0; // Retrieve the name of the value @@ -348,11 +348,11 @@ public: virtual bool IsSelected() { return m_ValFlags.Selected; } inline bool IsReleaseRequested() { return m_ValFlags.ReleaseRequested; } virtual bool IsVisible() { return m_ValFlags.Visible;} - virtual void SetCustomFlag1(bool bCustomFlag) { m_ValFlags.CustomFlag1 = bCustomFlag;}; - virtual bool IsCustomFlag1() { return m_ValFlags.CustomFlag1;}; + virtual void SetCustomFlag1(bool bCustomFlag) { m_ValFlags.CustomFlag1 = bCustomFlag;} + virtual bool IsCustomFlag1() { return m_ValFlags.CustomFlag1;} - virtual void SetCustomFlag2(bool bCustomFlag) { m_ValFlags.CustomFlag2 = bCustomFlag;}; - virtual bool IsCustomFlag2() { return m_ValFlags.CustomFlag2;}; + virtual void SetCustomFlag2(bool bCustomFlag) { m_ValFlags.CustomFlag2 = bCustomFlag;} + virtual bool IsCustomFlag2() { return m_ValFlags.CustomFlag2;} protected: virtual void DisableRefCount(); // Disable reference counting for this value @@ -379,18 +379,23 @@ private: // of object. So, for *any* CValue-derived object this should be set to CValue, // for *any* CExpression-derived object this should be set to CExpression. // -#define PLUGIN_DECLARE_SERIAL(class_name, root_base_class_name) \ -public: \ - virtual root_base_class_name * Copy() { return new class_name; } \ - virtual bool EdSerialize(CompressorArchive& arch,class CFactoryManager* facmgr,bool bIsStoring); \ - virtual bool EdIdSerialize(CompressorArchive& arch,class CFactoryManager* facmgr,bool bIsStoring) \ -{ \ - if (bIsStoring) \ - arch.StoreString(#class_name); \ - \ - return false; \ -} \ - +#define PLUGIN_DECLARE_SERIAL(class_name, root_base_class_name) \ +public: \ + virtual root_base_class_name *Copy() { \ + return new class_name; \ + } \ + virtual bool EdSerialize(CompressorArchive& arch, \ + class CFactoryManager* facmgr, \ + bool bIsStoring); \ + virtual bool EdIdSerialize(CompressorArchive& arch, \ + class CFactoryManager* facmgr, \ + bool bIsStoring) \ + { \ + if (bIsStoring) \ + arch.StoreString(#class_name); \ + return false; \ + } \ + //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// @@ -424,7 +429,7 @@ public: //if (namefromprop.Length() > 0) // return namefromprop; return m_strNewName; - }; // name of Value + } // name of Value protected: STR_String m_strNewName; // Identification diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.h b/source/gameengine/GameLogic/SCA_2DFilterActuator.h index ec4c4a1cbcf..42446b7a2b1 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.h +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.h @@ -37,7 +37,7 @@ class SCA_2DFilterActuator : public SCA_IActuator { - Py_Header; + Py_Header private: vector m_propNames; diff --git a/source/gameengine/GameLogic/SCA_ANDController.h b/source/gameengine/GameLogic/SCA_ANDController.h index e39dea547a2..363bca630aa 100644 --- a/source/gameengine/GameLogic/SCA_ANDController.h +++ b/source/gameengine/GameLogic/SCA_ANDController.h @@ -39,7 +39,7 @@ class SCA_ANDController : public SCA_IController { - Py_Header; + Py_Header //virtual void Trigger(class SCA_LogicManager* logicmgr); public: SCA_ANDController(SCA_IObject* gameobj); diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.h b/source/gameengine/GameLogic/SCA_ActuatorSensor.h index 9b5793787a2..e7a7525bb40 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.h +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.h @@ -40,7 +40,7 @@ class SCA_ActuatorSensor : public SCA_ISensor { - Py_Header; + Py_Header STR_String m_checkactname; bool m_lastresult; bool m_midresult; diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.h b/source/gameengine/GameLogic/SCA_AlwaysSensor.h index 41e9a9612c6..8748793d9a3 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.h +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.h @@ -38,7 +38,7 @@ class SCA_AlwaysSensor : public SCA_ISensor { - Py_Header; + Py_Header bool m_alwaysresult; public: SCA_AlwaysSensor(class SCA_EventManager* eventmgr, diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.h b/source/gameengine/GameLogic/SCA_DelaySensor.h index fea713502b4..ccb8f00c548 100644 --- a/source/gameengine/GameLogic/SCA_DelaySensor.h +++ b/source/gameengine/GameLogic/SCA_DelaySensor.h @@ -38,7 +38,7 @@ class SCA_DelaySensor : public SCA_ISensor { - Py_Header; + Py_Header bool m_lastResult; bool m_repeat; int m_delay; diff --git a/source/gameengine/GameLogic/SCA_ExpressionController.h b/source/gameengine/GameLogic/SCA_ExpressionController.h index 4e549c08ed1..93a3f08c95f 100644 --- a/source/gameengine/GameLogic/SCA_ExpressionController.h +++ b/source/gameengine/GameLogic/SCA_ExpressionController.h @@ -39,7 +39,7 @@ class SCA_ExpressionController : public SCA_IController { -// Py_Header; +// Py_Header STR_String m_exprText; CExpression* m_exprCache; diff --git a/source/gameengine/GameLogic/SCA_IController.h b/source/gameengine/GameLogic/SCA_IController.h index 795e02dcf78..5481f2ae8e4 100644 --- a/source/gameengine/GameLogic/SCA_IController.h +++ b/source/gameengine/GameLogic/SCA_IController.h @@ -42,7 +42,7 @@ */ class SCA_IController : public SCA_ILogicBrick { - Py_Header; + Py_Header protected: std::vector m_linkedsensors; std::vector m_linkedactuators; diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.h b/source/gameengine/GameLogic/SCA_ILogicBrick.h index 4016c557bf3..87b37a8ef39 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.h +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.h @@ -43,7 +43,7 @@ class SCA_IScene; class SCA_ILogicBrick : public CValue { - Py_Header; + Py_Header protected: SCA_IObject* m_gameobj; int m_Execute_Priority; diff --git a/source/gameengine/GameLogic/SCA_IObject.h b/source/gameengine/GameLogic/SCA_IObject.h index 1d16d4f0af7..b0a03de1242 100644 --- a/source/gameengine/GameLogic/SCA_IObject.h +++ b/source/gameengine/GameLogic/SCA_IObject.h @@ -54,7 +54,7 @@ typedef std::vector SCA_ObjectList; class SCA_IObject : public CValue { - Py_Header; + Py_Header protected: friend class KX_StateActuator; diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index 970faf7d29a..ef082095c0d 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -47,7 +47,7 @@ */ class SCA_ISensor : public SCA_ILogicBrick { - Py_Header; + Py_Header protected: class SCA_EventManager* m_eventmgr; diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.h b/source/gameengine/GameLogic/SCA_JoystickSensor.h index b4ed2c06d2f..db34ce4cc15 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.h +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.h @@ -38,7 +38,7 @@ class SCA_JoystickSensor :public SCA_ISensor { - Py_Header; + Py_Header /** * Axis 1-JOYAXIS_MAX, MUST be followed by m_axisf @@ -128,8 +128,8 @@ public: /* --------------------------------------------------------------------- */ /* Joystick Index */ - KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetButtonActiveList); - KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,GetButtonStatus); + KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetButtonActiveList) + KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,GetButtonStatus) static PyObject* pyattr_get_axis_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_axis_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.h b/source/gameengine/GameLogic/SCA_KeyboardSensor.h index 37a42cdcbe6..e7283978ae1 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.h +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.h @@ -44,7 +44,7 @@ * exclusive. */ class SCA_KeyboardSensor : public SCA_ISensor { - Py_Header; + Py_Header /** * the key this sensor is sensing for diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.h b/source/gameengine/GameLogic/SCA_MouseSensor.h index ecfa776112a..4bac9c10e13 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.h +++ b/source/gameengine/GameLogic/SCA_MouseSensor.h @@ -39,7 +39,7 @@ class SCA_MouseSensor : public SCA_ISensor { - Py_Header; + Py_Header /** * Use SCA_IInputDevice values to encode the mouse mode for now. diff --git a/source/gameengine/GameLogic/SCA_NANDController.h b/source/gameengine/GameLogic/SCA_NANDController.h index 8eb26127a51..723d2a5fe0d 100644 --- a/source/gameengine/GameLogic/SCA_NANDController.h +++ b/source/gameengine/GameLogic/SCA_NANDController.h @@ -36,7 +36,7 @@ class SCA_NANDController : public SCA_IController { - Py_Header; + Py_Header //virtual void Trigger(class SCA_LogicManager* logicmgr); public: SCA_NANDController(SCA_IObject* gameobj); diff --git a/source/gameengine/GameLogic/SCA_NORController.h b/source/gameengine/GameLogic/SCA_NORController.h index 6580ad7bc8c..26d7e925923 100644 --- a/source/gameengine/GameLogic/SCA_NORController.h +++ b/source/gameengine/GameLogic/SCA_NORController.h @@ -36,7 +36,7 @@ class SCA_NORController : public SCA_IController { - Py_Header; + Py_Header //virtual void Trigger(class SCA_LogicManager* logicmgr); public: SCA_NORController(SCA_IObject* gameobj); diff --git a/source/gameengine/GameLogic/SCA_ORController.h b/source/gameengine/GameLogic/SCA_ORController.h index 4edd34f6302..53debf894a3 100644 --- a/source/gameengine/GameLogic/SCA_ORController.h +++ b/source/gameengine/GameLogic/SCA_ORController.h @@ -36,7 +36,7 @@ class SCA_ORController : public SCA_IController { - Py_Header; + Py_Header //virtual void Trigger(class SCA_LogicManager* logicmgr); public: SCA_ORController(SCA_IObject* gameobj); diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.h b/source/gameengine/GameLogic/SCA_PropertyActuator.h index f4a43a7e21c..17419e34c2a 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.h +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.h @@ -36,7 +36,7 @@ class SCA_PropertyActuator : public SCA_IActuator { - Py_Header; + Py_Header enum KX_ACT_PROP_MODE { KX_ACT_PROP_NODEF = 0, diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.h b/source/gameengine/GameLogic/SCA_PropertySensor.h index c1fe5320546..bf7b1e879f7 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.h +++ b/source/gameengine/GameLogic/SCA_PropertySensor.h @@ -37,7 +37,7 @@ class SCA_PropertySensor : public SCA_ISensor { - Py_Header; + Py_Header //class CExpression* m_rightexpr; int m_checktype; STR_String m_checkpropval; diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index d69358928e6..8a87a734a1c 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -164,7 +164,7 @@ void SCA_PythonController::SetNamespace(PyObject* pythondictionary) /* Without __file__ set the sys.argv[0] is used for the filename * which ends up with lines from the blender binary being printed in the console */ - PyDict_SetItemString(m_pythondictionary, "__file__", PyUnicode_FromString(m_scriptName.Ptr())); + PyDict_SetItemString(m_pythondictionary, "__file__", PyUnicode_From_STR_String(m_scriptName)); } #endif @@ -490,7 +490,7 @@ PyObject* SCA_PythonController::pyattr_get_script(void *self_v, const KX_PYATTRI // static_cast(dynamic_cast(obj)) - static_cast(obj) SCA_PythonController* self= static_cast(self_v); - return PyUnicode_FromString(self->m_scriptText); + return PyUnicode_From_STR_String(self->m_scriptText); } diff --git a/source/gameengine/GameLogic/SCA_PythonController.h b/source/gameengine/GameLogic/SCA_PythonController.h index 0d22c347861..521a676bf4a 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.h +++ b/source/gameengine/GameLogic/SCA_PythonController.h @@ -42,7 +42,7 @@ class SCA_IObject; class SCA_PythonController : public SCA_IController { - Py_Header; + Py_Header #ifdef WITH_PYTHON struct _object * m_bytecode; /* SCA_PYEXEC_SCRIPT only */ PyObject* m_function; /* SCA_PYEXEC_MODULE only */ diff --git a/source/gameengine/GameLogic/SCA_PythonKeyboard.h b/source/gameengine/GameLogic/SCA_PythonKeyboard.h index 9c761e054f2..7ecf76d1581 100644 --- a/source/gameengine/GameLogic/SCA_PythonKeyboard.h +++ b/source/gameengine/GameLogic/SCA_PythonKeyboard.h @@ -31,7 +31,7 @@ class SCA_PythonKeyboard : public PyObjectPlus { - Py_Header; + Py_Header private: class SCA_IInputDevice *m_keyboard; #ifdef WITH_PYTHON diff --git a/source/gameengine/GameLogic/SCA_PythonMouse.h b/source/gameengine/GameLogic/SCA_PythonMouse.h index dfdf00bc6e9..4ad655dce8f 100644 --- a/source/gameengine/GameLogic/SCA_PythonMouse.h +++ b/source/gameengine/GameLogic/SCA_PythonMouse.h @@ -31,7 +31,7 @@ class SCA_PythonMouse : public PyObjectPlus { - Py_Header; + Py_Header private: class SCA_IInputDevice *m_mouse; class RAS_ICanvas *m_canvas; diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.h b/source/gameengine/GameLogic/SCA_RandomActuator.h index 66d22d5952b..c439b445a5b 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.h +++ b/source/gameengine/GameLogic/SCA_RandomActuator.h @@ -38,7 +38,7 @@ class SCA_RandomActuator : public SCA_IActuator { - Py_Header; + Py_Header /** Property to assign to */ STR_String m_propname; diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.h b/source/gameengine/GameLogic/SCA_RandomSensor.h index f0ae2fd2bde..cec8bcdb445 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.h +++ b/source/gameengine/GameLogic/SCA_RandomSensor.h @@ -39,7 +39,7 @@ class SCA_RandomSensor : public SCA_ISensor { - Py_Header; + Py_Header unsigned int m_currentDraw; int m_iteration; diff --git a/source/gameengine/GameLogic/SCA_XNORController.h b/source/gameengine/GameLogic/SCA_XNORController.h index de0af2ba9d5..c2cdad2cdf4 100644 --- a/source/gameengine/GameLogic/SCA_XNORController.h +++ b/source/gameengine/GameLogic/SCA_XNORController.h @@ -36,7 +36,7 @@ class SCA_XNORController : public SCA_IController { - Py_Header; + Py_Header //virtual void Trigger(class SCA_LogicManager* logicmgr); public: SCA_XNORController(SCA_IObject* gameobj); diff --git a/source/gameengine/GameLogic/SCA_XORController.h b/source/gameengine/GameLogic/SCA_XORController.h index 96098082165..1f38a510046 100644 --- a/source/gameengine/GameLogic/SCA_XORController.h +++ b/source/gameengine/GameLogic/SCA_XORController.h @@ -36,7 +36,7 @@ class SCA_XORController : public SCA_IController { - Py_Header; + Py_Header //virtual void Trigger(class SCA_LogicManager* logicmgr); public: SCA_XORController(SCA_IObject* gameobj); diff --git a/source/gameengine/Ketsji/BL_Shader.h b/source/gameengine/Ketsji/BL_Shader.h index 41802a0a19f..32872592cc5 100644 --- a/source/gameengine/Ketsji/BL_Shader.h +++ b/source/gameengine/Ketsji/BL_Shader.h @@ -116,7 +116,7 @@ public: */ class BL_Shader : public PyObjectPlus { - Py_Header; + Py_Header private: typedef std::vector BL_UniformVec; typedef std::vector BL_UniformVecDef; diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h index a7db2ed1660..f3447356055 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h @@ -39,7 +39,7 @@ class KX_NetworkMessageActuator : public SCA_IActuator { - Py_Header; + Py_Header bool m_lastEvent; class NG_NetworkScene* m_networkscene; // needed for replication STR_String m_toPropName; diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h index 7ec8f26f8ce..75800d9b9fa 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h @@ -40,7 +40,7 @@ class NG_NetworkScene; class KX_NetworkMessageSensor : public SCA_ISensor { // note: Py_Header MUST BE the first listed here - Py_Header; + Py_Header NG_NetworkScene *m_NetworkScene; // The subject we filter on. diff --git a/source/gameengine/Ketsji/KX_ArmatureSensor.h b/source/gameengine/Ketsji/KX_ArmatureSensor.h index 1b0168266a3..683a54f65de 100644 --- a/source/gameengine/Ketsji/KX_ArmatureSensor.h +++ b/source/gameengine/Ketsji/KX_ArmatureSensor.h @@ -40,7 +40,7 @@ struct bConstraint; class KX_ArmatureSensor : public SCA_ISensor { - Py_Header; + Py_Header //class CExpression* m_rightexpr; protected: diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index 236bd6afdc8..2736516bf33 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -32,7 +32,7 @@ class KX_Scene; class KX_BlenderMaterial : public PyObjectPlus, public RAS_IPolyMaterial { - Py_Header; + Py_Header public: // -------------------------------- KX_BlenderMaterial(); diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index 236e914b9e5..e9c4e99aa3b 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -50,7 +50,7 @@ bool ConvertPythonToCamera(PyObject * value, KX_Camera **object, bool py_none_ok class KX_Camera : public KX_GameObject { - Py_Header; + Py_Header protected: friend class KX_Scene; /** Camera parameters (clips distances, focal length). These diff --git a/source/gameengine/Ketsji/KX_CameraActuator.h b/source/gameengine/Ketsji/KX_CameraActuator.h index c06904ea56b..a6344ae380a 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.h +++ b/source/gameengine/Ketsji/KX_CameraActuator.h @@ -49,7 +49,7 @@ class KX_CameraActuator : public SCA_IActuator { - Py_Header; + Py_Header private : /** Object that will be tracked. */ SCA_IObject *m_ob; diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.h b/source/gameengine/Ketsji/KX_ConstraintActuator.h index ebaeed9aafe..b513b141f3e 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.h +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.h @@ -42,7 +42,7 @@ class KX_GameObject; class KX_ConstraintActuator : public SCA_IActuator { - Py_Header; + Py_Header protected: // Damp time (int), int m_posDampTime; diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.h b/source/gameengine/Ketsji/KX_ConstraintWrapper.h index 8f559881a2e..980221bd4b3 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.h +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.h @@ -37,7 +37,7 @@ class KX_ConstraintWrapper : public PyObjectPlus { - Py_Header; + Py_Header public: KX_ConstraintWrapper(PHY_ConstraintType ctype,int constraintId,class PHY_IPhysicsEnvironment* physenv); virtual ~KX_ConstraintWrapper (); diff --git a/source/gameengine/Ketsji/KX_FontObject.h b/source/gameengine/Ketsji/KX_FontObject.h index 15d455b7313..8fc7a9e9f28 100644 --- a/source/gameengine/Ketsji/KX_FontObject.h +++ b/source/gameengine/Ketsji/KX_FontObject.h @@ -38,7 +38,7 @@ class KX_FontObject : public KX_GameObject { public: - Py_Header; + Py_Header KX_FontObject( void* sgReplicationInfo, SG_Callbacks callbacks, RAS_IRenderTools* rendertools, diff --git a/source/gameengine/Ketsji/KX_GameActuator.h b/source/gameengine/Ketsji/KX_GameActuator.h index 1c05d152d39..ebc6712a2dd 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.h +++ b/source/gameengine/Ketsji/KX_GameActuator.h @@ -40,7 +40,7 @@ class KX_GameActuator : public SCA_IActuator { - Py_Header; + Py_Header protected: int m_mode; bool m_restart; diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index d3ed9991c31..c240a7fcf84 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1880,7 +1880,7 @@ PyTypeObject KX_GameObject::Type = { PyObject* KX_GameObject::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_GameObject* self= static_cast(self_v); - return PyUnicode_FromString(self->GetName().ReadPtr()); + return PyUnicode_From_STR_String(self->GetName()); } PyObject* KX_GameObject::pyattr_get_parent(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -2683,7 +2683,7 @@ PyObject* KX_GameObject::PyGetPhysicsId() PyObject* KX_GameObject::PyGetPropertyNames() { - PyObject *list= ConvertKeysToPython(); + PyObject *list= ConvertKeysToPython(); if(m_attr_dict) { PyObject *key, *value; diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 69bc394cbfc..245a92a96de 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -80,7 +80,7 @@ void KX_GameObject_Mathutils_Callback_Init(void); */ class KX_GameObject : public SCA_IObject { - Py_Header; + Py_Header protected: bool m_bDyna; diff --git a/source/gameengine/Ketsji/KX_IpoActuator.h b/source/gameengine/Ketsji/KX_IpoActuator.h index 5ee008ac5e3..fa26bbaa6e1 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.h +++ b/source/gameengine/Ketsji/KX_IpoActuator.h @@ -37,7 +37,7 @@ class KX_IpoActuator : public SCA_IActuator { - Py_Header; + Py_Header private: /** Computes the IPO start time from the current time and the current frame. */ diff --git a/source/gameengine/Ketsji/KX_Light.h b/source/gameengine/Ketsji/KX_Light.h index cd472311bcf..bb081e6a444 100644 --- a/source/gameengine/Ketsji/KX_Light.h +++ b/source/gameengine/Ketsji/KX_Light.h @@ -44,7 +44,7 @@ class MT_Transform; class KX_LightObject : public KX_GameObject { - Py_Header; + Py_Header protected: RAS_LightObject m_lightobj; class RAS_IRenderTools* m_rendertools; //needed for registering and replication of lightobj diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index 754ad511669..fec1d9d296c 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -129,7 +129,7 @@ PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* args, PyObject* kwds) return NULL; } - return PyUnicode_FromString(matname.Ptr()); + return PyUnicode_From_STR_String(matname); } @@ -147,7 +147,7 @@ PyObject* KX_MeshProxy::PyGetTextureName(PyObject* args, PyObject* kwds) return NULL; } - return PyUnicode_FromString(matname.Ptr()); + return PyUnicode_From_STR_String(matname); } diff --git a/source/gameengine/Ketsji/KX_MeshProxy.h b/source/gameengine/Ketsji/KX_MeshProxy.h index d5292b5108d..f59418a5de2 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.h +++ b/source/gameengine/Ketsji/KX_MeshProxy.h @@ -41,7 +41,7 @@ bool ConvertPythonToMesh(PyObject * value, class RAS_MeshObject **object, bool p class KX_MeshProxy : public CValue { - Py_Header; + Py_Header class RAS_MeshObject* m_meshobj; public: diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.h b/source/gameengine/Ketsji/KX_MouseFocusSensor.h index 5fb576eec28..277af87f9f2 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.h +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.h @@ -47,7 +47,7 @@ class KX_RayCast; class KX_MouseFocusSensor : public SCA_MouseSensor { - Py_Header; + Py_Header public: diff --git a/source/gameengine/Ketsji/KX_NavMeshObject.h b/source/gameengine/Ketsji/KX_NavMeshObject.h index 287b2b24fa9..ad128a0891d 100644 --- a/source/gameengine/Ketsji/KX_NavMeshObject.h +++ b/source/gameengine/Ketsji/KX_NavMeshObject.h @@ -36,7 +36,7 @@ class MT_Transform; class KX_NavMeshObject: public KX_GameObject { - Py_Header; + Py_Header protected: dtStatNavMesh* m_navMesh; diff --git a/source/gameengine/Ketsji/KX_NearSensor.h b/source/gameengine/Ketsji/KX_NearSensor.h index 1caea59867a..26adcb993b8 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.h +++ b/source/gameengine/Ketsji/KX_NearSensor.h @@ -41,7 +41,7 @@ struct PHY_CollData; class KX_NearSensor : public KX_TouchSensor { - Py_Header; + Py_Header protected: float m_Margin; float m_ResetMargin; diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.h b/source/gameengine/Ketsji/KX_ObjectActuator.h index fc6fcb66e28..aa0f844eb88 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.h +++ b/source/gameengine/Ketsji/KX_ObjectActuator.h @@ -80,7 +80,7 @@ struct KX_LocalFlags { class KX_ObjectActuator : public SCA_IActuator { - Py_Header; + Py_Header MT_Vector3 m_force; MT_Vector3 m_torque; diff --git a/source/gameengine/Ketsji/KX_ParentActuator.h b/source/gameengine/Ketsji/KX_ParentActuator.h index 8531675723a..484b137c2f5 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.h +++ b/source/gameengine/Ketsji/KX_ParentActuator.h @@ -41,7 +41,7 @@ class KX_ParentActuator : public SCA_IActuator { - Py_Header; + Py_Header /** Mode */ int m_mode; diff --git a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h index 0e4c2e71f3e..4f03c8fbfb1 100644 --- a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h +++ b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h @@ -37,7 +37,7 @@ class KX_PhysicsObjectWrapper : public PyObjectPlus { - Py_Header; + Py_Header public: KX_PhysicsObjectWrapper(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsEnvironment* physenv); virtual ~KX_PhysicsObjectWrapper(); diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp index 82a93e76cf3..caef8ba5e2e 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.cpp +++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp @@ -216,13 +216,13 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, isCollider, KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMaterialName, "getMaterialName() : returns the polygon material name, \"NoMaterial\" if no material\n") { - return PyUnicode_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetMaterialName()); + return PyUnicode_From_STR_String(m_polygon->GetMaterial()->GetPolyMaterial()->GetMaterialName()); } KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getTextureName, "getTexturelName() : returns the polygon texture name, \"NULL\" if no texture\n") { - return PyUnicode_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetTextureName()); + return PyUnicode_From_STR_String(m_polygon->GetMaterial()->GetPolyMaterial()->GetTextureName()); } KX_PYMETHODDEF_DOC(KX_PolyProxy, getVertexIndex, diff --git a/source/gameengine/Ketsji/KX_PolyProxy.h b/source/gameengine/Ketsji/KX_PolyProxy.h index d8046b3fec6..44945e58c2a 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.h +++ b/source/gameengine/Ketsji/KX_PolyProxy.h @@ -38,7 +38,7 @@ class KX_PolyProxy : public CValue { - Py_Header; + Py_Header protected: class RAS_Polygon* m_polygon; class RAS_MeshObject* m_mesh; diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp index 3147d6ba4c9..29127ec11a0 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp @@ -346,13 +346,13 @@ KX_PYMETHODDEF_DOC(KX_PolygonMaterial, activate, "activate(rasty, cachingInfo)") PyObject* KX_PolygonMaterial::pyattr_get_texture(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_PolygonMaterial* self= static_cast(self_v); - return PyUnicode_FromString(self->m_texturename.ReadPtr()); + return PyUnicode_From_STR_String(self->m_texturename); } PyObject* KX_PolygonMaterial::pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_PolygonMaterial* self= static_cast(self_v); - return PyUnicode_FromString(self->m_materialname.ReadPtr()); + return PyUnicode_From_STR_String(self->m_materialname); } /* this does not seem useful */ diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h index 78876c60409..f20a90f7deb 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.h +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h @@ -55,7 +55,7 @@ struct Image; */ class KX_PolygonMaterial : public PyObjectPlus, public RAS_IPolyMaterial { - Py_Header; + Py_Header private: /** Blender texture face structure. */ MTFace* m_tface; diff --git a/source/gameengine/Ketsji/KX_RadarSensor.h b/source/gameengine/Ketsji/KX_RadarSensor.h index 422313fcfef..ee803d9bdb9 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.h +++ b/source/gameengine/Ketsji/KX_RadarSensor.h @@ -41,7 +41,7 @@ class KX_RadarSensor : public KX_NearSensor { protected: - Py_Header; + Py_Header float m_coneradius; diff --git a/source/gameengine/Ketsji/KX_RaySensor.h b/source/gameengine/Ketsji/KX_RaySensor.h index d797666d6ab..4c0009a5a4c 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.h +++ b/source/gameengine/Ketsji/KX_RaySensor.h @@ -43,7 +43,7 @@ class KX_RayCast; class KX_RaySensor : public SCA_ISensor { - Py_Header; + Py_Header STR_String m_propertyname; bool m_bFindMaterial; bool m_bXRay; diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h index 4bb84663e9e..ec5cf305c3e 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h @@ -45,7 +45,7 @@ class SCA_IScene; class KX_SCA_AddObjectActuator : public SCA_IActuator { - Py_Header; + Py_Header /// Time field: lifetime of the new object int m_timeProp; diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h index eaad67ad0ea..5fefbb8cca5 100644 --- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h @@ -42,7 +42,7 @@ class KX_SCA_DynamicActuator : public SCA_IActuator { - Py_Header; + Py_Header // dynamics operation to apply to the game object short m_dyn_operation; diff --git a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h index a6bbf258398..7a325257e59 100644 --- a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h @@ -41,7 +41,7 @@ class SCA_IScene; class KX_SCA_EndObjectActuator : public SCA_IActuator { - Py_Header; + Py_Header SCA_IScene* m_scene; public: diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h index 1e0e2155e62..3e07ec2665c 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h @@ -44,7 +44,7 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator { - Py_Header; + Py_Header // mesh reference (mesh to replace) RAS_MeshObject* m_mesh; diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index f1e0fdc8a50..9b8f7f27d80 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -2117,7 +2117,7 @@ PySequenceMethods KX_Scene::Sequence = { PyObject* KX_Scene::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_Scene* self= static_cast(self_v); - return PyUnicode_FromString(self->GetName().ReadPtr()); + return PyUnicode_From_STR_String(self->GetName()); } PyObject* KX_Scene::pyattr_get_objects(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index 67508f5741b..c8070736b7f 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -101,7 +101,7 @@ class KX_ObstacleSimulation; * */ class KX_Scene : public PyObjectPlus, public SCA_IScene { - Py_Header; + Py_Header #ifdef WITH_PYTHON PyObject* m_attr_dict; diff --git a/source/gameengine/Ketsji/KX_SceneActuator.h b/source/gameengine/Ketsji/KX_SceneActuator.h index 30f325a775e..9064146a1d4 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.h +++ b/source/gameengine/Ketsji/KX_SceneActuator.h @@ -38,7 +38,7 @@ class KX_SceneActuator : public SCA_IActuator { - Py_Header; + Py_Header int m_mode; // (restart) has become a toggle internally... not in the interface though diff --git a/source/gameengine/Ketsji/KX_SoundActuator.h b/source/gameengine/Ketsji/KX_SoundActuator.h index 174bcc8f990..b9119677f4f 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.h +++ b/source/gameengine/Ketsji/KX_SoundActuator.h @@ -57,7 +57,7 @@ typedef struct KX_3DSoundSettings class KX_SoundActuator : public SCA_IActuator { - Py_Header; + Py_Header bool m_isplaying; AUD_Reference m_sound; float m_volume; diff --git a/source/gameengine/Ketsji/KX_StateActuator.h b/source/gameengine/Ketsji/KX_StateActuator.h index 3d1dc64d891..aa17b687463 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.h +++ b/source/gameengine/Ketsji/KX_StateActuator.h @@ -44,7 +44,7 @@ */ class KX_StateActuator : public SCA_IActuator { - Py_Header; + Py_Header /** Make visible? */ enum { diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.h b/source/gameengine/Ketsji/KX_SteeringActuator.h index 38be7bce57b..a0ae8e0d1d9 100644 --- a/source/gameengine/Ketsji/KX_SteeringActuator.h +++ b/source/gameengine/Ketsji/KX_SteeringActuator.h @@ -47,7 +47,7 @@ const int MAX_PATH_LENGTH = 128; class KX_SteeringActuator : public SCA_IActuator { - Py_Header; + Py_Header /** Target object */ KX_GameObject *m_target; diff --git a/source/gameengine/Ketsji/KX_TouchSensor.h b/source/gameengine/Ketsji/KX_TouchSensor.h index a111bf31cf6..1fae766aa13 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.h +++ b/source/gameengine/Ketsji/KX_TouchSensor.h @@ -51,7 +51,7 @@ class KX_TouchEventManager; class KX_TouchSensor : public SCA_ISensor { protected: - Py_Header; + Py_Header /** * The sensor should only look for objects with this property. diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.h b/source/gameengine/Ketsji/KX_TrackToActuator.h index 9d267bfe89a..30e276c0021 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.h +++ b/source/gameengine/Ketsji/KX_TrackToActuator.h @@ -40,7 +40,7 @@ class KX_TrackToActuator : public SCA_IActuator { - Py_Header; + Py_Header // Object reference. Actually, we use the object's 'life' SCA_IObject* m_object; // 3d toggle diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.h b/source/gameengine/Ketsji/KX_VehicleWrapper.h index f750912c95b..f6e360d34a8 100644 --- a/source/gameengine/Ketsji/KX_VehicleWrapper.h +++ b/source/gameengine/Ketsji/KX_VehicleWrapper.h @@ -16,7 +16,7 @@ class PHY_IMotionState; ///Python interface to physics vehicles (primarily 4-wheel cars and 2wheel bikes) class KX_VehicleWrapper : public PyObjectPlus { - Py_Header; + Py_Header std::vector m_motionStates; diff --git a/source/gameengine/Ketsji/KX_VertexProxy.h b/source/gameengine/Ketsji/KX_VertexProxy.h index 4ae662faa12..905a4e0f4ab 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.h +++ b/source/gameengine/Ketsji/KX_VertexProxy.h @@ -38,7 +38,7 @@ class KX_VertexProxy : public CValue { - Py_Header; + Py_Header protected: class RAS_TexVert* m_vertex; diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.h b/source/gameengine/Ketsji/KX_VisibilityActuator.h index 0ffe1de6480..f5c45ecbd99 100644 --- a/source/gameengine/Ketsji/KX_VisibilityActuator.h +++ b/source/gameengine/Ketsji/KX_VisibilityActuator.h @@ -37,7 +37,7 @@ class KX_VisibilityActuator : public SCA_IActuator { - Py_Header; + Py_Header /** Make visible? */ bool m_visible; -- cgit v1.2.3