diff options
Diffstat (limited to 'source/gameengine/GamePlayer/ghost/GPG_ghost.cpp')
-rw-r--r-- | source/gameengine/GamePlayer/ghost/GPG_ghost.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 3f8bcf9e2ad..d4ce19de83f 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -746,6 +746,11 @@ int main(int argc, char** argv) if(filename[0]) BLI_path_cwd(filename); + + // fill the GlobalSettings with the first scene files + // those may change during the game and persist after using Game Actuator + GlobalSettings gs; + do { // Read the Blender file @@ -799,9 +804,13 @@ int main(int argc, char** argv) Scene *scene = bfd->curscene; G.main = maggie; - if (firstTimeRunning) + if (firstTimeRunning) { G.fileflags = bfd->fileflags; + gs.matmode= scene->gm.matmode; + gs.glslflag= scene->gm.flag; + } + //Seg Fault; icon.c gIcons == 0 BKE_icons_init(1); @@ -861,7 +870,7 @@ int main(int argc, char** argv) } // GPG_Application app (system, maggie, startscenename); - app.SetGameEngineData(maggie, scene, argc, argv); /* this argc cant be argc_py_clamped, since python uses it */ + app.SetGameEngineData(maggie, scene, &gs, argc, argv); /* this argc cant be argc_py_clamped, since python uses it */ BLI_strncpy(pathname, maggie->name, sizeof(pathname)); if(G.main != maggie) { BLI_strncpy(G.main->name, maggie->name, sizeof(G.main->name)); @@ -957,6 +966,7 @@ int main(int argc, char** argv) { run = false; exitstring = app.getExitString(); + gs = *app.getGlobalSettings(); } } app.StopGameEngine(); |