From 10a770047d90045e882a65e5347da3530b189c42 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 11 Jun 2021 19:10:43 +0300 Subject: SL-15297 WIP Implement performance floater --- indra/newview/CMakeLists.txt | 2 + indra/newview/llavatarrendernotifier.cpp | 2 + indra/newview/llavatarrendernotifier.h | 3 + indra/newview/llfloaterperformance.cpp | 216 ++++++++++ indra/newview/llfloaterperformance.h | 65 +++ indra/newview/llnamelistctrl.cpp | 39 +- indra/newview/llnamelistctrl.h | 23 +- indra/newview/llviewerfloaterreg.cpp | 2 + indra/newview/skins/default/colors.xml | 6 + .../skins/default/textures/icons/green_dot.png | Bin 0 -> 18614 bytes indra/newview/skins/default/textures/textures.xml | 2 + .../skins/default/xui/en/floater_performance.xml | 447 +++++++++++++++++++++ indra/newview/skins/default/xui/en/menu_viewer.xml | 7 + .../default/xui/en/panel_performance_huds.xml | 112 ++++++ .../default/xui/en/panel_performance_nearby.xml | 161 ++++++++ .../xui/en/panel_performance_preferences.xml | 257 ++++++++++++ .../default/xui/en/panel_performance_scripts.xml | 82 ++++ .../xui/en/panel_performance_troubleshooting.xml | 190 +++++++++ 18 files changed, 1602 insertions(+), 14 deletions(-) create mode 100644 indra/newview/llfloaterperformance.cpp create mode 100644 indra/newview/llfloaterperformance.h create mode 100644 indra/newview/skins/default/textures/icons/green_dot.png create mode 100644 indra/newview/skins/default/xui/en/floater_performance.xml create mode 100644 indra/newview/skins/default/xui/en/panel_performance_huds.xml create mode 100644 indra/newview/skins/default/xui/en/panel_performance_nearby.xml create mode 100644 indra/newview/skins/default/xui/en/panel_performance_preferences.xml create mode 100644 indra/newview/skins/default/xui/en/panel_performance_scripts.xml create mode 100644 indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index fc8d8b805b..1ec1e2cc24 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -286,6 +286,7 @@ set(viewer_SOURCE_FILES llfloaterpathfindinglinksets.cpp llfloaterpathfindingobjects.cpp llfloaterpay.cpp + llfloaterperformance.cpp llfloaterperms.cpp llfloaterpostprocess.cpp llfloaterpreference.cpp @@ -924,6 +925,7 @@ set(viewer_HEADER_FILES llfloaterpathfindinglinksets.h llfloaterpathfindingobjects.h llfloaterpay.h + llfloaterperformance.h llfloaterperms.h llfloaterpostprocess.h llfloaterpreference.h diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index 94584a623b..4fd57c7341 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -298,6 +298,8 @@ void LLHUDRenderNotifier::updateNotificationHUD(hud_complexity_list_t complexity return; } + mHUDComplexityList = complexity; + // TODO: // Find a way to show message with list of issues, but without making it too large // and intrusive. diff --git a/indra/newview/llavatarrendernotifier.h b/indra/newview/llavatarrendernotifier.h index ec17b3d9e6..3fd7a32d84 100644 --- a/indra/newview/llavatarrendernotifier.h +++ b/indra/newview/llavatarrendernotifier.h @@ -121,6 +121,8 @@ public: void updateNotificationHUD(hud_complexity_list_t complexity); bool isNotificationVisible(); + hud_complexity_list_t getHUDComplexityList() { return mHUDComplexityList; } + private: enum EWarnLevel { @@ -141,6 +143,7 @@ private: EWarnLevel mReportedHUDWarning; LLHUDComplexity mLatestHUDComplexity; LLFrameTimer mHUDPopUpDelayTimer; + hud_complexity_list_t mHUDComplexityList; }; #endif /* ! defined(LL_llavatarrendernotifier_H) */ diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp new file mode 100644 index 0000000000..8024d1539c --- /dev/null +++ b/indra/newview/llfloaterperformance.cpp @@ -0,0 +1,216 @@ +/** + * @file llfloaterperformance.cpp + * + * $LicenseInfo:firstyear=2021&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2021, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llfloaterperformance.h" + +#include "llappearancemgr.h" +#include "llavatarrendernotifier.h" +#include "llfeaturemanager.h" +#include "llfloaterreg.h" +#include "llnamelistctrl.h" +#include "lltextbox.h" +#include "llvoavatar.h" + + +LLFloaterPerformance::LLFloaterPerformance(const LLSD& key) + : LLFloater(key) +{ + +} + +LLFloaterPerformance::~LLFloaterPerformance() +{ +} + +BOOL LLFloaterPerformance::postBuild() +{ + mMainPanel = getChild("panel_performance_main"); + mTroubleshootingPanel = getChild("panel_performance_troubleshooting"); + mNearbyPanel = getChild("panel_performance_nearby"); + mScriptsPanel = getChild("panel_performance_scripts"); + mPreferencesPanel = getChild("panel_performance_preferences"); + mHUDsPanel = getChild("panel_performance_huds"); + + getChild("troubleshooting_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mTroubleshootingPanel)); + getChild("nearby_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mNearbyPanel)); + getChild("scripts_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mScriptsPanel)); + getChild("preferences_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mPreferencesPanel)); + getChild("huds_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mHUDsPanel)); + + initBackBtn(mTroubleshootingPanel); + initBackBtn(mNearbyPanel); + initBackBtn(mScriptsPanel); + initBackBtn(mPreferencesPanel); + initBackBtn(mHUDsPanel); + + + mHUDsPanel->getChild("refresh_list_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::populateHUDList, this)); + + mHUDList = mHUDsPanel->getChild("hud_list"); + mHUDList->setNameListType(LLNameListCtrl::SPECIAL); + mHUDList->setHoverIconName("StopReload_Off"); + mHUDList->setIconClickedCallback(boost::bind(&LLFloaterPerformance::detachItem, this, _1)); + + mPreferencesPanel->getChild("advanced_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickAdvanced, this)); + mPreferencesPanel->getChild("defaults_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickRecommended, this)); + + mNearbyPanel->getChild("exceptions_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickExceptions, this)); + mNearbyList = mNearbyPanel->getChild("nearby_list"); + + return TRUE; +} + +void LLFloaterPerformance::showSelectedPanel(LLPanel* selected_panel) +{ + selected_panel->setVisible(TRUE); + mMainPanel->setVisible(FALSE); + + if (mHUDsPanel == selected_panel) + { + populateHUDList(); + } + else if (mNearbyPanel == selected_panel) + { + populateNearbyList(); + } +} + +void LLFloaterPerformance::showMainPanel() +{ + mTroubleshootingPanel->setVisible(FALSE); + mNearbyPanel->setVisible(FALSE); + mScriptsPanel->setVisible(FALSE); + mHUDsPanel->setVisible(FALSE); + mPreferencesPanel->setVisible(FALSE); + mMainPanel->setVisible(TRUE); +} + +void LLFloaterPerformance::initBackBtn(LLPanel* panel) +{ + panel->getChild("back_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::showMainPanel, this)); + + panel->getChild("back_lbl")->setShowCursorHand(false); + panel->getChild("back_lbl")->setSoundFlags(LLView::MOUSE_UP); + panel->getChild("back_lbl")->setClickedCallback(boost::bind(&LLFloaterPerformance::showMainPanel, this)); +} + +void LLFloaterPerformance::populateHUDList() +{ + mHUDList->clearRows(); + mHUDList->updateColumns(true); + + hud_complexity_list_t complexity_list = LLHUDRenderNotifier::getInstance()->getHUDComplexityList(); + + hud_complexity_list_t::iterator iter = complexity_list.begin(); + hud_complexity_list_t::iterator end = complexity_list.end(); + + for (; iter != end; ++iter) + { + LLHUDComplexity hud_object_complexity = *iter; + + LLSD item; + item["special_id"] = hud_object_complexity.objectId; + item["target"] = LLNameListCtrl::SPECIAL; + LLSD& row = item["columns"]; + row[0]["column"] = "complex_visual"; + row[0]["type"] = "text"; + row[0]["value"] = "*"; + + row[1]["column"] = "complex_value"; + row[1]["type"] = "text"; + row[1]["value"] = std::to_string(hud_object_complexity.objectsCost); + row[1]["font"]["name"] = "SANSSERIF"; + + row[2]["column"] = "name"; + row[2]["type"] = "text"; + row[2]["value"] = hud_object_complexity.objectName; + row[2]["font"]["name"] = "SANSSERIF"; + + mHUDList->addElement(item); + } + + mHUDsPanel->getChild("huds_value")->setValue(std::to_string(complexity_list.size())); +} + +void LLFloaterPerformance::populateNearbyList() +{ + mNearbyList->clearRows(); + mNearbyList->updateColumns(true); + + std::vector::iterator char_iter = LLCharacter::sInstances.begin(); + while (char_iter != LLCharacter::sInstances.end()) + { + LLVOAvatar* avatar = dynamic_cast(*char_iter); + if (avatar && !avatar->isDead() && !avatar->isControlAvatar()) + { + avatar->calculateUpdateRenderComplexity(); + + LLSD item; + item["id"] = avatar->getID(); + LLSD& row = item["columns"]; + row[0]["column"] = "complex_visual"; + row[0]["type"] = "text"; + row[0]["value"] = "*"; + + row[1]["column"] = "complex_value"; + row[1]["type"] = "text"; + row[1]["value"] = std::to_string( avatar->getVisualComplexity()); + row[1]["font"]["name"] = "SANSSERIF"; + + row[2]["column"] = "name"; + row[2]["type"] = "text"; + row[2]["value"] = avatar->getFullname(); + row[2]["font"]["name"] = "SANSSERIF"; + + mNearbyList->addElement(item); + } + char_iter++; + } + +} + +void LLFloaterPerformance::detachItem(const LLUUID& item_id) +{ + LLAppearanceMgr::instance().removeItemFromAvatar(item_id); + mHUDList->removeNameItem(item_id); +} + +void LLFloaterPerformance::onClickRecommended() +{ + LLFeatureManager::getInstance()->applyRecommendedSettings(); +} + +void LLFloaterPerformance::onClickAdvanced() +{ + LLFloaterReg::showInstance("prefs_graphics_advanced"); +} + +void LLFloaterPerformance::onClickExceptions() +{ + LLFloaterReg::showInstance("avatar_render_settings"); +} + +// EOF diff --git a/indra/newview/llfloaterperformance.h b/indra/newview/llfloaterperformance.h new file mode 100644 index 0000000000..a70a328d3a --- /dev/null +++ b/indra/newview/llfloaterperformance.h @@ -0,0 +1,65 @@ +/** + * @file llfloaterperformance.h + * + * $LicenseInfo:firstyear=2021&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2021, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERPERFORMANCE_H +#define LL_LLFLOATERPERFORMANCE_H + +#include "llfloater.h" + +class LLNameListCtrl; + +class LLFloaterPerformance : public LLFloater +{ +public: + LLFloaterPerformance(const LLSD& key); + virtual ~LLFloaterPerformance(); + + /*virtual*/ BOOL postBuild(); + + void showSelectedPanel(LLPanel* selected_panel); + void showMainPanel(); + + void detachItem(const LLUUID& item_id); + +private: + void initBackBtn(LLPanel* panel); + void populateHUDList(); + void populateNearbyList(); + + void onClickAdvanced(); + void onClickRecommended(); + void onClickExceptions(); + + LLPanel* mMainPanel; + LLPanel* mTroubleshootingPanel; + LLPanel* mNearbyPanel; + LLPanel* mScriptsPanel; + LLPanel* mHUDsPanel; + LLPanel* mPreferencesPanel; + LLNameListCtrl* mHUDList; + LLNameListCtrl* mNearbyList; +}; + +#endif // LL_LLFLOATERPERFORMANCE_H diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 3209d23e43..e1bf9b1a17 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -67,7 +67,9 @@ LLNameListCtrl::LLNameListCtrl(const LLNameListCtrl::Params& p) mNameColumn(p.name_column.column_name), mAllowCallingCardDrop(p.allow_calling_card_drop), mShortNames(p.short_names), - mPendingLookupsRemaining(0) + mPendingLookupsRemaining(0), + mHoverIconName("Info_Small"), + mNameListType(INDIVIDUAL) {} // public @@ -134,7 +136,12 @@ BOOL LLNameListCtrl::handleDragAndDrop( void LLNameListCtrl::showInspector(const LLUUID& avatar_id, bool is_group, bool is_experience) { - if(is_experience) + if (isSpecialType()) + { + mIconClickedSignal(avatar_id); + return; + } + if(is_experience) { LLFloaterReg::showInstance("experience_profile", avatar_id, true); return; @@ -215,14 +222,16 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) S32 column_index = getColumnIndexFromOffset(x); LLNameListItem* hit_item = dynamic_cast(hitItem(x, y)); LLFloater* floater = gFloaterView->getParentFloater(this); - if (floater + + + if (floater && floater->isFrontmost() && hit_item - && column_index == mNameColumnIndex) + && ((column_index == mNameColumnIndex) || isSpecialType())) { - // ...this is the column with the avatar name - LLUUID avatar_id = hit_item->getUUID(); - if (avatar_id.notNull()) + // ...this is the column with the avatar name + LLUUID item_id = isSpecialType() ? hit_item->getSpecialID() : hit_item->getUUID(); + if (item_id.notNull()) { // ...valid avatar id @@ -230,13 +239,13 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) if (hit_cell) { S32 row_index = getItemIndex(hit_item); - LLRect cell_rect = getCellRect(row_index, column_index); + LLRect cell_rect = getCellRect(row_index, isSpecialType() ? getNumColumns() - 1 : column_index); // Convert rect local to screen coordinates LLRect sticky_rect; localRectToScreen(cell_rect, &sticky_rect); // Spawn at right side of cell - LLPointer icon = LLUI::getUIImage("Info_Small"); + LLPointer icon = LLUI::getUIImage(mHoverIconName); S32 screenX = sticky_rect.mRight - info_icon_size; S32 screenY = sticky_rect.mTop - (sticky_rect.getHeight() - icon->getHeight()) / 2; LLCoordGL pos(screenX, screenY); @@ -250,7 +259,7 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) LLToolTip::Params params; params.background_visible(false); - params.click_callback(boost::bind(&LLNameListCtrl::showInspector, this, avatar_id, is_group, is_experience)); + params.click_callback(boost::bind(&LLNameListCtrl::showInspector, this, item_id, is_group, is_experience)); params.delay_time(0.0f); // spawn instantly on hover params.image(icon); params.message(""); @@ -321,6 +330,7 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( // use supplied name by default std::string fullname = name_item.name; + switch(name_item.target) { case GROUP: @@ -339,8 +349,10 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( } break; case SPECIAL: - // just use supplied name - break; + { + item->setSpecialID(name_item.special_id()); + return item; + } case INDIVIDUAL: { LLAvatarName av_name; @@ -420,7 +432,8 @@ void LLNameListCtrl::removeNameItem(const LLUUID& agent_id) for (item_list::iterator it = getItemList().begin(); it != getItemList().end(); it++) { LLScrollListItem* item = *it; - if (item->getUUID() == agent_id) + LLUUID cur_id = isSpecialType() ? dynamic_cast(item)->getSpecialID() : item->getUUID(); + if (cur_id == agent_id) { idx = getItemIndex(item); break; diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index ef0be135e6..1a31b1cc10 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -46,6 +46,8 @@ public: void setIsGroup(bool is_group) { mIsGroup = is_group; } bool isExperience() const { return mIsExperience; } void setIsExperience(bool is_experience) { mIsExperience = is_experience; } + void setSpecialID(const LLUUID& special_id) { mSpecialID = special_id; } + const LLUUID& getSpecialID() const { return mSpecialID; } protected: friend class LLNameListCtrl; @@ -68,6 +70,8 @@ protected: private: bool mIsGroup; bool mIsExperience; + + LLUUID mSpecialID; }; @@ -95,10 +99,12 @@ public: { Optional name; Optional target; + Optional special_id; NameItem() : name("name"), - target("target", INDIVIDUAL) + target("target", INDIVIDUAL), + special_id("special_id", LLUUID()) {} }; @@ -170,6 +176,12 @@ public: /*virtual*/ void updateColumns(bool force_update); /*virtual*/ void mouseOverHighlightNthItem( S32 index ); + + bool isSpecialType() { return (mNameListType == SPECIAL); } + + void setNameListType(e_name_type type) { mNameListType = type; } + void setHoverIconName(std::string icon_name) { mHoverIconName = icon_name; } + private: void showInspector(const LLUUID& avatar_id, bool is_group, bool is_experience = false); void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name, std::string suffix, std::string prefix, LLHandle item); @@ -186,6 +198,11 @@ private: S32 mPendingLookupsRemaining; namelist_complete_signal_t mNameListCompleteSignal; + + std::string mHoverIconName; + e_name_type mNameListType; + + boost::signals2::signal mIconClickedSignal; public: boost::signals2::connection setOnNameListCompleteCallback(boost::function onNameListCompleteCallback) @@ -193,6 +210,10 @@ public: return mNameListCompleteSignal.connect(onNameListCompleteCallback); } + boost::signals2::connection setIconClickedCallback(boost::function cb) + { + return mIconClickedSignal.connect(cb); + } }; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 414ae1fad6..eabdb67188 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -102,6 +102,7 @@ #include "llfloaterpathfindingconsole.h" #include "llfloaterpathfindinglinksets.h" #include "llfloaterpay.h" +#include "llfloaterperformance.h" #include "llfloaterperms.h" #include "llfloaterpostprocess.h" #include "llfloaterpreference.h" @@ -299,6 +300,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("pathfinding_linksets", "floater_pathfinding_linksets.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("pathfinding_console", "floater_pathfinding_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("people", "floater_people.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("performance", "floater_performance.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("perms_default", "floater_perms_default.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("places", "floater_places.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index efe8102f83..3816bf7e9a 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -963,4 +963,10 @@ + + diff --git a/indra/newview/skins/default/textures/icons/green_dot.png b/indra/newview/skins/default/textures/icons/green_dot.png new file mode 100644 index 0000000000..02c07810c2 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/green_dot.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index a875c4e848..51bb91cbf9 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -234,6 +234,8 @@ with the same filename but different name + + diff --git a/indra/newview/skins/default/xui/en/floater_performance.xml b/indra/newview/skins/default/xui/en/floater_performance.xml new file mode 100644 index 0000000000..42269ba34a --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_performance.xml @@ -0,0 +1,447 @@ + + + + + Current FPS + + + 75.2 + + + + + + + + Client: + + + Network: + + + Server: + + + Normal + + + Normal + + + Normal + + + + General troubleshooting + + + Choose among common problems and see what you can do. + + + + + + Avatars nearby: + + + 42 (very high) + + + Click to review avatars and choose a complexity limit. + + + + + + This location is + + + very complex + + + Try changing graphics quality or draw distance. + + + + + + Your avatar: + + + 12 scripts + + + Removing high-impact attachments may improve graphics speed. + + + + + + Your HUDs: + + + 7 + + + Removing HUDs you are not using can improve graphics speed. + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 0a50ff089f..f275b309a1 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -238,6 +238,13 @@ + + + + + + + Back + + + HUDs displayed: + + + 7 + + + If there are any you don't need, detaching them may improve graphics speed. + + + Note: Using a HUD's minimize button does not save memory. + + + + + + + + + Back + + + Avatars within draw distance: + + + 42 (very high) + + + Some avatars nearby are slow to display. Choosing complexity limit may help graphics speed. + + + + + + 0 + + + + + + + + You can also right-click on an avatar to control display. + + + + + + + diff --git a/indra/newview/skins/default/xui/en/panel_performance_preferences.xml b/indra/newview/skins/default/xui/en/panel_performance_preferences.xml new file mode 100644 index 0000000000..81605b35a2 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_performance_preferences.xml @@ -0,0 +1,257 @@ + + + + + Back + + + This location is very complex + + + While you are here, you may want to reduce graphics quality or draw distance. + + + + Graphics quality + + + Fastest + + + + + Best quality + + + Enhancements + + + + + + + Draw distance + + + Faster + + + + m + + + Farther + + + Regions are 256 m x 256 m. + + + To zoom out and see long distances, increase the draw distance. + + + If you are socializing in a small area, decrease the draw distance. + + + + + Back + + + Avatar attachment scripts: + + + 12 + + + These attachments contain scripts (embedded apps) that use memory. + + + If there are any you don't need, detaching them may improve graphics speed. + + diff --git a/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml b/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml new file mode 100644 index 0000000000..d942580880 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml @@ -0,0 +1,190 @@ + + + + + Back + + + Fixes for common problems + + + Some problems result from the complexity of the location where you are. All you can do is leave. + + + Rubberbanding + + + When you walk, your avatar may be pulled backward again and again. + + + Fix: XXXXXXX + + + Texture thrashing + + + On objects near you, you may see their surfaces get blurry, then sharp, then blurry again. + + + Fix: XXXXXXX + + + Avatars are not moving smoothly + + + Lorem ipsum dolor sit amet. + + + Fix: XXXXXXX + + + Will a better graphics card or new computer help? + + + Lorem ipsum dolor sit amet. + + + Fix: XXXXXXX + + -- cgit v1.2.3 From 0914f5c48f777705bdc57188e7372707f7977e5a Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 15 Jun 2021 19:25:08 +0300 Subject: SL-15297 WIP Implement performance floater #2 --- indra/newview/CMakeLists.txt | 2 + indra/newview/llfloaterperformance.cpp | 36 +- indra/newview/llfloaterperformance.h | 5 + indra/newview/llfloaterpreference.cpp | 409 +----------------- indra/newview/llfloaterpreference.h | 31 +- .../llfloaterpreferencesgraphicsadvanced.cpp | 466 +++++++++++++++++++++ .../newview/llfloaterpreferencesgraphicsadvanced.h | 63 +++ indra/newview/llviewerfloaterreg.cpp | 1 + .../default/xui/en/panel_performance_nearby.xml | 3 - 9 files changed, 575 insertions(+), 441 deletions(-) create mode 100644 indra/newview/llfloaterpreferencesgraphicsadvanced.cpp create mode 100644 indra/newview/llfloaterpreferencesgraphicsadvanced.h (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 1ec1e2cc24..888796015b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -290,6 +290,7 @@ set(viewer_SOURCE_FILES llfloaterperms.cpp llfloaterpostprocess.cpp llfloaterpreference.cpp + llfloaterpreferencesgraphicsadvanced.cpp llfloaterpreferenceviewadvanced.cpp llfloaterpreviewtrash.cpp llfloaterproperties.cpp @@ -929,6 +930,7 @@ set(viewer_HEADER_FILES llfloaterperms.h llfloaterpostprocess.h llfloaterpreference.h + llfloaterpreferencesgraphicsadvanced.h llfloaterpreferenceviewadvanced.h llfloaterpreviewtrash.h llfloaterproperties.h diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index 8024d1539c..a44c3a262d 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -27,11 +27,15 @@ #include "llfloaterperformance.h" #include "llappearancemgr.h" +#include "llavataractions.h" #include "llavatarrendernotifier.h" #include "llfeaturemanager.h" #include "llfloaterreg.h" #include "llnamelistctrl.h" +#include "llfloaterpreference.h" // LLAvatarComplexityControls +#include "llsliderctrl.h" #include "lltextbox.h" +#include "lltrans.h" #include "llvoavatar.h" @@ -43,6 +47,7 @@ LLFloaterPerformance::LLFloaterPerformance(const LLSD& key) LLFloaterPerformance::~LLFloaterPerformance() { + mComplexityChangedSignal.disconnect(); } BOOL LLFloaterPerformance::postBuild() @@ -79,7 +84,11 @@ BOOL LLFloaterPerformance::postBuild() mNearbyPanel->getChild("exceptions_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickExceptions, this)); mNearbyList = mNearbyPanel->getChild("nearby_list"); - + + updateComplexityText(); + mComplexityChangedSignal = gSavedSettings.getControl("IndirectMaxComplexity")->getCommitSignal()->connect(boost::bind(&LLFloaterPerformance::updateComplexityText, this)); + mNearbyPanel->getChild("IndirectMaxComplexity")->setCommitCallback(boost::bind(&LLFloaterPerformance::updateMaxComplexity, this)); + return TRUE; } @@ -151,6 +160,7 @@ void LLFloaterPerformance::populateHUDList() mHUDList->addElement(item); } + mHUDList->sortByColumnIndex(1, FALSE); mHUDsPanel->getChild("huds_value")->setValue(std::to_string(complexity_list.size())); } @@ -185,10 +195,19 @@ void LLFloaterPerformance::populateNearbyList() row[2]["value"] = avatar->getFullname(); row[2]["font"]["name"] = "SANSSERIF"; - mNearbyList->addElement(item); + LLScrollListItem* av_item = mNearbyList->addElement(item); + if(av_item && LLAvatarActions::isFriend(avatar->getID())) + { + LLScrollListText* name_text = dynamic_cast(av_item->getColumn(2)); + if (name_text) + { + name_text->setColor(LLUIColorTable::instance().getColor("ConversationFriendColor")); + } + } } char_iter++; } + mNearbyList->sortByColumnIndex(1, FALSE); } @@ -213,4 +232,17 @@ void LLFloaterPerformance::onClickExceptions() LLFloaterReg::showInstance("avatar_render_settings"); } +void LLFloaterPerformance::updateMaxComplexity() +{ + LLAvatarComplexityControls::updateMax( + mNearbyPanel->getChild("IndirectMaxComplexity"), + mNearbyPanel->getChild("IndirectMaxComplexityText")); +} + +void LLFloaterPerformance::updateComplexityText() +{ + LLAvatarComplexityControls::setText(gSavedSettings.getU32("RenderAvatarMaxComplexity"), + mNearbyPanel->getChild("IndirectMaxComplexityText", true)); +} + // EOF diff --git a/indra/newview/llfloaterperformance.h b/indra/newview/llfloaterperformance.h index a70a328d3a..0cba07f21e 100644 --- a/indra/newview/llfloaterperformance.h +++ b/indra/newview/llfloaterperformance.h @@ -52,6 +52,9 @@ private: void onClickRecommended(); void onClickExceptions(); + void updateMaxComplexity(); + void updateComplexityText(); + LLPanel* mMainPanel; LLPanel* mTroubleshootingPanel; LLPanel* mNearbyPanel; @@ -60,6 +63,8 @@ private: LLPanel* mPreferencesPanel; LLNameListCtrl* mHUDList; LLNameListCtrl* mNearbyList; + + boost::signals2::connection mComplexityChangedSignal; }; #endif // LL_LLFLOATERPERFORMANCE_H diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 6bf2136f60..1ab6621c4c 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -50,6 +50,7 @@ #include "llfloaterreg.h" #include "llfloaterabout.h" #include "llfavoritesbar.h" +#include "llfloaterpreferencesgraphicsadvanced.h" #include "llfloatersidepanelcontainer.h" #include "llfloaterimsession.h" #include "llkeyboard.h" @@ -74,7 +75,6 @@ #include "llviewereventrecorder.h" #include "llviewermessage.h" #include "llviewerwindow.h" -#include "llviewershadermgr.h" #include "llviewerthrottle.h" #include "llvoavatarself.h" #include "llvotree.h" @@ -98,11 +98,9 @@ #include "lltextbox.h" #include "llui.h" #include "llviewerobjectlist.h" -#include "llvoavatar.h" #include "llvovolume.h" #include "llwindow.h" #include "llworld.h" -#include "pipeline.h" #include "lluictrlfactory.h" #include "llviewermedia.h" #include "llpluginclassmedia.h" @@ -115,8 +113,6 @@ #include "llpresetsmanager.h" #include "llviewercontrol.h" #include "llpresetsmanager.h" -#include "llfeaturemanager.h" -#include "llviewertexturelist.h" #include "llsearchableui.h" @@ -751,33 +747,6 @@ void LLFloaterPreference::onRenderOptionEnable() refreshEnabledGraphics(); } -void LLFloaterPreferenceGraphicsAdvanced::onRenderOptionEnable() -{ - LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); - if (instance) - { - instance->refresh(); - } - - refreshEnabledGraphics(); -} - -void LLFloaterPreferenceGraphicsAdvanced::onAdvancedAtmosphericsEnable() -{ - LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); - if (instance) - { - instance->refresh(); - } - - refreshEnabledGraphics(); -} - -void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledGraphics() -{ - refreshEnabledState(); -} - void LLFloaterPreference::onAvatarImpostorsEnable() { refreshEnabledGraphics(); @@ -1216,124 +1185,6 @@ void LLFloaterPreference::refreshEnabledState() getChildView("block_list")->setEnabled(LLLoginInstance::getInstance()->authSuccess()); } -void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() -{ - LLComboBox* ctrl_reflections = getChild("Reflections"); - LLTextBox* reflections_text = getChild("ReflectionsText"); - - // Reflections - BOOL reflections = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps; - ctrl_reflections->setEnabled(reflections); - reflections_text->setEnabled(reflections); - - // Transparent Water - LLCheckBoxCtrl* transparent_water_ctrl = getChild("TransparentWater"); - - // Bump & Shiny - LLCheckBoxCtrl* bumpshiny_ctrl = getChild("BumpShiny"); - bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump"); - bumpshiny_ctrl->setEnabled(bumpshiny ? TRUE : FALSE); - - // Avatar Mode - // Enable Avatar Shaders - LLCheckBoxCtrl* ctrl_avatar_vp = getChild("AvatarVertexProgram"); - // Avatar Render Mode - LLCheckBoxCtrl* ctrl_avatar_cloth = getChild("AvatarCloth"); - - bool avatar_vp_enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP"); - if (LLViewerShaderMgr::sInitialized) - { - S32 max_avatar_shader = LLViewerShaderMgr::instance()->mMaxAvatarShaderLevel; - avatar_vp_enabled = (max_avatar_shader > 0) ? TRUE : FALSE; - } - - ctrl_avatar_vp->setEnabled(avatar_vp_enabled); - - if (gSavedSettings.getBOOL("RenderAvatarVP") == FALSE) - { - ctrl_avatar_cloth->setEnabled(FALSE); - } - else - { - ctrl_avatar_cloth->setEnabled(TRUE); - } - - // Vertex Shaders, Global Shader Enable - // SL-12594 Basic shaders are always enabled. DJH TODO clean up now-orphaned state handling code - LLSliderCtrl* terrain_detail = getChild("TerrainDetail"); // can be linked with control var - LLTextBox* terrain_text = getChild("TerrainDetailText"); - - terrain_detail->setEnabled(FALSE); - terrain_text->setEnabled(FALSE); - - // WindLight - LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); - LLSliderCtrl* sky = getChild("SkyMeshDetail"); - LLTextBox* sky_text = getChild("SkyMeshDetailText"); - ctrl_wind_light->setEnabled(TRUE); - sky->setEnabled(TRUE); - sky_text->setEnabled(TRUE); - - //Deferred/SSAO/Shadows - LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); - - BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && - ((bumpshiny_ctrl && bumpshiny_ctrl->get()) ? TRUE : FALSE) && - ((transparent_water_ctrl && transparent_water_ctrl->get()) ? TRUE : FALSE) && - gGLManager.mHasFramebufferObject && - gSavedSettings.getBOOL("RenderAvatarVP") && - (ctrl_wind_light->get()) ? TRUE : FALSE; - - ctrl_deferred->setEnabled(enabled); - - LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); - LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); - LLComboBox* ctrl_shadow = getChild("ShadowDetail"); - LLTextBox* shadow_text = getChild("RenderShadowDetailText"); - - // note, okay here to get from ctrl_deferred as it's twin, ctrl_deferred2 will alway match it - enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (ctrl_deferred->get() ? TRUE : FALSE); - - ctrl_deferred->set(gSavedSettings.getBOOL("RenderDeferred")); - - ctrl_ssao->setEnabled(enabled); - ctrl_dof->setEnabled(enabled); - - enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail"); - - ctrl_shadow->setEnabled(enabled); - shadow_text->setEnabled(enabled); - - // Hardware settings - F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); - S32Megabytes min_tex_mem = LLViewerTextureList::getMinVideoRamSetting(); - S32Megabytes max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(false, mem_multiplier); - getChild("GraphicsCardTextureMemory")->setMinValue(min_tex_mem.value()); - getChild("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem.value()); - - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") || - !gGLManager.mHasVertexBufferObject) - { - getChildView("vbo")->setEnabled(FALSE); - } - - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderCompressTextures") || - !gGLManager.mHasVertexBufferObject) - { - getChildView("texture compression")->setEnabled(FALSE); - } - - // if no windlight shaders, turn off nighttime brightness, gamma, and fog distance - LLUICtrl* gamma_ctrl = getChild("gamma"); - gamma_ctrl->setEnabled(!gPipeline.canUseWindLightShaders()); - getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders()); - getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders()); - getChildView("antialiasing restart")->setVisible(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred")); - - // now turn off any features that are unavailable - disableUnavailableSettings(); -} - // static void LLAvatarComplexityControls::setIndirectControls() { @@ -1376,118 +1227,6 @@ void LLAvatarComplexityControls::setIndirectMaxArc() gSavedSettings.setU32("IndirectMaxComplexity", indirect_max_arc); } -void LLFloaterPreferenceGraphicsAdvanced::disableUnavailableSettings() -{ - LLComboBox* ctrl_reflections = getChild("Reflections"); - LLTextBox* reflections_text = getChild("ReflectionsText"); - LLCheckBoxCtrl* ctrl_avatar_vp = getChild("AvatarVertexProgram"); - LLCheckBoxCtrl* ctrl_avatar_cloth = getChild("AvatarCloth"); - LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); - LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); - LLComboBox* ctrl_shadows = getChild("ShadowDetail"); - LLTextBox* shadows_text = getChild("RenderShadowDetailText"); - LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); - LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); - LLSliderCtrl* sky = getChild("SkyMeshDetail"); - LLTextBox* sky_text = getChild("SkyMeshDetailText"); - - // disabled windlight - if (!LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders")) - { - ctrl_wind_light->setEnabled(FALSE); - ctrl_wind_light->setValue(FALSE); - - sky->setEnabled(FALSE); - sky_text->setEnabled(FALSE); - - //deferred needs windlight, disable deferred - ctrl_shadows->setEnabled(FALSE); - ctrl_shadows->setValue(0); - shadows_text->setEnabled(FALSE); - - ctrl_ssao->setEnabled(FALSE); - ctrl_ssao->setValue(FALSE); - - ctrl_dof->setEnabled(FALSE); - ctrl_dof->setValue(FALSE); - - ctrl_deferred->setEnabled(FALSE); - ctrl_deferred->setValue(FALSE); - } - - // disabled deferred - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") || - !gGLManager.mHasFramebufferObject) - { - ctrl_shadows->setEnabled(FALSE); - ctrl_shadows->setValue(0); - shadows_text->setEnabled(FALSE); - - ctrl_ssao->setEnabled(FALSE); - ctrl_ssao->setValue(FALSE); - - ctrl_dof->setEnabled(FALSE); - ctrl_dof->setValue(FALSE); - - ctrl_deferred->setEnabled(FALSE); - ctrl_deferred->setValue(FALSE); - } - - // disabled deferred SSAO - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO")) - { - ctrl_ssao->setEnabled(FALSE); - ctrl_ssao->setValue(FALSE); - } - - // disabled deferred shadows - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail")) - { - ctrl_shadows->setEnabled(FALSE); - ctrl_shadows->setValue(0); - shadows_text->setEnabled(FALSE); - } - - // disabled reflections - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderReflectionDetail")) - { - ctrl_reflections->setEnabled(FALSE); - ctrl_reflections->setValue(FALSE); - reflections_text->setEnabled(FALSE); - } - - // disabled av - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP")) - { - ctrl_avatar_vp->setEnabled(FALSE); - ctrl_avatar_vp->setValue(FALSE); - - ctrl_avatar_cloth->setEnabled(FALSE); - ctrl_avatar_cloth->setValue(FALSE); - - //deferred needs AvatarVP, disable deferred - ctrl_shadows->setEnabled(FALSE); - ctrl_shadows->setValue(0); - shadows_text->setEnabled(FALSE); - - ctrl_ssao->setEnabled(FALSE); - ctrl_ssao->setValue(FALSE); - - ctrl_dof->setEnabled(FALSE); - ctrl_dof->setValue(FALSE); - - ctrl_deferred->setEnabled(FALSE); - ctrl_deferred->setValue(FALSE); - } - - // disabled cloth - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarCloth")) - { - ctrl_avatar_cloth->setEnabled(FALSE); - ctrl_avatar_cloth->setValue(FALSE); - } -} - void LLFloaterPreference::refresh() { LLPanel::refresh(); @@ -1503,32 +1242,6 @@ void LLFloaterPreference::refresh() updateClickActionViews(); } -void LLFloaterPreferenceGraphicsAdvanced::refresh() -{ - getChild("fsaa")->setValue((LLSD::Integer) gSavedSettings.getU32("RenderFSAASamples")); - - // sliders and their text boxes - // mPostProcess = gSavedSettings.getS32("RenderGlowResolutionPow"); - // slider text boxes - updateSliderText(getChild("ObjectMeshDetail", true), getChild("ObjectMeshDetailText", true)); - updateSliderText(getChild("FlexibleMeshDetail", true), getChild("FlexibleMeshDetailText", true)); - updateSliderText(getChild("TreeMeshDetail", true), getChild("TreeMeshDetailText", true)); - updateSliderText(getChild("AvatarMeshDetail", true), getChild("AvatarMeshDetailText", true)); - updateSliderText(getChild("AvatarPhysicsDetail", true), getChild("AvatarPhysicsDetailText", true)); - updateSliderText(getChild("TerrainMeshDetail", true), getChild("TerrainMeshDetailText", true)); - updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true)); - updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true)); - updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true)); - LLAvatarComplexityControls::setIndirectControls(); - setMaxNonImpostorsText( - gSavedSettings.getU32("RenderAvatarMaxNonImpostors"), - getChild("IndirectMaxNonImpostorsText", true)); - LLAvatarComplexityControls::setText( - gSavedSettings.getU32("RenderAvatarMaxComplexity"), - getChild("IndirectMaxComplexityText", true)); - refreshEnabledState(); -} - void LLFloaterPreference::onCommitWindowedMode() { refresh(); @@ -1742,63 +1455,6 @@ void LLFloaterPreference::refreshUI() refresh(); } -void LLFloaterPreferenceGraphicsAdvanced::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box) -{ - if (text_box == NULL || ctrl== NULL) - return; - - // get range and points when text should change - F32 value = (F32)ctrl->getValue().asReal(); - F32 min = ctrl->getMinValue(); - F32 max = ctrl->getMaxValue(); - F32 range = max - min; - llassert(range > 0); - F32 midPoint = min + range / 3.0f; - F32 highPoint = min + (2.0f * range / 3.0f); - - // choose the right text - if (value < midPoint) - { - text_box->setText(LLTrans::getString("GraphicsQualityLow")); - } - else if (value < highPoint) - { - text_box->setText(LLTrans::getString("GraphicsQualityMid")); - } - else - { - text_box->setText(LLTrans::getString("GraphicsQualityHigh")); - } -} - -void LLFloaterPreferenceGraphicsAdvanced::updateMaxNonImpostors() -{ - // Called when the IndirectMaxNonImpostors control changes - // Responsible for fixing the slider label (IndirectMaxNonImpostorsText) and setting RenderAvatarMaxNonImpostors - LLSliderCtrl* ctrl = getChild("IndirectMaxNonImpostors",true); - U32 value = ctrl->getValue().asInteger(); - - if (0 == value || LLVOAvatar::NON_IMPOSTORS_MAX_SLIDER <= value) - { - value=0; - } - gSavedSettings.setU32("RenderAvatarMaxNonImpostors", value); - LLVOAvatar::updateImpostorRendering(value); // make it effective immediately - setMaxNonImpostorsText(value, getChild("IndirectMaxNonImpostorsText")); -} - -void LLFloaterPreferenceGraphicsAdvanced::setMaxNonImpostorsText(U32 value, LLTextBox* text_box) -{ - if (0 == value) - { - text_box->setText(LLTrans::getString("no_limit")); - } - else - { - text_box->setText(llformat("%d", value)); - } -} - void LLAvatarComplexityControls::updateMax(LLSliderCtrl* slider, LLTextBox* value_label) { // Called when the IndirectMaxComplexity control changes @@ -1891,22 +1547,6 @@ bool LLFloaterPreference::loadFromFilename(const std::string& filename, std::map return true; } -void LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity() -{ - // Called when the IndirectMaxComplexity control changes - LLAvatarComplexityControls::updateMax( - getChild("IndirectMaxComplexity"), - getChild("IndirectMaxComplexityText")); - - LLFloaterPreference* floater_preferences = LLFloaterReg::findTypedInstance("preferences"); - if (floater_preferences) - { - LLAvatarComplexityControls::updateMax( - floater_preferences->getChild("IndirectMaxComplexity"), - floater_preferences->getChild("IndirectMaxComplexityText")); - } -} - void LLFloaterPreference::onChangeMaturity() { U8 sim_access = gSavedSettings.getU32("PreferredMaturity"); @@ -3310,18 +2950,6 @@ void LLPanelPreferenceControls::onCancelKeyBind() pControlsTable->deselectAllItems(); } -LLFloaterPreferenceGraphicsAdvanced::LLFloaterPreferenceGraphicsAdvanced(const LLSD& key) - : LLFloater(key) -{ - mCommitCallbackRegistrar.add("Pref.RenderOptionUpdate", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onRenderOptionEnable, this)); - mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxNonImpostors", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateMaxNonImpostors,this)); - mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxComplexity", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity,this)); -} - -LLFloaterPreferenceGraphicsAdvanced::~LLFloaterPreferenceGraphicsAdvanced() -{ -} - LLFloaterPreferenceProxy::LLFloaterPreferenceProxy(const LLSD& key) : LLFloater(key), mSocksSettingsDirty(false) @@ -3331,41 +2959,6 @@ LLFloaterPreferenceProxy::LLFloaterPreferenceProxy(const LLSD& key) mCommitCallbackRegistrar.add("Proxy.Change", boost::bind(&LLFloaterPreferenceProxy::onChangeSocksSettings, this)); } -BOOL LLFloaterPreferenceGraphicsAdvanced::postBuild() -{ - // Don't do this on Mac as their braindead GL versioning - // sets this when 8x and 16x are indeed available - // -#if !LL_DARWIN - if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f) - { //remove FSAA settings above "4x" - LLComboBox* combo = getChild("fsaa"); - combo->remove("8x"); - combo->remove("16x"); - } - - LLCheckBoxCtrl *use_HiDPI = getChild("use HiDPI"); - use_HiDPI->setVisible(FALSE); -#endif - - return TRUE; -} - -void LLFloaterPreferenceGraphicsAdvanced::onOpen(const LLSD& key) -{ - refresh(); -} - -void LLFloaterPreferenceGraphicsAdvanced::onClickCloseBtn(bool app_quitting) -{ - LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); - if (instance) - { - instance->cancel(); - } - updateMaxComplexity(); -} - LLFloaterPreferenceProxy::~LLFloaterPreferenceProxy() { } diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 1268935712..f86104ed99 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -109,9 +109,10 @@ public: // updates click/double-click action controls depending on values from settings.xml void updateClickActionViews(); + void onBtnOK(const LLSD& userdata); + void onBtnCancel(const LLSD& userdata); + protected: - void onBtnOK(const LLSD& userdata); - void onBtnCancel(const LLSD& userdata); void onClickClearCache(); // Clear viewer texture cache, vfs, and VO cache on next startup void onClickBrowserClearCache(); // Clear web history and caches as well as viewer caches above @@ -347,32 +348,6 @@ private: S32 mEditingMode; }; -class LLFloaterPreferenceGraphicsAdvanced : public LLFloater -{ - public: - LLFloaterPreferenceGraphicsAdvanced(const LLSD& key); - ~LLFloaterPreferenceGraphicsAdvanced(); - /*virtual*/ BOOL postBuild(); - void onOpen(const LLSD& key); - void onClickCloseBtn(bool app_quitting); - void disableUnavailableSettings(); - void refreshEnabledGraphics(); - void refreshEnabledState(); - void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box); - void updateMaxNonImpostors(); - void setMaxNonImpostorsText(U32 value, LLTextBox* text_box); - void updateMaxComplexity(); - void setMaxComplexityText(U32 value, LLTextBox* text_box); - static void setIndirectControls(); - static void setIndirectMaxNonImpostors(); - static void setIndirectMaxArc(); - void refresh(); - // callback for when client modifies a render option - void onRenderOptionEnable(); - void onAdvancedAtmosphericsEnable(); - LOG_CLASS(LLFloaterPreferenceGraphicsAdvanced); -}; - class LLAvatarComplexityControls { public: diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp new file mode 100644 index 0000000000..404cdf5280 --- /dev/null +++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp @@ -0,0 +1,466 @@ +/** + * @file llfloaterpreferencesgraphicsadvanced.cpp + * @brief floater for adjusting camera position + * + * $LicenseInfo:firstyear=2021&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2021, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llfloaterpreferencesgraphicsadvanced.h" + +#include "llcheckboxctrl.h" +#include "llcombobox.h" +#include "llfeaturemanager.h" +#include "llfloaterpreference.h" +#include "llfloaterreg.h" +#include "llsliderctrl.h" +#include "lltextbox.h" +#include "lltrans.h" +#include "llviewershadermgr.h" +#include "llviewertexturelist.h" +#include "llvoavatar.h" +#include "pipeline.h" + + +LLFloaterPreferenceGraphicsAdvanced::LLFloaterPreferenceGraphicsAdvanced(const LLSD& key) + : LLFloater(key) +{ + mCommitCallbackRegistrar.add("Pref.RenderOptionUpdate", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onRenderOptionEnable, this)); + mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxNonImpostors", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateMaxNonImpostors,this)); + mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxComplexity", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity,this)); + + mCommitCallbackRegistrar.add("Pref.Cancel", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onBtnCancel, this, _2)); + mCommitCallbackRegistrar.add("Pref.OK", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onBtnOK, this, _2)); +} + +LLFloaterPreferenceGraphicsAdvanced::~LLFloaterPreferenceGraphicsAdvanced() +{ +} + +BOOL LLFloaterPreferenceGraphicsAdvanced::postBuild() +{ + // Don't do this on Mac as their braindead GL versioning + // sets this when 8x and 16x are indeed available + // +#if !LL_DARWIN + if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f) + { //remove FSAA settings above "4x" + LLComboBox* combo = getChild("fsaa"); + combo->remove("8x"); + combo->remove("16x"); + } + + LLCheckBoxCtrl *use_HiDPI = getChild("use HiDPI"); + use_HiDPI->setVisible(FALSE); +#endif + + return TRUE; +} + +void LLFloaterPreferenceGraphicsAdvanced::onOpen(const LLSD& key) +{ + refresh(); +} + +void LLFloaterPreferenceGraphicsAdvanced::onClickCloseBtn(bool app_quitting) +{ + LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); + if (instance) + { + instance->cancel(); + } + updateMaxComplexity(); +} + +void LLFloaterPreferenceGraphicsAdvanced::onRenderOptionEnable() +{ + LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); + if (instance) + { + instance->refresh(); + } + + refreshEnabledGraphics(); +} + +void LLFloaterPreferenceGraphicsAdvanced::onAdvancedAtmosphericsEnable() +{ + LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); + if (instance) + { + instance->refresh(); + } + + refreshEnabledGraphics(); +} + +void LLFloaterPreferenceGraphicsAdvanced::refresh() +{ + getChild("fsaa")->setValue((LLSD::Integer) gSavedSettings.getU32("RenderFSAASamples")); + + // sliders and their text boxes + // mPostProcess = gSavedSettings.getS32("RenderGlowResolutionPow"); + // slider text boxes + updateSliderText(getChild("ObjectMeshDetail", true), getChild("ObjectMeshDetailText", true)); + updateSliderText(getChild("FlexibleMeshDetail", true), getChild("FlexibleMeshDetailText", true)); + updateSliderText(getChild("TreeMeshDetail", true), getChild("TreeMeshDetailText", true)); + updateSliderText(getChild("AvatarMeshDetail", true), getChild("AvatarMeshDetailText", true)); + updateSliderText(getChild("AvatarPhysicsDetail", true), getChild("AvatarPhysicsDetailText", true)); + updateSliderText(getChild("TerrainMeshDetail", true), getChild("TerrainMeshDetailText", true)); + updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true)); + updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true)); + updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true)); + LLAvatarComplexityControls::setIndirectControls(); + setMaxNonImpostorsText( + gSavedSettings.getU32("RenderAvatarMaxNonImpostors"), + getChild("IndirectMaxNonImpostorsText", true)); + LLAvatarComplexityControls::setText( + gSavedSettings.getU32("RenderAvatarMaxComplexity"), + getChild("IndirectMaxComplexityText", true)); + refreshEnabledState(); +} + +void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledGraphics() +{ + refreshEnabledState(); +} + +void LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity() +{ + // Called when the IndirectMaxComplexity control changes + LLAvatarComplexityControls::updateMax( + getChild("IndirectMaxComplexity"), + getChild("IndirectMaxComplexityText")); + + LLFloaterPreference* floater_preferences = LLFloaterReg::findTypedInstance("preferences"); + if (floater_preferences) + { + LLAvatarComplexityControls::updateMax( + floater_preferences->getChild("IndirectMaxComplexity"), + floater_preferences->getChild("IndirectMaxComplexityText")); + } +} + +void LLFloaterPreferenceGraphicsAdvanced::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box) +{ + if (text_box == NULL || ctrl== NULL) + return; + + // get range and points when text should change + F32 value = (F32)ctrl->getValue().asReal(); + F32 min = ctrl->getMinValue(); + F32 max = ctrl->getMaxValue(); + F32 range = max - min; + llassert(range > 0); + F32 midPoint = min + range / 3.0f; + F32 highPoint = min + (2.0f * range / 3.0f); + + // choose the right text + if (value < midPoint) + { + text_box->setText(LLTrans::getString("GraphicsQualityLow")); + } + else if (value < highPoint) + { + text_box->setText(LLTrans::getString("GraphicsQualityMid")); + } + else + { + text_box->setText(LLTrans::getString("GraphicsQualityHigh")); + } +} + +void LLFloaterPreferenceGraphicsAdvanced::updateMaxNonImpostors() +{ + // Called when the IndirectMaxNonImpostors control changes + // Responsible for fixing the slider label (IndirectMaxNonImpostorsText) and setting RenderAvatarMaxNonImpostors + LLSliderCtrl* ctrl = getChild("IndirectMaxNonImpostors",true); + U32 value = ctrl->getValue().asInteger(); + + if (0 == value || LLVOAvatar::NON_IMPOSTORS_MAX_SLIDER <= value) + { + value=0; + } + gSavedSettings.setU32("RenderAvatarMaxNonImpostors", value); + LLVOAvatar::updateImpostorRendering(value); // make it effective immediately + setMaxNonImpostorsText(value, getChild("IndirectMaxNonImpostorsText")); +} + +void LLFloaterPreferenceGraphicsAdvanced::setMaxNonImpostorsText(U32 value, LLTextBox* text_box) +{ + if (0 == value) + { + text_box->setText(LLTrans::getString("no_limit")); + } + else + { + text_box->setText(llformat("%d", value)); + } +} + +void LLFloaterPreferenceGraphicsAdvanced::disableUnavailableSettings() +{ + LLComboBox* ctrl_reflections = getChild("Reflections"); + LLTextBox* reflections_text = getChild("ReflectionsText"); + LLCheckBoxCtrl* ctrl_avatar_vp = getChild("AvatarVertexProgram"); + LLCheckBoxCtrl* ctrl_avatar_cloth = getChild("AvatarCloth"); + LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); + LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); + LLComboBox* ctrl_shadows = getChild("ShadowDetail"); + LLTextBox* shadows_text = getChild("RenderShadowDetailText"); + LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); + LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); + LLSliderCtrl* sky = getChild("SkyMeshDetail"); + LLTextBox* sky_text = getChild("SkyMeshDetailText"); + + // disabled windlight + if (!LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders")) + { + ctrl_wind_light->setEnabled(FALSE); + ctrl_wind_light->setValue(FALSE); + + sky->setEnabled(FALSE); + sky_text->setEnabled(FALSE); + + //deferred needs windlight, disable deferred + ctrl_shadows->setEnabled(FALSE); + ctrl_shadows->setValue(0); + shadows_text->setEnabled(FALSE); + + ctrl_ssao->setEnabled(FALSE); + ctrl_ssao->setValue(FALSE); + + ctrl_dof->setEnabled(FALSE); + ctrl_dof->setValue(FALSE); + + ctrl_deferred->setEnabled(FALSE); + ctrl_deferred->setValue(FALSE); + } + + // disabled deferred + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") || + !gGLManager.mHasFramebufferObject) + { + ctrl_shadows->setEnabled(FALSE); + ctrl_shadows->setValue(0); + shadows_text->setEnabled(FALSE); + + ctrl_ssao->setEnabled(FALSE); + ctrl_ssao->setValue(FALSE); + + ctrl_dof->setEnabled(FALSE); + ctrl_dof->setValue(FALSE); + + ctrl_deferred->setEnabled(FALSE); + ctrl_deferred->setValue(FALSE); + } + + // disabled deferred SSAO + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO")) + { + ctrl_ssao->setEnabled(FALSE); + ctrl_ssao->setValue(FALSE); + } + + // disabled deferred shadows + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail")) + { + ctrl_shadows->setEnabled(FALSE); + ctrl_shadows->setValue(0); + shadows_text->setEnabled(FALSE); + } + + // disabled reflections + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderReflectionDetail")) + { + ctrl_reflections->setEnabled(FALSE); + ctrl_reflections->setValue(FALSE); + reflections_text->setEnabled(FALSE); + } + + // disabled av + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP")) + { + ctrl_avatar_vp->setEnabled(FALSE); + ctrl_avatar_vp->setValue(FALSE); + + ctrl_avatar_cloth->setEnabled(FALSE); + ctrl_avatar_cloth->setValue(FALSE); + + //deferred needs AvatarVP, disable deferred + ctrl_shadows->setEnabled(FALSE); + ctrl_shadows->setValue(0); + shadows_text->setEnabled(FALSE); + + ctrl_ssao->setEnabled(FALSE); + ctrl_ssao->setValue(FALSE); + + ctrl_dof->setEnabled(FALSE); + ctrl_dof->setValue(FALSE); + + ctrl_deferred->setEnabled(FALSE); + ctrl_deferred->setValue(FALSE); + } + + // disabled cloth + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarCloth")) + { + ctrl_avatar_cloth->setEnabled(FALSE); + ctrl_avatar_cloth->setValue(FALSE); + } +} + +void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() +{ + LLComboBox* ctrl_reflections = getChild("Reflections"); + LLTextBox* reflections_text = getChild("ReflectionsText"); + + // Reflections + BOOL reflections = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps; + ctrl_reflections->setEnabled(reflections); + reflections_text->setEnabled(reflections); + + // Transparent Water + LLCheckBoxCtrl* transparent_water_ctrl = getChild("TransparentWater"); + + // Bump & Shiny + LLCheckBoxCtrl* bumpshiny_ctrl = getChild("BumpShiny"); + bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump"); + bumpshiny_ctrl->setEnabled(bumpshiny ? TRUE : FALSE); + + // Avatar Mode + // Enable Avatar Shaders + LLCheckBoxCtrl* ctrl_avatar_vp = getChild("AvatarVertexProgram"); + // Avatar Render Mode + LLCheckBoxCtrl* ctrl_avatar_cloth = getChild("AvatarCloth"); + + bool avatar_vp_enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP"); + if (LLViewerShaderMgr::sInitialized) + { + S32 max_avatar_shader = LLViewerShaderMgr::instance()->mMaxAvatarShaderLevel; + avatar_vp_enabled = (max_avatar_shader > 0) ? TRUE : FALSE; + } + + ctrl_avatar_vp->setEnabled(avatar_vp_enabled); + + if (gSavedSettings.getBOOL("RenderAvatarVP") == FALSE) + { + ctrl_avatar_cloth->setEnabled(FALSE); + } + else + { + ctrl_avatar_cloth->setEnabled(TRUE); + } + + // Vertex Shaders, Global Shader Enable + // SL-12594 Basic shaders are always enabled. DJH TODO clean up now-orphaned state handling code + LLSliderCtrl* terrain_detail = getChild("TerrainDetail"); // can be linked with control var + LLTextBox* terrain_text = getChild("TerrainDetailText"); + + terrain_detail->setEnabled(FALSE); + terrain_text->setEnabled(FALSE); + + // WindLight + LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); + LLSliderCtrl* sky = getChild("SkyMeshDetail"); + LLTextBox* sky_text = getChild("SkyMeshDetailText"); + ctrl_wind_light->setEnabled(TRUE); + sky->setEnabled(TRUE); + sky_text->setEnabled(TRUE); + + //Deferred/SSAO/Shadows + LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); + + BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && + ((bumpshiny_ctrl && bumpshiny_ctrl->get()) ? TRUE : FALSE) && + ((transparent_water_ctrl && transparent_water_ctrl->get()) ? TRUE : FALSE) && + gGLManager.mHasFramebufferObject && + gSavedSettings.getBOOL("RenderAvatarVP") && + (ctrl_wind_light->get()) ? TRUE : FALSE; + + ctrl_deferred->setEnabled(enabled); + + LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); + LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); + LLComboBox* ctrl_shadow = getChild("ShadowDetail"); + LLTextBox* shadow_text = getChild("RenderShadowDetailText"); + + // note, okay here to get from ctrl_deferred as it's twin, ctrl_deferred2 will alway match it + enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (ctrl_deferred->get() ? TRUE : FALSE); + + ctrl_deferred->set(gSavedSettings.getBOOL("RenderDeferred")); + + ctrl_ssao->setEnabled(enabled); + ctrl_dof->setEnabled(enabled); + + enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail"); + + ctrl_shadow->setEnabled(enabled); + shadow_text->setEnabled(enabled); + + // Hardware settings + F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); + S32Megabytes min_tex_mem = LLViewerTextureList::getMinVideoRamSetting(); + S32Megabytes max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(false, mem_multiplier); + getChild("GraphicsCardTextureMemory")->setMinValue(min_tex_mem.value()); + getChild("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem.value()); + + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") || + !gGLManager.mHasVertexBufferObject) + { + getChildView("vbo")->setEnabled(FALSE); + } + + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderCompressTextures") || + !gGLManager.mHasVertexBufferObject) + { + getChildView("texture compression")->setEnabled(FALSE); + } + + // if no windlight shaders, turn off nighttime brightness, gamma, and fog distance + LLUICtrl* gamma_ctrl = getChild("gamma"); + gamma_ctrl->setEnabled(!gPipeline.canUseWindLightShaders()); + getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders()); + getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders()); + getChildView("antialiasing restart")->setVisible(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred")); + + // now turn off any features that are unavailable + disableUnavailableSettings(); +} + +void LLFloaterPreferenceGraphicsAdvanced::onBtnOK(const LLSD& userdata) +{ + LLFloaterPreference* instance = LLFloaterReg::getTypedInstance("preferences"); + if (instance) + { + instance->onBtnOK(userdata); + } +} + +void LLFloaterPreferenceGraphicsAdvanced::onBtnCancel(const LLSD& userdata) +{ + LLFloaterPreference* instance = LLFloaterReg::getTypedInstance("preferences"); + if (instance) + { + instance->onBtnCancel(userdata); + } +} diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.h b/indra/newview/llfloaterpreferencesgraphicsadvanced.h new file mode 100644 index 0000000000..3e9046eba9 --- /dev/null +++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.h @@ -0,0 +1,63 @@ +/** + * @file llfloaterpreferencesgraphicsadvanced.h + * + * $LicenseInfo:firstyear=2021&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2021, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LLFLOATERPREFERENCEGRAPHICSADVANCED_H +#define LLFLOATERPREFERENCEGRAPHICSADVANCED_H + +#include "llcontrol.h" +#include "llfloater.h" + +class LLSliderCtrl; +class LLTextBox; + +class LLFloaterPreferenceGraphicsAdvanced : public LLFloater +{ +public: + LLFloaterPreferenceGraphicsAdvanced(const LLSD& key); + ~LLFloaterPreferenceGraphicsAdvanced(); + /*virtual*/ BOOL postBuild(); + void onOpen(const LLSD& key); + void onClickCloseBtn(bool app_quitting); + void disableUnavailableSettings(); + void refreshEnabledGraphics(); + void refreshEnabledState(); + void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box); + void updateMaxNonImpostors(); + void setMaxNonImpostorsText(U32 value, LLTextBox* text_box); + void updateMaxComplexity(); + void setMaxComplexityText(U32 value, LLTextBox* text_box); + void refresh(); + // callback for when client modifies a render option + void onRenderOptionEnable(); + void onAdvancedAtmosphericsEnable(); + LOG_CLASS(LLFloaterPreferenceGraphicsAdvanced); + +protected: + void onBtnOK(const LLSD& userdata); + void onBtnCancel(const LLSD& userdata); +}; + +#endif //LLFLOATERPREFERENCEGRAPHICSADVANCED_H + diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index eabdb67188..731a7e8ace 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -106,6 +106,7 @@ #include "llfloaterperms.h" #include "llfloaterpostprocess.h" #include "llfloaterpreference.h" +#include "llfloaterpreferencesgraphicsadvanced.h" #include "llfloaterpreferenceviewadvanced.h" #include "llfloaterpreviewtrash.h" #include "llfloaterproperties.h" diff --git a/indra/newview/skins/default/xui/en/panel_performance_nearby.xml b/indra/newview/skins/default/xui/en/panel_performance_nearby.xml index ade5f99451..d71b5334cd 100644 --- a/indra/newview/skins/default/xui/en/panel_performance_nearby.xml +++ b/indra/newview/skins/default/xui/en/panel_performance_nearby.xml @@ -83,9 +83,6 @@ show_text="false" top_pad="10" width="300"> - Date: Thu, 17 Jun 2021 20:37:06 +0300 Subject: SL-15297 WIP Implement performance floater - updated UI --- indra/newview/llavatarrendernotifier.cpp | 16 +- indra/newview/llavatarrendernotifier.h | 26 + indra/newview/llfloaterperformance.cpp | 135 +++- indra/newview/llfloaterperformance.h | 11 +- indra/newview/llvoavatar.cpp | 33 +- indra/newview/llvoavatar.h | 3 +- .../skins/default/textures/icons/green_dot.png | Bin 18614 -> 0 bytes indra/newview/skins/default/textures/textures.xml | 2 - .../skins/default/xui/en/floater_performance.xml | 730 ++++++++++----------- .../xui/en/panel_performance_complexity.xml | 92 +++ .../default/xui/en/panel_performance_huds.xml | 20 +- .../default/xui/en/panel_performance_nearby.xml | 25 +- .../xui/en/panel_performance_preferences.xml | 4 +- .../default/xui/en/panel_performance_scripts.xml | 82 --- .../xui/en/panel_performance_troubleshooting.xml | 4 +- 15 files changed, 661 insertions(+), 522 deletions(-) delete mode 100644 indra/newview/skins/default/textures/icons/green_dot.png create mode 100644 indra/newview/skins/default/xui/en/panel_performance_complexity.xml delete mode 100644 indra/newview/skins/default/xui/en/panel_performance_scripts.xml (limited to 'indra') diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index 4fd57c7341..8b09f7903d 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -235,6 +235,12 @@ void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) // save the value for use in following messages mLatestAgentComplexity = agentComplexity; + static LLCachedControl show_my_complexity_changes(gSavedSettings, "ShowMyComplexityChanges", 20); + if (!show_my_complexity_changes) + { + return; + } + if (!isAgentAvatarValid() || !gAgentWearables.areWearablesLoaded()) { // data not ready, nothing to show. @@ -282,7 +288,8 @@ static const char* e_hud_messages[] = }; LLHUDRenderNotifier::LLHUDRenderNotifier() : -mReportedHUDWarning(WARN_NONE) +mReportedHUDWarning(WARN_NONE), +mHUDsCount(0) { } @@ -299,7 +306,14 @@ void LLHUDRenderNotifier::updateNotificationHUD(hud_complexity_list_t complexity } mHUDComplexityList = complexity; + mHUDsCount = mHUDComplexityList.size(); + static LLCachedControl show_my_complexity_changes(gSavedSettings, "ShowMyComplexityChanges", 20); + if (!show_my_complexity_changes) + { + return; + } + // TODO: // Find a way to show message with list of issues, but without making it too large // and intrusive. diff --git a/indra/newview/llavatarrendernotifier.h b/indra/newview/llavatarrendernotifier.h index 3fd7a32d84..37130bfcf6 100644 --- a/indra/newview/llavatarrendernotifier.h +++ b/indra/newview/llavatarrendernotifier.h @@ -63,6 +63,25 @@ struct LLHUDComplexity typedef std::list hud_complexity_list_t; +struct LLObjectComplexity +{ + LLObjectComplexity() + { + reset(); + } + void reset() + { + objectId = LLUUID::null; + objectName = ""; + objectCost = 0; + } + LLUUID objectId; + std::string objectName; + U32 objectCost; +}; + +typedef std::list object_complexity_list_t; + // Class to notify user about drastic changes in agent's render weights or if other agents // reported that user's agent is too 'heavy' for their settings class LLAvatarRenderNotifier : public LLSingleton @@ -77,6 +96,9 @@ public: void updateNotificationState(); void updateNotificationAgent(U32 agentComplexity); + void setObjectComplexityList(object_complexity_list_t object_list) { mObjectComplexityList = object_list; } + object_complexity_list_t getObjectComplexityList() { return mObjectComplexityList; } + private: LLNotificationPtr mNotificationPtr; @@ -109,6 +131,8 @@ private: // Used to detect changes in voavatar's rezzed status. // If value decreases - there were changes in outfit. S32 mLastOutfitRezStatus; + + object_complexity_list_t mObjectComplexityList; }; // Class to notify user about heavy set of HUD @@ -122,6 +146,7 @@ public: bool isNotificationVisible(); hud_complexity_list_t getHUDComplexityList() { return mHUDComplexityList; } + S32 getHUDsCount() { return mHUDsCount; } private: enum EWarnLevel @@ -144,6 +169,7 @@ private: LLHUDComplexity mLatestHUDComplexity; LLFrameTimer mHUDPopUpDelayTimer; hud_complexity_list_t mHUDComplexityList; + S32 mHUDsCount; }; #endif /* ! defined(LL_llavatarrendernotifier_H) */ diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index a44c3a262d..c96d3dac5e 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -37,17 +37,22 @@ #include "lltextbox.h" #include "lltrans.h" #include "llvoavatar.h" +#include "llvoavatarself.h" + +const F32 REFRESH_INTERVAL = 1.0f; +const S32 COMPLEXITY_THRESHOLD_1 = 100000; LLFloaterPerformance::LLFloaterPerformance(const LLSD& key) - : LLFloater(key) +: LLFloater(key), + mUpdateTimer(new LLTimer()) { - } LLFloaterPerformance::~LLFloaterPerformance() { mComplexityChangedSignal.disconnect(); + delete mUpdateTimer; } BOOL LLFloaterPerformance::postBuild() @@ -55,32 +60,34 @@ BOOL LLFloaterPerformance::postBuild() mMainPanel = getChild("panel_performance_main"); mTroubleshootingPanel = getChild("panel_performance_troubleshooting"); mNearbyPanel = getChild("panel_performance_nearby"); - mScriptsPanel = getChild("panel_performance_scripts"); - mPreferencesPanel = getChild("panel_performance_preferences"); + mComplexityPanel = getChild("panel_performance_complexity"); + mSettingsPanel = getChild("panel_performance_preferences"); mHUDsPanel = getChild("panel_performance_huds"); getChild("troubleshooting_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mTroubleshootingPanel)); getChild("nearby_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mNearbyPanel)); - getChild("scripts_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mScriptsPanel)); - getChild("preferences_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mPreferencesPanel)); + getChild("complexity_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mComplexityPanel)); + getChild("settings_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mSettingsPanel)); getChild("huds_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mHUDsPanel)); initBackBtn(mTroubleshootingPanel); initBackBtn(mNearbyPanel); - initBackBtn(mScriptsPanel); - initBackBtn(mPreferencesPanel); + initBackBtn(mComplexityPanel); + initBackBtn(mSettingsPanel); initBackBtn(mHUDsPanel); - - mHUDsPanel->getChild("refresh_list_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::populateHUDList, this)); - mHUDList = mHUDsPanel->getChild("hud_list"); mHUDList->setNameListType(LLNameListCtrl::SPECIAL); mHUDList->setHoverIconName("StopReload_Off"); mHUDList->setIconClickedCallback(boost::bind(&LLFloaterPerformance::detachItem, this, _1)); - mPreferencesPanel->getChild("advanced_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickAdvanced, this)); - mPreferencesPanel->getChild("defaults_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickRecommended, this)); + mObjectList = mComplexityPanel->getChild("obj_list"); + mObjectList->setNameListType(LLNameListCtrl::SPECIAL); + mObjectList->setHoverIconName("StopReload_Off"); + mObjectList->setIconClickedCallback(boost::bind(&LLFloaterPerformance::detachItem, this, _1)); + + mSettingsPanel->getChild("advanced_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickAdvanced, this)); + mSettingsPanel->getChild("defaults_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickRecommended, this)); mNearbyPanel->getChild("exceptions_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickExceptions, this)); mNearbyList = mNearbyPanel->getChild("nearby_list"); @@ -89,6 +96,8 @@ BOOL LLFloaterPerformance::postBuild() mComplexityChangedSignal = gSavedSettings.getControl("IndirectMaxComplexity")->getCommitSignal()->connect(boost::bind(&LLFloaterPerformance::updateComplexityText, this)); mNearbyPanel->getChild("IndirectMaxComplexity")->setCommitCallback(boost::bind(&LLFloaterPerformance::updateMaxComplexity, this)); + LLAvatarComplexityControls::setIndirectMaxArc(); + return TRUE; } @@ -107,13 +116,43 @@ void LLFloaterPerformance::showSelectedPanel(LLPanel* selected_panel) } } +void LLFloaterPerformance::draw() +{ + if (mUpdateTimer->hasExpired()) + { + getChild("fps_value")->setValue((S32)llround(LLTrace::get_frame_recording().getPeriodMeanPerSec(LLStatViewer::FPS))); + if (mMainPanel->getVisible()) + { + mMainPanel->getChild("huds_value")->setValue(LLHUDRenderNotifier::getInstance()->getHUDsCount()); + mMainPanel->getChild("complexity_value")->setValue((S32)gAgentAvatarp->getVisualComplexity()); + updateNearbyComplexityDesc(); + } + else if (mHUDsPanel->getVisible()) + { + populateHUDList(); + } + else if (mNearbyPanel->getVisible()) + { + populateNearbyList(); + updateNearbyComplexityDesc(); + } + else if (mComplexityPanel->getVisible()) + { + populateObjectList(); + } + + mUpdateTimer->setTimerExpirySec(REFRESH_INTERVAL); + } + LLFloater::draw(); +} + void LLFloaterPerformance::showMainPanel() { mTroubleshootingPanel->setVisible(FALSE); mNearbyPanel->setVisible(FALSE); - mScriptsPanel->setVisible(FALSE); + mComplexityPanel->setVisible(FALSE); mHUDsPanel->setVisible(FALSE); - mPreferencesPanel->setVisible(FALSE); + mSettingsPanel->setVisible(FALSE); mMainPanel->setVisible(TRUE); } @@ -165,16 +204,55 @@ void LLFloaterPerformance::populateHUDList() mHUDsPanel->getChild("huds_value")->setValue(std::to_string(complexity_list.size())); } +void LLFloaterPerformance::populateObjectList() +{ + mObjectList->clearRows(); + mObjectList->updateColumns(true); + + object_complexity_list_t complexity_list = LLAvatarRenderNotifier::getInstance()->getObjectComplexityList(); + + object_complexity_list_t::iterator iter = complexity_list.begin(); + object_complexity_list_t::iterator end = complexity_list.end(); + + for (; iter != end; ++iter) + { + LLObjectComplexity object_complexity = *iter; + + LLSD item; + item["special_id"] = object_complexity.objectId; + item["target"] = LLNameListCtrl::SPECIAL; + LLSD& row = item["columns"]; + row[0]["column"] = "complex_visual"; + row[0]["type"] = "text"; + row[0]["value"] = "*"; + + row[1]["column"] = "complex_value"; + row[1]["type"] = "text"; + row[1]["value"] = std::to_string(object_complexity.objectCost); + row[1]["font"]["name"] = "SANSSERIF"; + + row[2]["column"] = "name"; + row[2]["type"] = "text"; + row[2]["value"] = object_complexity.objectName; + row[2]["font"]["name"] = "SANSSERIF"; + + mObjectList->addElement(item); + } + mObjectList->sortByColumnIndex(1, FALSE); +} + void LLFloaterPerformance::populateNearbyList() { mNearbyList->clearRows(); mNearbyList->updateColumns(true); + S32 avatars = 0; + std::vector::iterator char_iter = LLCharacter::sInstances.begin(); while (char_iter != LLCharacter::sInstances.end()) { LLVOAvatar* avatar = dynamic_cast(*char_iter); - if (avatar && !avatar->isDead() && !avatar->isControlAvatar()) + if (avatar && !avatar->isDead() && !avatar->isControlAvatar() && !avatar->isSelf()) { avatar->calculateUpdateRenderComplexity(); @@ -204,17 +282,38 @@ void LLFloaterPerformance::populateNearbyList() name_text->setColor(LLUIColorTable::instance().getColor("ConversationFriendColor")); } } + avatars++; } char_iter++; } - mNearbyList->sortByColumnIndex(1, FALSE); + mNearbyList->sortByColumnIndex(1, FALSE); +} +void LLFloaterPerformance::updateNearbyComplexityDesc() +{ + S32 max_complexity = 0; + std::vector::iterator char_iter = LLCharacter::sInstances.begin(); + while (char_iter != LLCharacter::sInstances.end()) + { + LLVOAvatar* avatar = dynamic_cast(*char_iter); + if (avatar && !avatar->isDead() && !avatar->isControlAvatar() && !avatar->isSelf()) + { + max_complexity = llmax(max_complexity, (S32)avatar->getVisualComplexity()); + } + char_iter++; + } + std::string desc = getString(max_complexity > COMPLEXITY_THRESHOLD_1 ? "very_high" : "medium"); + + if (mMainPanel->getVisible()) + { + mMainPanel->getChild("avatars_nearby_value")->setValue(desc); + } + mNearbyPanel->getChild("av_nearby_value")->setValue(desc); } void LLFloaterPerformance::detachItem(const LLUUID& item_id) { LLAppearanceMgr::instance().removeItemFromAvatar(item_id); - mHUDList->removeNameItem(item_id); } void LLFloaterPerformance::onClickRecommended() diff --git a/indra/newview/llfloaterperformance.h b/indra/newview/llfloaterperformance.h index 0cba07f21e..1facfe9225 100644 --- a/indra/newview/llfloaterperformance.h +++ b/indra/newview/llfloaterperformance.h @@ -37,6 +37,7 @@ public: virtual ~LLFloaterPerformance(); /*virtual*/ BOOL postBuild(); + /*virtual*/ void draw(); void showSelectedPanel(LLPanel* selected_panel); void showMainPanel(); @@ -46,6 +47,7 @@ public: private: void initBackBtn(LLPanel* panel); void populateHUDList(); + void populateObjectList(); void populateNearbyList(); void onClickAdvanced(); @@ -55,15 +57,20 @@ private: void updateMaxComplexity(); void updateComplexityText(); + void updateNearbyComplexityDesc(); + LLPanel* mMainPanel; LLPanel* mTroubleshootingPanel; LLPanel* mNearbyPanel; - LLPanel* mScriptsPanel; + LLPanel* mComplexityPanel; LLPanel* mHUDsPanel; - LLPanel* mPreferencesPanel; + LLPanel* mSettingsPanel; LLNameListCtrl* mHUDList; + LLNameListCtrl* mObjectList; LLNameListCtrl* mNearbyList; + LLTimer* mUpdateTimer; + boost::signals2::connection mComplexityChangedSignal; }; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f69b9b3861..ab7e5f7f8a 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -10533,7 +10533,8 @@ void LLVOAvatar::accountRenderComplexityForObject( const F32 max_attachment_complexity, LLVOVolume::texture_cost_t& textures, U32& cost, - hud_complexity_list_t& hud_complexity_list) + hud_complexity_list_t& hud_complexity_list, + object_complexity_list_t& object_complexity_list) { if (attached_object && !attached_object->isHUDAttachment()) { @@ -10552,12 +10553,12 @@ void LLVOAvatar::accountRenderComplexityForObject( F32 attachment_volume_cost = 0; F32 attachment_texture_cost = 0; F32 attachment_children_cost = 0; - const F32 animated_object_attachment_surcharge = 1000; + const F32 animated_object_attachment_surcharge = 1000; - if (attached_object->isAnimatedObject()) - { - attachment_volume_cost += animated_object_attachment_surcharge; - } + if (attached_object->isAnimatedObject()) + { + attachment_volume_cost += animated_object_attachment_surcharge; + } attachment_volume_cost += volume->getRenderCost(textures); const_child_list_t children = volume->getChildren(); @@ -10590,6 +10591,15 @@ void LLVOAvatar::accountRenderComplexityForObject( << LL_ENDL; // Limit attachment complexity to avoid signed integer flipping of the wearer's ACI cost += (U32)llclamp(attachment_total_cost, MIN_ATTACHMENT_COMPLEXITY, max_attachment_complexity); + + if (isSelf()) + { + LLObjectComplexity object_complexity; + object_complexity.objectName = attached_object->getAttachmentItemName(); + object_complexity.objectId = attached_object->getAttachmentItemID(); + object_complexity.objectCost = attachment_total_cost; + object_complexity_list.push_back(object_complexity); + } } } } @@ -10676,6 +10686,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity() U32 cost = VISUAL_COMPLEXITY_UNKNOWN; LLVOVolume::texture_cost_t textures; hud_complexity_list_t hud_complexity_list; + object_complexity_list_t object_complexity_list; for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { @@ -10706,7 +10717,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity() if (volp && !volp->isAttachment()) { accountRenderComplexityForObject(volp, max_attachment_complexity, - textures, cost, hud_complexity_list); + textures, cost, hud_complexity_list, object_complexity_list); } } @@ -10722,7 +10733,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity() { const LLViewerObject* attached_object = attachment_iter->get(); accountRenderComplexityForObject(attached_object, max_attachment_complexity, - textures, cost, hud_complexity_list); + textures, cost, hud_complexity_list, object_complexity_list); } } @@ -10782,13 +10793,13 @@ void LLVOAvatar::calculateUpdateRenderComplexity() mVisualComplexity = cost; mVisualComplexityStale = false; - static LLCachedControl show_my_complexity_changes(gSavedSettings, "ShowMyComplexityChanges", 20); - - if (isSelf() && show_my_complexity_changes) + if (isSelf()) { // Avatar complexity LLAvatarRenderNotifier::getInstance()->updateNotificationAgent(mVisualComplexity); + LLAvatarRenderNotifier::getInstance()->setObjectComplexityList(object_complexity_list); + // HUD complexity LLHUDRenderNotifier::getInstance()->updateNotificationHUD(hud_complexity_list); } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 74ef589ca4..f83f9d4eaf 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -299,7 +299,8 @@ public: const F32 max_attachment_complexity, LLVOVolume::texture_cost_t& textures, U32& cost, - hud_complexity_list_t& hud_complexity_list); + hud_complexity_list_t& hud_complexity_list, + object_complexity_list_t& object_complexity_list); void calculateUpdateRenderComplexity(); static const U32 VISUAL_COMPLEXITY_UNKNOWN; void updateVisualComplexity(); diff --git a/indra/newview/skins/default/textures/icons/green_dot.png b/indra/newview/skins/default/textures/icons/green_dot.png deleted file mode 100644 index 02c07810c2..0000000000 Binary files a/indra/newview/skins/default/textures/icons/green_dot.png and /dev/null differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 51bb91cbf9..a875c4e848 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -234,8 +234,6 @@ with the same filename but different name - - diff --git a/indra/newview/skins/default/xui/en/floater_performance.xml b/indra/newview/skins/default/xui/en/floater_performance.xml index 42269ba34a..09af364266 100644 --- a/indra/newview/skins/default/xui/en/floater_performance.xml +++ b/indra/newview/skins/default/xui/en/floater_performance.xml @@ -1,409 +1,387 @@ + + - - Current FPS - - - 75.2 - - - - - - - - Client: - - - Network: - - - Server: - - - Normal - - - Normal - - - Normal - - - - General troubleshooting - - - Choose among common problems and see what you can do. - - + top="5"> + + 75 + + + FPS -- 60 or more for the best experience + + - - Avatars nearby: - - - 42 (very high) - - - Click to review avatars and choose a complexity limit. - - - - - - This location is - - - very complex - - - Try changing graphics quality or draw distance. - - - - - + - Your avatar: - - + + Quick settings for common situations + + + Choose settings for parties, exploration, photography, and more. + + + + - 12 scripts - - + + Individual settings + + + More control over quality, visibility distance, and enhancements. + + + + - Removing high-impact attachments may improve graphics speed. - - - - - + + Nearby avatar complexity is + + + very high + + + Choose which avatars are not displayed in detail, to increase FPS. + + + + - Your HUDs: - - + + Your avatar complexity is + + + 275 + + + Reduce the complexity of your avatar if you aren't satisfied with current FPS. + + + + - 7 - - + + Your current HUDs: + + + 7 + + + Removing HUDs you are not using can improve speed. + + + + - Removing HUDs you are not using can improve graphics speed. - - + top_pad="20"> + + General troubleshooting + + + Choose among common problems and see what you can do. + + + - + top="55" /> + top="55" /> + top="55" /> + top="55" /> + top="55" /> diff --git a/indra/newview/skins/default/xui/en/panel_performance_complexity.xml b/indra/newview/skins/default/xui/en/panel_performance_complexity.xml new file mode 100644 index 0000000000..8d4512c4f7 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_performance_complexity.xml @@ -0,0 +1,92 @@ + + + + + Back + + + My avatar complexity + + + Complex attachments require more time and memory to display. + + + While you are in this location, removing the most complex ones may increase speed. + + + + + + + diff --git a/indra/newview/skins/default/xui/en/panel_performance_huds.xml b/indra/newview/skins/default/xui/en/panel_performance_huds.xml index c881fadbe8..96bdf2412f 100644 --- a/indra/newview/skins/default/xui/en/panel_performance_huds.xml +++ b/indra/newview/skins/default/xui/en/panel_performance_huds.xml @@ -15,7 +15,7 @@ mouse_opaque="true" follows="left|top" name="back_btn" - top="10" + top="7" image_selected="Arrow_Left_Off" image_pressed="Arrow_Left_Off" image_unselected="Arrow_Left_Off" @@ -27,7 +27,7 @@ height="20" layout="topleft" left_pad="3" - top="13" + top="10" name="back_lbl" width="40"> Back @@ -35,14 +35,14 @@ - HUDs displayed: + width="135"> + Your current HUDs: - If there are any you don't need, detaching them may improve graphics speed. + Detaching HUDs you aren't using us always a good idea, but especially in a complex location. - - - Back - - - Avatar attachment scripts: - - - 12 - - - These attachments contain scripts (embedded apps) that use memory. - - - If there are any you don't need, detaching them may improve graphics speed. - - diff --git a/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml b/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml index d942580880..0a14eeb1c0 100644 --- a/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml +++ b/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml @@ -15,7 +15,7 @@ mouse_opaque="true" follows="left|top" name="back_btn" - top="10" + top="7" image_selected="Arrow_Left_Off" image_pressed="Arrow_Left_Off" image_unselected="Arrow_Left_Off" @@ -27,7 +27,7 @@ height="20" layout="topleft" left_pad="3" - top="13" + top="10" name="back_lbl" width="40"> Back -- cgit v1.2.3 From 3fe7715197c1e9a4ae781201df7a9ec24354f15e Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 18 Jun 2021 18:36:15 +0300 Subject: SL-15297 WIP Implement performance floater - Quick and Individual settings panels --- indra/newview/llfloaterperformance.cpp | 45 +++- indra/newview/llfloaterperformance.h | 3 +- .../skins/default/xui/en/floater_performance.xml | 10 +- .../default/xui/en/panel_performance_nearby.xml | 2 +- .../xui/en/panel_performance_preferences.xml | 255 ++++++++++++++++----- .../default/xui/en/panel_performance_presets.xml | 223 ++++++++++++++++++ 6 files changed, 461 insertions(+), 77 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/panel_performance_presets.xml (limited to 'indra') diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index c96d3dac5e..424ca04b1f 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -63,18 +63,21 @@ BOOL LLFloaterPerformance::postBuild() mComplexityPanel = getChild("panel_performance_complexity"); mSettingsPanel = getChild("panel_performance_preferences"); mHUDsPanel = getChild("panel_performance_huds"); + mPresetsPanel = getChild("panel_performance_presets"); getChild("troubleshooting_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mTroubleshootingPanel)); getChild("nearby_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mNearbyPanel)); getChild("complexity_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mComplexityPanel)); getChild("settings_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mSettingsPanel)); getChild("huds_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mHUDsPanel)); + getChild("presets_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mPresetsPanel)); initBackBtn(mTroubleshootingPanel); initBackBtn(mNearbyPanel); initBackBtn(mComplexityPanel); initBackBtn(mSettingsPanel); initBackBtn(mHUDsPanel); + initBackBtn(mPresetsPanel); mHUDList = mHUDsPanel->getChild("hud_list"); mHUDList->setNameListType(LLNameListCtrl::SPECIAL); @@ -87,11 +90,13 @@ BOOL LLFloaterPerformance::postBuild() mObjectList->setIconClickedCallback(boost::bind(&LLFloaterPerformance::detachItem, this, _1)); mSettingsPanel->getChild("advanced_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickAdvanced, this)); - mSettingsPanel->getChild("defaults_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickRecommended, this)); mNearbyPanel->getChild("exceptions_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickExceptions, this)); mNearbyList = mNearbyPanel->getChild("nearby_list"); + mPresetsPanel->getChild("avatars_nearby_link")->setURLClickedCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mNearbyPanel)); + mPresetsPanel->getChild("settings_link")->setURLClickedCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mSettingsPanel)); + updateComplexityText(); mComplexityChangedSignal = gSavedSettings.getControl("IndirectMaxComplexity")->getCommitSignal()->connect(boost::bind(&LLFloaterPerformance::updateComplexityText, this)); mNearbyPanel->getChild("IndirectMaxComplexity")->setCommitCallback(boost::bind(&LLFloaterPerformance::updateMaxComplexity, this)); @@ -103,8 +108,9 @@ BOOL LLFloaterPerformance::postBuild() void LLFloaterPerformance::showSelectedPanel(LLPanel* selected_panel) { - selected_panel->setVisible(TRUE); + hidePanels(); mMainPanel->setVisible(FALSE); + selected_panel->setVisible(TRUE); if (mHUDsPanel == selected_panel) { @@ -147,13 +153,19 @@ void LLFloaterPerformance::draw() } void LLFloaterPerformance::showMainPanel() +{ + hidePanels(); + mMainPanel->setVisible(TRUE); +} + +void LLFloaterPerformance::hidePanels() { mTroubleshootingPanel->setVisible(FALSE); mNearbyPanel->setVisible(FALSE); mComplexityPanel->setVisible(FALSE); mHUDsPanel->setVisible(FALSE); mSettingsPanel->setVisible(FALSE); - mMainPanel->setVisible(TRUE); + mPresetsPanel->setVisible(FALSE); } void LLFloaterPerformance::initBackBtn(LLPanel* panel) @@ -247,6 +259,7 @@ void LLFloaterPerformance::populateNearbyList() mNearbyList->updateColumns(true); S32 avatars = 0; + static LLCachedControl max_render_cost(gSavedSettings, "RenderAvatarMaxComplexity", 0); std::vector::iterator char_iter = LLCharacter::sInstances.begin(); while (char_iter != LLCharacter::sInstances.end()) @@ -274,12 +287,21 @@ void LLFloaterPerformance::populateNearbyList() row[2]["font"]["name"] = "SANSSERIF"; LLScrollListItem* av_item = mNearbyList->addElement(item); - if(av_item && LLAvatarActions::isFriend(avatar->getID())) + if(av_item) { LLScrollListText* name_text = dynamic_cast(av_item->getColumn(2)); if (name_text) { - name_text->setColor(LLUIColorTable::instance().getColor("ConversationFriendColor")); + std::string color = "white"; + if (avatar->getVisualComplexity() > max_render_cost) + { + color = "LabelDisabledColor"; + } + else if (LLAvatarActions::isFriend(avatar->getID())) + { + color = "ConversationFriendColor"; + } + name_text->setColor(LLUIColorTable::instance().getColor(color)); } } avatars++; @@ -291,6 +313,7 @@ void LLFloaterPerformance::populateNearbyList() void LLFloaterPerformance::updateNearbyComplexityDesc() { + static LLCachedControl max_render_cost(gSavedSettings, "RenderAvatarMaxComplexity", 0); S32 max_complexity = 0; std::vector::iterator char_iter = LLCharacter::sInstances.begin(); while (char_iter != LLCharacter::sInstances.end()) @@ -302,7 +325,7 @@ void LLFloaterPerformance::updateNearbyComplexityDesc() } char_iter++; } - std::string desc = getString(max_complexity > COMPLEXITY_THRESHOLD_1 ? "very_high" : "medium"); + std::string desc = getString(max_complexity > llmin((S32)max_render_cost, COMPLEXITY_THRESHOLD_1) ? "very_high" : "medium"); if (mMainPanel->getVisible()) { @@ -316,13 +339,13 @@ void LLFloaterPerformance::detachItem(const LLUUID& item_id) LLAppearanceMgr::instance().removeItemFromAvatar(item_id); } -void LLFloaterPerformance::onClickRecommended() -{ - LLFeatureManager::getInstance()->applyRecommendedSettings(); -} - void LLFloaterPerformance::onClickAdvanced() { + LLFloaterPreference* instance = LLFloaterReg::getTypedInstance("preferences"); + if (instance) + { + instance->saveSettings(); + } LLFloaterReg::showInstance("prefs_graphics_advanced"); } diff --git a/indra/newview/llfloaterperformance.h b/indra/newview/llfloaterperformance.h index 1facfe9225..7aec7c3f6c 100644 --- a/indra/newview/llfloaterperformance.h +++ b/indra/newview/llfloaterperformance.h @@ -41,6 +41,7 @@ public: void showSelectedPanel(LLPanel* selected_panel); void showMainPanel(); + void hidePanels(); void detachItem(const LLUUID& item_id); @@ -51,7 +52,6 @@ private: void populateNearbyList(); void onClickAdvanced(); - void onClickRecommended(); void onClickExceptions(); void updateMaxComplexity(); @@ -65,6 +65,7 @@ private: LLPanel* mComplexityPanel; LLPanel* mHUDsPanel; LLPanel* mSettingsPanel; + LLPanel* mPresetsPanel; LLNameListCtrl* mHUDList; LLNameListCtrl* mObjectList; LLNameListCtrl* mNearbyList; diff --git a/indra/newview/skins/default/xui/en/floater_performance.xml b/indra/newview/skins/default/xui/en/floater_performance.xml index 09af364266..e415ac5be0 100644 --- a/indra/newview/skins/default/xui/en/floater_performance.xml +++ b/indra/newview/skins/default/xui/en/floater_performance.xml @@ -194,7 +194,7 @@ text_color="PerformanceMid" height="20" layout="topleft" - left_pad="5" + left_pad="2" name="avatars_nearby_value" width="100"> very high @@ -382,6 +382,14 @@ right="-20"/> + - This location is very complex + Individual settings + - While you are here, you may want to reduce graphics quality or draw distance. - - - Graphics quality +shortcuts - Enhancements + top_pad="15" + left="160" + name="quality_desc" + width="380"> + Choosing a shortcut will reset all manual changes you have made. - - - - + name="border2" + top_pad="15" + left="20" + width="540"/> - Draw distance + Visibility distance - Regions are 256 m x 256 m. + width="350"> + To zoom out and see long distances, increase the distance. - To zoom out and see long distances, increase the draw distance. + width="350"> + If you are indoors, decrease the distance to improve speed. + + Enhancements + + - If you are socializing in a small area, decrease the draw distance. + name="enhancements_desc" + width="350"> + Each enhancement improves realism but can reduce speed. - + width="540"/> + + Back + + + Quick settings + + + Note: Quick settings will reset all manual changes you have made. + + + + + Tuned for many avatars in a room. + + + Nearby avatar complexity is high. + + + [secondlife:/// Choose avatars to show and hide] + + + + + Fewer avatars, higher visibility distance. + + + + + Good for zooming your camera far out and viewing large land areas. + + + + + Maximum quality, minimum visibility distance. + + + + For more control, try + + + [secondlife:/// Idividual Settings] + + + -- cgit v1.2.3 From f33605f8b113f1fed84564c7618630acd5c9427a Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 24 Jun 2021 16:17:04 +0300 Subject: SL-15297 WIP Implement performance floater - implement complexity bars --- indra/llui/llscrolllistcell.cpp | 73 +++++++++++++ indra/llui/llscrolllistcell.h | 21 ++++ indra/newview/llfloaterperformance.cpp | 118 ++++++++++++++++----- indra/newview/llfloaterperformance.h | 4 + .../skins/default/xui/en/floater_performance.xml | 3 + 5 files changed, 195 insertions(+), 24 deletions(-) (limited to 'indra') diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp index 13839da400..50f0f5f820 100644 --- a/indra/llui/llscrolllistcell.cpp +++ b/indra/llui/llscrolllistcell.cpp @@ -54,6 +54,10 @@ LLScrollListCell* LLScrollListCell::create(const LLScrollListCell::Params& cell_ { cell = new LLScrollListIconText(cell_p); } + else if (cell_p.type() == "image") + { + cell = new LLScrollListBar(cell_p); + } else // default is "text" { cell = new LLScrollListText(cell_p); @@ -165,6 +169,75 @@ void LLScrollListIcon::draw(const LLColor4& color, const LLColor4& highlight_col } } +// +// LLScrollListBar +// +LLScrollListBar::LLScrollListBar(const LLScrollListCell::Params& p) + : LLScrollListCell(p), + mRatio(0), + mColor(p.color), + mBottom(1), + mLeftPad(1), + mRightPad(1) +{} + +LLScrollListBar::~LLScrollListBar() +{ +} + +/*virtual*/ +S32 LLScrollListBar::getHeight() const +{ + return LLScrollListCell::getHeight(); +} + +/*virtual*/ +const LLSD LLScrollListBar::getValue() const +{ + return LLStringUtil::null; +} + +void LLScrollListBar::setValue(const LLSD& value) +{ + if (value.has("ratio")) + { + mRatio = value["ratio"].asReal(); + } + if (value.has("bottom")) + { + mBottom = value["bottom"].asInteger(); + } + if (value.has("left_pad")) + { + mLeftPad = value["left_pad"].asInteger(); + } + if (value.has("right_pad")) + { + mRightPad = value["right_pad"].asInteger(); + } +} + +void LLScrollListBar::setColor(const LLColor4& color) +{ + mColor = color; +} + +S32 LLScrollListBar::getWidth() const +{ + return LLScrollListCell::getWidth(); +} + + +void LLScrollListBar::draw(const LLColor4& color, const LLColor4& highlight_color) const +{ + S32 bar_width = getWidth() - mLeftPad - mRightPad; + S32 left = bar_width - bar_width * mRatio; + left = llclamp(left, mLeftPad, getWidth() - mRightPad - 1); + + gl_line_2d(left, mBottom, getWidth() - mRightPad, mBottom, mColor); + gl_line_2d(left, mBottom - 1, getWidth() - mRightPad, mBottom - 1, mColor); +} + // // LLScrollListText // diff --git a/indra/llui/llscrolllistcell.h b/indra/llui/llscrolllistcell.h index 19576fb247..26a272b270 100644 --- a/indra/llui/llscrolllistcell.h +++ b/indra/llui/llscrolllistcell.h @@ -33,6 +33,7 @@ #include "lluistring.h" #include "v4color.h" #include "llui.h" +#include "llgltexture.h" class LLCheckBoxCtrl; class LLSD; @@ -192,6 +193,26 @@ private: LLFontGL::HAlign mAlignment; }; + +class LLScrollListBar : public LLScrollListCell +{ +public: + LLScrollListBar(const LLScrollListCell::Params& p); + /*virtual*/ ~LLScrollListBar(); + /*virtual*/ void draw(const LLColor4& color, const LLColor4& highlight_color) const; + /*virtual*/ S32 getWidth() const; + /*virtual*/ S32 getHeight() const; + /*virtual*/ const LLSD getValue() const; + /*virtual*/ void setColor(const LLColor4&); + /*virtual*/ void setValue(const LLSD& value); + +private: + LLColor4 mColor; + F32 mRatio; + S32 mBottom; + S32 mRightPad; + S32 mLeftPad; +}; /* * An interactive cell containing a check box. */ diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index 424ca04b1f..beeebcb202 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -26,13 +26,15 @@ #include "llviewerprecompiledheaders.h" #include "llfloaterperformance.h" +#include "llagent.h" +#include "llagentcamera.h" #include "llappearancemgr.h" #include "llavataractions.h" #include "llavatarrendernotifier.h" #include "llfeaturemanager.h" +#include "llfloaterpreference.h" // LLAvatarComplexityControls #include "llfloaterreg.h" #include "llnamelistctrl.h" -#include "llfloaterpreference.h" // LLAvatarComplexityControls #include "llsliderctrl.h" #include "lltextbox.h" #include "lltrans.h" @@ -40,12 +42,16 @@ #include "llvoavatarself.h" const F32 REFRESH_INTERVAL = 1.0f; -const S32 COMPLEXITY_THRESHOLD_1 = 100000; - +const S32 COMPLEXITY_THRESHOLD_HIGH = 100000; +const S32 COMPLEXITY_THRESHOLD_MEDIUM = 30000; +const S32 BAR_LEFT_PAD = 2; +const S32 BAR_RIGHT_PAD = 5; +const S32 BAR_BOTTOM_PAD = 9; LLFloaterPerformance::LLFloaterPerformance(const LLSD& key) : LLFloater(key), - mUpdateTimer(new LLTimer()) + mUpdateTimer(new LLTimer()), + mNearbyMaxComplexity(0) { } @@ -120,6 +126,10 @@ void LLFloaterPerformance::showSelectedPanel(LLPanel* selected_panel) { populateNearbyList(); } + else if (mComplexityPanel == selected_panel) + { + populateObjectList(); + } } void LLFloaterPerformance::draw() @@ -179,6 +189,7 @@ void LLFloaterPerformance::initBackBtn(LLPanel* panel) void LLFloaterPerformance::populateHUDList() { + S32 prev_pos = mHUDList->getScrollPos(); mHUDList->clearRows(); mHUDList->updateColumns(true); @@ -186,8 +197,14 @@ void LLFloaterPerformance::populateHUDList() hud_complexity_list_t::iterator iter = complexity_list.begin(); hud_complexity_list_t::iterator end = complexity_list.end(); - + + U32 max_complexity = 0; for (; iter != end; ++iter) + { + max_complexity = llmax(max_complexity, (*iter).objectsCost); + } + + for (iter = complexity_list.begin(); iter != end; ++iter) { LLHUDComplexity hud_object_complexity = *iter; @@ -196,8 +213,12 @@ void LLFloaterPerformance::populateHUDList() item["target"] = LLNameListCtrl::SPECIAL; LLSD& row = item["columns"]; row[0]["column"] = "complex_visual"; - row[0]["type"] = "text"; - row[0]["value"] = "*"; + row[0]["type"] = "image"; + LLSD& value = row[0]["value"]; + value["ratio"] = (F32)hud_object_complexity.objectsCost / max_complexity; + value["bottom"] = BAR_BOTTOM_PAD; + value["left_pad"] = BAR_LEFT_PAD; + value["right_pad"] = BAR_RIGHT_PAD; row[1]["column"] = "complex_value"; row[1]["type"] = "text"; @@ -212,12 +233,14 @@ void LLFloaterPerformance::populateHUDList() mHUDList->addElement(item); } mHUDList->sortByColumnIndex(1, FALSE); + mHUDList->setScrollPos(prev_pos); mHUDsPanel->getChild("huds_value")->setValue(std::to_string(complexity_list.size())); } void LLFloaterPerformance::populateObjectList() { + S32 prev_pos = mObjectList->getScrollPos(); mObjectList->clearRows(); mObjectList->updateColumns(true); @@ -226,7 +249,13 @@ void LLFloaterPerformance::populateObjectList() object_complexity_list_t::iterator iter = complexity_list.begin(); object_complexity_list_t::iterator end = complexity_list.end(); + U32 max_complexity = 0; for (; iter != end; ++iter) + { + max_complexity = llmax(max_complexity, (*iter).objectCost); + } + + for (iter = complexity_list.begin(); iter != end; ++iter) { LLObjectComplexity object_complexity = *iter; @@ -235,8 +264,12 @@ void LLFloaterPerformance::populateObjectList() item["target"] = LLNameListCtrl::SPECIAL; LLSD& row = item["columns"]; row[0]["column"] = "complex_visual"; - row[0]["type"] = "text"; - row[0]["value"] = "*"; + row[0]["type"] = "image"; + LLSD& value = row[0]["value"]; + value["ratio"] = (F32)object_complexity.objectCost / max_complexity; + value["bottom"] = BAR_BOTTOM_PAD; + value["left_pad"] = BAR_LEFT_PAD; + value["right_pad"] = BAR_RIGHT_PAD; row[1]["column"] = "complex_value"; row[1]["type"] = "text"; @@ -251,30 +284,35 @@ void LLFloaterPerformance::populateObjectList() mObjectList->addElement(item); } mObjectList->sortByColumnIndex(1, FALSE); + mObjectList->setScrollPos(prev_pos); } void LLFloaterPerformance::populateNearbyList() { + S32 prev_pos = mNearbyList->getScrollPos(); mNearbyList->clearRows(); mNearbyList->updateColumns(true); - S32 avatars = 0; static LLCachedControl max_render_cost(gSavedSettings, "RenderAvatarMaxComplexity", 0); + std::vector valid_nearby_avs; + getNearbyAvatars(valid_nearby_avs); - std::vector::iterator char_iter = LLCharacter::sInstances.begin(); - while (char_iter != LLCharacter::sInstances.end()) + std::vector::iterator char_iter = valid_nearby_avs.begin(); + while (char_iter != valid_nearby_avs.end()) { LLVOAvatar* avatar = dynamic_cast(*char_iter); - if (avatar && !avatar->isDead() && !avatar->isControlAvatar() && !avatar->isSelf()) + if (avatar) { - avatar->calculateUpdateRenderComplexity(); - LLSD item; item["id"] = avatar->getID(); LLSD& row = item["columns"]; row[0]["column"] = "complex_visual"; - row[0]["type"] = "text"; - row[0]["value"] = "*"; + row[0]["type"] = "image"; + LLSD& value = row[0]["value"]; + value["ratio"] = (F32)avatar->getVisualComplexity() / mNearbyMaxComplexity; + value["bottom"] = BAR_BOTTOM_PAD; + value["left_pad"] = BAR_LEFT_PAD; + value["right_pad"] = BAR_RIGHT_PAD; row[1]["column"] = "complex_value"; row[1]["type"] = "text"; @@ -296,6 +334,11 @@ void LLFloaterPerformance::populateNearbyList() if (avatar->getVisualComplexity() > max_render_cost) { color = "LabelDisabledColor"; + LLScrollListBar* bar = dynamic_cast(av_item->getColumn(0)); + if (bar) + { + bar->setColor(LLUIColorTable::instance().getColor(color)); + } } else if (LLAvatarActions::isFriend(avatar->getID())) { @@ -304,28 +347,55 @@ void LLFloaterPerformance::populateNearbyList() name_text->setColor(LLUIColorTable::instance().getColor(color)); } } - avatars++; } char_iter++; } - mNearbyList->sortByColumnIndex(1, FALSE); + mNearbyList->sortByColumnIndex(1, FALSE); + mNearbyList->setScrollPos(prev_pos); } -void LLFloaterPerformance::updateNearbyComplexityDesc() +void LLFloaterPerformance::getNearbyAvatars(std::vector &valid_nearby_avs) { - static LLCachedControl max_render_cost(gSavedSettings, "RenderAvatarMaxComplexity", 0); - S32 max_complexity = 0; + static LLCachedControl render_far_clip(gSavedSettings, "RenderFarClip", 64); + F32 radius = render_far_clip * render_far_clip; std::vector::iterator char_iter = LLCharacter::sInstances.begin(); while (char_iter != LLCharacter::sInstances.end()) { LLVOAvatar* avatar = dynamic_cast(*char_iter); if (avatar && !avatar->isDead() && !avatar->isControlAvatar() && !avatar->isSelf()) { - max_complexity = llmax(max_complexity, (S32)avatar->getVisualComplexity()); + if ((dist_vec_squared(avatar->getPositionGlobal(), gAgent.getPositionGlobal()) > radius) && + (dist_vec_squared(avatar->getPositionGlobal(), gAgentCamera.getCameraPositionGlobal()) > radius)) + { + char_iter++; + continue; + } + avatar->calculateUpdateRenderComplexity(); + mNearbyMaxComplexity = llmax(mNearbyMaxComplexity, (S32)avatar->getVisualComplexity()); + valid_nearby_avs.push_back(*char_iter); } char_iter++; } - std::string desc = getString(max_complexity > llmin((S32)max_render_cost, COMPLEXITY_THRESHOLD_1) ? "very_high" : "medium"); +} + +void LLFloaterPerformance::updateNearbyComplexityDesc() +{ + std::string desc = getString("low"); + + static LLCachedControl max_render_cost(gSavedSettings, "RenderAvatarMaxComplexity", 0); + if (mMainPanel->getVisible()) + { + std::vector valid_nearby_avs; + getNearbyAvatars(valid_nearby_avs); + } + if (mNearbyMaxComplexity > COMPLEXITY_THRESHOLD_HIGH) + { + desc = getString("very_high"); + } + else if (mNearbyMaxComplexity > COMPLEXITY_THRESHOLD_MEDIUM) + { + desc = getString("medium"); + } if (mMainPanel->getVisible()) { diff --git a/indra/newview/llfloaterperformance.h b/indra/newview/llfloaterperformance.h index 7aec7c3f6c..ea15873b95 100644 --- a/indra/newview/llfloaterperformance.h +++ b/indra/newview/llfloaterperformance.h @@ -28,6 +28,7 @@ #include "llfloater.h" +class LLCharacter; class LLNameListCtrl; class LLFloaterPerformance : public LLFloater @@ -57,6 +58,7 @@ private: void updateMaxComplexity(); void updateComplexityText(); + void getNearbyAvatars(std::vector &valid_nearby_avs); void updateNearbyComplexityDesc(); LLPanel* mMainPanel; @@ -72,6 +74,8 @@ private: LLTimer* mUpdateTimer; + S32 mNearbyMaxComplexity; + boost::signals2::connection mComplexityChangedSignal; }; diff --git a/indra/newview/skins/default/xui/en/floater_performance.xml b/indra/newview/skins/default/xui/en/floater_performance.xml index e415ac5be0..4cd3c7a603 100644 --- a/indra/newview/skins/default/xui/en/floater_performance.xml +++ b/indra/newview/skins/default/xui/en/floater_performance.xml @@ -12,6 +12,9 @@ + Date: Fri, 25 Jun 2021 20:05:07 +0300 Subject: SL-15297 WIP restore selection after updating the list & don't show avatars in the list as disabled when complexity is not limited --- indra/llui/llscrolllistcell.cpp | 2 +- indra/newview/llfloaterperformance.cpp | 14 +++++++---- indra/newview/llnamelistctrl.cpp | 28 ++++++++++++++++++++++ indra/newview/llnamelistctrl.h | 3 +++ indra/newview/skins/default/colors.xml | 5 +--- .../default/xui/en/floater_add_payment_method.xml | 2 +- .../skins/default/xui/en/floater_performance.xml | 12 +++++----- 7 files changed, 50 insertions(+), 16 deletions(-) (limited to 'indra') diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp index 50f0f5f820..c5f53823f3 100644 --- a/indra/llui/llscrolllistcell.cpp +++ b/indra/llui/llscrolllistcell.cpp @@ -54,7 +54,7 @@ LLScrollListCell* LLScrollListCell::create(const LLScrollListCell::Params& cell_ { cell = new LLScrollListIconText(cell_p); } - else if (cell_p.type() == "image") + else if (cell_p.type() == "bar") { cell = new LLScrollListBar(cell_p); } diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index beeebcb202..b8adf7fedc 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -190,6 +190,7 @@ void LLFloaterPerformance::initBackBtn(LLPanel* panel) void LLFloaterPerformance::populateHUDList() { S32 prev_pos = mHUDList->getScrollPos(); + LLUUID prev_selected_id = mHUDList->getSelectedSpecialId(); mHUDList->clearRows(); mHUDList->updateColumns(true); @@ -213,7 +214,7 @@ void LLFloaterPerformance::populateHUDList() item["target"] = LLNameListCtrl::SPECIAL; LLSD& row = item["columns"]; row[0]["column"] = "complex_visual"; - row[0]["type"] = "image"; + row[0]["type"] = "bar"; LLSD& value = row[0]["value"]; value["ratio"] = (F32)hud_object_complexity.objectsCost / max_complexity; value["bottom"] = BAR_BOTTOM_PAD; @@ -234,6 +235,7 @@ void LLFloaterPerformance::populateHUDList() } mHUDList->sortByColumnIndex(1, FALSE); mHUDList->setScrollPos(prev_pos); + mHUDList->selectItemBySpecialId(prev_selected_id); mHUDsPanel->getChild("huds_value")->setValue(std::to_string(complexity_list.size())); } @@ -241,6 +243,7 @@ void LLFloaterPerformance::populateHUDList() void LLFloaterPerformance::populateObjectList() { S32 prev_pos = mObjectList->getScrollPos(); + LLUUID prev_selected_id = mObjectList->getSelectedSpecialId(); mObjectList->clearRows(); mObjectList->updateColumns(true); @@ -264,7 +267,7 @@ void LLFloaterPerformance::populateObjectList() item["target"] = LLNameListCtrl::SPECIAL; LLSD& row = item["columns"]; row[0]["column"] = "complex_visual"; - row[0]["type"] = "image"; + row[0]["type"] = "bar"; LLSD& value = row[0]["value"]; value["ratio"] = (F32)object_complexity.objectCost / max_complexity; value["bottom"] = BAR_BOTTOM_PAD; @@ -285,11 +288,13 @@ void LLFloaterPerformance::populateObjectList() } mObjectList->sortByColumnIndex(1, FALSE); mObjectList->setScrollPos(prev_pos); + mObjectList->selectItemBySpecialId(prev_selected_id); } void LLFloaterPerformance::populateNearbyList() { S32 prev_pos = mNearbyList->getScrollPos(); + LLUUID prev_selected_id = mNearbyList->getStringUUIDSelectedItem(); mNearbyList->clearRows(); mNearbyList->updateColumns(true); @@ -307,7 +312,7 @@ void LLFloaterPerformance::populateNearbyList() item["id"] = avatar->getID(); LLSD& row = item["columns"]; row[0]["column"] = "complex_visual"; - row[0]["type"] = "image"; + row[0]["type"] = "bar"; LLSD& value = row[0]["value"]; value["ratio"] = (F32)avatar->getVisualComplexity() / mNearbyMaxComplexity; value["bottom"] = BAR_BOTTOM_PAD; @@ -331,7 +336,7 @@ void LLFloaterPerformance::populateNearbyList() if (name_text) { std::string color = "white"; - if (avatar->getVisualComplexity() > max_render_cost) + if ((max_render_cost != 0) && (avatar->getVisualComplexity() > max_render_cost)) { color = "LabelDisabledColor"; LLScrollListBar* bar = dynamic_cast(av_item->getColumn(0)); @@ -352,6 +357,7 @@ void LLFloaterPerformance::populateNearbyList() } mNearbyList->sortByColumnIndex(1, FALSE); mNearbyList->setScrollPos(prev_pos); + mNearbyList->selectByID(prev_selected_id); } void LLFloaterPerformance::getNearbyAvatars(std::vector &valid_nearby_avs) diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index e1bf9b1a17..92805e03f0 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -464,6 +464,34 @@ LLScrollListItem* LLNameListCtrl::getNameItemByAgentId(const LLUUID& agent_id) return NULL; } +void LLNameListCtrl::selectItemBySpecialId(const LLUUID& special_id) +{ + if (special_id.isNull()) + { + return; + } + + for (item_list::iterator it = getItemList().begin(); it != getItemList().end(); it++) + { + LLNameListItem* item = dynamic_cast(*it); + if (item && item->getSpecialID() == special_id) + { + item->setSelected(TRUE); + break; + } + } +} + +LLUUID LLNameListCtrl::getSelectedSpecialId() +{ + LLNameListItem* item = dynamic_cast(getFirstSelected()); + if(item) + { + return item->getSpecialID(); + } + return LLUUID(); +} + void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name, std::string suffix, diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index 1a31b1cc10..d7e991c94d 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -162,6 +162,9 @@ public: LLScrollListItem* getNameItemByAgentId(const LLUUID& agent_id); + void selectItemBySpecialId(const LLUUID& special_id); + LLUUID getSelectedSpecialId(); + // LLView interface /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 9fcb6edca4..e8d3c12d39 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -967,10 +967,7 @@ name="OutfitGalleryItemUnselected" value="0.4 0.4 0.4 1" /> - Date: Tue, 29 Jun 2021 18:34:18 +0300 Subject: SL-15297 WIP update Individual settings panel & correctly show avatar state in the list --- indra/newview/llfloaterperformance.cpp | 8 +- .../xui/en/panel_performance_preferences.xml | 144 ++++++++++++++++++--- 2 files changed, 131 insertions(+), 21 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index b8adf7fedc..16afeb6e52 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -306,7 +306,7 @@ void LLFloaterPerformance::populateNearbyList() while (char_iter != valid_nearby_avs.end()) { LLVOAvatar* avatar = dynamic_cast(*char_iter); - if (avatar) + if (avatar && (LLVOAvatar::AOA_INVISIBLE != avatar->getOverallAppearance())) { LLSD item; item["id"] = avatar->getID(); @@ -336,7 +336,7 @@ void LLFloaterPerformance::populateNearbyList() if (name_text) { std::string color = "white"; - if ((max_render_cost != 0) && (avatar->getVisualComplexity() > max_render_cost)) + if (LLVOAvatar::AOA_JELLYDOLL == avatar->getOverallAppearance()) { color = "LabelDisabledColor"; LLScrollListBar* bar = dynamic_cast(av_item->getColumn(0)); @@ -345,9 +345,9 @@ void LLFloaterPerformance::populateNearbyList() bar->setColor(LLUIColorTable::instance().getColor(color)); } } - else if (LLAvatarActions::isFriend(avatar->getID())) + else if (LLVOAvatar::AOA_NORMAL == avatar->getOverallAppearance()) { - color = "ConversationFriendColor"; + color = LLAvatarActions::isFriend(avatar->getID()) ? "ConversationFriendColor" : "white"; } name_text->setColor(LLUIColorTable::instance().getColor(color)); } diff --git a/indra/newview/skins/default/xui/en/panel_performance_preferences.xml b/indra/newview/skins/default/xui/en/panel_performance_preferences.xml index ec1b624f13..b5cc2a29ed 100644 --- a/indra/newview/skins/default/xui/en/panel_performance_preferences.xml +++ b/indra/newview/skins/default/xui/en/panel_performance_preferences.xml @@ -2,7 +2,7 @@ Graphics quality @@ -74,21 +74,60 @@ shortcuts width="40"> Fastest - - + + + + + + + + + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + 6 + + + 7 + -- cgit v1.2.3 From 77aac9579170369a11f0884e16bd730f8cbb8bdb Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 14 Jul 2021 14:49:43 +0300 Subject: SL-15297 performance floater ui update --- indra/newview/llfloateravatarrendersettings.cpp | 37 +--- indra/newview/llfloateravatarrendersettings.h | 4 - indra/newview/llfloaterperformance.cpp | 178 +++++++++++----- indra/newview/llfloaterperformance.h | 12 +- .../xui/en/floater_avatar_render_settings.xml | 66 +++--- .../skins/default/xui/en/floater_performance.xml | 217 ++++---------------- .../xui/en/menu_avatar_rendering_settings.xml | 25 +-- .../xui/en/menu_avatar_rendering_settings_add.xml | 4 +- .../xui/en/panel_performance_complexity.xml | 6 +- .../default/xui/en/panel_performance_huds.xml | 17 +- .../default/xui/en/panel_performance_nearby.xml | 18 +- .../xui/en/panel_performance_preferences.xml | 186 +++++++++++------ .../default/xui/en/panel_performance_presets.xml | 223 --------------------- .../xui/en/panel_performance_troubleshooting.xml | 190 ------------------ 14 files changed, 372 insertions(+), 811 deletions(-) delete mode 100644 indra/newview/skins/default/xui/en/panel_performance_presets.xml delete mode 100644 indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml (limited to 'indra') diff --git a/indra/newview/llfloateravatarrendersettings.cpp b/indra/newview/llfloateravatarrendersettings.cpp index b8f854feb3..7d098e6c88 100644 --- a/indra/newview/llfloateravatarrendersettings.cpp +++ b/indra/newview/llfloateravatarrendersettings.cpp @@ -89,7 +89,6 @@ BOOL LLFloaterAvatarRenderSettings::postBuild() LLFloater::postBuild(); mAvatarSettingsList = getChild("render_settings_list"); mAvatarSettingsList->setRightMouseDownCallback(boost::bind(&LLFloaterAvatarRenderSettings::onAvatarListRightClick, this, _1, _2, _3)); - getChild("people_filter_input")->setCommitCallback(boost::bind(&LLFloaterAvatarRenderSettings::onFilterEdit, this, _2)); return TRUE; } @@ -133,37 +132,13 @@ void LLFloaterAvatarRenderSettings::updateList() { item_params.value = iter->first; LLAvatarNameCache::get(iter->first, &av_name); - if(!isHiddenRow(av_name.getCompleteName())) - { - item_params.columns.add().value(av_name.getCompleteName()).column("name"); - std::string setting = getString(iter->second == 1 ? "av_never_render" : "av_always_render"); - item_params.columns.add().value(setting).column("setting"); - std::string timestamp = createTimestamp(LLRenderMuteList::getInstance()->getVisualMuteDate(iter->first)); - item_params.columns.add().value(timestamp).column("timestamp"); - mAvatarSettingsList->addNameItemRow(item_params); - } + item_params.columns.add().value(av_name.getCompleteName()).column("name"); + std::string setting = getString(iter->second == 1 ? "av_never_render" : "av_always_render"); + item_params.columns.add().value(setting).column("setting"); + mAvatarSettingsList->addNameItemRow(item_params); } } -void LLFloaterAvatarRenderSettings::onFilterEdit(const std::string& search_string) -{ - std::string filter_upper = search_string; - LLStringUtil::toUpper(filter_upper); - if (mNameFilter != filter_upper) - { - mNameFilter = filter_upper; - mNeedsUpdate = true; - } -} - -bool LLFloaterAvatarRenderSettings::isHiddenRow(const std::string& av_name) -{ - if (mNameFilter.empty()) return false; - std::string upper_name = av_name; - LLStringUtil::toUpper(upper_name); - return std::string::npos == upper_name.find(mNameFilter); -} - static LLVOAvatar* find_avatar(const LLUUID& id) { LLViewerObject *obj = gObjectList.findObject(id); @@ -214,6 +189,10 @@ bool LLFloaterAvatarRenderSettings::isActionChecked(const LLSD& userdata, const { return (visual_setting == S32(LLVOAvatar::AV_RENDER_NORMALLY)); } + else if ("non_default" == command_name) + { + return (visual_setting != S32(LLVOAvatar::AV_RENDER_NORMALLY)); + } else if ("never" == command_name) { return (visual_setting == S32(LLVOAvatar::AV_DO_NOT_RENDER)); diff --git a/indra/newview/llfloateravatarrendersettings.h b/indra/newview/llfloateravatarrendersettings.h index 00ee074f17..2e0a844afd 100644 --- a/indra/newview/llfloateravatarrendersettings.h +++ b/indra/newview/llfloateravatarrendersettings.h @@ -48,7 +48,6 @@ public: void onAvatarListRightClick(LLUICtrl* ctrl, S32 x, S32 y); void updateList(); - void onFilterEdit(const std::string& search_string); void onCustomAction (const LLSD& userdata, const LLUUID& av_id); bool isActionChecked(const LLSD& userdata, const LLUUID& av_id); void onClickAdd(const LLSD& userdata); @@ -59,15 +58,12 @@ public: static void setNeedsUpdate(); private: - bool isHiddenRow(const std::string& av_name); void callbackAvatarPicked(const uuid_vec_t& ids, S32 visual_setting); void removePicker(); bool mNeedsUpdate; LLListContextMenu* mContextMenu; LLNameListCtrl* mAvatarSettingsList; - - std::string mNameFilter; }; diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index 16afeb6e52..a2fb8c130d 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -31,6 +31,7 @@ #include "llappearancemgr.h" #include "llavataractions.h" #include "llavatarrendernotifier.h" +#include "llcheckboxctrl.h" #include "llfeaturemanager.h" #include "llfloaterpreference.h" // LLAvatarComplexityControls #include "llfloaterreg.h" @@ -38,52 +39,69 @@ #include "llsliderctrl.h" #include "lltextbox.h" #include "lltrans.h" +#include "llviewerobjectlist.h" #include "llvoavatar.h" #include "llvoavatarself.h" +#include "pipeline.h" const F32 REFRESH_INTERVAL = 1.0f; -const S32 COMPLEXITY_THRESHOLD_HIGH = 100000; -const S32 COMPLEXITY_THRESHOLD_MEDIUM = 30000; const S32 BAR_LEFT_PAD = 2; const S32 BAR_RIGHT_PAD = 5; const S32 BAR_BOTTOM_PAD = 9; +class LLExceptionsContextMenu : public LLListContextMenu +{ +public: + LLExceptionsContextMenu(LLFloaterPerformance* floater_settings) + : mFloaterPerformance(floater_settings) + {} +protected: + LLContextMenu* createMenu() + { + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; + registrar.add("Settings.SetRendering", boost::bind(&LLFloaterPerformance::onCustomAction, mFloaterPerformance, _2, mUUIDs.front())); + enable_registrar.add("Settings.IsSelected", boost::bind(&LLFloaterPerformance::isActionChecked, mFloaterPerformance, _2, mUUIDs.front())); + LLContextMenu* menu = createFromFile("menu_avatar_rendering_settings.xml"); + + return menu; + } + + LLFloaterPerformance* mFloaterPerformance; +}; + LLFloaterPerformance::LLFloaterPerformance(const LLSD& key) : LLFloater(key), mUpdateTimer(new LLTimer()), mNearbyMaxComplexity(0) { + mContextMenu = new LLExceptionsContextMenu(this); } LLFloaterPerformance::~LLFloaterPerformance() { mComplexityChangedSignal.disconnect(); + delete mContextMenu; delete mUpdateTimer; } BOOL LLFloaterPerformance::postBuild() { mMainPanel = getChild("panel_performance_main"); - mTroubleshootingPanel = getChild("panel_performance_troubleshooting"); mNearbyPanel = getChild("panel_performance_nearby"); mComplexityPanel = getChild("panel_performance_complexity"); mSettingsPanel = getChild("panel_performance_preferences"); mHUDsPanel = getChild("panel_performance_huds"); - mPresetsPanel = getChild("panel_performance_presets"); - getChild("troubleshooting_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mTroubleshootingPanel)); getChild("nearby_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mNearbyPanel)); getChild("complexity_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mComplexityPanel)); getChild("settings_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mSettingsPanel)); getChild("huds_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mHUDsPanel)); - getChild("presets_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mPresetsPanel)); - initBackBtn(mTroubleshootingPanel); initBackBtn(mNearbyPanel); initBackBtn(mComplexityPanel); initBackBtn(mSettingsPanel); initBackBtn(mHUDsPanel); - initBackBtn(mPresetsPanel); mHUDList = mHUDsPanel->getChild("hud_list"); mHUDList->setNameListType(LLNameListCtrl::SPECIAL); @@ -96,12 +114,12 @@ BOOL LLFloaterPerformance::postBuild() mObjectList->setIconClickedCallback(boost::bind(&LLFloaterPerformance::detachItem, this, _1)); mSettingsPanel->getChild("advanced_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickAdvanced, this)); + mSettingsPanel->getChild("hide_avatars")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickHideAvatars, this)); + mSettingsPanel->getChild("hide_avatars")->set(!LLPipeline::hasRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR)); mNearbyPanel->getChild("exceptions_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickExceptions, this)); mNearbyList = mNearbyPanel->getChild("nearby_list"); - - mPresetsPanel->getChild("avatars_nearby_link")->setURLClickedCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mNearbyPanel)); - mPresetsPanel->getChild("settings_link")->setURLClickedCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mSettingsPanel)); + mNearbyList->setRightMouseDownCallback(boost::bind(&LLFloaterPerformance::onAvatarListRightClick, this, _1, _2, _3)); updateComplexityText(); mComplexityChangedSignal = gSavedSettings.getControl("IndirectMaxComplexity")->getCommitSignal()->connect(boost::bind(&LLFloaterPerformance::updateComplexityText, this)); @@ -134,28 +152,27 @@ void LLFloaterPerformance::showSelectedPanel(LLPanel* selected_panel) void LLFloaterPerformance::draw() { + const S32 NUM_PERIODS = 50; + if (mUpdateTimer->hasExpired()) { - getChild("fps_value")->setValue((S32)llround(LLTrace::get_frame_recording().getPeriodMeanPerSec(LLStatViewer::FPS))); - if (mMainPanel->getVisible()) - { - mMainPanel->getChild("huds_value")->setValue(LLHUDRenderNotifier::getInstance()->getHUDsCount()); - mMainPanel->getChild("complexity_value")->setValue((S32)gAgentAvatarp->getVisualComplexity()); - updateNearbyComplexityDesc(); - } - else if (mHUDsPanel->getVisible()) + getChild("fps_value")->setValue((S32)llround(LLTrace::get_frame_recording().getPeriodMeanPerSec(LLStatViewer::FPS, NUM_PERIODS))); + if (mHUDsPanel->getVisible()) { populateHUDList(); } else if (mNearbyPanel->getVisible()) { populateNearbyList(); - updateNearbyComplexityDesc(); } else if (mComplexityPanel->getVisible()) { populateObjectList(); } + else if (mSettingsPanel->getVisible()) + { + mSettingsPanel->getChild("hide_avatars")->set(!LLPipeline::hasRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR)); + } mUpdateTimer->setTimerExpirySec(REFRESH_INTERVAL); } @@ -170,12 +187,10 @@ void LLFloaterPerformance::showMainPanel() void LLFloaterPerformance::hidePanels() { - mTroubleshootingPanel->setVisible(FALSE); mNearbyPanel->setVisible(FALSE); mComplexityPanel->setVisible(FALSE); mHUDsPanel->setVisible(FALSE); mSettingsPanel->setVisible(FALSE); - mPresetsPanel->setVisible(FALSE); } void LLFloaterPerformance::initBackBtn(LLPanel* panel) @@ -236,8 +251,6 @@ void LLFloaterPerformance::populateHUDList() mHUDList->sortByColumnIndex(1, FALSE); mHUDList->setScrollPos(prev_pos); mHUDList->selectItemBySpecialId(prev_selected_id); - - mHUDsPanel->getChild("huds_value")->setValue(std::to_string(complexity_list.size())); } void LLFloaterPerformance::populateObjectList() @@ -384,32 +397,6 @@ void LLFloaterPerformance::getNearbyAvatars(std::vector &valid_nea } } -void LLFloaterPerformance::updateNearbyComplexityDesc() -{ - std::string desc = getString("low"); - - static LLCachedControl max_render_cost(gSavedSettings, "RenderAvatarMaxComplexity", 0); - if (mMainPanel->getVisible()) - { - std::vector valid_nearby_avs; - getNearbyAvatars(valid_nearby_avs); - } - if (mNearbyMaxComplexity > COMPLEXITY_THRESHOLD_HIGH) - { - desc = getString("very_high"); - } - else if (mNearbyMaxComplexity > COMPLEXITY_THRESHOLD_MEDIUM) - { - desc = getString("medium"); - } - - if (mMainPanel->getVisible()) - { - mMainPanel->getChild("avatars_nearby_value")->setValue(desc); - } - mNearbyPanel->getChild("av_nearby_value")->setValue(desc); -} - void LLFloaterPerformance::detachItem(const LLUUID& item_id) { LLAppearanceMgr::instance().removeItemFromAvatar(item_id); @@ -425,6 +412,11 @@ void LLFloaterPerformance::onClickAdvanced() LLFloaterReg::showInstance("prefs_graphics_advanced"); } +void LLFloaterPerformance::onClickHideAvatars() +{ + LLPipeline::toggleRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR); +} + void LLFloaterPerformance::onClickExceptions() { LLFloaterReg::showInstance("avatar_render_settings"); @@ -443,4 +435,90 @@ void LLFloaterPerformance::updateComplexityText() mNearbyPanel->getChild("IndirectMaxComplexityText", true)); } +static LLVOAvatar* find_avatar(const LLUUID& id) +{ + LLViewerObject *obj = gObjectList.findObject(id); + while (obj && obj->isAttachment()) + { + obj = (LLViewerObject *)obj->getParent(); + } + + if (obj && obj->isAvatar()) + { + return (LLVOAvatar*)obj; + } + else + { + return NULL; + } +} + +void LLFloaterPerformance::onCustomAction(const LLSD& userdata, const LLUUID& av_id) +{ + const std::string command_name = userdata.asString(); + + S32 new_setting = 0; + if ("default" == command_name) + { + new_setting = S32(LLVOAvatar::AV_RENDER_NORMALLY); + } + else if ("never" == command_name) + { + new_setting = S32(LLVOAvatar::AV_DO_NOT_RENDER); + } + else if ("always" == command_name) + { + new_setting = S32(LLVOAvatar::AV_ALWAYS_RENDER); + } + + LLVOAvatar *avatarp = find_avatar(av_id); + if (avatarp) + { + avatarp->setVisualMuteSettings(LLVOAvatar::VisualMuteSettings(new_setting)); + } + else + { + LLRenderMuteList::getInstance()->saveVisualMuteSetting(av_id, new_setting); + } +} + + +bool LLFloaterPerformance::isActionChecked(const LLSD& userdata, const LLUUID& av_id) +{ + const std::string command_name = userdata.asString(); + + S32 visual_setting = LLRenderMuteList::getInstance()->getSavedVisualMuteSetting(av_id); + if ("default" == command_name) + { + return (visual_setting == S32(LLVOAvatar::AV_RENDER_NORMALLY)); + } + else if ("non_default" == command_name) + { + return (visual_setting != S32(LLVOAvatar::AV_RENDER_NORMALLY)); + } + else if ("never" == command_name) + { + return (visual_setting == S32(LLVOAvatar::AV_DO_NOT_RENDER)); + } + else if ("always" == command_name) + { + return (visual_setting == S32(LLVOAvatar::AV_ALWAYS_RENDER)); + } + return false; +} + +void LLFloaterPerformance::onAvatarListRightClick(LLUICtrl* ctrl, S32 x, S32 y) +{ + LLNameListCtrl* list = dynamic_cast(ctrl); + if (!list) return; + list->selectItemAt(x, y, MASK_NONE); + uuid_vec_t selected_uuids; + + if(list->getCurrentID().notNull()) + { + selected_uuids.push_back(list->getCurrentID()); + mContextMenu->show(ctrl, selected_uuids, x, y); + } +} + // EOF diff --git a/indra/newview/llfloaterperformance.h b/indra/newview/llfloaterperformance.h index ea15873b95..58f9447d4c 100644 --- a/indra/newview/llfloaterperformance.h +++ b/indra/newview/llfloaterperformance.h @@ -27,6 +27,7 @@ #define LL_LLFLOATERPERFORMANCE_H #include "llfloater.h" +#include "lllistcontextmenu.h" class LLCharacter; class LLNameListCtrl; @@ -46,6 +47,11 @@ public: void detachItem(const LLUUID& item_id); + void onAvatarListRightClick(LLUICtrl* ctrl, S32 x, S32 y); + + void onCustomAction (const LLSD& userdata, const LLUUID& av_id); + bool isActionChecked(const LLSD& userdata, const LLUUID& av_id); + private: void initBackBtn(LLPanel* panel); void populateHUDList(); @@ -53,25 +59,25 @@ private: void populateNearbyList(); void onClickAdvanced(); + void onClickHideAvatars(); void onClickExceptions(); void updateMaxComplexity(); void updateComplexityText(); void getNearbyAvatars(std::vector &valid_nearby_avs); - void updateNearbyComplexityDesc(); LLPanel* mMainPanel; - LLPanel* mTroubleshootingPanel; LLPanel* mNearbyPanel; LLPanel* mComplexityPanel; LLPanel* mHUDsPanel; LLPanel* mSettingsPanel; - LLPanel* mPresetsPanel; LLNameListCtrl* mHUDList; LLNameListCtrl* mObjectList; LLNameListCtrl* mNearbyList; + LLListContextMenu* mContextMenu; + LLTimer* mUpdateTimer; S32 mNearbyMaxComplexity; diff --git a/indra/newview/skins/default/xui/en/floater_avatar_render_settings.xml b/indra/newview/skins/default/xui/en/floater_avatar_render_settings.xml index e088d4d2a1..d222dca98b 100644 --- a/indra/newview/skins/default/xui/en/floater_avatar_render_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_avatar_render_settings.xml @@ -10,7 +10,7 @@ save_rect="true" single_instance="true" reuse_instance="true" - title="AVATAR RENDER SETTINGS" + title="AVATAR DISPLAY EXCEPTIONS" width="300"> - - + top="0"> + relative_width="0.65" /> - + relative_width="0.35" /> + + + diff --git a/indra/newview/skins/default/xui/en/floater_performance.xml b/indra/newview/skins/default/xui/en/floater_performance.xml index 039421d589..210b2f8792 100644 --- a/indra/newview/skins/default/xui/en/floater_performance.xml +++ b/indra/newview/skins/default/xui/en/floater_performance.xml @@ -1,20 +1,11 @@ - - - - FPS -- 60 or more for the best experience - - - - - + frames per second + - Quick settings for common situations + left="395" + top="7" + name="fps_desc1_lbl" + width="150"> + Allow 5-10 seconds for - Choose settings for parties, exploration, photography, and more. + top_pad="-3" + name="fps_desc2_lbl" + width="150"> + changes to take full effect. - + + + left="10" + top="5"> - Individual settings + Graphics settings - More control over quality, visibility distance, and enhancements. + Choose settings for distance, water, lighting and more. - Nearby avatar complexity is - - - very high + Avatars nearby - Choose which avatars are not displayed in detail, to increase FPS. + Manage which nearby avatars are fully displayed. - Your avatar complexity is - - - 275 + Your avatar complexity Reduce the complexity of your avatar if you aren't satisfied with current FPS. @@ -278,7 +222,7 @@ mouse_opaque="true" name="icon_arrow4" follows="right|top" - top="24" + top="29" right="-20"/> - Your current HUDs: - - - 7 + Your active HUDs Removing HUDs you are not using can improve speed. @@ -335,72 +268,10 @@ mouse_opaque="true" name="icon_arrow4" follows="right|top" - top="24" - right="-20"/> - - - - General troubleshooting - - - Choose among common problems and see what you can do. - - - - - - - - - + - - + + + + + + + diff --git a/indra/newview/skins/default/xui/en/menu_avatar_rendering_settings_add.xml b/indra/newview/skins/default/xui/en/menu_avatar_rendering_settings_add.xml index c64b24ed70..6e09eb5981 100644 --- a/indra/newview/skins/default/xui/en/menu_avatar_rendering_settings_add.xml +++ b/indra/newview/skins/default/xui/en/menu_avatar_rendering_settings_add.xml @@ -4,13 +4,13 @@ left="0" bottom="0" visible="false" mouse_opaque="false"> diff --git a/indra/newview/skins/default/xui/en/panel_performance_complexity.xml b/indra/newview/skins/default/xui/en/panel_performance_complexity.xml index 8d4512c4f7..b2f65f9488 100644 --- a/indra/newview/skins/default/xui/en/panel_performance_complexity.xml +++ b/indra/newview/skins/default/xui/en/panel_performance_complexity.xml @@ -42,7 +42,7 @@ top_pad="10" name="attachments_title" width="195"> - My avatar complexity + Your avatar complexity - Complex attachments require more time and memory to display. + If your avatar is very complex, some other people may not see you in full detail and - While you are in this location, removing the most complex ones may increase speed. + your own graphics speed may be reduced. - Your current HUDs: - - - 7 + Your active HUDs - Detaching HUDs you aren't using us always a good idea, but especially in a complex location. + Detaching HUDs you aren't using saves memory and can make Second Life run faster. - Note: Using a HUD's minimize button does not save memory. + Note: Using a HUD's minimize button does not detach it. - Nearby avatar complexity is - - - very high + Avatars nearby - Some avatars nearby are slow to display. Choosing a complexity limit may help graphics speed. + Avatars more complex than your chosen limit will be shown in silhouette. - Individual settings + Graphics settings - Graphics quality -shortcuts + Shortcuts - To zoom out and see long distances, increase the distance. - - - If you are indoors, decrease the distance to improve speed. + To see more land when you zoom out, increase the distance. - Enhancements + Environment - + + + Shadows: + + + + + + + + + Water + + + Reducing or turning off water effects can greatly improve frame rate. + - - Shadows: - - + - - - - + top_pad="20" + left="20" + name="photo_lbl" + width="100"> + Photography + - [secondlife:/// What do these settings mean?] + Maximum detail is good for photos, but can slow frame rate. + + + + (Enter value between 0.0 and 4.0) + + diff --git a/indra/newview/skins/default/xui/en/panel_performance_presets.xml b/indra/newview/skins/default/xui/en/panel_performance_presets.xml deleted file mode 100644 index 51516020a2..0000000000 --- a/indra/newview/skins/default/xui/en/panel_performance_presets.xml +++ /dev/null @@ -1,223 +0,0 @@ - - - - - Back - - - Quick settings - - - Note: Quick settings will reset all manual changes you have made. - - - - - Tuned for many avatars in a room. - - - Nearby avatar complexity is high. - - - [secondlife:/// Choose avatars to show and hide] - - - - - Fewer avatars, higher visibility distance. - - - - - Good for zooming your camera far out and viewing large land areas. - - - - - Maximum quality, minimum visibility distance. - - - - For more control, try - - - [secondlife:/// Idividual Settings] - - - diff --git a/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml b/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml deleted file mode 100644 index 0a14eeb1c0..0000000000 --- a/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml +++ /dev/null @@ -1,190 +0,0 @@ - - - - - Back - - - Fixes for common problems - - - Some problems result from the complexity of the location where you are. All you can do is leave. - - - Rubberbanding - - - When you walk, your avatar may be pulled backward again and again. - - - Fix: XXXXXXX - - - Texture thrashing - - - On objects near you, you may see their surfaces get blurry, then sharp, then blurry again. - - - Fix: XXXXXXX - - - Avatars are not moving smoothly - - - Lorem ipsum dolor sit amet. - - - Fix: XXXXXXX - - - Will a better graphics card or new computer help? - - - Lorem ipsum dolor sit amet. - - - Fix: XXXXXXX - - -- cgit v1.2.3 From 84ae60a3b34d92930a74e9207bf39e6335e307a0 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 16 Jul 2021 16:32:12 +0300 Subject: SL-15581 Add the function to get median FPS --- indra/llcommon/lltracerecording.h | 25 +++++++++++++++++++++++++ indra/newview/llfloaterperformance.cpp | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h index d0b4a842a6..2af5273d70 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -580,6 +580,31 @@ namespace LLTrace return typename RelatedTypes::fractional_t(getPeriodMeanPerSec(static_cast&>(stat), num_periods)); } + template + typename RelatedTypes::fractional_t getPeriodMedianPerSec(const StatType& stat, S32 num_periods = S32_MAX) + { + num_periods = llmin(num_periods, getNumRecordedPeriods()); + + std::vector ::fractional_t> buf; + for (S32 i = 1; i <= num_periods; i++) + { + Recording& recording = getPrevRecording(i); + if (recording.getDuration() > (F32Seconds)0.f) + { + buf.push_back(recording.getPerSec(stat)); + } + } + std::sort(buf.begin(), buf.end()); + + return typename RelatedTypes::fractional_t((buf.size() % 2 == 0) ? (buf[buf.size() / 2 - 1] + buf[buf.size() / 2]) / 2 : buf[buf.size() / 2]); + } + + template + typename RelatedTypes::fractional_t getPeriodMedianPerSec(const CountStatHandle& stat, S32 num_periods = S32_MAX) + { + return typename RelatedTypes::fractional_t(getPeriodMedianPerSec(static_cast&>(stat), num_periods)); + } + // // PERIODIC STANDARD DEVIATION // diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index a2fb8c130d..879a8f8718 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -156,7 +156,7 @@ void LLFloaterPerformance::draw() if (mUpdateTimer->hasExpired()) { - getChild("fps_value")->setValue((S32)llround(LLTrace::get_frame_recording().getPeriodMeanPerSec(LLStatViewer::FPS, NUM_PERIODS))); + getChild("fps_value")->setValue((S32)llround(LLTrace::get_frame_recording().getPeriodMedianPerSec(LLStatViewer::FPS, NUM_PERIODS))); if (mHUDsPanel->getVisible()) { populateHUDList(); -- cgit v1.2.3 From 928191f525cf8a02816718eefd9a65097d8ecb8b Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 19 Jul 2021 20:07:03 +0300 Subject: SL-15297 performance floater UI update #2 --- indra/llui/llscrolllistcell.cpp | 3 +- indra/llui/llscrolllistcell.h | 1 + indra/newview/llfloaterperformance.cpp | 89 ++++++++++++++-------- indra/newview/llfloaterpreference.cpp | 9 ++- indra/newview/llfloaterpreference.h | 4 +- indra/newview/llnamelistctrl.cpp | 2 +- indra/newview/llviewermenu.cpp | 2 + .../skins/default/xui/en/floater_performance.xml | 42 +++++----- .../skins/default/xui/en/menu_attachment_other.xml | 28 +++---- .../skins/default/xui/en/menu_avatar_other.xml | 64 ++++++++-------- indra/newview/skins/default/xui/en/menu_viewer.xml | 15 ++-- .../xui/en/panel_performance_complexity.xml | 20 ++++- .../default/xui/en/panel_performance_huds.xml | 4 +- .../default/xui/en/panel_performance_nearby.xml | 75 ++++++++++++++++-- .../xui/en/panel_performance_preferences.xml | 47 ++++-------- indra/newview/skins/default/xui/en/strings.xml | 2 +- 16 files changed, 249 insertions(+), 158 deletions(-) (limited to 'indra') diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp index c5f53823f3..61470d1440 100644 --- a/indra/llui/llscrolllistcell.cpp +++ b/indra/llui/llscrolllistcell.cpp @@ -234,8 +234,7 @@ void LLScrollListBar::draw(const LLColor4& color, const LLColor4& highlight_colo S32 left = bar_width - bar_width * mRatio; left = llclamp(left, mLeftPad, getWidth() - mRightPad - 1); - gl_line_2d(left, mBottom, getWidth() - mRightPad, mBottom, mColor); - gl_line_2d(left, mBottom - 1, getWidth() - mRightPad, mBottom - 1, mColor); + gl_rect_2d(left, mBottom, getWidth() - mRightPad, mBottom - 1, mColor); } // diff --git a/indra/llui/llscrolllistcell.h b/indra/llui/llscrolllistcell.h index 26a272b270..9a659dfd0d 100644 --- a/indra/llui/llscrolllistcell.h +++ b/indra/llui/llscrolllistcell.h @@ -154,6 +154,7 @@ public: void setText(const LLStringExplicit& text); void setFontStyle(const U8 font_style); + void setAlignment(LLFontGL::HAlign align) { mFontAlignment = align; } protected: LLUIString mText; diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index 879a8f8718..d7c0527b5c 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -114,10 +114,10 @@ BOOL LLFloaterPerformance::postBuild() mObjectList->setIconClickedCallback(boost::bind(&LLFloaterPerformance::detachItem, this, _1)); mSettingsPanel->getChild("advanced_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickAdvanced, this)); - mSettingsPanel->getChild("hide_avatars")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickHideAvatars, this)); - mSettingsPanel->getChild("hide_avatars")->set(!LLPipeline::hasRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR)); mNearbyPanel->getChild("exceptions_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickExceptions, this)); + mNearbyPanel->getChild("hide_avatars")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickHideAvatars, this)); + mNearbyPanel->getChild("hide_avatars")->set(!LLPipeline::hasRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR)); mNearbyList = mNearbyPanel->getChild("nearby_list"); mNearbyList->setRightMouseDownCallback(boost::bind(&LLFloaterPerformance::onAvatarListRightClick, this, _1, _2, _3)); @@ -164,15 +164,12 @@ void LLFloaterPerformance::draw() else if (mNearbyPanel->getVisible()) { populateNearbyList(); + mNearbyPanel->getChild("hide_avatars")->set(!LLPipeline::hasRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR)); } else if (mComplexityPanel->getVisible()) { populateObjectList(); } - else if (mSettingsPanel->getVisible()) - { - mSettingsPanel->getChild("hide_avatars")->set(!LLPipeline::hasRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR)); - } mUpdateTimer->setTimerExpirySec(REFRESH_INTERVAL); } @@ -223,7 +220,7 @@ void LLFloaterPerformance::populateHUDList() for (iter = complexity_list.begin(); iter != end; ++iter) { LLHUDComplexity hud_object_complexity = *iter; - + S32 obj_cost_short = hud_object_complexity.objectsCost / 1000; LLSD item; item["special_id"] = hud_object_complexity.objectId; item["target"] = LLNameListCtrl::SPECIAL; @@ -231,14 +228,14 @@ void LLFloaterPerformance::populateHUDList() row[0]["column"] = "complex_visual"; row[0]["type"] = "bar"; LLSD& value = row[0]["value"]; - value["ratio"] = (F32)hud_object_complexity.objectsCost / max_complexity; + value["ratio"] = (F32)obj_cost_short / max_complexity * 1000; value["bottom"] = BAR_BOTTOM_PAD; value["left_pad"] = BAR_LEFT_PAD; value["right_pad"] = BAR_RIGHT_PAD; row[1]["column"] = "complex_value"; row[1]["type"] = "text"; - row[1]["value"] = std::to_string(hud_object_complexity.objectsCost); + row[1]["value"] = std::to_string(obj_cost_short); row[1]["font"]["name"] = "SANSSERIF"; row[2]["column"] = "name"; @@ -246,7 +243,15 @@ void LLFloaterPerformance::populateHUDList() row[2]["value"] = hud_object_complexity.objectName; row[2]["font"]["name"] = "SANSSERIF"; - mHUDList->addElement(item); + LLScrollListItem* obj = mHUDList->addElement(item); + if (obj) + { + LLScrollListText* value_text = dynamic_cast(obj->getColumn(1)); + if (value_text) + { + value_text->setAlignment(LLFontGL::HCENTER); + } + } } mHUDList->sortByColumnIndex(1, FALSE); mHUDList->setScrollPos(prev_pos); @@ -274,7 +279,7 @@ void LLFloaterPerformance::populateObjectList() for (iter = complexity_list.begin(); iter != end; ++iter) { LLObjectComplexity object_complexity = *iter; - + S32 obj_cost_short = object_complexity.objectCost / 1000; LLSD item; item["special_id"] = object_complexity.objectId; item["target"] = LLNameListCtrl::SPECIAL; @@ -282,14 +287,14 @@ void LLFloaterPerformance::populateObjectList() row[0]["column"] = "complex_visual"; row[0]["type"] = "bar"; LLSD& value = row[0]["value"]; - value["ratio"] = (F32)object_complexity.objectCost / max_complexity; + value["ratio"] = (F32)obj_cost_short / max_complexity * 1000; value["bottom"] = BAR_BOTTOM_PAD; value["left_pad"] = BAR_LEFT_PAD; value["right_pad"] = BAR_RIGHT_PAD; row[1]["column"] = "complex_value"; row[1]["type"] = "text"; - row[1]["value"] = std::to_string(object_complexity.objectCost); + row[1]["value"] = std::to_string(obj_cost_short); row[1]["font"]["name"] = "SANSSERIF"; row[2]["column"] = "name"; @@ -297,7 +302,15 @@ void LLFloaterPerformance::populateObjectList() row[2]["value"] = object_complexity.objectName; row[2]["font"]["name"] = "SANSSERIF"; - mObjectList->addElement(item); + LLScrollListItem* obj = mObjectList->addElement(item); + if (obj) + { + LLScrollListText* value_text = dynamic_cast(obj->getColumn(1)); + if (value_text) + { + value_text->setAlignment(LLFontGL::HCENTER); + } + } } mObjectList->sortByColumnIndex(1, FALSE); mObjectList->setScrollPos(prev_pos); @@ -321,20 +334,21 @@ void LLFloaterPerformance::populateNearbyList() LLVOAvatar* avatar = dynamic_cast(*char_iter); if (avatar && (LLVOAvatar::AOA_INVISIBLE != avatar->getOverallAppearance())) { + S32 complexity_short = avatar->getVisualComplexity() / 1000; LLSD item; item["id"] = avatar->getID(); LLSD& row = item["columns"]; row[0]["column"] = "complex_visual"; row[0]["type"] = "bar"; LLSD& value = row[0]["value"]; - value["ratio"] = (F32)avatar->getVisualComplexity() / mNearbyMaxComplexity; + value["ratio"] = (F32)complexity_short / mNearbyMaxComplexity * 1000; value["bottom"] = BAR_BOTTOM_PAD; value["left_pad"] = BAR_LEFT_PAD; value["right_pad"] = BAR_RIGHT_PAD; row[1]["column"] = "complex_value"; row[1]["type"] = "text"; - row[1]["value"] = std::to_string( avatar->getVisualComplexity()); + row[1]["value"] = std::to_string(complexity_short); row[1]["font"]["name"] = "SANSSERIF"; row[2]["column"] = "name"; @@ -345,24 +359,36 @@ void LLFloaterPerformance::populateNearbyList() LLScrollListItem* av_item = mNearbyList->addElement(item); if(av_item) { + LLScrollListText* value_text = dynamic_cast(av_item->getColumn(1)); + if (value_text) + { + value_text->setAlignment(LLFontGL::HCENTER); + } LLScrollListText* name_text = dynamic_cast(av_item->getColumn(2)); if (name_text) { - std::string color = "white"; - if (LLVOAvatar::AOA_JELLYDOLL == avatar->getOverallAppearance()) + if (avatar->isSelf()) { - color = "LabelDisabledColor"; - LLScrollListBar* bar = dynamic_cast(av_item->getColumn(0)); - if (bar) - { - bar->setColor(LLUIColorTable::instance().getColor(color)); - } + name_text->setColor(LLUIColorTable::instance().getColor("DrYellow")); } - else if (LLVOAvatar::AOA_NORMAL == avatar->getOverallAppearance()) + else { - color = LLAvatarActions::isFriend(avatar->getID()) ? "ConversationFriendColor" : "white"; + std::string color = "white"; + if (LLVOAvatar::AOA_JELLYDOLL == avatar->getOverallAppearance()) + { + color = "LabelDisabledColor"; + LLScrollListBar* bar = dynamic_cast(av_item->getColumn(0)); + if (bar) + { + bar->setColor(LLUIColorTable::instance().getColor(color)); + } + } + else if (LLVOAvatar::AOA_NORMAL == avatar->getOverallAppearance()) + { + color = LLAvatarActions::isFriend(avatar->getID()) ? "ConversationFriendColor" : "white"; + } + name_text->setColor(LLUIColorTable::instance().getColor(color)); } - name_text->setColor(LLUIColorTable::instance().getColor(color)); } } } @@ -376,12 +402,13 @@ void LLFloaterPerformance::populateNearbyList() void LLFloaterPerformance::getNearbyAvatars(std::vector &valid_nearby_avs) { static LLCachedControl render_far_clip(gSavedSettings, "RenderFarClip", 64); + mNearbyMaxComplexity = 0; F32 radius = render_far_clip * render_far_clip; std::vector::iterator char_iter = LLCharacter::sInstances.begin(); while (char_iter != LLCharacter::sInstances.end()) { LLVOAvatar* avatar = dynamic_cast(*char_iter); - if (avatar && !avatar->isDead() && !avatar->isControlAvatar() && !avatar->isSelf()) + if (avatar && !avatar->isDead() && !avatar->isControlAvatar()) { if ((dist_vec_squared(avatar->getPositionGlobal(), gAgent.getPositionGlobal()) > radius) && (dist_vec_squared(avatar->getPositionGlobal(), gAgentCamera.getCameraPositionGlobal()) > radius)) @@ -426,13 +453,15 @@ void LLFloaterPerformance::updateMaxComplexity() { LLAvatarComplexityControls::updateMax( mNearbyPanel->getChild("IndirectMaxComplexity"), - mNearbyPanel->getChild("IndirectMaxComplexityText")); + mNearbyPanel->getChild("IndirectMaxComplexityText"), + true); } void LLFloaterPerformance::updateComplexityText() { LLAvatarComplexityControls::setText(gSavedSettings.getU32("RenderAvatarMaxComplexity"), - mNearbyPanel->getChild("IndirectMaxComplexityText", true)); + mNearbyPanel->getChild("IndirectMaxComplexityText", true), + true); } static LLVOAvatar* find_avatar(const LLUUID& id) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 1ab6621c4c..a0a0b3c874 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1455,7 +1455,7 @@ void LLFloaterPreference::refreshUI() refresh(); } -void LLAvatarComplexityControls::updateMax(LLSliderCtrl* slider, LLTextBox* value_label) +void LLAvatarComplexityControls::updateMax(LLSliderCtrl* slider, LLTextBox* value_label, bool short_val) { // Called when the IndirectMaxComplexity control changes // Responsible for fixing the slider label (IndirectMaxComplexityText) and setting RenderAvatarMaxComplexity @@ -1477,10 +1477,10 @@ void LLAvatarComplexityControls::updateMax(LLSliderCtrl* slider, LLTextBox* valu } gSavedSettings.setU32("RenderAvatarMaxComplexity", (U32)max_arc); - setText(max_arc, value_label); + setText(max_arc, value_label, short_val); } -void LLAvatarComplexityControls::setText(U32 value, LLTextBox* text_box) +void LLAvatarComplexityControls::setText(U32 value, LLTextBox* text_box, bool short_val) { if (0 == value) { @@ -1488,7 +1488,8 @@ void LLAvatarComplexityControls::setText(U32 value, LLTextBox* text_box) } else { - text_box->setText(llformat("%d", value)); + std::string text_value = short_val ? llformat("%d", value / 1000) : llformat("%d", value); + text_box->setText(text_value); } } diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index f86104ed99..23d3f73d70 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -351,8 +351,8 @@ private: class LLAvatarComplexityControls { public: - static void updateMax(LLSliderCtrl* slider, LLTextBox* value_label); - static void setText(U32 value, LLTextBox* text_box); + static void updateMax(LLSliderCtrl* slider, LLTextBox* value_label, bool short_val = false); + static void setText(U32 value, LLTextBox* text_box, bool short_val = false); static void setIndirectControls(); static void setIndirectMaxNonImpostors(); static void setIndirectMaxArc(); diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 92805e03f0..c24c74393d 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -363,7 +363,7 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( else if (LLAvatarNameCache::get(id, &av_name)) { if (mShortNames) - fullname = av_name.getDisplayName(); + fullname = av_name.getDisplayName(true); else fullname = av_name.getCompleteName(); } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index ad81cb07c1..fa2ada32b3 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3149,6 +3149,8 @@ class LLAvatarCheckImpostorMode : public view_listener_t return (avatar->getVisualMuteSettings() == LLVOAvatar::AV_DO_NOT_RENDER); case 2: return (avatar->getVisualMuteSettings() == LLVOAvatar::AV_ALWAYS_RENDER); + case 4: + return (avatar->getVisualMuteSettings() != LLVOAvatar::AV_RENDER_NORMALLY); default: return false; } diff --git a/indra/newview/skins/default/xui/en/floater_performance.xml b/indra/newview/skins/default/xui/en/floater_performance.xml index 210b2f8792..c47b8100c2 100644 --- a/indra/newview/skins/default/xui/en/floater_performance.xml +++ b/indra/newview/skins/default/xui/en/floater_performance.xml @@ -1,6 +1,6 @@ @@ -93,7 +93,7 @@ border="true" bevel_style="none" follows="left|top" - height="70" + height="50" width="560" name="settings_subpanel" layout="topleft" @@ -107,7 +107,7 @@ layout="topleft" left="10" name="settings_lbl" - top="12" + top="7" width="180"> Graphics settings @@ -119,7 +119,7 @@ layout="topleft" left="10" name="settings_desc" - top_pad="10" + top_pad="0" width="395"> Choose settings for distance, water, lighting and more. @@ -130,7 +130,7 @@ mouse_opaque="true" name="icon_arrow3" follows="right|top" - top="29" + top="19" right="-20"/> + top_pad="10"> Avatars nearby @@ -165,7 +165,7 @@ layout="topleft" left="10" name="avatars_nearby_desc" - top_pad="10" + top_pad="0" width="395"> Manage which nearby avatars are fully displayed. @@ -176,7 +176,7 @@ mouse_opaque="true" name="icon_arrow2" follows="right|top" - top="29" + top="19" right="-20"/> + top_pad="10"> Your avatar complexity @@ -211,7 +211,7 @@ layout="topleft" left="10" name="complexity_info" - top_pad="10" + top_pad="0" width="455"> Reduce the complexity of your avatar if you aren't satisfied with current FPS. @@ -222,7 +222,7 @@ mouse_opaque="true" name="icon_arrow4" follows="right|top" - top="29" + top="19" right="-20"/> + top_pad="10"> Your active HUDs @@ -257,7 +257,7 @@ layout="topleft" left="10" name="huds_desc" - top_pad="10" + top_pad="0" width="395"> Removing HUDs you are not using can improve speed. @@ -268,7 +268,7 @@ mouse_opaque="true" name="icon_arrow4" follows="right|top" - top="29" + top="19" right="-20"/> diff --git a/indra/newview/skins/default/xui/en/menu_attachment_other.xml b/indra/newview/skins/default/xui/en/menu_attachment_other.xml index 7ad692038e..22006c287f 100644 --- a/indra/newview/skins/default/xui/en/menu_attachment_other.xml +++ b/indra/newview/skins/default/xui/en/menu_attachment_other.xml @@ -131,22 +131,12 @@ - - - - + name="Render Avatar"> + label="Always full detail"> @@ -156,7 +146,7 @@ + label="Never full detail"> @@ -164,6 +154,16 @@ function="Avatar.SetImpostorMode" parameter="1" /> + + + + - - - - - - - - - - - - + name="Render Avatar"> + + + + + + + + + + + + - - - - + + + driver // | min1 max1 max2 min2 - for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ ) + for(auto& driven : mDriven) { - LLDrivenEntry* driven = &(*iter); - LLDrivenEntryInfo* info = driven->mInfo; + LLDrivenEntry* drivenp = &driven; + LLDrivenEntryInfo* info = drivenp->mInfo; F32 driven_weight = 0.f; - F32 driven_min = driven->mParam->getMinWeight(); - F32 driven_max = driven->mParam->getMaxWeight(); + F32 driven_min = drivenp->mParam->getMinWeight(); + F32 driven_max = drivenp->mParam->getMaxWeight(); if (mIsAnimating) { // driven param doesn't interpolate (textures, for example) - if (!driven->mParam->getAnimating()) + if (!drivenp->mParam->getAnimating()) { continue; } @@ -268,7 +266,7 @@ void LLDriverParam::setWeight(F32 weight) driven_weight = driven_min; } - setDrivenWeight(driven,driven_weight); + setDrivenWeight(drivenp,driven_weight); continue; } else @@ -292,23 +290,22 @@ void LLDriverParam::setWeight(F32 weight) driven_weight = driven_min; } - setDrivenWeight(driven,driven_weight); + setDrivenWeight(drivenp,driven_weight); continue; } } - driven_weight = getDrivenWeight(driven, mCurWeight); - setDrivenWeight(driven,driven_weight); + driven_weight = getDrivenWeight(drivenp, mCurWeight); + setDrivenWeight(drivenp,driven_weight); } } F32 LLDriverParam::getTotalDistortion() { F32 sum = 0.f; - for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ ) + for(auto& driven : mDriven) { - LLDrivenEntry* driven = &(*iter); - sum += driven->mParam->getTotalDistortion(); + sum += driven.mParam->getTotalDistortion(); } return sum; @@ -320,10 +317,9 @@ const LLVector4a &LLDriverParam::getAvgDistortion() LLVector4a sum; sum.clear(); S32 count = 0; - for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ ) + for(auto& driven : mDriven) { - LLDrivenEntry* driven = &(*iter); - sum.add(driven->mParam->getAvgDistortion()); + sum.add(driven.mParam->getAvgDistortion()); count++; } sum.mul( 1.f/(F32)count); @@ -335,10 +331,9 @@ const LLVector4a &LLDriverParam::getAvgDistortion() F32 LLDriverParam::getMaxDistortion() { F32 max = 0.f; - for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ ) + for(auto& driven : mDriven) { - LLDrivenEntry* driven = &(*iter); - F32 param_max = driven->mParam->getMaxDistortion(); + F32 param_max = driven.mParam->getMaxDistortion(); if( param_max > max ) { max = param_max; @@ -353,10 +348,9 @@ LLVector4a LLDriverParam::getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) { LLVector4a sum; sum.clear(); - for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ ) + for(auto& driven : mDriven) { - LLDrivenEntry* driven = &(*iter); - sum.add(driven->mParam->getVertexDistortion( index, poly_mesh )); + sum.add(driven.mParam->getVertexDistortion(index, poly_mesh)); } return sum; } @@ -365,13 +359,12 @@ const LLVector4a* LLDriverParam::getFirstDistortion(U32 *index, LLPolyMesh **pol { mCurrentDistortionParam = NULL; const LLVector4a* v = NULL; - for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ ) + for(auto& driven : mDriven) { - LLDrivenEntry* driven = &(*iter); - v = driven->mParam->getFirstDistortion( index, poly_mesh ); + v = driven.mParam->getFirstDistortion(index, poly_mesh); if( v ) { - mCurrentDistortionParam = driven->mParam; + mCurrentDistortionParam = driven.mParam; break; } } @@ -415,7 +408,7 @@ const LLVector4a* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **poly for( iter++; iter != mDriven.end(); iter++ ) { driven = &(*iter); - v = driven->mParam->getFirstDistortion( index, poly_mesh ); + v = driven->mParam->getFirstDistortion(index, poly_mesh); if( v ) { mCurrentDistortionParam = driven->mParam; @@ -448,14 +441,14 @@ void LLDriverParam::setAnimationTarget( F32 target_value) { LLVisualParam::setAnimationTarget(target_value); - for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ ) + for(auto& driven : mDriven) { - LLDrivenEntry* driven = &(*iter); - F32 driven_weight = getDrivenWeight(driven, mTargetWeight); + LLDrivenEntry* drivenp = &driven; + F32 driven_weight = getDrivenWeight(drivenp, mTargetWeight); // this isn't normally necessary, as driver params handle interpolation of their driven params // but texture params need to know to assume their final value at beginning of interpolation - driven->mParam->setAnimationTarget(driven_weight); + drivenp->mParam->setAnimationTarget(driven_weight); } } @@ -466,10 +459,9 @@ void LLDriverParam::stopAnimating() { LLVisualParam::stopAnimating(); - for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ ) + for(auto& driven : mDriven) { - LLDrivenEntry* driven = &(*iter); - driven->mParam->setAnimating(FALSE); + driven.mParam->setAnimating(FALSE); } } @@ -477,17 +469,15 @@ void LLDriverParam::stopAnimating() BOOL LLDriverParam::linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params) { BOOL success = TRUE; - LLDriverParamInfo::entry_info_list_t::iterator iter; - for (iter = getInfo()->mDrivenInfoList.begin(); iter != getInfo()->mDrivenInfoList.end(); ++iter) + for (auto& driven_info : getInfo()->mDrivenInfoList) { - LLDrivenEntryInfo *driven_info = &(*iter); - S32 driven_id = driven_info->mDrivenID; + S32 driven_id = driven_info.mDrivenID; // check for already existing links. Do not overwrite. BOOL found = FALSE; - for (entry_list_t::iterator driven_iter = mDriven.begin(); driven_iter != mDriven.end() && !found; ++driven_iter) + for (auto& driven : mDriven) { - if (driven_iter->mInfo->mDrivenID == driven_id) + if (driven.mInfo->mDrivenID == driven_id) { found = TRUE; } @@ -500,7 +490,7 @@ BOOL LLDriverParam::linkDrivenParams(visual_param_mapper mapper, BOOL only_cross bool push = param && (!only_cross_params || param->getCrossWearable()); if (push) { - mDriven.push_back(LLDrivenEntry( param, driven_info )); + mDriven.push_back(LLDrivenEntry( param, &driven_info )); } else { @@ -523,10 +513,9 @@ void LLDriverParam::updateCrossDrivenParams(LLWearableType::EType driven_type) bool needs_update = (getWearableType()==driven_type); // if the driver has a driven entry for the passed-in wearable type, we need to refresh the value - for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ ) + for(auto& driven : mDriven) { - LLDrivenEntry* driven = &(*iter); - if (driven && driven->mParam && driven->mParam->getCrossWearable() && driven->mParam->getWearableType() == driven_type) + if (driven.mParam && driven.mParam->getCrossWearable() && driven.mParam->getWearableType() == driven_type) { needs_update = true; } diff --git a/indra/llappearance/lllocaltextureobject.cpp b/indra/llappearance/lllocaltextureobject.cpp index 3f564ec3de..b66b51f4e4 100644 --- a/indra/llappearance/lllocaltextureobject.cpp +++ b/indra/llappearance/lllocaltextureobject.cpp @@ -95,9 +95,8 @@ LLTexLayer* LLLocalTextureObject::getTexLayer(U32 index) const LLTexLayer* LLLocalTextureObject::getTexLayer(const std::string &name) { - for( tex_layer_vec_t::iterator iter = mTexLayers.begin(); iter != mTexLayers.end(); iter++) + for(auto layer : mTexLayers) { - LLTexLayer *layer = *iter; if (layer->getName().compare(name) == 0) { return layer; diff --git a/indra/llappearance/llpolymesh.cpp b/indra/llappearance/llpolymesh.cpp index 3892e4ce43..d0f0199d61 100644 --- a/indra/llappearance/llpolymesh.cpp +++ b/indra/llappearance/llpolymesh.cpp @@ -890,11 +890,10 @@ void LLPolyMesh::dumpDiagInfo() LL_INFOS() << "-----------------------------------------------------" << LL_ENDL; // print each loaded mesh, and it's memory usage - for(LLPolyMeshSharedDataTable::iterator iter = sGlobalSharedMeshList.begin(); - iter != sGlobalSharedMeshList.end(); ++iter) + for(const auto& mesh_pair : sGlobalSharedMeshList) { - const std::string& mesh_name = iter->first; - LLPolyMeshSharedData* mesh = iter->second; + const std::string& mesh_name = mesh_pair.first; + LLPolyMeshSharedData* mesh = mesh_pair.second; S32 num_verts = mesh->mNumVertices; S32 num_faces = mesh->mNumFaces; @@ -997,14 +996,12 @@ LLPolyMorphData* LLPolyMesh::getMorphData(const std::string& morph_name) { if (!mSharedData) return NULL; - for (LLPolyMeshSharedData::morphdata_list_t::iterator iter = mSharedData->mMorphData.begin(); - iter != mSharedData->mMorphData.end(); ++iter) + for (auto morph_data : mSharedData->mMorphData) { - LLPolyMorphData *morph_data = *iter; - if (morph_data->getName() == morph_name) - { - return morph_data; - } + if (morph_data->getName() == morph_name) + { + return morph_data; + } } return NULL; } diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp index 84dd6156a9..1f83f748a1 100644 --- a/indra/llappearance/llpolymorph.cpp +++ b/indra/llappearance/llpolymorph.cpp @@ -364,17 +364,16 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info) LLAvatarAppearance* avatarp = mMesh->getAvatar(); LLPolyMorphTargetInfo::volume_info_list_t::iterator iter; - for (iter = getInfo()->mVolumeInfoList.begin(); iter != getInfo()->mVolumeInfoList.end(); iter++) + for (auto& volume_info : getInfo()->mVolumeInfoList) { - LLPolyVolumeMorphInfo *volume_info = &(*iter); for (S32 i = 0; i < avatarp->mNumCollisionVolumes; i++) { - if (avatarp->mCollisionVolumes[i].getName() == volume_info->mName) + if (avatarp->mCollisionVolumes[i].getName() == volume_info.mName) { mVolumeMorphs.push_back( LLPolyVolumeMorph(&avatarp->mCollisionVolumes[i], - volume_info->mScale, - volume_info->mPos)); + volume_info.mScale, + volume_info.mPos)); break; } } @@ -641,15 +640,14 @@ void LLPolyMorphTarget::apply( ESex avatar_sex ) } // now apply volume changes - for( volume_list_t::iterator iter = mVolumeMorphs.begin(); iter != mVolumeMorphs.end(); iter++ ) + for(auto& volume_morph : mVolumeMorphs) { - LLPolyVolumeMorph* volume_morph = &(*iter); - LLVector3 scale_delta = volume_morph->mScale * delta_weight; - LLVector3 pos_delta = volume_morph->mPos * delta_weight; + LLVector3 scale_delta = volume_morph.mScale * delta_weight; + LLVector3 pos_delta = volume_morph.mPos * delta_weight; - volume_morph->mVolume->setScale(volume_morph->mVolume->getScale() + scale_delta); + volume_morph.mVolume->setScale(volume_morph.mVolume->getScale() + scale_delta); // SL-315 - volume_morph->mVolume->setPosition(volume_morph->mVolume->getPosition() + pos_delta); + volume_morph.mVolume->setPosition(volume_morph.mVolume->getPosition() + pos_delta); } } @@ -735,15 +733,14 @@ void LLPolyMorphTarget::applyMask(U8 *maskTextureData, S32 width, S32 height, S3 void LLPolyMorphTarget::applyVolumeChanges(F32 delta_weight) { // now apply volume changes - for( volume_list_t::iterator iter = mVolumeMorphs.begin(); iter != mVolumeMorphs.end(); iter++ ) + for(auto& volume_morph : mVolumeMorphs) { - LLPolyVolumeMorph* volume_morph = &(*iter); - LLVector3 scale_delta = volume_morph->mScale * delta_weight; - LLVector3 pos_delta = volume_morph->mPos * delta_weight; + LLVector3 scale_delta = volume_morph.mScale * delta_weight; + LLVector3 pos_delta = volume_morph.mPos * delta_weight; - volume_morph->mVolume->setScale(volume_morph->mVolume->getScale() + scale_delta); + volume_morph.mVolume->setScale(volume_morph.mVolume->getScale() + scale_delta); // SL-315 - volume_morph->mVolume->setPosition(volume_morph->mVolume->getPosition() + pos_delta); + volume_morph.mVolume->setPosition(volume_morph.mVolume->getPosition() + pos_delta); } } diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index 360f17508f..e1460b68de 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -144,37 +144,35 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) setWeight(getDefaultWeight()); LLPolySkeletalDistortionInfo::bone_info_list_t::iterator iter; - for (iter = getInfo()->mBoneInfoList.begin(); iter != getInfo()->mBoneInfoList.end(); iter++) + for (auto& bone_info : getInfo()->mBoneInfoList) { - LLPolySkeletalBoneInfo *bone_info = &(*iter); - LLJoint* joint = mAvatar->getJoint(bone_info->mBoneName); + LLJoint* joint = mAvatar->getJoint(bone_info.mBoneName); if (!joint) { // There's no point continuing after this error - means // that either the skeleton or lad file is broken. - LL_WARNS() << "Joint " << bone_info->mBoneName << " not found." << LL_ENDL; + LL_WARNS() << "Joint " << bone_info.mBoneName << " not found." << LL_ENDL; return FALSE; } // store it - mJointScales[joint] = bone_info->mScaleDeformation; + mJointScales[joint] = bone_info.mScaleDeformation; // apply to children that need to inherit it - for (LLJoint::joints_t::iterator iter = joint->mChildren.begin(); - iter != joint->mChildren.end(); ++iter) + for (auto joint : joint->mChildren) { - LLAvatarJoint* child_joint = (LLAvatarJoint*)(*iter); + LLAvatarJoint* child_joint = (LLAvatarJoint*)joint; if (child_joint->inheritScale()) { LLVector3 childDeformation = LLVector3(child_joint->getScale()); - childDeformation.scaleVec(bone_info->mScaleDeformation); + childDeformation.scaleVec(bone_info.mScaleDeformation); mJointScales[child_joint] = childDeformation; } } - if (bone_info->mHasPositionDeformation) + if (bone_info.mHasPositionDeformation) { - mJointOffsets[joint] = bone_info->mPositionDeformation; + mJointOffsets[joint] = bone_info.mPositionDeformation; } } return TRUE; @@ -195,15 +193,12 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) F32 effective_weight = ( getSex() & avatar_sex ) ? mCurWeight : getDefaultWeight(); LLJoint* joint; - joint_vec_map_t::iterator iter; - for (iter = mJointScales.begin(); - iter != mJointScales.end(); - iter++) + for (auto& scale_pair : mJointScales) { - joint = iter->first; + joint = scale_pair.first; LLVector3 newScale = joint->getScale(); - LLVector3 scaleDelta = iter->second; + LLVector3 scaleDelta = scale_pair.second; LLVector3 offset = (effective_weight - mLastWeight) * scaleDelta; newScale = newScale + offset; //An aspect of attached mesh objects (which contain joint offsets) that need to be cleaned up when detached @@ -218,13 +213,11 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) joint->setScale(newScale, true); } - for (iter = mJointOffsets.begin(); - iter != mJointOffsets.end(); - iter++) + for (auto& offset_pair : mJointOffsets) { - joint = iter->first; + joint = offset_pair.first; LLVector3 newPosition = joint->getPosition(); - LLVector3 positionDelta = iter->second; + LLVector3 positionDelta = offset_pair.second; newPosition = newPosition + (effective_weight * positionDelta) - (mLastWeight * positionDelta); // SL-315 bool allow_attachment_pos_overrides = true; diff --git a/indra/llappearance/lltexglobalcolor.cpp b/indra/llappearance/lltexglobalcolor.cpp index 3df2254b14..611b87a7cf 100644 --- a/indra/llappearance/lltexglobalcolor.cpp +++ b/indra/llappearance/lltexglobalcolor.cpp @@ -55,12 +55,10 @@ BOOL LLTexGlobalColor::setInfo(LLTexGlobalColorInfo *info) //mID = info->mID; // No ID mParamGlobalColorList.reserve(mInfo->mParamColorInfoList.size()); - for (param_color_info_list_t::iterator iter = mInfo->mParamColorInfoList.begin(); - iter != mInfo->mParamColorInfoList.end(); - iter++) + for (auto color_info : mInfo->mParamColorInfoList) { LLTexParamGlobalColor* param_color = new LLTexParamGlobalColor(this); - if (!param_color->setInfo(*iter, TRUE)) + if (!param_color->setInfo(color_info, TRUE)) { mInfo = NULL; return FALSE; diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index 3430a25536..68a021eb9a 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -241,11 +241,8 @@ BOOL LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node) void LLTexLayerSetInfo::createVisualParams(LLAvatarAppearance *appearance) { //layer_info_list_t mLayerInfoList; - for (layer_info_list_t::iterator layer_iter = mLayerInfoList.begin(); - layer_iter != mLayerInfoList.end(); - layer_iter++) + for (auto layer_info : mLayerInfoList) { - LLTexLayerInfo *layer_info = *layer_iter; layer_info->createVisualParams(appearance); } } @@ -287,12 +284,10 @@ BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info) //mID = info->mID; // No ID mLayerList.reserve(info->mLayerInfoList.size()); - for (LLTexLayerSetInfo::layer_info_list_t::const_iterator iter = info->mLayerInfoList.begin(); - iter != info->mLayerInfoList.end(); - iter++) + for (auto layer_info : info->mLayerInfoList) { LLTexLayerInterface *layer = NULL; - if ( (*iter)->isUserSettable() ) + if (layer_info->isUserSettable()) { layer = new LLTexLayerTemplate( this, getAvatarAppearance() ); } @@ -301,7 +296,7 @@ BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info) layer = new LLTexLayer(this); } // this is the first time this layer (of either type) is being created - make sure you add the parameters to the avatar appearance - if (!layer->setInfo(*iter, NULL)) + if (!layer->setInfo(layer_info, NULL)) { mInfo = NULL; return FALSE; @@ -348,14 +343,12 @@ BOOL LLTexLayerSet::parseData(LLXmlTreeNode* node) void LLTexLayerSet::deleteCaches() { - for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) + for(auto layer : mLayerList) { - LLTexLayerInterface* layer = *iter; layer->deleteCaches(); } - for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++) + for (auto layer : mMaskLayerList) { - LLTexLayerInterface* layer = *iter; layer->deleteCaches(); } } @@ -368,9 +361,8 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* if (mMaskLayerList.size() > 0) { - for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++) + for (auto layer : mMaskLayerList) { - LLTexLayerInterface* layer = *iter; if (layer->isInvisibleAlphaMask()) { mIsVisible = FALSE; @@ -399,9 +391,8 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* if (mIsVisible) { // composite color layers - for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) + for(auto layer : mLayerList) { - LLTexLayerInterface* layer = *iter; if (layer->getRenderPass() == LLTexLayer::RP_COLOR) { gGL.flush(); @@ -473,9 +464,8 @@ void LLTexLayerSet::gatherMorphMaskAlpha(U8 *data, S32 origin_x, S32 origin_y, S LL_PROFILE_ZONE_SCOPED; memset(data, 255, width * height); - for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) + for(auto layer : mLayerList) { - LLTexLayerInterface* layer = *iter; layer->gatherAlphaMasks(data, origin_x, origin_y, width, height, bound_target); } @@ -526,9 +516,8 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height, if (mMaskLayerList.size() > 0) { gGL.setSceneBlendType(LLRender::BT_MULT_ALPHA); - for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++) + for (auto layer : mMaskLayerList) { - LLTexLayerInterface* layer = *iter; gGL.flush(); layer->blendAlphaTexture(x,y,width, height); gGL.flush(); @@ -549,9 +538,8 @@ void LLTexLayerSet::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_ BOOL LLTexLayerSet::isMorphValid() const { - for(layer_list_t::const_iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) + for(const auto layer : mLayerList) { - const LLTexLayerInterface* layer = *iter; if (layer && !layer->isMorphValid()) { return FALSE; @@ -562,9 +550,8 @@ BOOL LLTexLayerSet::isMorphValid() const void LLTexLayerSet::invalidateMorphMasks() { - for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) + for(auto layer : mLayerList) { - LLTexLayerInterface* layer = *iter; if (layer) { layer->invalidateMorphMasks(); @@ -661,14 +648,12 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node) /* if ("upper_shirt" == local_texture_name) mLocalTexture = TEX_UPPER_SHIRT; */ mLocalTexture = TEX_NUM_INDICES; - for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearance::getDictionary()->getTextures().begin(); - iter != LLAvatarAppearance::getDictionary()->getTextures().end(); - iter++) + for (const auto& dict_pair : LLAvatarAppearance::getDictionary()->getTextures()) { - const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second; + const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = dict_pair.second; if (local_texture_name == texture_dict->mName) { - mLocalTexture = iter->first; + mLocalTexture = dict_pair.first; break; } } @@ -735,11 +720,8 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node) BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance) { BOOL success = TRUE; - for (param_color_info_list_t::iterator color_info_iter = mParamColorInfoList.begin(); - color_info_iter != mParamColorInfoList.end(); - color_info_iter++) + for (auto color_info : mParamColorInfoList) { - LLTexLayerParamColorInfo * color_info = *color_info_iter; LLTexLayerParamColor* param_color = new LLTexLayerParamColor(appearance); if (!param_color->setInfo(color_info, TRUE)) { @@ -749,11 +731,8 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance) } } - for (param_alpha_info_list_t::iterator alpha_info_iter = mParamAlphaInfoList.begin(); - alpha_info_iter != mParamAlphaInfoList.end(); - alpha_info_iter++) + for (auto alpha_info : mParamAlphaInfoList) { - LLTexLayerParamAlphaInfo * alpha_info = *alpha_info_iter; LLTexLayerParamAlpha* param_alpha = new LLTexLayerParamAlpha(appearance); if (!param_alpha->setInfo(alpha_info, TRUE)) { @@ -796,15 +775,13 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab //mID = info->mID; // No ID mParamColorList.reserve(mInfo->mParamColorInfoList.size()); - for (param_color_info_list_t::const_iterator iter = mInfo->mParamColorInfoList.begin(); - iter != mInfo->mParamColorInfoList.end(); - iter++) + for (auto color_info : mInfo->mParamColorInfoList) { LLTexLayerParamColor* param_color; if (!wearable) { param_color = new LLTexLayerParamColor(this); - if (!param_color->setInfo(*iter, TRUE)) + if (!param_color->setInfo(color_info, TRUE)) { mInfo = NULL; return FALSE; @@ -812,7 +789,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab } else { - param_color = (LLTexLayerParamColor*)wearable->getVisualParam((*iter)->getID()); + param_color = (LLTexLayerParamColor*)wearable->getVisualParam(color_info->getID()); if (!param_color) { mInfo = NULL; @@ -823,15 +800,13 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab } mParamAlphaList.reserve(mInfo->mParamAlphaInfoList.size()); - for (param_alpha_info_list_t::const_iterator iter = mInfo->mParamAlphaInfoList.begin(); - iter != mInfo->mParamAlphaInfoList.end(); - iter++) + for (auto alpha_info : mInfo->mParamAlphaInfoList) { LLTexLayerParamAlpha* param_alpha; if (!wearable) { param_alpha = new LLTexLayerParamAlpha( this ); - if (!param_alpha->setInfo(*iter, TRUE)) + if (!param_alpha->setInfo(alpha_info, TRUE)) { mInfo = NULL; return FALSE; @@ -839,7 +814,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab } else { - param_alpha = (LLTexLayerParamAlpha*) wearable->getVisualParam((*iter)->getID()); + param_alpha = (LLTexLayerParamAlpha*) wearable->getVisualParam(alpha_info->getID()); if (!param_alpha) { mInfo = NULL; @@ -873,12 +848,9 @@ LLWearableType::EType LLTexLayerInterface::getWearableType() const if (TEX_INVALID == te) { LLWearableType::EType type = LLWearableType::WT_INVALID; - param_color_list_t::const_iterator color_iter = mParamColorList.begin(); - param_alpha_list_t::const_iterator alpha_iter = mParamAlphaList.begin(); - for (; color_iter != mParamColorList.end(); color_iter++) + for (auto param : mParamColorList) { - LLTexLayerParamColor* param = *color_iter; if (param) { LLWearableType::EType new_type = (LLWearableType::EType)param->getWearableType(); @@ -893,9 +865,8 @@ LLWearableType::EType LLTexLayerInterface::getWearableType() const } } - for (; alpha_iter != mParamAlphaList.end(); alpha_iter++) + for (auto param : mParamAlphaList) { - LLTexLayerParamAlpha* param = *alpha_iter; if (param) { LLWearableType::EType new_type = (LLWearableType::EType)param->getWearableType(); @@ -938,18 +909,18 @@ void LLTexLayerInterface::invalidateMorphMasks() LLViewerVisualParam* LLTexLayerInterface::getVisualParamPtr(S32 index) const { LLViewerVisualParam *result = NULL; - for (param_color_list_t::const_iterator color_iter = mParamColorList.begin(); color_iter != mParamColorList.end() && !result; ++color_iter) + for (auto param : mParamColorList) { - if ((*color_iter)->getID() == index) + if (param->getID() == index) { - result = *color_iter; + result = param; } } - for (param_alpha_list_t::const_iterator alpha_iter = mParamAlphaList.begin(); alpha_iter != mParamAlphaList.end() && !result; ++alpha_iter) + for (auto param : mParamAlphaList) { - if ((*alpha_iter)->getID() == index) + if (param->getID() == index) { - result = *alpha_iter; + result = param; } } @@ -994,10 +965,9 @@ LLTexLayer::~LLTexLayer() //std::for_each(mParamAlphaList.begin(), mParamAlphaList.end(), DeletePointer()); //std::for_each(mParamColorList.begin(), mParamColorList.end(), DeletePointer()); - for( alpha_cache_t::iterator iter = mAlphaCache.begin(); - iter != mAlphaCache.end(); iter++ ) + for(auto& alpha_pair : mAlphaCache) { - U8* alpha_data = iter->second; + U8* alpha_data = alpha_pair.second; ll_aligned_free_32(alpha_data); } @@ -1021,10 +991,8 @@ BOOL LLTexLayer::setInfo(const LLTexLayerInfo* info, LLWearable* wearable ) //static void LLTexLayer::calculateTexLayerColor(const param_color_list_t ¶m_list, LLColor4 &net_color) { - for (param_color_list_t::const_iterator iter = param_list.begin(); - iter != param_list.end(); iter++) + for (const auto param : param_list) { - const LLTexLayerParamColor* param = *iter; LLColor4 param_net = param->getNetColor(); const LLTexLayerParamColorInfo *info = (LLTexLayerParamColorInfo *)param->getInfo(); switch(info->getOperation()) @@ -1049,10 +1017,8 @@ void LLTexLayer::calculateTexLayerColor(const param_color_list_t ¶m_list, LL /*virtual*/ void LLTexLayer::deleteCaches() { // Only need to delete caches for alpha params. Color params don't hold extra memory - for (param_alpha_list_t::iterator iter = mParamAlphaList.begin(); - iter != mParamAlphaList.end(); iter++ ) + for (auto param : mParamAlphaList) { - LLTexLayerParamAlpha* param = *iter; param->deleteCaches(); } } @@ -1226,9 +1192,8 @@ const U8* LLTexLayer::getAlphaData() const const LLUUID& uuid = getUUID(); alpha_mask_crc.update((U8*)(&uuid.mData), UUID_BYTES); - for (param_alpha_list_t::const_iterator iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); iter++) + for (const auto param : mParamAlphaList) { - const LLTexLayerParamAlpha* param = *iter; // MULTI-WEARABLE: verify visual parameters used here F32 param_weight = param->getWeight(); alpha_mask_crc.update((U8*)¶m_weight, sizeof(F32)); @@ -1365,9 +1330,8 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC // Accumulate alphas LLGLSNoAlphaTest gls_no_alpha_test; gGL.color4f( 1.f, 1.f, 1.f, 1.f ); - for (param_alpha_list_t::iterator iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); iter++) + for (auto param : mParamAlphaList) { - LLTexLayerParamAlpha* param = *iter; success &= param->render( x, y, width, height ); if (!success && !force_render) { @@ -1441,9 +1405,8 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC const LLUUID& uuid = getUUID(); alpha_mask_crc.update((U8*)(&uuid.mData), UUID_BYTES); - for (param_alpha_list_t::const_iterator iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); iter++) + for (const auto param : mParamAlphaList) { - const LLTexLayerParamAlpha* param = *iter; F32 param_weight = param->getWeight(); alpha_mask_crc.update((U8*)¶m_weight, sizeof(F32)); } @@ -1683,12 +1646,10 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const BOOL success = TRUE; updateWearableCache(); - for (wearable_cache_t::const_iterator iter = mWearableCache.begin(); iter!= mWearableCache.end(); iter++) + for (auto wearable : mWearableCache) { - LLWearable* wearable = NULL; LLLocalTextureObject *lto = NULL; LLTexLayer *layer = NULL; - wearable = *iter; if (wearable) { lto = wearable->getLocalTextureObject(mInfo->mLocalTexture); @@ -1785,17 +1746,15 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const //----------------------------------------------------------------------------- LLTexLayerInterface* LLTexLayerSet::findLayerByName(const std::string& name) { - for (layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) + for (auto layer : mLayerList) { - LLTexLayerInterface* layer = *iter; if (layer->getName() == name) { return layer; } } - for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++ ) + for (auto layer : mMaskLayerList) { - LLTexLayerInterface* layer = *iter; if (layer->getName() == name) { return layer; @@ -1807,20 +1766,20 @@ LLTexLayerInterface* LLTexLayerSet::findLayerByName(const std::string& name) void LLTexLayerSet::cloneTemplates(LLLocalTextureObject *lto, LLAvatarAppearanceDefines::ETextureIndex tex_index, LLWearable *wearable) { // initialize all texlayers with this texture type for this LTO - for( LLTexLayerSet::layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) + for(auto layer : mLayerList) { - LLTexLayerTemplate* layer = (LLTexLayerTemplate*)*iter; - if (layer->getInfo()->getLocalTexture() == (S32) tex_index) + LLTexLayerTemplate* layer_template = (LLTexLayerTemplate*)layer; + if (layer_template->getInfo()->getLocalTexture() == (S32)tex_index) { - lto->addTexLayer(layer, wearable); + lto->addTexLayer(layer_template, wearable); } } - for( LLTexLayerSet::layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++ ) + for(auto layer : mMaskLayerList) { - LLTexLayerTemplate* layer = (LLTexLayerTemplate*)*iter; - if (layer->getInfo()->getLocalTexture() == (S32) tex_index) + LLTexLayerTemplate* layer_template = (LLTexLayerTemplate*)layer; + if (layer_template->getInfo()->getLocalTexture() == (S32)tex_index) { - lto->addTexLayer(layer, wearable); + lto->addTexLayer(layer_template, wearable); } } } diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index ce5c7142d5..549b1802a7 100644 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -103,10 +103,8 @@ void LLTexLayerParamAlpha::getCacheByteCount(S32* gl_bytes) { *gl_bytes = 0; - for (param_alpha_ptr_list_t::iterator iter = sInstances.begin(); - iter != sInstances.end(); iter++) + for (auto instance : sInstances) { - LLTexLayerParamAlpha* instance = *iter; LLGLTexture* tex = instance->mCachedProcessedTexture; if (tex) { diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index e4bc8ff427..6889304410 100644 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -60,12 +60,12 @@ LLWearable::LLWearable() // virtual LLWearable::~LLWearable() { - for (visual_param_index_map_t::iterator vpIter = mVisualParamIndexMap.begin(); vpIter != mVisualParamIndexMap.end(); ++vpIter) + for (auto& vp_pair : mVisualParamIndexMap) { - LLVisualParam* vp = vpIter->second; + LLVisualParam* vp = vp_pair.second; vp->clearNextParam(); delete vp; - vpIter->second = NULL; + vp_pair.second = NULL; } destroyTextures(); @@ -122,12 +122,10 @@ BOOL LLWearable::exportStream( std::ostream& output_stream ) const // parameters output_stream << "parameters " << mVisualParamIndexMap.size() << "\n"; - for (visual_param_index_map_t::const_iterator iter = mVisualParamIndexMap.begin(); - iter != mVisualParamIndexMap.end(); - ++iter) + for (auto& vp_pair : mVisualParamIndexMap) { - S32 param_id = iter->first; - const LLVisualParam* param = iter->second; + S32 param_id = vp_pair.first; + const LLVisualParam* param = vp_pair.second; F32 param_weight = param->getWeight(); output_stream << param_id << " " << terse_F32_to_string( param_weight ) << "\n"; } @@ -135,11 +133,11 @@ BOOL LLWearable::exportStream( std::ostream& output_stream ) const // texture entries output_stream << "textures " << mTEMap.size() << "\n"; - for (te_map_t::const_iterator iter = mTEMap.begin(); iter != mTEMap.end(); ++iter) + for (auto& te_pair : mTEMap) { - S32 te = iter->first; - const LLUUID& image_id = iter->second->getID(); - output_stream << te << " " << image_id << "\n"; + S32 te = te_pair.first; + const LLUUID& image_id = te_pair.second->getID(); + output_stream << te << " " << image_id << "\n"; } return TRUE; } @@ -160,11 +158,9 @@ void LLWearable::createVisualParams(LLAvatarAppearance *avatarp) } // resync driver parameters to point to the newly cloned driven parameters - for (visual_param_index_map_t::iterator param_iter = mVisualParamIndexMap.begin(); - param_iter != mVisualParamIndexMap.end(); - ++param_iter) + for (auto& param_pair : mVisualParamIndexMap) { - LLVisualParam* param = param_iter->second; + LLVisualParam* param = param_pair.second; LLVisualParam*(LLWearable::*wearable_function)(S32)const = &LLWearable::getVisualParam; // need this line to disambiguate between versions of LLCharacter::getVisualParam() LLVisualParam*(LLAvatarAppearance::*param_function)(S32)const = &LLAvatarAppearance::getVisualParam; @@ -523,10 +519,9 @@ std::vector LLWearable::getLocalTextureListSeq() { std::vector result; - for(te_map_t::const_iterator iter = mTEMap.begin(); - iter != mTEMap.end(); iter++) + for(auto& te_pair : mTEMap) { - LLLocalTextureObject* lto = iter->second; + LLLocalTextureObject* lto = te_pair.second; result.push_back(lto); } @@ -547,37 +542,15 @@ void LLWearable::revertValues() // FIXME DRANO - this triggers changes to driven params on avatar, potentially clobbering baked appearance. //update saved settings so wearable is no longer dirty - // non-driver params first - for (param_map_t::const_iterator iter = mSavedVisualParamMap.begin(); iter != mSavedVisualParamMap.end(); iter++) - { - S32 id = iter->first; - F32 value = iter->second; - LLVisualParam *param = getVisualParam(id); - if(param && !dynamic_cast(param) ) - { - setVisualParamWeight(id, value); - } - } - - //then driver params - for (param_map_t::const_iterator iter = mSavedVisualParamMap.begin(); iter != mSavedVisualParamMap.end(); iter++) + // One loop should be necessary here + for (auto& vp_pair : mSavedVisualParamMap) { - S32 id = iter->first; - F32 value = iter->second; + S32 id = vp_pair.first; LLVisualParam *param = getVisualParam(id); - if(param && dynamic_cast(param) ) + if(param) { + F32 value = vp_pair.second; setVisualParamWeight(id, value); - } - } - - // make sure that saved values are sane - for (param_map_t::const_iterator iter = mSavedVisualParamMap.begin(); iter != mSavedVisualParamMap.end(); iter++) - { - S32 id = iter->first; - LLVisualParam *param = getVisualParam(id); - if( param ) - { mSavedVisualParamMap[id] = param->getWeight(); } } @@ -589,10 +562,10 @@ void LLWearable::saveValues() { //update saved settings so wearable is no longer dirty mSavedVisualParamMap.clear(); - for (visual_param_index_map_t::const_iterator iter = mVisualParamIndexMap.begin(); iter != mVisualParamIndexMap.end(); ++iter) + for (auto& vp_pair : mVisualParamIndexMap) { - S32 id = iter->first; - LLVisualParam *wearable_param = iter->second; + S32 id = vp_pair.first; + LLVisualParam *wearable_param = vp_pair.second; F32 value = wearable_param->getWeight(); mSavedVisualParamMap[id] = value; } @@ -706,23 +679,18 @@ LLVisualParam* LLWearable::getVisualParam(S32 index) const void LLWearable::getVisualParams(visual_param_vec_t &list) { - visual_param_index_map_t::iterator iter = mVisualParamIndexMap.begin(); - visual_param_index_map_t::iterator end = mVisualParamIndexMap.end(); - // add all visual params to the passed-in vector - for( ; iter != end; ++iter ) + for(auto& vp_pair : mVisualParamIndexMap) { - list.push_back(iter->second); + list.push_back(vp_pair.second); } } void LLWearable::animateParams(F32 delta) { - for(visual_param_index_map_t::iterator iter = mVisualParamIndexMap.begin(); - iter != mVisualParamIndexMap.end(); - ++iter) + for(auto& vp_pair : mVisualParamIndexMap) { - LLVisualParam *param = (LLVisualParam*) iter->second; + LLVisualParam *param = (LLVisualParam*)vp_pair.second; param->animate(delta); } } -- cgit v1.2.3 From 030be1d14fb59872b31e738f858048d75ff9fd86 Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Tue, 3 Jan 2023 23:03:17 +0100 Subject: Widgets cleanup in Polish translation (up to 6.6.9), fix translatability for density_ctrl.xml file --- .../skins/default/xui/en/widgets/density_ctrl.xml | 5 +++++ .../skins/default/xui/pl/widgets/density_ctrl.xml | 21 +++++++++++++++++++++ .../skins/default/xui/pl/widgets/person_view.xml | 1 - .../skins/default/xui/pl/widgets/texture_picker.xml | 4 ---- 4 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 indra/newview/skins/default/xui/pl/widgets/density_ctrl.xml delete mode 100644 indra/newview/skins/default/xui/pl/widgets/texture_picker.xml (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/widgets/density_ctrl.xml b/indra/newview/skins/default/xui/en/widgets/density_ctrl.xml index 0f3f0159db..eb665fd3cb 100644 --- a/indra/newview/skins/default/xui/en/widgets/density_ctrl.xml +++ b/indra/newview/skins/default/xui/en/widgets/density_ctrl.xml @@ -13,6 +13,7 @@ follows="left|top" height="11" layout="topleft" + name="exponential_term_label" left="15" top_pad="-5" width="120"> @@ -45,6 +46,7 @@ Exponential Term follows="left|top" height="11" layout="topleft" + name="exponential_scale_factor_label" left="15" top_pad="-5" width="120"> @@ -69,6 +71,7 @@ Exponential Scale Factor follows="left|top" height="11" layout="topleft" + name="linear_term_label" left="15" top_pad="-5" width="120"> @@ -93,6 +96,7 @@ Linear Term follows="left|top" height="11" layout="topleft" + name="constant_term_label" left="15" top_pad="-5" width="120"> @@ -117,6 +121,7 @@ Constant Term follows="left|top" height="11" layout="topleft" + name="max_altitude_label" left="15" top_pad="15" width="80"> diff --git a/indra/newview/skins/default/xui/pl/widgets/density_ctrl.xml b/indra/newview/skins/default/xui/pl/widgets/density_ctrl.xml new file mode 100644 index 0000000000..fcd7de9eca --- /dev/null +++ b/indra/newview/skins/default/xui/pl/widgets/density_ctrl.xml @@ -0,0 +1,21 @@ + + + + Okres wykładniczy + + + Współczynnik skali wykładn. + + + Okres liniowy + + + Okres stały + + + Maks. wysokość + + + Współczynnik anizotropii + + diff --git a/indra/newview/skins/default/xui/pl/widgets/person_view.xml b/indra/newview/skins/default/xui/pl/widgets/person_view.xml index 2ebe5974d6..7df1663fe0 100644 --- a/indra/newview/skins/default/xui/pl/widgets/person_view.xml +++ b/indra/newview/skins/default/xui/pl/widgets/person_view.xml @@ -1,6 +1,5 @@ - diff --git a/indra/newview/skins/default/xui/pl/widgets/texture_picker.xml b/indra/newview/skins/default/xui/pl/widgets/texture_picker.xml deleted file mode 100644 index fc35ac714d..0000000000 --- a/indra/newview/skins/default/xui/pl/widgets/texture_picker.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - -- cgit v1.2.3 From bfa8239361e9ed48e7f7c33ecc2664ed64dcfbc1 Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Tue, 3 Jan 2023 23:21:24 +0100 Subject: Polish translation: Leftovers cleanup (files not present in /en/) --- .../default/xui/pl/floater_edit_day_cycle.xml | 75 ------------- .../default/xui/pl/floater_edit_sky_preset.xml | 123 --------------------- .../default/xui/pl/floater_edit_water_preset.xml | 68 ------------ .../xui/pl/floater_environment_settings.xml | 36 ------ .../skins/default/xui/pl/floater_facebook.xml | 15 --- .../skins/default/xui/pl/floater_flickr.xml | 17 --- .../default/xui/pl/floater_hardware_settings.xml | 29 ----- .../skins/default/xui/pl/floater_twitter.xml | 13 --- .../skins/default/xui/pl/panel_edit_classified.xml | 51 --------- .../skins/default/xui/pl/panel_edit_pick.xml | 37 ------- .../skins/default/xui/pl/panel_edit_profile.xml | 51 --------- .../default/xui/pl/panel_facebook_friends.xml | 12 -- .../skins/default/xui/pl/panel_facebook_photo.xml | 19 ---- .../skins/default/xui/pl/panel_facebook_place.xml | 9 -- .../skins/default/xui/pl/panel_facebook_status.xml | 20 ---- .../skins/default/xui/pl/panel_flickr_account.xml | 15 --- .../skins/default/xui/pl/panel_flickr_photo.xml | 35 ------ .../skins/default/xui/pl/panel_pick_info.xml | 24 ---- indra/newview/skins/default/xui/pl/panel_picks.xml | 29 ----- .../skins/default/xui/pl/panel_twitter_account.xml | 15 --- .../skins/default/xui/pl/panel_twitter_photo.xml | 21 ---- indra/newview/skins/default/xui/pl/xui_version.xml | 4 - 22 files changed, 718 deletions(-) delete mode 100644 indra/newview/skins/default/xui/pl/floater_edit_day_cycle.xml delete mode 100644 indra/newview/skins/default/xui/pl/floater_edit_sky_preset.xml delete mode 100644 indra/newview/skins/default/xui/pl/floater_edit_water_preset.xml delete mode 100644 indra/newview/skins/default/xui/pl/floater_environment_settings.xml delete mode 100644 indra/newview/skins/default/xui/pl/floater_facebook.xml delete mode 100644 indra/newview/skins/default/xui/pl/floater_flickr.xml delete mode 100644 indra/newview/skins/default/xui/pl/floater_hardware_settings.xml delete mode 100644 indra/newview/skins/default/xui/pl/floater_twitter.xml delete mode 100644 indra/newview/skins/default/xui/pl/panel_edit_classified.xml delete mode 100644 indra/newview/skins/default/xui/pl/panel_edit_pick.xml delete mode 100644 indra/newview/skins/default/xui/pl/panel_edit_profile.xml delete mode 100644 indra/newview/skins/default/xui/pl/panel_facebook_friends.xml delete mode 100644 indra/newview/skins/default/xui/pl/panel_facebook_photo.xml delete mode 100644 indra/newview/skins/default/xui/pl/panel_facebook_place.xml delete mode 100644 indra/newview/skins/default/xui/pl/panel_facebook_status.xml delete mode 100644 indra/newview/skins/default/xui/pl/panel_flickr_account.xml delete mode 100644 indra/newview/skins/default/xui/pl/panel_flickr_photo.xml delete mode 100644 indra/newview/skins/default/xui/pl/panel_pick_info.xml delete mode 100644 indra/newview/skins/default/xui/pl/panel_picks.xml delete mode 100644 indra/newview/skins/default/xui/pl/panel_twitter_account.xml delete mode 100644 indra/newview/skins/default/xui/pl/panel_twitter_photo.xml delete mode 100644 indra/newview/skins/default/xui/pl/xui_version.xml (limited to 'indra') diff --git a/indra/newview/skins/default/xui/pl/floater_edit_day_cycle.xml b/indra/newview/skins/default/xui/pl/floater_edit_day_cycle.xml deleted file mode 100644 index 9d3a070191..0000000000 --- a/indra/newview/skins/default/xui/pl/floater_edit_day_cycle.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - Stwórz nowy cykl dnia - - - Edytuj cykl dnia - - - Nazwij cykl dnia, ustaw co trzeba i kliknij na "Zapisz". - - - Aby edytować cykl dnia ustaw co trzeba i kliknij na "Zapisz". - - - -Wybierz Ustawienie- - - - Nazwa: - - - Uwaga: jeśli zmienisz nazwę Ustawienia, to zaczniesz tworzyć nowe, a obecne pozostanie bez zmian. - - - - Kliknij na zakładce, aby edytować ust. nieba i czas. - - - - Klikaj i przeciągaj zakładki, aby ustawić czasy przejść. - - - - Użyj suwaka, aby podglądać cykl dnia. - - - + width="32"> Back Preferred frame rate diff --git a/indra/newview/skins/default/xui/en/panel_performance_complexity.xml b/indra/newview/skins/default/xui/en/panel_performance_complexity.xml index 954fd0a8c1..cd3f610a92 100644 --- a/indra/newview/skins/default/xui/en/panel_performance_complexity.xml +++ b/indra/newview/skins/default/xui/en/panel_performance_complexity.xml @@ -24,12 +24,14 @@ + width="32"> Back Your avatar complexity diff --git a/indra/newview/skins/default/xui/en/panel_performance_huds.xml b/indra/newview/skins/default/xui/en/panel_performance_huds.xml index 289f865eb7..2fddcb3b9e 100644 --- a/indra/newview/skins/default/xui/en/panel_performance_huds.xml +++ b/indra/newview/skins/default/xui/en/panel_performance_huds.xml @@ -24,12 +24,14 @@ + width="32"> Back Your active HUDs diff --git a/indra/newview/skins/default/xui/en/panel_performance_nearby.xml b/indra/newview/skins/default/xui/en/panel_performance_nearby.xml index e80bf592e4..cb795e59a9 100644 --- a/indra/newview/skins/default/xui/en/panel_performance_nearby.xml +++ b/indra/newview/skins/default/xui/en/panel_performance_nearby.xml @@ -24,12 +24,14 @@ + width="32"> Back Avatars nearby diff --git a/indra/newview/skins/default/xui/en/panel_performance_preferences.xml b/indra/newview/skins/default/xui/en/panel_performance_preferences.xml index ee8105eac9..9c1a3ebd9e 100644 --- a/indra/newview/skins/default/xui/en/panel_performance_preferences.xml +++ b/indra/newview/skins/default/xui/en/panel_performance_preferences.xml @@ -24,12 +24,14 @@ + width="32"> Back Graphics settings -- cgit v1.2.3 From 9e743c99fb69db5694c388ae33656c62e3fa0b8e Mon Sep 17 00:00:00 2001 From: Fawrsk Date: Sat, 7 Jan 2023 00:38:12 -0400 Subject: Cleanup for loops in llcommon to use C++11 range based for loops --- indra/llcommon/llallocator_heap_profile.cpp | 9 ++- indra/llcommon/llassettype.cpp | 16 ++---- indra/llcommon/llcallbacklist.cpp | 5 +- indra/llcommon/llcallstack.cpp | 18 +++--- indra/llcommon/lldependencies.h | 46 ++++++--------- indra/llcommon/llerror.cpp | 12 +--- indra/llcommon/llevent.cpp | 16 ++---- indra/llcommon/llheteromap.cpp | 10 ++-- indra/llcommon/llinitdestroyclass.cpp | 7 +-- indra/llcommon/llinitparam.cpp | 86 +++++++++++----------------- indra/llcommon/llinitparam.h | 14 ++--- indra/llcommon/llkeybind.cpp | 35 ++++++----- indra/llcommon/llmetricperformancetester.cpp | 9 ++- indra/llcommon/llnametable.h | 8 +-- indra/llcommon/llpriqueuemap.h | 4 +- indra/llcommon/llregistry.h | 24 +++----- indra/llcommon/llsdparam.cpp | 6 +- indra/llcommon/llsdutil.cpp | 5 +- indra/llcommon/llstring.h | 6 +- indra/llcommon/llstringtable.cpp | 23 +++----- indra/llcommon/llstringtable.h | 4 +- indra/llcommon/lltracerecording.cpp | 6 +- indra/llcommon/lltracethreadrecorder.cpp | 10 ++-- indra/llcommon/lluri.cpp | 4 +- indra/llcommon/llworkerthread.cpp | 19 +++--- 25 files changed, 159 insertions(+), 243 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llallocator_heap_profile.cpp b/indra/llcommon/llallocator_heap_profile.cpp index b2eafde1aa..6dd399e1e3 100644 --- a/indra/llcommon/llallocator_heap_profile.cpp +++ b/indra/llcommon/llallocator_heap_profile.cpp @@ -131,14 +131,13 @@ void LLAllocatorHeapProfile::parse(std::string const & prof_text) void LLAllocatorHeapProfile::dump(std::ostream & out) const { lines_t::const_iterator i; - for(i = mLines.begin(); i != mLines.end(); ++i) + for (const LLAllocatorHeapProfile::line& line : mLines) { - out << i->mLiveCount << ": " << i->mLiveSize << '[' << i->mTotalCount << ": " << i->mTotalSize << "] @"; + out << line.mLiveCount << ": " << line.mLiveSize << '[' << line.mTotalCount << ": " << line.mTotalSize << "] @"; - stack_trace::const_iterator j; - for(j = i->mTrace.begin(); j != i->mTrace.end(); ++j) + for (const stack_marker marker : line.mTrace) { - out << ' ' << *j; + out << ' ' << marker; } out << '\n'; } diff --git a/indra/llcommon/llassettype.cpp b/indra/llcommon/llassettype.cpp index e6cc06e8d0..4e6cebc5eb 100644 --- a/indra/llcommon/llassettype.cpp +++ b/indra/llcommon/llassettype.cpp @@ -150,14 +150,12 @@ LLAssetType::EType LLAssetType::lookup(const char* name) LLAssetType::EType LLAssetType::lookup(const std::string& type_name) { const LLAssetDictionary *dict = LLAssetDictionary::getInstance(); - for (LLAssetDictionary::const_iterator iter = dict->begin(); - iter != dict->end(); - iter++) + for (const LLAssetDictionary::value_type pair : *dict) { - const AssetEntry *entry = iter->second; + const AssetEntry *entry = pair.second; if (type_name == entry->mTypeName) { - return iter->first; + return pair.first; } } return AT_UNKNOWN; @@ -188,14 +186,12 @@ LLAssetType::EType LLAssetType::lookupHumanReadable(const char* name) LLAssetType::EType LLAssetType::lookupHumanReadable(const std::string& readable_name) { const LLAssetDictionary *dict = LLAssetDictionary::getInstance(); - for (LLAssetDictionary::const_iterator iter = dict->begin(); - iter != dict->end(); - iter++) + for (const LLAssetDictionary::value_type pair : *dict) { - const AssetEntry *entry = iter->second; + const AssetEntry *entry = pair.second; if (entry->mHumanName && (readable_name == entry->mHumanName)) { - return iter->first; + return pair.first; } } return AT_NONE; diff --git a/indra/llcommon/llcallbacklist.cpp b/indra/llcommon/llcallbacklist.cpp index 541ff75ee4..aea19c6424 100644 --- a/indra/llcommon/llcallbacklist.cpp +++ b/indra/llcommon/llcallbacklist.cpp @@ -109,10 +109,9 @@ void LLCallbackList::deleteAllFunctions() void LLCallbackList::callFunctions() { - for (callback_list_t::iterator iter = mCallbackList.begin(); iter != mCallbackList.end(); ) + for (callback_list_t::value_type pair : mCallbackList) { - callback_list_t::iterator curiter = iter++; - curiter->first(curiter->second); + pair.first(pair.second); } } diff --git a/indra/llcommon/llcallstack.cpp b/indra/llcommon/llcallstack.cpp index 8db291eed1..fac03e0c9e 100644 --- a/indra/llcommon/llcallstack.cpp +++ b/indra/llcommon/llcallstack.cpp @@ -91,10 +91,9 @@ LLCallStack::LLCallStack(S32 skip_count, bool verbose): bool LLCallStack::contains(const std::string& str) { - for (std::vector::const_iterator it = m_strings.begin(); - it != m_strings.end(); ++it) + for (const std::string& src_str : m_strings) { - if (it->find(str) != std::string::npos) + if (src_str.find(str) != std::string::npos) { return true; } @@ -105,10 +104,9 @@ bool LLCallStack::contains(const std::string& str) std::ostream& operator<<(std::ostream& s, const LLCallStack& call_stack) { #ifndef LL_RELEASE_FOR_DOWNLOAD - std::vector::const_iterator it; - for (it=call_stack.m_strings.begin(); it!=call_stack.m_strings.end(); ++it) + for (const std::string& str : call_stack.m_strings) { - s << *it; + s << str; } #else s << "UNAVAILABLE IN RELEASE"; @@ -156,9 +154,9 @@ bool LLContextStrings::contains(const std::string& str) { const std::map& strings = LLThreadLocalSingletonPointer::getInstance()->m_contextStrings; - for (std::map::const_iterator it = strings.begin(); it!=strings.end(); ++it) + for (const std::map::value_type str_pair : strings) { - if (it->first.find(str) != std::string::npos) + if (str_pair.first.find(str) != std::string::npos) { return true; } @@ -171,9 +169,9 @@ void LLContextStrings::output(std::ostream& os) { const std::map& strings = LLThreadLocalSingletonPointer::getInstance()->m_contextStrings; - for (std::map::const_iterator it = strings.begin(); it!=strings.end(); ++it) + for (const std::map::value_type str_pair : strings) { - os << it->first << "[" << it->second << "]" << "\n"; + os << str_pair.first << "[" << str_pair.second << "]" << "\n"; } } diff --git a/indra/llcommon/lldependencies.h b/indra/llcommon/lldependencies.h index 950af4a4ad..ba5fcb195c 100644 --- a/indra/llcommon/lldependencies.h +++ b/indra/llcommon/lldependencies.h @@ -514,21 +514,16 @@ public: // former broken behavior has finally been fixed -- and our builds // treat warnings as errors. { - for (typename DepNodeMap::const_iterator nmi = mNodes.begin(), nmend = mNodes.end(); - nmi != nmend; ++nmi) + for (typename const DepNodeMap::value_type nm_pair : mNodes) { - vmap.insert(typename VertexMap::value_type(nmi->first, vmap.size())); - for (typename DepNode::dep_set::const_iterator ai = nmi->second.after.begin(), - aend = nmi->second.after.end(); - ai != aend; ++ai) + vmap.insert(typename VertexMap::value_type(nm_pair.first, vmap.size())); + for (typename const KEY& after_k : nm_pair.second.after) { - vmap.insert(typename VertexMap::value_type(*ai, vmap.size())); + vmap.insert(typename VertexMap::value_type(after_k, vmap.size())); } - for (typename DepNode::dep_set::const_iterator bi = nmi->second.before.begin(), - bend = nmi->second.before.end(); - bi != bend; ++bi) + for (typename const KEY& before_k : nm_pair.second.before) { - vmap.insert(typename VertexMap::value_type(*bi, vmap.size())); + vmap.insert(typename VertexMap::value_type(before_k, vmap.size())); } } } @@ -536,24 +531,19 @@ public: // all the known key dependencies to integer pairs. EdgeList edges; { - for (typename DepNodeMap::const_iterator nmi = mNodes.begin(), nmend = mNodes.end(); - nmi != nmend; ++nmi) + for (typename const DepNodeMap::value_type nm_pair : mNodes) { - auto thisnode = vmap[nmi->first]; + auto thisnode = vmap[nm_pair.first]; // after dependencies: build edges from the named node to this one - for (typename DepNode::dep_set::const_iterator ai = nmi->second.after.begin(), - aend = nmi->second.after.end(); - ai != aend; ++ai) + for (typename const KEY& after_k : nm_pair.second.after) { - edges.push_back(EdgeList::value_type(vmap[*ai], thisnode)); + edges.push_back(EdgeList::value_type(vmap[after_k], thisnode)); } // before dependencies: build edges from this node to the // named one - for (typename DepNode::dep_set::const_iterator bi = nmi->second.before.begin(), - bend = nmi->second.before.end(); - bi != bend; ++bi) + for (typename const KEY& before_k : nm_pair.second.before) { - edges.push_back(EdgeList::value_type(thisnode, vmap[*bi])); + edges.push_back(EdgeList::value_type(thisnode, vmap[before_k])); } } } @@ -565,21 +555,19 @@ public: // and we're certain that the associated int values are distinct // indexes. The fact that they're not in order is irrelevant. KeyList vkeys(vmap.size()); - for (typename VertexMap::const_iterator vmi = vmap.begin(), vmend = vmap.end(); - vmi != vmend; ++vmi) + for (typename const VertexMap::value_type vm_pair : vmap) { - vkeys[vmi->second] = vmi->first; + vkeys[vm_pair.second] = vm_pair.first; } // Walk the sorted output list, building the result into mCache so // we'll have it next time someone asks. mCache.clear(); - for (VertexList::const_iterator svi = sorted.begin(), svend = sorted.end(); - svi != svend; ++svi) + for (const size_t sv : sorted) { - // We're certain that vkeys[*svi] exists. However, there might not + // We're certain that vkeys[sv] exists. However, there might not // yet be a corresponding entry in mNodes. self_type* non_const_this(const_cast(this)); - typename DepNodeMap::iterator found = non_const_this->mNodes.find(vkeys[*svi]); + typename DepNodeMap::iterator found = non_const_this->mNodes.find(vkeys[sv]); if (found != non_const_this->mNodes.end()) { // Make an iterator of appropriate type. diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 519426e9d1..c5eb515292 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -586,11 +586,9 @@ namespace void Globals::invalidateCallSites() { - for (CallSiteVector::const_iterator i = callSites.begin(); - i != callSites.end(); - ++i) + for (LLError::CallSite* site : callSites) { - (*i)->invalidate(); + site->invalidate(); } callSites.clear(); @@ -1224,12 +1222,8 @@ namespace std::string escaped_message; LLMutexLock lock(&s->mRecorderMutex); - for (Recorders::const_iterator i = s->mRecorders.begin(); - i != s->mRecorders.end(); - ++i) + for (LLError::RecorderPtr r : s->mRecorders) { - LLError::RecorderPtr r = *i; - if (!r->enabled()) { continue; diff --git a/indra/llcommon/llevent.cpp b/indra/llcommon/llevent.cpp index 633df01588..501d06e3cd 100644 --- a/indra/llcommon/llevent.cpp +++ b/indra/llcommon/llevent.cpp @@ -203,10 +203,9 @@ void LLSimpleDispatcher::removeListener(LLEventListener* listener) std::vector LLSimpleDispatcher::getListeners() const { std::vector ret; - std::vector::const_iterator itor; - for (itor=mListeners.begin(); itor!=mListeners.end(); ++itor) + for (const LLListenerEntry& entry : mListeners) { - ret.push_back(*itor); + ret.push_back(entry); } return ret; @@ -215,14 +214,12 @@ std::vector LLSimpleDispatcher::getListeners() const // virtual bool LLSimpleDispatcher::fireEvent(LLPointer event, LLSD filter) { - std::vector::iterator itor; std::string filter_string = filter.asString(); - for (itor=mListeners.begin(); itor!=mListeners.end(); ++itor) + for (LLListenerEntry& entry : mListeners) { - LLListenerEntry& entry = *itor; if (filter_string == "" || entry.filter.asString() == filter_string) { - (entry.listener)->handleEvent(event, (*itor).userdata); + (entry.listener)->handleEvent(event, entry.userdata); } } return true; @@ -276,10 +273,9 @@ void LLSimpleListener::clearDispatchers() bool LLSimpleListener::handleAttach(LLEventDispatcher *dispatcher) { // Add dispatcher if it doesn't already exist - std::vector::iterator itor; - for (itor = mDispatchers.begin(); itor != mDispatchers.end(); ++itor) + for (LLEventDispatcher* disp : mDispatchers) { - if ((*itor) == dispatcher) return true; + if (disp == dispatcher) return true; } mDispatchers.push_back(dispatcher); return true; diff --git a/indra/llcommon/llheteromap.cpp b/indra/llcommon/llheteromap.cpp index 7c19196e0c..4bc29a1736 100644 --- a/indra/llcommon/llheteromap.cpp +++ b/indra/llcommon/llheteromap.cpp @@ -22,11 +22,11 @@ LLHeteroMap::~LLHeteroMap() { // For each entry in our map, we must call its deleter, which is the only // record we have of its original type. - for (TypeMap::iterator mi(mMap.begin()), me(mMap.end()); mi != me; ++mi) + for (TypeMap::value_type pair : mMap) { - // mi->second is the std::pair; mi->second.first is the void*; - // mi->second.second points to the deleter function - (mi->second.second)(mi->second.first); - mi->second.first = NULL; + // pair.second is the std::pair; pair.second.first is the void*; + // pair.second.second points to the deleter function + (pair.second.second)(pair.second.first); + pair.second.first = NULL; } } diff --git a/indra/llcommon/llinitdestroyclass.cpp b/indra/llcommon/llinitdestroyclass.cpp index e6382a7924..e3b9e6d099 100644 --- a/indra/llcommon/llinitdestroyclass.cpp +++ b/indra/llcommon/llinitdestroyclass.cpp @@ -21,10 +21,9 @@ void LLCallbackRegistry::fireCallbacks() const { - for (FuncList::const_iterator fi = mCallbacks.begin(), fe = mCallbacks.end(); - fi != fe; ++fi) + for (FuncList::value_type pair : mCallbacks) { - LL_INFOS("LLInitDestroyClass") << "calling " << fi->first << "()" << LL_ENDL; - fi->second(); + LL_INFOS("LLInitDestroyClass") << "calling " << pair.first << "()" << LL_ENDL; + pair.second(); } } diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp index aa2f4eb289..12765bb1dc 100644 --- a/indra/llcommon/llinitparam.cpp +++ b/indra/llcommon/llinitparam.cpp @@ -207,10 +207,10 @@ namespace LLInitParam if (!mValidated) { const BlockDescriptor& block_data = mostDerivedBlockDescriptor(); - for (BlockDescriptor::param_validation_list_t::const_iterator it = block_data.mValidationList.begin(); it != block_data.mValidationList.end(); ++it) + for (const BlockDescriptor::param_validation_list_t::value_type pair : block_data.mValidationList) { - const Param* param = getParamFromHandle(it->first); - if (!it->second(param)) + const Param* param = getParamFromHandle(pair.first); + if (!pair.second(param)) { if (emit_errors) { @@ -235,13 +235,11 @@ namespace LLInitParam // unnamed param is like LLView::Params::rect - implicit const BlockDescriptor& block_data = mostDerivedBlockDescriptor(); - for (BlockDescriptor::param_list_t::const_iterator it = block_data.mUnnamedParams.begin(); - it != block_data.mUnnamedParams.end(); - ++it) + for (const ParamDescriptorPtr ptr : block_data.mUnnamedParams) { - param_handle_t param_handle = (*it)->mParamHandle; + param_handle_t param_handle = ptr->mParamHandle; const Param* param = getParamFromHandle(param_handle); - ParamDescriptor::serialize_func_t serialize_func = (*it)->mSerializeFunc; + ParamDescriptor::serialize_func_t serialize_func = ptr->mSerializeFunc; if (serialize_func && predicate_rule.check(ll_make_predicate(PROVIDED, param->anyProvided()))) { const Param* diff_param = diff_block ? diff_block->getParamFromHandle(param_handle) : NULL; @@ -249,23 +247,19 @@ namespace LLInitParam } } - for(BlockDescriptor::param_map_t::const_iterator it = block_data.mNamedParams.begin(); - it != block_data.mNamedParams.end(); - ++it) + for (const BlockDescriptor::param_map_t::value_type pair : block_data.mNamedParams) { - param_handle_t param_handle = it->second->mParamHandle; + param_handle_t param_handle = pair.second->mParamHandle; const Param* param = getParamFromHandle(param_handle); - ParamDescriptor::serialize_func_t serialize_func = it->second->mSerializeFunc; + ParamDescriptor::serialize_func_t serialize_func = pair.second->mSerializeFunc; if (serialize_func && predicate_rule.check(ll_make_predicate(PROVIDED, param->anyProvided()))) { // Ensure this param has not already been serialized // Prevents from being serialized as its own tag. bool duplicate = false; - for (BlockDescriptor::param_list_t::const_iterator it2 = block_data.mUnnamedParams.begin(); - it2 != block_data.mUnnamedParams.end(); - ++it2) + for (const ParamDescriptorPtr ptr : block_data.mUnnamedParams) { - if (param_handle == (*it2)->mParamHandle) + if (param_handle == ptr->mParamHandle) { duplicate = true; break; @@ -279,7 +273,7 @@ namespace LLInitParam continue; } - name_stack.push_back(std::make_pair(it->first, !duplicate)); + name_stack.push_back(std::make_pair(pair.first, !duplicate)); const Param* diff_param = diff_block ? diff_block->getParamFromHandle(param_handle) : NULL; serialized |= serialize_func(*param, parser, name_stack, predicate_rule, diff_param); name_stack.pop_back(); @@ -300,45 +294,39 @@ namespace LLInitParam // unnamed param is like LLView::Params::rect - implicit const BlockDescriptor& block_data = mostDerivedBlockDescriptor(); - for (BlockDescriptor::param_list_t::const_iterator it = block_data.mUnnamedParams.begin(); - it != block_data.mUnnamedParams.end(); - ++it) + for (const ParamDescriptorPtr ptr : block_data.mUnnamedParams) { - param_handle_t param_handle = (*it)->mParamHandle; + param_handle_t param_handle = ptr->mParamHandle; const Param* param = getParamFromHandle(param_handle); - ParamDescriptor::inspect_func_t inspect_func = (*it)->mInspectFunc; + ParamDescriptor::inspect_func_t inspect_func = ptr->mInspectFunc; if (inspect_func) { name_stack.push_back(std::make_pair("", true)); - inspect_func(*param, parser, name_stack, (*it)->mMinCount, (*it)->mMaxCount); + inspect_func(*param, parser, name_stack, ptr->mMinCount, ptr->mMaxCount); name_stack.pop_back(); } } - for(BlockDescriptor::param_map_t::const_iterator it = block_data.mNamedParams.begin(); - it != block_data.mNamedParams.end(); - ++it) + for(const BlockDescriptor::param_map_t::value_type pair : block_data.mNamedParams) { - param_handle_t param_handle = it->second->mParamHandle; + param_handle_t param_handle = pair.second->mParamHandle; const Param* param = getParamFromHandle(param_handle); - ParamDescriptor::inspect_func_t inspect_func = it->second->mInspectFunc; + ParamDescriptor::inspect_func_t inspect_func = pair.second->mInspectFunc; if (inspect_func) { // Ensure this param has not already been inspected bool duplicate = false; - for (BlockDescriptor::param_list_t::const_iterator it2 = block_data.mUnnamedParams.begin(); - it2 != block_data.mUnnamedParams.end(); - ++it2) + for (const ParamDescriptorPtr ptr : block_data.mUnnamedParams) { - if (param_handle == (*it2)->mParamHandle) + if (param_handle == ptr->mParamHandle) { duplicate = true; break; } } - name_stack.push_back(std::make_pair(it->first, !duplicate)); - inspect_func(*param, parser, name_stack, it->second->mMinCount, it->second->mMaxCount); + name_stack.push_back(std::make_pair(pair.first, !duplicate)); + inspect_func(*param, parser, name_stack, pair.second->mMinCount, pair.second->mMaxCount); name_stack.pop_back(); } } @@ -382,12 +370,10 @@ namespace LLInitParam } // try to parse unnamed parameters, in declaration order - for ( BlockDescriptor::param_list_t::iterator it = block_data.mUnnamedParams.begin(); - it != block_data.mUnnamedParams.end(); - ++it) + for (ParamDescriptorPtr ptr : block_data.mUnnamedParams) { - Param* paramp = getParamFromHandle((*it)->mParamHandle); - ParamDescriptor::deserialize_func_t deserialize_func = (*it)->mDeserializeFunc; + Param* paramp = getParamFromHandle(ptr->mParamHandle); + ParamDescriptor::deserialize_func_t deserialize_func = ptr->mDeserializeFunc; if (deserialize_func && deserialize_func(*paramp, p, name_stack_range, new_name)) { @@ -453,12 +439,9 @@ namespace LLInitParam { param_handle_t handle = getHandleFromParam(¶m); BlockDescriptor& descriptor = mostDerivedBlockDescriptor(); - BlockDescriptor::all_params_list_t::iterator end_it = descriptor.mAllParams.end(); - for (BlockDescriptor::all_params_list_t::iterator it = descriptor.mAllParams.begin(); - it != end_it; - ++it) + for (ParamDescriptorPtr ptr : descriptor.mAllParams) { - if ((*it)->mParamHandle == handle) return *it; + if (ptr->mParamHandle == handle) return ptr; } return ParamDescriptorPtr(); } @@ -468,17 +451,14 @@ namespace LLInitParam bool BaseBlock::mergeBlock(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) { bool some_param_changed = false; - BlockDescriptor::all_params_list_t::const_iterator end_it = block_data.mAllParams.end(); - for (BlockDescriptor::all_params_list_t::const_iterator it = block_data.mAllParams.begin(); - it != end_it; - ++it) + for (const ParamDescriptorPtr ptr : block_data.mAllParams) { - const Param* other_paramp = other.getParamFromHandle((*it)->mParamHandle); - ParamDescriptor::merge_func_t merge_func = (*it)->mMergeFunc; + const Param* other_paramp = other.getParamFromHandle(ptr->mParamHandle); + ParamDescriptor::merge_func_t merge_func = ptr->mMergeFunc; if (merge_func) { - Param* paramp = getParamFromHandle((*it)->mParamHandle); - llassert(paramp->getEnclosingBlockOffset() == (*it)->mParamHandle); + Param* paramp = getParamFromHandle(ptr->mParamHandle); + llassert(paramp->getEnclosingBlockOffset() == ptr->mParamHandle); some_param_changed |= merge_func(*paramp, *other_paramp, overwrite); } } diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index 7f5b9b4ac2..16829249b8 100644 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -325,13 +325,11 @@ namespace LLInitParam std::string calcValueName(const value_t& value) const { value_name_map_t* map = getValueNames(); - for (typename value_name_map_t::iterator it = map->begin(), end_it = map->end(); - it != end_it; - ++it) + for (typename value_name_map_t::value_type map_pair : *map) { - if (ParamCompare::equals(it->second, value)) + if (ParamCompare::equals(map_pair.second, value)) { - return it->first; + return map_pair.first; } } @@ -376,11 +374,9 @@ namespace LLInitParam static std::vector sValues; value_name_map_t* map = getValueNames(); - for (typename value_name_map_t::iterator it = map->begin(), end_it = map->end(); - it != end_it; - ++it) + for (typename value_name_map_t::value_type map_pair : *map) { - sValues.push_back(it->first); + sValues.push_back(map_pair.first); } return &sValues; } diff --git a/indra/llcommon/llkeybind.cpp b/indra/llcommon/llkeybind.cpp index 12e57ae94b..b89160cc55 100644 --- a/indra/llcommon/llkeybind.cpp +++ b/indra/llcommon/llkeybind.cpp @@ -207,9 +207,9 @@ bool LLKeyBind::operator!=(const LLKeyBind& rhs) bool LLKeyBind::isEmpty() const { - for (data_vector_t::const_iterator iter = mData.begin(); iter != mData.end(); iter++) + for (const LLKeyData& key_data : mData) { - if (!iter->isEmpty()) return false; + if (!key_data.isEmpty()) return false; } return true; } @@ -225,12 +225,11 @@ LLKeyBind::data_vector_t::const_iterator LLKeyBind::endNonEmpty() const LLSD LLKeyBind::asLLSD() const { LLSD data; - auto end{ endNonEmpty() }; - for (auto it = mData.begin(); it < end; ++it) + for (const LLKeyData& key_data : mData) { // append intermediate entries even if empty to not affect visual // representation - data.append(it->asLLSD()); + data.append(key_data.asLLSD()); } return data; } @@ -243,9 +242,9 @@ bool LLKeyBind::canHandle(EMouseClickType mouse, KEY key, MASK mask) const return false; } - for (data_vector_t::const_iterator iter = mData.begin(); iter != mData.end(); iter++) + for (const LLKeyData& key_data : mData) { - if (iter->canHandle(mouse, key, mask)) + if (key_data.canHandle(mouse, key, mask)) { return true; } @@ -267,12 +266,12 @@ bool LLKeyBind::hasKeyData(EMouseClickType mouse, KEY key, MASK mask, bool ignor { if (mouse != CLICK_NONE || key != KEY_NONE) { - for (data_vector_t::const_iterator iter = mData.begin(); iter != mData.end(); iter++) + for (const LLKeyData& key_data : mData) { - if (iter->mKey == key - && iter->mMask == mask - && iter->mMouse == mouse - && iter->mIgnoreMasks == ignore) + if (key_data.mKey == key + && key_data.mMask == mask + && key_data.mMouse == mouse + && key_data.mIgnoreMasks == ignore) { return true; } @@ -354,16 +353,16 @@ void LLKeyBind::replaceKeyData(const LLKeyData& data, U32 index) { // if both click and key are none (isEmpty()), we are inserting a placeholder, we don't want to reset anything // otherwise reset identical key - for (data_vector_t::iterator iter = mData.begin(); iter != mData.end(); iter++) + for (LLKeyData& key_data : mData) { - if (iter->mKey == data.mKey - && iter->mMouse == data.mMouse - && iter->mIgnoreMasks == data.mIgnoreMasks - && iter->mMask == data.mMask) + if (key_data.mKey == data.mKey + && key_data.mMouse == data.mMouse + && key_data.mIgnoreMasks == data.mIgnoreMasks + && key_data.mMask == data.mMask) { // Replacing only fully equal combinations even in case 'ignore' is set // Reason: Simplicity and user might decide to do a 'move' command as W and Shift+Ctrl+W, and 'run' as Shift+W - iter->reset(); + key_data.reset(); break; } } diff --git a/indra/llcommon/llmetricperformancetester.cpp b/indra/llcommon/llmetricperformancetester.cpp index 864ecf650b..a981865e62 100644 --- a/indra/llcommon/llmetricperformancetester.cpp +++ b/indra/llcommon/llmetricperformancetester.cpp @@ -42,9 +42,9 @@ LLMetricPerformanceTesterBasic::name_tester_map_t LLMetricPerformanceTesterBasic /*static*/ void LLMetricPerformanceTesterBasic::cleanupClass() { - for (name_tester_map_t::iterator iter = sTesterMap.begin() ; iter != sTesterMap.end() ; ++iter) + for (name_tester_map_t::value_type pair : sTesterMap) { - delete iter->second ; + delete pair.second; } sTesterMap.clear() ; } @@ -154,10 +154,9 @@ void LLMetricPerformanceTesterBasic::doAnalysisMetrics(std::string baseline, std llofstream os(output.c_str()); os << "Label, Metric, Base(B), Target(T), Diff(T-B), Percentage(100*T/B)\n"; - for(LLMetricPerformanceTesterBasic::name_tester_map_t::iterator iter = LLMetricPerformanceTesterBasic::sTesterMap.begin() ; - iter != LLMetricPerformanceTesterBasic::sTesterMap.end() ; ++iter) + for (LLMetricPerformanceTesterBasic::name_tester_map_t::value_type pair : LLMetricPerformanceTesterBasic::sTesterMap) { - LLMetricPerformanceTesterBasic* tester = ((LLMetricPerformanceTesterBasic*)iter->second) ; + LLMetricPerformanceTesterBasic* tester = ((LLMetricPerformanceTesterBasic*)pair.second); tester->analyzePerformance(&os, &base, ¤t) ; } diff --git a/indra/llcommon/llnametable.h b/indra/llcommon/llnametable.h index d3283543f3..51247d61ba 100644 --- a/indra/llcommon/llnametable.h +++ b/indra/llcommon/llnametable.h @@ -86,12 +86,10 @@ public: // O(N)! (currently only used in one place... (newsim/llstate.cpp)) const char *resolveData(const DATA &data) const { - const_iter_t iter = mNameMap.begin(); - const_iter_t end = mNameMap.end(); - for (; iter != end; ++iter) + for (const name_map_t::value_type pair : mNameMap) { - if (iter->second == data) - return iter->first; + if (pair.second == data) + return pair.first; } return NULL; } diff --git a/indra/llcommon/llpriqueuemap.h b/indra/llcommon/llpriqueuemap.h index d8d3edd48a..030e2e0f21 100644 --- a/indra/llcommon/llpriqueuemap.h +++ b/indra/llcommon/llpriqueuemap.h @@ -115,9 +115,9 @@ public: LL_WARNS() << "Data not on priority queue!" << LL_ENDL; // OK, try iterating through all of the data and seeing if we just screwed up the priority // somehow. - for (iter = mMap.begin(); iter != mMap.end(); iter++) + for (pqm_pair pair : mMap) { - if ((*(iter)).second == data) + if (pair.second == data) { LL_ERRS() << "Data on priority queue but priority not matched!" << LL_ENDL; } diff --git a/indra/llcommon/llregistry.h b/indra/llcommon/llregistry.h index 750fe9fdc8..e272d7a9b8 100644 --- a/indra/llcommon/llregistry.h +++ b/indra/llcommon/llregistry.h @@ -141,11 +141,9 @@ public: ptr_value_t getValue(ref_const_key_t key) { - for(scope_list_iterator_t it = mActiveScopes.begin(); - it != mActiveScopes.end(); - ++it) + for(Registrar* scope : mActiveScopes) { - ptr_value_t valuep = (*it)->getValue(key); + ptr_value_t valuep = scope->getValue(key); if (valuep != NULL) return valuep; } return mDefaultRegistrar.getValue(key); @@ -153,11 +151,9 @@ public: ptr_const_value_t getValue(ref_const_key_t key) const { - for(scope_list_const_iterator_t it = mActiveScopes.begin(); - it != mActiveScopes.end(); - ++it) + for(const Registrar* scope : mActiveScopes) { - ptr_value_t valuep = (*it)->getValue(key); + ptr_const_value_t valuep = scope->getValue(key); if (valuep != NULL) return valuep; } return mDefaultRegistrar.getValue(key); @@ -165,11 +161,9 @@ public: bool exists(ref_const_key_t key) const { - for(scope_list_const_iterator_t it = mActiveScopes.begin(); - it != mActiveScopes.end(); - ++it) + for(const Registrar* scope : mActiveScopes) { - if ((*it)->exists(key)) return true; + if (scope->exists(key)) return true; } return mDefaultRegistrar.exists(key); @@ -177,11 +171,9 @@ public: bool empty() const { - for(scope_list_const_iterator_t it = mActiveScopes.begin(); - it != mActiveScopes.end(); - ++it) + for(const Registrar* scope : mActiveScopes) { - if (!(*it)->empty()) return false; + if (!scope->empty()) return false; } return mDefaultRegistrar.empty(); diff --git a/indra/llcommon/llsdparam.cpp b/indra/llcommon/llsdparam.cpp index af4ccf25fd..7f3d3c2d77 100644 --- a/indra/llcommon/llsdparam.cpp +++ b/indra/llcommon/llsdparam.cpp @@ -113,11 +113,9 @@ void LLParamSDParser::writeSDImpl(LLSD& sd, const LLInitParam::BaseBlock& block, /*virtual*/ std::string LLParamSDParser::getCurrentElementName() { std::string full_name = "sd"; - for (name_stack_t::iterator it = mNameStack.begin(); - it != mNameStack.end(); - ++it) + for (name_stack_t::value_type stack_pair : mNameStack) { - full_name += llformat("[%s]", it->first.c_str()); + full_name += llformat("[%s]", stack_pair.first.c_str()); } return full_name; diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp index 8e90d1e8b8..f70bee9903 100644 --- a/indra/llcommon/llsdutil.cpp +++ b/indra/llcommon/llsdutil.cpp @@ -148,10 +148,9 @@ LLSD ll_binary_from_string(const LLSD& sd) std::vector binary_value; std::string string_value = sd.asString(); - for (std::string::iterator iter = string_value.begin(); - iter != string_value.end(); ++iter) + for (const U8 c : string_value) { - binary_value.push_back(*iter); + binary_value.push_back(c); } binary_value.push_back('\0'); diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 1fd6cac14a..7ba5c8c241 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -1668,13 +1668,13 @@ std::basic_string LLStringUtilBase::quote(const string_type& str, // For whatever reason, we must quote this string. string_type result; result.push_back('"'); - for (typename string_type::const_iterator ci(str.begin()), cend(str.end()); ci != cend; ++ci) + for (typename const S8 c : str) { - if (*ci == '"') + if (c == '"') { result.append(escape); } - result.push_back(*ci); + result.push_back(c); } result.push_back('"'); return result; diff --git a/indra/llcommon/llstringtable.cpp b/indra/llcommon/llstringtable.cpp index f288999964..92a5e777a6 100644 --- a/indra/llcommon/llstringtable.cpp +++ b/indra/llcommon/llstringtable.cpp @@ -89,9 +89,8 @@ LLStringTable::~LLStringTable() { if (mStringList[i]) { - string_list_t::iterator iter; - for (iter = mStringList[i]->begin(); iter != mStringList[i]->end(); iter++) - delete *iter; // *iter = (LLStringTableEntry*) + for (LLStringTableEntry* entry : *mStringList[i]) + delete entry; } delete mStringList[i]; } @@ -156,9 +155,9 @@ LLStringTableEntry* LLStringTable::checkStringEntry(const char *str) if (str) { char *ret_val; - LLStringTableEntry *entry; U32 hash_value = hash_my_string(str, mMaxEntries); #if STRING_TABLE_HASH_MAP + LLStringTableEntry *entry; #if 1 // Microsoft string_hash_t::iterator lower = mStringHash.lower_bound(hash_value); string_hash_t::iterator upper = mStringHash.upper_bound(hash_value); @@ -180,10 +179,8 @@ LLStringTableEntry* LLStringTable::checkStringEntry(const char *str) string_list_t *strlist = mStringList[hash_value]; if (strlist) { - string_list_t::iterator iter; - for (iter = strlist->begin(); iter != strlist->end(); iter++) + for (LLStringTableEntry* entry : *strlist) { - entry = *iter; ret_val = entry->mString; if (!strncmp(ret_val, str, MAX_STRINGS_LENGTH)) { @@ -226,9 +223,9 @@ LLStringTableEntry* LLStringTable::addStringEntry(const char *str) if (str) { char *ret_val = NULL; - LLStringTableEntry *entry; U32 hash_value = hash_my_string(str, mMaxEntries); #if STRING_TABLE_HASH_MAP + LLStringTableEntry *entry; #if 1 // Microsoft string_hash_t::iterator lower = mStringHash.lower_bound(hash_value); string_hash_t::iterator upper = mStringHash.upper_bound(hash_value); @@ -257,10 +254,8 @@ LLStringTableEntry* LLStringTable::addStringEntry(const char *str) if (strlist) { - string_list_t::iterator iter; - for (iter = strlist->begin(); iter != strlist->end(); iter++) + for (LLStringTableEntry* entry : *strlist) { - entry = *iter; ret_val = entry->mString; if (!strncmp(ret_val, str, MAX_STRINGS_LENGTH)) { @@ -294,10 +289,10 @@ void LLStringTable::removeString(const char *str) if (str) { char *ret_val; - LLStringTableEntry *entry; U32 hash_value = hash_my_string(str, mMaxEntries); #if STRING_TABLE_HASH_MAP { + LLStringTableEntry *entry; #if 1 // Microsoft string_hash_t::iterator lower = mStringHash.lower_bound(hash_value); string_hash_t::iterator upper = mStringHash.upper_bound(hash_value); @@ -331,10 +326,8 @@ void LLStringTable::removeString(const char *str) if (strlist) { - string_list_t::iterator iter; - for (iter = strlist->begin(); iter != strlist->end(); iter++) + for (LLStringTableEntry* entry : *strlist) { - entry = *iter; ret_val = entry->mString; if (!strncmp(ret_val, str, MAX_STRINGS_LENGTH)) { diff --git a/indra/llcommon/llstringtable.h b/indra/llcommon/llstringtable.h index ff09e71677..0a292c8bac 100644 --- a/indra/llcommon/llstringtable.h +++ b/indra/llcommon/llstringtable.h @@ -136,9 +136,9 @@ public: for (S32 i = 0; i::iterator it = mRecordingPeriods.begin(), end_it = mRecordingPeriods.end(); - it != end_it; - ++it) + for (Recording& rec : mRecordingPeriods) { - it->reset(); + rec.reset(); } } mCurPeriod = 0; diff --git a/indra/llcommon/lltracethreadrecorder.cpp b/indra/llcommon/lltracethreadrecorder.cpp index 4028a5ce97..282c454a2a 100644 --- a/indra/llcommon/lltracethreadrecorder.cpp +++ b/indra/llcommon/lltracethreadrecorder.cpp @@ -284,13 +284,11 @@ void ThreadRecorder::pullFromChildren() AccumulatorBufferGroup& target_recording_buffers = mActiveRecordings.back()->mPartialRecording; target_recording_buffers.sync(); - for (child_thread_recorder_list_t::iterator it = mChildThreadRecorders.begin(), end_it = mChildThreadRecorders.end(); - it != end_it; - ++it) - { LLMutexLock lock(&(*it)->mSharedRecordingMutex); + for (LLTrace::ThreadRecorder* rec : mChildThreadRecorders) + { LLMutexLock lock(&(rec->mSharedRecordingMutex)); - target_recording_buffers.merge((*it)->mSharedRecordingBuffers); - (*it)->mSharedRecordingBuffers.reset(); + target_recording_buffers.merge(rec->mSharedRecordingBuffers); + rec->mSharedRecordingBuffers.reset(); } } #endif diff --git a/indra/llcommon/lluri.cpp b/indra/llcommon/lluri.cpp index 22711a83d2..4fb92a8f3e 100644 --- a/indra/llcommon/lluri.cpp +++ b/indra/llcommon/lluri.cpp @@ -663,9 +663,9 @@ LLSD LLURI::pathArray() const tokenizer::iterator end = tokens.end(); LLSD params; - for ( ; it != end; ++it) + for (const std::string& str : tokens) { - params.append(*it); + params.append(str); } return params; } diff --git a/indra/llcommon/llworkerthread.cpp b/indra/llcommon/llworkerthread.cpp index 97838e296e..e5eda1eac7 100644 --- a/indra/llcommon/llworkerthread.cpp +++ b/indra/llcommon/llworkerthread.cpp @@ -69,11 +69,11 @@ void LLWorkerThread::clearDeleteList() << " entries in delete list." << LL_ENDL; mDeleteMutex->lock(); - for (delete_list_t::iterator iter = mDeleteList.begin(); iter != mDeleteList.end(); ++iter) + for (LLWorkerClass* worker : mDeleteList) { - (*iter)->mRequestHandle = LLWorkerThread::nullHandle(); - (*iter)->clearFlags(LLWorkerClass::WCF_HAVE_WORK); - delete *iter ; + worker->mRequestHandle = LLWorkerThread::nullHandle(); + worker->clearFlags(LLWorkerClass::WCF_HAVE_WORK); + delete worker; } mDeleteList.clear() ; mDeleteMutex->unlock() ; @@ -108,15 +108,12 @@ size_t LLWorkerThread::update(F32 max_time_ms) } mDeleteMutex->unlock(); // abort and delete after releasing mutex - for (std::vector::iterator iter = abort_list.begin(); - iter != abort_list.end(); ++iter) + for (LLWorkerClass* worker : abort_list) { - (*iter)->abortWork(false); + worker->abortWork(false); } - for (std::vector::iterator iter = delete_list.begin(); - iter != delete_list.end(); ++iter) + for (LLWorkerClass* worker : delete_list) { - LLWorkerClass* worker = *iter; if (worker->mRequestHandle) { // Finished but not completed @@ -124,7 +121,7 @@ size_t LLWorkerThread::update(F32 max_time_ms) worker->mRequestHandle = LLWorkerThread::nullHandle(); worker->clearFlags(LLWorkerClass::WCF_HAVE_WORK); } - delete *iter; + delete worker; } // delete and aborted entries mean there's still work to do res += delete_list.size() + abort_list.size(); -- cgit v1.2.3 From 77444ca356abb4ab77736d7db84f01b89cdf55b5 Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Sat, 7 Jan 2023 20:36:50 +0100 Subject: Translate missing control_*, floater_* menu_* and few panel_* files in Polish directory; Fix localizability in various English XMLs --- .../skins/default/xui/en/floater_360capture.xml | 1 + .../default/xui/en/floater_adjust_environment.xml | 24 ++++- .../default/xui/en/floater_edit_ext_day_cycle.xml | 4 + .../default/xui/en/floater_experienceprofile.xml | 7 +- .../default/xui/en/floater_fixedenvironment.xml | 1 + .../default/xui/en/floater_my_environments.xml | 2 + .../skins/default/xui/en/panel_experience_info.xml | 3 + .../default/xui/en/panel_experience_list_item.xml | 1 + .../skins/default/xui/en/panel_experience_log.xml | 3 + .../default/xui/en/panel_experience_search.xml | 3 + .../skins/default/xui/en/panel_experiences.xml | 1 + .../default/xui/en/panel_settings_sky_atmos.xml | 17 ++++ .../default/xui/en/panel_settings_sky_clouds.xml | 11 +++ .../default/xui/en/panel_settings_sky_density.xml | 4 + .../default/xui/en/panel_settings_sky_sunmoon.xml | 20 ++++ .../skins/default/xui/en/panel_settings_water.xml | 17 ++++ .../xui/pl/control_table_contents_camera.xml | 72 ++++++++++++++ .../pl/control_table_contents_columns_basic.xml | 7 ++ .../xui/pl/control_table_contents_editing.xml | 24 +++++ .../xui/pl/control_table_contents_media.xml | 27 ++++++ .../xui/pl/control_table_contents_movement.xml | 60 ++++++++++++ .../skins/default/xui/pl/floater_360capture.xml | 22 +++++ .../default/xui/pl/floater_add_payment_method.xml | 19 ++++ .../default/xui/pl/floater_adjust_environment.xml | 86 +++++++++++++++++ .../xui/pl/floater_avatar_render_settings.xml | 12 +++ .../skins/default/xui/pl/floater_ban_duration.xml | 18 ++++ .../default/xui/pl/floater_camera_presets.xml | 2 + .../skins/default/xui/pl/floater_classified.xml | 2 + .../default/xui/pl/floater_create_landmark.xml | 14 +++ .../default/xui/pl/floater_delete_pref_preset.xml | 14 +++ .../default/xui/pl/floater_edit_ext_day_cycle.xml | 79 +++++++++++++++ .../default/xui/pl/floater_experience_search.xml | 2 + .../default/xui/pl/floater_experienceprofile.xml | 84 ++++++++++++++++ .../skins/default/xui/pl/floater_experiences.xml | 2 + .../default/xui/pl/floater_fixedenvironment.xml | 28 ++++++ .../skins/default/xui/pl/floater_forget_user.xml | 5 + .../skins/default/xui/pl/floater_linkreplace.xml | 33 +++++++ .../default/xui/pl/floater_load_pref_preset.xml | 13 +++ indra/newview/skins/default/xui/pl/floater_mfa.xml | 8 ++ .../default/xui/pl/floater_my_environments.xml | 22 +++++ .../skins/default/xui/pl/floater_my_scripts.xml | 2 + .../xui/pl/floater_notifications_tabbed.xml | 36 +++++++ .../xui/pl/floater_outfit_photo_preview.xml | 13 +++ .../skins/default/xui/pl/floater_pick_track.xml | 21 ++++ .../pl/floater_preferences_graphics_advanced.xml | 107 +++++++++++++++++++++ .../xui/pl/floater_preferences_view_advanced.xml | 12 +++ .../skins/default/xui/pl/floater_preview_trash.xml | 11 +++ .../skins/default/xui/pl/floater_profile.xml | 13 +++ .../default/xui/pl/floater_profile_permissions.xml | 9 ++ .../default/xui/pl/floater_profile_texture.xml | 12 +++ .../default/xui/pl/floater_save_camera_preset.xml | 15 +++ .../default/xui/pl/floater_save_pref_preset.xml | 8 ++ .../default/xui/pl/floater_settings_picker.xml | 29 ++++++ .../xui/pl/floater_simple_outfit_snapshot.xml | 6 ++ .../xui/pl/menu_avatar_rendering_settings.xml | 6 ++ .../xui/pl/menu_avatar_rendering_settings_add.xml | 5 + .../skins/default/xui/pl/menu_copy_paste_color.xml | 5 + .../default/xui/pl/menu_copy_paste_features.xml | 5 + .../skins/default/xui/pl/menu_copy_paste_light.xml | 5 + .../default/xui/pl/menu_copy_paste_object.xml | 5 + .../skins/default/xui/pl/menu_copy_paste_pos.xml | 7 ++ .../skins/default/xui/pl/menu_copy_paste_rot.xml | 7 ++ .../skins/default/xui/pl/menu_copy_paste_size.xml | 7 ++ .../default/xui/pl/menu_copy_paste_texture.xml | 5 + .../default/xui/pl/menu_gallery_outfit_tab.xml | 33 +++++++ .../xui/pl/menu_inventory_search_visibility.xml | 6 ++ .../default/xui/pl/menu_places_gear_sorting.xml | 6 ++ .../skins/default/xui/pl/menu_profile_other.xml | 19 ++++ .../skins/default/xui/pl/menu_profile_self.xml | 11 +++ .../skins/default/xui/pl/menu_save_settings.xml | 9 ++ .../skins/default/xui/pl/menu_settings_add.xml | 6 ++ .../skins/default/xui/pl/menu_settings_gear.xml | 10 ++ .../skins/default/xui/pl/menu_url_email.xml | 5 + .../skins/default/xui/pl/menu_url_experience.xml | 4 + .../default/xui/pl/panel_camera_preset_item.xml | 6 ++ .../skins/default/xui/pl/panel_edit_universal.xml | 19 ++++ .../skins/default/xui/pl/panel_experience_info.xml | 31 ++++++ .../xui/pl/panel_experience_list_editor.xml | 27 ++++++ .../default/xui/pl/panel_experience_list_item.xml | 2 + .../skins/default/xui/pl/panel_experience_log.xml | 22 +++++ .../default/xui/pl/panel_experience_search.xml | 35 +++++++ .../skins/default/xui/pl/panel_experiences.xml | 6 ++ .../xui/pl/panel_presets_camera_pulldown.xml | 7 ++ .../default/xui/pl/panel_presets_pulldown.xml | 7 ++ .../skins/default/xui/pl/panel_progress.xml | 18 ++++ .../default/xui/pl/panel_settings_sky_atmos.xml | 51 ++++++++++ .../default/xui/pl/panel_settings_sky_clouds.xml | 34 +++++++ .../default/xui/pl/panel_settings_sky_density.xml | 27 ++++++ .../default/xui/pl/panel_settings_sky_sunmoon.xml | 66 +++++++++++++ .../skins/default/xui/pl/panel_settings_water.xml | 57 +++++++++++ 90 files changed, 1647 insertions(+), 2 deletions(-) create mode 100644 indra/newview/skins/default/xui/pl/control_table_contents_camera.xml create mode 100644 indra/newview/skins/default/xui/pl/control_table_contents_columns_basic.xml create mode 100644 indra/newview/skins/default/xui/pl/control_table_contents_editing.xml create mode 100644 indra/newview/skins/default/xui/pl/control_table_contents_media.xml create mode 100644 indra/newview/skins/default/xui/pl/control_table_contents_movement.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_360capture.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_add_payment_method.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_adjust_environment.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_avatar_render_settings.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_ban_duration.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_camera_presets.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_classified.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_create_landmark.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_delete_pref_preset.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_edit_ext_day_cycle.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_experience_search.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_experienceprofile.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_experiences.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_fixedenvironment.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_forget_user.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_linkreplace.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_load_pref_preset.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_mfa.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_my_environments.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_my_scripts.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_notifications_tabbed.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_outfit_photo_preview.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_pick_track.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_preferences_graphics_advanced.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_preferences_view_advanced.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_preview_trash.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_profile.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_profile_permissions.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_profile_texture.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_save_camera_preset.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_save_pref_preset.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_settings_picker.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_simple_outfit_snapshot.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_avatar_rendering_settings.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_avatar_rendering_settings_add.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_copy_paste_color.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_copy_paste_features.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_copy_paste_light.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_copy_paste_object.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_copy_paste_pos.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_copy_paste_rot.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_copy_paste_size.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_copy_paste_texture.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_gallery_outfit_tab.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_inventory_search_visibility.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_places_gear_sorting.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_profile_other.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_profile_self.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_save_settings.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_settings_add.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_settings_gear.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_url_email.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_url_experience.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_camera_preset_item.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_edit_universal.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_experience_info.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_experience_list_editor.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_experience_list_item.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_experience_log.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_experience_search.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_experiences.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_presets_camera_pulldown.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_presets_pulldown.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_progress.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_settings_sky_atmos.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_settings_sky_clouds.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_settings_sky_density.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_settings_sky_sunmoon.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_settings_water.xml (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_360capture.xml b/indra/newview/skins/default/xui/en/floater_360capture.xml index c89489d145..23d054105f 100644 --- a/indra/newview/skins/default/xui/en/floater_360capture.xml +++ b/indra/newview/skins/default/xui/en/floater_360capture.xml @@ -24,6 +24,7 @@ height="16" layout="topleft" left="10" + name="quality_level_label" top="10" width="100"> Quality level diff --git a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml index f4a686bae1..bf97d32a5c 100644 --- a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml +++ b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml @@ -33,6 +33,7 @@ animate="false" orientation="horizontal"> Water Image: + Name: diff --git a/indra/newview/skins/default/xui/en/floater_my_environments.xml b/indra/newview/skins/default/xui/en/floater_my_environments.xml index 6aff387dcb..4ff25de5e2 100644 --- a/indra/newview/skins/default/xui/en/floater_my_environments.xml +++ b/indra/newview/skins/default/xui/en/floater_my_environments.xml @@ -17,6 +17,7 @@ min_width="265" width="313"> @@ -63,6 +65,7 @@ height="18" name="find"/> Fresnel Scale: @@ -141,6 +147,7 @@ @@ -152,6 +159,7 @@ follows="left|top|right|bottom" orientation="horizontal"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/pl/control_table_contents_columns_basic.xml b/indra/newview/skins/default/xui/pl/control_table_contents_columns_basic.xml new file mode 100644 index 0000000000..5f995b4128 --- /dev/null +++ b/indra/newview/skins/default/xui/pl/control_table_contents_columns_basic.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/indra/newview/skins/default/xui/pl/control_table_contents_editing.xml b/indra/newview/skins/default/xui/pl/control_table_contents_editing.xml new file mode 100644 index 0000000000..568b7dcf6d --- /dev/null +++ b/indra/newview/skins/default/xui/pl/control_table_contents_editing.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/pl/control_table_contents_media.xml b/indra/newview/skins/default/xui/pl/control_table_contents_media.xml new file mode 100644 index 0000000000..042e37963d --- /dev/null +++ b/indra/newview/skins/default/xui/pl/control_table_contents_media.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/pl/control_table_contents_movement.xml b/indra/newview/skins/default/xui/pl/control_table_contents_movement.xml new file mode 100644 index 0000000000..93dd24f0d5 --- /dev/null +++ b/indra/newview/skins/default/xui/pl/control_table_contents_movement.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/pl/floater_360capture.xml b/indra/newview/skins/default/xui/pl/floater_360capture.xml new file mode 100644 index 0000000000..d0a49d1bde --- /dev/null +++ b/indra/newview/skins/default/xui/pl/floater_360capture.xml @@ -0,0 +1,22 @@ + + + + + Poziom detali + + + + + + + + +