diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2004-07-20 12:16:46 +0400 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2004-07-20 12:16:46 +0400 |
commit | 7b3b3ae432f692ed32f57aa70bdab5b89a05be21 (patch) | |
tree | 5cb77a8ba082858798b6312a8b6d20824abaaf53 /source/blender/src/editscreen.c | |
parent | 9bf16550706c7fdf22d6d76b0e5a41ec3b538fbc (diff) |
Trying to fix bug reported by Peter den Bak and Meino Christian Cramer (thanks!):
-- splash screen disappeared (duh, I did that!) and Blender quits upon exiting from some 225 games:
It was troublesome to find how to run demos in general with the screen correctly redrawn before they started, etc. Ended up making the above error in screenmain(). About the games, I don't have them and will need some time to get the files for testing, but I'll do it, though only on linux.
BPython:
-- Window: added GetScreens, SetScreen and improved GetScreenInfo.
-- Object, NMesh: updated (added in NMesh) method getMaterials to return either only valid materials as before or also empty slots (as None). This previous omission can be considered a bug, since it made info about materials incomplete / incompatible with face mat indices. Thanks Yann Vernier for bringing this up and sending/proposing a patch that also fixed a bug related to assigning lists of materials with different lengths to obj and its mesh. setMaterials also accepts Py_None entries now, which become empty slots in Blender.
-- doc updates.
Diffstat (limited to 'source/blender/src/editscreen.c')
-rw-r--r-- | source/blender/src/editscreen.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c index b592e25daff..f53dbb2d5f4 100644 --- a/source/blender/src/editscreen.c +++ b/source/blender/src/editscreen.c @@ -939,7 +939,8 @@ void screenmain(void) { int has_input= 1; int firsttime = 1; - + int onload_script = 0; + window_make_active(mainwin); while (1) { @@ -1035,8 +1036,10 @@ void screenmain(void) BIF_read_file(ext_load_str); sound_initialize_sounds(); } - else if (event==ONLOAD_SCRIPT) { - firsttime = 1; /* trick to run BPY_do_pyscript below */ + else if ((event==ONLOAD_SCRIPT) && BPY_has_onload_script()) { + /* event queued in setup_app_data() in blender.c, where G.f is checked */ + onload_script = 1; + firsttime = 1; /* see last 'if' in this function */ } else { towin= 1; @@ -1133,8 +1136,13 @@ void screenmain(void) /* Bizar hack. The event queue has mutated... */ if ( (firsttime) && (event == 0) ) { - - if (G.fileflags & G_FILE_AUTOPLAY) { + + if (onload_script) { + /* OnLoad scriptlink */ + BPY_do_pyscript(&G.scene->id, SCRIPT_ONLOAD); + onload_script = 0; + } + else if (G.fileflags & G_FILE_AUTOPLAY) { // SET AUTOPLAY in G.flags for // other fileloads @@ -1145,9 +1153,6 @@ void screenmain(void) // fake a 'p' keypress mainqenter(PKEY, 1); - } else if (G.f & G_SCENESCRIPT) { - /* ONLOAD scriptlink */ - BPY_do_pyscript(&G.scene->id, SCRIPT_ONLOAD); } else { extern char datatoc_splash_jpg[]; extern int datatoc_splash_jpg_size; |