summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermodelpreview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp60
1 files changed, 48 insertions, 12 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 05a4b245d1..0f2924d8aa 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -283,6 +283,7 @@ BOOL LLFloaterModelPreview::postBuild()
childSetAction("lod_browse", onBrowseLOD, this);
+ childSetCommitCallback("cancel_btn", onCancel, this);
childSetCommitCallback("crease_angle", onGenerateNormalsCommit, this);
childSetCommitCallback("generate_normals", onGenerateNormalsCommit, this);
@@ -559,7 +560,14 @@ void LLFloaterModelPreview::draw()
LLMutexLock lock(mStatusLock);
childSetTextArg("status", "[STATUS]", mStatusMessage);
}
-
+ else
+ {
+ childSetVisible("Simplify", true);
+ childSetVisible("simplify_cancel", false);
+ childSetVisible("Decompose", true);
+ childSetVisible("decompose_cancel", false);
+ }
+
U32 resource_cost = mModelPreview->mResourceCost*10;
if (childGetValue("upload_textures").asBoolean())
@@ -735,7 +743,8 @@ void LLFloaterModelPreview::onPhysicsParamCommit(LLUICtrl* ctrl, void* data)
//static
void LLFloaterModelPreview::onPhysicsStageExecute(LLUICtrl* ctrl, void* data)
{
- LLCDStageData* stage = (LLCDStageData*) data;
+ LLCDStageData* stage_data = (LLCDStageData*) data;
+ std::string stage = stage_data->mName;
if (sInstance)
{
@@ -750,11 +759,22 @@ void LLFloaterModelPreview::onPhysicsStageExecute(LLUICtrl* ctrl, void* data)
for (S32 i = 0; i < sInstance->mModelPreview->mModel[LLModel::LOD_PHYSICS].size(); ++i)
{
LLModel* mdl = sInstance->mModelPreview->mModel[LLModel::LOD_PHYSICS][i];
- DecompRequest* request = new DecompRequest(stage->mName, mdl);
+ DecompRequest* request = new DecompRequest(stage, mdl);
sInstance->mCurRequest.insert(request);
gMeshRepo.mDecompThread->submitRequest(request);
}
}
+
+ if (stage == "Decompose")
+ {
+ sInstance->childSetVisible("Decompose", false);
+ sInstance->childSetVisible("decompose_cancel", true);
+ }
+ else if (stage == "Simplify")
+ {
+ sInstance->childSetVisible("Simplify", false);
+ sInstance->childSetVisible("simplify_cancel", true);
+ }
}
}
@@ -777,6 +797,15 @@ void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata)
sInstance->mModelPreview->setPhysicsFromLOD(which_mode);
}
+//static
+void LLFloaterModelPreview::onCancel(LLUICtrl* ctrl, void* data)
+{
+ if (sInstance)
+ {
+ sInstance->closeFloater(false);
+ }
+}
+
//static
void LLFloaterModelPreview::onPhysicsStageCancel(LLUICtrl* ctrl, void*data)
{
@@ -795,7 +824,9 @@ void LLFloaterModelPreview::initDecompControls()
{
LLSD key;
- childSetCommitCallback("cancel_btn", onPhysicsStageCancel, NULL);
+ childSetCommitCallback("simplify_cancel", onPhysicsStageCancel, NULL);
+ childSetCommitCallback("decompose_cancel", onPhysicsStageCancel, NULL);
+
childSetCommitCallback("physics_lod_combo", onPhysicsUseLOD, NULL);
childSetCommitCallback("physics_browse", onPhysicsBrowse, NULL);
@@ -2059,7 +2090,7 @@ LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp)
mBuildShareTolerance = 0.f;
mBuildQueueMode = GLOD_QUEUE_GREEDY;
mBuildBorderMode = GLOD_BORDER_UNLOCK;
- mBuildOperator = GLOD_OPERATOR_HALF_EDGE_COLLAPSE;
+ mBuildOperator = GLOD_OPERATOR_EDGE_COLLAPSE;
mViewOption["show_textures"] = false;
@@ -2767,7 +2798,9 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation)
lod_mode = GLOD_TRIANGLE_BUDGET;
if (which_lod != -1)
{
- limit = mFMP->childGetValue("lod_triangle_limit").asInteger();
+ //SH-632 take budget as supplied limit+1 to prevent GLOD from creating a smaller
+ //decimation when the given decimation is possible
+ limit = mFMP->childGetValue("lod_triangle_limit").asInteger(); //+1;
}
}
else
@@ -2785,11 +2818,11 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation)
if (build_operator == 0)
{
- build_operator = GLOD_OPERATOR_HALF_EDGE_COLLAPSE;
+ build_operator = GLOD_OPERATOR_EDGE_COLLAPSE;
}
else
{
- build_operator = GLOD_OPERATOR_EDGE_COLLAPSE;
+ build_operator = GLOD_OPERATOR_HALF_EDGE_COLLAPSE;
}
U32 queue_mode=0;
@@ -4276,11 +4309,14 @@ void LLFloaterModelPreview::DecompRequest::completed()
if (sInstance)
{
- if (sInstance->mModelPreview)
+ if (mContinue)
{
- sInstance->mModelPreview->mPhysicsMesh[mModel] = mHullMesh;
- sInstance->mModelPreview->mDirty = true;
- LLFloaterModelPreview::sInstance->mModelPreview->refresh();
+ if (sInstance->mModelPreview)
+ {
+ sInstance->mModelPreview->mPhysicsMesh[mModel] = mHullMesh;
+ sInstance->mModelPreview->mDirty = true;
+ LLFloaterModelPreview::sInstance->mModelPreview->refresh();
+ }
}
sInstance->mCurRequest.erase(this);