summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatertools.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloatertools.cpp')
-rw-r--r--indra/newview/llfloatertools.cpp32
1 files changed, 30 insertions, 2 deletions
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index c9b99d83ff..f5e3d160fc 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -451,8 +451,7 @@ void LLFloaterTools::refresh()
if (sShowObjectCost)
{
std::string prim_cost_string;
- S32 cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectRenderCost();
- LLResMgr::getInstance()->getIntegerString(prim_cost_string, cost);
+ LLResMgr::getInstance()->getIntegerString(prim_cost_string, calcRenderCost());
getChild<LLUICtrl>("RenderingCost")->setTextArg("[COUNT]", prim_cost_string);
}
@@ -1010,6 +1009,35 @@ 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)
{