BGE Rasterizer Cleanup: The Blenderplayer now loads the monospace font so it can properly draw the framerate and profile display.

This commit is contained in:
Mitchell Stokes 2013-11-04 19:22:15 +00:00
parent fb94a53978
commit 64c346ed1e
2 changed files with 10 additions and 10 deletions

@ -88,6 +88,8 @@ extern "C"
#include "BLF_translation.h"
extern int datatoc_bfont_ttf_size;
extern char datatoc_bfont_ttf[];
extern int datatoc_bmonofont_ttf_size;
extern char datatoc_bmonofont_ttf[];
#ifdef __cplusplus
}
@ -475,6 +477,8 @@ int main(int argc, char** argv)
BLF_lang_set("");
BLF_load_mem("default", (unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size);
if (blf_mono_font == -1)
blf_mono_font = BLF_load_mem_unique("monospace", (unsigned char*)datatoc_bmonofont_ttf, datatoc_bmonofont_ttf_size);
// Parse command line options
#if defined(DEBUG)

@ -1498,17 +1498,13 @@ void RAS_OpenGLRasterizer::RenderText2D(RAS_TEXT_RENDER_MODE mode,
BLF_size(blf_mono_font, 11, 72);
BLF_position(blf_mono_font, (float)xco+1, (float)(height-yco-1), 0.0f);
BLF_draw(blf_mono_font, (char *)text, 65535);/* XXX, use real len */
}
glColor3ub(255, 255, 255);
BLF_position(blf_mono_font, (float)xco, (float)(height-yco), 0.0f);
BLF_draw(blf_mono_font, (char *)text, 65535);
} else {
/* the actual drawing */
glColor3ub(255, 255, 255);
BLF_size(blf_mono_font, 11, 72);
BLF_position(blf_mono_font, (float)xco, (float)(height-yco), 0.0f);
BLF_draw(blf_mono_font, (char *)text, 65535); /* XXX, use real len */
}
glMatrixMode(GL_PROJECTION);
glPopMatrix();