From 1aa4e4e68d972ed118ebab14d01c829dc79cfc18 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Thu, 12 Nov 2009 20:54:00 -0500 Subject: 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 --- indra/newview/llfloatertools.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'indra/newview/llfloatertools.cpp') 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) { -- cgit v1.2.3 From 69f4b29761aa31d2ac46268eccf5b1cb7edf30f1 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Fri, 13 Nov 2009 11:11:11 -0500 Subject: EXT-2434 update rendering cost to reflect changes in avatar rendering finished the updates to avatar rendering cost and formalized the display of selected object render cost in the build tools floater. Both checkins reviewed by Vir. --- indra/newview/llfloatertools.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloatertools.cpp') diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 672160073e..9854d2594b 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -425,13 +425,14 @@ void LLFloaterTools::refresh() // calculate selection rendering cost std::string prim_cost_string; LLResMgr::getInstance()->getIntegerString(prim_cost_string, calcRenderCost()); - childSetTextArg("render_cost", "[COUNT]", prim_cost_string); + childSetTextArg("RenderingCost", "[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); childSetEnabled("prim_count", have_selection); + childSetEnabled("RenderingCost", have_selection); // Refresh child tabs mPanelPermissions->refresh(); @@ -562,6 +563,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) mBtnEdit ->setToggleState( edit_visible ); mRadioGroupEdit->setVisible( edit_visible ); + childSetVisible("RenderingCost", edit_visible || focus_visible || move_visible); if (mCheckSelectIndividual) { @@ -983,7 +985,7 @@ S32 LLFloaterTools::calcRenderCost() LLVOVolume *viewer_volume = (LLVOVolume*)select_node->getObject(); if (viewer_volume) { - cost += viewer_volume->getRenderCost(); + cost += viewer_volume->getRenderCost(); } } } -- cgit v1.2.3