diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llpolymorph.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llpolymorph.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/linden/indra/newview/llpolymorph.cpp b/linden/indra/newview/llpolymorph.cpp index 11ca7af..34a9b71 100644 --- a/linden/indra/newview/llpolymorph.cpp +++ b/linden/indra/newview/llpolymorph.cpp | |||
@@ -46,13 +46,9 @@ const F32 NORMAL_SOFTEN_FACTOR = 0.65f; | |||
46 | //----------------------------------------------------------------------------- | 46 | //----------------------------------------------------------------------------- |
47 | // LLPolyMorphData() | 47 | // LLPolyMorphData() |
48 | //----------------------------------------------------------------------------- | 48 | //----------------------------------------------------------------------------- |
49 | LLPolyMorphData::LLPolyMorphData(char *morph_name) | 49 | LLPolyMorphData::LLPolyMorphData(const std::string& morph_name) |
50 | : mName(morph_name) | ||
50 | { | 51 | { |
51 | llassert (morph_name); | ||
52 | |||
53 | mName = new char[strlen(morph_name) + 1]; /*Flawfinder: ignore*/ | ||
54 | strcpy(mName, morph_name); /*Flawfinder: ignore*/ | ||
55 | |||
56 | mNumIndices = 0; | 52 | mNumIndices = 0; |
57 | mCurrentIndex = 0; | 53 | mCurrentIndex = 0; |
58 | mTotalDistortion = 0.f; | 54 | mTotalDistortion = 0.f; |
@@ -72,7 +68,6 @@ LLPolyMorphData::LLPolyMorphData(char *morph_name) | |||
72 | //----------------------------------------------------------------------------- | 68 | //----------------------------------------------------------------------------- |
73 | LLPolyMorphData::~LLPolyMorphData() | 69 | LLPolyMorphData::~LLPolyMorphData() |
74 | { | 70 | { |
75 | delete [] mName; | ||
76 | delete [] mVertexIndices; | 71 | delete [] mVertexIndices; |
77 | delete [] mCoords; | 72 | delete [] mCoords; |
78 | delete [] mNormals; | 73 | delete [] mNormals; |
@@ -226,7 +221,7 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node) | |||
226 | static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name"); | 221 | static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name"); |
227 | if (child_node->hasName("volume_morph")) | 222 | if (child_node->hasName("volume_morph")) |
228 | { | 223 | { |
229 | LLString volume_name; | 224 | std::string volume_name; |
230 | if (child_node->getFastAttributeString(name_string, volume_name)) | 225 | if (child_node->getFastAttributeString(name_string, volume_name)) |
231 | { | 226 | { |
232 | LLVector3 scale; | 227 | LLVector3 scale; |
@@ -284,10 +279,9 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info) | |||
284 | for (iter = getInfo()->mVolumeInfoList.begin(); iter != getInfo()->mVolumeInfoList.end(); iter++) | 279 | for (iter = getInfo()->mVolumeInfoList.begin(); iter != getInfo()->mVolumeInfoList.end(); iter++) |
285 | { | 280 | { |
286 | LLPolyVolumeMorphInfo *volume_info = &(*iter); | 281 | LLPolyVolumeMorphInfo *volume_info = &(*iter); |
287 | std::string vol_string(volume_info->mName); | ||
288 | for (S32 i = 0; i < avatarp->mNumCollisionVolumes; i++) | 282 | for (S32 i = 0; i < avatarp->mNumCollisionVolumes; i++) |
289 | { | 283 | { |
290 | if (avatarp->mCollisionVolumes[i].getName() == vol_string) | 284 | if (avatarp->mCollisionVolumes[i].getName() == volume_info->mName) |
291 | { | 285 | { |
292 | mVolumeMorphs.push_back(LLPolyVolumeMorph(&avatarp->mCollisionVolumes[i], | 286 | mVolumeMorphs.push_back(LLPolyVolumeMorph(&avatarp->mCollisionVolumes[i], |
293 | volume_info->mScale, | 287 | volume_info->mScale, |
@@ -297,7 +291,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info) | |||
297 | } | 291 | } |
298 | } | 292 | } |
299 | 293 | ||
300 | mMorphData = mMesh->getMorphData(getInfo()->mMorphName.c_str()); | 294 | mMorphData = mMesh->getMorphData(getInfo()->mMorphName); |
301 | if (!mMorphData) | 295 | if (!mMorphData) |
302 | { | 296 | { |
303 | llwarns << "No morph target named " << getInfo()->mMorphName << " found in mesh." << llendl; | 297 | llwarns << "No morph target named " << getInfo()->mMorphName << " found in mesh." << llendl; |