diff options
author | Tofu Buzzard <no-email> | 2011-02-08 09:50:40 -0800 |
---|---|---|
committer | Tofu Buzzard <no-email> | 2011-02-08 09:50:40 -0800 |
commit | a9b38304e4184d56eb19140f139ea169f3a944b2 (patch) | |
tree | bb55b7a71948afd95a3d5cdf3c700fddb0e5e22d /indra/newview/llfloatertools.cpp | |
parent | 36feb9d5a467453763c1f4b41b1779ea711c410f (diff) | |
parent | 8b15ca8d6b9cf516670e66ee57591e79b898394d (diff) |
merge
Diffstat (limited to 'indra/newview/llfloatertools.cpp')
-rw-r--r-- | indra/newview/llfloatertools.cpp | 32 |
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) { |