From 061442cbd1e69ad494eb22a69a2ae89e72e9d978 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 27 Sep 2004 10:12:45 +0000 Subject: - improvement for edge/face select - edges now sample on three locationsm gives more hits - own version of glPolygonOffset remains cumbersome... but for select now the selection routine gets more offset than draw. - first attempt to clean drawobject.c and displists - generic call for draw object in backbuf for select purposes, cleans up a lot in the other calls. - also to verify if we can (in future) use this for vertex/edge/face select, but the whole drawobject code works against me... this is for another refactory (incl. displist) and out of the focus for now - subsurf.c: now creates new faces in order of original. Not used yet, but is handy to recover the original order for selection/paint purposes. --- source/blender/blenkernel/intern/subsurf.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel/intern/subsurf.c') diff --git a/source/blender/blenkernel/intern/subsurf.c b/source/blender/blenkernel/intern/subsurf.c index 280af7c4a53..00070fef72c 100644 --- a/source/blender/blenkernel/intern/subsurf.c +++ b/source/blender/blenkernel/intern/subsurf.c @@ -215,6 +215,7 @@ struct _HyperMesh { HyperVert *verts; HyperEdge *edges; HyperFace *faces; + HyperFace *lastface; // we add faces in same order they get delivered now (ton) Mesh *orig_me; short hasuvco, hasvcol; @@ -322,9 +323,12 @@ static HyperFace *hypermesh_add_face(HyperMesh *hme, HyperVert **verts, int nver last= v; } - f->next= hme->faces; - hme->faces= f; - + // less elegant, but for many reasons i prefer the order of faces to remain same (vpaint etc) (ton) + f->next= NULL; + if(hme->lastface) hme->lastface->next= f; + else hme->faces= f; + hme->lastface= f; + return f; } @@ -333,7 +337,7 @@ static HyperMesh *hypermesh_new(void) { hme->verts= NULL; hme->edges= NULL; - hme->faces= NULL; + hme->faces= hme->lastface= NULL; hme->orig_me= NULL; hme->hasuvco= hme->hasvcol= 0; hme->arena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE); -- cgit v1.2.3