summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatertools.cpp
diff options
context:
space:
mode:
authorNyx (Neal Orman) <nyx@lindenlab.com>2009-11-12 20:54:00 -0500
committerNyx (Neal Orman) <nyx@lindenlab.com>2009-11-12 20:54:00 -0500
commit1aa4e4e68d972ed118ebab14d01c829dc79cfc18 (patch)
tree823ff4c3326c303e6ce1f7f0dfb88de27a09591a /indra/newview/llfloatertools.cpp
parent31ceac828920bac39c330ba1eb6b7f7d9cc918b1 (diff)
EXT-2434 update avatar rendering cost
First crack at updating the rendering cost calculation for avatars to account for the possibility of invisible avatars. Also generalized rendering cost of attachments to be more general - added debug code to build floater will be post-reviewed
Diffstat (limited to 'indra/newview/llfloatertools.cpp')
-rw-r--r--indra/newview/llfloatertools.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 3c3dfb760e..672160073e 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -422,6 +422,12 @@ void LLFloaterTools::refresh()
LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount());
childSetTextArg("prim_count", "[COUNT]", prim_count_string);
+ // calculate selection rendering cost
+ std::string prim_cost_string;
+ LLResMgr::getInstance()->getIntegerString(prim_cost_string, calcRenderCost());
+ childSetTextArg("render_cost", "[COUNT]", prim_cost_string);
+
+
// disable the object and prim counts if nothing selected
bool have_selection = ! LLSelectMgr::getInstance()->getSelection()->isEmpty();
childSetEnabled("obj_count", have_selection);
@@ -964,6 +970,27 @@ void LLFloaterTools::onClickGridOptions()
//floaterp->addDependentFloater(LLFloaterBuildOptions::getInstance(), FALSE);
}
+S32 LLFloaterTools::calcRenderCost()
+{
+ S32 cost = 0;
+ 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)
+ {
+ LLVOVolume *viewer_volume = (LLVOVolume*)select_node->getObject();
+ if (viewer_volume)
+ {
+ cost += viewer_volume->getRenderCost();
+ }
+ }
+ }
+
+ return cost;
+}
+
// static
void LLFloaterTools::setEditTool(void* tool_pointer)
{