diff options
Diffstat (limited to 'source/gameengine/Expressions')
-rw-r--r-- | source/gameengine/Expressions/BoolValue.cpp | 4 | ||||
-rw-r--r-- | source/gameengine/Expressions/BoolValue.h | 2 | ||||
-rw-r--r-- | source/gameengine/Expressions/CMakeLists.txt | 3 | ||||
-rw-r--r-- | source/gameengine/Expressions/FloatValue.cpp | 4 | ||||
-rw-r--r-- | source/gameengine/Expressions/FloatValue.h | 2 | ||||
-rw-r--r-- | source/gameengine/Expressions/IntValue.cpp | 4 | ||||
-rw-r--r-- | source/gameengine/Expressions/IntValue.h | 2 | ||||
-rw-r--r-- | source/gameengine/Expressions/KX_Python.h | 2 | ||||
-rw-r--r-- | source/gameengine/Expressions/ListValue.cpp | 4 | ||||
-rw-r--r-- | source/gameengine/Expressions/ListValue.h | 2 | ||||
-rw-r--r-- | source/gameengine/Expressions/PyObjectPlus.cpp | 12 | ||||
-rw-r--r-- | source/gameengine/Expressions/PyObjectPlus.h | 8 | ||||
-rw-r--r-- | source/gameengine/Expressions/SConscript | 3 | ||||
-rw-r--r-- | source/gameengine/Expressions/StringValue.h | 4 | ||||
-rw-r--r-- | source/gameengine/Expressions/Value.cpp | 8 | ||||
-rw-r--r-- | source/gameengine/Expressions/Value.h | 6 |
16 files changed, 34 insertions, 36 deletions
diff --git a/source/gameengine/Expressions/BoolValue.cpp b/source/gameengine/Expressions/BoolValue.cpp index e6bb454a1b5..5510554bd22 100644 --- a/source/gameengine/Expressions/BoolValue.cpp +++ b/source/gameengine/Expressions/BoolValue.cpp @@ -201,9 +201,9 @@ CValue* CBoolValue::GetReplica() return replica; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject* CBoolValue::ConvertValueToPython() { return PyBool_FromLong(m_bool != 0); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Expressions/BoolValue.h b/source/gameengine/Expressions/BoolValue.h index dac70e3c0b7..8110b9719bf 100644 --- a/source/gameengine/Expressions/BoolValue.h +++ b/source/gameengine/Expressions/BoolValue.h @@ -45,7 +45,7 @@ public: void Configure(CValue* menuvalue); virtual CValue* GetReplica(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON virtual PyObject* ConvertValueToPython(); #endif diff --git a/source/gameengine/Expressions/CMakeLists.txt b/source/gameengine/Expressions/CMakeLists.txt index 828afa7ae92..ad446d1085e 100644 --- a/source/gameengine/Expressions/CMakeLists.txt +++ b/source/gameengine/Expressions/CMakeLists.txt @@ -58,8 +58,7 @@ SET(SRC IF(WITH_PYTHON) LIST(APPEND INC ${PYTHON_INC}) -ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DWITH_PYTHON) ENDIF(WITH_PYTHON) BLENDERLIB(bf_expressions "${SRC}" "${INC}") diff --git a/source/gameengine/Expressions/FloatValue.cpp b/source/gameengine/Expressions/FloatValue.cpp index 82c86ac68b2..e00121354f8 100644 --- a/source/gameengine/Expressions/FloatValue.cpp +++ b/source/gameengine/Expressions/FloatValue.cpp @@ -310,9 +310,9 @@ CValue* CFloatValue::GetReplica() } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject* CFloatValue::ConvertValueToPython() { return PyFloat_FromDouble(m_float); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Expressions/FloatValue.h b/source/gameengine/Expressions/FloatValue.h index 49d4efa9f74..83b9ff1db5e 100644 --- a/source/gameengine/Expressions/FloatValue.h +++ b/source/gameengine/Expressions/FloatValue.h @@ -36,7 +36,7 @@ public: virtual CValue* GetReplica(); virtual CValue* Calc(VALUE_OPERATOR op, CValue *val); virtual CValue* CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON virtual PyObject* ConvertValueToPython(); #endif diff --git a/source/gameengine/Expressions/IntValue.cpp b/source/gameengine/Expressions/IntValue.cpp index 83e57200db0..5ba57e756c0 100644 --- a/source/gameengine/Expressions/IntValue.cpp +++ b/source/gameengine/Expressions/IntValue.cpp @@ -322,7 +322,7 @@ void CIntValue::SetValue(CValue* newval) } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject* CIntValue::ConvertValueToPython() { if((m_int > INT_MIN) && (m_int < INT_MAX)) @@ -330,4 +330,4 @@ PyObject* CIntValue::ConvertValueToPython() else return PyLong_FromLongLong(m_int); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Expressions/IntValue.h b/source/gameengine/Expressions/IntValue.h index 63efea56d14..e484c436177 100644 --- a/source/gameengine/Expressions/IntValue.h +++ b/source/gameengine/Expressions/IntValue.h @@ -48,7 +48,7 @@ public: void AddConfigurationData(CValue* menuvalue); virtual CValue* GetReplica(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON virtual PyObject* ConvertValueToPython(); #endif diff --git a/source/gameengine/Expressions/KX_Python.h b/source/gameengine/Expressions/KX_Python.h index 7901d5226f7..62353f04e50 100644 --- a/source/gameengine/Expressions/KX_Python.h +++ b/source/gameengine/Expressions/KX_Python.h @@ -40,7 +40,7 @@ #undef _POSIX_C_SOURCE #endif -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "Python.h" #define USE_MATHUTILS // Blender 2.5x api will use mathutils, for a while we might want to test without it diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index 4d9d82efb98..258aada6565 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -268,7 +268,7 @@ bool CListValue::IsModified() return bmod; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ @@ -674,4 +674,4 @@ PyObject* CListValue::Pyfrom_id(PyObject* value) } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Expressions/ListValue.h b/source/gameengine/Expressions/ListValue.h index 8f3b9dcda0b..ff675dd0e68 100644 --- a/source/gameengine/Expressions/ListValue.h +++ b/source/gameengine/Expressions/ListValue.h @@ -60,7 +60,7 @@ public: bool CheckEqual(CValue* first,CValue* second); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON virtual PyObject* py_repr(void) { PyObject *py_proxy= this->GetProxy(); PyObject *py_list= PySequence_List(py_proxy); diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 32bf4ba95c4..9195bd64f3f 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -49,7 +49,7 @@ PyObjectPlus::~PyObjectPlus() { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON if(m_proxy) { BGE_PROXY_REF(m_proxy)= NULL; Py_DECREF(m_proxy); /* Remove own reference, python may still have 1 */ @@ -60,14 +60,14 @@ PyObjectPlus::~PyObjectPlus() PyObjectPlus::PyObjectPlus() : SG_QList() // constructor { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON m_proxy= NULL; #endif }; void PyObjectPlus::ProcessReplica() { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* Clear the proxy, will be created again if needed with GetProxy() * otherwise the PyObject will point to the wrong reference */ m_proxy= NULL; @@ -84,7 +84,7 @@ void PyObjectPlus::ProcessReplica() */ void PyObjectPlus::InvalidateProxy() // check typename of each parent { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON if(m_proxy) { BGE_PROXY_REF(m_proxy)=NULL; Py_DECREF(m_proxy); @@ -94,7 +94,7 @@ void PyObjectPlus::InvalidateProxy() // check typename of each parent } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /*------------------------------ * PyObjectPlus Type -- Every class, even the abstract one should have a Type @@ -1224,4 +1224,4 @@ void PyObjectPlus::SetDeprecationWarningFirst(WarnLink* wlink) {m_base_wlink_f void PyObjectPlus::SetDeprecationWarningLinkLast(WarnLink* wlink) {m_base_wlink_last= wlink;} void PyObjectPlus::NullDeprecationWarning() {m_base_wlink_first= m_base_wlink_last= NULL;} -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index b2688231a43..d69be6af5e5 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -43,7 +43,7 @@ * Python defines ------------------------------*/ -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #ifdef USE_MATHUTILS extern "C" { #include "../../blender/python/generic/mathutils.h" /* so we can have mathutils callbacks */ @@ -459,7 +459,7 @@ typedef struct KX_PYATTRIBUTE_DEF { ------------------------------*/ typedef PyTypeObject * PyParentObject; // Define the PyParent Object -#else // DISABLE_PYTHON +#else // WITH_PYTHON #ifdef WITH_CXX_GUARDEDALLOC #define Py_Header \ @@ -505,7 +505,7 @@ public: virtual ~PyObjectPlus(); // destructor -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject *m_proxy; /* actually a PyObjectPlus_Proxy */ /* These static functions are referenced by ALL PyObjectPlus_Proxy types @@ -561,7 +561,7 @@ public: static bool m_ignore_deprecation_warnings; }; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject *py_getattr_dict(PyObject *pydict, PyObject *tp_dict); #endif diff --git a/source/gameengine/Expressions/SConscript b/source/gameengine/Expressions/SConscript index 85db689a9ba..dea652dabb4 100644 --- a/source/gameengine/Expressions/SConscript +++ b/source/gameengine/Expressions/SConscript @@ -9,8 +9,7 @@ defs = [] if env['WITH_BF_PYTHON']: incs += ' ' + env['BF_PYTHON_INC'] -else: - defs.append('DISABLE_PYTHON') + defs.append('WITH_PYTHON') if env['WITH_BF_CXX_GUARDEDALLOC']: defs.append('WITH_CXX_GUARDEDALLOC') diff --git a/source/gameengine/Expressions/StringValue.h b/source/gameengine/Expressions/StringValue.h index d28e435e2a7..ef8228141a2 100644 --- a/source/gameengine/Expressions/StringValue.h +++ b/source/gameengine/Expressions/StringValue.h @@ -39,11 +39,11 @@ public: virtual CValue* CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val); virtual void SetValue(CValue* newval) { m_strString = newval->GetText(); SetModified(true); }; virtual CValue* GetReplica(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON virtual PyObject* ConvertValueToPython() { return PyUnicode_FromString(m_strString.Ptr()); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON private: // data member diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 1f4f961268b..262f543f834 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -29,7 +29,7 @@ double CValue::m_sZeroVec[3] = {0.0,0.0,0.0}; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyTypeObject CValue::Type = { PyVarObject_HEAD_INIT(NULL, 0) @@ -60,7 +60,7 @@ PyTypeObject CValue::Type = { PyMethodDef CValue::Methods[] = { {NULL,NULL} //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /*#define CVALUE_DEBUG*/ @@ -520,7 +520,7 @@ CValue* CValue::FindIdentifier(const STR_String& identifiername) return result; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyAttributeDef CValue::Attributes[] = { KX_PYATTRIBUTE_RO_FUNCTION("name", CValue, pyattr_get_name), @@ -611,7 +611,7 @@ PyObject* CValue::ConvertKeysToPython( void ) return pylist; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index 009d95ee4d2..e6ea431ec1c 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -198,7 +198,7 @@ public: #include "PyObjectPlus.h" -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "object.h" #endif class CValue : public PyObjectPlus @@ -221,7 +221,7 @@ public: // Construction / Destruction CValue(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON //static PyObject* PyMake(PyObject*,PyObject*); virtual PyObject *py_repr(void) { @@ -237,7 +237,7 @@ public: static PyObject * pyattr_get_name(void * self, const KX_PYATTRIBUTE_DEF * attrdef); virtual PyObject* ConvertKeysToPython( void ); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON |