*** empty log message ***

This commit is contained in:
Ton Roosendaal
2004-10-01 14:48:12 +00:00
parent f2b785296e
commit 5ef1c75dbe
2 changed files with 33 additions and 1 deletions

View File

@@ -322,6 +322,38 @@ int EM_mask_init_backbuf_border(short mcords[][2], short tot, short xmin, short
}
/* circle shaped sample area */
int EM_init_backbuf_circle(short xs, short ys, short rads)
{
unsigned int *buf, *dr;
short xmin, ymin, xmax, ymax, xc, yc;
int radsq;
if(G.obedit==NULL || G.vd->drawtype<OB_SOLID || (G.vd->flag & V3D_ZBUF_SELECT)==0) return 0;
if(em_vertoffs==0) return 0;
xmin= xs-rads; xmax= xs+rads;
ymin= ys-rads; ymax= ys+rads;
dr= buf= read_backbuf(xmin, ymin, xmax, ymax);
if(buf==NULL) return 0;
/* build selection lookup */
selbuf= MEM_callocN(em_vertoffs+1, "selbuf");
radsq= rads*rads;
for(yc= -rads; yc<=rads; yc++) {
for(xc= -rads; xc<=rads; xc++, dr++) {
if(xc*xc + yc*yc < radsq) {
if(*dr>0 && *dr<=em_vertoffs) selbuf[*dr]= 1;
}
}
}
MEM_freeN(buf);
return 1;
}
static EditVert *findnearestvert_f(short *dist, short sel)
{
static EditVert *acto= NULL;

View File

@@ -1341,7 +1341,7 @@ void mesh_selectionCB(int selecting, Object *editobj, short *mval, float rad)
int index, bbsel=0; // if bbsel we dont clip with screencoords
short rads= (short)(rad+1.0);
bbsel= EM_init_backbuf_border(mval[0]-rads, mval[1]-rads, mval[0]+rads, mval[1]+rads);
bbsel= EM_init_backbuf_circle(mval[0], mval[1], rads);
if(G.scene->selectmode & SCE_SELECT_VERTEX) {
if(bbsel==0) calc_meshverts_ext(); /* drawobject.c */