summaryrefslogtreecommitdiff
path: root/indra/llmath/llvolume.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2015-09-30 11:00:48 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2015-09-30 11:00:48 -0400
commitfc74e02cde9b7b31de157f23a8bd9bf27a756428 (patch)
tree911dfc78a516a0079ad10c7cd6be2ce1a148763b /indra/llmath/llvolume.cpp
parent5460c0f4c80660f93723a80d464c0a5ebd97921a (diff)
parent2d52b62e67cf46222396c724d00d2de874819197 (diff)
merge
Diffstat (limited to 'indra/llmath/llvolume.cpp')
-rwxr-xr-xindra/llmath/llvolume.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index cd417c913d..ae714c5bce 100755
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -6084,7 +6084,7 @@ void LLVolumeFace::pushVertex(const LLVector4a& pos, const LLVector4a& norm, con
if (new_verts > mNumAllocatedVertices)
{
- //double buffer size on expansion
+ // double buffer size on expansion
new_verts *= 2;
S32 new_tc_size = ((new_verts*8)+0xF) & ~0xF;
@@ -6100,18 +6100,21 @@ void LLVolumeFace::pushVertex(const LLVector4a& pos, const LLVector4a& norm, con
mNormals = mPositions+new_verts;
mTexCoords = (LLVector2*) (mNormals+new_verts);
- //positions
- LLVector4a::memcpyNonAliased16((F32*) mPositions, (F32*) old_buf, old_vsize);
-
- //normals
- LLVector4a::memcpyNonAliased16((F32*) mNormals, (F32*) (old_buf+mNumVertices), old_vsize);
+ if (old_buf != NULL)
+ {
+ // copy old positions into new buffer
+ LLVector4a::memcpyNonAliased16((F32*)mPositions, (F32*)old_buf, old_vsize);
- //tex coords
- LLVector4a::memcpyNonAliased16((F32*) mTexCoords, (F32*) (old_buf+mNumVertices*2), old_tc_size);
+ // normals
+ LLVector4a::memcpyNonAliased16((F32*)mNormals, (F32*)(old_buf + mNumVertices), old_vsize);
- //just clear tangents
- ll_aligned_free_16(mTangents);
- mTangents = NULL;
+ // tex coords
+ LLVector4a::memcpyNonAliased16((F32*)mTexCoords, (F32*)(old_buf + mNumVertices * 2), old_tc_size);
+ }
+
+ // just clear tangents
+ ll_aligned_free_16(mTangents);
+ mTangents = NULL;
ll_aligned_free<64>(old_buf);
mNumAllocatedVertices = new_verts;