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-09-27 21:44:27 +0300
committerHans Goudey <h.goudey@me.com>2022-09-27 22:50:07 +0300
commitb6ee599d9205814aacd95a2aa09e1dba47e7494d (patch)
treed12831d054e7c7b7d69b22b32f237d7f609e14f3
parentf69aaf71f82ad9c52a8590479dbb20e1c2916f1e (diff)
Cleanup: Use variable and const for sculpt mesh vertex to poly maps
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index eb4cc9fd866..ce00f20b88e 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -444,7 +444,7 @@ bool SCULPT_vertex_any_face_visible_get(SculptSession *ss, PBVHVertRef vertex)
if (!ss->hide_poly) {
return true;
}
- MeshElemMap *vert_map = &ss->pmap[vertex.i];
+ const MeshElemMap *vert_map = &ss->pmap[vertex.i];
for (int j = 0; j < ss->pmap[vertex.i].count; j++) {
if (!ss->hide_poly[vert_map->indices[j]]) {
return true;
@@ -467,8 +467,8 @@ bool SCULPT_vertex_all_faces_visible_get(const SculptSession *ss, PBVHVertRef ve
if (!ss->hide_poly) {
return true;
}
- MeshElemMap *vert_map = &ss->pmap[vertex.i];
- for (int j = 0; j < ss->pmap[vertex.i].count; j++) {
+ const MeshElemMap *vert_map = &ss->pmap[vertex.i];
+ for (int j = 0; j < vert_map->count; j++) {
if (ss->hide_poly[vert_map->indices[j]]) {
return false;
}
@@ -495,8 +495,8 @@ void SCULPT_vertex_face_set_set(SculptSession *ss, PBVHVertRef vertex, int face_
switch (BKE_pbvh_type(ss->pbvh)) {
case PBVH_FACES: {
BLI_assert(ss->face_sets != NULL);
- MeshElemMap *vert_map = &ss->pmap[vertex.i];
- for (int j = 0; j < ss->pmap[vertex.i].count; j++) {
+ const MeshElemMap *vert_map = &ss->pmap[vertex.i];
+ for (int j = 0; j < vert_map->count; j++) {
const int poly_index = vert_map->indices[j];
if (ss->hide_poly && ss->hide_poly[poly_index]) {
/* Skip hidden faces connected to the vertex. */
@@ -530,9 +530,9 @@ int SCULPT_vertex_face_set_get(SculptSession *ss, PBVHVertRef vertex)
if (!ss->face_sets) {
return SCULPT_FACE_SET_NONE;
}
- MeshElemMap *vert_map = &ss->pmap[vertex.i];
+ const MeshElemMap *vert_map = &ss->pmap[vertex.i];
int face_set = 0;
- for (int i = 0; i < ss->pmap[vertex.i].count; i++) {
+ for (int i = 0; i < vert_map->count; i++) {
if (ss->face_sets[vert_map->indices[i]] > face_set) {
face_set = abs(ss->face_sets[vert_map->indices[i]]);
}
@@ -561,8 +561,8 @@ bool SCULPT_vertex_has_face_set(SculptSession *ss, PBVHVertRef vertex, int face_
if (!ss->face_sets) {
return face_set == SCULPT_FACE_SET_NONE;
}
- MeshElemMap *vert_map = &ss->pmap[vertex.i];
- for (int i = 0; i < ss->pmap[vertex.i].count; i++) {
+ const MeshElemMap *vert_map = &ss->pmap[vertex.i];
+ for (int i = 0; i < vert_map->count; i++) {
if (ss->face_sets[vert_map->indices[i]] == face_set) {
return true;
}
@@ -613,9 +613,9 @@ static bool sculpt_check_unique_face_set_in_base_mesh(SculptSession *ss, int ind
if (!ss->face_sets) {
return true;
}
- MeshElemMap *vert_map = &ss->pmap[index];
+ const MeshElemMap *vert_map = &ss->pmap[index];
int face_set = -1;
- for (int i = 0; i < ss->pmap[index].count; i++) {
+ for (int i = 0; i < vert_map->count; i++) {
if (face_set == -1) {
face_set = ss->face_sets[vert_map->indices[i]];
}
@@ -634,9 +634,9 @@ static bool sculpt_check_unique_face_set_in_base_mesh(SculptSession *ss, int ind
*/
static bool sculpt_check_unique_face_set_for_edge_in_base_mesh(SculptSession *ss, int v1, int v2)
{
- MeshElemMap *vert_map = &ss->pmap[v1];
+ const MeshElemMap *vert_map = &ss->pmap[v1];
int p1 = -1, p2 = -1;
- for (int i = 0; i < ss->pmap[v1].count; i++) {
+ for (int i = 0; i < vert_map->count; i++) {
const MPoly *p = &ss->mpoly[vert_map->indices[i]];
for (int l = 0; l < p->totloop; l++) {
const MLoop *loop = &ss->mloop[p->loopstart + l];
@@ -785,7 +785,7 @@ static void sculpt_vertex_neighbors_get_faces(SculptSession *ss,
PBVHVertRef vertex,
SculptVertexNeighborIter *iter)
{
- MeshElemMap *vert_map = &ss->pmap[vertex.i];
+ const MeshElemMap *vert_map = &ss->pmap[vertex.i];
iter->size = 0;
iter->num_duplicates = 0;
iter->capacity = SCULPT_VERTEX_NEIGHBOR_FIXED_CAPACITY;
@@ -793,7 +793,7 @@ static void sculpt_vertex_neighbors_get_faces(SculptSession *ss,
iter->neighbor_indices = iter->neighbor_indices_fixed;
const bool *hide_poly = BKE_pbvh_get_vert_hide(ss->pbvh);
- for (int i = 0; i < ss->pmap[vertex.i].count; i++) {
+ for (int i = 0; i < vert_map->count; i++) {
if (hide_poly && hide_poly[vert_map->indices[i]]) {
/* Skip connectivity from hidden faces. */
continue;