summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatertools.cpp
diff options
context:
space:
mode:
authorSeth ProductEngine <slitovchuk@productengine.com>2011-08-19 02:20:07 +0300
committerSeth ProductEngine <slitovchuk@productengine.com>2011-08-19 02:20:07 +0300
commit27332685e9617f331866f8b11a6389eff88cc28e (patch)
tree0df909c7cf89c41801303196f947d18d157bb419 /indra/newview/llfloatertools.cpp
parent299a01470402de0327fc7f839e5937fc6b60bf63 (diff)
parent94f3432871d8512d04447cec3345694bf04537c9 (diff)
Merge
Diffstat (limited to 'indra/newview/llfloatertools.cpp')
-rw-r--r--indra/newview/llfloatertools.cpp54
1 files changed, 11 insertions, 43 deletions
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 00a0da3cde..48aeeafcfd 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -435,7 +435,8 @@ void LLFloaterTools::refresh()
if (sShowObjectCost)
{
std::string prim_cost_string;
- LLResMgr::getInstance()->getIntegerString(prim_cost_string, calcRenderCost());
+ S32 render_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectRenderCost();
+ LLResMgr::getInstance()->getIntegerString(prim_cost_string, render_cost);
getChild<LLUICtrl>("RenderingCost")->setTextArg("[COUNT]", prim_cost_string);
}
@@ -459,7 +460,6 @@ void LLFloaterTools::refresh()
std::ostringstream selection_info;
- bool show_adv_weight = gSavedSettings.getBOOL("ShowAdvancedBuilderOptions");
bool show_mesh_cost = gMeshRepo.meshRezEnabled();
if (show_mesh_cost)
@@ -475,22 +475,19 @@ void LLFloaterTools::refresh()
selection_info << getString("status_selectcount", selection_args);
- if (show_adv_weight)
- {
- selection_info << ",";
- childSetTextArg("selection_weight", "[PHYS_WEIGHT]", llformat("%.1f", link_phys_cost));
- childSetTextArg("selection_weight", "[DISP_WEIGHT]", llformat("%.1d", calcRenderCost()));
- }
- else
- {
- selection_info<<".";
- }
+ selection_info << ",";
+
+ S32 render_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectRenderCost();
+
+ childSetTextArg("selection_weight", "[PHYS_WEIGHT]", llformat("%.1f", link_phys_cost));
+ childSetTextArg("selection_weight", "[DISP_WEIGHT]", llformat("%.1d", render_cost));
+
getChild<LLTextBox>("selection_count")->setText(selection_info.str());
bool have_selection = !LLSelectMgr::getInstance()->getSelection()->isEmpty();
childSetVisible("selection_count", have_selection);
- childSetVisible("selection_weight", have_selection && show_adv_weight);
+ childSetVisible("selection_weight", have_selection);
childSetVisible("selection_empty", !have_selection);
}
@@ -761,7 +758,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
bool have_selection = !LLSelectMgr::getInstance()->getSelection()->isEmpty();
getChildView("selection_count")->setVisible(!land_visible && have_selection);
- getChildView("selection_weight")->setVisible(!land_visible && have_selection && gSavedSettings.getBOOL("ShowAdvancedBuilderOptions"));
+ getChildView("selection_weight")->setVisible(!land_visible && have_selection);
getChildView("selection_empty")->setVisible(!land_visible && !have_selection);
mTab->setVisible(!land_visible);
@@ -1014,35 +1011,6 @@ void LLFloaterTools::onClickGridOptions()
//floaterp->addDependentFloater(LLFloaterBuildOptions::getInstance(), FALSE);
}
-S32 LLFloaterTools::calcRenderCost()
-{
- S32 cost = 0;
- std::set<LLUUID> textures;
-
- for (LLObjectSelection::iterator selection_iter = LLSelectMgr::getInstance()->getSelection()->begin();
- selection_iter != LLSelectMgr::getInstance()->getSelection()->end();
- ++selection_iter)
- {
- LLSelectNode *select_node = *selection_iter;
- if (select_node)
- {
- LLViewerObject *vobj = select_node->getObject();
- if (vobj->getVolume())
- {
- LLVOVolume* volume = (LLVOVolume*) vobj;
-
- cost += volume->getRenderCost(textures);
- cost += textures.size() * LLVOVolume::ARC_TEXTURE_COST;
- textures.clear();
- }
- }
- }
-
-
- return cost;
-}
-
-
// static
void LLFloaterTools::setEditTool(void* tool_pointer)
{