diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-13 17:18:18 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-13 17:51:51 +0300 |
commit | 6b0d1ef7e118f679fb5dacac184a7e72fef6142e (patch) | |
tree | c514f73902d4b533104ff182047ffe2373691c4c /source/blender/gpu/intern/gpu_buffers.c | |
parent | 27b82bbb75c5fd527b6b22682f8d173f6040644a (diff) |
Cleanup: compiler warnings
Diffstat (limited to 'source/blender/gpu/intern/gpu_buffers.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_buffers.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index add3a154c93..12ed8d4de70 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -452,7 +452,10 @@ static void gpu_pbvh_grid_fill_index_buffers( } grid_visible = true; } - GPU_indexbuf_add_line_verts(&elb_lines, v1, v2); + + if (grid_visible) { + GPU_indexbuf_add_line_verts(&elb_lines, v1, v2); + } } if (grid_visible) { @@ -504,7 +507,10 @@ static void gpu_pbvh_grid_fill_index_buffers( } grid_visible = true; } - GPU_indexbuf_add_line_verts(&elb_lines, v1, v2); + + if (grid_visible) { + GPU_indexbuf_add_line_verts(&elb_lines, v1, v2); + } } if (grid_visible) { @@ -803,7 +809,7 @@ void GPU_pbvh_bmesh_buffers_update(GPU_PBVH_Buffers *buffers, const bool show_vcol = (update_flags & GPU_PBVH_BUFFERS_SHOW_VCOL) != 0; int tottri, totvert, maxvert = 0; bool empty_mask = true; - BMFace *f; + BMFace *f = NULL; /* Count visible triangles */ tottri = gpu_bmesh_face_visible_count(bm_faces); @@ -972,7 +978,7 @@ void GPU_pbvh_bmesh_buffers_update(GPU_PBVH_Buffers *buffers, } /* Get material index from the last face we iterated on. */ - buffers->material_index = f->mat_nr; + buffers->material_index = (f) ? f->mat_nr : 0; buffers->show_mask = !empty_mask; |