Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-07-11 14:09:22 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-07-11 16:21:41 +0300
commit114e7eaa0994b07d44b5a9ed5a4b8b14ef9b0791 (patch)
treecb5ddc3e98086fb47213ccdb90a2be45357974d9 /source/blender/editors/sculpt_paint
parent02b36188737b3e15fe8173dec7a57da7da610922 (diff)
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.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 5af327e7b49..6116903935b 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -869,7 +869,7 @@ static unsigned int vpaint_blend(VPaint *vp, unsigned int col, unsigned int colo
}
-static int sample_backbuf_area(ViewContext *vc, int *indexar, int totface, int x, int y, float size)
+static int sample_backbuf_area(ViewContext *vc, int *indexar, int totpoly, int x, int y, float size)
{
struct ImBuf *ibuf;
int a, tot = 0, index;
@@ -882,22 +882,25 @@ static int sample_backbuf_area(ViewContext *vc, int *indexar, int totface, int x
if (ibuf) {
unsigned int *rt = ibuf->rect;
- memset(indexar, 0, sizeof(int) * (totface + 1));
+ memset(indexar, 0, sizeof(int) * (totpoly + 1));
size = ibuf->x * ibuf->y;
while (size--) {
if (*rt) {
- index = WM_framebuffer_to_index(*rt);
- if (index > 0 && index <= totface)
+ index = *rt;
+ if (index > 0 && index <= totpoly) {
indexar[index] = 1;
+ }
}
rt++;
}
- for (a = 1; a <= totface; a++) {
- if (indexar[a]) indexar[tot++] = a;
+ for (a = 1; a <= totpoly; a++) {
+ if (indexar[a]) {
+ indexar[tot++] = a;
+ }
}
IMB_freeImBuf(ibuf);