Cleanup: comment for depth picking code, const args

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.
This commit is contained in:
2018-02-28 11:46:02 +11:00
parent 6addaf7393
commit 6bd53cb541
3 changed files with 8 additions and 4 deletions

View 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)";

View 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;

View 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 {