Finally something new!

- in Solid draw mode, curves without faces draw as wireframe now
- in Solid draw mode, curves without faces don't get fat outline on select
- in Solid draw mode, editing curves shows filled now!
This commit is contained in:
Ton Roosendaal 2004-10-29 15:39:01 +00:00
parent 63d81be035
commit 408702009e
3 changed files with 23 additions and 3 deletions

@ -118,6 +118,7 @@ extern void addnormalsDispList(struct Object *ob, struct ListBase *lb);
extern void count_displist(struct ListBase *lb, int *totvert, int *totface);
extern void curve_to_filledpoly(struct Curve *cu, struct ListBase *dispbase);
extern void freedisplist(struct ListBase *lb);
extern int displist_has_faces(struct ListBase *lb);
extern float calc_taper(struct Object *taperobj, int cur, int tot);
extern void makeDispList(struct Object *ob);
extern void set_displist_onlyzero(int val);

@ -397,6 +397,19 @@ DispList *find_displist(ListBase *lb, int type)
return 0;
}
int displist_has_faces(ListBase *lb)
{
DispList *dl;
dl= lb->first;
while(dl) {
if ELEM5(dl->type, DL_INDEX3, DL_INDEX4, DL_SURF, DL_MESH, DL_TRIA)
return 1;
dl= dl->next;
}
return 0;
}
void copy_displist(ListBase *lbn, ListBase *lb)
{
DispList *dln, *dl;

@ -2273,7 +2273,7 @@ static void drawDispList(Object *ob, int dt)
lb= &((Curve *)ob->data)->disp;
if(lb->first==0) makeDispList(ob);
if(solid && ob!=G.obedit) {
if(solid) {
dl= lb->first;
if(dl==0) return;
@ -2286,7 +2286,12 @@ static void drawDispList(Object *ob, int dt)
index3_nors_incr= 0;
if(dt==OB_SHADED) {
if( displist_has_faces(lb)==0) {
draw_index_wire= 0;
drawDispListwire(lb);
draw_index_wire= 1;
}
else if(dt==OB_SHADED) {
if(ob->disp.first==0) shadeDispList(ob);
drawDispListshaded(lb, ob);
}
@ -3891,7 +3896,8 @@ static void draw_solid_select(Object *ob)
case OB_CURVE:
case OB_SURF:
cu= ob->data;
if(boundbox_clip(ob->obmat, cu->bb)) drawSolidSelect(ob, &cu->disp);
if(displist_has_faces(&cu->disp))
if(boundbox_clip(ob->obmat, cu->bb)) drawSolidSelect(ob, &cu->disp);
break;
case OB_MBALL:
drawSolidSelect(ob, &ob->disp);