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:
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-07-17 09:28:23 +0400
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-07-17 09:28:23 +0400
commitbaa2f99f079920d404af65798a8df3e82bcc6a48 (patch)
tree2e8fb2bad0c3824e87e12cc0ebf3d4933eeb56f3 /source/gameengine/Ketsji/KX_SoundActuator.cpp
parent90fb63152628927d5d13b0101f4f2dcec025d2f7 (diff)
Port Python updates from Tuhopuu2:
getType/setType to action/sound actuator (sgefant) Use a more generic python -> math conversion.
Diffstat (limited to 'source/gameengine/Ketsji/KX_SoundActuator.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_SoundActuator.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp
index 6f959f0273b..e71902519f3 100644
--- a/source/gameengine/Ketsji/KX_SoundActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp
@@ -256,7 +256,9 @@ PyMethodDef KX_SoundActuator::Methods[] = {
{"getLooping",(PyCFunction) KX_SoundActuator::sPyGetLooping,METH_VARARGS,NULL},
{"setPosition",(PyCFunction) KX_SoundActuator::sPySetPosition,METH_VARARGS,NULL},
{"setVelocity",(PyCFunction) KX_SoundActuator::sPySetVelocity,METH_VARARGS,NULL},
- {"setOrientation",(PyCFunction) KX_SoundActuator::sPySetOrientation,METH_VARARGS,NULL},
+ {"setOrientation",(PyCFunction) KX_SoundActuator::sPySetOrientation,METH_VARARGS,NULL},
+ {"setType",(PyCFunction) KX_SoundActuator::sPySetType,METH_VARARGS,NULL},
+ {"getType",(PyCFunction) KX_SoundActuator::sPyGetType,METH_VARARGS,NULL},
{NULL,NULL,NULL,NULL} //Sentinel
};
@@ -464,7 +466,28 @@ PyObject* KX_SoundActuator::PySetOrientation(PyObject* self, PyObject* args, PyO
m_soundObject->SetOrientation(ori);
Py_Return;
-}
+}
+
+PyObject* KX_SoundActuator::PySetType(PyObject* self, PyObject* args, PyObject* kwds)
+{
+ int typeArg;
+
+ if (!PyArg_ParseTuple(args, "i", &typeArg)) {
+ return NULL;
+ }
+
+ if ( (typeArg > KX_SOUNDACT_NODEF)
+ && (typeArg < KX_SOUNDACT_MAX) ) {
+ m_type = (KX_SOUNDACT_TYPE) typeArg;
+ }
+
+ Py_Return;
+}
+
+PyObject* KX_SoundActuator::PyGetType(PyObject* self, PyObject* args, PyObject* kwds)
+{
+ return PyInt_FromLong(m_type);
+}