diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2013-06-20 07:50:02 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2013-06-20 07:50:02 +0400 |
commit | 1e64732d5264edef5af455febdf8567fc3472a05 (patch) | |
tree | 8b4d5a8862bf8458a4d5188ac41d32c14164c1ca /source/gameengine | |
parent | 4eded6dbdcb3c0d451a0d5d5f0147be73b10f8af (diff) |
BGE: Fix for [#34781] "bge.texture.ImageRender does not show Font object" reported by Monster.
This fix is mostly based off of HG1's patch from the bug report, which had ImageRender::Render() call KX_KetsjiEngine::RenderFonts(). However, I have moved RenderFonts() from KX_KetsjiEngine to KX_Scene where all of the other font and rendering functions are. The real fix for this mess would be to not have ImageRender::Render() have so much duplicate code from KX_KetsjiEngine::Render(), but that's a code cleanup problem for another day.
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 18 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.h | 1 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_Scene.cpp | 15 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_Scene.h | 8 | ||||
-rw-r--r-- | source/gameengine/VideoTexture/ImageRender.cpp | 2 |
5 files changed, 19 insertions, 25 deletions
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index f02e842ad2e..1061e9fd571 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -54,7 +54,6 @@ #include "MT_Transform.h" #include "SCA_IInputDevice.h" #include "KX_Camera.h" -#include "KX_FontObject.h" #include "KX_Dome.h" #include "KX_Light.h" #include "KX_PythonInit.h" @@ -340,7 +339,7 @@ void KX_KetsjiEngine::RenderDome() // do the rendering m_dome->RenderDomeFrame(scene,cam, i); //render all the font objects for this scene - RenderFonts(scene); + scene->RenderFonts(); } list<class KX_Camera*>* cameras = scene->GetCameras(); @@ -358,7 +357,7 @@ void KX_KetsjiEngine::RenderDome() // do the rendering m_dome->RenderDomeFrame(scene, (*it),i); //render all the font objects for this scene - RenderFonts(scene); + scene->RenderFonts(); } it++; @@ -1339,23 +1338,12 @@ void KX_KetsjiEngine::RenderFrame(KX_Scene* scene, KX_Camera* cam) scene->RenderBuckets(camtrans, m_rasterizer, m_rendertools); //render all the font objects for this scene - RenderFonts(scene); + scene->RenderFonts(); 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 */ diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index 3cba3558db3..4e69c7d35f7 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -205,7 +205,6 @@ private: void RenderDebugProperties(); void RenderShadowBuffers(KX_Scene *scene); void SetBackGround(KX_WorldInfo* worldinfo); - void RenderFonts(KX_Scene* scene); public: KX_KetsjiEngine(class KX_ISystem* system); diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 8bb9eaeef10..13fb168221d 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -40,6 +40,7 @@ #include "MT_assert.h" #include "KX_KetsjiEngine.h" #include "KX_BlenderMaterial.h" +#include "KX_FontObject.h" #include "RAS_IPolygonMaterial.h" #include "ListValue.h" #include "SCA_LogicManager.h" @@ -352,11 +353,6 @@ list<class KX_Camera*>* KX_Scene::GetCameras() return &m_cameras; } -list<class KX_FontObject*>* KX_Scene::GetFonts() -{ - return &m_fonts; -} - void KX_Scene::SetFramingType(RAS_FrameSettings & frame_settings) { m_frame_settings = frame_settings; @@ -1639,6 +1635,15 @@ void KX_Scene::RenderBuckets(const MT_Transform & cameratransform, KX_BlenderMaterial::EndFrame(); } +void KX_Scene::RenderFonts() +{ + list<KX_FontObject*>::iterator it = m_fonts.begin(); + while (it != m_fonts.end()) { + (*it)->DrawText(); + ++it; + } +} + void KX_Scene::UpdateObjectActivity(void) { if (m_activity_culling) { diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index 632e1bf9b50..7c3ea946044 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -381,10 +381,6 @@ public: ); /** Font Routines */ - - std::list<class KX_FontObject*>* - GetFonts( - ); /** Find a font in the scene by pointer. */ KX_FontObject* @@ -398,6 +394,10 @@ public: KX_FontObject* ); + /** Render the fonts in this scene. */ + void + RenderFonts( + ); /** Camera Routines */ diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp index d251f4f7bcb..f184ab9bd1d 100644 --- a/source/gameengine/VideoTexture/ImageRender.cpp +++ b/source/gameengine/VideoTexture/ImageRender.cpp @@ -275,6 +275,8 @@ void ImageRender::Render() m_scene->RenderBuckets(camtrans, m_rasterizer, m_rendertools); + m_scene->RenderFonts(); + // restore the canvas area now that the render is completed m_canvas->GetWindowArea() = area; } |