diff options
-rwxr-xr-x | indra/llprimitive/llmodel.cpp | 16 | ||||
-rwxr-xr-x | indra/newview/llfloatermodelpreview.cpp | 7 |
2 files changed, 20 insertions, 3 deletions
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index e0294cfd6a..e18004a49e 100755 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -316,6 +316,14 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa if (indices.size()%3 == 0 && verts.size() >= 65532) { + std::string material; + + if (tri->getMaterial()) + { + material = std::string(tri->getMaterial()); + } + + materials.push_back(material); face_list.push_back(face); face_list.rbegin()->fillFromLegacyData(verts, indices); LLVolumeFace& new_face = *face_list.rbegin(); @@ -587,6 +595,14 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac if (indices.size()%3 == 0 && indices.size() >= 65532) { + std::string material; + + if (poly->getMaterial()) + { + material = std::string(poly->getMaterial()); + } + + materials.push_back(material); face_list.push_back(face); face_list.rbegin()->fillFromLegacyData(verts, indices); LLVolumeFace& new_face = *face_list.rbegin(); diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index e0a998c369..3f62d94dae 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -4860,7 +4860,7 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights) LLModel* base_mdl = *base_iter; base_iter++; - for (S32 i = 0; i < mdl->getNumVolumeFaces(); ++i) + for (S32 i = 0, e = mdl->getNumVolumeFaces(); i < e; ++i) { const LLVolumeFace &vf = mdl->getVolumeFace(i); U32 num_vertices = vf.mNumVertices; @@ -5292,7 +5292,7 @@ BOOL LLModelPreview::render() gGL.multMatrix((GLfloat*) mat.mMatrix); - for (U32 i = 0; i < mVertexBuffer[mPreviewLOD][model].size(); ++i) + for (U32 i = 0, e = mVertexBuffer[mPreviewLOD][model].size(); i < e; ++i) { LLVertexBuffer* buffer = mVertexBuffer[mPreviewLOD][model][i]; @@ -5567,7 +5567,7 @@ BOOL LLModelPreview::render() if (!model->mSkinWeights.empty()) { - for (U32 i = 0; i < mVertexBuffer[mPreviewLOD][model].size(); ++i) + for (U32 i = 0, e = mVertexBuffer[mPreviewLOD][model].size(); i < e; ++i) { LLVertexBuffer* buffer = mVertexBuffer[mPreviewLOD][model][i]; @@ -5636,6 +5636,7 @@ BOOL LLModelPreview::render() position[j] = v; } + llassert(model->mMaterialList.size() > i); const std::string& binding = instance.mModel->mMaterialList[i]; const LLImportMaterial& material = instance.mMaterial[binding]; |