From 85053e53b6ffabddf702f5ef8da52fe5c18e7753 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 10 Sep 2010 10:26:42 -0600 Subject: fix for VWR-22811: crash at LLImageGL::createGLTexture(int,unsigned char const *,int,int) [secondlife-bin llimagegl.cpp] line 1259 --- indra/llrender/llrender.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra') diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index e26acd53a3..8eb160f4e7 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -431,6 +431,9 @@ void LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions optio if (gGL.mMaxAnisotropy < 1.f) { glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &gGL.mMaxAnisotropy); + + llinfos << "gGL.mMaxAnisotropy: " << gGL.mMaxAnisotropy << llendl ; + gGL.mMaxAnisotropy = llmax(1.f, gGL.mMaxAnisotropy) ; } glTexParameterf(sGLTextureType[mCurrTexType], GL_TEXTURE_MAX_ANISOTROPY_EXT, gGL.mMaxAnisotropy); } -- cgit v1.2.3 From b5ea8b6046b2634cd0ef0ca2d7c3ac8079529e90 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 13 Sep 2010 12:39:14 -0600 Subject: for VWR-22936: design test code/plan for the object cache. --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/lltextureview.cpp | 7 ++++--- indra/newview/llviewerstats.h | 1 + indra/newview/llvocache.cpp | 30 ++++++++++++++++++++++++------ indra/newview/llvocache.h | 3 ++- indra/newview/llworld.cpp | 5 ++++- 6 files changed, 46 insertions(+), 11 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b3f6f0c9f8..c83a87f968 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5849,6 +5849,17 @@ Value 0 + ObjectCacheEnabled + + Comment + Enable the object cache. + Persist + 1 + Type + Boolean + Value + 1 + OpenDebugStatAdvanced Comment diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index c87aff022f..b9a15fd1f4 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -514,7 +514,8 @@ void LLGLTexMemBar::draw() F32 cache_max_usage = (F32)BYTES_TO_MEGA_BYTES(LLAppViewer::getTextureCache()->getMaxUsage()) ; S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f); S32 v_offset = (S32)((texture_bar_height + 2.2f) * mTextureView->mNumTextureBars + 2.0f); - S32 total_downloaded = BYTES_TO_MEGA_BYTES(gTotalTextureBytes); + F32 total_texture_downloaded = (F32)gTotalTextureBytes / (1024 * 1024); + F32 total_object_downloaded = (F32)gTotalObjectBytes / (1024 * 1024); //---------------------------------------------------------------------------- LLGLSUIDefault gls_ui; LLColor4 text_color(1.f, 1.f, 1.f, 0.75f); @@ -525,13 +526,13 @@ void LLGLTexMemBar::draw() LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*6, text_color, LLFontGL::LEFT, LLFontGL::TOP); - text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB Net Tot: %d MB", + text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB Net Tot Tex: %.1f MB Tot Obj: %.1f MB", total_mem, max_total_mem, bound_mem, max_bound_mem, LLImageRaw::sGlobalRawMemory >> 20, discard_bias, - cache_usage, cache_max_usage, total_downloaded); + cache_usage, cache_max_usage, total_texture_downloaded, total_object_downloaded); //, cache_entries, cache_max_entries LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*3, diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index ca977d4599..dd82ccddc3 100644 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -264,4 +264,5 @@ void send_stats(); extern std::map gDebugTimers; extern std::map gDebugTimerLabel; extern U32 gTotalTextureBytes; +extern U32 gTotalObjectBytes; #endif // LL_LLVIEWERSTATS_H diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index ee32bd562e..d40e3c153c 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -28,6 +28,7 @@ #include "llvocache.h" #include "llerror.h" #include "llregionhandle.h" +#include "llviewercontrol.h" BOOL check_read(LLAPRFile* apr_file, void* src, S32 n_bytes) { @@ -230,11 +231,11 @@ LLVOCache* LLVOCache::sInstance = NULL; //static LLVOCache* LLVOCache::getInstance() -{ +{ if(!sInstance) { sInstance = new LLVOCache() ; -} + } return sInstance ; } @@ -259,13 +260,17 @@ LLVOCache::LLVOCache(): mReadOnly(TRUE), mNumEntries(0) { + mEnabled = gSavedSettings.getBOOL("ObjectCacheEnabled"); mLocalAPRFilePoolp = new LLVolatileAPRPool() ; } LLVOCache::~LLVOCache() { - writeCacheHeader(); - clearCacheInMemory(); + if(mEnabled) + { + writeCacheHeader(); + clearCacheInMemory(); + } delete mLocalAPRFilePoolp; } @@ -279,7 +284,7 @@ void LLVOCache::setDirNames(ELLPath location) void LLVOCache::initCache(ELLPath location, U32 size, U32 cache_version) { - if(mInitialized) + if(mInitialized || !mEnabled) { return ; } @@ -406,6 +411,11 @@ BOOL LLVOCache::checkWrite(LLAPRFile* apr_file, void* src, S32 n_bytes) void LLVOCache::readCacheHeader() { + if(!mEnabled) + { + return ; + } + //clear stale info. clearCacheInMemory(); @@ -450,7 +460,7 @@ void LLVOCache::readCacheHeader() void LLVOCache::writeCacheHeader() { - if(mReadOnly) + if(mReadOnly || !mEnabled) { return ; } @@ -501,6 +511,10 @@ BOOL LLVOCache::updateEntry(const HeaderEntryInfo* entry) void LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::vocache_entry_map_t& cache_entry_map) { + if(!mEnabled) + { + return ; + } llassert_always(mInitialized); handle_entry_map_t::iterator iter = mHandleEntryMap.find(handle) ; @@ -570,6 +584,10 @@ void LLVOCache::purgeEntries() void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache) { + if(!mEnabled) + { + return ; + } llassert_always(mInitialized); if(mReadOnly) diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h index 56b48ef705..4d3c3d98c9 100644 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -128,6 +128,7 @@ private: BOOL checkWrite(LLAPRFile* apr_file, void* src, S32 n_bytes) ; private: + BOOL mEnabled; BOOL mInitialized ; BOOL mReadOnly ; HeaderMetaInfo mMetaInfo; @@ -142,7 +143,7 @@ private: static LLVOCache* sInstance ; public: static LLVOCache* getInstance() ; - static BOOL hasInstance() ; + static BOOL hasInstance() ; static void destroyClass() ; }; diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 5760d04a08..c727c4f773 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -121,7 +121,10 @@ void LLWorld::destroyClass() LLViewerRegion* region_to_delete = *region_it++; removeRegion(region_to_delete->getHost()); } - LLVOCache::getInstance()->destroyClass() ; + if(LLVOCache::hasInstance()) + { + LLVOCache::getInstance()->destroyClass() ; + } LLViewerPartSim::getInstance()->destroyClass(); } -- cgit v1.2.3 From fcdd09772f857b7a8ba4cd12d42b23e9dbb6dbf7 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 16 Sep 2010 13:13:06 -0600 Subject: debug code for SH-115: investigate texture related network traffic between viewer 2.x and 1.23. --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/lltexturefetch.cpp | 11 +++++++++++ indra/newview/llviewerstats.cpp | 2 +- indra/newview/llviewerstats.h | 1 + indra/newview/llviewertexturelist.cpp | 26 ++++++++++++++++++++++---- indra/newview/llviewerwindow.cpp | 19 +++++++++++++++++++ 6 files changed, 65 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c83a87f968..e76874e3cb 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4548,6 +4548,17 @@ Value 0 + LogTextureNetworkTraffic + + Comment + Log network traffic for textures + Persist + 1 + Type + Boolean + Value + 0 + LoginAsGod Comment diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 4e9ebce4d1..7d09ea5b4f 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -299,6 +299,7 @@ public: { static LLCachedControl log_to_viewer_log(gSavedSettings,"LogTextureDownloadsToViewerLog"); static LLCachedControl log_to_sim(gSavedSettings,"LogTextureDownloadsToSimulator"); + static LLCachedControl log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic") ; if (log_to_viewer_log || log_to_sim) { @@ -332,6 +333,16 @@ public: } S32 data_size = worker->callbackHttpGet(channels, buffer, partial, success); + + if(log_texture_traffic && data_size > 0) + { + LLViewerTexture* tex = LLViewerTextureManager::findTexture(mID) ; + if(tex) + { + gTotalTextureBytesPerBoostLevel[tex->getBoostLevel()] += data_size ; + } + } + mFetcher->removeFromHTTPQueue(mID, data_size); } else diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index e55808597c..5da672e759 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -558,7 +558,7 @@ F32 gWorstLandCompression = 0.f, gWorstWaterCompression = 0.f; U32 gTotalWorldBytes = 0, gTotalObjectBytes = 0, gTotalTextureBytes = 0, gSimPingCount = 0; U32 gObjectBits = 0; F32 gAvgSimPing = 0.f; - +U32 gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0}; extern U32 gVisCompared; extern U32 gVisTested; diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index dd82ccddc3..3f9cfb9d9b 100644 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -265,4 +265,5 @@ extern std::map gDebugTimers; extern std::map gDebugTimerLabel; extern U32 gTotalTextureBytes; extern U32 gTotalObjectBytes; +extern U32 gTotalTextureBytesPerBoostLevel[] ; #endif // LL_LLVIEWERSTATS_H diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 456516ab6b..36865b798c 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1161,6 +1161,8 @@ void LLViewerTextureList::updateMaxResidentTexMem(S32 mem) // static void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_data) { + static LLCachedControl log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic") ; + LLFastTimer t(FTM_PROCESS_IMAGES); // Receive image header, copy into image object and decompresses @@ -1171,14 +1173,16 @@ void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_d char ip_string[256]; u32_to_ip_string(msg->getSenderIP(),ip_string); + U32 received_size ; if (msg->getReceiveCompressedSize()) { - gTextureList.sTextureBits += msg->getReceiveCompressedSize() * 8; + received_size = msg->getReceiveCompressedSize() ; } else { - gTextureList.sTextureBits += msg->getReceiveSize() * 8; + received_size = msg->getReceiveSize() ; } + gTextureList.sTextureBits += received_size * 8; gTextureList.sTexturePackets++; U8 codec; @@ -1213,6 +1217,11 @@ void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_d delete [] data; return; } + if(log_texture_traffic) + { + gTotalTextureBytesPerBoostLevel[image->getBoostLevel()] += received_size ; + } + //image->getLastPacketTimer()->reset(); bool res = LLAppViewer::getTextureFetch()->receiveImageHeader(msg->getSender(), id, codec, packets, totalbytes, data_size, data); if (!res) @@ -1224,6 +1233,8 @@ void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_d // static void LLViewerTextureList::receiveImagePacket(LLMessageSystem *msg, void **user_data) { + static LLCachedControl log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic") ; + LLMemType mt1(LLMemType::MTYPE_APPFMTIMAGE); LLFastTimer t(FTM_PROCESS_IMAGES); @@ -1236,14 +1247,16 @@ void LLViewerTextureList::receiveImagePacket(LLMessageSystem *msg, void **user_d char ip_string[256]; u32_to_ip_string(msg->getSenderIP(),ip_string); + U32 received_size ; if (msg->getReceiveCompressedSize()) { - gTextureList.sTextureBits += msg->getReceiveCompressedSize() * 8; + received_size = msg->getReceiveCompressedSize() ; } else { - gTextureList.sTextureBits += msg->getReceiveSize() * 8; + received_size = msg->getReceiveSize() ; } + gTextureList.sTextureBits += received_size * 8; gTextureList.sTexturePackets++; //llprintline("Start decode, image header..."); @@ -1277,6 +1290,11 @@ void LLViewerTextureList::receiveImagePacket(LLMessageSystem *msg, void **user_d delete [] data; return; } + if(log_texture_traffic) + { + gTotalTextureBytesPerBoostLevel[image->getBoostLevel()] += received_size ; + } + //image->getLastPacketTimer()->reset(); bool res = LLAppViewer::getTextureFetch()->receiveImagePacket(msg->getSender(), id, packet_num, data_size, data); if (!res) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 43d18c6d83..12aa40341a 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -304,6 +304,8 @@ public: void update() { + static LLCachedControl log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic") ; + std::string wind_vel_text; std::string wind_vector_text; std::string rwind_vel_text; @@ -580,6 +582,23 @@ public: ypos += y_inc; } } + if(log_texture_traffic) + { + U32 old_y = ypos ; + for(S32 i = LLViewerTexture::BOOST_NONE; i < LLViewerTexture::MAX_GL_IMAGE_CATEGORY; i++) + { + if(gTotalTextureBytesPerBoostLevel[i] > 0) + { + addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, (F32)gTotalTextureBytesPerBoostLevel[i] / (1024 * 1024))); + ypos += y_inc; + } + } + if(ypos != old_y) + { + addText(xpos, ypos, "Network traffic for textures:"); + ypos += y_inc; + } + } } void draw() -- cgit v1.2.3 From 556d3a1a4919e983ff02cb2704a7ad60255eb13c Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 17 Sep 2010 17:23:30 -0600 Subject: fix for SH-115: investigate texture related network traffic between viewer 2.x and 1.23. --- indra/newview/llviewertexture.cpp | 128 ++++++++++++++++++++------------------ indra/newview/llviewertexture.h | 3 + 2 files changed, 72 insertions(+), 59 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 0ad54f238e..4e7ac195ee 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1155,9 +1155,11 @@ void LLViewerFetchedTexture::init(bool firstinit) mSavedRawImage = NULL ; mForceToSaveRawImage = FALSE ; + mSaveRawImage = FALSE ; mSavedRawDiscardLevel = -1 ; mDesiredSavedRawDiscardLevel = -1 ; mLastReferencedSavedRawImageTime = 0.0f ; + mLastCallBackActiveTime = 0.f; } LLViewerFetchedTexture::~LLViewerFetchedTexture() @@ -1483,56 +1485,57 @@ void LLViewerFetchedTexture::setKnownDrawSize(S32 width, S32 height) //virtual void LLViewerFetchedTexture::processTextureStats() { + static LLCachedControl textures_fullres(gSavedSettings,"TextureLoadFullRes"); + if(mFullyLoaded) - { - if(mDesiredDiscardLevel > mMinDesiredDiscardLevel)//need to load more + { + if(needsToSaveRawImage())//needs to reload { - mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ; mFullyLoaded = FALSE ; } - } - else - { - updateVirtualSize() ; - - static LLCachedControl textures_fullres(gSavedSettings,"TextureLoadFullRes"); - - if (textures_fullres) + else { - mDesiredDiscardLevel = 0; + return ; } - else if(!mFullWidth || !mFullHeight) + } + + //updateVirtualSize() ; + + if (textures_fullres) + { + mDesiredDiscardLevel = 0; + } + else if(!mFullWidth || !mFullHeight) + { + mDesiredDiscardLevel = getMaxDiscardLevel() ; + } + else + { + if(!mKnownDrawWidth || !mKnownDrawHeight || mFullWidth <= mKnownDrawWidth || mFullHeight <= mKnownDrawHeight) { - mDesiredDiscardLevel = getMaxDiscardLevel() ; - } - else - { - if(!mKnownDrawWidth || !mKnownDrawHeight || mFullWidth <= mKnownDrawWidth || mFullHeight <= mKnownDrawHeight) + if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT) { - if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT) - { - mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048 - } - else - { - mDesiredDiscardLevel = 0; - } + mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048 } - else if(mKnownDrawSizeChanged)//known draw size is set - { - mDesiredDiscardLevel = (S8)llmin(log((F32)mFullWidth / mKnownDrawWidth) / log_2, - log((F32)mFullHeight / mKnownDrawHeight) / log_2) ; - mDesiredDiscardLevel = llclamp(mDesiredDiscardLevel, (S8)0, (S8)getMaxDiscardLevel()) ; - mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ; - } - mKnownDrawSizeChanged = FALSE ; - - if(getDiscardLevel() >= 0 && (getDiscardLevel() <= mDesiredDiscardLevel)) + else { - mFullyLoaded = TRUE ; + mDesiredDiscardLevel = 0; } } - } + else if(mKnownDrawSizeChanged)//known draw size is set + { + mDesiredDiscardLevel = (S8)llmin(log((F32)mFullWidth / mKnownDrawWidth) / log_2, + log((F32)mFullHeight / mKnownDrawHeight) / log_2) ; + mDesiredDiscardLevel = llclamp(mDesiredDiscardLevel, (S8)0, (S8)getMaxDiscardLevel()) ; + mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ; + } + mKnownDrawSizeChanged = FALSE ; + + if(getDiscardLevel() >= 0 && (getDiscardLevel() <= mDesiredDiscardLevel)) + { + mFullyLoaded = TRUE ; + } + } if(mForceToSaveRawImage && mDesiredSavedRawDiscardLevel >= 0) //force to refetch the texture. { @@ -2074,13 +2077,14 @@ void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_call mNeedsAux |= needs_aux; if(keep_imageraw) { - forceToSaveRawImage(discard_level, true) ; + mSaveRawImage = TRUE ; } if (mNeedsAux && mAuxRawImage.isNull() && getDiscardLevel() >= 0) { // We need aux data, but we've already loaded the image, and it didn't have any llwarns << "No aux data available for callback for image:" << getID() << llendl; } + mLastCallBackActiveTime = sCurrentTime ; } void LLViewerFetchedTexture::clearCallbackEntryList() @@ -2103,9 +2107,8 @@ void LLViewerFetchedTexture::clearCallbackEntryList() } gTextureList.mCallbackList.erase(this); - mMinDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1; mLoadedCallbackDesiredDiscardLevel = S8_MAX ; - if(mForceToSaveRawImage) + if(needsToSaveRawImage()) { destroySavedRawImage() ; } @@ -2151,14 +2154,13 @@ void LLViewerFetchedTexture::deleteCallbackEntry(const LLLoadedCallbackEntry::so { // If we have no callbacks, take us off of the image callback list. gTextureList.mCallbackList.erase(this); - mMinDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1; - - if(mForceToSaveRawImage) + + if(needsToSaveRawImage()) { destroySavedRawImage() ; } } - else if(mForceToSaveRawImage && mBoostLevel != LLViewerTexture::BOOST_PREVIEW) + else if(needsToSaveRawImage() && mBoostLevel != LLViewerTexture::BOOST_PREVIEW) { if(desired_raw_discard != INVALID_DISCARD_LEVEL) { @@ -2196,7 +2198,7 @@ void LLViewerFetchedTexture::unpauseLoadedCallbacks(const LLLoadedCallbackEntry: mPauseLoadedCallBacks = FALSE ; if(need_raw) { - mForceToSaveRawImage = TRUE ; + mSaveRawImage = TRUE ; } } @@ -2227,16 +2229,23 @@ void LLViewerFetchedTexture::pauseLoadedCallbacks(const LLLoadedCallbackEntry::s { mPauseLoadedCallBacks = TRUE ;//when set, loaded callback is paused. resetTextureStats(); - mForceToSaveRawImage = FALSE ; + mSaveRawImage = FALSE ; } } bool LLViewerFetchedTexture::doLoadedCallbacks() { + static const F32 MAX_INACTIVE_TIME = 120.f ; //seconds + if (mNeedsCreateTexture) { return false; } + if(sCurrentTime - mLastCallBackActiveTime > MAX_INACTIVE_TIME) + { + clearCallbackEntryList() ; //remove all callbacks. + return false ; + } bool res = false; @@ -2302,13 +2311,11 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() bool run_raw_callbacks = false; bool need_readback = false; - mMinDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1; for(callback_list_t::iterator iter = mLoadedCallbackList.begin(); iter != mLoadedCallbackList.end(); ) { LLLoadedCallbackEntry *entryp = *iter++; - mMinDesiredDiscardLevel = llmin(mMinDesiredDiscardLevel, (S8)entryp->mDesiredDiscard) ; - + if (entryp->mNeedsImageRaw) { if (mNeedsAux) @@ -2382,7 +2389,8 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() // to satisfy the interested party, then this is the last time that // we're going to call them. - llassert_always(mRawImage.notNull()); + mLastCallBackActiveTime = sCurrentTime ; + //llassert_always(mRawImage.notNull()); if(mNeedsAux && mAuxRawImage.isNull()) { llwarns << "Raw Image with no Aux Data for callback" << llendl; @@ -2417,6 +2425,7 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() LLLoadedCallbackEntry *entryp = *curiter; if (!entryp->mNeedsImageRaw && (entryp->mLastUsedDiscard > gl_discard)) { + mLastCallBackActiveTime = sCurrentTime ; BOOL final = gl_discard <= entryp->mDesiredDiscard ? TRUE : FALSE; entryp->mLastUsedDiscard = gl_discard; entryp->mCallback(TRUE, this, NULL, NULL, gl_discard, final, entryp->mUserData); @@ -2436,7 +2445,6 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() if (mLoadedCallbackList.empty()) { gTextureList.mCallbackList.erase(this); - mMinDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1; } // Done with any raw image data at this point (will be re-created if we still have callbacks) @@ -2516,6 +2524,11 @@ LLImageRaw* LLViewerFetchedTexture::reloadRawImage(S8 discard_level) return mRawImage; } +bool LLViewerFetchedTexture::needsToSaveRawImage() +{ + return mForceToSaveRawImage || mSaveRawImage ; +} + void LLViewerFetchedTexture::destroyRawImage() { if (mAuxRawImage.notNull()) sAuxCount--; @@ -2526,7 +2539,7 @@ void LLViewerFetchedTexture::destroyRawImage() if(mIsRawImageValid) { - if(mForceToSaveRawImage) + if(needsToSaveRawImage()) { saveRawImage() ; } @@ -2658,7 +2671,7 @@ void LLViewerFetchedTexture::saveRawImage() mSavedRawDiscardLevel = mRawDiscardLevel ; mSavedRawImage = new LLImageRaw(mRawImage->getData(), mRawImage->getWidth(), mRawImage->getHeight(), mRawImage->getComponents()) ; - if(mSavedRawDiscardLevel <= mDesiredSavedRawDiscardLevel) + if(mForceToSaveRawImage && mSavedRawDiscardLevel <= mDesiredSavedRawDiscardLevel) { mForceToSaveRawImage = FALSE ; } @@ -2691,13 +2704,10 @@ void LLViewerFetchedTexture::forceToSaveRawImage(S32 desired_discard, bool from_ void LLViewerFetchedTexture::destroySavedRawImage() { clearCallbackEntryList() ; - //if(mForceToSaveRawImage && mDesiredSavedRawDiscardLevel >= 0 && mDesiredSavedRawDiscardLevel < getDiscardLevel()) - //{ - // return ; //can not destroy the saved raw image before it is fully fetched, otherwise causing callbacks hanging there. - //} - + mSavedRawImage = NULL ; mForceToSaveRawImage = FALSE ; + mSaveRawImage = FALSE ; mSavedRawDiscardLevel = -1 ; mDesiredSavedRawDiscardLevel = -1 ; mLastReferencedSavedRawImageTime = 0.0f ; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 7cb8bea4c8..b779396293 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -441,6 +441,7 @@ public: LLImageRaw* reloadRawImage(S8 discard_level) ; void destroyRawImage(); + bool needsToSaveRawImage(); const std::string& getUrl() const {return mUrl;} //--------------- @@ -532,6 +533,7 @@ protected: S8 mLoadedCallbackDesiredDiscardLevel; BOOL mPauseLoadedCallBacks; callback_list_t mLoadedCallbackList; + F32 mLastCallBackActiveTime; LLPointer mRawImage; S32 mRawDiscardLevel; @@ -543,6 +545,7 @@ protected: //keep a copy of mRawImage for some special purposes //when mForceToSaveRawImage is set. BOOL mForceToSaveRawImage ; + BOOL mSaveRawImage; LLPointer mSavedRawImage; S32 mSavedRawDiscardLevel; S32 mDesiredSavedRawDiscardLevel; -- cgit v1.2.3 From b4e0c28103fe30480650bbf39b48af2a8428c74b Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 20 Sep 2010 14:01:05 -0400 Subject: Automated merge from viewer-development-shining --- indra/newview/skins/default/xui/en/notifications.xml | 1 - 1 file changed, 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 609a9b09be..c496b1d5a5 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6268,7 +6268,6 @@ You sent out an update of your appearance after [TIME] seconds. [STATUS] - Date: Tue, 21 Sep 2010 10:47:59 -0400 Subject: SH-178 FIXED As a non-god, I don't want to see admin options Admin options are now enabled by a debug setting. --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llviewermenu.cpp | 13 ++++++++++++- indra/newview/skins/default/xui/en/menu_viewer.xml | 20 +++++++++++--------- 3 files changed, 34 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 916657b97d..b641a16847 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -24,6 +24,17 @@ Value 300 + AdminMenu + + Comment + Enable the debug admin menu from the main menu. Note: This will just allow the menu to be shown; this does not grant admin privileges. + Persist + 0 + Type + Boolean + Value + 0 + AdvanceSnapshot Comment diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index f62223a38d..b46febba63 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1992,6 +1992,16 @@ class LLAdvancedShowDebugSettings : public view_listener_t // VIEW ADMIN OPTIONS // //////////////////////// +class LLAdvancedEnableViewAdminOptions : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + // Don't enable in god mode since the admin menu is shown anyway. + // Only enable if the user has set the appropriate debug setting. + bool new_value = !gAgent.getAgentAccess().isGodlikeWithoutAdminMenuFakery() && gSavedSettings.getBOOL("AdminMenu"); + return new_value; + } +}; class LLAdvancedToggleViewAdminOptions : public view_listener_t { @@ -2006,7 +2016,7 @@ class LLAdvancedCheckViewAdminOptions : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = check_admin_override(NULL); + bool new_value = check_admin_override(NULL) || gAgent.isGodlike(); return new_value; } }; @@ -8099,6 +8109,7 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedCheckShowObjectUpdates(), "Advanced.CheckShowObjectUpdates"); view_listener_t::addMenu(new LLAdvancedCompressImage(), "Advanced.CompressImage"); view_listener_t::addMenu(new LLAdvancedShowDebugSettings(), "Advanced.ShowDebugSettings"); + view_listener_t::addMenu(new LLAdvancedEnableViewAdminOptions(), "Advanced.EnableViewAdminOptions"); view_listener_t::addMenu(new LLAdvancedToggleViewAdminOptions(), "Advanced.ToggleViewAdminOptions"); view_listener_t::addMenu(new LLAdvancedCheckViewAdminOptions(), "Advanced.CheckViewAdminOptions"); view_listener_t::addMenu(new LLAdvancedRequestAdminStatus(), "Advanced.RequestAdminStatus"); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 19707c1bc9..72677de357 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -3038,15 +3038,6 @@ - - - - + + + + + Date: Wed, 22 Sep 2010 14:44:40 -0600 Subject: fix for SH-173/VWR-22868: Development Viewer freezes just after startup / greedy with file handles / 'WARNING: ll_apr_warn_status: APR: Too many open files' --- indra/newview/lltexturefetch.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 7d09ea5b4f..d6d38de225 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -858,10 +858,16 @@ bool LLTextureFetchWorker::doWork(S32 param) if(mCanUseHTTP) { //NOTE: - //it seems ok to let sim control the UDP traffic - //so there is no throttle for http here. + //control the number of the http requests issued for: + //1, not openning too many file descriptors at the same time; + //2, control the traffic of http so udp gets bandwidth. // - + static const S32 MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE = 32 ; + if(mFetcher->getNumHTTPRequests() > MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE) + { + return false ; //wait. + } + mFetcher->removeFromNetworkQueue(this, false); S32 cur_size = 0; -- cgit v1.2.3 From 9961df7c19ed11566b2153df18773f86032f185c Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Wed, 22 Sep 2010 18:09:17 -0400 Subject: SH-188 FIX crash in llvoavatar.cpp We were using a NULL pointer after checking it. Did some logic juggling to ensure that we only use the pointer if it is non-null Code reviewed by Seraph --- indra/newview/llvoavatar.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 46d8f65d23..c31714de5a 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6089,9 +6089,9 @@ void LLVOAvatar::updateMeshTextures() // use the last-known good baked texture until it finish the first // render of the new layerset. - const BOOL layerset_invalid = !mBakedTextureDatas[i].mTexLayerSet - || !mBakedTextureDatas[i].mTexLayerSet->getComposite()->isInitialized() - || !mBakedTextureDatas[i].mTexLayerSet->isLocalTextureDataAvailable(); + const BOOL layerset_invalid = mBakedTextureDatas[i].mTexLayerSet + && ( !mBakedTextureDatas[i].mTexLayerSet->getComposite()->isInitialized() + || !mBakedTextureDatas[i].mTexLayerSet->isLocalTextureDataAvailable() ); use_lkg_baked_layer[i] = (!is_layer_baked[i] && (mBakedTextureDatas[i].mLastTextureIndex != IMG_DEFAULT_AVATAR) -- cgit v1.2.3 From 3db2af5d425051cb9b66c3e0bd734895b78aca4b Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 23 Sep 2010 16:12:01 -0600 Subject: a try fix for SH-212: crash at LLViewerObjectList::removeFromLocalIDTable(LLViewerObject const &) [secondlife-bin llviewerobjectlist.cpp] line 173 --- indra/newview/llviewerobjectlist.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra') diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 05695193a5..9bb9b71b19 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -165,6 +165,11 @@ BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object) { U32 local_id = object.mLocalID; LLHost region_host = object.getRegion()->getHost(); + if(!region_host.isOk()) + { + return FALSE ; + } + U32 ip = region_host.getAddress(); U32 port = region_host.getPort(); U64 ipport = (((U64)ip) << 32) | (U64)port; -- cgit v1.2.3 From 5db02993ef806d2d73ae3e3fde89c3405132a348 Mon Sep 17 00:00:00 2001 From: Wolfpup Lowenhar Date: Mon, 27 Sep 2010 20:20:09 -0400 Subject: [STORM-255] As a user I would like to disable incoming Group/IM toasts from showing up. This will also take care of STORM-221 since the person that would be affected by the toast cha now disable them. --- indra/newview/app_settings/settings.xml | 22 +++++++++++++ indra/newview/llimview.cpp | 14 +++++++++ .../default/xui/en/panel_preferences_chat.xml | 36 ++++++++++++++++++++-- 3 files changed, 69 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 33f5482e50..02e9a10fde 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2567,6 +2567,28 @@ Value 1 + DisableGroupToast + + Comment + Disable Incoming Group Toasts + Persist + 1 + Type + Boolean + Value + 0 + + DisableIMToast + + Comment + Disable Incoming IM Toasts + Persist + 1 + Type + Boolean + Value + 0 + DisplayAvatarAgentTarget Comment diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index c865dcf9a3..286231523a 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("DisableGroupToast") + && session->isGroupSessionType()) + { + return; + } + if (gSavedSettings.getBOOL("DisableIMToast") + && !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()) 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..3adc174aaf 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -343,7 +343,7 @@ left="30" height="20" width="170" - top_pad="14"> + top_pad="7"> Show IMs in: + + Disable incoming notifications: + + + - + \ No newline at end of file -- cgit v1.2.3 From 2a869d52f189a31c185b93f6425dd3e3dd8e927f Mon Sep 17 00:00:00 2001 From: Wolfpup Lowenhar Date: Tue, 28 Sep 2010 14:14:10 -0400 Subject: update for STORM-255 to correct small issue with tool tip in pannel_preferences_chat.xml --- indra/newview/skins/default/xui/en/panel_preferences_chat.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') 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 3adc174aaf..e36415832c 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -366,7 +366,7 @@ 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"> Date: Thu, 30 Sep 2010 22:57:05 -0700 Subject: Port of SNOW-643 : Water flicker at high altitude. This doesn't fix the low altitude flicker though (STORM-306) --- indra/llrender/llgl.cpp | 26 ++- indra/llrender/llgl.h | 7 +- indra/llrender/llglheaders.h | 10 + indra/newview/lldrawable.cpp | 1 + indra/newview/lldrawpool.cpp | 1 + indra/newview/lldrawpool.h | 1 + indra/newview/lldrawpoolground.cpp | 2 +- indra/newview/lldrawpoolsky.cpp | 2 +- indra/newview/lldrawpoolwater.cpp | 28 +-- indra/newview/lldrawpoolwlsky.cpp | 2 +- indra/newview/llfloatergodtools.cpp | 18 +- indra/newview/llspatialpartition.cpp | 25 ++- indra/newview/llspatialpartition.h | 7 + indra/newview/llsurface.cpp | 5 + indra/newview/llviewerdisplay.cpp | 3 +- indra/newview/llviewerobject.cpp | 4 +- indra/newview/llviewerobject.h | 22 +-- indra/newview/llviewerregion.cpp | 1 + indra/newview/llviewerregion.h | 1 + indra/newview/llviewershadermgr.cpp | 4 +- indra/newview/llviewerwindow.cpp | 5 + indra/newview/llvosurfacepatch.cpp | 2 +- indra/newview/llvowater.cpp | 16 +- indra/newview/llvowater.h | 14 ++ indra/newview/llworld.cpp | 353 +++++++++++++++++++++++++++-------- indra/newview/llworld.h | 1 + indra/newview/pipeline.cpp | 45 ++--- indra/newview/pipeline.h | 1 + 28 files changed, 448 insertions(+), 159 deletions(-) (limited to 'indra') 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/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::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 f95112a8ab..087e4abe7e 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -210,13 +210,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; @@ -234,6 +227,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); @@ -243,6 +238,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/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/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 916cbe2267..10c5a27aa7 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/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 741a9e6ec4..4ef1853095 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -167,8 +167,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 bcc2cb164f..10683618cc 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 98f16757b2..74e9b9f4a2 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -261,6 +261,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 038c831e59..bf3948bef1 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 43d18c6d83..66b8d7cd69 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1406,6 +1406,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/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 +#include +#include +#include + // // 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 water_heights(n * n); + std::vector 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 water_height_counts; + typedef std::queue, std::deque > > 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::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::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 1ee3b84b5e..272682710c 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -628,14 +628,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; } @@ -1632,20 +1632,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) && @@ -2214,6 +2208,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)) { @@ -5005,6 +5000,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 @@ -7331,6 +7330,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, @@ -7383,6 +7383,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(); @@ -7899,6 +7900,7 @@ void LLPipeline::generateGI(LLCamera& camera, LLVector3& lightDir, std::vector Date: Mon, 4 Oct 2010 11:19:26 -0400 Subject: SH-270 FIXED As a SL user, I want my speaker order settings to persist between sessions SH-271 FIXED Add #ifdefs to llparticipantlist.h Changed speaker order to store its speaker ordering using settings.xml. Did some superficial code cleanup. --- indra/newview/llcallfloater.cpp | 6 +- indra/newview/llparticipantlist.cpp | 99 +++++---- indra/newview/llparticipantlist.h | 431 ++++++++++++++++++------------------ 3 files changed, 278 insertions(+), 258 deletions(-) (limited to 'indra') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index c78f73c3b8..2dfc30675e 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -44,6 +44,7 @@ #include "llspeakers.h" #include "lltextutil.h" #include "lltransientfloatermgr.h" +#include "llviewercontrol.h" #include "llviewerwindow.h" #include "llvoicechannel.h" #include "llviewerparcelmgr.h" @@ -327,8 +328,9 @@ void LLCallFloater::refreshParticipantList() { mParticipants = new LLParticipantList(mSpeakerManager, mAvatarList, true, mVoiceType != VC_GROUP_CHAT && mVoiceType != VC_AD_HOC_CHAT, false); mParticipants->setValidateSpeakerCallback(boost::bind(&LLCallFloater::validateSpeaker, this, _1)); - mParticipants->setSortOrder(LLParticipantList::E_SORT_BY_RECENT_SPEAKERS); - + const U32 speaker_sort_order = gSavedSettings.getU32("SpeakerParticipantDefaultOrder"); + mParticipants->setSortOrder(LLParticipantList::EParticipantSortOrder(speaker_sort_order)); + if (LLLocalSpeakerMgr::getInstance() == mSpeakerManager) { mAvatarList->setNoItemsCommentText(getString("no_one_near")); diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index c8aa9ac91e..1c68f8a43c 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -197,17 +197,20 @@ private: uuid_set_t mAvalineCallers; }; -LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list, bool use_context_menu/* = true*/, - bool exclude_agent /*= true*/, bool can_toggle_icons /*= true*/): +LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, + LLAvatarList* avatar_list, + bool use_context_menu/* = true*/, + bool exclude_agent /*= true*/, + bool can_toggle_icons /*= true*/) : mSpeakerMgr(data_source), mAvatarList(avatar_list), - mSortOrder(E_SORT_BY_NAME) -, mParticipantListMenu(NULL) -, mExcludeAgent(exclude_agent) -, mValidateSpeakerCallback(NULL) + mParticipantListMenu(NULL), + mExcludeAgent(exclude_agent), + mValidateSpeakerCallback(NULL) { + mAvalineUpdater = new LLAvalineUpdater(boost::bind(&LLParticipantList::onAvalineCallerFound, this, _1), - boost::bind(&LLParticipantList::onAvalineCallerRemoved, this, _1)); + boost::bind(&LLParticipantList::onAvalineCallerRemoved, this, _1)); mSpeakerAddListener = new SpeakerAddListener(*this); mSpeakerRemoveListener = new SpeakerRemoveListener(*this); @@ -378,15 +381,15 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param) } /* -Seems this method is not necessary after onAvalineCallerRemoved was implemented; + Seems this method is not necessary after onAvalineCallerRemoved was implemented; -It does nothing because list item is always created with correct class type for Avaline caller. -For now Avaline Caller is removed from the LLSpeakerMgr List when it is removed from the Voice Client -session. -This happens in two cases: if Avaline Caller ends call itself or if Resident ends group call. + It does nothing because list item is always created with correct class type for Avaline caller. + For now Avaline Caller is removed from the LLSpeakerMgr List when it is removed from the Voice Client + session. + This happens in two cases: if Avaline Caller ends call itself or if Resident ends group call. -Probably Avaline caller should be removed from the LLSpeakerMgr list ONLY if it ends call itself. -Asked in EXT-4301. + Probably Avaline caller should be removed from the LLSpeakerMgr list ONLY if it ends call itself. + Asked in EXT-4301. */ void LLParticipantList::onAvalineCallerFound(const LLUUID& participant_id) { @@ -428,16 +431,19 @@ void LLParticipantList::onAvalineCallerRemoved(const LLUUID& participant_id) void LLParticipantList::setSortOrder(EParticipantSortOrder order) { - if ( mSortOrder != order ) + const U32 speaker_sort_order = gSavedSettings.getU32("SpeakerParticipantDefaultOrder"); + + if ( speaker_sort_order != order ) { - mSortOrder = order; + gSavedSettings.setU32("SpeakerParticipantDefaultOrder", (U32)order); sort(); } } -LLParticipantList::EParticipantSortOrder LLParticipantList::getSortOrder() +const LLParticipantList::EParticipantSortOrder LLParticipantList::getSortOrder() const { - return mSortOrder; + const U32 speaker_sort_order = gSavedSettings.getU32("SpeakerParticipantDefaultOrder"); + return EParticipantSortOrder(speaker_sort_order); } void LLParticipantList::setValidateSpeakerCallback(validate_speaker_callback_t cb) @@ -536,28 +542,29 @@ void LLParticipantList::sort() if ( !mAvatarList ) return; - switch ( mSortOrder ) { - case E_SORT_BY_NAME : - // if mExcludeAgent == true , then no need to keep agent on top of the list - if(mExcludeAgent) - { - mAvatarList->sortByName(); - } - else - { - mAvatarList->setComparator(&AGENT_ON_TOP_NAME_COMPARATOR); + switch ( getSortOrder() ) + { + case E_SORT_BY_NAME : + // if mExcludeAgent == true , then no need to keep agent on top of the list + if(mExcludeAgent) + { + mAvatarList->sortByName(); + } + else + { + mAvatarList->setComparator(&AGENT_ON_TOP_NAME_COMPARATOR); + mAvatarList->sort(); + } + break; + case E_SORT_BY_RECENT_SPEAKERS: + if (mSortByRecentSpeakers.isNull()) + mSortByRecentSpeakers = new LLAvatarItemRecentSpeakerComparator(*this); + mAvatarList->setComparator(mSortByRecentSpeakers.get()); mAvatarList->sort(); - } - break; - case E_SORT_BY_RECENT_SPEAKERS: - if (mSortByRecentSpeakers.isNull()) - mSortByRecentSpeakers = new LLAvatarItemRecentSpeakerComparator(*this); - mAvatarList->setComparator(mSortByRecentSpeakers.get()); - mAvatarList->sort(); - break; - default : - llwarns << "Unrecognized sort order for " << mAvatarList->getName() << llendl; - return; + break; + default : + llwarns << "Unrecognized sort order for " << mAvatarList->getName() << llendl; + return; } } @@ -630,7 +637,7 @@ bool LLParticipantList::SpeakerClearListener::handleEvent(LLPointer event, const LLSD& userdata) { - return mParent.onModeratorUpdateEvent(event, userdata); + return mParent.onModeratorUpdateEvent(event, userdata); } bool LLParticipantList::SpeakerMuteListener::handleEvent(LLPointer event, const LLSD& userdata) @@ -852,7 +859,7 @@ void LLParticipantList::LLParticipantListMenu::confirmMuteAllCallback(const LLSD const LLUUID& session_id = payload["session_id"]; LLIMSpeakerMgr * speaker_manager = dynamic_cast ( - LLIMModel::getInstance()->getSpeakerManager(session_id)); + LLIMModel::getInstance()->getSpeakerManager(session_id)); if (speaker_manager) { speaker_manager->moderateVoiceAllParticipants(false); @@ -910,9 +917,9 @@ bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD& } /* -Processed menu items with such parameters: - can_allow_text_chat - can_moderate_voice + Processed menu items with such parameters: + can_allow_text_chat + can_moderate_voice */ bool LLParticipantList::LLParticipantListMenu::enableModerateContextMenuItem(const LLSD& userdata) { @@ -963,11 +970,11 @@ bool LLParticipantList::LLParticipantListMenu::checkContextMenuItem(const LLSD& } else if(item == "is_sorted_by_name") { - return E_SORT_BY_NAME == mParent.mSortOrder; + return E_SORT_BY_NAME == mParent.getSortOrder(); } else if(item == "is_sorted_by_recent_speakers") { - return E_SORT_BY_RECENT_SPEAKERS == mParent.mSortOrder; + return E_SORT_BY_RECENT_SPEAKERS == mParent.getSortOrder(); } return false; diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index 722a749d19..e0b3d42c25 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -24,6 +24,9 @@ * $/LicenseInfo$ */ +#ifndef LL_PARTICIPANTLIST_H +#define LL_PARTICIPANTLIST_H + #include "llviewerprecompiledheaders.h" #include "llevent.h" #include "llavatarlist.h" // for LLAvatarItemRecentSpeakerComparator @@ -37,239 +40,247 @@ class LLAvalineUpdater; class LLParticipantList { LOG_CLASS(LLParticipantList); +public: + + typedef boost::function validate_speaker_callback_t; + + LLParticipantList(LLSpeakerMgr* data_source, + LLAvatarList* avatar_list, + bool use_context_menu = true, + bool exclude_agent = true, + bool can_toggle_icons = true); + ~LLParticipantList(); + void setSpeakingIndicatorsVisible(BOOL visible); + + enum EParticipantSortOrder + { + E_SORT_BY_NAME = 0, + E_SORT_BY_RECENT_SPEAKERS = 1, + }; + + /** + * Adds specified avatar ID to the existing list if it is not Agent's ID + * + * @param[in] avatar_id - Avatar UUID to be added into the list + */ + void addAvatarIDExceptAgent(const LLUUID& avatar_id); + + /** + * Set and sort Avatarlist by given order + */ + void setSortOrder(EParticipantSortOrder order = E_SORT_BY_NAME); + const EParticipantSortOrder getSortOrder() const; + + /** + * Refreshes the participant list if it's in sort by recent speaker order. + */ + void updateRecentSpeakersOrder(); + + /** + * Set a callback to be called before adding a speaker. Invalid speakers will not be added. + * + * If the callback is unset all speakers are considered as valid. + * + * @see onAddItemEvent() + */ + void setValidateSpeakerCallback(validate_speaker_callback_t cb); + +protected: + /** + * LLSpeakerMgr event handlers + */ + bool onAddItemEvent(LLPointer event, const LLSD& userdata); + bool onRemoveItemEvent(LLPointer event, const LLSD& userdata); + bool onClearListEvent(LLPointer event, const LLSD& userdata); + bool onModeratorUpdateEvent(LLPointer event, const LLSD& userdata); + bool onSpeakerMuteEvent(LLPointer event, const LLSD& userdata); + + /** + * Sorts the Avatarlist by stored order + */ + void sort(); + + /** + * List of listeners implementing LLOldEvents::LLSimpleListener. + * There is no way to handle all the events in one listener as LLSpeakerMgr registers + * listeners in such a way that one listener can handle only one type of event + **/ + class BaseSpeakerListener : public LLOldEvents::LLSimpleListener + { public: + BaseSpeakerListener(LLParticipantList& parent) : mParent(parent) {} + protected: + LLParticipantList& mParent; + }; - typedef boost::function validate_speaker_callback_t; - - LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list, bool use_context_menu = true, bool exclude_agent = true, bool can_toggle_icons = true); - ~LLParticipantList(); - void setSpeakingIndicatorsVisible(BOOL visible); - - typedef enum e_participant_sort_oder { - E_SORT_BY_NAME = 0, - E_SORT_BY_RECENT_SPEAKERS = 1, - } EParticipantSortOrder; + class SpeakerAddListener : public BaseSpeakerListener + { + public: + SpeakerAddListener(LLParticipantList& parent) : BaseSpeakerListener(parent) {} + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); + }; - /** - * Adds specified avatar ID to the existing list if it is not Agent's ID - * - * @param[in] avatar_id - Avatar UUID to be added into the list - */ - void addAvatarIDExceptAgent(const LLUUID& avatar_id); + class SpeakerRemoveListener : public BaseSpeakerListener + { + public: + SpeakerRemoveListener(LLParticipantList& parent) : BaseSpeakerListener(parent) {} + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); + }; - /** - * Set and sort Avatarlist by given order - */ - void setSortOrder(EParticipantSortOrder order = E_SORT_BY_NAME); - EParticipantSortOrder getSortOrder(); + class SpeakerClearListener : public BaseSpeakerListener + { + public: + SpeakerClearListener(LLParticipantList& parent) : BaseSpeakerListener(parent) {} + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); + }; - /** - * Refreshes the participant list if it's in sort by recent speaker order. - */ - void updateRecentSpeakersOrder(); + class SpeakerModeratorUpdateListener : public BaseSpeakerListener + { + public: + SpeakerModeratorUpdateListener(LLParticipantList& parent) : BaseSpeakerListener(parent) {} + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); + }; + + class SpeakerMuteListener : public BaseSpeakerListener + { + public: + SpeakerMuteListener(LLParticipantList& parent) : BaseSpeakerListener(parent) {} - /** - * Set a callback to be called before adding a speaker. Invalid speakers will not be added. - * - * If the callback is unset all speakers are considered as valid. - * - * @see onAddItemEvent() - */ - void setValidateSpeakerCallback(validate_speaker_callback_t cb); + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); + }; + /** + * Menu used in the participant list. + */ + class LLParticipantListMenu : public LLListContextMenu + { + public: + LLParticipantListMenu(LLParticipantList& parent):mParent(parent){}; + /*virtual*/ LLContextMenu* createMenu(); + /*virtual*/ void show(LLView* spawning_view, const uuid_vec_t& uuids, S32 x, S32 y); protected: + LLParticipantList& mParent; + private: + bool enableContextMenuItem(const LLSD& userdata); + bool enableModerateContextMenuItem(const LLSD& userdata); + bool checkContextMenuItem(const LLSD& userdata); + + void sortParticipantList(const LLSD& userdata); + void toggleAllowTextChat(const LLSD& userdata); + void toggleMute(const LLSD& userdata, U32 flags); + void toggleMuteText(const LLSD& userdata); + void toggleMuteVoice(const LLSD& userdata); + /** - * LLSpeakerMgr event handlers + * Return true if Agent is group moderator(and moderator of group call). */ - bool onAddItemEvent(LLPointer event, const LLSD& userdata); - bool onRemoveItemEvent(LLPointer event, const LLSD& userdata); - bool onClearListEvent(LLPointer event, const LLSD& userdata); - bool onModeratorUpdateEvent(LLPointer event, const LLSD& userdata); - bool onSpeakerMuteEvent(LLPointer event, const LLSD& userdata); + bool isGroupModerator(); + // Voice moderation support /** - * Sorts the Avatarlist by stored order + * Check whether specified by argument avatar is muted for group chat or not. */ - void sort(); - - //List of listeners implementing LLOldEvents::LLSimpleListener. - //There is no way to handle all the events in one listener as LLSpeakerMgr registers listeners in such a way - //that one listener can handle only one type of event - class BaseSpeakerListner : public LLOldEvents::LLSimpleListener - { - public: - BaseSpeakerListner(LLParticipantList& parent) : mParent(parent) {} - protected: - LLParticipantList& mParent; - }; - - class SpeakerAddListener : public BaseSpeakerListner - { - public: - SpeakerAddListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {} - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - class SpeakerRemoveListener : public BaseSpeakerListner - { - public: - SpeakerRemoveListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {} - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - class SpeakerClearListener : public BaseSpeakerListner - { - public: - SpeakerClearListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {} - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - class SpeakerModeratorUpdateListener : public BaseSpeakerListner - { - public: - SpeakerModeratorUpdateListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {} - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - class SpeakerMuteListener : public BaseSpeakerListner - { - public: - SpeakerMuteListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {} - - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; + bool isMuted(const LLUUID& avatar_id); /** - * Menu used in the participant list. + * Processes Voice moderation menu items. + * + * It calls either moderateVoiceParticipant() or moderateVoiceParticipant() depend on + * passed parameter. + * + * @param userdata can be "selected" or "others". + * + * @see moderateVoiceParticipant() + * @see moderateVoiceAllParticipants() */ - class LLParticipantListMenu : public LLListContextMenu - { - public: - LLParticipantListMenu(LLParticipantList& parent):mParent(parent){}; - /*virtual*/ LLContextMenu* createMenu(); - /*virtual*/ void show(LLView* spawning_view, const uuid_vec_t& uuids, S32 x, S32 y); - protected: - LLParticipantList& mParent; - private: - bool enableContextMenuItem(const LLSD& userdata); - bool enableModerateContextMenuItem(const LLSD& userdata); - bool checkContextMenuItem(const LLSD& userdata); - - void sortParticipantList(const LLSD& userdata); - void toggleAllowTextChat(const LLSD& userdata); - void toggleMute(const LLSD& userdata, U32 flags); - void toggleMuteText(const LLSD& userdata); - void toggleMuteVoice(const LLSD& userdata); - - /** - * Return true if Agent is group moderator(and moderator of group call). - */ - bool isGroupModerator(); - - // Voice moderation support - /** - * Check whether specified by argument avatar is muted for group chat or not. - */ - bool isMuted(const LLUUID& avatar_id); - - /** - * Processes Voice moderation menu items. - * - * It calls either moderateVoiceParticipant() or moderateVoiceParticipant() depend on - * passed parameter. - * - * @param userdata can be "selected" or "others". - * - * @see moderateVoiceParticipant() - * @see moderateVoiceAllParticipants() - */ - void moderateVoice(const LLSD& userdata); - - /** - * Mutes/Unmutes avatar for current group voice chat. - * - * It only marks avatar as muted for session and does not use local Agent's Block list. - * It does not mute Agent itself. - * - * @param[in] avatar_id UUID of avatar to be processed - * @param[in] unmute if true - specified avatar will be muted, otherwise - unmuted. - * - * @see moderateVoiceAllParticipants() - */ - void moderateVoiceParticipant(const LLUUID& avatar_id, bool unmute); - - /** - * Mutes/Unmutes all avatars for current group voice chat. - * - * It only marks avatars as muted for session and does not use local Agent's Block list. - * - * @param[in] unmute if true - avatars will be muted, otherwise - unmuted. - * - * @see moderateVoiceParticipant() - */ - void moderateVoiceAllParticipants(bool unmute); - - static void confirmMuteAllCallback(const LLSD& notification, const LLSD& response); - }; + void moderateVoice(const LLSD& userdata); /** - * Comparator for comparing avatar items by last spoken time + * Mutes/Unmutes avatar for current group voice chat. + * + * It only marks avatar as muted for session and does not use local Agent's Block list. + * It does not mute Agent itself. + * + * @param[in] avatar_id UUID of avatar to be processed + * @param[in] unmute if true - specified avatar will be muted, otherwise - unmuted. + * + * @see moderateVoiceAllParticipants() */ - class LLAvatarItemRecentSpeakerComparator : public LLAvatarItemNameComparator, public LLRefCount - { - LOG_CLASS(LLAvatarItemRecentSpeakerComparator); - public: - LLAvatarItemRecentSpeakerComparator(LLParticipantList& parent):mParent(parent){}; - virtual ~LLAvatarItemRecentSpeakerComparator() {}; - protected: - virtual bool doCompare(const LLAvatarListItem* avatar_item1, const LLAvatarListItem* avatar_item2) const; - private: - LLParticipantList& mParent; - }; - - private: - void onAvatarListDoubleClicked(LLUICtrl* ctrl); - void onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param); - - void onAvalineCallerFound(const LLUUID& participant_id); - void onAvalineCallerRemoved(const LLUUID& participant_id); + void moderateVoiceParticipant(const LLUUID& avatar_id, bool unmute); /** - * Adjusts passed participant to work properly. + * Mutes/Unmutes all avatars for current group voice chat. * - * Adds SpeakerMuteListener to process moderation actions. - */ - void adjustParticipant(const LLUUID& speaker_id); - - LLSpeakerMgr* mSpeakerMgr; - LLAvatarList* mAvatarList; - - std::set mModeratorList; - std::set mModeratorToRemoveList; - - LLPointer mSpeakerAddListener; - LLPointer mSpeakerRemoveListener; - LLPointer mSpeakerClearListener; - LLPointer mSpeakerModeratorListener; - LLPointer mSpeakerMuteListener; - - LLParticipantListMenu* mParticipantListMenu; - - EParticipantSortOrder mSortOrder; - /* - * This field manages an adding a new avatar_id in the mAvatarList - * If true, then agent_id wont be added into mAvatarList - * Also by default this field is controlling a sort procedure, @c sort() + * It only marks avatars as muted for session and does not use local Agent's Block list. + * + * @param[in] unmute if true - avatars will be muted, otherwise - unmuted. + * + * @see moderateVoiceParticipant() */ - bool mExcludeAgent; + void moderateVoiceAllParticipants(bool unmute); - // boost::connections - boost::signals2::connection mAvatarListDoubleClickConnection; - boost::signals2::connection mAvatarListRefreshConnection; - boost::signals2::connection mAvatarListReturnConnection; - boost::signals2::connection mAvatarListToggleIconsConnection; + static void confirmMuteAllCallback(const LLSD& notification, const LLSD& response); + }; - LLPointer mSortByRecentSpeakers; - validate_speaker_callback_t mValidateSpeakerCallback; - LLAvalineUpdater* mAvalineUpdater; + /** + * Comparator for comparing avatar items by last spoken time + */ + class LLAvatarItemRecentSpeakerComparator : public LLAvatarItemNameComparator, public LLRefCount + { + LOG_CLASS(LLAvatarItemRecentSpeakerComparator); + public: + LLAvatarItemRecentSpeakerComparator(LLParticipantList& parent):mParent(parent){}; + virtual ~LLAvatarItemRecentSpeakerComparator() {}; + protected: + virtual bool doCompare(const LLAvatarListItem* avatar_item1, const LLAvatarListItem* avatar_item2) const; + private: + LLParticipantList& mParent; + }; + +private: + void onAvatarListDoubleClicked(LLUICtrl* ctrl); + void onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param); + + void onAvalineCallerFound(const LLUUID& participant_id); + void onAvalineCallerRemoved(const LLUUID& participant_id); + + /** + * Adjusts passed participant to work properly. + * + * Adds SpeakerMuteListener to process moderation actions. + */ + void adjustParticipant(const LLUUID& speaker_id); + + LLSpeakerMgr* mSpeakerMgr; + LLAvatarList* mAvatarList; + + std::set mModeratorList; + std::set mModeratorToRemoveList; + + LLPointer mSpeakerAddListener; + LLPointer mSpeakerRemoveListener; + LLPointer mSpeakerClearListener; + LLPointer mSpeakerModeratorListener; + LLPointer mSpeakerMuteListener; + + LLParticipantListMenu* mParticipantListMenu; + + /** + * This field manages an adding a new avatar_id in the mAvatarList + * If true, then agent_id wont be added into mAvatarList + * Also by default this field is controlling a sort procedure, @c sort() + */ + bool mExcludeAgent; + + // boost::connections + boost::signals2::connection mAvatarListDoubleClickConnection; + boost::signals2::connection mAvatarListRefreshConnection; + boost::signals2::connection mAvatarListReturnConnection; + boost::signals2::connection mAvatarListToggleIconsConnection; + + LLPointer mSortByRecentSpeakers; + validate_speaker_callback_t mValidateSpeakerCallback; + LLAvalineUpdater* mAvalineUpdater; }; + +#endif // LL_PARTICIPANTLIST_H -- cgit v1.2.3 From cafefd3f5f161d79ecd62bc00b769e6b2b94dc82 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 4 Oct 2010 11:19:37 -0400 Subject: SH-270 FIXED As a SL user, I want my speaker order settings to persist between sessions SH-271 FIXED Add #ifdefs to llparticipantlist.h Changed speaker order to store its speaker ordering using settings.xml. Did some superficial code cleanup. --- indra/newview/app_settings/settings.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b641a16847..b67530215b 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -11079,6 +11079,17 @@ Value 1 + SpeakerParticipantDefaultOrder + + Comment + Order for displaying speakers in voice controls. 0 = alphabetical. 1 = recent. + Persist + 1 + Type + U32 + Value + 1 + SpeakerParticipantRemoveDelay Comment -- cgit v1.2.3 From 235980dfe3f5683c7871285888001740c1c5d66f Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 6 Oct 2010 19:57:45 -0700 Subject: STORM-306 : Fix black flickering of water on Mac when atm shading off --- indra/newview/pipeline.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 272682710c..cc3fa7f254 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4809,7 +4809,7 @@ void LLPipeline::enableLightsFullbright(const LLColor4& color) void LLPipeline::disableLights() { enableLights(0); // no lighting (full bright) - //glColor4f(1.f, 1.f, 1.f, 1.f); // lighting color = white by default + glColor4f(1.f, 1.f, 1.f, 1.f); // lighting color = white by default } //============================================================================ -- cgit v1.2.3 From 3dd2641818f9be3a6a38c8223658814644b06ce8 Mon Sep 17 00:00:00 2001 From: Boroondas Gupte Date: Fri, 8 Oct 2010 01:35:14 +0200 Subject: VWR-23239 FIXED memory leak in LLUIString --- indra/llui/lluistring.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/llui/lluistring.h b/indra/llui/lluistring.h index 3f91856e26..1ecd9bab36 100644 --- a/indra/llui/lluistring.h +++ b/indra/llui/lluistring.h @@ -68,6 +68,8 @@ public: 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; } -- cgit v1.2.3 From ea2005edf062b69e88261e2a824bdbb6e2b2db7d Mon Sep 17 00:00:00 2001 From: Boroondas Gupte Date: Fri, 8 Oct 2010 00:53:55 +0200 Subject: fixed indentation in lluistring.h --- indra/llui/lluistring.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/llui/lluistring.h b/indra/llui/lluistring.h index 1ecd9bab36..6a3a9dba46 100644 --- a/indra/llui/lluistring.h +++ b/indra/llui/lluistring.h @@ -64,7 +64,7 @@ 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); } @@ -89,14 +89,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(); @@ -108,7 +108,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 -- cgit v1.2.3 From 4809142acce5ed66579184dca4fa6e4cdb7bfeed Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 12 Oct 2010 15:35:39 -0600 Subject: add a debug function to output gl error information to the log file without crashing the viewer. No need to test because there are no negative effects. --- indra/llrender/llgl.cpp | 27 +++++++++++++++++++++++++++ indra/llrender/llgl.h | 1 + 2 files changed, 28 insertions(+) (limited to 'indra') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index c0edd92bc1..c2e9740372 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1047,6 +1047,33 @@ void flush_glerror() glGetError(); } +//this function outputs gl error to the log file, does not crash the code. +void log_glerror() +{ + if (LL_UNLIKELY(!gGLManager.mInited)) + { + return ; + } + // Create or update texture to be used with this data + GLenum error; + error = glGetError(); + while (LL_UNLIKELY(error)) + { + GLubyte const * gl_error_msg = gluErrorString(error); + if (NULL != gl_error_msg) + { + llwarns << "GL Error: " << error << " GL Error String: " << gl_error_msg << llendl ; + } + else + { + // gluErrorString returns NULL for some extensions' error codes. + // you'll probably have to grep for the number in glext.h. + llwarns << "GL Error: UNKNOWN 0x" << std::hex << error << std::dec << llendl; + } + error = glGetError(); + } +} + void do_assert_glerror() { if (LL_UNLIKELY(!gGLManager.mInited)) diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index 5e8965c06a..de63d37480 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -157,6 +157,7 @@ void rotate_quat(LLQuaternion& rotation); void flush_glerror(); // Flush GL errors when we know we're handling them correctly. +void log_glerror(); void assert_glerror(); void clear_glerror(); -- cgit v1.2.3 From c3764eaf87580b66790a8d6c4c6a6700159f7977 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 12 Oct 2010 15:38:52 -0600 Subject: add debug code for SH-207: viewer crash in LLVertexBuffer::mapBuffer --- indra/llrender/llvertexbuffer.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index de4501dd0f..fd5136e58b 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -854,6 +854,8 @@ U8* LLVertexBuffer::mapBuffer(S32 access) if (!mMappedData) { + log_glerror(); + //-------------------- //print out more debug info before crash llinfos << "vertex buffer size: (num verts : num indices) = " << getNumVerts() << " : " << getNumIndices() << llendl ; @@ -875,6 +877,8 @@ U8* LLVertexBuffer::mapBuffer(S32 access) if (!mMappedIndexData) { + log_glerror(); + GLint buff; glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff); if ((GLuint)buff != mGLIndices) -- cgit v1.2.3 From fa20a3fe100bd2c99b6fe4c087c79268752a107c Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 13 Oct 2010 17:05:53 -0400 Subject: SH-325 FIXED Add terminal / to SearchURL in viewer settings.xml Added "/". Simple fix. --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 47524a0e91..535bc95287 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3863,7 +3863,7 @@ Type String Value - http://search.secondlife.com/viewer/[CATEGORY]?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID]&channel=[CHANNEL]&version=[VERSION]&major=[VERSION_MAJOR]&minor=[VERSION_MINOR]&patch=[VERSION_PATCH]&build=[VERSION_BUILD] + http://search.secondlife.com/viewer/[CATEGORY]/?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID]&channel=[CHANNEL]&version=[VERSION]&major=[VERSION_MAJOR]&minor=[VERSION_MINOR]&patch=[VERSION_PATCH]&build=[VERSION_BUILD] HighResSnapshot -- cgit v1.2.3 From e403f402e9743099d03e286593f42651a01bad88 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 13 Oct 2010 19:33:36 -0600 Subject: some debug code for SH-288: [crashhunters] LLImageGL::setSubImageFromFrameBuffer --- indra/llrender/llimagegl.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 9d037f2565..9d0fc53d29 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1057,6 +1057,8 @@ BOOL LLImageGL::setSubImageFromFrameBuffer(S32 fb_x, S32 fb_y, S32 x_pos, S32 y_ checkTexSize(true) ; llcallstacks << fb_x << " : " << fb_y << " : " << x_pos << " : " << y_pos << " : " << width << " : " << height << " : " << (S32)mComponents << llcallstacksendl ; + + log_glerror() ; } glCopyTexSubImage2D(GL_TEXTURE_2D, 0, fb_x, fb_y, x_pos, y_pos, width, height); -- cgit v1.2.3 From 03277635d03e8e7c2f73285743fdd9c77802d76f Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 13 Oct 2010 19:56:55 -0600 Subject: merge REV-13dc54d03e13 from skylight: fix for EXP-195: Custom login progress screen blurry when first presented to user as the image fully loads --- indra/newview/llviewertexture.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 7ccd4828ba..f96b93da4d 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1130,7 +1130,7 @@ void LLViewerFetchedTexture::init(bool firstinit) // does not contain this image. mIsMissingAsset = FALSE; - mLoadedCallbackDesiredDiscardLevel = 0; + mLoadedCallbackDesiredDiscardLevel = S8_MAX; mPauseLoadedCallBacks = TRUE ; mNeedsCreateTexture = FALSE; @@ -1507,7 +1507,7 @@ void LLViewerFetchedTexture::processTextureStats() } else if(!mFullWidth || !mFullHeight) { - mDesiredDiscardLevel = getMaxDiscardLevel() ; + mDesiredDiscardLevel = llmin(getMaxDiscardLevel(), (S32)mLoadedCallbackDesiredDiscardLevel) ; } else { -- cgit v1.2.3 From 5ee546eb4e446632c32e62a5234241fd6498f281 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 14 Oct 2010 17:01:39 -0600 Subject: for SH-335: create a debug tool to track of memory availability. --- indra/llcommon/llsys.cpp | 19 +++++++++++++++++++ indra/llcommon/llsys.h | 3 +++ indra/newview/llappviewer.cpp | 32 ++++++++++++++++++++++++++++++-- indra/newview/llappviewer.h | 2 ++ indra/newview/llviewerdisplay.cpp | 1 - 5 files changed, 54 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 00c94404d4..7a82a17d0b 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -635,6 +635,25 @@ U32 LLMemoryInfo::getPhysicalMemoryClamped() const } } +void LLMemoryInfo::getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb) const +{ +#if LL_WINDOWS + MEMORYSTATUSEX state; + state.dwLength = sizeof(state); + GlobalMemoryStatusEx(&state); + + avail_physical_mem_kb = (U32)(state.ullAvailPhys/1024) ; + avail_virtual_mem_kb = (U32)(state.ullAvailVirtual/1024) ; + +#else + //do not know how to collect available memory info for other systems. + //leave it blank here for now. + + avail_physical_mem_kb = -1 ; + avail_virtual_mem_kb = -1 ; +#endif +} + void LLMemoryInfo::stream(std::ostream& s) const { #if LL_WINDOWS diff --git a/indra/llcommon/llsys.h b/indra/llcommon/llsys.h index 39af74e5c8..35425f38ed 100644 --- a/indra/llcommon/llsys.h +++ b/indra/llcommon/llsys.h @@ -114,6 +114,9 @@ public: ** be returned. */ U32 getPhysicalMemoryClamped() const; ///< Memory size in clamped bytes + + //get the available memory infomation in KiloBytes. + void getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb) const; }; diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 333c92e50d..f6cff3d443 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -984,6 +984,7 @@ bool LLAppViewer::mainLoop() LLVoiceClient::getInstance()->init(gServicePump); LLTimer frameTimer,idleTimer; LLTimer debugTime; + LLFrameTimer memCheckTimer; LLViewerJoystick* joystick(LLViewerJoystick::getInstance()); joystick->setNeedsReset(true); @@ -994,11 +995,29 @@ bool LLAppViewer::mainLoop() // point of posting. LLSD newFrame; + const F32 memory_check_interval = 1.0f ; //second + // Handle messages while (!LLApp::isExiting()) { LLFastTimer::nextFrame(); // Should be outside of any timer instances + //clear call stack records + llclearcallstacks; + + //check memory availability information + { + if(memory_check_interval < memCheckTimer.getElapsedTimeF32()) + { + memCheckTimer.reset() ; + + //update the availability of memory + gSysMemory.getAvailableMemoryKB(mAvailPhysicalMemInKB, mAvailVirtualMemInKB) ; + } + llcallstacks << "Available physical mem(KB): " << mAvailPhysicalMemInKB << llcallstacksendl ; + llcallstacks << "Available virtual mem(KB): " << mAvailVirtualMemInKB << llcallstacksendl ; + } + try { pingMainloopTimeout("Main:MiscNativeWindowEvents"); @@ -1225,11 +1244,20 @@ bool LLAppViewer::mainLoop() resumeMainloopTimeout(); pingMainloopTimeout("Main:End"); - } - + } } catch(std::bad_alloc) { + { + llinfos << "Availabe physical memory(KB) at the beginning of the frame: " << mAvailPhysicalMemInKB << llendl ; + llinfos << "Availabe virtual memory(KB) at the beginning of the frame: " << mAvailVirtualMemInKB << llendl ; + + gSysMemory.getAvailableMemoryKB(mAvailPhysicalMemInKB, mAvailVirtualMemInKB) ; + + llinfos << "Current availabe physical memory(KB): " << mAvailPhysicalMemInKB << llendl ; + llinfos << "Current availabe virtual memory(KB): " << mAvailVirtualMemInKB << llendl ; + } + //stop memory leaking simulation LLFloaterMemLeak* mem_leak_instance = LLFloaterReg::findTypedInstance("mem_leaking"); diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 56d88f07c8..a70a727c5d 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -258,6 +258,8 @@ private: std::set mPlugins; + U32 mAvailPhysicalMemInKB ; + U32 mAvailVirtualMemInKB ; public: //some information for updater typedef struct diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 916cbe2267..7c8b52d0b6 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -706,7 +706,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) // // Doing this here gives hardware occlusion queries extra time to complete LLAppViewer::instance()->pingMainloopTimeout("Display:UpdateImages"); - LLError::LLCallStacks::clear() ; { LLMemType mt_iu(LLMemType::MTYPE_DISPLAY_IMAGE_UPDATE); -- cgit v1.2.3 From 219cd6ecda60e1c48852f582f0994573fd0e10ae Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 14 Oct 2010 21:23:23 -0600 Subject: more debug code for SH-207: viewer crash in LLVertexBuffer::mapBuffer. --- indra/llcommon/llsys.cpp | 3 ++- indra/llcommon/llsys.h | 2 +- indra/llrender/llvertexbuffer.cpp | 8 +++++++- indra/newview/llappviewer.cpp | 4 ++-- 4 files changed, 12 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 7a82a17d0b..10cdc7087b 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -635,7 +635,8 @@ U32 LLMemoryInfo::getPhysicalMemoryClamped() const } } -void LLMemoryInfo::getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb) const +//static +void LLMemoryInfo::getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb) { #if LL_WINDOWS MEMORYSTATUSEX state; diff --git a/indra/llcommon/llsys.h b/indra/llcommon/llsys.h index 35425f38ed..41a4f25000 100644 --- a/indra/llcommon/llsys.h +++ b/indra/llcommon/llsys.h @@ -116,7 +116,7 @@ public: U32 getPhysicalMemoryClamped() const; ///< Memory size in clamped bytes //get the available memory infomation in KiloBytes. - void getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb) const; + static void getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb); }; diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index fd5136e58b..02160b09c4 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -27,7 +27,7 @@ #include "linden_common.h" #include - +#include "llsys.h" #include "llvertexbuffer.h" // #include "llrender.h" #include "llglheaders.h" @@ -856,6 +856,12 @@ U8* LLVertexBuffer::mapBuffer(S32 access) { log_glerror(); + //check the availability of memory + U32 avail_phy_mem, avail_vir_mem; + LLMemoryInfo::getAvailableMemoryKB(avail_phy_mem, avail_vir_mem) ; + llinfos << "Available physical mwmory(KB): " << avail_phy_mem << llendl ; + llinfos << "Available virtual memory(KB): " << avail_vir_mem << llendl; + //-------------------- //print out more debug info before crash llinfos << "vertex buffer size: (num verts : num indices) = " << getNumVerts() << " : " << getNumIndices() << llendl ; diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f6cff3d443..3a98749c0f 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1012,7 +1012,7 @@ bool LLAppViewer::mainLoop() memCheckTimer.reset() ; //update the availability of memory - gSysMemory.getAvailableMemoryKB(mAvailPhysicalMemInKB, mAvailVirtualMemInKB) ; + LLMemoryInfo::getAvailableMemoryKB(mAvailPhysicalMemInKB, mAvailVirtualMemInKB) ; } llcallstacks << "Available physical mem(KB): " << mAvailPhysicalMemInKB << llcallstacksendl ; llcallstacks << "Available virtual mem(KB): " << mAvailVirtualMemInKB << llcallstacksendl ; @@ -1252,7 +1252,7 @@ bool LLAppViewer::mainLoop() llinfos << "Availabe physical memory(KB) at the beginning of the frame: " << mAvailPhysicalMemInKB << llendl ; llinfos << "Availabe virtual memory(KB) at the beginning of the frame: " << mAvailVirtualMemInKB << llendl ; - gSysMemory.getAvailableMemoryKB(mAvailPhysicalMemInKB, mAvailVirtualMemInKB) ; + LLMemoryInfo::getAvailableMemoryKB(mAvailPhysicalMemInKB, mAvailVirtualMemInKB) ; llinfos << "Current availabe physical memory(KB): " << mAvailPhysicalMemInKB << llendl ; llinfos << "Current availabe virtual memory(KB): " << mAvailVirtualMemInKB << llendl ; -- cgit v1.2.3 From ea7420a7b3e1f68b8eb78a6e8ebd13683f7716b9 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Tue, 19 Oct 2010 20:59:08 +0300 Subject: STORM-293 FIXED Friend permissions icons overlap long names on 'My Friends' tab - Added 'avatar name right padding' as parameter to avatar_list_item. Before it was calculated and correctness of calculation was strongly dependent on right positioning elements in XML, which was prone to errors. --- indra/newview/llavatarlistitem.cpp | 11 +++++++---- indra/newview/llavatarlistitem.h | 4 +++- .../newview/skins/default/xui/en/widgets/avatar_list_item.xml | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'indra') 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().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 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/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 @@ Date: Wed, 20 Oct 2010 19:24:32 +0300 Subject: STORM-311 FIXED "Share" button in My Inventory SP was not updated on Current Outfit changes. When you wear an inventory item, the code that disables/enables the button was called as soon as the item got linked to COF, before it actually appeared on your avatar. However to determine whether to enable the button, the code checked avatar appearence. I fixed it to take the COF link into account, i.e. to treat items linked to COF as worn (=not shareable), no matter has appearance been updated or not. --- indra/newview/llgiveinventory.cpp | 4 ++-- indra/newview/llinventoryfunctions.cpp | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'indra') 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/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: -- cgit v1.2.3 From 0d456a1ae7d523a3253a98212c420bd60c4a1f16 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Thu, 21 Oct 2010 20:57:43 +0300 Subject: STORM-224 FIXED Changed label "Fabric" to read "Texture" in wearable editing panels. --- indra/newview/skins/default/xui/en/panel_edit_gloves.xml | 2 +- indra/newview/skins/default/xui/en/panel_edit_jacket.xml | 4 ++-- indra/newview/skins/default/xui/en/panel_edit_pants.xml | 2 +- indra/newview/skins/default/xui/en/panel_edit_shirt.xml | 2 +- indra/newview/skins/default/xui/en/panel_edit_shoes.xml | 2 +- indra/newview/skins/default/xui/en/panel_edit_skirt.xml | 2 +- indra/newview/skins/default/xui/en/panel_edit_socks.xml | 2 +- indra/newview/skins/default/xui/en/panel_edit_underpants.xml | 2 +- indra/newview/skins/default/xui/en/panel_edit_undershirt.xml | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) (limited to 'indra') 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_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" -- cgit v1.2.3 From d4018e22446904f25ec1363717df86ba7e48bbdf Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 21 Oct 2010 14:37:51 -0400 Subject: Manual fix for merge compile errors. --- indra/newview/llcallfloater.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 6f8f0381f1..b2e9564f7d 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -45,6 +45,7 @@ #include "llspeakers.h" #include "lltextutil.h" #include "lltransientfloatermgr.h" +#include "llviewercontrol.h" #include "llviewerdisplayname.h" #include "llviewerwindow.h" #include "llvoicechannel.h" -- cgit v1.2.3 From e316654bffb552f92320c1e32aed25e0997e12c4 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 22 Oct 2010 16:04:00 -0500 Subject: Disable FBO by default for all settings. --- indra/newview/featuretable.txt | 6 +++--- indra/newview/featuretable_xp.txt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index b09dd699ba..d69842d5f1 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -1,4 +1,4 @@ -version 23 +version 25 // NOTE: This is mostly identical to featuretable_mac.txt with a few differences // Should be combined into one table @@ -144,7 +144,7 @@ WLSkyDetail 1 48 RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderShadowDetail 1 0 -RenderUseFBO 1 1 +RenderUseFBO 1 0 // // Ultra graphics (REALLY PURTY!) @@ -171,7 +171,7 @@ WLSkyDetail 1 128 RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderShadowDetail 1 0 -RenderUseFBO 1 1 +RenderUseFBO 1 0 // // Class Unknown Hardware (unknown) diff --git a/indra/newview/featuretable_xp.txt b/indra/newview/featuretable_xp.txt index 1e83bc73a5..dae7705971 100644 --- a/indra/newview/featuretable_xp.txt +++ b/indra/newview/featuretable_xp.txt @@ -1,4 +1,4 @@ -version 23 +version 25 // NOTE: This is mostly identical to featuretable_mac.txt with a few differences // Should be combined into one table @@ -144,7 +144,7 @@ WLSkyDetail 1 48 RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderShadowDetail 1 0 -RenderUseFBO 1 1 +RenderUseFBO 1 0 // // Ultra graphics (REALLY PURTY!) @@ -171,7 +171,7 @@ WLSkyDetail 1 128 RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderShadowDetail 1 0 -RenderUseFBO 1 1 +RenderUseFBO 1 0 // // Class Unknown Hardware (unknown) -- cgit v1.2.3 From 40e9566d98452d9a48f6bdb01c407fb2b231a816 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 22 Oct 2010 16:49:32 -0500 Subject: Non-FBO driven fix for anti-aliasing (make applying of FSAA require restart when FBO is disabled). --- indra/newview/llfloaterhardwaresettings.cpp | 7 +++++-- indra/newview/llviewerwindow.cpp | 2 +- indra/newview/pipeline.cpp | 2 +- .../skins/default/xui/en/floater_hardware_settings.xml | 14 +++++++++++++- 4 files changed, 20 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index 3cd3c74ee4..e562b00a04 100644 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -104,6 +104,8 @@ void LLFloaterHardwareSettings::refreshEnabledState() getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders()); getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders()); getChildView("fsaa")->setEnabled(gPipeline.canUseAntiAliasing()); + getChildView("antialiasing restart")->setVisible(!gSavedSettings.getBOOL("RenderUseFBO")); + /* Enable to reset fsaa value to disabled when feature is not available. if (!gPipeline.canUseAntiAliasing()) { @@ -130,7 +132,8 @@ BOOL LLFloaterHardwareSettings::postBuild() void LLFloaterHardwareSettings::apply() { // Anisotropic rendering - BOOL old_anisotropic = LLImageGL::sGlobalUseAnisotropic; + //Do nothing here -- this code is unreliable, and UI now tells users to restart for changes to take affect + /*BOOL old_anisotropic = LLImageGL::sGlobalUseAnisotropic; LLImageGL::sGlobalUseAnisotropic = getChild("ani")->getValue(); U32 fsaa = (U32) getChild("fsaa")->getValue().asInteger(); @@ -151,7 +154,7 @@ void LLFloaterHardwareSettings::apply() else if (old_anisotropic != LLImageGL::sGlobalUseAnisotropic) { gViewerWindow->restartDisplay(logged_in); - } + }*/ refresh(); } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 2e04463964..17db21836a 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1360,7 +1360,7 @@ LLViewerWindow::LLViewerWindow( gSavedSettings.getBOOL("DisableVerticalSync"), !gNoRender, ignore_pixel_depth, - 0); //gSavedSettings.getU32("RenderFSAASamples")); + gSavedSettings.getBOOL("RenderUseFBO") ? 0 : gSavedSettings.getU32("RenderFSAASamples")); //don't use window level anti-aliasing if FBOs are enabled if (!LLAppViewer::instance()->restoreErrorTrap()) { diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 0c5735cdfc..0782f072dd 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -874,7 +874,7 @@ BOOL LLPipeline::canUseWindLightShadersOnObjects() const BOOL LLPipeline::canUseAntiAliasing() const { - return (gSavedSettings.getBOOL("RenderUseFBO")); + return TRUE; //(gSavedSettings.getBOOL("RenderUseFBO")); } void LLPipeline::unloadShaders() diff --git a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml index 27f8b4bb39..b2c620f435 100644 --- a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml @@ -22,7 +22,7 @@ + + (requires viewer restart) + Date: Thu, 21 Oct 2010 14:24:03 -0500 Subject: Fix for crash when toggling anisotropic filtering. --- indra/llrender/llimagegl.h | 1 + indra/newview/llfloaterhardwaresettings.cpp | 25 ------------------------- indra/newview/llviewercontrol.cpp | 8 ++++++++ 3 files changed, 9 insertions(+), 25 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index 87a835cdcc..6c980984c0 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -64,6 +64,7 @@ public: // Save off / restore GL textures static void destroyGL(BOOL save_state = TRUE); static void restoreGL(); + static void dirtyTexOptions(); // Sometimes called externally for textures not using LLImageGL (should go away...) static S32 updateBoundTexMem(const S32 mem, const S32 ncomponents, S32 category) ; diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index e562b00a04..1e91710552 100644 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -131,31 +131,6 @@ BOOL LLFloaterHardwareSettings::postBuild() void LLFloaterHardwareSettings::apply() { - // Anisotropic rendering - //Do nothing here -- this code is unreliable, and UI now tells users to restart for changes to take affect - /*BOOL old_anisotropic = LLImageGL::sGlobalUseAnisotropic; - LLImageGL::sGlobalUseAnisotropic = getChild("ani")->getValue(); - - U32 fsaa = (U32) getChild("fsaa")->getValue().asInteger(); - U32 old_fsaa = gSavedSettings.getU32("RenderFSAASamples"); - - BOOL logged_in = (LLStartUp::getStartupState() >= STATE_STARTED); - - if (old_fsaa != fsaa) - { - gSavedSettings.setU32("RenderFSAASamples", fsaa); - LLWindow* window = gViewerWindow->getWindow(); - LLCoordScreen size; - window->getSize(&size); - gViewerWindow->changeDisplaySettings(size, - gSavedSettings.getBOOL("DisableVerticalSync"), - logged_in); - } - else if (old_anisotropic != LLImageGL::sGlobalUseAnisotropic) - { - gViewerWindow->restartDisplay(logged_in); - }*/ - refresh(); } diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 522b5a7dfa..fbec2a7b9e 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -131,6 +131,13 @@ static bool handleReleaseGLBufferChanged(const LLSD& newvalue) return true; } +static bool handleAnisotropicChanged(const LLSD& newvalue) +{ + LLImageGL::sGlobalUseAnisotropic = newvalue.asBoolean(); + LLImageGL::dirtyTexOptions(); + return true; +} + static bool handleVolumeLODChanged(const LLSD& newvalue) { LLVOVolume::sLODFactor = (F32) newvalue.asReal(); @@ -498,6 +505,7 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderSpecularResY")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderSpecularExponent")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderFSAASamples")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); + gSavedSettings.getControl("RenderAnisotropic")->getSignal()->connect(boost::bind(&handleAnisotropicChanged, _2)); gSavedSettings.getControl("RenderShadowResolutionScale")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); -- cgit v1.2.3 From b3c06e6a740b10fe99cc95eab4f026f5db59cf92 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 21 Oct 2010 14:24:49 -0500 Subject: Fix for crash when toggling anisotropic filtering. --- indra/llrender/llimagegl.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra') diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 9d0fc53d29..65940cb067 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -368,6 +368,18 @@ void LLImageGL::restoreGL() } } +//static +void LLImageGL::dirtyTexOptions() +{ + for (std::set::iterator iter = sImageList.begin(); + iter != sImageList.end(); iter++) + { + LLImageGL* glimage = *iter; + glimage->mTexOptionsDirty = true; + stop_glerror(); + } + +} //---------------------------------------------------------------------------- //for server side use only. -- cgit v1.2.3 From af57ff75dea16ed857c27ebfa288b9881668e9ac Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 22 Oct 2010 17:16:44 -0500 Subject: Anisotropic filtering does NOT require a viewer restart. --- indra/newview/skins/default/xui/en/floater_hardware_settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml index b2c620f435..0ea42f9757 100644 --- a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml @@ -22,7 +22,7 @@ Date: Fri, 22 Oct 2010 17:06:18 -0700 Subject: STORM-454 : fix height in world map, allow altitude till 4096m, display altitude on 4 digits --- indra/newview/llfloaterworldmap.cpp | 2 +- indra/newview/skins/default/xui/en/floater_world_map.xml | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'indra') 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/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml index 20629018e2..34c091b0da 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" > @@ -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="56" > -- cgit v1.2.3 From 6da1e54e6a8b66a2cad7c8c89de279ca5b9ac7dd Mon Sep 17 00:00:00 2001 From: Wolfpup Lowenhar Date: Mon, 25 Oct 2010 11:43:50 -0400 Subject: Inverting settings and test so that telling other how to turn off the messages popping is easier as per discussion with Oz and Boroondas also correcting some minor spelling issues --- indra/newview/app_settings/settings.xml | 12 ++++++------ indra/newview/llimview.cpp | 4 ++-- .../skins/default/xui/en/panel_preferences_chat.xml | 14 +++++++------- 3 files changed, 15 insertions(+), 15 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 3015dc523a..8ec812d59e 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2567,27 +2567,27 @@ Value 1 - DisableGroupToast + EnableGroupToast Comment - Disable Incoming Group Toasts + Enable Incoming Group Toasts Persist 1 Type Boolean Value - 0 + 1 - DisableIMToast + EnableIMToast Comment - Disable Incoming IM Toasts + Enable Incoming IM Toasts Persist 1 Type Boolean Value - 0 + 1 DisplayAvatarAgentTarget diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 410a20ffd0..79d524006d 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -134,12 +134,12 @@ void toast_callback(const LLSD& msg){ // *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("DisableGroupToast") + if (!gSavedSettings.getBOOL("EnableGroupToast") && session->isGroupSessionType()) { return; } - if (gSavedSettings.getBOOL("DisableIMToast") + if (!gSavedSettings.getBOOL("EnableIMToast") && !session->isGroupSessionType()) { return; 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 e36415832c..77f3405ed9 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -394,27 +394,27 @@ left="280" height="10" width="180"> - Disable incoming notifications: + Enable Incoming Messages: Date: Mon, 25 Oct 2010 18:56:04 +0300 Subject: STORM-95 FIXED Fixed hanging of client when incorrect WAV file was passed. As Aimee has found: "The data chunk of nexfire.wav has an incorrect length specified in its header which we blindly trust when reading the file in check_for_invalid_wav_formats() in llvorbisencode.cpp. It causes an overflow of the file position pointer when reading the file which makes it start over from the beginning, hanging it in an infinite loop." - To avoid this situation in future, check for chunk size was added, and if it is declared bigger then it may be, function is interrupted and returns error. --- indra/llaudio/llvorbisencode.cpp | 7 +++++++ indra/llaudio/llvorbisencode.h | 1 + indra/newview/skins/default/xui/en/notifications.xml | 8 ++++++++ 3 files changed, 16 insertions(+) (limited to 'indra') 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/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 @@ -1365,6 +1365,14 @@ Could not find 'data' chunk in WAV header: [FILE] + +Wrong chunk size in WAV file: +[FILE] + + Date: Tue, 26 Oct 2010 09:32:56 -0400 Subject: Correction to pannel_preferences_chat.xml os it reads 'IM chat' instead of Im chat' --- indra/newview/skins/default/xui/en/panel_preferences_chat.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') 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 77f3405ed9..45d7633f73 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -409,7 +409,7 @@ Date: Tue, 26 Oct 2010 18:15:30 +0300 Subject: STORM-36 FIXED As a User, I want to control how long a chat toast appears before it fades. Please add fade time back to Chat preferences. - Added two spinners to the Chat preferences tab that control NearbyToastLifeTime and NearbyToastFadingTime - Added callbacks to the LLNearbyChatScreenChannel that update these properties if they were changed Refactoring of LLToast: - Removed code that was making toast transparent from LLToast::draw() - Modified LLToast interface that relates to showing and hiding toast, so that all screen channels can use LLToast universally. - Replaced in LLScreenChannel calling methods of old interface to new ones. --- indra/newview/llnearbychathandler.cpp | 58 +++++++++-- indra/newview/llscreenchannel.cpp | 8 +- indra/newview/lltoast.cpp | 110 ++++++++++++++++++--- indra/newview/lltoast.h | 35 ++++--- .../default/xui/en/panel_preferences_chat.xml | 34 ++++++- 5 files changed, 210 insertions(+), 35 deletions(-) (limited to 'indra') 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 first, LLHandle 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/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/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 notif_id, //notification ID session_id; //im session ID Optional notification; - Optional 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 lifetime_secs, // Number of seconds while a toast is non-transparent + fading_time_secs; // Number of seconds while a toast is transparent + + Optional on_delete_toast, on_mouse_enter; Optional 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/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml index 31e160ec33..c009fd2931 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 + + Date: Tue, 26 Oct 2010 19:20:09 +0300 Subject: STORM-354 FIXED [TRUNCATION] many langs - build tools "Click to:" combobox - Increased width of label and decreased width of checkbox in EN locale - Removed overrides of width dimensions in EN, ES, NL, FR locales --- indra/newview/skins/default/xui/en/floater_tools.xml | 4 ++-- indra/newview/skins/default/xui/es/floater_tools.xml | 4 ++-- indra/newview/skins/default/xui/fr/floater_tools.xml | 2 +- indra/newview/skins/default/xui/nl/floater_tools.xml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 4c508035be..e25cef1ef7 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -965,7 +965,7 @@ top_pad="10" left="10" name="label click action" - width="98"> + width="118"> Click to: @@ -98,6 +99,7 @@ + @@ -118,6 +120,7 @@ + @@ -264,7 +267,7 @@ - + @@ -276,6 +279,7 @@ + diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml index 6379722553..286af718e3 100644 --- a/indra/newview/skins/default/xui/es/notifications.xml +++ b/indra/newview/skins/default/xui/es/notifications.xml @@ -110,7 +110,7 @@ Asegúrate de que tu conexión a Internet está funcionando adecuadamente. Al conceder permisos de modificación a otro Residente, le estás permitiendo cambiar, borrar o tomar CUALQUIER objeto que tengas en el mundo. Sé MUY cuidadoso al conceder este permiso. -¿Quieres conceder permisos de modificación a [FIRST_NAME] [LAST_NAME]? +¿Quieres conceder permisos de modificación a [NAME]? @@ -119,7 +119,7 @@ Asegúrate de que tu conexión a Internet está funcionando adecuadamente. - ¿Quieres revocar los derechos de modificación a [FIRST_NAME] [LAST_NAME]? + ¿Quieres retirar los permisos de modificación a [NAME]? @@ -314,17 +314,17 @@ Se ha superado el límite máximo de [MAX_ATTACHMENTS] objetos. Por favor, quít No puedes vestirte este ítem porque aún no se ha cargado. Por favor, inténtalo de nuevo en un minuto. - ¡Vaya! Algo se quedó en blanco. -Debes escribir tanto el nombre como el apellido de tu avatar, los dos. + Lo sentimos. Se ha quedado algún espacio en blanco. +Tienes que volver a introducir el nombre de usuario de tu avatar. -Necesitas una cuenta para entrar en [SECOND_LIFE]. ¿Quieres crear una ahora? +Necesitas una cuenta para acceder a [SECOND_LIFE]. ¿Te gustaría crear una ahora? https://join.secondlife.com/index.php?lang=es-ES - Escribe el nombre y apellido de tu avatar en el campo Nombre de usuario e inicia sesión otra vez. + Escribe el nombre de usuario o el nombre y el apellido de tu avatar en el campo Nombre de usuario e inicia sesión otra vez. Los anuncios clasificados aparecen durante una semana en la sección 'Clasificados' de la búsqueda y en [http://secondlife.com/community/classifieds secondlife.com]. @@ -921,12 +921,6 @@ Generalmente, esto es un fallo pasajero. Por favor, personaliza y guarda el íte No se ha podido comprar terreno para el grupo: no tienes el permiso de comprar terreno para el grupo que tienes activado actualmente. - - Los amigos pueden darse permiso para localizarse en el mapa y para saber si el otro está conectado. - -¿Ofrecer a [NAME] que sea tu amigo? - - Los amigos pueden darse permiso para localizarse en el mapa y para saber si el otro está conectado. @@ -970,7 +964,7 @@ no tienes el permiso de comprar terreno para el grupo que tienes activado actual - ¿Quieres quitar a [FIRST_NAME] [LAST_NAME] de tu lista de amigos? + ¿Quieres eliminar a [NAME] de tu lista de amigos? @@ -1093,12 +1087,11 @@ Si se vende una parcela transferida, el precio de venta se dividirá a partes ig - Al transferir esta parcela, se requerirá al grupo que tenga y mantenga el crédito suficiente para uso de terreno. -La tranferencia incluirá, a la vez, una contribucíon de terreno al grupo de '[FIRST_NAME] [LAST_NAME]'. -El precio de compra de la parcela no se reembolsa al propietario. -Si se vende una parcela transferida, el precio de venta se dividirá a partes iguales entre los miembros del grupo. + Al transferir esta parcela, el grupo deberá poseer y mantener el número suficiente de créditos de uso de terreno. +El traspaso incluirá una contribución simultánea de terreno al grupo de "[NAME]". +El precio de compra del terreno no se le devolverá al propietario. Si se vende una parcela transferida, el precio de venta se dividirá en partes iguales entre los miembros del grupo. -¿Transferir estos [AREA] m² de terreno al grupo '[GROUP_NAME]'? +¿Transferir este terreno de [AREA] m² al grupo '[GROUP_NAME]'? @@ -1471,6 +1464,46 @@ Se ocultará el chat y los mensajes instantáneos (éstos recibirán tu Respue