diff options
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index d3a8ec82e4c..d85be9406d7 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1128,7 +1128,7 @@ void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d) } -void check_backbuf(ViewContext *vc) +void view3d_validate_backbuf(ViewContext *vc) { if(vc->v3d->flag & V3D_NEEDBACKBUFDRAW) backdrawview3d(vc->scene, vc->ar, vc->v3d); @@ -1143,7 +1143,7 @@ unsigned int view3d_sample_backbuf(ViewContext *vc, int x, int y) x+= vc->ar->winrct.xmin; y+= vc->ar->winrct.ymin; - check_backbuf(vc); + view3d_validate_backbuf(vc); glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &col); glReadBuffer(GL_BACK); @@ -1172,7 +1172,7 @@ ImBuf *view3d_read_backbuf(ViewContext *vc, short xmin, short ymin, short xmax, ibuf= IMB_allocImBuf((xmaxc-xminc+1), (ymaxc-yminc+1), 32, IB_rect,0); - check_backbuf(vc); + view3d_validate_backbuf(vc); glReadPixels(vc->ar->winrct.xmin+xminc, vc->ar->winrct.ymin+yminc, (xmaxc-xminc+1), (ymaxc-yminc+1), GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); glReadBuffer(GL_BACK); @@ -1207,7 +1207,9 @@ ImBuf *view3d_read_backbuf(ViewContext *vc, short xmin, short ymin, short xmax, } /* smart function to sample a rect spiralling outside, nice for backbuf selection */ -unsigned int view3d_sample_backbuf_rect(ViewContext *vc, short mval[2], int size, unsigned int min, unsigned int max, int *dist, short strict, unsigned int (*indextest)(unsigned int index)) +unsigned int view3d_sample_backbuf_rect(ViewContext *vc, short mval[2], int size, + unsigned int min, unsigned int max, int *dist, short strict, + void *handle, unsigned int (*indextest)(void *handle, unsigned int index)) { struct ImBuf *buf; unsigned int *bufmin, *bufmax, *tbuf; @@ -1242,7 +1244,7 @@ unsigned int view3d_sample_backbuf_rect(ViewContext *vc, short mval[2], int size for(b=0; b<nr; b++, distance++) { if (*tbuf && *tbuf>=min && *tbuf<max) { //we got a hit if(strict){ - indexok = indextest(*tbuf - min+1); + indexok = indextest(handle, *tbuf - min+1); if(indexok){ *dist= (short) sqrt( (float)distance ); index = *tbuf - min+1; |