summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/CMakeLists.txt83
-rw-r--r--indra/newview/app_settings/settings.xml33
-rw-r--r--indra/newview/installers/windows/installer_template.nsi1
-rw-r--r--indra/newview/llappearancemgr.cpp6
-rw-r--r--indra/newview/llappviewer.cpp3
-rw-r--r--indra/newview/llchathistory.cpp18
-rw-r--r--indra/newview/llchatitemscontainerctrl.cpp21
-rw-r--r--indra/newview/llconversationview.cpp11
-rw-r--r--indra/newview/lldrawable.cpp12
-rw-r--r--indra/newview/lldrawpoolwater.cpp5
-rw-r--r--indra/newview/llenvironment.cpp2
-rw-r--r--indra/newview/lleventpoll.cpp2
-rw-r--r--indra/newview/llface.cpp116
-rw-r--r--indra/newview/llface.h4
-rw-r--r--indra/newview/llfloatercolorpicker.cpp12
-rw-r--r--indra/newview/llfloatereditenvironmentbase.cpp2
-rw-r--r--indra/newview/llfloateremojipicker.cpp36
-rw-r--r--indra/newview/llfloaterfixedenvironment.cpp2
-rw-r--r--indra/newview/llfloaterimnearbychathandler.cpp9
-rw-r--r--indra/newview/llfloaterjoystick.cpp33
-rw-r--r--indra/newview/llfloaterjoystick.h2
-rw-r--r--indra/newview/llfloaterscriptedprefs.cpp2
-rw-r--r--indra/newview/llfloatersettingscolor.cpp334
-rw-r--r--indra/newview/llfloatersettingscolor.h81
-rwxr-xr-xindra/newview/llfloaterworldmap.cpp135
-rw-r--r--indra/newview/llfloaterworldmap.h29
-rw-r--r--indra/newview/llhudnametag.cpp9
-rw-r--r--indra/newview/llhudtext.cpp6
-rw-r--r--indra/newview/llinventorygallery.cpp110
-rw-r--r--indra/newview/llinventorygallery.h1
-rw-r--r--indra/newview/lllocalbitmaps.cpp9
-rw-r--r--indra/newview/llmanip.cpp6
-rw-r--r--indra/newview/llmeshrepository.cpp3
-rw-r--r--indra/newview/lloutfitgallery.cpp48
-rw-r--r--indra/newview/lloutfitgallery.h3
-rw-r--r--indra/newview/lloutputmonitorctrl.cpp12
-rw-r--r--indra/newview/llpanelface.cpp1850
-rw-r--r--indra/newview/llpanelface.h412
-rw-r--r--indra/newview/llpanelpermissions.cpp2
-rw-r--r--indra/newview/llreflectionmap.cpp4
-rw-r--r--indra/newview/llscripteditor.cpp2
-rw-r--r--indra/newview/llsculptidsize.cpp2
-rw-r--r--indra/newview/llselectmgr.cpp25
-rw-r--r--indra/newview/llselectmgr.h14
-rw-r--r--indra/newview/llsettingsvo.cpp1
-rw-r--r--indra/newview/llsidepaneliteminfo.cpp2
-rw-r--r--indra/newview/llspatialpartition.cpp3
-rw-r--r--indra/newview/llspeakers.cpp26
-rw-r--r--indra/newview/lltexturefetch.cpp77
-rw-r--r--indra/newview/lltexturefetch.h2
-rw-r--r--indra/newview/lltextureview.cpp10
-rw-r--r--indra/newview/lltoolbarview.cpp2
-rw-r--r--indra/newview/llviewerchat.cpp10
-rw-r--r--indra/newview/llviewerchat.h5
-rw-r--r--indra/newview/llviewerfloaterreg.cpp2
-rw-r--r--indra/newview/llviewermenu.cpp6
-rw-r--r--indra/newview/llviewermenufile.cpp21
-rw-r--r--indra/newview/llviewerobject.cpp3
-rw-r--r--indra/newview/llviewerobject.h4
-rw-r--r--indra/newview/llviewerobjectlist.cpp29
-rw-r--r--indra/newview/llviewerobjectlist.h2
-rwxr-xr-xindra/newview/llviewerparceloverlay.cpp43
-rw-r--r--indra/newview/llviewerparceloverlay.h9
-rw-r--r--indra/newview/llviewertexteditor.cpp12
-rw-r--r--indra/newview/llviewertexture.cpp4
-rw-r--r--indra/newview/llviewertexturelist.cpp10
-rw-r--r--indra/newview/llviewertexturelist.h2
-rw-r--r--indra/newview/llviewerwindow.cpp6
-rw-r--r--indra/newview/llvoavatar.cpp151
-rw-r--r--indra/newview/llvoavatar.h4
-rw-r--r--indra/newview/llvoicechannel.cpp7
-rw-r--r--indra/newview/llvoicechannel.h6
-rw-r--r--indra/newview/llvoiceclient.cpp32
-rw-r--r--indra/newview/llvoiceclient.h16
-rw-r--r--indra/newview/llvoicevivox.cpp35
-rw-r--r--indra/newview/llvoicevivox.h9
-rw-r--r--indra/newview/llvoicewebrtc.cpp107
-rw-r--r--indra/newview/llvoicewebrtc.h37
-rw-r--r--indra/newview/llvosurfacepatch.cpp6
-rw-r--r--indra/newview/llvovolume.cpp2
-rw-r--r--indra/newview/llvovolume.h8
-rw-r--r--indra/newview/llworldmap.h8
-rw-r--r--indra/newview/pipeline.cpp159
-rw-r--r--indra/newview/pipeline.h1
-rw-r--r--indra/newview/skins/default/xui/en/floater_settings_color.xml117
-rw-r--r--indra/newview/skins/default/xui/en/floater_world_map.xml3
-rw-r--r--indra/newview/skins/default/xui/en/menu_login.xml7
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml7
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml1
-rw-r--r--indra/newview/skins/default/xui/en/panel_region_debug.xml2
-rwxr-xr-xindra/newview/viewer_manifest.py30
91 files changed, 2606 insertions, 1952 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index e7857ff09f..fbaf4e559f 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -286,6 +286,7 @@ set(viewer_SOURCE_FILES
llfloaterscriptlimits.cpp
llfloatersearch.cpp
llfloatersellland.cpp
+ llfloatersettingscolor.cpp
llfloatersettingsdebug.cpp
llfloatersidepanelcontainer.cpp
llfloatersnapshot.cpp
@@ -955,6 +956,7 @@ set(viewer_HEADER_FILES
llfloaterscriptlimits.h
llfloatersearch.h
llfloatersellland.h
+ llfloatersettingscolor.h
llfloatersettingsdebug.h
llfloatersidepanelcontainer.h
llfloatersnapshot.h
@@ -1731,7 +1733,6 @@ if (WINDOWS)
${CMAKE_SOURCE_DIR}/../etc/message.xml
${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg
${SHARED_LIB_STAGING_DIR}/openjp2.dll
- ${SHARED_LIB_STAGING_DIR}/libhunspell.dll
${SHARED_LIB_STAGING_DIR}/llwebrtc.dll
#${SHARED_LIB_STAGING_DIR}/${LL_INTDIR}/SLVoice.exe
#${SHARED_LIB_STAGING_DIR}/${LL_INTDIR}/libsndfile-1.dll
@@ -1750,15 +1751,11 @@ if (WINDOWS)
list(APPEND COPY_INPUT_DEPENDENCIES
${SHARED_LIB_STAGING_DIR}/vivoxsdk_x64.dll
${SHARED_LIB_STAGING_DIR}/ortp_x64.dll
- ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto-1_1-x64.dll
- ${ARCH_PREBUILT_DIRS_RELEASE}/libssl-1_1-x64.dll
)
else (ADDRESS_SIZE EQUAL 64)
list(APPEND COPY_INPUT_DEPENDENCIES
${SHARED_LIB_STAGING_DIR}/vivoxsdk.dll
${SHARED_LIB_STAGING_DIR}/ortp.dll
- ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto-1_1.dll
- ${ARCH_PREBUILT_DIRS_RELEASE}/libssl-1_1.dll
)
endif (ADDRESS_SIZE EQUAL 64)
@@ -2074,8 +2071,6 @@ if (DARWIN)
set(VIEWER_APP_BUNDLE "${CMAKE_CURRENT_BINARY_DIR}/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>/${product}.app")
set(VIEWER_APP_EXE "${VIEWER_APP_BUNDLE}/Contents/MacOS/${product}")
- set(VIEWER_APP_DSYM "${VIEWER_APP_EXE}.dSYM")
- set(VIEWER_APP_XCARCHIVE "${VIEWER_APP_BUNDLE}/../${product}.xcarchive.zip")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist"
@@ -2146,73 +2141,51 @@ if (INSTALL)
include(${CMAKE_CURRENT_SOURCE_DIR}/ViewerInstall.cmake)
endif (INSTALL)
-# Note that the conventional VIEWER_SYMBOL_FILE is set by ../../build.sh
if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIEWER_SYMBOL_FILE)
if (USE_BUGSPLAT)
# BugSplat symbol-file generation
if (WINDOWS)
- # Just pack up a tarball containing only the .pdb file for the
- # executable. Because we intend to use cygwin tar, we must render
- # VIEWER_SYMBOL_FILE in cygwin path syntax.
- execute_process(COMMAND "cygpath" "-u" "${VIEWER_SYMBOL_FILE}"
- OUTPUT_VARIABLE VIEWER_SYMBOL_FILE_CYGWIN
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND "cygpath" "-u" "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}"
- OUTPUT_VARIABLE PARENT_DIRECTORY_CYGWIN
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}"
- # Use of 'tar ...J' here assumes VIEWER_SYMBOL_FILE endswith .tar.xz;
- # testing a string suffix is painful enough in CMake language that
- # we'll continue assuming it until forced to generalize.
+ set(VIEWER_APP_SYMBOLS_ARCHIVE "${SYMBOLS_STAGING_DIR}.sym.tar.xz")
+ set_target_properties( ${VIEWER_BINARY_NAME} PROPERTIES PDB_OUTPUT_DIRECTORY "${SYMBOLS_STAGING_DIR}")
+
+ # Just pack up a tarball containing only the .pdb files for the
+ # executables.
+ add_custom_command(OUTPUT "${VIEWER_APP_SYMBOLS_ARCHIVE}"
COMMAND "tar"
ARGS
"cJf"
- "${VIEWER_SYMBOL_FILE_CYGWIN}"
- "-C"
- "${PARENT_DIRECTORY_CYGWIN}"
- "secondlife-bin.pdb"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-bin.pdb"
- COMMENT "Packing viewer PDB into ${VIEWER_SYMBOL_FILE_CYGWIN}"
+ "${VIEWER_CHANNEL}.sym.tar.xz"
+ "${VIEWER_CHANNEL}"
+ DEPENDS "${VIEWER_BINARY_NAME}" llwebrtc
+ WORKING_DIRECTORY "${SYMBOLS_STAGING_DIR}/.."
+ COMMENT "Packing viewer PDBs into ${VIEWER_APP_SYMBOLS_ARCHIVE}"
)
- add_custom_target(generate_symbols DEPENDS "${VIEWER_SYMBOL_FILE}" ${VIEWER_BINARY_NAME})
- add_dependencies(generate_symbols ${VIEWER_BINARY_NAME})
+ add_custom_target(generate_symbols DEPENDS "${VIEWER_APP_SYMBOLS_ARCHIVE}")
+ add_dependencies(generate_symbols ${VIEWER_BINARY_NAME} llwebrtc)
+
endif (WINDOWS)
if (DARWIN)
- # Have to run dsymutil first, then pack up the resulting .dSYM directory
- add_custom_command(OUTPUT "${VIEWER_APP_DSYM}"
- COMMAND "dsymutil"
- ARGS
- ${VIEWER_APP_EXE}
- COMMENT "Generating ${VIEWER_APP_DSYM}"
- )
- add_custom_target(dsym_generate DEPENDS "${VIEWER_APP_DSYM}")
- add_dependencies(dsym_generate ${VIEWER_BINARY_NAME})
+ set(VIEWER_APP_XCARCHIVE "${SYMBOLS_STAGING_DIR}.xcarchive.zip")
+
+ # we only need an xcarchive with dSYMs (including the application)
+ set_target_properties(${VIEWER_BINARY_NAME}
+ PROPERTIES
+ XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym"
+ XCODE_ATTRIBUTE_DWARF_DSYM_FOLDER_PATH "${SYMBOLS_STAGING_DIR}/dSYMs")
+
add_custom_command(OUTPUT "${VIEWER_APP_XCARCHIVE}"
COMMAND "zip"
ARGS
"-r"
"${VIEWER_APP_XCARCHIVE}"
- "."
- WORKING_DIRECTORY "${VIEWER_APP_DSYM}/.."
- DEPENDS "${VIEWER_APP_DSYM}"
- COMMENT "Generating xcarchive.zip for upload to BugSplat"
- )
- add_custom_target(dsym_xcarchive DEPENDS "${VIEWER_APP_XCARCHIVE}")
- add_dependencies(dsym_xcarchive dsym_generate)
- # Have to create a stamp file, and depend on it, to force CMake to run
- # the cleanup step.
- add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/dsym.stamp"
- COMMAND rm -rf "${VIEWER_APP_DSYM}"
- COMMAND touch "${CMAKE_CURRENT_BINARY_DIR}/dsym.stamp"
- DEPENDS "${VIEWER_APP_XCARCHIVE}"
- COMMENT "Cleaning up dSYM"
+ "${VIEWER_CHANNEL}"
+ WORKING_DIRECTORY "${SYMBOLS_STAGING_DIR}/.."
+ DEPENDS "${VIEWER_BINARY_NAME}" llwebrtc
+ COMMENT "Generating ${VIEWER_APP_XCARCHIVE} for upload to BugSplat"
)
add_custom_target(generate_symbols DEPENDS
- "${VIEWER_APP_DSYM}"
"${VIEWER_APP_XCARCHIVE}"
- "${CMAKE_CURRENT_BINARY_DIR}/dsym.stamp"
)
- add_dependencies(generate_symbols dsym_xcarchive)
endif (DARWIN)
if (LINUX)
# TBD
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 5c3706bb6c..b89618dc87 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1874,6 +1874,28 @@
<key>Value</key>
<real>64.0</real>
</map>
+ <key>AvatarExtentRefreshPeriodBatch</key>
+ <map>
+ <key>Comment</key>
+ <string>how many frames do we spread over by default when refreshing extents (default is 4)</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>S32</string>
+ <key>Value</key>
+ <integer>4</integer>
+ </map>
+ <key>AvatarExtentRefreshMaxPerBatch</key>
+ <map>
+ <key>Comment</key>
+ <string>how many avatars do we want to handle in total per batch (default is 5)</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>S32</string>
+ <key>Value</key>
+ <integer>5</integer>
+ </map>
<key>DebugAvatarAppearanceMessage</key>
<map>
<key>Comment</key>
@@ -15806,6 +15828,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>ColorSettingsHideDefault</key>
+ <map>
+ <key>Comment</key>
+ <string>Show non-default settings only in Color Settings list</string>
+ <key>Persist</key>
+ <integer>0</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>DebugSettingsHideDefault</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi
index d1dab94a76..77f24ac6a6 100644
--- a/indra/newview/installers/windows/installer_template.nsi
+++ b/indra/newview/installers/windows/installer_template.nsi
@@ -32,6 +32,7 @@ SetCompressor /solid lzma # Compress whole installer as one block
SetDatablockOptimize off # Only saves us 0.1%, not worth it
XPStyle on # Add an XP manifest to the installer
RequestExecutionLevel admin # For when we write to Program Files
+Unicode true # Enable unicode support
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Project flags
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index a808c196c7..66082d317a 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -2133,11 +2133,11 @@ void LLAppearanceMgr::filterWearableItems(
items.clear();
for (S32 i=0; i<LLWearableType::WT_COUNT; i++)
{
- auto size = items_by_type[i].size();
+ S32 size = (S32)items_by_type[i].size();
if (size <= 0)
continue;
- auto start_index = llmax(0,size-max_per_type);
- for (size_t j = start_index; j<size; j++)
+ S32 start_index = llmax(0,size-max_per_type);
+ for (S32 j = start_index; j<size; j++)
{
items.push_back(items_by_type[i][j]);
}
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index f2023565fc..262ab439b4 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -802,7 +802,7 @@ bool LLAppViewer::init()
settings_map["floater"] = &gSavedSettings; // *TODO: New settings file
settings_map["account"] = &gSavedPerAccountSettings;
- LLUI::initParamSingleton(settings_map,
+ LLUI::createInstance(settings_map,
LLUIImageList::getInstance(),
ui_audio_callback,
deferred_ui_audio_callback);
@@ -2155,6 +2155,7 @@ bool LLAppViewer::cleanup()
LLViewerEventRecorder::deleteSingleton();
LLWorld::deleteSingleton();
LLVoiceClient::deleteSingleton();
+ LLUI::deleteSingleton();
// It's not at first obvious where, in this long sequence, a generic cleanup
// call OUGHT to go. So let's say this: as we migrate cleanup from
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index 2b02aabc31..a48e22bc73 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -693,7 +693,7 @@ public:
mNeedsTimeBox = false;
user_name->setValue(mFrom);
updateMinUserNameWidth();
- LLColor4 sep_color = LLUIColorTable::instance().getColor("ChatTeleportSeparatorColor");
+ LLUIColor sep_color = LLUIColorTable::instance().getColor("ChatTeleportSeparatorColor");
setTransparentColor(sep_color);
mTimeBoxTextBox->setVisible(false);
}
@@ -739,7 +739,7 @@ public:
std::string username = chat.mFromName.substr(username_start + 2);
username = username.substr(0, username.length() - 1);
LLStyle::Params style_params_name;
- LLColor4 userNameColor = LLUIColorTable::instance().getColor("EmphasisColor");
+ LLUIColor userNameColor = LLUIColorTable::instance().getColor("EmphasisColor");
style_params_name.color(userNameColor);
style_params_name.font.name("SansSerifSmall");
style_params_name.font.style("NORMAL");
@@ -1037,7 +1037,7 @@ private:
!av_name.isDisplayNameDefault())
{
LLStyle::Params style_params_name;
- LLColor4 userNameColor = LLUIColorTable::instance().getColor("EmphasisColor");
+ LLUIColor userNameColor = LLUIColorTable::instance().getColor("EmphasisColor");
style_params_name.color(userNameColor);
style_params_name.font.name("SansSerifSmall");
style_params_name.font.style("NORMAL");
@@ -1239,10 +1239,11 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
mMoreChatPanel->reshape(mMoreChatPanel->getRect().getWidth(), height);
}
- LLColor4 txt_color = LLUIColorTable::instance().getColor("White");
- LLColor4 name_color(txt_color);
+ F32 alpha = 1.f;
+ LLUIColor txt_color = LLUIColorTable::instance().getColor("White");
+ LLUIColor name_color(txt_color);
+ LLViewerChat::getChatColor(chat, txt_color, alpha);
- LLViewerChat::getChatColor(chat,txt_color);
LLFontGL* fontp = LLViewerChat::getChatFont();
std::string font_name = LLFontGL::nameFromFont(fontp);
std::string font_size = LLFontGL::sizeFromFont(fontp);
@@ -1250,6 +1251,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
LLStyle::Params body_message_params;
body_message_params.color(txt_color);
body_message_params.readonly_color(txt_color);
+ body_message_params.alpha(alpha);
body_message_params.font.name(font_name);
body_message_params.font.size(font_size);
body_message_params.font.style(input_append_params.font.style);
@@ -1317,7 +1319,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
{
if (!message_from_log)
{
- LLColor4 timestamp_color = LLUIColorTable::instance().getColor("ChatTimestampColor");
+ LLUIColor timestamp_color = LLUIColorTable::instance().getColor("ChatTimestampColor");
timestamp_style.color(timestamp_color);
timestamp_style.readonly_color(timestamp_color);
}
@@ -1344,7 +1346,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
// set the link for the object name to be the objectim SLapp
// (don't let object names with hyperlinks override our objectim Url)
LLStyle::Params link_params(body_message_params);
- LLColor4 link_color = LLUIColorTable::instance().getColor("HTMLLinkColor");
+ LLUIColor link_color = LLUIColorTable::instance().getColor("HTMLLinkColor");
link_params.color = link_color;
link_params.readonly_color = link_color;
link_params.is_link = true;
diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp
index a5c26eff9c..550dfeb802 100644
--- a/indra/newview/llchatitemscontainerctrl.cpp
+++ b/indra/newview/llchatitemscontainerctrl.cpp
@@ -134,8 +134,8 @@ void LLFloaterIMNearbyChatToastPanel::addMessage(LLSD& notification)
std::string color_name = notification["text_color"].asString();
- LLColor4 textColor = LLUIColorTable::instance().getColor(color_name);
- textColor.mV[VALPHA] = (F32)notification["color_alpha"].asReal();
+ LLUIColor textColor = LLUIColorTable::instance().getColor(color_name);
+ F32 textAlpha = (F32)notification["color_alpha"].asReal();
S32 font_size = notification["font_size"].asInteger();
@@ -152,6 +152,7 @@ void LLFloaterIMNearbyChatToastPanel::addMessage(LLSD& notification)
{
LLStyle::Params style_params;
style_params.color(textColor);
+ style_params.alpha(textAlpha);
std::string font_name = LLFontGL::nameFromFont(messageFont);
std::string font_style_size = LLFontGL::sizeFromFont(messageFont);
style_params.font.name(font_name);
@@ -190,8 +191,8 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification)
std::string color_name = notification["text_color"].asString();
- LLColor4 textColor = LLUIColorTable::instance().getColor(color_name);
- textColor.mV[VALPHA] = (F32)notification["color_alpha"].asReal();
+ LLUIColor textColor = LLUIColorTable::instance().getColor(color_name);
+ F32 textAlpha = (F32)notification["color_alpha"].asReal();
S32 font_size = notification["font_size"].asInteger();
@@ -222,14 +223,9 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification)
if (mSourceType == CHAT_SOURCE_AGENT || mSourceType == CHAT_SOURCE_OBJECT)
{
LLStyle::Params style_params_name;
-
- LLColor4 user_name_color = LLUIColorTable::instance().getColor("HTMLLinkColor");
- style_params_name.color(user_name_color);
-
- std::string font_name = LLFontGL::nameFromFont(messageFont);
- std::string font_style_size = LLFontGL::sizeFromFont(messageFont);
- style_params_name.font.name(font_name);
- style_params_name.font.size(font_style_size);
+ style_params_name.color = LLUIColorTable::instance().getColor("HTMLLinkColor");
+ style_params_name.font.name = LLFontGL::nameFromFont(messageFont);
+ style_params_name.font.size = LLFontGL::sizeFromFont(messageFont);
style_params_name.link_href = notification["sender_slurl"].asString();
style_params_name.is_link = true;
@@ -274,6 +270,7 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification)
{
LLStyle::Params style_params;
style_params.color(textColor);
+ style_params.alpha(textAlpha);
std::string font_name = LLFontGL::nameFromFont(messageFont);
std::string font_style_size = LLFontGL::sizeFromFont(messageFont);
style_params.font.name(font_name);
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index eac1ee2a3c..cb2370f413 100644
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -652,6 +652,7 @@ void LLConversationViewParticipant::draw()
static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE);
static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("InventoryFocusOutlineColor", DEFAULT_WHITE);
static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE);
+ static LLUIColor sFriendColor = LLUIColorTable::instance().getColor("ConversationFriendColor");
const bool show_context = (getRoot() ? getRoot()->getShowSelectionContext() : false);
@@ -661,23 +662,23 @@ void LLConversationViewParticipant::draw()
F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad;
F32 text_left = (F32)getLabelXPos();
- LLColor4 color;
+ LLUIColor* color;
LLLocalSpeakerMgr *speakerMgr = LLLocalSpeakerMgr::getInstance();
if (speakerMgr && speakerMgr->isSpeakerToBeRemoved(mUUID))
{
- color = sFgDisabledColor;
+ color = &sFgDisabledColor;
}
else
{
if (LLAvatarActions::isFriend(mUUID))
{
- color = LLUIColorTable::instance().getColor("ConversationFriendColor");
+ color = &sFriendColor;
}
else
{
- color = mIsSelected ? sHighlightFgColor : sFgColor;
+ color = mIsSelected ? &sHighlightFgColor : &sFgColor;
}
}
@@ -688,7 +689,7 @@ void LLConversationViewParticipant::draw()
}
drawHighlight(show_context, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor);
- drawLabel(font, text_left, y, color, right_x);
+ drawLabel(font, text_left, y, color->get(), right_x);
LLView::draw();
}
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index 60e7171004..ae48db24bc 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -1600,18 +1600,10 @@ void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update)
mDrawable->updateDistance(camera, force_update);
- LLViewerObject::const_child_list_t& child_list = mDrawable->getVObj()->getChildren();
- for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
- iter != child_list.end(); iter++)
+ for (LLViewerObject* child : mDrawable->getVObj()->getChildren())
{
- LLViewerObject* child = *iter;
LLDrawable* drawable = child->mDrawable;
- if (!drawable)
- {
- continue;
- }
-
- if (!drawable->isAvatar())
+ if (drawable && !drawable->isDead() && !drawable->isAvatar())
{
drawable->updateDistance(camera, force_update);
}
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp
index 0d4eaab488..53d6e528b6 100644
--- a/indra/newview/lldrawpoolwater.cpp
+++ b/indra/newview/lldrawpoolwater.cpp
@@ -241,8 +241,6 @@ void LLDrawPoolWater::renderPostDeferred(S32 pass)
F32 screenRes[] = { 1.f / gGLViewport[2], 1.f / gGLViewport[3] };
- S32 diffTex = shader->enableTexture(LLShaderMgr::DIFFUSE_MAP);
-
shader->uniform2fv(LLShaderMgr::DEFERRED_SCREEN_RES, 1, screenRes);
shader->uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor);
@@ -316,8 +314,6 @@ void LLDrawPoolWater::renderPostDeferred(S32 pass)
water = static_cast<LLVOWater*>(face->getViewerObject());
if (!water) continue;
- gGL.getTexUnit(diffTex)->bind(face->getTexture());
-
if ((bool)edge == (bool)water->getIsEdgePatch())
{
face->renderIndexed();
@@ -334,7 +330,6 @@ void LLDrawPoolWater::renderPostDeferred(S32 pass)
shader->disableTexture(LLShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP);
shader->disableTexture(LLShaderMgr::WATER_SCREENTEX);
shader->disableTexture(LLShaderMgr::BUMP_MAP);
- shader->disableTexture(LLShaderMgr::DIFFUSE_MAP);
shader->disableTexture(LLShaderMgr::WATER_REFTEX);
// clean up
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index c12546f7eb..5dfaf176fd 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -54,8 +54,6 @@
#include "llregioninfomodel.h"
-#include <boost/make_shared.hpp>
-
#include "llatmosphere.h"
#include "llagent.h"
#include "roles_constants.h"
diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp
index 471bb6d478..c05a7fef44 100644
--- a/indra/newview/lleventpoll.cpp
+++ b/indra/newview/lleventpoll.cpp
@@ -40,8 +40,6 @@
#include "llcorehttputil.h"
#include "lleventfilter.h"
-#include "boost/make_shared.hpp"
-
namespace LLEventPolling
{
namespace Details
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index f73c530ff9..d14a7ffddc 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -514,7 +514,7 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color)
mDrawablep->getSpatialGroup()->rebuildGeom();
mDrawablep->getSpatialGroup()->rebuildMesh();
- if(mVertexBuffer.isNull())
+ if (mVertexBuffer.isNull())
{
return;
}
@@ -567,8 +567,20 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color)
{
// cheaters sometimes prosper...
//
- mVertexBuffer->setBuffer();
- mVertexBuffer->draw(LLRender::TRIANGLES, mIndicesCount, mIndicesIndex);
+ LLVertexBuffer* vertex_buffer = mVertexBuffer.get();
+ // To display selection markers (white squares with the rounded cross at the center)
+ // on faces with GLTF textures we use a spectal vertex buffer with other transforms
+ if (const LLTextureEntry* te = getTextureEntry())
+ {
+ if (LLGLTFMaterial* gltf_mat = te->getGLTFRenderMaterial())
+ {
+ vertex_buffer = mVertexBufferGLTF.get();
+ vertex_buffer->unmapBuffer();
+ }
+ }
+ // Draw the selection marker using the correctly chosen vertex buffer
+ vertex_buffer->setBuffer();
+ vertex_buffer->draw(LLRender::TRIANGLES, mIndicesCount, mIndicesIndex);
}
gGL.popMatrix();
@@ -1144,7 +1156,8 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
const LLMatrix3& mat_norm_in,
U16 index_offset,
bool force_rebuild,
- bool no_debug_assert)
+ bool no_debug_assert,
+ bool rebuild_for_gltf)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE;
llassert(verify());
@@ -1202,6 +1215,58 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
}
}
+ const LLTextureEntry* tep = mVObjp->getTE(face_index);
+ llassert(tep);
+ if (!tep)
+ return false;
+
+ LLGLTFMaterial* gltf_mat = tep->getGLTFRenderMaterial();
+ // To display selection markers (white squares with the rounded cross at the center)
+ // on faces with GLTF textures we use a special vertex buffer with other transforms
+ if (gltf_mat && !rebuild_for_gltf && tep->isSelected() && mVertexBuffer.notNull())
+ {
+ // Create a temporary vertex buffer to provide transforms for GLTF textures
+ if (mVertexBufferGLTF.isNull())
+ {
+ mVertexBufferGLTF = new LLVertexBuffer(mVertexBuffer->getTypeMask());
+ }
+
+ // Clone the existing vertex buffer into the temporary one
+ mVertexBuffer->clone(*mVertexBufferGLTF);
+
+ // Recursive call the same function with the argument rebuild_for_gltf set to true
+ // This call will make geometry in mVertexBuffer but in fact for mVertexBufferGLTF
+ mVertexBufferGLTF.swap(mVertexBufferGLTF, mVertexBuffer);
+ getGeometryVolume(volume, face_index, mat_vert_in, mat_norm_in, index_offset, force_rebuild, no_debug_assert, true);
+ mVertexBufferGLTF.swap(mVertexBufferGLTF, mVertexBuffer);
+ }
+ else if (!tep->isSelected() && mVertexBufferGLTF.notNull())
+ {
+ // Free the temporary vertex buffer when it is not needed anymore
+ mVertexBufferGLTF = nullptr;
+ }
+
+ LLGLTFMaterial::TextureInfo gltf_info_index = (LLGLTFMaterial::TextureInfo)0;
+ if (gltf_mat && rebuild_for_gltf)
+ {
+ switch (LLPipeline::sRenderHighlightTextureChannel)
+ {
+ case LLRender::BASECOLOR_MAP:
+ gltf_info_index = LLGLTFMaterial::GLTF_TEXTURE_INFO_BASE_COLOR;
+ break;
+ case LLRender::METALLIC_ROUGHNESS_MAP:
+ gltf_info_index = LLGLTFMaterial::GLTF_TEXTURE_INFO_METALLIC_ROUGHNESS;
+ break;
+ case LLRender::GLTF_NORMAL_MAP:
+ gltf_info_index = LLGLTFMaterial::GLTF_TEXTURE_INFO_NORMAL;
+ break;
+ case LLRender::EMISSIVE_MAP:
+ gltf_info_index = LLGLTFMaterial::GLTF_TEXTURE_INFO_EMISSIVE;
+ break;
+ default:; // just to make clang happy
+ }
+ }
+
LLStrider<LLVector3> vert;
LLStrider<LLVector2> tex_coords0;
LLStrider<LLVector2> tex_coords1;
@@ -1218,7 +1283,7 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
LLVector3 scale;
if (global_volume)
{
- scale.setVec(1,1,1);
+ scale.setVec(1, 1, 1);
}
else
{
@@ -1233,7 +1298,6 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
bool rebuild_tangent = rebuild_pos && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_TANGENT);
bool rebuild_weights = rebuild_pos && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_WEIGHT4);
- const LLTextureEntry *tep = mVObjp->getTE(face_index);
const U8 bump_code = tep ? tep->getBumpmap() : 0;
bool is_static = mDrawablep->isStatic();
@@ -1323,7 +1387,6 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
LLMaterial* mat = tep->getMaterialParams().get();
- LLGLTFMaterial* gltf_mat = tep->getGLTFRenderMaterial();
F32 r = 0, os = 0, ot = 0, ms = 0, mt = 0, cos_ang = 0, sin_ang = 0;
@@ -1334,13 +1397,27 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
S32 xforms = XFORM_NONE;
// For GLTF, transforms will be applied later
- if (rebuild_tcoord && tep && !gltf_mat)
+ if (rebuild_tcoord && tep && (!gltf_mat || rebuild_for_gltf))
{
- r = tep->getRotation();
- os = tep->mOffsetS;
- ot = tep->mOffsetT;
- ms = tep->mScaleS;
- mt = tep->mScaleT;
+ if (gltf_mat && rebuild_for_gltf)
+ {
+ // Apply special transformations for mVertexBufferGLTF
+ // They are used only to display a face selection marker
+ // (white square with a rounded cross at the center)
+ const auto& tt = gltf_mat->mTextureTransform[gltf_info_index];
+ r = -tt.mRotation * 2;
+ ms = tt.mScale[VX];
+ mt = tt.mScale[VY];
+ os += tt.mOffset[VX] + (ms - 1) / 2;
+ ot -= tt.mOffset[VY] + (mt - 1) / 2;
+ }
+ else
+ {
+ r = tep->getRotation();
+ tep->getOffset(&os, &ot);
+ tep->getScale(&ms, &mt);
+ }
+
cos_ang = cos(r);
sin_ang = sin(r);
@@ -1481,12 +1558,9 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
break;
}
- F32 s_scale = 1.f;
- F32 t_scale = 1.f;
- if( tep )
- {
- tep->getScale( &s_scale, &t_scale );
- }
+ F32 s_scale = tep->getScaleS();
+ F32 t_scale = tep->getScaleT();
+
// Use the nudged south when coming from above sun angle, such
// that emboss mapping always shows up on the upward faces of cubes when
// it's noon (since a lot of builders build with the sun forced to noon).
@@ -1508,8 +1582,8 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
bool tex_anim = false;
- LLVOVolume* vobj = (LLVOVolume*) (LLViewerObject*) mVObjp;
- tex_mode = vobj->mTexAnimMode;
+ LLVOVolume* vobj = (LLVOVolume*)mVObjp.get();
+ tex_mode = vobj->mTexAnimMode;
if (vobj->mTextureAnimp)
{ //texture animation is in play, override specular and normal map tex coords with diffuse texcoords
diff --git a/indra/newview/llface.h b/indra/newview/llface.h
index 917f3aa0b2..7cf256f731 100644
--- a/indra/newview/llface.h
+++ b/indra/newview/llface.h
@@ -161,7 +161,8 @@ public:
const LLMatrix3& mat_normal,
U16 index_offset,
bool force_rebuild = false,
- bool no_debug_assert = false);
+ bool no_debug_assert = false,
+ bool rebuild_for_gltf = false);
// For avatar
U16 getGeometryAvatar(
@@ -266,6 +267,7 @@ public:
private:
LLPointer<LLVertexBuffer> mVertexBuffer;
+ LLPointer<LLVertexBuffer> mVertexBufferGLTF;
U32 mState;
LLFacePool* mDrawPoolp;
diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp
index 603f54fb49..cd45093856 100644
--- a/indra/newview/llfloatercolorpicker.cpp
+++ b/indra/newview/llfloatercolorpicker.cpp
@@ -110,12 +110,6 @@ LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, bool show
// create user interface for this picker
createUI ();
-
- if (!mCanApplyImmediately)
- {
- mApplyImmediateCheck->setEnabled(false);
- mApplyImmediateCheck->set(false);
- }
}
LLFloaterColorPicker::~LLFloaterColorPicker()
@@ -226,6 +220,12 @@ bool LLFloaterColorPicker::postBuild()
mApplyImmediateCheck->set(gSavedSettings.getBOOL("ApplyColorImmediately"));
mApplyImmediateCheck->setCommitCallback(onImmediateCheck, this);
+ if (!mCanApplyImmediately)
+ {
+ mApplyImmediateCheck->setEnabled(false);
+ mApplyImmediateCheck->set(false);
+ }
+
childSetCommitCallback("rspin", onTextCommit, (void*)this );
childSetCommitCallback("gspin", onTextCommit, (void*)this );
childSetCommitCallback("bspin", onTextCommit, (void*)this );
diff --git a/indra/newview/llfloatereditenvironmentbase.cpp b/indra/newview/llfloatereditenvironmentbase.cpp
index bd5839ed17..a42c94f049 100644
--- a/indra/newview/llfloatereditenvironmentbase.cpp
+++ b/indra/newview/llfloatereditenvironmentbase.cpp
@@ -28,8 +28,6 @@
#include "llfloatereditenvironmentbase.h"
-#include <boost/make_shared.hpp>
-
// libs
#include "llnotifications.h"
#include "llnotificationsutil.h"
diff --git a/indra/newview/llfloateremojipicker.cpp b/indra/newview/llfloateremojipicker.cpp
index 30f58aaeec..cc13e5d059 100644
--- a/indra/newview/llfloateremojipicker.cpp
+++ b/indra/newview/llfloateremojipicker.cpp
@@ -186,7 +186,7 @@ public:
{
mWStr = LLWString(1, emoji);
mEmoji = emoji;
- mTitle = title;
+ mTitle = utf8str_to_wstring(title);
mBegin = begin;
mEnd = end;
}
@@ -203,10 +203,9 @@ public:
F32 centerY = 0.5f * clientHeight;
drawIcon(centerX, centerY - 1, iconWidth);
- static LLColor4 defaultColor(0.75f, 0.75f, 0.75f, 1.0f);
- LLColor4 textColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", defaultColor);
+ static LLUIColor textColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", LLColor4(0.75f, 0.75f, 0.75f, 1.0f));
S32 max_pixels = clientWidth - iconWidth;
- drawName((F32)iconWidth, centerY, max_pixels, textColor);
+ drawName((F32)iconWidth, centerY, max_pixels, textColor.get());
}
protected:
@@ -226,16 +225,16 @@ protected:
max_pixels); // max_pixels
}
- void drawName(F32 x, F32 y, S32 max_pixels, LLColor4& color)
+ void drawName(F32 x, F32 y, S32 max_pixels, const LLColor4& color)
{
F32 x0 = x;
F32 x1 = (F32)max_pixels;
LLFontGL* font = LLFontGL::getFontEmojiLarge();
if (mBegin)
{
- std::string text = mTitle.substr(0, mBegin);
- font->renderUTF8(
- text, // text
+ LLWString text = mTitle.substr(0, mBegin);
+ font->render(
+ text.c_str(), // text
0, // begin_offset
x0, // x
y, // y
@@ -246,14 +245,14 @@ protected:
LLFontGL::DROP_SHADOW_SOFT, // shadow
static_cast<S32>(text.size()), // max_chars
(S32)x1); // max_pixels
- F32 dx = font->getWidthF32(text);
+ F32 dx = font->getWidthF32(text.c_str());
x0 += dx;
x1 -= dx;
}
if (x1 > 0 && mEnd > mBegin)
{
- std::string text = mTitle.substr(mBegin, mEnd - mBegin);
- font->renderUTF8(
+ LLWString text = mTitle.substr(mBegin, mEnd - mBegin);
+ font->render(
text, // text
0, // begin_offset
x0, // x
@@ -265,14 +264,14 @@ protected:
LLFontGL::DROP_SHADOW_SOFT, // shadow
static_cast<S32>(text.size()), // max_chars
(S32)x1); // max_pixels
- F32 dx = font->getWidthF32(text);
+ F32 dx = font->getWidthF32(text.c_str());
x0 += dx;
x1 -= dx;
}
if (x1 > 0 && mEnd < mTitle.size())
{
- std::string text = mEnd ? mTitle.substr(mEnd) : mTitle;
- font->renderUTF8(
+ LLWString text = mEnd ? mTitle.substr(mEnd) : mTitle;
+ font->render(
text, // text
0, // begin_offset
x0, // x
@@ -290,7 +289,7 @@ protected:
private:
llwchar mEmoji;
LLWString mWStr;
- std::string mTitle;
+ LLWString mTitle;
size_t mBegin;
size_t mEnd;
};
@@ -429,6 +428,7 @@ void LLFloaterEmojiPicker::fillGroups()
for (LLButton* button : mGroupButtons)
{
mGroups->removeChild(button);
+ button->die();
}
mFilteredEmojiGroups.clear();
mFilteredEmojis.clear();
@@ -442,6 +442,7 @@ void LLFloaterEmojiPicker::fillGroups()
rect.mBottom = mBadge->getRect().getHeight();
// Create button for "All categories"
+ params.name = "all_categories";
createGroupButton(params, rect, ALL_EMOJIS_IMAGE_INDEX);
// Create group and button for "Recently used" and/or "Frequently used"
@@ -455,6 +456,7 @@ void LLFloaterEmojiPicker::fillGroups()
{
mFilteredEmojiGroups.push_back(USED_EMOJIS_GROUP_INDEX);
mFilteredEmojis.emplace_back(cats);
+ params.name = "used_categories";
createGroupButton(params, rect, USED_EMOJIS_IMAGE_INDEX);
}
}
@@ -472,6 +474,7 @@ void LLFloaterEmojiPicker::fillGroups()
{
mFilteredEmojiGroups.push_back(i);
mFilteredEmojis.emplace_back(cats);
+ params.name = "group_" + std::to_string(i);
createGroupButton(params, rect, groups[i].Character);
}
}
@@ -700,8 +703,7 @@ void LLFloaterEmojiPicker::fillEmojis(bool fromResize)
LLPanel::Params icon_params;
LLRect icon_rect(0, icon_size, icon_size, 0);
- static LLColor4 default_color(0.75f, 0.75f, 0.75f, 1.0f);
- LLColor4 bg_color = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", default_color);
+ static LLUIColor bg_color = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", LLColor4(0.75f, 0.75f, 0.75f, 1.0f));
if (!mSelectedGroupIndex)
{
diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp
index 6829e6b479..e44202312b 100644
--- a/indra/newview/llfloaterfixedenvironment.cpp
+++ b/indra/newview/llfloaterfixedenvironment.cpp
@@ -28,8 +28,6 @@
#include "llfloaterfixedenvironment.h"
-#include <boost/make_shared.hpp>
-
// libs
#include "llbutton.h"
#include "llnotifications.h"
diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp
index 5cf02d1ec0..a614299e03 100644
--- a/indra/newview/llfloaterimnearbychathandler.cpp
+++ b/indra/newview/llfloaterimnearbychathandler.cpp
@@ -535,14 +535,13 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
if (gSavedSettings.getS32("ShowScriptErrorsLocation") == 1)// show error in window //("ScriptErrorsAsChat"))
{
-
- LLColor4 txt_color;
-
- LLViewerChat::getChatColor(chat_msg,txt_color);
+ LLUIColor txt_color;
+ F32 alpha = 1.f;
+ LLViewerChat::getChatColor(chat_msg, txt_color, alpha);
LLFloaterScriptDebug::addScriptLine(chat_msg.mText,
chat_msg.mFromName,
- txt_color,
+ txt_color % alpha,
chat_msg.mFromID);
return;
}
diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp
index 7db3621a4b..68b11ec92b 100644
--- a/indra/newview/llfloaterjoystick.cpp
+++ b/indra/newview/llfloaterjoystick.cpp
@@ -93,8 +93,9 @@ BOOL CALLBACK di8_list_devices_callback(LPCDIDEVICEINSTANCE device_instance_ptr,
#endif
LLFloaterJoystick::LLFloaterJoystick(const LLSD& data)
- : LLFloater(data),
- mHasDeviceList(false)
+ : LLFloater(data)
+ , mHasDeviceList(false)
+ , mJoystickInitialized(false)
{
if (!LLViewerJoystick::getInstance()->isJoystickInitialized())
{
@@ -108,7 +109,10 @@ void LLFloaterJoystick::draw()
{
LLViewerJoystick* joystick(LLViewerJoystick::getInstance());
bool joystick_inited = joystick->isJoystickInitialized();
- if (joystick_inited != mHasDeviceList)
+ if (!mHasDeviceList
+ || mJoystickInitialized != joystick_inited
+ || (joystick->isDeviceUUIDSet() && joystick->getDeviceUUID().asUUID() != mCurrentDeviceId)
+ || (!joystick->isDeviceUUIDSet() && mCurrentDeviceId.notNull()))
{
refreshListOfDevices();
}
@@ -290,15 +294,16 @@ void LLFloaterJoystick::refreshListOfDevices()
mHasDeviceList = true;
}
- bool is_device_id_set = LLViewerJoystick::getInstance()->isDeviceUUIDSet();
+ LLViewerJoystick* joystick = LLViewerJoystick::getInstance();
+ bool is_device_id_set = joystick->isDeviceUUIDSet();
- if (LLViewerJoystick::getInstance()->isJoystickInitialized() &&
+ if (joystick->isJoystickInitialized() &&
(!mHasDeviceList || !is_device_id_set))
{
#if LL_WINDOWS && !LL_MESA_HEADLESS
LL_WARNS() << "NDOF connected to device without using SL provided handle" << LL_ENDL;
#endif
- std::string desc = LLViewerJoystick::getInstance()->getDescription();
+ std::string desc = joystick->getDescription();
if (!desc.empty())
{
LLSD value = LLSD::Integer(1); // value for selection
@@ -311,11 +316,13 @@ void LLFloaterJoystick::refreshListOfDevices()
{
if (is_device_id_set)
{
- LLSD guid = LLViewerJoystick::getInstance()->getDeviceUUID();
+ LLSD guid = joystick->getDeviceUUID();
+ mCurrentDeviceId = guid.asUUID();
mJoysticksCombo->selectByValue(guid);
}
else
{
+ mCurrentDeviceId.setNull();
mJoysticksCombo->selectByValue(LLSD::Integer(1));
}
}
@@ -323,6 +330,18 @@ void LLFloaterJoystick::refreshListOfDevices()
{
mJoysticksCombo->selectByValue(LLSD::Integer(0));
}
+
+ // Update tracking
+ if (is_device_id_set)
+ {
+ LLSD guid = joystick->getDeviceUUID();
+ mCurrentDeviceId = guid.asUUID();
+ }
+ else
+ {
+ mCurrentDeviceId.setNull();
+ }
+ mJoystickInitialized = joystick->isJoystickInitialized();
}
void LLFloaterJoystick::cancel()
diff --git a/indra/newview/llfloaterjoystick.h b/indra/newview/llfloaterjoystick.h
index b94223a738..c7e727635d 100644
--- a/indra/newview/llfloaterjoystick.h
+++ b/indra/newview/llfloaterjoystick.h
@@ -95,6 +95,8 @@ private:
LLComboBox *mJoysticksCombo;
bool mHasDeviceList;
+ bool mJoystickInitialized;
+ LLUUID mCurrentDeviceId;
// stats view
LLStatBar* mAxisStatsBar[6];
diff --git a/indra/newview/llfloaterscriptedprefs.cpp b/indra/newview/llfloaterscriptedprefs.cpp
index a38c4b51f2..fa31cd72c1 100644
--- a/indra/newview/llfloaterscriptedprefs.cpp
+++ b/indra/newview/llfloaterscriptedprefs.cpp
@@ -54,8 +54,6 @@ bool LLFloaterScriptEdPrefs::postBuild()
void LLFloaterScriptEdPrefs::applyUIColor(LLUICtrl* ctrl, const LLSD& param)
{
LLUIColorTable::instance().setColor(param.asString(), LLColor4(ctrl->getValue()));
- mEditor->initKeywords();
- mEditor->loadKeywords();
}
void LLFloaterScriptEdPrefs::getUIColor(LLUICtrl* ctrl, const LLSD& param)
diff --git a/indra/newview/llfloatersettingscolor.cpp b/indra/newview/llfloatersettingscolor.cpp
new file mode 100644
index 0000000000..d9c382a1dc
--- /dev/null
+++ b/indra/newview/llfloatersettingscolor.cpp
@@ -0,0 +1,334 @@
+/**
+* @file llfloatersettingscolor.cpp
+* @brief Implementation of LLFloaterSettingsColor
+* @author Rye Cogtail<rye@alchemyviewer.org>
+*
+* $LicenseInfo:firstyear=2024&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2024, 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 "llfloatersettingscolor.h"
+
+#include "llfloater.h"
+#include "llfiltereditor.h"
+#include "lluictrlfactory.h"
+#include "llcombobox.h"
+#include "llspinctrl.h"
+#include "llcolorswatch.h"
+#include "llviewercontrol.h"
+#include "lltexteditor.h"
+
+
+LLFloaterSettingsColor::LLFloaterSettingsColor(const LLSD& key)
+: LLFloater(key),
+ mSettingList(NULL)
+{
+ mCommitCallbackRegistrar.add("CommitSettings", boost::bind(&LLFloaterSettingsColor::onCommitSettings, this));
+ mCommitCallbackRegistrar.add("ClickDefault", boost::bind(&LLFloaterSettingsColor::onClickDefault, this));
+}
+
+LLFloaterSettingsColor::~LLFloaterSettingsColor()
+{}
+
+bool LLFloaterSettingsColor::postBuild()
+{
+ enableResizeCtrls(true, false, true);
+
+ mAlphaSpinner = getChild<LLSpinCtrl>("alpha_spinner");
+ mColorSwatch = getChild<LLColorSwatchCtrl>("color_swatch");
+
+ mDefaultButton = getChild<LLUICtrl>("default_btn");
+ mSettingNameText = getChild<LLTextBox>("color_name_txt");
+
+ getChild<LLFilterEditor>("filter_input")->setCommitCallback(boost::bind(&LLFloaterSettingsColor::setSearchFilter, this, _2));
+
+ mSettingList = getChild<LLScrollListCtrl>("setting_list");
+ mSettingList->setCommitOnSelectionChange(true);
+ mSettingList->setCommitCallback(boost::bind(&LLFloaterSettingsColor::onSettingSelect, this));
+
+ updateList();
+
+ gSavedSettings.getControl("ColorSettingsHideDefault")->getCommitSignal()->connect(boost::bind(&LLFloaterSettingsColor::updateList, this, false));
+
+ return LLFloater::postBuild();
+}
+
+void LLFloaterSettingsColor::draw()
+{
+ LLScrollListItem* first_selected = mSettingList->getFirstSelected();
+ if (first_selected)
+ {
+ if(auto cell = first_selected->getColumn(1))
+ {
+ updateControl(cell->getValue().asString());
+ }
+ }
+
+ LLFloater::draw();
+}
+
+void LLFloaterSettingsColor::onCommitSettings()
+{
+ LLScrollListItem* first_selected = mSettingList->getFirstSelected();
+ if (!first_selected)
+ {
+ return;
+ }
+ auto cell = first_selected->getColumn(1);
+
+ if (!cell)
+ {
+ return;
+ }
+
+ auto color_name = cell->getValue().asString();
+ if (color_name.empty())
+ {
+ return;
+ }
+
+ LLColor4 col4;
+ LLColor3 col3;
+ col3.setValue(mColorSwatch->getValue());
+ col4 = LLColor4(col3, (F32)mAlphaSpinner->getValue().asReal());
+ LLUIColorTable::instance().setColor(color_name, col4);
+
+ updateDefaultColumn(color_name);
+}
+
+// static
+void LLFloaterSettingsColor::onClickDefault()
+{
+ LLScrollListItem* first_selected = mSettingList->getFirstSelected();
+ if (first_selected)
+ {
+ auto cell = first_selected->getColumn(1);
+ if (cell)
+ {
+ auto name = cell->getValue().asString();
+ LLUIColorTable::instance().resetToDefault(name);
+ updateDefaultColumn(name);
+ updateControl(name);
+ }
+ }
+}
+
+// we've switched controls, or doing per-frame update, so update spinners, etc.
+void LLFloaterSettingsColor::updateControl(const std::string& color_name)
+{
+ hideUIControls();
+
+ if (!isSettingHidden(color_name))
+ {
+ mDefaultButton->setVisible(true);
+ mSettingNameText->setVisible(true);
+ mSettingNameText->setText(color_name);
+ mSettingNameText->setToolTip(color_name);
+
+ LLColor4 clr = LLUIColorTable::instance().getColor(color_name);
+ mColorSwatch->setVisible(true);
+ // only set if changed so color picker doesn't update
+ if (clr != LLColor4(mColorSwatch->getValue()))
+ {
+ mColorSwatch->setOriginal(clr);
+ }
+ mAlphaSpinner->setVisible(true);
+ mAlphaSpinner->setLabel(std::string("Alpha"));
+ if (!mAlphaSpinner->hasFocus())
+ {
+ mAlphaSpinner->setPrecision(3);
+ mAlphaSpinner->setMinValue(0.0);
+ mAlphaSpinner->setMaxValue(1.f);
+ mAlphaSpinner->setValue(clr.mV[VALPHA]);
+ }
+ }
+
+}
+
+void LLFloaterSettingsColor::updateList(bool skip_selection)
+{
+ std::string last_selected;
+ LLScrollListItem* item = mSettingList->getFirstSelected();
+ if (item)
+ {
+ LLScrollListCell* cell = item->getColumn(1);
+ if (cell)
+ {
+ last_selected = cell->getValue().asString();
+ }
+ }
+
+ mSettingList->deleteAllItems();
+
+ const auto& base_colors = LLUIColorTable::instance().getLoadedColors();
+ for (const auto& pair : base_colors)
+ {
+ const auto& name = pair.first;
+ if (matchesSearchFilter(name) && !isSettingHidden(name))
+ {
+ LLSD row;
+
+ row["columns"][0]["column"] = "changed_color";
+ row["columns"][0]["value"] = LLUIColorTable::instance().isDefault(name) ? "" : "*";
+
+ row["columns"][1]["column"] = "color";
+ row["columns"][1]["value"] = name;
+
+ LLScrollListItem* item = mSettingList->addElement(row, ADD_BOTTOM, nullptr);
+ if (!mSearchFilter.empty() && (last_selected == name) && !skip_selection)
+ {
+ std::string lower_name(name);
+ LLStringUtil::toLower(lower_name);
+ if (LLStringUtil::startsWith(lower_name, mSearchFilter))
+ {
+ item->setSelected(true);
+ }
+ }
+ }
+ }
+
+ for (const auto& pair : LLUIColorTable::instance().getUserColors())
+ {
+ const auto& name = pair.first;
+ if (base_colors.find(name) == base_colors.end() && matchesSearchFilter(name) && !isSettingHidden(name))
+ {
+ LLSD row;
+
+ row["columns"][0]["column"] = "changed_color";
+ row["columns"][0]["value"] = LLUIColorTable::instance().isDefault(name) ? "" : "*";
+
+ row["columns"][1]["column"] = "color";
+ row["columns"][1]["value"] = name;
+
+ LLScrollListItem* item = mSettingList->addElement(row, ADD_BOTTOM, nullptr);
+ if (!mSearchFilter.empty() && (last_selected == name) && !skip_selection)
+ {
+ std::string lower_name(name);
+ LLStringUtil::toLower(lower_name);
+ if (LLStringUtil::startsWith(lower_name, mSearchFilter))
+ {
+ item->setSelected(true);
+ }
+ }
+ }
+ }
+
+ mSettingList->updateSort();
+
+ if (!mSettingList->isEmpty())
+ {
+ if (mSettingList->hasSelectedItem())
+ {
+ mSettingList->scrollToShowSelected();
+ }
+ else if (!mSettingList->hasSelectedItem() && !mSearchFilter.empty() && !skip_selection)
+ {
+ if (!mSettingList->selectItemByPrefix(mSearchFilter, false, 1))
+ {
+ mSettingList->selectFirstItem();
+ }
+ mSettingList->scrollToShowSelected();
+ }
+ }
+ else
+ {
+ LLSD row;
+
+ row["columns"][0]["column"] = "changed_color";
+ row["columns"][0]["value"] = "";
+ row["columns"][1]["column"] = "color";
+ row["columns"][1]["value"] = "No matching colors.";
+
+ mSettingList->addElement(row);
+ hideUIControls();
+ }
+}
+
+void LLFloaterSettingsColor::onSettingSelect()
+{
+ LLScrollListItem* first_selected = mSettingList->getFirstSelected();
+ if (first_selected)
+ {
+ auto cell = first_selected->getColumn(1);
+ if (cell)
+ {
+ updateControl(cell->getValue().asString());
+ }
+ }
+}
+
+void LLFloaterSettingsColor::setSearchFilter(const std::string& filter)
+{
+ if(mSearchFilter == filter)
+ return;
+ mSearchFilter = filter;
+ LLStringUtil::toLower(mSearchFilter);
+ updateList();
+}
+
+bool LLFloaterSettingsColor::matchesSearchFilter(std::string setting_name)
+{
+ // If the search filter is empty, everything passes.
+ if (mSearchFilter.empty()) return true;
+
+ LLStringUtil::toLower(setting_name);
+ std::string::size_type match_name = setting_name.find(mSearchFilter);
+
+ return (std::string::npos != match_name);
+}
+
+bool LLFloaterSettingsColor::isSettingHidden(const std::string& color_name)
+{
+ static LLCachedControl<bool> hide_default(gSavedSettings, "ColorSettingsHideDefault", false);
+ return hide_default && LLUIColorTable::instance().isDefault(color_name);
+}
+
+void LLFloaterSettingsColor::updateDefaultColumn(const std::string& color_name)
+{
+ if (isSettingHidden(color_name))
+ {
+ hideUIControls();
+ updateList(true);
+ return;
+ }
+
+ LLScrollListItem* item = mSettingList->getFirstSelected();
+ if (item)
+ {
+ LLScrollListCell* cell = item->getColumn(0);
+ if (cell)
+ {
+ std::string is_default = LLUIColorTable::instance().isDefault(color_name) ? "" : "*";
+ cell->setValue(is_default);
+ }
+ }
+}
+
+void LLFloaterSettingsColor::hideUIControls()
+{
+ mColorSwatch->setVisible(false);
+ mAlphaSpinner->setVisible(false);
+ mDefaultButton->setVisible(false);
+ mSettingNameText->setVisible(false);
+}
+
diff --git a/indra/newview/llfloatersettingscolor.h b/indra/newview/llfloatersettingscolor.h
new file mode 100644
index 0000000000..42eb85cd60
--- /dev/null
+++ b/indra/newview/llfloatersettingscolor.h
@@ -0,0 +1,81 @@
+/**
+* @file llfloatersettingscolor.h
+* @brief Header file for LLFloaterSettingsColor
+* @author Rye Cogtail<rye@alchemyviewer.org>
+*
+* $LicenseInfo:firstyear=2024&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2024, 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 LLFLOATERCOLORSETTINGS_H
+#define LLFLOATERCOLORSETTINGS_H
+
+#include "llcontrol.h"
+#include "llfloater.h"
+
+class LLColorSwatchCtrl;
+class LLScrollListCtrl;
+class LLSpinCtrl;
+class LLTextBox;
+
+class LLFloaterSettingsColor final
+: public LLFloater
+{
+ friend class LLFloaterReg;
+
+public:
+
+ bool postBuild() override;
+ void draw() override;
+
+ void updateControl(const std::string& color_name);
+
+ void onCommitSettings();
+ void onClickDefault();
+
+ bool matchesSearchFilter(std::string setting_name);
+ bool isSettingHidden(const std::string& color_name);
+
+private:
+ LLFloaterSettingsColor(const LLSD& key);
+ virtual ~LLFloaterSettingsColor();
+
+ void updateList(bool skip_selection = false);
+ void onSettingSelect();
+ void setSearchFilter(const std::string& filter);
+
+ void updateDefaultColumn(const std::string& color_name);
+ void hideUIControls();
+
+ LLScrollListCtrl* mSettingList;
+
+protected:
+ LLUICtrl* mDefaultButton = nullptr;
+ LLTextBox* mSettingNameText = nullptr;
+
+ LLSpinCtrl* mAlphaSpinner = nullptr;
+ LLColorSwatchCtrl* mColorSwatch = nullptr;
+
+ std::string mSearchFilter;
+};
+
+#endif //LLFLOATERCOLORSETTINGS_H
+
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index 8d74a99539..fc2cfbcf2b 100755
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -261,6 +261,48 @@ void LLMapFriendObserver::changed(U32 mask)
}
}
+LLWorldMapParcelInfoObserver::LLWorldMapParcelInfoObserver(const LLVector3d& pos_global)
+ : LLRemoteParcelInfoObserver(),
+ mPosGlobal(pos_global),
+ mParcelID(LLUUID::null)
+{ }
+
+LLWorldMapParcelInfoObserver::~LLWorldMapParcelInfoObserver()
+{
+ if (mParcelID.notNull())
+ {
+ LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelID, this);
+ }
+}
+
+void LLWorldMapParcelInfoObserver::processParcelInfo(const LLParcelData& parcel_data)
+{
+ if (parcel_data.parcel_id == mParcelID)
+ {
+ LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelID, this);
+
+ if (gFloaterWorldMap)
+ {
+ gFloaterWorldMap->processParcelInfo(parcel_data, mPosGlobal);
+ }
+ }
+}
+
+// virtual
+void LLWorldMapParcelInfoObserver::setParcelID(const LLUUID& parcel_id)
+{
+ mParcelID = parcel_id;
+ auto instance = LLRemoteParcelInfoProcessor::getInstance();
+ instance->addObserver(mParcelID, this);
+ instance->sendParcelInfoRequest(mParcelID);
+}
+
+// virtual
+void LLWorldMapParcelInfoObserver::setErrorStatus(S32 status, const std::string& reason)
+{
+ LL_WARNS("LLWorldMapParcelInfoObserver") << "Can't handle remote parcel request." << " Http Status: " << status << ". Reason : " << reason << LL_ENDL;
+}
+
//---------------------------------------------------------------------------
// Statics
//---------------------------------------------------------------------------
@@ -275,23 +317,25 @@ const LLUUID LLFloaterWorldMap::sHomeID( "10000000-0000-0000-0000-000000000001"
LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key)
: LLFloater(key),
- mInventory(NULL),
- mInventoryObserver(NULL),
- mFriendObserver(NULL),
+ mInventory(nullptr),
+ mInventoryObserver(nullptr),
+ mFriendObserver(nullptr),
mCompletingRegionName(),
mCompletingRegionPos(),
mWaitingForTracker(false),
mIsClosing(false),
mSetToUserPosition(true),
- mTrackedLocation(0,0,0),
+ mTrackedLocation(0.0,0.0,0.0),
mTrackedStatus(LLTracker::TRACKING_NOTHING),
- mListFriendCombo(NULL),
- mListLandmarkCombo(NULL),
- mListSearchResults(NULL)
+ mListFriendCombo(nullptr),
+ mListLandmarkCombo(nullptr),
+ mListSearchResults(nullptr),
+ mParcelInfoObserver(nullptr),
+ mShowParcelInfo(false)
{
gFloaterWorldMap = this;
- mFactoryMap["objects_mapview"] = LLCallbackMap(createWorldMapView, NULL);
+ mFactoryMap["objects_mapview"] = LLCallbackMap(createWorldMapView, nullptr);
mCommitCallbackRegistrar.add("WMap.Coordinates", boost::bind(&LLFloaterWorldMap::onCoordinatesCommit, this));
mCommitCallbackRegistrar.add("WMap.Location", boost::bind(&LLFloaterWorldMap::onLocationCommit, this));
@@ -374,6 +418,11 @@ bool LLFloaterWorldMap::postBuild()
// virtual
LLFloaterWorldMap::~LLFloaterWorldMap()
{
+ if (mParcelInfoObserver)
+ {
+ delete mParcelInfoObserver;
+ }
+
// All cleaned up by LLView destructor
mMapView = NULL;
@@ -584,9 +633,73 @@ void LLFloaterWorldMap::draw()
// Internal utility functions
//-------------------------------------------------------------------------
+void LLFloaterWorldMap::processParcelInfo(const LLParcelData& parcel_data, const LLVector3d& pos_global) const
+{
+ LLVector3d tracker_pos = LLTracker::getTrackedPositionGlobal();
+ if (!mShowParcelInfo ||
+ (tracker_pos.mdV[VX] != pos_global.mdV[VX] && tracker_pos.mdV[VY] != pos_global.mdV[VY]) ||
+ LLTracker::getTrackedLocationType() != LLTracker::LOCATION_NOTHING ||
+ LLTracker::getTrackingStatus() != LLTracker::TRACKING_LOCATION)
+ {
+ return;
+ }
+
+ LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global);
+ if (!sim_info)
+ {
+ return;
+ }
+
+ std::string sim_name = sim_info->getName();
+ U32 locX, locY;
+ from_region_handle(sim_info->getHandle(), &locX, &locY);
+ F32 region_x = (F32)(pos_global.mdV[VX] - locX);
+ F32 region_y = (F32)(pos_global.mdV[VY] - locY);
+ std::string full_name = llformat("%s (%d, %d, %d)",
+ sim_name.c_str(),
+ ll_round(region_x),
+ ll_round(region_y),
+ ll_round((F32)pos_global.mdV[VZ]));
+
+ LLTracker::trackLocation(pos_global, parcel_data.name.empty() ? getString("UnnamedParcel") : parcel_data.name, full_name);
+}
+
+void LLFloaterWorldMap::requestParcelInfo(const LLVector3d& pos_global, const LLVector3d& region_origin)
+{
+ if (pos_global == mRequestedGlobalPos)
+ {
+ return;
+ }
+
+ LLViewerRegion* region = gAgent.getRegion();
+ if (!region)
+ {
+ return;
+ }
+
+ if (std::string url = region->getCapability("RemoteParcelRequest"); !url.empty())
+ {
+ mRequestedGlobalPos = pos_global;
+ if (mParcelInfoObserver)
+ {
+ delete mParcelInfoObserver;
+ }
+ mParcelInfoObserver = new LLWorldMapParcelInfoObserver(pos_global);
+
+ auto pos_region = LLVector3(pos_global - region_origin);
+ LLRemoteParcelInfoProcessor::instance().requestRegionParcelInfo(url,
+ region->getRegionID(), pos_region, pos_global,
+ mParcelInfoObserver->getObserverHandle());
+ }
+ else
+ {
+ LL_WARNS() << "Cannot request parcel details: Cap not found" << LL_ENDL;
+ }
+}
void LLFloaterWorldMap::trackAvatar( const LLUUID& avatar_id, const std::string& name )
{
+ mShowParcelInfo = false;
LLCtrlSelectionInterface *iface = childGetSelectionInterface("friend combo");
if (!iface) return;
@@ -617,6 +730,7 @@ void LLFloaterWorldMap::trackAvatar( const LLUUID& avatar_id, const std::string&
void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id )
{
+ mShowParcelInfo = false;
LLCtrlSelectionInterface *iface = childGetSelectionInterface("landmark combo");
if (!iface) return;
@@ -662,6 +776,7 @@ void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id )
void LLFloaterWorldMap::trackEvent(const LLItemInfo &event_info)
{
+ mShowParcelInfo = false;
mTrackedStatus = LLTracker::TRACKING_LOCATION;
LLTracker::trackLocation(event_info.getGlobalPosition(), event_info.getName(), event_info.getToolTip(), LLTracker::LOCATION_EVENT);
setDefaultBtn("Teleport");
@@ -669,6 +784,7 @@ void LLFloaterWorldMap::trackEvent(const LLItemInfo &event_info)
void LLFloaterWorldMap::trackGenericItem(const LLItemInfo &item)
{
+ mShowParcelInfo = false;
mTrackedStatus = LLTracker::TRACKING_LOCATION;
LLTracker::trackLocation(item.getGlobalPosition(), item.getName(), item.getToolTip(), LLTracker::LOCATION_ITEM);
setDefaultBtn("Teleport");
@@ -721,6 +837,9 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global)
LLWorldMap::getInstance()->cancelTracking(); // The floater is taking over the tracking
LLTracker::trackLocation(pos_global, full_name, tooltip);
+ mShowParcelInfo = true;
+ requestParcelInfo(pos_global, sim_info->getGlobalOrigin());
+
LLVector3d coord_pos = LLTracker::getTrackedPositionGlobal();
updateTeleportCoordsDisplay( coord_pos );
diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h
index a99100f5bd..2f2b2b7a0d 100644
--- a/indra/newview/llfloaterworldmap.h
+++ b/indra/newview/llfloaterworldmap.h
@@ -34,8 +34,9 @@
#include "llfloater.h"
#include "llmapimagetype.h"
-#include "lltracker.h"
+#include "llremoteparcelrequest.h"
#include "llslurl.h"
+#include "lltracker.h"
class LLCtrlListInterface;
class LLFriendObserver;
@@ -51,6 +52,21 @@ class LLSliderCtrl;
class LLSpinCtrl;
class LLSearchEditor;
+class LLWorldMapParcelInfoObserver : public LLRemoteParcelInfoObserver
+{
+public:
+ LLWorldMapParcelInfoObserver(const LLVector3d& pos_global);
+ ~LLWorldMapParcelInfoObserver();
+
+ void processParcelInfo(const LLParcelData& parcel_data);
+ void setParcelID(const LLUUID& parcel_id);
+ void setErrorStatus(S32 status, const std::string& reason);
+
+protected:
+ LLVector3d mPosGlobal;
+ LLUUID mParcelID;
+};
+
class LLFloaterWorldMap : public LLFloater
{
public:
@@ -119,6 +135,8 @@ public:
//Slapp instigated avatar tracking
void avatarTrackFromSlapp( const LLUUID& id );
+ void processParcelInfo(const LLParcelData& parcel_data, const LLVector3d& pos_global) const;
+
protected:
void onGoHome();
@@ -169,8 +187,13 @@ private:
// enable/disable teleport destination coordinates
void enableTeleportCoordsDisplay( bool enabled );
- std::vector<LLUUID> mLandmarkAssetIDList;
- std::vector<LLUUID> mLandmarkItemIDList;
+ void requestParcelInfo(const LLVector3d& pos_global, const LLVector3d& region_origin);
+ LLVector3d mRequestedGlobalPos;
+ bool mShowParcelInfo;
+ LLWorldMapParcelInfoObserver* mParcelInfoObserver;
+
+ uuid_vec_t mLandmarkAssetIDList;
+ uuid_vec_t mLandmarkItemIDList;
static const LLUUID sHomeID;
diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp
index 4011a857e5..205089c662 100644
--- a/indra/newview/llhudnametag.cpp
+++ b/indra/newview/llhudnametag.cpp
@@ -279,8 +279,10 @@ void LLHUDNameTag::renderText(bool for_select)
mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f));
// *TODO: make this a per-text setting
- LLColor4 bg_color = LLUIColorTable::instance().getColor("NameTagBackground");
- bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor);
+ static LLCachedControl<F32> bubble_opacity(gSavedSettings, "ChatBubbleOpacity");
+ static LLUIColor nametag_bg_color = LLUIColorTable::instance().getColor("NameTagBackground");
+ LLColor4 bg_color = nametag_bg_color;
+ bg_color.setAlpha(bubble_opacity * alpha_factor);
// scale screen size of borders down
//RN: for now, text on hud objects is never occluded
@@ -340,8 +342,7 @@ void LLHUDNameTag::renderText(bool for_select)
x_offset = -0.5f * mWidth + (HORIZONTAL_PADDING / 2.f);
}
- LLColor4 label_color(0.f, 0.f, 0.f, 1.f);
- label_color.mV[VALPHA] = alpha_factor;
+ LLColor4 label_color(0.f, 0.f, 0.f, alpha_factor);
hud_render_text(segment_iter->getText(), render_position, *fontp, segment_iter->mStyle, LLFontGL::NO_SHADOW, x_offset, y_offset, label_color, false);
}
}
diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp
index 35bcf65db6..fd0d8b696f 100644
--- a/indra/newview/llhudtext.cpp
+++ b/indra/newview/llhudtext.cpp
@@ -138,8 +138,10 @@ void LLHUDText::renderText()
mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f));
// *TODO: make this a per-text setting
- LLColor4 bg_color = LLUIColorTable::instance().getColor("ObjectBubbleColor");
- bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor);
+ static LLCachedControl<F32> bubble_opacity(gSavedSettings, "ChatBubbleOpacity");
+ static LLUIColor nametag_bg_color = LLUIColorTable::instance().getColor("ObjectBubbleColor");
+ LLColor4 bg_color = nametag_bg_color;
+ bg_color.setAlpha(bubble_opacity * alpha_factor);
const S32 border_height = 16;
const S32 border_width = 16;
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index 98b3707457..9e6cf7ac73 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -221,9 +221,10 @@ void LLInventoryGallery::setRootFolder(const LLUUID cat_id)
for (const LLUUID& id : mSelectedItemIDs)
{
- if (mItemMap[id])
+ LLInventoryGalleryItem* item = getItem(id);
+ if (item)
{
- mItemMap[id]->setSelected(false);
+ item->setSelected(false);
}
}
@@ -348,7 +349,7 @@ void LLInventoryGallery::initGallery()
mScrollPanel->addChild(mGalleryPanel);
for (int i = 0; i < n; i++)
{
- addToGallery(mItemMap[cats[i]]);
+ addToGallery(getItem(cats[i]));
}
reArrangeRows();
mGalleryCreated = true;
@@ -656,6 +657,16 @@ LLInventoryGalleryItem* LLInventoryGallery::buildGalleryItem(std::string name, L
return gitem;
}
+LLInventoryGalleryItem* LLInventoryGallery::getItem(const LLUUID& id) const
+{
+ auto it = mItemMap.find(id);
+ if (it != mItemMap.end())
+ {
+ return it->second;
+ }
+ return nullptr;
+}
+
void LLInventoryGallery::buildGalleryPanel(int row_count)
{
LLPanel::Params params;
@@ -1006,14 +1017,15 @@ void LLInventoryGallery::updateItemThumbnail(LLUUID item_id)
thumbnail_id = getOutfitImageID(item_id);
}
- if (mItemMap[item_id])
+ LLInventoryGalleryItem* item = getItem(item_id);
+ if (item)
{
- mItemMap[item_id]->setLoadImmediately(mLoadThumbnailsImmediately);
- mItemMap[item_id]->setThumbnail(thumbnail_id);
+ item->setLoadImmediately(mLoadThumbnailsImmediately);
+ item->setThumbnail(thumbnail_id);
- bool passes_filter = checkAgainstFilters(mItemMap[item_id], mFilterSubString);
- if((mItemMap[item_id]->isHidden() && passes_filter)
- || (!mItemMap[item_id]->isHidden() && !passes_filter))
+ bool passes_filter = checkAgainstFilters(item, mFilterSubString);
+ if((item->isHidden() && passes_filter)
+ || (!item->isHidden() && !passes_filter))
{
reArrangeRows();
}
@@ -1169,7 +1181,7 @@ void LLInventoryGallery::moveUp(MASK mask)
if (mInventoryGalleryMenu && mSelectedItemIDs.size() > 0 && mItemsAddedCount > 1)
{
- LLInventoryGalleryItem* item = mItemMap[mLastInteractedUUID];
+ LLInventoryGalleryItem* item = getItem(mLastInteractedUUID);
if (item)
{
if (mask == MASK_NONE || mask == MASK_CONTROL)
@@ -1214,7 +1226,7 @@ void LLInventoryGallery::moveDown(MASK mask)
if (mInventoryGalleryMenu && mSelectedItemIDs.size() > 0 && mItemsAddedCount > 1)
{
- LLInventoryGalleryItem* item = mItemMap[mLastInteractedUUID];
+ LLInventoryGalleryItem* item = getItem(mLastInteractedUUID);
if (item)
{
if (mask == MASK_NONE || mask == MASK_CONTROL)
@@ -1259,11 +1271,7 @@ void LLInventoryGallery::moveLeft(MASK mask)
if (mInventoryGalleryMenu && mSelectedItemIDs.size() > 0 && mItemsAddedCount > 1)
{
- LLInventoryGalleryItem* item = mItemMap[mLastInteractedUUID];
- if (mask == MASK_SHIFT)
- {
- item = mItemMap[mLastInteractedUUID];
- }
+ LLInventoryGalleryItem* item = getItem(mLastInteractedUUID);
if (item)
{
// Might be better to get item from panel
@@ -1307,7 +1315,7 @@ void LLInventoryGallery::moveRight(MASK mask)
if (mInventoryGalleryMenu && mSelectedItemIDs.size() > 0 && mItemsAddedCount > 1)
{
- LLInventoryGalleryItem* item = mItemMap[mLastInteractedUUID];
+ LLInventoryGalleryItem* item = getItem(mLastInteractedUUID);
if (item)
{
S32 n = mItemIndexMap[item];
@@ -1373,8 +1381,8 @@ void LLInventoryGallery::toggleSelectionRangeFromLast(const LLUUID target)
{
return;
}
- LLInventoryGalleryItem* last_item = mItemMap[mLastInteractedUUID];
- LLInventoryGalleryItem* next_item = mItemMap[target];
+ LLInventoryGalleryItem* last_item = getItem(mLastInteractedUUID);
+ LLInventoryGalleryItem* next_item = getItem(target);
if (last_item && next_item)
{
S32 last_idx = mItemIndexMap[last_item];
@@ -1417,9 +1425,10 @@ void LLInventoryGallery::onFocusLost()
for (const LLUUID& id : mSelectedItemIDs)
{
- if (mItemMap[id])
+ LLInventoryGalleryItem* item = getItem(id);
+ if (item)
{
- mItemMap[id]->setSelected(false);
+ item->setSelected(false);
}
}
}
@@ -1435,9 +1444,10 @@ void LLInventoryGallery::onFocusReceived()
LLInventoryGalleryItem* focus_item = NULL;
for (const LLUUID& id : mSelectedItemIDs)
{
- if (mItemMap[id] && !mItemMap[id]->isHidden())
+ LLInventoryGalleryItem* item = getItem(id);
+ if (item && !item->isHidden())
{
- focus_item = mItemMap[id];
+ focus_item = item;
focus_item->setSelected(true);
}
}
@@ -1478,9 +1488,10 @@ void LLInventoryGallery::changeItemSelection(const LLUUID& item_id, bool scroll_
{
for (const LLUUID& id : mSelectedItemIDs)
{
- if (mItemMap[id])
+ LLInventoryGalleryItem* item = getItem(id);
+ if (item)
{
- mItemMap[id]->setSelected(false);
+ item->setSelected(false);
}
}
mSelectedItemIDs.clear();
@@ -1499,9 +1510,10 @@ void LLInventoryGallery::changeItemSelection(const LLUUID& item_id, bool scroll_
return;
}
- if (mItemMap[item_id])
+ LLInventoryGalleryItem* item = getItem(item_id);
+ if (item)
{
- mItemMap[item_id]->setSelected(true);
+ item->setSelected(true);
}
mSelectedItemIDs.push_back(item_id);
signalSelectionItemID(item_id);
@@ -1527,9 +1539,10 @@ void LLInventoryGallery::addItemSelection(const LLUUID& item_id, bool scroll_to_
return;
}
- if (mItemMap[item_id])
+ LLInventoryGalleryItem* item = getItem(item_id);
+ if (item)
{
- mItemMap[item_id]->setSelected(true);
+ item->setSelected(true);
}
mSelectedItemIDs.push_back(item_id);
signalSelectionItemID(item_id);
@@ -1552,18 +1565,20 @@ bool LLInventoryGallery::toggleItemSelection(const LLUUID& item_id, bool scroll_
selection_deque::iterator found = std::find(mSelectedItemIDs.begin(), mSelectedItemIDs.end(), item_id);
if (found != mSelectedItemIDs.end())
{
- if (mItemMap[item_id])
+ LLInventoryGalleryItem* item = getItem(item_id);
+ if (item)
{
- mItemMap[item_id]->setSelected(false);
+ item->setSelected(false);
}
mSelectedItemIDs.erase(found);
result = false;
}
else
{
- if (mItemMap[item_id])
+ LLInventoryGalleryItem* item = getItem(item_id);
+ if (item)
{
- mItemMap[item_id]->setSelected(true);
+ item->setSelected(true);
}
mSelectedItemIDs.push_back(item_id);
signalSelectionItemID(item_id);
@@ -1580,7 +1595,7 @@ bool LLInventoryGallery::toggleItemSelection(const LLUUID& item_id, bool scroll_
void LLInventoryGallery::scrollToShowItem(const LLUUID& item_id)
{
- LLInventoryGalleryItem* item = mItemMap[item_id];
+ LLInventoryGalleryItem* item = getItem(item_id);
if(item)
{
const LLRect visible_content_rect = mScrollPanel->getVisibleContentRect();
@@ -1610,7 +1625,7 @@ LLInventoryGalleryItem* LLInventoryGallery::getFirstSelectedItem()
if (mSelectedItemIDs.size() > 0)
{
selection_deque::iterator iter = mSelectedItemIDs.begin();
- return mItemMap[*iter];
+ return getItem(*iter);
}
return NULL;
}
@@ -1768,9 +1783,10 @@ void LLInventoryGallery::paste()
{
for (const LLUUID& id : mSelectedItemIDs)
{
- if (mItemMap[id])
+ LLInventoryGalleryItem* item = getItem(id);
+ if (item)
{
- mItemMap[id]->setSelected(false);
+ item->setSelected(false);
}
}
mSelectedItemIDs.clear();
@@ -2108,9 +2124,10 @@ void LLInventoryGallery::pasteAsLink()
{
for (const LLUUID& id : mSelectedItemIDs)
{
- if (mItemMap[id])
+ LLInventoryGalleryItem* item = getItem(id);
+ if (item)
{
- mItemMap[id]->setSelected(false);
+ item->setSelected(false);
}
}
mSelectedItemIDs.clear();
@@ -2433,10 +2450,10 @@ void LLInventoryGallery::onGesturesChanged()
void LLInventoryGallery::deselectItem(const LLUUID& category_id)
{
// Reset selection if the item is selected.
- LLInventoryGalleryItem* item = mItemMap[category_id];
+ LLInventoryGalleryItem* item = getItem(category_id);
if (item && item->isSelected())
{
- mItemMap[category_id]->setSelected(false);
+ item->setSelected(false);
setFocus(true);
// Todo: support multiselect
// signalSelectionItemID(LLUUID::null);
@@ -2453,9 +2470,10 @@ void LLInventoryGallery::clearSelection()
{
for (const LLUUID& id: mSelectedItemIDs)
{
- if (mItemMap[id])
+ LLInventoryGalleryItem* item = getItem(id);
+ if (item)
{
- mItemMap[id]->setSelected(false);
+ item->setSelected(false);
}
}
if (!mSelectedItemIDs.empty())
@@ -2863,11 +2881,13 @@ void LLInventoryGalleryItem::draw()
LLPanel::draw();
// Draw border
- LLUIColor border_color = LLUIColorTable::instance().getColor(mSelected ? "MenuItemHighlightBgColor" : "TextFgTentativeColor", LLColor4::white);
+ static LLUIColor menu_highlighted_color = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", LLColor4::white);;
+ static LLUIColor text_fg_tentative_color = LLUIColorTable::instance().getColor("TextFgTentativeColor", LLColor4::white);;
+ const LLColor4& border_color = mSelected ? menu_highlighted_color : text_fg_tentative_color;
LLRect border = mThumbnailCtrl->getRect();
border.mRight = border.mRight + 1;
border.mTop = border.mTop + 1;
- gl_rect_2d(border, border_color.get(), false);
+ gl_rect_2d(border, border_color, false);
}
}
diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h
index afc7bdc9f8..59d08d19ed 100644
--- a/indra/newview/llinventorygallery.h
+++ b/indra/newview/llinventorygallery.h
@@ -228,6 +228,7 @@ private:
void updateGalleryWidth();
LLInventoryGalleryItem* buildGalleryItem(std::string name, LLUUID item_id, LLAssetType::EType type, LLUUID thumbnail_id, LLInventoryType::EType inventory_type, U32 flags, time_t creation_date, bool is_link, bool is_worn);
+ LLInventoryGalleryItem* getItem(const LLUUID& id) const;
void buildGalleryPanel(int row_count);
void reshapeGalleryPanel(int row_count);
diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp
index 0e2b3cb409..31c9eb8966 100644
--- a/indra/newview/lllocalbitmaps.cpp
+++ b/indra/newview/lllocalbitmaps.cpp
@@ -670,15 +670,16 @@ void LLLocalBitmap::updateGLTFMaterials(LLUUID old_id, LLUUID new_id)
if (override_mat)
{
// do not create a new material, reuse existing pointer
- LLFetchedGLTFMaterial* render_mat = (LLFetchedGLTFMaterial*)entry->getGLTFRenderMaterial();
+ LLFetchedGLTFMaterial* render_mat = dynamic_cast<LLFetchedGLTFMaterial*>(entry->getGLTFRenderMaterial());
if (render_mat)
{
- llassert(dynamic_cast<LLFetchedGLTFMaterial*>(entry->getGLTFRenderMaterial()) != nullptr);
- {
*render_mat = *fetched_mat;
- }
render_mat->applyOverride(*override_mat);
}
+ else
+ {
+ LL_WARNS_ONCE() << "Failed to apply local material override, render material not found" << LL_ENDL;
+ }
}
}
}
diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp
index 0c82db1011..0d617753c8 100644
--- a/indra/newview/llmanip.cpp
+++ b/indra/newview/llmanip.cpp
@@ -594,9 +594,9 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string
LLColor4 LLManip::setupSnapGuideRenderPass(S32 pass)
{
- static LLColor4 grid_color_fg = LLUIColorTable::instance().getColor("GridlineColor");
- static LLColor4 grid_color_bg = LLUIColorTable::instance().getColor("GridlineBGColor");
- static LLColor4 grid_color_shadow = LLUIColorTable::instance().getColor("GridlineShadowColor");
+ static LLUIColor grid_color_fg = LLUIColorTable::instance().getColor("GridlineColor");
+ static LLUIColor grid_color_bg = LLUIColorTable::instance().getColor("GridlineBGColor");
+ static LLUIColor grid_color_shadow = LLUIColorTable::instance().getColor("GridlineShadowColor");
LLColor4 line_color;
F32 line_alpha = gSavedSettings.getF32("GridOpacity");
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 4c5cc37766..349df11f35 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -2363,10 +2363,11 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
// We want to be able to allow more than 8 materials...
//
- S32 end = llmin((S32)instance.mMaterial.size(), instance.mModel->getNumVolumeFaces()) ;
+ S32 end = llmin((S32)data.mBaseModel->mMaterialList.size(), instance.mModel->getNumVolumeFaces()) ;
for (S32 face_num = 0; face_num < end; face_num++)
{
+ // multiple faces can reuse the same material
LLImportMaterial& material = instance.mMaterial[data.mBaseModel->mMaterialList[face_num]];
LLSD face_entry = LLSD::emptyMap();
diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp
index 7482890d1e..d7df9ceadc 100644
--- a/indra/newview/lloutfitgallery.cpp
+++ b/indra/newview/lloutfitgallery.cpp
@@ -128,7 +128,7 @@ void LLOutfitGallery::onOpen(const LLSD& info)
mScrollPanel->addChild(mGalleryPanel);
for (int i = 0; i < n; i++)
{
- addToGallery(mOutfitMap[cats[i]]);
+ addToGallery(getItem(cats[i]));
}
reArrangeRows();
mGalleryCreated = true;
@@ -377,7 +377,7 @@ void LLOutfitGallery::onOutfitsRemovalConfirmation(const LLSD& notification, con
void LLOutfitGallery::scrollToShowItem(const LLUUID& item_id)
{
- LLOutfitGalleryItem* item = mOutfitMap[item_id];
+ LLOutfitGalleryItem* item = getItem(item_id);
if (item)
{
const LLRect visible_content_rect = mScrollPanel->getVisibleContentRect();
@@ -525,6 +525,10 @@ LLPanel* LLOutfitGallery::addToRow(LLPanel* row_stack, LLOutfitGalleryItem* item
void LLOutfitGallery::addToGallery(LLOutfitGalleryItem* item)
{
+ if (!item)
+ {
+ return;
+ }
if(item->isHidden())
{
mHiddenItems.push_back(item);
@@ -632,9 +636,19 @@ LLOutfitGalleryItem* LLOutfitGallery::buildGalleryItem(std::string name, LLUUID
return gitem;
}
-LLOutfitGalleryItem* LLOutfitGallery::getSelectedItem()
+LLOutfitGalleryItem* LLOutfitGallery::getSelectedItem() const
+{
+ return getItem(mSelectedOutfitUUID);
+}
+
+LLOutfitGalleryItem* LLOutfitGallery::getItem(const LLUUID& id) const
{
- return mOutfitMap[mSelectedOutfitUUID];
+ auto it = mOutfitMap.find(id);
+ if (it != mOutfitMap.end())
+ {
+ return it->second;
+ }
+ return nullptr;
}
void LLOutfitGallery::buildGalleryPanel(int row_count)
@@ -1006,8 +1020,8 @@ void LLOutfitGalleryItem::setOutfitWorn(bool value)
LLStringUtil::format_map_t worn_string_args;
std::string worn_string = getString("worn_string", worn_string_args);
LLUIColor text_color = LLUIColorTable::instance().getColor("White", LLColor4::white);
- mOutfitWornText->setReadOnlyColor(text_color.get());
- mOutfitNameText->setReadOnlyColor(text_color.get());
+ mOutfitWornText->setReadOnlyColor(text_color);
+ mOutfitNameText->setReadOnlyColor(text_color);
mOutfitWornText->setFont(value ? LLFontGL::getFontSansSerifBold() : LLFontGL::getFontSansSerifSmall());
mOutfitNameText->setFont(value ? LLFontGL::getFontSansSerifBold() : LLFontGL::getFontSansSerifSmall());
mOutfitWornText->setValue(value ? worn_string : "");
@@ -1275,7 +1289,15 @@ void LLOutfitGallery::refreshOutfit(const LLUUID& category_id)
}
if (asset_id.notNull())
{
- photo_loaded |= mOutfitMap[category_id]->setImageAssetId(asset_id);
+ LLOutfitGalleryItem* item = getItem(category_id);
+ if (item)
+ {
+ photo_loaded |= item->setImageAssetId(asset_id);
+ }
+ else
+ {
+ photo_loaded = true;
+ }
// Rename links
if (!mOutfitRenamePending.isNull() && mOutfitRenamePending.asString() == item_name)
{
@@ -1301,13 +1323,21 @@ void LLOutfitGallery::refreshOutfit(const LLUUID& category_id)
}
if (!photo_loaded)
{
- mOutfitMap[category_id]->setDefaultImage();
+ LLOutfitGalleryItem* item = getItem(category_id);
+ if (item)
+ {
+ item->setDefaultImage();
+ }
}
}
}
else
{
- mOutfitMap[category_id]->setImageAssetId(asset_id);
+ LLOutfitGalleryItem* item = getItem(category_id);
+ if (item)
+ {
+ item->setImageAssetId(asset_id);
+ }
}
}
diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h
index 5b2a33d0ca..fa441ff209 100644
--- a/indra/newview/lloutfitgallery.h
+++ b/indra/newview/lloutfitgallery.h
@@ -135,7 +135,8 @@ private:
void updateGalleryWidth();
LLOutfitGalleryItem* buildGalleryItem(std::string name, LLUUID outfit_id);
- LLOutfitGalleryItem* getSelectedItem();
+ LLOutfitGalleryItem* getSelectedItem() const;
+ LLOutfitGalleryItem* getItem(const LLUUID& id) const;
void onTextureSelectionChanged(LLInventoryItem* itemp);
diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp
index e6421d8a41..488bd87272 100644
--- a/indra/newview/lloutputmonitorctrl.cpp
+++ b/indra/newview/lloutputmonitorctrl.cpp
@@ -126,29 +126,31 @@ void LLOutputMonitorCtrl::draw()
const F32 LEVEL_1 = LLVoiceClient::OVERDRIVEN_POWER_LEVEL * 2.f / 3.f;
const F32 LEVEL_2 = LLVoiceClient::OVERDRIVEN_POWER_LEVEL;
+ LLVoiceClient* vocie_client = LLVoiceClient::getInstance();
+
if (getVisible() && mAutoUpdate && !getIsMuted() && mSpeakerId.notNull())
{
- setPower(LLVoiceClient::getInstance()->getCurrentPower(mSpeakerId));
+ setPower(vocie_client->getCurrentPower(mSpeakerId));
if(mIsAgentControl)
{
- setIsTalking(LLVoiceClient::getInstance()->getUserPTTState());
+ setIsTalking(vocie_client->getUserPTTState());
}
else
{
- setIsTalking(LLVoiceClient::getInstance()->getIsSpeaking(mSpeakerId));
+ setIsTalking(vocie_client->getIsSpeaking(mSpeakerId));
}
}
if ((mPower == 0.f && !mIsTalking) && mShowParticipantsSpeaking)
{
std::set<LLUUID> participant_uuids;
- LLVoiceClient::instance().getParticipantList(participant_uuids);
+ vocie_client->getParticipantList(participant_uuids);
std::set<LLUUID>::const_iterator part_it = participant_uuids.begin();
F32 power = 0;
for (; part_it != participant_uuids.end(); ++part_it)
{
- power = LLVoiceClient::instance().getCurrentPower(*part_it);
+ power = vocie_client->getCurrentPower(*part_it);
if (power)
{
mPower = power;
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 0afe967839..544b6fbc9c 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -117,26 +117,23 @@ const S32 PBRTYPE_METALLIC_ROUGHNESS = 2; // PBR Metallic
const S32 PBRTYPE_EMISSIVE = 3; // PBR Emissive
const S32 PBRTYPE_NORMAL = 4; // PBR Normal
-LLGLTFMaterial::TextureInfo texture_info_from_pbrtype(S32 pbr_type)
+LLGLTFMaterial::TextureInfo LLPanelFace::getPBRTextureInfo()
{
- switch (pbr_type)
+ // Radiogroup [ "Complete material", "Base color", "Metallic/roughness", "Emissive", "Normal" ]
+ S32 radio_group_index = mRadioPbrType->getSelectedIndex();
+ switch (radio_group_index)
{
case PBRTYPE_BASE_COLOR:
return LLGLTFMaterial::GLTF_TEXTURE_INFO_BASE_COLOR;
- break;
case PBRTYPE_NORMAL:
return LLGLTFMaterial::GLTF_TEXTURE_INFO_NORMAL;
- break;
case PBRTYPE_METALLIC_ROUGHNESS:
return LLGLTFMaterial::GLTF_TEXTURE_INFO_METALLIC_ROUGHNESS;
- break;
case PBRTYPE_EMISSIVE:
return LLGLTFMaterial::GLTF_TEXTURE_INFO_EMISSIVE;
- break;
- default:
- return LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT;
- break;
}
+ // The default value is used as a fallback
+ return LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT;
}
void LLPanelFace::updateSelectedGLTFMaterials(std::function<void(LLGLTFMaterial*)> func)
@@ -195,265 +192,250 @@ std::string USE_TEXTURE;
LLRender::eTexIndex LLPanelFace::getTextureChannelToEdit()
{
- LLRender::eTexIndex channel_to_edit = LLRender::DIFFUSE_MAP;
- if (mComboMatMedia)
+ S32 matmedia_selection = mComboMatMedia->getCurrentIndex();
+ switch (matmedia_selection)
{
- U32 matmedia_selection = mComboMatMedia->getCurrentIndex();
- if (matmedia_selection == MATMEDIA_MATERIAL)
- {
- channel_to_edit = (LLRender::eTexIndex)mRadioMaterialType->getSelectedIndex();
- }
- if (matmedia_selection == MATMEDIA_PBR)
- {
- channel_to_edit = (LLRender::eTexIndex)mRadioPbrType->getSelectedIndex();
- }
+ case MATMEDIA_MATERIAL:
+ return getMatTextureChannel();
+ case MATMEDIA_PBR:
+ return getPBRTextureChannel();
}
+ return (LLRender::eTexIndex)0;
+}
- channel_to_edit = (channel_to_edit == LLRender::NORMAL_MAP) ? (getCurrentNormalMap().isNull() ? LLRender::DIFFUSE_MAP : channel_to_edit) : channel_to_edit;
- channel_to_edit = (channel_to_edit == LLRender::SPECULAR_MAP) ? (getCurrentSpecularMap().isNull() ? LLRender::DIFFUSE_MAP : channel_to_edit) : channel_to_edit;
- return channel_to_edit;
+LLRender::eTexIndex LLPanelFace::getMatTextureChannel()
+{
+ // Radiogroup [ "Texture (diffuse)", "Bumpiness (normal)", "Shininess (specular)" ]
+ S32 radio_group_index = mRadioMaterialType->getSelectedIndex();
+ switch (radio_group_index)
+ {
+ case MATTYPE_DIFFUSE: // "Texture (diffuse)"
+ return LLRender::DIFFUSE_MAP;
+ case MATTYPE_NORMAL: // "Bumpiness (normal)"
+ if (getCurrentNormalMap().notNull())
+ return LLRender::NORMAL_MAP;
+ break;
+ case MATTYPE_SPECULAR: // "Shininess (specular)"
+ if (getCurrentNormalMap().notNull())
+ return LLRender::SPECULAR_MAP;
+ break;
+ }
+ // The default value is used as a fallback if no required texture is chosen
+ return (LLRender::eTexIndex)0;
+}
+
+LLRender::eTexIndex LLPanelFace::getPBRTextureChannel()
+{
+ // Radiogroup [ "Complete material", "Base color", "Metallic/roughness", "Emissive", "Normal" ]
+ S32 radio_group_index = mRadioPbrType->getSelectedIndex();
+ switch (radio_group_index)
+ {
+ case PBRTYPE_RENDER_MATERIAL_ID: // "Complete material"
+ return LLRender::NUM_TEXTURE_CHANNELS;
+ case PBRTYPE_BASE_COLOR: // "Base color"
+ return LLRender::BASECOLOR_MAP;
+ case PBRTYPE_METALLIC_ROUGHNESS: // "Metallic/roughness"
+ return LLRender::METALLIC_ROUGHNESS_MAP;
+ case PBRTYPE_EMISSIVE: // "Emissive"
+ return LLRender::EMISSIVE_MAP;
+ case PBRTYPE_NORMAL: // "Normal"
+ return LLRender::GLTF_NORMAL_MAP;
+ }
+ // The default value is used as a fallback
+ return LLRender::NUM_TEXTURE_CHANNELS;
}
LLRender::eTexIndex LLPanelFace::getTextureDropChannel()
{
- if (mComboMatMedia && mComboMatMedia->getCurrentIndex() == MATMEDIA_MATERIAL)
+ if (mComboMatMedia->getCurrentIndex() == MATMEDIA_MATERIAL)
{
- return LLRender::eTexIndex(mRadioMaterialType->getSelectedIndex());
+ return getMatTextureChannel();
}
- return LLRender::eTexIndex(MATTYPE_DIFFUSE);
+ return (LLRender::eTexIndex)0;
}
LLGLTFMaterial::TextureInfo LLPanelFace::getPBRDropChannel()
{
- if (mComboMatMedia && mComboMatMedia->getCurrentIndex() == MATMEDIA_PBR)
+ if (mComboMatMedia->getCurrentIndex() == MATMEDIA_PBR)
{
- return texture_info_from_pbrtype(mRadioPbrType->getSelectedIndex());
+ return getPBRTextureInfo();
}
- return texture_info_from_pbrtype(PBRTYPE_BASE_COLOR);
+ return (LLGLTFMaterial::TextureInfo)0;
}
// Things the UI provides...
//
-LLUUID LLPanelFace::getCurrentNormalMap() { return mBumpyTextureCtrl->getImageAssetID(); }
-LLUUID LLPanelFace::getCurrentSpecularMap() { return mShinyTextureCtrl->getImageAssetID(); }
-U32 LLPanelFace::getCurrentShininess() { return getChild<LLComboBox>("combobox shininess")->getCurrentIndex(); }
-U32 LLPanelFace::getCurrentBumpiness() { return getChild<LLComboBox>("combobox bumpiness")->getCurrentIndex(); }
-U8 LLPanelFace::getCurrentDiffuseAlphaMode() { return (U8)getChild<LLComboBox>("combobox alphamode")->getCurrentIndex(); }
-U8 LLPanelFace::getCurrentAlphaMaskCutoff() { return (U8)getChild<LLUICtrl>("maskcutoff")->getValue().asInteger(); }
-U8 LLPanelFace::getCurrentEnvIntensity() { return (U8)getChild<LLUICtrl>("environment")->getValue().asInteger(); }
-U8 LLPanelFace::getCurrentGlossiness() { return (U8)getChild<LLUICtrl>("glossiness")->getValue().asInteger(); }
-F32 LLPanelFace::getCurrentBumpyRot() { return (F32)getChild<LLUICtrl>("bumpyRot")->getValue().asReal(); }
-F32 LLPanelFace::getCurrentBumpyScaleU() { return (F32)getChild<LLUICtrl>("bumpyScaleU")->getValue().asReal(); }
-F32 LLPanelFace::getCurrentBumpyScaleV() { return (F32)getChild<LLUICtrl>("bumpyScaleV")->getValue().asReal(); }
-F32 LLPanelFace::getCurrentBumpyOffsetU() { return (F32)getChild<LLUICtrl>("bumpyOffsetU")->getValue().asReal(); }
-F32 LLPanelFace::getCurrentBumpyOffsetV() { return (F32)getChild<LLUICtrl>("bumpyOffsetV")->getValue().asReal(); }
-F32 LLPanelFace::getCurrentShinyRot() { return (F32)getChild<LLUICtrl>("shinyRot")->getValue().asReal(); }
-F32 LLPanelFace::getCurrentShinyScaleU() { return (F32)getChild<LLUICtrl>("shinyScaleU")->getValue().asReal(); }
-F32 LLPanelFace::getCurrentShinyScaleV() { return (F32)getChild<LLUICtrl>("shinyScaleV")->getValue().asReal(); }
-F32 LLPanelFace::getCurrentShinyOffsetU() { return (F32)getChild<LLUICtrl>("shinyOffsetU")->getValue().asReal(); }
-F32 LLPanelFace::getCurrentShinyOffsetV() { return (F32)getChild<LLUICtrl>("shinyOffsetV")->getValue().asReal(); }
+LLUUID LLPanelFace::getCurrentNormalMap() { return mBumpyTextureCtrl->getImageAssetID(); }
+LLUUID LLPanelFace::getCurrentSpecularMap() { return mShinyTextureCtrl->getImageAssetID(); }
+U32 LLPanelFace::getCurrentShininess() { return mComboShininess->getCurrentIndex(); }
+U32 LLPanelFace::getCurrentBumpiness() { return mComboBumpiness->getCurrentIndex(); }
+U8 LLPanelFace::getCurrentDiffuseAlphaMode() { return (U8)mComboAlphaMode->getCurrentIndex(); }
+U8 LLPanelFace::getCurrentAlphaMaskCutoff() { return (U8)mMaskCutoff->getValue().asInteger(); }
+U8 LLPanelFace::getCurrentEnvIntensity() { return (U8)mEnvironment->getValue().asInteger(); }
+U8 LLPanelFace::getCurrentGlossiness() { return (U8)mGlossiness->getValue().asInteger(); }
+F32 LLPanelFace::getCurrentBumpyRot() { return (F32)mBumpyRotate->getValue().asReal(); }
+F32 LLPanelFace::getCurrentBumpyScaleU() { return (F32)mBumpyScaleU->getValue().asReal(); }
+F32 LLPanelFace::getCurrentBumpyScaleV() { return (F32)mBumpyScaleV->getValue().asReal(); }
+F32 LLPanelFace::getCurrentBumpyOffsetU() { return (F32)mBumpyOffsetU->getValue().asReal(); }
+F32 LLPanelFace::getCurrentBumpyOffsetV() { return (F32)mBumpyOffsetV->getValue().asReal(); }
+F32 LLPanelFace::getCurrentShinyRot() { return (F32)mShinyRotate->getValue().asReal(); }
+F32 LLPanelFace::getCurrentShinyScaleU() { return (F32)mShinyScaleU->getValue().asReal(); }
+F32 LLPanelFace::getCurrentShinyScaleV() { return (F32)mShinyScaleV->getValue().asReal(); }
+F32 LLPanelFace::getCurrentShinyOffsetU() { return (F32)mShinyOffsetU->getValue().asReal(); }
+F32 LLPanelFace::getCurrentShinyOffsetV() { return (F32)mShinyOffsetV->getValue().asReal(); }
//
// Methods
//
-bool LLPanelFace::postBuild()
-{
- childSetCommitCallback("combobox shininess",&LLPanelFace::onCommitShiny,this);
- childSetCommitCallback("combobox bumpiness",&LLPanelFace::onCommitBump,this);
- childSetCommitCallback("combobox alphamode",&LLPanelFace::onCommitAlphaMode,this);
- childSetCommitCallback("TexScaleU",&LLPanelFace::onCommitTextureScaleX, this);
- childSetCommitCallback("TexScaleV",&LLPanelFace::onCommitTextureScaleY, this);
- childSetCommitCallback("TexRot",&LLPanelFace::onCommitTextureRot, this);
- childSetCommitCallback("rptctrl",&LLPanelFace::onCommitRepeatsPerMeter, this);
- childSetCommitCallback("checkbox planar align",&LLPanelFace::onCommitPlanarAlign, this);
- childSetCommitCallback("TexOffsetU",LLPanelFace::onCommitTextureOffsetX, this);
- childSetCommitCallback("TexOffsetV",LLPanelFace::onCommitTextureOffsetY, this);
-
- childSetCommitCallback("bumpyScaleU",&LLPanelFace::onCommitMaterialBumpyScaleX, this);
- childSetCommitCallback("bumpyScaleV",&LLPanelFace::onCommitMaterialBumpyScaleY, this);
- childSetCommitCallback("bumpyRot",&LLPanelFace::onCommitMaterialBumpyRot, this);
- childSetCommitCallback("bumpyOffsetU",&LLPanelFace::onCommitMaterialBumpyOffsetX, this);
- childSetCommitCallback("bumpyOffsetV",&LLPanelFace::onCommitMaterialBumpyOffsetY, this);
- childSetCommitCallback("shinyScaleU",&LLPanelFace::onCommitMaterialShinyScaleX, this);
- childSetCommitCallback("shinyScaleV",&LLPanelFace::onCommitMaterialShinyScaleY, this);
- childSetCommitCallback("shinyRot",&LLPanelFace::onCommitMaterialShinyRot, this);
- childSetCommitCallback("shinyOffsetU",&LLPanelFace::onCommitMaterialShinyOffsetX, this);
- childSetCommitCallback("shinyOffsetV",&LLPanelFace::onCommitMaterialShinyOffsetY, this);
- childSetCommitCallback("glossiness",&LLPanelFace::onCommitMaterialGloss, this);
- childSetCommitCallback("environment",&LLPanelFace::onCommitMaterialEnv, this);
- childSetCommitCallback("maskcutoff",&LLPanelFace::onCommitMaterialMaskCutoff, this);
- childSetCommitCallback("add_media", &LLPanelFace::onClickBtnAddMedia, this);
- childSetCommitCallback("delete_media", &LLPanelFace::onClickBtnDeleteMedia, this);
-
- getChild<LLUICtrl>("gltfTextureScaleU")->setCommitCallback(boost::bind(&LLPanelFace::onCommitGLTFTextureScaleU, this, _1), nullptr);
- getChild<LLUICtrl>("gltfTextureScaleV")->setCommitCallback(boost::bind(&LLPanelFace::onCommitGLTFTextureScaleV, this, _1), nullptr);
- getChild<LLUICtrl>("gltfTextureRotation")->setCommitCallback(boost::bind(&LLPanelFace::onCommitGLTFRotation, this, _1), nullptr);
- getChild<LLUICtrl>("gltfTextureOffsetU")->setCommitCallback(boost::bind(&LLPanelFace::onCommitGLTFTextureOffsetU, this, _1), nullptr);
- getChild<LLUICtrl>("gltfTextureOffsetV")->setCommitCallback(boost::bind(&LLPanelFace::onCommitGLTFTextureOffsetV, this, _1), nullptr);
+bool LLPanelFace::postBuild()
+{
+ getChildSetCommitCallback(mComboShininess, "combobox shininess", [&](LLUICtrl*, const LLSD&) { onCommitShiny(); });
+ getChildSetCommitCallback(mComboBumpiness, "combobox bumpiness", [&](LLUICtrl*, const LLSD&) { onCommitBump(); });
+ getChildSetCommitCallback(mComboAlphaMode, "combobox alphamode", [&](LLUICtrl*, const LLSD&) { onCommitAlphaMode(); });
+ getChildSetCommitCallback(mTexScaleU, "TexScaleU", [&](LLUICtrl*, const LLSD&) { onCommitTextureScaleX(); });
+ getChildSetCommitCallback(mTexScaleV, "TexScaleV", [&](LLUICtrl*, const LLSD&) { onCommitTextureScaleY(); });
+ getChildSetCommitCallback(mTexRotate, "TexRot", [&](LLUICtrl*, const LLSD&) { onCommitTextureRot(); });
+ getChildSetCommitCallback(mTexRepeat, "rptctrl", [&](LLUICtrl*, const LLSD&) { onCommitRepeatsPerMeter(); });
+ getChildSetCommitCallback(mPlanarAlign, "checkbox planar align", [&](LLUICtrl*, const LLSD&) { onCommitPlanarAlign(); });
+ getChildSetCommitCallback(mTexOffsetU, "TexOffsetU", [&](LLUICtrl*, const LLSD&) { onCommitTextureOffsetX(); });
+ getChildSetCommitCallback(mTexOffsetV, "TexOffsetV", [&](LLUICtrl*, const LLSD&) { onCommitTextureOffsetY(); });
+
+ getChildSetCommitCallback(mBumpyScaleU, "bumpyScaleU", [&](LLUICtrl*, const LLSD&) { onCommitMaterialBumpyScaleX(); });
+ getChildSetCommitCallback(mBumpyScaleV, "bumpyScaleV", [&](LLUICtrl*, const LLSD&) { onCommitMaterialBumpyScaleY(); });
+ getChildSetCommitCallback(mBumpyRotate, "bumpyRot", [&](LLUICtrl*, const LLSD&) { onCommitMaterialBumpyRot(); });
+ getChildSetCommitCallback(mBumpyOffsetU, "bumpyOffsetU", [&](LLUICtrl*, const LLSD&) { onCommitMaterialBumpyOffsetX(); });
+ getChildSetCommitCallback(mBumpyOffsetV, "bumpyOffsetV", [&](LLUICtrl*, const LLSD&) { onCommitMaterialBumpyOffsetY(); });
+ getChildSetCommitCallback(mShinyScaleU, "shinyScaleU", [&](LLUICtrl*, const LLSD&) { onCommitMaterialShinyScaleX(); });
+ getChildSetCommitCallback(mShinyScaleV, "shinyScaleV", [&](LLUICtrl*, const LLSD&) { onCommitMaterialShinyScaleY(); });
+ getChildSetCommitCallback(mShinyRotate, "shinyRot", [&](LLUICtrl*, const LLSD&) { onCommitMaterialShinyRot(); });
+ getChildSetCommitCallback(mShinyOffsetU, "shinyOffsetU", [&](LLUICtrl*, const LLSD&) { onCommitMaterialShinyOffsetX(); });
+ getChildSetCommitCallback(mShinyOffsetV, "shinyOffsetV", [&](LLUICtrl*, const LLSD&) { onCommitMaterialShinyOffsetY(); });
+
+ getChildSetCommitCallback(mGlossiness, "glossiness", [&](LLUICtrl*, const LLSD&) { onCommitMaterialGloss(); });
+ getChildSetCommitCallback(mEnvironment, "environment", [&](LLUICtrl*, const LLSD&) { onCommitMaterialEnv(); });
+ getChildSetCommitCallback(mMaskCutoff, "maskcutoff", [&](LLUICtrl*, const LLSD&) { onCommitMaterialMaskCutoff(); });
+ getChildSetCommitCallback(mAddMedia, "add_media", [&](LLUICtrl*, const LLSD&) { onClickBtnAddMedia(); });
+ getChildSetCommitCallback(mDelMedia, "delete_media", [&](LLUICtrl*, const LLSD&) { onClickBtnDeleteMedia(); });
+
+ getChildSetCommitCallback(mPBRScaleU, "gltfTextureScaleU", [&](LLUICtrl*, const LLSD&) { onCommitGLTFTextureScaleU(); });
+ getChildSetCommitCallback(mPBRScaleV, "gltfTextureScaleV", [&](LLUICtrl*, const LLSD&) { onCommitGLTFTextureScaleV(); });
+ getChildSetCommitCallback(mPBRRotate, "gltfTextureRotation", [&](LLUICtrl*, const LLSD&) { onCommitGLTFRotation(); });
+ getChildSetCommitCallback(mPBROffsetU, "gltfTextureOffsetU", [&](LLUICtrl*, const LLSD&) { onCommitGLTFTextureOffsetU(); });
+ getChildSetCommitCallback(mPBROffsetV, "gltfTextureOffsetV", [&](LLUICtrl*, const LLSD&) { onCommitGLTFTextureOffsetV(); });
LLGLTFMaterialList::addSelectionUpdateCallback(&LLPanelFace::onMaterialOverrideReceived);
sMaterialOverrideSelection.connect();
- childSetAction("button align",&LLPanelFace::onClickAutoFix,this);
- childSetAction("button align textures", &LLPanelFace::onAlignTexture, this);
- childSetAction("pbr_from_inventory", &LLPanelFace::onClickBtnLoadInvPBR, this);
- childSetAction("edit_selected_pbr", &LLPanelFace::onClickBtnEditPBR, this);
- childSetAction("save_selected_pbr", &LLPanelFace::onClickBtnSavePBR, this);
+ getChildSetClickedCallback(mBtnAlign, "button align", [&](LLUICtrl*, const LLSD&) { onClickAutoFix(); });
+ getChildSetClickedCallback(mBtnAlignTex, "button align textures", [&](LLUICtrl*, const LLSD&) { onAlignTexture(); });
+ getChildSetClickedCallback(mBtnPbrFromInv, "pbr_from_inventory", [&](LLUICtrl*, const LLSD&) { onClickBtnLoadInvPBR(); });
+ getChildSetClickedCallback(mBtnEditBbr, "edit_selected_pbr", [&](LLUICtrl*, const LLSD&) { onClickBtnEditPBR(); });
+ getChildSetClickedCallback(mBtnSaveBbr, "save_selected_pbr", [&](LLUICtrl*, const LLSD&) { onClickBtnSavePBR(); });
setMouseOpaque(false);
mPBRTextureCtrl = getChild<LLTextureCtrl>("pbr_control");
- if (mPBRTextureCtrl)
- {
- mPBRTextureCtrl->setDefaultImageAssetID(LLUUID::null);
- mPBRTextureCtrl->setBlankImageAssetID(BLANK_MATERIAL_ASSET_ID);
- mPBRTextureCtrl->setCommitCallback(boost::bind(&LLPanelFace::onCommitPbr, this, _2));
- mPBRTextureCtrl->setOnCancelCallback(boost::bind(&LLPanelFace::onCancelPbr, this, _2));
- mPBRTextureCtrl->setOnSelectCallback(boost::bind(&LLPanelFace::onSelectPbr, this, _2));
- mPBRTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragPbr, this, _2));
- mPBRTextureCtrl->setOnTextureSelectedCallback(boost::bind(&LLPanelFace::onPbrSelectionChanged, this, _1));
- mPBRTextureCtrl->setOnCloseCallback(boost::bind(&LLPanelFace::onCloseTexturePicker, this, _2));
-
- mPBRTextureCtrl->setFollowsTop();
- mPBRTextureCtrl->setFollowsLeft();
- mPBRTextureCtrl->setImmediateFilterPermMask(PERM_NONE);
- mPBRTextureCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER);
- mPBRTextureCtrl->setBakeTextureEnabled(false);
- mPBRTextureCtrl->setInventoryPickType(PICK_MATERIAL);
- }
+ mPBRTextureCtrl->setDefaultImageAssetID(LLUUID::null);
+ mPBRTextureCtrl->setBlankImageAssetID(BLANK_MATERIAL_ASSET_ID);
+ mPBRTextureCtrl->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitPbr(); });
+ mPBRTextureCtrl->setOnCancelCallback([&](LLUICtrl*, const LLSD&) { onCancelPbr(); });
+ mPBRTextureCtrl->setOnSelectCallback([&](LLUICtrl*, const LLSD&) { onSelectPbr(); });
+ mPBRTextureCtrl->setDragCallback([&](LLUICtrl*, LLInventoryItem* item) { return onDragPbr(item); });
+ mPBRTextureCtrl->setOnTextureSelectedCallback([&](LLInventoryItem* item) { onPbrSelectionChanged(item); });
+ mPBRTextureCtrl->setOnCloseCallback([&](LLUICtrl*, const LLSD& data) { onCloseTexturePicker(data); });
+ mPBRTextureCtrl->setFollowsTop();
+ mPBRTextureCtrl->setFollowsLeft();
+ mPBRTextureCtrl->setImmediateFilterPermMask(PERM_NONE);
+ mPBRTextureCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER);
+ mPBRTextureCtrl->setBakeTextureEnabled(false);
+ mPBRTextureCtrl->setInventoryPickType(PICK_MATERIAL);
mTextureCtrl = getChild<LLTextureCtrl>("texture control");
- if(mTextureCtrl)
- {
- mTextureCtrl->setDefaultImageAssetID(DEFAULT_OBJECT_TEXTURE);
- mTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitTexture, this, _2) );
- mTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelTexture, this, _2) );
- mTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectTexture, this, _2) );
- mTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragTexture, this, _2));
- mTextureCtrl->setOnTextureSelectedCallback(boost::bind(&LLPanelFace::onTextureSelectionChanged, this, _1));
- mTextureCtrl->setOnCloseCallback( boost::bind(&LLPanelFace::onCloseTexturePicker, this, _2) );
-
- mTextureCtrl->setFollowsTop();
- mTextureCtrl->setFollowsLeft();
- mTextureCtrl->setImmediateFilterPermMask(PERM_NONE);
- mTextureCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER);
- }
+ mTextureCtrl->setDefaultImageAssetID(DEFAULT_OBJECT_TEXTURE);
+ mTextureCtrl->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitTexture(); });
+ mTextureCtrl->setOnCancelCallback([&](LLUICtrl*, const LLSD&) { onCancelTexture(); });
+ mTextureCtrl->setOnSelectCallback([&](LLUICtrl*, const LLSD&) { onSelectTexture(); });
+ mTextureCtrl->setDragCallback([&](LLUICtrl*, LLInventoryItem* item) { return onDragTexture(item); });
+ mTextureCtrl->setOnTextureSelectedCallback([&](LLInventoryItem* item) { onTextureSelectionChanged(item); });
+ mTextureCtrl->setOnCloseCallback([&](LLUICtrl*, const LLSD& data) { onCloseTexturePicker(data); });
+ mTextureCtrl->setFollowsTop();
+ mTextureCtrl->setFollowsLeft();
+ mTextureCtrl->setImmediateFilterPermMask(PERM_NONE);
+ mTextureCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER);
mShinyTextureCtrl = getChild<LLTextureCtrl>("shinytexture control");
- if(mShinyTextureCtrl)
- {
- mShinyTextureCtrl->setDefaultImageAssetID(DEFAULT_OBJECT_SPECULAR);
- mShinyTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitSpecularTexture, this, _2) );
- mShinyTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelSpecularTexture, this, _2) );
- mShinyTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectSpecularTexture, this, _2) );
- mShinyTextureCtrl->setOnCloseCallback( boost::bind(&LLPanelFace::onCloseTexturePicker, this, _2) );
-
- mShinyTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragTexture, this, _2));
- mShinyTextureCtrl->setOnTextureSelectedCallback(boost::bind(&LLPanelFace::onTextureSelectionChanged, this, _1));
- mShinyTextureCtrl->setFollowsTop();
- mShinyTextureCtrl->setFollowsLeft();
- mShinyTextureCtrl->setImmediateFilterPermMask(PERM_NONE);
- mShinyTextureCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER);
- }
+ mShinyTextureCtrl->setDefaultImageAssetID(DEFAULT_OBJECT_SPECULAR);
+ mShinyTextureCtrl->setCommitCallback([&](LLUICtrl*, const LLSD& data) { onCommitSpecularTexture(data); });
+ mShinyTextureCtrl->setOnCancelCallback([&](LLUICtrl*, const LLSD& data) { onCancelSpecularTexture(data); });
+ mShinyTextureCtrl->setOnSelectCallback([&](LLUICtrl*, const LLSD& data) { onSelectSpecularTexture(data); });
+ mShinyTextureCtrl->setDragCallback([&](LLUICtrl*, LLInventoryItem* item) { return onDragTexture(item); });
+ mShinyTextureCtrl->setOnTextureSelectedCallback([&](LLInventoryItem* item) { onTextureSelectionChanged(item); });
+ mShinyTextureCtrl->setOnCloseCallback([&](LLUICtrl*, const LLSD& data) { onCloseTexturePicker(data); });
+ mShinyTextureCtrl->setFollowsTop();
+ mShinyTextureCtrl->setFollowsLeft();
+ mShinyTextureCtrl->setImmediateFilterPermMask(PERM_NONE);
+ mShinyTextureCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER);
mBumpyTextureCtrl = getChild<LLTextureCtrl>("bumpytexture control");
- if(mBumpyTextureCtrl)
- {
- mBumpyTextureCtrl->setDefaultImageAssetID(DEFAULT_OBJECT_NORMAL);
- mBumpyTextureCtrl->setBlankImageAssetID(BLANK_OBJECT_NORMAL);
- mBumpyTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitNormalTexture, this, _2) );
- mBumpyTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelNormalTexture, this, _2) );
- mBumpyTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectNormalTexture, this, _2) );
- mBumpyTextureCtrl->setOnCloseCallback( boost::bind(&LLPanelFace::onCloseTexturePicker, this, _2) );
-
- mBumpyTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragTexture, this, _2));
- mBumpyTextureCtrl->setOnTextureSelectedCallback(boost::bind(&LLPanelFace::onTextureSelectionChanged, this, _1));
- mBumpyTextureCtrl->setFollowsTop();
- mBumpyTextureCtrl->setFollowsLeft();
- mBumpyTextureCtrl->setImmediateFilterPermMask(PERM_NONE);
- mBumpyTextureCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER);
- }
+ mBumpyTextureCtrl->setDefaultImageAssetID(DEFAULT_OBJECT_NORMAL);
+ mBumpyTextureCtrl->setBlankImageAssetID(BLANK_OBJECT_NORMAL);
+ mBumpyTextureCtrl->setCommitCallback([&](LLUICtrl*, const LLSD& data) { onCommitNormalTexture(data); });
+ mBumpyTextureCtrl->setOnCancelCallback([&](LLUICtrl*, const LLSD& data) { onCancelNormalTexture(data); });
+ mBumpyTextureCtrl->setOnSelectCallback([&](LLUICtrl*, const LLSD& data) { onSelectNormalTexture(data); });
+ mBumpyTextureCtrl->setDragCallback([&](LLUICtrl*, LLInventoryItem* item) { return onDragTexture(item); });
+ mBumpyTextureCtrl->setOnTextureSelectedCallback([&](LLInventoryItem* item) { onTextureSelectionChanged(item); });
+ mBumpyTextureCtrl->setOnCloseCallback([&](LLUICtrl*, const LLSD& data) { onCloseTexturePicker(data); });
+ mBumpyTextureCtrl->setFollowsTop();
+ mBumpyTextureCtrl->setFollowsLeft();
+ mBumpyTextureCtrl->setImmediateFilterPermMask(PERM_NONE);
+ mBumpyTextureCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER);
mColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
- if(mColorSwatch)
- {
- mColorSwatch->setCommitCallback(boost::bind(&LLPanelFace::onCommitColor, this, _2));
- mColorSwatch->setOnCancelCallback(boost::bind(&LLPanelFace::onCancelColor, this, _2));
- mColorSwatch->setOnSelectCallback(boost::bind(&LLPanelFace::onSelectColor, this, _2));
- mColorSwatch->setFollowsTop();
- mColorSwatch->setFollowsLeft();
- mColorSwatch->setCanApplyImmediately(true);
- }
+ mColorSwatch->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitColor(); });
+ mColorSwatch->setOnCancelCallback([&](LLUICtrl*, const LLSD&) { onCancelColor(); });
+ mColorSwatch->setOnSelectCallback([&](LLUICtrl*, const LLSD&) { onSelectColor(); });
+ mColorSwatch->setFollowsTop();
+ mColorSwatch->setFollowsLeft();
+ mColorSwatch->setCanApplyImmediately(true);
mShinyColorSwatch = getChild<LLColorSwatchCtrl>("shinycolorswatch");
- if(mShinyColorSwatch)
- {
- mShinyColorSwatch->setCommitCallback(boost::bind(&LLPanelFace::onCommitShinyColor, this, _2));
- mShinyColorSwatch->setOnCancelCallback(boost::bind(&LLPanelFace::onCancelShinyColor, this, _2));
- mShinyColorSwatch->setOnSelectCallback(boost::bind(&LLPanelFace::onSelectShinyColor, this, _2));
- mShinyColorSwatch->setFollowsTop();
- mShinyColorSwatch->setFollowsLeft();
- mShinyColorSwatch->setCanApplyImmediately(true);
- }
+ mShinyColorSwatch->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitShinyColor(); });
+ mShinyColorSwatch->setOnCancelCallback([&](LLUICtrl*, const LLSD&) { onCancelShinyColor(); });
+ mShinyColorSwatch->setOnSelectCallback([&](LLUICtrl*, const LLSD&) { onSelectShinyColor(); });
+ mShinyColorSwatch->setFollowsTop();
+ mShinyColorSwatch->setFollowsLeft();
+ mShinyColorSwatch->setCanApplyImmediately(true);
mLabelColorTransp = getChild<LLTextBox>("color trans");
- if(mLabelColorTransp)
- {
- mLabelColorTransp->setFollowsTop();
- mLabelColorTransp->setFollowsLeft();
- }
+ mLabelColorTransp->setFollowsTop();
+ mLabelColorTransp->setFollowsLeft();
mCtrlColorTransp = getChild<LLSpinCtrl>("ColorTrans");
- if(mCtrlColorTransp)
- {
- mCtrlColorTransp->setCommitCallback(boost::bind(&LLPanelFace::onCommitAlpha, this, _2));
- mCtrlColorTransp->setPrecision(0);
- mCtrlColorTransp->setFollowsTop();
- mCtrlColorTransp->setFollowsLeft();
- }
+ mCtrlColorTransp->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitAlpha(); });
+ mCtrlColorTransp->setPrecision(0);
+ mCtrlColorTransp->setFollowsTop();
+ mCtrlColorTransp->setFollowsLeft();
- mCheckFullbright = getChild<LLCheckBoxCtrl>("checkbox fullbright");
- if (mCheckFullbright)
- {
- mCheckFullbright->setCommitCallback(LLPanelFace::onCommitFullbright, this);
- }
+ getChildSetCommitCallback(mCheckFullbright, "checkbox fullbright", [&](LLUICtrl*, const LLSD&) { onCommitFullbright(); });
- mComboTexGen = getChild<LLComboBox>("combobox texgen");
- if(mComboTexGen)
- {
- mComboTexGen->setCommitCallback(LLPanelFace::onCommitTexGen, this);
- mComboTexGen->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP);
- }
+ mLabelTexGen = getChild<LLTextBox>("tex gen");
+ getChildSetCommitCallback(mComboTexGen, "combobox texgen", [&](LLUICtrl*, const LLSD&) { onCommitTexGen(); });
+ mComboTexGen->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP);
- mComboMatMedia = getChild<LLComboBox>("combobox matmedia");
- if(mComboMatMedia)
- {
- mComboMatMedia->setCommitCallback(LLPanelFace::onCommitMaterialsMedia,this);
- mComboMatMedia->selectNthItem(MATMEDIA_MATERIAL);
- }
+ getChildSetCommitCallback(mComboMatMedia, "combobox matmedia", [&](LLUICtrl*, const LLSD&) { onCommitMaterialsMedia(); });
+ mComboMatMedia->selectNthItem(MATMEDIA_MATERIAL);
- mRadioMaterialType = getChild<LLRadioGroup>("radio_material_type");
- if(mRadioMaterialType)
- {
- mRadioMaterialType->setCommitCallback(LLPanelFace::onCommitMaterialType, this);
- mRadioMaterialType->selectNthItem(MATTYPE_DIFFUSE);
- }
+ getChildSetCommitCallback(mRadioMaterialType, "radio_material_type", [&](LLUICtrl*, const LLSD&) { onCommitMaterialType(); });
+ mRadioMaterialType->selectNthItem(MATTYPE_DIFFUSE);
- mRadioPbrType = getChild<LLRadioGroup>("radio_pbr_type");
- if (mRadioPbrType)
- {
- mRadioPbrType->setCommitCallback(LLPanelFace::onCommitPbrType, this);
- mRadioPbrType->selectNthItem(PBRTYPE_RENDER_MATERIAL_ID);
- }
+ getChildSetCommitCallback(mRadioPbrType, "radio_pbr_type", [&](LLUICtrl*, const LLSD&) { onCommitPbrType(); });
+ mRadioPbrType->selectNthItem(PBRTYPE_RENDER_MATERIAL_ID);
- mCtrlGlow = getChild<LLSpinCtrl>("glow");
- if(mCtrlGlow)
- {
- mCtrlGlow->setCommitCallback(LLPanelFace::onCommitGlow, this);
- }
+ mLabelGlow = getChild<LLTextBox>("glow label");
+ getChildSetCommitCallback(mCtrlGlow, "glow", [&](LLUICtrl*, const LLSD&) { onCommitGlow(); });
mMenuClipboardColor = getChild<LLMenuButton>("clipboard_color_params_btn");
mMenuClipboardTexture = getChild<LLMenuButton>("clipboard_texture_params_btn");
@@ -461,6 +443,19 @@ bool LLPanelFace::postBuild()
mTitleMedia = getChild<LLMediaCtrl>("title_media");
mTitleMediaText = getChild<LLTextBox>("media_info");
+ mLabelBumpiness = getChild<LLTextBox>("label bumpiness");
+ mLabelShininess = getChild<LLTextBox>("label shininess");
+ mLabelAlphaMode = getChild<LLTextBox>("label alphamode");
+ mLabelGlossiness = getChild<LLTextBox>("label glossiness");
+ mLabelEnvironment = getChild<LLTextBox>("label environment");
+ mLabelMaskCutoff = getChild<LLTextBox>("label maskcutoff");
+ mLabelShiniColor = getChild<LLTextBox>("label shinycolor");
+ mLabelColor = getChild<LLTextBox>("color label");
+
+ mLabelMatPermLoading = getChild<LLTextBox>("material_permissions_loading_label");
+
+ mCheckSyncSettings = getChild<LLCheckBoxCtrl>("checkbox_sync_settings");
+
clearCtrls();
return true;
@@ -513,8 +508,7 @@ void LLPanelFace::draw()
void LLPanelFace::sendTexture()
{
- if(!mTextureCtrl) return;
- if( !mTextureCtrl->getTentative() )
+ if (!mTextureCtrl->getTentative())
{
// we grab the item id first, because we want to do a
// permissions check in the selection manager. ARGH!
@@ -534,7 +528,7 @@ void LLPanelFace::sendTexture()
void LLPanelFace::sendBump(U32 bumpiness)
{
if (bumpiness < BUMPY_TEXTURE)
-{
+ {
LL_DEBUGS("Materials") << "clearing bumptexture control" << LL_ENDL;
mBumpyTextureCtrl->clear();
mBumpyTextureCtrl->setImageAssetID(LLUUID());
@@ -544,12 +538,13 @@ void LLPanelFace::sendBump(U32 bumpiness)
LLUUID current_normal_map = mBumpyTextureCtrl->getImageAssetID();
- U8 bump = (U8) bumpiness & TEM_BUMP_MASK;
+ U8 bump = (U8)bumpiness & TEM_BUMP_MASK;
// Clear legacy bump to None when using an actual normal map
- //
if (!current_normal_map.isNull())
+ {
bump = 0;
+ }
// Set the normal map or reset it to null as appropriate
//
@@ -560,14 +555,14 @@ void LLPanelFace::sendBump(U32 bumpiness)
void LLPanelFace::sendTexGen()
{
- U8 tex_gen = (U8) mComboTexGen->getCurrentIndex() << TEM_TEX_GEN_SHIFT;
- LLSelectMgr::getInstance()->selectionSetTexGen( tex_gen );
+ U8 tex_gen = (U8)mComboTexGen->getCurrentIndex() << TEM_TEX_GEN_SHIFT;
+ LLSelectMgr::getInstance()->selectionSetTexGen(tex_gen);
}
void LLPanelFace::sendShiny(U32 shininess)
{
if (shininess < SHINY_TEXTURE)
-{
+ {
mShinyTextureCtrl->clear();
mShinyTextureCtrl->setImageAssetID(LLUUID());
}
@@ -576,47 +571,39 @@ void LLPanelFace::sendShiny(U32 shininess)
U8 shiny = (U8) shininess & TEM_SHINY_MASK;
if (!specmap.isNull())
+ {
shiny = 0;
+ }
LLSelectedTEMaterial::setSpecularID(this, specmap);
- LLSelectMgr::getInstance()->selectionSetShiny( shiny, mShinyTextureCtrl->getImageItemID() );
+ LLSelectMgr::getInstance()->selectionSetShiny(shiny, mShinyTextureCtrl->getImageItemID());
updateShinyControls(!specmap.isNull(), true);
-
}
void LLPanelFace::sendFullbright()
{
- if(!mCheckFullbright)return;
U8 fullbright = mCheckFullbright->get() ? TEM_FULLBRIGHT_MASK : 0;
- LLSelectMgr::getInstance()->selectionSetFullbright( fullbright );
+ LLSelectMgr::getInstance()->selectionSetFullbright(fullbright);
}
void LLPanelFace::sendColor()
{
- if(!mColorSwatch)return;
LLColor4 color = mColorSwatch->get();
-
- LLSelectMgr::getInstance()->selectionSetColorOnly( color );
+ LLSelectMgr::getInstance()->selectionSetColorOnly(color);
}
void LLPanelFace::sendAlpha()
{
- if(!mCtrlColorTransp)return;
F32 alpha = (100.f - mCtrlColorTransp->get()) / 100.f;
-
LLSelectMgr::getInstance()->selectionSetAlphaOnly( alpha );
}
-
void LLPanelFace::sendGlow()
{
- if (mCtrlGlow)
- {
- F32 glow = mCtrlGlow->get();
- LLSelectMgr::getInstance()->selectionSetGlow( glow );
- }
+ F32 glow = mCtrlGlow->get();
+ LLSelectMgr::getInstance()->selectionSetGlow(glow);
}
struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
@@ -624,47 +611,49 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
LLPanelFaceSetTEFunctor(LLPanelFace* panel) : mPanel(panel) {}
virtual bool apply(LLViewerObject* object, S32 te)
{
- bool valid;
- F32 value;
- std::string prefix;
+ LLSpinCtrl *ctrlTexScaleS, *ctrlTexScaleT, *ctrlTexOffsetS, *ctrlTexOffsetT, *ctrlTexRotation;
// Effectively the same as MATMEDIA_PBR sans using different radio,
// separate for the sake of clarity
- LLRadioGroup * radio_mat_type = mPanel->getChild<LLRadioGroup>("radio_material_type");
- switch (radio_mat_type->getSelectedIndex())
+ switch (mPanel->mRadioMaterialType->getSelectedIndex())
{
case MATTYPE_DIFFUSE:
- prefix = "Tex";
+ ctrlTexScaleS = mPanel->mTexScaleU;
+ ctrlTexScaleT = mPanel->mTexScaleV;
+ ctrlTexOffsetS = mPanel->mTexOffsetU;
+ ctrlTexOffsetT = mPanel->mTexOffsetV;
+ ctrlTexRotation = mPanel->mTexRotate;
break;
case MATTYPE_NORMAL:
- prefix = "bumpy";
+ ctrlTexScaleS = mPanel->mBumpyScaleU;
+ ctrlTexScaleT = mPanel->mBumpyScaleV;
+ ctrlTexOffsetS = mPanel->mBumpyOffsetU;
+ ctrlTexOffsetT = mPanel->mBumpyOffsetV;
+ ctrlTexRotation = mPanel->mBumpyRotate;
break;
case MATTYPE_SPECULAR:
- prefix = "shiny";
+ ctrlTexScaleS = mPanel->mShinyScaleU;
+ ctrlTexScaleT = mPanel->mShinyScaleV;
+ ctrlTexOffsetS = mPanel->mShinyOffsetU;
+ ctrlTexOffsetT = mPanel->mShinyOffsetV;
+ ctrlTexRotation = mPanel->mShinyRotate;
break;
+ default:
+ llassert(false);
+ return false;
}
- LLSpinCtrl * ctrlTexScaleS = mPanel->getChild<LLSpinCtrl>(prefix + "ScaleU");
- LLSpinCtrl * ctrlTexScaleT = mPanel->getChild<LLSpinCtrl>(prefix + "ScaleV");
- LLSpinCtrl * ctrlTexOffsetS = mPanel->getChild<LLSpinCtrl>(prefix + "OffsetU");
- LLSpinCtrl * ctrlTexOffsetT = mPanel->getChild<LLSpinCtrl>(prefix + "OffsetV");
- LLSpinCtrl * ctrlTexRotation = mPanel->getChild<LLSpinCtrl>(prefix + "Rot");
+ bool align_planar = mPanel->mPlanarAlign->get();
- LLComboBox* comboTexGen = mPanel->getChild<LLComboBox>("combobox texgen");
- LLCheckBoxCtrl* cb_planar_align = mPanel->getChild<LLCheckBoxCtrl>("checkbox planar align");
- bool align_planar = (cb_planar_align && cb_planar_align->get());
-
- llassert(comboTexGen);
llassert(object);
if (ctrlTexScaleS)
{
- valid = !ctrlTexScaleS->getTentative(); // || !checkFlipScaleS->getTentative();
+ bool valid = !ctrlTexScaleS->getTentative(); // || !checkFlipScaleS->getTentative();
if (valid || align_planar)
{
- value = ctrlTexScaleS->get();
- if (comboTexGen &&
- comboTexGen->getCurrentIndex() == 1)
+ F32 value = ctrlTexScaleS->get();
+ if (mPanel->mComboTexGen->getCurrentIndex() == 1)
{
value *= 0.5f;
}
@@ -680,20 +669,19 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
if (ctrlTexScaleT)
{
- valid = !ctrlTexScaleT->getTentative(); // || !checkFlipScaleT->getTentative();
+ bool valid = !ctrlTexScaleT->getTentative(); // || !checkFlipScaleT->getTentative();
if (valid || align_planar)
{
- value = ctrlTexScaleT->get();
- //if( checkFlipScaleT->get() )
+ F32 value = ctrlTexScaleT->get();
+ //if (checkFlipScaleT->get())
//{
// value = -value;
//}
- if (comboTexGen &&
- comboTexGen->getCurrentIndex() == 1)
+ if (mPanel->mComboTexGen->getCurrentIndex() == 1)
{
value *= 0.5f;
}
- object->setTEScaleT( te, value );
+ object->setTEScaleT(te, value);
if (align_planar)
{
@@ -705,11 +693,11 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
if (ctrlTexOffsetS)
{
- valid = !ctrlTexOffsetS->getTentative();
+ bool valid = !ctrlTexOffsetS->getTentative();
if (valid || align_planar)
{
- value = ctrlTexOffsetS->get();
- object->setTEOffsetS( te, value );
+ F32 value = ctrlTexOffsetS->get();
+ object->setTEOffsetS(te, value);
if (align_planar)
{
@@ -721,11 +709,11 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
if (ctrlTexOffsetT)
{
- valid = !ctrlTexOffsetT->getTentative();
+ bool valid = !ctrlTexOffsetT->getTentative();
if (valid || align_planar)
{
- value = ctrlTexOffsetT->get();
- object->setTEOffsetT( te, value );
+ F32 value = ctrlTexOffsetT->get();
+ object->setTEOffsetT(te, value);
if (align_planar)
{
@@ -737,11 +725,11 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
if (ctrlTexRotation)
{
- valid = !ctrlTexRotation->getTentative();
+ bool valid = !ctrlTexRotation->getTentative();
if (valid || align_planar)
{
- value = ctrlTexRotation->get() * DEG_TO_RAD;
- object->setTERotation( te, value );
+ F32 value = ctrlTexRotation->get() * DEG_TO_RAD;
+ object->setTERotation(te, value);
if (align_planar)
{
@@ -750,6 +738,7 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
}
}
}
+
return true;
}
private:
@@ -906,7 +895,7 @@ struct LLPanelFaceGetIsAlignedTEFunctor : public LLSelectedTEFunctor
LLVector2 aligned_st_offset, aligned_st_scale;
F32 aligned_st_rot;
- if ( facep->calcAlignedPlanarTE(mCenterFace, &aligned_st_offset, &aligned_st_scale, &aligned_st_rot) )
+ if (facep->calcAlignedPlanarTE(mCenterFace, &aligned_st_offset, &aligned_st_scale, &aligned_st_rot))
{
const LLTextureEntry* tep = facep->getTextureEntry();
LLVector2 st_offset, st_scale;
@@ -947,7 +936,7 @@ struct LLPanelFaceSendFunctor : public LLSelectedObjectFunctor
void LLPanelFace::sendTextureInfo()
{
- if ((bool)childGetValue("checkbox planar align").asBoolean())
+ if (mPlanarAlign->getValue().asBoolean())
{
LLFace* last_face = NULL;
bool identical_face =false;
@@ -999,7 +988,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
const bool has_material = !has_pbr_material;
// only turn on auto-adjust button if there is a media renderer and the media is loaded
- childSetEnabled("button align", editable);
+ mBtnAlign->setEnabled(editable);
if (mComboMatMedia->getCurrentIndex() < MATMEDIA_MATERIAL)
{
@@ -1100,30 +1089,23 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
const bool pbr_selected = mComboMatMedia->getCurrentIndex() == MATMEDIA_PBR;
const bool texture_info_selected = pbr_selected && mRadioPbrType->getSelectedIndex() != PBRTYPE_RENDER_MATERIAL_ID;
- getChildView("checkbox_sync_settings")->setEnabled(editable);
- childSetValue("checkbox_sync_settings", gSavedSettings.getBOOL("SyncMaterialSettings"));
+ mCheckSyncSettings->setEnabled(editable);
+ mCheckSyncSettings->setValue(gSavedSettings.getBOOL("SyncMaterialSettings"));
updateVisibility(objectp);
// Color swatch
- {
- getChildView("color label")->setEnabled(editable);
- }
-
+ mLabelColor->setEnabled(editable);
LLColor4 color = LLColor4::white;
bool identical_color = false;
- {
- LLSelectedTE::getColor(color, identical_color);
- LLColor4 prev_color = mColorSwatch->get();
-
- mColorSwatch->setOriginal(color);
- mColorSwatch->set(color, force_set_values || (prev_color != color) || !editable);
-
- mColorSwatch->setValid(editable && !has_pbr_material);
- mColorSwatch->setEnabled( editable && !has_pbr_material);
- mColorSwatch->setCanApplyImmediately( editable && !has_pbr_material);
- }
+ LLSelectedTE::getColor(color, identical_color);
+ LLColor4 prev_color = mColorSwatch->get();
+ mColorSwatch->setOriginal(color);
+ mColorSwatch->set(color, force_set_values || (prev_color != color) || !editable);
+ mColorSwatch->setValid(editable && !has_pbr_material);
+ mColorSwatch->setEnabled( editable && !has_pbr_material);
+ mColorSwatch->setCanApplyImmediately( editable && !has_pbr_material);
// Color transparency
mLabelColorTransp->setEnabled(editable);
@@ -1132,65 +1114,51 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
mCtrlColorTransp->setValue(editable ? transparency : 0);
mCtrlColorTransp->setEnabled(editable && has_material);
+ // Shiny
U8 shiny = 0;
- bool identical_shiny = false;
+ {
+ bool identical_shiny = false;
- // Shiny
- LLSelectedTE::getShiny(shiny, identical_shiny);
- identical = identical && identical_shiny;
+ LLSelectedTE::getShiny(shiny, identical_shiny);
+ identical = identical && identical_shiny;
- shiny = specmap_id.isNull() ? shiny : SHINY_TEXTURE;
+ shiny = specmap_id.isNull() ? shiny : SHINY_TEXTURE;
- LLCtrlSelectionInterface* combobox_shininess = childGetSelectionInterface("combobox shininess");
- if (combobox_shininess)
- {
- combobox_shininess->selectNthItem((S32)shiny);
- }
+ mComboShininess->getSelectionInterface()->selectNthItem((S32)shiny);
- getChildView("label shininess")->setEnabled(editable);
- getChildView("combobox shininess")->setEnabled(editable);
+ mLabelShininess->setEnabled(editable);
+ mComboShininess->setEnabled(editable);
- getChildView("label glossiness")->setEnabled(editable);
- getChildView("glossiness")->setEnabled(editable);
+ mLabelGlossiness->setEnabled(editable);
+ mGlossiness->setEnabled(editable);
- getChildView("label environment")->setEnabled(editable);
- getChildView("environment")->setEnabled(editable);
- getChildView("label shinycolor")->setEnabled(editable);
+ mLabelEnvironment->setEnabled(editable);
+ mEnvironment->setEnabled(editable);
+ mLabelShiniColor->setEnabled(editable);
- getChild<LLUICtrl>("combobox shininess")->setTentative(!identical_spec);
- getChild<LLUICtrl>("glossiness")->setTentative(!identical_spec);
- getChild<LLUICtrl>("environment")->setTentative(!identical_spec);
- mShinyColorSwatch->setTentative(!identical_spec);
+ mComboShininess->setTentative(!identical_spec);
+ mGlossiness->setTentative(!identical_spec);
+ mEnvironment->setTentative(!identical_spec);
+ mShinyColorSwatch->setTentative(!identical_spec);
- {
mShinyColorSwatch->setValid(editable);
- mShinyColorSwatch->setEnabled( editable );
- mShinyColorSwatch->setCanApplyImmediately( editable );
+ mShinyColorSwatch->setEnabled(editable);
+ mShinyColorSwatch->setCanApplyImmediately(editable);
}
- U8 bumpy = 0;
// Bumpy
+ U8 bumpy = 0;
{
bool identical_bumpy = false;
- LLSelectedTE::getBumpmap(bumpy,identical_bumpy);
+ LLSelectedTE::getBumpmap(bumpy, identical_bumpy);
LLUUID norm_map_id = getCurrentNormalMap();
- LLCtrlSelectionInterface* combobox_bumpiness = childGetSelectionInterface("combobox bumpiness");
-
bumpy = norm_map_id.isNull() ? bumpy : BUMPY_TEXTURE;
+ mComboBumpiness->getSelectionInterface()->selectNthItem((S32)bumpy);
- if (combobox_bumpiness)
- {
- combobox_bumpiness->selectNthItem((S32)bumpy);
- }
- else
- {
- LL_WARNS() << "failed childGetSelectionInterface for 'combobox bumpiness'" << LL_ENDL;
- }
-
- getChildView("combobox bumpiness")->setEnabled(editable);
- getChild<LLUICtrl>("combobox bumpiness")->setTentative(!identical_bumpy);
- getChildView("label bumpiness")->setEnabled(editable);
+ mComboBumpiness->setEnabled(editable);
+ mComboBumpiness->setTentative(!identical_bumpy);
+ mLabelBumpiness->setEnabled(editable);
}
// Texture
@@ -1228,7 +1196,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
if (LLViewerMedia::getInstance()->textureHasMedia(id))
{
- getChildView("button align")->setEnabled(editable);
+ mBtnAlign->setEnabled(editable);
}
// Diffuse Alpha Mode
@@ -1243,22 +1211,14 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
//
LLSelectedTEMaterial::getCurrentDiffuseAlphaMode(alpha_mode, identical_alpha_mode, mIsAlpha);
- LLCtrlSelectionInterface* combobox_alphamode = childGetSelectionInterface("combobox alphamode");
- if (combobox_alphamode)
- {
- //it is invalid to have any alpha mode other than blend if transparency is greater than zero ...
- // Want masking? Want emissive? Tough! You get BLEND!
- alpha_mode = (transparency > 0.f) ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : alpha_mode;
+ // it is invalid to have any alpha mode other than blend if transparency is greater than zero ...
+ // Want masking? Want emissive? Tough! You get BLEND!
+ alpha_mode = (transparency > 0.f) ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : alpha_mode;
- // ... unless there is no alpha channel in the texture, in which case alpha mode MUST be none
- alpha_mode = mIsAlpha ? alpha_mode : LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
+ // ... unless there is no alpha channel in the texture, in which case alpha mode MUST be none
+ alpha_mode = mIsAlpha ? alpha_mode : LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
- combobox_alphamode->selectNthItem(alpha_mode);
- }
- else
- {
- LL_WARNS() << "failed childGetSelectionInterface for 'combobox alphamode'" << LL_ENDL;
- }
+ mComboAlphaMode->getSelectionInterface()->selectNthItem(alpha_mode);
updateAlphaControls();
@@ -1271,10 +1231,10 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
mTextureCtrl->setImageAssetID(id);
bool can_change_alpha = editable && mIsAlpha && !missing_asset && !has_pbr_material;
- getChildView("combobox alphamode")->setEnabled(can_change_alpha && transparency <= 0.f);
- getChildView("label alphamode")->setEnabled(can_change_alpha);
- getChildView("maskcutoff")->setEnabled(can_change_alpha);
- getChildView("label maskcutoff")->setEnabled(can_change_alpha);
+ mComboAlphaMode->setEnabled(can_change_alpha && transparency <= 0.f);
+ mLabelAlphaMode->setEnabled(can_change_alpha);
+ mMaskCutoff->setEnabled(can_change_alpha);
+ mLabelMaskCutoff->setEnabled(can_change_alpha);
mTextureCtrl->setBakeTextureEnabled(true);
}
@@ -1284,10 +1244,10 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
mTextureCtrl->setTentative(false);
mTextureCtrl->setEnabled(false);
mTextureCtrl->setImageAssetID(LLUUID::null);
- getChildView("combobox alphamode")->setEnabled(false);
- getChildView("label alphamode")->setEnabled(false);
- getChildView("maskcutoff")->setEnabled(false);
- getChildView("label maskcutoff")->setEnabled(false);
+ mComboAlphaMode->setEnabled(false);
+ mLabelAlphaMode->setEnabled(false);
+ mMaskCutoff->setEnabled(false);
+ mLabelMaskCutoff->setEnabled(false);
mTextureCtrl->setBakeTextureEnabled(false);
}
@@ -1299,10 +1259,10 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
mTextureCtrl->setImageAssetID(id);
bool can_change_alpha = editable && mIsAlpha && !missing_asset && !has_pbr_material;
- getChildView("combobox alphamode")->setEnabled(can_change_alpha && transparency <= 0.f);
- getChildView("label alphamode")->setEnabled(can_change_alpha);
- getChildView("maskcutoff")->setEnabled(can_change_alpha);
- getChildView("label maskcutoff")->setEnabled(can_change_alpha);
+ mComboAlphaMode->setEnabled(can_change_alpha && transparency <= 0.f);
+ mLabelAlphaMode->setEnabled(can_change_alpha);
+ mMaskCutoff->setEnabled(can_change_alpha);
+ mLabelMaskCutoff->setEnabled(can_change_alpha);
mTextureCtrl->setBakeTextureEnabled(true);
}
@@ -1322,9 +1282,9 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
if (mShinyTextureCtrl)
{
- mShinyTextureCtrl->setTentative( !identical_spec );
- mShinyTextureCtrl->setEnabled( editable && !has_pbr_material);
- mShinyTextureCtrl->setImageAssetID( specmap_id );
+ mShinyTextureCtrl->setTentative(!identical_spec);
+ mShinyTextureCtrl->setEnabled(editable && !has_pbr_material);
+ mShinyTextureCtrl->setImageAssetID(specmap_id);
if (attachment)
{
@@ -1338,9 +1298,9 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
if (mBumpyTextureCtrl)
{
- mBumpyTextureCtrl->setTentative( !identical_norm );
- mBumpyTextureCtrl->setEnabled( editable && !has_pbr_material);
- mBumpyTextureCtrl->setImageAssetID( normmap_id );
+ mBumpyTextureCtrl->setTentative(!identical_norm);
+ mBumpyTextureCtrl->setEnabled(editable && !has_pbr_material);
+ mBumpyTextureCtrl->setImageAssetID(normmap_id);
if (attachment)
{
@@ -1354,28 +1314,24 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
}
// planar align
- bool align_planar = false;
+ bool align_planar = mPlanarAlign->get();
bool identical_planar_aligned = false;
- {
- LLCheckBoxCtrl* cb_planar_align = getChild<LLCheckBoxCtrl>("checkbox planar align");
- align_planar = (cb_planar_align && cb_planar_align->get());
- bool enabled = (editable && isIdenticalPlanarTexgen() && !texture_info_selected);
- childSetValue("checkbox planar align", align_planar && enabled);
- childSetVisible("checkbox planar align", enabled);
- childSetEnabled("checkbox planar align", enabled);
- childSetEnabled("button align textures", enabled && LLSelectMgr::getInstance()->getSelection()->getObjectCount() > 1);
+ bool enabled = (editable && isIdenticalPlanarTexgen() && !texture_info_selected);
+ mPlanarAlign->setValue(align_planar && enabled);
+ mPlanarAlign->setVisible(enabled);
+ mPlanarAlign->setEnabled(enabled);
+ mBtnAlignTex->setEnabled(enabled && LLSelectMgr::getInstance()->getSelection()->getObjectCount() > 1);
- if (align_planar && enabled)
- {
- LLFace* last_face = NULL;
- bool identical_face = false;
- LLSelectedTE::getFace(last_face, identical_face);
+ if (align_planar && enabled)
+ {
+ LLFace* last_face = NULL;
+ bool identical_face = false;
+ LLSelectedTE::getFace(last_face, identical_face);
- LLPanelFaceGetIsAlignedTEFunctor get_is_aligend_func(last_face);
- // this will determine if the texture param controls are tentative:
- identical_planar_aligned = LLSelectMgr::getInstance()->getSelection()->applyToTEs(&get_is_aligend_func);
- }
+ LLPanelFaceGetIsAlignedTEFunctor get_is_aligend_func(last_face);
+ // this will determine if the texture param controls are tentative:
+ identical_planar_aligned = LLSelectMgr::getInstance()->getSelection()->applyToTEs(&get_is_aligend_func);
}
// Needs to be public and before tex scale settings below to properly reflect
@@ -1386,10 +1342,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
bool identical_texgen = true;
bool identical_planar_texgen = false;
- {
- LLSelectedTE::getTexGen(selected_texgen, identical_texgen);
- identical_planar_texgen = (identical_texgen && (selected_texgen == LLTextureEntry::TEX_GEN_PLANAR));
- }
+ LLSelectedTE::getTexGen(selected_texgen, identical_texgen);
+ identical_planar_texgen = (identical_texgen && (selected_texgen == LLTextureEntry::TEX_GEN_PLANAR));
// Texture scale
{
@@ -1416,21 +1370,21 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
spec_scale_s = editable ? spec_scale_s : 1.0f;
spec_scale_s *= identical_planar_texgen ? 2.0f : 1.0f;
- getChild<LLUICtrl>("TexScaleU")->setValue(diff_scale_s);
- getChild<LLUICtrl>("shinyScaleU")->setValue(spec_scale_s);
- getChild<LLUICtrl>("bumpyScaleU")->setValue(norm_scale_s);
+ mTexScaleU->setValue(diff_scale_s);
+ mShinyScaleU->setValue(spec_scale_s);
+ mBumpyScaleU->setValue(norm_scale_s);
- getChildView("TexScaleU")->setEnabled(editable && has_material);
- getChildView("shinyScaleU")->setEnabled(editable && has_material && specmap_id.notNull());
- getChildView("bumpyScaleU")->setEnabled(editable && has_material && normmap_id.notNull());
+ mTexScaleU->setEnabled(editable && has_material);
+ mShinyScaleU->setEnabled(editable && has_material && specmap_id.notNull());
+ mBumpyScaleU->setEnabled(editable && has_material && normmap_id.notNull());
bool diff_scale_tentative = !(identical && identical_diff_scale_s);
bool norm_scale_tentative = !(identical && identical_norm_scale_s);
bool spec_scale_tentative = !(identical && identical_spec_scale_s);
- getChild<LLUICtrl>("TexScaleU")->setTentative( LLSD(diff_scale_tentative));
- getChild<LLUICtrl>("shinyScaleU")->setTentative(LLSD(spec_scale_tentative));
- getChild<LLUICtrl>("bumpyScaleU")->setTentative(LLSD(norm_scale_tentative));
+ mTexScaleU->setTentative(LLSD(diff_scale_tentative));
+ mShinyScaleU->setTentative(LLSD(spec_scale_tentative));
+ mBumpyScaleU->setTentative(LLSD(norm_scale_tentative));
}
{
@@ -1459,24 +1413,24 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
bool norm_scale_tentative = !identical_norm_scale_t;
bool spec_scale_tentative = !identical_spec_scale_t;
- getChildView("TexScaleV")->setEnabled(editable && has_material);
- getChildView("shinyScaleV")->setEnabled(editable && has_material && specmap_id.notNull());
- getChildView("bumpyScaleV")->setEnabled(editable && has_material && normmap_id.notNull());
+ mTexScaleV->setEnabled(editable && has_material);
+ mShinyScaleV->setEnabled(editable && has_material && specmap_id.notNull());
+ mBumpyScaleV->setEnabled(editable && has_material && normmap_id.notNull());
if (force_set_values)
{
- getChild<LLSpinCtrl>("TexScaleV")->forceSetValue(diff_scale_t);
+ mTexScaleV->forceSetValue(diff_scale_t);
}
else
{
- getChild<LLSpinCtrl>("TexScaleV")->setValue(diff_scale_t);
+ mTexScaleV->setValue(diff_scale_t);
}
- getChild<LLUICtrl>("shinyScaleV")->setValue(norm_scale_t);
- getChild<LLUICtrl>("bumpyScaleV")->setValue(spec_scale_t);
+ mShinyScaleV->setValue(spec_scale_t);
+ mBumpyScaleV->setValue(norm_scale_t);
- getChild<LLUICtrl>("TexScaleV")->setTentative(LLSD(diff_scale_tentative));
- getChild<LLUICtrl>("shinyScaleV")->setTentative(LLSD(norm_scale_tentative));
- getChild<LLUICtrl>("bumpyScaleV")->setTentative(LLSD(spec_scale_tentative));
+ mTexScaleV->setTentative(LLSD(diff_scale_tentative));
+ mShinyScaleV->setTentative(LLSD(spec_scale_tentative));
+ mBumpyScaleV->setTentative(LLSD(norm_scale_tentative));
}
// Texture offset
@@ -1497,17 +1451,17 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
bool norm_offset_u_tentative = !(align_planar ? identical_planar_aligned : identical_norm_offset_s);
bool spec_offset_u_tentative = !(align_planar ? identical_planar_aligned : identical_spec_offset_s);
- getChild<LLUICtrl>("TexOffsetU")->setValue( editable ? diff_offset_s : 0.0f);
- getChild<LLUICtrl>("bumpyOffsetU")->setValue(editable ? norm_offset_s : 0.0f);
- getChild<LLUICtrl>("shinyOffsetU")->setValue(editable ? spec_offset_s : 0.0f);
+ mTexOffsetU->setValue(editable ? diff_offset_s : 0.0f);
+ mBumpyOffsetU->setValue(editable ? norm_offset_s : 0.0f);
+ mShinyOffsetU->setValue(editable ? spec_offset_s : 0.0f);
- getChild<LLUICtrl>("TexOffsetU")->setTentative(LLSD(diff_offset_u_tentative));
- getChild<LLUICtrl>("shinyOffsetU")->setTentative(LLSD(norm_offset_u_tentative));
- getChild<LLUICtrl>("bumpyOffsetU")->setTentative(LLSD(spec_offset_u_tentative));
+ mTexOffsetU->setTentative(LLSD(diff_offset_u_tentative));
+ mShinyOffsetU->setTentative(LLSD(spec_offset_u_tentative));
+ mBumpyOffsetU->setTentative(LLSD(norm_offset_u_tentative));
- getChildView("TexOffsetU")->setEnabled(editable && has_material);
- getChildView("shinyOffsetU")->setEnabled(editable && has_material && specmap_id.notNull());
- getChildView("bumpyOffsetU")->setEnabled(editable && has_material && normmap_id.notNull());
+ mTexOffsetU->setEnabled(editable && has_material);
+ mShinyOffsetU->setEnabled(editable && has_material && specmap_id.notNull());
+ mBumpyOffsetU->setEnabled(editable && has_material && normmap_id.notNull());
}
{
@@ -1527,17 +1481,17 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
bool norm_offset_v_tentative = !(align_planar ? identical_planar_aligned : identical_norm_offset_t);
bool spec_offset_v_tentative = !(align_planar ? identical_planar_aligned : identical_spec_offset_t);
- getChild<LLUICtrl>("TexOffsetV")->setValue( editable ? diff_offset_t : 0.0f);
- getChild<LLUICtrl>("bumpyOffsetV")->setValue(editable ? norm_offset_t : 0.0f);
- getChild<LLUICtrl>("shinyOffsetV")->setValue(editable ? spec_offset_t : 0.0f);
+ mTexOffsetV->setValue( editable ? diff_offset_t : 0.0f);
+ mBumpyOffsetV->setValue(editable ? norm_offset_t : 0.0f);
+ mShinyOffsetV->setValue(editable ? spec_offset_t : 0.0f);
- getChild<LLUICtrl>("TexOffsetV")->setTentative(LLSD(diff_offset_v_tentative));
- getChild<LLUICtrl>("shinyOffsetV")->setTentative(LLSD(norm_offset_v_tentative));
- getChild<LLUICtrl>("bumpyOffsetV")->setTentative(LLSD(spec_offset_v_tentative));
+ mTexOffsetV->setTentative(LLSD(diff_offset_v_tentative));
+ mBumpyOffsetV->setTentative(LLSD(norm_offset_v_tentative));
+ mShinyOffsetV->setTentative(LLSD(spec_offset_v_tentative));
- getChildView("TexOffsetV")->setEnabled(editable && has_material);
- getChildView("shinyOffsetV")->setEnabled(editable && has_material && specmap_id.notNull());
- getChildView("bumpyOffsetV")->setEnabled(editable && has_material && normmap_id.notNull());
+ mTexOffsetV->setEnabled(editable && has_material);
+ mShinyOffsetV->setEnabled(editable && has_material && specmap_id.notNull());
+ mBumpyOffsetV->setEnabled(editable && has_material && normmap_id.notNull());
}
// Texture rotation
@@ -1550,9 +1504,9 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
F32 norm_rotation = 0.f;
F32 spec_rotation = 0.f;
- LLSelectedTE::getRotation(diff_rotation,identical_diff_rotation);
- LLSelectedTEMaterial::getSpecularRotation(spec_rotation,identical_spec_rotation);
- LLSelectedTEMaterial::getNormalRotation(norm_rotation,identical_norm_rotation);
+ LLSelectedTE::getRotation(diff_rotation, identical_diff_rotation);
+ LLSelectedTEMaterial::getSpecularRotation(spec_rotation, identical_spec_rotation);
+ LLSelectedTEMaterial::getNormalRotation(norm_rotation, identical_norm_rotation);
bool diff_rot_tentative = !(align_planar ? identical_planar_aligned : identical_diff_rotation);
bool norm_rot_tentative = !(align_planar ? identical_planar_aligned : identical_norm_rotation);
@@ -1562,27 +1516,27 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
F32 norm_rot_deg = norm_rotation * RAD_TO_DEG;
F32 spec_rot_deg = spec_rotation * RAD_TO_DEG;
- getChildView("TexRot")->setEnabled(editable && has_material);
- getChildView("shinyRot")->setEnabled(editable && has_material && specmap_id.notNull());
- getChildView("bumpyRot")->setEnabled(editable && has_material && normmap_id.notNull());
+ mTexRotate->setEnabled(editable && has_material);
+ mShinyRotate->setEnabled(editable && has_material && specmap_id.notNull());
+ mBumpyRotate->setEnabled(editable && has_material && normmap_id.notNull());
- getChild<LLUICtrl>("TexRot")->setTentative(diff_rot_tentative);
- getChild<LLUICtrl>("shinyRot")->setTentative(LLSD(norm_rot_tentative));
- getChild<LLUICtrl>("bumpyRot")->setTentative(LLSD(spec_rot_tentative));
+ mTexRotate->setTentative(LLSD(diff_rot_tentative));
+ mShinyRotate->setTentative(LLSD(spec_rot_tentative));
+ mBumpyRotate->setTentative(LLSD(norm_rot_tentative));
- getChild<LLUICtrl>("TexRot")->setValue( editable ? diff_rot_deg : 0.0f);
- getChild<LLUICtrl>("shinyRot")->setValue(editable ? spec_rot_deg : 0.0f);
- getChild<LLUICtrl>("bumpyRot")->setValue(editable ? norm_rot_deg : 0.0f);
+ mTexRotate->setValue(editable ? diff_rot_deg : 0.0f);
+ mShinyRotate->setValue(editable ? spec_rot_deg : 0.0f);
+ mBumpyRotate->setValue(editable ? norm_rot_deg : 0.0f);
}
{
F32 glow = 0.f;
bool identical_glow = false;
- LLSelectedTE::getGlow(glow,identical_glow);
+ LLSelectedTE::getGlow(glow, identical_glow);
mCtrlGlow->setValue(glow);
mCtrlGlow->setTentative(!identical_glow);
mCtrlGlow->setEnabled(editable);
- getChildView("glow label")->setEnabled(editable);
+ mLabelGlow->setEnabled(editable);
}
{
@@ -1591,14 +1545,14 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
mComboTexGen->setEnabled(editable);
mComboTexGen->setTentative(!identical);
- getChildView("tex gen")->setEnabled(editable);
+ mLabelTexGen->setEnabled(editable);
}
{
U8 fullbright_flag = 0;
bool identical_fullbright = false;
- LLSelectedTE::getFullbright(fullbright_flag,identical_fullbright);
+ LLSelectedTE::getFullbright(fullbright_flag, identical_fullbright);
mCheckFullbright->setValue((S32)(fullbright_flag != 0));
mCheckFullbright->setEnabled(editable && !has_pbr_material);
@@ -1625,7 +1579,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
bool enabled = editable && (index != 1);
bool identical_repeats = true;
S32 material_selection = mComboMatMedia->getCurrentIndex();
- F32 repeats = 1.0f;
+ F32 repeats = 1.0f;
U32 material_type = MATTYPE_DIFFUSE;
if (material_selection == MATMEDIA_MATERIAL)
@@ -1642,53 +1596,44 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
{
default:
case MATTYPE_DIFFUSE:
- {
if (material_selection != MATMEDIA_PBR)
{
enabled = editable && !id.isNull();
}
identical_repeats = identical_diff_repeats;
repeats = repeats_diff;
- }
- break;
-
+ break;
case MATTYPE_SPECULAR:
- {
if (material_selection != MATMEDIA_PBR)
{
enabled = (editable && ((shiny == SHINY_TEXTURE) && !specmap_id.isNull()));
}
identical_repeats = identical_spec_repeats;
repeats = repeats_spec;
- }
- break;
-
+ break;
case MATTYPE_NORMAL:
- {
if (material_selection != MATMEDIA_PBR)
{
enabled = (editable && ((bumpy == BUMPY_TEXTURE) && !normmap_id.isNull()));
}
identical_repeats = identical_norm_repeats;
repeats = repeats_norm;
- }
- break;
+ break;
}
bool repeats_tentative = !identical_repeats;
- LLSpinCtrl* rpt_ctrl = getChild<LLSpinCtrl>("rptctrl");
if (force_set_values)
{
- //onCommit, previosly edited element updates related ones
- rpt_ctrl->forceSetValue(editable ? repeats : 1.0f);
+ // onCommit, previosly edited element updates related ones
+ mTexRepeat->forceSetValue(editable ? repeats : 1.0f);
}
else
{
- rpt_ctrl->setValue(editable ? repeats : 1.0f);
+ mTexRepeat->setValue(editable ? repeats : 1.0f);
}
- rpt_ctrl->setTentative(LLSD(repeats_tentative));
- rpt_ctrl->setEnabled(has_material && !identical_planar_texgen && enabled);
+ mTexRepeat->setTentative(LLSD(repeats_tentative));
+ mTexRepeat->setEnabled(has_material && !identical_planar_texgen && enabled);
}
}
@@ -1702,9 +1647,6 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
LL_DEBUGS("Materials") << material->asLLSD() << LL_ENDL;
// Alpha
- LLCtrlSelectionInterface* combobox_alphamode =
- childGetSelectionInterface("combobox alphamode");
- if (combobox_alphamode)
{
U32 alpha_mode = material->getDiffuseAlphaMode();
@@ -1718,13 +1660,10 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
}
- combobox_alphamode->selectNthItem(alpha_mode);
- }
- else
- {
- LL_WARNS() << "failed childGetSelectionInterface for 'combobox alphamode'" << LL_ENDL;
+ mComboAlphaMode->getSelectionInterface()->selectNthItem(alpha_mode);
}
- getChild<LLUICtrl>("maskcutoff")->setValue(material->getAlphaMaskCutoff());
+
+ mMaskCutoff->setValue(material->getAlphaMaskCutoff());
updateAlphaControls();
identical_planar_texgen = isIdenticalPlanarTexgen();
@@ -1735,8 +1674,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
if (!material->getSpecularID().isNull() && (shiny == SHINY_TEXTURE))
{
- material->getSpecularOffset(offset_x,offset_y);
- material->getSpecularRepeat(repeat_x,repeat_y);
+ material->getSpecularOffset(offset_x, offset_y);
+ material->getSpecularRepeat(repeat_x, repeat_y);
if (identical_planar_texgen)
{
@@ -1745,13 +1684,13 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
}
rot = material->getSpecularRotation();
- getChild<LLUICtrl>("shinyScaleU")->setValue(repeat_x);
- getChild<LLUICtrl>("shinyScaleV")->setValue(repeat_y);
- getChild<LLUICtrl>("shinyRot")->setValue(rot*RAD_TO_DEG);
- getChild<LLUICtrl>("shinyOffsetU")->setValue(offset_x);
- getChild<LLUICtrl>("shinyOffsetV")->setValue(offset_y);
- getChild<LLUICtrl>("glossiness")->setValue(material->getSpecularLightExponent());
- getChild<LLUICtrl>("environment")->setValue(material->getEnvironmentIntensity());
+ mShinyScaleU->setValue(repeat_x);
+ mShinyScaleV->setValue(repeat_y);
+ mShinyRotate->setValue(rot * RAD_TO_DEG);
+ mShinyOffsetU->setValue(offset_x);
+ mShinyOffsetV->setValue(offset_y);
+ mGlossiness->setValue(material->getSpecularLightExponent());
+ mEnvironment->setValue(material->getEnvironmentIntensity());
updateShinyControls(!material->getSpecularID().isNull(), true);
}
@@ -1783,27 +1722,28 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
}
rot = material->getNormalRotation();
- getChild<LLUICtrl>("bumpyScaleU")->setValue(repeat_x);
- getChild<LLUICtrl>("bumpyScaleV")->setValue(repeat_y);
- getChild<LLUICtrl>("bumpyRot")->setValue(rot*RAD_TO_DEG);
- getChild<LLUICtrl>("bumpyOffsetU")->setValue(offset_x);
- getChild<LLUICtrl>("bumpyOffsetV")->setValue(offset_y);
+ mBumpyScaleU->setValue(repeat_x);
+ mBumpyScaleV->setValue(repeat_y);
+ mBumpyRotate->setValue(rot*RAD_TO_DEG);
+ mBumpyOffsetU->setValue(offset_x);
+ mBumpyOffsetV->setValue(offset_y);
updateBumpyControls(!material->getNormalID().isNull(), true);
}
}
}
+
S32 selected_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
bool single_volume = (selected_count == 1);
mMenuClipboardColor->setEnabled(editable && single_volume);
// Set variable values for numeric expressions
LLCalc* calcp = LLCalc::getInstance();
- calcp->setVar(LLCalc::TEX_U_SCALE, (F32)childGetValue("TexScaleU").asReal());
- calcp->setVar(LLCalc::TEX_V_SCALE, (F32)childGetValue("TexScaleV").asReal());
- calcp->setVar(LLCalc::TEX_U_OFFSET, (F32)childGetValue("TexOffsetU").asReal());
- calcp->setVar(LLCalc::TEX_V_OFFSET, (F32)childGetValue("TexOffsetV").asReal());
- calcp->setVar(LLCalc::TEX_ROTATION, (F32)childGetValue("TexRot").asReal());
+ calcp->setVar(LLCalc::TEX_U_SCALE, (F32)mTexScaleU->getValue().asReal());
+ calcp->setVar(LLCalc::TEX_V_SCALE, (F32)mTexScaleV->getValue().asReal());
+ calcp->setVar(LLCalc::TEX_U_OFFSET, (F32)mTexOffsetU->getValue().asReal());
+ calcp->setVar(LLCalc::TEX_V_OFFSET, (F32)mTexOffsetV->getValue().asReal());
+ calcp->setVar(LLCalc::TEX_ROTATION, (F32)mTexRotate->getValue().asReal());
calcp->setVar(LLCalc::TEX_TRANSPARENCY, (F32)mCtrlColorTransp->getValue().asReal());
calcp->setVar(LLCalc::TEX_GLOW, (F32)mCtrlGlow->getValue().asReal());
}
@@ -1838,14 +1778,14 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
mRadioMaterialType->setSelectedIndex(0);
}
mLabelColorTransp->setEnabled(false);
- getChildView("rptctrl")->setEnabled(false);
- getChildView("tex gen")->setEnabled(false);
- getChildView("label shininess")->setEnabled(false);
- getChildView("label bumpiness")->setEnabled(false);
- getChildView("button align")->setEnabled(false);
- getChildView("pbr_from_inventory")->setEnabled(false);
- getChildView("edit_selected_pbr")->setEnabled(false);
- getChildView("save_selected_pbr")->setEnabled(false);
+ mTexRepeat->setEnabled(false);
+ mLabelTexGen->setEnabled(false);
+ mLabelShininess->setEnabled(false);
+ mLabelBumpiness->setEnabled(false);
+ mBtnAlign->setEnabled(false);
+ mBtnPbrFromInv->setEnabled(false);
+ mBtnEditBbr->setEnabled(false);
+ mBtnSaveBbr->setEnabled(false);
updateVisibility();
@@ -1968,9 +1908,9 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material,
}
}
- getChildView("pbr_from_inventory")->setEnabled(settable);
- getChildView("edit_selected_pbr")->setEnabled(editable && !has_faces_without_pbr);
- getChildView("save_selected_pbr")->setEnabled(saveable && identical_pbr);
+ mBtnPbrFromInv->setEnabled(settable);
+ mBtnEditBbr->setEnabled(editable && !has_faces_without_pbr);
+ mBtnSaveBbr->setEnabled(saveable && identical_pbr);
if (objectp->isInventoryPending())
{
// Reuse the same listener when possible
@@ -2000,17 +1940,11 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material,
{
const bool new_state = has_pbr_capabilities && has_pbr_material && !has_faces_without_pbr;
- LLUICtrl* gltfCtrlTextureScaleU = getChild<LLUICtrl>("gltfTextureScaleU");
- LLUICtrl* gltfCtrlTextureScaleV = getChild<LLUICtrl>("gltfTextureScaleV");
- LLUICtrl* gltfCtrlTextureRotation = getChild<LLUICtrl>("gltfTextureRotation");
- LLUICtrl* gltfCtrlTextureOffsetU = getChild<LLUICtrl>("gltfTextureOffsetU");
- LLUICtrl* gltfCtrlTextureOffsetV = getChild<LLUICtrl>("gltfTextureOffsetV");
-
- gltfCtrlTextureScaleU->setEnabled(new_state);
- gltfCtrlTextureScaleV->setEnabled(new_state);
- gltfCtrlTextureRotation->setEnabled(new_state);
- gltfCtrlTextureOffsetU->setEnabled(new_state);
- gltfCtrlTextureOffsetV->setEnabled(new_state);
+ mPBRScaleU->setEnabled(new_state);
+ mPBRScaleV->setEnabled(new_state);
+ mPBRRotate->setEnabled(new_state);
+ mPBROffsetU->setEnabled(new_state);
+ mPBROffsetV->setEnabled(new_state);
// Control values will be set once per frame in
// setMaterialOverridesFromSelection
@@ -2030,16 +1964,16 @@ void LLPanelFace::updateVisibilityGLTF(LLViewerObject* objectp /*= nullptr */)
mPBRTextureCtrl->setVisible(show_pbr_render_material_id);
- getChildView("pbr_from_inventory")->setVisible(show_pbr_render_material_id);
- getChildView("edit_selected_pbr")->setVisible(show_pbr_render_material_id && !inventory_pending);
- getChildView("save_selected_pbr")->setVisible(show_pbr_render_material_id && !inventory_pending);
- getChildView("material_permissions_loading_label")->setVisible(show_pbr_render_material_id && inventory_pending);
+ mBtnPbrFromInv->setVisible(show_pbr_render_material_id);
+ mBtnEditBbr->setVisible(show_pbr_render_material_id && !inventory_pending);
+ mBtnSaveBbr->setVisible(show_pbr_render_material_id && !inventory_pending);
+ mLabelMatPermLoading->setVisible(show_pbr_render_material_id && inventory_pending);
- getChildView("gltfTextureScaleU")->setVisible(show_pbr);
- getChildView("gltfTextureScaleV")->setVisible(show_pbr);
- getChildView("gltfTextureRotation")->setVisible(show_pbr);
- getChildView("gltfTextureOffsetU")->setVisible(show_pbr);
- getChildView("gltfTextureOffsetV")->setVisible(show_pbr);
+ mPBRScaleU->setVisible(show_pbr);
+ mPBRScaleV->setVisible(show_pbr);
+ mPBRRotate->setVisible(show_pbr);
+ mPBROffsetU->setVisible(show_pbr);
+ mPBROffsetV->setVisible(show_pbr);
}
void LLPanelFace::updateCopyTexButton()
@@ -2069,7 +2003,7 @@ void LLPanelFace::refreshMedia()
&& first_object->permModify()
))
{
- getChildView("add_media")->setEnabled(false);
+ mAddMedia->setEnabled(false);
mTitleMediaText->clear();
clearMediaSettings();
return;
@@ -2080,7 +2014,7 @@ void LLPanelFace::refreshMedia()
if (!has_media_capability)
{
- getChildView("add_media")->setEnabled(false);
+ mAddMedia->setEnabled(false);
LL_WARNS("LLFloaterToolsMedia") << "Media not enabled (no capability) in this region!" << LL_ENDL;
clearMediaSettings();
return;
@@ -2162,7 +2096,7 @@ void LLPanelFace::refreshMedia()
// update UI depending on whether "object" (prim or face) has media
// and whether or not you are allowed to edit it.
- getChildView("add_media")->setEnabled(editable);
+ mAddMedia->setEnabled(editable);
// IF all the faces have media (or all dont have media)
if (LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo)
{
@@ -2184,7 +2118,7 @@ void LLPanelFace::refreshMedia()
media_title = multi_media_info_str;
}
- getChildView("delete_media")->setEnabled(bool_has_media && editable);
+ mDelMedia->setEnabled(bool_has_media && editable);
// TODO: display a list of all media on the face - use 'identical' flag
}
else // not all face has media but at least one does.
@@ -2206,7 +2140,7 @@ void LLPanelFace::refreshMedia()
}
}
- getChildView("delete_media")->setEnabled(true);
+ mDelMedia->setEnabled(true);
}
U32 materials_media = mComboMatMedia->getCurrentIndex();
@@ -2247,7 +2181,7 @@ void LLPanelFace::onMaterialOverrideReceived(const LLUUID& object_id, S32 side)
//////////////////////////////////////////////////////////////////////////////
//
-void LLPanelFace::navigateToTitleMedia( const std::string url )
+void LLPanelFace::navigateToTitleMedia(const std::string& url)
{
std::string multi_media_info_str = LLTrans::getString("Multiple Media");
if (url.empty() || multi_media_info_str == url)
@@ -2259,9 +2193,9 @@ void LLPanelFace::navigateToTitleMedia( const std::string url )
{
LLPluginClassMedia* media_plugin = mTitleMedia->getMediaPlugin();
// check if url changed or if we need a new media source
- if (mTitleMedia->getCurrentNavUrl() != url || media_plugin == NULL)
+ if (mTitleMedia->getCurrentNavUrl() != url || media_plugin == nullptr)
{
- mTitleMedia->navigateTo( url );
+ mTitleMedia->navigateTo(url);
LLViewerMediaImpl* impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(mTitleMedia->getTextureID());
if (impl)
@@ -2814,72 +2748,63 @@ void LLPanelFace::updateMediaTitle()
};
}
-//
-// Static functions
-//
-
// static
F32 LLPanelFace::valueGlow(LLViewerObject* object, S32 face)
{
return (F32)(object->getTE(face)->getGlow());
}
-
-void LLPanelFace::onCommitColor(const LLSD& data)
+void LLPanelFace::onCommitColor()
{
sendColor();
}
-void LLPanelFace::onCommitShinyColor(const LLSD& data)
+void LLPanelFace::onCommitShinyColor()
{
LLSelectedTEMaterial::setSpecularLightColor(this, mShinyColorSwatch->get());
}
-void LLPanelFace::onCommitAlpha(const LLSD& data)
+void LLPanelFace::onCommitAlpha()
{
sendAlpha();
}
-void LLPanelFace::onCancelColor(const LLSD& data)
+void LLPanelFace::onCancelColor()
{
LLSelectMgr::getInstance()->selectionRevertColors();
}
-void LLPanelFace::onCancelShinyColor(const LLSD& data)
+void LLPanelFace::onCancelShinyColor()
{
LLSelectMgr::getInstance()->selectionRevertShinyColors();
}
-void LLPanelFace::onSelectColor(const LLSD& data)
+void LLPanelFace::onSelectColor()
{
LLSelectMgr::getInstance()->saveSelectedObjectColors();
sendColor();
}
-void LLPanelFace::onSelectShinyColor(const LLSD& data)
+void LLPanelFace::onSelectShinyColor()
{
LLSelectedTEMaterial::setSpecularLightColor(this, mShinyColorSwatch->get());
LLSelectMgr::getInstance()->saveSelectedShinyColors();
}
-// static
-void LLPanelFace::onCommitMaterialsMedia(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitMaterialsMedia()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
// Force to default states to side-step problems with menu contents
// and generally reflecting old state when switching tabs or objects
//
- self->updateShinyControls(false,true);
- self->updateBumpyControls(false,true);
- self->updateUI();
- self->refreshMedia();
+ updateShinyControls(false, true);
+ updateBumpyControls(false, true);
+ updateUI();
+ refreshMedia();
}
void LLPanelFace::updateVisibility(LLViewerObject* objectp /* = nullptr */)
{
- LLComboBox* combo_shininess = findChild<LLComboBox>("combobox shininess");
- LLComboBox* combo_bumpiness = findChild<LLComboBox>("combobox bumpiness");
- if (!mRadioMaterialType || !mRadioPbrType || !mComboMatMedia || !combo_shininess || !combo_bumpiness)
+ if (!mRadioMaterialType || !mRadioPbrType)
{
LL_WARNS("Materials") << "Combo box not found...exiting." << LL_ENDL;
return;
@@ -2892,60 +2817,59 @@ void LLPanelFace::updateVisibility(LLViewerObject* objectp /* = nullptr */)
bool show_bumpiness = show_material && (material_type == MATTYPE_NORMAL) && mComboMatMedia->getEnabled();
bool show_shininess = show_material && (material_type == MATTYPE_SPECULAR) && mComboMatMedia->getEnabled();
const bool show_pbr = mComboMatMedia->getCurrentIndex() == MATMEDIA_PBR && mComboMatMedia->getEnabled();
- const U32 pbr_type = mRadioPbrType->getSelectedIndex();
- const LLGLTFMaterial::TextureInfo texture_info = texture_info_from_pbrtype(pbr_type);
+ const LLGLTFMaterial::TextureInfo texture_info = getPBRTextureInfo();
const bool show_pbr_asset = show_pbr && texture_info == LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT;
mRadioMaterialType->setVisible(show_material);
// Shared material controls
- getChildView("checkbox_sync_settings")->setVisible(show_material || show_media);
- getChildView("tex gen")->setVisible(show_material || show_media || show_pbr_asset);
+ mCheckSyncSettings->setVisible(show_material || show_media);
+ mLabelTexGen->setVisible(show_material || show_media || show_pbr_asset);
mComboTexGen->setVisible(show_material || show_media || show_pbr_asset);
- getChildView("button align textures")->setVisible(show_material || show_media);
+ mBtnAlignTex->setVisible(show_material || show_media);
// Media controls
mTitleMediaText->setVisible(show_media);
- getChildView("add_media")->setVisible(show_media);
- getChildView("delete_media")->setVisible(show_media);
- getChildView("button align")->setVisible(show_media);
+ mAddMedia->setVisible(show_media);
+ mDelMedia->setVisible(show_media);
+ mBtnAlign->setVisible(show_media);
// Diffuse texture controls
mTextureCtrl->setVisible(show_texture && show_material);
- getChildView("label alphamode")->setVisible(show_texture && show_material);
- getChildView("combobox alphamode")->setVisible(show_texture && show_material);
- getChildView("label maskcutoff")->setVisible(false);
- getChildView("maskcutoff")->setVisible(false);
+ mLabelAlphaMode->setVisible(show_texture && show_material);
+ mComboAlphaMode->setVisible(show_texture && show_material);
+ mLabelMaskCutoff->setVisible(false);
+ mMaskCutoff->setVisible(false);
if (show_texture && show_material)
{
updateAlphaControls();
}
// texture scale and position controls
- getChildView("TexScaleU")->setVisible(show_texture);
- getChildView("TexScaleV")->setVisible(show_texture);
- getChildView("TexRot")->setVisible(show_texture);
- getChildView("TexOffsetU")->setVisible(show_texture);
- getChildView("TexOffsetV")->setVisible(show_texture);
+ mTexScaleU->setVisible(show_texture);
+ mTexScaleV->setVisible(show_texture);
+ mTexRotate->setVisible(show_texture);
+ mTexOffsetU->setVisible(show_texture);
+ mTexOffsetV->setVisible(show_texture);
// Specular map controls
mShinyTextureCtrl->setVisible(show_shininess);
- getChildView("combobox shininess")->setVisible(show_shininess);
- getChildView("label shininess")->setVisible(show_shininess);
- getChildView("label glossiness")->setVisible(false);
- getChildView("glossiness")->setVisible(false);
- getChildView("label environment")->setVisible(false);
- getChildView("environment")->setVisible(false);
- getChildView("label shinycolor")->setVisible(false);
+ mComboShininess->setVisible(show_shininess);
+ mLabelShininess->setVisible(show_shininess);
+ mLabelGlossiness->setVisible(false);
+ mGlossiness->setVisible(false);
+ mLabelEnvironment->setVisible(false);
+ mEnvironment->setVisible(false);
+ mLabelShiniColor->setVisible(false);
mShinyColorSwatch->setVisible(false);
if (show_shininess)
{
updateShinyControls();
}
- getChildView("shinyScaleU")->setVisible(show_shininess);
- getChildView("shinyScaleV")->setVisible(show_shininess);
- getChildView("shinyRot")->setVisible(show_shininess);
- getChildView("shinyOffsetU")->setVisible(show_shininess);
- getChildView("shinyOffsetV")->setVisible(show_shininess);
+ mShinyScaleU->setVisible(show_shininess);
+ mShinyScaleV->setVisible(show_shininess);
+ mShinyRotate->setVisible(show_shininess);
+ mShinyOffsetU->setVisible(show_shininess);
+ mShinyOffsetV->setVisible(show_shininess);
// Normal map controls
if (show_bumpiness)
@@ -2953,99 +2877,78 @@ void LLPanelFace::updateVisibility(LLViewerObject* objectp /* = nullptr */)
updateBumpyControls();
}
mBumpyTextureCtrl->setVisible(show_bumpiness);
- getChildView("combobox bumpiness")->setVisible(show_bumpiness);
- getChildView("label bumpiness")->setVisible(show_bumpiness);
- getChildView("bumpyScaleU")->setVisible(show_bumpiness);
- getChildView("bumpyScaleV")->setVisible(show_bumpiness);
- getChildView("bumpyRot")->setVisible(show_bumpiness);
- getChildView("bumpyOffsetU")->setVisible(show_bumpiness);
- getChildView("bumpyOffsetV")->setVisible(show_bumpiness);
+ mComboBumpiness->setVisible(show_bumpiness);
+ mLabelBumpiness->setVisible(show_bumpiness);
+ mBumpyScaleU->setVisible(show_bumpiness);
+ mBumpyScaleV->setVisible(show_bumpiness);
+ mBumpyRotate->setVisible(show_bumpiness);
+ mBumpyOffsetU->setVisible(show_bumpiness);
+ mBumpyOffsetV->setVisible(show_bumpiness);
- getChild<LLSpinCtrl>("rptctrl")->setVisible(show_material || show_media);
+ mTexRepeat->setVisible(show_material || show_media);
// PBR controls
updateVisibilityGLTF(objectp);
}
-// static
-void LLPanelFace::onCommitMaterialType(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitMaterialType()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
// Force to default states to side-step problems with menu contents
// and generally reflecting old state when switching tabs or objects
//
- self->updateShinyControls(false,true);
- self->updateBumpyControls(false,true);
- self->updateUI();
+ updateShinyControls(false, true);
+ updateBumpyControls(false, true);
+ updateUI();
}
-// static
-void LLPanelFace::onCommitPbrType(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitPbrType()
{
- LLPanelFace* self = (LLPanelFace*)userdata;
// Force to default states to side-step problems with menu contents
// and generally reflecting old state when switching tabs or objects
//
- self->updateUI();
+ updateUI();
}
-// static
-void LLPanelFace::onCommitBump(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitBump()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
-
- LLComboBox* mComboBumpiness = self->getChild<LLComboBox>("combobox bumpiness");
- if(!mComboBumpiness)
- return;
-
- U32 bumpiness = mComboBumpiness->getCurrentIndex();
-
- self->sendBump(bumpiness);
+ sendBump(mComboBumpiness->getCurrentIndex());
}
-// static
-void LLPanelFace::onCommitTexGen(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitTexGen()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
- self->sendTexGen();
+ sendTexGen();
}
-// static
void LLPanelFace::updateShinyControls(bool is_setting_texture, bool mess_with_shiny_combobox)
{
LLUUID shiny_texture_ID = mShinyTextureCtrl->getImageAssetID();
LL_DEBUGS("Materials") << "Shiny texture selected: " << shiny_texture_ID << LL_ENDL;
- LLComboBox* comboShiny = getChild<LLComboBox>("combobox shininess");
- if(mess_with_shiny_combobox)
+ if (mess_with_shiny_combobox)
{
- if (!comboShiny)
- {
- return;
- }
if (!shiny_texture_ID.isNull() && is_setting_texture)
{
- if (!comboShiny->itemExists(USE_TEXTURE))
+ if (!mComboShininess->itemExists(USE_TEXTURE))
{
- comboShiny->add(USE_TEXTURE);
+ mComboShininess->add(USE_TEXTURE);
}
- comboShiny->setSimple(USE_TEXTURE);
+ mComboShininess->setSimple(USE_TEXTURE);
}
else
{
- if (comboShiny->itemExists(USE_TEXTURE))
+ if (mComboShininess->itemExists(USE_TEXTURE))
{
- comboShiny->remove(SHINY_TEXTURE);
- comboShiny->selectFirstItem();
+ mComboShininess->remove(SHINY_TEXTURE);
+ mComboShininess->selectFirstItem();
}
}
}
else
{
- if (shiny_texture_ID.isNull() && comboShiny && comboShiny->itemExists(USE_TEXTURE))
+ if (shiny_texture_ID.isNull() && mComboShininess->itemExists(USE_TEXTURE))
{
- comboShiny->remove(SHINY_TEXTURE);
- comboShiny->selectFirstItem();
+ mComboShininess->remove(SHINY_TEXTURE);
+ mComboShininess->selectFirstItem();
}
}
@@ -3053,117 +2956,79 @@ void LLPanelFace::updateShinyControls(bool is_setting_texture, bool mess_with_sh
U32 material_type = mRadioMaterialType->getSelectedIndex();
bool show_material = (materials_media == MATMEDIA_MATERIAL);
bool show_shininess = show_material && (material_type == MATTYPE_SPECULAR) && mComboMatMedia->getEnabled();
- U32 shiny_value = comboShiny->getCurrentIndex();
+ U32 shiny_value = mComboShininess->getCurrentIndex();
bool show_shinyctrls = (shiny_value == SHINY_TEXTURE) && show_shininess; // Use texture
- getChildView("label glossiness")->setVisible(show_shinyctrls);
- getChildView("glossiness")->setVisible(show_shinyctrls);
- getChildView("label environment")->setVisible(show_shinyctrls);
- getChildView("environment")->setVisible(show_shinyctrls);
- getChildView("label shinycolor")->setVisible(show_shinyctrls);
+ mLabelGlossiness->setVisible(show_shinyctrls);
+ mGlossiness->setVisible(show_shinyctrls);
+ mLabelEnvironment->setVisible(show_shinyctrls);
+ mEnvironment->setVisible(show_shinyctrls);
+ mLabelShiniColor->setVisible(show_shinyctrls);
mShinyColorSwatch->setVisible(show_shinyctrls);
}
-// static
void LLPanelFace::updateBumpyControls(bool is_setting_texture, bool mess_with_combobox)
{
LLUUID bumpy_texture_ID = mBumpyTextureCtrl->getImageAssetID();
LL_DEBUGS("Materials") << "texture: " << bumpy_texture_ID << (mess_with_combobox ? "" : " do not") << " update combobox" << LL_ENDL;
- LLComboBox* comboBumpy = getChild<LLComboBox>("combobox bumpiness");
- if (!comboBumpy)
- {
- return;
- }
if (mess_with_combobox)
{
if (!bumpy_texture_ID.isNull() && is_setting_texture)
{
- if (!comboBumpy->itemExists(USE_TEXTURE))
+ if (!mComboBumpiness->itemExists(USE_TEXTURE))
{
- comboBumpy->add(USE_TEXTURE);
+ mComboBumpiness->add(USE_TEXTURE);
}
- comboBumpy->setSimple(USE_TEXTURE);
+ mComboBumpiness->setSimple(USE_TEXTURE);
}
else
{
- if (comboBumpy->itemExists(USE_TEXTURE))
+ if (mComboBumpiness->itemExists(USE_TEXTURE))
{
- comboBumpy->remove(BUMPY_TEXTURE);
- comboBumpy->selectFirstItem();
+ mComboBumpiness->remove(BUMPY_TEXTURE);
+ mComboBumpiness->selectFirstItem();
}
}
}
}
-// static
-void LLPanelFace::onCommitShiny(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitShiny()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
-
-
- LLComboBox* mComboShininess = self->getChild<LLComboBox>("combobox shininess");
- if(!mComboShininess)
- return;
-
- U32 shininess = mComboShininess->getCurrentIndex();
-
- self->sendShiny(shininess);
+ sendShiny(mComboShininess->getCurrentIndex());
}
-// static
void LLPanelFace::updateAlphaControls()
{
- LLComboBox* comboAlphaMode = getChild<LLComboBox>("combobox alphamode");
- if (!comboAlphaMode)
- {
- return;
- }
- U32 alpha_value = comboAlphaMode->getCurrentIndex();
+ U32 alpha_value = mComboAlphaMode->getCurrentIndex();
bool show_alphactrls = (alpha_value == ALPHAMODE_MASK); // Alpha masking
- U32 mat_media = MATMEDIA_MATERIAL;
- if (mComboMatMedia)
- {
- mat_media = mComboMatMedia->getCurrentIndex();
- }
-
- U32 mat_type = MATTYPE_DIFFUSE;
- if(mRadioMaterialType)
- {
- mat_type = mRadioMaterialType->getSelectedIndex();
- }
+ U32 mat_media = mComboMatMedia->getCurrentIndex();
+ U32 mat_type = mRadioMaterialType->getSelectedIndex();
show_alphactrls = show_alphactrls && (mat_media == MATMEDIA_MATERIAL);
show_alphactrls = show_alphactrls && (mat_type == MATTYPE_DIFFUSE);
- getChildView("label maskcutoff")->setVisible(show_alphactrls);
- getChildView("maskcutoff")->setVisible(show_alphactrls);
+ mLabelMaskCutoff->setVisible(show_alphactrls);
+ mMaskCutoff->setVisible(show_alphactrls);
}
-// static
-void LLPanelFace::onCommitAlphaMode(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitAlphaMode()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
- self->updateAlphaControls();
- LLSelectedTEMaterial::setDiffuseAlphaMode(self,self->getCurrentDiffuseAlphaMode());
+ updateAlphaControls();
+ LLSelectedTEMaterial::setDiffuseAlphaMode(this, getCurrentDiffuseAlphaMode());
}
-// static
-void LLPanelFace::onCommitFullbright(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitFullbright()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
- self->sendFullbright();
+ sendFullbright();
}
-// static
-void LLPanelFace::onCommitGlow(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitGlow()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
- self->sendGlow();
+ sendGlow();
}
-// static
-bool LLPanelFace::onDragPbr(LLUICtrl*, LLInventoryItem* item)
+bool LLPanelFace::onDragPbr(LLInventoryItem* item)
{
bool accept = true;
for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin();
@@ -3180,9 +3045,8 @@ bool LLPanelFace::onDragPbr(LLUICtrl*, LLInventoryItem* item)
return accept;
}
-void LLPanelFace::onCommitPbr(const LLSD& data)
+void LLPanelFace::onCommitPbr()
{
- if (!mPBRTextureCtrl) return;
if (!mPBRTextureCtrl->getTentative())
{
// we grab the item id first, because we want to do a
@@ -3200,16 +3064,15 @@ void LLPanelFace::onCommitPbr(const LLSD& data)
}
}
-void LLPanelFace::onCancelPbr(const LLSD& data)
+void LLPanelFace::onCancelPbr()
{
LLSelectMgr::getInstance()->selectionRevertGLTFMaterials();
}
-void LLPanelFace::onSelectPbr(const LLSD& data)
+void LLPanelFace::onSelectPbr()
{
LLSelectMgr::getInstance()->saveSelectedObjectTextures();
- if (!mPBRTextureCtrl) return;
if (!mPBRTextureCtrl->getTentative())
{
// we grab the item id first, because we want to do a
@@ -3226,8 +3089,7 @@ void LLPanelFace::onSelectPbr(const LLSD& data)
}
}
-// static
-bool LLPanelFace::onDragTexture(LLUICtrl*, LLInventoryItem* item)
+bool LLPanelFace::onDragTexture(LLInventoryItem* item)
{
bool accept = true;
for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin();
@@ -3244,18 +3106,18 @@ bool LLPanelFace::onDragTexture(LLUICtrl*, LLInventoryItem* item)
return accept;
}
-void LLPanelFace::onCommitTexture( const LLSD& data )
+void LLPanelFace::onCommitTexture()
{
add(LLStatViewer::EDIT_TEXTURE, 1);
sendTexture();
}
-void LLPanelFace::onCancelTexture(const LLSD& data)
+void LLPanelFace::onCancelTexture()
{
LLSelectMgr::getInstance()->selectionRevertTextures();
}
-void LLPanelFace::onSelectTexture(const LLSD& data)
+void LLPanelFace::onSelectTexture()
{
LLSelectMgr::getInstance()->saveSelectedObjectTextures();
sendTexture();
@@ -3265,31 +3127,25 @@ void LLPanelFace::onSelectTexture(const LLSD& data)
bool missing_asset = false;
LLSelectedTE::getImageFormat(image_format, identical_image_format, missing_asset);
- LLCtrlSelectionInterface* combobox_alphamode =
- childGetSelectionInterface("combobox alphamode");
-
U32 alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
- if (combobox_alphamode && !missing_asset)
+ if (!missing_asset)
{
switch (image_format)
{
case GL_RGBA:
case GL_ALPHA:
- {
- alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_BLEND;
- }
+ alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_BLEND;
+ break;
+ case GL_RGB:
break;
-
- case GL_RGB: break;
default:
- {
- LL_WARNS() << "Unexpected tex format in LLPanelFace...resorting to no alpha" << LL_ENDL;
- }
+ LL_WARNS() << "Unexpected tex format in LLPanelFace...resorting to no alpha" << LL_ENDL;
break;
}
- combobox_alphamode->selectNthItem(alpha_mode);
+ mComboAlphaMode->getSelectionInterface()->selectNthItem(alpha_mode);
}
+
LLSelectedTEMaterial::setDiffuseAlphaMode(this, getCurrentDiffuseAlphaMode());
}
@@ -3299,13 +3155,13 @@ void LLPanelFace::onCloseTexturePicker(const LLSD& data)
updateUI();
}
-void LLPanelFace::onCommitSpecularTexture( const LLSD& data )
+void LLPanelFace::onCommitSpecularTexture(const LLSD& data)
{
LL_DEBUGS("Materials") << data << LL_ENDL;
sendShiny(SHINY_TEXTURE);
}
-void LLPanelFace::onCommitNormalTexture( const LLSD& data )
+void LLPanelFace::onCommitNormalTexture(const LLSD& data)
{
LL_DEBUGS("Materials") << data << LL_ENDL;
LLUUID nmap_id = getCurrentNormalMap();
@@ -3348,34 +3204,32 @@ void LLPanelFace::onSelectNormalTexture(const LLSD& data)
//////////////////////////////////////////////////////////////////////////////
// called when a user wants to edit existing media settings on a prim or prim face
// TODO: test if there is media on the item and only allow editing if present
-void LLPanelFace::onClickBtnEditMedia(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onClickBtnEditMedia()
{
- LLPanelFace* self = (LLPanelFace*)userdata;
- self->refreshMedia();
+ refreshMedia();
LLFloaterReg::showInstance("media_settings");
}
//////////////////////////////////////////////////////////////////////////////
// called when a user wants to delete media from a prim or prim face
-void LLPanelFace::onClickBtnDeleteMedia(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onClickBtnDeleteMedia()
{
LLNotificationsUtil::add("DeleteMedia", LLSD(), LLSD(), deleteMediaConfirm);
}
//////////////////////////////////////////////////////////////////////////////
// called when a user wants to add media to a prim or prim face
-void LLPanelFace::onClickBtnAddMedia(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onClickBtnAddMedia()
{
// check if multiple faces are selected
if (LLSelectMgr::getInstance()->getSelection()->isMultipleTESelected())
{
- LLPanelFace* self = (LLPanelFace*)userdata;
- self->refreshMedia();
+ refreshMedia();
LLNotificationsUtil::add("MultipleFacesSelected", LLSD(), LLSD(), multipleFacesSelectedConfirm);
}
else
{
- onClickBtnEditMedia(ctrl, userdata);
+ onClickBtnEditMedia();
}
}
@@ -3416,396 +3270,316 @@ bool LLPanelFace::multipleFacesSelectedConfirm(const LLSD& notification, const L
return false;
}
-//static
-void LLPanelFace::syncOffsetX(LLPanelFace* self, F32 offsetU)
+void LLPanelFace::syncOffsetX(F32 offsetU)
{
- LLSelectedTEMaterial::setNormalOffsetX(self,offsetU);
- LLSelectedTEMaterial::setSpecularOffsetX(self,offsetU);
- self->getChild<LLSpinCtrl>("TexOffsetU")->forceSetValue(offsetU);
- self->sendTextureInfo();
+ LLSelectedTEMaterial::setNormalOffsetX(this, offsetU);
+ LLSelectedTEMaterial::setSpecularOffsetX(this, offsetU);
+ mTexOffsetU->forceSetValue(LLSD(offsetU));
+ sendTextureInfo();
}
-//static
-void LLPanelFace::syncOffsetY(LLPanelFace* self, F32 offsetV)
+void LLPanelFace::syncOffsetY(F32 offsetV)
{
- LLSelectedTEMaterial::setNormalOffsetY(self,offsetV);
- LLSelectedTEMaterial::setSpecularOffsetY(self,offsetV);
- self->getChild<LLSpinCtrl>("TexOffsetV")->forceSetValue(offsetV);
- self->sendTextureInfo();
+ LLSelectedTEMaterial::setNormalOffsetY(this, offsetV);
+ LLSelectedTEMaterial::setSpecularOffsetY(this, offsetV);
+ mTexOffsetV->forceSetValue(LLSD(offsetV));
+ sendTextureInfo();
}
-//static
-void LLPanelFace::onCommitMaterialBumpyOffsetX(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitMaterialBumpyOffsetX()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
- llassert_always(self);
-
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
{
- syncOffsetX(self,self->getCurrentBumpyOffsetU());
+ syncOffsetX(getCurrentBumpyOffsetU());
}
else
{
- LLSelectedTEMaterial::setNormalOffsetX(self,self->getCurrentBumpyOffsetU());
+ LLSelectedTEMaterial::setNormalOffsetX(this, getCurrentBumpyOffsetU());
}
-
}
-//static
-void LLPanelFace::onCommitMaterialBumpyOffsetY(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitMaterialBumpyOffsetY()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
- llassert_always(self);
-
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
{
- syncOffsetY(self,self->getCurrentBumpyOffsetV());
+ syncOffsetY(getCurrentBumpyOffsetV());
}
else
{
- LLSelectedTEMaterial::setNormalOffsetY(self,self->getCurrentBumpyOffsetV());
+ LLSelectedTEMaterial::setNormalOffsetY(this, getCurrentBumpyOffsetV());
}
}
-//static
-void LLPanelFace::onCommitMaterialShinyOffsetX(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitMaterialShinyOffsetX()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
- llassert_always(self);
-
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
{
- syncOffsetX(self, self->getCurrentShinyOffsetU());
+ syncOffsetX(getCurrentShinyOffsetU());
}
else
{
- LLSelectedTEMaterial::setSpecularOffsetX(self,self->getCurrentShinyOffsetU());
+ LLSelectedTEMaterial::setSpecularOffsetX(this, getCurrentShinyOffsetU());
}
}
-//static
-void LLPanelFace::onCommitMaterialShinyOffsetY(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitMaterialShinyOffsetY()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
- llassert_always(self);
-
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
{
- syncOffsetY(self,self->getCurrentShinyOffsetV());
+ syncOffsetY(getCurrentShinyOffsetV());
}
else
{
- LLSelectedTEMaterial::setSpecularOffsetY(self,self->getCurrentShinyOffsetV());
+ LLSelectedTEMaterial::setSpecularOffsetY(this, getCurrentShinyOffsetV());
}
}
-//static
-void LLPanelFace::syncRepeatX(LLPanelFace* self, F32 scaleU)
+void LLPanelFace::syncRepeatX(F32 scaleU)
{
- LLSelectedTEMaterial::setNormalRepeatX(self,scaleU);
- LLSelectedTEMaterial::setSpecularRepeatX(self,scaleU);
- self->sendTextureInfo();
+ LLSelectedTEMaterial::setNormalRepeatX(this, scaleU);
+ LLSelectedTEMaterial::setSpecularRepeatX(this, scaleU);
+ sendTextureInfo();
}
-//static
-void LLPanelFace::syncRepeatY(LLPanelFace* self, F32 scaleV)
+void LLPanelFace::syncRepeatY(F32 scaleV)
{
- LLSelectedTEMaterial::setNormalRepeatY(self,scaleV);
- LLSelectedTEMaterial::setSpecularRepeatY(self,scaleV);
- self->sendTextureInfo();
+ LLSelectedTEMaterial::setNormalRepeatY(this, scaleV);
+ LLSelectedTEMaterial::setSpecularRepeatY(this, scaleV);
+ sendTextureInfo();
}
-//static
-void LLPanelFace::onCommitMaterialBumpyScaleX(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitMaterialBumpyScaleX()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
- llassert_always(self);
- F32 bumpy_scale_u = self->getCurrentBumpyScaleU();
- if (self->isIdenticalPlanarTexgen())
+ F32 bumpy_scale_u = getCurrentBumpyScaleU();
+ if (isIdenticalPlanarTexgen())
{
bumpy_scale_u *= 0.5f;
}
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
{
- self->getChild<LLSpinCtrl>("TexScaleU")->forceSetValue(self->getCurrentBumpyScaleU());
- syncRepeatX(self, bumpy_scale_u);
+ mTexScaleU->forceSetValue(LLSD(getCurrentBumpyScaleU()));
+ syncRepeatX(bumpy_scale_u);
}
else
{
- LLSelectedTEMaterial::setNormalRepeatX(self,bumpy_scale_u);
+ LLSelectedTEMaterial::setNormalRepeatX(this, bumpy_scale_u);
}
}
-//static
-void LLPanelFace::onCommitMaterialBumpyScaleY(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitMaterialBumpyScaleY()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
- llassert_always(self);
- F32 bumpy_scale_v = self->getCurrentBumpyScaleV();
- if (self->isIdenticalPlanarTexgen())
+ F32 bumpy_scale_v = getCurrentBumpyScaleV();
+ if (isIdenticalPlanarTexgen())
{
bumpy_scale_v *= 0.5f;
}
-
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
{
- self->getChild<LLSpinCtrl>("TexScaleV")->forceSetValue(self->getCurrentBumpyScaleV());
- syncRepeatY(self, bumpy_scale_v);
+ mTexScaleV->forceSetValue(LLSD(getCurrentBumpyScaleV()));
+ syncRepeatY(bumpy_scale_v);
}
else
{
- LLSelectedTEMaterial::setNormalRepeatY(self,bumpy_scale_v);
+ LLSelectedTEMaterial::setNormalRepeatY(this, bumpy_scale_v);
}
}
-//static
-void LLPanelFace::onCommitMaterialShinyScaleX(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitMaterialShinyScaleX()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
- llassert_always(self);
- F32 shiny_scale_u = self->getCurrentShinyScaleU();
- if (self->isIdenticalPlanarTexgen())
+ F32 shiny_scale_u = getCurrentShinyScaleU();
+ if (isIdenticalPlanarTexgen())
{
shiny_scale_u *= 0.5f;
}
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
{
- self->getChild<LLSpinCtrl>("TexScaleU")->forceSetValue(self->getCurrentShinyScaleU());
- syncRepeatX(self, shiny_scale_u);
+ mTexScaleU->forceSetValue(LLSD(getCurrentShinyScaleU()));
+ syncRepeatX(shiny_scale_u);
}
else
{
- LLSelectedTEMaterial::setSpecularRepeatX(self,shiny_scale_u);
+ LLSelectedTEMaterial::setSpecularRepeatX(this, shiny_scale_u);
}
}
-//static
-void LLPanelFace::onCommitMaterialShinyScaleY(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitMaterialShinyScaleY()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
- llassert_always(self);
- F32 shiny_scale_v = self->getCurrentShinyScaleV();
- if (self->isIdenticalPlanarTexgen())
+ F32 shiny_scale_v = getCurrentShinyScaleV();
+ if (isIdenticalPlanarTexgen())
{
shiny_scale_v *= 0.5f;
}
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
{
- self->getChild<LLSpinCtrl>("TexScaleV")->forceSetValue(self->getCurrentShinyScaleV());
- syncRepeatY(self, shiny_scale_v);
+ mTexScaleV->forceSetValue(LLSD(getCurrentShinyScaleV()));
+ syncRepeatY(shiny_scale_v);
}
else
{
- LLSelectedTEMaterial::setSpecularRepeatY(self,shiny_scale_v);
+ LLSelectedTEMaterial::setSpecularRepeatY(this, shiny_scale_v);
}
}
-//static
-void LLPanelFace::syncMaterialRot(LLPanelFace* self, F32 rot, int te)
+void LLPanelFace::syncMaterialRot(F32 rot, int te)
{
- LLSelectedTEMaterial::setNormalRotation(self,rot * DEG_TO_RAD, te);
- LLSelectedTEMaterial::setSpecularRotation(self,rot * DEG_TO_RAD, te);
- self->sendTextureInfo();
+ LLSelectedTEMaterial::setNormalRotation(this, rot * DEG_TO_RAD, te);
+ LLSelectedTEMaterial::setSpecularRotation(this, rot * DEG_TO_RAD, te);
+ sendTextureInfo();
}
-//static
-void LLPanelFace::onCommitMaterialBumpyRot(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitMaterialBumpyRot()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
- llassert_always(self);
-
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
{
- self->getChild<LLSpinCtrl>("TexRot")->forceSetValue(self->getCurrentBumpyRot());
- syncMaterialRot(self, self->getCurrentBumpyRot());
+ mTexRotate->forceSetValue(LLSD(getCurrentBumpyRot()));
+ syncMaterialRot(getCurrentBumpyRot());
}
else
{
- if ((bool)self->childGetValue("checkbox planar align").asBoolean())
+ if (mPlanarAlign->getValue().asBoolean())
{
LLFace* last_face = NULL;
bool identical_face = false;
LLSelectedTE::getFace(last_face, identical_face);
- LLPanelFaceSetAlignedTEFunctor setfunc(self, last_face);
+ LLPanelFaceSetAlignedTEFunctor setfunc(this, last_face);
LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc);
}
else
{
- LLSelectedTEMaterial::setNormalRotation(self, self->getCurrentBumpyRot() * DEG_TO_RAD);
+ LLSelectedTEMaterial::setNormalRotation(this, getCurrentBumpyRot() * DEG_TO_RAD);
}
}
}
-//static
-void LLPanelFace::onCommitMaterialShinyRot(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitMaterialShinyRot()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
- llassert_always(self);
-
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
{
- self->getChild<LLSpinCtrl>("TexRot")->forceSetValue(self->getCurrentShinyRot());
- syncMaterialRot(self, self->getCurrentShinyRot());
+ mTexRotate->forceSetValue(LLSD(getCurrentShinyRot()));
+ syncMaterialRot(getCurrentShinyRot());
}
else
{
- if ((bool)self->childGetValue("checkbox planar align").asBoolean())
+ if (mPlanarAlign->getValue().asBoolean())
{
LLFace* last_face = NULL;
bool identical_face = false;
LLSelectedTE::getFace(last_face, identical_face);
- LLPanelFaceSetAlignedTEFunctor setfunc(self, last_face);
+ LLPanelFaceSetAlignedTEFunctor setfunc(this, last_face);
LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc);
}
else
{
- LLSelectedTEMaterial::setSpecularRotation(self, self->getCurrentShinyRot() * DEG_TO_RAD);
+ LLSelectedTEMaterial::setSpecularRotation(this, getCurrentShinyRot() * DEG_TO_RAD);
}
}
}
-//static
-void LLPanelFace::onCommitMaterialGloss(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitMaterialGloss()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
- llassert_always(self);
- LLSelectedTEMaterial::setSpecularLightExponent(self,self->getCurrentGlossiness());
+ LLSelectedTEMaterial::setSpecularLightExponent(this, getCurrentGlossiness());
}
-//static
-void LLPanelFace::onCommitMaterialEnv(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitMaterialEnv()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
- llassert_always(self);
- LLSelectedTEMaterial::setEnvironmentIntensity(self,self->getCurrentEnvIntensity());
+ LLSelectedTEMaterial::setEnvironmentIntensity(this, getCurrentEnvIntensity());
}
-//static
-void LLPanelFace::onCommitMaterialMaskCutoff(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitMaterialMaskCutoff()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
- LLSelectedTEMaterial::setAlphaMaskCutoff(self,self->getCurrentAlphaMaskCutoff());
+ LLSelectedTEMaterial::setAlphaMaskCutoff(this, getCurrentAlphaMaskCutoff());
}
-// static
-void LLPanelFace::onCommitTextureInfo( LLUICtrl* ctrl, void* userdata )
+void LLPanelFace::onCommitTextureInfo()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
- self->sendTextureInfo();
+ sendTextureInfo();
// vertical scale and repeats per meter depends on each other, so force set on changes
- self->updateUI(true);
+ updateUI(true);
}
-// static
-void LLPanelFace::onCommitTextureScaleX( LLUICtrl* ctrl, void* userdata )
+void LLPanelFace::onCommitTextureScaleX()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
{
- F32 bumpy_scale_u = (F32)self->getChild<LLUICtrl>("TexScaleU")->getValue().asReal();
- if (self->isIdenticalPlanarTexgen())
+ F32 bumpy_scale_u = (F32)mTexScaleU->getValue().asReal();
+ if (isIdenticalPlanarTexgen())
{
bumpy_scale_u *= 0.5f;
}
- syncRepeatX(self, bumpy_scale_u);
+ syncRepeatX(bumpy_scale_u);
}
else
{
- self->sendTextureInfo();
+ sendTextureInfo();
}
- self->updateUI(true);
+ updateUI(true);
}
-// static
-void LLPanelFace::onCommitTextureScaleY( LLUICtrl* ctrl, void* userdata )
+void LLPanelFace::onCommitTextureScaleY()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
{
- F32 bumpy_scale_v = (F32)self->getChild<LLUICtrl>("TexScaleV")->getValue().asReal();
- if (self->isIdenticalPlanarTexgen())
+ F32 bumpy_scale_v = (F32)mTexScaleV->getValue().asReal();
+ if (isIdenticalPlanarTexgen())
{
bumpy_scale_v *= 0.5f;
}
- syncRepeatY(self, bumpy_scale_v);
+ syncRepeatY(bumpy_scale_v);
}
else
{
- self->sendTextureInfo();
+ sendTextureInfo();
}
- self->updateUI(true);
+ updateUI(true);
}
-// static
-void LLPanelFace::onCommitTextureRot( LLUICtrl* ctrl, void* userdata )
+void LLPanelFace::onCommitTextureRot()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
-
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
{
- syncMaterialRot(self, (F32)self->getChild<LLUICtrl>("TexRot")->getValue().asReal());
+ syncMaterialRot((F32)mTexRotate->getValue().asReal());
}
else
{
- self->sendTextureInfo();
+ sendTextureInfo();
}
- self->updateUI(true);
+ updateUI(true);
}
-// static
-void LLPanelFace::onCommitTextureOffsetX( LLUICtrl* ctrl, void* userdata )
+void LLPanelFace::onCommitTextureOffsetX()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
{
- syncOffsetX(self, (F32)self->getChild<LLUICtrl>("TexOffsetU")->getValue().asReal());
+ syncOffsetX((F32)mTexOffsetU->getValue().asReal());
}
else
{
- self->sendTextureInfo();
+ sendTextureInfo();
}
- self->updateUI(true);
+ updateUI(true);
}
-// static
-void LLPanelFace::onCommitTextureOffsetY( LLUICtrl* ctrl, void* userdata )
+void LLPanelFace::onCommitTextureOffsetY()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
{
- syncOffsetY(self, (F32)self->getChild<LLUICtrl>("TexOffsetV")->getValue().asReal());
+ syncOffsetY((F32)mTexOffsetV->getValue().asReal());
}
else
{
- self->sendTextureInfo();
+ sendTextureInfo();
}
- self->updateUI(true);
+ updateUI(true);
}
// Commit the number of repeats per meter
-// static
-void LLPanelFace::onCommitRepeatsPerMeter(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitRepeatsPerMeter()
{
- LLPanelFace *self = (LLPanelFace *) userdata;
-
- LLUICtrl *repeats_ctrl = self->getChild<LLUICtrl>("rptctrl");
-
- U32 materials_media = self->mComboMatMedia->getCurrentIndex();
- U32 material_type = 0;
- if (materials_media == MATMEDIA_PBR)
- {
- material_type = self->mRadioPbrType->getSelectedIndex();
- }
- if (materials_media == MATMEDIA_MATERIAL)
- {
- material_type = self->mRadioMaterialType->getSelectedIndex();
- }
-
- F32 repeats_per_meter = (F32) repeats_ctrl->getValue().asReal();
+ F32 repeats_per_meter = (F32)mTexRepeat->getValue().asReal();
F32 obj_scale_s = 1.0f;
F32 obj_scale_t = 1.0f;
@@ -3816,64 +3590,51 @@ void LLPanelFace::onCommitRepeatsPerMeter(LLUICtrl* ctrl, void* userdata)
LLSelectedTE::getObjectScaleS(obj_scale_s, identical_scale_s);
LLSelectedTE::getObjectScaleS(obj_scale_t, identical_scale_t);
- LLUICtrl *bumpy_scale_u = self->getChild<LLUICtrl>("bumpyScaleU");
- LLUICtrl *bumpy_scale_v = self->getChild<LLUICtrl>("bumpyScaleV");
- LLUICtrl *shiny_scale_u = self->getChild<LLUICtrl>("shinyScaleU");
- LLUICtrl *shiny_scale_v = self->getChild<LLUICtrl>("shinyScaleV");
-
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
{
- LLSelectMgr::getInstance()->selectionTexScaleAutofit( repeats_per_meter );
+ LLSelectMgr::getInstance()->selectionTexScaleAutofit(repeats_per_meter);
- bumpy_scale_u->setValue(obj_scale_s * repeats_per_meter);
- bumpy_scale_v->setValue(obj_scale_t * repeats_per_meter);
+ mBumpyScaleU->setValue(obj_scale_s * repeats_per_meter);
+ mBumpyScaleV->setValue(obj_scale_t * repeats_per_meter);
- LLSelectedTEMaterial::setNormalRepeatX(self,obj_scale_s * repeats_per_meter);
- LLSelectedTEMaterial::setNormalRepeatY(self,obj_scale_t * repeats_per_meter);
+ LLSelectedTEMaterial::setNormalRepeatX(this, obj_scale_s * repeats_per_meter);
+ LLSelectedTEMaterial::setNormalRepeatY(this, obj_scale_t * repeats_per_meter);
- shiny_scale_u->setValue(obj_scale_s * repeats_per_meter);
- shiny_scale_v->setValue(obj_scale_t * repeats_per_meter);
+ mShinyScaleU->setValue(obj_scale_s * repeats_per_meter);
+ mShinyScaleV->setValue(obj_scale_t * repeats_per_meter);
- LLSelectedTEMaterial::setSpecularRepeatX(self,obj_scale_s * repeats_per_meter);
- LLSelectedTEMaterial::setSpecularRepeatY(self,obj_scale_t * repeats_per_meter);
+ LLSelectedTEMaterial::setSpecularRepeatX(this, obj_scale_s * repeats_per_meter);
+ LLSelectedTEMaterial::setSpecularRepeatY(this, obj_scale_t * repeats_per_meter);
}
else
{
+ U32 material_type = mRadioMaterialType->getSelectedIndex();
switch (material_type)
{
- case MATTYPE_DIFFUSE:
- {
- LLSelectMgr::getInstance()->selectionTexScaleAutofit( repeats_per_meter );
- }
+ case MATTYPE_DIFFUSE:
+ LLSelectMgr::getInstance()->selectionTexScaleAutofit(repeats_per_meter);
break;
+ case MATTYPE_NORMAL:
+ mBumpyScaleU->setValue(obj_scale_s * repeats_per_meter);
+ mBumpyScaleV->setValue(obj_scale_t * repeats_per_meter);
- case MATTYPE_NORMAL:
- {
- bumpy_scale_u->setValue(obj_scale_s * repeats_per_meter);
- bumpy_scale_v->setValue(obj_scale_t * repeats_per_meter);
-
- LLSelectedTEMaterial::setNormalRepeatX(self,obj_scale_s * repeats_per_meter);
- LLSelectedTEMaterial::setNormalRepeatY(self,obj_scale_t * repeats_per_meter);
- }
+ LLSelectedTEMaterial::setNormalRepeatX(this, obj_scale_s * repeats_per_meter);
+ LLSelectedTEMaterial::setNormalRepeatY(this, obj_scale_t * repeats_per_meter);
break;
+ case MATTYPE_SPECULAR:
+ mBumpyScaleU->setValue(obj_scale_s * repeats_per_meter);
+ mBumpyScaleV->setValue(obj_scale_t * repeats_per_meter);
- case MATTYPE_SPECULAR:
- {
- shiny_scale_u->setValue(obj_scale_s * repeats_per_meter);
- shiny_scale_v->setValue(obj_scale_t * repeats_per_meter);
-
- LLSelectedTEMaterial::setSpecularRepeatX(self,obj_scale_s * repeats_per_meter);
- LLSelectedTEMaterial::setSpecularRepeatY(self,obj_scale_t * repeats_per_meter);
- }
+ LLSelectedTEMaterial::setSpecularRepeatX(this, obj_scale_s * repeats_per_meter);
+ LLSelectedTEMaterial::setSpecularRepeatY(this, obj_scale_t * repeats_per_meter);
+ break;
+ default:
+ llassert(false);
break;
-
- default:
- llassert(false);
- break;
}
}
// vertical scale and repeats per meter depends on each other, so force set on changes
- self->updateUI(true);
+ updateUI(true);
}
struct LLPanelFaceSetMediaFunctor : public LLSelectedTEFunctor
@@ -3883,22 +3644,20 @@ struct LLPanelFaceSetMediaFunctor : public LLSelectedTEFunctor
viewer_media_t pMediaImpl;
const LLTextureEntry* tep = object->getTE(te);
- const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : NULL;
- if ( mep )
+ if (const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : NULL)
{
pMediaImpl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(mep->getMediaID());
}
- if ( pMediaImpl.isNull())
+ if (pMediaImpl.isNull())
{
// If we didn't find face media for this face, check whether this face is showing parcel media.
pMediaImpl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(tep->getID());
}
- if ( pMediaImpl.notNull())
+ if (pMediaImpl.notNull())
{
- LLPluginClassMedia *media = pMediaImpl->getMediaPlugin();
- if(media)
+ if (LLPluginClassMedia* media = pMediaImpl->getMediaPlugin())
{
S32 media_width = media->getWidth();
S32 media_height = media->getHeight();
@@ -3908,17 +3667,17 @@ struct LLPanelFaceSetMediaFunctor : public LLSelectedTEFunctor
F32 scale_t = (F32)media_height / (F32)texture_height;
// set scale and adjust offset
- object->setTEScaleS( te, scale_s );
- object->setTEScaleT( te, scale_t ); // don't need to flip Y anymore since QT does this for us now.
- object->setTEOffsetS( te, -( 1.0f - scale_s ) / 2.0f );
- object->setTEOffsetT( te, -( 1.0f - scale_t ) / 2.0f );
+ object->setTEScaleS(te, scale_s);
+ object->setTEScaleT(te, scale_t); // don't need to flip Y anymore since QT does this for us now.
+ object->setTEOffsetS(te, -( 1.0f - scale_s ) / 2.0f);
+ object->setTEOffsetT(te, -( 1.0f - scale_t ) / 2.0f);
}
}
return true;
};
};
-void LLPanelFace::onClickAutoFix(void* userdata)
+void LLPanelFace::onClickAutoFix()
{
LLPanelFaceSetMediaFunctor setfunc;
LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc);
@@ -3927,25 +3686,23 @@ void LLPanelFace::onClickAutoFix(void* userdata)
LLSelectMgr::getInstance()->getSelection()->applyToObjects(&sendfunc);
}
-void LLPanelFace::onAlignTexture(void* userdata)
+void LLPanelFace::onAlignTexture()
{
- LLPanelFace* self = (LLPanelFace*)userdata;
- self->alignTextureLayer();
+ alignTextureLayer();
}
-void LLPanelFace::onClickBtnLoadInvPBR(void* userdata)
+void LLPanelFace::onClickBtnLoadInvPBR()
{
// Shouldn't this be "save to inventory?"
- LLPanelFace* self = (LLPanelFace*)userdata;
- self->mPBRTextureCtrl->showPicker(true);
+ mPBRTextureCtrl->showPicker(true);
}
-void LLPanelFace::onClickBtnEditPBR(void* userdata)
+void LLPanelFace::onClickBtnEditPBR()
{
LLMaterialEditor::loadLive();
}
-void LLPanelFace::onClickBtnSavePBR(void* userdata)
+void LLPanelFace::onClickBtnSavePBR()
{
LLMaterialEditor::saveObjectsMaterialAs();
}
@@ -4806,44 +4563,39 @@ bool LLPanelFace::menuEnableItem(const LLSD& userdata)
return false;
}
-
-// static
-void LLPanelFace::onCommitPlanarAlign(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitPlanarAlign()
{
- LLPanelFace* self = (LLPanelFace*) userdata;
- self->getState();
- self->sendTextureInfo();
+ getState();
+ sendTextureInfo();
}
-void LLPanelFace::updateGLTFTextureTransform(float value, U32 pbr_type, std::function<void(LLGLTFMaterial::TextureTransform*)> edit)
+void LLPanelFace::updateGLTFTextureTransform(std::function<void(LLGLTFMaterial::TextureTransform*)> edit)
{
- U32 texture_info_start;
- U32 texture_info_end;
- const LLGLTFMaterial::TextureInfo texture_info = texture_info_from_pbrtype(pbr_type);
+ const LLGLTFMaterial::TextureInfo texture_info = getPBRTextureInfo();
if (texture_info == LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT)
{
- texture_info_start = 0;
- texture_info_end = LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT;
+ updateSelectedGLTFMaterials([&](LLGLTFMaterial* new_override)
+ {
+ for (U32 i = 0; i < LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT; ++i)
+ {
+ LLGLTFMaterial::TextureTransform& new_transform = new_override->mTextureTransform[(LLGLTFMaterial::TextureInfo)i];
+ edit(&new_transform);
+ }
+ });
}
else
{
- texture_info_start = texture_info_from_pbrtype(pbr_type);
- texture_info_end = texture_info_start + 1;
+ updateSelectedGLTFMaterials([&](LLGLTFMaterial* new_override)
+ {
+ LLGLTFMaterial::TextureTransform& new_transform = new_override->mTextureTransform[texture_info];
+ edit(&new_transform);
+ });
}
- updateSelectedGLTFMaterials([&](LLGLTFMaterial* new_override)
- {
- for (U32 ti = texture_info_start; ti < texture_info_end; ++ti)
- {
- LLGLTFMaterial::TextureTransform& new_transform = new_override->mTextureTransform[(LLGLTFMaterial::TextureInfo)ti];
- edit(&new_transform);
- }
- });
}
void LLPanelFace::setMaterialOverridesFromSelection()
{
- const U32 pbr_type = mRadioPbrType->getSelectedIndex();
- const LLGLTFMaterial::TextureInfo texture_info = texture_info_from_pbrtype(pbr_type);
+ const LLGLTFMaterial::TextureInfo texture_info = getPBRTextureInfo();
U32 texture_info_start;
U32 texture_info_end;
if (texture_info == LLGLTFMaterial::TextureInfo::GLTF_TEXTURE_INFO_COUNT)
@@ -4916,23 +4668,17 @@ void LLPanelFace::setMaterialOverridesFromSelection()
}
}
- LLUICtrl* gltfCtrlTextureScaleU = getChild<LLUICtrl>("gltfTextureScaleU");
- LLUICtrl* gltfCtrlTextureScaleV = getChild<LLUICtrl>("gltfTextureScaleV");
- LLUICtrl* gltfCtrlTextureRotation = getChild<LLUICtrl>("gltfTextureRotation");
- LLUICtrl* gltfCtrlTextureOffsetU = getChild<LLUICtrl>("gltfTextureOffsetU");
- LLUICtrl* gltfCtrlTextureOffsetV = getChild<LLUICtrl>("gltfTextureOffsetV");
+ mPBRScaleU->setValue(transform.mScale[VX]);
+ mPBRScaleV->setValue(transform.mScale[VY]);
+ mPBRRotate->setValue(transform.mRotation * RAD_TO_DEG);
+ mPBROffsetU->setValue(transform.mOffset[VX]);
+ mPBROffsetV->setValue(transform.mOffset[VY]);
- gltfCtrlTextureScaleU->setValue(transform.mScale[VX]);
- gltfCtrlTextureScaleV->setValue(transform.mScale[VY]);
- gltfCtrlTextureRotation->setValue(transform.mRotation * RAD_TO_DEG);
- gltfCtrlTextureOffsetU->setValue(transform.mOffset[VX]);
- gltfCtrlTextureOffsetV->setValue(transform.mOffset[VY]);
-
- gltfCtrlTextureScaleU->setTentative(!scale_u_same);
- gltfCtrlTextureScaleV->setTentative(!scale_v_same);
- gltfCtrlTextureRotation->setTentative(!rotation_same);
- gltfCtrlTextureOffsetU->setTentative(!offset_u_same);
- gltfCtrlTextureOffsetV->setTentative(!offset_v_same);
+ mPBRScaleU->setTentative(!scale_u_same);
+ mPBRScaleV->setTentative(!scale_v_same);
+ mPBRRotate->setTentative(!rotation_same);
+ mPBROffsetU->setTentative(!offset_u_same);
+ mPBROffsetV->setTentative(!offset_v_same);
}
void LLPanelFace::Selection::connect()
@@ -5009,51 +4755,46 @@ bool LLPanelFace::Selection::compareSelection()
return selection_changed;
}
-void LLPanelFace::onCommitGLTFTextureScaleU(LLUICtrl* ctrl)
+void LLPanelFace::onCommitGLTFTextureScaleU()
{
- const float value = (F32)ctrl->getValue().asReal();
- const U32 pbr_type = mRadioPbrType->getSelectedIndex();
- updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform)
+ F32 value = (F32)mPBRScaleU->getValue().asReal();
+ updateGLTFTextureTransform([&](LLGLTFMaterial::TextureTransform* new_transform)
{
new_transform->mScale.mV[VX] = value;
});
}
-void LLPanelFace::onCommitGLTFTextureScaleV(LLUICtrl* ctrl)
+void LLPanelFace::onCommitGLTFTextureScaleV()
{
- const float value = (F32)ctrl->getValue().asReal();
- const U32 pbr_type = mRadioPbrType->getSelectedIndex();
- updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform)
+ F32 value = (F32)mPBRScaleV->getValue().asReal();
+ updateGLTFTextureTransform([&](LLGLTFMaterial::TextureTransform* new_transform)
{
new_transform->mScale.mV[VY] = value;
});
}
-void LLPanelFace::onCommitGLTFRotation(LLUICtrl* ctrl)
+void LLPanelFace::onCommitGLTFRotation()
{
- const float value = (F32)ctrl->getValue().asReal() * DEG_TO_RAD;
- const U32 pbr_type = mRadioPbrType->getSelectedIndex();
- updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform)
+ F32 value = (F32)mPBRRotate->getValue().asReal() * DEG_TO_RAD;
+ updateGLTFTextureTransform([&](LLGLTFMaterial::TextureTransform* new_transform)
{
new_transform->mRotation = value;
});
}
-void LLPanelFace::onCommitGLTFTextureOffsetU(LLUICtrl* ctrl)
+void LLPanelFace::onCommitGLTFTextureOffsetU()
{
- const float value = (F32)ctrl->getValue().asReal();
- const U32 pbr_type = mRadioPbrType->getSelectedIndex();
- updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform)
+ F32 value = (F32)mPBROffsetU->getValue().asReal();
+ updateGLTFTextureTransform([&](LLGLTFMaterial::TextureTransform* new_transform)
{
new_transform->mOffset.mV[VX] = value;
});
}
-void LLPanelFace::onCommitGLTFTextureOffsetV(LLUICtrl* ctrl)
+void LLPanelFace::onCommitGLTFTextureOffsetV()
{
- const float value = (F32)ctrl->getValue().asReal();
- const U32 pbr_type = mRadioPbrType->getSelectedIndex();
- updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform)
+ F32 value = (F32)mPBROffsetV->getValue().asReal();
+ updateGLTFTextureTransform([&](LLGLTFMaterial::TextureTransform* new_transform)
{
new_transform->mOffset.mV[VY] = value;
});
@@ -5063,47 +4804,44 @@ void LLPanelFace::onTextureSelectionChanged(LLInventoryItem* itemp)
{
LL_DEBUGS("Materials") << "item asset " << itemp->getAssetUUID() << LL_ENDL;
+ LLTextureCtrl* texture_ctrl;
U32 mattype = mRadioMaterialType->getSelectedIndex();
- std::string which_control="texture control";
switch (mattype)
{
case MATTYPE_SPECULAR:
- which_control = "shinytexture control";
+ texture_ctrl = mShinyTextureCtrl;
break;
case MATTYPE_NORMAL:
- which_control = "bumpytexture control";
+ texture_ctrl = mBumpyTextureCtrl;
break;
- // no default needed
+ default:
+ texture_ctrl = mTextureCtrl;
}
- LL_DEBUGS("Materials") << "control " << which_control << LL_ENDL;
- LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>(which_control);
- if (texture_ctrl)
- {
- LLUUID obj_owner_id;
- std::string obj_owner_name;
- LLSelectMgr::instance().selectGetOwner(obj_owner_id, obj_owner_name);
- LLSaleInfo sale_info;
- LLSelectMgr::instance().selectGetSaleInfo(sale_info);
+ LLUUID obj_owner_id;
+ std::string obj_owner_name;
+ LLSelectMgr::instance().selectGetOwner(obj_owner_id, obj_owner_name);
- bool can_copy = itemp->getPermissions().allowCopyBy(gAgentID); // do we have perm to copy this texture?
- bool can_transfer = itemp->getPermissions().allowOperationBy(PERM_TRANSFER, gAgentID); // do we have perm to transfer this texture?
- bool is_object_owner = gAgentID == obj_owner_id; // does object for which we are going to apply texture belong to the agent?
- bool not_for_sale = !sale_info.isForSale(); // is object for which we are going to apply texture not for sale?
+ LLSaleInfo sale_info;
+ LLSelectMgr::instance().selectGetSaleInfo(sale_info);
- if (can_copy && can_transfer)
- {
- texture_ctrl->setCanApply(true, true);
- return;
- }
+ bool can_copy = itemp->getPermissions().allowCopyBy(gAgentID); // do we have perm to copy this texture?
+ bool can_transfer = itemp->getPermissions().allowOperationBy(PERM_TRANSFER, gAgentID); // do we have perm to transfer this texture?
+ bool is_object_owner = gAgentID == obj_owner_id; // does object for which we are going to apply texture belong to the agent?
+ bool not_for_sale = !sale_info.isForSale(); // is object for which we are going to apply texture not for sale?
- // if texture has (no-transfer) attribute it can be applied only for object which we own and is not for sale
- texture_ctrl->setCanApply(false, can_transfer ? true : is_object_owner && not_for_sale);
+ if (can_copy && can_transfer)
+ {
+ texture_ctrl->setCanApply(true, true);
+ return;
+ }
- if (gSavedSettings.getBOOL("TextureLivePreview"))
- {
- LLNotificationsUtil::add("LivePreviewUnavailable");
- }
+ // if texture has (no-transfer) attribute it can be applied only for object which we own and is not for sale
+ texture_ctrl->setCanApply(false, can_transfer ? true : is_object_owner && not_for_sale);
+
+ if (gSavedSettings.getBOOL("TextureLivePreview"))
+ {
+ LLNotificationsUtil::add("LivePreviewUnavailable");
}
}
diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h
index 6e88116a2d..dfd3201533 100644
--- a/indra/newview/llpanelface.h
+++ b/indra/newview/llpanelface.h
@@ -125,59 +125,62 @@ public:
return new_material;
}
+ LLGLTFMaterial::TextureInfo getPBRTextureInfo();
LLRender::eTexIndex getTextureChannelToEdit();
+ LLRender::eTexIndex getMatTextureChannel();
+ LLRender::eTexIndex getPBRTextureChannel();
LLRender::eTexIndex getTextureDropChannel();
LLGLTFMaterial::TextureInfo getPBRDropChannel();
protected:
- void navigateToTitleMedia(const std::string url);
- bool selectedMediaEditable();
- void clearMediaSettings();
- void updateMediaSettings();
- void updateMediaTitle();
-
- void getState();
-
- void sendTexture(); // applies and sends texture
- void sendTextureInfo(); // applies and sends texture scale, offset, etc.
- void sendColor(); // applies and sends color
- void sendAlpha(); // applies and sends transparency
- void sendBump(U32 bumpiness); // applies and sends bump map
- void sendTexGen(); // applies and sends bump map
- void sendShiny(U32 shininess); // applies and sends shininess
- void sendFullbright(); // applies and sends full bright
-
- void sendGlow();
- void alignTextureLayer();
-
- void updateCopyTexButton();
-
- void onCommitPbr(const LLSD& data);
- void onCancelPbr(const LLSD& data);
- void onSelectPbr(const LLSD& data);
- static bool onDragPbr(LLUICtrl* ctrl, LLInventoryItem* item);
-
- // this function is to return true if the drag should succeed.
- static bool onDragTexture(LLUICtrl* ctrl, LLInventoryItem* item);
-
- void onCommitTexture(const LLSD& data);
- void onCancelTexture(const LLSD& data);
- void onSelectTexture(const LLSD& data);
- void onCommitSpecularTexture(const LLSD& data);
- void onCancelSpecularTexture(const LLSD& data);
- void onSelectSpecularTexture(const LLSD& data);
- void onCommitNormalTexture(const LLSD& data);
- void onCancelNormalTexture(const LLSD& data);
- void onSelectNormalTexture(const LLSD& data);
- void onCommitColor(const LLSD& data);
- void onCommitShinyColor(const LLSD& data);
- void onCommitAlpha(const LLSD& data);
- void onCancelColor(const LLSD& data);
- void onCancelShinyColor(const LLSD& data);
- void onSelectColor(const LLSD& data);
- void onSelectShinyColor(const LLSD& data);
-
- void onCloseTexturePicker(const LLSD& data);
+ void navigateToTitleMedia(const std::string& url);
+ bool selectedMediaEditable();
+ void clearMediaSettings();
+ void updateMediaSettings();
+ void updateMediaTitle();
+
+ void getState();
+
+ void sendTexture(); // applies and sends texture
+ void sendTextureInfo(); // applies and sends texture scale, offset, etc.
+ void sendColor(); // applies and sends color
+ void sendAlpha(); // applies and sends transparency
+ void sendBump(U32 bumpiness); // applies and sends bump map
+ void sendTexGen(); // applies and sends bump map
+ void sendShiny(U32 shininess); // applies and sends shininess
+ void sendFullbright(); // applies and sends full bright
+
+ void sendGlow();
+ void alignTextureLayer();
+
+ void updateCopyTexButton();
+
+ void onCommitPbr();
+ void onCancelPbr();
+ void onSelectPbr();
+
+ // These functions are to return true if the drag should succeed
+ bool onDragPbr(LLInventoryItem* item);
+ bool onDragTexture(LLInventoryItem* item);
+
+ void onCommitTexture();
+ void onCancelTexture();
+ void onSelectTexture();
+ void onCommitSpecularTexture(const LLSD& data);
+ void onCancelSpecularTexture(const LLSD& data);
+ void onSelectSpecularTexture(const LLSD& data);
+ void onCommitNormalTexture(const LLSD& data);
+ void onCancelNormalTexture(const LLSD& data);
+ void onSelectNormalTexture(const LLSD& data);
+ void onCommitColor();
+ void onCommitShinyColor();
+ void onCommitAlpha();
+ void onCancelColor();
+ void onCancelShinyColor();
+ void onSelectColor();
+ void onSelectShinyColor();
+
+ void onCloseTexturePicker(const LLSD& data);
static bool deleteMediaConfirm(const LLSD& notification, const LLSD& response);
static bool multipleFacesSelectedConfirm(const LLSD& notification, const LLSD& response);
@@ -195,81 +198,78 @@ protected:
// Callback funcs for individual controls
//
- static void onCommitTextureInfo(LLUICtrl* ctrl, void* userdata);
- static void onCommitTextureScaleX(LLUICtrl* ctrl, void* userdata);
- static void onCommitTextureScaleY(LLUICtrl* ctrl, void* userdata);
- static void onCommitTextureRot(LLUICtrl* ctrl, void* userdata);
- static void onCommitTextureOffsetX(LLUICtrl* ctrl, void* userdata);
- static void onCommitTextureOffsetY(LLUICtrl* ctrl, void* userdata);
-
- static void onCommitMaterialBumpyScaleX( LLUICtrl* ctrl, void* userdata);
- static void onCommitMaterialBumpyScaleY( LLUICtrl* ctrl, void* userdata);
- static void onCommitMaterialBumpyRot( LLUICtrl* ctrl, void* userdata);
- static void onCommitMaterialBumpyOffsetX( LLUICtrl* ctrl, void* userdata);
- static void onCommitMaterialBumpyOffsetY( LLUICtrl* ctrl, void* userdata);
-
- static void syncRepeatX(LLPanelFace* self, F32 scaleU);
- static void syncRepeatY(LLPanelFace* self, F32 scaleV);
- static void syncOffsetX(LLPanelFace* self, F32 offsetU);
- static void syncOffsetY(LLPanelFace* self, F32 offsetV);
- static void syncMaterialRot(LLPanelFace* self, F32 rot, int te = -1);
-
- static void onCommitMaterialShinyScaleX( LLUICtrl* ctrl, void* userdata);
- static void onCommitMaterialShinyScaleY( LLUICtrl* ctrl, void* userdata);
- static void onCommitMaterialShinyRot( LLUICtrl* ctrl, void* userdata);
- static void onCommitMaterialShinyOffsetX( LLUICtrl* ctrl, void* userdata);
- static void onCommitMaterialShinyOffsetY( LLUICtrl* ctrl, void* userdata);
-
- static void onCommitMaterialGloss( LLUICtrl* ctrl, void* userdata);
- static void onCommitMaterialEnv( LLUICtrl* ctrl, void* userdata);
- static void onCommitMaterialMaskCutoff( LLUICtrl* ctrl, void* userdata);
- static void onCommitMaterialID( LLUICtrl* ctrl, void* userdata);
-
- static void onCommitMaterialsMedia( LLUICtrl* ctrl, void* userdata);
- static void onCommitMaterialType( LLUICtrl* ctrl, void* userdata);
- static void onCommitPbrType(LLUICtrl* ctrl, void* userdata);
- static void onClickBtnEditMedia(LLUICtrl* ctrl, void* userdata);
- static void onClickBtnDeleteMedia(LLUICtrl* ctrl, void* userdata);
- static void onClickBtnAddMedia(LLUICtrl* ctrl, void* userdata);
- static void onCommitBump( LLUICtrl* ctrl, void* userdata);
- static void onCommitTexGen( LLUICtrl* ctrl, void* userdata);
- static void onCommitShiny( LLUICtrl* ctrl, void* userdata);
- static void onCommitAlphaMode( LLUICtrl* ctrl, void* userdata);
- static void onCommitFullbright( LLUICtrl* ctrl, void* userdata);
- static void onCommitGlow( LLUICtrl* ctrl, void *userdata);
- static void onCommitPlanarAlign( LLUICtrl* ctrl, void* userdata);
- static void onCommitRepeatsPerMeter( LLUICtrl* ctrl, void* userinfo);
-
- void onCommitGLTFTextureScaleU(LLUICtrl* ctrl);
- void onCommitGLTFTextureScaleV(LLUICtrl* ctrl);
- void onCommitGLTFRotation(LLUICtrl* ctrl);
- void onCommitGLTFTextureOffsetU(LLUICtrl* ctrl);
- void onCommitGLTFTextureOffsetV(LLUICtrl* ctrl);
-
- static void onClickAutoFix(void*);
- static void onAlignTexture(void*);
- static void onClickBtnLoadInvPBR(void* userdata);
- static void onClickBtnEditPBR(void* userdata);
- static void onClickBtnSavePBR(void* userdata);
+ void onCommitTextureInfo();
+ void onCommitTextureScaleX();
+ void onCommitTextureScaleY();
+ void onCommitTextureRot();
+ void onCommitTextureOffsetX();
+ void onCommitTextureOffsetY();
+
+ void onCommitMaterialBumpyScaleX();
+ void onCommitMaterialBumpyScaleY();
+ void onCommitMaterialBumpyRot();
+ void onCommitMaterialBumpyOffsetX();
+ void onCommitMaterialBumpyOffsetY();
+
+ void syncRepeatX(F32 scaleU);
+ void syncRepeatY(F32 scaleV);
+ void syncOffsetX(F32 offsetU);
+ void syncOffsetY(F32 offsetV);
+ void syncMaterialRot(F32 rot, int te = -1);
+
+ void onCommitMaterialShinyScaleX();
+ void onCommitMaterialShinyScaleY();
+ void onCommitMaterialShinyRot();
+ void onCommitMaterialShinyOffsetX();
+ void onCommitMaterialShinyOffsetY();
+
+ void onCommitMaterialGloss();
+ void onCommitMaterialEnv();
+ void onCommitMaterialMaskCutoff();
+
+ void onCommitMaterialsMedia();
+ void onCommitMaterialType();
+ void onCommitPbrType();
+ void onClickBtnEditMedia();
+ void onClickBtnDeleteMedia();
+ void onClickBtnAddMedia();
+ void onCommitBump();
+ void onCommitTexGen();
+ void onCommitShiny();
+ void onCommitAlphaMode();
+ void onCommitFullbright();
+ void onCommitGlow();
+ void onCommitPlanarAlign();
+ void onCommitRepeatsPerMeter();
+
+ void onCommitGLTFTextureScaleU();
+ void onCommitGLTFTextureScaleV();
+ void onCommitGLTFRotation();
+ void onCommitGLTFTextureOffsetU();
+ void onCommitGLTFTextureOffsetV();
+
+ void onClickAutoFix();
+ void onAlignTexture();
+ void onClickBtnLoadInvPBR();
+ void onClickBtnEditPBR();
+ void onClickBtnSavePBR();
public: // needs to be accessible to selection manager
- void onCopyColor(); // records all selected faces
- void onPasteColor(); // to specific face
- void onPasteColor(LLViewerObject* objectp, S32 te); // to specific face
- void onCopyTexture();
- void onPasteTexture();
- void onPasteTexture(LLViewerObject* objectp, S32 te);
+ void onCopyColor(); // records all selected faces
+ void onPasteColor(); // to specific face
+ void onPasteColor(LLViewerObject* objectp, S32 te); // to specific face
+ void onCopyTexture();
+ void onPasteTexture();
+ void onPasteTexture(LLViewerObject* objectp, S32 te);
protected:
- void menuDoToSelected(const LLSD& userdata);
- bool menuEnableItem(const LLSD& userdata);
-
- static F32 valueGlow(LLViewerObject* object, S32 face);
-
+ void menuDoToSelected(const LLSD& userdata);
+ bool menuEnableItem(const LLSD& userdata);
+ static F32 valueGlow(LLViewerObject* object, S32 face);
private:
- bool isAlpha() { return mIsAlpha; }
+ bool isAlpha() const { return mIsAlpha; }
// Convenience funcs to keep the visual flack to a minimum
//
@@ -292,27 +292,77 @@ private:
F32 getCurrentShinyOffsetU();
F32 getCurrentShinyOffsetV();
- LLTextureCtrl* mPBRTextureCtrl = nullptr;
- LLTextureCtrl* mTextureCtrl = nullptr;
- LLTextureCtrl* mShinyTextureCtrl = nullptr;
- LLTextureCtrl* mBumpyTextureCtrl = nullptr;
- LLColorSwatchCtrl* mColorSwatch = nullptr;
- LLColorSwatchCtrl* mShinyColorSwatch = nullptr;
-
- LLComboBox* mComboTexGen = nullptr;
-
- LLRadioGroup* mRadioMaterialType = nullptr;
- LLRadioGroup* mRadioPbrType = nullptr;
-
- LLCheckBoxCtrl* mCheckFullbright = nullptr;
-
- LLTextBox* mLabelColorTransp = nullptr;
- LLSpinCtrl* mCtrlColorTransp = nullptr; // transparency = 1 - alpha
-
- LLSpinCtrl* mCtrlGlow = nullptr;
- LLComboBox *mComboMatMedia = nullptr;
- LLMediaCtrl *mTitleMedia = nullptr;
- LLTextBox *mTitleMediaText = nullptr;
+ LLTextureCtrl* mPBRTextureCtrl { nullptr };
+ LLTextureCtrl* mTextureCtrl { nullptr };
+ LLTextureCtrl* mShinyTextureCtrl { nullptr };
+ LLTextureCtrl* mBumpyTextureCtrl { nullptr };
+ LLTextBox* mLabelColor { nullptr };
+ LLColorSwatchCtrl* mColorSwatch { nullptr };
+ LLTextBox* mLabelShiniColor { nullptr };
+ LLColorSwatchCtrl* mShinyColorSwatch { nullptr };
+
+ LLTextBox* mLabelTexGen { nullptr };
+ LLComboBox* mComboTexGen { nullptr };
+
+ LLRadioGroup* mRadioMaterialType { nullptr };
+ LLRadioGroup* mRadioPbrType { nullptr };
+
+ LLCheckBoxCtrl* mCheckFullbright { nullptr };
+
+ LLTextBox* mLabelColorTransp { nullptr };
+ LLSpinCtrl* mCtrlColorTransp { nullptr }; // transparency = 1 - alpha
+
+ LLTextBox* mLabelGlow { nullptr };
+ LLSpinCtrl* mCtrlGlow { nullptr };
+ LLComboBox* mComboMatMedia { nullptr };
+ LLMediaCtrl* mTitleMedia { nullptr };
+ LLTextBox* mTitleMediaText { nullptr };
+
+ LLTextBox* mLabelMatPermLoading { nullptr };
+ LLCheckBoxCtrl* mCheckSyncSettings { nullptr };
+
+ LLTextBox* mLabelBumpiness { nullptr };
+ LLComboBox* mComboBumpiness { nullptr };
+ LLTextBox* mLabelShininess { nullptr };
+ LLComboBox* mComboShininess { nullptr };
+ LLTextBox* mLabelAlphaMode { nullptr };
+ LLComboBox* mComboAlphaMode { nullptr };
+ LLSpinCtrl* mTexScaleU { nullptr };
+ LLSpinCtrl* mTexScaleV { nullptr };
+ LLSpinCtrl* mTexRotate { nullptr };
+ LLSpinCtrl* mTexRepeat { nullptr };
+ LLSpinCtrl* mTexOffsetU { nullptr };
+ LLSpinCtrl* mTexOffsetV { nullptr };
+ LLCheckBoxCtrl* mPlanarAlign{ nullptr };
+ LLSpinCtrl* mBumpyScaleU { nullptr };
+ LLSpinCtrl* mBumpyScaleV { nullptr };
+ LLSpinCtrl* mBumpyRotate { nullptr };
+ LLSpinCtrl* mBumpyOffsetU { nullptr };
+ LLSpinCtrl* mBumpyOffsetV { nullptr };
+ LLSpinCtrl* mShinyScaleU { nullptr };
+ LLSpinCtrl* mShinyScaleV { nullptr };
+ LLSpinCtrl* mShinyRotate { nullptr };
+ LLSpinCtrl* mShinyOffsetU { nullptr };
+ LLSpinCtrl* mShinyOffsetV { nullptr };
+ LLTextBox* mLabelGlossiness { nullptr };
+ LLSpinCtrl* mGlossiness { nullptr };
+ LLTextBox* mLabelEnvironment { nullptr };
+ LLSpinCtrl* mEnvironment { nullptr };
+ LLTextBox* mLabelMaskCutoff { nullptr };
+ LLSpinCtrl* mMaskCutoff { nullptr };
+ LLButton* mAddMedia { nullptr };
+ LLButton* mDelMedia { nullptr };
+ LLSpinCtrl* mPBRScaleU { nullptr };
+ LLSpinCtrl* mPBRScaleV { nullptr };
+ LLSpinCtrl* mPBRRotate { nullptr };
+ LLSpinCtrl* mPBROffsetU { nullptr };
+ LLSpinCtrl* mPBROffsetV { nullptr };
+
+ LLButton* mBtnAlign { nullptr };
+ LLButton* mBtnAlignTex { nullptr };
+ LLButton* mBtnPbrFromInv { nullptr };
+ LLButton* mBtnEditBbr { nullptr };
+ LLButton* mBtnSaveBbr { nullptr };
// Update visibility of controls to match current UI mode
// (e.g. materials vs media editing)
@@ -324,6 +374,20 @@ private:
// Hey look everyone, a type-safe alternative to copy and paste! :)
//
+ template<class T>
+ void getChildSetCommitCallback(T*& ctrl, std::string_view name, std::function<void(LLUICtrl*, const LLSD&)> cb)
+ {
+ ctrl = this->getChild<T>(name);
+ ctrl->setCommitCallback(cb);
+ }
+
+ template<class T>
+ void getChildSetClickedCallback(T*& ctrl, std::string_view name, std::function<void(LLUICtrl*, const LLSD&)> cb)
+ {
+ ctrl = this->getChild<T>(name);
+ ctrl->setClickedCallback(cb);
+ }
+
// Update material parameters by applying 'edit_func' to selected TEs
//
template<
@@ -483,7 +547,7 @@ private:
void updateVisibilityGLTF(LLViewerObject* objectp = nullptr);
void updateSelectedGLTFMaterials(std::function<void(LLGLTFMaterial*)> func);
- void updateGLTFTextureTransform(float value, U32 pbr_type, std::function<void(LLGLTFMaterial::TextureTransform*)> edit);
+ void updateGLTFTextureTransform(std::function<void(LLGLTFMaterial::TextureTransform*)> edit);
void setMaterialOverridesFromSelection();
@@ -578,41 +642,41 @@ public:
static void getMaxNormalRepeats(F32& repeats, bool& identical);
static void getCurrentDiffuseAlphaMode(U8& diffuse_alpha_mode, bool& identical, bool diffuse_texture_has_alpha);
- DEF_GET_MAT_STATE(LLUUID,const LLUUID&,getNormalID,LLUUID::null, false, LLUUID::null)
- DEF_GET_MAT_STATE(LLUUID,const LLUUID&,getSpecularID,LLUUID::null, false, LLUUID::null)
- DEF_GET_MAT_STATE(F32,F32,getSpecularRepeatX,1.0f, true, 0.001f)
- DEF_GET_MAT_STATE(F32,F32,getSpecularRepeatY,1.0f, true, 0.001f)
- DEF_GET_MAT_STATE(F32,F32,getSpecularOffsetX,0.0f, true, 0.001f)
- DEF_GET_MAT_STATE(F32,F32,getSpecularOffsetY,0.0f, true, 0.001f)
- DEF_GET_MAT_STATE(F32,F32,getSpecularRotation,0.0f, true, 0.001f)
-
- DEF_GET_MAT_STATE(F32,F32,getNormalRepeatX,1.0f, true, 0.001f)
- DEF_GET_MAT_STATE(F32,F32,getNormalRepeatY,1.0f, true, 0.001f)
- DEF_GET_MAT_STATE(F32,F32,getNormalOffsetX,0.0f, true, 0.001f)
- DEF_GET_MAT_STATE(F32,F32,getNormalOffsetY,0.0f, true, 0.001f)
- DEF_GET_MAT_STATE(F32,F32,getNormalRotation,0.0f, true, 0.001f)
-
- DEF_EDIT_MAT_STATE(U8,U8,setDiffuseAlphaMode);
- DEF_EDIT_MAT_STATE(U8,U8,setAlphaMaskCutoff);
-
- DEF_EDIT_MAT_STATE(F32,F32,setNormalOffsetX);
- DEF_EDIT_MAT_STATE(F32,F32,setNormalOffsetY);
- DEF_EDIT_MAT_STATE(F32,F32,setNormalRepeatX);
- DEF_EDIT_MAT_STATE(F32,F32,setNormalRepeatY);
- DEF_EDIT_MAT_STATE(F32,F32,setNormalRotation);
-
- DEF_EDIT_MAT_STATE(F32,F32,setSpecularOffsetX);
- DEF_EDIT_MAT_STATE(F32,F32,setSpecularOffsetY);
- DEF_EDIT_MAT_STATE(F32,F32,setSpecularRepeatX);
- DEF_EDIT_MAT_STATE(F32,F32,setSpecularRepeatY);
- DEF_EDIT_MAT_STATE(F32,F32,setSpecularRotation);
-
- DEF_EDIT_MAT_STATE(U8,U8,setEnvironmentIntensity);
- DEF_EDIT_MAT_STATE(U8,U8,setSpecularLightExponent);
-
- DEF_EDIT_MAT_STATE(LLUUID,const LLUUID&,setNormalID);
- DEF_EDIT_MAT_STATE(LLUUID,const LLUUID&,setSpecularID);
- DEF_EDIT_MAT_STATE(LLColor4U, const LLColor4U&,setSpecularLightColor);
+ DEF_GET_MAT_STATE(LLUUID, const LLUUID&, getNormalID, LLUUID::null, false, LLUUID::null);
+ DEF_GET_MAT_STATE(LLUUID, const LLUUID&, getSpecularID, LLUUID::null, false, LLUUID::null);
+ DEF_GET_MAT_STATE(F32, F32, getSpecularRepeatX, 1.0f, true, 0.001f);
+ DEF_GET_MAT_STATE(F32, F32, getSpecularRepeatY, 1.0f, true, 0.001f);
+ DEF_GET_MAT_STATE(F32, F32, getSpecularOffsetX, 0.0f, true, 0.001f);
+ DEF_GET_MAT_STATE(F32, F32, getSpecularOffsetY, 0.0f, true, 0.001f);
+ DEF_GET_MAT_STATE(F32, F32, getSpecularRotation, 0.0f, true, 0.001f);
+
+ DEF_GET_MAT_STATE(F32, F32, getNormalRepeatX, 1.0f, true, 0.001f);
+ DEF_GET_MAT_STATE(F32, F32, getNormalRepeatY, 1.0f, true, 0.001f);
+ DEF_GET_MAT_STATE(F32, F32, getNormalOffsetX, 0.0f, true, 0.001f);
+ DEF_GET_MAT_STATE(F32, F32, getNormalOffsetY, 0.0f, true, 0.001f);
+ DEF_GET_MAT_STATE(F32, F32, getNormalRotation, 0.0f, true, 0.001f);
+
+ DEF_EDIT_MAT_STATE(U8, U8, setDiffuseAlphaMode);
+ DEF_EDIT_MAT_STATE(U8, U8, setAlphaMaskCutoff);
+
+ DEF_EDIT_MAT_STATE(F32, F32, setNormalOffsetX);
+ DEF_EDIT_MAT_STATE(F32, F32, setNormalOffsetY);
+ DEF_EDIT_MAT_STATE(F32, F32, setNormalRepeatX);
+ DEF_EDIT_MAT_STATE(F32, F32, setNormalRepeatY);
+ DEF_EDIT_MAT_STATE(F32, F32, setNormalRotation);
+
+ DEF_EDIT_MAT_STATE(F32, F32, setSpecularOffsetX);
+ DEF_EDIT_MAT_STATE(F32, F32, setSpecularOffsetY);
+ DEF_EDIT_MAT_STATE(F32, F32, setSpecularRepeatX);
+ DEF_EDIT_MAT_STATE(F32, F32, setSpecularRepeatY);
+ DEF_EDIT_MAT_STATE(F32, F32, setSpecularRotation);
+
+ DEF_EDIT_MAT_STATE(U8, U8, setEnvironmentIntensity);
+ DEF_EDIT_MAT_STATE(U8, U8, setSpecularLightExponent);
+
+ DEF_EDIT_MAT_STATE(LLUUID, const LLUUID&,setNormalID);
+ DEF_EDIT_MAT_STATE(LLUUID, const LLUUID&,setSpecularID);
+ DEF_EDIT_MAT_STATE(LLColor4U, const LLColor4U&, setSpecularLightColor);
};
class LLSelectedTE
@@ -638,6 +702,8 @@ public:
DEF_GET_TE_STATE(LLTextureEntry::e_texgen,LLTextureEntry::e_texgen,getTexGen,LLTextureEntry::TEX_GEN_DEFAULT, false, LLTextureEntry::TEX_GEN_DEFAULT)
DEF_GET_TE_STATE(LLColor4,const LLColor4&,getColor,LLColor4::white, false, LLColor4::black);
};
+
+ friend struct LLPanelFaceSetTEFunctor;
};
#endif
diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp
index aa35335ad9..0ce1f0f9d3 100644
--- a/indra/newview/llpanelpermissions.cpp
+++ b/indra/newview/llpanelpermissions.cpp
@@ -399,7 +399,7 @@ void LLPanelPermissions::refresh()
// Style for creator and owner links (both group and agent)
LLStyle::Params style_params;
- LLColor4 link_color = LLUIColorTable::instance().getColor("HTMLLinkColor");
+ LLUIColor link_color = LLUIColorTable::instance().getColor("HTMLLinkColor");
style_params.color = link_color;
style_params.readonly_color = link_color;
style_params.is_link = true; // link will be added later
diff --git a/indra/newview/llreflectionmap.cpp b/indra/newview/llreflectionmap.cpp
index 31fd6f3f07..8d164b6883 100644
--- a/indra/newview/llreflectionmap.cpp
+++ b/indra/newview/llreflectionmap.cpp
@@ -220,7 +220,7 @@ F32 LLReflectionMap::getNearClip()
if (mViewerObject && mViewerObject->getVolume())
{
- ret = ((LLVOVolume*)mViewerObject)->getReflectionProbeNearClip();
+ ret = mViewerObject->getReflectionProbeNearClip();
}
else if (mGroup)
{
@@ -240,7 +240,7 @@ bool LLReflectionMap::getIsDynamic()
mViewerObject &&
mViewerObject->getVolume())
{
- return ((LLVOVolume*)mViewerObject)->getReflectionProbeIsDynamic();
+ return mViewerObject->getReflectionProbeIsDynamic();
}
return false;
diff --git a/indra/newview/llscripteditor.cpp b/indra/newview/llscripteditor.cpp
index 6f23477415..59cf3ac02b 100644
--- a/indra/newview/llscripteditor.cpp
+++ b/indra/newview/llscripteditor.cpp
@@ -122,7 +122,7 @@ void LLScriptEditor::drawLineNumbers()
const LLWString ltext = utf8str_to_wstring(llformat("%d", line.mLineNum ));
bool is_cur_line = cursor_line == line.mLineNum;
const U8 style = is_cur_line ? LLFontGL::BOLD : LLFontGL::NORMAL;
- const LLColor4 fg_color = is_cur_line ? mCursorColor : mReadOnlyFgColor;
+ const LLColor4& fg_color = is_cur_line ? mCursorColor : mReadOnlyFgColor;
getScriptFont()->render(
ltext, // string to draw
0, // begin offset
diff --git a/indra/newview/llsculptidsize.cpp b/indra/newview/llsculptidsize.cpp
index 3bc5ad7616..6be05fb003 100644
--- a/indra/newview/llsculptidsize.cpp
+++ b/indra/newview/llsculptidsize.cpp
@@ -29,8 +29,6 @@
#include "llvovolume.h"
#include "lldrawable.h"
#include "llvoavatar.h"
-//boost
-#include "boost/make_shared.hpp"
//...........
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index fcd1c84ba4..342048252f 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -128,12 +128,12 @@ F32 LLSelectMgr::sHighlightAlpha = 0.f;
F32 LLSelectMgr::sHighlightAlphaTest = 0.f;
F32 LLSelectMgr::sHighlightUAnim = 0.f;
F32 LLSelectMgr::sHighlightVAnim = 0.f;
-LLColor4 LLSelectMgr::sSilhouetteParentColor;
-LLColor4 LLSelectMgr::sSilhouetteChildColor;
-LLColor4 LLSelectMgr::sHighlightInspectColor;
-LLColor4 LLSelectMgr::sHighlightParentColor;
-LLColor4 LLSelectMgr::sHighlightChildColor;
-LLColor4 LLSelectMgr::sContextSilhouetteColor;
+LLUIColor LLSelectMgr::sSilhouetteParentColor;
+LLUIColor LLSelectMgr::sSilhouetteChildColor;
+LLUIColor LLSelectMgr::sHighlightInspectColor;
+LLUIColor LLSelectMgr::sHighlightParentColor;
+LLUIColor LLSelectMgr::sHighlightChildColor;
+LLUIColor LLSelectMgr::sContextSilhouetteColor;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// struct LLDeRezInfo
@@ -6437,8 +6437,10 @@ void LLSelectMgr::renderSilhouettes(bool for_hud)
bool wireframe_selection = (gFloaterTools && gFloaterTools->getVisible()) || LLSelectMgr::sRenderHiddenSelections;
F32 fogCfx = (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal() - gAgentCamera.getCameraPositionGlobal()).magVec() / (LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec() * 4), 0.0, 1.0);
- static LLColor4 sParentColor = LLColor4(sSilhouetteParentColor[VRED], sSilhouetteParentColor[VGREEN], sSilhouetteParentColor[VBLUE], LLSelectMgr::sHighlightAlpha);
- static LLColor4 sChildColor = LLColor4(sSilhouetteChildColor[VRED], sSilhouetteChildColor[VGREEN], sSilhouetteChildColor[VBLUE], LLSelectMgr::sHighlightAlpha);
+ LLColor4 sParentColor = sSilhouetteParentColor;
+ sParentColor.mV[VALPHA] = LLSelectMgr::sHighlightAlpha;
+ LLColor4 sChildColor = sSilhouetteChildColor;
+ sChildColor.mV[VALPHA] = LLSelectMgr::sHighlightAlpha;
auto renderMeshSelection_f = [fogCfx, wireframe_selection](LLSelectNode* node, LLViewerObject* objectp, LLColor4 hlColor)
{
@@ -8006,12 +8008,9 @@ S32 LLObjectSelection::getSelectedObjectRenderCost()
cost += object->getRenderCost(textures);
computed_objects.insert(object->getID());
- const_child_list_t children = object->getChildren();
- for (const_child_list_t::const_iterator child_iter = children.begin();
- child_iter != children.end();
- ++child_iter)
+ const const_child_list_t& children = object->getChildren();
+ for (LLViewerObject* child_obj : children)
{
- LLViewerObject* child_obj = *child_iter;
LLVOVolume *child = dynamic_cast<LLVOVolume*>( child_obj );
if (child)
{
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index 355e28595b..f8242675dc 100644
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -44,11 +44,11 @@
#include "llcontrol.h"
#include "llviewerobject.h" // LLObjectSelection::getSelectedTEValue template
#include "llmaterial.h"
+#include "lluicolor.h"
#include <deque>
#include <boost/iterator/filter_iterator.hpp>
#include <boost/signals2.hpp>
-#include <boost/make_shared.hpp> // boost::make_shared
class LLMessageSystem;
class LLViewerTexture;
@@ -450,12 +450,12 @@ public:
static F32 sHighlightAlphaTest;
static F32 sHighlightUAnim;
static F32 sHighlightVAnim;
- static LLColor4 sSilhouetteParentColor;
- static LLColor4 sSilhouetteChildColor;
- static LLColor4 sHighlightParentColor;
- static LLColor4 sHighlightChildColor;
- static LLColor4 sHighlightInspectColor;
- static LLColor4 sContextSilhouetteColor;
+ static LLUIColor sSilhouetteParentColor;
+ static LLUIColor sSilhouetteChildColor;
+ static LLUIColor sHighlightParentColor;
+ static LLUIColor sHighlightChildColor;
+ static LLUIColor sHighlightInspectColor;
+ static LLUIColor sContextSilhouetteColor;
LLCachedControl<bool> mHideSelectedObjects;
LLCachedControl<bool> mRenderHighlightSelections;
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index fdb73efa14..5152570786 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -33,7 +33,6 @@
#include <algorithm>
#include <cstdio>
-#include <boost/make_shared.hpp>
#include "lltrace.h"
#include "llfasttimer.h"
#include "v3colorutil.h"
diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp
index 7775e3d9f6..fccf745a74 100644
--- a/indra/newview/llsidepaneliteminfo.cpp
+++ b/indra/newview/llsidepaneliteminfo.cpp
@@ -351,7 +351,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)
// Style for creator and owner links
LLStyle::Params style_params;
- LLColor4 link_color = LLUIColorTable::instance().getColor("HTMLLinkColor");
+ LLUIColor link_color = LLUIColorTable::instance().getColor("HTMLLinkColor");
style_params.color = link_color;
style_params.readonly_color = link_color;
style_params.is_link = true; // link will be added later
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index ffe5fa394f..b1f80e48af 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -1051,7 +1051,8 @@ public:
LLSpatialGroup* group = (LLSpatialGroup*)base_group;
group->checkOcclusion();
- if (group->getOctreeNode()->getParent() && //never occlusion cull the root node
+ if (group->getOctreeNode() &&
+ group->getOctreeNode()->getParent() && //never occlusion cull the root node
LLPipeline::sUseOcclusion && //ignore occlusion if disabled
group->isOcclusionState(LLSpatialGroup::OCCLUDED))
{
diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp
index 81002139be..4956c188fb 100644
--- a/indra/newview/llspeakers.cpp
+++ b/indra/newview/llspeakers.cpp
@@ -368,8 +368,8 @@ void LLSpeakerMgr::update(bool resort_ok)
return;
}
- LLColor4 speaking_color = LLUIColorTable::instance().getColor("SpeakingColor");
- LLColor4 overdriven_color = LLUIColorTable::instance().getColor("OverdrivenColor");
+ static const LLUIColor speaking_color = LLUIColorTable::instance().getColor("SpeakingColor");
+ static const LLUIColor overdriven_color = LLUIColorTable::instance().getColor("OverdrivenColor");
if(resort_ok) // only allow list changes when user is not interacting with it
{
@@ -377,16 +377,17 @@ void LLSpeakerMgr::update(bool resort_ok)
}
// update status of all current speakers
- bool voice_channel_active = (!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive());
+ LLVoiceClient* voice_client = LLVoiceClient::getInstance();
+ bool voice_channel_active = (!mVoiceChannel && voice_client->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive());
for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); speaker_it++)
{
LLUUID speaker_id = speaker_it->first;
LLSpeaker* speakerp = speaker_it->second;
- if (voice_channel_active && LLVoiceClient::getInstance()->getVoiceEnabled(speaker_id))
+ if (voice_channel_active && voice_client->getVoiceEnabled(speaker_id))
{
- speakerp->mSpeechVolume = LLVoiceClient::getInstance()->getCurrentPower(speaker_id);
- bool moderator_muted_voice = LLVoiceClient::getInstance()->getIsModeratorMuted(speaker_id);
+ speakerp->mSpeechVolume = voice_client->getCurrentPower(speaker_id);
+ bool moderator_muted_voice = voice_client->getIsModeratorMuted(speaker_id);
if (moderator_muted_voice != speakerp->mModeratorMutedVoice)
{
speakerp->mModeratorMutedVoice = moderator_muted_voice;
@@ -394,11 +395,11 @@ void LLSpeakerMgr::update(bool resort_ok)
speakerp->fireEvent(new LLSpeakerVoiceModerationEvent(speakerp));
}
- if (LLVoiceClient::getInstance()->getOnMuteList(speaker_id) || speakerp->mModeratorMutedVoice)
+ if (voice_client->getOnMuteList(speaker_id) || speakerp->mModeratorMutedVoice)
{
speakerp->mStatus = LLSpeaker::STATUS_MUTED;
}
- else if (LLVoiceClient::getInstance()->getIsSpeaking(speaker_id))
+ else if (voice_client->getIsSpeaking(speaker_id))
{
// reset inactivity expiration
if (speakerp->mStatus != LLSpeaker::STATUS_SPEAKING)
@@ -481,17 +482,18 @@ void LLSpeakerMgr::update(bool resort_ok)
void LLSpeakerMgr::updateSpeakerList()
{
// Are we bound to the currently active voice channel?
- if ((!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive()))
+ LLVoiceClient* vocie_client = LLVoiceClient::getInstance();
+ if ((!mVoiceChannel && vocie_client->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive()))
{
std::set<LLUUID> participants;
- LLVoiceClient::getInstance()->getParticipantList(participants);
+ vocie_client->getParticipantList(participants);
// If we are, add all voice client participants to our list of known speakers
for (std::set<LLUUID>::iterator participant_it = participants.begin(); participant_it != participants.end(); ++participant_it)
{
setSpeaker(*participant_it,
- LLVoiceClient::getInstance()->getDisplayName(*participant_it),
+ vocie_client->getDisplayName(*participant_it),
LLSpeaker::STATUS_VOICE_ACTIVE,
- (LLVoiceClient::getInstance()->isParticipantAvatar(*participant_it)?LLSpeaker::SPEAKER_AGENT:LLSpeaker::SPEAKER_EXTERNAL));
+ (vocie_client->isParticipantAvatar(*participant_it)?LLSpeaker::SPEAKER_AGENT:LLSpeaker::SPEAKER_EXTERNAL));
}
}
else if (mVoiceChannel)
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 689c555998..69c40066b4 100644
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -467,14 +467,6 @@ private:
// Locks: Mw (ctor invokes without lock)
void setDesiredDiscard(S32 discard, S32 size);
- // Threads: T*
- // Locks: Mw
- bool insertPacket(S32 index, U8* data, S32 size);
-
- // Locks: Mw
- void clearPackets();
-
-
// Locks: Mw
void removeFromCache();
@@ -592,21 +584,6 @@ private:
// Work Data
LLMutex mWorkMutex;
- struct PacketData
- {
- PacketData(U8* data, S32 size)
- : mData(data), mSize(size)
- {}
- ~PacketData() { clearData(); }
- void clearData() { delete[] mData; mData = NULL; }
-
- U8* mData;
- U32 mSize;
- };
- std::vector<PacketData*> mPackets;
- S32 mFirstPacket;
- S32 mLastPacket;
- U16 mTotalPackets;
U8 mImageCodec;
LLViewerAssetStats::duration_t mMetricsStartTime;
@@ -922,9 +899,6 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher,
mRetryAttempt(0),
mActiveCount(0),
mWorkMutex(),
- mFirstPacket(0),
- mLastPacket(-1),
- mTotalPackets(0),
mImageCodec(IMG_CODEC_INVALID),
mMetricsStartTime(0),
mHttpHandle(LLCORE_HTTP_HANDLE_INVALID),
@@ -980,7 +954,6 @@ LLTextureFetchWorker::~LLTextureFetchWorker()
mFetcher->mTextureCache->writeComplete(mCacheWriteHandle, true);
}
mFormattedImage = NULL;
- clearPackets();
if (mHttpBufferArray)
{
mHttpBufferArray->release();
@@ -992,16 +965,6 @@ LLTextureFetchWorker::~LLTextureFetchWorker()
mFetcher->updateStateStats(mCacheReadCount, mCacheWriteCount, mResourceWaitCount);
}
-// Locks: Mw
-void LLTextureFetchWorker::clearPackets()
-{
- for_each(mPackets.begin(), mPackets.end(), DeletePointer());
- mPackets.clear();
- mTotalPackets = 0;
- mLastPacket = -1;
- mFirstPacket = 0;
-}
-
// Locks: Mw (ctor invokes without lock)
void LLTextureFetchWorker::setDesiredDiscard(S32 discard, S32 size)
{
@@ -1164,7 +1127,6 @@ bool LLTextureFetchWorker::doWork(S32 param)
mHttpReplySize = 0;
mHttpReplyOffset = 0;
mHaveAllData = false;
- clearPackets(); // TODO: Shouldn't be necessary
mCacheReadHandle = LLTextureCache::nullHandle();
mCacheWriteHandle = LLTextureCache::nullHandle();
setState(LOAD_FROM_TEXTURE_CACHE);
@@ -2441,8 +2403,6 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, bool threaded, bool qa_mod
: LLWorkerThread("TextureFetch", threaded, true),
mDebugCount(0),
mDebugPause(false),
- mPacketCount(0),
- mBadPacketCount(0),
mQueueMutex(),
mNetworkQueueMutex(),
mTextureCache(cache),
@@ -3066,43 +3026,6 @@ void LLTextureFetch::threadedUpdate()
#endif
}
-//////////////////////////////////////////////////////////////////////////////
-
-// Threads: T*
-// Locks: Mw
-bool LLTextureFetchWorker::insertPacket(S32 index, U8* data, S32 size)
-{
- LL_PROFILE_ZONE_SCOPED;
- mRequestedDeltaTimer.reset();
- if (index >= mTotalPackets)
- {
-// LL_WARNS(LOG_TXT) << "Received Image Packet " << index << " > max: " << mTotalPackets << " for image: " << mID << LL_ENDL;
- return false;
- }
- if (index > 0 && index < mTotalPackets-1 && size != MAX_IMG_PACKET_SIZE)
- {
-// LL_WARNS(LOG_TXT) << "Received bad sized packet: " << index << ", " << size << " != " << MAX_IMG_PACKET_SIZE << " for image: " << mID << LL_ENDL;
- return false;
- }
-
- if (index >= (S32)mPackets.size())
- {
- mPackets.resize(index+1, (PacketData*)NULL); // initializes v to NULL pointers
- }
- else if (mPackets[index] != NULL)
- {
-// LL_WARNS(LOG_TXT) << "Received duplicate packet: " << index << " for image: " << mID << LL_ENDL;
- return false;
- }
-
- mPackets[index] = new PacketData(data, size);
- while (mLastPacket+1 < (S32)mPackets.size() && mPackets[mLastPacket+1] != NULL)
- {
- ++mLastPacket;
- }
- return true;
-}
-
void LLTextureFetchWorker::setState(e_state new_state)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h
index aebd2f8f95..3405f76e37 100644
--- a/indra/newview/lltexturefetch.h
+++ b/indra/newview/lltexturefetch.h
@@ -293,8 +293,6 @@ public:
LLUUID mDebugID;
S32 mDebugCount;
bool mDebugPause;
- S32 mPacketCount;
- S32 mBadPacketCount;
static LLTrace::CountStatHandle<F64> sCacheHit;
static LLTrace::CountStatHandle<F64> sCacheAttempt;
diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp
index 92527fc3a9..e5a61b359d 100644
--- a/indra/newview/lltextureview.cpp
+++ b/indra/newview/lltextureview.cpp
@@ -323,13 +323,6 @@ void LLTextureBar::draw()
{
LLGLSUIDefault gls_ui;
- // draw the packet data
-// {
-// std::string num_str = llformat("%3d/%3d", mImagep->mLastPacket+1, mImagep->mPackets);
-// LLFontGL::getFontMonospace()->renderUTF8(num_str, 0, bar_left + 100, getRect().getHeight(), color,
-// LLFontGL::LEFT, LLFontGL::TOP);
-// }
-
// draw the image size at the end
{
std::string num_str = llformat("%3dx%3d (%2d) %7d", mImagep->getWidth(), mImagep->getHeight(),
@@ -620,10 +613,9 @@ void LLGLTexMemBar::draw()
//----------------------------------------------------------------------------
- text = llformat("Textures: %d Fetch: %d(%d) Pkts:%d(%d) Cache R/W: %d/%d LFS:%d RAW:%d HTP:%d DEC:%d CRE:%d ",
+ text = llformat("Textures: %d Fetch: %d(%d) Cache R/W: %d/%d LFS:%d RAW:%d HTP:%d DEC:%d CRE:%d ",
gTextureList.getNumImages(),
LLAppViewer::getTextureFetch()->getNumRequests(), LLAppViewer::getTextureFetch()->getNumDeletes(),
- LLAppViewer::getTextureFetch()->mPacketCount, LLAppViewer::getTextureFetch()->mBadPacketCount,
LLAppViewer::getTextureCache()->getNumReads(), LLAppViewer::getTextureCache()->getNumWrites(),
LLLFSThread::sLocal->getPending(),
LLImageRaw::sRawImageCount,
diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp
index 5180b1808c..0063e0b7fd 100644
--- a/indra/newview/lltoolbarview.cpp
+++ b/indra/newview/lltoolbarview.cpp
@@ -566,7 +566,7 @@ void LLToolBarView::draw()
// Draw drop zones if drop of a tool is active
if (isToolDragged())
{
- LLColor4 drop_color = LLUIColorTable::instance().getColor( "ToolbarDropZoneColor" );
+ static const LLUIColor drop_color = LLUIColorTable::instance().getColor( "ToolbarDropZoneColor" );
for (S32 i = LLToolBarEnums::TOOLBAR_FIRST; i <= LLToolBarEnums::TOOLBAR_LAST; i++)
{
diff --git a/indra/newview/llviewerchat.cpp b/indra/newview/llviewerchat.cpp
index 597cf3c98c..8b01c4ef88 100644
--- a/indra/newview/llviewerchat.cpp
+++ b/indra/newview/llviewerchat.cpp
@@ -41,7 +41,7 @@
LLViewerChat::font_change_signal_t LLViewerChat::sChatFontChangedSignal;
//static
-void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color)
+void LLViewerChat::getChatColor(const LLChat& chat, LLUIColor& r_color, F32& r_color_alpha)
{
if(chat.mMuted)
{
@@ -90,7 +90,7 @@ void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color)
}
break;
default:
- r_color.setToWhite();
+ r_color = LLUIColorTable::instance().getColor("White");
}
if (!chat.mPosAgent.isExactlyZero())
@@ -101,7 +101,11 @@ void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color)
if (distance_squared > dist_near_chat * dist_near_chat)
{
// diminish far-off chat
- r_color.mV[VALPHA] = 0.8f;
+ r_color_alpha = 0.8f;
+ }
+ else
+ {
+ r_color_alpha = 1.0f;
}
}
}
diff --git a/indra/newview/llviewerchat.h b/indra/newview/llviewerchat.h
index a84d7dbc5d..6138358caf 100644
--- a/indra/newview/llviewerchat.h
+++ b/indra/newview/llviewerchat.h
@@ -29,15 +29,14 @@
#include "llchat.h"
#include "llfontgl.h"
-#include "v4color.h"
-
+#include "lluicolor.h"
class LLViewerChat
{
public:
typedef boost::signals2::signal<void (LLFontGL*)> font_change_signal_t;
- static void getChatColor(const LLChat& chat, LLColor4& r_color);
+ static void getChatColor(const LLChat& chat, LLUIColor& r_color, F32& r_color_alpha);
static void getChatColor(const LLChat& chat, std::string& r_color_name, F32& r_color_alpha);
static LLFontGL* getChatFont();
static S32 getChatFontSize();
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index c97a512a57..9bdd246129 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -134,6 +134,7 @@
#include "llfloaterscriptlimits.h"
#include "llfloatersearch.h"
#include "llfloatersellland.h"
+#include "llfloatersettingscolor.h"
#include "llfloatersettingsdebug.h"
#include "llfloatersidepanelcontainer.h"
#include "llfloatersnapshot.h"
@@ -486,6 +487,7 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("script_limits", "floater_script_limits.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterScriptLimits>);
LLFloaterReg::add("my_scripts", "floater_my_scripts.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMyScripts>);
LLFloaterReg::add("sell_land", "floater_sell_land.xml", &LLFloaterSellLand::buildFloater);
+ LLFloaterReg::add("settings_color", "floater_settings_color.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSettingsColor>);
LLFloaterReg::add("settings_debug", "floater_settings_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSettingsDebug>);
LLFloaterReg::add("sound_devices", "floater_sound_devices.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSoundDevices>);
LLFloaterReg::add("stats", "floater_stats.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloater>);
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index aa14820d55..529d6f97ca 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -539,9 +539,7 @@ void init_menus()
///
/// set up the colors
///
- LLColor4 color;
-
- LLColor4 context_menu_color = LLUIColorTable::instance().getColor("MenuPopupBgColor");
+ LLUIColor context_menu_color = LLUIColorTable::instance().getColor("MenuPopupBgColor");
gMenuAvatarSelf->setBackgroundColor( context_menu_color );
gMenuAvatarOther->setBackgroundColor( context_menu_color );
@@ -551,7 +549,7 @@ void init_menus()
gMenuLand->setBackgroundColor( context_menu_color );
- color = LLUIColorTable::instance().getColor( "MenuPopupBgColor" );
+ LLUIColor color = LLUIColorTable::instance().getColor( "MenuPopupBgColor" );
gPopupMenuView->setBackgroundColor( color );
// If we are not in production, use a different color to make it apparent.
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index c4fecf8dff..83f8e96f9a 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -547,9 +547,11 @@ void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k)
if (asset_type == LLAssetType::AT_TEXTURE && allow_2k)
{
LLPointer<LLImageFormatted> image_frmted = LLImageFormatted::createFromType(codec);
- if (gDirUtilp->fileExists(filename) && image_frmted->load(filename))
+ if (gDirUtilp->fileExists(filename) && image_frmted && image_frmted->load(filename))
{
- expected_upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost(image_frmted);
+ S32 biased_width = LLImageRaw::biasedDimToPowerOfTwo(image_frmted->getWidth(), LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT);
+ S32 biased_height = LLImageRaw::biasedDimToPowerOfTwo(image_frmted->getHeight(), LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT);
+ expected_upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost(biased_width, biased_height);
resource_upload = true;
}
}
@@ -643,16 +645,15 @@ bool get_bulk_upload_expected_cost(
if (asset_type == LLAssetType::AT_TEXTURE && allow_2k)
{
LLPointer<LLImageFormatted> image_frmted = LLImageFormatted::createFromType(codec);
- if (gDirUtilp->fileExists(filename) && image_frmted->load(filename))
+ if (gDirUtilp->fileExists(filename) && image_frmted && image_frmted->load(filename))
{
- total_cost += LLAgentBenefitsMgr::current().getTextureUploadCost(image_frmted);
- if (image_frmted)
+ S32 biased_width = LLImageRaw::biasedDimToPowerOfTwo(image_frmted->getWidth(), LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT);
+ S32 biased_height = LLImageRaw::biasedDimToPowerOfTwo(image_frmted->getHeight(), LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT);
+ total_cost += LLAgentBenefitsMgr::current().getTextureUploadCost(biased_width, biased_height);
+ S32 area = biased_width * biased_height;
+ if (area >= LLAgentBenefits::MIN_2K_TEXTURE_AREA)
{
- S32 area = image_frmted->getHeight() * image_frmted->getWidth();
- if (area >= LLAgentBenefits::MIN_2K_TEXTURE_AREA)
- {
- textures_2k_count++;
- }
+ textures_2k_count++;
}
file_count++;
}
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index fd85d75d98..a2abd1d930 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -5753,7 +5753,8 @@ LLBBox LLViewerObject::getBoundingBoxAgent() const
}
if (avatar_parent && avatar_parent->isAvatar() &&
- root_edit && root_edit->mDrawable.notNull() && root_edit->mDrawable->getXform()->getParent())
+ root_edit && root_edit->mDrawable.notNull() && !root_edit->mDrawable->isDead() &&
+ root_edit->mDrawable->getXform()->getParent())
{
LLXform* parent_xform = root_edit->mDrawable->getXform()->getParent();
position_agent = (getPositionEdit() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition();
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index 09584d22a8..b6846c6716 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -266,7 +266,11 @@ public:
virtual bool isRiggedMesh() const { return false; }
virtual bool hasLightTexture() const { return false; }
virtual bool isReflectionProbe() const { return false; }
+ virtual F32 getReflectionProbeAmbiance() const { return 0.f; }
+ virtual F32 getReflectionProbeNearClip() const { return 0.f; }
virtual bool getReflectionProbeIsBox() const { return false; }
+ virtual bool getReflectionProbeIsDynamic() const { return false; };
+ virtual bool getReflectionProbeIsMirror() const { return false; };
// This method returns true if the object is over land owned by
// the agent, one of its groups, or it encroaches and
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index cda8c99594..435bd60917 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -889,6 +889,7 @@ void LLViewerObjectList::update(LLAgent &agent)
static std::vector<LLViewerObject*> idle_list;
U32 idle_count = 0;
+ mNumAvatars = 0;
{
for (std::vector<LLPointer<LLViewerObject> >::iterator active_iter = mActiveObjects.begin();
@@ -906,6 +907,10 @@ void LLViewerObjectList::update(LLAgent &agent)
idle_list[idle_count] = objectp;
}
++idle_count;
+ if (objectp->isAvatar())
+ {
+ mNumAvatars++;
+ }
}
else
{ // There shouldn't be any NULL pointers in the list, but they have caused
@@ -1715,15 +1720,15 @@ void LLViewerObjectList::clearAllMapObjectsInRegion(LLViewerRegion* regionp)
void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap)
{
- LLColor4 above_water_color = LLUIColorTable::instance().getColor( "NetMapOtherOwnAboveWater" );
- LLColor4 below_water_color = LLUIColorTable::instance().getColor( "NetMapOtherOwnBelowWater" );
- LLColor4 you_own_above_water_color =
+ static const LLUIColor above_water_color = LLUIColorTable::instance().getColor( "NetMapOtherOwnAboveWater" );
+ static const LLUIColor below_water_color = LLUIColorTable::instance().getColor( "NetMapOtherOwnBelowWater" );
+ static const LLUIColor you_own_above_water_color =
LLUIColorTable::instance().getColor( "NetMapYouOwnAboveWater" );
- LLColor4 you_own_below_water_color =
+ static const LLUIColor you_own_below_water_color =
LLUIColorTable::instance().getColor( "NetMapYouOwnBelowWater" );
- LLColor4 group_own_above_water_color =
+ static const LLUIColor group_own_above_water_color =
LLUIColorTable::instance().getColor( "NetMapGroupOwnAboveWater" );
- LLColor4 group_own_below_water_color =
+ static const LLUIColor group_own_below_water_color =
LLUIColorTable::instance().getColor( "NetMapGroupOwnBelowWater" );
F32 max_radius = gSavedSettings.getF32("MiniMapPrimMaxRadius");
@@ -1753,7 +1758,7 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap)
// See DEV-17370 and DEV-29869/SNOW-79 for details.
approx_radius = llmin(approx_radius, max_radius);
- LLColor4U color = above_water_color;
+ LLColor4U color = above_water_color.get();
if( objectp->permYouOwner() )
{
const F32 MIN_RADIUS_FOR_OWNED_OBJECTS = 2.f;
@@ -1766,29 +1771,29 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap)
{
if ( objectp->permGroupOwner() )
{
- color = group_own_above_water_color;
+ color = group_own_above_water_color.get();
}
else
{
- color = you_own_above_water_color;
+ color = you_own_above_water_color.get();
}
}
else
{
if ( objectp->permGroupOwner() )
{
- color = group_own_below_water_color;
+ color = group_own_below_water_color.get();
}
else
{
- color = you_own_below_water_color;
+ color = you_own_below_water_color.get();
}
}
}
else
if( pos.mdV[VZ] < water_height )
{
- color = below_water_color;
+ color = below_water_color.get();
}
netmap.renderScaledPointGlobal(
diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h
index ebdfd0d369..7dfa94b99f 100644
--- a/indra/newview/llviewerobjectlist.h
+++ b/indra/newview/llviewerobjectlist.h
@@ -145,6 +145,7 @@ public:
S32 getOrphanParentCount() const { return (S32) mOrphanParents.size(); }
S32 getOrphanCount() const { return mNumOrphans; }
+ S32 getAvatarCount() const { return mNumAvatars; }
void orphanize(LLViewerObject *childp, U32 parent_id, U32 ip, U32 port);
void findOrphans(LLViewerObject* objectp, U32 ip, U32 port);
@@ -191,6 +192,7 @@ protected:
std::vector<U64> mOrphanParents; // LocalID/ip,port of orphaned objects
std::vector<OrphanInfo> mOrphanChildren; // UUID's of orphaned objects
S32 mNumOrphans;
+ S32 mNumAvatars;
typedef std::vector<LLPointer<LLViewerObject> > vobj_list_t;
diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp
index 58b8a5b677..2e9b5de72b 100755
--- a/indra/newview/llviewerparceloverlay.cpp
+++ b/indra/newview/llviewerparceloverlay.cpp
@@ -53,6 +53,14 @@
static const U8 OVERLAY_IMG_COMPONENTS = 4;
static const F32 LINE_WIDTH = 0.0625f;
+bool LLViewerParcelOverlay::sColorSetInitialized = false;
+LLUIColor LLViewerParcelOverlay::sAvailColor;
+LLUIColor LLViewerParcelOverlay::sOwnedColor;
+LLUIColor LLViewerParcelOverlay::sGroupColor;
+LLUIColor LLViewerParcelOverlay::sSelfColor;
+LLUIColor LLViewerParcelOverlay::sForSaleColor;
+LLUIColor LLViewerParcelOverlay::sAuctionColor;
+
LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_width_meters)
: mRegion( region ),
mParcelGridsPerEdge( S32( region_width_meters / PARCEL_GRID_STEP_METERS ) ),
@@ -60,6 +68,17 @@ LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_
mTimeSinceLastUpdate(),
mOverlayTextureIdx(-1)
{
+ if (!sColorSetInitialized)
+ {
+ sColorSetInitialized = true;
+ sAvailColor = LLUIColorTable::instance().getColor("PropertyColorAvail").get();
+ sOwnedColor = LLUIColorTable::instance().getColor("PropertyColorOther").get();
+ sGroupColor = LLUIColorTable::instance().getColor("PropertyColorGroup").get();
+ sSelfColor = LLUIColorTable::instance().getColor("PropertyColorSelf").get();
+ sForSaleColor = LLUIColorTable::instance().getColor("PropertyColorForSale").get();
+ sAuctionColor = LLUIColorTable::instance().getColor("PropertyColorAuction").get();
+ }
+
// Create a texture to hold color information.
// 4 components
// Use mipmaps = false, clamped, NEAREST filter, for sharp edges
@@ -321,12 +340,12 @@ void LLViewerParcelOverlay::updateOverlayTexture()
mOverlayTextureIdx = 0;
}
- const LLColor4U avail = LLUIColorTable::instance().getColor("PropertyColorAvail").get();
- const LLColor4U owned = LLUIColorTable::instance().getColor("PropertyColorOther").get();
- const LLColor4U group = LLUIColorTable::instance().getColor("PropertyColorGroup").get();
- const LLColor4U self = LLUIColorTable::instance().getColor("PropertyColorSelf").get();
- const LLColor4U for_sale = LLUIColorTable::instance().getColor("PropertyColorForSale").get();
- const LLColor4U auction = LLUIColorTable::instance().getColor("PropertyColorAuction").get();
+ const LLColor4U avail = sAvailColor.get();
+ const LLColor4U owned = sOwnedColor.get();
+ const LLColor4U group = sGroupColor.get();
+ const LLColor4U self = sSelfColor.get();
+ const LLColor4U for_sale = sForSaleColor.get();
+ const LLColor4U auction = sAuctionColor.get();
// Create the base texture.
U8 *raw = mImageRaw->getData();
@@ -339,7 +358,7 @@ void LLViewerParcelOverlay::updateOverlayTexture()
{
U8 ownership = mOwnership[i];
- F32 r,g,b,a;
+ U8 r,g,b,a;
// Color stored in low three bits
switch( ownership & 0x7 )
@@ -433,11 +452,11 @@ void LLViewerParcelOverlay::updatePropertyLines()
return;
LLColor4U colors[PARCEL_COLOR_MASK + 1];
- colors[PARCEL_SELF] = LLUIColorTable::instance().getColor("PropertyColorSelf").get();
- colors[PARCEL_OWNED] = LLUIColorTable::instance().getColor("PropertyColorOther").get();
- colors[PARCEL_GROUP] = LLUIColorTable::instance().getColor("PropertyColorGroup").get();
- colors[PARCEL_FOR_SALE] = LLUIColorTable::instance().getColor("PropertyColorForSale").get();
- colors[PARCEL_AUCTION] = LLUIColorTable::instance().getColor("PropertyColorAuction").get();
+ colors[PARCEL_SELF] = sSelfColor.get();
+ colors[PARCEL_OWNED] = sOwnedColor.get();
+ colors[PARCEL_GROUP] = sGroupColor.get();
+ colors[PARCEL_FOR_SALE] = sForSaleColor.get();
+ colors[PARCEL_AUCTION] = sAuctionColor.get();
mEdges.clear();
diff --git a/indra/newview/llviewerparceloverlay.h b/indra/newview/llviewerparceloverlay.h
index d78005e376..03ae464cb8 100644
--- a/indra/newview/llviewerparceloverlay.h
+++ b/indra/newview/llviewerparceloverlay.h
@@ -35,6 +35,7 @@
#include "lluuid.h"
#include "llviewertexture.h"
#include "llgl.h"
+#include "lluicolor.h"
class LLViewerRegion;
class LLVector3;
@@ -123,6 +124,14 @@ private:
};
std::vector<Edge> mEdges;
+
+ static bool sColorSetInitialized;
+ static LLUIColor sAvailColor;
+ static LLUIColor sOwnedColor;
+ static LLUIColor sGroupColor;
+ static LLUIColor sSelfColor;
+ static LLUIColor sForSaleColor;
+ static LLUIColor sAuctionColor;
};
#endif
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp
index 15902e8a87..14228b469f 100644
--- a/indra/newview/llviewertexteditor.cpp
+++ b/indra/newview/llviewertexteditor.cpp
@@ -222,15 +222,9 @@ public:
image_rect.mTop = image_rect.mBottom + mImage->getHeight();
mImage->draw(LLRect((S32)image_rect.mLeft, (S32)image_rect.mTop, (S32)image_rect.mRight, (S32)image_rect.mBottom));
- LLColor4 color;
- if (mEditor.getReadOnly())
- {
- color = LLUIColorTable::instance().getColor("TextEmbeddedItemReadOnlyColor");
- }
- else
- {
- color = LLUIColorTable::instance().getColor("TextEmbeddedItemColor");
- }
+ static const LLUIColor embedded_item_readonly_col = LLUIColorTable::instance().getColor("TextEmbeddedItemReadOnlyColor");
+ static const LLUIColor embedded_item_col = LLUIColorTable::instance().getColor("TextEmbeddedItemColor");
+ const LLColor4& color = mEditor.getReadOnly() ? embedded_item_readonly_col : embedded_item_col;
F32 right_x;
mStyle->getFont()->render(mLabel, 0, image_rect.mRight + EMBEDDED_ITEM_LABEL_PADDING, draw_rect.mTop, color, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::UNDERLINE, LLFontGL::NO_SHADOW, static_cast<S32>(mLabel.length()), S32_MAX, &right_x);
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 1369e3d306..98da378c0d 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -540,9 +540,9 @@ void LLViewerTexture::updateClass()
LL_WARNS() << "Low system memory detected, emergency downrezzing off screen textures" << LL_ENDL;
sDesiredDiscardBias = llmax(sDesiredDiscardBias, 1.5f);
- for (auto image : gTextureList)
+ for (auto& image : gTextureList)
{
- gTextureList.updateImageDecodePriority(image);
+ gTextureList.updateImageDecodePriority(image, false /*will modify gTextureList otherwise!*/);
}
}
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index d31c53d000..7047ce7d29 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -904,7 +904,7 @@ void LLViewerTextureList::clearFetchingRequests()
extern bool gCubeSnapshot;
-void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imagep)
+void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imagep, bool flush_images)
{
if (imagep->isInDebug() || imagep->isUnremovable())
{
@@ -938,9 +938,9 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
onFace = true;
F32 radius;
F32 cos_angle_to_view_dir;
- bool in_frustum = face->calcPixelArea(cos_angle_to_view_dir, radius);
static LLCachedControl<F32> bias_unimportant_threshold(gSavedSettings, "TextureBiasUnimportantFactor", 0.25f);
F32 vsize = face->getPixelArea();
+ bool in_frustum = face->calcPixelArea(cos_angle_to_view_dir, radius);
// Scale desired texture resolution higher or lower depending on texture scale
//
@@ -948,7 +948,9 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
// shows one letter at a time
//
// Maximum usage examples: huge chunk of terrain repeats texture
- const LLTextureEntry* te = face->getTextureEntry();
+ S32 te_offset = face->getTEOffset(); // offset is -1 if not inited
+ LLViewerObject* objp = face->getViewerObject();
+ const LLTextureEntry* te = (te_offset < 0 || te_offset >= objp->getNumTEs()) ? nullptr : objp->getTE(te_offset);
F32 min_scale = te ? llmin(fabsf(te->getScaleS()), fabsf(te->getScaleT())) : 1.f;
min_scale = llclamp(min_scale * min_scale, texture_scale_min(), texture_scale_max());
vsize /= min_scale;
@@ -991,7 +993,7 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
// Flush formatted images using a lazy flush
//
S32 num_refs = imagep->getNumRefs();
- if (num_refs == min_refs)
+ if (num_refs == min_refs && flush_images)
{
if (imagep->getLastReferencedTimer()->getElapsedTimeF32() > lazy_flush_timeout)
{
diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h
index 075f6ae915..b614753b4f 100644
--- a/indra/newview/llviewertexturelist.h
+++ b/indra/newview/llviewertexturelist.h
@@ -148,7 +148,7 @@ public:
// - updates decode priority
// - updates desired discard level
// - cleans up textures that haven't been referenced in awhile
- void updateImageDecodePriority(LLViewerFetchedTexture* imagep);
+ void updateImageDecodePriority(LLViewerFetchedTexture* imagep, bool flush_images = true);
private:
F32 updateImagesCreateTextures(F32 max_time);
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 4bd1b98569..b13ccda5e0 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2190,7 +2190,7 @@ void LLViewerWindow::initWorldUI()
gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP | FOLLOWS_RIGHT);
gStatusBar->setShape(status_bar_container->getLocalRect());
// sync bg color with menu bar
- gStatusBar->setBackgroundColor(gMenuBarView->getBackgroundColor().get());
+ gStatusBar->setBackgroundColor(gMenuBarView->getBackgroundColor());
// add InBack so that gStatusBar won't be drawn over menu
status_bar_container->addChildInBack(gStatusBar, 2/*tab order, after menu*/);
status_bar_container->setVisible(true);
@@ -2199,7 +2199,7 @@ void LLViewerWindow::initWorldUI()
LLView* nav_bar_container = getRootView()->getChild<LLView>("nav_bar_container");
navbar->setShape(nav_bar_container->getLocalRect());
- navbar->setBackgroundColor(gMenuBarView->getBackgroundColor().get());
+ navbar->setBackgroundColor(gMenuBarView->getBackgroundColor());
nav_bar_container->addChild(navbar);
nav_bar_container->setVisible(true);
}
@@ -2583,7 +2583,7 @@ void LLViewerWindow::setNormalControlsVisible( bool visible )
void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid)
{
LLSD args;
- LLColor4 new_bg_color;
+ LLUIColor new_bg_color;
// god more important than project, proj more important than grid
if ( god_mode )
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 6e6ad485cf..09375a6930 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -2631,6 +2631,29 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time)
}
// Update should be happening max once per frame.
+ static LLCachedControl<S32> refreshPeriod(gSavedSettings, "AvatarExtentRefreshPeriodBatch");
+ static LLCachedControl<S32> refreshMaxPerPeriod(gSavedSettings, "AvatarExtentRefreshMaxPerBatch");
+ static S32 upd_freq = refreshPeriod; // initialise to a reasonable default of 1 batch
+ static S32 lastRecalibrationFrame{ 0 };
+
+ const S32 thisFrame = LLDrawable::getCurrentFrame();
+ if (thisFrame - lastRecalibrationFrame >= upd_freq)
+ {
+ // Only update at the start of a cycle. .
+ // update frequency = ((Num_Avatars -1 / NumberPerPeriod) + 1 ) * Periodicity
+ // Given NumberPerPeriod = 5 and Periodicity = 4
+ // | NumAvatars | frequency |
+ // +-------------+-----------+
+ // | 1 | 4 |
+ // | 2 | 4 |
+ // | 5 | 4 |
+ // | 10 | 8 |
+ // | 25 | 20 |
+
+ upd_freq = (((gObjectList.getAvatarCount() - 1) / refreshMaxPerPeriod) + 1)*refreshPeriod;
+ lastRecalibrationFrame = thisFrame;
+ }
+
if ((mLastAnimExtents[0]==LLVector3())||
(mLastAnimExtents[1])==LLVector3())
{
@@ -2638,8 +2661,9 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time)
}
else
{
- const S32 upd_freq = 4; // force update every upd_freq frames.
- mNeedsExtentUpdate = ((LLDrawable::getCurrentFrame()+mID.mData[0])%upd_freq==0);
+ // Update extent if necessary.
+ // if the frame counnter + the first byte of the UUID % upd_freq = 0 then update the extent.
+ mNeedsExtentUpdate = ((thisFrame + mID.mData[0]) % upd_freq == 0);
}
LLScopedContextString str("avatar_idle_update " + getFullname());
@@ -2818,7 +2842,7 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled, const LLVector3 &
// Notice the calls to "gAwayTimer.reset()". This resets the timer that determines how long the avatar has been
// "away", so that the avatar doesn't lapse into away-mode (and slump over) while the user is still talking.
//-----------------------------------------------------------------------------------------------------------------
- if (LLVoiceClient::getInstance()->getIsSpeaking( mID ))
+ if (LLVoiceClient::getInstance()->getIsSpeaking( mID ) && (!isInMuteList() || isSelf()))
{
if (!mVoiceVisualizer->getCurrentlySpeaking())
{
@@ -3057,30 +3081,15 @@ void LLVOAvatar::idleUpdateAppearanceAnimation()
}
else
{
- F32 morph_amt = calcMorphAmount();
- LLVisualParam *param;
-
if (!isSelf())
{
+ F32 morph_amt = calcMorphAmount();
// animate only top level params for non-self avatars
- for (param = getFirstVisualParam();
- param;
- param = getNextVisualParam())
- {
- if (param->isTweakable())
- {
- param->animate(morph_amt);
- }
- }
+ animateTweakableVisualParams(morph_amt);
}
// apply all params
- for (param = getFirstVisualParam();
- param;
- param = getNextVisualParam())
- {
- param->apply(avatar_sex);
- }
+ applyAllVisualParams(avatar_sex);
mLastAppearanceBlendTime = appearance_anim_time;
}
@@ -3088,7 +3097,7 @@ void LLVOAvatar::idleUpdateAppearanceAnimation()
}
}
-F32 LLVOAvatar::calcMorphAmount()
+F32 LLVOAvatar::calcMorphAmount() const
{
F32 appearance_anim_time = mAppearanceMorphTimer.getElapsedTimeF32();
F32 blend_frac = calc_bouncy_animation(appearance_anim_time / APPEARANCE_MORPH_TIME);
@@ -3145,7 +3154,7 @@ void LLVOAvatar::idleUpdateLipSync(bool voice_enabled)
void LLVOAvatar::idleUpdateLoadingEffect()
{
// update visibility when avatar is partially loaded
- if (updateIsFullyLoaded()) // changed?
+ if (!mFullyLoaded && updateIsFullyLoaded()) // Avoid repeat calculations by checking if mFullyLoaded is true first.
{
if (isFullyLoaded())
{
@@ -3395,7 +3404,7 @@ void LLVOAvatar::idleUpdateNameTagText(bool new_name)
{
is_muted = isInMuteList();
}
- bool is_friend = LLAvatarTracker::instance().isBuddy(getID());
+ bool is_friend = isBuddy();
bool is_cloud = getIsCloud();
if (is_appearance != mNameAppearance)
@@ -3531,7 +3540,9 @@ void LLVOAvatar::idleUpdateNameTagText(bool new_name)
std::deque<LLChat>::iterator chat_iter = mChats.begin();
mNameText->clearString();
- LLColor4 new_chat = LLUIColorTable::instance().getColor( isSelf() ? "UserChatColor" : "AgentChatColor" );
+ static const LLUIColor user_chat_color = LLUIColorTable::instance().getColor("UserChatColor");
+ static const LLUIColor agent_chat_color = LLUIColorTable::instance().getColor("AgentChatColor");
+ const LLColor4& new_chat = isSelf() ? user_chat_color : agent_chat_color;
LLColor4 normal_chat = lerp(new_chat, LLColor4(0.8f, 0.8f, 0.8f, 1.f), 0.7f);
LLColor4 old_chat = lerp(normal_chat, LLColor4(0.6f, 0.6f, 0.6f, 1.f), 0.7f);
if (mTyping && mChats.size() >= MAX_BUBBLE_CHAT_UTTERANCES)
@@ -8452,7 +8463,7 @@ bool LLVOAvatar::isTooComplex() const
{
bool too_complex;
static LLCachedControl<S32> compelxity_render_mode(gSavedSettings, "RenderAvatarComplexityMode");
- bool render_friend = (LLAvatarTracker::instance().isBuddy(getID()) && compelxity_render_mode > AV_RENDER_LIMIT_BY_COMPLEXITY);
+ bool render_friend = (isBuddy() && compelxity_render_mode > AV_RENDER_LIMIT_BY_COMPLEXITY);
if (isSelf() || render_friend || mVisuallyMuteSetting == AV_ALWAYS_RENDER)
{
@@ -8488,7 +8499,7 @@ bool LLVOAvatar::isTooSlow() const
static LLCachedControl<S32> compelxity_render_mode(gSavedSettings, "RenderAvatarComplexityMode");
static LLCachedControl<bool> friends_only(gSavedSettings, "RenderAvatarFriendsOnly", false);
- bool is_friend = LLAvatarTracker::instance().isBuddy(getID());
+ bool is_friend = isBuddy();
bool render_friend = is_friend && compelxity_render_mode > AV_RENDER_LIMIT_BY_COMPLEXITY;
if (render_friend || mVisuallyMuteSetting == AV_ALWAYS_RENDER)
@@ -8545,7 +8556,7 @@ void LLVOAvatar::updateTooSlow()
if(!mTooSlowWithoutShadows) // if we were not previously above the full impostor cap
{
bool always_render_friends = compelxity_render_mode > AV_RENDER_LIMIT_BY_COMPLEXITY;
- bool render_friend_or_exception = (always_render_friends && LLAvatarTracker::instance().isBuddy( id ) ) ||
+ bool render_friend_or_exception = (always_render_friends && isBuddy()) ||
( getVisualMuteSettings() == LLVOAvatar::AV_ALWAYS_RENDER );
if( (!isSelf() || allowSelfImpostor) && !render_friend_or_exception)
{
@@ -10623,18 +10634,19 @@ void showRigInfoTabExtents(LLVOAvatar *avatar, LLJointRiggingInfoTab& tab, S32&
void LLVOAvatar::getAssociatedVolumes(std::vector<LLVOVolume*>& volumes)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
- for ( LLVOAvatar::attachment_map_t::iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter )
+ for (const auto& iter : mAttachmentPoints)
{
- LLViewerJointAttachment* attachment = iter->second;
+ LLViewerJointAttachment* attachment = iter.second;
LLViewerJointAttachment::attachedobjs_vec_t::iterator attach_end = attachment->mAttachedObjects.end();
- for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attach_iter = attachment->mAttachedObjects.begin();
- attach_iter != attach_end; ++attach_iter)
+ for (LLViewerObject* attached_object : attachment->mAttachedObjects)
{
- LLViewerObject* attached_object = attach_iter->get();
- LLVOVolume *volume = dynamic_cast<LLVOVolume*>(attached_object);
- if (volume)
+ if (attached_object->isDead())
+ continue;
+
+ if (attached_object->getPCode() == LL_PCODE_VOLUME)
{
+ LLVOVolume* volume = (LLVOVolume*)attached_object;
volumes.push_back(volume);
if (volume->isAnimatedObject())
{
@@ -10644,15 +10656,12 @@ void LLVOAvatar::getAssociatedVolumes(std::vector<LLVOVolume*>& volumes)
continue;
}
}
- LLViewerObject::const_child_list_t& children = attached_object->getChildren();
- for (LLViewerObject::const_child_list_t::const_iterator it = children.begin();
- it != children.end(); ++it)
+
+ for (LLViewerObject* childp : attached_object->getChildren())
{
- LLViewerObject *childp = *it;
- LLVOVolume *volume = dynamic_cast<LLVOVolume*>(childp);
- if (volume)
+ if (!childp->isDead() && childp->getPCode() == LL_PCODE_VOLUME)
{
- volumes.push_back(volume);
+ volumes.push_back((LLVOVolume*)childp);
}
}
}
@@ -10691,42 +10700,40 @@ void LLVOAvatar::updateRiggingInfo()
getAssociatedVolumes(volumes);
- std::map<LLUUID,S32> curr_rigging_info_key;
+ std::map<LLUUID, S32> curr_rigging_info_key;
+
+ // Get current rigging info key
+ for (LLVOVolume* vol : volumes)
{
- // Get current rigging info key
- for (std::vector<LLVOVolume*>::iterator it = volumes.begin(); it != volumes.end(); ++it)
+ if (vol->isMesh() && vol->getVolume())
{
- LLVOVolume *vol = *it;
- if (vol->isMesh() && vol->getVolume())
- {
- const LLUUID& mesh_id = vol->getVolume()->getParams().getSculptID();
- S32 max_lod = llmax(vol->getLOD(), vol->mLastRiggingInfoLOD);
- curr_rigging_info_key[mesh_id] = max_lod;
- }
+ const LLUUID& mesh_id = vol->getVolume()->getParams().getSculptID();
+ S32 max_lod = llmax(vol->getLOD(), vol->mLastRiggingInfoLOD);
+ curr_rigging_info_key[mesh_id] = max_lod;
}
+ }
- // Check for key change, which indicates some change in volume composition or LOD.
- if (curr_rigging_info_key == mLastRiggingInfoKey)
- {
- return;
- }
+ // Check for key change, which indicates some change in volume composition or LOD.
+ if (curr_rigging_info_key == mLastRiggingInfoKey)
+ {
+ return;
}
// Something changed. Update.
mLastRiggingInfoKey = curr_rigging_info_key;
mJointRiggingInfoTab.clear();
- for (std::vector<LLVOVolume*>::iterator it = volumes.begin(); it != volumes.end(); ++it)
+ for (LLVOVolume* vol : volumes)
{
- LLVOVolume *vol = *it;
vol->updateRiggingInfo();
mJointRiggingInfoTab.merge(vol->mJointRiggingInfoTab);
}
//LL_INFOS() << "done update rig count is " << countRigInfoTab(mJointRiggingInfoTab) << LL_ENDL;
- LL_DEBUGS("RigSpammish") << getFullname() << " after update rig tab:" << LL_ENDL;
- S32 joint_count, box_count;
- showRigInfoTabExtents(this, mJointRiggingInfoTab, joint_count, box_count);
- LL_DEBUGS("RigSpammish") << "uses " << joint_count << " joints " << " nonzero boxes: " << box_count << LL_ENDL;
+ // Remove debug only stuff on hot path
+ // LL_DEBUGS("RigSpammish") << getFullname() << " after update rig tab:" << LL_ENDL;
+ // S32 joint_count, box_count;
+ // showRigInfoTabExtents(this, mJointRiggingInfoTab, joint_count, box_count);
+ // LL_DEBUGS("RigSpammish") << "uses " << joint_count << " joints " << " nonzero boxes: " << box_count << LL_ENDL;
}
// virtual
@@ -11489,7 +11496,7 @@ void LLVOAvatar::calcMutedAVColor()
new_color = LLColor4::grey4;
change_msg = " not rendered: color is grey4";
}
- else if (LLMuteList::getInstance()->isMuted(av_id)) // the user blocked them
+ else if (isInMuteList()) // the user blocked them
{
// blocked avatars are dark grey
new_color = LLColor4::grey4;
@@ -11738,6 +11745,20 @@ F32 LLVOAvatar::getAverageGPURenderTime()
bool LLVOAvatar::isBuddy() const
{
- return LLAvatarTracker::instance().isBuddy(getID());
+ bool is_friend = false;
+ F64 now = LLFrameTimer::getTotalSeconds();
+ if (now < mCachedBuddyListUpdateTime)
+ {
+ is_friend = mCachedInBuddyList;
+ }
+ else
+ {
+ is_friend = LLAvatarTracker::instance().isBuddy(getID());
+
+ const F64 SECONDS_BETWEEN_BUDDY_UPDATES = 1;
+ mCachedBuddyListUpdateTime = now + SECONDS_BETWEEN_BUDDY_UPDATES;
+ mCachedInBuddyList = is_friend;
+ }
+ return is_friend;
}
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 1ca8b81553..aa6aee0de5 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -422,7 +422,7 @@ protected:
bool updateIsFullyLoaded();
bool processFullyLoadedChange(bool loading);
void updateRuthTimer(bool loading);
- F32 calcMorphAmount();
+ F32 calcMorphAmount() const;
private:
bool mFirstFullyVisible;
@@ -587,6 +587,8 @@ private:
mutable bool mCachedInMuteList;
mutable F64 mCachedMuteListUpdateTime;
+ mutable bool mCachedInBuddyList = false;
+ mutable F64 mCachedBuddyListUpdateTime = 0.0;
VisualMuteSettings mVisuallyMuteSetting; // Always or never visually mute this AV
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index b95e43da8d..5914303e80 100644
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -187,13 +187,13 @@ void LLVoiceChannel::handleError(EStatusType type)
setState(STATE_ERROR);
}
-bool LLVoiceChannel::isActive()
+bool LLVoiceChannel::isActive() const
{
// only considered active when currently bound channel matches what our channel
return callStarted() && LLVoiceClient::getInstance()->isCurrentChannel(mChannelInfo);
}
-bool LLVoiceChannel::callStarted()
+bool LLVoiceChannel::callStarted() const
{
return mState >= STATE_CALL_STARTED;
}
@@ -662,7 +662,7 @@ LLVoiceChannelProximal::LLVoiceChannelProximal() :
{
}
-bool LLVoiceChannelProximal::isActive()
+bool LLVoiceChannelProximal::isActive() const
{
return callStarted() && LLVoiceClient::getInstance()->inProximalChannel();
}
@@ -768,6 +768,7 @@ LLVoiceChannelP2P::LLVoiceChannelP2P(const LLUUID &session_id,
mReceivedCall(false),
mOutgoingCallInterface(outgoing_call_interface)
{
+ mChannelInfo = LLVoiceClient::getInstance()->getP2PChannelInfoTemplate(other_user_id);
}
void LLVoiceChannelP2P::handleStatusChange(EStatusType type)
diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h
index 6af1bd57a3..d50a6f589a 100644
--- a/indra/newview/llvoicechannel.h
+++ b/indra/newview/llvoicechannel.h
@@ -74,8 +74,8 @@ public:
virtual void activate();
virtual void setChannelInfo(const LLSD &channelInfo);
virtual void requestChannelInfo();
- virtual bool isActive();
- virtual bool callStarted();
+ virtual bool isActive() const;
+ virtual bool callStarted() const;
// Session name is a UI label used for feedback about which person,
// group, or phone number you are talking to
@@ -170,7 +170,7 @@ class LLVoiceChannelProximal : public LLVoiceChannel, public LLSingleton<LLVoice
void onChange(EStatusType status, const LLSD &channelInfo, bool proximal) override;
void handleStatusChange(EStatusType status) override;
void handleError(EStatusType status) override;
- bool isActive() override;
+ bool isActive() const override;
void activate() override;
void deactivate() override;
};
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index 4b299a51f5..21f469abb3 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -281,10 +281,8 @@ void LLVoiceClient::setNonSpatialVoiceModule(const std::string &voice_server_typ
void LLVoiceClient::setHidden(bool hidden)
{
- if (mSpatialVoiceModule)
- {
- mSpatialVoiceModule->setHidden(hidden);
- }
+ LLWebRTCVoiceClient::getInstance()->setHidden(hidden);
+ LLVivoxVoiceClient::getInstance()->setHidden(hidden);
}
void LLVoiceClient::terminate()
@@ -408,13 +406,13 @@ const LLVoiceDeviceList& LLVoiceClient::getRenderDevices()
//--------------------------------------------------
// participants
-void LLVoiceClient::getParticipantList(std::set<LLUUID> &participants)
+void LLVoiceClient::getParticipantList(std::set<LLUUID> &participants) const
{
LLWebRTCVoiceClient::getInstance()->getParticipantList(participants);
LLVivoxVoiceClient::getInstance()->getParticipantList(participants);
}
-bool LLVoiceClient::isParticipant(const LLUUID &speaker_id)
+bool LLVoiceClient::isParticipant(const LLUUID &speaker_id) const
{
return LLWebRTCVoiceClient::getInstance()->isParticipant(speaker_id) ||
LLVivoxVoiceClient::getInstance()->isParticipant(speaker_id);
@@ -718,12 +716,12 @@ void LLVoiceClient::toggleUserPTTState(void)
//-------------------------------------------
// nearby speaker accessors
-bool LLVoiceClient::getVoiceEnabled(const LLUUID& id)
+bool LLVoiceClient::getVoiceEnabled(const LLUUID& id) const
{
return isParticipant(id);
}
-std::string LLVoiceClient::getDisplayName(const LLUUID& id)
+std::string LLVoiceClient::getDisplayName(const LLUUID& id) const
{
std::string result = LLWebRTCVoiceClient::getInstance()->getDisplayName(id);
if (result.empty())
@@ -826,7 +824,7 @@ void LLVoiceClient::removeObserver(LLVoiceClientParticipantObserver* observer)
LLWebRTCVoiceClient::getInstance()->removeObserver(observer);
}
-std::string LLVoiceClient::sipURIFromID(const LLUUID &id)
+std::string LLVoiceClient::sipURIFromID(const LLUUID &id) const
{
if (mNonSpatialVoiceModule)
{
@@ -842,6 +840,22 @@ std::string LLVoiceClient::sipURIFromID(const LLUUID &id)
}
}
+LLSD LLVoiceClient::getP2PChannelInfoTemplate(const LLUUID& id) const
+{
+ if (mNonSpatialVoiceModule)
+ {
+ return mNonSpatialVoiceModule->getP2PChannelInfoTemplate(id);
+ }
+ else if (mSpatialVoiceModule)
+ {
+ return mSpatialVoiceModule->getP2PChannelInfoTemplate(id);
+ }
+ else
+ {
+ return LLSD();
+ }
+}
+
LLVoiceEffectInterface* LLVoiceClient::getVoiceEffectInterface() const
{
return NULL;
diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h
index 9ae18b315c..2221bc6df4 100644
--- a/indra/newview/llvoiceclient.h
+++ b/indra/newview/llvoiceclient.h
@@ -133,7 +133,7 @@ class LLVoiceP2PIncomingCallInterface
virtual void declineInvite() = 0;
};
-typedef boost::shared_ptr<LLVoiceP2PIncomingCallInterface> LLVoiceP2PIncomingCallInterfacePtr;
+typedef std::shared_ptr<LLVoiceP2PIncomingCallInterface> LLVoiceP2PIncomingCallInterfacePtr;
//////////////////////////////////
/// @class LLVoiceModuleInterface
@@ -281,7 +281,8 @@ public:
virtual void removeObserver(LLVoiceClientParticipantObserver* observer)=0;
//@}
- virtual std::string sipURIFromID(const LLUUID &id)=0;
+ virtual std::string sipURIFromID(const LLUUID &id) const=0;
+ virtual LLSD getP2PChannelInfoTemplate(const LLUUID& id) const=0;
//@}
};
@@ -451,8 +452,8 @@ public:
/////////////////////////////
// Accessors for data related to nearby speakers
- bool getVoiceEnabled(const LLUUID& id); // true if we've received data for this avatar
- std::string getDisplayName(const LLUUID& id);
+ bool getVoiceEnabled(const LLUUID& id) const; // true if we've received data for this avatar
+ std::string getDisplayName(const LLUUID& id) const;
bool isOnlineSIP(const LLUUID &id);
bool isParticipantAvatar(const LLUUID &id);
bool getIsSpeaking(const LLUUID& id);
@@ -462,8 +463,8 @@ public:
F32 getUserVolume(const LLUUID& id);
/////////////////////////////
- void getParticipantList(std::set<LLUUID> &participants);
- bool isParticipant(const LLUUID& speaker_id);
+ void getParticipantList(std::set<LLUUID> &participants) const;
+ bool isParticipant(const LLUUID& speaker_id) const;
//////////////////////////
/// @name text chat
@@ -488,7 +489,8 @@ public:
void addObserver(LLVoiceClientParticipantObserver* observer);
void removeObserver(LLVoiceClientParticipantObserver* observer);
- std::string sipURIFromID(const LLUUID &id);
+ std::string sipURIFromID(const LLUUID &id) const;
+ LLSD getP2PChannelInfoTemplate(const LLUUID& id) const;
//////////////////////////
/// @name Voice effects
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 060e1243ab..2358c04236 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -298,7 +298,6 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() :
mDevicesListUpdated(false),
mAudioSession(), // TBD - should be NULL
- mAudioSessionChanged(false),
mNextAudioSession(),
mCurrentParcelLocalID(0),
@@ -1643,7 +1642,6 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession)
LL_INFOS("Voice") << "Adding or joining voice session " << nextSession->mHandle << LL_ENDL;
mAudioSession = nextSession;
- mAudioSessionChanged = true;
if (!mAudioSession || !mAudioSession->mReconnect)
{
mNextAudioSession.reset();
@@ -1900,9 +1898,8 @@ bool LLVivoxVoiceClient::terminateAudioSession(bool wait)
sessionStatePtr_t oldSession = mAudioSession;
+ notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL); // needs mAudioSession for uri
mAudioSession.reset();
- // We just notified status observers about this change. Don't do it again.
- mAudioSessionChanged = false;
// The old session may now need to be deleted.
reapSession(oldSession);
@@ -1910,9 +1907,9 @@ bool LLVivoxVoiceClient::terminateAudioSession(bool wait)
else
{
LL_WARNS("Voice") << "terminateAudioSession(" << wait << ") with NULL mAudioSession" << LL_ENDL;
+ notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL);
}
- notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL);
// Always reset the terminate request flag when we get here.
// Some slower PCs have a race condition where they can switch to an incoming P2P call faster than the state machine leaves
@@ -2154,7 +2151,6 @@ bool LLVivoxVoiceClient::runSession(const sessionStatePtr_t &session)
mIsInChannel = true;
mMuteMicDirty = true;
- mSessionTerminateRequested = false;
while (!sShuttingDown
&& mVoiceEnabled
@@ -3834,7 +3830,6 @@ void LLVivoxVoiceClient::joinedAudioSession(const sessionStatePtr_t &session)
sessionStatePtr_t oldSession = mAudioSession;
mAudioSession = session;
- mAudioSessionChanged = true;
// The old session may now need to be deleted.
reapSession(oldSession);
@@ -4980,7 +4975,7 @@ void LLVivoxVoiceClient::hangup() { leaveChannel(); }
LLVoiceP2PIncomingCallInterfacePtr LLVivoxVoiceClient::getIncomingCallInterface(const LLSD &voice_call_info)
{
- return boost::make_shared<LLVivoxVoiceP2PIncomingCall>(voice_call_info);
+ return std::make_shared<LLVivoxVoiceP2PIncomingCall>(voice_call_info);
}
bool LLVivoxVoiceClient::answerInvite(const std::string &sessionHandle)
@@ -5104,7 +5099,9 @@ void LLVivoxVoiceClient::processChannels(bool process)
bool LLVivoxVoiceClient::isCurrentChannel(const LLSD &channelInfo)
{
- if (!mProcessChannels || (channelInfo.has("voice_server_type") && channelInfo["voice_server_type"].asString() != VIVOX_VOICE_SERVER_TYPE))
+ if (!mProcessChannels
+ || (channelInfo.has("voice_server_type") && channelInfo["voice_server_type"].asString() != VIVOX_VOICE_SERVER_TYPE)
+ || mSessionTerminateRequested)
{
return false;
}
@@ -5144,7 +5141,7 @@ bool LLVivoxVoiceClient::inProximalChannel()
return result;
}
-std::string LLVivoxVoiceClient::sipURIFromID(const LLUUID &id)
+std::string LLVivoxVoiceClient::sipURIFromID(const LLUUID &id) const
{
std::string result;
result = "sip:";
@@ -5155,6 +5152,14 @@ std::string LLVivoxVoiceClient::sipURIFromID(const LLUUID &id)
return result;
}
+LLSD LLVivoxVoiceClient::getP2PChannelInfoTemplate(const LLUUID& id) const
+{
+ LLSD result;
+ result["channel_uri"] = sipURIFromID(id);
+ result["voice_server_type"] = VIVOX_VOICE_SERVER_TYPE;
+ return result;
+}
+
std::string LLVivoxVoiceClient::sipURIFromAvatar(LLVOAvatar *avatar)
{
std::string result;
@@ -5169,7 +5174,7 @@ std::string LLVivoxVoiceClient::sipURIFromAvatar(LLVOAvatar *avatar)
return result;
}
-std::string LLVivoxVoiceClient::nameFromID(const LLUUID &uuid)
+std::string LLVivoxVoiceClient::nameFromID(const LLUUID &uuid) const
{
std::string result;
@@ -5433,8 +5438,8 @@ void LLVivoxVoiceClient::leaveChannel(void)
{
LL_DEBUGS("Voice") << "leaving channel for teleport/logout" << LL_ENDL;
mChannelName.clear();
- sessionTerminate();
}
+ sessionTerminate();
}
void LLVivoxVoiceClient::setMuteMic(bool muted)
@@ -6149,7 +6154,6 @@ void LLVivoxVoiceClient::deleteSession(const sessionStatePtr_t &session)
if(mAudioSession == session)
{
mAudioSession.reset();
- mAudioSessionChanged = true;
}
// ditto for the next audio session
@@ -6258,9 +6262,10 @@ void LLVivoxVoiceClient::notifyStatusObservers(LLVoiceClientStatusObserver::ESta
}
}
+ LLSD channel_info = getAudioSessionChannelInfo();
LL_DEBUGS("Voice")
<< " " << LLVoiceClientStatusObserver::status2string(status)
- << ", session channelInfo " << getAudioSessionChannelInfo()
+ << ", session channelInfo " << channel_info
<< ", proximal is " << inSpatialChannel()
<< LL_ENDL;
@@ -6275,7 +6280,7 @@ void LLVivoxVoiceClient::notifyStatusObservers(LLVoiceClientStatusObserver::ESta
)
{
LLVoiceClientStatusObserver* observer = *it;
- observer->onChange(status, getAudioSessionChannelInfo(), inSpatialChannel());
+ observer->onChange(status, channel_info, inSpatialChannel());
// In case onError() deleted an entry.
it = mStatusObservers.upper_bound(observer);
}
diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h
index 420e0aa869..7862e492b2 100644
--- a/indra/newview/llvoicevivox.h
+++ b/indra/newview/llvoicevivox.h
@@ -89,6 +89,8 @@ public:
// Returns true if vivox has successfully logged in and is not in error state
bool isVoiceWorking() const override;
+ void setHidden(bool hidden) override; // virtual
+
/////////////////////
/// @name Tuning
//@{
@@ -221,7 +223,8 @@ public:
void removeObserver(LLVoiceClientParticipantObserver* observer) override;
//@}
- std::string sipURIFromID(const LLUUID &id) override;
+ std::string sipURIFromID(const LLUUID &id) const override;
+ LLSD getP2PChannelInfoTemplate(const LLUUID& id) const override;
//@}
/// @name LLVoiceEffectInterface virtual implementations
@@ -706,7 +709,6 @@ private:
std::string mChannelName; // Name of the channel to be looked up
sessionStatePtr_t mAudioSession; // Session state for the current audio session
- bool mAudioSessionChanged; // set to true when the above pointer gets changed, so observers can be notified.
sessionStatePtr_t mNextAudioSession; // Session state for the audio session we're trying to join
@@ -748,7 +750,7 @@ private:
bool switchChannel(std::string uri = std::string(), bool spatial = true, bool no_reconnect = false, bool is_p2p = false, std::string hash = "");
void joinSession(const sessionStatePtr_t &session);
- std::string nameFromID(const LLUUID &id);
+ std::string nameFromID(const LLUUID &id) const;
bool IDFromName(const std::string name, LLUUID &uuid);
std::string sipURIFromAvatar(LLVOAvatar *avatar);
std::string sipURIFromName(std::string &name);
@@ -760,7 +762,6 @@ private:
LLSD getAudioSessionChannelInfo();
std::string getAudioSessionHandle();
- void setHidden(bool hidden) override; //virtual
void sendPositionAndVolumeUpdate(void);
void sendCaptureAndRenderDevices();
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index 4f08dde6e0..35ba75138c 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -248,7 +248,7 @@ LLWebRTCVoiceClient::~LLWebRTCVoiceClient()
void LLWebRTCVoiceClient::init(LLPumpIO* pump)
{
// constructor will set up LLVoiceClient::getInstance()
- llwebrtc::init();
+ llwebrtc::init(this);
mWebRTCDeviceInterface = llwebrtc::getDeviceInterface();
mWebRTCDeviceInterface->setDevicesObserver(this);
@@ -279,6 +279,29 @@ void LLWebRTCVoiceClient::cleanUp()
LL_DEBUGS("Voice") << "Exiting" << LL_ENDL;
}
+void LLWebRTCVoiceClient::LogMessage(llwebrtc::LLWebRTCLogCallback::LogLevel level, const std::string& message)
+{
+ switch (level)
+ {
+ case llwebrtc::LLWebRTCLogCallback::LOG_LEVEL_VERBOSE:
+ LL_DEBUGS("Voice") << message << LL_ENDL;
+ break;
+ case llwebrtc::LLWebRTCLogCallback::LOG_LEVEL_INFO:
+ LL_INFOS("Voice") << message << LL_ENDL;
+ break;
+ case llwebrtc::LLWebRTCLogCallback::LOG_LEVEL_WARNING:
+ LL_WARNS("Voice") << message << LL_ENDL;
+ break;
+ case llwebrtc::LLWebRTCLogCallback::LOG_LEVEL_ERROR:
+ // use WARN so that we don't crash on a webrtc error.
+ // webrtc will force a crash on a fatal error.
+ LL_WARNS("Voice") << message << LL_ENDL;
+ break;
+ default:
+ break;
+ }
+}
+
// --------------------------------------------------
const LLVoiceVersionInfo& LLWebRTCVoiceClient::getVersion()
@@ -434,6 +457,7 @@ void LLWebRTCVoiceClient::voiceConnectionCoro()
// Could help with voice updates making for smoother
// voice when we're busy.
llcoro::suspendUntilTimeout(UPDATE_THROTTLE_SECONDS);
+ if (sShuttingDown) return; // 'this' migh already be invalid
bool voiceEnabled = mVoiceEnabled;
if (!isAgentAvatarValid())
@@ -1230,7 +1254,7 @@ void LLWebRTCVoiceClient::sessionState::removeParticipant(const LLWebRTCVoiceCli
LLWebRTCVoiceClient::getInstance()->notifyParticipantObservers();
}
}
- if (mHangupOnLastLeave && (participantID != gAgentID) && (mParticipantsByUUID.size() <= 1))
+ if (mHangupOnLastLeave && (participantID != gAgentID) && (mParticipantsByUUID.size() <= 1) && LLWebRTCVoiceClient::instanceExists())
{
LLWebRTCVoiceClient::getInstance()->notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL);
}
@@ -1941,8 +1965,8 @@ bool LLWebRTCVoiceClient::estateSessionState::processConnectionStates()
for (auto &connection : mWebRTCConnections)
{
- boost::shared_ptr<LLVoiceWebRTCSpatialConnection> spatialConnection =
- boost::static_pointer_cast<LLVoiceWebRTCSpatialConnection>(connection);
+ std::shared_ptr<LLVoiceWebRTCSpatialConnection> spatialConnection =
+ std::static_pointer_cast<LLVoiceWebRTCSpatialConnection>(connection);
LLUUID regionID = spatialConnection.get()->getRegionID();
@@ -2067,11 +2091,16 @@ void LLWebRTCVoiceClient::avatarNameResolved(const LLUUID &id, const std::string
}
// Leftover from vivox PTSN
-std::string LLWebRTCVoiceClient::sipURIFromID(const LLUUID& id)
+std::string LLWebRTCVoiceClient::sipURIFromID(const LLUUID& id) const
{
return id.asString();
}
+LLSD LLWebRTCVoiceClient::getP2PChannelInfoTemplate(const LLUUID& id) const
+{
+ return LLSD();
+}
+
/////////////////////////////
// LLVoiceWebRTCConnection
@@ -2159,47 +2188,47 @@ void LLVoiceWebRTCConnection::processIceUpdates()
{
mOutstandingRequests++;
LLCoros::getInstance()->launch("LLVoiceWebRTCConnection::processIceUpdatesCoro",
- boost::bind(&LLVoiceWebRTCConnection::processIceUpdatesCoro, this));
+ boost::bind(&LLVoiceWebRTCConnection::processIceUpdatesCoro, this->shared_from_this()));
}
// Ice candidates may be streamed in before or after the SDP offer is available (see below)
// This function determines whether candidates are available to send to the Secondlife WebRTC
// server via the simulator. If so, and there are no more candidates, this code
// will make the cap call to the server sending up the ICE candidates.
-void LLVoiceWebRTCConnection::processIceUpdatesCoro()
+void LLVoiceWebRTCConnection::processIceUpdatesCoro(connectionPtr_t connection)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE;
- if (mShutDown || LLWebRTCVoiceClient::isShuttingDown())
+ if (connection->mShutDown || LLWebRTCVoiceClient::isShuttingDown())
{
- mOutstandingRequests--;
+ connection->mOutstandingRequests--;
return;
}
bool iceCompleted = false;
LLSD body;
- if (!mIceCandidates.empty() || mIceCompleted)
+ if (!connection->mIceCandidates.empty() || connection->mIceCompleted)
{
- LLViewerRegion *regionp = LLWorld::instance().getRegionFromID(mRegionID);
+ LLViewerRegion *regionp = LLWorld::instance().getRegionFromID(connection->mRegionID);
if (!regionp || !regionp->capabilitiesReceived())
{
LL_DEBUGS("Voice") << "no capabilities for ice gathering; waiting " << LL_ENDL;
- mOutstandingRequests--;
+ connection->mOutstandingRequests--;
return;
}
std::string url = regionp->getCapability("VoiceSignalingRequest");
if (url.empty())
{
- mOutstandingRequests--;
+ connection->mOutstandingRequests--;
return;
}
LL_DEBUGS("Voice") << "region ready to complete voice signaling; url=" << url << LL_ENDL;
- if (!mIceCandidates.empty())
+ if (!connection->mIceCandidates.empty())
{
LLSD candidates = LLSD::emptyArray();
- for (auto &ice_candidate : mIceCandidates)
+ for (auto &ice_candidate : connection->mIceCandidates)
{
LLSD body_candidate;
body_candidate["sdpMid"] = ice_candidate.mSdpMid;
@@ -2208,18 +2237,18 @@ void LLVoiceWebRTCConnection::processIceUpdatesCoro()
candidates.append(body_candidate);
}
body["candidates"] = candidates;
- mIceCandidates.clear();
+ connection->mIceCandidates.clear();
}
- else if (mIceCompleted)
+ else if (connection->mIceCompleted)
{
LLSD body_candidate;
body_candidate["completed"] = true;
body["candidate"] = body_candidate;
- iceCompleted = mIceCompleted;
- mIceCompleted = false;
+ iceCompleted = connection->mIceCompleted;
+ connection->mIceCompleted = false;
}
- body["viewer_session"] = mViewerSession;
+ body["viewer_session"] = connection->mViewerSession;
body["voice_server_type"] = WEBRTC_VOICE_SERVER_TYPE;
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(
@@ -2234,7 +2263,7 @@ void LLVoiceWebRTCConnection::processIceUpdatesCoro()
if (LLWebRTCVoiceClient::isShuttingDown())
{
- mOutstandingRequests--;
+ connection->mOutstandingRequests--;
return;
}
@@ -2244,10 +2273,10 @@ void LLVoiceWebRTCConnection::processIceUpdatesCoro()
if (!status)
{
// couldn't trickle the candidates, so restart the session.
- setVoiceConnectionState(VOICE_STATE_SESSION_RETRY);
+ connection->setVoiceConnectionState(VOICE_STATE_SESSION_RETRY);
}
}
- mOutstandingRequests--;
+ connection->mOutstandingRequests--;
}
@@ -2393,31 +2422,31 @@ void LLVoiceWebRTCConnection::sendData(const std::string &data)
// Tell the simulator that we're shutting down a voice connection.
// The simulator will pass this on to the Secondlife WebRTC server.
-void LLVoiceWebRTCConnection::breakVoiceConnectionCoro()
+void LLVoiceWebRTCConnection::breakVoiceConnectionCoro(connectionPtr_t connection)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE;
LL_DEBUGS("Voice") << "Disconnecting voice." << LL_ENDL;
- if (mWebRTCDataInterface)
+ if (connection->mWebRTCDataInterface)
{
- mWebRTCDataInterface->unsetDataObserver(this);
- mWebRTCDataInterface = nullptr;
+ connection->mWebRTCDataInterface->unsetDataObserver(connection.get());
+ connection->mWebRTCDataInterface = nullptr;
}
- mWebRTCAudioInterface = nullptr;
- LLViewerRegion *regionp = LLWorld::instance().getRegionFromID(mRegionID);
+ connection->mWebRTCAudioInterface = nullptr;
+ LLViewerRegion *regionp = LLWorld::instance().getRegionFromID(connection->mRegionID);
if (!regionp || !regionp->capabilitiesReceived())
{
LL_DEBUGS("Voice") << "no capabilities for voice provisioning; waiting " << LL_ENDL;
- setVoiceConnectionState(VOICE_STATE_SESSION_RETRY);
- mOutstandingRequests--;
+ connection->setVoiceConnectionState(VOICE_STATE_SESSION_RETRY);
+ connection->mOutstandingRequests--;
return;
}
std::string url = regionp->getCapability("ProvisionVoiceAccountRequest");
if (url.empty())
{
- setVoiceConnectionState(VOICE_STATE_SESSION_RETRY);
- mOutstandingRequests--;
+ connection->setVoiceConnectionState(VOICE_STATE_SESSION_RETRY);
+ connection->mOutstandingRequests--;
return;
}
@@ -2426,7 +2455,7 @@ void LLVoiceWebRTCConnection::breakVoiceConnectionCoro()
LLVoiceWebRTCStats::getInstance()->provisionAttemptStart();
LLSD body;
body["logout"] = true;
- body["viewer_session"] = mViewerSession;
+ body["viewer_session"] = connection->mViewerSession;
body["voice_server_type"] = WEBRTC_VOICE_SERVER_TYPE;
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(
@@ -2437,15 +2466,15 @@ void LLVoiceWebRTCConnection::breakVoiceConnectionCoro()
httpOpts->setWantHeaders(true);
- mOutstandingRequests++;
+ connection->mOutstandingRequests++;
// tell the server to shut down the connection as a courtesy.
// shutdownConnection will drop the WebRTC connection which will
// also shut things down.
LLSD result = httpAdapter->postAndSuspend(httpRequest, url, body, httpOpts);
- mOutstandingRequests--;
- setVoiceConnectionState(VOICE_STATE_SESSION_EXIT);
+ connection->mOutstandingRequests--;
+ connection->setVoiceConnectionState(VOICE_STATE_SESSION_EXIT);
}
// Tell the simulator to tell the Secondlife WebRTC server that we want a voice
@@ -2629,7 +2658,7 @@ bool LLVoiceWebRTCConnection::connectionStateMachine()
// VOICE_STATE_SESSION_ESTABLISHED via a callback on a webrtc thread.
setVoiceConnectionState(VOICE_STATE_CONNECTION_WAIT);
LLCoros::getInstance()->launch("LLVoiceWebRTCConnection::requestVoiceConnectionCoro",
- boost::bind(&LLVoiceWebRTCConnection::requestVoiceConnectionCoro, this));
+ boost::bind(&LLVoiceWebRTCConnection::requestVoiceConnectionCoro, this->shared_from_this()));
break;
case VOICE_STATE_CONNECTION_WAIT:
@@ -2709,7 +2738,7 @@ bool LLVoiceWebRTCConnection::connectionStateMachine()
case VOICE_STATE_DISCONNECT:
setVoiceConnectionState(VOICE_STATE_WAIT_FOR_EXIT);
LLCoros::instance().launch("LLVoiceWebRTCConnection::breakVoiceConnectionCoro",
- boost::bind(&LLVoiceWebRTCConnection::breakVoiceConnectionCoro, this));
+ boost::bind(&LLVoiceWebRTCConnection::breakVoiceConnectionCoro, this->shared_from_this()));
break;
case VOICE_STATE_WAIT_FOR_EXIT:
diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h
index 480a7897cd..c8dbb64574 100644
--- a/indra/newview/llvoicewebrtc.h
+++ b/indra/newview/llvoicewebrtc.h
@@ -55,14 +55,15 @@ class LLWebRTCProtocolParser;
class LLAvatarName;
class LLVoiceWebRTCConnection;
-typedef boost::shared_ptr<LLVoiceWebRTCConnection> connectionPtr_t;
+typedef std::shared_ptr<LLVoiceWebRTCConnection> connectionPtr_t;
extern const std::string WEBRTC_VOICE_SERVER_TYPE;
class LLWebRTCVoiceClient : public LLSingleton<LLWebRTCVoiceClient>,
virtual public LLVoiceModuleInterface,
public llwebrtc::LLWebRTCDevicesObserver,
- public LLMuteListObserver
+ public LLMuteListObserver,
+ public llwebrtc::LLWebRTCLogCallback
{
LLSINGLETON(LLWebRTCVoiceClient);
LOG_CLASS(LLWebRTCVoiceClient);
@@ -84,7 +85,16 @@ public:
// Returns true if WebRTC has successfully logged in and is not in error state
bool isVoiceWorking() const override;
- std::string sipURIFromID(const LLUUID &id) override;
+ std::string sipURIFromID(const LLUUID &id) const override;
+ LLSD getP2PChannelInfoTemplate(const LLUUID& id) const override;
+
+ void setHidden(bool hidden) override; // virtual
+
+ ///////////////////
+ /// @name Logging
+ /// @{
+ void LogMessage(llwebrtc::LLWebRTCLogCallback::LogLevel level, const std::string& message) override;
+ //@}
/////////////////////
/// @name Tuning
@@ -243,7 +253,7 @@ public:
bool mIsModeratorMuted;
LLUUID mRegion;
};
- typedef boost::shared_ptr<participantState> participantStatePtr_t;
+ typedef std::shared_ptr<participantState> participantStatePtr_t;
participantStatePtr_t findParticipantByID(const std::string &channelID, const LLUUID &id);
participantStatePtr_t addParticipantByID(const std::string& channelID, const LLUUID &id, const LLUUID& region);
@@ -256,10 +266,10 @@ public:
class sessionState
{
public:
- typedef boost::shared_ptr<sessionState> ptr_t;
- typedef boost::weak_ptr<sessionState> wptr_t;
+ typedef std::shared_ptr<sessionState> ptr_t;
+ typedef std::weak_ptr<sessionState> wptr_t;
- typedef boost::function<void(const ptr_t &)> sessionFunc_t;
+ typedef std::function<void(const ptr_t &)> sessionFunc_t;
static void addSession(const std::string &channelID, ptr_t& session);
virtual ~sessionState();
@@ -327,7 +337,7 @@ public:
sessionFunc_t func);
};
- typedef boost::shared_ptr<sessionState> sessionStatePtr_t;
+ typedef std::shared_ptr<sessionState> sessionStatePtr_t;
typedef std::map<std::string, sessionStatePtr_t> sessionMap;
class estateSessionState : public sessionState
@@ -471,8 +481,6 @@ private:
LLSD getAudioSessionChannelInfo();
- void setHidden(bool hidden) override; //virtual
-
void enforceTether();
void updateNeighboringRegions();
@@ -567,7 +575,8 @@ class LLVoiceWebRTCStats : public LLSingleton<LLVoiceWebRTCStats>
class LLVoiceWebRTCConnection :
public llwebrtc::LLWebRTCSignalingObserver,
- public llwebrtc::LLWebRTCDataObserver
+ public llwebrtc::LLWebRTCDataObserver,
+ public std::enable_shared_from_this<LLVoiceWebRTCConnection>
{
public:
LLVoiceWebRTCConnection(const LLUUID &regionID, const std::string &channelID);
@@ -601,7 +610,7 @@ class LLVoiceWebRTCConnection :
void processIceUpdates();
- void processIceUpdatesCoro();
+ static void processIceUpdatesCoro(connectionPtr_t connection);
virtual void setMuteMic(bool muted);
virtual void setSpeakerVolume(F32 volume);
@@ -668,9 +677,9 @@ class LLVoiceWebRTCConnection :
}
virtual void requestVoiceConnection() = 0;
- void requestVoiceConnectionCoro() { requestVoiceConnection(); }
+ static void requestVoiceConnectionCoro(connectionPtr_t connection) { connection->requestVoiceConnection(); }
- void breakVoiceConnectionCoro();
+ static void breakVoiceConnectionCoro(connectionPtr_t connection);
LLVoiceClientStatusObserver::EStatusType mCurrentStatus;
diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp
index b76717e660..fdccf34e6a 100644
--- a/indra/newview/llvosurfacepatch.cpp
+++ b/indra/newview/llvosurfacepatch.cpp
@@ -967,7 +967,7 @@ LLTerrainPartition::LLTerrainPartition(LLViewerRegion* regionp)
}
// Do not add vertices; honor strict vertex count specified by strider_vertex_count
-void gen_terrain_tangents(U16 strider_vertex_count,
+void gen_terrain_tangents(U32 strider_vertex_count,
U32 strider_index_count,
LLStrider<LLVector3> &verticesp,
LLStrider<LLVector3> &normalsp,
@@ -983,7 +983,7 @@ void gen_terrain_tangents(U16 strider_vertex_count,
std::vector<LLVector2> texcoords(strider_vertex_count);
std::vector<U16> indices(strider_index_count);
- for (U16 v = 0; v < strider_vertex_count; ++v)
+ for (U32 v = 0; v < strider_vertex_count; ++v)
{
F32 *vert = verticesp[v].mV;
vertices[v] = LLVector4a(vert[0], vert[1], vert[2], 1.f);
@@ -1002,7 +1002,7 @@ void gen_terrain_tangents(U16 strider_vertex_count,
LLCalculateTangentArray(strider_vertex_count, vertices, normals, texcoords.data(), strider_index_count / 3, indices.data(), tangents);
- for (U16 v = 0; v < strider_vertex_count; ++v)
+ for (U32 v = 0; v < strider_vertex_count; ++v)
{
tangentsp[v] = tangents[v];
}
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 9ebe648680..7a7d88327b 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1250,7 +1250,7 @@ void LLVOVolume::sculpt()
if (!raw_image)
{
raw_image = mSculptTexture->getSavedRawImage();
- S32 discard_level = mSculptTexture->getSavedRawImageLevel();
+ discard_level = mSculptTexture->getSavedRawImageLevel();
}
if (!raw_image)
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index 07e02e042c..6241bf42d6 100644
--- a/indra/newview/llvovolume.h
+++ b/indra/newview/llvovolume.h
@@ -304,11 +304,11 @@ public:
bool setReflectionProbeIsMirror(bool is_mirror);
bool isReflectionProbe() const override;
- F32 getReflectionProbeAmbiance() const;
- F32 getReflectionProbeNearClip() const;
+ F32 getReflectionProbeAmbiance() const override;
+ F32 getReflectionProbeNearClip() const override;
bool getReflectionProbeIsBox() const override;
- bool getReflectionProbeIsDynamic() const;
- bool getReflectionProbeIsMirror() const;
+ bool getReflectionProbeIsDynamic() const override;
+ bool getReflectionProbeIsMirror() const override;
// Flexible Objects
U32 getVolumeInterfaceID() const;
diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h
index fb9d140851..aab19a4d5f 100644
--- a/indra/newview/llworldmap.h
+++ b/indra/newview/llworldmap.h
@@ -128,9 +128,9 @@ public:
LLPointer<LLViewerFetchedTexture> getLandForSaleImage(); // Get the overlay image, fetch it if necessary
bool isName(const std::string& name) const;
- bool isDown() { return (mAccess == SIM_ACCESS_DOWN); }
- bool isPG() { return (mAccess <= SIM_ACCESS_PG); }
- bool isAdult() { return (mAccess == SIM_ACCESS_ADULT); }
+ bool isDown() const { return (mAccess == SIM_ACCESS_DOWN); }
+ bool isPG() const { return (mAccess <= SIM_ACCESS_PG); }
+ bool isAdult() const { return (mAccess == SIM_ACCESS_ADULT); }
// Debug only
void dump() const; // Print the region info to the standard output
@@ -157,6 +157,8 @@ public:
const LLSimInfo::item_info_list_t& getLandForSaleAdult() const { return mLandForSaleAdult; }
const LLSimInfo::item_info_list_t& getAgentLocation() const { return mAgentLocations; }
+ const U64& getHandle() const { return mHandle; }
+
private:
U64 mHandle; // This is a hash of the X and Y world coordinates of the SW corner of the sim
std::string mName; // Region name
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 2a461ca84b..1b2cffa6c9 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -3580,9 +3580,12 @@ void LLPipeline::postSort(LLCamera &camera)
{
mSelectedFaces.clear();
+ bool tex_index_changed = false;
if (!gNonInteractive)
{
- LLPipeline::setRenderHighlightTextureChannel(gFloaterTools->getPanelFace()->getTextureChannelToEdit());
+ LLRender::eTexIndex tex_index = sRenderHighlightTextureChannel;
+ setRenderHighlightTextureChannel(gFloaterTools->getPanelFace()->getTextureChannelToEdit());
+ tex_index_changed = sRenderHighlightTextureChannel != tex_index;
}
// Draw face highlights for selected faces.
@@ -3604,6 +3607,24 @@ void LLPipeline::postSort(LLCamera &camera)
}
} func;
LLSelectMgr::getInstance()->getSelection()->applyToTEs(&func);
+
+ if (tex_index_changed)
+ {
+ // Rebuild geometry for all selected faces with PBR textures
+ for (const LLFace* face : gPipeline.mSelectedFaces)
+ {
+ if (const LLViewerObject* vobj = face->getViewerObject())
+ {
+ if (const LLTextureEntry* tep = vobj->getTE(face->getTEOffset()))
+ {
+ if (tep->getGLTFRenderMaterial())
+ {
+ gPipeline.markRebuild(face->getDrawable(), LLDrawable::REBUILD_VOLUME);
+ }
+ }
+ }
+ }
+ }
}
}
@@ -3656,28 +3677,31 @@ void render_hud_elements()
gUIProgram.unbind();
}
-void LLPipeline::renderHighlights()
+static inline void bindHighlightProgram(LLGLSLShader& program)
{
- assertInitialized();
-
- // Draw 3D UI elements here (before we clear the Z buffer in POOL_HUD)
- // Render highlighted faces.
- LLGLSPipelineAlpha gls_pipeline_alpha;
- LLColor4 color(1.f, 1.f, 1.f, 0.5f);
- disableLights();
-
if ((LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0))
{
- gHighlightProgram.bind();
- gGL.diffuseColor4f(1,1,1,0.5f);
+ program.bind();
+ gGL.diffuseColor4f(1, 1, 1, 0.5f);
}
+}
- if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED) && !mFaceSelectImagep)
- {
- mFaceSelectImagep = LLViewerTextureManager::getFetchedTexture(IMG_FACE_SELECT);
- }
+static inline void unbindHighlightProgram(LLGLSLShader& program)
+{
+ if (LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0)
+ {
+ program.unbind();
+ }
+}
- if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED) && (sRenderHighlightTextureChannel == LLRender::DIFFUSE_MAP))
+void LLPipeline::renderSelectedFaces(const LLColor4& color)
+{
+ if (!mFaceSelectImagep)
+ {
+ mFaceSelectImagep = LLViewerTextureManager::getFetchedTexture(IMG_FACE_SELECT);
+ }
+
+ if (mFaceSelectImagep)
{
// Make sure the selection image gets downloaded and decoded
mFaceSelectImagep->addTextureStats((F32)MAX_IMAGE_AREA);
@@ -3693,81 +3717,61 @@ void LLPipeline::renderHighlights()
facep->renderSelected(mFaceSelectImagep, color);
}
}
+}
- if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED))
- {
- // Paint 'em red!
- color.setVec(1.f, 0.f, 0.f, 0.5f);
-
- for (auto facep : mHighlightFaces)
- {
- facep->renderSelected(LLViewerTexture::sNullImagep, color);
- }
- }
+void LLPipeline::renderHighlights()
+{
+ assertInitialized();
- // Contains a list of the faces of objects that are physical or
- // have touch-handlers.
- mHighlightFaces.clear();
+ // Draw 3D UI elements here (before we clear the Z buffer in POOL_HUD)
+ // Render highlighted faces.
+ LLGLSPipelineAlpha gls_pipeline_alpha;
+ disableLights();
- if (LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0)
+ if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED))
{
- gHighlightProgram.unbind();
- }
-
+ bindHighlightProgram(gHighlightProgram);
- if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED) && (sRenderHighlightTextureChannel == LLRender::NORMAL_MAP))
- {
- color.setVec(1.0f, 0.5f, 0.5f, 0.5f);
- if ((LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0))
+ if (sRenderHighlightTextureChannel == LLRender::DIFFUSE_MAP ||
+ sRenderHighlightTextureChannel == LLRender::BASECOLOR_MAP ||
+ sRenderHighlightTextureChannel == LLRender::METALLIC_ROUGHNESS_MAP ||
+ sRenderHighlightTextureChannel == LLRender::GLTF_NORMAL_MAP ||
+ sRenderHighlightTextureChannel == LLRender::EMISSIVE_MAP ||
+ sRenderHighlightTextureChannel == LLRender::NUM_TEXTURE_CHANNELS)
{
- gHighlightNormalProgram.bind();
- gGL.diffuseColor4f(1,1,1,0.5f);
+ static const LLColor4 highlight_selected_color(1.f, 1.f, 1.f, 0.5f);
+ renderSelectedFaces(highlight_selected_color);
}
- mFaceSelectImagep->addTextureStats((F32)MAX_IMAGE_AREA);
-
- for (auto facep : mSelectedFaces)
+ // Paint 'em red!
+ static const LLColor4 highlight_face_color(1.f, 0.f, 0.f, 0.5f);
+ for (auto facep : mHighlightFaces)
{
- if (!facep || facep->getDrawable()->isDead())
- {
- LL_ERRS() << "Bad face on selection" << LL_ENDL;
- return;
- }
-
- facep->renderSelected(mFaceSelectImagep, color);
+ facep->renderSelected(LLViewerTexture::sNullImagep, highlight_face_color);
}
- if ((LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0))
- {
- gHighlightNormalProgram.unbind();
- }
+ unbindHighlightProgram(gHighlightProgram);
}
- if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED) && (sRenderHighlightTextureChannel == LLRender::SPECULAR_MAP))
- {
- color.setVec(0.0f, 0.3f, 1.0f, 0.8f);
- if ((LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0))
- {
- gHighlightSpecularProgram.bind();
- gGL.diffuseColor4f(1,1,1,0.5f);
- }
-
- mFaceSelectImagep->addTextureStats((F32)MAX_IMAGE_AREA);
+ // Contains a list of the faces of objects that are physical or
+ // have touch-handlers.
+ mHighlightFaces.clear();
- for (auto facep : mSelectedFaces)
+ if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED))
+ {
+ if (sRenderHighlightTextureChannel == LLRender::NORMAL_MAP)
{
- if (!facep || facep->getDrawable()->isDead())
- {
- LL_ERRS() << "Bad face on selection" << LL_ENDL;
- return;
- }
-
- facep->renderSelected(mFaceSelectImagep, color);
+ static const LLColor4 highlight_normal_color(1.0f, 0.5f, 0.5f, 0.5f);
+ bindHighlightProgram(gHighlightNormalProgram);
+ renderSelectedFaces(highlight_normal_color);
+ unbindHighlightProgram(gHighlightNormalProgram);
}
-
- if ((LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0))
+ else if (sRenderHighlightTextureChannel == LLRender::SPECULAR_MAP)
{
- gHighlightSpecularProgram.unbind();
+ static const LLColor4 highlight_specular_color(0.0f, 0.3f, 1.0f, 0.8f);
+ bindHighlightProgram(gHighlightSpecularProgram);
+ renderSelectedFaces(highlight_specular_color);
+ unbindHighlightProgram(gHighlightSpecularProgram);
}
}
}
@@ -6256,7 +6260,10 @@ bool LLPipeline::getRenderHighlights()
// static
void LLPipeline::setRenderHighlightTextureChannel(LLRender::eTexIndex channel)
{
- sRenderHighlightTextureChannel = channel;
+ if (channel != sRenderHighlightTextureChannel)
+ {
+ sRenderHighlightTextureChannel = channel;
+ }
}
LLVOPartGroup* LLPipeline::lineSegmentIntersectParticle(const LLVector4a& start, const LLVector4a& end, LLVector4a* intersection,
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 6c79d20149..4164474238 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -342,6 +342,7 @@ public:
void renderHighlight(const LLViewerObject* obj, F32 fade);
void renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera& camera, LLCullResult& result, bool depth_clamp);
+ void renderSelectedFaces(const LLColor4& color);
void renderHighlights();
void renderDebug();
void renderPhysicsDisplay();
diff --git a/indra/newview/skins/default/xui/en/floater_settings_color.xml b/indra/newview/skins/default/xui/en/floater_settings_color.xml
new file mode 100644
index 0000000000..0722677f1d
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_settings_color.xml
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater
+ legacy_header_height="18"
+ can_minimize="false"
+ height="360"
+ min_height="367"
+ layout="topleft"
+ name="settings_color"
+ help_topic="settings_color"
+ title="COLOR SETTINGS"
+ reuse_instance="true"
+ can_resize="true"
+ min_width="550"
+ width="570">
+ <filter_editor
+ follows="left|top|right"
+ height="23"
+ layout="topleft"
+ left="10"
+ right="-10"
+ label="Enter search text"
+ max_length_chars="300"
+ name="filter_input"
+ text_pad_left="10"
+ top="30" />
+ <scroll_list
+ column_padding="0"
+ draw_heading="true"
+ draw_stripes="false"
+ heading_height="23"
+ height="266"
+ layout="topleft"
+ search_column="1"
+ sort_column="1"
+ left="10"
+ follows="left|top|bottom"
+ name="setting_list"
+ top_pad="2"
+ width="300">
+ <scroll_list.columns
+ name="changed_color"
+ relative_width="0.05" />
+ <scroll_list.columns
+ label="Color"
+ name="color" />
+ </scroll_list>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ name="color_name_txt"
+ font="SansSerifSmallBold"
+ top_delta="8"
+ left_pad="10"
+ visible="true"
+ use_ellipses="true"
+ text_color="White"
+ width="240">
+ Color name
+ </text>
+ <color_swatch
+ top_pad="0"
+ left_delta="0"
+ follows="top|left"
+ can_apply_immediately="true"
+ height="180"
+ name="color_swatch"
+ visible="true"
+ layout="topleft"
+ width="240">
+ <color_swatch.commit_callback
+ function="CommitSettings" />
+ </color_swatch>
+ <spinner
+ height="20"
+ label="Alpha"
+ layout="topleft"
+ follows="top|left"
+ left_delta="0"
+ min_val="0"
+ max_val="1"
+ decimal_digits="3"
+ name="alpha_spinner"
+ top_pad="5"
+ visible="true"
+ width="120">
+ <spinner.commit_callback
+ function="CommitSettings" />
+ </spinner>
+ <button
+ height="22"
+ label="Reset to default"
+ follows="left|top"
+ layout="topleft"
+ left_delta="0"
+ name="default_btn"
+ visible="true"
+ top_pad="15"
+ width="150">
+ <button.commit_callback
+ function="ClickDefault" />
+ </button>
+ <check_box
+ control_name="ColorSettingsHideDefault"
+ height="16"
+ initial_value="true"
+ label="Show changed colors only"
+ layout="topleft"
+ top_pad="10"
+ left="10"
+ follows="left|bottom"
+ name="hide_default"
+ width="330">
+ </check_box>
+</floater> \ No newline at end of file
diff --git a/indra/newview/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml
index 7efa81d263..b0b818cde5 100644
--- a/indra/newview/skins/default/xui/en/floater_world_map.xml
+++ b/indra/newview/skins/default/xui/en/floater_world_map.xml
@@ -14,6 +14,9 @@
single_instance="true"
title="WORLD MAP"
width="650">
+ <string name="UnnamedParcel">
+ (Unnamed Parcel)
+ </string>
<string
name="collapse_icon"
value="map_ui_collapse_icon.png"/>
diff --git a/indra/newview/skins/default/xui/en/menu_login.xml b/indra/newview/skins/default/xui/en/menu_login.xml
index a71cbde21b..1d1b81e31a 100644
--- a/indra/newview/skins/default/xui/en/menu_login.xml
+++ b/indra/newview/skins/default/xui/en/menu_login.xml
@@ -149,6 +149,13 @@
function="Advanced.ShowDebugSettings"
parameter="all" />
</menu_item_call>
+ <menu_item_call
+ label="Show Color settings"
+ name="Color Settings">
+ <menu_item_call.on_click
+ function="Floater.Toggle"
+ parameter="settings_color" />
+ </menu_item_call>
<menu_item_separator />
<menu_item_call
label="XUI Preview Tool"
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 98cf03b30e..40f3e51fca 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -3854,6 +3854,13 @@ function="World.EnvPreset"
name="XUI"
tear_off="true">
<menu_item_call
+ label="Show Color settings"
+ name="Color Settings">
+ <menu_item_call.on_click
+ function="Floater.Toggle"
+ parameter="settings_color" />
+ </menu_item_call>
+ <menu_item_call
label="Reload Color Settings"
name="Reload Color Settings">
<menu_item_call.on_click
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 2e08f6b3be..91b137b75f 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -8873,6 +8873,7 @@ New Voice Morphs are available!
Voice Morphs are not supported by this viewer.
For more information about other voice morph tools, see [[FAQ_URL] this article].
<usetemplate
+ ignoretext="Warn me about voice morph not being supported"
name="okignore"
yestext="OK"/>
<tag>voice</tag>
diff --git a/indra/newview/skins/default/xui/en/panel_region_debug.xml b/indra/newview/skins/default/xui/en/panel_region_debug.xml
index 04a510d4e8..be8468a15c 100644
--- a/indra/newview/skins/default/xui/en/panel_region_debug.xml
+++ b/indra/newview/skins/default/xui/en/panel_region_debug.xml
@@ -140,7 +140,7 @@
layout="topleft"
left_delta="0"
name="return_other_land"
- tool_tip="Return only objects which are on land belonging to someone else"
+ tool_tip="Return only objects which are on land that isn't owned by selected user"
top_delta="20"
width="80" />
<check_box
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index a25efc5de4..91a9347449 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -580,16 +580,6 @@ class Windows_x86_64_Manifest(ViewerManifest):
self.path("vivoxsdk_x64.dll")
self.path("ortp_x64.dll")
- # OpenSSL
- self.path("libcrypto-1_1-x64.dll")
- self.path("libssl-1_1-x64.dll")
-
- # HTTP/2
- self.path("nghttp2.dll")
-
- # Hunspell
- self.path("libhunspell.dll")
-
# BugSplat
if self.args.get('bugsplat'):
self.path("BsSndRpt64.exe")
@@ -930,7 +920,6 @@ class Darwin_x86_64_Manifest(ViewerManifest):
with self.prefix(src=relpkgdir, dst=""):
self.path("libndofdev.dylib")
- self.path("libhunspell-*.dylib")
with self.prefix(src_dst="cursors_mac"):
self.path("*.tif")
@@ -1011,17 +1000,6 @@ class Darwin_x86_64_Manifest(ViewerManifest):
# Need to get the llcommon dll from any of the build directories as well.
libfile_parent = self.get_dst_prefix()
dylibs=[]
- for libfile in (
- "libapr-1.0.dylib",
- "libaprutil-1.0.dylib",
- "libexpat.1.dylib",
- # libnghttp2.dylib is a symlink to
- # libnghttp2.major.dylib, which is a symlink to
- # libnghttp2.version.dylib. Get all of them.
- "libnghttp2.*dylib",
- ):
- dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile)
-
# SLVoice executable
with self.prefix(src=os.path.join(pkgdir, 'bin', 'release')):
self.path("SLVoice")
@@ -1319,14 +1297,7 @@ class Linux_i686_Manifest(LinuxManifest):
debpkgdir = os.path.join(pkgdir, "lib", "debug")
with self.prefix(src=relpkgdir, dst="lib"):
- self.path("libapr-1.so")
- self.path("libapr-1.so.0")
- self.path("libapr-1.so.0.4.5")
- self.path("libaprutil-1.so")
- self.path("libaprutil-1.so.0")
- self.path("libaprutil-1.so.0.4.1")
self.path("libdb*.so")
- self.path("libexpat.so.*")
self.path("libuuid.so*")
self.path("libSDL-1.2.so.*")
self.path("libdirectfb-1.*.so.*")
@@ -1336,7 +1307,6 @@ class Linux_i686_Manifest(LinuxManifest):
self.path("libdirectfb-1.4.so.5")
self.path("libfusion-1.4.so.5")
self.path("libdirect-1.4.so.5*")
- self.path("libhunspell-1.3.so*")
self.path("libalut.so*")
self.path("libopenal.so*")
self.path("libopenal.so", "libvivoxoal.so.1") # vivox's sdk expects this soname