[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [61089] trunk/blender/source/gameengine/ Rasterizer: BGE Rasterizer Cleanup: Getting rid of RAS_IRasterizer:: RenderText(), and just adding the code to IndexPrimitives_3DText(), which is the only function that uses RenderText().

Mitchell Stokes mogurijin at gmail.com
Mon Nov 4 20:21:21 CET 2013


Revision: 61089
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=61089
Author:   moguri
Date:     2013-11-04 19:21:21 +0000 (Mon, 04 Nov 2013)
Log Message:
-----------
BGE Rasterizer Cleanup: Getting rid of RAS_IRasterizer::RenderText(), and just adding the code to IndexPrimitives_3DText(), which is the only function that uses RenderText().

Modified Paths:
--------------
    trunk/blender/source/gameengine/Rasterizer/RAS_IRasterizer.h
    trunk/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
    trunk/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h

Modified: trunk/blender/source/gameengine/Rasterizer/RAS_IRasterizer.h
===================================================================
--- trunk/blender/source/gameengine/Rasterizer/RAS_IRasterizer.h	2013-11-04 19:21:16 UTC (rev 61088)
+++ trunk/blender/source/gameengine/Rasterizer/RAS_IRasterizer.h	2013-11-04 19:21:21 UTC (rev 61089)
@@ -495,16 +495,6 @@
 							int height
 						) = 0;
 
-	// 3d text, mapped on polygon
-	virtual void RenderText(int mode,
-							RAS_IPolyMaterial* polymat,
-							float v1[3],
-							float v2[3],
-							float v3[3],
-							float v4[3],
-							int glattrib
-						)=0;
-
 	virtual	void ProcessLighting(bool uselights, const MT_Transform& trans)=0;
 
 	virtual void PushMatrix()=0;

Modified: trunk/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
===================================================================
--- trunk/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp	2013-11-04 19:21:16 UTC (rev 61088)
+++ trunk/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp	2013-11-04 19:21:21 UTC (rev 61089)
@@ -681,7 +681,13 @@
 	bool obcolor = ms.m_bObjectColor;
 	MT_Vector4& rgba = ms.m_RGBAcolor;
 	RAS_MeshSlot::iterator it;
+	struct MTFace* tface = 0;
 
+	const STR_String& mytext = ((CValue*)m_clientobject)->GetPropertyText("Text");
+
+	const unsigned int flag = polymat->GetFlag();
+	unsigned int *col = 0;
+
 	// handle object color
 	if (obcolor) {
 		glDisableClientState(GL_COLOR_ARRAY);
@@ -732,10 +738,19 @@
 					for (unit=0; unit<m_attrib_num; unit++)
 						if (m_attrib[unit] == RAS_TEXCO_UV)
 							glattrib = unit;
-				
-				RenderText(polymat->GetDrawingMode(), polymat,
-					v[0], v[1], v[2], (numvert == 4)? v[3]: NULL, glattrib);
 
+				if (flag & RAS_BLENDERMAT) {
+					KX_BlenderMaterial *bl_mat = static_cast<KX_BlenderMaterial*>(polymat);
+					tface = bl_mat->GetMTFace();
+					col = bl_mat->GetMCol();
+				} else {
+					KX_PolygonMaterial* blenderpoly = static_cast<KX_PolygonMaterial*>(polymat);
+					tface = blenderpoly->GetMTFace();
+					col = blenderpoly->GetMCol();
+				}
+
+				GPU_render_text(tface, polymat->GetDrawingMode(), mytext, mytext.Length(), col, v[1], v[2], v[3], v[4], glattrib);
+
 				ClearCachingInfo();
 			}
 		}
@@ -1500,34 +1515,6 @@
 	glEnable(GL_DEPTH_TEST);
 }
 
-/* Render Text renders text into a (series of) polygon, using a texture font,
- * Each character consists of one polygon (one quad or two triangles) */
-
-void RAS_OpenGLRasterizer::RenderText(
-	int mode,
-	RAS_IPolyMaterial* polymat,
-	float v1[3], float v2[3], float v3[3], float v4[3], int glattrib)
-{
-	const STR_String& mytext = ((CValue*)m_clientobject)->GetPropertyText("Text");
-
-	const unsigned int flag = polymat->GetFlag();
-	struct MTFace* tface = 0;
-	unsigned int *col = 0;
-
-	if (flag & RAS_BLENDERMAT) {
-		KX_BlenderMaterial *bl_mat = static_cast<KX_BlenderMaterial*>(polymat);
-		tface = bl_mat->GetMTFace();
-		col = bl_mat->GetMCol();
-	} else {
-		KX_PolygonMaterial* blenderpoly = static_cast<KX_PolygonMaterial*>(polymat);
-		tface = blenderpoly->GetMTFace();
-		col = blenderpoly->GetMCol();
-	}
-
-	GPU_render_text(tface, mode, mytext, mytext.Length(), col, v1, v2, v3, v4, glattrib);
-}
-
-
 void RAS_OpenGLRasterizer::PushMatrix()
 {
 	glPushMatrix();

Modified: trunk/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
===================================================================
--- trunk/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h	2013-11-04 19:21:16 UTC (rev 61088)
+++ trunk/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h	2013-11-04 19:21:21 UTC (rev 61089)
@@ -366,14 +366,6 @@
 						 int width,
 						 int height);
 
-	void	RenderText(int mode,
-					   class RAS_IPolyMaterial* polymat,
-					   float v1[3],
-					   float v2[3],
-					   float v3[3],
-					   float v4[3],
-					   int glattrib);
-
 	void	applyTransform(double* oglmatrix, int objectdrawmode);
 	int		applyLights(int objectlayer, const MT_Transform& viewmat);
 




More information about the Bf-blender-cvs mailing list