summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-07-08 23:22:07 -0500
committerDave Parks <davep@lindenlab.com>2011-07-08 23:22:07 -0500
commitdd6547a55e02a4340cb178c72acff1216a56f84c (patch)
tree5fe699d33fe160575e5b195754d94561c4d9ff09
parent615cc856a8abf44f62c58962f8b53178f9708ee3 (diff)
parentdc7100a63f09aa67a2fa59e354f8e681bfd7fcb9 (diff)
merge
-rw-r--r--indra/llprimitive/llmodel.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index 986bde0581..ba7abd4c79 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -1209,10 +1209,23 @@ void LLModel::generateNormals(F32 angle_cutoff)
LLVolumeFace::VertexData v;
new_face.mPositions[i] = vol_face.mPositions[idx];
new_face.mNormals[i].clear();
- new_face.mTexCoords[i] = vol_face.mTexCoords[idx];
new_face.mIndices[i] = i;
}
+ if (vol_face.mTexCoords)
+ {
+ for (U32 i = 0; i < vol_face.mNumIndices; i++)
+ {
+ U32 idx = vol_face.mIndices[i];
+ new_face.mTexCoords[i] = vol_face.mTexCoords[idx];
+ }
+ }
+ else
+ {
+ ll_aligned_free_16(new_face.mTexCoords);
+ new_face.mTexCoords = NULL;
+ }
+
//generate normals for new face
for (U32 i = 0; i < new_face.mNumIndices; i += 3)
{ //for each triangle