use float (not double) for font matrix

Following up on recent double --> float commits in the game engine.
This commit is contained in:
Mike Erwin 2015-12-13 21:19:45 -05:00
parent 17a16b57df
commit 87fac9a816
7 changed files with 8 additions and 12 deletions

View File

@ -73,7 +73,7 @@ void BLF_size(int fontid, int size, int dpi);
* | m[3] m[7] m[11] m[15] | * | m[3] m[7] m[11] m[15] |
* *
*/ */
void BLF_matrix(int fontid, const double m[16]); void BLF_matrix(int fontid, const float m[16]);
/* Draw the string using the default font, size and dpi. */ /* Draw the string using the default font, size and dpi. */
void BLF_draw_default(float x, float y, float z, const char *str, size_t len) ATTR_NONNULL(); void BLF_draw_default(float x, float y, float z, const char *str, size_t len) ATTR_NONNULL();

View File

@ -384,7 +384,7 @@ void BLF_aspect(int fontid, float x, float y, float z)
} }
} }
void BLF_matrix(int fontid, const double m[16]) void BLF_matrix(int fontid, const float m[16])
{ {
FontBLF *font = blf_get(fontid); FontBLF *font = blf_get(fontid);
@ -511,7 +511,7 @@ static void blf_draw_gl__start(FontBLF *font, GLint *mode)
glPushMatrix(); glPushMatrix();
if (font->flags & BLF_MATRIX) if (font->flags & BLF_MATRIX)
glMultMatrixd((GLdouble *)&font->m); glMultMatrixf(font->m);
glTranslate3fv(font->pos); glTranslate3fv(font->pos);

View File

@ -194,7 +194,7 @@ typedef struct FontBLF {
/* Multiplied this matrix with the current one before /* Multiplied this matrix with the current one before
* draw the text! see blf_draw__start. * draw the text! see blf_draw__start.
*/ */
double m[16]; float m[16];
/* clipping rectangle. */ /* clipping rectangle. */
rctf clip_rec; rctf clip_rec;

View File

@ -193,11 +193,7 @@ void KX_FontObject::DrawFontText()
const float aspect = m_fsize / size; const float aspect = m_fsize / size;
/* Get a working copy of the OpenGLMatrix to use */ /* Get a working copy of the OpenGLMatrix to use */
double mat[16]; float *mat = GetOpenGLMatrix();
float *origmat = GetOpenGLMatrix();
for (unsigned short i = 0; i < 16; ++i) {
mat[i] = (double)origmat[i];
}
/* Account for offset */ /* Account for offset */
MT_Vector3 offset = this->NodeGetWorldOrientation() * m_offset * this->NodeGetWorldScaling(); MT_Vector3 offset = this->NodeGetWorldOrientation() * m_offset * this->NodeGetWorldScaling();

View File

@ -446,7 +446,7 @@ public:
*/ */
virtual void RenderText3D( virtual void RenderText3D(
int fontid, const char *text, int size, int dpi, int fontid, const char *text, int size, int dpi,
const float color[4], const double mat[16], float aspect) = 0; const float color[4], const float mat[16], float aspect) = 0;
/** /**
* Renders 2D text string. * Renders 2D text string.

View File

@ -1504,7 +1504,7 @@ void RAS_OpenGLRasterizer::RenderBox2D(int xco,
void RAS_OpenGLRasterizer::RenderText3D( void RAS_OpenGLRasterizer::RenderText3D(
int fontid, const char *text, int size, int dpi, int fontid, const char *text, int size, int dpi,
const float color[4], const double mat[16], float aspect) const float color[4], const float mat[16], float aspect)
{ {
/* gl prepping */ /* gl prepping */
DisableForText(); DisableForText();

View File

@ -297,7 +297,7 @@ public:
void RenderBox2D(int xco, int yco, int width, int height, float percentage); void RenderBox2D(int xco, int yco, int width, int height, float percentage);
void RenderText3D(int fontid, const char *text, int size, int dpi, void RenderText3D(int fontid, const char *text, int size, int dpi,
const float color[4], const double mat[16], float aspect); const float color[4], const float mat[16], float aspect);
void RenderText2D(RAS_TEXT_RENDER_MODE mode, const char *text, void RenderText2D(RAS_TEXT_RENDER_MODE mode, const char *text,
int xco, int yco, int width, int height); int xco, int yco, int width, int height);