diff options
author | Oz Linden <oz@lindenlab.com> | 2013-03-18 14:30:57 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2013-03-18 14:30:57 -0400 |
commit | ed7785bf97a601448ba2da5fb2f19ea2861454c5 (patch) | |
tree | 17e8d9ccf28ae30c5029ecea7e0ab8bed0fe3926 /indra/newview/llpolymorph.cpp | |
parent | c8533650b4779040c5e196f9ff156e3454edc9c8 (diff) | |
parent | bf95c1cae7a84d1a97dacd8ea7f1b6af8be067a9 (diff) |
merge up to 3.5.0-beta3 (chui)
Diffstat (limited to 'indra/newview/llpolymorph.cpp')
-rw-r--r-- | indra/newview/llpolymorph.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/indra/newview/llpolymorph.cpp b/indra/newview/llpolymorph.cpp index bd96608641..495fdc348c 100644 --- a/indra/newview/llpolymorph.cpp +++ b/indra/newview/llpolymorph.cpp @@ -73,9 +73,11 @@ LLPolyMorphData::LLPolyMorphData(const LLPolyMorphData &rhs) : { const S32 numVertices = mNumIndices; - mCoords = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a))); - mNormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a))); - mBinormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a))); + U32 size = sizeof(LLVector4a)*numVertices; + + mCoords = static_cast<LLVector4a*>( ll_aligned_malloc_16(size) ); + mNormals = static_cast<LLVector4a*>( ll_aligned_malloc_16(size) ); + mBinormals = static_cast<LLVector4a*>( ll_aligned_malloc_16(size) ); mTexCoords = new LLVector2[numVertices]; mVertexIndices = new U32[numVertices]; @@ -121,9 +123,13 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh) //------------------------------------------------------------------------- // allocate vertices //------------------------------------------------------------------------- - mCoords = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a))); - mNormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a))); - mBinormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a))); + + U32 size = sizeof(LLVector4a)*numVertices; + + mCoords = static_cast<LLVector4a*>(ll_aligned_malloc_16(size)); + mNormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(size)); + mBinormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(size)); + mTexCoords = new LLVector2[numVertices]; // Actually, we are allocating more space than we need for the skiplist mVertexIndices = new U32[numVertices]; |