diff options
author | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-06-07 15:03:12 +0400 |
---|---|---|
committer | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-06-07 15:03:12 +0400 |
commit | c16444e624040bd51a86b5dfd743396eaed970d1 (patch) | |
tree | 8224a39a10bd2b16968394d2e185c1413c57ed13 /source/gameengine/Ketsji/KX_PythonInit.cpp | |
parent | b468bf726c50d3126fac2664164e1be0d6e209c5 (diff) |
Python updates:
Added scene module
Diffstat (limited to 'source/gameengine/Ketsji/KX_PythonInit.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index f4736f4c423..1b6d55f68e9 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -160,7 +160,7 @@ static PyObject* gPyGetSpectrum(PyObject* self, -static void gPyStartDSP(PyObject* self, +static PyObject* gPyStartDSP(PyObject* self, PyObject* args, PyObject* kwds) { @@ -172,13 +172,15 @@ static void gPyStartDSP(PyObject* self, { audiodevice->StartUsingDSP(); usedsp = true; + Py_Return; } } + return NULL; } -static void gPyStopDSP(PyObject* self, +static PyObject* gPyStopDSP(PyObject* self, PyObject* args, PyObject* kwds) { @@ -190,16 +192,32 @@ static void gPyStopDSP(PyObject* self, { audiodevice->StopUsingDSP(); usedsp = false; + Py_Return; } } + return NULL; } +static STR_String gPyGetCurrentScene_doc = +"getCurrentScene()\n" +"Gets a reference to the current scene.\n"; +static PyObject* gPyGetCurrentScene(PyObject* self, + PyObject* args, + PyObject* kwds) +{ + Py_INCREF(gp_KetsjiScene); + return (PyObject*) gp_KetsjiScene; +} + + static struct PyMethodDef game_methods[] = { {"getCurrentController", (PyCFunction) SCA_PythonController::sPyGetCurrentController, METH_VARARGS, SCA_PythonController::sPyGetCurrentController__doc__}, + {"getCurrentScene", (PyCFunction) gPyGetCurrentScene, + METH_VARARGS, gPyGetCurrentScene_doc.Ptr()}, {"addActiveActuator",(PyCFunction) SCA_PythonController::sPyAddActiveActuator, METH_VARARGS, SCA_PythonController::sPyAddActiveActuator__doc__}, {"getRandomFloat",(PyCFunction) gPyGetRandomFloat, |