diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-03-09 19:10:06 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-03-09 19:10:06 +0300 |
commit | 8a6d055f3734c8a0bfeb9b6256d25bfb414634e6 (patch) | |
tree | 17ec0b453d351f56d3a3511b9d50773f1fc8271f /source/blender | |
parent | 528cb8877f3c8923752a016854682722708c47a0 (diff) | |
parent | 6c942db30dee14eb37229879656fa049a9ac6df6 (diff) |
Merge remote-tracking branch 'origin/master' into blender2.8
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/armature/armature_select.c | 6 | ||||
-rw-r--r-- | source/blender/editors/include/ED_view3d.h | 9 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_draw.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_select.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 17 |
5 files changed, 29 insertions, 13 deletions
diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c index 1b2b70cd60d..b78adba408c 100644 --- a/source/blender/editors/armature/armature_select.c +++ b/source/blender/editors/armature/armature_select.c @@ -53,8 +53,6 @@ #include "ED_screen.h" #include "ED_view3d.h" -#include "GPU_select.h" - #include "armature_intern.h" /* utility macros for storing a temp int in the bone (selection flag) */ @@ -343,7 +341,7 @@ static EditBone *get_nearest_editbonepoint( int hits = 0; /* we _must_ end cache before return, use 'goto cache_end' */ - GPU_select_cache_begin(); + view3d_opengl_select_cache_begin(); BLI_rcti_init_pt_radius(&rect, mval, 12); hits12 = view3d_opengl_select(vc, buffer, MAXPICKBUF, &rect, select_mode); @@ -368,7 +366,7 @@ static EditBone *get_nearest_editbonepoint( } cache_end: - GPU_select_cache_end(); + view3d_opengl_select_cache_end(); /* See if there are any selected bones in this group */ if (hits > 0) { diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index c1f323b17a2..b1b78a9876f 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -308,18 +308,21 @@ bool ED_view3d_autodist_depth_seg(struct ARegion *ar, const int mval_sta[2], con #define MAXPICKELEMS 2500 #define MAXPICKBUF (4 * MAXPICKELEMS) -enum { +typedef enum { /* all elements in the region, ignore depth */ VIEW3D_SELECT_ALL = 0, /* pick also depth sorts (only for small regions!) */ VIEW3D_SELECT_PICK_ALL = 1, /* sorts and only returns visible objects (only for small regions!) */ VIEW3D_SELECT_PICK_NEAREST = 2, -}; +} eV3DSelectMode; + +void view3d_opengl_select_cache_begin(void); +void view3d_opengl_select_cache_end(void); int view3d_opengl_select( struct ViewContext *vc, unsigned int *buffer, unsigned int bufsize, const struct rcti *input, - int select_mode); + eV3DSelectMode select_mode); /* view3d_select.c */ float ED_view3d_select_dist_px(void); diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 30b607e063d..1ae72f2e3e7 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -925,6 +925,7 @@ static void draw_textscroll(const SpaceText *st, rcti *scroll, rcti *back) /*********************** draw documentation *******************************/ +#if 0 static void draw_documentation(const SpaceText *st, ARegion *ar) { TextDrawContext tdc = {0}; @@ -1013,6 +1014,7 @@ static void draw_documentation(const SpaceText *st, ARegion *ar) draw_documentation(st, ar); } } +#endif /*********************** draw suggestion list *******************************/ @@ -1486,7 +1488,7 @@ void draw_text_main(SpaceText *st, ARegion *ar) /* draw other stuff */ draw_brackets(st, &tdc, ar); draw_textscroll(st, &scroll, &back); - draw_documentation(st, ar); + /* draw_documentation(st, ar); - No longer supported */ draw_suggestion_list(st, &tdc, ar); text_font_end(&tdc); diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 6d2208bee53..8eee7f6a632 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -98,8 +98,6 @@ #include "GPU_draw.h" -#include "GPU_select.h" - #include "view3d_intern.h" /* own include */ // #include "PIL_time_utildefines.h" @@ -1216,7 +1214,7 @@ static int mixed_bones_object_selectbuffer( int hits = 0; /* we _must_ end cache before return, use 'goto finally' */ - GPU_select_cache_begin(); + view3d_opengl_select_cache_begin(); BLI_rcti_init_pt_radius(&rect, mval, 14); hits15 = view3d_opengl_select(vc, buffer, MAXPICKBUF, &rect, select_mode); @@ -1260,7 +1258,7 @@ static int mixed_bones_object_selectbuffer( } finally: - GPU_select_cache_end(); + view3d_opengl_select_cache_end(); return hits; } diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 3a28b875f00..bd2071165db 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1158,6 +1158,21 @@ static void view3d_select_loop(ViewContext *vc, Scene *scene, SceneLayer *sl, Vi } /** + * Optionally cache data for multiple calls to #view3d_opengl_select + * + * just avoid GPU_select headers outside this file + */ +void view3d_opengl_select_cache_begin(void) +{ + GPU_select_cache_begin(); +} + +void view3d_opengl_select_cache_end(void) +{ + GPU_select_cache_end(); +} + +/** * \warning be sure to account for a negative return value * This is an error, "Too many objects in select buffer" * and no action should be taken (can crash blender) if this happens @@ -1166,7 +1181,7 @@ static void view3d_select_loop(ViewContext *vc, Scene *scene, SceneLayer *sl, Vi */ int view3d_opengl_select( ViewContext *vc, unsigned int *buffer, unsigned int bufsize, const rcti *input, - int select_mode) + eV3DSelectMode select_mode) { Scene *scene = vc->scene; SceneLayer *sl = vc->sl; |