diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-04-14 20:41:17 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-04-14 20:41:17 +0400 |
commit | d9c249785982475bc86cdcd3d61a3bfe5422338a (patch) | |
tree | 56f92e015876bc2f2c994cca8908eb0d952eeac5 /source/blender/render | |
parent | 5d850c16bfd9058827edb454cf539e0f6e965a7e (diff) |
no functional change, avoid making a 4 pointer array just for an index lookup for tangents, orcos and normals.
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/intern/source/convertblender.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 62f47dcd3b5..6222635378e 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -531,8 +531,8 @@ static void GetPosition(const SMikkTSpaceContext * pContext, float fPos[], const //assert(vert_index>=0 && vert_index<4); SRenderMeshToTangent * pMesh = (SRenderMeshToTangent *) pContext->m_pUserData; VlakRen *vlr= RE_findOrAddVlak(pMesh->obr, face_num); - VertRen * pVerts[] = {vlr->v1, vlr->v2, vlr->v3, vlr->v4}; - VECCOPY(fPos, pVerts[vert_index]->co); + const float *co= (&vlr->v1)[vert_index]->co; + VECCOPY(fPos, co); } static void GetTextureCoordinate(const SMikkTSpaceContext * pContext, float fUV[], const int face_num, const int vert_index) @@ -549,8 +549,9 @@ static void GetTextureCoordinate(const SMikkTSpaceContext * pContext, float fUV[ } else { - VertRen * pVerts[] = {vlr->v1, vlr->v2, vlr->v3, vlr->v4}; - map_to_sphere(&fUV[0], &fUV[1], pVerts[vert_index]->orco[0], pVerts[vert_index]->orco[1], pVerts[vert_index]->orco[2]); + const float *orco= (&vlr->v1)[vert_index]->orco; + map_to_sphere(&fUV[0], &fUV[1], orco[0], orco[1], orco[2]); + } } @@ -559,8 +560,8 @@ static void GetNormal(const SMikkTSpaceContext * pContext, float fNorm[], const //assert(vert_index>=0 && vert_index<4); SRenderMeshToTangent * pMesh = (SRenderMeshToTangent *) pContext->m_pUserData; VlakRen *vlr= RE_findOrAddVlak(pMesh->obr, face_num); - VertRen * pVerts[] = {vlr->v1, vlr->v2, vlr->v3, vlr->v4}; - VECCOPY(fNorm, pVerts[vert_index]->n); + const float *n= (&vlr->v1)[vert_index]->n; + VECCOPY(fNorm, n); } static void SetTSpace(const SMikkTSpaceContext * pContext, const float fvTangent[], const float fSign, const int face_num, const int iVert) { |