diff options
115 files changed, 1072 insertions, 494 deletions
@@ -32,3 +32,4 @@ b0cd7e150009809a0b5b0a9d5785cd4bb230413a 2.2.0-beta3 98e0d6df638429fd2f0476667504bd5a6b298def 2.3.0-beta1 1415e6538d54fd5d568ee88343424d57c6803c2c 2.2.0-release 98e0d6df638429fd2f0476667504bd5a6b298def 2.3.0-start +a3c12342b1af0951b8aa3b828aacef17fcea8178 2.3.0-beta1 diff --git a/doc/contributions.txt b/doc/contributions.txt index 96ee446a0c..2ca5adc643 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -69,6 +69,7 @@ Aleric Inglewood VWR-10759 VWR-10837 VWR-12691 + VWR-12984 VWR-13996 VWR-14426 SNOW-84 @@ -78,6 +79,8 @@ Aleric Inglewood Ales Beaumont VWR-9352 SNOW-240 +Alexandrea Fride + STORM-255 Alissa Sabre VWR-81 VWR-83 @@ -593,6 +596,8 @@ Salahzar Stenvaag CT-321 Sammy Frederix VWR-6186 +Satomi Ahn + STORM-501 Scrippy Scofield VWR-3748 Seg Baphomet @@ -751,6 +756,9 @@ Wilton Lundquist VWR-7682 Zai Lynch VWR-19505 +Wolfpup Lowenhar + STORM-255 + STORM-256 Zarkonnen Decosta VWR-253 Zi Ree diff --git a/indra/llaudio/llvorbisencode.cpp b/indra/llaudio/llvorbisencode.cpp index 9f479189d7..0e0c80a456 100644 --- a/indra/llaudio/llvorbisencode.cpp +++ b/indra/llaudio/llvorbisencode.cpp @@ -120,6 +120,13 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro + ((U32) wav_header[5] << 8) + wav_header[4]; + if (chunk_length > physical_file_size - file_pos - 4) + { + infile.close(); + error_msg = "SoundFileInvalidChunkSize"; + return(LLVORBISENC_CHUNK_SIZE_ERR); + } + // llinfos << "chunk found: '" << wav_header[0] << wav_header[1] << wav_header[2] << wav_header[3] << "'" << llendl; if (!(strncmp((char *)&(wav_header[0]),"fmt ",4))) diff --git a/indra/llaudio/llvorbisencode.h b/indra/llaudio/llvorbisencode.h index d33aacf1ea..6b22a2cb59 100644 --- a/indra/llaudio/llvorbisencode.h +++ b/indra/llaudio/llvorbisencode.h @@ -38,6 +38,7 @@ const S32 LLVORBISENC_MULTICHANNEL_ERR = 7; // can't do stereo const S32 LLVORBISENC_UNSUPPORTED_SAMPLE_RATE = 8; // unsupported sample rate const S32 LLVORBISENC_UNSUPPORTED_WORD_SIZE = 9; // unsupported word size const S32 LLVORBISENC_CLIP_TOO_LONG = 10; // source file is too long +const S32 LLVORBISENC_CHUNK_SIZE_ERR = 11; // chunk size is wrong const F32 LLVORBIS_CLIP_MAX_TIME = 10.0f; const U8 LLVORBIS_CLIP_MAX_CHANNELS = 2; diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 522b99bc02..a8f53a38c3 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -556,25 +556,38 @@ std::string LLCacheName::buildUsername(const std::string& full_name) //static std::string LLCacheName::buildLegacyName(const std::string& complete_name) { - boost::regex complete_name_regex("(.+)( \\()([A-Za-z]+)(.[A-Za-z]+)*(\\))"); - boost::match_results<std::string::const_iterator> name_results; - if (!boost::regex_match(complete_name, name_results, complete_name_regex)) return complete_name; + // regexp doesn't play nice with unicode, chop off the display name + S32 open_paren = complete_name.rfind(" ("); - std::string legacy_name = name_results[3]; + if (open_paren == std::string::npos) + { + return complete_name; + } + + std::string username = complete_name.substr(open_paren); + boost::regex complete_name_regex("( \\()([a-z0-9]+)(.[a-z]+)*(\\))");
+ boost::match_results<std::string::const_iterator> name_results;
+ if (!boost::regex_match(username, name_results, complete_name_regex)) return complete_name;
+
+ std::string legacy_name = name_results[2]; // capitalize the first letter std::string cap_letter = legacy_name.substr(0, 1); LLStringUtil::toUpper(cap_letter); - legacy_name = cap_letter + legacy_name.substr(1); - - if (name_results[4].matched) - { - std::string last_name = name_results[4]; + legacy_name = cap_letter + legacy_name.substr(1);
+
+ if (name_results[3].matched)
+ {
+ std::string last_name = name_results[3]; std::string cap_letter = last_name.substr(1, 1); LLStringUtil::toUpper(cap_letter); - last_name = cap_letter + last_name.substr(2); - legacy_name = legacy_name + " " + last_name; - } - + last_name = cap_letter + last_name.substr(2);
+ legacy_name = legacy_name + " " + last_name;
+ }
+ else
+ {
+ legacy_name = legacy_name + " Resident";
+ }
+
return legacy_name; } diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index c0edd92bc1..096e8e07ab 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -610,41 +610,46 @@ void LLGLManager::shutdownGL() void LLGLManager::initExtensions() { #if LL_MESA_HEADLESS -# if GL_ARB_multitexture +# ifdef GL_ARB_multitexture mHasMultitexture = TRUE; # else mHasMultitexture = FALSE; # endif -# if GL_ARB_texture_env_combine +# ifdef GL_ARB_texture_env_combine mHasARBEnvCombine = TRUE; # else mHasARBEnvCombine = FALSE; # endif -# if GL_ARB_texture_compression +# ifdef GL_ARB_texture_compression mHasCompressedTextures = TRUE; # else mHasCompressedTextures = FALSE; # endif -# if GL_ARB_vertex_buffer_object +# ifdef GL_ARB_vertex_buffer_object mHasVertexBufferObject = TRUE; # else mHasVertexBufferObject = FALSE; # endif -# if GL_EXT_framebuffer_object +# ifdef GL_EXT_framebuffer_object mHasFramebufferObject = TRUE; # else mHasFramebufferObject = FALSE; # endif -# if GL_EXT_framebuffer_multisample +# ifdef GL_EXT_framebuffer_multisample mHasFramebufferMultisample = TRUE; # else mHasFramebufferMultisample = FALSE; # endif -# if GL_ARB_draw_buffers +# ifdef GL_ARB_draw_buffers mHasDrawBuffers = TRUE; #else mHasDrawBuffers = FALSE; # endif +# if defined(GL_NV_depth_clamp) || defined(GL_ARB_depth_clamp) + mHasDepthClamp = TRUE; +#else + mHasDepthClamp = FALSE; +#endif # if GL_EXT_blend_func_separate mHasBlendFuncSeparate = TRUE; #else @@ -671,6 +676,7 @@ void LLGLManager::initExtensions() mHasCompressedTextures = glh_init_extensions("GL_ARB_texture_compression"); mHasOcclusionQuery = ExtensionExists("GL_ARB_occlusion_query", gGLHExts.mSysExts); mHasVertexBufferObject = ExtensionExists("GL_ARB_vertex_buffer_object", gGLHExts.mSysExts); + mHasDepthClamp = ExtensionExists("GL_ARB_depth_clamp", gGLHExts.mSysExts) || ExtensionExists("GL_NV_depth_clamp", gGLHExts.mSysExts); // mask out FBO support when packed_depth_stencil isn't there 'cause we need it for LLRenderTarget -Brad mHasFramebufferObject = ExtensionExists("GL_EXT_framebuffer_object", gGLHExts.mSysExts) && ExtensionExists("GL_EXT_packed_depth_stencil", gGLHExts.mSysExts); @@ -694,6 +700,7 @@ void LLGLManager::initExtensions() if (getenv("LL_GL_NOEXT")) { //mHasMultitexture = FALSE; // NEEDED! + mHasDepthClamp = FALSE; mHasARBEnvCombine = FALSE; mHasCompressedTextures = FALSE; mHasVertexBufferObject = FALSE; @@ -755,6 +762,7 @@ void LLGLManager::initExtensions() if (strchr(blacklist,'s')) mHasFramebufferMultisample = FALSE; if (strchr(blacklist,'t')) mHasTextureRectangle = FALSE; if (strchr(blacklist,'u')) mHasBlendFuncSeparate = FALSE;//S + if (strchr(blacklist,'v')) mHasDepthClamp = FALSE; } #endif // LL_LINUX || LL_SOLARIS @@ -2037,7 +2045,7 @@ void LLGLDepthTest::checkState() } } -LLGLClampToFarClip::LLGLClampToFarClip(glh::matrix4f P) +LLGLSquashToFarClip::LLGLSquashToFarClip(glh::matrix4f P) { for (U32 i = 0; i < 4; i++) { @@ -2050,7 +2058,7 @@ LLGLClampToFarClip::LLGLClampToFarClip(glh::matrix4f P) glMatrixMode(GL_MODELVIEW); } -LLGLClampToFarClip::~LLGLClampToFarClip() +LLGLSquashToFarClip::~LLGLSquashToFarClip() { glMatrixMode(GL_PROJECTION); glPopMatrix(); diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index 5e8965c06a..b0decc1499 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -92,6 +92,7 @@ public: BOOL mHasOcclusionQuery; BOOL mHasPointParameters; BOOL mHasDrawBuffers; + BOOL mHasDepthClamp; BOOL mHasTextureRectangle; // Other extensions. @@ -315,11 +316,11 @@ private: leaves this class. Does not stack. */ -class LLGLClampToFarClip +class LLGLSquashToFarClip { public: - LLGLClampToFarClip(glh::matrix4f projection); - ~LLGLClampToFarClip(); + LLGLSquashToFarClip(glh::matrix4f projection); + ~LLGLSquashToFarClip(); }; /* diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index 5a34b46d0c..576969b81a 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -829,5 +829,15 @@ extern void glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); #endif // LL_MESA / LL_WINDOWS / LL_DARWIN +// Even when GL_ARB_depth_clamp is available in the driver, the (correct) +// headers, and therefore GL_DEPTH_CLAMP might not be defined. +// In that case GL_DEPTH_CLAMP_NV should be defined, but why not just +// use the known numeric. +// +// To avoid #ifdef's in the code. Just define this here. +#ifndef GL_DEPTH_CLAMP +// Probably (still) called GL_DEPTH_CLAMP_NV. +#define GL_DEPTH_CLAMP 0x864F +#endif #endif // LL_LLGLHEADERS_H diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 758df418e8..5721df6b36 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2214,19 +2214,39 @@ bool LLTextBase::scrolledToEnd() return mScroller->isAtBottom(); } - bool LLTextBase::setCursor(S32 row, S32 column) { - if (0 <= row && row < (S32)mLineInfoList.size()) + if (row < 0 || column < 0) return false; + + S32 n_lines = mLineInfoList.size(); + for (S32 line = row; line < n_lines; ++line) { - S32 doc_pos = mLineInfoList[row].mDocIndexStart; - column = llclamp(column, 0, mLineInfoList[row].mDocIndexEnd - mLineInfoList[row].mDocIndexStart - 1); - doc_pos += column; - updateCursorXPos(); + const line_info& li = mLineInfoList[line]; + + if (li.mLineNum < row) + { + continue; + } + else if (li.mLineNum > row) + { + break; // invalid column specified + } + + // Found the given row. + S32 line_length = li.mDocIndexEnd - li.mDocIndexStart;; + if (column >= line_length) + { + column -= line_length; + continue; + } + // Found the given column. + updateCursorXPos(); + S32 doc_pos = li.mDocIndexStart + column; return setCursorPos(doc_pos); } - return false; + + return false; // invalid row or column specified } diff --git a/indra/llui/lluistring.h b/indra/llui/lluistring.h index eff2467bf0..4faa0e070e 100644 --- a/indra/llui/lluistring.h +++ b/indra/llui/lluistring.h @@ -58,10 +58,12 @@ class LLUIString public: // These methods all perform appropriate argument substitution // and modify mOrig where appropriate - LLUIString() : mArgs(NULL), mNeedsResult(false), mNeedsWResult(false) {} + LLUIString() : mArgs(NULL), mNeedsResult(false), mNeedsWResult(false) {} LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args); LLUIString(const std::string& instring) : mArgs(NULL) { assign(instring); } + ~LLUIString() { delete mArgs; } + void assign(const std::string& instring); LLUIString& operator=(const std::string& s) { assign(s); return *this; } @@ -81,14 +83,14 @@ public: void clear(); void clearArgs() { if (mArgs) mArgs->clear(); } - + // These utility functions are included for text editing. // They do not affect mOrig and do not perform argument substitution void truncate(S32 maxchars); void erase(S32 charidx, S32 len); void insert(S32 charidx, const LLWString& wchars); void replace(S32 charidx, llwchar wc); - + private: // something changed, requiring reformatting of strings void dirty(); @@ -100,7 +102,7 @@ private: void updateResult() const; void updateWResult() const; LLStringUtil::format_map_t& getArgs(); - + std::string mOrig; mutable std::string mResult; mutable LLWString mWResult; // for displaying diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index f49dfec82b..84678ef4db 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -989,7 +989,8 @@ std::string LLUrlEntryNoLink::getLabel(const std::string &url, const LLUrlLabelC LLStyle::Params LLUrlEntryNoLink::getStyle() const { - return LLStyle::Params(); + // Don't render as URL (i.e. no context menu or hand cursor). + return LLStyle::Params().is_link(false); } diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7172f0359a..e5656c0877 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2567,6 +2567,28 @@ <key>Value</key> <integer>1</integer> </map> + <key>EnableGroupChatPopups</key> + <map> + <key>Comment</key> + <string>Enable Incoming Group Chat Popups</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>EnableIMChatPopups</key> + <map> + <key>Comment</key> + <string>Enable Incoming IM Chat Popups</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>DisplayAvatarAgentTarget</key> <map> <key>Comment</key> diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 68e408d3e4..7c953cd2dc 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -296,8 +296,11 @@ void LLAgentCamera::resetView(BOOL reset_camera, BOOL change_camera) LLSelectMgr::getInstance()->deselectAll(); } - // Hide all popup menus - gMenuHolder->hideMenus(); + if (gMenuHolder != NULL) + { + // Hide all popup menus + gMenuHolder->hideMenus(); + } } if (change_camera && !gSavedSettings.getBOOL("FreezeTime")) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index ed5e8ceee3..62074ddcd5 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2204,12 +2204,11 @@ void LLAppearanceMgr::updateIsDirty() base_outfit = catp->getUUID(); } - if(base_outfit.isNull()) - { - // no outfit link found, display "unsaved outfit" - mOutfitIsDirty = true; - } - else + // Set dirty to "false" if no base outfit found to disable "Save" + // and leave only "Save As" enabled in My Outfits. + mOutfitIsDirty = false; + + if (base_outfit.notNull()) { LLIsOfAssetType collector = LLIsOfAssetType(LLAssetType::AT_LINK); @@ -2248,8 +2247,6 @@ void LLAppearanceMgr::updateIsDirty() return; } } - - mOutfitIsDirty = false; } } @@ -2635,6 +2632,7 @@ void LLAppearanceMgr::dumpItemArray(const LLInventoryModel::item_array_t& items, LLAppearanceMgr::LLAppearanceMgr(): mAttachmentInvLinkEnabled(false), mOutfitIsDirty(false), + mOutfitLocked(false), mIsInUpdateAppearanceFromCOF(false) { LLOutfitObserver& outfit_observer = LLOutfitObserver::instance(); diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index a56dc129d4..30eecfe323 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -41,7 +41,7 @@ bool LLAvatarListItem::sStaticInitialized = false; S32 LLAvatarListItem::sLeftPadding = 0; -S32 LLAvatarListItem::sRightNamePadding = 0; +S32 LLAvatarListItem::sNameRightPadding = 0; S32 LLAvatarListItem::sChildrenWidths[LLAvatarListItem::ALIC_COUNT]; static LLWidgetNameRegistry::StaticRegistrar sRegisterAvatarListItemParams(&typeid(LLAvatarListItem::Params), "avatar_list_item"); @@ -52,7 +52,8 @@ LLAvatarListItem::Params::Params() voice_call_joined_style("voice_call_joined_style"), voice_call_left_style("voice_call_left_style"), online_style("online_style"), - offline_style("offline_style") + offline_style("offline_style"), + name_right_pad("name_right_pad", 0) {}; @@ -119,6 +120,9 @@ BOOL LLAvatarListItem::postBuild() // so that we can hide and show them again later. initChildrenWidths(this); + // Right padding between avatar name text box and nearest visible child. + sNameRightPadding = LLUICtrlFactory::getDefaultParams<LLAvatarListItem>().name_right_pad; + sStaticInitialized = true; } @@ -486,7 +490,6 @@ void LLAvatarListItem::initChildrenWidths(LLAvatarListItem* avatar_item) S32 icon_width = avatar_item->mAvatarName->getRect().mLeft - avatar_item->mAvatarIcon->getRect().mLeft; sLeftPadding = avatar_item->mAvatarIcon->getRect().mLeft; - sRightNamePadding = avatar_item->mLastInteractionTime->getRect().mLeft - avatar_item->mAvatarName->getRect().mRight; S32 index = ALIC_COUNT; sChildrenWidths[--index] = icon_width; @@ -565,7 +568,7 @@ void LLAvatarListItem::updateChildren() // apply paddings name_new_width -= sLeftPadding; - name_new_width -= sRightNamePadding; + name_new_width -= sNameRightPadding; name_view_rect.setLeftTopAndSize( name_new_left, diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index a069838ac3..c95ac39696 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -51,6 +51,8 @@ public: online_style, offline_style; + Optional<S32> name_right_pad; + Params(); }; @@ -215,7 +217,7 @@ private: static bool sStaticInitialized; // this variable is introduced to improve code readability static S32 sLeftPadding; // padding to first left visible child (icon or name) - static S32 sRightNamePadding; // right padding from name to next visible child + static S32 sNameRightPadding; // right padding from name to next visible child /** * Contains widths of each child specified by EAvatarListItemChildIndex diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index cb5cf4a61d..3dc6e786d3 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -790,8 +790,9 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL // (don't let object names with hyperlinks override our objectim Url) LLStyle::Params link_params(style_params); link_params.color.control = "HTMLLinkColor"; + link_params.is_link = true; link_params.link_href = url; - mEditor->appendText("<nolink>" + chat.mFromName + "</nolink>" + delimiter, + mEditor->appendText(chat.mFromName + delimiter, false, link_params); } else if ( chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() && !message_from_log) @@ -804,7 +805,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL } else { - mEditor->appendText(chat.mFromName + delimiter, false, style_params); + mEditor->appendText("<nolink>" + chat.mFromName + "</nolink>" + delimiter, false, style_params); } } } diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 583bb54160..8106fada11 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -358,6 +358,7 @@ void LLDrawable::makeActive() { U32 pcode = mVObjp->getPCode(); if (pcode == LLViewerObject::LL_VO_WATER || + pcode == LLViewerObject::LL_VO_VOID_WATER || pcode == LLViewerObject::LL_VO_SURFACE_PATCH || pcode == LLViewerObject::LL_VO_PART_GROUP || pcode == LLViewerObject::LL_VO_HUD_PART_GROUP || diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index cb651f9d3a..ba576ff97f 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -89,6 +89,7 @@ LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerTexture *tex0) case POOL_SKY: poolp = new LLDrawPoolSky(); break; + case POOL_VOIDWATER: case POOL_WATER: poolp = new LLDrawPoolWater(); break; diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index 221f81ec25..e394aeaaf1 100644 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -57,6 +57,7 @@ public: POOL_BUMP, POOL_INVISIBLE, // see below * POOL_AVATAR, + POOL_VOIDWATER, POOL_WATER, POOL_GLOW, POOL_ALPHA, diff --git a/indra/newview/lldrawpoolground.cpp b/indra/newview/lldrawpoolground.cpp index e950fbfa82..b4dc0c26a6 100644 --- a/indra/newview/lldrawpoolground.cpp +++ b/indra/newview/lldrawpoolground.cpp @@ -68,7 +68,7 @@ void LLDrawPoolGround::render(S32 pass) LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); - LLGLClampToFarClip far_clip(glh_get_current_projection()); + LLGLSquashToFarClip far_clip(glh_get_current_projection()); F32 water_height = gAgent.getRegion()->getWaterHeight(); glPushMatrix(); diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index d811ab8c54..9eb45a952c 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -97,7 +97,7 @@ void LLDrawPoolSky::render(S32 pass) LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); - LLGLClampToFarClip far_clip(glh_get_current_projection()); + LLGLSquashToFarClip far_clip(glh_get_current_projection()); LLGLEnable fog_enable( (mVertexShaderLevel < 1 && LLViewerCamera::getInstance()->cameraUnderWater()) ? GL_FOG : 0); diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index ce1b899d55..6126908231 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -532,6 +532,7 @@ void LLDrawPoolWater::shade() glColor4fv(water_color.mV); { + LLGLEnable depth_clamp(gGLManager.mHasDepthClamp ? GL_DEPTH_CLAMP : 0); LLGLDisable cullface(GL_CULL_FACE); for (std::vector<LLFace*>::iterator iter = mDrawFace.begin(); iter != mDrawFace.end(); iter++) @@ -548,30 +549,19 @@ void LLDrawPoolWater::shade() sNeedsReflectionUpdate = TRUE; - if (water->getUseTexture()) + if (water->getUseTexture() || !water->getIsEdgePatch()) { sNeedsDistortionUpdate = TRUE; face->renderIndexed(); } + else if (gGLManager.mHasDepthClamp || deferred_render) + { + face->renderIndexed(); + } else - { //smash background faces to far clip plane - if (water->getIsEdgePatch()) - { - if (deferred_render) - { - face->renderIndexed(); - } - else - { - LLGLClampToFarClip far_clip(glh_get_current_projection()); - face->renderIndexed(); - } - } - else - { - sNeedsDistortionUpdate = TRUE; - face->renderIndexed(); - } + { + LLGLSquashToFarClip far_clip(glh_get_current_projection()); + face->renderIndexed(); } } } diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index 41a299151e..eaa6aa7e37 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -260,7 +260,7 @@ void LLDrawPoolWLSky::render(S32 pass) LLGLDepthTest depth(GL_TRUE, GL_FALSE); LLGLDisable clip(GL_CLIP_PLANE0); - LLGLClampToFarClip far_clip(glh_get_current_projection()); + LLGLSquashToFarClip far_clip(glh_get_current_projection()); renderSkyHaze(camHeightLocal); diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index 662e1c4f42..a34e0353ec 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -209,13 +209,6 @@ void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg) llassert(msg); if (!msg) return; - LLHost host = msg->getSender(); - if (host != gAgent.getRegionHost()) - { - // update is for a different region than the one we're in - return; - } - //const S32 SIM_NAME_BUF = 256; U32 region_flags; U8 sim_access; @@ -233,6 +226,8 @@ void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg) S32 redirect_grid_y; LLUUID cache_id; + LLHost host = msg->getSender(); + msg->getStringFast(_PREHASH_RegionInfo, _PREHASH_SimName, sim_name); msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_EstateID, estate_id); msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_ParentEstateID, parent_estate_id); @@ -242,6 +237,15 @@ void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg) msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_ObjectBonusFactor, object_bonus_factor); msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_BillableFactor, billable_factor); msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_WaterHeight, water_height); + + if (host != gAgent.getRegionHost()) + { + // Update is for a different region than the one we're in. + // Just check for a waterheight change. + LLWorld::getInstance()->waterHeightRegionInfo(sim_name, water_height); + return; + } + msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_TerrainRaiseLimit, terrain_raise_limit); msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_TerrainLowerLimit, terrain_lower_limit); msg->getS32Fast(_PREHASH_RegionInfo, _PREHASH_PricePerMeter, price_per_meter); diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 7236894542..ba0eb8a711 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -635,7 +635,7 @@ void LLFloaterWorldMap::updateTeleportCoordsDisplay( const LLVector3d& pos ) // convert global specified position to a local one F32 region_local_x = (F32)fmod( pos.mdV[VX], (F64)REGION_WIDTH_METERS ); F32 region_local_y = (F32)fmod( pos.mdV[VY], (F64)REGION_WIDTH_METERS ); - F32 region_local_z = (F32)fmod( pos.mdV[VZ], (F64)REGION_WIDTH_METERS ); + F32 region_local_z = (F32)llclamp( pos.mdV[VZ], 0.0, (F64)REGION_HEIGHT_METERS ); // write in the values childSetValue("teleport_coordinate_x", region_local_x ); diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index 260e15c714..f990b9294d 100644 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -128,7 +128,7 @@ bool LLGiveInventory::isInventoryGiveAcceptable(const LLInventoryItem* item) switch(item->getType()) { case LLAssetType::AT_OBJECT: - if (gAgentAvatarp->isWearingAttachment(item->getUUID())) + if (get_is_item_worn(item->getUUID())) { acceptable = false; } @@ -139,7 +139,7 @@ bool LLGiveInventory::isInventoryGiveAcceptable(const LLInventoryItem* item) BOOL copyable = false; if (item->getPermissions().allowCopyBy(gAgentID)) copyable = true; - if (!copyable && gAgentWearables.isWearingItem(item->getUUID())) + if (!copyable && get_is_item_worn(item->getUUID())) { acceptable = false; } diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index 7f6df627e0..3f0deb98cd 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -109,7 +109,14 @@ public: /*virtual*/ BOOL postBuild(); - void onClickClose() { hide(); LLNotifications::instance().cancel(mNotification); } + void onClickClose() + { + if (!mHidden) + { + hide(); + LLNotifications::instance().cancel(mNotification); + } + } void draw(); void hide() { if(!mHidden) {mHidden = true; mFadeTimer.reset();} } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 914e7a3df0..857c27be63 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -131,6 +131,20 @@ void toast_callback(const LLSD& msg){ return; } + // *NOTE Skip toasting if the user disable it in preferences/debug settings ~Alexandrea + LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession( + msg["session_id"]); + if (!gSavedSettings.getBOOL("EnableGroupChatPopups") + && session->isGroupSessionType()) + { + return; + } + if (!gSavedSettings.getBOOL("EnableIMChatPopups") + && !session->isGroupSessionType()) + { + return; + } + // Skip toasting if we have open window of IM with this session id LLIMFloater* open_im_floater = LLIMFloater::findInstance(msg["session_id"]); if (open_im_floater && open_im_floater->getVisible()) @@ -257,21 +271,17 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& // history files have consistent (English) names in different locales. if (isAdHocSessionType() && IM_SESSION_INVITE == type) { - // Name here has a form of "<Avatar's name> Conference" - // Lets update it to localize the "Conference" word. See EXT-8429. - S32 separator_index = mName.rfind(" "); - std::string name = mName.substr(0, separator_index); - ++separator_index; - std::string conference_word = mName.substr(separator_index, mName.length()); + LLAvatarNameCache::get(mOtherParticipantID, + boost::bind(&LLIMModel::LLIMSession::onAdHocNameCache, + this, _2)); + } +} - // additional check that session name is what we expected - if ("Conference" == conference_word) - { +void LLIMModel::LLIMSession::onAdHocNameCache(const LLAvatarName& av_name) +{ LLStringUtil::format_map_t args; - args["[AGENT_NAME]"] = name; + args["[AGENT_NAME]"] = av_name.getCompleteName(); LLTrans::findString(mName, "conference-title-incoming", args); - } - } } void LLIMModel::LLIMSession::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state, const LLVoiceChannel::EDirection& direction) diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 3da4465862..650d329e18 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -100,6 +100,8 @@ public: void onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name); + void onAdHocNameCache(const LLAvatarName& av_name);
+ //*TODO make private static std::string generateHash(const std::set<LLUUID>& sorted_uuids); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index b15dcd993a..e672892282 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1649,10 +1649,12 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, const LLUUID &cat_id = inv_cat->getUUID(); const LLUUID &trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH, false); const LLUUID ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false); + const LLUUID &landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false); const BOOL move_is_into_trash = (mUUID == trash_id) || model->isObjectDescendentOf(mUUID, trash_id); const BOOL move_is_into_outfit = getCategory() && (getCategory()->getPreferredType() == LLFolderType::FT_OUTFIT); const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); + const BOOL move_is_into_landmarks = (mUUID == landmarks_id) || model->isObjectDescendentOf(mUUID, landmarks_id); //-------------------------------------------------------------------------------- // Determine if folder can be moved. @@ -1690,6 +1692,21 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } } + if (move_is_into_landmarks) + { + for (S32 i=0; i < descendent_items.count(); ++i) + { + LLViewerInventoryItem* item = descendent_items[i]; + + // Don't move anything except landmarks and categories into Landmarks folder. + // We use getType() instead of getActua;Type() to allow links to landmarks and folders. + if (LLAssetType::AT_LANDMARK != item->getType() && LLAssetType::AT_CATEGORY != item->getType()) + { + is_movable = FALSE; + break; // It's generally movable, but not into Landmarks. + } + } + } // //-------------------------------------------------------------------------------- @@ -2661,6 +2678,8 @@ BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data) { + LLInventoryItem* inv_item = (LLInventoryItem*)cargo_data; + //llinfos << "LLFolderBridge::dragOrDrop()" << llendl; BOOL accept = FALSE; switch(cargo_type) @@ -2676,9 +2695,24 @@ BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop, case DAD_BODYPART: case DAD_ANIMATION: case DAD_GESTURE: + accept = dragItemIntoFolder(inv_item, drop); + break; case DAD_LINK: - accept = dragItemIntoFolder((LLInventoryItem*)cargo_data, - drop); + // DAD_LINK type might mean one of two asset types: AT_LINK or AT_LINK_FOLDER. + // If we have an item of AT_LINK_FOLDER type we should process the linked + // category being dragged or dropped into folder. + if (inv_item && LLAssetType::AT_LINK_FOLDER == inv_item->getActualType()) + { + LLInventoryCategory* linked_category = gInventory.getCategory(inv_item->getLinkedUUID()); + if (linked_category) + { + accept = dragCategoryIntoFolder((LLInventoryCategory*)linked_category, drop); + } + } + else + { + accept = dragItemIntoFolder(inv_item, drop); + } break; case DAD_CATEGORY: if (LLFriendCardsManager::instance().isAnyFriendCategory(mUUID)) @@ -2875,6 +2909,24 @@ static BOOL can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_curr return TRUE; } +// Returns TRUE if item is a landmark or a link to a landmark +// and can be moved to Favorites or Landmarks folder. +static BOOL can_move_to_landmarks(LLInventoryItem* inv_item) +{ + // Need to get the linked item to know its type because LLInventoryItem::getType() + // returns actual type AT_LINK for links, not the asset type of a linked item. + if (LLAssetType::AT_LINK == inv_item->getType()) + { + LLInventoryItem* linked_item = gInventory.getItem(inv_item->getLinkedUUID()); + if (linked_item) + { + return LLAssetType::AT_LANDMARK == linked_item->getType(); + } + } + + return LLAssetType::AT_LANDMARK == inv_item->getType(); +} + void LLFolderBridge::dropToFavorites(LLInventoryItem* inv_item) { // use callback to rearrange favorite landmarks after adding @@ -2931,9 +2983,12 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, const LLUUID ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false); const LLUUID &favorites_id = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE, false); + const LLUUID &landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false); const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); + const BOOL move_is_into_favorites = (mUUID == favorites_id); const BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT); + const BOOL move_is_into_landmarks = (mUUID == landmarks_id) || model->isObjectDescendentOf(mUUID, landmarks_id); LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); BOOL accept = FALSE; @@ -2944,7 +2999,6 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, const BOOL move_is_into_trash = (mUUID == trash_id) || model->isObjectDescendentOf(mUUID, trash_id); const BOOL move_is_outof_current_outfit = LLAppearanceMgr::instance().getIsInCOF(inv_item->getUUID()); - const BOOL folder_allows_reorder = (mUUID == favorites_id); //-------------------------------------------------------------------------------- // Determine if item can be moved. @@ -2990,12 +3044,16 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, if (!is_movable) accept = FALSE; - if ((mUUID == inv_item->getParentUUID()) && !folder_allows_reorder) + if ((mUUID == inv_item->getParentUUID()) && !move_is_into_favorites) accept = FALSE; if (move_is_into_current_outfit || move_is_into_outfit) { accept = can_move_to_outfit(inv_item, move_is_into_current_outfit); } + else if (move_is_into_favorites || move_is_into_landmarks) + { + accept = can_move_to_landmarks(inv_item); + } if(accept && drop) { @@ -3021,8 +3079,8 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // // REORDER - // (only reorder the item) - if ((mUUID == inv_item->getParentUUID()) && folder_allows_reorder) + // (only reorder the item in Favorites folder) + if ((mUUID == inv_item->getParentUUID()) && move_is_into_favorites) { LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get()); LLFolderViewItem* itemp = panel ? panel->getRootFolder()->getDraggingOverItem() : NULL; @@ -3036,7 +3094,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // FAVORITES folder // (copy the item) - else if (favorites_id == mUUID) + else if (move_is_into_favorites) { dropToFavorites(inv_item); } @@ -3101,6 +3159,13 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { accept = FALSE; } + // Don't allow to move a single item to Favorites or Landmarks + // if it is not a landmark or a link to a landmark. + else if ((move_is_into_favorites || move_is_into_landmarks) + && !can_move_to_landmarks(inv_item)) + { + accept = FALSE; + } if(drop && accept) { @@ -3146,12 +3211,18 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { accept = can_move_to_outfit(inv_item, move_is_into_current_outfit); } + // Don't allow to move a single item to Favorites or Landmarks + // if it is not a landmark or a link to a landmark. + else if (move_is_into_favorites || move_is_into_landmarks) + { + accept = can_move_to_landmarks(inv_item); + } if (accept && drop) { // FAVORITES folder // (copy the item) - if (favorites_id == mUUID) + if (move_is_into_favorites) { dropToFavorites(inv_item); } diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index f3d9639dee..ef20869114 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -487,12 +487,9 @@ bool LLInventoryCollectFunctor::itemTransferCommonlyAllowed(const LLInventoryIte return false; break; case LLAssetType::AT_OBJECT: - if (isAgentAvatarValid() && !gAgentAvatarp->isWearingAttachment(item->getUUID())) - return true; - break; case LLAssetType::AT_BODYPART: case LLAssetType::AT_CLOTHING: - if(!gAgentWearables.isWearingItem(item->getUUID())) + if (!get_is_item_worn(item->getUUID())) return true; break; default: diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 50adae09c0..0870b5b8dd 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -290,7 +290,10 @@ void LLInventoryPanel::modelChanged(U32 mask) const LLUUID& item_id = (*items_iter); const LLInventoryObject* model_item = model->getObject(item_id); LLFolderViewItem* view_item = mFolderRoot->getItemByID(item_id); - LLFolderViewFolder* view_folder = mFolderRoot->getFolderByID(item_id); + + // LLFolderViewFolder is derived from LLFolderViewItem so dynamic_cast from item + // to folder is the fast way to get a folder without searching through folders tree. + LLFolderViewFolder* view_folder = dynamic_cast<LLFolderViewFolder*>(view_item); ////////////////////////////// // LABEL Operation diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 47d32e57fb..d2ad78f140 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -64,6 +64,18 @@ public: LLNearbyChatScreenChannel(const LLUUID& id):LLScreenChannelBase(id) { mStopProcessing = false; + + LLControlVariable* ctrl = gSavedSettings.getControl("NearbyToastLifeTime").get(); + if (ctrl) + { + ctrl->getSignal()->connect(boost::bind(&LLNearbyChatScreenChannel::updateToastsLifetime, this)); + } + + ctrl = gSavedSettings.getControl("NearbyToastFadingTime").get(); + if (ctrl) + { + ctrl->getSignal()->connect(boost::bind(&LLNearbyChatScreenChannel::updateToastFadingTime, this)); + } } void addNotification (LLSD& notification); @@ -109,13 +121,26 @@ protected: if (!toast) return; LL_DEBUGS("NearbyChat") << "Pooling toast" << llendl; toast->setVisible(FALSE); - toast->stopTimer(); + toast->stopFading(); toast->setIsHidden(true); + + // Nearby chat toasts that are hidden, not destroyed. They are collected to the toast pool, so that + // they can be used next time, this is done for performance. But if the toast lifetime was changed + // (from preferences floater (STORY-36)) while it was shown (at this moment toast isn't in the pool yet) + // changes don't take affect. + // So toast's lifetime should be updated each time it's added to the pool. Otherwise viewer would have + // to be restarted so that changes take effect. + toast->setLifetime(gSavedSettings.getS32("NearbyToastLifeTime")); + toast->setFadingTime(gSavedSettings.getS32("NearbyToastFadingTime")); m_toast_pool.push_back(toast->getHandle()); } void createOverflowToast(S32 bottom, F32 timer); + void updateToastsLifetime(); + + void updateToastFadingTime(); + create_toast_panel_callback_t m_create_toast_panel_callback_t; bool createPoolToast(); @@ -205,6 +230,27 @@ void LLNearbyChatScreenChannel::onToastFade(LLToast* toast) arrangeToasts(); } +void LLNearbyChatScreenChannel::updateToastsLifetime() +{ + S32 seconds = gSavedSettings.getS32("NearbyToastLifeTime"); + toast_list_t::iterator it; + + for(it = m_toast_pool.begin(); it != m_toast_pool.end(); ++it) + { + (*it).get()->setLifetime(seconds); + } +} + +void LLNearbyChatScreenChannel::updateToastFadingTime() +{ + S32 seconds = gSavedSettings.getS32("NearbyToastFadingTime"); + toast_list_t::iterator it; + + for(it = m_toast_pool.begin(); it != m_toast_pool.end(); ++it) + { + (*it).get()->setFadingTime(seconds); + } +} bool LLNearbyChatScreenChannel::createPoolToast() { @@ -250,7 +296,7 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification) { panel->addMessage(notification); toast->reshapeToPanel(); - toast->resetTimer(); + toast->startFading(); arrangeToasts(); return; @@ -295,7 +341,7 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification) panel->init(notification); toast->reshapeToPanel(); - toast->resetTimer(); + toast->startFading(); m_active_toasts.push_back(toast->getHandle()); @@ -325,9 +371,9 @@ void LLNearbyChatScreenChannel::arrangeToasts() int sort_toasts_predicate(LLHandle<LLToast> first, LLHandle<LLToast> second) { - F32 v1 = first.get()->getTimer()->getEventTimer().getElapsedTimeF32(); - F32 v2 = second.get()->getTimer()->getEventTimer().getElapsedTimeF32(); - return v1 < v2; + F32 v1 = first.get()->getTimeLeftToLive(); + F32 v2 = second.get()->getTimeLeftToLive(); + return v1 > v2; } void LLNearbyChatScreenChannel::showToastsBottom() diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 70295259b3..6435126fc0 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -115,7 +115,7 @@ public: registrar.add("Gear.Wear", boost::bind(&LLOutfitListGearMenu::onWear, this)); registrar.add("Gear.TakeOff", boost::bind(&LLOutfitListGearMenu::onTakeOff, this)); registrar.add("Gear.Rename", boost::bind(&LLOutfitListGearMenu::onRename, this)); - registrar.add("Gear.Delete", boost::bind(&LLOutfitListGearMenu::onDelete, this)); + registrar.add("Gear.Delete", boost::bind(&LLOutfitsList::removeSelected, mOutfitList)); registrar.add("Gear.Create", boost::bind(&LLOutfitListGearMenu::onCreate, this, _2)); registrar.add("Gear.WearAdd", boost::bind(&LLOutfitListGearMenu::onAdd, this)); @@ -197,15 +197,6 @@ private: } } - void onDelete() - { - const LLUUID& selected_outfit_id = getSelectedOutfitID(); - if (selected_outfit_id.notNull()) - { - remove_category(&gInventory, selected_outfit_id); - } - } - void onCreate(const LLSD& data) { LLWearableType::EType type = LLWearableType::typeNameToType(data.asString()); @@ -260,6 +251,12 @@ private: class LLOutfitContextMenu : public LLListContextMenu { +public: + + LLOutfitContextMenu(LLOutfitsList* outfit_list) + : LLListContextMenu(), + mOutfitList(outfit_list) + {} protected: /* virtual */ LLContextMenu* createMenu() { @@ -275,7 +272,7 @@ protected: boost::bind(&LLAppearanceMgr::takeOffOutfit, &LLAppearanceMgr::instance(), selected_id)); registrar.add("Outfit.Edit", boost::bind(editOutfit)); registrar.add("Outfit.Rename", boost::bind(renameOutfit, selected_id)); - registrar.add("Outfit.Delete", boost::bind(deleteOutfit, selected_id)); + registrar.add("Outfit.Delete", boost::bind(&LLOutfitsList::removeSelected, mOutfitList)); enable_registrar.add("Outfit.OnEnable", boost::bind(&LLOutfitContextMenu::onEnable, this, _2)); enable_registrar.add("Outfit.OnVisible", boost::bind(&LLOutfitContextMenu::onVisible, this, _2)); @@ -338,10 +335,8 @@ protected: LLAppearanceMgr::instance().renameOutfit(outfit_cat_id); } - static void deleteOutfit(const LLUUID& outfit_cat_id) - { - remove_category(&gInventory, outfit_cat_id); - } +private: + LLOutfitsList* mOutfitList; }; ////////////////////////////////////////////////////////////////////////// @@ -358,7 +353,7 @@ LLOutfitsList::LLOutfitsList() mCategoriesObserver = new LLInventoryCategoriesObserver(); mGearMenu = new LLOutfitListGearMenu(this); - mOutfitMenu = new LLOutfitContextMenu(); + mOutfitMenu = new LLOutfitContextMenu(this); } LLOutfitsList::~LLOutfitsList() @@ -635,6 +630,14 @@ void LLOutfitsList::performAction(std::string action) void LLOutfitsList::removeSelected() { + LLNotificationsUtil::add("DeleteOutfits", LLSD(), LLSD(), boost::bind(&LLOutfitsList::onOutfitsRemovalConfirmation, this, _1, _2)); +} + +void LLOutfitsList::onOutfitsRemovalConfirmation(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option != 0) return; // canceled + if (mSelectedOutfitUUID.notNull()) { remove_category(&gInventory, mSelectedOutfitUUID); diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index 5fecbb83e7..a0598737f1 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -110,6 +110,8 @@ public: private: + void onOutfitsRemovalConfirmation(const LLSD& notification, const LLSD& response); + /** * Wrapper for LLCommonUtils::computeDifference. @see LLCommonUtils::computeDifference */ diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 80df420a4e..ec340dc258 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -692,7 +692,8 @@ void LLPanelGroupGeneral::updateMembers() LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!mListVisibleMembers || !gdatap - || !gdatap->isMemberDataComplete()) + || !gdatap->isMemberDataComplete() + || gdatap->mMembers.empty()) { return; } diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 0d1d96eae6..d1362d7922 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -1576,6 +1576,7 @@ void LLPanelGroupMembersSubTab::update(LLGroupChange gc) void LLPanelGroupMembersSubTab::addMemberToList(LLUUID id, LLGroupMemberData* data) { + if (!data) return; LLUIString donated = getString("donation_area"); donated.setArg("[AREA]", llformat("%d", data->getContribution())); @@ -1616,9 +1617,12 @@ void LLPanelGroupMembersSubTab::onNameCache(const LLUUID& update_id, const LLUUI std::string fullname; gCacheName->getFullName(id, fullname); - if (matchesSearchFilter(fullname)) + + LLGroupMemberData* data; + // trying to avoid unnecessary hash lookups + if (matchesSearchFilter(fullname) && ((data = gdatap->mMembers[id]) != NULL)) { - addMemberToList(id, gdatap->mMembers[id]); + addMemberToList(id, data); if(!mMembersList->getEnabled()) { mMembersList->setEnabled(TRUE); diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 4f2cfa2bbc..a90f864ae2 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -258,17 +258,7 @@ void LLPanelOutfitsInventory::updateListCommands() void LLPanelOutfitsInventory::onTrashButtonClick() { - LLNotificationsUtil::add("DeleteOutfits", LLSD(), LLSD(), boost::bind(&LLPanelOutfitsInventory::onOutfitsRemovalConfirmation, this, _1, _2)); -} - -void LLPanelOutfitsInventory::onOutfitsRemovalConfirmation(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option != 0) return; // canceled - mMyOutfitsPanel->removeSelected(); - updateListCommands(); - updateVerbs(); } bool LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index f1ca1dbfeb..a7917b457c 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -89,7 +89,6 @@ protected: void onWearButtonClick(); void showGearMenu(); void onTrashButtonClick(); - void onOutfitsRemovalConfirmation(const LLSD& notification, const LLSD& response); bool isActionEnabled(const LLSD& userdata); void setWearablesLoading(bool val); void onWearablesLoaded(); diff --git a/indra/newview/llplacesinventorypanel.cpp b/indra/newview/llplacesinventorypanel.cpp index 408270a1a0..29e262199e 100644 --- a/indra/newview/llplacesinventorypanel.cpp +++ b/indra/newview/llplacesinventorypanel.cpp @@ -205,24 +205,6 @@ BOOL LLPlacesFolderView::handleRightMouseDown(S32 x, S32 y, MASK mask) return LLFolderView::handleRightMouseDown(x, y, mask); } -BOOL LLPlacesFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, - EDragAndDropType cargo_type, - void* cargo_data, - EAcceptance* accept, - std::string& tooltip_msg) -{ - // Don't accept anything except landmarks and folders to be dropped - // in places folder view. See STORM-296. - if (cargo_type != DAD_LANDMARK && cargo_type != DAD_CATEGORY) - { - *accept = ACCEPT_NO; - return FALSE; - } - - return LLFolderView::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, - accept, tooltip_msg); -} - void LLPlacesFolderView::setupMenuHandle(LLInventoryType::EType asset_type, LLHandle<LLView> menu_handle) { mMenuHandlesByInventoryType[asset_type] = menu_handle; diff --git a/indra/newview/llplacesinventorypanel.h b/indra/newview/llplacesinventorypanel.h index a44776d18b..6641871a0b 100644 --- a/indra/newview/llplacesinventorypanel.h +++ b/indra/newview/llplacesinventorypanel.h @@ -70,12 +70,6 @@ public: */ /*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); - /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, - EDragAndDropType cargo_type, - void* cargo_data, - EAcceptance* accept, - std::string& tooltip_msg); - void setupMenuHandle(LLInventoryType::EType asset_type, LLHandle<LLView> menu_handle); void setParentLandmarksPanel(LLLandmarksPanel* panel) diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 18c9ac28c1..61f4897ed0 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -369,7 +369,7 @@ void LLScreenChannel::loadStoredToastsToChannel() for(it = mStoredToastList.begin(); it != mStoredToastList.end(); ++it) { (*it).toast->setIsHidden(false); - (*it).toast->resetTimer(); + (*it).toast->startFading(); mToastList.push_back((*it)); } @@ -394,7 +394,7 @@ void LLScreenChannel::loadStoredToastByNotificationIDToChannel(LLUUID id) } toast->setIsHidden(false); - toast->resetTimer(); + toast->startFading(); mToastList.push_back((*it)); redrawToasts(); @@ -477,7 +477,7 @@ void LLScreenChannel::modifyToastByNotificationID(LLUUID id, LLPanel* panel) toast->removeChild(old_panel); delete old_panel; toast->insertPanel(panel); - toast->resetTimer(); + toast->startFading(); redrawToasts(); } } @@ -588,7 +588,7 @@ void LLScreenChannel::showToastsBottom() mHiddenToastsNum = 0; for(; it != mToastList.rend(); it++) { - (*it).toast->stopTimer(); + (*it).toast->stopFading(); (*it).toast->setVisible(FALSE); mHiddenToastsNum++; } diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index fb984a7c62..960e72ee42 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1555,7 +1555,9 @@ void LLSpatialGroup::doOcclusion(LLCamera* camera) { if (mSpatialPartition->isOcclusionEnabled() && LLPipeline::sUseOcclusion > 1) { - if (earlyFail(camera, this)) + // Don't cull hole/edge water, unless we have the GL_ARB_depth_clamp extension + if ((mSpatialPartition->mDrawableType == LLDrawPool::POOL_VOIDWATER && !gGLManager.mHasDepthClamp) || + earlyFail(camera, this)) { setOcclusionState(LLSpatialGroup::DISCARD_QUERY); assert_states_valid(this); @@ -1576,7 +1578,18 @@ void LLSpatialGroup::doOcclusion(LLCamera* camera) { buildOcclusion(); } - + + // Depth clamp all water to avoid it being culled as a result of being + // behind the far clip plane, and in the case of edge water to avoid + // it being culled while still visible. + bool const use_depth_clamp = gGLManager.mHasDepthClamp && + (mSpatialPartition->mDrawableType == LLDrawPool::POOL_WATER || + mSpatialPartition->mDrawableType == LLDrawPool::POOL_VOIDWATER); + if (use_depth_clamp) + { + glEnable(GL_DEPTH_CLAMP); + } + glBeginQueryARB(GL_SAMPLES_PASSED_ARB, mOcclusionQuery[LLViewerCamera::sCurCameraID]); glVertexPointer(3, GL_FLOAT, 0, mOcclusionVerts); if (camera->getOrigin().isExactlyZero()) @@ -1592,6 +1605,11 @@ void LLSpatialGroup::doOcclusion(LLCamera* camera) GL_UNSIGNED_BYTE, get_box_fan_indices(camera, mBounds[0])); } glEndQueryARB(GL_SAMPLES_PASSED_ARB); + + if (use_depth_clamp) + { + glDisable(GL_DEPTH_CLAMP); + } } setOcclusionState(LLSpatialGroup::QUERY_PENDING); @@ -2591,9 +2609,10 @@ void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE) gGL.color4f(0.5f,0.5f,0.5f,1.0f); break; case LLViewerObject::LL_VO_PART_GROUP: - case LLViewerObject::LL_VO_HUD_PART_GROUP: + case LLViewerObject::LL_VO_HUD_PART_GROUP: gGL.color4f(0,0,1,1); break; + case LLViewerObject::LL_VO_VOID_WATER: case LLViewerObject::LL_VO_WATER: gGL.color4f(0,0.5f,1,1); break; diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 1a25f3f85d..2b9cf6c630 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -551,6 +551,13 @@ public: virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { } }; +//spatial partition for hole and edge water (implemented in LLVOWater.cpp) +class LLVoidWaterPartition : public LLWaterPartition +{ +public: + LLVoidWaterPartition(); +}; + //spatial partition for terrain (impelmented in LLVOSurfacePatch.cpp) class LLTerrainPartition : public LLSpatialPartition { diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index af4d9fa7b9..6fc8153b77 100644 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -1162,8 +1162,13 @@ void LLSurface::setWaterHeight(F32 height) if (!mWaterObjp.isNull()) { LLVector3 water_pos_region = mWaterObjp->getPositionRegion(); + bool changed = water_pos_region.mV[VZ] != height; water_pos_region.mV[VZ] = height; mWaterObjp->setPositionRegion(water_pos_region); + if (changed) + { + LLWorld::getInstance()->updateWaterObjects(); + } } else { diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index c3090cb1fc..8176b8c1f9 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -35,6 +35,13 @@ using namespace LLNotificationsUI; +//-------------------------------------------------------------------------- +LLToastLifeTimer::LLToastLifeTimer(LLToast* toast, F32 period) + : mToast(toast), + LLEventTimer(period) +{ +} + /*virtual*/ BOOL LLToastLifeTimer::tick() { @@ -45,6 +52,38 @@ BOOL LLToastLifeTimer::tick() return FALSE; } +void LLToastLifeTimer::stop() +{ + mEventTimer.stop(); +} + +void LLToastLifeTimer::start() +{ + mEventTimer.start(); +} + +void LLToastLifeTimer::restart() +{ + mEventTimer.reset(); +} + +BOOL LLToastLifeTimer::getStarted() +{ + return mEventTimer.getStarted(); +} + +void LLToastLifeTimer::setPeriod(F32 period) +{ + mPeriod = period; +} + +F32 LLToastLifeTimer::getRemainingTimeF32() +{ + F32 et = mEventTimer.getElapsedTimeF32(); + if (!getStarted() || et > mPeriod) return 0.0f; + return mPeriod - et; +} + //-------------------------------------------------------------------------- LLToast::Params::Params() : can_fade("can_fade", true), @@ -73,7 +112,8 @@ LLToast::LLToast(const LLToast::Params& p) mIsHidden(false), mHideBtnPressed(false), mIsTip(p.is_tip), - mWrapperPanel(NULL) + mWrapperPanel(NULL), + mIsTransparent(false) { mTimer.reset(new LLToastLifeTimer(this, p.lifetime_secs)); @@ -143,6 +183,7 @@ LLToast::~LLToast() void LLToast::hide() { setVisible(FALSE); + setTransparentState(false); mTimer->stop(); mIsHidden = true; mOnFadeSignal(this); @@ -166,6 +207,16 @@ void LLToast::onFocusReceived() } } +void LLToast::setLifetime(S32 seconds) +{ + mToastLifetime = seconds; +} + +void LLToast::setFadingTime(S32 seconds) +{ + mToastFadingTime = seconds; +} + S32 LLToast::getTopPad() { if(mWrapperPanel) @@ -195,13 +246,46 @@ void LLToast::setCanFade(bool can_fade) //-------------------------------------------------------------------------- void LLToast::expire() { - // if toast has fade property - hide it - if(mCanFade) + if (mCanFade) { - hide(); + if (mIsTransparent) + { + hide(); + } + else + { + setTransparentState(true); + mTimer->restart(); + } } } +void LLToast::setTransparentState(bool transparent) +{ + setBackgroundOpaque(!transparent); + mIsTransparent = transparent; + + if (transparent) + { + mTimer->setPeriod(mToastFadingTime); + } + else + { + mTimer->setPeriod(mToastLifetime); + } +} + +F32 LLToast::getTimeLeftToLive() +{ + F32 time_to_live = mTimer->getRemainingTimeF32(); + + if (!mIsTransparent) + { + time_to_live += mToastFadingTime; + } + + return time_to_live; +} //-------------------------------------------------------------------------- void LLToast::reshapeToPanel() @@ -245,13 +329,6 @@ void LLToast::draw() drawChild(mHideBtn); } } - - // if timer started and remaining time <= fading time - if (mTimer->getStarted() && (mToastLifetime - - mTimer->getEventTimer().getElapsedTimeF32()) <= mToastFadingTime) - { - setBackgroundOpaque(FALSE); - } } //-------------------------------------------------------------------------- @@ -267,6 +344,11 @@ void LLToast::setVisible(BOOL show) return; } + if (show && getVisible()) + { + return; + } + if(show) { setBackgroundOpaque(TRUE); @@ -372,7 +454,8 @@ void LLNotificationsUI::LLToast::stopFading() { if(mCanFade) { - stopTimer(); + setTransparentState(false); + mTimer->stop(); } } @@ -380,7 +463,8 @@ void LLNotificationsUI::LLToast::startFading() { if(mCanFade) { - resetTimer(); + setTransparentState(false); + mTimer->start(); } } diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index 0a96c092a0..fb534561c9 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -49,14 +49,16 @@ class LLToast; class LLToastLifeTimer: public LLEventTimer { public: - LLToastLifeTimer(LLToast* toast, F32 period) : mToast(toast), LLEventTimer(period){} + LLToastLifeTimer(LLToast* toast, F32 period); /*virtual*/ BOOL tick(); - void stop() { mEventTimer.stop(); } - void start() { mEventTimer.start(); } - void restart() {mEventTimer.reset(); } - BOOL getStarted() { return mEventTimer.getStarted(); } + void stop(); + void start(); + void restart(); + BOOL getStarted(); + void setPeriod(F32 period); + F32 getRemainingTimeF32(); LLTimer& getEventTimer() { return mEventTimer;} private : @@ -80,8 +82,14 @@ public: Optional<LLUUID> notif_id, //notification ID session_id; //im session ID Optional<LLNotificationPtr> notification; - Optional<F32> lifetime_secs, - fading_time_secs; // Number of seconds while a toast is fading + + //NOTE: Life time of a toast (i.e. period of time from the moment toast was shown + //till the moment when toast was hidden) is the sum of lifetime_secs and fading_time_secs. + + Optional<F32> lifetime_secs, // Number of seconds while a toast is non-transparent + fading_time_secs; // Number of seconds while a toast is transparent + + Optional<toast_callback_t> on_delete_toast, on_mouse_enter; Optional<bool> can_fade, @@ -125,10 +133,8 @@ public: LLPanel* getPanel() { return mPanel; } // enable/disable Toast's Hide button void setHideButtonEnabled(bool enabled); - // - void resetTimer() { mTimer->start(); } // - void stopTimer() { mTimer->stop(); } + F32 getTimeLeftToLive(); // LLToastLifeTimer* getTimer() { return mTimer.get();} // @@ -144,6 +150,10 @@ public: /*virtual*/ void onFocusReceived(); + void setLifetime(S32 seconds); + + void setFadingTime(S32 seconds); + /** * Returns padding between floater top and wrapper_panel top. * This padding should be taken into account when positioning or reshaping toasts @@ -196,7 +206,9 @@ private: void onToastMouseLeave(); - void expire(); + void expire(); + + void setTransparentState(bool transparent); LLUUID mNotificationID; LLUUID mSessionID; @@ -222,6 +234,7 @@ private: bool mHideBtnPressed; bool mIsHidden; // this flag is TRUE when a toast has faded or was hidden with (x) button (EXT-1849) bool mIsTip; + bool mIsTransparent; commit_signal_t mToastMouseEnterSignal; commit_signal_t mToastMouseLeaveSignal; diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 6640e32cd2..d1cb9dabf1 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -573,7 +573,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) S32 water_clip = 0; if ((LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_ENVIRONMENT) > 1) && - gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_WATER)) + (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_WATER) || + gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_VOIDWATER))) { if (LLViewerCamera::getInstance()->cameraUnderWater()) { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 68935d536b..1778eaed68 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -221,8 +221,6 @@ BOOL check_show_xui_names(void *); // Debug UI void handle_buy_currency_test(void*); -void handle_save_to_xml(void*); -void handle_load_from_xml(void*); void handle_god_mode(void*); @@ -1384,37 +1382,6 @@ class LLAdvancedCheckDebugWindowProc : public view_listener_t // ------------------------------XUI MENU --------------------------- -////////////////////// -// LOAD UI FROM XML // -////////////////////// - - -class LLAdvancedLoadUIFromXML : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - handle_load_from_xml(NULL); - return true; -} -}; - - - -//////////////////// -// SAVE UI TO XML // -//////////////////// - - -class LLAdvancedSaveUIToXML : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - handle_save_to_xml(NULL); - return true; -} -}; - - class LLAdvancedSendTestIms : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -7188,44 +7155,6 @@ const LLRect LLViewerMenuHolderGL::getMenuRect() const return LLRect(0, getRect().getHeight() - MENU_BAR_HEIGHT, getRect().getWidth(), STATUS_BAR_HEIGHT); } -void handle_save_to_xml(void*) -{ - LLFloater* frontmost = gFloaterView->getFrontmost(); - if (!frontmost) - { - LLNotificationsUtil::add("NoFrontmostFloater"); - return; - } - - std::string default_name = "floater_"; - default_name += frontmost->getTitle(); - default_name += ".xml"; - - LLStringUtil::toLower(default_name); - LLStringUtil::replaceChar(default_name, ' ', '_'); - LLStringUtil::replaceChar(default_name, '/', '_'); - LLStringUtil::replaceChar(default_name, ':', '_'); - LLStringUtil::replaceChar(default_name, '"', '_'); - - LLFilePicker& picker = LLFilePicker::instance(); - if (picker.getSaveFile(LLFilePicker::FFSAVE_XML, default_name)) - { - std::string filename = picker.getFirstFile(); - LLUICtrlFactory::getInstance()->saveToXML(frontmost, filename); - } -} - -void handle_load_from_xml(void*) -{ - LLFilePicker& picker = LLFilePicker::instance(); - if (picker.getOpenFile(LLFilePicker::FFLOAD_XML)) - { - std::string filename = picker.getFirstFile(); - LLFloater* floater = new LLFloater(LLSD()); - floater->buildFromFile(filename); - } -} - void handle_web_browser_test(const LLSD& param) { std::string url = param.asString(); @@ -8011,8 +7940,6 @@ void initialize_menus() // Advanced > XUI commit.add("Advanced.ReloadColorSettings", boost::bind(&LLUIColorTable::loadFromSettings, LLUIColorTable::getInstance())); - view_listener_t::addMenu(new LLAdvancedLoadUIFromXML(), "Advanced.LoadUIFromXML"); - view_listener_t::addMenu(new LLAdvancedSaveUIToXML(), "Advanced.SaveUIToXML"); view_listener_t::addMenu(new LLAdvancedToggleXUINames(), "Advanced.ToggleXUINames"); view_listener_t::addMenu(new LLAdvancedCheckXUINames(), "Advanced.CheckXUINames"); view_listener_t::addMenu(new LLAdvancedSendTestIms(), "Advanced.SendTestIMs"); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 9b1f2e67c6..672213d3e8 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1511,7 +1511,12 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& // MUTE falls through to decline case IOR_DECLINE: { - log_message = LLTrans::getString("InvOfferYouDecline") + " " + mDesc + " " + LLTrans::getString("InvOfferFrom") + " " + mFromName +"."; + { + LLStringUtil::format_map_t log_message_args; + log_message_args["DESC"] = mDesc; + log_message_args["NAME"] = mFromName; + log_message = LLTrans::getString("InvOfferDecline", log_message_args); + } chat.mText = log_message; if( LLMuteList::getInstance()->isMuted(mFromID ) && ! LLMuteList::getInstance()->isLinden(mFromName) ) // muting for SL-42269 { @@ -1710,8 +1715,12 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const msg->addBinaryDataFast(_PREHASH_BinaryBucket, EMPTY_BINARY_BUCKET, EMPTY_BINARY_BUCKET_SIZE); // send the message msg->sendReliable(mHost); - - log_message = LLTrans::getString("InvOfferYouDecline") + " " + mDesc + " " + LLTrans::getString("InvOfferFrom") + " " + mFromName +"."; + { + LLStringUtil::format_map_t log_message_args; + log_message_args["DESC"] = mDesc; + log_message_args["NAME"] = mFromName; + log_message = LLTrans::getString("InvOfferDecline", log_message_args); + } LLSD args; args["MESSAGE"] = log_message; LLNotificationsUtil::add("SystemMessage", args); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index a58b0d68de..0e1553c421 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -168,8 +168,10 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco res = new LLVOSurfacePatch(id, pcode, regionp); break; case LL_VO_SKY: res = new LLVOSky(id, pcode, regionp); break; + case LL_VO_VOID_WATER: + res = new LLVOVoidWater(id, pcode, regionp); break; case LL_VO_WATER: - res = new LLVOWater(id, pcode, regionp); break; + res = new LLVOWater(id, pcode, regionp); break; case LL_VO_GROUND: res = new LLVOGround(id, pcode, regionp); break; case LL_VO_PART_GROUP: diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 7d697a4a5f..c2475c2709 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -131,7 +131,7 @@ public: typedef const child_list_t const_child_list_t; - LLViewerObject(const LLUUID &id, const LLPCode type, LLViewerRegion *regionp, BOOL is_global = FALSE); + LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp, BOOL is_global = FALSE); MEM_TYPE_NEW(LLMemType::MTYPE_OBJECT); virtual void markDead(); // Mark this object as dead, and clean up its references @@ -518,14 +518,14 @@ public: { LL_VO_CLOUDS = LL_PCODE_APP | 0x20, LL_VO_SURFACE_PATCH = LL_PCODE_APP | 0x30, - //LL_VO_STARS = LL_PCODE_APP | 0x40, + LL_VO_WL_SKY = LL_PCODE_APP | 0x40, LL_VO_SQUARE_TORUS = LL_PCODE_APP | 0x50, LL_VO_SKY = LL_PCODE_APP | 0x60, - LL_VO_WATER = LL_PCODE_APP | 0x70, - LL_VO_GROUND = LL_PCODE_APP | 0x80, - LL_VO_PART_GROUP = LL_PCODE_APP | 0x90, - LL_VO_TRIANGLE_TORUS = LL_PCODE_APP | 0xa0, - LL_VO_WL_SKY = LL_PCODE_APP | 0xb0, // should this be moved to 0x40? + LL_VO_VOID_WATER = LL_PCODE_APP | 0x70, + LL_VO_WATER = LL_PCODE_APP | 0x80, + LL_VO_GROUND = LL_PCODE_APP | 0x90, + LL_VO_PART_GROUP = LL_PCODE_APP | 0xa0, + LL_VO_TRIANGLE_TORUS = LL_PCODE_APP | 0xb0, LL_VO_HUD_PART_GROUP = LL_PCODE_APP | 0xc0, } EVOType; @@ -717,8 +717,8 @@ public: class LLAlphaObject : public LLViewerObject { public: - LLAlphaObject(const LLUUID &id, const LLPCode type, LLViewerRegion *regionp) - : LLViewerObject(id,type,regionp) + LLAlphaObject(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) + : LLViewerObject(id,pcode,regionp) { mDepth = 0.f; } virtual F32 getPartSize(S32 idx); @@ -735,8 +735,8 @@ public: class LLStaticViewerObject : public LLViewerObject { public: - LLStaticViewerObject(const LLUUID& id, const LLPCode type, LLViewerRegion* regionp, BOOL is_global = FALSE) - : LLViewerObject(id,type,regionp, is_global) + LLStaticViewerObject(const LLUUID& id, const LLPCode pcode, LLViewerRegion* regionp, BOOL is_global = FALSE) + : LLViewerObject(id,pcode,regionp, is_global) { } virtual void updateDrawable(BOOL force_damped); diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 7fb259e012..b684206960 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -266,6 +266,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, //MUST MATCH declaration of eObjectPartitions mObjectPartition.push_back(new LLHUDPartition()); //PARTITION_HUD mObjectPartition.push_back(new LLTerrainPartition()); //PARTITION_TERRAIN + mObjectPartition.push_back(new LLVoidWaterPartition()); //PARTITION_VOIDWATER mObjectPartition.push_back(new LLWaterPartition()); //PARTITION_WATER mObjectPartition.push_back(new LLTreePartition()); //PARTITION_TREE mObjectPartition.push_back(new LLParticlePartition()); //PARTITION_PARTICLE diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 1ba025312b..8b71998f60 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -73,6 +73,7 @@ public: { PARTITION_HUD=0, PARTITION_TERRAIN, + PARTITION_VOIDWATER, PARTITION_WATER, PARTITION_TREE, PARTITION_PARTICLE, diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index d078c15316..c1abead36e 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -335,8 +335,8 @@ void LLViewerShaderMgr::setShaders() } else { - LLPipeline::sRenderGlow = - LLPipeline::sWaterReflections = FALSE; + LLPipeline::sRenderGlow = FALSE; + LLPipeline::sWaterReflections = FALSE; } //hack to reset buffers that change behavior with shaders diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index a0a3380441..0e494e90ee 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1404,6 +1404,11 @@ LLViewerWindow::LLViewerWindow( gSavedSettings.setBOOL("ProbeHardwareOnStartup", FALSE); } + if (!gGLManager.mHasDepthClamp) + { + LL_INFOS("RenderInit") << "Missing feature GL_ARB_depth_clamp. Void water might disappear in rare cases." << LL_ENDL; + } + // If we crashed while initializng GL stuff last time, disable certain features if (gSavedSettings.getBOOL("RenderInitError")) { diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index f4f1235d55..a779a1735c 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -33,6 +33,8 @@ #include <string> #include <vector> +#include <boost/signals2.hpp> + #include "imageids.h" // IMG_INVISIBLE #include "llchat.h" #include "lldrawpoolalpha.h" @@ -71,7 +73,8 @@ class LLVOAvatarSkeletonInfo; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class LLVOAvatar : public LLViewerObject, - public LLCharacter + public LLCharacter, + public boost::signals2::trackable { public: friend class LLVOAvatarSelf; diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp index eba600b50a..2eb4398488 100644 --- a/indra/newview/llvosurfacepatch.cpp +++ b/indra/newview/llvosurfacepatch.cpp @@ -80,7 +80,7 @@ public: //============================================================================ LLVOSurfacePatch::LLVOSurfacePatch(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) - : LLStaticViewerObject(id, LL_VO_SURFACE_PATCH, regionp), + : LLStaticViewerObject(id, pcode, regionp), mDirtiedPatch(FALSE), mPool(NULL), mBaseComp(0), diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index 598938b710..9280eb8fa4 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -61,7 +61,8 @@ const F32 WAVE_STEP_INV = (1. / WAVE_STEP); LLVOWater::LLVOWater(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) -: LLStaticViewerObject(id, LL_VO_WATER, regionp) +: LLStaticViewerObject(id, pcode, regionp), + mRenderType(LLPipeline::RENDER_TYPE_WATER) { // Terrain must draw during selection passes so it can block objects behind it. mbCanSelect = FALSE; @@ -114,7 +115,7 @@ LLDrawable *LLVOWater::createDrawable(LLPipeline *pipeline) { pipeline->allocDrawable(this); mDrawable->setLit(FALSE); - mDrawable->setRenderType(LLPipeline::RENDER_TYPE_WATER); + mDrawable->setRenderType(mRenderType); LLDrawPoolWater *pool = (LLDrawPoolWater*) gPipeline.getPool(LLDrawPool::POOL_WATER); @@ -268,6 +269,11 @@ U32 LLVOWater::getPartitionType() const return LLViewerRegion::PARTITION_WATER; } +U32 LLVOVoidWater::getPartitionType() const +{ + return LLViewerRegion::PARTITION_VOIDWATER; +} + LLWaterPartition::LLWaterPartition() : LLSpatialPartition(0, FALSE, 0) { @@ -275,3 +281,9 @@ LLWaterPartition::LLWaterPartition() mDrawableType = LLPipeline::RENDER_TYPE_WATER; mPartitionType = LLViewerRegion::PARTITION_WATER; } + +LLVoidWaterPartition::LLVoidWaterPartition() +{ + mDrawableType = LLPipeline::RENDER_TYPE_VOIDWATER; + mPartitionType = LLViewerRegion::PARTITION_VOIDWATER; +} diff --git a/indra/newview/llvowater.h b/indra/newview/llvowater.h index beefc3f17f..cb9584cabf 100644 --- a/indra/newview/llvowater.h +++ b/indra/newview/llvowater.h @@ -29,6 +29,7 @@ #include "llviewerobject.h" #include "llviewertexture.h" +#include "pipeline.h" #include "v2math.h" const U32 N_RES = 16; //32 // number of subdivisions of wave tile @@ -77,6 +78,19 @@ public: protected: BOOL mUseTexture; BOOL mIsEdgePatch; + S32 mRenderType; }; +class LLVOVoidWater : public LLVOWater +{ +public: + LLVOVoidWater(LLUUID const& id, LLPCode pcode, LLViewerRegion* regionp) : LLVOWater(id, pcode, regionp) + { + mRenderType = LLPipeline::RENDER_TYPE_VOIDWATER; + } + + /*virtual*/ U32 getPartitionType() const; +}; + + #endif // LL_VOSURFACEPATCH_H diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 5760d04a08..8731c9e1a7 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -55,6 +55,11 @@ #include "pipeline.h" #include "llappviewer.h" // for do_disconnect() +#include <deque> +#include <queue> +#include <map> +#include <cstring> + // // Globals // @@ -834,10 +839,69 @@ F32 LLWorld::getLandFarClip() const void LLWorld::setLandFarClip(const F32 far_clip) { + static S32 const rwidth = (S32)REGION_WIDTH_U32; + S32 const n1 = (llceil(mLandFarClip) - 1) / rwidth; + S32 const n2 = (llceil(far_clip) - 1) / rwidth; + bool need_water_objects_update = n1 != n2; + mLandFarClip = far_clip; + + if (need_water_objects_update) + { + updateWaterObjects(); + } } +// Some region that we're connected to, but not the one we're in, gave us +// a (possibly) new water height. Update it in our local copy. +void LLWorld::waterHeightRegionInfo(std::string const& sim_name, F32 water_height) +{ + for (region_list_t::iterator iter = mRegionList.begin(); iter != mRegionList.end(); ++iter) + { + if ((*iter)->getName() == sim_name) + { + (*iter)->setWaterHeight(water_height); + break; + } + } +} +// There are three types of water objects: +// Region water objects: the water in a region. +// Hole water objects: water in the void but within current draw distance. +// Edge water objects: the water outside the draw distance, up till the horizon. +// +// For example: +// +// -----------------------horizon------------------------- +// | | | | +// | Edge Water | | | +// | | | | +// | | | | +// | | | | +// | | | | +// | | rwidth | | +// | | <-----> | | +// ------------------------------------------------------- +// | |Hole |other| | | +// | |Water|reg. | | | +// | |-----------------| | +// | |other|cur. |<--> | | +// | |reg. | reg.| \__|_ draw distance | +// | |-----------------| | +// | | | |<--->| | +// | | | | \__|_ range | +// ------------------------------------------------------- +// | |<----width------>|<--horizon ext.->| +// | | | | +// | | | | +// | | | | +// | | | | +// | | | | +// | | | | +// | | | | +// ------------------------------------------------------- +// void LLWorld::updateWaterObjects() { if (!gAgent.getRegion()) @@ -850,128 +914,265 @@ void LLWorld::updateWaterObjects() return; } - // First, determine the min and max "box" of water objects - S32 min_x = 0; - S32 min_y = 0; - S32 max_x = 0; - S32 max_y = 0; + // Region width in meters. + S32 const rwidth = (S32)REGION_WIDTH_U32; + + // The distance we might see into the void + // when standing on the edge of a region, in meters. + S32 const draw_distance = llceil(mLandFarClip); + + // We can only have "holes" in the water (where there no region) if we + // can have existing regions around it. Taking into account that this + // code is only executed when we enter a region, and not when we walk + // around in it, we (only) need to take into account regions that fall + // within the draw_distance. + // + // Set 'range' to draw_distance, rounded up to the nearest multiple of rwidth. + S32 const nsims = (draw_distance + rwidth - 1) / rwidth; + S32 const range = nsims * rwidth; + + // Get South-West corner of current region. + LLViewerRegion const* regionp = gAgent.getRegion(); U32 region_x, region_y; - - S32 rwidth = 256; - - // We only want to fill in water for stuff that's near us, say, within 256 or 512m - S32 range = LLViewerCamera::getInstance()->getFar() > 256.f ? 512 : 256; - - LLViewerRegion* regionp = gAgent.getRegion(); from_region_handle(regionp->getHandle(), ®ion_x, ®ion_y); - min_x = (S32)region_x - range; - min_y = (S32)region_y - range; - max_x = (S32)region_x + range; - max_y = (S32)region_y + range; + // The min. and max. coordinates of the South-West corners of the Hole water objects. + S32 const min_x = (S32)region_x - range; + S32 const min_y = (S32)region_y - range; + S32 const max_x = (S32)region_x + range; + S32 const max_y = (S32)region_y + range; + + // Attempt to determine a sensible water height for all the + // Hole Water objects. + // + // It make little sense to try to guess what the best water + // height should be when that isn't completely obvious: if it's + // impossible to satisfy every region's water height without + // getting a jump in the water height. + // + // In order to keep the reasoning simple, we assume something + // logical as a group of connected regions, where the coastline + // is at the outer edge. Anything more complex that would "break" + // under such an assumption would probably break anyway (would + // depend on terrain editing and existing mega prims, say, if + // anything would make sense at all). + // + // So, what we do is find all connected regions within the + // draw distance that border void, and then pick the lowest + // water height of those (coast) regions. + S32 const n = 2 * nsims + 1; + S32 const origin = nsims + nsims * n; + std::vector<F32> water_heights(n * n); + std::vector<U8> checked(n * n, 0); // index = nx + ny * n + origin; + U8 const region_bit = 1; + U8 const hole_bit = 2; + U8 const bordering_hole_bit = 4; + U8 const bordering_edge_bit = 8; + // Use the legacy waterheight for the Edge water in the case + // that we don't find any Hole water at all. + F32 water_height = DEFAULT_WATER_HEIGHT; + int max_count = 0; + LL_DEBUGS("WaterHeight") << "Current region: " << regionp->getName() << "; water height: " << regionp->getWaterHeight() << " m." << LL_ENDL; + std::map<S32, int> water_height_counts; + typedef std::queue<std::pair<S32, S32>, std::deque<std::pair<S32, S32> > > nxny_pairs_type; + nxny_pairs_type nxny_pairs; + nxny_pairs.push(nxny_pairs_type::value_type(0, 0)); + water_heights[origin] = regionp->getWaterHeight(); + checked[origin] = region_bit; + // For debugging purposes. + int number_of_connected_regions = 1; + int uninitialized_regions = 0; + int bordering_hole = 0; + int bordering_edge = 0; + while(!nxny_pairs.empty()) + { + S32 const nx = nxny_pairs.front().first; + S32 const ny = nxny_pairs.front().second; + LL_DEBUGS("WaterHeight") << "nx,ny = " << nx << "," << ny << LL_ENDL; + S32 const index = nx + ny * n + origin; + nxny_pairs.pop(); + for (S32 dir = 0; dir < 4; ++dir) + { + S32 const cnx = nx + gDirAxes[dir][0]; + S32 const cny = ny + gDirAxes[dir][1]; + LL_DEBUGS("WaterHeight") << "dir = " << dir << "; cnx,cny = " << cnx << "," << cny << LL_ENDL; + S32 const cindex = cnx + cny * n + origin; + bool is_hole = false; + bool is_edge = false; + LLViewerRegion* new_region_found = NULL; + if (cnx < -nsims || cnx > nsims || + cny < -nsims || cny > nsims) + { + LL_DEBUGS("WaterHeight") << " Edge Water!" << LL_ENDL; + // Bumped into Edge water object. + is_edge = true; + } + else if (checked[cindex]) + { + LL_DEBUGS("WaterHeight") << " Already checked before!" << LL_ENDL; + // Already checked. + is_hole = (checked[cindex] & hole_bit); + } + else + { + S32 x = (S32)region_x + cnx * rwidth; + S32 y = (S32)region_y + cny * rwidth; + U64 region_handle = to_region_handle(x, y); + new_region_found = getRegionFromHandle(region_handle); + is_hole = !new_region_found; + checked[cindex] = is_hole ? hole_bit : region_bit; + } + if (is_hole) + { + // This was a region that borders at least one 'hole'. + // Count the found coastline. + F32 new_water_height = water_heights[index]; + LL_DEBUGS("WaterHeight") << " This is void; counting coastline with water height of " << new_water_height << LL_ENDL; + S32 new_water_height_cm = llround(new_water_height * 100); + int count = (water_height_counts[new_water_height_cm] += 1); + // Just use the lowest water height: this is mainly about the horizon water, + // and whatever we do, we don't want it to be possible to look under the water + // when looking in the distance: it is better to make a step downwards in water + // height when going away from the avie than a step upwards. However, since + // everyone is used to DEFAULT_WATER_HEIGHT, don't allow a single region + // to drag the water level below DEFAULT_WATER_HEIGHT on it's own. + if (bordering_hole == 0 || // First time we get here. + (new_water_height >= DEFAULT_WATER_HEIGHT && + new_water_height < water_height) || + (new_water_height < DEFAULT_WATER_HEIGHT && + count > max_count) + ) + { + water_height = new_water_height; + } + if (count > max_count) + { + max_count = count; + } + if (!(checked[index] & bordering_hole_bit)) + { + checked[index] |= bordering_hole_bit; + ++bordering_hole; + } + } + else if (is_edge && !(checked[index] & bordering_edge_bit)) + { + checked[index] |= bordering_edge_bit; + ++bordering_edge; + } + if (!new_region_found) + { + // Dead end, there is no region here. + continue; + } + // Found a new connected region. + ++number_of_connected_regions; + if (new_region_found->getName().empty()) + { + // Uninitialized LLViewerRegion, don't use it's water height. + LL_DEBUGS("WaterHeight") << " Uninitialized region." << LL_ENDL; + ++uninitialized_regions; + continue; + } + nxny_pairs.push(nxny_pairs_type::value_type(cnx, cny)); + water_heights[cindex] = new_region_found->getWaterHeight(); + LL_DEBUGS("WaterHeight") << " Found a new region (name: " << new_region_found->getName() << "; water height: " << water_heights[cindex] << " m)!" << LL_ENDL; + } + } + llinfos << "Number of connected regions: " << number_of_connected_regions << " (" << uninitialized_regions << + " uninitialized); number of regions bordering Hole water: " << bordering_hole << + "; number of regions bordering Edge water: " << bordering_edge << llendl; + llinfos << "Coastline count (height, count): "; + bool first = true; + for (std::map<S32, int>::iterator iter = water_height_counts.begin(); iter != water_height_counts.end(); ++iter) + { + if (!first) llcont << ", "; + llcont << "(" << (iter->first / 100.f) << ", " << iter->second << ")"; + first = false; + } + llcont << llendl; + llinfos << "Water height used for Hole and Edge water objects: " << water_height << llendl; - F32 height = 0.f; - - for (region_list_t::iterator iter = mRegionList.begin(); - iter != mRegionList.end(); ++iter) + // Update all Region water objects. + for (region_list_t::iterator iter = mRegionList.begin(); iter != mRegionList.end(); ++iter) { LLViewerRegion* regionp = *iter; LLVOWater* waterp = regionp->getLand().getWaterObj(); - height += regionp->getWaterHeight(); if (waterp) { gObjectList.updateActive(waterp); } } + // Clean up all existing Hole water objects. for (std::list<LLVOWater*>::iterator iter = mHoleWaterObjects.begin(); - iter != mHoleWaterObjects.end(); ++ iter) + iter != mHoleWaterObjects.end(); ++iter) { LLVOWater* waterp = *iter; gObjectList.killObject(waterp); } mHoleWaterObjects.clear(); - // Now, get a list of the holes - S32 x, y; - for (x = min_x; x <= max_x; x += rwidth) + // Let the Edge and Hole water boxes be 1024 meter high so that they + // are never too small to be drawn (A LL_VO_*_WATER box has water + // rendered on it's bottom surface only), and put their bottom at + // the current regions water height. + F32 const box_height = 1024; + F32 const water_center_z = water_height + box_height / 2; + + // Create new Hole water objects within 'range' where there is no region. + for (S32 x = min_x; x <= max_x; x += rwidth) { - for (y = min_y; y <= max_y; y += rwidth) + for (S32 y = min_y; y <= max_y; y += rwidth) { U64 region_handle = to_region_handle(x, y); if (!getRegionFromHandle(region_handle)) { - LLVOWater* waterp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, gAgent.getRegion()); + LLVOWater* waterp = (LLVOWater*)gObjectList.createObjectViewer(LLViewerObject::LL_VO_VOID_WATER, gAgent.getRegion()); waterp->setUseTexture(FALSE); - waterp->setPositionGlobal(LLVector3d(x + rwidth/2, - y + rwidth/2, - 256.f+DEFAULT_WATER_HEIGHT)); - waterp->setScale(LLVector3((F32)rwidth, (F32)rwidth, 512.f)); + waterp->setPositionGlobal(LLVector3d(x + rwidth / 2, y + rwidth / 2, water_center_z)); + waterp->setScale(LLVector3((F32)rwidth, (F32)rwidth, box_height)); gPipeline.createObject(waterp); mHoleWaterObjects.push_back(waterp); } } } - // Update edge water objects - S32 wx, wy; - S32 center_x, center_y; - wx = (max_x - min_x) + rwidth; - wy = (max_y - min_y) + rwidth; - center_x = min_x + (wx >> 1); - center_y = min_y + (wy >> 1); - - S32 add_boundary[4] = { - 512 - (max_x - region_x), - 512 - (max_y - region_y), - 512 - (region_x - min_x), - 512 - (region_y - min_y) }; + // Center of the region. + S32 const center_x = region_x + rwidth / 2; + S32 const center_y = region_y + rwidth / 2; + // Width of the area with Hole water objects. + S32 const width = rwidth + 2 * range; + S32 const horizon_extend = 2048 + 512 - range; // Legacy value. + // The overlap is needed to get rid of sky pixels being visible between the + // Edge and Hole water object at greater distances (due to floating point + // round off errors). + S32 const edge_hole_overlap = 1; // Twice the actual overlap. - S32 dir; - for (dir = 0; dir < 8; dir++) + for (S32 dir = 0; dir < 8; ++dir) { - S32 dim[2] = { 0 }; - switch (gDirAxes[dir][0]) - { - case -1: dim[0] = add_boundary[2]; break; - case 0: dim[0] = wx; break; - default: dim[0] = add_boundary[0]; break; - } - switch (gDirAxes[dir][1]) - { - case -1: dim[1] = add_boundary[3]; break; - case 0: dim[1] = wy; break; - default: dim[1] = add_boundary[1]; break; - } + // Size of the Edge water objects. + S32 const dim_x = (gDirAxes[dir][0] == 0) ? width : (horizon_extend + edge_hole_overlap); + S32 const dim_y = (gDirAxes[dir][1] == 0) ? width : (horizon_extend + edge_hole_overlap); + // And their position. + S32 const water_center_x = center_x + (width + horizon_extend) / 2 * gDirAxes[dir][0]; + S32 const water_center_y = center_y + (width + horizon_extend) / 2 * gDirAxes[dir][1]; - // Resize and reshape the water objects - const S32 water_center_x = center_x + llround((wx + dim[0]) * 0.5f * gDirAxes[dir][0]); - const S32 water_center_y = center_y + llround((wy + dim[1]) * 0.5f * gDirAxes[dir][1]); - LLVOWater* waterp = mEdgeWaterObjects[dir]; if (!waterp || waterp->isDead()) { // The edge water objects can be dead because they're attached to the region that the // agent was in when they were originally created. - mEdgeWaterObjects[dir] = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, - gAgent.getRegion()); + mEdgeWaterObjects[dir] = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_VOID_WATER, gAgent.getRegion()); waterp = mEdgeWaterObjects[dir]; waterp->setUseTexture(FALSE); - waterp->setIsEdgePatch(TRUE); + waterp->setIsEdgePatch(TRUE); // Mark that this is edge water and not hole water. gPipeline.createObject(waterp); } waterp->setRegion(gAgent.getRegion()); - LLVector3d water_pos(water_center_x, water_center_y, - DEFAULT_WATER_HEIGHT+256.f); - LLVector3 water_scale((F32) dim[0], (F32) dim[1], 512.f); - - //stretch out to horizon - water_scale.mV[0] += fabsf(2048.f * gDirAxes[dir][0]); - water_scale.mV[1] += fabsf(2048.f * gDirAxes[dir][1]); - - water_pos.mdV[0] += 1024.f * gDirAxes[dir][0]; - water_pos.mdV[1] += 1024.f * gDirAxes[dir][1]; + LLVector3d water_pos(water_center_x, water_center_y, water_center_z); + LLVector3 water_scale((F32) dim_x, (F32) dim_y, box_height); waterp->setPositionGlobal(water_pos); waterp->setScale(water_scale); diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h index 4465fde210..c60dc8dc29 100644 --- a/indra/newview/llworld.h +++ b/indra/newview/llworld.h @@ -137,6 +137,7 @@ public: LLViewerTexture *getDefaultWaterTexture(); void updateWaterObjects(); + void waterHeightRegionInfo(std::string const& sim_name, F32 water_height); void shiftRegions(const LLVector3& offset); void setSpaceTimeUSec(const U64 space_time_usec); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 0c5735cdfc..56f55b8bd7 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -630,14 +630,14 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) //static void LLPipeline::updateRenderDeferred() { - BOOL deferred = (gSavedSettings.getBOOL("RenderDeferred") && - LLRenderTarget::sUseFBO && - LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && - gSavedSettings.getBOOL("VertexShaderEnable") && - gSavedSettings.getBOOL("RenderAvatarVP") && - (gSavedSettings.getBOOL("WindLightUseAtmosShaders")) ? TRUE : FALSE) && - !gUseWireframe; - + BOOL deferred = ((gSavedSettings.getBOOL("RenderDeferred") && + LLRenderTarget::sUseFBO && + LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && + gSavedSettings.getBOOL("VertexShaderEnable") && + gSavedSettings.getBOOL("RenderAvatarVP") && + gSavedSettings.getBOOL("WindLightUseAtmosShaders")) ? TRUE : FALSE) && + !gUseWireframe; + sRenderDeferred = deferred; } @@ -1639,20 +1639,14 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl camera.disableUserClipPlane(); - if (gSky.mVOSkyp.notNull() && gSky.mVOSkyp->mDrawable.notNull()) + if (hasRenderType(LLPipeline::RENDER_TYPE_SKY) && + gSky.mVOSkyp.notNull() && + gSky.mVOSkyp->mDrawable.notNull()) { - // Hack for sky - always visible. - if (hasRenderType(LLPipeline::RENDER_TYPE_SKY)) - { - gSky.mVOSkyp->mDrawable->setVisible(camera); - sCull->pushDrawable(gSky.mVOSkyp->mDrawable); - gSky.updateCull(); - stop_glerror(); - } - } - else - { - llinfos << "No sky drawable!" << llendl; + gSky.mVOSkyp->mDrawable->setVisible(camera); + sCull->pushDrawable(gSky.mVOSkyp->mDrawable); + gSky.updateCull(); + stop_glerror(); } if (hasRenderType(LLPipeline::RENDER_TYPE_GROUND) && @@ -2222,6 +2216,7 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) LLPipeline::RENDER_TYPE_TERRAIN, LLPipeline::RENDER_TYPE_TREE, LLPipeline::RENDER_TYPE_SKY, + LLPipeline::RENDER_TYPE_VOIDWATER, LLPipeline::RENDER_TYPE_WATER, LLPipeline::END_RENDER_TYPES)) { @@ -5013,6 +5008,10 @@ void LLPipeline::setLight(LLDrawable *drawablep, BOOL is_light) void LLPipeline::toggleRenderType(U32 type) { gPipeline.mRenderTypeEnabled[type] = !gPipeline.mRenderTypeEnabled[type]; + if (type == LLPipeline::RENDER_TYPE_WATER) + { + gPipeline.mRenderTypeEnabled[LLPipeline::RENDER_TYPE_VOIDWATER] = !gPipeline.mRenderTypeEnabled[LLPipeline::RENDER_TYPE_VOIDWATER]; + } } //static @@ -7340,6 +7339,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) gPipeline.pushRenderTypeMask(); clearRenderTypeMask(LLPipeline::RENDER_TYPE_WATER, + LLPipeline::RENDER_TYPE_VOIDWATER, LLPipeline::RENDER_TYPE_GROUND, LLPipeline::RENDER_TYPE_SKY, LLPipeline::RENDER_TYPE_CLOUDS, @@ -7392,6 +7392,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) { camera.setFar(camera_in.getFar()); clearRenderTypeMask(LLPipeline::RENDER_TYPE_WATER, + LLPipeline::RENDER_TYPE_VOIDWATER, LLPipeline::RENDER_TYPE_GROUND, END_RENDER_TYPES); stop_glerror(); @@ -7908,6 +7909,7 @@ void LLPipeline::generateGI(LLCamera& camera, LLVector3& lightDir, std::vector<L LLPipeline::RENDER_TYPE_TREE, LLPipeline::RENDER_TYPE_TERRAIN, LLPipeline::RENDER_TYPE_WATER, + LLPipeline::RENDER_TYPE_VOIDWATER, LLPipeline::RENDER_TYPE_PASS_ALPHA_SHADOW, LLPipeline::RENDER_TYPE_AVATAR, LLPipeline::RENDER_TYPE_PASS_SIMPLE, @@ -8091,6 +8093,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) LLPipeline::RENDER_TYPE_TREE, LLPipeline::RENDER_TYPE_TERRAIN, LLPipeline::RENDER_TYPE_WATER, + LLPipeline::RENDER_TYPE_VOIDWATER, LLPipeline::RENDER_TYPE_PASS_ALPHA_SHADOW, LLPipeline::RENDER_TYPE_PASS_SIMPLE, LLPipeline::RENDER_TYPE_PASS_BUMP, diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index b80765dac6..790b595626 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -359,6 +359,7 @@ public: RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR, RENDER_TYPE_TREE = LLDrawPool::POOL_TREE, RENDER_TYPE_INVISIBLE = LLDrawPool::POOL_INVISIBLE, + RENDER_TYPE_VOIDWATER = LLDrawPool::POOL_VOIDWATER, RENDER_TYPE_WATER = LLDrawPool::POOL_WATER, RENDER_TYPE_ALPHA = LLDrawPool::POOL_ALPHA, RENDER_TYPE_GLOW = LLDrawPool::POOL_GLOW, diff --git a/indra/newview/skins/default/xui/en/alert_line_editor.xml b/indra/newview/skins/default/xui/en/alert_line_editor.xml index 82bf5fc8da..54dbc698c8 100644 --- a/indra/newview/skins/default/xui/en/alert_line_editor.xml +++ b/indra/newview/skins/default/xui/en/alert_line_editor.xml @@ -4,7 +4,7 @@ revert_on_esc="true" commit_on_focus_lost="true" ignore_tab="true" - max_length="254" + max_length_bytes="254" text_pad_right="0" text_pad_left="2" mouse_opaque="true"/> diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 89ed16e7c2..0a27cc7bc9 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -128,7 +128,7 @@ height="23" layout="topleft" left_pad="2" - max_length="63" + max_length_bytes="63" name="Name" top_delta="0" width="365" /> @@ -1081,7 +1081,7 @@ Leyla Linden </text> follows="left|top" height="23" layout="topleft" - max_length="6" + max_length_bytes="6" name="clean other time" left_pad="0" width="46" @@ -1625,7 +1625,7 @@ Only large parcels can be listed in search. height="23" layout="topleft" left_pad="0" - max_length="255" + max_length_bytes="255" name="media_url" select_on_focus="true" width="300" @@ -1666,7 +1666,7 @@ Only large parcels can be listed in search. height="20" layout="topleft" left="110" - max_length="255" + max_length_bytes="255" name="url_description" select_on_focus="true" tool_tip="Text displayed next to play/load button" @@ -1821,7 +1821,7 @@ Only large parcels can be listed in search. height="23" layout="topleft" left="100" - max_length="255" + max_length_bytes="255" name="music_url" top_delta="0" right="-15" diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency.xml b/indra/newview/skins/default/xui/en/floater_buy_currency.xml index 637f9f55d4..cd5922a9a2 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_currency.xml @@ -114,7 +114,7 @@ </text> <line_editor type="string" - max_length="10" + max_length_bytes="10" halign="right" font="SansSerifMedium" select_on_focus="true" diff --git a/indra/newview/skins/default/xui/en/floater_display_name.xml b/indra/newview/skins/default/xui/en/floater_display_name.xml index 7a3fb9334a..9a9fd32a77 100644 --- a/indra/newview/skins/default/xui/en/floater_display_name.xml +++ b/indra/newview/skins/default/xui/en/floater_display_name.xml @@ -63,7 +63,7 @@ width="300" height="20" font="SansSerif" - name="set_name_label"> + name="name_confirm_label"> Type your new name again to confirm: </text> <line_editor diff --git a/indra/newview/skins/default/xui/en/floater_god_tools.xml b/indra/newview/skins/default/xui/en/floater_god_tools.xml index dfe3cf4485..e7131e20cb 100644 --- a/indra/newview/skins/default/xui/en/floater_god_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_god_tools.xml @@ -73,7 +73,7 @@ height="20" layout="topleft" left_pad="0" - max_length="63" + max_length_bytes="63" name="region name" top_delta="0" width="250"> @@ -236,7 +236,7 @@ height="16" layout="topleft" left_delta="108" - max_length="10" + max_length_bytes="10" name="estate" top_delta="0" width="50" /> @@ -260,7 +260,7 @@ height="16" layout="topleft" left_delta="108" - max_length="10" + max_length_bytes="10" name="parentestate" tool_tip="This is the parent estate for this region" top_delta="0" @@ -287,7 +287,7 @@ height="16" layout="topleft" left_delta="88" - max_length="10" + max_length_bytes="10" name="gridposx" tool_tip="This is the grid x position for this region" top_delta="0" @@ -302,7 +302,7 @@ height="16" layout="topleft" left_pad="10" - max_length="10" + max_length_bytes="10" name="gridposy" tool_tip="This is the grid y position for this region" top_delta="0" @@ -329,7 +329,7 @@ height="16" layout="topleft" left_pad="0" - max_length="10" + max_length_bytes="10" name="redirectx" width="50"> <line_editor.commit_callback @@ -342,7 +342,7 @@ height="16" layout="topleft" left_pad="10" - max_length="10" + max_length_bytes="10" name="redirecty" top_delta="0" width="40"> @@ -754,7 +754,7 @@ height="22" layout="topleft" left_pad="10" - max_length="63" + max_length_bytes="63" name="parameter" top_delta="0" width="290" /> diff --git a/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml b/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml index 2ef52bf539..29f09dd0b2 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml @@ -58,7 +58,7 @@ height="16" layout="topleft" left_delta="78" - max_length="63" + max_length_bytes="63" name="LabelItemName" top_delta="0" width="252" /> @@ -81,7 +81,7 @@ height="16" layout="topleft" left_delta="78" - max_length="127" + max_length_bytes="127" name="LabelItemDesc" top_delta="0" width="252" /> @@ -348,7 +348,7 @@ height="16" layout="topleft" left_pad="5" - max_length="25" + max_length_bytes="25" name="EditPrice" top_delta="0" width="242" /--> diff --git a/indra/newview/skins/default/xui/en/floater_outfit_save_as.xml b/indra/newview/skins/default/xui/en/floater_outfit_save_as.xml index 1d73d516d0..068737494f 100644 --- a/indra/newview/skins/default/xui/en/floater_outfit_save_as.xml +++ b/indra/newview/skins/default/xui/en/floater_outfit_save_as.xml @@ -50,7 +50,7 @@ as a new Outfit: left_delta="0" show_text_as_tentative="false" top_pad="0" - max_length="63" + max_length_bytes="63" name="name ed" width="200"> [DESC] (new) diff --git a/indra/newview/skins/default/xui/en/floater_pay.xml b/indra/newview/skins/default/xui/en/floater_pay.xml index 7ab565313e..41a7134b1d 100644 --- a/indra/newview/skins/default/xui/en/floater_pay.xml +++ b/indra/newview/skins/default/xui/en/floater_pay.xml @@ -84,7 +84,7 @@ top_pad="0" layout="topleft" left="130" - max_length="9" + max_length_bytes="9" name="amount" width="80" /> <button diff --git a/indra/newview/skins/default/xui/en/floater_pay_object.xml b/indra/newview/skins/default/xui/en/floater_pay_object.xml index d8cfed7b09..d3a35c2051 100644 --- a/indra/newview/skins/default/xui/en/floater_pay_object.xml +++ b/indra/newview/skins/default/xui/en/floater_pay_object.xml @@ -117,7 +117,7 @@ top_pad="0" layout="topleft" left="120" - max_length="9" + max_length_bytes="9" name="amount" width="80" /> <button diff --git a/indra/newview/skins/default/xui/en/floater_post_process.xml b/indra/newview/skins/default/xui/en/floater_post_process.xml index 05559adf89..05943a10d3 100644 --- a/indra/newview/skins/default/xui/en/floater_post_process.xml +++ b/indra/newview/skins/default/xui/en/floater_post_process.xml @@ -416,7 +416,7 @@ label="Effect Name" layout="topleft" left_delta="0" - max_length="40" + max_length_bytes="40" name="PPEffectNameEditor" tab_group="1" top_pad="22" diff --git a/indra/newview/skins/default/xui/en/floater_postcard.xml b/indra/newview/skins/default/xui/en/floater_postcard.xml index 6f78363b25..b4ecedd981 100644 --- a/indra/newview/skins/default/xui/en/floater_postcard.xml +++ b/indra/newview/skins/default/xui/en/floater_postcard.xml @@ -78,7 +78,7 @@ height="20" layout="topleft" left_delta="108" - max_length="100" + max_length_bytes="100" name="name_form" top_delta="-4" width="150" /> @@ -99,7 +99,7 @@ label="Type your subject here." layout="topleft" left_delta="108" - max_length="100" + max_length_bytes="100" name="subject_form" top_delta="-4" width="150" /> diff --git a/indra/newview/skins/default/xui/en/floater_preview_animation.xml b/indra/newview/skins/default/xui/en/floater_preview_animation.xml index 6dc073728b..65efc46c71 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_animation.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_animation.xml @@ -32,7 +32,7 @@ height="19" layout="topleft" left_delta="95" - max_length="127" + max_length_bytes="127" name="desc" top="19" width="170" /> diff --git a/indra/newview/skins/default/xui/en/floater_preview_gesture.xml b/indra/newview/skins/default/xui/en/floater_preview_gesture.xml index 1903401988..a17cf8eea8 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_gesture.xml @@ -80,7 +80,7 @@ height="20" layout="topleft" left_delta="89" - max_length="31" + max_length_bytes="31" name="trigger_editor" top_delta="-4" width="175" /> @@ -104,7 +104,7 @@ height="20" layout="topleft" left_delta="99" - max_length="31" + max_length_bytes="31" name="replace_editor" tool_tip="Replace the trigger word(s) with these words. For example, trigger 'hello' replace with 'howdy' will turn the chat 'I wanted to say hello' into 'I wanted to say howdy' as well as playing the gesture" top_delta="-4" @@ -263,7 +263,7 @@ height="20" layout="topleft" left_delta="0" - max_length="127" + max_length_bytes="127" name="chat_editor" top="330" width="100" /> @@ -316,7 +316,7 @@ height="20" layout="topleft" left_pad="10" - max_length="15" + max_length_bytes="15" name="wait_time_editor" top_delta="1" width="50" /> diff --git a/indra/newview/skins/default/xui/en/floater_preview_notecard.xml b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml index e5a5fab9b9..8c9e1d52b3 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_notecard.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml @@ -56,7 +56,7 @@ height="22" layout="topleft" left_pad="0" - max_length="127" + max_length_bytes="127" name="desc" width="296" /> <text_editor diff --git a/indra/newview/skins/default/xui/en/floater_preview_sound.xml b/indra/newview/skins/default/xui/en/floater_preview_sound.xml index f3be8c4131..62ef4c3097 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_sound.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_sound.xml @@ -32,7 +32,7 @@ height="19" layout="topleft" left_pad="0" - max_length="127" + max_length_bytes="127" name="desc" width="170" /> <button diff --git a/indra/newview/skins/default/xui/en/floater_preview_texture.xml b/indra/newview/skins/default/xui/en/floater_preview_texture.xml index 7fd7eab867..a79d2f63cb 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_texture.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_texture.xml @@ -40,7 +40,7 @@ height="19" layout="topleft" left_pad="0" - max_length="127" + max_length_bytes="127" name="desc" width="190" /> <text diff --git a/indra/newview/skins/default/xui/en/floater_report_abuse.xml b/indra/newview/skins/default/xui/en/floater_report_abuse.xml index 47383c8010..e6d749a3f0 100644 --- a/indra/newview/skins/default/xui/en/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/en/floater_report_abuse.xml @@ -416,7 +416,7 @@ height="23" layout="topleft" left="10" - max_length="256" + max_length_bytes="256" name="abuse_location_edit" top_pad="0" width="313" /> @@ -441,7 +441,7 @@ height="23" layout="topleft" left_delta="0" - max_length="64" + max_length_bytes="64" name="summary_edit" top_pad="0" width="313" /> diff --git a/indra/newview/skins/default/xui/en/floater_script_preview.xml b/indra/newview/skins/default/xui/en/floater_script_preview.xml index d0cd00d147..8c03b56040 100644 --- a/indra/newview/skins/default/xui/en/floater_script_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_script_preview.xml @@ -55,7 +55,7 @@ height="19" layout="topleft" left_delta="80" - max_length="127" + max_length_bytes="127" name="desc" top_delta="0" width="394" /> diff --git a/indra/newview/skins/default/xui/en/floater_sound_preview.xml b/indra/newview/skins/default/xui/en/floater_sound_preview.xml index ca54ee6604..af791466b6 100644 --- a/indra/newview/skins/default/xui/en/floater_sound_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_sound_preview.xml @@ -27,7 +27,7 @@ height="19" layout="topleft" left_delta="0" - max_length="63" + max_length_bytes="63" name="name_form" top_pad="0" width="280" /> @@ -51,7 +51,7 @@ height="19" layout="topleft" left_delta="0" - max_length="127" + max_length_bytes="127" name="description_form" top_pad="0" width="280" /> diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 4c508035be..d5be64192b 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -831,7 +831,7 @@ follows="left|top|right" height="19" left_pad="0" - max_length="63" + max_length_bytes="63" name="Object Name" select_on_focus="true" top_delta="0" @@ -849,7 +849,7 @@ follows="left|top|right" height="19" left_pad="0" - max_length="127" + max_length_bytes="127" name="Object Description" select_on_focus="true" top_delta="0" @@ -2554,7 +2554,7 @@ even though the user gets a free copy. height="16" layout="topleft" left="10" - max_length="63" + max_length_bytes="63" name="Home Url" select_on_focus="true" top="134" diff --git a/indra/newview/skins/default/xui/en/floater_ui_preview.xml b/indra/newview/skins/default/xui/en/floater_ui_preview.xml index 3b10a57c50..12c4561753 100644 --- a/indra/newview/skins/default/xui/en/floater_ui_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_ui_preview.xml @@ -241,7 +241,7 @@ height="20" layout="topleft" left_delta="100" - max_length="300" + max_length_bytes="300" name="executable_path_field" select_on_focus="true" tool_tip="The full path to an editor (executable) to edit floater XML files (quotes not necessary)" @@ -280,7 +280,7 @@ height="20" layout="topleft" left_delta="100" - max_length="300" + max_length_bytes="300" name="executable_args_field" select_on_focus="true" tool_tip="Command-line arguments to the editor; use '%FILE%' to refer to the target file; 'YourProgram.exe FileName.xml' will be run if this field is empty" @@ -321,7 +321,7 @@ height="20" layout="topleft" left_delta="65" - max_length="300" + max_length_bytes="300" name="vlt_diff_path_field" select_on_focus="true" tool_tip="The full path to an XML D0 or D1 localization difference file generated by the Viewer Localization Toolkit" 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 20629018e2..019e7cd032 100644 --- a/indra/newview/skins/default/xui/en/floater_world_map.xml +++ b/indra/newview/skins/default/xui/en/floater_world_map.xml @@ -541,7 +541,7 @@ halign="right" height="16" layout="topleft" - left="25" + left="15" name="events_label" top_pad="16" width="70"> @@ -574,7 +574,8 @@ left_delta="47" max_val="255" min_val="0" - name="teleport_coordinate_y" > + name="teleport_coordinate_y" + width="44" > <spinner.commit_callback function="WMap.Coordinates" /> </spinner> @@ -584,12 +585,13 @@ follows="right|bottom" height="23" increment="1" - initial_value="128" + initial_value="23" layout="topleft" left_delta="47" - max_val="255" + max_val="4096" min_val="0" - name="teleport_coordinate_z"> + name="teleport_coordinate_z" + width="55" > <spinner.commit_callback function="WMap.Coordinates" /> </spinner> diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index ce628d93b5..43058a5ee3 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2761,18 +2761,6 @@ function="Floater.Show" parameter="font_test" /> </menu_item_call> - <menu_item_call - label="Load from XML" - name="Load from XML"> - <menu_item_call.on_click - function="Advanced.LoadUIFromXML" /> - </menu_item_call> - <menu_item_call - label="Save to XML" - name="Save to XML"> - <menu_item_call.on_click - function="Advanced.SaveUIToXML" /> - </menu_item_call> <menu_item_check label="Show XUI Names" name="Show XUI Names"> diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 83cbcb3344..4ee04b44b6 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -1367,6 +1367,14 @@ Could not find 'data' chunk in WAV header: <notification icon="alertmodal.tga" + name="SoundFileInvalidChunkSize" + type="alertmodal"> +Wrong chunk size in WAV file: +[FILE] + </notification> + + <notification + icon="alertmodal.tga" name="SoundFileInvalidTooLong" type="alertmodal"> Audio file is too long (10 second maximum): diff --git a/indra/newview/skins/default/xui/en/panel_edit_classified.xml b/indra/newview/skins/default/xui/en/panel_edit_classified.xml index 5934956559..ce0438fbc9 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_classified.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_classified.xml @@ -119,7 +119,7 @@ layout="topleft" left="10" top_pad="2" - max_length="30" + max_length_bytes="30" name="classified_name" prevalidate_callback="ascii" text_color="black" diff --git a/indra/newview/skins/default/xui/en/panel_edit_gloves.xml b/indra/newview/skins/default/xui/en/panel_edit_gloves.xml index a490f27b9f..8c0c543d71 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_gloves.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_gloves.xml @@ -26,7 +26,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Fabric" + label="Texture" layout="topleft" left="10" name="Fabric" diff --git a/indra/newview/skins/default/xui/en/panel_edit_jacket.xml b/indra/newview/skins/default/xui/en/panel_edit_jacket.xml index 929cdffb3d..8e8d8e6505 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_jacket.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_jacket.xml @@ -26,7 +26,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Upper Fabric" + label="Upper Texture" layout="topleft" left="25" name="Upper Fabric" @@ -41,7 +41,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Lower Fabric" + label="Lower Texture" layout="topleft" left_pad="20" name="Lower Fabric" diff --git a/indra/newview/skins/default/xui/en/panel_edit_pants.xml b/indra/newview/skins/default/xui/en/panel_edit_pants.xml index f22cf983aa..dd749a9259 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_pants.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_pants.xml @@ -26,7 +26,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Fabric" + label="Texture" layout="topleft" left="10" name="Fabric" diff --git a/indra/newview/skins/default/xui/en/panel_edit_pick.xml b/indra/newview/skins/default/xui/en/panel_edit_pick.xml index c4b831b71c..a284d3ccc0 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_pick.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_pick.xml @@ -104,7 +104,7 @@ layout="topleft" left="10" top_pad="2" - max_length="63" + max_length_bytes="63" name="pick_name" text_color="black" width="273" /> diff --git a/indra/newview/skins/default/xui/en/panel_edit_shirt.xml b/indra/newview/skins/default/xui/en/panel_edit_shirt.xml index 85823073b5..5424b805e1 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_shirt.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_shirt.xml @@ -26,7 +26,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Fabric" + label="Texture" layout="topleft" left="10" name="Fabric" diff --git a/indra/newview/skins/default/xui/en/panel_edit_shoes.xml b/indra/newview/skins/default/xui/en/panel_edit_shoes.xml index b26fde68f1..859e7454a4 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_shoes.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_shoes.xml @@ -26,7 +26,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Fabric" + label="Texture" layout="topleft" left="10" name="Fabric" diff --git a/indra/newview/skins/default/xui/en/panel_edit_skirt.xml b/indra/newview/skins/default/xui/en/panel_edit_skirt.xml index bb8e0dca07..76d66cc5dc 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_skirt.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_skirt.xml @@ -26,7 +26,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Fabric" + label="Texture" layout="topleft" left="10" name="Fabric" diff --git a/indra/newview/skins/default/xui/en/panel_edit_socks.xml b/indra/newview/skins/default/xui/en/panel_edit_socks.xml index d813d94d93..5f978174b3 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_socks.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_socks.xml @@ -26,7 +26,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Fabric" + label="Texture" layout="topleft" left="10" name="Fabric" diff --git a/indra/newview/skins/default/xui/en/panel_edit_underpants.xml b/indra/newview/skins/default/xui/en/panel_edit_underpants.xml index 19225e9757..16f28377fb 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_underpants.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_underpants.xml @@ -26,7 +26,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Fabric" + label="Texture" layout="topleft" left="10" name="Fabric" diff --git a/indra/newview/skins/default/xui/en/panel_edit_undershirt.xml b/indra/newview/skins/default/xui/en/panel_edit_undershirt.xml index 720a55dcc2..059485cfb4 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_undershirt.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_undershirt.xml @@ -26,7 +26,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Fabric" + label="Texture" layout="topleft" left="10" name="Fabric" diff --git a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml index b8ef612c6c..b3e9586ee9 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml @@ -241,7 +241,7 @@ height="23" layout="topleft" left="10" - max_length="63" + max_length_bytes="63" name="description" prevalidate_callback="ascii" select_on_focus="true" diff --git a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml index 3ded5c6678..0347d2feec 100644 --- a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml +++ b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml @@ -71,7 +71,7 @@ background_visible="true" label="Type your new group name here" layout="topleft" left_delta="10" - max_length="35" + max_length_bytes="35" name="group_name_editor" top_delta="5" width="270" diff --git a/indra/newview/skins/default/xui/en/panel_group_land_money.xml b/indra/newview/skins/default/xui/en/panel_group_land_money.xml index 2e57c85d6f..1270a21710 100644 --- a/indra/newview/skins/default/xui/en/panel_group_land_money.xml +++ b/indra/newview/skins/default/xui/en/panel_group_land_money.xml @@ -184,7 +184,7 @@ height="19" layout="topleft" left_pad="5" - max_length="10" + max_length_bytes="10" name="your_contribution_line_editor" top_delta="0" width="80" /> diff --git a/indra/newview/skins/default/xui/en/panel_group_notices.xml b/indra/newview/skins/default/xui/en/panel_group_notices.xml index 41f2b28004..600b0e3b71 100644 --- a/indra/newview/skins/default/xui/en/panel_group_notices.xml +++ b/indra/newview/skins/default/xui/en/panel_group_notices.xml @@ -138,7 +138,7 @@ Maximum 200 per group daily height="16" layout="topleft" left_pad="3" - max_length="63" + max_length_bytes="63" name="create_subject" prevalidate_callback="ascii" width="220" /> @@ -180,7 +180,7 @@ Maximum 200 per group daily enabled="false" height="19" layout="topleft" - max_length="90" + max_length_bytes="90" mouse_opaque="false" name="create_inventory_name" top_pad="2" @@ -307,7 +307,7 @@ Maximum 200 per group daily height="20" layout="topleft" left_pad="3" - max_length="63" + max_length_bytes="63" name="view_subject" top_delta="-1" visible="false" @@ -341,7 +341,7 @@ Maximum 200 per group daily height="20" layout="topleft" left="5" - max_length="63" + max_length_bytes="63" mouse_opaque="false" name="view_inventory_name" top_pad="8" diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml index 074e9bf5e5..a7178dc288 100644 --- a/indra/newview/skins/default/xui/en/panel_group_roles.xml +++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml @@ -390,7 +390,7 @@ things in this group. There's a broad variety of Abilities. left="0" follows="left|top|right" right="-1" - max_length="20" + max_length_bytes="20" name="role_name" top_pad="0" width="300"> @@ -413,7 +413,7 @@ things in this group. There's a broad variety of Abilities. left="0" follows="left|top|right" right="-1" - max_length="20" + max_length_bytes="20" name="role_title" top_pad="0" width="300"> diff --git a/indra/newview/skins/default/xui/en/panel_landmark_info.xml b/indra/newview/skins/default/xui/en/panel_landmark_info.xml index f8635b9edb..6ee2abc70f 100644 --- a/indra/newview/skins/default/xui/en/panel_landmark_info.xml +++ b/indra/newview/skins/default/xui/en/panel_landmark_info.xml @@ -252,7 +252,7 @@ height="22" layout="topleft" left="0" - max_length="63" + max_length_bytes="63" name="title_editor" prevalidate_callback="ascii" text_readonly_color="white" diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index a5d730711c..b181ca3bba 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -69,7 +69,7 @@ follows="left|bottom" height="22" label="bobsmith12 or Steller Sunshine" left_delta="0" -max_length="63" +max_length_bytes="63" name="username_edit" prevalidate_callback="ascii" select_on_focus="true" @@ -89,7 +89,7 @@ top="20" <line_editor follows="left|bottom" height="22" - max_length="16" + max_length_bytes="16" name="password_edit" select_on_focus="true" top_pad="0" diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml index 55df70eb71..5871eb0654 100644 --- a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml @@ -17,7 +17,7 @@ layout="topleft" left_delta="3" left="0" - max_length="1024" + max_length_bytes="1023" name="chat_box" text_pad_left="5" text_pad_right="25" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index 7d9bd1bf2a..9d496575c9 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -280,7 +280,7 @@ Automatic position for: enabled_control="EnableVoiceChat" height="23" left="80" - max_length="200" + max_length_bytes="200" name="modifier_combo" label="Push-to-Speak trigger" top_pad="5" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml index 31e160ec33..85824c2576 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -308,6 +308,38 @@ width="95"> URLs </text> + <spinner + control_name="NearbyToastLifeTime" + decimal_digits="0" + follows="left|top" + height="23" + increment="1" + initial_value="23" + label="Nearby chat toasts life time:" + label_width="190" + layout="topleft" + left="290" + max_val="60" + min_val="1" + name="nearby_toasts_lifetime" + top_pad="33" + width="210" /> + <spinner + control_name="NearbyToastFadingTime" + decimal_digits="0" + follows="left|top" + height="23" + increment="1" + initial_value="3" + label="Nearby chat toasts fading time:" + label_width="190" + layout="topleft" + left_delta="00" + max_val="60" + min_val="0" + name="nearby_toasts_fadingtime" + top_pad="15" + width="210" /> <check_box control_name="PlayTypingAnim" height="16" @@ -316,7 +348,7 @@ layout="topleft" left="30" name="play_typing_animation" - top_pad="32" + top="205" width="400" /> <check_box enabled="false" @@ -343,7 +375,7 @@ left="30" height="20" width="170" - top_pad="14"> + top_pad="7"> Show IMs in: </text> <text @@ -359,14 +391,14 @@ (requires restart) </text> <radio_group + follows="left|top" height="30" - layout="topleft" left="40" control_name="ChatWindow" name="chat_window" top_pad="0" tool_tip="Show your Instant Messages in separate floaters, or in one floater with many tabs (Requires restart)" - width="331"> + width="150"> <radio_item height="16" label="Separate windows" @@ -386,6 +418,36 @@ top_pad="5" width="150" /> </radio_group> + <text + name="disable_toast_label" + follows="left|top" + layout="topleft" + top_delta="-22" + left="280" + height="10" + width="180"> + Enable Incoming Chat popups: + </text> + <check_box + control_name="EnableGroupChatPopups" + name="EnableGroupChatPopups" + label="Group Chats" + layout="topleft" + top_delta="18" + left="295" + height="20" + tool_tip="Check to see popups when a Group Chat message arrives" + width="400" /> + <check_box + control_name="EnableIMChatPopups" + name="EnableIMChatPopups" + label="IM Chats" + layout="topleft" + top_delta="22" + left="295" + height="20" + tool_tip="Check to see popups when an instant message arrives" + width="400" /> <check_box control_name="TranslateChat" enabled="true" @@ -488,4 +550,4 @@ name="Korean" value="ko" /> </combo_box> -</panel> +</panel>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml index b25fd695c9..273c252474 100644 --- a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml +++ b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml @@ -319,7 +319,7 @@ min_width="90"> <line_editor name="media_address_url" - max_length="1024" + max_length_bytes="1023" follows="top|left|right" height="22" top="0" diff --git a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml index 8760c911dc..6940d1549b 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml @@ -118,7 +118,7 @@ height="20" layout="topleft" left_delta="78" - max_length="63" + max_length_bytes="63" name="LabelItemName" top_delta="0" width="210" /> @@ -141,7 +141,7 @@ height="23" layout="topleft" left_delta="78" - max_length="127" + max_length_bytes="127" name="LabelItemDesc" top_delta="-5" width="210" /> diff --git a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml index a2f7edb167..ca63d2df39 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml @@ -118,7 +118,7 @@ height="20" layout="topleft" left_delta="78" - max_length="63" + max_length_bytes="63" name="Object Name" top_delta="0" width="225" /> @@ -143,7 +143,7 @@ name="Object Description" select_on_focus="true" left_delta="78" - max_length="127" + max_length_bytes="127" top_delta="-5" width="225"/> <text diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 403d976350..5d3f19edcf 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2242,8 +2242,7 @@ Clears (deletes) the media and all params from the given face. <string name="InvOfferOwnedBy">owned by</string> <string name="InvOfferOwnedByUnknownUser">owned by an unknown user</string> <string name="InvOfferGaveYou">gave you</string> - <string name="InvOfferYouDecline">You decline</string> - <string name="InvOfferFrom">from</string> + <string name="InvOfferDecline">You decline [DESC] from <nolink>[NAME]</nolink>.</string> <!-- group money --> <string name="GroupMoneyTotal">Total</string> diff --git a/indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml b/indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml index ed8df69bf4..1bb3188cc8 100644 --- a/indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml +++ b/indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <avatar_list_item + name_right_pad="5" height="0" layout="topleft" left="0" |