diff options
Diffstat (limited to 'source/creator/creator.c')
-rw-r--r-- | source/creator/creator.c | 55 |
1 files changed, 17 insertions, 38 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c index 7576954ae48..fd65943fa64 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -59,16 +59,18 @@ #include "BKE_brush.h" #include "BKE_cachefile.h" #include "BKE_context.h" -#include "BKE_depsgraph.h" /* for DAG_init */ #include "BKE_font.h" #include "BKE_global.h" #include "BKE_material.h" #include "BKE_modifier.h" +#include "BKE_gpencil_modifier.h" #include "BKE_node.h" +#include "BKE_shader_fx.h" #include "BKE_sound.h" #include "BKE_image.h" #include "BKE_particle.h" +#include "DEG_depsgraph.h" #include "IMB_imbuf.h" /* for IMB_init */ @@ -78,6 +80,7 @@ #include "ED_datafiles.h" #include "WM_api.h" +#include "WM_toolsystem.h" #include "RNA_define.h" @@ -85,13 +88,6 @@ # include "FRS_freestyle.h" #endif -/* for passing information between creator and gameengine */ -#ifdef WITH_GAMEENGINE -# include "BL_System.h" -#else /* dummy */ -# define SYS_SystemHandle int -#endif - #include <signal.h> #ifdef __FreeBSD__ @@ -131,11 +127,10 @@ struct ApplicationState app_state = { }, .exit_code_on_error = { .python = 0, - } + }, }; /* -------------------------------------------------------------------- */ - /** \name Application Level Callbacks * * Initialize callbacks for the modules that need them. @@ -191,9 +186,7 @@ static void callback_clg_fatal(void *fp) /** \} */ - /* -------------------------------------------------------------------- */ - /** \name Main Function * \{ */ @@ -226,7 +219,6 @@ int main( ) { bContext *C; - SYS_SystemHandle syshandle; #ifndef WITH_PYTHON_MODULE bArgs *ba; @@ -243,6 +235,11 @@ int main( struct CreatorAtExitData app_init_data = {NULL}; BKE_blender_atexit_register(callback_main_atexit, &app_init_data); + /* Unbuffered stdout makes stdout and stderr better synchronized, and helps + * when stepping through code in a debugger (prints are immediately + * visible). */ + setvbuf(stdout, NULL, _IONBF, 0); + #ifdef WIN32 /* We delay loading of openmp so we can set the policy here. */ # if defined(_MSC_VER) @@ -375,7 +372,9 @@ int main( BKE_cachefiles_init(); BKE_images_init(); BKE_modifier_init(); - DAG_init(); + BKE_gpencil_modifier_init(); + BKE_shaderfx_init(); + DEG_register_node_types(); BKE_brush_system_init(); RE_texture_rng_init(); @@ -383,12 +382,6 @@ int main( BLI_callback_global_init(); -#ifdef WITH_GAMEENGINE - syshandle = SYS_GetSystem(); -#else - syshandle = 0; -#endif - /* first test for background */ #ifndef WITH_PYTHON_MODULE ba = BLI_argsInit(argc, (const char **)argv); /* skip binary path */ @@ -396,15 +389,15 @@ int main( /* ensure we free on early exit */ app_init_data.ba = ba; - main_args_setup(C, ba, &syshandle); + main_args_setup(C, ba); BLI_argsParse(ba, 1, NULL, NULL); main_signal_setup(); #else - G.factory_startup = true; /* using preferences or user startup makes no sense for py-as-module */ - (void)syshandle; + /* using preferences or user startup makes no sense for py-as-module */ + G.factory_startup = true; #endif #ifdef WITH_FFMPEG @@ -472,7 +465,7 @@ int main( #endif CTX_py_init_set(C, 1); - WM_keymap_init(C); + WM_keyconfig_init(C); #ifdef WITH_FREESTYLE /* initialize Freestyle */ @@ -519,20 +512,6 @@ int main( WM_exit(C); } else { - if (G.fileflags & G_FILE_AUTOPLAY) { - if (G.f & G_SCRIPT_AUTOEXEC) { - if (WM_init_game(C)) { - return 0; - } - } - else { - if (!(G.f & G_SCRIPT_AUTOEXEC_FAIL_QUIET)) { - G.f |= G_SCRIPT_AUTOEXEC_FAIL; - BLI_snprintf(G.autoexec_fail, sizeof(G.autoexec_fail), "Game AutoStart"); - } - } - } - if (!G.file_loaded) { WM_init_splash(C); } |