diff options
author | RunitaiLinden <davep@lindenlab.com> | 2023-10-11 14:21:00 -0500 |
---|---|---|
committer | RunitaiLinden <davep@lindenlab.com> | 2023-10-11 14:21:00 -0500 |
commit | 9cd5314ca8c4d7e0b2f5beda6893eca026594a2d (patch) | |
tree | 9b2f7098d8ee708704da8e16b3b3635e3c82407b /indra/newview | |
parent | 478703e3c82df7b5751d80007264468bf44cb379 (diff) | |
parent | 61a04f5ee1582d2d53874b8ef81a0e773df0fbfe (diff) |
Merge branch 'DRTVWR-559' of github.com:secondlife/viewer into DRTVWR-559
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterimcontainer.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llfloaterimsessiontab.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 86 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.h | 2 | ||||
-rw-r--r-- | indra/newview/lllogchat.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llselectmgr.cpp | 8 | ||||
-rw-r--r-- | indra/newview/lltexturectrl.cpp | 223 | ||||
-rw-r--r-- | indra/newview/lltexturectrl.h | 4 | ||||
-rw-r--r-- | indra/newview/lltexturefetch.cpp | 95 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 98 |
10 files changed, 308 insertions, 215 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 2720b7fcf7..011ad67011 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -289,6 +289,9 @@ void LLFloaterIMContainer::onOpen(const LLSD& key) LLMultiFloater::onOpen(key); reSelectConversation(); assignResizeLimits(); + + LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(mSelectedSession); + session_floater->onOpen(key); } // virtual diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index af4e7f5aff..0b0dce29fb 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -986,6 +986,8 @@ void LLFloaterIMSessionTab::onOpen(const LLSD& key) } mInputButtonPanel->setVisible(isTornOff()); + + setFocus(TRUE); } diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 355d222b27..154d8e2e18 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1449,45 +1449,6 @@ void LLInventoryPanel::onFocusReceived() // inventory now handles cut/copy/paste/delete LLEditMenuHandler::gEditMenuHandler = mFolderRoot.get(); - // Tab support, when tabbing into this view, select first item - // (ideally needs to account for scroll) - bool select_first = mSelectThisID.isNull() && mFolderRoot.get() && mFolderRoot.get()->getSelectedCount() == 0; - - if (select_first) - { - LLFolderViewFolder::folders_t::const_iterator folders_it = mFolderRoot.get()->getFoldersBegin(); - LLFolderViewFolder::folders_t::const_iterator folders_end = mFolderRoot.get()->getFoldersEnd(); - - for (; folders_it != folders_end; ++folders_it) - { - const LLFolderViewFolder* folder_view = *folders_it; - if (folder_view->getVisible()) - { - const LLFolderViewModelItemInventory* modelp = static_cast<const LLFolderViewModelItemInventory*>(folder_view->getViewModelItem()); - setSelectionByID(modelp->getUUID(), TRUE); - select_first = false; - break; - } - } - } - - if (select_first) - { - LLFolderViewFolder::items_t::const_iterator items_it = mFolderRoot.get()->getItemsBegin(); - LLFolderViewFolder::items_t::const_iterator items_end = mFolderRoot.get()->getItemsEnd(); - - for (; items_it != items_end; ++items_it) - { - const LLFolderViewItem* item_view = *items_it; - if (item_view->getVisible()) - { - const LLFolderViewModelItemInventory* modelp = static_cast<const LLFolderViewModelItemInventory*>(item_view->getViewModelItem()); - setSelectionByID(modelp->getUUID(), TRUE); - break; - } - } - } - LLPanel::onFocusReceived(); } @@ -2258,6 +2219,53 @@ void LLInventorySingleFolderPanel::initFromParams(const Params& p) LLPanel::initFromParams(mParams); } +void LLInventorySingleFolderPanel::onFocusReceived() +{ + // Tab support, when tabbing into this view, select first item + // (ideally needs to account for scroll) + bool select_first = mSelectThisID.isNull() && mFolderRoot.get() && mFolderRoot.get()->getSelectedCount() == 0; + + if (select_first) + { + LLFolderViewFolder::folders_t::const_iterator folders_it = mFolderRoot.get()->getFoldersBegin(); + LLFolderViewFolder::folders_t::const_iterator folders_end = mFolderRoot.get()->getFoldersEnd(); + + for (; folders_it != folders_end; ++folders_it) + { + const LLFolderViewFolder* folder_view = *folders_it; + if (folder_view->getVisible()) + { + const LLFolderViewModelItemInventory* modelp = static_cast<const LLFolderViewModelItemInventory*>(folder_view->getViewModelItem()); + setSelectionByID(modelp->getUUID(), TRUE); + // quick and dirty fix: don't scroll on switching focus + // todo: better 'tab' support, one that would work for LLInventoryPanel + mFolderRoot.get()->stopAutoScollining(); + select_first = false; + break; + } + } + } + + if (select_first) + { + LLFolderViewFolder::items_t::const_iterator items_it = mFolderRoot.get()->getItemsBegin(); + LLFolderViewFolder::items_t::const_iterator items_end = mFolderRoot.get()->getItemsEnd(); + + for (; items_it != items_end; ++items_it) + { + const LLFolderViewItem* item_view = *items_it; + if (item_view->getVisible()) + { + const LLFolderViewModelItemInventory* modelp = static_cast<const LLFolderViewModelItemInventory*>(item_view->getViewModelItem()); + setSelectionByID(modelp->getUUID(), TRUE); + mFolderRoot.get()->stopAutoScollining(); + break; + } + } + } + LLInventoryPanel::onFocusReceived(); +} + void LLInventorySingleFolderPanel::initFolderRoot(const LLUUID& start_folder_id) { if(mRootInited) return; diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 4d69bdf17d..b68433bab0 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -404,6 +404,8 @@ public: {}; void initFromParams(const Params& p); + void onFocusReceived() override; + bool isSelectionRemovable() { return false; } void initFolderRoot(const LLUUID& start_folder_id = LLUUID::null); diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index ba82ff0b0f..07825c1b0c 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -59,7 +59,7 @@ #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/date_time/local_time_adjustor.hpp> -const S32 LOG_RECALL_SIZE = 2048; +const S32 LOG_RECALL_SIZE = 20480; const std::string LL_IM_TIME("time"); const std::string LL_IM_DATE_TIME("datetime"); diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 98ee6a6859..c86e43333c 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -1780,6 +1780,10 @@ bool LLObjectSelection::applyRestrictedPbrMaterialToTEs(LLViewerInventoryItem* i } LLUUID asset_id = item->getAssetUUID(); + if (asset_id.isNull()) + { + asset_id = LLGLTFMaterialList::BLANK_MATERIAL_ASSET_ID; + } bool material_copied_all_faces = true; @@ -1976,6 +1980,10 @@ bool LLSelectMgr::selectionSetGLTFMaterial(const LLUUID& mat_id) return false; } asset_id = mItem->getAssetUUID(); + if (asset_id.isNull()) + { + asset_id = LLGLTFMaterialList::BLANK_MATERIAL_ASSET_ID; + } } // Blank out most override data on the object and send to server diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 8a8abc222f..10667b02d9 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -138,6 +138,8 @@ bool get_can_copy_texture(LLUUID asset_id) return get_is_predefined_texture(asset_id) || get_copy_free_item_by_asset_id(asset_id).notNull(); } +S32 LLFloaterTexturePicker::sLastPickerMode = 0; + LLFloaterTexturePicker::LLFloaterTexturePicker( LLView* owner, LLUUID image_asset_id, @@ -213,15 +215,38 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id, bool set_selecti mModeSelector->selectByValue(0); onModeSelect(0,this); } - - LLUUID item_id = findItemID(mImageAssetID, FALSE); + + LLUUID item_id; + LLFolderView* root_folder = mInventoryPanel->getRootFolder(); + if (root_folder && root_folder->getCurSelectedItem()) + { + LLFolderViewItem* last_selected = root_folder->getCurSelectedItem(); + LLFolderViewModelItemInventory* inv_view = static_cast<LLFolderViewModelItemInventory*>(last_selected->getViewModelItem()); + + LLInventoryItem* itemp = gInventory.getItem(inv_view->getUUID()); + + if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL + && mImageAssetID == LLGLTFMaterialList::BLANK_MATERIAL_ASSET_ID + && itemp && itemp->getAssetUUID().isNull()) + { + item_id = inv_view->getUUID(); + } + else if (itemp && itemp->getAssetUUID() == mImageAssetID) + { + item_id = inv_view->getUUID(); + } + } + if (item_id.isNull()) + { + item_id = findItemID(mImageAssetID, FALSE); + } if (item_id.isNull()) { mInventoryPanel->getRootFolder()->clearSelection(); } else { - LLInventoryItem* itemp = gInventory.getItem(image_id); + LLInventoryItem* itemp = gInventory.getItem(item_id); if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) { // no copy texture @@ -492,6 +517,15 @@ BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask) return LLFloater::handleKeyHere(key, mask); } +void LLFloaterTexturePicker::onOpen(const LLSD& key) +{ + if (sLastPickerMode != 0 + && mModeSelector->selectByValue(sLastPickerMode)) + { + changeMode(); + } +} + void LLFloaterTexturePicker::onClose(bool app_quitting) { if (mOwner && mOnFloaterCloseCallback) @@ -499,6 +533,7 @@ void LLFloaterTexturePicker::onClose(bool app_quitting) mOnFloaterCloseCallback(); } stopUsingPipette(); + sLastPickerMode = mModeSelector->getValue().asInteger(); } // virtual @@ -741,14 +776,22 @@ void LLFloaterTexturePicker::draw() const LLUUID& LLFloaterTexturePicker::findItemID(const LLUUID& asset_id, BOOL copyable_only, BOOL ignore_library) { - if (asset_id.isNull()) + LLUUID loockup_id = asset_id; + if (loockup_id.isNull()) { - return LLUUID::null; + if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL) + { + loockup_id = LLGLTFMaterialList::BLANK_MATERIAL_ASSET_ID; + } + else + { + return LLUUID::null; + } } LLViewerInventoryCategory::cat_array_t cats; LLViewerInventoryItem::item_array_t items; - LLAssetIDMatches asset_id_matches(asset_id); + LLAssetIDMatches asset_id_matches(loockup_id); gInventory.collectDescendentsIf(LLUUID::null, cats, items, @@ -816,7 +859,14 @@ void LLFloaterTexturePicker::commitCallback(LLTextureCtrl::ETexturePickOp op) LLFolderViewModelItemInventory* inv_view = static_cast<LLFolderViewModelItemInventory*>(last_selected->getViewModelItem()); LLInventoryItem* itemp = gInventory.getItem(inv_view->getUUID()); - if (itemp && itemp->getAssetUUID() == mImageAssetID) + + if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL + && mImageAssetID == LLGLTFMaterialList::BLANK_MATERIAL_ASSET_ID + && itemp && itemp->getAssetUUID().isNull()) + { + inventory_id = inv_view->getUUID(); + } + else if (itemp && itemp->getAssetUUID() == mImageAssetID) { inventory_id = inv_view->getUUID(); } @@ -994,85 +1044,8 @@ void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem // static void LLFloaterTexturePicker::onModeSelect(LLUICtrl* ctrl, void *userdata) { - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - int index = self->mModeSelector->getValue().asInteger(); - - self->mDefaultBtn->setVisible(index == PICKER_INVENTORY ? TRUE : FALSE); - self->mBlankBtn->setVisible(index == PICKER_INVENTORY ? TRUE : FALSE); - self->mNoneBtn->setVisible(index == PICKER_INVENTORY ? TRUE : FALSE); - self->getChild<LLFilterEditor>("inventory search editor")->setVisible(index == PICKER_INVENTORY ? TRUE : FALSE); - self->getChild<LLInventoryPanel>("inventory panel")->setVisible(index == PICKER_INVENTORY ? TRUE : FALSE); - - /*self->getChild<LLCheckBox>("show_folders_check")->setVisible(mode); - no idea under which conditions the above is even shown, needs testing. */ - - self->getChild<LLButton>("l_add_btn")->setVisible(index == PICKER_LOCAL ? TRUE : FALSE); - self->getChild<LLButton>("l_rem_btn")->setVisible(index == PICKER_LOCAL ? TRUE : FALSE); - self->getChild<LLButton>("l_upl_btn")->setVisible(index == PICKER_LOCAL ? TRUE : FALSE); - self->getChild<LLScrollListCtrl>("l_name_list")->setVisible(index == PICKER_LOCAL ? TRUE : FALSE); - - self->getChild<LLComboBox>("l_bake_use_texture_combo_box")->setVisible(index == PICKER_BAKE ? TRUE : FALSE); - self->getChild<LLCheckBoxCtrl>("hide_base_mesh_region")->setVisible(FALSE);// index == 2 ? TRUE : FALSE); - - bool pipette_visible = (index == PICKER_INVENTORY) - && (self->mInventoryPickType != LLTextureCtrl::PICK_MATERIAL); - self->mPipetteBtn->setVisible(pipette_visible); - - if (index == PICKER_BAKE) - { - self->stopUsingPipette(); - - S8 val = -1; - - LLUUID imageID = self->mImageAssetID; - if (imageID == IMG_USE_BAKED_HEAD) - { - val = 0; - } - else if (imageID == IMG_USE_BAKED_UPPER) - { - val = 1; - } - else if (imageID == IMG_USE_BAKED_LOWER) - { - val = 2; - } - else if (imageID == IMG_USE_BAKED_EYES) - { - val = 3; - } - else if (imageID == IMG_USE_BAKED_SKIRT) - { - val = 4; - } - else if (imageID == IMG_USE_BAKED_HAIR) - { - val = 5; - } - else if (imageID == IMG_USE_BAKED_LEFTARM) - { - val = 6; - } - else if (imageID == IMG_USE_BAKED_LEFTLEG) - { - val = 7; - } - else if (imageID == IMG_USE_BAKED_AUX1) - { - val = 8; - } - else if (imageID == IMG_USE_BAKED_AUX2) - { - val = 9; - } - else if (imageID == IMG_USE_BAKED_AUX3) - { - val = 10; - } - - - self->getChild<LLComboBox>("l_bake_use_texture_combo_box")->setSelectedByValue(val, TRUE); - } + LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; + self->changeMode(); } // static @@ -1348,6 +1321,84 @@ void LLFloaterTexturePicker::onFilterEdit(const std::string& search_string ) mInventoryPanel->setFilterSubString(search_string); } +void LLFloaterTexturePicker::changeMode() +{ + int index = mModeSelector->getValue().asInteger(); + + mDefaultBtn->setVisible(index == PICKER_INVENTORY ? TRUE : FALSE); + mBlankBtn->setVisible(index == PICKER_INVENTORY ? TRUE : FALSE); + mNoneBtn->setVisible(index == PICKER_INVENTORY ? TRUE : FALSE); + mFilterEdit->setVisible(index == PICKER_INVENTORY ? TRUE : FALSE); + mInventoryPanel->setVisible(index == PICKER_INVENTORY ? TRUE : FALSE); + + getChild<LLButton>("l_add_btn")->setVisible(index == PICKER_LOCAL ? TRUE : FALSE); + getChild<LLButton>("l_rem_btn")->setVisible(index == PICKER_LOCAL ? TRUE : FALSE); + getChild<LLButton>("l_upl_btn")->setVisible(index == PICKER_LOCAL ? TRUE : FALSE); + getChild<LLScrollListCtrl>("l_name_list")->setVisible(index == PICKER_LOCAL ? TRUE : FALSE); + + getChild<LLComboBox>("l_bake_use_texture_combo_box")->setVisible(index == PICKER_BAKE ? TRUE : FALSE); + getChild<LLCheckBoxCtrl>("hide_base_mesh_region")->setVisible(FALSE);// index == 2 ? TRUE : FALSE); + + bool pipette_visible = (index == PICKER_INVENTORY) + && (mInventoryPickType != LLTextureCtrl::PICK_MATERIAL); + mPipetteBtn->setVisible(pipette_visible); + + if (index == PICKER_BAKE) + { + stopUsingPipette(); + + S8 val = -1; + + LLUUID imageID = mImageAssetID; + if (imageID == IMG_USE_BAKED_HEAD) + { + val = 0; + } + else if (imageID == IMG_USE_BAKED_UPPER) + { + val = 1; + } + else if (imageID == IMG_USE_BAKED_LOWER) + { + val = 2; + } + else if (imageID == IMG_USE_BAKED_EYES) + { + val = 3; + } + else if (imageID == IMG_USE_BAKED_SKIRT) + { + val = 4; + } + else if (imageID == IMG_USE_BAKED_HAIR) + { + val = 5; + } + else if (imageID == IMG_USE_BAKED_LEFTARM) + { + val = 6; + } + else if (imageID == IMG_USE_BAKED_LEFTLEG) + { + val = 7; + } + else if (imageID == IMG_USE_BAKED_AUX1) + { + val = 8; + } + else if (imageID == IMG_USE_BAKED_AUX2) + { + val = 9; + } + else if (imageID == IMG_USE_BAKED_AUX3) + { + val = 10; + } + + getChild<LLComboBox>("l_bake_use_texture_combo_box")->setSelectedByValue(val, TRUE); + } +} + void LLFloaterTexturePicker::refreshLocalList() { mLocalScrollCtrl->clearRows(); diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index b742ea2da3..180c4fa4b8 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -306,6 +306,7 @@ public: // LLFloater overrides /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void onClose(bool app_settings); // New functions @@ -365,6 +366,7 @@ public: static void onPickerCallback(const std::vector<std::string>& filenames, LLHandle<LLFloater> handle); protected: + void changeMode(); void refreshLocalList(); void refreshInventoryFilter(); void setImageIDFromItem(const LLInventoryItem* itemp, bool set_selection = true); @@ -427,6 +429,8 @@ private: set_on_update_image_stats_callback mOnUpdateImageStatsCallback; BOOL mBakeTextureEnabled; + + static S32 sLastPickerMode; }; #endif // LL_LLTEXTURECTRL_H diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index fd46d54a1d..e669393dba 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -239,6 +239,10 @@ static const S32 HTTP_NONPIPE_REQUESTS_LOW_WATER = 20; // request (e.g. 'Range: <start>-') which seems to fix the problem. static const S32 HTTP_REQUESTS_RANGE_END_MAX = 20000000; +// stop after 720 seconds, might be overkill, but cap request can keep going forever. +static const S32 MAX_CAP_MISSING_RETRIES = 720; +static const S32 CAP_MISSING_EXPIRATION_DELAY = 1; // seconds + ////////////////////////////////////////////////////////////////////////////// namespace { @@ -526,6 +530,7 @@ private: e_state mState; void setState(e_state new_state); + LLViewerRegion* getRegion(); e_write_to_cache_state mWriteToCacheState; LLTextureFetch* mFetcher; @@ -579,6 +584,10 @@ private: LLCore::HttpStatus mGetStatus; std::string mGetReason; LLAdaptiveRetryPolicy mFetchRetryPolicy; + bool mCanUseCapability; + LLTimer mRegionRetryTimer; + S32 mRegionRetryAttempt; + LLUUID mLastRegionId; // Work Data @@ -928,7 +937,9 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mCacheReadCount(0U), mCacheWriteCount(0U), mResourceWaitCount(0U), - mFetchRetryPolicy(10.f,3600.f,2.f,10) + mFetchRetryPolicy(10.f,3600.f,2.f,10), + mCanUseCapability(true), + mRegionRetryAttempt(0) { mType = host.isOk() ? LLImageBase::TYPE_AVATAR_BAKE : LLImageBase::TYPE_NORMAL; // LL_INFOS(LOG_TXT) << "Create: " << mID << " mHost:" << host << " Discard=" << discard << LL_ENDL; @@ -1089,6 +1100,18 @@ bool LLTextureFetchWorker::doWork(S32 param) return true; // abort } } + if (mState > CACHE_POST && !mCanUseCapability && mCanUseHTTP) + { + if (mRegionRetryAttempt > MAX_CAP_MISSING_RETRIES) + { + mCanUseHTTP = false; + } + else if (!mRegionRetryTimer.hasExpired()) + { + return false; + } + // else retry + } if(mState > CACHE_POST && !mCanUseHTTP) { LL_PROFILE_ZONE_NAMED_CATEGORY_THREAD("tfwdw - state > cache_post"); @@ -1290,16 +1313,7 @@ bool LLTextureFetchWorker::doWork(S32 param) // if (mHost.isInvalid()) get_url = false; if ( use_http && mCanUseHTTP && mUrl.empty())//get http url. { - LLViewerRegion* region = NULL; - if (mHost.isInvalid()) - { - region = gAgent.getRegion(); - } - else if (LLWorld::instanceExists()) - { - region = LLWorld::getInstance()->getRegion(mHost); - } - + LLViewerRegion* region = getRegion(); if (region) { std::string http_url = region->getViewerAssetUrl(); @@ -1312,19 +1326,27 @@ bool LLTextureFetchWorker::doWork(S32 param) setUrl(http_url + "/?texture_id=" + mID.asString().c_str()); LL_DEBUGS(LOG_TXT) << "Texture URL: " << mUrl << LL_ENDL; mWriteToCacheState = CAN_WRITE ; //because this texture has a fixed texture id. + mCanUseCapability = true; + mRegionRetryAttempt = 0; + mLastRegionId = region->getRegionID(); } else { - mCanUseHTTP = false ; - LL_WARNS(LOG_TXT) << "Texture not available via HTTP: empty URL." << LL_ENDL; + mCanUseCapability = false; + mRegionRetryAttempt++; + mRegionRetryTimer.setTimerExpirySec(CAP_MISSING_EXPIRATION_DELAY); + // ex: waiting for caps + LL_INFOS_ONCE(LOG_TXT) << "Texture not available via HTTP: empty URL." << LL_ENDL; } } else { + mCanUseCapability = false; + mRegionRetryAttempt++; + mRegionRetryTimer.setTimerExpirySec(CAP_MISSING_EXPIRATION_DELAY); // This will happen if not logged in or if a region deoes not have HTTP Texture enabled //LL_WARNS(LOG_TXT) << "Region not found for host: " << mHost << LL_ENDL; - LL_WARNS(LOG_TXT) << "Texture not available via HTTP: no region " << mUrl << LL_ENDL; - mCanUseHTTP = false; + LL_INFOS_ONCE(LOG_TXT) << "Texture not available via HTTP: no region " << mUrl << LL_ENDL; } } else if (mFTType == FTT_SERVER_BAKE) @@ -1332,7 +1354,7 @@ bool LLTextureFetchWorker::doWork(S32 param) mWriteToCacheState = CAN_WRITE; } - if (mCanUseHTTP && !mUrl.empty()) + if (mCanUseCapability && mCanUseHTTP && !mUrl.empty()) { setState(WAIT_HTTP_RESOURCE); if(mWriteToCacheState != NOT_WRITE) @@ -1534,10 +1556,37 @@ bool LLTextureFetchWorker::doWork(S32 param) } return true; } + + if (mCanUseHTTP && !mUrl.empty() && cur_size <= 0) + { + LLViewerRegion* region = getRegion(); + if (!region || mLastRegionId != region->getRegionID()) + { + // cap failure? try on new region. + mUrl.clear(); + ++mRetryAttempt; + mLastRegionId.setNull(); + setState(INIT); + return false; + } + } } else if (http_service_unavail == mGetStatus) { LL_INFOS_ONCE(LOG_TXT) << "Texture server busy (503): " << mUrl << LL_ENDL; + if (mCanUseHTTP && !mUrl.empty() && cur_size <= 0) + { + LLViewerRegion* region = getRegion(); + if (!region || mLastRegionId != region->getRegionID()) + { + // try on new region. + mUrl.clear(); + ++mRetryAttempt; + mLastRegionId.setNull(); + setState(INIT); + return false; + } + } } else if (http_not_sat == mGetStatus) { @@ -3054,6 +3103,20 @@ void LLTextureFetchWorker::setState(e_state new_state) mState = new_state; } +LLViewerRegion* LLTextureFetchWorker::getRegion() +{ + LLViewerRegion* region = NULL; + if (mHost.isInvalid()) + { + region = gAgent.getRegion(); + } + else if (LLWorld::instanceExists()) + { + region = LLWorld::getInstance()->getRegion(mHost); + } + return region; +} + ////////////////////////////////////////////////////////////////////////////// // Threads: T* diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 468943423a..ec2f490742 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -619,8 +619,18 @@ void LLVOVolume::animateTextures() continue; } - LLGLTFMaterial *gltf_mat = te->getGLTFRenderMaterial(); - const bool is_pbr = gltf_mat != nullptr; + if (!(result & LLViewerTextureAnim::ROTATE)) + { + te->getRotation(&rot); + } + if (!(result & LLViewerTextureAnim::TRANSLATE)) + { + te->getOffset(&off_s,&off_t); + } + if (!(result & LLViewerTextureAnim::SCALE)) + { + te->getScale(&scale_s, &scale_t); + } if (!facep->mTextureMatrix) { @@ -629,80 +639,22 @@ void LLVOVolume::animateTextures() LLMatrix4& tex_mat = *facep->mTextureMatrix; tex_mat.setIdentity(); + LLVector3 trans ; - if (!is_pbr) - { - if (!(result & LLViewerTextureAnim::ROTATE)) - { - te->getRotation(&rot); - } - if (!(result & LLViewerTextureAnim::TRANSLATE)) - { - te->getOffset(&off_s,&off_t); - } - if (!(result & LLViewerTextureAnim::SCALE)) - { - te->getScale(&scale_s, &scale_t); - } - - LLVector3 trans ; - - trans.set(LLVector3(off_s+0.5f, off_t+0.5f, 0.f)); - tex_mat.translate(LLVector3(-0.5f, -0.5f, 0.f)); - - LLVector3 scale(scale_s, scale_t, 1.f); - LLQuaternion quat; - quat.setQuat(rot, 0, 0, -1.f); - - tex_mat.rotate(quat); - - LLMatrix4 mat; - mat.initAll(scale, LLQuaternion(), LLVector3()); - tex_mat *= mat; - - tex_mat.translate(trans); - } - else - { - if (!(result & LLViewerTextureAnim::ROTATE)) - { - rot = 0.0f; - } - if (!(result & LLViewerTextureAnim::TRANSLATE)) - { - off_s = 0.0f; - off_t = 0.0f; - } - if (!(result & LLViewerTextureAnim::SCALE)) - { - scale_s = 1.0f; - scale_t = 1.0f; - } - - // For PBR materials, use Blinn-Phong rotation as hint for - // translation direction. In a Blinn-Phong material, the - // translation direction would be a byproduct the texture - // transform. - F32 rot_frame; - te->getRotation(&rot_frame); - - tex_mat.translate(LLVector3(-0.5f, -0.5f, 0.f)); - - LLQuaternion quat; - quat.setQuat(rot, 0, 0, -1.f); - tex_mat.rotate(quat); + trans.set(LLVector3(off_s+0.5f, off_t+0.5f, 0.f)); + tex_mat.translate(LLVector3(-0.5f, -0.5f, 0.f)); - LLMatrix4 mat; - LLVector3 scale(scale_s, scale_t, 1.f); - mat.initAll(scale, LLQuaternion(), LLVector3()); - tex_mat *= mat; - - LLVector3 off(off_s, off_t, 0.f); - off.rotVec(rot_frame, 0, 0, 1.f); - tex_mat.translate(off); + LLVector3 scale(scale_s, scale_t, 1.f); + LLQuaternion quat; + quat.setQuat(rot, 0, 0, -1.f); + + tex_mat.rotate(quat); - tex_mat.translate(LLVector3(0.5f, 0.5f, 0.f)); - } + LLMatrix4 mat; + mat.initAll(scale, LLQuaternion(), LLVector3()); + tex_mat *= mat; + + tex_mat.translate(trans); } } else |