From 9f10853c03293f845d9a17adcf8de7ea23a0a778 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 21 Feb 2022 16:07:58 +0200 Subject: SL-16887 FIXED Crash in LLNetMap::draw --- indra/newview/llnetmap.cpp | 4 ++++ indra/newview/lltracker.cpp | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 937f36b6fc..1240ce7c0f 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -147,6 +147,10 @@ void LLNetMap::setScale( F32 scale ) void LLNetMap::draw() { + if (!LLWorld::instanceExists()) + { + return; + } LL_PROFILE_ZONE_SCOPED; static LLFrameTimer map_timer; static LLUIColor map_avatar_color = LLUIColorTable::instance().getColor("MapAvatarColor", LLColor4::white); diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index 728d0c9417..320554c39e 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -109,7 +109,12 @@ void LLTracker::stopTracking(bool clear_ui) // static virtual void LLTracker::drawHUDArrow() { - if (!gSavedSettings.getBOOL("RenderTrackerBeacon")) return; + if (!LLWorld::instanceExists()) + { + return; + } + + if (!gSavedSettings.getBOOL("RenderTrackerBeacon")) return; if (gViewerWindow->getProgressView()->getVisible()) return; -- cgit v1.2.3 From 97f6736d7fe2575023eff3a6429855c19d9f92f5 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 21 Feb 2022 17:46:27 +0200 Subject: Cached setting should be used in draw() calls --- indra/newview/lltracker.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index 320554c39e..ab4ad5817b 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -113,8 +113,12 @@ void LLTracker::drawHUDArrow() { return; } - - if (!gSavedSettings.getBOOL("RenderTrackerBeacon")) return; + + static LLCachedControl render_beacon(gSavedSettings, "RenderTrackerBeacon", true); + if (!render_beacon) + { + return; + } if (gViewerWindow->getProgressView()->getVisible()) return; -- cgit v1.2.3 From e24acd81e0cf47c1a8f39e2485daf81c39d26ca3 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 21 Feb 2022 21:31:19 +0200 Subject: SL-16892 Fix crash at getCameraOffsetInitial getCameraOffsetInitial() call can happen before init() --- indra/newview/llagentcamera.cpp | 19 ++++++++++--------- indra/newview/llagentcamera.h | 6 ------ 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index ed6c3c307f..84a41113be 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -210,9 +210,6 @@ void LLAgentCamera::init() mCameraPreset = (ECameraPreset) gSavedSettings.getU32("CameraPresetType"); - mCameraOffsetInitial = gSavedSettings.getControl("CameraOffsetRearView"); - mFocusOffsetInitial = gSavedSettings.getControl("FocusOffsetRearView"); - mCameraCollidePlane.clearVec(); mCurrentCameraDistance = getCameraOffsetInitial().magVec() * gSavedSettings.getF32("CameraOffsetScale"); mTargetCameraDistance = mCurrentCameraDistance; @@ -1672,8 +1669,8 @@ LLVector3d LLAgentCamera::calcThirdPersonFocusOffset() agent_rot *= ((LLViewerObject*)(gAgentAvatarp->getParent()))->getRenderRotation(); } - focus_offset = convert_from_llsd(mFocusOffsetInitial->get(), TYPE_VEC3D, ""); - return focus_offset * agent_rot; + static LLCachedControl focus_offset_initial(gSavedSettings, "FocusOffsetRearView", LLVector3d()); + return focus_offset_initial * agent_rot; } void LLAgentCamera::setupSitCamera() @@ -1810,8 +1807,9 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) } else { - local_camera_offset = mCameraZoomFraction * getCameraOffsetInitial() * gSavedSettings.getF32("CameraOffsetScale"); - + static LLCachedControl camera_offset_scale(gSavedSettings, "CameraOffsetScale"); + local_camera_offset = mCameraZoomFraction * getCameraOffsetInitial() * camera_offset_scale; + // are we sitting down? if (isAgentAvatarValid() && gAgentAvatarp->getParent()) { @@ -2028,12 +2026,15 @@ bool LLAgentCamera::isJoystickCameraUsed() LLVector3 LLAgentCamera::getCameraOffsetInitial() { - return convert_from_llsd(mCameraOffsetInitial->get(), TYPE_VEC3, ""); + // getCameraOffsetInitial and getFocusOffsetInitial can be called on update from idle before init() + static LLCachedControl camera_offset_initial (gSavedSettings, "CameraOffsetRearView", LLVector3()); + return camera_offset_initial; } LLVector3d LLAgentCamera::getFocusOffsetInitial() { - return convert_from_llsd(mFocusOffsetInitial->get(), TYPE_VEC3D, ""); + static LLCachedControl focus_offset_initial(gSavedSettings, "FocusOffsetRearView", LLVector3d()); + return focus_offset_initial; } F32 LLAgentCamera::getCameraMaxZoomDistance() diff --git a/indra/newview/llagentcamera.h b/indra/newview/llagentcamera.h index ec1ed433d7..89680f95dc 100644 --- a/indra/newview/llagentcamera.h +++ b/indra/newview/llagentcamera.h @@ -131,12 +131,6 @@ private: /** Camera preset in Third Person Mode */ ECameraPreset mCameraPreset; - /** Initial camera offset */ - LLPointer mCameraOffsetInitial; - - /** Initial focus offset */ - LLPointer mFocusOffsetInitial; - LLQuaternion mInitSitRot; //-------------------------------------------------------------------- -- cgit v1.2.3 From 4e31ff1d7e05ff376fc1c66156eb76cccbdd5f38 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 21 Feb 2022 23:11:17 +0200 Subject: SL-16056 Load cloud texture only once --- indra/newview/llvoavatar.cpp | 5 +++-- indra/newview/llvoavatar.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 2d34e28b93..31035f666d 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -619,6 +619,7 @@ F32 LLVOAvatar::sUnbakedTime = 0.f; F32 LLVOAvatar::sUnbakedUpdateTime = 0.f; F32 LLVOAvatar::sGreyTime = 0.f; F32 LLVOAvatar::sGreyUpdateTime = 0.f; +LLPointer LLVOAvatar::sCloudTexture = NULL; //----------------------------------------------------------------------------- // Helper functions @@ -1136,6 +1137,7 @@ void LLVOAvatar::initClass() LLControlAvatar::sRegionChangedSlot = gAgent.addRegionChangedCallback(&LLControlAvatar::onRegionChanged); + sCloudTexture = LLViewerTextureManager::getFetchedTextureFromFile("cloud-particle.j2c"); } @@ -3080,8 +3082,7 @@ void LLVOAvatar::idleUpdateLoadingEffect() particle_parameters.mPartData.mStartColor = LLColor4(1, 1, 1, 0.5f); particle_parameters.mPartData.mEndColor = LLColor4(1, 1, 1, 0.0f); particle_parameters.mPartData.mStartScale.mV[VX] = 0.8f; - LLViewerTexture* cloud = LLViewerTextureManager::getFetchedTextureFromFile("cloud-particle.j2c"); - particle_parameters.mPartImageID = cloud->getID(); + particle_parameters.mPartImageID = sCloudTexture->getID(); particle_parameters.mMaxAge = 0.f; particle_parameters.mPattern = LLPartSysData::LL_PART_SRC_PATTERN_ANGLE_CONE; particle_parameters.mInnerAngle = F_PI; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 7c2d71802e..ba67007fa9 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -336,7 +336,8 @@ public: static F32 sLODFactor; // user-settable LOD factor static F32 sPhysicsLODFactor; // user-settable physics LOD factor static BOOL sJointDebug; // output total number of joints being touched for each avatar - static BOOL sDebugAvatarRotation; + + static LLPointer sCloudTexture; //-------------------------------------------------------------------- // Region state -- cgit v1.2.3 From 900c13d361671c35cd5899dc99bbfbc9c5ec2200 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 22 Feb 2022 00:05:38 +0200 Subject: SL-16892 Fix incorrect width of dropdown menus --- indra/llui/llcombobox.cpp | 29 +++++++++++++++++++++++++++++ indra/llui/llcombobox.h | 3 +++ 2 files changed, 32 insertions(+) diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index bcc653a602..9ca05a16f3 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -113,6 +113,10 @@ LLComboBox::LLComboBox(const LLComboBox::Params& p) } mArrowImage = button_params.image_unselected; + if (mArrowImage.notNull()) + { + mImageLoadedConnection = mArrowImage->addLoadedCallback(boost::bind(&LLComboBox::imageLoaded, this)); + } mButton = LLUICtrlFactory::create(button_params); @@ -183,6 +187,7 @@ LLComboBox::~LLComboBox() // explicitly disconect this signal, since base class destructor might fire top lost mTopLostSignalConnection.disconnect(); + mImageLoadedConnection.disconnect(); } @@ -1074,6 +1079,30 @@ void LLComboBox::onSetHighlight() const } } +void LLComboBox::imageLoaded() +{ + static LLUICachedControl drop_shadow_button("DropShadowButton", 0); + + if (mAllowTextEntry) + { + LLRect rect = getLocalRect(); + S32 arrow_width = mArrowImage ? mArrowImage->getWidth() : 0; + S32 shadow_size = drop_shadow_button; + mButton->setRect(LLRect(getRect().getWidth() - llmax(8, arrow_width) - 2 * shadow_size, + rect.mTop, rect.mRight, rect.mBottom)); + if (mButton->getVisible()) + { + // recalculate field size + if (mTextEntry) + { + LLRect text_entry_rect(0, getRect().getHeight(), getRect().getWidth(), 0); + text_entry_rect.mRight -= llmax(8, arrow_width) + 2 * drop_shadow_button; + mTextEntry->reshape(text_entry_rect.getWidth(), text_entry_rect.getHeight(), TRUE); + } + } + } +} + //============================================================================ // LLCtrlListInterface functions diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h index e17d6cdfb4..cac8850a25 100644 --- a/indra/llui/llcombobox.h +++ b/indra/llui/llcombobox.h @@ -105,6 +105,8 @@ protected: virtual std::string _getSearchText() const; virtual void onSetHighlight() const; + void imageLoaded(); + public: // LLView interface virtual void onFocusLost(); @@ -244,6 +246,7 @@ private: commit_callback_t mTextChangedCallback; commit_callback_t mSelectionCallback; boost::signals2::connection mTopLostSignalConnection; + boost::signals2::connection mImageLoadedConnection; commit_signal_t mOnReturnSignal; S32 mLastSelectedIndex; }; -- cgit v1.2.3