[Bf-blender-cvs] [91fde28] master: Fix edge drawing, total loose edges can only be determined -after- the edge buffer has been setup (this is where they are counted)

Antony Riakiotakis noreply at git.blender.org
Tue Jun 23 12:06:52 CEST 2015


Commit: 91fde2891c9142d6f3f5ff4d2f667714d22c3f3b
Author: Antony Riakiotakis
Date:   Tue Jun 23 12:06:36 2015 +0200
Branches: master
https://developer.blender.org/rB91fde2891c9142d6f3f5ff4d2f667714d22c3f3b

Fix edge drawing, total loose edges can only be determined -after- the
edge buffer has been setup (this is where they are counted)

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

M	source/blender/blenkernel/intern/cdderivedmesh.c

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

diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 30e0bc2..649778c7 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -420,14 +420,19 @@ static void cdDM_drawEdges(DerivedMesh *dm, bool drawLooseEdges, bool drawAllEdg
 
 static void cdDM_drawLooseEdges(DerivedMesh *dm)
 {
-	const int start = (dm->drawObject->loose_edge_offset * 2);
-	const int count = (dm->drawObject->totedge - dm->drawObject->loose_edge_offset) * 2;
+	int start;
+	int count;
+
+	GPU_edge_setup(dm);
+
+	start = (dm->drawObject->loose_edge_offset * 2);
+	count = (dm->drawObject->totedge - dm->drawObject->loose_edge_offset) * 2;
 
 	if (count) {
-		GPU_edge_setup(dm);
 		GPU_buffer_draw_elements(dm->drawObject->edges, GL_LINES, start, count);
-		GPU_buffer_unbind();
 	}
+
+	GPU_buffer_unbind();
 }
 
 static void cdDM_drawFacesSolid(DerivedMesh *dm,




More information about the Bf-blender-cvs mailing list