From 114e7eaa0994b07d44b5a9ed5a4b8b14ef9b0791 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 11 Jul 2015 21:09:22 +1000 Subject: Add WM_framebuffer_to_index_array Convert buffer to index in one loop, also minor cleanup to backbuf/selection functions. - Use IMB_rectcpy instead of inline pixel copy. - Redundant WM_framebuffer_to_index call. --- source/blender/editors/mesh/editmesh_select.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/mesh/editmesh_select.c') diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index 8c2bc154e30..0e4630f7029 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -203,8 +203,9 @@ bool EDBM_backbuf_border_init(ViewContext *vc, short xmin, short ymin, short xma } buf = ED_view3d_backbuf_read(vc, xmin, ymin, xmax, ymax); - if (buf == NULL) return false; - if (bm_vertoffs == 0) return false; + if ((buf == NULL) || (bm_vertoffs == 0)) { + return false; + } dr = buf->rect; @@ -278,8 +279,9 @@ bool EDBM_backbuf_border_mask_init(ViewContext *vc, const int mcords[][2], short } buf = ED_view3d_backbuf_read(vc, xmin, ymin, xmax, ymax); - if (buf == NULL) return false; - if (bm_vertoffs == 0) return false; + if ((buf == NULL) || (bm_vertoffs == 0)) { + return false; + } dr = buf->rect; @@ -329,8 +331,9 @@ bool EDBM_backbuf_circle_init(ViewContext *vc, short xs, short ys, short rads) xmin = xs - rads; xmax = xs + rads; ymin = ys - rads; ymax = ys + rads; buf = ED_view3d_backbuf_read(vc, xmin, ymin, xmax, ymax); - if (bm_vertoffs == 0) return false; - if (buf == NULL) return false; + if ((buf == NULL) || (bm_vertoffs == 0)) { + return false; + } dr = buf->rect; -- cgit v1.2.3