Revision: 18606
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18606
Author:   ben2610
Date:     2009-01-21 14:54:53 +0100 (Wed, 21 Jan 2009)

Log Message:
-----------
BGE API cleanup: action actuator.

Modified Paths:
--------------
    trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp
    trunk/blender/source/gameengine/Converter/BL_ActionActuator.h
    trunk/blender/source/gameengine/PyDoc/BL_ActionActuator.py

Modified: trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp
===================================================================
--- trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp     
2009-01-21 12:39:56 UTC (rev 18605)
+++ trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp     
2009-01-21 13:54:53 UTC (rev 18606)
@@ -52,6 +52,8 @@
 #include "FloatValue.h"
 #include "PyObjectPlus.h"
 
+#include "blendef.h"
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -418,67 +420,6 @@
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
 
-/* Integration hooks ------------------------------------------------------- */
-
-PyTypeObject BL_ActionActuator::Type = {
-       PyObject_HEAD_INIT(&PyType_Type)
-               0,
-               "BL_ActionActuator",
-               sizeof(BL_ActionActuator),
-               0,
-               PyDestructor,
-               0,
-               __getattr,
-               __setattr,
-               0, //&MyPyCompare,
-               __repr,
-               0, //&cvalue_as_number,
-               0,
-               0,
-               0,
-               0
-};
-
-PyParentObject BL_ActionActuator::Parents[] = {
-       &BL_ActionActuator::Type,
-               &SCA_IActuator::Type,
-               &SCA_ILogicBrick::Type,
-               &CValue::Type,
-               NULL
-};
-
-PyMethodDef BL_ActionActuator::Methods[] = {
-       {"setAction", (PyCFunction) BL_ActionActuator::sPySetAction, 
METH_VARARGS, (PY_METHODCHAR)SetAction_doc},
-       {"setStart", (PyCFunction) BL_ActionActuator::sPySetStart, 
METH_VARARGS, (PY_METHODCHAR)SetStart_doc},
-       {"setEnd", (PyCFunction) BL_ActionActuator::sPySetEnd, METH_VARARGS, 
(PY_METHODCHAR)SetEnd_doc},
-       {"setBlendin", (PyCFunction) BL_ActionActuator::sPySetBlendin, 
METH_VARARGS, (PY_METHODCHAR)SetBlendin_doc},
-       {"setPriority", (PyCFunction) BL_ActionActuator::sPySetPriority, 
METH_VARARGS, (PY_METHODCHAR)SetPriority_doc},
-       {"setFrame", (PyCFunction) BL_ActionActuator::sPySetFrame, 
METH_VARARGS, (PY_METHODCHAR)SetFrame_doc},
-       {"setProperty", (PyCFunction) BL_ActionActuator::sPySetProperty, 
METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
-       {"setFrameProperty", (PyCFunction) 
BL_ActionActuator::sPySetFrameProperty, METH_VARARGS, 
(PY_METHODCHAR)SetFrameProperty_doc},
-       {"setBlendtime", (PyCFunction) BL_ActionActuator::sPySetBlendtime, 
METH_VARARGS, (PY_METHODCHAR)SetBlendtime_doc},
-
-       {"getAction", (PyCFunction) BL_ActionActuator::sPyGetAction, 
METH_VARARGS, (PY_METHODCHAR)GetAction_doc},
-       {"getStart", (PyCFunction) BL_ActionActuator::sPyGetStart, 
METH_VARARGS, (PY_METHODCHAR)GetStart_doc},
-       {"getEnd", (PyCFunction) BL_ActionActuator::sPyGetEnd, METH_VARARGS, 
(PY_METHODCHAR)GetEnd_doc},
-       {"getBlendin", (PyCFunction) BL_ActionActuator::sPyGetBlendin, 
METH_VARARGS, (PY_METHODCHAR)GetBlendin_doc},
-       {"getPriority", (PyCFunction) BL_ActionActuator::sPyGetPriority, 
METH_VARARGS, (PY_METHODCHAR)GetPriority_doc},
-       {"getFrame", (PyCFunction) BL_ActionActuator::sPyGetFrame, 
METH_VARARGS, (PY_METHODCHAR)GetFrame_doc},
-       {"getProperty", (PyCFunction) BL_ActionActuator::sPyGetProperty, 
METH_VARARGS, (PY_METHODCHAR)GetProperty_doc},
-       {"getFrameProperty", (PyCFunction) 
BL_ActionActuator::sPyGetFrameProperty, METH_VARARGS, 
(PY_METHODCHAR)GetFrameProperty_doc},
-       {"setChannel", (PyCFunction) BL_ActionActuator::sPySetChannel, 
METH_VARARGS, (PY_METHODCHAR)SetChannel_doc},
-//     {"getChannel", (PyCFunction) BL_ActionActuator::sPyGetChannel, 
METH_VARARGS},
-       {"getType", (PyCFunction) BL_ActionActuator::sPyGetType, METH_VARARGS, 
(PY_METHODCHAR)GetType_doc},
-       {"setType", (PyCFunction) BL_ActionActuator::sPySetType, METH_VARARGS, 
(PY_METHODCHAR)SetType_doc},
-       {"getContinue", (PyCFunction) BL_ActionActuator::sPyGetContinue, 
METH_NOARGS, 0},       
-       {"setContinue", (PyCFunction) BL_ActionActuator::sPySetContinue, 
METH_O, 0},
-       {NULL,NULL} //Sentinel
-};
-
-PyObject* BL_ActionActuator::_getattr(const STR_String& attr) {
-       _getattr_up(SCA_IActuator);
-}
-
 /*     setStart                                                              */
 const char BL_ActionActuator::GetAction_doc[] = 
 "getAction()\n"
@@ -487,6 +428,8 @@
 PyObject* BL_ActionActuator::PyGetAction(PyObject* self, 
                                                                                
 PyObject* args, 
                                                                                
 PyObject* kwds) {
+       ShowDeprecationWarning("getAction()", "the action property");
+
        if (m_action){
                return PyString_FromString(m_action->id.name+2);
        }
@@ -501,6 +444,8 @@
 PyObject* BL_ActionActuator::PyGetProperty(PyObject* self, 
                                                                                
   PyObject* args, 
                                                                                
   PyObject* kwds) {
+       ShowDeprecationWarning("getProperty()", "the property property");
+
        PyObject *result;
        
        result = Py_BuildValue("s", (const char *)m_propname);
@@ -516,6 +461,8 @@
 PyObject* BL_ActionActuator::PyGetFrameProperty(PyObject* self, 
                                                                                
   PyObject* args, 
                                                                                
   PyObject* kwds) {
+       ShowDeprecationWarning("getFrameProperty()", "the frameProperty 
property");
+
        PyObject *result;
        
        result = Py_BuildValue("s", (const char *)m_framepropname);
@@ -531,6 +478,8 @@
 PyObject* BL_ActionActuator::PyGetFrame(PyObject* self, 
                                                                                
PyObject* args, 
                                                                                
PyObject* kwds) {
+       ShowDeprecationWarning("getFrame()", "the frame property");
+
        PyObject *result;
        
        result = Py_BuildValue("f", m_localtime);
@@ -546,6 +495,8 @@
 PyObject* BL_ActionActuator::PyGetEnd(PyObject* self, 
                                                                          
PyObject* args, 
                                                                          
PyObject* kwds) {
+       ShowDeprecationWarning("getEnd()", "the end property");
+
        PyObject *result;
        
        result = Py_BuildValue("f", m_endframe);
@@ -561,6 +512,8 @@
 PyObject* BL_ActionActuator::PyGetStart(PyObject* self, 
                                                                                
PyObject* args, 
                                                                                
PyObject* kwds) {
+       ShowDeprecationWarning("getStart()", "the start property");
+
        PyObject *result;
        
        result = Py_BuildValue("f", m_startframe);
@@ -577,6 +530,8 @@
 PyObject* BL_ActionActuator::PyGetBlendin(PyObject* self, 
                                                                                
  PyObject* args, 
                                                                                
  PyObject* kwds) {
+       ShowDeprecationWarning("getBlendin()", "the blendin property");
+
        PyObject *result;
        
        result = Py_BuildValue("f", m_blendin);
@@ -593,6 +548,8 @@
 PyObject* BL_ActionActuator::PyGetPriority(PyObject* self, 
                                                                                
   PyObject* args, 
                                                                                
   PyObject* kwds) {
+       ShowDeprecationWarning("getPriority()", "the priority property");
+
        PyObject *result;
        
        result = Py_BuildValue("i", m_priority);
@@ -613,6 +570,8 @@
 PyObject* BL_ActionActuator::PySetAction(PyObject* self, 
                                                                                
 PyObject* args, 
                                                                                
 PyObject* kwds) {
+       ShowDeprecationWarning("setAction()", "the action property");
+
        char *string;
        int     reset = 1;
 
@@ -647,6 +606,8 @@
 PyObject* BL_ActionActuator::PySetStart(PyObject* self, 
                                                                                
PyObject* args, 
                                                                                
PyObject* kwds) {
+       ShowDeprecationWarning("setStart()", "the start property");
+
        float start;
        
        if (PyArg_ParseTuple(args,"f",&start))
@@ -668,6 +629,8 @@
 PyObject* BL_ActionActuator::PySetEnd(PyObject* self, 
                                                                          
PyObject* args, 
                                                                          
PyObject* kwds) {
+       ShowDeprecationWarning("setEnd()", "the end property");
+
        float end;
        
        if (PyArg_ParseTuple(args,"f",&end))
@@ -690,6 +653,8 @@
 PyObject* BL_ActionActuator::PySetBlendin(PyObject* self, 
                                                                                
  PyObject* args, 
                                                                                
  PyObject* kwds) {
+       ShowDeprecationWarning("setBlendin()", "the blendin property");
+
        float blendin;
        
        if (PyArg_ParseTuple(args,"f",&blendin))
@@ -713,6 +678,8 @@
 PyObject* BL_ActionActuator::PySetBlendtime(PyObject* self, 
                                                                                
  PyObject* args, 
                                                                                
  PyObject* kwds) {
+       ShowDeprecationWarning("setBlendtime()", "the blendtime property");
+
        float blendframe;
        
        if (PyArg_ParseTuple(args,"f",&blendframe))
@@ -740,6 +707,8 @@
 PyObject* BL_ActionActuator::PySetPriority(PyObject* self, 
                                                                                
   PyObject* args, 
                                                                                
   PyObject* kwds) {
+       ShowDeprecationWarning("setPriority()", "the priority property");
+
        int priority;
        
        if (PyArg_ParseTuple(args,"i",&priority))
@@ -761,6 +730,8 @@
 PyObject* BL_ActionActuator::PySetFrame(PyObject* self, 
                                                                                
PyObject* args, 
                                                                                
PyObject* kwds) {
+       ShowDeprecationWarning("setFrame()", "the frame property");
+
        float frame;
        
        if (PyArg_ParseTuple(args,"f",&frame))
@@ -787,6 +758,8 @@
 PyObject* BL_ActionActuator::PySetProperty(PyObject* self, 
                                                                                
   PyObject* args, 
                                                                                
   PyObject* kwds) {
+       ShowDeprecationWarning("setProperty()", "the property property");
+
        char *string;
        
        if (PyArg_ParseTuple(args,"s",&string))
@@ -808,6 +781,8 @@
 PyObject* BL_ActionActuator::PySetFrameProperty(PyObject* self, 
                                                                                
   PyObject* args, 
                                                                                
   PyObject* kwds) {
+       ShowDeprecationWarning("setFrameProperty()", "the frameProperty 
property");
+
        char *string;
        
        if (PyArg_ParseTuple(args,"s",&string))
@@ -839,16 +814,80 @@
 }
 */
 
-/*     setChannel                                                            */
-const char BL_ActionActuator::SetChannel_doc[] = 
+/* getType */
+const 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) {
+       ShowDeprecationWarning("getType()", "the type property");
+
+    return Py_BuildValue("h", m_playtype);
+}
+
+/* setType */
+const 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) {
+       ShowDeprecationWarning("setType()", "the type property");
+
+       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_NONE;
+}
+
+PyObject* BL_ActionActuator::PyGetContinue(PyObject* self) {
+       ShowDeprecationWarning("getContinue()", "the continue property");
+
+    return PyInt_FromLong((long)(m_end_reset==0));
+}
+
+PyObject* BL_ActionActuator::PySetContinue(PyObject* self, PyObject* value) {
+       ShowDeprecationWarning("setContinue()", "the continue property");
+

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to