diff options
author | Ton Roosendaal <ton@blender.org> | 2008-12-27 20:43:05 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2008-12-27 20:43:05 +0300 |
commit | b97ee36f8dc1cd12039d5cbd317cb32be43a59ef (patch) | |
tree | f885803b33b7436427485b9c9bd1392e57223a52 /source/blender/windowmanager | |
parent | b7c7057f3e876cd0f964e2badc43e0b9a5e25d3b (diff) |
2.5
Anim playback part 1 (needs more test, will do after commit)
- added the update_for_new_frame() back
- proper evaluation of time change notifier in WM level
- fixed redraw flushes for menus while animation plays.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 64 |
1 files changed, 52 insertions, 12 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index b0abdc3b7f2..f241fb7f91e 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -48,6 +48,7 @@ #include "ED_screen.h" #include "ED_space_api.h" +#include "ED_anim_api.h" #include "RNA_access.h" @@ -127,6 +128,25 @@ void wm_event_do_notifiers(bContext *C) { wmWindowManager *wm= CTX_wm_manager(C); wmNotifier *note; + wmWindow *win; + + /* cache & catch WM level notifiers, such as frame change */ + /* XXX todo, multiwindow scenes */ + for(win= wm->windows.first; win; win= win->next) { + int do_anim= 0; + + for(note= wm->queue.first; note; note= note->next) { + if(note->window==win) + if(note->category==NC_SCENE) + if(note->data==ND_FRAME) + do_anim= 1; + } + if(do_anim) { + /* depsgraph gets called, might send more notifiers */ + CTX_wm_window_set(C, win); + ED_update_for_newframe(C, 1); + } + } while( (note=wm_notifier_next(wm)) ) { wmWindow *win; @@ -158,15 +178,11 @@ void wm_event_do_notifiers(bContext *C) } } -/* mark regions to redraw if overlapped with rect */ -static void wm_flush_regions(bScreen *screen, rcti *dirty) +/* mark area-regions to redraw if overlapped with rect */ +static void wm_flush_regions_down(bScreen *screen, rcti *dirty) { ScrArea *sa; ARegion *ar; - - for(ar= screen->regionbase.first; ar; ar= ar->next) - if(BLI_isect_rcti(dirty, &ar->winrct, NULL)) - ar->do_draw= 1; for(sa= screen->areabase.first; sa; sa= sa->next) for(ar= sa->regionbase.first; ar; ar= ar->next) @@ -174,18 +190,42 @@ static void wm_flush_regions(bScreen *screen, rcti *dirty) ar->do_draw= 1; } +/* mark menu-regions to redraw if overlapped with rect */ +static void wm_flush_regions_up(bScreen *screen, rcti *dirty) +{ + ARegion *ar; + + for(ar= screen->regionbase.first; ar; ar= ar->next) + if(BLI_isect_rcti(dirty, &ar->winrct, NULL)) + ar->do_draw= 1; +} + + /* all the overlay management, menus, actionzones, region tabs, etc */ static void wm_flush_draw_update(bContext *C) { + ScrArea *sa; ARegion *ar; bScreen *screen= CTX_wm_screen(C); - /* flush redraws of screen regions (menus) down */ - for(ar= screen->regionbase.last; ar; ar= ar->prev) { - if(ar->swinid && ar->do_draw) { - wm_flush_regions(screen, &ar->winrct); - } - } + if(screen->regionbase.first) { + /* flush redraws of area-regions up to menus */ + for(sa= screen->areabase.first; sa; sa= sa->next) + for(ar= sa->regionbase.first; ar; ar= ar->next) + if(ar->swinid && ar->do_draw) + wm_flush_regions_up(screen, &ar->winrct); + + /* flush overlapping menus */ + for(ar= screen->regionbase.last; ar; ar= ar->prev) + if(ar->swinid && ar->do_draw) + wm_flush_regions_up(screen, &ar->winrct); + + + /* flush redraws of menus down to areas */ + for(ar= screen->regionbase.last; ar; ar= ar->prev) + if(ar->swinid && ar->do_draw) + wm_flush_regions_down(screen, &ar->winrct); + } /* sets redraws for Azones, future region tabs, etc */ ED_area_overdraw_flush(C); |