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:
authorCampbell Barton <ideasman42@gmail.com>2010-03-24 00:37:02 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-03-24 00:37:02 +0300
commit377f06082a2ce127e658b94396d37c9c308450fd (patch)
tree138bc989557030a5f00c5fb670bfac340c30f96c /source/gameengine
parent6956f6c1c5616b6268029f2b24926125421dcc92 (diff)
enable compiling without python again
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp61
-rw-r--r--source/gameengine/Ketsji/KX_Scene.h10
3 files changed, 39 insertions, 36 deletions
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
index d1fecb76998..dfac6e1b816 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
@@ -1309,8 +1309,10 @@ void KX_KetsjiEngine::RenderFrame(KX_Scene* scene, KX_Camera* cam)
m_logger->StartLog(tc_rasterizer, m_kxsystem->GetTimeInSeconds(), true);
SG_SetActiveStage(SG_STAGE_RENDER);
+#ifndef DISABLE_PYTHON
// Run any pre-drawing python callbacks
scene->RunDrawingCallbacks(scene->GetPreDrawCB());
+#endif
scene->RenderBuckets(camtrans, m_rasterizer, m_rendertools);
@@ -1324,7 +1326,9 @@ void KX_KetsjiEngine::PostRenderScene(KX_Scene* scene)
{
m_rendertools->MotionBlur(m_rasterizer);
scene->Render2DFilters(m_canvas);
+#ifndef DISABLE_PYTHON
scene->RunDrawingCallbacks(scene->GetPostDrawCB());
+#endif
m_rasterizer->FlushDebugLines();
}
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index a5512c2e34a..c4b1aaeacf4 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -407,34 +407,6 @@ bool KX_Scene::IsClearingZBuffer()
return m_isclearingZbuffer;
}
-void KX_Scene::RunDrawingCallbacks(PyObject* cb_list)
-{
- int len;
-
- if (cb_list && (len=PyList_GET_SIZE(cb_list)))
- {
- PyObject* args= PyTuple_New(0); // save python creating each call
- PyObject* func;
- PyObject* ret;
-
- // Iterate the list and run the callbacks
- for (int pos=0; pos < len; pos++)
- {
- func= PyList_GET_ITEM(cb_list, pos);
- ret= PyObject_Call(func, args, NULL);
- if (ret==NULL) {
- PyErr_Print();
- PyErr_Clear();
- }
- else {
- Py_DECREF(ret);
- }
- }
-
- Py_DECREF(args);
- }
-}
-
void KX_Scene::EnableZBufferClearing(bool isclearingZbuffer)
{
m_isclearingZbuffer = isclearingZbuffer;
@@ -1657,9 +1629,6 @@ double KX_Scene::getSuspendedDelta()
return m_suspendeddelta;
}
-#ifndef DISABLE_PYTHON
-
-
#include "KX_BulletPhysicsController.h"
static void MergeScene_LogicBrick(SCA_ILogicBrick* brick, KX_Scene *to)
@@ -1855,6 +1824,36 @@ void KX_Scene::Render2DFilters(RAS_ICanvas* canvas)
m_filtermanager.RenderFilters(canvas);
}
+#ifndef DISABLE_PYTHON
+
+void KX_Scene::RunDrawingCallbacks(PyObject* cb_list)
+{
+ int len;
+
+ if (cb_list && (len=PyList_GET_SIZE(cb_list)))
+ {
+ PyObject* args= PyTuple_New(0); // save python creating each call
+ PyObject* func;
+ PyObject* ret;
+
+ // Iterate the list and run the callbacks
+ for (int pos=0; pos < len; pos++)
+ {
+ func= PyList_GET_ITEM(cb_list, pos);
+ ret= PyObject_Call(func, args, NULL);
+ if (ret==NULL) {
+ PyErr_Print();
+ PyErr_Clear();
+ }
+ else {
+ Py_DECREF(ret);
+ }
+ }
+
+ Py_DECREF(args);
+ }
+}
+
//----------------------------------------------------------------------------
//Python
diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h
index c3fc23f2979..5b562977837 100644
--- a/source/gameengine/Ketsji/KX_Scene.h
+++ b/source/gameengine/Ketsji/KX_Scene.h
@@ -292,11 +292,6 @@ public:
RAS_IRenderTools* rendertools);
/**
- * Run the registered python drawing functions.
- */
- void RunDrawingCallbacks(PyObject* cb_list);
-
- /**
* Update all transforms according to the scenegraph.
*/
static bool KX_ScenegraphUpdateFunc(SG_IObject* node,void* gameobj,void* scene);
@@ -573,6 +568,11 @@ public:
static PyMappingMethods Mapping;
static PySequenceMethods Sequence;
+ /**
+ * Run the registered python drawing functions.
+ */
+ void RunDrawingCallbacks(PyObject* cb_list);
+
PyObject* GetPreDrawCB() { return m_draw_call_pre; };
PyObject* GetPostDrawCB() { return m_draw_call_post; };
#endif