Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-08-16 21:42:06 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-16 21:42:06 +0400
commit54196f0e943f0d2619fe5a9a7d96c5e49eb7618e (patch)
tree0649c18a7491684dd71732ae86b2d6134b8ff673 /source/blender/editors
parent009b212300ab8a5527c0abbcf456d71456467a06 (diff)
change to draw extra wire (draw_wire_extra)
- was changing color and changing glDepthMask even when the object type didnt support wire drawing and no wire would draw. - was setting the color when no wire would draw.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_view3d/drawobject.c75
1 files changed, 32 insertions, 43 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 09e7480c91b..85111345cff 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -6340,59 +6340,46 @@ static void drawObjectSelect(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
glDepthMask(1);
}
-static void drawWireExtra(Scene *scene, RegionView3D *rv3d, Object *ob)
+static void draw_wire_extra(Scene *scene, RegionView3D *rv3d, Object *ob, unsigned char ob_wire_col[4])
{
- if (ob != scene->obedit && (ob->flag & SELECT)) {
- if (ob == OBACT) {
- if (ob->flag & OB_FROMGROUP) UI_ThemeColor(TH_GROUP_ACTIVE);
- else UI_ThemeColor(TH_ACTIVE);
+ if (ELEM4(ob->type, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL)) {
+
+ if (scene->obedit == ob) {
+ UI_ThemeColor(TH_WIRE);
}
- else if (ob->flag & OB_FROMGROUP)
- UI_ThemeColorShade(TH_GROUP_ACTIVE, -16);
- else
- UI_ThemeColor(TH_SELECT);
- }
- else {
- if (ob->flag & OB_FROMGROUP)
- UI_ThemeColor(TH_GROUP);
else {
- if (ob->dtx & OB_DRAWWIRE) {
- glColor3ub(80, 80, 80);
- }
- else {
- UI_ThemeColor(TH_WIRE);
- }
+ glColor3ubv(ob_wire_col);
}
- }
-
- bglPolygonOffset(rv3d->dist, 1.0);
- glDepthMask(0); /* disable write in zbuffer, selected edge wires show better */
- if (ELEM3(ob->type, OB_FONT, OB_CURVE, OB_SURF)) {
- Curve *cu = ob->data;
- if (ED_view3d_boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
- if (ob->type == OB_CURVE)
- draw_index_wire = 0;
+ bglPolygonOffset(rv3d->dist, 1.0);
+ glDepthMask(0); /* disable write in zbuffer, selected edge wires show better */
+
+ if (ELEM3(ob->type, OB_FONT, OB_CURVE, OB_SURF)) {
+ Curve *cu = ob->data;
+ if (ED_view3d_boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
+ if (ob->type == OB_CURVE)
+ draw_index_wire = 0;
+
+ if (ob->derivedFinal) {
+ drawCurveDMWired(ob);
+ }
+ else {
+ drawDispListwire(&ob->disp);
+ }
- if (ob->derivedFinal) {
- drawCurveDMWired(ob);
+ if (ob->type == OB_CURVE)
+ draw_index_wire = 1;
}
- else {
+ }
+ else if (ob->type == OB_MBALL) {
+ if (BKE_mball_is_basis(ob)) {
drawDispListwire(&ob->disp);
}
-
- if (ob->type == OB_CURVE)
- draw_index_wire = 1;
- }
- }
- else if (ob->type == OB_MBALL) {
- if (BKE_mball_is_basis(ob)) {
- drawDispListwire(&ob->disp);
}
- }
- glDepthMask(1);
- bglPolygonOffset(rv3d->dist, 0.0);
+ glDepthMask(1);
+ bglPolygonOffset(rv3d->dist, 0.0);
+ }
}
/* should be called in view space */
@@ -7090,7 +7077,9 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
}
/*if (dtx & OB_DRAWIMAGE) drawDispListwire(&ob->disp);*/
if ((dtx & OB_DRAWWIRE) && dt >= OB_SOLID) {
- drawWireExtra(scene, rv3d, ob);
+ if ((dflag & DRAW_CONSTCOLOR) == 0) {
+ draw_wire_extra(scene, rv3d, ob, ob_wire_col);
+ }
}
}
}