From 505ed20da32df3ab96f8b199e30be3c50e88a1e2 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 16 Apr 2024 02:28:25 +0300 Subject: viewer#1216 Library settings can be deleted via My Environments --- indra/newview/llfloatermyenvironment.cpp | 33 +++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfloatermyenvironment.cpp b/indra/newview/llfloatermyenvironment.cpp index bc12a5707c..9f42655c83 100644 --- a/indra/newview/llfloatermyenvironment.cpp +++ b/indra/newview/llfloatermyenvironment.cpp @@ -399,6 +399,30 @@ bool LLFloaterMyEnvironment::canApply(const std::string &context) return false; } +bool can_delete(const LLUUID& id) +{ + const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); + if (id == trash_id || gInventory.isObjectDescendentOf(id, trash_id)) + { + return false; + } + + LLViewerInventoryCategory* cat = gInventory.getCategory(id); + if (cat) + { + if (!get_is_category_removable(&gInventory, id)) + { + return false; + } + } + else if (!get_is_item_removable(&gInventory, id)) + { + return false; + } + + return true; +} + //------------------------------------------------------------------------- void LLFloaterMyEnvironment::refreshButtonStates() { @@ -409,7 +433,14 @@ void LLFloaterMyEnvironment::refreshButtonStates() getChild(BUTTON_GEAR)->setEnabled(settings_ok); getChild(BUTTON_NEWSETTINGS)->setEnabled(true); - getChild(BUTTON_DELETE)->setEnabled(settings_ok && !selected.empty()); + + bool enable_delete = false; + if(settings_ok && !selected.empty()) + { + enable_delete = can_delete(selected.front()); + } + + getChild(BUTTON_DELETE)->setEnabled(enable_delete); } //------------------------------------------------------------------------- -- cgit v1.2.3 From 21947778baaca205615a71a97ac8f563c998fdd3 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 16 Apr 2024 23:25:01 +0300 Subject: SL-18721 Window shutdown adjustments On viewer shutdown 1. Instead of handling potential WM_* messages viewer is no longer equiped to handle drop window's pointer and expect only WM_DESTROY 2. Detach thread and let it do its own thing, thread will delete itself 3. Reverts commit 1161262029f9619fb02d81575382b64d82d9cd09 Reason for the change: window was closing too early (as son as "LLApp" status changes) without proper cleanup --- indra/llcommon/threadpool.h | 2 +- indra/llwindow/llwindowwin32.cpp | 102 ++++++++++++++------------------------- 2 files changed, 37 insertions(+), 67 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/threadpool.h b/indra/llcommon/threadpool.h index 74056aea17..b8be7bb81a 100644 --- a/indra/llcommon/threadpool.h +++ b/indra/llcommon/threadpool.h @@ -55,7 +55,7 @@ namespace LL * ThreadPool listens for application shutdown messages on the "LLApp" * LLEventPump. Call close() to shut down this ThreadPool early. */ - virtual void close(); + void close(); std::string getName() const { return mName; } size_t getWidth() const { return mThreads.size(); } diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 54e5f43e87..3ffc7d3354 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -351,10 +351,9 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool LLWindowWin32Thread(); void run() override; - void close() override; // closes queue, wakes thread, waits until thread closes - void wakeAndDestroy(); + bool wakeAndDestroy(); void glReady() { @@ -425,6 +424,7 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool // *HACK: Attempt to prevent startup crashes by deferring memory accounting // until after some graphics setup. See SL-20177. -Cosmic,2023-09-18 bool mGLReady = false; + bool mDeleteOnExit = false; // best guess at available video memory in MB std::atomic mAvailableVRAM; @@ -997,7 +997,11 @@ void LLWindowWin32::close() mhDC = NULL; mWindowHandle = NULL; - mWindowThread->wakeAndDestroy(); + if (mWindowThread->wakeAndDestroy()) + { + // thread will delete itselfs once done + mWindowThread = NULL; + } } BOOL LLWindowWin32::isValid() @@ -3104,10 +3108,17 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ break; } } - else + else // (NULL == window_imp) { - // (NULL == window_imp) - LL_DEBUGS("Window") << "No window implementation to handle message with, message code: " << U32(u_msg) << LL_ENDL; + if (u_msg == WM_DESTROY) + { + PostQuitMessage(0); // Posts WM_QUIT with an exit code of 0 + return 0; + } + else + { + LL_DEBUGS("Window") << "No window implementation to handle message with, message code: " << U32(u_msg) << LL_ENDL; + } } // pass unhandled messages down to Windows @@ -4563,25 +4574,11 @@ U32 LLWindowWin32::getAvailableVRAMMegabytes() #endif // LL_WINDOWS inline LLWindowWin32::LLWindowWin32Thread::LLWindowWin32Thread() - : LL::ThreadPool("Window Thread", 1, MAX_QUEUE_SIZE, true /*should be false, temporary workaround for SL-18721*/) + : LL::ThreadPool("Window Thread", 1, MAX_QUEUE_SIZE, false) { LL::ThreadPool::start(); } -void LLWindowWin32::LLWindowWin32Thread::close() -{ - if (!mQueue->isClosed()) - { - LL_WARNS() << "Closing window thread without using destroy_window_handler" << LL_ENDL; - LL::ThreadPool::close(); - - // Workaround for SL-18721 in case window closes too early and abruptly - LLSplashScreen::show(); - LLSplashScreen::update("..."); // will be updated later - } -} - - /** * LogChange is to log changes in status while trying to avoid spamming the * log with repeated messages, especially in a tight loop. It refuses to log @@ -4926,14 +4923,19 @@ void LLWindowWin32::LLWindowWin32Thread::run() } cleanupDX(); + + if (mDeleteOnExit) + { + delete this; + } } -void LLWindowWin32::LLWindowWin32Thread::wakeAndDestroy() +bool LLWindowWin32::LLWindowWin32Thread::wakeAndDestroy() { if (mQueue->isClosed()) { - LL_WARNS() << "Tried to close Queue. Win32 thread Queue already closed." << LL_ENDL; - return; + LL_WARNS() << "Tried to close Queue. Win32 thread Queue already closed." <close(); @@ -4986,49 +4997,8 @@ void LLWindowWin32::LLWindowWin32Thread::wakeAndDestroy() PostMessage(old_handle, WM_DUMMY_, wparam, 0x1337); } - // There are cases where window will refuse to close, - // can't wait forever on join, check state instead - LLTimer timeout; - timeout.setTimerExpirySec(2.0); - while (!getQueue().done() && !timeout.hasExpired() && mWindowHandleThrd) - { - ms_sleep(100); - } - - if (getQueue().done() || mWindowHandleThrd == NULL) - { - // Window is closed, started closing or is cleaning up - // now wait for our single thread to die. - if (mWindowHandleThrd) - { - LL_INFOS("Window") << "Window is closing, waiting on pool's thread to join, time since post: " << timeout.getElapsedSeconds() << "s" << LL_ENDL; - } - else - { - LL_DEBUGS("Window") << "Waiting on pool's thread, time since post: " << timeout.getElapsedSeconds() << "s" << LL_ENDL; - } - for (auto& pair : mThreads) - { - pair.second.join(); - } - } - else - { - // Something suspended window thread, can't afford to wait forever - // so kill thread instead - // Ex: This can happen if user starts dragging window arround (if it - // was visible) or a modal notification pops up - LL_WARNS("Window") << "Window is frozen, couldn't perform clean exit" << LL_ENDL; - - for (auto& pair : mThreads) - { - // very unsafe - TerminateThread(pair.second.native_handle(), 0); - pair.second.detach(); - cleanupDX(); - } - } LL_DEBUGS("Window") << "thread pool shutdown complete" << LL_ENDL; + return true; } void LLWindowWin32::post(const std::function& func) -- cgit v1.2.3 From 3758618949684641fc94b5c9478d9002706213cc Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 17 Apr 2024 02:49:18 +0300 Subject: viewer#1260 Fix thumbnail preview being blury 1. Switched 'inspect' to thumbnails to minimalize differences 2. Reporting larger area to bump priority 3. Change scaling behavior. Old mechanics worked fine for icons that were scaled down from large images to ~32, but for thumbnails it can result in 256 image scaling down to ~200 before being scaled up to UI's scale (scale factor), causing extra loss of quality. --- indra/newview/llinspecttexture.cpp | 41 +++++++++++++++++--------------------- indra/newview/llthumbnailctrl.cpp | 12 +++++------ indra/newview/llviewertexture.cpp | 30 ++++++++++------------------ 3 files changed, 34 insertions(+), 49 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinspecttexture.cpp b/indra/newview/llinspecttexture.cpp index da4e3c0949..a8c638aa68 100644 --- a/indra/newview/llinspecttexture.cpp +++ b/indra/newview/llinspecttexture.cpp @@ -112,7 +112,6 @@ public: protected: LLPointer m_Image; - S32 mImageBoostLevel = LLGLTexture::BOOST_NONE; std::string mLoadingText; }; @@ -125,11 +124,7 @@ LLTexturePreviewView::LLTexturePreviewView(const LLView::Params& p) LLTexturePreviewView::~LLTexturePreviewView() { - if (m_Image) - { - m_Image->setBoostLevel(mImageBoostLevel); - m_Image = nullptr; - } + m_Image = nullptr; } void LLTexturePreviewView::draw() @@ -150,33 +145,33 @@ void LLTexturePreviewView::draw() bool isLoading = (!m_Image->isFullyLoaded()) && (m_Image->getDiscardLevel() > 0); if (isLoading) LLFontGL::getFontSansSerif()->renderUTF8(mLoadingText, 0, llfloor(rctClient.mLeft + 3), llfloor(rctClient.mTop - 25), LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::DROP_SHADOW); - m_Image->addTextureStats((isLoading) ? MAX_IMAGE_AREA : (F32)(rctClient.getWidth() * rctClient.getHeight())); + + m_Image->setKnownDrawSize(MAX_IMAGE_SIZE, MAX_IMAGE_SIZE); } } void LLTexturePreviewView::setImageFromAssetId(const LLUUID& idAsset) { - m_Image = LLViewerTextureManager::getFetchedTexture(idAsset, FTT_DEFAULT, MIPMAP_TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); - if (m_Image) - { - mImageBoostLevel = m_Image->getBoostLevel(); - m_Image->setBoostLevel(LLGLTexture::BOOST_PREVIEW); - m_Image->forceToSaveRawImage(0); - if ( (!m_Image->isFullyLoaded()) && (!m_Image->hasFetcher()) ) - { - if (m_Image->isInFastCacheList()) - { - m_Image->loadFromFastCache(); - } - gTextureList.forceImmediateUpdate(m_Image); - } - } + m_Image = LLViewerTextureManager::getFetchedTexture(idAsset, FTT_DEFAULT, MIPMAP_TRUE, LLGLTexture::BOOST_THUMBNAIL); + if (m_Image) + { + m_Image->forceToSaveRawImage(0); + m_Image->setKnownDrawSize(MAX_IMAGE_SIZE, MAX_IMAGE_SIZE); + if ((!m_Image->isFullyLoaded()) && (!m_Image->hasFetcher())) + { + if (m_Image->isInFastCacheList()) + { + m_Image->loadFromFastCache(); + } + gTextureList.forceImmediateUpdate(m_Image); + } + } } void LLTexturePreviewView::setImageFromItemId(const LLUUID& idItem) { const LLViewerInventoryItem* pItem = gInventory.getItem(idItem); - setImageFromAssetId( (pItem) ? pItem->getAssetUUID() : LLUUID::null ); + setImageFromAssetId( (pItem) ? pItem->getAssetUUID() : LLUUID::null); } // ============================================================================ diff --git a/indra/newview/llthumbnailctrl.cpp b/indra/newview/llthumbnailctrl.cpp index b558c249cb..1cabb62f77 100644 --- a/indra/newview/llthumbnailctrl.cpp +++ b/indra/newview/llthumbnailctrl.cpp @@ -110,8 +110,10 @@ void LLThumbnailCtrl::draw() } gl_draw_scaled_image( draw_rect.mLeft, draw_rect.mBottom, draw_rect.getWidth(), draw_rect.getHeight(), mTexturep, UI_VERTEX_COLOR % alpha); - - mTexturep->setKnownDrawSize(draw_rect.getWidth(), draw_rect.getHeight()); + + // Thumbnails are usually 256x256 or smaller, either report that or + // some high value to get image with higher priority + mTexturep->setKnownDrawSize(MAX_IMAGE_SIZE, MAX_IMAGE_SIZE); } else if( mImagep.notNull() ) { @@ -238,12 +240,8 @@ void LLThumbnailCtrl::initImage() { // Should it support baked textures? mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, MIPMAP_YES, LLGLTexture::BOOST_THUMBNAIL); - mTexturep->forceToSaveRawImage(0); - - S32 desired_draw_width = MAX_IMAGE_SIZE; - S32 desired_draw_height = MAX_IMAGE_SIZE; - mTexturep->setKnownDrawSize(desired_draw_width, desired_draw_height); + mTexturep->setKnownDrawSize(MAX_IMAGE_SIZE, MAX_IMAGE_SIZE); } } else if (tvalue.isString()) diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 04ef441a69..648bdf7bee 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1193,12 +1193,11 @@ void LLViewerFetchedTexture::loadFromFastCache() if (mBoostLevel == LLGLTexture::BOOST_THUMBNAIL) { - S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_THUMBNAIL_DIMENSIONS; - S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_THUMBNAIL_DIMENSIONS; - if (mRawImage && (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height)) + if (mRawImage && (mRawImage->getWidth() > DEFAULT_THUMBNAIL_DIMENSIONS || mRawImage->getHeight() > DEFAULT_THUMBNAIL_DIMENSIONS)) { - // scale oversized icon, no need to give more work to gl - mRawImage->scale(expected_width, expected_height); + // Scale oversized thumbnail + // thumbnails aren't supposed to go over DEFAULT_THUMBNAIL_DIMENSIONS + mRawImage->scale(DEFAULT_THUMBNAIL_DIMENSIONS, DEFAULT_THUMBNAIL_DIMENSIONS); } } @@ -1941,13 +1940,10 @@ bool LLViewerFetchedTexture::updateFetch() if (mBoostLevel == LLGLTexture::BOOST_THUMBNAIL) { - S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_THUMBNAIL_DIMENSIONS; - S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_THUMBNAIL_DIMENSIONS; - if (mRawImage && (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height)) + if (mRawImage && (mRawImage->getWidth() > DEFAULT_THUMBNAIL_DIMENSIONS || mRawImage->getHeight() > DEFAULT_THUMBNAIL_DIMENSIONS)) { - // scale oversized icon, no need to give more work to gl - // since we got mRawImage from thread worker and image may be in use (ex: writing cache), make a copy - mRawImage = mRawImage->scaled(expected_width, expected_height); + // Scale oversized thumbnail + mRawImage = mRawImage->scaled(DEFAULT_THUMBNAIL_DIMENSIONS, DEFAULT_THUMBNAIL_DIMENSIONS); } } @@ -2797,11 +2793,9 @@ void LLViewerFetchedTexture::setCachedRawImage(S32 discard_level, LLImageRaw* im } else if (mBoostLevel == LLGLTexture::BOOST_THUMBNAIL) { - S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_THUMBNAIL_DIMENSIONS; - S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_THUMBNAIL_DIMENSIONS; - if (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height) + if (mRawImage->getWidth() > DEFAULT_THUMBNAIL_DIMENSIONS || mRawImage->getHeight() > DEFAULT_THUMBNAIL_DIMENSIONS) { - mCachedRawImage = new LLImageRaw(expected_width, expected_height, imageraw->getComponents()); + mCachedRawImage = new LLImageRaw(DEFAULT_THUMBNAIL_DIMENSIONS, DEFAULT_THUMBNAIL_DIMENSIONS, imageraw->getComponents()); mCachedRawImage->copyScaled(imageraw); } else @@ -2919,11 +2913,9 @@ void LLViewerFetchedTexture::saveRawImage() } else if (mBoostLevel == LLGLTexture::BOOST_THUMBNAIL) { - S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_THUMBNAIL_DIMENSIONS; - S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_THUMBNAIL_DIMENSIONS; - if (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height) + if (mRawImage->getWidth() > DEFAULT_THUMBNAIL_DIMENSIONS || mRawImage->getHeight() > DEFAULT_THUMBNAIL_DIMENSIONS) { - mSavedRawImage = new LLImageRaw(expected_width, expected_height, mRawImage->getComponents()); + mSavedRawImage = new LLImageRaw(DEFAULT_THUMBNAIL_DIMENSIONS, DEFAULT_THUMBNAIL_DIMENSIONS, mRawImage->getComponents()); mSavedRawImage->copyScaled(mRawImage); } else -- cgit v1.2.3 From f660f1f0fda4d2363d351fa550b4f8818b46c2c3 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 18 Apr 2024 02:46:18 +0300 Subject: viewer#1260 Fix thumbnail preview not loading Standard and scaled textures couldn't share workers and if one finished a request, second one failed to start a new one. --- indra/newview/lltexturefetch.cpp | 15 +++++++++------ indra/newview/lltexturefetch.h | 11 ++++++++--- indra/newview/llviewertexture.cpp | 27 ++++++++++++++++++--------- indra/newview/llviewertexture.h | 3 ++- 4 files changed, 37 insertions(+), 19 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 40bbe2b934..174af406ec 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -2509,12 +2509,13 @@ LLTextureFetch::~LLTextureFetch() } S32 LLTextureFetch::createRequest(FTType f_type, const std::string& url, const LLUUID& id, const LLHost& host, F32 priority, - S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux, bool can_use_http) + S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux, bool can_use_http, S32& worker_discard) { LL_PROFILE_ZONE_SCOPED; + worker_discard = -1; if (mDebugPause) { - return -1; + return FETCH_REQUEST_CREATION_FAILED; } if (f_type == FTT_SERVER_BAKE) @@ -2530,7 +2531,7 @@ S32 LLTextureFetch::createRequest(FTType f_type, const std::string& url, const L << host << " != " << worker->mHost << LL_ENDL; removeRequest(worker, true); worker = NULL; - return -1; + return FETCH_REQUEST_ABORTED; } } @@ -2583,13 +2584,14 @@ S32 LLTextureFetch::createRequest(FTType f_type, const std::string& url, const L { if (worker->wasAborted()) { - return -1; // need to wait for previous aborted request to complete + return FETCH_REQUEST_ABORTED; // need to wait for previous aborted request to complete } + worker_discard = desired_discard; worker->lockWorkMutex(); // +Mw if (worker->mState == LLTextureFetchWorker::DONE && worker->mDesiredSize == llmax(desired_size, TEXTURE_CACHE_ENTRY_SIZE) && worker->mDesiredDiscard == desired_discard) { worker->unlockWorkMutex(); // -Mw - return -1; // similar request has failed or is in a transitional state + return FETCH_REQUEST_EXISTS; // similar request has failed or is in a transitional state } worker->mActiveCount++; worker->mNeedsAux = needs_aux; @@ -2623,11 +2625,12 @@ S32 LLTextureFetch::createRequest(FTType f_type, const std::string& url, const L worker->mNeedsAux = needs_aux; worker->setCanUseHTTP(can_use_http) ; worker->unlockWorkMutex(); // -Mw + worker_discard = desired_discard; } LL_DEBUGS(LOG_TXT) << "REQUESTED: " << id << " f_type " << fttype_to_string(f_type) << " Discard: " << desired_discard << " size " << desired_size << LL_ENDL; - return desired_discard; + return FETCH_REQUEST_OK; } // Threads: T* // diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 9ff6468bb2..029b07af3a 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -76,9 +76,14 @@ public: // Threads: Tmain void shutDownImageDecodeThread(); - // Threads: T* (but Tmain mostly) - S32 createRequest(FTType f_type, const std::string& url, const LLUUID& id, const LLHost& host, F32 priority, - S32 w, S32 h, S32 c, S32 discard, bool needs_aux, bool can_use_http); + static constexpr S32 FETCH_REQUEST_OK = 0; + static constexpr S32 FETCH_REQUEST_CREATION_FAILED = -1; + static constexpr S32 FETCH_REQUEST_ABORTED = -2; + static constexpr S32 FETCH_REQUEST_EXISTS = -3; + // Threads: T* (but Tmain mostly) + // returns discard on success, fail code otherwise + S32 createRequest(FTType f_type, const std::string& url, const LLUUID& id, const LLHost& host, F32 priority, + S32 w, S32 h, S32 c, S32 discard, bool needs_aux, bool can_use_http, S32& worker_disacrd); // Requests that a fetch operation be deleted from the queue. // If @cancel is true, also stops any I/O operations pending. diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 648bdf7bee..be80fedd58 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1032,7 +1032,8 @@ void LLViewerFetchedTexture::init(bool firstinit) mOrigHeight = 0; mHasAux = FALSE; mNeedsAux = FALSE; - mRequestedDiscardLevel = -1; + mLastWorkerDiscardLevel = -1; + mRequestedDiscardLevel = -1; mRequestedDownloadPriority = 0.f; mFullyLoaded = FALSE; mCanUseHTTP = true; @@ -2084,18 +2085,26 @@ bool LLViewerFetchedTexture::updateFetch() } // bypass texturefetch directly by pulling from LLTextureCache - S32 fetch_request_discard = -1; - fetch_request_discard = LLAppViewer::getTextureFetch()->createRequest(mFTType, mUrl, getID(), getTargetHost(), decode_priority, - w, h, c, desired_discard, needsAux(), mCanUseHTTP); - - if (fetch_request_discard >= 0) + S32 worker_discard = -1; + S32 result = LLAppViewer::getTextureFetch()->createRequest(mFTType, mUrl, getID(), getTargetHost(), decode_priority, + w, h, c, desired_discard, needsAux(), mCanUseHTTP, worker_discard); + + + if ((result >= 0) // Worker created + // scaled and standard images share requests, they just process the result differently + // if mLastWorkerDiscardLevel doen't match worker, worker was requested by a different + // image and current one needs to schedule an update + || (result == LLTextureFetch::FETCH_REQUEST_EXISTS + && mLastWorkerDiscardLevel != worker_discard) + ) { LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - request created"); - mHasFetcher = TRUE; - mIsFetching = TRUE; + mHasFetcher = TRUE; + mIsFetching = TRUE; + mLastWorkerDiscardLevel = worker_discard; // in some cases createRequest can modify discard, as an example // bake textures are always at discard 0 - mRequestedDiscardLevel = llmin(desired_discard, fetch_request_discard); + mRequestedDiscardLevel = llmin(desired_discard, worker_discard); mFetchState = LLAppViewer::getTextureFetch()->getFetchState(mID, mDownloadProgress, mRequestedDownloadPriority, mFetchPriority, mFetchDeltaTime, mRequestDeltaTime, mCanUseHTTP); } diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 35fb0a2237..3d8c3e57af 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -452,7 +452,8 @@ protected: S32 mKnownDrawHeight; BOOL mKnownDrawSizeChanged ; std::string mUrl; - + + S32 mLastWorkerDiscardLevel; S32 mRequestedDiscardLevel; F32 mRequestedDownloadPriority; S32 mFetchState; -- cgit v1.2.3 From b1b2ae00cad6c624ae3ce45bd27bc07f48ce70dd Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Mon, 15 Apr 2024 18:39:23 +0300 Subject: Revert "SL-20140 Setting shape hand size to 36 won't save" This reverts commit 810a3d24c2e3671f926091c062b101bdec6a1517. (secondlife/jira-archive-internal#70482) --- indra/newview/character/avatar_lad.xml | 17 ++++---- indra/newview/llscrollingpanelparam.cpp | 63 ++++++++++++++++++++--------- indra/newview/llscrollingpanelparam.h | 3 ++ indra/newview/llscrollingpanelparambase.cpp | 29 +++++++------ indra/newview/llscrollingpanelparambase.h | 7 +--- 5 files changed, 72 insertions(+), 47 deletions(-) (limited to 'indra') diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index aef402d4db..2cdd86267e 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -2021,7 +2021,7 @@ value_min="-1" value_max="1"> - + - - @@ -2041,7 +2042,7 @@ name="mFaceEyeAltRight" scale="0 0 0" offset="-.005 0 0" /> - + - @@ -2061,17 +2062,17 @@ name="mFaceEyeLidUpperLeft" scale="0 0.3 0.7" offset=" 0 0 0" /> - + - + - + diff --git a/indra/newview/llscrollingpanelparam.cpp b/indra/newview/llscrollingpanelparam.cpp index efd84eaa6d..bfa453a0ae 100644 --- a/indra/newview/llscrollingpanelparam.cpp +++ b/indra/newview/llscrollingpanelparam.cpp @@ -259,15 +259,19 @@ void LLScrollingPanelParam::onHintHeldDown( LLVisualParamHint* hint ) // Make sure we're not taking the slider out of bounds // (this is where some simple UI limits are stored) - F32 new_percent = weightToSlider(new_weight); - if (mSlider->getMinValue() < new_percent - && new_percent < mSlider->getMaxValue()) + F32 new_percent = weightToPercent(new_weight); + LLSliderCtrl* slider = getChild("param slider"); + if (slider) { - mWearable->setVisualParamWeight( hint->getVisualParam()->getID(), new_weight); - mWearable->writeToAvatar(gAgentAvatarp); - gAgentAvatarp->updateVisualParams(); + if (slider->getMinValue() < new_percent + && new_percent < slider->getMaxValue()) + { + mWearable->setVisualParamWeight( hint->getVisualParam()->getID(), new_weight); + mWearable->writeToAvatar(gAgentAvatarp); + gAgentAvatarp->updateVisualParams(); - mSlider->setValue( weightToSlider( new_weight ) ); + slider->setValue( weightToPercent( new_weight ) ); + } } } } @@ -288,13 +292,17 @@ void LLScrollingPanelParam::onHintMinMouseUp( void* userdata ) F32 range = self->mHintMax->getVisualParamWeight() - self->mHintMin->getVisualParamWeight(); // step a fraction in the negative directiona F32 new_weight = current_weight - (range / 10.f); - F32 new_percent = self->weightToSlider(new_weight); - if (self->mSlider->getMinValue() < new_percent - && new_percent < self->mSlider->getMaxValue()) + F32 new_percent = self->weightToPercent(new_weight); + LLSliderCtrl* slider = self->getChild("param slider"); + if (slider) { - self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight); - self->mWearable->writeToAvatar(gAgentAvatarp); - self->mSlider->setValue( self->weightToSlider( new_weight ) ); + if (slider->getMinValue() < new_percent + && new_percent < slider->getMaxValue()) + { + self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight); + self->mWearable->writeToAvatar(gAgentAvatarp); + slider->setValue( self->weightToPercent( new_weight ) ); + } } } @@ -318,16 +326,33 @@ void LLScrollingPanelParam::onHintMaxMouseUp( void* userdata ) F32 range = self->mHintMax->getVisualParamWeight() - self->mHintMin->getVisualParamWeight(); // step a fraction in the negative direction F32 new_weight = current_weight + (range / 10.f); - F32 new_percent = self->weightToSlider(new_weight); - if (self->mSlider->getMinValue() < new_percent - && new_percent < self->mSlider->getMaxValue()) + F32 new_percent = self->weightToPercent(new_weight); + LLSliderCtrl* slider = self->getChild("param slider"); + if (slider) { - self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight); - self->mWearable->writeToAvatar(gAgentAvatarp); - self->mSlider->setValue( self->weightToSlider( new_weight ) ); + if (slider->getMinValue() < new_percent + && new_percent < slider->getMaxValue()) + { + self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight); + self->mWearable->writeToAvatar(gAgentAvatarp); + slider->setValue( self->weightToPercent( new_weight ) ); + } } } } LLVisualParamHint::requestHintUpdates( self->mHintMin, self->mHintMax ); } + + +F32 LLScrollingPanelParam::weightToPercent( F32 weight ) +{ + LLViewerVisualParam* param = mParam; + return (weight - param->getMinWeight()) / (param->getMaxWeight() - param->getMinWeight()) * 100.f; +} + +F32 LLScrollingPanelParam::percentToWeight( F32 percent ) +{ + LLViewerVisualParam* param = mParam; + return percent / 100.f * (param->getMaxWeight() - param->getMinWeight()) + param->getMinWeight(); +} diff --git a/indra/newview/llscrollingpanelparam.h b/indra/newview/llscrollingpanelparam.h index dc344486fc..c7a47d5c7a 100644 --- a/indra/newview/llscrollingpanelparam.h +++ b/indra/newview/llscrollingpanelparam.h @@ -61,6 +61,9 @@ public: void onHintMouseDown( LLVisualParamHint* hint ); void onHintHeldDown( LLVisualParamHint* hint ); + F32 weightToPercent( F32 weight ); + F32 percentToWeight( F32 percent ); + public: // Constants for LLPanelVisualParam const static F32 PARAM_STEP_TIME_THRESHOLD; diff --git a/indra/newview/llscrollingpanelparambase.cpp b/indra/newview/llscrollingpanelparambase.cpp index 2a6c25235d..fe7a362723 100644 --- a/indra/newview/llscrollingpanelparambase.cpp +++ b/indra/newview/llscrollingpanelparambase.cpp @@ -43,7 +43,6 @@ LLScrollingPanelParamBase::LLScrollingPanelParamBase( const LLPanel::Params& pan LLViewerJointMesh* mesh, LLViewerVisualParam* param, BOOL allow_modify, LLWearable* wearable, LLJoint* jointp, BOOL use_hints) : LLScrollingPanel( panel_params ), mParam(param), - mSlider(nullptr), mAllowModify(allow_modify), mWearable(wearable) { @@ -51,15 +50,13 @@ LLScrollingPanelParamBase::LLScrollingPanelParamBase( const LLPanel::Params& pan buildFromFile( "panel_scrolling_param.xml"); else buildFromFile( "panel_scrolling_param_base.xml"); - - mSlider = getChild("param slider"); - mSlider->setMaxValue(100.f * (mParam->getMaxWeight() - mParam->getMinWeight())); - mSlider->setValue(weightToSlider(param->getWeight())); + + getChild("param slider")->setValue(weightToPercent(param->getWeight())); std::string display_name = LLTrans::getString(param->getDisplayName()); - mSlider->setLabelArg("[DESC]", display_name); - mSlider->setEnabled(mAllowModify); - mSlider->setCommitCallback(boost::bind(LLScrollingPanelParamBase::onSliderMoved, mSlider, this)); + getChild("param slider")->setLabelArg("[DESC]", display_name); + getChildView("param slider")->setEnabled(mAllowModify); + childSetCommitCallback("param slider", LLScrollingPanelParamBase::onSliderMoved, this); setVisible(FALSE); setBorderVisible( FALSE ); @@ -80,9 +77,9 @@ void LLScrollingPanelParamBase::updatePanel(BOOL allow_modify) } F32 current_weight = mWearable->getVisualParamWeight( param->getID() ); - mSlider->setValue(weightToSlider( current_weight ) ); + getChild("param slider")->setValue(weightToPercent( current_weight ) ); mAllowModify = allow_modify; - mSlider->setEnabled(mAllowModify); + getChildView("param slider")->setEnabled(mAllowModify); } // static @@ -93,7 +90,7 @@ void LLScrollingPanelParamBase::onSliderMoved(LLUICtrl* ctrl, void* userdata) LLViewerVisualParam* param = self->mParam; F32 current_weight = self->mWearable->getVisualParamWeight( param->getID() ); - F32 new_weight = self->sliderToWeight( (F32)slider->getValue().asReal() ); + F32 new_weight = self->percentToWeight( (F32)slider->getValue().asReal() ); if (current_weight != new_weight ) { self->mWearable->setVisualParamWeight( param->getID(), new_weight); @@ -102,12 +99,14 @@ void LLScrollingPanelParamBase::onSliderMoved(LLUICtrl* ctrl, void* userdata) } } -F32 LLScrollingPanelParamBase::weightToSlider(F32 weight) +F32 LLScrollingPanelParamBase::weightToPercent( F32 weight ) { - return (weight - mParam->getMinWeight()) * 100.f; + LLViewerVisualParam* param = mParam; + return (weight - param->getMinWeight()) / (param->getMaxWeight() - param->getMinWeight()) * 100.f; } -F32 LLScrollingPanelParamBase::sliderToWeight(F32 slider) +F32 LLScrollingPanelParamBase::percentToWeight( F32 percent ) { - return slider / 100.f + mParam->getMinWeight(); + LLViewerVisualParam* param = mParam; + return percent / 100.f * (param->getMaxWeight() - param->getMinWeight()) + param->getMinWeight(); } diff --git a/indra/newview/llscrollingpanelparambase.h b/indra/newview/llscrollingpanelparambase.h index e7f88a21bd..9538826251 100644 --- a/indra/newview/llscrollingpanelparambase.h +++ b/indra/newview/llscrollingpanelparambase.h @@ -36,7 +36,6 @@ class LLViewerVisualParam; class LLWearable; class LLVisualParamHint; class LLViewerVisualParam; -class LLSliderCtrl; class LLJoint; class LLScrollingPanelParamBase : public LLScrollingPanel @@ -50,13 +49,11 @@ public: static void onSliderMoved(LLUICtrl* ctrl, void* userdata); - F32 weightToSlider(F32 weight); - F32 sliderToWeight(F32 slider); + F32 weightToPercent( F32 weight ); + F32 percentToWeight( F32 percent ); public: LLViewerVisualParam* mParam; - LLSliderCtrl* mSlider; - protected: BOOL mAllowModify; LLWearable *mWearable; -- cgit v1.2.3 From 0d4f52b7783706d988ec2c022be24ef9880f318a Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Mon, 15 Apr 2024 22:56:53 +0200 Subject: secondlife/viewer#1200 Avatar rotates 360 degrees when viewed from the top and below --- indra/newview/llagent.cpp | 83 ++++++++++++++++++++++++++----------------- indra/newview/llagentcamera.h | 1 + 2 files changed, 52 insertions(+), 32 deletions(-) (limited to 'indra') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 13501833b2..192bd9cccd 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -1453,48 +1453,67 @@ LLVector3 LLAgent::getReferenceUpVector() return up_vector; } - // Radians, positive is forward into ground //----------------------------------------------------------------------------- // pitch() //----------------------------------------------------------------------------- void LLAgent::pitch(F32 angle) { - // don't let user pitch if pointed almost all the way down or up + if (fabs(angle) <= 1e-4) + return; - // A dot B = mag(A) * mag(B) * cos(angle between A and B) - // so... cos(angle between A and B) = A dot B / mag(A) / mag(B) - // = A dot B for unit vectors + LLCoordFrame newCoordFrame(mFrameAgent); + newCoordFrame.pitch(angle); - LLVector3 skyward = getReferenceUpVector(); + // don't let user pitch if rotated 180 degree around the vertical axis + if ((newCoordFrame.getXAxis()[VX] * mFrameAgent.getXAxis()[VX] < 0) && + (newCoordFrame.getXAxis()[VY] * mFrameAgent.getXAxis()[VY] < 0)) + return; - // clamp pitch to limits - if (angle >= 0.f) - { - const F32 look_down_limit = 179.f * DEG_TO_RAD; - F32 angle_from_skyward = acos(mFrameAgent.getAtAxis() * skyward); - if (angle_from_skyward + angle > look_down_limit) - { - angle = look_down_limit - angle_from_skyward; - } - } - else if (angle < 0.f) - { - const F32 look_up_limit = 5.f * DEG_TO_RAD; - const LLVector3& viewer_camera_pos = LLViewerCamera::getInstance()->getOrigin(); - LLVector3 agent_focus_pos = getPosAgentFromGlobal(gAgentCamera.calcFocusPositionTargetGlobal()); - LLVector3 look_dir = agent_focus_pos - viewer_camera_pos; - F32 angle_from_skyward = angle_between(look_dir, skyward); - if (angle_from_skyward + angle < look_up_limit) - { - angle = look_up_limit - angle_from_skyward; - } - } + // don't let user pitch if pointed almost all the way down or up + LLVector3 skyward = getReferenceUpVector(); - if (fabs(angle) > 1e-4) - { - mFrameAgent.pitch(angle); - } + // A dot B = mag(A) * mag(B) * cos(angle between A and B) + // so... cos(angle between A and B) = A dot B / mag(A) / mag(B) + // = A dot B for unit vectors + F32 agent_camera_angle_from_skyward = acos(newCoordFrame.getAtAxis() * skyward) * RAD_TO_DEG; + + F32 min_angle = 1; + F32 max_angle = 179; + bool check_viewer_camera = false; + + if (gAgentCamera.getCameraMode() == CAMERA_MODE_THIRD_PERSON) + { + // These values of min_angle and max_angle are obtained purely empirically + if (gAgentCamera.getCameraPreset() == CAMERA_PRESET_REAR_VIEW) + { + min_angle = 10; + check_viewer_camera = true; + } + else if (gAgentCamera.getCameraPreset() == CAMERA_PRESET_GROUP_VIEW) + { + min_angle = 10; + max_angle = 170; + check_viewer_camera = true; + } + } + + if ((angle < 0 && agent_camera_angle_from_skyward < min_angle) || + (angle > 0 && agent_camera_angle_from_skyward > max_angle)) + return; + + if (check_viewer_camera) + { + const LLVector3& viewer_camera_pos = LLViewerCamera::getInstance()->getOrigin(); + LLVector3 agent_focus_pos = getPosAgentFromGlobal(gAgentCamera.calcFocusPositionTargetGlobal()); + LLVector3 look_dir = agent_focus_pos - viewer_camera_pos; + F32 viewer_camera_angle_from_skyward = angle_between(look_dir, skyward) * RAD_TO_DEG; + if ((angle < 0 && viewer_camera_angle_from_skyward < min_angle) || + (angle > 0 && viewer_camera_angle_from_skyward > max_angle)) + return; + } + + mFrameAgent = newCoordFrame; } diff --git a/indra/newview/llagentcamera.h b/indra/newview/llagentcamera.h index d27cdb0c5c..4fab5f5d92 100644 --- a/indra/newview/llagentcamera.h +++ b/indra/newview/llagentcamera.h @@ -112,6 +112,7 @@ private: //-------------------------------------------------------------------- public: void switchCameraPreset(ECameraPreset preset); + ECameraPreset getCameraPreset() const { return mCameraPreset; } /** Determines default camera offset depending on the current camera preset */ LLVector3 getCameraOffsetInitial(); /** Determines default focus offset depending on the current camera preset */ -- cgit v1.2.3 From 0cceb13b5a5283078c31c88d864d700b49eeff7f Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 25 Apr 2024 20:33:10 +0300 Subject: viewer#1321 allow to set price before clicking the "For Sale" box --- indra/newview/llpanelpermissions.cpp | 16 ++++++++++++++-- indra/newview/llpanelpermissions.h | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 67f913a067..f11136da6d 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -176,7 +176,7 @@ BOOL LLPanelPermissions::postBuild() childSetCommitCallback("sale type",LLPanelPermissions::onCommitSaleType,this); - childSetCommitCallback("Edit Cost", LLPanelPermissions::onCommitSaleInfo, this); + childSetCommitCallback("Edit Cost", LLPanelPermissions::onCommitSalePrice, this); childSetCommitCallback("checkbox next owner can modify",LLPanelPermissions::onCommitNextOwnerModify,this); childSetCommitCallback("checkbox next owner can copy",LLPanelPermissions::onCommitNextOwnerCopy,this); @@ -781,7 +781,9 @@ void LLPanelPermissions::refresh() if (has_change_sale_ability && (owner_mask_on & PERM_TRANSFER)) { - getChildView("checkbox for sale")->setEnabled(can_transfer || (!can_transfer && num_for_sale)); + bool change_sale_allowed = can_transfer || (!can_transfer && num_for_sale); + getChildView("checkbox for sale")->setEnabled(change_sale_allowed); + getChildView("Edit Cost")->setEnabled(change_sale_allowed && !is_for_sale_mixed); // Set the checkbox to tentative if the prices of each object selected // are not the same. getChild("checkbox for sale")->setTentative( is_for_sale_mixed); @@ -1223,6 +1225,16 @@ void LLPanelPermissions::onCommitSaleType(LLUICtrl*, void* data) self->setAllSaleInfo(); } +void LLPanelPermissions::onCommitSalePrice(LLUICtrl *, void *data) +{ + LLPanelPermissions *self = (LLPanelPermissions *) data; + LLCheckBoxCtrl *checkPurchase = self->getChild("checkbox for sale"); + if (checkPurchase && checkPurchase->get()) + { + self->setAllSaleInfo(); + } +} + void LLPanelPermissions::setAllSaleInfo() { LL_INFOS() << "LLPanelPermissions::setAllSaleInfo()" << LL_ENDL; diff --git a/indra/newview/llpanelpermissions.h b/indra/newview/llpanelpermissions.h index e657f8f8b7..4ae916d41a 100644 --- a/indra/newview/llpanelpermissions.h +++ b/indra/newview/llpanelpermissions.h @@ -77,6 +77,7 @@ protected: static void onCommitSaleInfo(LLUICtrl* ctrl, void* data); static void onCommitSaleType(LLUICtrl* ctrl, void* data); + static void onCommitSalePrice(LLUICtrl *ctrl, void *data); void setAllSaleInfo(); static void onCommitClickAction(LLUICtrl* ctrl, void*); -- cgit v1.2.3 From 204b7ff6fb7544dd4210e125d275fd550f52f5c6 Mon Sep 17 00:00:00 2001 From: Bennett Goble Date: Sat, 27 Apr 2024 10:49:31 -0700 Subject: Add timestamp to snapshot file names This changeset adds a timestamp in the format of "YYYY-MM-DD_HHSS" to snapshot filenames. This is useful for understanding when a snapshot was taken, chronologically ordering files, and is less confusing than the current method of adding a number to the snapshot name, as it does not result in interleaving of old and new snapshots inside a directory. --- indra/llcommon/lldate.cpp | 9 +++++++ indra/llcommon/lldate.h | 1 + indra/newview/llfloater360capture.cpp | 11 ++------- indra/newview/llviewerwindow.cpp | 44 +++++++++++++++++------------------ 4 files changed, 33 insertions(+), 32 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index 2ddcf40895..39d5a3131e 100644 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -86,6 +86,15 @@ std::string LLDate::asRFC1123() const return toHTTPDateString (std::string ("%A, %d %b %Y %H:%M:%S GMT")); } +std::string LLDate::toLocalDateString (std::string fmt) const +{ + LL_PROFILE_ZONE_SCOPED; + + time_t locSeconds = (time_t) mSecondsSinceEpoch; + struct tm * lt = localtime (&locSeconds); + return toHTTPDateString(lt, fmt); +} + std::string LLDate::toHTTPDateString (std::string fmt) const { LL_PROFILE_ZONE_SCOPED; diff --git a/indra/llcommon/lldate.h b/indra/llcommon/lldate.h index be2cd2d051..248de41da7 100644 --- a/indra/llcommon/lldate.h +++ b/indra/llcommon/lldate.h @@ -80,6 +80,7 @@ public: std::string asRFC1123() const; void toStream(std::ostream&) const; bool split(S32 *year, S32 *month = NULL, S32 *day = NULL, S32 *hour = NULL, S32 *min = NULL, S32 *sec = NULL) const; + std::string toLocalDateString (std::string fmt) const; std::string toHTTPDateString (std::string fmt) const; static std::string toHTTPDateString (tm * gmt, std::string fmt); /** diff --git a/indra/newview/llfloater360capture.cpp b/indra/newview/llfloater360capture.cpp index 2c638fa959..9bc012d6f0 100644 --- a/indra/newview/llfloater360capture.cpp +++ b/indra/newview/llfloater360capture.cpp @@ -33,6 +33,7 @@ #include "llagentui.h" #include "llbase64.h" #include "llcallbacklist.h" +#include "lldate.h" #include "llenvironment.h" #include "llimagejpeg.h" #include "llmediactrl.h" @@ -862,15 +863,7 @@ const std::string LLFloater360Capture::generate_proposed_filename() filename << "_"; // add in the current HH-MM-SS (with leading 0's) so users can easily save many shots in same folder - std::time_t cur_epoch = std::time(nullptr); - std::tm* tm_time = std::localtime(&cur_epoch); - filename << std::setfill('0') << std::setw(4) << (tm_time->tm_year + 1900); - filename << std::setfill('0') << std::setw(2) << (tm_time->tm_mon + 1); - filename << std::setfill('0') << std::setw(2) << tm_time->tm_mday; - filename << "_"; - filename << std::setfill('0') << std::setw(2) << tm_time->tm_hour; - filename << std::setfill('0') << std::setw(2) << tm_time->tm_min; - filename << std::setfill('0') << std::setw(2) << tm_time->tm_sec; + filename << LLDate::now().toLocalDateString("%Y%m%d_%H%M%S"); // the unusual way we save the output image (originates in the // embedded browser and not the C++ code) means that the system diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 37e64dfc17..d7a1ca34d0 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -66,6 +66,7 @@ #include "llchatentry.h" #include "indra_constants.h" #include "llassetstorage.h" +#include "lldate.h" #include "llerrorcontrol.h" #include "llfontgl.h" #include "llmousehandler.h" @@ -4761,29 +4762,26 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save failure_cb(); } - // Look for an unused file name - BOOL is_snapshot_name_loc_set = isSnapshotLocSet(); - std::string filepath; - S32 i = 1; - S32 err = 0; - std::string extension("." + image->getExtension()); - do - { - filepath = sSnapshotDir; - filepath += gDirUtilp->getDirDelimiter(); - filepath += sSnapshotBaseName; - - if (is_snapshot_name_loc_set) - { - filepath += llformat("_%.3d",i); - } - - filepath += extension; - - llstat stat_info; - err = LLFile::stat( filepath, &stat_info ); - i++; - } + // Look for an unused file name + auto is_snapshot_name_loc_set = isSnapshotLocSet(); + std::string filepath; + auto i = 1; + auto err = 0; + auto extension("." + image->getExtension()); + auto now = LLDate::now(); + do + { + filepath = sSnapshotDir; + filepath += gDirUtilp->getDirDelimiter(); + filepath += sSnapshotBaseName; + filepath += now.toLocalDateString("_%Y-%m-%d_%H%M%S"); + filepath += llformat("%.2d", i); + filepath += extension; + + llstat stat_info; + err = LLFile::stat( filepath, &stat_info ); + i++; + } while( -1 != err // Search until the file is not found (i.e., stat() gives an error). && is_snapshot_name_loc_set); // Or stop if we are rewriting. -- cgit v1.2.3 From 23729442aab7130f3368d433e8a5a9dd45ff6b98 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Tue, 30 Apr 2024 14:17:09 +0200 Subject: secondlife/viewer#1359 Introduce enum ERezzedStatus --- indra/newview/llavatarrenderinfoaccountant.cpp | 2 +- indra/newview/llavatarrendernotifier.cpp | 2 +- indra/newview/llavatarrendernotifier.h | 4 +- indra/newview/llvoavatar.cpp | 211 ++++++++++++------------- indra/newview/llvoavatar.h | 40 +++-- indra/newview/llvoavatarself.cpp | 15 +- 6 files changed, 138 insertions(+), 136 deletions(-) (limited to 'indra') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index b95b971890..d7a9bc5715 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -231,7 +231,7 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoReportCoro(std::string url, U { LLVOAvatar* avatar = dynamic_cast(*iter); if (avatar && - avatar->getRezzedStatus() >= 2 && // Mostly rezzed (maybe without baked textures downloaded) + avatar->getRezzedStatus() >= AV_REZZED_TEXTURED && // Mostly rezzed (maybe without baked textures downloaded) !avatar->isDead() && // Not dead yet !avatar->isControlAvatar() && // Not part of an animated object avatar->getObjectHost() == regionp->getHost()) // Ensure it's on the same region diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index 8b09f7903d..b249565646 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -70,7 +70,7 @@ mLatestOverLimitPct(0.0f), mShowOverLimitAgents(false), mNotifyOutfitLoading(false), mLastCofVersion(LLViewerInventoryCategory::VERSION_UNKNOWN), -mLastOutfitRezStatus(-1), +mLastOutfitRezStatus(AV_REZZED_UNKNOWN), mLastSkeletonSerialNum(-1) { mPopUpDelayTimer.resetWithExpiry(OVER_LIMIT_UPDATE_DELAY); diff --git a/indra/newview/llavatarrendernotifier.h b/indra/newview/llavatarrendernotifier.h index 37130bfcf6..f30b6b3612 100644 --- a/indra/newview/llavatarrendernotifier.h +++ b/indra/newview/llavatarrendernotifier.h @@ -33,6 +33,8 @@ class LLViewerRegion; +enum ERezzedStatus : S32; + struct LLHUDComplexity { LLHUDComplexity() @@ -130,7 +132,7 @@ private: S32 mLastSkeletonSerialNum; // Used to detect changes in voavatar's rezzed status. // If value decreases - there were changes in outfit. - S32 mLastOutfitRezStatus; + enum ERezzedStatus mLastOutfitRezStatus; object_complexity_list_t mObjectComplexityList; }; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 8ecfa3eed1..ab2c59e80a 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -212,7 +212,7 @@ const S32 MIN_NONTUNED_AVS = 5; enum ERenderName { RENDER_NAME_NEVER, - RENDER_NAME_ALWAYS, + RENDER_NAME_ALWAYS, RENDER_NAME_FADE }; @@ -574,7 +574,7 @@ private: // joint states to be animated //------------------------------------------------------------------------- LLPointer mPelvisState; - LLCharacter* mCharacter; + LLCharacter* mCharacter; }; /** @@ -677,15 +677,15 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mVisuallyMuteSetting(AV_RENDER_NORMALLY), mMutedAVColor(LLColor4::white /* used for "uninitialize" */), mFirstFullyVisible(TRUE), - mFirstUseDelaySeconds(FIRST_APPEARANCE_CLOUD_MIN_DELAY), mFullyLoaded(FALSE), mPreviousFullyLoaded(FALSE), mFullyLoadedInitialized(FALSE), + mFullyLoadedFrameCounter(0), mVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN), mLoadedCallbacksPaused(FALSE), mLoadedCallbackTextures(0), mRenderUnloadedAvatar(LLCachedControl(gSavedSettings, "RenderUnloadedAvatar", false)), - mLastRezzedStatus(-1), + mLastRezzedStatus(AV_REZZED_UNKNOWN), mIsEditingAppearance(FALSE), mUseLocalAppearance(FALSE), mLastUpdateRequestCOFVersion(-1), @@ -799,10 +799,10 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c if (gSavedSettings.getBOOL("DebugAvatarRezTime")) { LLSD args; - args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32()); - args["TIME"] = llformat("%d",(U32)mRuthDebugTimer.getElapsedTimeF32()); + args["EXISTENCE"] = llformat("%d", (U32)mDebugExistenceTimer.getElapsedTimeF32()); + args["TIME"] = llformat("%d", (U32)mRuthDebugTimer.getElapsedTimeF32()); args["NAME"] = getFullname(); - LLNotificationsUtil::add(notification_name,args); + LLNotificationsUtil::add(notification_name, args); } } @@ -813,14 +813,14 @@ LLVOAvatar::~LLVOAvatar() { if (!mFullyLoaded) { - debugAvatarRezTime("AvatarRezLeftCloudNotification","left after ruth seconds as cloud"); + debugAvatarRezTime("AvatarRezLeftCloudNotification", "left after ruth seconds as cloud"); } else { - debugAvatarRezTime("AvatarRezLeftNotification","left sometime after declouding"); + debugAvatarRezTime("AvatarRezLeftNotification", "left sometime after declouding"); } - if(mTuned) + if (mTuned) { LLPerfStats::tunedAvatars--; mTuned = false; @@ -917,14 +917,34 @@ BOOL LLVOAvatar::hasGray() const return !getIsCloud() && !isFullyTextured(); } -S32 LLVOAvatar::getRezzedStatus() const +ERezzedStatus LLVOAvatar::getRezzedStatus() const { - if (getIsCloud()) return 0; - bool textured = isFullyTextured(); - if (textured && allBakedTexturesCompletelyDownloaded()) return 3; - if (textured) return 2; - llassert(hasGray()); - return 1; // gray + if (getIsCloud()) + return AV_REZZED_CLOUD; + if (!isFullyTextured()) + return AV_REZZED_GRAY; + if (!allBakedTexturesCompletelyDownloaded()) + return AV_REZZED_TEXTURED; // "downloading" + return AV_REZZED_FULL; +} + +// static +std::string LLVOAvatar::rezStatusToString(ERezzedStatus rez_status) +{ + switch (rez_status) + { + case AV_REZZED_CLOUD: + return "cloud"; + case AV_REZZED_GRAY: + return "gray"; + case AV_REZZED_TEXTURED: + return "downloading"; + case AV_REZZED_FULL: + return "full"; + default: + ; + } + return "unknown"; } void LLVOAvatar::deleteLayerSetCaches(bool clearAll) @@ -953,15 +973,10 @@ BOOL LLVOAvatar::areAllNearbyInstancesBaked(S32& grey_avatars) { BOOL res = TRUE; grey_avatars = 0; - for (std::vector::iterator iter = LLCharacter::sInstances.begin(); - iter != LLCharacter::sInstances.end(); ++iter) + for (LLCharacter* character : LLCharacter::sInstances) { - LLVOAvatar* inst = (LLVOAvatar*) *iter; - if( inst->isDead() ) - { - continue; - } - else if( !inst->isFullyBaked() ) + LLVOAvatar* inst = (LLVOAvatar*)character; + if (!inst->isDead() && !inst->isFullyBaked()) { res = FALSE; if (inst->mHasGrey) @@ -973,33 +988,6 @@ BOOL LLVOAvatar::areAllNearbyInstancesBaked(S32& grey_avatars) return res; } -// static -void LLVOAvatar::getNearbyRezzedStats(std::vector& counts) -{ - counts.clear(); - counts.resize(4); - for (std::vector::iterator iter = LLCharacter::sInstances.begin(); - iter != LLCharacter::sInstances.end(); ++iter) - { - LLVOAvatar* inst = (LLVOAvatar*) *iter; - if (inst) - { - S32 rez_status = inst->getRezzedStatus(); - counts[rez_status]++; - } - } -} - -// static -std::string LLVOAvatar::rezStatusToString(S32 rez_status) -{ - if (rez_status==0) return "cloud"; - if (rez_status==1) return "gray"; - if (rez_status==2) return "downloading"; - if (rez_status==3) return "full"; - return "unknown"; -} - // static void LLVOAvatar::dumpBakedStatus() { @@ -2679,7 +2667,7 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time) // no need for high frequency compl_upd_freq = 100; } - else if (mLastRezzedStatus <= 0) //cloud or init + else if (mLastRezzedStatus <= AV_REZZED_CLOUD) // cloud or initial { compl_upd_freq = 60; } @@ -2687,11 +2675,11 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time) { compl_upd_freq = 5; } - else if (mLastRezzedStatus == 1) //'grey', not fully loaded + else if (mLastRezzedStatus == AV_REZZED_GRAY) // 'gray', not fully loaded { compl_upd_freq = 40; } - else if (isInMuteList()) //cheap, buffers value from search + else if (isInMuteList()) // cheap, buffers value from search { compl_upd_freq = 100; } @@ -3055,17 +3043,17 @@ F32 LLVOAvatar::calcMorphAmount() void LLVOAvatar::idleUpdateLipSync(bool voice_enabled) { // Use the Lipsync_Ooh and Lipsync_Aah morphs for lip sync - if ( voice_enabled - && mLastRezzedStatus > 0 // no point updating lip-sync for clouds + if (voice_enabled + && mLastRezzedStatus > AV_REZZED_CLOUD // no point updating lip-sync for clouds && (LLVoiceClient::getInstance()->lipSyncEnabled()) - && LLVoiceClient::getInstance()->getIsSpeaking( mID ) ) + && LLVoiceClient::getInstance()->getIsSpeaking(mID)) { F32 ooh_morph_amount = 0.0f; F32 aah_morph_amount = 0.0f; mVoiceVisualizer->lipSyncOohAah( ooh_morph_amount, aah_morph_amount ); - if( mOohMorph ) + if (mOohMorph) { F32 ooh_weight = mOohMorph->getMinWeight() + ooh_morph_amount * (mOohMorph->getMaxWeight() - mOohMorph->getMinWeight()); @@ -3073,7 +3061,7 @@ void LLVOAvatar::idleUpdateLipSync(bool voice_enabled) mOohMorph->setWeight( ooh_weight); } - if( mAahMorph ) + if (mAahMorph) { F32 aah_weight = mAahMorph->getMinWeight() + aah_morph_amount * (mAahMorph->getMaxWeight() - mAahMorph->getMinWeight()); @@ -4165,16 +4153,16 @@ void LLVOAvatar::computeUpdatePeriod() // impostor camera near clip plane mUpdatePeriod = 1; } - else if ( shouldImpostor(4.0) ) + else if (shouldImpostor(4.0)) { //background avatars are REALLY slow updating impostors mUpdatePeriod = UPDATE_RATE_SLOW; } - else if (mLastRezzedStatus <= 0) + else if (mLastRezzedStatus <= AV_REZZED_CLOUD) { // Don't update cloud avatars too often mUpdatePeriod = UPDATE_RATE_SLOW; } - else if ( shouldImpostor(3.0) ) + else if (shouldImpostor(3.0)) { //back 25% of max visible avatars are slow updating impostors mUpdatePeriod = UPDATE_RATE_MED; } @@ -8056,10 +8044,10 @@ bool LLVOAvatar::getIsCloud() const ); } -void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status) +void LLVOAvatar::updateRezzedStatusTimers(ERezzedStatus rez_status) { - // State machine for rezzed status. Statuses are -1 on startup, 0 - // = cloud, 1 = gray, 2 = downloading, 3 = full. + // State machine for rezzed status. + // Statuses are -1 on startup, 0 = cloud, 1 = gray, 2 = downloading, 3 = full. // Purpose is to collect time data for each it takes avatar to reach // various loading landmarks: gray, textured (partial), textured fully. @@ -8067,10 +8055,10 @@ void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status) { LL_DEBUGS("Avatar") << avString() << "rez state change: " << mLastRezzedStatus << " -> " << rez_status << LL_ENDL; - if (mLastRezzedStatus == -1 && rez_status != -1) + if (mLastRezzedStatus == AV_REZZED_UNKNOWN && rez_status != AV_REZZED_UNKNOWN) { // First time initialization, start all timers. - for (S32 i = 1; i < 4; i++) + for (ERezzedStatus i = AV_REZZED_GRAY; i <= AV_REZZED_FULL; ++(S32&)i) { startPhase("load_" + LLVOAvatar::rezStatusToString(i)); startPhase("first_load_" + LLVOAvatar::rezStatusToString(i)); @@ -8079,7 +8067,7 @@ void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status) if (rez_status < mLastRezzedStatus) { // load level has decreased. start phase timers for higher load levels. - for (S32 i = rez_status+1; i <= mLastRezzedStatus; i++) + for (ERezzedStatus i = next(rez_status); i <= mLastRezzedStatus; ++(S32&)i) { startPhase("load_" + LLVOAvatar::rezStatusToString(i)); } @@ -8087,21 +8075,22 @@ void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status) else if (rez_status > mLastRezzedStatus) { // load level has increased. stop phase timers for lower and equal load levels. - for (S32 i = llmax(mLastRezzedStatus+1,1); i <= rez_status; i++) + for (ERezzedStatus i = llmax(next(mLastRezzedStatus), AV_REZZED_GRAY); i <= rez_status; ++(S32&)i) { stopPhase("load_" + LLVOAvatar::rezStatusToString(i)); stopPhase("first_load_" + LLVOAvatar::rezStatusToString(i), false); } - if (rez_status == 3) + if (rez_status == AV_REZZED_FULL) { // "fully loaded", mark any pending appearance change complete. selfStopPhase("update_appearance_from_cof"); selfStopPhase("wear_inventory_category", false); selfStopPhase("process_initial_wearables_update", false); - updateVisualComplexity(); + updateVisualComplexity(); } } + mLastRezzedStatus = rez_status; } } @@ -8232,18 +8221,18 @@ void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapse // returns true if the value has changed. BOOL LLVOAvatar::updateIsFullyLoaded() { - S32 rez_status = getRezzedStatus(); + ERezzedStatus rez_status = getRezzedStatus(); bool loading = getIsCloud(); if (mFirstFullyVisible && !mIsControlAvatar) { - loading = ((rez_status < 2) + loading = ((rez_status < AV_REZZED_TEXTURED) // Wait at least 60s for unfinished textures to finish on first load, // don't wait forever, it might fail. Even if it will eventually load by // itself and update mLoadedCallbackTextures (or fail and clean the list), // avatars are more time-sensitive than textures and can't wait that long. || (mLoadedCallbackTextures < mCallbackTextureList.size() && mLastTexCallbackAddedTime.getElapsedTimeF32() < MAX_TEXTURE_WAIT_TIME_SEC) || !mPendingAttachment.empty() - || (rez_status < 3 && !isFullyBaked()) + || (rez_status < AV_REZZED_FULL && !isFullyBaked()) || hasPendingAttachedMeshes() ); } @@ -8283,56 +8272,53 @@ void LLVOAvatar::updateRuthTimer(bool loading) BOOL LLVOAvatar::processFullyLoadedChange(bool loading) { - // We wait a little bit before giving the 'all clear', to let things to - // settle down (models to snap into place, textures to get first packets). - // And if viewer isn't aware of some parts yet, this gives them a chance - // to arrive. - const F32 LOADED_DELAY = 1.f; - if (loading) { mFullyLoadedTimer.reset(); + mFullyLoaded = false; } + else if (!mFullyLoaded) + { + // We wait a little bit before giving the 'all clear', to let things to settle down: + // models to snap into place, textures to get first packets, LODs to load. + const F32 LOADED_DELAY = 1.f; - if (mFirstFullyVisible) - { - if (!isSelf() && loading) + F32 delay = LOADED_DELAY; + if (mFirstFullyVisible && !isSelf() && loading) { - // Note that textures can causes 60s delay on thier own - // so this delay might end up on top of textures' delay - mFirstUseDelaySeconds = llclamp( - mFirstAppearanceMessageTimer.getElapsedTimeF32(), - FIRST_APPEARANCE_CLOUD_MIN_DELAY, - FIRST_APPEARANCE_CLOUD_MAX_DELAY); - - if (shouldImpostor()) - { - // Impostors are less of a priority, - // let them stay cloud longer - mFirstUseDelaySeconds *= 1.25; - } + delay = mFirstAppearanceMessageTimer.getElapsedTimeF32(); + // Note that textures can causes 60s delay on thier own + // so this delay might end up on top of textures' delay + delay = llclamp( + mFirstAppearanceMessageTimer.getElapsedTimeF32(), + FIRST_APPEARANCE_CLOUD_MIN_DELAY, + FIRST_APPEARANCE_CLOUD_MAX_DELAY); + + if (shouldImpostor()) + { + // Impostors are less of a priority, + // let them stay cloud longer + delay *= 1.25; + } } - mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > mFirstUseDelaySeconds); - } - else - { - mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > LOADED_DELAY); - } - if (!mPreviousFullyLoaded && !loading && mFullyLoaded) - { - debugAvatarRezTime("AvatarRezNotification","fully loaded"); - } + mFullyLoaded = mFullyLoadedTimer.getElapsedTimeF32() > delay; + + if (!mPreviousFullyLoaded && !loading && mFullyLoaded) + { + debugAvatarRezTime("AvatarRezNotification", "fully loaded"); + } + } // did our loading state "change" from last call? // FIXME runway - why are we updating every 30 calls even if nothing has changed? // This causes updateLOD() to run every 30 frames, among other things. + BOOL fully_loaded_changed = (mFullyLoaded != mPreviousFullyLoaded); const S32 UPDATE_RATE = 30; BOOL changed = - ((mFullyLoaded != mPreviousFullyLoaded) || // if the value is different from the previous call - (!mFullyLoadedInitialized) || // if we've never been called before - (mFullyLoadedFrameCounter % UPDATE_RATE == 0)); // every now and then issue a change - BOOL fully_loaded_changed = (mFullyLoaded != mPreviousFullyLoaded); + (fully_loaded_changed || // if the value is different from the previous call + !mFullyLoadedInitialized || // if we've never been called before + (mFullyLoadedFrameCounter % UPDATE_RATE == 0)); // every now and then issue a change mPreviousFullyLoaded = mFullyLoaded; mFullyLoadedInitialized = TRUE; @@ -8349,7 +8335,8 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading) // Fix for jellydoll initially invisible mNeedsImpostorUpdate = TRUE; mLastImpostorUpdateReason = 6; - } + } + return changed; } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 4bb0c8aa73..77f50a83f8 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -80,6 +80,15 @@ const F32 MAX_AVATAR_LOD_FACTOR = 1.0f; extern U32 gFrameCount; +enum ERezzedStatus : S32 +{ + AV_REZZED_UNKNOWN = -1, + AV_REZZED_CLOUD = 0, + AV_REZZED_GRAY = 1, + AV_REZZED_TEXTURED = 2, // "downloading" + AV_REZZED_FULL = 3 +}; + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // LLVOAvatar // @@ -327,22 +336,24 @@ public: // avatar render cost - U32 getVisualComplexity() { return mVisualComplexity; }; + U32 getVisualComplexity() { return mVisualComplexity; }; // surface area calculation - F32 getAttachmentSurfaceArea() { return mAttachmentSurfaceArea; }; + F32 getAttachmentSurfaceArea() { return mAttachmentSurfaceArea; }; - U32 getReportedVisualComplexity() { return mReportedVisualComplexity; }; // Numbers as reported by the SL server - void setReportedVisualComplexity(U32 value) { mReportedVisualComplexity = value; }; - - S32 getUpdatePeriod() { return mUpdatePeriod; }; - const LLColor4 & getMutedAVColor() { return mMutedAVColor; }; + U32 getReportedVisualComplexity() { return mReportedVisualComplexity; }; // Numbers as reported by the SL server + void setReportedVisualComplexity(U32 value) { mReportedVisualComplexity = value; }; + + S32 getUpdatePeriod() { return mUpdatePeriod; }; + const LLColor4 & getMutedAVColor() { return mMutedAVColor; }; static void updateImpostorRendering(U32 newMaxNonImpostorsValue); void idleUpdateBelowWater(); static void updateNearbyAvatarCount(); + static ERezzedStatus next(ERezzedStatus status) { return (ERezzedStatus)++(S32&)status; } + LLVector3 idleCalcNameTagPosition(const LLVector3 &root_pos_last); //-------------------------------------------------------------------- @@ -397,13 +408,12 @@ public: bool visualParamWeightsAreDefault(); virtual bool getIsCloud() const; BOOL isFullyTextured() const; - BOOL hasGray() const; - S32 getRezzedStatus() const; // 0 = cloud, 1 = gray, 2 = textured, 3 = textured and fully downloaded. - void updateRezzedStatusTimers(S32 status); + BOOL hasGray() const; + ERezzedStatus getRezzedStatus() const; + void updateRezzedStatusTimers(ERezzedStatus status); - S32 mLastRezzedStatus; + ERezzedStatus mLastRezzedStatus; - void startPhase(const std::string& phase_name); void stopPhase(const std::string& phase_name, bool err_check = true); void clearPhases(); @@ -422,7 +432,6 @@ protected: private: BOOL mFirstFullyVisible; - F32 mFirstUseDelaySeconds; LLFrameTimer mFirstAppearanceMessageTimer; BOOL mFullyLoaded; @@ -708,8 +717,7 @@ public: BOOL isFullyBaked(); static BOOL areAllNearbyInstancesBaked(S32& grey_avatars); - static void getNearbyRezzedStats(std::vector& counts); - static std::string rezStatusToString(S32 status); + static std::string rezStatusToString(ERezzedStatus status); //-------------------------------------------------------------------- // Baked textures @@ -727,7 +735,7 @@ protected: LLViewerTexLayerSet* getTexLayerSet(const U32 index) const { return dynamic_cast(mBakedTextureDatas[index].mTexLayerSet); } - LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList ; + LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList; BOOL mLoadedCallbacksPaused; S32 mLoadedCallbackTextures; // count of 'loaded' baked textures, filled from mCallbackTextureList LLFrameTimer mLastTexCallbackAddedTime; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index f12fc3babc..3cf20fc77c 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2233,12 +2233,17 @@ void LLVOAvatarSelf::appearanceChangeMetricsCoro(std::string url) // Status of all nearby avs including ourself. msg["nearby"] = LLSD::emptyArray(); - std::vector rez_counts; - LLVOAvatar::getNearbyRezzedStats(rez_counts); - for (S32 rez_stat = 0; rez_stat < rez_counts.size(); ++rez_stat) + + S32 status_counts[AV_REZZED_FULL - AV_REZZED_CLOUD + 1] = { 0 }; + for (LLCharacter* character : LLCharacter::sInstances) + { + ERezzedStatus status = ((LLVOAvatar*)character)->getRezzedStatus(); + ++status_counts[status - AV_REZZED_CLOUD]; + } + for (ERezzedStatus status = AV_REZZED_CLOUD; status <= AV_REZZED_FULL; ++(S32&)status) { - std::string rez_status_name = LLVOAvatar::rezStatusToString(rez_stat); - msg["nearby"][rez_status_name] = rez_counts[rez_stat]; + std::string status_name = LLVOAvatar::rezStatusToString(status); + msg["nearby"][status_name] = status_counts[status - AV_REZZED_CLOUD]; } // std::vector bucket_fields("timer_name","is_self","grid_x","grid_y","is_using_server_bake"); -- cgit v1.2.3 From 18f23d9a559d3b5ed61d4fc4d3cfa9fa6c50689c Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Tue, 30 Apr 2024 20:26:22 +0200 Subject: secondlife/viewer#1360 Avoid of using avatar full names --- indra/llcharacter/llcharacter.h | 2 + indra/newview/llaisapi.cpp | 2 +- indra/newview/llappearancemgr.cpp | 6 +-- indra/newview/llcontrolavatar.cpp | 6 +-- indra/newview/llpanelpeoplemenus.cpp | 5 +- indra/newview/llskinningutil.cpp | 4 +- indra/newview/llviewermenu.cpp | 3 +- indra/newview/llvoavatar.cpp | 94 +++++++++++++++++++++--------------- indra/newview/llvoavatar.h | 3 +- indra/newview/llvovolume.cpp | 4 +- 10 files changed, 74 insertions(+), 55 deletions(-) (limited to 'indra') diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index 6d56d59e8c..90ae662225 100644 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -119,6 +119,8 @@ public: virtual void addDebugText( const std::string& text ) = 0; + virtual std::string getDebugName() const { return getID().asString(); } + virtual const LLUUID& getID() const = 0; //------------------------------------------------------------------------- // End Interface diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index f23ce13608..6acfb7358e 100644 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -839,7 +839,7 @@ void AISAPI::onUpdateReceived(const LLSD& update, COMMAND_TYPE type, const LLSD& if ( (type == UPDATECATEGORY || type == UPDATEITEM) && gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) { - dump_sequential_xml(gAgentAvatarp->getFullname() + "_ais_update", update); + dump_sequential_xml(gAgentAvatarp->getDebugName() + "_ais_update", update); } AISUpdate ais_update(update, type, request_body); diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index c84657cf7a..3fa6cdfc8a 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2258,7 +2258,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) } if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) { - dump_sequential_xml(gAgentAvatarp->getFullname() + "_slam_request", contents); + dump_sequential_xml(gAgentAvatarp->getDebugName() + "_slam_request", contents); } slam_inventory_folder(getCOF(), contents, link_waiter); @@ -3943,7 +3943,7 @@ void LLAppearanceMgr::serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAd LL_DEBUGS("Avatar") << "succeeded" << LL_ENDL; if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) { - dump_sequential_xml(gAgentAvatarp->getFullname() + "_appearance_request_ok", result); + dump_sequential_xml(gAgentAvatarp->getDebugName() + "_appearance_request_ok", result); } } while (bRetry); @@ -3952,7 +3952,7 @@ void LLAppearanceMgr::serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAd /*static*/ void LLAppearanceMgr::debugAppearanceUpdateCOF(const LLSD& content) { - dump_sequential_xml(gAgentAvatarp->getFullname() + "_appearance_request_error", content); + dump_sequential_xml(gAgentAvatarp->getDebugName() + "_appearance_request_error", content); LL_INFOS("Avatar") << "AIS COF, version received: " << content["expected"].asInteger() << " ================================= " << LL_ENDL; diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index d764f64c79..4b1d6632ce 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -144,7 +144,7 @@ void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_ } if (new_pos_fixup != mPositionConstraintFixup) { - LL_DEBUGS("ConstraintFix") << getFullname() << " pos fix, offset_dist " << offset_dist << " pos fixup " + LL_DEBUGS("ConstraintFix") << getDebugName() << " pos fix, offset_dist " << offset_dist << " pos fixup " << new_pos_fixup << " was " << mPositionConstraintFixup << LL_ENDL; LL_DEBUGS("ConstraintFix") << "vol_pos " << vol_pos << LL_ENDL; LL_DEBUGS("ConstraintFix") << "extents " << extents[0] << " " << extents[1] << LL_ENDL; @@ -155,7 +155,7 @@ void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_ if (box_size/mScaleConstraintFixup > max_legal_size) { new_scale_fixup = mScaleConstraintFixup*max_legal_size/box_size; - LL_DEBUGS("ConstraintFix") << getFullname() << " scale fix, box_size " << box_size << " fixup " + LL_DEBUGS("ConstraintFix") << getDebugName() << " scale fix, box_size " << box_size << " fixup " << mScaleConstraintFixup << " max legal " << max_legal_size << " -> new scale " << new_scale_fixup << LL_ENDL; } @@ -240,7 +240,7 @@ void LLControlAvatar::matchVolumeTransform() const LLMeshSkinInfo* skin_info = mRootVolp->getSkinInfo(); if (skin_info) { - LL_DEBUGS("BindShape") << getFullname() << " bind shape " << skin_info->mBindShapeMatrix << LL_ENDL; + LL_DEBUGS("BindShape") << getDebugName() << " bind shape " << skin_info->mBindShapeMatrix << LL_ENDL; bind_rot = LLSkinningUtil::getUnscaledQuaternion(LLMatrix4(skin_info->mBindShapeMatrix)); } #endif diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index 42cecc9986..380c12d0d1 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -347,7 +347,10 @@ void PeopleContextMenu::eject() avatar = (LLVOAvatar*) object; } } - if (!avatar) return; + + if (!avatar) + return; + LLSD payload; payload["avatar_id"] = avatar->getID(); std::string fullname = avatar->getFullname(); diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp index 8bdccfd9f6..0de66f7821 100644 --- a/indra/newview/llskinningutil.cpp +++ b/indra/newview/llskinningutil.cpp @@ -110,8 +110,8 @@ void LLSkinningUtil::scrubInvalidJoints(LLVOAvatar *avatar, LLMeshSkinInfo* skin // needed for handling of any legacy bad data. if (!avatar->getJoint(skin->mJointNames[j])) { - LL_DEBUGS("Avatar") << avatar->getFullname() << " mesh rigged to invalid joint " << skin->mJointNames[j] << LL_ENDL; - LL_WARNS_ONCE("Avatar") << avatar->getFullname() << " mesh rigged to invalid joint" << skin->mJointNames[j] << LL_ENDL; + LL_DEBUGS("Avatar") << avatar->getDebugName() << " mesh rigged to invalid joint " << skin->mJointNames[j] << LL_ENDL; + LL_WARNS_ONCE("Avatar") << avatar->getDebugName() << " mesh rigged to invalid joint" << skin->mJointNames[j] << LL_ENDL; skin->mJointNames[j] = "mPelvis"; skin->mJointNumsInitialized = false; // force update after names change. } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index e413c32b7d..cbb104ee0f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1733,7 +1733,6 @@ class LLAdvancedAppearanceToXML : public view_listener_t { bool handleEvent(const LLSD& userdata) { - std::string emptyname; LLViewerObject *obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); LLVOAvatar *avatar = NULL; if (obj) @@ -1760,7 +1759,7 @@ class LLAdvancedAppearanceToXML : public view_listener_t } if (avatar) { - avatar->dumpArchetypeXML(emptyname); + avatar->dumpArchetypeXML(LLStringUtil::null); } return true; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index ab2c59e80a..3b3960e578 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -772,11 +772,9 @@ std::string LLVOAvatar::avString() const { return getFullname(); } - else - { - std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus()); - return " Avatar '" + getFullname() + "' " + viz_string + " "; - } + + std::string status = LLVOAvatar::rezStatusToString(getRezzedStatus()); + return " Avatar '" + getDebugName() + "' " + status + " "; } void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string comment) @@ -2574,9 +2572,9 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time) const S32 upd_freq = 4; // force update every upd_freq frames. mNeedsExtentUpdate = ((LLDrawable::getCurrentFrame()+mID.mData[0])%upd_freq==0); } - - LLScopedContextString str("avatar_idle_update " + getFullname()); - + + LLScopedContextString str("avatar_idle_update " + getDebugName()); + checkTextureLoading() ; // force immediate pixel area update on avatars using last frames data (before drawable or camera updates) @@ -2801,7 +2799,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update) LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; if (LLVOAvatar::sJointDebug) { - LL_INFOS() << getFullname() << ": joint touches: " << LLJoint::sNumTouches << " updates: " << LLJoint::sNumUpdates << LL_ENDL; + LL_INFOS() << getDebugName() << ": joint touches: " << LLJoint::sNumTouches << " updates: " << LLJoint::sNumUpdates << LL_ENDL; } LLJoint::sNumUpdates = 0; @@ -4602,7 +4600,7 @@ bool LLVOAvatar::updateCharacter(LLAgent &agent) is_attachment = cav && cav->mRootVolp && cav->mRootVolp->isAttachment(); // For attached animated objects } - LLScopedContextString str("updateCharacter " + getFullname() + " is_control_avatar " + LLScopedContextString str("updateCharacter " + getDebugName() + " is_control_avatar " + boost::lexical_cast(is_control_avatar) + " is_attachment " + boost::lexical_cast(is_attachment)); @@ -6021,8 +6019,11 @@ void LLVOAvatar::resetAnimations() flushAllMotions(); } -// Override selectively based on avatar sex and whether we're using new -// animations. +//----------------------------------------------------------------------------- +// remapMotionID() +// Override selectively based on avatar sex and whether we're using new animations. +//----------------------------------------------------------------------------- +// virtual LLUUID LLVOAvatar::remapMotionID(const LLUUID& id) { static LLCachedControl use_new_walk_run(gSavedSettings, "UseNewWalkRun"); @@ -6072,7 +6073,6 @@ LLUUID LLVOAvatar::remapMotionID(const LLUUID& id) } return result; - } //----------------------------------------------------------------------------- @@ -6080,6 +6080,7 @@ LLUUID LLVOAvatar::remapMotionID(const LLUUID& id) // id is the asset if of the animation to start // time_offset is the offset into the animation at which to start playing //----------------------------------------------------------------------------- +// virtual BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) { LL_DEBUGS("Motion") << "motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL; @@ -6102,6 +6103,7 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) //----------------------------------------------------------------------------- // stopMotion() //----------------------------------------------------------------------------- +// virtual BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate) { LL_DEBUGS("Motion") << "Motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL; @@ -6141,15 +6143,30 @@ void LLVOAvatar::stopMotionFromSource(const LLUUID& source_id) //----------------------------------------------------------------------------- // addDebugText() //----------------------------------------------------------------------------- +// virtual void LLVOAvatar::addDebugText(const std::string& text) { mDebugText.append(1, '\n'); mDebugText.append(text); } +//----------------------------------------------------------------------------- +// getDebugName() +//----------------------------------------------------------------------------- +// virtual +std::string LLVOAvatar::getDebugName() const +{ +#if LL_RELEASE_WITH_DEBUG_INFO + return getFullname(); +#else + return getID().asString(); +#endif // LL_RELEASE_WITH_DEBUG_INFO +} + //----------------------------------------------------------------------------- // getID() //----------------------------------------------------------------------------- +// virtual const LLUUID& LLVOAvatar::getID() const { return mID; @@ -6159,6 +6176,7 @@ const LLUUID& LLVOAvatar::getID() const // getJoint() //----------------------------------------------------------------------------- // RN: avatar joints are multi-rooted to include screen-based attachments +// virtual LLJoint *LLVOAvatar::getJoint( const std::string &name ) { joint_map_t::iterator iter = mJointMap.find(name); @@ -6274,7 +6292,7 @@ bool LLVOAvatar::jointIsRiggedTo(const LLJoint *joint) const void LLVOAvatar::clearAttachmentOverrides() { - LLScopedContextString str("clearAttachmentOverrides " + getFullname()); + LLScopedContextString str("clearAttachmentOverrides " + getDebugName()); for (S32 i=0; i(ss, ",")); - LL_INFOS() << getFullname() << " attachment positions defined for joints: " << ss.str() << "\n" << LL_ENDL; + LL_INFOS() << avString() << " attachment positions defined for joints: " << ss.str() << "\n" << LL_ENDL; } else { - LL_DEBUGS("Avatar") << getFullname() << " no attachment positions defined for any joints" << "\n" << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << " no attachment positions defined for any joints" << "\n" << LL_ENDL; } if (scale_names.size()) { std::stringstream ss; std::copy(scale_names.begin(), scale_names.end(), std::ostream_iterator(ss, ",")); - LL_INFOS() << getFullname() << " attachment scales defined for joints: " << ss.str() << "\n" << LL_ENDL; + LL_INFOS() << getDebugName() << " attachment scales defined for joints: " << ss.str() << "\n" << LL_ENDL; } else { - LL_INFOS() << getFullname() << " no attachment scales defined for any joints" << "\n" << LL_ENDL; + LL_INFOS() << getDebugName() << " no attachment scales defined for any joints" << "\n" << LL_ENDL; } if (!verbose) @@ -9209,12 +9227,12 @@ void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value) void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, const LLAppearanceMessageContents& contents) { - std::string outfilename = get_sequential_numbered_file_name(dump_prefix,".xml"); + std::string outfilename = get_sequential_numbered_file_name(dump_prefix, ".xml"); const std::vector& params_for_dump = contents.mParamWeights; const LLTEContents& tec = contents.mTEContents; LLAPRFile outfile; - std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); + std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, outfilename); outfile.open(fullpath, LL_APR_WB ); apr_file_t* file = outfile.getFileHandle(); if (!file) @@ -9283,7 +9301,7 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe contents.mHoverOffset = hover; contents.mHoverOffsetWasSet = true; } - + // Parse visual params, if any. S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_VisualParam); static LLCachedControl block_some_avatars(gSavedSettings, "BlockSomeAvatarAppearanceVisualParams"); @@ -9307,7 +9325,7 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe { param = getNextVisualParam(); } - + if( !param ) { // more visual params supplied than expected - just process what we know about @@ -9396,7 +9414,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) static LLCachedControl enable_verbose_dumps(gSavedSettings, "DebugAvatarAppearanceMessage"); static LLCachedControl block_avatar_appearance_messages(gSavedSettings, "BlockAvatarAppearanceMessages"); - std::string dump_prefix = getFullname() + "_" + (isSelf()?"s":"o") + "_"; + std::string dump_prefix = getDebugName() + (isSelf() ? "_s_" : "_o_"); if (block_avatar_appearance_messages) { LL_WARNS() << "Blocking AvatarAppearance message" << LL_ENDL; @@ -10028,17 +10046,13 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara std::string outprefix(prefix); if (outprefix.empty()) { - outprefix = getFullname() + (isSelf()?"_s":"_o"); - } - if (outprefix.empty()) - { - outprefix = std::string("new_archetype"); + outprefix = getDebugName() + (isSelf() ? "_s" : "_o"); } - std::string outfilename = get_sequential_numbered_file_name(outprefix,".xml"); - + std::string outfilename = get_sequential_numbered_file_name(outprefix, ".xml"); + LLAPRFile outfile; LLWearableType *wr_inst = LLWearableType::getInstance(); - std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); + std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, outfilename); if (APR_SUCCESS == outfile.open(fullpath, LL_APR_WB )) { apr_file_t* file = outfile.getFileHandle(); @@ -10537,7 +10551,7 @@ void LLVOAvatar::updateRiggingInfo() { LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; - LL_DEBUGS("RigSpammish") << getFullname() << " updating rig tab" << LL_ENDL; + LL_DEBUGS("RigSpammish") << getDebugName() << " updating rig tab" << LL_ENDL; std::vector volumes; @@ -10575,7 +10589,7 @@ void LLVOAvatar::updateRiggingInfo() } //LL_INFOS() << "done update rig count is " << countRigInfoTab(mJointRiggingInfoTab) << LL_ENDL; - LL_DEBUGS("RigSpammish") << getFullname() << " after update rig tab:" << LL_ENDL; + LL_DEBUGS("RigSpammish") << getDebugName() << " after update rig tab:" << LL_ENDL; S32 joint_count, box_count; showRigInfoTabExtents(this, mJointRiggingInfoTab, joint_count, box_count); LL_DEBUGS("RigSpammish") << "uses " << joint_count << " joints " << " nonzero boxes: " << box_count << LL_ENDL; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 77f50a83f8..6a907ef079 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -238,8 +238,9 @@ public: std::set mActiveOverrideMeshes; virtual void onActiveOverrideMeshesChanged(); - + /*virtual*/ const LLUUID& getID() const; + /*virtual*/ std::string getDebugName() const; /*virtual*/ void addDebugText(const std::string& text); /*virtual*/ F32 getTimeDilation(); /*virtual*/ void getGround(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e3f2afadc5..b0d79cd341 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1425,7 +1425,7 @@ BOOL LLVOVolume::calcLOD() const LLVector3* box = avatar->getLastAnimExtents(); LLVector3 diag = box[1] - box[0]; radius = diag.magVec() * 0.5f; - LL_DEBUGS("DynamicBox") << avatar->getFullname() << " diag " << diag << " radius " << radius << LL_ENDL; + LL_DEBUGS("DynamicBox") << avatar->getDebugName() << " diag " << diag << " radius " << radius << LL_ENDL; } else { @@ -1436,7 +1436,7 @@ BOOL LLVOVolume::calcLOD() const LLVector3* box = avatar->getLastAnimExtents(); LLVector3 diag = box[1] - box[0]; radius = diag.magVec(); // preserve old BinRadius behavior - 2x off - LL_DEBUGS("DynamicBox") << avatar->getFullname() << " diag " << diag << " radius " << radius << LL_ENDL; + LL_DEBUGS("DynamicBox") << avatar->getDebugName() << " diag " << diag << " radius " << radius << LL_ENDL; } if (distance <= 0.f || radius <= 0.f) { -- cgit v1.2.3