summaryrefslogtreecommitdiff
path: root/indra/newview/llpolymorph.cpp
diff options
context:
space:
mode:
authordolphin <dolphin@lindenlab.com>2013-01-23 13:36:50 -0800
committerdolphin <dolphin@lindenlab.com>2013-01-23 13:36:50 -0800
commit3e8bc28c88f16c1b8bba496704ec3a6156a25e1d (patch)
treeaa52be0bc7aa10d578ba000b8cd69d40271477a0 /indra/newview/llpolymorph.cpp
parent7e9ac192d779e77cad0a0b785510190215fbe7a6 (diff)
parenta30a2c492d06c9ef843a43c0ff0be6f2826d6d0b (diff)
Merge
Diffstat (limited to 'indra/newview/llpolymorph.cpp')
-rw-r--r--indra/newview/llpolymorph.cpp18
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];