OpenGL: pull glBegin/End out of loop

so that all points here are drawn between one Begin/End pair.
This commit is contained in:
Mike Erwin 2016-01-16 00:11:49 -05:00
parent 2d71d13ea2
commit f4cd7ca9c6
1 changed files with 3 additions and 6 deletions

View File

@ -5807,19 +5807,16 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit)
if (cdata) { MEM_freeN(cdata); cd = cdata = NULL; }
}
else if (pset->selectmode == SCE_SELECT_END) {
glBegin(GL_POINTS);
for (i = 0, point = edit->points; i < totpoint; i++, point++) {
if ((point->flag & PEP_HIDE) == 0 && point->totkey) {
key = point->keys + point->totkey - 1;
if (key->flag & PEK_SELECT)
glColor3fv(sel_col);
else
glColor3fv(nosel_col);
glColor3fv((key->flag & PEK_SELECT) ? sel_col : nosel_col);
/* has to be like this.. otherwise selection won't work, have try glArrayElement later..*/
glBegin(GL_POINTS);
glVertex3fv((key->flag & PEK_USE_WCO) ? key->world_co : key->co);
glEnd();
}
}
glEnd();
}
}