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/llpolymesh.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 'linden/indra/newview/llpolymesh.cpp')
-rw-r--r-- | linden/indra/newview/llpolymesh.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/linden/indra/newview/llpolymesh.cpp b/linden/indra/newview/llpolymesh.cpp index 3884b31..0a1e2ce 100644 --- a/linden/indra/newview/llpolymesh.cpp +++ b/linden/indra/newview/llpolymesh.cpp | |||
@@ -261,12 +261,12 @@ BOOL LLPolyMeshSharedData::allocateJointNames( U32 numJointNames ) | |||
261 | //-------------------------------------------------------------------- | 261 | //-------------------------------------------------------------------- |
262 | // LLPolyMeshSharedData::loadMesh() | 262 | // LLPolyMeshSharedData::loadMesh() |
263 | //-------------------------------------------------------------------- | 263 | //-------------------------------------------------------------------- |
264 | BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | 264 | BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) |
265 | { | 265 | { |
266 | //------------------------------------------------------------------------- | 266 | //------------------------------------------------------------------------- |
267 | // Open the file | 267 | // Open the file |
268 | //------------------------------------------------------------------------- | 268 | //------------------------------------------------------------------------- |
269 | if(!fileName) | 269 | if(fileName.empty()) |
270 | { | 270 | { |
271 | llerrs << "Filename is Empty!" << llendl; | 271 | llerrs << "Filename is Empty!" << llendl; |
272 | return FALSE; | 272 | return FALSE; |
@@ -595,7 +595,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
595 | // we reached the end of the morphs | 595 | // we reached the end of the morphs |
596 | break; | 596 | break; |
597 | } | 597 | } |
598 | LLPolyMorphData* morph_data = new LLPolyMorphData(morphName); | 598 | LLPolyMorphData* morph_data = new LLPolyMorphData(std::string(morphName)); |
599 | 599 | ||
600 | BOOL result = morph_data->loadBinary(fp, this); | 600 | BOOL result = morph_data->loadBinary(fp, this); |
601 | 601 | ||
@@ -679,7 +679,9 @@ const LLVector2 &LLPolyMeshSharedData::getUVs(U32 index) | |||
679 | // LLPolyMesh() | 679 | // LLPolyMesh() |
680 | //----------------------------------------------------------------------------- | 680 | //----------------------------------------------------------------------------- |
681 | LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_mesh) | 681 | LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_mesh) |
682 | { | 682 | { |
683 | LLMemType mt(LLMemType::MTYPE_AVATAR_MESH); | ||
684 | |||
683 | llassert(shared_data); | 685 | llassert(shared_data); |
684 | 686 | ||
685 | mSharedData = shared_data; | 687 | mSharedData = shared_data; |
@@ -687,6 +689,12 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_ | |||
687 | mAvatarp = NULL; | 689 | mAvatarp = NULL; |
688 | mVertexData = NULL; | 690 | mVertexData = NULL; |
689 | 691 | ||
692 | mCurVertexCount = 0; | ||
693 | mFaceIndexCount = 0; | ||
694 | mFaceIndexOffset = 0; | ||
695 | mFaceVertexCount = 0; | ||
696 | mFaceVertexOffset = 0; | ||
697 | |||
690 | if (shared_data->isLOD() && reference_mesh) | 698 | if (shared_data->isLOD() && reference_mesh) |
691 | { | 699 | { |
692 | mCoords = reference_mesh->mCoords; | 700 | mCoords = reference_mesh->mCoords; |
@@ -755,7 +763,7 @@ LLPolyMesh::~LLPolyMesh() | |||
755 | //----------------------------------------------------------------------------- | 763 | //----------------------------------------------------------------------------- |
756 | // LLPolyMesh::getMesh() | 764 | // LLPolyMesh::getMesh() |
757 | //----------------------------------------------------------------------------- | 765 | //----------------------------------------------------------------------------- |
758 | LLPolyMesh *LLPolyMesh::getMesh(const LLString &name, LLPolyMesh* reference_mesh) | 766 | LLPolyMesh *LLPolyMesh::getMesh(const std::string &name, LLPolyMesh* reference_mesh) |
759 | { | 767 | { |
760 | //------------------------------------------------------------------------- | 768 | //------------------------------------------------------------------------- |
761 | // search for an existing mesh by this name | 769 | // search for an existing mesh by this name |
@@ -771,8 +779,8 @@ LLPolyMesh *LLPolyMesh::getMesh(const LLString &name, LLPolyMesh* reference_mesh | |||
771 | //------------------------------------------------------------------------- | 779 | //------------------------------------------------------------------------- |
772 | // if not found, create a new one, add it to the list | 780 | // if not found, create a new one, add it to the list |
773 | //------------------------------------------------------------------------- | 781 | //------------------------------------------------------------------------- |
774 | char full_path[LL_MAX_PATH]; /*Flawfinder: ignore*/ | 782 | std::string full_path; |
775 | snprintf(full_path, LL_MAX_PATH, "%s", (gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,name.c_str())).c_str()); /* Flawfinder: ignore */ | 783 | full_path = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,name); |
776 | 784 | ||
777 | LLPolyMeshSharedData *mesh_data = new LLPolyMeshSharedData(); | 785 | LLPolyMeshSharedData *mesh_data = new LLPolyMeshSharedData(); |
778 | if (reference_mesh) | 786 | if (reference_mesh) |
@@ -929,7 +937,7 @@ void LLPolyMesh::initializeForMorph() | |||
929 | //----------------------------------------------------------------------------- | 937 | //----------------------------------------------------------------------------- |
930 | // getMorphData() | 938 | // getMorphData() |
931 | //----------------------------------------------------------------------------- | 939 | //----------------------------------------------------------------------------- |
932 | LLPolyMorphData* LLPolyMesh::getMorphData(const char *morph_name) | 940 | LLPolyMorphData* LLPolyMesh::getMorphData(const std::string& morph_name) |
933 | { | 941 | { |
934 | if (!mSharedData) | 942 | if (!mSharedData) |
935 | return NULL; | 943 | return NULL; |
@@ -937,7 +945,7 @@ LLPolyMorphData* LLPolyMesh::getMorphData(const char *morph_name) | |||
937 | iter != mSharedData->mMorphData.end(); ++iter) | 945 | iter != mSharedData->mMorphData.end(); ++iter) |
938 | { | 946 | { |
939 | LLPolyMorphData *morph_data = *iter; | 947 | LLPolyMorphData *morph_data = *iter; |
940 | if (!strcmp(morph_data->getName(), morph_name)) | 948 | if (morph_data->getName() == morph_name) |
941 | { | 949 | { |
942 | return morph_data; | 950 | return morph_data; |
943 | } | 951 | } |
@@ -1003,7 +1011,7 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node) | |||
1003 | { | 1011 | { |
1004 | if (bone->hasName("bone")) | 1012 | if (bone->hasName("bone")) |
1005 | { | 1013 | { |
1006 | LLString name; | 1014 | std::string name; |
1007 | LLVector3 scale; | 1015 | LLVector3 scale; |
1008 | LLVector3 pos; | 1016 | LLVector3 pos; |
1009 | BOOL haspos = FALSE; | 1017 | BOOL haspos = FALSE; |