[Bf-blender-cvs] [f4cd7ca] master: OpenGL: pull glBegin/End out of loop

Mike Erwin noreply at git.blender.org
Sat Jan 16 07:19:48 CET 2016


Commit: f4cd7ca9c63c76aa2fb2a16868af14af57fd9a36
Author: Mike Erwin
Date:   Sat Jan 16 00:11:49 2016 -0500
Branches: master
https://developer.blender.org/rBf4cd7ca9c63c76aa2fb2a16868af14af57fd9a36

OpenGL: pull glBegin/End out of loop

so that all points here are drawn between one Begin/End pair.

===================================================================

M	source/blender/editors/space_view3d/drawobject.c

===================================================================

diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 5b95c04..2a09b31 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -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();
 		}
 	}




More information about the Bf-blender-cvs mailing list