From 13202345d5d4aee652e160a437ec765090f3ec63 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 22 Jun 2011 15:43:57 -0400 Subject: SH-989 FIX - only reject LOD if vertex total is too high, rather than checking mesh-by-mesh. This should make rejections much less common. --- indra/newview/llfloatermodelpreview.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 9721fc9224..1c48795ea7 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -4100,18 +4100,20 @@ void LLModelPreview::updateStatusMessages() } else if (!verts[lod].empty()) { + S32 sum_verts_higher_lod = 0; + S32 sum_verts_this_lod = 0; for (U32 i = 0; i < verts[lod].size(); ++i) { - S32 max_verts = i < verts[lod+1].size() ? verts[lod+1][i] : 0; + sum_verts_higher_lod += ((i < verts[lod+1].size()) ? verts[lod+1][i] : 0); + sum_verts_this_lod += verts[lod][i]; + } - if (max_verts > 0) - { - if (verts[lod][i] > max_verts) - { //too many vertices in this lod - message = "mesh_status_too_many_vertices"; - upload_status[lod] = 2; - } - } + if ((sum_verts_higher_lod > 0) && + (sum_verts_this_lod > sum_verts_higher_lod)) + { + //too many vertices in this lod + message = "mesh_status_too_many_vertices"; + upload_status[lod] = 2; } } } -- cgit v1.2.3