diff options
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 23 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 8 |
2 files changed, 27 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 4b07aa82239..74679ce89a6 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -50,6 +50,7 @@ #include "BKE_scene.h" #include "BKE_screen.h" #include "BKE_utildefines.h" +#include "BKE_sound.h" #include "ED_fileselect.h" #include "ED_info.h" @@ -1530,6 +1531,28 @@ void wm_event_do_handlers(bContext *C) if( win->screen==NULL ) wm_event_free_all(win); + else + { + if(win->screen->scene) + { + int playing = sound_scene_playing(win->screen->scene); + if(playing != -1) + { + if(((playing == 1) && (!win->screen->animtimer)) || ((playing == 0) && (win->screen->animtimer))) + { + CTX_wm_window_set(C, win); + CTX_wm_screen_set(C, win->screen); + CTX_data_scene_set(C, win->screen->scene); + + ED_screen_animation_play(C, -1, 1); + + CTX_data_scene_set(C, NULL); + CTX_wm_screen_set(C, NULL); + CTX_wm_window_set(C, NULL); + } + } + } + } while( (event= win->queue.first) ) { int action = WM_HANDLER_CONTINUE; diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index efa8aa7e819..16776517e40 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -236,11 +236,11 @@ static void wm_window_match_do(bContext *C, ListBase *oldwmlist) } /* in case UserDef was read, we re-initialize all, and do versioning */ -static void wm_init_userdef() +static void wm_init_userdef(bContext *C) { UI_init_userdef(); MEM_CacheLimiter_set_maximum(U.memcachelimit * 1024 * 1024); - sound_init(); + sound_init(CTX_data_main(C)); } void WM_read_file(bContext *C, char *name, ReportList *reports) @@ -269,7 +269,7 @@ void WM_read_file(bContext *C, char *name, ReportList *reports) // XXX mainwindow_set_filename_to_title(G.main->name); - if(retval==2) wm_init_userdef(); // in case a userdef is read from regular .blend + if(retval==2) wm_init_userdef(C); // in case a userdef is read from regular .blend if (retval!=0) { G.relbase_valid = 1; @@ -338,7 +338,7 @@ int WM_read_homefile(bContext *C, wmOperator *op) strcpy(G.sce, scestr); /* restore */ - wm_init_userdef(); + wm_init_userdef(C); /* When loading factory settings, the reset solid OpenGL lights need to be applied. */ if (!G.background) GPU_default_lights(); |