diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-05-06 19:31:17 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-05-06 19:31:17 +0400 |
commit | 722f24d15357275ee3efed33fa03f9b27909a604 (patch) | |
tree | 79e946a10bcf03cf79957dd0fd8c26043792cdb3 /source/blender | |
parent | 3ba9069c040d6d3682d1421f89a061236ed8cd88 (diff) |
Fix for bug: drawing x-ray and transparency with sets didn't
work well, now it draws those type of objects from sets also
at the end.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/include/BSE_drawview.h | 2 | ||||
-rw-r--r-- | source/blender/src/drawobject.c | 4 | ||||
-rw-r--r-- | source/blender/src/drawview.c | 29 |
3 files changed, 16 insertions, 19 deletions
diff --git a/source/blender/include/BSE_drawview.h b/source/blender/include/BSE_drawview.h index 09ce87015d9..be1f5581be7 100644 --- a/source/blender/include/BSE_drawview.h +++ b/source/blender/include/BSE_drawview.h @@ -46,7 +46,7 @@ void do_viewbuts(unsigned short event); /* View3DAfter->type */ #define V3D_XRAY 1 #define V3D_TRANSP 2 -void add_view3d_after(struct View3D *v3d, struct Base *base, int type); +void add_view3d_after(struct View3D *v3d, struct Base *base, int type, int flag); void backdrawview3d(int test); void check_backbuf(void); diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index aec0e112b32..181f797dbc9 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -2485,7 +2485,7 @@ static int draw_mesh_object(Base *base, int dt, int flag) } /* init_gl_materials did the proper checking if this is needed */ - if(has_alpha) add_view3d_after(G.vd, base, V3D_TRANSP); + if(has_alpha) add_view3d_after(G.vd, base, V3D_TRANSP, flag); return retval; } @@ -4663,7 +4663,7 @@ void draw_object(Base *base, int flag) if(!(G.f & G_PARTICLEEDIT)) { /* xray and transp are set when it is drawing the 2nd/3rd pass */ if(!G.vd->xray && !G.vd->transp && (ob->dtx & OB_DRAWXRAY)) { - add_view3d_after(G.vd, base, V3D_XRAY); + add_view3d_after(G.vd, base, V3D_XRAY, flag); return; } } diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index b01b7bc151c..1acb7c4373f 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -2663,21 +2663,22 @@ static void view3d_blockhandlers(ScrArea *sa) typedef struct View3DAfter { struct View3DAfter *next, *prev; struct Base *base; - int type; + int type, flag; } View3DAfter; /* temp storage of Objects that need to be drawn as last */ -void add_view3d_after(View3D *v3d, Base *base, int type) +void add_view3d_after(View3D *v3d, Base *base, int type, int flag) { View3DAfter *v3da= MEM_callocN(sizeof(View3DAfter), "View 3d after"); BLI_addtail(&v3d->afterdraw, v3da); v3da->base= base; v3da->type= type; + v3da->flag= flag; } /* clears zbuffer and draws it over */ -static void view3d_draw_xray(View3D *v3d, int flag) +static void view3d_draw_xray(View3D *v3d) { View3DAfter *v3da, *next; int doit= 0; @@ -2692,7 +2693,7 @@ static void view3d_draw_xray(View3D *v3d, int flag) for(v3da= v3d->afterdraw.first; v3da; v3da= next) { next= v3da->next; if(v3da->type==V3D_XRAY) { - draw_object(v3da->base, flag); + draw_object(v3da->base, v3da->flag); BLI_remlink(&v3d->afterdraw, v3da); MEM_freeN(v3da); } @@ -2702,7 +2703,7 @@ static void view3d_draw_xray(View3D *v3d, int flag) } /* disables write in zbuffer and draws it over */ -static void view3d_draw_transp(View3D *v3d, int flag) +static void view3d_draw_transp(View3D *v3d) { View3DAfter *v3da, *next; @@ -2712,7 +2713,7 @@ static void view3d_draw_transp(View3D *v3d, int flag) for(v3da= v3d->afterdraw.first; v3da; v3da= next) { next= v3da->next; if(v3da->type==V3D_TRANSP) { - draw_object(v3da->base, flag); + draw_object(v3da->base, v3da->flag); BLI_remlink(&v3d->afterdraw, v3da); MEM_freeN(v3da); } @@ -3102,9 +3103,7 @@ void drawview3dspace(ScrArea *sa, void *spacedata) } } - /* Transp and X-ray afterdraw stuff */ - view3d_draw_xray(v3d, DRAW_CONSTCOLOR); // clears zbuffer if it is used! - view3d_draw_transp(v3d, DRAW_CONSTCOLOR); + /* Transp and X-ray afterdraw stuff for sets is done later */ } /* then draw not selected and the duplis, but skip editmode object */ @@ -3150,8 +3149,8 @@ void drawview3dspace(ScrArea *sa, void *spacedata) if(G.scene->radio) RAD_drawall(v3d->drawtype>=OB_SOLID); /* Transp and X-ray afterdraw stuff */ - view3d_draw_xray(v3d, 0); // clears zbuffer if it is used! - view3d_draw_transp(v3d, 0); + view3d_draw_xray(v3d); // clears zbuffer if it is used! + view3d_draw_transp(v3d); if(!retopo && sculptparticle && (obact && (OBACT->dtx & OB_DRAWXRAY))) { if(G.f & G_SCULPTMODE) @@ -3327,9 +3326,7 @@ void drawview3d_render(struct View3D *v3d, int winx, int winy, float winmat[][4] } } - /* Transp and X-ray afterdraw stuff */ - view3d_draw_xray(v3d, DRAW_CONSTCOLOR); // clears zbuffer if it is used! - view3d_draw_transp(v3d, DRAW_CONSTCOLOR); + /* Transp and X-ray afterdraw stuff for sets is done later */ } /* first not selected and duplis */ @@ -3367,8 +3364,8 @@ void drawview3d_render(struct View3D *v3d, int winx, int winy, float winmat[][4] if(G.scene->radio) RAD_drawall(v3d->drawtype>=OB_SOLID); /* Transp and X-ray afterdraw stuff */ - view3d_draw_xray(v3d, 0); // clears zbuffer if it is used! - view3d_draw_transp(v3d, 0); + view3d_draw_xray(v3d); // clears zbuffer if it is used! + view3d_draw_transp(v3d); if(v3d->flag & V3D_CLIPPING) view3d_clr_clipping(); |