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:
authorHans Goudey <h.goudey@me.com>2022-01-29 07:40:13 +0300
committerHans Goudey <h.goudey@me.com>2022-01-29 07:40:13 +0300
commit90a23dec4650d63a836cb9e9969aab4d0da4ba2f (patch)
treebb558f7336aed4a03a78efb07302b33d56923bce /source/blender/blenkernel/intern/mesh_validate.c
parent0b2864382a90585ce5a5033d446ac1f27c82074a (diff)
Cleanup: Remove mesh vertex "temp tag" flag
As part of the project of converting `MVert` into `float3` (more details in T93602), this is an easy step, since it is only locally used runtime data. In the six places it was used, the flag was replaced by a local bitmap. By itself this change has no benefits other than making some code slightly simpler. It only really matters when the other flags are removed and it can be removed from `MVert` along with the bevel weight. Differential Revision: https://developer.blender.org/D13878
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_validate.c')
-rw-r--r--source/blender/blenkernel/intern/mesh_validate.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c
index 005c916b4e0..a5ba2767301 100644
--- a/source/blender/blenkernel/intern/mesh_validate.c
+++ b/source/blender/blenkernel/intern/mesh_validate.c
@@ -28,6 +28,7 @@
#include "CLG_log.h"
+#include "BLI_bitmap.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
@@ -560,6 +561,8 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
* so be sure to leave at most one poly per loop!
*/
{
+ BLI_bitmap *vert_tag = BLI_BITMAP_NEW(mesh->totvert, __func__);
+
SortPoly *sort_polys = MEM_callocN(sizeof(SortPoly) * totpoly, "mesh validate's sort_polys");
SortPoly *prev_sp, *sp = sort_polys;
int prev_end;
@@ -608,7 +611,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
* so we have to ensure here all verts of current poly are cleared. */
for (j = 0, ml = &mloops[sp->loopstart]; j < mp->totloop; j++, ml++) {
if (ml->v < totvert) {
- mverts[ml->v].flag &= ~ME_VERT_TMP_TAG;
+ BLI_BITMAP_DISABLE(vert_tag, ml->v);
}
}
@@ -619,12 +622,12 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
PRINT_ERR("\tLoop %u has invalid vert reference (%u)", sp->loopstart + j, ml->v);
sp->invalid = true;
}
- else if (mverts[ml->v].flag & ME_VERT_TMP_TAG) {
+ else if (BLI_BITMAP_TEST(vert_tag, ml->v)) {
PRINT_ERR("\tPoly %u has duplicated vert reference at corner (%u)", i, j);
sp->invalid = true;
}
else {
- mverts[ml->v].flag |= ME_VERT_TMP_TAG;
+ BLI_BITMAP_ENABLE(vert_tag, ml->v);
}
*v = ml->v;
}
@@ -698,6 +701,8 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
}
}
+ MEM_freeN(vert_tag);
+
/* Second check pass, testing polys using the same verts. */
qsort(sort_polys, totpoly, sizeof(SortPoly), search_poly_cmp);
sp = prev_sp = sort_polys;