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:
authorMitchell Stokes <mogurijin@gmail.com>2013-11-04 23:21:21 +0400
committerMitchell Stokes <mogurijin@gmail.com>2013-11-04 23:21:21 +0400
commite2c91b570d5c00c2a4882ff2418de085b5dccbfc (patch)
tree0a045aa379ce8573fc322e06ae544fab13f55c9d /source/gameengine
parenta565e34c39880557ca09ec02d8bfb05e4bcccbae (diff)
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().
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/Rasterizer/RAS_IRasterizer.h10
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp49
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h8
3 files changed, 18 insertions, 49 deletions
diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h
index 8291b9a2d5b..034ea7f87a9 100644
--- a/source/gameengine/Rasterizer/RAS_IRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h
@@ -495,16 +495,6 @@ public:
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;
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
index 9d1fb3ba63c..4a8afb2b652 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
@@ -681,6 +681,12 @@ void RAS_OpenGLRasterizer::IndexPrimitives_3DText(RAS_MeshSlot& ms,
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) {
@@ -732,9 +738,18 @@ void RAS_OpenGLRasterizer::IndexPrimitives_3DText(RAS_MeshSlot& ms,
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 @@ void RAS_OpenGLRasterizer::RenderText2D(RAS_TEXT_RENDER_MODE mode,
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();
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
index bd9e479464a..a6fa057e6c0 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
@@ -366,14 +366,6 @@ public:
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);