BLI_bitmap: rename macros

- BLI_BITMAP_SET -> BLI_BITMAP_ENABLE
- BLI_BITMAP_CLEAR -> BLI_BITMAP_DISABLE
- BLI_BITMAP_GET -> BLI_BITMAP_TEST
- BLI_BITMAP_MODIFY -> BLI_BITMAP_SET
This commit is contained in:
Campbell Barton 2014-06-06 16:05:15 +10:00
parent a427fa5261
commit bf462149a6
22 changed files with 68 additions and 68 deletions

@ -294,7 +294,7 @@ void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node,
vi.mask = vi.key->has_mask ? CCG_elem_mask(vi.key, vi.grid) : NULL; \ vi.mask = vi.key->has_mask ? CCG_elem_mask(vi.key, vi.grid) : NULL; \
vi.grid = CCG_elem_next(vi.key, vi.grid); \ vi.grid = CCG_elem_next(vi.key, vi.grid); \
if (vi.gh) { \ if (vi.gh) { \
if (BLI_BITMAP_GET(vi.gh, vi.gy * vi.gridsize + vi.gx)) \ if (BLI_BITMAP_TEST(vi.gh, vi.gy * vi.gridsize + vi.gx)) \
continue; \ continue; \
} \ } \
} \ } \

@ -93,12 +93,12 @@ static void make_vertexcos__mapFunc(void *userData, int index, const float co[3]
{ {
MappedUserData *mappedData = (MappedUserData *)userData; MappedUserData *mappedData = (MappedUserData *)userData;
if (BLI_BITMAP_GET(mappedData->vertex_visit, index) == 0) { if (BLI_BITMAP_TEST(mappedData->vertex_visit, index) == 0) {
/* we need coord from prototype vertex, not from copies, /* we need coord from prototype vertex, not from copies,
* assume they stored in the beginning of vertex array stored in DM * assume they stored in the beginning of vertex array stored in DM
* (mirror modifier for eg does this) */ * (mirror modifier for eg does this) */
copy_v3_v3(mappedData->vertexcos[index], co); copy_v3_v3(mappedData->vertexcos[index], co);
BLI_BITMAP_SET(mappedData->vertex_visit, index); BLI_BITMAP_ENABLE(mappedData->vertex_visit, index);
} }
} }

@ -2283,8 +2283,8 @@ static void cage_mapped_verts_callback(void *userData, int index, const float co
{ {
struct CageUserData *data = userData; struct CageUserData *data = userData;
if ((index >= 0 && index < data->totvert) && (!BLI_BITMAP_GET(data->visit_bitmap, index))) { if ((index >= 0 && index < data->totvert) && (!BLI_BITMAP_TEST(data->visit_bitmap, index))) {
BLI_BITMAP_SET(data->visit_bitmap, index); BLI_BITMAP_ENABLE(data->visit_bitmap, index);
copy_v3_v3(data->cos_cage[index], co); copy_v3_v3(data->cos_cage[index], co);
} }
} }

@ -120,11 +120,11 @@ void BKE_lattice_bitmap_from_flag(Lattice *lt, BLI_bitmap *bitmap, const short f
bp = lt->def; bp = lt->def;
for (i = 0; i < tot; i++, bp++) { for (i = 0; i < tot; i++, bp++) {
if ((bp->f1 & flag) && (!respecthide || !bp->hide)) { if ((bp->f1 & flag) && (!respecthide || !bp->hide)) {
BLI_BITMAP_SET(bitmap, i); BLI_BITMAP_ENABLE(bitmap, i);
} }
else { else {
if (clear) { if (clear) {
BLI_BITMAP_CLEAR(bitmap, i); BLI_BITMAP_DISABLE(bitmap, i);
} }
} }
} }

@ -1021,7 +1021,7 @@ void BKE_mesh_poly_edgebitmap_insert(unsigned int *edge_bitmap, const MPoly *mp,
ml = mloop; ml = mloop;
while (i-- != 0) { while (i-- != 0) {
BLI_BITMAP_SET(edge_bitmap, ml->e); BLI_BITMAP_ENABLE(edge_bitmap, ml->e);
ml++; ml++;
} }
} }

@ -134,7 +134,7 @@ static BLI_bitmap *multires_mdisps_upsample_hidden(BLI_bitmap *lo_hidden,
/* low-res blocks */ /* low-res blocks */
for (yl = 0; yl < lo_gridsize; yl++) { for (yl = 0; yl < lo_gridsize; yl++) {
for (xl = 0; xl < lo_gridsize; xl++) { for (xl = 0; xl < lo_gridsize; xl++) {
int lo_val = BLI_BITMAP_GET(lo_hidden, yl * lo_gridsize + xl); int lo_val = BLI_BITMAP_TEST(lo_hidden, yl * lo_gridsize + xl);
/* high-res blocks */ /* high-res blocks */
for (yo = -offset; yo <= offset; yo++) { for (yo = -offset; yo <= offset; yo++) {
@ -154,14 +154,14 @@ static BLI_bitmap *multires_mdisps_upsample_hidden(BLI_bitmap *lo_hidden,
* subd, except when the equivalent element in * subd, except when the equivalent element in
* lo_hidden is different */ * lo_hidden is different */
if (lo_val != prev_hidden[hi_ndx]) { if (lo_val != prev_hidden[hi_ndx]) {
BLI_BITMAP_MODIFY(subd, hi_ndx, lo_val); BLI_BITMAP_SET(subd, hi_ndx, lo_val);
} }
else { else {
BLI_BITMAP_MODIFY(subd, hi_ndx, prev_hidden[hi_ndx]); BLI_BITMAP_SET(subd, hi_ndx, prev_hidden[hi_ndx]);
} }
} }
else { else {
BLI_BITMAP_MODIFY(subd, hi_ndx, lo_val); BLI_BITMAP_SET(subd, hi_ndx, lo_val);
} }
} }
} }
@ -189,10 +189,10 @@ static BLI_bitmap *multires_mdisps_downsample_hidden(BLI_bitmap *old_hidden,
for (y = 0; y < new_gridsize; y++) { for (y = 0; y < new_gridsize; y++) {
for (x = 0; x < new_gridsize; x++) { for (x = 0; x < new_gridsize; x++) {
old_value = BLI_BITMAP_GET(old_hidden, old_value = BLI_BITMAP_TEST(old_hidden,
factor * y * old_gridsize + x * factor); factor * y * old_gridsize + x * factor);
BLI_BITMAP_MODIFY(new_hidden, y * new_gridsize + x, old_value); BLI_BITMAP_SET(new_hidden, y * new_gridsize + x, old_value);
} }
} }
@ -274,7 +274,7 @@ static MDisps *multires_mdisps_initialize_hidden(Mesh *me, int level)
md->hidden = BLI_BITMAP_NEW(gridarea, "MDisps.hidden initialize"); md->hidden = BLI_BITMAP_NEW(gridarea, "MDisps.hidden initialize");
for (k = 0; k < gridarea; k++) for (k = 0; k < gridarea; k++)
BLI_BITMAP_SET(md->hidden, k); BLI_BITMAP_ENABLE(md->hidden, k);
} }
} }

@ -347,10 +347,10 @@ bool paint_is_grid_face_hidden(const unsigned int *grid_hidden,
int gridsize, int x, int y) int gridsize, int x, int y)
{ {
/* skip face if any of its corners are hidden */ /* skip face if any of its corners are hidden */
return (BLI_BITMAP_GET(grid_hidden, y * gridsize + x) || return (BLI_BITMAP_TEST(grid_hidden, y * gridsize + x) ||
BLI_BITMAP_GET(grid_hidden, y * gridsize + x + 1) || BLI_BITMAP_TEST(grid_hidden, y * gridsize + x + 1) ||
BLI_BITMAP_GET(grid_hidden, (y + 1) * gridsize + x + 1) || BLI_BITMAP_TEST(grid_hidden, (y + 1) * gridsize + x + 1) ||
BLI_BITMAP_GET(grid_hidden, (y + 1) * gridsize + x)); BLI_BITMAP_TEST(grid_hidden, (y + 1) * gridsize + x));
} }
/* Return true if all vertices in the face are visible, false otherwise */ /* Return true if all vertices in the face are visible, false otherwise */

@ -251,12 +251,12 @@ static int map_insert_vert(PBVH *bvh, GHash *map,
if (value_p == NULL) { if (value_p == NULL) {
void *value; void *value;
if (BLI_BITMAP_GET(bvh->vert_bitmap, vertex)) { if (BLI_BITMAP_TEST(bvh->vert_bitmap, vertex)) {
value = SET_INT_IN_POINTER(~(*face_verts)); value = SET_INT_IN_POINTER(~(*face_verts));
++(*face_verts); ++(*face_verts);
} }
else { else {
BLI_BITMAP_SET(bvh->vert_bitmap, vertex); BLI_BITMAP_ENABLE(bvh->vert_bitmap, vertex);
value = SET_INT_IN_POINTER(*uniq_verts); value = SET_INT_IN_POINTER(*uniq_verts);
++(*uniq_verts); ++(*uniq_verts);
} }

@ -1077,7 +1077,7 @@ void subsurf_copy_grid_hidden(DerivedMesh *dm, const MPoly *mpoly,
vndx = getFaceIndex(ss, f, j, x, y, edgeSize, gridSize); vndx = getFaceIndex(ss, f, j, x, y, edgeSize, gridSize);
offset = (y * factor) * hidden_gridsize + (x * factor); offset = (y * factor) * hidden_gridsize + (x * factor);
if (BLI_BITMAP_GET(md->hidden, offset)) if (BLI_BITMAP_TEST(md->hidden, offset))
mvert[vndx].flag |= ME_HIDE; mvert[vndx].flag |= ME_HIDE;
} }
} }

@ -47,7 +47,7 @@ typedef unsigned int BLI_bitmap;
/* size (in bytes) used to hold '_tot' bits */ /* size (in bytes) used to hold '_tot' bits */
#define BLI_BITMAP_SIZE(_tot) \ #define BLI_BITMAP_SIZE(_tot) \
(_BITMAP_NUM_BLOCKS(_tot) * sizeof(unsigned int)) (_BITMAP_NUM_BLOCKS(_tot) * sizeof(BLI_bitmap))
/* allocate memory for a bitmap with '_tot' bits; free /* allocate memory for a bitmap with '_tot' bits; free
* with MEM_freeN() */ * with MEM_freeN() */
@ -60,35 +60,35 @@ typedef unsigned int BLI_bitmap;
((BLI_bitmap *)memset(alloca(BLI_BITMAP_SIZE(_tot)), 0, BLI_BITMAP_SIZE(_tot))) ((BLI_bitmap *)memset(alloca(BLI_BITMAP_SIZE(_tot)), 0, BLI_BITMAP_SIZE(_tot)))
/* get the value of a single bit at '_index' */ /* get the value of a single bit at '_index' */
#define BLI_BITMAP_GET(_bitmap, _index) \ #define BLI_BITMAP_TEST(_bitmap, _index) \
(CHECK_TYPE_INLINE(_bitmap, BLI_bitmap *), \ (CHECK_TYPE_INLINE(_bitmap, BLI_bitmap *), \
((_bitmap)[(_index) >> _BITMAP_POWER] & \ ((_bitmap)[(_index) >> _BITMAP_POWER] & \
(1u << ((_index) & _BITMAP_MASK)))) (1u << ((_index) & _BITMAP_MASK))))
#define BLI_BITMAP_GET_BOOL(_bitmap, _index) \ #define BLI_BITMAP_TEST_BOOL(_bitmap, _index) \
(CHECK_TYPE_INLINE(_bitmap, BLI_bitmap *), \ (CHECK_TYPE_INLINE(_bitmap, BLI_bitmap *), \
(BLI_BITMAP_GET(_bitmap, _index) != 0)) (BLI_BITMAP_TEST(_bitmap, _index) != 0))
/* set the value of a single bit at '_index' */ /* set the value of a single bit at '_index' */
#define BLI_BITMAP_SET(_bitmap, _index) \ #define BLI_BITMAP_ENABLE(_bitmap, _index) \
(CHECK_TYPE_INLINE(_bitmap, BLI_bitmap *), \ (CHECK_TYPE_INLINE(_bitmap, BLI_bitmap *), \
((_bitmap)[(_index) >> _BITMAP_POWER] |= \ ((_bitmap)[(_index) >> _BITMAP_POWER] |= \
(1u << ((_index) & _BITMAP_MASK)))) (1u << ((_index) & _BITMAP_MASK))))
/* clear the value of a single bit at '_index' */ /* clear the value of a single bit at '_index' */
#define BLI_BITMAP_CLEAR(_bitmap, _index) \ #define BLI_BITMAP_DISABLE(_bitmap, _index) \
(CHECK_TYPE_INLINE(_bitmap, BLI_bitmap *), \ (CHECK_TYPE_INLINE(_bitmap, BLI_bitmap *), \
((_bitmap)[(_index) >> _BITMAP_POWER] &= \ ((_bitmap)[(_index) >> _BITMAP_POWER] &= \
~(1u << ((_index) & _BITMAP_MASK)))) ~(1u << ((_index) & _BITMAP_MASK))))
/* set or clear the value of a single bit at '_index' */ /* set or clear the value of a single bit at '_index' */
#define BLI_BITMAP_MODIFY(_bitmap, _index, _set) \ #define BLI_BITMAP_SET(_bitmap, _index, _set) \
{ \ { \
CHECK_TYPE(_bitmap, BLI_bitmap *); \ CHECK_TYPE(_bitmap, BLI_bitmap *); \
if (_set) \ if (_set) \
BLI_BITMAP_SET(_bitmap, _index); \ BLI_BITMAP_ENABLE(_bitmap, _index); \
else \ else \
BLI_BITMAP_CLEAR(_bitmap, _index); \ BLI_BITMAP_DISABLE(_bitmap, _index); \
} (void)0 } (void)0
/* resize bitmap to have space for '_tot' bits */ /* resize bitmap to have space for '_tot' bits */

@ -5717,7 +5717,7 @@ static int select_more_exec(bContext *C, wmOperator *UNUSED(op))
bp = nu->bp; bp = nu->bp;
selbpoints = BLI_BITMAP_NEW(a, "selectlist"); selbpoints = BLI_BITMAP_NEW(a, "selectlist");
while (a > 0) { while (a > 0) {
if ((!BLI_BITMAP_GET(selbpoints, a)) && (bp->hide == 0) && (bp->f1 & SELECT)) { if ((!BLI_BITMAP_TEST(selbpoints, a)) && (bp->hide == 0) && (bp->f1 & SELECT)) {
/* upper control point */ /* upper control point */
if (a % nu->pntsu != 0) { if (a % nu->pntsu != 0) {
tempbp = bp - 1; tempbp = bp - 1;
@ -5730,7 +5730,7 @@ static int select_more_exec(bContext *C, wmOperator *UNUSED(op))
tempbp = bp + nu->pntsu; tempbp = bp + nu->pntsu;
if (!(tempbp->f1 & SELECT)) sel = select_bpoint(tempbp, SELECT, SELECT, VISIBLE); if (!(tempbp->f1 & SELECT)) sel = select_bpoint(tempbp, SELECT, SELECT, VISIBLE);
/* make sure selected bpoint is discarded */ /* make sure selected bpoint is discarded */
if (sel == 1) BLI_BITMAP_SET(selbpoints, a - nu->pntsu); if (sel == 1) BLI_BITMAP_ENABLE(selbpoints, a - nu->pntsu);
} }
/* right control point */ /* right control point */
@ -5814,7 +5814,7 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
} }
else { else {
bp--; bp--;
if (BLI_BITMAP_GET(selbpoints, a + 1) || ((bp->hide == 0) && (bp->f1 & SELECT))) sel++; if (BLI_BITMAP_TEST(selbpoints, a + 1) || ((bp->hide == 0) && (bp->f1 & SELECT))) sel++;
bp++; bp++;
} }
@ -5832,7 +5832,7 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
} }
else { else {
bp -= nu->pntsu; bp -= nu->pntsu;
if (BLI_BITMAP_GET(selbpoints, a + nu->pntsu) || ((bp->hide == 0) && (bp->f1 & SELECT))) sel++; if (BLI_BITMAP_TEST(selbpoints, a + nu->pntsu) || ((bp->hide == 0) && (bp->f1 & SELECT))) sel++;
bp += nu->pntsu; bp += nu->pntsu;
} }
@ -5847,7 +5847,7 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
if (sel != 4) { if (sel != 4) {
select_bpoint(bp, DESELECT, SELECT, VISIBLE); select_bpoint(bp, DESELECT, SELECT, VISIBLE);
BLI_BITMAP_SET(selbpoints, a); BLI_BITMAP_ENABLE(selbpoints, a);
} }
} }
else { else {

@ -204,7 +204,7 @@ static void select_linked_tfaces_with_seams(Mesh *me, const unsigned int index,
/* only put face under cursor in array */ /* only put face under cursor in array */
mp = &me->mpoly[index]; mp = &me->mpoly[index];
BKE_mesh_poly_edgebitmap_insert(edge_tag, mp, me->mloop + mp->loopstart); BKE_mesh_poly_edgebitmap_insert(edge_tag, mp, me->mloop + mp->loopstart);
BLI_BITMAP_SET(poly_tag, index); BLI_BITMAP_ENABLE(poly_tag, index);
} }
else { else {
/* fill array by selection */ /* fill array by selection */
@ -215,7 +215,7 @@ static void select_linked_tfaces_with_seams(Mesh *me, const unsigned int index,
} }
else if (mp->flag & ME_FACE_SEL) { else if (mp->flag & ME_FACE_SEL) {
BKE_mesh_poly_edgebitmap_insert(edge_tag, mp, me->mloop + mp->loopstart); BKE_mesh_poly_edgebitmap_insert(edge_tag, mp, me->mloop + mp->loopstart);
BLI_BITMAP_SET(poly_tag, a); BLI_BITMAP_ENABLE(poly_tag, a);
} }
} }
} }
@ -229,13 +229,13 @@ static void select_linked_tfaces_with_seams(Mesh *me, const unsigned int index,
if (mp->flag & ME_HIDE) if (mp->flag & ME_HIDE)
continue; continue;
if (!BLI_BITMAP_GET(poly_tag, a)) { if (!BLI_BITMAP_TEST(poly_tag, a)) {
mark = false; mark = false;
ml = me->mloop + mp->loopstart; ml = me->mloop + mp->loopstart;
for (b = 0; b < mp->totloop; b++, ml++) { for (b = 0; b < mp->totloop; b++, ml++) {
if ((me->medge[ml->e].flag & ME_SEAM) == 0) { if ((me->medge[ml->e].flag & ME_SEAM) == 0) {
if (BLI_BITMAP_GET(edge_tag, ml->e)) { if (BLI_BITMAP_TEST(edge_tag, ml->e)) {
mark = true; mark = true;
break; break;
} }
@ -243,7 +243,7 @@ static void select_linked_tfaces_with_seams(Mesh *me, const unsigned int index,
} }
if (mark) { if (mark) {
BLI_BITMAP_SET(poly_tag, a); BLI_BITMAP_ENABLE(poly_tag, a);
BKE_mesh_poly_edgebitmap_insert(edge_tag, mp, me->mloop + mp->loopstart); BKE_mesh_poly_edgebitmap_insert(edge_tag, mp, me->mloop + mp->loopstart);
do_it = true; do_it = true;
} }
@ -254,7 +254,7 @@ static void select_linked_tfaces_with_seams(Mesh *me, const unsigned int index,
MEM_freeN(edge_tag); MEM_freeN(edge_tag);
for (a = 0, mp = me->mpoly; a < me->totpoly; a++, mp++) { for (a = 0, mp = me->mpoly; a < me->totpoly; a++, mp++) {
if (BLI_BITMAP_GET(poly_tag, a)) { if (BLI_BITMAP_TEST(poly_tag, a)) {
BKE_BIT_TEST_SET(mp->flag, select, ME_FACE_SEL); BKE_BIT_TEST_SET(mp->flag, select, ME_FACE_SEL);
} }
} }

@ -213,7 +213,7 @@ bool EDBM_backbuf_border_init(ViewContext *vc, short xmin, short ymin, short xma
a = (xmax - xmin + 1) * (ymax - ymin + 1); a = (xmax - xmin + 1) * (ymax - ymin + 1);
while (a--) { while (a--) {
if (*dr > 0 && *dr <= bm_vertoffs) { if (*dr > 0 && *dr <= bm_vertoffs) {
BLI_BITMAP_SET(selbuf, *dr); BLI_BITMAP_ENABLE(selbuf, *dr);
} }
dr++; dr++;
} }
@ -230,7 +230,7 @@ bool EDBM_backbuf_check(unsigned int index)
return true; return true;
if (index > 0 && index <= bm_vertoffs) if (index > 0 && index <= bm_vertoffs)
return BLI_BITMAP_GET_BOOL(selbuf, index); return BLI_BITMAP_TEST_BOOL(selbuf, index);
return false; return false;
} }
@ -297,7 +297,7 @@ bool EDBM_backbuf_border_mask_init(ViewContext *vc, const int mcords[][2], short
a = (xmax - xmin + 1) * (ymax - ymin + 1); a = (xmax - xmin + 1) * (ymax - ymin + 1);
while (a--) { while (a--) {
if (*dr > 0 && *dr <= bm_vertoffs && *dr_mask == true) { if (*dr > 0 && *dr <= bm_vertoffs && *dr_mask == true) {
BLI_BITMAP_SET(selbuf, *dr); BLI_BITMAP_ENABLE(selbuf, *dr);
} }
dr++; dr_mask++; dr++; dr_mask++;
} }
@ -340,7 +340,7 @@ bool EDBM_backbuf_circle_init(ViewContext *vc, short xs, short ys, short rads)
for (xc = -rads; xc <= rads; xc++, dr++) { for (xc = -rads; xc <= rads; xc++, dr++) {
if (xc * xc + yc * yc < radsq) { if (xc * xc + yc * yc < radsq) {
if (*dr > 0 && *dr <= bm_vertoffs) { if (*dr > 0 && *dr <= bm_vertoffs) {
BLI_BITMAP_SET(selbuf, *dr); BLI_BITMAP_ENABLE(selbuf, *dr);
} }
} }
} }

@ -285,7 +285,7 @@ static int lattice_select_mirror_exec(bContext *C, wmOperator *op)
const int i_flip = BKE_lattice_index_flip(lt, i, flip_uvw[0], flip_uvw[1], flip_uvw[2]); const int i_flip = BKE_lattice_index_flip(lt, i, flip_uvw[0], flip_uvw[1], flip_uvw[2]);
bp = &lt->def[i]; bp = &lt->def[i];
if (!bp->hide) { if (!bp->hide) {
if (BLI_BITMAP_GET(selpoints, i_flip)) { if (BLI_BITMAP_TEST(selpoints, i_flip)) {
bp->f1 |= SELECT; bp->f1 |= SELECT;
} }
else { else {
@ -338,7 +338,7 @@ static bool lattice_test_bitmap_uvw(Lattice *lt, BLI_bitmap *selpoints, int u, i
else { else {
int i = BKE_lattice_index_from_uvw(lt, u, v, w); int i = BKE_lattice_index_from_uvw(lt, u, v, w);
if (lt->def[i].hide == 0) { if (lt->def[i].hide == 0) {
return (BLI_BITMAP_GET(selpoints, i) != 0) == selected; return (BLI_BITMAP_TEST(selpoints, i) != 0) == selected;
} }
return false; return false;
} }

@ -1650,9 +1650,9 @@ static void skin_armature_bone_create(Object *skin_ob,
int v; int v;
/* ignore edge if already visited */ /* ignore edge if already visited */
if (BLI_BITMAP_GET(edges_visited, endx)) if (BLI_BITMAP_TEST(edges_visited, endx))
continue; continue;
BLI_BITMAP_SET(edges_visited, endx); BLI_BITMAP_ENABLE(edges_visited, endx);
v = (e->v1 == parent_v ? e->v2 : e->v1); v = (e->v1 == parent_v ? e->v2 : e->v1);

@ -192,14 +192,14 @@ static void partialvis_update_grids(Object *ob,
/* skip grid element if not in the effected area */ /* skip grid element if not in the effected area */
if (is_effected(area, planes, co, mask)) { if (is_effected(area, planes, co, mask)) {
/* set or clear the hide flag */ /* set or clear the hide flag */
BLI_BITMAP_MODIFY(gh, y * key.grid_size + x, BLI_BITMAP_SET(gh, y * key.grid_size + x,
action == PARTIALVIS_HIDE); action == PARTIALVIS_HIDE);
any_changed = true; any_changed = true;
} }
/* keep track of whether any elements are still hidden */ /* keep track of whether any elements are still hidden */
if (BLI_BITMAP_GET(gh, y * key.grid_size + x)) if (BLI_BITMAP_TEST(gh, y * key.grid_size + x))
any_hidden = true; any_hidden = true;
else else
any_visible = true; any_visible = true;

@ -1566,7 +1566,7 @@ static void do_multires_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *no
int index; int index;
if (gh) { if (gh) {
if (BLI_BITMAP_GET(gh, y * gridsize + x)) if (BLI_BITMAP_TEST(gh, y * gridsize + x))
continue; continue;
} }

@ -195,9 +195,9 @@ static int sculpt_undo_restore_hidden(bContext *C, DerivedMesh *dm,
for (i = 0; i < unode->totvert; i++) { for (i = 0; i < unode->totvert; i++) {
MVert *v = &mvert[unode->index[i]]; MVert *v = &mvert[unode->index[i]];
int uval = BLI_BITMAP_GET(unode->vert_hidden, i); int uval = BLI_BITMAP_TEST(unode->vert_hidden, i);
BLI_BITMAP_MODIFY(unode->vert_hidden, i, BLI_BITMAP_SET(unode->vert_hidden, i,
v->flag & ME_HIDE); v->flag & ME_HIDE);
if (uval) if (uval)
v->flag |= ME_HIDE; v->flag |= ME_HIDE;
@ -702,7 +702,7 @@ static void sculpt_undo_store_hidden(Object *ob, SculptUndoNode *unode)
BKE_pbvh_node_num_verts(pbvh, node, NULL, &allvert); BKE_pbvh_node_num_verts(pbvh, node, NULL, &allvert);
BKE_pbvh_node_get_verts(pbvh, node, &vert_indices, &mvert); BKE_pbvh_node_get_verts(pbvh, node, &vert_indices, &mvert);
for (i = 0; i < allvert; i++) { for (i = 0; i < allvert; i++) {
BLI_BITMAP_MODIFY(unode->vert_hidden, i, BLI_BITMAP_SET(unode->vert_hidden, i,
mvert[vert_indices[i]].flag & ME_HIDE); mvert[vert_indices[i]].flag & ME_HIDE);
} }
} }

@ -113,8 +113,8 @@ static BLI_bitmap *get_tface_mesh_marked_edge_info(Mesh *me)
ml = me->mloop + mp->loopstart; ml = me->mloop + mp->loopstart;
for (j = 0; j < mp->totloop; j++, ml++) { for (j = 0; j < mp->totloop; j++, ml++) {
BLI_BITMAP_SET(bitmap_edge_flags, edge_vis_index(ml->e)); BLI_BITMAP_ENABLE(bitmap_edge_flags, edge_vis_index(ml->e));
if (select_set) BLI_BITMAP_SET(bitmap_edge_flags, edge_sel_index(ml->e)); if (select_set) BLI_BITMAP_ENABLE(bitmap_edge_flags, edge_sel_index(ml->e));
} }
} }
} }
@ -129,12 +129,12 @@ static DMDrawOption draw_mesh_face_select__setHiddenOpts(void *userData, int ind
Mesh *me = data->me; Mesh *me = data->me;
if (me->drawflag & ME_DRAWEDGES) { if (me->drawflag & ME_DRAWEDGES) {
if ((me->drawflag & ME_HIDDENEDGES) || (BLI_BITMAP_GET(data->edge_flags, edge_vis_index(index)))) if ((me->drawflag & ME_HIDDENEDGES) || (BLI_BITMAP_TEST(data->edge_flags, edge_vis_index(index))))
return DM_DRAW_OPTION_NORMAL; return DM_DRAW_OPTION_NORMAL;
else else
return DM_DRAW_OPTION_SKIP; return DM_DRAW_OPTION_SKIP;
} }
else if (BLI_BITMAP_GET(data->edge_flags, edge_sel_index(index))) else if (BLI_BITMAP_TEST(data->edge_flags, edge_sel_index(index)))
return DM_DRAW_OPTION_NORMAL; return DM_DRAW_OPTION_NORMAL;
else else
return DM_DRAW_OPTION_SKIP; return DM_DRAW_OPTION_SKIP;
@ -143,7 +143,7 @@ static DMDrawOption draw_mesh_face_select__setHiddenOpts(void *userData, int ind
static DMDrawOption draw_mesh_face_select__setSelectOpts(void *userData, int index) static DMDrawOption draw_mesh_face_select__setSelectOpts(void *userData, int index)
{ {
drawMeshFaceSelect_userData *data = userData; drawMeshFaceSelect_userData *data = userData;
return (BLI_BITMAP_GET(data->edge_flags, edge_sel_index(index))) ? DM_DRAW_OPTION_NORMAL : DM_DRAW_OPTION_SKIP; return (BLI_BITMAP_TEST(data->edge_flags, edge_sel_index(index))) ? DM_DRAW_OPTION_NORMAL : DM_DRAW_OPTION_SKIP;
} }
/* draws unselected */ /* draws unselected */

@ -2623,7 +2623,7 @@ static void createTransUVs(bContext *C, TransInfo *t)
if (propconnected) { if (propconnected) {
UvElement *element = BM_uv_element_get(elementmap, efa, l); UvElement *element = BM_uv_element_get(elementmap, efa, l);
BLI_BITMAP_SET(island_enabled, element->island); BLI_BITMAP_ENABLE(island_enabled, element->island);
} }
} }
@ -2664,7 +2664,7 @@ static void createTransUVs(bContext *C, TransInfo *t)
if (propconnected) { if (propconnected) {
UvElement *element = BM_uv_element_get(elementmap, efa, l); UvElement *element = BM_uv_element_get(elementmap, efa, l);
if (!BLI_BITMAP_GET(island_enabled, element->island)) { if (!BLI_BITMAP_TEST(island_enabled, element->island)) {
count_rejected++; count_rejected++;
continue; continue;
} }

@ -418,7 +418,7 @@ static void draw_uvs_other_mesh_new_shading(Object *ob, const Image *curimage)
Image *image; Image *image;
ED_object_get_active_image(ob, a + 1, &image, NULL, NULL); ED_object_get_active_image(ob, a + 1, &image, NULL, NULL);
if (image == curimage) { if (image == curimage) {
BLI_BITMAP_SET(mat_test_array, a); BLI_BITMAP_ENABLE(mat_test_array, a);
ok = true; ok = true;
} }
} }
@ -430,7 +430,7 @@ static void draw_uvs_other_mesh_new_shading(Object *ob, const Image *curimage)
for (a = me->totpoly; a != 0; a--, mpoly++) { for (a = me->totpoly; a != 0; a--, mpoly++) {
const int mat_nr = mpoly->mat_nr; const int mat_nr = mpoly->mat_nr;
if ((mat_nr >= ob->totcol) || if ((mat_nr >= ob->totcol) ||
(BLI_BITMAP_GET(mat_test_array, mat_nr)) == 0) (BLI_BITMAP_TEST(mat_test_array, mat_nr)) == 0)
{ {
continue; continue;
} }

@ -325,8 +325,8 @@ static DerivedMesh *applyModifier(
for (eidx = 0, ed = orig_medge; eidx < numEdges; eidx++, ed++) { for (eidx = 0, ed = orig_medge; eidx < numEdges; eidx++, ed++) {
if (!ELEM(edge_users[eidx], INVALID_UNUSED, INVALID_PAIR)) { if (!ELEM(edge_users[eidx], INVALID_UNUSED, INVALID_PAIR)) {
BLI_BITMAP_SET(orig_mvert_tag, ed->v1); BLI_BITMAP_ENABLE(orig_mvert_tag, ed->v1);
BLI_BITMAP_SET(orig_mvert_tag, ed->v2); BLI_BITMAP_ENABLE(orig_mvert_tag, ed->v2);
STACK_PUSH(new_edge_arr, eidx); STACK_PUSH(new_edge_arr, eidx);
newFaces++; newFaces++;
newLoops += 4; newLoops += 4;
@ -337,7 +337,7 @@ static DerivedMesh *applyModifier(
#undef INVALID_PAIR #undef INVALID_PAIR
for (i = 0; i < numVerts; i++) { for (i = 0; i < numVerts; i++) {
if (BLI_BITMAP_GET(orig_mvert_tag, i)) { if (BLI_BITMAP_TEST(orig_mvert_tag, i)) {
old_vert_arr[i] = STACK_SIZE(new_vert_arr); old_vert_arr[i] = STACK_SIZE(new_vert_arr);
STACK_PUSH(new_vert_arr, i); STACK_PUSH(new_vert_arr, i);
newEdges++; newEdges++;