Merge of itasc branch. Project files, scons and cmake should be working. Makefile...
[blender.git] / source / gameengine / Ketsji / KX_SceneActuator.cpp
index 16521f2..c7721c4 100644 (file)
@@ -50,7 +50,7 @@ KX_SceneActuator::KX_SceneActuator(SCA_IObject *gameobj,
                                                                   KX_KetsjiEngine* ketsjiEngine,
                                                                   const STR_String& nextSceneName,
                                                                   KX_Camera* camera)
-                                                                  : SCA_IActuator(gameobj)
+                                                                  : SCA_IActuator(gameobj, KX_ACT_SCENE)
 {
        m_mode = mode;
        m_scene  = scene;
@@ -222,44 +222,29 @@ KX_Scene* KX_SceneActuator::FindScene(char * sceneName)
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_SceneActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
        PyVarObject_HEAD_INIT(NULL, 0)
-#else
-       /* python 2.5 and below */
-       PyObject_HEAD_INIT( NULL )  /* required py macro */
-       0,                          /* ob_size */
-#endif
-               "KX_SceneActuator",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,0,0,0,0,0,
-               NULL, //py_base_getattro,
-               NULL, //py_base_setattro,
-               0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &SCA_IActuator::Type
+       "KX_SceneActuator",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &SCA_IActuator::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 PyMethodDef KX_SceneActuator::Methods[] =
 {
-       //Deprecated functions ------>
-       {"setUseRestart", (PyCFunction) KX_SceneActuator::sPySetUseRestart, METH_VARARGS, (PY_METHODCHAR)SetUseRestart_doc},
-       {"setScene",      (PyCFunction) KX_SceneActuator::sPySetScene, METH_VARARGS, (PY_METHODCHAR)SetScene_doc},
-       {"setCamera",     (PyCFunction) KX_SceneActuator::sPySetCamera, METH_O, (PY_METHODCHAR)SetCamera_doc},
-       {"getUseRestart", (PyCFunction) KX_SceneActuator::sPyGetUseRestart, METH_NOARGS, (PY_METHODCHAR)GetUseRestart_doc},
-       {"getScene",      (PyCFunction) KX_SceneActuator::sPyGetScene, METH_NOARGS, (PY_METHODCHAR)GetScene_doc},
-       {"getCamera",     (PyCFunction) KX_SceneActuator::sPyGetCamera, METH_NOARGS, (PY_METHODCHAR)GetCamera_doc},
-       //<----- Deprecated
        {NULL,NULL} //Sentinel
 };
 
@@ -302,117 +287,4 @@ int KX_SceneActuator::pyattr_set_camera(void *self, const struct KX_PYATTRIBUTE_
        return PY_SET_ATTR_SUCCESS;
 }
 
-
-/* 2. setUseRestart--------------------------------------------------------- */
-const char KX_SceneActuator::SetUseRestart_doc[] = 
-"setUseRestart(flag)\n"
-"\t- flag: 0 or 1.\n"
-"\tSet flag to 1 to restart the scene.\n" ;
-PyObject* KX_SceneActuator::PySetUseRestart(PyObject* args)
-{
-       ShowDeprecationWarning("setUseRestart()", "the useRestart property");
-       int boolArg;
-       
-       if (!PyArg_ParseTuple(args, "i:setUseRestart", &boolArg))
-       {
-               return NULL;
-       }
-       
-       m_restart = boolArg != 0;
-       
-       Py_RETURN_NONE;
-}
-
-
-
-/* 3. getUseRestart:                                                         */
-const char KX_SceneActuator::GetUseRestart_doc[] = 
-"getUseRestart()\n"
-"\tReturn whether the scene will be restarted.\n" ;
-PyObject* KX_SceneActuator::PyGetUseRestart()
-{
-       ShowDeprecationWarning("getUseRestart()", "the useRestart property");
-       return PyInt_FromLong(!(m_restart == 0));
-}
-
-
-
-/* 4. set scene------------------------------------------------------------- */
-const char KX_SceneActuator::SetScene_doc[] = 
-"setScene(scene)\n"
-"\t- scene: string\n"
-"\tSet the name of scene the actuator will switch to.\n" ;
-PyObject* KX_SceneActuator::PySetScene(PyObject* args)
-{
-       ShowDeprecationWarning("setScene()", "the scene property");
-       /* one argument: a scene, ignore the rest */
-       char *scene_name;
-
-       if(!PyArg_ParseTuple(args, "s:setScene", &scene_name))
-       {
-               return NULL;
-       }
-
-       /* Scene switch is done by name. */
-       m_nextSceneName = scene_name;
-
-       Py_RETURN_NONE;
-}
-
-
-
-/* 5. getScene:                                                              */
-const char KX_SceneActuator::GetScene_doc[] = 
-"getScene()\n"
-"\tReturn the name of the scene the actuator wants to switch to.\n" ;
-PyObject* KX_SceneActuator::PyGetScene()
-{
-       ShowDeprecationWarning("getScene()", "the scene property");
-       return PyString_FromString(m_nextSceneName);
-}
-
-
-
-/* 6. set camera------------------------------------------------------------ */
-const char KX_SceneActuator::SetCamera_doc[] = 
-"setCamera(camera)\n"
-"\t- camera: string\n"
-"\tSet the camera to switch to.\n" ;
-PyObject* KX_SceneActuator::PySetCamera(PyObject* value)
-{
-       ShowDeprecationWarning("setCamera()", "the camera property");
-       KX_Camera *camOb;
-       
-       if (!ConvertPythonToCamera(value, &camOb, true, "actu.setCamera(value): KX_SceneActuator"))
-               return NULL;
-       
-       if (m_camera)
-               m_camera->UnregisterActuator(this);
-       
-       if(camOb==NULL) {
-               m_camera= NULL;
-       }
-       else {  
-               m_camera = camOb;
-               m_camera->RegisterActuator(this);
-       }
-       Py_RETURN_NONE;
-}
-
-
-
-/* 7. getCamera:                                                             */
-const char KX_SceneActuator::GetCamera_doc[] = 
-"getCamera()\n"
-"\tReturn the name of the camera to switch to.\n" ;
-PyObject* KX_SceneActuator::PyGetCamera()
-{
-       ShowDeprecationWarning("getCamera()", "the camera property");
-       if (m_camera) {
-               return PyString_FromString(m_camera->GetName());
-       }
-       else {
-               Py_RETURN_NONE;
-       }
-}
 /* eof */