Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/Ketsji/KX_Scene.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp33
1 files changed, 24 insertions, 9 deletions
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index 0a74f8ad66f..5e0e46026df 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -28,6 +28,11 @@
* Ketsji scene. Holds references to all scene data.
*/
+/** \file gameengine/Ketsji/KX_Scene.cpp
+ * \ingroup ketsji
+ */
+
+
#if defined(WIN32) && !defined(FREE_WINDOWS)
#pragma warning (disable : 4786)
#endif //WIN32
@@ -62,7 +67,7 @@
#include "SCA_IController.h"
#include "SCA_IActuator.h"
#include "SG_Node.h"
-#include "SYS_System.h"
+#include "BL_System.h"
#include "SG_Controller.h"
#include "SG_IObject.h"
#include "SG_Tree.h"
@@ -281,10 +286,12 @@ KX_Scene::~KX_Scene()
#ifdef WITH_PYTHON
PyDict_Clear(m_attr_dict);
- Py_DECREF(m_attr_dict);
+ /* Py_CLEAR: Py_DECREF's and NULL's */
+ Py_CLEAR(m_attr_dict);
- Py_XDECREF(m_draw_call_pre);
- Py_XDECREF(m_draw_call_post);
+ /* these may be NULL but the macro checks */
+ Py_CLEAR(m_draw_call_pre);
+ Py_CLEAR(m_draw_call_post);
#endif
}
@@ -1524,7 +1531,7 @@ void KX_Scene::LogicUpdateFrame(double curtime, bool frame)
void KX_Scene::LogicEndFrame()
{
m_logicmgr->EndFrame();
- int numobj = m_euthanasyobjects->GetCount();
+ int numobj;
KX_GameObject* obj;
@@ -1878,6 +1885,16 @@ bool KX_Scene::MergeScene(KX_Scene *other)
/* when merging objects sensors are moved across into the new manager, dont need to do this here */
}
+
+ /* grab any timer properties from the other scene */
+ SCA_TimeEventManager *timemgr= GetTimeEventManager();
+ SCA_TimeEventManager *timemgr_other= other->GetTimeEventManager();
+ vector<CValue*> times = timemgr_other->GetTimeValues();
+
+ for(unsigned int i= 0; i < times.size(); i++) {
+ timemgr->AddTimeProperty(times[i]);
+ }
+
}
return true;
}
@@ -2142,8 +2159,7 @@ PyObject* KX_Scene::pyattr_get_drawing_callback_pre(void *self_v, const KX_PYATT
if(self->m_draw_call_pre==NULL)
self->m_draw_call_pre= PyList_New(0);
- else
- Py_INCREF(self->m_draw_call_pre);
+ Py_INCREF(self->m_draw_call_pre);
return self->m_draw_call_pre;
}
@@ -2153,8 +2169,7 @@ PyObject* KX_Scene::pyattr_get_drawing_callback_post(void *self_v, const KX_PYAT
if(self->m_draw_call_post==NULL)
self->m_draw_call_post= PyList_New(0);
- else
- Py_INCREF(self->m_draw_call_post);
+ Py_INCREF(self->m_draw_call_post);
return self->m_draw_call_post;
}