Cleanup: comment for depth picking code, const args
authorCampbell Barton <ideasman42@gmail.com>
Wed, 28 Feb 2018 00:46:02 +0000 (11:46 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 28 Feb 2018 00:47:54 +0000 (11:47 +1100)
Note that setting `glDepthFunc` isn't important,
since 2.8 branch changes this value it might seem like an error
however it's harmless in this case - so better make note of this.

source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/gpu/intern/gpu_select_pick.c

index 94c7ff5a051a7aca948c09527f2257a57a029de4..7e613e36119a9dc73d8b1ccdb599daa4170e8077 100644 (file)
@@ -861,7 +861,7 @@ static void draw_viewport_name(ARegion *ar, View3D *v3d, rcti *rect)
  * framenum, object name, bone name (if available), marker name (if available)
  */
 
-static void draw_selected_name(Scene *scene, Object *ob, rcti *rect)
+static void draw_selected_name(Scene *scene, Object *ob, const rcti *rect)
 {
        const int cfra = CFRA;
        const char *msg_pin = " (Pinned)";
index 68c35115584ab7e0fe3544cae8374333e340e788..4e96ea63808274a828f650005099087da3078235 100644 (file)
@@ -1114,7 +1114,7 @@ static Base *object_mouse_select_menu(
        }
 }
 
-static bool selectbuffer_has_bones(const unsigned int *buffer, const unsigned int hits)
+static bool selectbuffer_has_bones(const uint *buffer, const uint hits)
 {
        unsigned int i;
        for (i = 0; i < hits; i++) {
@@ -1235,8 +1235,9 @@ finally:
 }
 
 /* returns basact */
-static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int hits,
-                                      Base *startbase, bool has_bones, bool do_nearest)
+static Base *mouse_select_eval_buffer(
+        ViewContext *vc, const uint *buffer, int hits,
+        Base *startbase, bool has_bones, bool do_nearest)
 {
        Scene *scene = vc->scene;
        View3D *v3d = vc->v3d;
index 7657d329b8ac154e02435cb40a0559ae97d6855a..703035483dd14325215fd0187da9a39290f02df7 100644 (file)
@@ -326,6 +326,9 @@ void gpu_select_pick_begin(
                glDepthMask(GL_TRUE);
 
                if (mode == GPU_SELECT_PICK_ALL) {
+                       /* Note that other depth settings (such as #GL_LEQUAL) work too,
+                        * since the depth is always cleared.
+                        * Noting this for cases when depth picking is used where drawing calls change depth settings. */
                        glDepthFunc(GL_ALWAYS);
                }
                else {