Cleanup: use const for 'clnors' argument where possible
This commit is contained in:
parent
9fe0505db0
commit
3e8a818419
|
@ -1012,7 +1012,7 @@ void BKE_mesh_loop_manifold_fan_around_vert_next(const MLoop *mloops,
|
|||
static void split_loop_nor_single_do(LoopSplitTaskDataCommon *common_data, LoopSplitTaskData *data)
|
||||
{
|
||||
MLoopNorSpaceArray *lnors_spacearr = common_data->lnors_spacearr;
|
||||
short(*clnors_data)[2] = common_data->clnors_data;
|
||||
const short(*clnors_data)[2] = common_data->clnors_data;
|
||||
|
||||
const MVert *mverts = common_data->mverts;
|
||||
const MEdge *medges = common_data->medges;
|
||||
|
|
|
@ -676,7 +676,7 @@ static void bm_mesh_loops_calc_normals(BMesh *bm,
|
|||
const float (*fnos)[3],
|
||||
float (*r_lnos)[3],
|
||||
MLoopNorSpaceArray *r_lnors_spacearr,
|
||||
short (*clnors_data)[2],
|
||||
const short (*clnors_data)[2],
|
||||
const int cd_loop_clnors_offset,
|
||||
const bool do_rebuild)
|
||||
{
|
||||
|
@ -786,8 +786,9 @@ static void bm_mesh_loops_calc_normals(BMesh *bm,
|
|||
BKE_lnor_space_add_loop(r_lnors_spacearr, lnor_space, l_curr_index, l_curr, true);
|
||||
|
||||
if (has_clnors) {
|
||||
short(*clnor)[2] = clnors_data ? &clnors_data[l_curr_index] :
|
||||
BM_ELEM_CD_GET_VOID_P(l_curr, cd_loop_clnors_offset);
|
||||
const short(*clnor)[2] = clnors_data ? &clnors_data[l_curr_index] :
|
||||
(const void *)BM_ELEM_CD_GET_VOID_P(
|
||||
l_curr, cd_loop_clnors_offset);
|
||||
BKE_lnor_space_custom_data_to_normal(lnor_space, *clnor, r_lnos[l_curr_index]);
|
||||
}
|
||||
}
|
||||
|
@ -820,7 +821,7 @@ static void bm_mesh_loops_calc_normals(BMesh *bm,
|
|||
|
||||
/* We validate clnors data on the fly - cheapest way to do! */
|
||||
int clnors_avg[2] = {0, 0};
|
||||
short(*clnor_ref)[2] = NULL;
|
||||
const short(*clnor_ref)[2] = NULL;
|
||||
int clnors_nbr = 0;
|
||||
bool clnors_invalid = false;
|
||||
|
||||
|
@ -886,9 +887,9 @@ static void bm_mesh_loops_calc_normals(BMesh *bm,
|
|||
|
||||
if (has_clnors) {
|
||||
/* Accumulate all clnors, if they are not all equal we have to fix that! */
|
||||
short(*clnor)[2] = clnors_data ?
|
||||
&clnors_data[lfan_pivot_index] :
|
||||
BM_ELEM_CD_GET_VOID_P(lfan_pivot, cd_loop_clnors_offset);
|
||||
const short(*clnor)[2] = clnors_data ? &clnors_data[lfan_pivot_index] :
|
||||
(const void *)BM_ELEM_CD_GET_VOID_P(
|
||||
lfan_pivot, cd_loop_clnors_offset);
|
||||
if (clnors_nbr) {
|
||||
clnors_invalid |= ((*clnor_ref)[0] != (*clnor)[0] ||
|
||||
(*clnor_ref)[1] != (*clnor)[1]);
|
||||
|
@ -1049,7 +1050,7 @@ void BM_mesh_loop_normals_update(BMesh *bm,
|
|||
const float split_angle,
|
||||
float (*r_lnos)[3],
|
||||
MLoopNorSpaceArray *r_lnors_spacearr,
|
||||
short (*clnors_data)[2],
|
||||
const short (*clnors_data)[2],
|
||||
const int cd_loop_clnors_offset)
|
||||
{
|
||||
const bool has_clnors = clnors_data || (cd_loop_clnors_offset != -1);
|
||||
|
|
Loading…
Reference in New Issue