synched with trunk at revision 36569
[blender.git] / source / gameengine / Ketsji / KX_KetsjiEngine.cpp
index 35d02fb..eef543e 100644 (file)
  * The engine ties all game modules together. 
  */
 
+/** \file gameengine/Ketsji/KX_KetsjiEngine.cpp
+ *  \ingroup ketsji
+ */
+
+
 #if defined(WIN32) && !defined(FREE_WINDOWS)
 #pragma warning (disable : 4786)
 #endif //WIN32
 
 #include <iostream>
+#include <stdio.h>
 
 #include "KX_KetsjiEngine.h"
 
@@ -55,6 +61,7 @@
 #include "KX_Scene.h"
 #include "MT_CmMatrix4x4.h"
 #include "KX_Camera.h"
+#include "KX_FontObject.h"
 #include "KX_Dome.h"
 #include "KX_Light.h"
 #include "KX_PythonInit.h"
 #include "KX_TimeCategoryLogger.h"
 
 #include "RAS_FramingManager.h"
-#include "stdio.h"
 #include "DNA_world_types.h"
 #include "DNA_scene_types.h"
 
+#include "KX_NavMeshObject.h"
+
 // If define: little test for Nzc: guarded drawing. If the canvas is
 // not valid, skip rendering this frame.
 //#define NZC_GUARDED_OUTPUT
@@ -1301,10 +1309,26 @@ void KX_KetsjiEngine::RenderFrame(KX_Scene* scene, KX_Camera* cam)
 #endif
 
        scene->RenderBuckets(camtrans, m_rasterizer, m_rendertools);
+
+       //render all the font objects for this scene
+       RenderFonts(scene);
        
        if (scene->GetPhysicsEnvironment())
                scene->GetPhysicsEnvironment()->debugDrawWorld();
 }
+
+void KX_KetsjiEngine::RenderFonts(KX_Scene* scene)
+{
+       list<class KX_FontObject*>* fonts = scene->GetFonts();
+       
+       list<KX_FontObject*>::iterator it = fonts->begin();
+       while(it != fonts->end())
+       {
+               (*it)->DrawText();
+               ++it;
+       }
+}
+
 /*
 To run once per scene
 */
@@ -1315,7 +1339,7 @@ void KX_KetsjiEngine::PostRenderScene(KX_Scene* scene)
 #ifdef WITH_PYTHON
        scene->RunDrawingCallbacks(scene->GetPostDrawCB());     
 #endif
-       m_rasterizer->FlushDebugLines();
+       m_rasterizer->FlushDebugShapes();
 }
 
 void KX_KetsjiEngine::StopEngine()