Commit: 3520c134f945aca1724912f595476fbf6eac3361
Author: Campbell Barton
Date:   Wed Mar 8 06:03:58 2017 +1100
Branches: temp-select-pick
https://developer.blender.org/rB3520c134f945aca1724912f595476fbf6eac3361

Fix mistake in glReadPixels

===================================================================

M       source/blender/editors/armature/armature_select.c
M       source/blender/editors/space_view3d/view3d_select.c
M       source/blender/editors/space_view3d/view3d_view.c
M       source/blender/gpu/intern/gpu_select.c
M       source/blender/gpu/intern/gpu_select_pick.c

===================================================================

diff --git a/source/blender/editors/armature/armature_select.c 
b/source/blender/editors/armature/armature_select.c
index 29883cf709..13103730e5 100644
--- a/source/blender/editors/armature/armature_select.c
+++ b/source/blender/editors/armature/armature_select.c
@@ -332,9 +332,9 @@ static EditBone *get_nearest_editbonepoint(
                BLI_rcti_init_pt_size(&rect, mval, 12);
                hits = view3d_opengl_select(vc, buffer, MAXPICKBUF, &rect, 
select_mode);
        }
-
        /* See if there are any selected bones in this group */
        if (hits > 0) {
+               
                if (hits == 1) {
                        if (!(buffer[3] & BONESEL_NOSEL))
                                besthitresult = buffer[3];
diff --git a/source/blender/editors/space_view3d/view3d_select.c 
b/source/blender/editors/space_view3d/view3d_select.c
index 6b2e057f59..73597ba0e6 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -97,7 +97,6 @@
 #include "GPU_draw.h"
 
 #include "GPU_select.h"
-#include "PIL_time_utildefines.h"
 
 #include "view3d_intern.h"  /* own include */
 
@@ -1480,9 +1479,8 @@ static bool ed_object_select_pick(
                bool do_nearest;
 
                /* if objects have posemode set, the bones are in the same 
selection buffer */
-               TIMEIT_START(select);
+               
                hits = mixed_bones_object_selectbuffer(&vc, buffer, mval, true, 
enumerate, &do_nearest);
-               TIMEIT_END(select);
                
                if (hits > 0) {
                        /* note: bundles are handling in the same way as bones 
*/
@@ -2671,7 +2669,7 @@ static void pose_circle_select(ViewContext *vc, const 
bool select, const int mva
        }
 }
 
-static short armature_circle_doSelectJoint(void *userData, EditBone *ebone, 
const float screen_co[2], bool head)
+static short armature_circle_doSelectJoint(void *userData, EditBone *ebone, 
const float screen_co[2], short head)
 {
        CircleSelectUserData *data = userData;
 
diff --git a/source/blender/editors/space_view3d/view3d_view.c 
b/source/blender/editors/space_view3d/view3d_view.c
index fa68055c3b..efdf5ce297 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -1214,7 +1214,6 @@ int view3d_opengl_select(
        G.f |= G_PICKSEL;
 
        view3d_winmatrix_set(ar, v3d, &rect);
-
        mul_m4_m4m4(vc->rv3d->persmat, vc->rv3d->winmat, vc->rv3d->viewmat);
        
        if (v3d->drawtype > OB_WIRE) {
diff --git a/source/blender/gpu/intern/gpu_select.c 
b/source/blender/gpu/intern/gpu_select.c
index b8d5fb55b7..79dd4fa06b 100644
--- a/source/blender/gpu/intern/gpu_select.c
+++ b/source/blender/gpu/intern/gpu_select.c
@@ -29,10 +29,7 @@
  * Interface for accessing gpu-related methods for selection. The semantics 
will be
  * similar to glRenderMode(GL_SELECT) since the goal is to maintain 
compatibility.
  */
-
-#include <string.h>
 #include <stdlib.h>
-#include <float.h>
 
 #include "GPU_select.h"
 #include "GPU_extensions.h"
@@ -174,7 +171,6 @@ unsigned int GPU_select_end(void)
        return hits;
 }
 
-
 /**
  * has user activated?
  */
diff --git a/source/blender/gpu/intern/gpu_select_pick.c 
b/source/blender/gpu/intern/gpu_select_pick.c
index c5da48dc0c..bdaa58985e 100644
--- a/source/blender/gpu/intern/gpu_select_pick.c
+++ b/source/blender/gpu/intern/gpu_select_pick.c
@@ -368,7 +368,7 @@ bool gpu_select_pick_load_id(unsigned int id)
        GPUPickState *ps = &g_pick_state;
        if (ps->gl.is_init) {
                const unsigned int rect_len = ps->src.rect_len;
-               glReadPixels(UNPACK4(ps->gl.clip_readpixels), 
GL_DEPTH_COMPONENT, GL_FLOAT, ps->gl.rect_depth_test);
+               glReadPixels(UNPACK4(ps->gl.clip_readpixels), 
GL_DEPTH_COMPONENT, GL_FLOAT, ps->gl.rect_depth_test->buf);
                /* perform initial memcmp since most cases the array remains 
unchanged  */
                if (memcmp(ps->gl.rect_depth->buf, ps->gl.rect_depth_test->buf, 
rect_len * sizeof(float)) != 0) {
                        ps->gl.rect_depth_test->id = ps->gl.prev_id;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to