svn merge -r 21041:21301 https://svn.blender.org/svnroot/bf-blender/branches/blender2...
[blender.git] / source / gameengine / Ketsji / KX_SceneActuator.cpp
index 1b790ec98248d4660eddcf28a94116a012307931..5528e58ef775fefa6051e81c893e122460f6c3c9 100644 (file)
@@ -49,9 +49,8 @@ KX_SceneActuator::KX_SceneActuator(SCA_IObject *gameobj,
                                                                   KX_Scene *scene,
                                                                   KX_KetsjiEngine* ketsjiEngine,
                                                                   const STR_String& nextSceneName,
-                                                                  KX_Camera* camera,
-                                                                  PyTypeObject* T)
-                                                                  : SCA_IActuator(gameobj, T)
+                                                                  KX_Camera* camera)
+                                                                  : SCA_IActuator(gameobj)
 {
        m_mode = mode;
        m_scene  = scene;
@@ -134,7 +133,7 @@ bool KX_SceneActuator::Update()
                {
                        // if no camera is set and the parent object is a camera, use it as the camera
                        SCA_IObject* parent = GetParent();
-                       if (parent->isA(&KX_Camera::Type))
+                       if (parent->GetGameObjectType()==SCA_IObject::OBJ_CAMERA)
                        {
                                m_scene->SetActiveCamera((KX_Camera*)parent);
                        }
@@ -239,26 +238,17 @@ PyTypeObject KX_SceneActuator::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_SceneActuator::Parents[] =
-{
-       &KX_SceneActuator::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_SceneActuator::Methods[] =
 {
        //Deprecated functions ------>
@@ -280,20 +270,6 @@ PyAttributeDef KX_SceneActuator::Attributes[] = {
        { NULL }        //Sentinel
 };
 
-PyObject* KX_SceneActuator::py_getattro(PyObject *attr)
-{
-       py_getattro_up(SCA_IActuator);
-}
-
-PyObject* KX_SceneActuator::py_getattro_dict() {
-       py_getattro_dict_up(SCA_IActuator);
-}
-
-int KX_SceneActuator::py_setattro(PyObject *attr, PyObject *value)
-{
-       py_setattro_up(SCA_IActuator);
-}
-
 PyObject* KX_SceneActuator::pyattr_get_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
 {
        KX_SceneActuator* actuator = static_cast<KX_SceneActuator*>(self);
@@ -355,7 +331,7 @@ const char KX_SceneActuator::GetUseRestart_doc[] =
 PyObject* KX_SceneActuator::PyGetUseRestart()
 {
        ShowDeprecationWarning("getUseRestart()", "the useRestart property");
-       return PyInt_FromLong(!(m_restart == 0));
+       return PyLong_FromSsize_t(!(m_restart == 0));
 }
 
 
@@ -391,7 +367,7 @@ const char KX_SceneActuator::GetScene_doc[] =
 PyObject* KX_SceneActuator::PyGetScene()
 {
        ShowDeprecationWarning("getScene()", "the scene property");
-       return PyString_FromString(m_nextSceneName);
+       return PyUnicode_FromString(m_nextSceneName);
 }
 
 
@@ -432,7 +408,7 @@ PyObject* KX_SceneActuator::PyGetCamera()
 {
        ShowDeprecationWarning("getCamera()", "the camera property");
        if (m_camera) {
-               return PyString_FromString(m_camera->GetName());
+               return PyUnicode_FromString(m_camera->GetName());
        }
        else {
                Py_RETURN_NONE;