From 63a40347e361e19a4ea7aa02db96dd5cc6f3d8c3 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 15 Oct 2024 22:35:38 +0200 Subject: Fix merge issues: * Restore changes from 21947778baaca205615a71a97ac8f563c998fdd3 to llwindow/llwindowwin32.cpp * Restore changes from 3758618949684641fc94b5c9478d9002706213cc to newview/llinspecttexture.cpp * Fix apparent merge error in LLInventoryPanel::itemChanged * Restore changes from 1eeecfa1a8bf43a8980217ce34e3b5f4458483e0 in newview/llpaneloutfitsinventory.h * Restore changes from b9633c17e373bfe55b29228996e8473eb041466d in newview/llpaneloutfitsinventory.h & newview/llpanelwearing.cpp * Restore changes from f660f1f0fda4d2363d351fa550b4f8818b46c2c3 in newview/llviewertexture.cpp * Restore changes from b9633c17e373bfe55b29228996e8473eb041466d & 98f7d73d46fdc045759023eda6409e8c791f5cb2 in newview/lloutfitgallery.cpp and newview/lloutfitslist.cpp * Replace changes from 23729442aab7130f3368d433e8a5a9dd45ff6b98 with current implementation in develop branch * Fix more broken changes in LLViewerTexture::saveRawImage * Restore the changes in LLMath both from develop and maint-c * Fix all kind of other merge errors --- indra/llinventory/llinventory.cpp | 2 +- indra/llmath/llmath.h | 2 +- indra/llmath/v2math.h | 4 +- indra/llmath/v3math.h | 10 +-- indra/llmath/v4math.h | 4 +- indra/llui/llfolderviewitem.cpp | 4 - indra/llwindow/llwindowwin32.cpp | 112 ++++++++------------------- indra/newview/llagentcamera.cpp | 2 +- indra/newview/llagentcamera.h | 4 +- indra/newview/llappearancemgr.cpp | 2 +- indra/newview/llfloaterobjectweights.h | 8 +- indra/newview/llfolderviewmodelinventory.cpp | 2 +- indra/newview/llinspecttexture.cpp | 17 ++-- indra/newview/llinventorybridge.cpp | 2 +- indra/newview/llinventoryfilter.cpp | 8 +- indra/newview/llinventorypanel.cpp | 8 +- indra/newview/lllocalbitmaps.cpp | 2 +- indra/newview/llmeshrepository.cpp | 4 +- indra/newview/lloutfitgallery.cpp | 8 -- indra/newview/lloutfitslist.cpp | 14 ---- indra/newview/llpaneloutfitsinventory.h | 2 - indra/newview/llpanelwearing.cpp | 4 - indra/newview/llsidepaneliteminfo.cpp | 4 +- indra/newview/llviewertexture.cpp | 17 +++- indra/newview/llvoavatar.cpp | 80 ++++++++++--------- indra/newview/llvoavatar.h | 2 +- 26 files changed, 127 insertions(+), 201 deletions(-) diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index 14abf76eb9..16c112d411 100644 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -1029,7 +1029,7 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd, bool is_new) 1 */ continue; - } + } if (i->first == INV_THUMBNAIL_ID_LABEL) { diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index fa315291a3..f5e9cdc7e4 100644 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -75,7 +75,7 @@ constexpr F32 DEG_TO_RAD = 0.017453292519943295769236907684886f; constexpr F32 RAD_TO_DEG = 57.295779513082320876798154814105f; constexpr F32 F_APPROXIMATELY_ZERO = 0.00001f; constexpr F32 F_LN10 = 2.3025850929940456840179914546844f; -constexpr F32 OO_LN10 = 0.43429448190325182765112891891661; +constexpr F32 OO_LN10 = 0.43429448190325182765112891891661f; constexpr F32 F_LN2 = 0.69314718056f; constexpr F32 OO_LN2 = 1.4426950408889634073599246810019f; diff --git a/indra/llmath/v2math.h b/indra/llmath/v2math.h index b06739f122..6f2136139a 100644 --- a/indra/llmath/v2math.h +++ b/indra/llmath/v2math.h @@ -212,7 +212,7 @@ inline void LLVector2::setVec(const F32 *vec) inline F32 LLVector2::length() const { - return (F32) sqrt(lengthSquared()); + return sqrt(lengthSquared()); } inline F32 LLVector2::lengthSquared() const @@ -304,7 +304,7 @@ inline LLVector2 operator-(const LLVector2& a, const LLVector2& b) inline F32 operator*(const LLVector2& a, const LLVector2& b) { - return (a.mV[VX]*b.mV[VX] + a.mV[VY]*b.mV[VY]); + return a.mV[VX]*b.mV[VX] + a.mV[VY]*b.mV[VY]; } inline LLVector2 operator%(const LLVector2& a, const LLVector2& b) diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h index bcd8f311a8..c51c3bd316 100644 --- a/indra/llmath/v3math.h +++ b/indra/llmath/v3math.h @@ -233,7 +233,7 @@ inline void LLVector3::set(F32 x, F32 y, F32 z) inline void LLVector3::set(const LLVector3& vec) { - set(vec.mV[0], vec.mV[1], vec.mV[2]); + set(vec.mV[VX], vec.mV[VY], vec.mV[VZ]); } inline void LLVector3::set(const F32* vec) @@ -285,10 +285,10 @@ inline F32 LLVector3::normVec() inline F32 LLVector3::length() const { - return (F32) sqrt(lengthSquared()); + return sqrt(lengthSquared()); } -inline F32 LLVector3::lengthSquared(void) const +inline F32 LLVector3::lengthSquared() const { return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]; } @@ -412,9 +412,7 @@ inline const LLVector3& operator*=(LLVector3& a, const LLVector3& b) inline const LLVector3& operator/=(LLVector3& a, F32 k) { - a.mV[VX] /= k; - a.mV[VY] /= k; - a.mV[VZ] /= k; + a *= 1.f / k; return a; } diff --git a/indra/llmath/v4math.h b/indra/llmath/v4math.h index b906ae24fd..4f36dc6533 100644 --- a/indra/llmath/v4math.h +++ b/indra/llmath/v4math.h @@ -298,7 +298,7 @@ inline void LLVector4::setVec(const F32* vec) inline F32 LLVector4::length() const { - return (F32) sqrt(lengthSquared()); + return sqrt(lengthSquared()); } inline F32 LLVector4::lengthSquared() const @@ -436,7 +436,7 @@ inline LLVector4 lerp(const LLVector4& a, const LLVector4& b, F32 u) inline F32 LLVector4::normalize() { - F32 mag = (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); + F32 mag = sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); if (mag > FP_MAG_THRESHOLD) { diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 477e0bc492..eff276d8c6 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -200,10 +200,6 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) { mViewModelItem->setFolderViewItem(this); } - if (mViewModelItem) - { - mViewModelItem->setFolderViewItem(this); - } } // Destroys the object diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index f0b099df41..9494eee46d 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -344,12 +344,7 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool void run() override; - // Detroys handles and window - // Either post to or call from window thread - void destroyWindow(); - - // Closes queue, wakes thread, waits until thread closes. - // Call from main thread + // closes queue, wakes thread, waits until thread closes bool wakeAndDestroy(); void glReady() @@ -407,7 +402,7 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool // until after some graphics setup. See SL-20177. -Cosmic,2023-09-18 bool mGLReady = false; bool mGotGLBuffer = false; - LLAtomicBool mDeleteOnExit = false; + bool mDeleteOnExit = false; }; @@ -4790,48 +4785,17 @@ void LLWindowWin32::LLWindowWin32Thread::run() #endif } - destroyWindow(); - if (mDeleteOnExit) { delete this; } } -void LLWindowWin32::LLWindowWin32Thread::destroyWindow() -{ - if (mWindowHandleThrd != NULL && IsWindow(mWindowHandleThrd)) - { - if (mhDCThrd) - { - if (!ReleaseDC(mWindowHandleThrd, mhDCThrd)) - { - LL_WARNS("Window") << "Release of ghDC failed!" << LL_ENDL; - } - mhDCThrd = NULL; - } - - // This causes WM_DESTROY to be sent *immediately* - if (!destroy_window_handler(mWindowHandleThrd)) - { - LL_WARNS("Window") << "Failed to destroy Window! " << std::hex << GetLastError() << LL_ENDL; - } - } - else - { - // Something killed the window while we were busy destroying gl or handle somehow got broken - LL_WARNS("Window") << "Failed to destroy Window, invalid handle!" << LL_ENDL; - } - mWindowHandleThrd = NULL; - mhDCThrd = NULL; - mGLReady = false; -} - bool LLWindowWin32::LLWindowWin32Thread::wakeAndDestroy() { if (mQueue->isClosed()) { - LL_WARNS() << "Tried to close Queue. Win32 thread Queue already closed." < m_Image; - S32 mImageBoostLevel = LLGLTexture::BOOST_NONE; std::string mLoadingText; }; @@ -128,11 +127,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() @@ -153,19 +148,19 @@ void LLTexturePreviewView::draw() bool isLoading = (!m_Image->isFullyLoaded()) && (m_Image->getDiscardLevel() > 0); if (isLoading) LLFontGL::getFontSansSerif()->renderUTF8(mLoadingText, 0, rctClient.mLeft + 3, 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); + m_Image = LLViewerTextureManager::getFetchedTexture(idAsset, FTT_DEFAULT, MIPMAP_TRUE, LLGLTexture::BOOST_THUMBNAIL); if (m_Image) { - mImageBoostLevel = m_Image->getBoostLevel(); - m_Image->setBoostLevel(LLGLTexture::BOOST_PREVIEW); m_Image->forceToSaveRawImage(0); - if ( (!m_Image->isFullyLoaded()) && (!m_Image->hasFetcher()) ) + m_Image->setKnownDrawSize(MAX_IMAGE_SIZE, MAX_IMAGE_SIZE); + if ((!m_Image->isFullyLoaded()) && (!m_Image->hasFetcher())) { if (m_Image->isInFastCacheList()) { diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 7b975a2154..9a38355858 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2310,7 +2310,7 @@ bool LLItemBridge::isFavorite() const { LLViewerInventoryItem* item = NULL; LLInventoryModel* model = getInventoryModel(); - if(model) + if (model) { item = model->getItem(mUUID); } diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 78bff79854..99c2d6e410 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -645,10 +645,10 @@ bool LLInventoryFilter::checkAgainstFilterFavorites(const LLUUID& object_id) con if (mFilterOps.mFilterFavorites != FILTER_INCLUDE_FAVORITES) { bool is_favorite = get_is_favorite(object); - if (is_favorite && (mFilterOps.mFilterFavorites == FILTER_EXCLUDE_FAVORITES)) - return false; - if (!is_favorite && (mFilterOps.mFilterFavorites == FILTER_ONLY_FAVORITES)) - return false; + if (is_favorite && (mFilterOps.mFilterFavorites == FILTER_EXCLUDE_FAVORITES)) + return false; + if (!is_favorite && (mFilterOps.mFilterFavorites == FILTER_ONLY_FAVORITES)) + return false; } return true; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 69c8cb4747..04abc5e5f4 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -755,10 +755,10 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve { updateFolderLabel(viewmodel_folder->getUUID()); } - if (view_item->isFavorite()) - { - parent->updateHasFavorites(false); // favorite was removed - } + } + if (view_item->isFavorite()) + { + parent->updateHasFavorites(false); // favorite was removed } } } diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 81b2d23cf7..4d54eac2ba 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -673,7 +673,7 @@ void LLLocalBitmap::updateGLTFMaterials(LLUUID old_id, LLUUID new_id) LLFetchedGLTFMaterial* render_mat = dynamic_cast(entry->getGLTFRenderMaterial()); if (render_mat) { - *render_mat = *fetched_mat; + *render_mat = *fetched_mat; render_mat->applyOverride(*override_mat); } else diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 06a327c56a..e2471ca76a 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2309,8 +2309,8 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, std::vector& LLSD res; if (mDestinationFolderId.isNull()) { - result["folder_id"] = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_OBJECT); - result["texture_folder_id"] = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_TEXTURE); + result["folder_id"] = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_OBJECT); + result["texture_folder_id"] = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_TEXTURE); } else { diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index adf9cd3518..489be091d1 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -1273,15 +1273,7 @@ void LLOutfitGalleryGearMenu::onUpdateItemsVisibility() { if (!mMenu) return; bool have_selection = getSelectedOutfitID().notNull(); - mMenu->setItemVisible("expand", false); - mMenu->setItemVisible("collapse", false); mMenu->setItemVisible("thumbnail", have_selection); - mMenu->setItemVisible("inventory_settings", false); - mMenu->setItemVisible("inv_settings_separator", false); - mMenu->setItemVisible("sort_order_separator", true); - mMenu->setItemVisible("sort_order_by_image", true); - mMenu->setItemVisible("sepatator3", true); - mMenu->setItemVisible("sort_folders_by_name", true); LLOutfitListGearMenuBase::onUpdateItemsVisibility(); } diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 13bd270f7b..a7fda4b9d3 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -1151,12 +1151,6 @@ void LLOutfitListBase::ChangeOutfitSelection(LLWearableItemsList* list, const LL bool LLOutfitListBase::postBuild() { - mGearMenu = createGearMenu(); - - LLMenuButton* menu_gear_btn = getChild("options_gear_btn"); - - menu_gear_btn->setMouseDownCallback(boost::bind(&LLOutfitListGearMenuBase::updateItemsVisibility, mGearMenu)); - menu_gear_btn->setMenu(mGearMenu->getMenu()); return true; } @@ -1515,16 +1509,8 @@ LLOutfitListGearMenu::~LLOutfitListGearMenu() void LLOutfitListGearMenu::onUpdateItemsVisibility() { if (!mMenu) return; - mMenu->setItemVisible("expand", true); - mMenu->setItemVisible("collapse", true); mMenu->setItemVisible("thumbnail", getSelectedOutfitID().notNull()); mMenu->setItemVisible("favorite", getSelectedOutfitID().notNull()); - mMenu->setItemVisible("inventory_settings", true); - mMenu->setItemVisible("inv_settings_separator", true); - mMenu->setItemVisible("sort_order_separator", false); - mMenu->setItemVisible("sort_order_by_image", false); - mMenu->setItemVisible("sepatator3", false); - mMenu->setItemVisible("sort_folders_by_name", false); LLOutfitListGearMenuBase::onUpdateItemsVisibility(); } diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index 59cfcc75ba..29f7eb44f7 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -101,7 +101,6 @@ protected: void initListCommandsHandlers(); void updateListCommands(); void onWearButtonClick(); - void showGearMenu(); void onTrashButtonClick(); void onGearMouseDown(); bool isActionEnabled(const LLSD& userdata); @@ -110,7 +109,6 @@ protected: void onWearablesLoading(); private: LLPanel* mListCommands; - LLMenuGL* mMenuAdd; LLButton* mWearBtn = nullptr; // List Commands // ////////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index 52a040eb17..b4f6db9287 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -263,10 +263,6 @@ bool LLPanelWearing::postBuild() mTempItemsList->setFgUnselectedColor(LLColor4::white); mTempItemsList->setRightMouseDownCallback(boost::bind(&LLPanelWearing::onTempAttachmentsListRightClick, this, _1, _2, _3)); - LLMenuButton* menu_gear_btn = getChild("options_gear_btn"); - - menu_gear_btn->setMenu(mGearMenu->getMenu()); - return true; } diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index f952d74a4b..8998d61c47 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -342,10 +342,10 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) GP_OBJECT_MANIPULATE) && is_obj_modify && is_complete && not_in_trash; - getChildView("LabelItemNameTitle")->setEnabled(TRUE); + getChildView("LabelItemNameTitle")->setEnabled(true); getChildView("LabelItemName")->setEnabled(is_modifiable && !is_calling_card); // for now, don't allow rename of calling cards getChild("LabelItemName")->setValue(item->getName()); - getChildView("LabelItemDescTitle")->setEnabled(TRUE); + getChildView("LabelItemDescTitle")->setEnabled(true); getChild("item_thumbnail")->setValue(item->getThumbnailUUID()); // Asset upload substitutes empty description with a (No Description) placeholder diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index a65e967013..6953407f75 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2057,6 +2057,7 @@ bool LLViewerFetchedTexture::updateFetch() LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - request created"); 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, worker_discard); @@ -2652,6 +2653,8 @@ void LLViewerFetchedTexture::saveRawImage() return; } + LLImageDataSharedLock lock(mRawImage); + mSavedRawDiscardLevel = mRawDiscardLevel; if (mBoostLevel == LLGLTexture::BOOST_ICON) { @@ -2667,13 +2670,25 @@ void LLViewerFetchedTexture::saveRawImage() mSavedRawImage = new LLImageRaw(mRawImage->getData(), mRawImage->getWidth(), mRawImage->getHeight(), mRawImage->getComponents()); } } + else if (mBoostLevel == LLGLTexture::BOOST_THUMBNAIL) + { + if (mRawImage->getWidth() > DEFAULT_THUMBNAIL_DIMENSIONS || mRawImage->getHeight() > DEFAULT_THUMBNAIL_DIMENSIONS) + { + mSavedRawImage = new LLImageRaw(DEFAULT_THUMBNAIL_DIMENSIONS, DEFAULT_THUMBNAIL_DIMENSIONS, mRawImage->getComponents()); + mSavedRawImage->copyScaled(mRawImage); + } + else + { + mSavedRawImage = new LLImageRaw(mRawImage->getData(), mRawImage->getWidth(), mRawImage->getHeight(), mRawImage->getComponents()); + } + } else if (mBoostLevel == LLGLTexture::BOOST_SCULPTED) { S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : sMaxSculptRez; S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : sMaxSculptRez; if (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height) { - mSavedRawImage = new LLImageRaw(DEFAULT_THUMBNAIL_DIMENSIONS, DEFAULT_THUMBNAIL_DIMENSIONS, mRawImage->getComponents()); + mSavedRawImage = new LLImageRaw(expected_width, expected_height, mRawImage->getComponents()); mSavedRawImage->copyScaled(mRawImage); } else diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 52d6740fe5..8b7d284259 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -684,6 +684,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mPreviousFullyLoaded(false), mFullyLoadedInitialized(false), mLastCloudAttachmentCount(0), + mFullyLoadedFrameCounter(0), mVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN), mLoadedCallbacksPaused(false), mLoadedCallbackTextures(0), @@ -967,7 +968,7 @@ bool LLVOAvatar::areAllNearbyInstancesBaked(S32& grey_avatars) ++grey_avatars; } } - return !grey_avatars; + return grey_avatars == 0; } // static @@ -3183,17 +3184,17 @@ F32 LLVOAvatar::calcMorphAmount() const void LLVOAvatar::idleUpdateLipSync(bool voice_enabled) { // Use the Lipsync_Ooh and Lipsync_Aah morphs for lip sync - if ( voice_enabled + if (voice_enabled && mLastRezzedStatus > 0 // no point updating lip-sync for clouds && LLVoiceVisualizer::getLipSyncEnabled() - && 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()); @@ -3201,7 +3202,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()); @@ -8218,7 +8219,7 @@ bool LLVOAvatar::getIsCloud() const void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status) { // State machine for rezzed status. Statuses are -1 on startup, 0 - // = cloud, 1 = gray, 2 = downloading, 3 = waiting for attachments, 4 = full. + // Statuses are -1 on startup, 0 = cloud, 1 = gray, 2 = downloading, 3 = waiting for attachments, 4 = full. // Purpose is to collect time data for each it takes avatar to reach // various loading landmarks: gray, textured (partial), textured fully. @@ -8406,7 +8407,7 @@ bool LLVOAvatar::updateIsFullyLoaded() // 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 < 4 && !isFullyBaked()) + || (rez_status < 3 && !isFullyBaked()) || hasPendingAttachedMeshes() ); @@ -8467,48 +8468,45 @@ 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, + // LODs to load. + 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 (mFirstFullyVisible) + { + F32 first_use_delay = FIRST_APPEARANCE_CLOUD_MIN_DELAY; + if (!isSelf() && loading) { - F32 first_use_delay = FIRST_APPEARANCE_CLOUD_MIN_DELAY; - if (!isSelf() && loading) - { - // Note that textures can causes 60s delay on thier own - // so this delay might end up on top of textures' delay - first_use_delay = llclamp( - mFirstAppearanceMessageTimer.getElapsedTimeF32(), - FIRST_APPEARANCE_CLOUD_MIN_DELAY, - FIRST_APPEARANCE_CLOUD_MAX_DELAY); + // Note that textures can causes 60s delay on thier own + // so this delay might end up on top of textures' delay + first_use_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 - first_use_delay *= FIRST_APPEARANCE_CLOUD_IMPOSTOR_MODIFIER; - } + if (shouldImpostor()) + { + // Impostors are less of a priority, + // let them stay cloud longer + first_use_delay *= FIRST_APPEARANCE_CLOUD_IMPOSTOR_MODIFIER; } - mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > first_use_delay); - } - else - { - mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > LOADED_DELAY); } + mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > first_use_delay); + } + else + { + mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > LOADED_DELAY); + } - if (!mPreviousFullyLoaded && !loading && mFullyLoaded) - { - debugAvatarRezTime("AvatarRezNotification", "fully loaded"); - } + if (!mPreviousFullyLoaded && !loading && mFullyLoaded) + { + debugAvatarRezTime("AvatarRezNotification", "fully loaded"); } // did our loading state "change" from last call? @@ -8517,8 +8515,8 @@ bool LLVOAvatar::processFullyLoadedChange(bool loading) 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 + (!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); mPreviousFullyLoaded = mFullyLoaded; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 6cdf50efea..d377ebad41 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -741,7 +741,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; -- cgit v1.2.3 From 7f090c3859eb1df99d77918307275146768dc495 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 15 Oct 2024 22:46:23 +0200 Subject: Convert BOOL to bool --- indra/newview/llagent.cpp | 2 +- indra/newview/llfloaterobjectweights.cpp | 2 +- indra/newview/llinventorypanel.cpp | 2 +- indra/newview/llmodelpreview.cpp | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 4b758396de..6d03fdd61f 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -5028,7 +5028,7 @@ void LLAgent::applyExternalActionFlags(U32 outer_flags) if( delta_time > FLY_TIME && delta_frames > FLY_FRAMES) { - setFlying(TRUE); + setFlying(true); } } } diff --git a/indra/newview/llfloaterobjectweights.cpp b/indra/newview/llfloaterobjectweights.cpp index 45adb77c71..21aaed14c8 100644 --- a/indra/newview/llfloaterobjectweights.cpp +++ b/indra/newview/llfloaterobjectweights.cpp @@ -114,7 +114,7 @@ bool LLFloaterObjectWeights::postBuild() mTrianglesShown = getChild("triangles_shown"); mPixelArea = getChild("pixel_area"); - return TRUE; + return true; } // virtual diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 04abc5e5f4..ba4d4c08ed 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -2435,7 +2435,7 @@ void LLInventoryFavoritesItemsPanel::itemChanged(const LLUUID& id, U32 mask, con LLFavoritesCollector is_favorite; LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; - gInventory.collectDescendentsIf(id, cat_array, item_array, FALSE, is_favorite); + gInventory.collectDescendentsIf(id, cat_array, item_array, false, is_favorite); for (LLInventoryModel::cat_array_t::const_iterator it = cat_array.begin(); it != cat_array.end(); ++it) { removeFavorite((*it)->getUUID(), *it); diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 3e8b7f72e7..363e176fc8 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -3322,7 +3322,6 @@ bool LLModelPreview::render() fmp->setViewOptionEnabled("show_skin_weight", show_skin_weight); } } - //if (this) return TRUE; if (upload_skin && !has_skin_weights) { //can't upload skin weights if model has no skin weights -- cgit v1.2.3 From b68557d9fe6cfdfafc3e9c609c1c8b799eb62f9f Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 15 Oct 2024 23:03:40 +0200 Subject: Add missing overrides --- indra/newview/llfloaterobjectweights.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfloaterobjectweights.h b/indra/newview/llfloaterobjectweights.h index 0ae78faf48..bda625564b 100644 --- a/indra/newview/llfloaterobjectweights.h +++ b/indra/newview/llfloaterobjectweights.h @@ -65,13 +65,13 @@ public: void onWeightsUpdate(const SelectionCost& selection_cost) override; void setErrorStatus(S32 status, const std::string& reason) override; - void draw(); + void draw() override; void updateLandImpacts(const LLParcel* parcel); - void refresh(); + void refresh() override; private: - /*virtual*/ void generateTransactionID(); + void generateTransactionID() override; void toggleWeightsLoadingIndicators(bool visible); void toggleLandImpactsLoadingIndicators(bool visible); -- cgit v1.2.3 From 401f7eecb5c011a330046ac125ce14562de7ab5e Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 15 Oct 2024 23:49:00 +0200 Subject: Fix more merge issues: * Re-apply changes from a620e58daccf92b5b8d61347312739720ed2b51a * Fix duplicate code resulting from 826236f1bc065fba257d7954d11ac98c59493445 --- indra/llwindow/llwindowwin32.cpp | 71 ++++++++++++++++++++++------------------ indra/newview/llappviewer.cpp | 32 +----------------- 2 files changed, 40 insertions(+), 63 deletions(-) diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 9494eee46d..bacf5325fe 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -344,7 +344,12 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool void run() override; - // closes queue, wakes thread, waits until thread closes + // Detroys handles and window + // Either post to or call from window thread + void destroyWindow(); + + // Closes queue, wakes thread, waits until thread closes. + // Call from main thread bool wakeAndDestroy(); void glReady() @@ -402,7 +407,7 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool // until after some graphics setup. See SL-20177. -Cosmic,2023-09-18 bool mGLReady = false; bool mGotGLBuffer = false; - bool mDeleteOnExit = false; + LLAtomicBool mDeleteOnExit = false; }; @@ -4785,17 +4790,48 @@ void LLWindowWin32::LLWindowWin32Thread::run() #endif } + destroyWindow(); + if (mDeleteOnExit) { delete this; } } +void LLWindowWin32::LLWindowWin32Thread::destroyWindow() +{ + if (mWindowHandleThrd != NULL && IsWindow(mWindowHandleThrd)) + { + if (mhDCThrd) + { + if (!ReleaseDC(mWindowHandleThrd, mhDCThrd)) + { + LL_WARNS("Window") << "Release of ghDC failed!" << LL_ENDL; + } + mhDCThrd = NULL; + } + + // This causes WM_DESTROY to be sent *immediately* + if (!destroy_window_handler(mWindowHandleThrd)) + { + LL_WARNS("Window") << "Failed to destroy Window! " << std::hex << GetLastError() << LL_ENDL; + } + } + else + { + // Something killed the window while we were busy destroying gl or handle somehow got broken + LL_WARNS("Window") << "Failed to destroy Window, invalid handle!" << LL_ENDL; + } + mWindowHandleThrd = NULL; + mhDCThrd = NULL; + mGLReady = false; +} + bool LLWindowWin32::LLWindowWin32Thread::wakeAndDestroy() { if (mQueue->isClosed()) { - LL_WARNS() << "Tried to close Queue. Win32 thread Queue already closed." << LL_ENDL; + LL_WARNS() << "Tried to close Queue. Win32 thread Queue already closed." <shutdownGL(); - - // Destroy window, and make sure we're not fullscreen - // This may generate window reshape and activation events. - // Therefore must do this before destroying the message system. - delete gViewerWindow; - gViewerWindow = NULL; - LL_INFOS() << "ViewerWindow deleted" << LL_ENDL; - } - - LLSplashScreen::show(); - LLSplashScreen::update(LLTrans::getString("ShuttingDown")); - - LL_INFOS() << "Cleaning up Keyboard & Joystick" << LL_ENDL; - - // viewer UI relies on keyboard so keep it aound until viewer UI isa gone - delete gKeyboard; - gKeyboard = NULL; - - if (LLViewerJoystick::instanceExists()) - { - // Turn off Space Navigator and similar devices - LLViewerJoystick::getInstance()->terminate(); - } - LLGameControl::terminate(); - LL_INFOS() << "Cleaning up Objects" << LL_ENDL; LLViewerObject::cleanupVOClasses(); @@ -2220,6 +2189,7 @@ bool LLAppViewer::cleanup() // Turn off Space Navigator and similar devices LLViewerJoystick::getInstance()->terminate(); } + LLGameControl::terminate(); LL_INFOS() << "Shutting down message system" << LL_ENDL; end_messaging_system(); -- cgit v1.2.3