diff options
Diffstat (limited to 'source/gameengine/GamePlayer/ghost/GPG_ghost.cpp')
-rw-r--r-- | source/gameengine/GamePlayer/ghost/GPG_ghost.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index a56d5b6d027..137f4cd6bc8 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -43,6 +43,7 @@ #include "KX_KetsjiEngine.h" #include "KX_PythonInit.h" #include "KX_PythonMain.h" +#include "KX_PyConstraintBinding.h" // for PHY_SetActiveEnvironment /********************************** * Begin Blender include block @@ -87,7 +88,8 @@ extern "C" // For BLF #include "BLF_api.h" -#include "BLF_translation.h" +#include "BLT_translation.h" +#include "BLT_lang.h" extern int datatoc_bfont_ttf_size; extern char datatoc_bfont_ttf[]; extern int datatoc_bmonofont_ttf_size; @@ -472,8 +474,8 @@ int main(int argc, char** argv) // 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_lang_set(""); + BLT_lang_init(); + BLT_lang_set(""); BLF_load_mem("default", (unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size); if (blf_mono_font == -1) @@ -853,7 +855,7 @@ int main(int argc, char** argv) get_filename(argc_py_clamped, argv, filename); if (filename[0]) - BLI_path_cwd(filename); + BLI_path_cwd(filename, sizeof(filename)); // fill the GlobalSettings with the first scene files @@ -1079,6 +1081,11 @@ int main(int argc, char** argv) char *python_code = KX_GetPythonCode(maggie, python_main); if (python_code) { #ifdef WITH_PYTHON + // Set python environement variable. + KX_Scene *startscene = app.GetStartScene(); + KX_SetActiveScene(startscene); + PHY_SetActiveEnvironment(startscene->GetPhysicsEnvironment()); + gpg_nextframestate.system = system; gpg_nextframestate.app = &app; gpg_nextframestate.gs = &gs; @@ -1140,7 +1147,7 @@ int main(int argc, char** argv) #ifdef WITH_INTERNATIONAL BLF_free_unifont(); BLF_free_unifont_mono(); - BLF_lang_free(); + BLT_lang_free(); #endif IMB_exit(); |