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:
authorAntony Riakiotakis <kalast@gmail.com>2015-02-24 19:19:07 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-02-24 19:19:07 +0300
commit50e9868abe11bd2ed0173b7a51cf129d77e4389e (patch)
tree318fe9a4f753569cebee011a93575b6b6ac4ebd4 /source/blender/editors/include
parent340b76b42c53816ddac1b4cecdff3d8d2010a9cc (diff)
Fix T43785 crash with border select.
Naming here is slightly misleading. We have: * Number of elements (objects) that can be picked * Buffer size * Number of integers in buffer. Interestingly enough, bufsize in OpenGL (as far as I could find in examples on the web) and in most of the code refers to the latter and actual buffer size is only used whenever we do allocations on the heap. Added an extra defines here to make things a bit clearer: * MAXPICKELEMS refers to the number of objects that can be picked * MAXPICKBUF refers to the number of integers in the selection buffer Also made all buffers use MAXPICKBUF where some used MAXPICKBUF * 4. That means that some parts of blender will use less space for selection now. MAXPICKBUF is set to 10000 for 2500 object selection, which can be changed at any time, but I think 10000 integers on the stack touches the borders of uglyland anyway.
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r--source/blender/editors/include/ED_view3d.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index e6434a19952..5bf077b6293 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -275,7 +275,8 @@ bool ED_view3d_autodist_depth(struct ARegion *ar, const int mval[2], int margin,
bool ED_view3d_autodist_depth_seg(struct ARegion *ar, const int mval_sta[2], const int mval_end[2], int margin, float *depth);
/* select */
-#define MAXPICKBUF 10000
+#define MAXPICKELEMS 2500
+#define MAXPICKBUF (4 * MAXPICKELEMS)
short view3d_opengl_select(struct ViewContext *vc, unsigned int *buffer, unsigned int bufsize, const struct rcti *input, bool do_nearest);
/* view3d_select.c */