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:22:15 +0400
committerMitchell Stokes <mogurijin@gmail.com>2013-11-04 23:22:15 +0400
commit64c346ed1ec76bf91303a7f8ca0bbd0587ba2635 (patch)
tree3c1c767dac1db9a2143123ae260783953fed32c8 /source/gameengine
parentfb94a539789e06148b28a73f59f0aefd0ad71e00 (diff)
BGE Rasterizer Cleanup: The Blenderplayer now loads the monospace font so it can properly draw the framerate and profile display.
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp4
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp16
2 files changed, 10 insertions, 10 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index 5bed4fa40b6..385fa0a42d8 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -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)
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
index 41847bb0f8f..7360b1b1d8e 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
@@ -1498,18 +1498,14 @@ 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 */
}
+ /* 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();
glMatrixMode(GL_MODELVIEW);