- Jack transport update: Moving the playhead in another jack app when not playing...
authorJoerg Mueller <nexyon@gmail.com>
Mon, 22 Feb 2010 09:01:49 +0000 (09:01 +0000)
committerJoerg Mueller <nexyon@gmail.com>
Mon, 22 Feb 2010 09:01:49 +0000 (09:01 +0000)
- Missing stub fix from last commit by nazg-gul, blenderplayer works now atm.

source/blender/windowmanager/intern/wm_event_system.c
source/blenderplayer/bad_level_call_stubs/stubs.c

index 74679ce89a68920e62119758997f82f0a86d06d7..92780d1b97380aac2816d0a3e7bccb99b0e36b19 100644 (file)
@@ -1533,23 +1533,32 @@ void wm_event_do_handlers(bContext *C)
                        wm_event_free_all(win);
                else
                {
-                       if(win->screen->scene)
+                       Scene* scene = win->screen->scene;
+                       if(scene)
                        {
                                int playing = sound_scene_playing(win->screen->scene);
                                if(playing != -1)
                                {
+                                       CTX_wm_window_set(C, win);
+                                       CTX_wm_screen_set(C, win->screen);
+                                       CTX_data_scene_set(C, scene);
                                        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);
                                        }
+                                       if(playing == 0)
+                                       {
+                                               int ncfra = floor(sound_sync_scene(scene) * FPS);
+                                               if(ncfra != scene->r.cfra)
+                                               {
+                                                       scene->r.cfra = ncfra;
+                                                       ED_update_for_newframe(C, 1);
+                                                       WM_event_add_notifier(C, NC_WINDOW, NULL);
+                                               }
+                                       }
+                                       CTX_data_scene_set(C, NULL);
+                                       CTX_wm_screen_set(C, NULL);
+                                       CTX_wm_window_set(C, NULL);
                                }
                        }
                }
index d3a760002aea27506288c7b323d8a13dd76748d6..9c8ccfe7380a84d46983c32e06b411774af1870b 100644 (file)
@@ -88,6 +88,7 @@ int WM_enum_search_invoke(struct bContext *C, struct wmOperator *op, struct wmEv
 void WM_event_add_notifier(const struct bContext *C, unsigned int type, void *reference){}
 void WM_main_add_notifier(unsigned int type, void *reference){}
 void ED_armature_bone_rename(struct bArmature *arm, char *oldnamep, char *newnamep){}
+struct wmEventHandler *WM_event_add_modal_handler(struct bContext *C, struct wmOperator *op){return (struct wmEventHandler *)NULL;};
 void ED_armature_edit_bone_remove(struct bArmature *arm, struct EditBone *exBone){}
 void object_test_constraints (struct Object *owner){}
 void ED_object_parent(struct Object *ob, struct Object *par, int type, const char *substr){}