summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2011-05-04 10:11:39 -0600
committerXiaohong Bao <bao@lindenlab.com>2011-05-04 10:11:39 -0600
commit905fc03e5dd422e4d6b74859e22406ec4e12742c (patch)
tree798cf5a758b523474dc5090a2dc2cff1fb3c8888
parentee06fde19392d060276c21104385e292a00f4bff (diff)
fix for SH-1185: uploading large mesh file sometimes fails and locks up viewer.
-rw-r--r--indra/newview/llfloatermodelpreview.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index ae0e1b7d46..fe9de14747 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -3645,21 +3645,19 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
glodGroupParameterf(mGroup, GLOD_OBJECT_SPACE_ERROR_THRESHOLD, lod_error_threshold);
stop_gloderror();
- glodGroupParameteri(mGroup, GLOD_MAX_TRIANGLES, 0);
- stop_gloderror();
-
- glodAdaptGroup(mGroup);
- stop_gloderror();
-
- if (lod_mode == GLOD_TRIANGLE_BUDGET)
- { //SH-632 Always adapt to 0 before adapting to actual desired amount, and always
- //add 1 to desired amount to avoid decimating below desired amount
+ if (lod_mode != GLOD_TRIANGLE_BUDGET)
+ {
+ glodGroupParameteri(mGroup, GLOD_MAX_TRIANGLES, 0);
+ }
+ else
+ {
+ //SH-632: always add 1 to desired amount to avoid decimating below desired amount
glodGroupParameteri(mGroup, GLOD_MAX_TRIANGLES, triangle_count+1);
- stop_gloderror();
-
- glodAdaptGroup(mGroup);
- stop_gloderror();
}
+
+ stop_gloderror();
+ glodAdaptGroup(mGroup);
+ stop_gloderror();
for (U32 mdl_idx = 0; mdl_idx < mBaseModel.size(); ++mdl_idx)
{