summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermodelpreview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rw-r--r--indra/newview/llfloatermodelpreview.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 64b24d54c3..d6bb0ec872 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -137,10 +137,10 @@ mAvatarTabIndex(0)
mStatusLock = new LLMutex();
mModelPreview = NULL;
- mLODMode[LLModel::LOD_HIGH] = 0;
+ mLODMode[LLModel::LOD_HIGH] = LLModelPreview::LOD_FROM_FILE;
for (U32 i = 0; i < LLModel::LOD_HIGH; i++)
{
- mLODMode[i] = 1;
+ mLODMode[i] = LLModelPreview::MESH_OPTIMIZER_AUTO;
}
}
@@ -723,7 +723,19 @@ void LLFloaterModelPreview::onAutoFillCommit(LLUICtrl* ctrl, void* userdata)
void LLFloaterModelPreview::onLODParamCommit(S32 lod, bool enforce_tri_limit)
{
- mModelPreview->onLODParamCommit(lod, enforce_tri_limit);
+ LLComboBox* lod_source_combo = getChild<LLComboBox>("lod_source_" + lod_name[lod]);
+ S32 mode = lod_source_combo->getCurrentIndex();
+ switch (mode)
+ {
+ case LLModelPreview::MESH_OPTIMIZER_AUTO:
+ case LLModelPreview::MESH_OPTIMIZER_SLOPPY:
+ case LLModelPreview::MESH_OPTIMIZER_COMBINE:
+ mModelPreview->onLODMeshOptimizerParamCommit(lod, enforce_tri_limit, mode);
+ break;
+ default:
+ LL_ERRS() << "Only supposed to be called to generate models" << LL_ENDL;
+ break;
+ }
//refresh LoDs that reference this one
for (S32 i = lod - 1; i >= 0; --i)
@@ -1722,7 +1734,10 @@ void LLFloaterModelPreview::onLoDSourceCommit(S32 lod)
refresh();
LLComboBox* lod_source_combo = getChild<LLComboBox>("lod_source_" + lod_name[lod]);
- if (lod_source_combo->getCurrentIndex() == LLModelPreview::GENERATE)
+ S32 index = lod_source_combo->getCurrentIndex();
+ if (index == LLModelPreview::MESH_OPTIMIZER_AUTO
+ || index == LLModelPreview::MESH_OPTIMIZER_SLOPPY
+ || index == LLModelPreview::MESH_OPTIMIZER_COMBINE)
{ //rebuild LoD to update triangle counts
onLODParamCommit(lod, true);
}
@@ -1753,7 +1768,7 @@ void LLFloaterModelPreview::resetUploadOptions()
getChild<LLComboBox>("lod_source_" + lod_name[NUM_LOD - 1])->setCurrentByIndex(LLModelPreview::LOD_FROM_FILE);
for (S32 lod = 0; lod < NUM_LOD - 1; ++lod)
{
- getChild<LLComboBox>("lod_source_" + lod_name[lod])->setCurrentByIndex(LLModelPreview::GENERATE);
+ getChild<LLComboBox>("lod_source_" + lod_name[lod])->setCurrentByIndex(LLModelPreview::MESH_OPTIMIZER_AUTO);
childSetValue("lod_file_" + lod_name[lod], "");
}