Getting BLF to work with the Blenderplayer.
authorMitchell Stokes <mogurijin@gmail.com>
Fri, 12 Nov 2010 07:16:33 +0000 (07:16 +0000)
committerMitchell Stokes <mogurijin@gmail.com>
Fri, 12 Nov 2010 07:16:33 +0000 (07:16 +0000)
source/blender/editors/datafiles/SConscript
source/blender/windowmanager/intern/wm_init_exit.c
source/blenderplayer/CMakeLists.txt
source/blenderplayer/bad_level_call_stubs/stubs.c
source/gameengine/GamePlayer/ghost/CMakeLists.txt
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
source/gameengine/GamePlayer/ghost/SConscript

index 99acd52..dd0db90 100644 (file)
@@ -6,4 +6,4 @@ sources = env.Glob('*.c')
 incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
 incs += ' #/intern/guardedalloc'
 
-env.BlenderLib ( 'bf_editor_datafiles', sources, Split(incs), [], libtype=['core'], priority=[235] )
+env.BlenderLib ( 'bf_editor_datafiles', sources, Split(incs), [], libtype=['core', 'player'], priority=[235, 30] )
index d98459a..855317b 100644 (file)
@@ -129,7 +129,7 @@ void WM_init(bContext *C, int argc, char **argv)
        ED_file_init();                 /* for fsmenu */
        ED_init_node_butfuncs();        
        
-       BLF_init(11, U.dpi);
+       BLF_init(11, U.dpi); /* Please update source/gamengine/GamePlayer/GPG_ghost.cpp if you change this */
        BLF_lang_init();
        
        /* get the default database, plus a wm */
index 6c97c2a..b3c9aed 100644 (file)
@@ -70,7 +70,8 @@ IF(UNIX)
                bf_blenkernel
                bf_blenloader 
                bf_blenpluginapi 
-               bf_blroutines 
+               bf_blroutines
+               bf_editor_datafiles
                bf_converter 
                bf_ketsji 
                bf_bullet 
index 7f0a57b..f6a84b0 100644 (file)
@@ -116,8 +116,6 @@ struct Render *RE_GetRender(const char *name){return (struct Render *) NULL;}
 /* blenkernel */
 char btempdir[] = "";
 void RE_FreeRenderResult(struct RenderResult *res){}
-char datatoc_bmonofont_ttf[] = "";
-int datatoc_bmonofont_ttf_size = 0;
 struct RenderResult *RE_MultilayerConvert(void *exrhandle, int rectx, int recty){return (struct RenderResult *) NULL;}
 void RE_GetResultImage(struct Render *re, struct RenderResult *rr){}
 int RE_RenderInProgress(struct Render *re){return 0;}
index e02a8a5..824b11d 100644 (file)
@@ -36,6 +36,7 @@ SET(INC
        ../../../../source/gameengine/Converter
        ../../../../source/blender/imbuf
        ../../../../source/gameengine/Ketsji
+       ../../../../source/blender/blenfont
        ../../../../source/blender/blenlib
        ../../../../source/blender/blenkernel
        ../../../../source/blender/readblenfile
index 45eea75..d9aaa56 100644 (file)
@@ -72,6 +72,11 @@ extern "C"
 extern char bprogname[];       /* holds a copy of argv[0], from creator.c */
 extern char btempdir[];                /* use this to store a valid temp directory */
 
+// For BLF
+#include "BLF_api.h"
+extern int datatoc_bfont_ttf_size;
+extern char datatoc_bfont_ttf[];
+
 #ifdef __cplusplus
 }
 #endif // __cplusplus
@@ -389,6 +394,11 @@ int main(int argc, char** argv)
        GEN_init_messaging_system();
 
        IMB_init();
+
+       // Setup builtin font for BLF (mostly copied from creator.c, wm_init_exit.c and interface_style.c)
+       BLF_init(11, U.dpi);
+       BLF_lang_init();
+       BLF_load_mem("default", (unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size);
  
        // Parse command line options
 #if defined(DEBUG)
index d222488..eb3d50a 100644 (file)
@@ -19,6 +19,7 @@ incs = ['.',
         '#source/gameengine/Converter',
         '#source/blender/imbuf',
         '#source/gameengine/Ketsji',
+        '#source/blender/blenfont',
         '#source/blender/blenlib',
         '#source/blender/blenkernel',
         '#source/blender/readblenfile',