diff options
Diffstat (limited to 'indra/newview/llmodelpreview.cpp')
-rw-r--r-- | indra/newview/llmodelpreview.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 0055684e56..6ba840fa5d 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -2344,7 +2344,7 @@ void LLModelPreview::updateStatusMessages() if (lod != lod_high) { - if (total_submeshes[lod] && total_submeshes[lod] != total_submeshes[lod_high]) + if (total_submeshes[lod] && total_submeshes[lod] > total_submeshes[lod_high]) { //number of submeshes is different message = "mesh_status_submesh_mismatch"; upload_status[lod] = 2; @@ -2829,9 +2829,9 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights) LLMatrix4a mat_normal; if (skinned) { - glh::matrix4f m((F32*)mdl->mSkinInfo.mBindShapeMatrix.getF32ptr()); - m = m.inverse().transpose(); - mat_normal.loadu(m.m); + glm::mat4 m = glm::make_mat4((F32*)mdl->mSkinInfo.mBindShapeMatrix.getF32ptr()); + m = glm::transpose(glm::inverse(m)); + mat_normal.loadu(glm::value_ptr(m)); } S32 num_faces = mdl->getNumVolumeFaces(); @@ -3322,7 +3322,6 @@ bool LLModelPreview::render() fmp->setViewOptionEnabled("show_skin_weight", show_skin_weight); } } - //if (this) return TRUE; if (upload_skin && !has_skin_weights) { //can't upload skin weights if model has no skin weights @@ -3365,7 +3364,7 @@ bool LLModelPreview::render() mFMP->childSetEnabled("upload_joints", upload_skin); } - F32 explode = (F32)mFMP->childGetValue("physics_explode").asReal(); + F32 physics_explode = (F32)mFMP->childGetValue("physics_explode").asReal(); LLGLDepthTest gls_depth(GL_TRUE); // SL-12781 re-enable z-buffer for 3D model preview @@ -3569,7 +3568,7 @@ bool LLModelPreview::render() LLPhysicsDecomp* decomp = gMeshRepo.mDecompThread; if (decomp) { - LLMutexLock(decomp->mMutex); + LLMutexLock lock(decomp->mMutex); LLModel::Decomposition& physics = model->mPhysics; @@ -3594,12 +3593,12 @@ bool LLModelPreview::render() for (U32 i = 0; i < physics.mMesh.size(); ++i) { - if (explode > 0.f) + if (physics_explode > 0.f) { gGL.pushMatrix(); LLVector3 offset = model->mHullCenter[i] - model->mCenterOfHullCenters; - offset *= explode; + offset *= physics_explode; gGL.translatef(offset.mV[0], offset.mV[1], offset.mV[2]); } @@ -3614,7 +3613,7 @@ bool LLModelPreview::render() gGL.diffuseColor4ubv(hull_colors[i].mV); LLVertexBuffer::drawArrays(LLRender::TRIANGLES, physics.mMesh[i].mPositions); - if (explode > 0.f) + if (physics_explode > 0.f) { gGL.popMatrix(); } @@ -3629,7 +3628,8 @@ bool LLModelPreview::render() if (render_mesh) { auto num_models = mVertexBuffer[LLModel::LOD_PHYSICS][model].size(); - if (pass > 0){ + if (pass > 0) + { for (size_t i = 0; i < num_models; ++i) { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -3695,7 +3695,7 @@ bool LLModelPreview::render() LLPhysicsDecomp* decomp = gMeshRepo.mDecompThread; if (decomp) { - LLMutexLock(decomp->mMutex); + LLMutexLock lock(decomp->mMutex); LLModel::Decomposition& physics = model->mPhysics; @@ -3817,7 +3817,8 @@ bool LLModelPreview::render() } } - for (U32 i = 0, e = static_cast<U32>(mVertexBuffer[mPreviewLOD][model].size()); i < e; ++i) + std::size_t size = mVertexBuffer[mPreviewLOD][model].size(); + for (U32 i = 0; i < size; ++i) { model->mSkinInfo.updateHash(); LLRenderPass::uploadMatrixPalette(mPreviewAvatar, &model->mSkinInfo); |