diff options
author | Campbell Barton <campbell@blender.org> | 2022-01-31 05:01:29 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-01-31 06:10:08 +0300 |
commit | 8815f2f11632ea84d706bacd18e60639cb13d6eb (patch) | |
tree | a1f479191ee6388c023e99ad8780ada8d6d0562e /source/blender/editors/armature/armature_intern.h | |
parent | 9ccdad8a2173e14848fbfa5401210d8ffb074352 (diff) |
Cleanup: use struct for GPU the select buffer
GPU_select originally used GL_SELECT which defined the format for
storing the selection result.
Now this is no longer the case, define our own struct - making the code
easier to follow:
- Avoid having to deal with arrays in both `uint*` and `uint(*)[4]`
multiplying offsets by 4 in some cases & not others.
- No magic numbers for the offsets of depth & selection-ID.
- No need to allocate unused members to match GL_SELECT
(halving the buffer size).
Diffstat (limited to 'source/blender/editors/armature/armature_intern.h')
-rw-r--r-- | source/blender/editors/armature/armature_intern.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/armature/armature_intern.h b/source/blender/editors/armature/armature_intern.h index 252cf806e34..aaeac29b7d0 100644 --- a/source/blender/editors/armature/armature_intern.h +++ b/source/blender/editors/armature/armature_intern.h @@ -27,6 +27,7 @@ struct wmOperatorType; struct Base; +struct GPUSelectResult; struct Object; struct Scene; struct bContext; @@ -323,21 +324,21 @@ struct Bone *ED_armature_pick_bone(struct bContext *C, struct EditBone *ED_armature_pick_ebone_from_selectbuffer(struct Base **bases, uint bases_len, - const uint *buffer, + const struct GPUSelectResult *buffer, short hits, bool findunsel, bool do_nearest, struct Base **r_base); struct bPoseChannel *ED_armature_pick_pchan_from_selectbuffer(struct Base **bases, uint bases_len, - const uint *buffer, + const struct GPUSelectResult *buffer, short hits, bool findunsel, bool do_nearest, struct Base **r_base); struct Bone *ED_armature_pick_bone_from_selectbuffer(struct Base **bases, uint bases_len, - const uint *buffer, + const struct GPUSelectResult *buffer, short hits, bool findunsel, bool do_nearest, |