diff options
author | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2005-04-23 16:25:21 +0400 |
---|---|---|
committer | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2005-04-23 16:25:21 +0400 |
commit | 0dcba86c6b631a31eadb5e8805c5c94222559e25 (patch) | |
tree | 06ab18aaeed6567bd4af7696d83f847adf5249bb /source/gameengine/Expressions/PyObjectPlus.h | |
parent | 10acf20645729d7c06eec1b091a0bf21417d613f (diff) |
Added the docs & use Python booleans for physics reinstance.
Diffstat (limited to 'source/gameengine/Expressions/PyObjectPlus.h')
-rw-r--r-- | source/gameengine/Expressions/PyObjectPlus.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index 8784d28d502..c261012a3bc 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -49,12 +49,22 @@ // some basic python macros #define Py_NEWARGS 1 #define Py_Return { Py_INCREF(Py_None); return Py_None;} +static inline PyObject* Py_Success(bool truth) +{ + if (truth) + { + Py_INCREF(Py_True); + return Py_True; + } + Py_INCREF(Py_False); + return Py_False; +} #define Py_Error(E, M) {PyErr_SetString(E, M); return NULL;} #define Py_Try(F) {if (!(F)) return NULL;} #define Py_Assert(A,E,M) {if (!(A)) {PyErr_SetString(E, M); return NULL;}} -inline void Py_Fatal(char *M) { +static inline void Py_Fatal(char *M) { //cout << M << endl; exit(-1); }; |