Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2016-05-05 23:10:37 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-05-05 23:14:36 +0300
commit55c4889864dace4e00d1266637f3450dbcbf951d (patch)
treedd19b904549802cb83d2d8d0fa99aacba333d475 /source/blender/blenkernel/intern/bvhutils.c
parentc5a26bef5dee3b300dc8909b442bf2828cc3a8b1 (diff)
bvhutils: remove bitmap counting
All callers pass in valid number
Diffstat (limited to 'source/blender/blenkernel/intern/bvhutils.c')
-rw-r--r--source/blender/blenkernel/intern/bvhutils.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index a2998e869af..660412dc96f 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -396,15 +396,10 @@ static BVHTree *bvhtree_from_editmesh_verts_create_tree(
BVHTree *tree = NULL;
int i;
BM_mesh_elem_table_ensure(em->bm, BM_VERT);
- if (verts_mask && verts_num_active == -1) {
- verts_num_active = 0;
- for (i = 0; i < verts_num; i++) {
- if (BLI_BITMAP_TEST_BOOL(verts_mask, i)) {
- verts_num_active++;
- }
- }
+ if (verts_mask) {
+ BLI_assert(IN_RANGE(verts_num_active, 0, verts_num));
}
- else if (!verts_mask) {
+ else {
verts_num_active = verts_num;
}
@@ -434,13 +429,8 @@ static BVHTree *bvhtree_from_mesh_verts_create_tree(
BVHTree *tree = NULL;
int i;
if (vert) {
- if (verts_mask && verts_num_active == -1) {
- verts_num_active = 0;
- for (i = 0; i < verts_num; i++) {
- if (BLI_BITMAP_TEST_BOOL(verts_mask, i)) {
- verts_num_active++;
- }
- }
+ if (verts_mask) {
+ BLI_assert(IN_RANGE(verts_num_active, 0, verts_num));
}
else if (!verts_mask) {
verts_num_active = verts_num;
@@ -697,15 +687,10 @@ static BVHTree *bvhtree_from_mesh_faces_create_tree(
int i;
if (faces_num) {
- if (faces_mask && faces_num_active == -1) {
- faces_num_active = 0;
- for (i = 0; i < faces_num; i++) {
- if (BLI_BITMAP_TEST_BOOL(faces_mask, i)) {
- faces_num_active++;
- }
- }
+ if (faces_mask) {
+ BLI_assert(IN_RANGE(faces_num_active, 0, faces_num));
}
- else if (!faces_mask) {
+ else {
faces_num_active = faces_num;
}