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 99acd52806e592d634797cf1a2c94d2004061658..dd0db90af448573d1b8ca0b01f95f03ed80ad376 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 d98459a113cbb10776fd7dbf2f418223f13f48d4..855317b9f76801d1961cda58d339a7dc1354707a 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 6c97c2a4465cb751f4d4bf55acb22f93b347986c..b3c9aede6b5770c9d3932a361128ddc4b1a3364c 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 7f0a57be3713b393936b8be3c18829fba5f58dd4..f6a84b0852d5d442b2e0b8e1754fe9aa6f7d2f1b 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 e02a8a53ba228c6bb5c5a2820b815484cdc0d570..824b11d77f87ffc01480c376cc6cce0caf07f01d 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 45eea75eb2f633cbf05be3b2fb1b3bb941877341..d9aaa56b19e93ae24e2f7d5efb0cb0a44d69dc5f 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 d2224884f7fbb8a97606aa390eb3a630dd4df5fd..eb3d50a49bd846927accddaa0a26bdd65719f424 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',