[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33031] trunk/blender/source: Getting BLF to work with the Blenderplayer.

Mitchell Stokes mogurijin at gmail.com
Fri Nov 12 08:16:34 CET 2010


Revision: 33031
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33031
Author:   moguri
Date:     2010-11-12 08:16:33 +0100 (Fri, 12 Nov 2010)

Log Message:
-----------
Getting BLF to work with the Blenderplayer.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/datafiles/SConscript
    trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c
    trunk/blender/source/blenderplayer/bad_level_call_stubs/stubs.c
    trunk/blender/source/gameengine/GamePlayer/ghost/CMakeLists.txt
    trunk/blender/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
    trunk/blender/source/gameengine/GamePlayer/ghost/SConscript

Modified: trunk/blender/source/blender/editors/datafiles/SConscript
===================================================================
--- trunk/blender/source/blender/editors/datafiles/SConscript	2010-11-12 02:50:57 UTC (rev 33030)
+++ trunk/blender/source/blender/editors/datafiles/SConscript	2010-11-12 07:16:33 UTC (rev 33031)
@@ -6,4 +6,4 @@
 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] )

Modified: trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c	2010-11-12 02:50:57 UTC (rev 33030)
+++ trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c	2010-11-12 07:16:33 UTC (rev 33031)
@@ -129,7 +129,7 @@
 	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 */

Modified: trunk/blender/source/blenderplayer/bad_level_call_stubs/stubs.c
===================================================================
--- trunk/blender/source/blenderplayer/bad_level_call_stubs/stubs.c	2010-11-12 02:50:57 UTC (rev 33030)
+++ trunk/blender/source/blenderplayer/bad_level_call_stubs/stubs.c	2010-11-12 07:16:33 UTC (rev 33031)
@@ -116,8 +116,6 @@
 /* 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;}

Modified: trunk/blender/source/gameengine/GamePlayer/ghost/CMakeLists.txt
===================================================================
--- trunk/blender/source/gameengine/GamePlayer/ghost/CMakeLists.txt	2010-11-12 02:50:57 UTC (rev 33030)
+++ trunk/blender/source/gameengine/GamePlayer/ghost/CMakeLists.txt	2010-11-12 07:16:33 UTC (rev 33031)
@@ -36,6 +36,7 @@
 	../../../../source/gameengine/Converter
 	../../../../source/blender/imbuf
 	../../../../source/gameengine/Ketsji
+	../../../../source/blender/blenfont
 	../../../../source/blender/blenlib
 	../../../../source/blender/blenkernel
 	../../../../source/blender/readblenfile

Modified: trunk/blender/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
===================================================================
--- trunk/blender/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp	2010-11-12 02:50:57 UTC (rev 33030)
+++ trunk/blender/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp	2010-11-12 07:16:33 UTC (rev 33031)
@@ -72,6 +72,11 @@
 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 @@
 	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)

Modified: trunk/blender/source/gameengine/GamePlayer/ghost/SConscript
===================================================================
--- trunk/blender/source/gameengine/GamePlayer/ghost/SConscript	2010-11-12 02:50:57 UTC (rev 33030)
+++ trunk/blender/source/gameengine/GamePlayer/ghost/SConscript	2010-11-12 07:16:33 UTC (rev 33031)
@@ -19,6 +19,7 @@
         '#source/gameengine/Converter',
         '#source/blender/imbuf',
         '#source/gameengine/Ketsji',
+        '#source/blender/blenfont',
         '#source/blender/blenlib',
         '#source/blender/blenkernel',
         '#source/blender/readblenfile',





More information about the Bf-blender-cvs mailing list