diff options
author | Hans Goudey <h.goudey@me.com> | 2022-05-14 19:57:52 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-05-14 19:57:52 +0300 |
commit | ea5bfedb4925485192e40cab98f2d5f1d3fe5012 (patch) | |
tree | dc1acc6668f86e9a439eea673a76b4f387400c4d /source/blender/blenkernel/intern/mesh_tangent.c | |
parent | e1c8ef551fe2c4393d714822e5e74eb153fc7af2 (diff) |
Cleanup: Further use of const for retrieved custom data layers
Similar to cf69652618fefcd22b2cde9a2.
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_tangent.c')
-rw-r--r-- | source/blender/blenkernel/intern/mesh_tangent.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/mesh_tangent.c b/source/blender/blenkernel/intern/mesh_tangent.c index 16d76a75f2c..c0b2b33c47c 100644 --- a/source/blender/blenkernel/intern/mesh_tangent.c +++ b/source/blender/blenkernel/intern/mesh_tangent.c @@ -37,13 +37,13 @@ /* User data. */ typedef struct { - const MPoly *mpolys; /* faces */ - const MLoop *mloops; /* faces's vertices */ - const MVert *mverts; /* vertices */ - const MLoopUV *luvs; /* texture coordinates */ - float (*lnors)[3]; /* loops' normals */ - float (*tangents)[4]; /* output tangents */ - int num_polys; /* number of polygons */ + const MPoly *mpolys; /* faces */ + const MLoop *mloops; /* faces's vertices */ + const MVert *mverts; /* vertices */ + const MLoopUV *luvs; /* texture coordinates */ + const float (*lnors)[3]; /* loops' normals */ + float (*tangents)[4]; /* output tangents */ + int num_polys; /* number of polygons */ } BKEMeshToTangent; /* Mikktspace's API */ @@ -103,7 +103,7 @@ void BKE_mesh_calc_loop_tangent_single_ex(const MVert *mverts, const int UNUSED(numVerts), const MLoop *mloops, float (*r_looptangent)[4], - float (*loopnors)[3], + const float (*loopnors)[3], const MLoopUV *loopuvs, const int UNUSED(numLoops), const MPoly *mpolys, @@ -156,7 +156,6 @@ void BKE_mesh_calc_loop_tangent_single(Mesh *mesh, ReportList *reports) { const MLoopUV *loopuvs; - float(*loopnors)[3]; /* Check we have valid texture coordinates first! */ if (uvmap) { @@ -173,7 +172,7 @@ void BKE_mesh_calc_loop_tangent_single(Mesh *mesh, return; } - loopnors = CustomData_get_layer(&mesh->ldata, CD_NORMAL); + const float(*loopnors)[3] = CustomData_get_layer(&mesh->ldata, CD_NORMAL); if (!loopnors) { BKE_report( reports, RPT_ERROR, "Tangent space computation needs loop normals, none found, aborting"); |