diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-04-12 11:59:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-04-12 11:59:14 +0400 |
commit | a5990bca11f3ec6947631c681e2d0d727409c6a5 (patch) | |
tree | fc023c12df0d6d8d8e789e415414e1107cb952b2 /source | |
parent | 8435da4774c75ec9e546e81b0761cd86be86fad8 (diff) |
split draw_dupli_objects into 2 functions (draw_dupli_objects and draw_dupli_objects_color)
so when a dupli is drawn from a set, its selection state wont make it draw selected.
draw_dupli_objects works the same as before
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/src/drawview.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index e8989011595..daa60318686 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -2570,23 +2570,23 @@ static void view3d_draw_transp(View3D *v3d, int flag) /* *********************** */ -static void draw_dupli_objects(View3D *v3d, Base *base) -{ +/* + In most cases call draw_dupli_objects, + draw_dupli_objects_color was added because when drawing set dupli's + we need to force the color +*/ +static void draw_dupli_objects_color(View3D *v3d, Base *base, int color) +{ ListBase *lb; DupliObject *dob; Base tbase; BoundBox *bb= NULL; GLuint displist=0; - int color= (base->flag & SELECT)?TH_SELECT:TH_WIRE; short transflag, use_displist= -1; /* -1 is initialize */ char dt, dtx; if (base->object->restrictflag & OB_RESTRICT_VIEW) return; - /* debug */ - if(base->object->dup_group && base->object->dup_group->id.us<1) - color= TH_REDALERT; - /* test if we can do a displist */ if(base->object->transflag & OB_DUPLIGROUP) use_displist= 0; @@ -2663,6 +2663,19 @@ static void draw_dupli_objects(View3D *v3d, Base *base) glDeleteLists(displist, 1); } +static void draw_dupli_objects(View3D *v3d, Base *base) +{ + /* define the color here so draw_dupli_objects_color can be called + * from the set loop */ + + int color= (base->flag & SELECT)?TH_SELECT:TH_WIRE; + /* debug */ + if(base->object->dup_group && base->object->dup_group->id.us<1) + color= TH_REDALERT; + + draw_dupli_objects_color(v3d, base, color); +} + void view3d_update_depths(View3D *v3d) { /* Create storage for, and, if necessary, copy depth buffer */ @@ -2800,7 +2813,7 @@ void drawview3dspace(ScrArea *sa, void *spacedata) draw_object(base, DRAW_CONSTCOLOR); if(base->object->transflag & OB_DUPLI) { - draw_dupli_objects(v3d, base); + draw_dupli_objects_color(v3d, base, TH_WIRE); } } } |