add missing files after merging
[blender.git] / source / gameengine / Ketsji / KX_VisibilityActuator.cpp
index 9b1849511fee165187fee70c70e87cad6d1fac8d..6dc9961fe2d5b66019ce55c59bdfaaeb98374090 100644 (file)
@@ -15,7 +15,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
  * All rights reserved.
  * Actuator to toggle visibility/invisibility of objects
  */
 
+/** \file gameengine/Ketsji/KX_VisibilityActuator.cpp
+ *  \ingroup ketsji
+ */
+
+
 #include "KX_VisibilityActuator.h"
 #include "KX_GameObject.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 KX_VisibilityActuator::KX_VisibilityActuator(
        SCA_IObject* gameobj,
        bool visible,
        bool occlusion,
-       bool recursive,
-       PyTypeObject* T
+       bool recursive
        ) 
-       : SCA_IActuator(gameobj,T),
+       : SCA_IActuator(gameobj, KX_ACT_VISIBILITY),
          m_visible(visible),
          m_occlusion(occlusion),
          m_recursive(recursive)
@@ -64,8 +64,6 @@ KX_VisibilityActuator::GetReplica(
 {
        KX_VisibilityActuator* replica = new KX_VisibilityActuator(*this);
        replica->ProcessReplica();
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
        return replica;
 }
 
@@ -86,6 +84,8 @@ KX_VisibilityActuator::Update()
        return false;
 }
 
+#ifdef WITH_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
@@ -94,8 +94,7 @@ KX_VisibilityActuator::Update()
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_VisibilityActuator::Type = {
-       PyObject_HEAD_INIT(NULL)
-       0,
+       PyVarObject_HEAD_INIT(NULL, 0)
        "KX_VisibilityActuator",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -105,73 +104,26 @@ PyTypeObject KX_VisibilityActuator::Type = {
        0,
        0,
        py_base_repr,
-       0,0,0,0,0,0,
-       py_base_getattro,
-       py_base_setattro,
        0,0,0,0,0,0,0,0,0,
-       Methods
-
-};
-
-PyParentObject 
-KX_VisibilityActuator::Parents[] = {
-       &KX_VisibilityActuator::Type,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
        &SCA_IActuator::Type,
-       &SCA_ILogicBrick::Type,
-       &CValue::Type,
-       NULL
+       0,0,0,0,0,0,
+       py_base_new
 };
 
-PyMethodDef 
-KX_VisibilityActuator::Methods[] = {
-       // Deprecated ----->
-       {"set", (PyCFunction) KX_VisibilityActuator::sPySetVisible, METH_VARARGS,
-               (PY_METHODCHAR) SetVisible_doc},
-       // <-----
+PyMethodDef KX_VisibilityActuator::Methods[] = {
        {NULL,NULL} //Sentinel
 };
 
 PyAttributeDef KX_VisibilityActuator::Attributes[] = {
        KX_PYATTRIBUTE_BOOL_RW("visibility", KX_VisibilityActuator, m_visible),
-       KX_PYATTRIBUTE_BOOL_RW("occlusion", KX_VisibilityActuator, m_occlusion),
-       KX_PYATTRIBUTE_BOOL_RW("recursion", KX_VisibilityActuator, m_recursive),
+       KX_PYATTRIBUTE_BOOL_RW("useOcclusion", KX_VisibilityActuator, m_occlusion),
+       KX_PYATTRIBUTE_BOOL_RW("useRecursion", KX_VisibilityActuator, m_recursive),
        { NULL }        //Sentinel
 };
 
-PyObject* KX_VisibilityActuator::py_getattro(PyObject *attr)
-{
-       py_getattro_up(SCA_IActuator);
-}
-
-PyObject* KX_VisibilityActuator::py_getattro_dict() {
-       py_getattro_dict_up(SCA_IActuator);
-}
-
-int KX_VisibilityActuator::py_setattro(PyObject *attr, PyObject *value)
-{
-       py_setattro_up(SCA_IActuator);
-}
-
-
-/* set visibility ---------------------------------------------------------- */
-const char 
-KX_VisibilityActuator::SetVisible_doc[] = 
-"setVisible(visible?)\n"
-"\t - visible? : Make the object visible? (KX_TRUE, KX_FALSE)"
-"\tSet the properties of the actuator.\n";
-PyObject* 
-
-KX_VisibilityActuator::PySetVisible(PyObject* args) {
-       int vis;
-       ShowDeprecationWarning("SetVisible()", "the visible property");
-
-       if(!PyArg_ParseTuple(args, "i:setVisible", &vis)) {
-               return NULL;
-       }
-
-       m_visible = PyArgToBool(vis);
-
-       Py_RETURN_NONE;
-}
-
-
+#endif // WITH_PYTHON