diff options
Diffstat (limited to 'source/blender/editors/mesh/editmesh_knife.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 347f6806d13..b02e48a652e 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -1147,16 +1147,13 @@ static void knifetool_draw(const bContext *UNUSED(C), ARegion *UNUSED(region), v GPUBatch *batch = GPU_batch_create_ex(GPU_PRIM_POINTS, vert, NULL, GPU_BATCH_OWNS_VBO); GPU_batch_program_set_builtin(batch, GPU_SHADER_3D_UNIFORM_COLOR); - GPU_batch_bind(batch); /* draw any snapped verts first */ rgba_uchar_to_float(fcol, kcd->colors.point_a); GPU_batch_uniform_4fv(batch, "color", fcol); - GPU_matrix_bind(batch->interface); - GPU_shader_set_srgb_uniform(batch->interface); GPU_point_size(11); if (snapped_verts_count > 0) { - GPU_batch_draw_advanced(batch, 0, snapped_verts_count, 0, 0); + GPU_batch_draw_range(batch, 0, snapped_verts_count); } /* now draw the rest */ @@ -1164,10 +1161,9 @@ static void knifetool_draw(const bContext *UNUSED(C), ARegion *UNUSED(region), v GPU_batch_uniform_4fv(batch, "color", fcol); GPU_point_size(7); if (other_verts_count > 0) { - GPU_batch_draw_advanced(batch, snapped_verts_count, other_verts_count, 0, 0); + GPU_batch_draw_range(batch, snapped_verts_count, other_verts_count); } - GPU_batch_program_use_end(batch); GPU_batch_discard(batch); GPU_blend(false); @@ -1628,9 +1624,9 @@ static void knife_find_line_hits(KnifeTool_OpData *kcd) plane_from_point_normal_v3(plane, v1, plane); } - /* First use bvh tree to find faces, knife edges, and knife verts that might + /* First use BVH tree to find faces, knife edges, and knife verts that might * intersect the cut plane with rays v1-v3 and v2-v4. - * This deduplicates the candidates before doing more expensive intersection tests. */ + * This de-duplicates the candidates before doing more expensive intersection tests. */ tree = BKE_bmbvh_tree_get(kcd->bmbvh); results = BLI_bvhtree_intersect_plane(tree, plane, &tot); @@ -2632,7 +2628,7 @@ static void knifetool_update_mval(KnifeTool_OpData *kcd, const float mval[2]) static void knifetool_update_mval_i(KnifeTool_OpData *kcd, const int mval_i[2]) { - float mval[2] = {UNPACK2(mval_i)}; + const float mval[2] = {UNPACK2(mval_i)}; knifetool_update_mval(kcd, mval); } |