diff options
author | leyla_linden <none@none> | 2011-01-12 13:44:55 -0800 |
---|---|---|
committer | leyla_linden <none@none> | 2011-01-12 13:44:55 -0800 |
commit | d51d294296ac0d53a46586c9868bb80e0468680b (patch) | |
tree | d2414e41ee80cee1e315722112639315d06937f6 /indra/newview/llfloatermodelpreview.cpp | |
parent | 3a47555dc27ffa74f5427e0ef44fa25b505f6c16 (diff) | |
parent | c5de64467f33fef564f930dea156f22d59631c19 (diff) |
Merge
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rwxr-xr-x | indra/newview/llfloatermodelpreview.cpp | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 8e08c6aa6c..8d5b3c648e 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -291,7 +291,7 @@ BOOL LLFloaterModelPreview::postBuild() childSetCommitCallback("lod_mode", onLODParamCommit, this); childSetCommitCallback("lod_error_threshold", onLODParamCommit, this); - childSetCommitCallback("lod_triangle_limit", onLODParamCommit, this); + childSetCommitCallback("lod_triangle_limit", onLODParamCommitTriangleLimit, this); childSetCommitCallback("build_operator", onLODParamCommit, this); childSetCommitCallback("queue_mode", onLODParamCommit, this); childSetCommitCallback("border_mode", onLODParamCommit, this); @@ -533,9 +533,14 @@ void LLFloaterModelPreview::onAutoFillCommit(LLUICtrl* ctrl, void* userdata) void LLFloaterModelPreview::onLODParamCommit(LLUICtrl* ctrl, void* userdata) { LLFloaterModelPreview* fp = (LLFloaterModelPreview*) userdata; - fp->mModelPreview->genLODs(fp->mModelPreview->mPreviewLOD); - fp->mModelPreview->updateStatusMessages(); - fp->mModelPreview->refresh(); + fp->mModelPreview->onLODParamCommit(false); +} + +//static +void LLFloaterModelPreview::onLODParamCommitTriangleLimit(LLUICtrl* ctrl, void* userdata) +{ + LLFloaterModelPreview* fp = (LLFloaterModelPreview*) userdata; + fp->mModelPreview->onLODParamCommit(true); } @@ -2843,7 +2848,7 @@ bool LLModelPreview::containsRiggedAsset( void ) } return false; } -void LLModelPreview::genLODs(S32 which_lod, U32 decimation) +void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_limit) { if (mBaseModel.empty()) { @@ -3074,7 +3079,17 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation) } else { - triangle_count = limit; + if (enforce_tri_limit) + { + triangle_count = limit; + } + else + { + for (S32 j=LLModel::LOD_HIGH; j>which_lod; --j) + { + triangle_count /= decimation; + } + } } mModel[lod].clear(); @@ -4340,6 +4355,13 @@ void LLModelPreview::textureLoadedCallback( BOOL success, LLViewerFetchedTexture preview->refresh(); } +void LLModelPreview::onLODParamCommit(bool enforce_tri_limit) +{ + genLODs(mPreviewLOD, 3, enforce_tri_limit); + updateStatusMessages(); + refresh(); +} + LLFloaterModelPreview::DecompRequest::DecompRequest(const std::string& stage, LLModel* mdl) { mStage = stage; |