diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index f1325163c..e88c404eb 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -223,3 +223,12 @@ if (LINUX) set_property(TARGET llcommon PROPERTY LINK_INTERFACE_LIBRARIES "-lapr-1 -laprutil-1 -lz") endif (LINUX) +if (DARWIN) + # Don't embed a full path in the library's install name + set_target_properties( + llcommon + PROPERTIES + BUILD_WITH_INSTALL_RPATH 1 + INSTALL_NAME_DIR "@executable_path/../Resources" + ) +endif (DARWIN) diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h index f841637b3..60f3bfad1 100644 --- a/indra/llcommon/llerror.h +++ b/indra/llcommon/llerror.h @@ -303,7 +303,7 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG; */ #ifdef SHOW_ASSERT -extern bool is_main_thread(); +extern LL_COMMON_API bool is_main_thread(); #endif #endif // LL_LLERROR_H diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index 2146216aa..fa003afdd 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -41,7 +41,7 @@ #include "aiaprpool.h" #ifdef SHOW_ASSERT -extern bool is_main_thread(void); +extern LL_COMMON_API bool is_main_thread(void); #endif class LLThread; diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h index ba1183376..458c3de80 100644 --- a/indra/llcommon/llversionviewer.h +++ b/indra/llcommon/llversionviewer.h @@ -35,13 +35,13 @@ const S32 LL_VERSION_MAJOR = 1; const S32 LL_VERSION_MINOR = 5; -const S32 LL_VERSION_PATCH = 7; +const S32 LL_VERSION_PATCH = 8; const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Singularity"; #if LL_DARWIN -const char * const LL_VERSION_BUNDLE_ID = "com.secondlife.snowglobe.viewer"; +const char * const LL_VERSION_BUNDLE_ID = "com.secondlife.singularity.viewer"; #endif #endif diff --git a/indra/llplugin/CMakeLists.txt b/indra/llplugin/CMakeLists.txt index 10f5d34ef..4b5420b6b 100644 --- a/indra/llplugin/CMakeLists.txt +++ b/indra/llplugin/CMakeLists.txt @@ -54,13 +54,13 @@ set(llplugin_HEADER_FILES set_source_files_properties(${llplugin_HEADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) -if(NOT CMAKE_SIZEOF_VOID_P MATCHES 4) +if(NOT WORD_SIZE EQUAL 32) if(WINDOWS) add_definitions(/FIXED:NO) else(WINDOWS) # not windows therefore gcc LINUX and DARWIN add_definitions(-fPIC) endif(WINDOWS) -endif (NOT CMAKE_SIZEOF_VOID_P MATCHES 4) +endif (NOT WORD_SIZE EQUAL 32) list(APPEND llplugin_SOURCE_FILES ${llplugin_HEADER_FILES}) diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index ce8bee216..74ec1323f 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -178,8 +178,6 @@ LLView* LLComboBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory * NULL); combo_box->setAllowTextEntry(allow_text_entry, max_chars); - combo_box->initFromXML(node, parent); - const std::string& contents = node->getValue(); if (contents.find_first_not_of(" \n\t") != contents.npos) @@ -210,6 +208,9 @@ LLView* LLComboBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory * } } + //Do this AFTER combo_items are set up so setValue is actually able to select the correct initial entry. + combo_box->initFromXML(node, parent); + // if providing user text entry or descriptive label // don't select an item under the hood if (!combo_box->acceptsTextInput() && combo_box->mLabel.empty()) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 2b4a4ca31..cd5a30260 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -79,6 +79,7 @@ set(viewer_SOURCE_FILES cofmgr.cpp ascentdaycyclemanager.cpp ascentfloatercontactgroups.cpp + ascentkeyword.cpp ascentprefssys.cpp ascentprefsvan.cpp dhparam.cpp @@ -553,6 +554,7 @@ set(viewer_HEADER_FILES cofmgr.h ascentdaycyclemanager.h ascentfloatercontactgroups.h + ascentkeyword.h ascentprefssys.h ascentprefsvan.h emerald.h @@ -1333,11 +1335,11 @@ set(PACKAGE ${PACKAGE_DEFAULT} CACHE BOOL "Add a package target that builds an installer package.") if (WINDOWS) - if(MSVC71) - set(release_flags "/MAP:Release/${VIEWER_BINARY_NAME}.map /MAPINFO:LINES") - else(MSVC71) + if(MSVC10) + set(release_flags "/MAPRelease/${VIEWER_BINARY_NAME}.map") + else() set(release_flags "/MAP:Release/${VIEWER_BINARY_NAME}.map") - endif(MSVC71) + endif() set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index e6f3b2ab2..944b1fef0 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9,6 +9,23 @@ settings_rlv.xml + FloaterAvatarTextRect + + Comment + Avatar texture floater position + Persist + 1 + Type + Rect + Value + + 0 + 0 + 0 + 0 + + + SianaLegacyJ2CSize Comment @@ -12967,7 +12984,7 @@ Type Boolean Value - 1 + 0 UseOutfitFolders diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index cab1429ca..c740123ab 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -673,5 +673,100 @@ Value 0 + + KeywordsChangeColor + + Comment + change message color if keyword found + Persist + 1 + Type + Boolean + Value + 1 + + KeywordsColor + + Comment + Color of keyword detects messages + Persist + 1 + Type + Color4 + Value + + 1.0 + 0.600000023842 + 0.0 + 1.0 + + + KeywordsInChat + + Comment + Look for keywords in local chat + Persist + 1 + Type + Boolean + Value + 1 + + KeywordsInIM + + Comment + Look for keywords in group instant messages + Persist + 1 + Type + Boolean + Value + 1 + + KeywordsList + + Comment + Comma seperated key words to search for + Persist + 1 + Type + String + Value + + + KeywordsOn + + Comment + Look for keywords + Persist + 1 + Type + Boolean + Value + 0 + + KeywordsPlaySound + + Comment + Play a sound if keyword found + Persist + 1 + Type + Boolean + Value + 0 + + KeywordsSound + + Comment + The sound to play if a keyword is found + Persist + 1 + Type + String + Value + + + diff --git a/indra/newview/app_settings/settings_sh.xml b/indra/newview/app_settings/settings_sh.xml index 6165c069d..1838edac6 100644 --- a/indra/newview/app_settings/settings_sh.xml +++ b/indra/newview/app_settings/settings_sh.xml @@ -111,7 +111,7 @@ Type Boolean Value - 1 + 0 SGBlockDialogSpam diff --git a/indra/newview/ascentkeyword.cpp b/indra/newview/ascentkeyword.cpp new file mode 100644 index 000000000..65efe3958 --- /dev/null +++ b/indra/newview/ascentkeyword.cpp @@ -0,0 +1,89 @@ +/** + * @file ascentprefssys.cpp + * @Ascent Viewer preferences panel + * + * $LicenseInfo:firstyear=2011&license=viewergpl$ + * + * Copyright (c) 2011, Tigh MacFanatic. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "ascentkeyword.h" +#include "llviewercontrol.h" +#include "llui.h" +#include + + +BOOL AscentKeyword::hasKeyword(std::string msg,int source) +{ + static const LLCachedControl mKeywordsOn("KeywordsOn", false, gSavedPerAccountSettings); + static const LLCachedControl mKeywordsInChat("KeywordsInChat", false, gSavedPerAccountSettings); + static const LLCachedControl mKeywordsInIM("KeywordsInIM", false, gSavedPerAccountSettings); + + if (mKeywordsOn) + { + if ((source == 1) && (mKeywordsInChat)) + { + return containsKeyWord(msg); + } + + if ((source == 2) && (mKeywordsInIM)) + { + return containsKeyWord(msg); + } + } + + return FALSE; +} + +bool AscentKeyword::containsKeyWord(std::string source) +{ + static const LLCachedControl mKeywordsList("KeywordsList", "", gSavedPerAccountSettings); + static const LLCachedControl mKeywordsPlaySound("KeywordsPlaySound", false, gSavedPerAccountSettings); + static const LLCachedControl mKeywordsSound("KeywordsSound", "", gSavedPerAccountSettings); + + std::string s = mKeywordsList; + LLStringUtil::toLower(s); + LLStringUtil::toLower(source); + boost::regex re(","); + boost::sregex_token_iterator i(s.begin(), s.end(), re, -1); + boost::sregex_token_iterator j; + + while(i != j) + { + if(source.find( *i++) != std::string::npos) + { + if (mKeywordsPlaySound) + { + LLUI::sAudioCallback(LLUUID(mKeywordsSound)); + } + + return true; + } + } + + return false; +} diff --git a/indra/newview/ascentkeyword.h b/indra/newview/ascentkeyword.h new file mode 100644 index 000000000..1e22f8ae1 --- /dev/null +++ b/indra/newview/ascentkeyword.h @@ -0,0 +1,53 @@ +/** + * @file ascentprefssys.cpp + * @Ascent Viewer preferences panel + * + * $LicenseInfo:firstyear=2011&license=viewergpl$ + * + * Copyright (c) 2011, Tigh MacFanatic. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef ASCENTKEYWORD_H +#define ASCENTKEYWORD_H + + +class AscentKeyword +{ +public: + enum MessageSource + { + LocalChat=1, + PrivateMessage=2, + GroupChat=3 + }; + + static BOOL hasKeyword(std::string msg, int source); + +private: + static bool containsKeyWord(std::string source); +}; + + +#endif diff --git a/indra/newview/ascentprefssys.cpp b/indra/newview/ascentprefssys.cpp index 677280b1f..b8461ea0b 100644 --- a/indra/newview/ascentprefssys.cpp +++ b/indra/newview/ascentprefssys.cpp @@ -51,7 +51,6 @@ #include "lgghunspell_wrapper.h" - LLPrefsAscentSys::LLPrefsAscentSys() { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_system.xml"); @@ -67,6 +66,9 @@ LLPrefsAscentSys::LLPrefsAscentSys() childSetAction("EmSpell_Add", onSpellAdd, this); childSetAction("EmSpell_Remove", onSpellRemove, this); + childSetCommitCallback("Keywords_Alert", onCommitCheckBox, this); + + refreshValues(); refresh(); } @@ -110,6 +112,17 @@ void LLPrefsAscentSys::onCommitCheckBox(LLUICtrl* ctrl, void* user_data) bool enabled = self->childGetValue("enable_clouds").asBoolean(); self->childSetEnabled("enable_classic_clouds", enabled); } + else if (ctrl->getName() == "Keywords_Alert") + { + bool enabled = self->childGetValue("Keywords_Alert").asBoolean(); + self->childSetEnabled("Keywords_Entries", enabled); + self->childSetEnabled("Keywords_LocalChat", enabled); + self->childSetEnabled("Keywords_IM", enabled); + self->childSetEnabled("Keywords_Highlight", enabled); + self->childSetEnabled("Keywords_Color", enabled); + self->childSetEnabled("Keywords_PlaySound", enabled); + self->childSetEnabled("Keywords_SoundUUID", enabled); + } } void LLPrefsAscentSys::onSpellAdd(void* data) @@ -204,6 +217,15 @@ void LLPrefsAscentSys::refreshValues() mDisableClickSit = gSavedSettings.getBOOL("DisableClickSit"); //Text Options ------------------------------------------------------------------------ mSpellDisplay = gSavedSettings.getBOOL("SpellDisplay"); + + mKeywordsOn = gSavedPerAccountSettings.getBOOL("KeywordsOn"); + mKeywordsList = gSavedPerAccountSettings.getString("KeywordsList"); + mKeywordsInChat = gSavedPerAccountSettings.getBOOL("KeywordsInChat"); + mKeywordsInIM = gSavedPerAccountSettings.getBOOL("KeywordsInIM"); + mKeywordsChangeColor = gSavedPerAccountSettings.getBOOL("KeywordsChangeColor"); + mKeywordsColor = gSavedPerAccountSettings.getColor4("KeywordsColor"); + mKeywordsPlaySound = gSavedPerAccountSettings.getBOOL("KeywordsPlaySound"); + mKeywordsSound = static_cast(gSavedPerAccountSettings.getString("KeywordsSound")); } void LLPrefsAscentSys::refresh() @@ -359,10 +381,21 @@ void LLPrefsAscentSys::refresh() combo->setSimple(std::string("")); } + + childSetValue("Keywords_Alert", mKeywordsOn); + childSetValue("Keywords_Entries", mKeywordsList); + childSetValue("Keywords_LocalChat", mKeywordsInChat); + childSetValue("Keywords_IM", mKeywordsInIM); + childSetValue("Keywords_Highlight", mKeywordsChangeColor); + childSetValue("Keywords_PlaySound", mKeywordsPlaySound); + childSetValue("Keywords_SoundUUID", mKeywordsSound); + + LLColorSwatchCtrl* colorctrl = getChild("Keywords_Color"); + colorctrl->set(LLColor4(mKeywordsColor),TRUE); } void LLPrefsAscentSys::cancel() -{ +{/* //General ----------------------------------------------------------------------------- childSetValue("double_click_teleport_check", mDoubleClickTeleport); childSetValue("center_after_teleport_check", mResetCameraAfterTP); @@ -412,7 +445,18 @@ void LLPrefsAscentSys::cancel() //Text Options ------------------------------------------------------------------------ childSetValue("SpellDisplay", mSpellDisplay); -} + + childSetValue("Keywords_Alert", mKeywordsOn); + childSetValue("Keywords_Entries", mKeywordsList); + childSetValue("Keywords_LocalChat", mKeywordsInChat); + childSetValue("Keywords_IM", mKeywordsInIM); + childSetValue("Keywords_Highlight", mKeywordsChangeColor); + childSetValue("Keywords_PlaySound", mKeywordsPlaySound); + childSetValue("Keywords_SoundUUID", mKeywordsSound); + + LLColorSwatchCtrl* colorctrl = getChild("Keywords_Color"); + colorctrl->set(LLColor4(mKeywordsColor),TRUE); +*/} void LLPrefsAscentSys::apply() { @@ -549,7 +593,18 @@ void LLPrefsAscentSys::apply() LLHUDEffectLookAt::sDebugLookAt = childGetValue("show_look_at_check"); gSavedSettings.setBOOL("RevokePermsOnStandUp", childGetValue("revoke_perms_on_stand_up_check")); gSavedSettings.setBOOL("DisableClickSit", childGetValue("disable_click_sit_check")); - + + + //Text Options --------------------------------------------------------------------------- + gSavedPerAccountSettings.setBOOL("KeywordsOn", childGetValue("Keywords_Alert")); + gSavedPerAccountSettings.setString("KeywordsList", childGetValue("Keywords_Entries")); + gSavedPerAccountSettings.setBOOL("KeywordsInChat", childGetValue("Keywords_LocalChat")); + gSavedPerAccountSettings.setBOOL("KeywordsInIM", childGetValue("Keywords_IM")); + gSavedPerAccountSettings.setBOOL("KeywordsChangeColor", childGetValue("Keywords_Highlight")); + gSavedPerAccountSettings.setColor4("KeywordsColor", childGetValue("Keywords_Color")); + gSavedPerAccountSettings.setBOOL("KeywordsPlaySound", childGetValue("Keywords_PlaySound")); + gSavedPerAccountSettings.setString("KeywordsSound", childGetValue("Keywords_SoundUUID")); + refreshValues(); refresh(); } diff --git a/indra/newview/ascentprefssys.h b/indra/newview/ascentprefssys.h index d62c9bdf1..06984f03a 100644 --- a/indra/newview/ascentprefssys.h +++ b/indra/newview/ascentprefssys.h @@ -98,6 +98,14 @@ protected: BOOL mDisableClickSit; //Text Options ------------------------------------------------------------------------ BOOL mSpellDisplay; + BOOL mKeywordsOn; + std::string mKeywordsList; + BOOL mKeywordsInIM; + BOOL mKeywordsInChat; + BOOL mKeywordsChangeColor; + BOOL mKeywordsPlaySound; + LLUUID mKeywordsSound; + LLColor4 mKeywordsColor; }; #endif diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index 7ddc609fd..91fe00c54 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -715,31 +715,38 @@ void LLFloaterAvatarList::refreshAvatarList() estate_owner = parent_estate->getOwner(); } + static const LLCachedControl unselected_color("ScrollUnselectedColor",LLColor4(LLColor4U(0, 0, 0, 204)), gColors ); + + LLColor4 name_color = unselected_color; + //Lindens are always more Linden than your friend, make that take precedence if(LLMuteList::getInstance()->isLinden(av_name)) { static const LLCachedControl ascent_linden_color("AscentLindenColor",LLColor4(0.f,0.f,1.f,1.f)); - element["columns"][LIST_AVATAR_NAME]["color"] = ascent_linden_color.get().getValue(); + name_color = ascent_linden_color; } //check if they are an estate owner at their current position else if(estate_owner.notNull() && av_id == estate_owner) { static const LLCachedControl ascent_estate_owner_color("AscentEstateOwnerColor",LLColor4(1.f,0.6f,1.f,1.f)); - element["columns"][LIST_AVATAR_NAME]["color"] = ascent_estate_owner_color.get().getValue(); + name_color = ascent_estate_owner_color; } //without these dots, SL would suck. else if(is_agent_friend(av_id)) { static const LLCachedControl ascent_friend_color("AscentFriendColor",LLColor4(1.f,1.f,0.f,1.f)); - element["columns"][LIST_AVATAR_NAME]["color"] = ascent_friend_color.get().getValue(); + name_color = ascent_friend_color; } //big fat jerkface who is probably a jerk, display them as such. else if(LLMuteList::getInstance()->isMuted(av_id)) { static const LLCachedControl ascent_muted_color("AscentMutedColor",LLColor4(0.7f,0.7f,0.7f,1.f)); - element["columns"][LIST_AVATAR_NAME]["color"] = ascent_muted_color.get().getValue(); + name_color = ascent_muted_color; } + + name_color = name_color*0.5f + unselected_color*0.5f; + element["columns"][LIST_AVATAR_NAME]["color"] = name_color.getValue(); char temp[32]; LLColor4 color = LLColor4::black; @@ -830,16 +837,15 @@ void LLFloaterAvatarList::refreshAvatarList() //element["columns"][LIST_METADATA]["type"] = "text"; static const LLCachedControl avatar_name_color("AvatarNameColor",LLColor4(LLColor4U(251, 175, 93, 255)), gColors ); - static const LLCachedControl unselected_color("ScrollUnselectedColor",LLColor4(LLColor4U(0, 0, 0, 204)), gColors ); - LLColor4 name_color(avatar_name_color); + LLColor4 client_color(avatar_name_color); std::string client; LLVOAvatar *avatarp = gObjectList.findAvatar(av_id); if(avatarp) { - avatarp->getClientInfo(client, name_color, TRUE); + avatarp->getClientInfo(client, client_color, TRUE); if(client == "") { - name_color = unselected_color; + client_color = unselected_color; client = "?"; } element["columns"][LIST_CLIENT]["value"] = client.c_str(); @@ -857,9 +863,9 @@ void LLFloaterAvatarList::refreshAvatarList() element["columns"][LIST_CLIENT]["value"] = "Out Of Range"; } //Blend to make the color show up better - name_color = name_color *.5f + unselected_color * .5f; + client_color = client_color *.5f + unselected_color * .5f; - element["columns"][LIST_CLIENT]["color"] = avatar_name_color.get().getValue(); + element["columns"][LIST_CLIENT]["color"] = client_color.getValue(); // Add to list mAvatarList->addElement(element, ADD_BOTTOM); diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index d434ecdb8..3f5641558 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -75,6 +75,7 @@ #include "llfloaterhtml.h" #include "llweb.h" #include "llstylemap.h" +#include "ascentkeyword.h" // linden library includes #include "llaudioengine.h" @@ -595,6 +596,20 @@ LLColor4 get_text_color(const LLChat& chat) } } + static const LLCachedControl mKeywordsChangeColor("KeywordsChangeColor", false, gSavedPerAccountSettings); + static const LLCachedControl mKeywordsColor("KeywordsColor", LLColor4(1.f, 1.f, 1.f, 1.f), gSavedPerAccountSettings); + + if (gAgent.getID() != chat.mFromID) + { + if (mKeywordsChangeColor) + { + if (AscentKeyword::hasKeyword(chat.mText, 1)) + { + text_color = mKeywordsColor; + } + } + } + return text_color; } diff --git a/indra/newview/llfloatercustomize.cpp b/indra/newview/llfloatercustomize.cpp index b8e23f387..96f300cd5 100644 --- a/indra/newview/llfloatercustomize.cpp +++ b/indra/newview/llfloatercustomize.cpp @@ -1386,14 +1386,18 @@ LLScrollingPanelParam::LLScrollingPanelParam( const std::string& name, else { //Kill everything that isn't the slider... - for(child_list_t::const_iterator it = getChildList()->begin();it!=getChildList()->end();) + child_list_t to_remove; + child_list_t::const_iterator it; + for (it = getChildList()->begin(); it != getChildList()->end(); it++) { - if((*it)!=slider && (*it)->getName() != "panel border") + if ((*it) != slider && (*it)->getName() != "panel border") { - llinfos << "removing: " << (*it)->getName() << llendl; - removeChild((*(it++)),TRUE); + to_remove.push_back(*it); } - else ++it; + } + for (it = to_remove.begin(); it != to_remove.end(); it++) + { + removeChild(*it, TRUE); } slider->translate(0,PARAM_HINT_HEIGHT); reshape(getRect().getWidth(),getRect().getHeight()-PARAM_HINT_HEIGHT); diff --git a/indra/newview/llfloatercustomize.h b/indra/newview/llfloatercustomize.h index 84af37f70..1b7b57705 100644 --- a/indra/newview/llfloatercustomize.h +++ b/indra/newview/llfloatercustomize.h @@ -131,7 +131,7 @@ protected: LLScrollingPanelList* mScrollingPanelList; LLScrollableContainerView* mScrollContainer; - LLVisualParamReset* mResetParams; + LLPointer mResetParams; LLInventoryObserver* mInventoryObserver; diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index fd6bcca05..81a787967 100644 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -77,6 +77,7 @@ void LLFloaterHardwareSettings::refresh() LLPanel::refresh(); mUseVBO = gSavedSettings.getBOOL("RenderVBOEnable"); + mUseFBO = gSavedSettings.getBOOL("RenderUseFBO"); mUseAniso = gSavedSettings.getBOOL("RenderAnisotropic"); mFSAASamples = gSavedSettings.getU32("RenderFSAASamples"); mGamma = gSavedSettings.getF32("RenderGamma"); @@ -106,7 +107,8 @@ void LLFloaterHardwareSettings::refreshEnabledState() { childSetEnabled("vbo_stream", LLVertexBuffer::sEnableVBOs); } - + + childSetEnabled("fbo",gGLManager.mHasFramebufferObject); // if no windlight shaders, turn off nighttime brightness, gamma, and fog distance childSetEnabled("gamma", !gPipeline.canUseWindLightShaders()); @@ -192,6 +194,7 @@ void LLFloaterHardwareSettings::apply() void LLFloaterHardwareSettings::cancel() { gSavedSettings.setBOOL("RenderVBOEnable", mUseVBO); + gSavedSettings.setBOOL("RenderUseFBO", mUseFBO); gSavedSettings.setBOOL("RenderAnisotropic", mUseAniso); gSavedSettings.setU32("RenderFSAASamples", mFSAASamples); gSavedSettings.setF32("RenderGamma", mGamma); diff --git a/indra/newview/llfloaterhardwaresettings.h b/indra/newview/llfloaterhardwaresettings.h index 04a33f69d..bdf3fb13b 100644 --- a/indra/newview/llfloaterhardwaresettings.h +++ b/indra/newview/llfloaterhardwaresettings.h @@ -88,6 +88,7 @@ protected: LLSliderCtrl* mCtrlVideoCardMem; BOOL mUseVBO; + BOOL mUseFBO; BOOL mUseAniso; U32 mFSAASamples; F32 mGamma; diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index 3e3b83eab..98814e882 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -509,6 +509,8 @@ void LLHUDEffectLookAt::render() (gAgent.getAvatarObject() == ((LLVOAvatar*)(LLViewerObject*)mSourceObject))) return; if (sDebugLookAt && mSourceObject.notNull()) { + LLGLDepthTest gls_depth(GL_TRUE,GL_FALSE); + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLVector3 target = mTargetPos + ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->mHeadp->getWorldPosition(); diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 5476db1e2..cef6f9daa 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -74,6 +74,7 @@ #include "llhttpclient.h" #include "llmutelist.h" #include "llstylemap.h" +#include "ascentkeyword.h" #include "boost/algorithm/string.hpp" @@ -1592,8 +1593,23 @@ BOOL LLFloaterIMPanel::inviteToSession(const LLDynamicArray& ids) return TRUE; } -void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, const LLColor4& color, bool log_to_file, const LLUUID& source, const std::string& name) +void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incolor, bool log_to_file, const LLUUID& source, const std::string& name) { + static const LLCachedControl mKeywordsChangeColor("KeywordsChangeColor", false, gSavedPerAccountSettings); + static const LLCachedControl mKeywordsColor("KeywordsColor", LLColor4(1.f, 1.f, 1.f, 1.f), gSavedPerAccountSettings); + + if (gAgent.getID() != source) + { + if (mKeywordsChangeColor) + { + if (AscentKeyword::hasKeyword(utf8msg, 2)) + { + incolor = mKeywordsColor; + } + } + } + + const LLColor4& color = incolor; // start tab flashing when receiving im for background session from user if (source != LLUUID::null) { diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index c839a2ca2..5787fc603 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -211,7 +211,7 @@ public: BOOL inviteToSession(const LLDynamicArray& agent_ids); void addHistoryLine(const std::string &utf8msg, - const LLColor4& color = LLColor4::white, + LLColor4 incolor = LLColor4::white, bool log_to_file = true, const LLUUID& source = LLUUID::null, const std::string& name = LLStringUtil::null); diff --git a/indra/newview/llpaneldisplay.cpp b/indra/newview/llpaneldisplay.cpp index 273e68fdb..c8906fc53 100644 --- a/indra/newview/llpaneldisplay.cpp +++ b/indra/newview/llpaneldisplay.cpp @@ -233,13 +233,21 @@ BOOL LLPanelDisplay::postBuild() mCtrlReflections = getChild("Reflections"); mCtrlReflections->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); mCtrlReflections->setCallbackUserData(this); - mRadioReflectionDetail = getChild("ReflectionDetailRadio"); + mCtrlReflectionDetail = getChild("ReflectionDetailCombo"); // WindLight mCtrlWindLight = getChild("WindLightUseAtmosShaders"); mCtrlWindLight->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); mCtrlWindLight->setCallbackUserData(this); + // Deferred + mCtrlDeferred = getChild("RenderDeferred"); + mCtrlDeferred->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); + mCtrlDeferred->setCallbackUserData(this); + mCtrlSunShadow = getChild("RenderDeferredSunShadow"); + mCtrlSunShadow->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); + mCtrlSunShadow->setCallbackUserData(this); + //---------------------------------------------------------------------------- // Enable Avatar Shaders mCtrlAvatarVP = getChild("AvatarVertexProgram"); @@ -391,6 +399,8 @@ void LLPanelDisplay::refresh() mWindLight = gSavedSettings.getBOOL("WindLightUseAtmosShaders"); mReflections = gSavedSettings.getBOOL("RenderWaterReflections"); mAvatarVP = gSavedSettings.getBOOL("RenderAvatarVP"); + mDeferred = gSavedSettings.getBOOL("RenderDeferred"); + mSunShadow = gSavedSettings.getBOOL("RenderDeferredSunShadow"); // reflection radio mReflectionDetail = gSavedSettings.getS32("RenderReflectionDetail"); @@ -464,10 +474,7 @@ void LLPanelDisplay::refreshEnabledState() bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump"); mCtrlBumpShiny->setEnabled(bumpshiny ? TRUE : FALSE); - for (S32 i = 0; i < mRadioReflectionDetail->getItemCount(); ++i) - { - mRadioReflectionDetail->setIndexEnabled(i, mCtrlReflections->get() && reflections); - } + mCtrlReflectionDetail->setEnabled(mCtrlReflections->get() && reflections); // Avatar Mode S32 max_avatar_shader = LLViewerShaderMgr::instance()->mMaxAvatarShaderLevel; @@ -483,6 +490,20 @@ void LLPanelDisplay::refreshEnabledState() mCtrlAvatarCloth->setEnabled(true); } + //I actually recommend RenderUseFBO:FALSE for ati users when not using deferred, so RenderUseFBO shouldn't control visibility of the element. + // Instead, gGLManager.mHasFramebufferObject seems better as it is determined by hardware and not current user settings. -Shyotl + //Enabling deferred will force RenderUseFBO to TRUE. + BOOL can_defer = gGLManager.mHasFramebufferObject && + LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && //Ensure it's enabled in the gpu feature table + LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP") && //Hardware Skinning. Deferred forces RenderAvatarVP to true + LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable") && gSavedSettings.getBOOL("VertexShaderEnable") && //Basic Shaders + LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders") && gSavedSettings.getBOOL("WindLightUseAtmosShaders"); //Atmospheric Shaders + + + mCtrlDeferred->setEnabled(can_defer); + mCtrlSunShadow->setEnabled(can_defer && gSavedSettings.getBOOL("RenderDeferred")); + mCtrlAvatarCloth->setValue(gSavedSettings.getBOOL("RenderAvatarVP")); //Enabling RenderDeferred changes this setting behind this floaters back. + // Vertex Shaders // mCtrlShaderEnable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")); // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0a @@ -538,6 +559,11 @@ void LLPanelDisplay::disableUnavailableSettings() mCtrlAvatarCloth->setEnabled(FALSE); mCtrlAvatarCloth->setValue(FALSE); + + mCtrlDeferred->setEnabled(FALSE); + mCtrlDeferred->setValue(FALSE); + mCtrlSunShadow->setEnabled(FALSE); + mCtrlSunShadow->setValue(FALSE); } // disabled windlight @@ -575,6 +601,15 @@ void LLPanelDisplay::disableUnavailableSettings() mCtrlAvatarImpostors->setEnabled(FALSE); mCtrlAvatarImpostors->setValue(FALSE); } + // disabled deferred + if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred")) + { + mCtrlDeferred->setEnabled(FALSE); + mCtrlDeferred->setValue(FALSE); + mCtrlSunShadow->setEnabled(FALSE); + mCtrlSunShadow->setValue(FALSE); + } + } void LLPanelDisplay::setHiddenGraphicsState(bool isHidden) @@ -610,7 +645,7 @@ void LLPanelDisplay::setHiddenGraphicsState(bool isHidden) llassert(mRadioLightingDetail2 != NULL); llassert(mRadioTerrainDetail != NULL); - llassert(mRadioReflectionDetail != NULL); + llassert(mCtrlReflectionDetail != NULL); llassert(mMeshDetailText != NULL); llassert(mShaderText != NULL); @@ -633,7 +668,7 @@ void LLPanelDisplay::setHiddenGraphicsState(bool isHidden) mCtrlLODFactor->setVisible(!isHidden); mCtrlFlexFactor->setVisible(!isHidden); mCtrlTreeFactor->setVisible(!isHidden); - mCtrlAvatarFactor->setVisible(!isHidden); + mCtrlAvatarFactor->setVisible(!isHidden); mCtrlTerrainFactor->setVisible(!isHidden); mCtrlSkyFactor->setVisible(!isHidden); mCtrlMaxParticle->setVisible(!isHidden); @@ -657,7 +692,10 @@ void LLPanelDisplay::setHiddenGraphicsState(bool isHidden) mRadioLightingDetail2->setVisible(!isHidden); mRadioTerrainDetail->setVisible(!isHidden); - mRadioReflectionDetail->setVisible(!isHidden); + mCtrlReflectionDetail->setVisible(!isHidden); + + mCtrlDeferred->setVisible(!isHidden); + mCtrlSunShadow->setVisible(!isHidden); // text boxes mShaderText->setVisible(!isHidden); @@ -691,6 +729,8 @@ void LLPanelDisplay::cancel() gSavedSettings.setBOOL("WindLightUseAtmosShaders", mWindLight); gSavedSettings.setBOOL("RenderWaterReflections", mReflections); gSavedSettings.setBOOL("RenderAvatarVP", mAvatarVP); + gSavedSettings.setBOOL("RenderDeferred", mDeferred); + gSavedSettings.setBOOL("RenderDeferredSunShadow", mSunShadow); gSavedSettings.setS32("RenderReflectionDetail", mReflectionDetail); diff --git a/indra/newview/llpaneldisplay.h b/indra/newview/llpaneldisplay.h index 1aedee499..677f1086c 100644 --- a/indra/newview/llpaneldisplay.h +++ b/indra/newview/llpaneldisplay.h @@ -84,6 +84,7 @@ protected: LLComboBox *mCtrlFullScreen; // Fullscreen resolution LLCheckBoxCtrl *mCtrlAutoDetectAspect; // automatically detect aspect ratio LLComboBox *mCtrlAspectRatio; // user provided aspect ratio + LLComboBox *mCtrlReflectionDetail; LLCheckBoxCtrl *mCtrlWindowed; // windowed mode LLComboBox *mCtrlWindowSize; // window size for windowed mode @@ -110,12 +111,12 @@ protected: LLCheckBoxCtrl *mCtrlWindLight; LLCheckBoxCtrl *mCtrlAvatarVP; LLCheckBoxCtrl *mCtrlShaderEnable; + LLCheckBoxCtrl *mCtrlDeferred; + LLCheckBoxCtrl *mCtrlSunShadow; LLCheckBoxCtrl *mCtrlAvatarImpostors; LLCheckBoxCtrl *mCtrlAvatarCloth; LLRadioGroup *mRadioLightingDetail2; - LLRadioGroup *mRadioTerrainDetail; - LLRadioGroup *mRadioReflectionDetail; LLTextBox *mAspectRatioLabel1; LLTextBox *mDisplayResLabel; @@ -151,6 +152,8 @@ protected: BOOL mShaderEnable; BOOL mWindLight; BOOL mReflections; + BOOL mDeferred; + BOOL mSunShadow; BOOL mAvatarVP; S32 mReflectionDetail; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index c5889106f..73b108981 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -224,7 +224,7 @@ static bool handleAvatarLODChanged(const LLSD& newvalue) static bool handleAvatarPhysicsLODChanged(const LLSD& newvalue) { - LLVOAvatar::sLODFactor = (F32) newvalue.asReal(); + LLVOAvatar::sPhysicsLODFactor = (F32) newvalue.asReal(); return true; } diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 9fc072b59..5e62531d1 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1092,9 +1092,9 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) LLViewerObject* objectp = *iter; llassert_always(objectp); - llassert_always(!objectp->isDead()); - - if (!objectp->getRegion() || objectp->isOrphaned() || objectp->isAttachment()) + llassert(!objectp->isDead()); + + if (objectp->isDead() || !objectp->getRegion() || objectp->isOrphaned() || objectp->isAttachment()) { continue; } diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 8ef475a24..00d89e45d 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -310,7 +310,9 @@ void LLViewerShaderMgr::setShaders() S32 deferred_class = 0; if (LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && - gSavedSettings.getBOOL("RenderDeferred")) + gSavedSettings.getBOOL("RenderDeferred") && + LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders") && + gSavedSettings.getBOOL("WindLightUseAtmosShaders")) { deferred_class = 1; @@ -319,9 +321,6 @@ void LLViewerShaderMgr::setShaders() //make sure hardware skinning is enabled gSavedSettings.setBOOL("RenderAvatarVP", TRUE); - - //make sure atmospheric shaders are enabled - gSavedSettings.setBOOL("WindLightUseAtmosShaders", TRUE); } if (!(LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders") && gSavedSettings.getBOOL("WindLightUseAtmosShaders"))) diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index e9e1ac086..0c445b65f 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -1386,26 +1386,17 @@ void send_agent_resume() LLAppViewer::instance()->resumeMainloopTimeout(); } -static LLVector3d unpackLocalToGlobalPosition(U32 compact_local, const LLVector3d& region_origin) -{ - LLVector3d pos_global; - LLVector3 pos_local; - U8 bits; - - bits = compact_local & 0xFF; - pos_local.mV[VZ] = F32(bits) * 4.f; - compact_local >>= 8; - - bits = compact_local & 0xFF; - pos_local.mV[VY] = (F32)bits; - compact_local >>= 8; - - bits = compact_local & 0xFF; - pos_local.mV[VX] = (F32)bits; - - pos_global.setVec( pos_local ); - pos_global += region_origin; - return pos_global; +static LLVector3d unpackLocalToGlobalPosition(U32 compact_local, const LLVector3d& region_origin) +{ + LLVector3d pos_global(region_origin); + LLVector3d pos_local; + + pos_local.mdV[VZ] = (compact_local & 0xFFU) * 4; + pos_local.mdV[VY] = (compact_local >> 8) & 0xFFU; + pos_local.mdV[VX] = (compact_local >> 16) & 0xFFU; + + pos_global += pos_local; + return pos_global; } void LLWorld::getAvatars(std::vector* avatar_ids, std::vector* positions, const LLVector3d& relative_to, F32 radius) const diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index e10b64409..3562733ea 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -563,6 +563,7 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) void LLPipeline::updateRenderDeferred() { sRenderDeferred = (gSavedSettings.getBOOL("RenderDeferred") && + LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && LLRenderTarget::sUseFBO && gSavedSettings.getBOOL("VertexShaderEnable") && gSavedSettings.getBOOL("RenderAvatarVP") && diff --git a/indra/newview/skins/default/xui/en-us/floater_hardware_settings.xml b/indra/newview/skins/default/xui/en-us/floater_hardware_settings.xml index aab647014..21ba6b168 100644 --- a/indra/newview/skins/default/xui/en-us/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/en-us/floater_hardware_settings.xml @@ -69,6 +69,19 @@ mouse_opaque="true" name="vbo_stream" radio_style="false" tool_tip="Disabling this may improve performance when VBOs are enabled. Disabling produced observable improvement on various AMD GPUs." width="315" /> + + Enable Framebuffer Objects: + + - + + + + + seconds + + + + + + + seconds + + + + - Current language (dictionary): - - Downloaded languages (dictionaries): -