diff options
author | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-07-17 09:28:23 +0400 |
---|---|---|
committer | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-07-17 09:28:23 +0400 |
commit | baa2f99f079920d404af65798a8df3e82bcc6a48 (patch) | |
tree | 2e8fb2bad0c3824e87e12cc0ebf3d4933eeb56f3 /source/gameengine/Converter | |
parent | 90fb63152628927d5d13b0101f4f2dcec025d2f7 (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/Converter')
-rw-r--r-- | source/gameengine/Converter/BL_ActionActuator.cpp | 42 | ||||
-rw-r--r-- | source/gameengine/Converter/BL_ActionActuator.h | 12 | ||||
-rw-r--r-- | source/gameengine/Converter/BL_SkinMeshObject.h | 4 |
3 files changed, 54 insertions, 4 deletions
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 3f633eec9d6..52b948b18f1 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -395,7 +395,8 @@ PyMethodDef BL_ActionActuator::Methods[] = { {"getProperty", (PyCFunction) BL_ActionActuator::sPyGetProperty, METH_VARARGS, GetProperty_doc}, {"setChannel", (PyCFunction) BL_ActionActuator::sPySetChannel, METH_VARARGS, SetChannel_doc}, // {"getChannel", (PyCFunction) BL_ActionActuator::sPyGetChannel, METH_VARARGS}, - + {"getType", (PyCFunction) BL_ActionActuator::sPyGetType, METH_VARARGS, GetType_doc}, + {"setType", (PyCFunction) BL_ActionActuator::sPySetType, METH_VARARGS, SetType_doc}, {NULL,NULL} //Sentinel }; @@ -805,3 +806,42 @@ PyObject* BL_ActionActuator::PySetChannel(PyObject* self, return Py_None; } +/* getType */ +char BL_ActionActuator::GetType_doc[] = +"getType()\n" +"\tReturns the operation mode of the actuator.\n"; +PyObject* BL_ActionActuator::PyGetType(PyObject* self, + PyObject* args, + PyObject* kwds) { + return Py_BuildValue("h", m_playtype); +} + +/* setType */ +char BL_ActionActuator::SetType_doc[] = +"setType(mode)\n" +"\t - mode: Play (0), Flipper (2), LoopStop (3), LoopEnd (4) or Property (6)\n" +"\tSet the operation mode of the actuator.\n"; +PyObject* BL_ActionActuator::PySetType(PyObject* self, + PyObject* args, + PyObject* kwds) { + short typeArg; + + if (!PyArg_ParseTuple(args, "h", &typeArg)) { + return NULL; + } + + switch (typeArg) { + case KX_ACT_ACTION_PLAY: + case KX_ACT_ACTION_FLIPPER: + case KX_ACT_ACTION_LOOPSTOP: + case KX_ACT_ACTION_LOOPEND: + case KX_ACT_ACTION_PROPERTY: + m_playtype = typeArg; + break; + default: + printf("Invalid type for action actuator: %d\n", typeArg); /* error */ + } + + Py_Return; +} + diff --git a/source/gameengine/Converter/BL_ActionActuator.h b/source/gameengine/Converter/BL_ActionActuator.h index 9e8054bff81..ca1f937cbd4 100644 --- a/source/gameengine/Converter/BL_ActionActuator.h +++ b/source/gameengine/Converter/BL_ActionActuator.h @@ -93,11 +93,21 @@ public: KX_PYMETHOD_DOC(BL_ActionActuator,GetFrame); KX_PYMETHOD_DOC(BL_ActionActuator,GetProperty); // KX_PYMETHOD(BL_ActionActuator,GetChannel); - + KX_PYMETHOD_DOC(BL_ActionActuator,GetType); + KX_PYMETHOD_DOC(BL_ActionActuator,SetType); virtual PyObject* _getattr(const STR_String& attr); void SetBlendTime (float newtime); + enum ActionActType + { + KX_ACT_ACTION_PLAY = 0, + KX_ACT_ACTION_FLIPPER = 2, + KX_ACT_ACTION_LOOPSTOP, + KX_ACT_ACTION_LOOPEND, + KX_ACT_ACTION_PROPERTY = 6 + }; + protected: float m_blendframe; MT_Point3 m_lastpos; diff --git a/source/gameengine/Converter/BL_SkinMeshObject.h b/source/gameengine/Converter/BL_SkinMeshObject.h index d7539031b35..b233088acba 100644 --- a/source/gameengine/Converter/BL_SkinMeshObject.h +++ b/source/gameengine/Converter/BL_SkinMeshObject.h @@ -91,8 +91,8 @@ public: class BL_SkinMeshObject : public RAS_MeshObject { - enum { BUCKET_MAX_INDICES = 16384};//2048};//8192}; - enum { BUCKET_MAX_TRIANGLES = 4096}; +// enum { BUCKET_MAX_INDICES = 16384};//2048};//8192}; +// enum { BUCKET_MAX_TRIANGLES = 4096}; KX_ArrayOptimizer* GetArrayOptimizer(RAS_IPolyMaterial* polymat) { |