diff options
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/area.c | 68 | ||||
-rw-r--r-- | source/blender/editors/screen/glutil.c | 3 |
2 files changed, 52 insertions, 19 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 3e44566e593..5fe8d5e315c 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -104,7 +104,6 @@ void ED_region_pixelspace(const bContext *C, ARegion *ar) void ED_region_do_listen(ARegion *ar, wmNotifier *note) { - /* generic notes first */ switch(note->type) { case WM_NOTE_WINDOW_REDRAW: @@ -118,24 +117,54 @@ void ED_region_do_listen(ARegion *ar, wmNotifier *note) } } -/* only internal decoration, AZone for now */ -void ED_area_do_draw(bContext *C, ScrArea *sa) +/* based on screen region draw tags, set draw tags in azones, and future region tabs etc */ +void ED_area_overdraw_flush(bContext *C) { - AZone *az; + ScrArea *sa; + + for(sa= C->screen->areabase.first; sa; sa= sa->next) { + ARegion *ar; + + for(ar= sa->regionbase.first; ar; ar= ar->next) { + if(ar->do_draw) { + AZone *az; + + for(az= sa->actionzones.first; az; az= az->next) { + int xs= (az->x1+az->x2)/2, ys= (az->y1+az->y2)/2; + + /* test if inside */ + if(BLI_in_rcti(&ar->winrct, xs, ys)) { + az->do_draw= 1; + } + } + } + } + } +} + +void ED_area_overdraw(bContext *C) +{ + ScrArea *sa; - /* hrmf, screenspace for zones */ + /* Draw AZones, in screenspace */ wm_subwindow_set(C->window, C->window->screen->mainwin); + + glEnable( GL_BLEND ); + glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - /* temporary viz for 'action corner' */ - for(az= sa->actionzones.first; az; az= az->next) { - - glEnable( GL_BLEND ); - glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - glColor4ub(0, 0, 0, 80); - if(az->type==AZONE_TRI) sdrawtrifill(az->x1, az->y1, az->x2, az->y2); - //if(az->type==AZONE_TRI) sdrawtri(az->x1, az->y1, az->x2, az->y2); - glDisable( GL_BLEND ); - } + for(sa= C->screen->areabase.first; sa; sa= sa->next) { + AZone *az; + for(az= sa->actionzones.first; az; az= az->next) { + if(az->do_draw) { + if(az->type==AZONE_TRI) { + glColor4ub(0, 0, 0, 70); + sdrawtrifill(az->x1, az->y1, az->x2, az->y2); + } + az->do_draw= 0; + } + } + } + glDisable( GL_BLEND ); } @@ -180,15 +209,17 @@ void ED_region_do_draw(bContext *C, ARegion *ar) void ED_region_tag_redraw(ARegion *ar) { - ar->do_draw= 1; + if(ar) + ar->do_draw= 1; } void ED_area_tag_redraw(ScrArea *sa) { ARegion *ar; - for(ar= sa->regionbase.first; ar; ar= ar->next) - ar->do_draw= 1; + if(sa) + for(ar= sa->regionbase.first; ar; ar= ar->next) + ar->do_draw= 1; } @@ -328,6 +359,7 @@ static void area_calc_totrct(ScrArea *sa, int sizex, int sizey) sa->winy= sa->totrct.ymax-sa->totrct.ymin+1; } + #define AZONESPOT 12 void area_azone_initialize(ScrArea *sa) { diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 0be29fc53c0..f4739a218d6 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -103,7 +103,8 @@ void sdrawline(short x1, short y1, short x2, short y2) */ -static void sdrawtripoints(short x1, short y1, short x2, short y2){ +static void sdrawtripoints(short x1, short y1, short x2, short y2) +{ short v[2]; v[0]= x1; v[1]= y1; glVertex2sv(v); |