diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-06-23 13:06:36 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-06-23 13:06:36 +0300 |
commit | 91fde2891c9142d6f3f5ff4d2f667714d22c3f3b (patch) | |
tree | 8b475563626fd643d414bc0973515764d227cf34 /source/blender/blenkernel/intern/cdderivedmesh.c | |
parent | cd7853be2277320e9c1a7209d95c7778ae0408de (diff) |
Fix edge drawing, total loose edges can only be determined -after- the
edge buffer has been setup (this is where they are counted)
Diffstat (limited to 'source/blender/blenkernel/intern/cdderivedmesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/cdderivedmesh.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 30e0bc233e8..649778c71f5 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, |