diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2006-05-13 04:08:14 +0400 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2006-05-13 04:08:14 +0400 |
commit | 50a1d9fc8bfcd376ba808da54a0fa828aa32c9f2 (patch) | |
tree | 510f00bd75ea7283906fb5456d0363b63abe71f5 /source/gameengine/GamePlayer/common | |
parent | 1e23c080de9b53604cb07a47dfc0ec16cd70a6f2 (diff) |
Text patch for game player, from Charlie: TFace from KX_PolygonMaterial, as opposed to KX_BlenderMaterial
Diffstat (limited to 'source/gameengine/GamePlayer/common')
-rw-r--r-- | source/gameengine/GamePlayer/common/GPC_RenderTools.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index 9bc01e1408e..43e823d59ac 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -99,7 +99,7 @@ #include "KX_RayCast.h" #include "KX_IPhysicsController.h" #include "PHY_IPhysicsEnvironment.h" - +#include "KX_BlenderMaterial.h" GPC_RenderTools::GPC_RenderTools() { @@ -253,9 +253,17 @@ void GPC_RenderTools::RenderText( { STR_String mytext = ((CValue*)m_clientobject)->GetPropertyText("Text"); - KX_PolygonMaterial* blenderpoly = static_cast<KX_PolygonMaterial*>(polymat); - struct TFace* tface = blenderpoly->GetTFace(); - + const unsigned int flag = polymat->GetFlag(); + struct TFace* tface = 0; + + if(flag & RAS_BLENDERMAT) { + KX_BlenderMaterial *bl_mat = static_cast<KX_BlenderMaterial*>(polymat); + tface = bl_mat->GetTFace(); + } else { + KX_PolygonMaterial* blenderpoly = static_cast<KX_PolygonMaterial*>(polymat); + tface = blenderpoly->GetTFace(); + } + BL_RenderText(mode, mytext, mytext.Length(), tface, v1, v2, v3, v4); } |