From 830cb6b66551025285120fb628f0b5ebf3841756 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 3 Feb 2023 17:18:39 -0600 Subject: SL-19148 Decruft some forward shaders and drawpools. Fix HUDs being in wrong color space. --- indra/newview/llagent.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 9018a5f168..af4c68e41f 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -940,11 +940,7 @@ void LLAgent::setRegion(LLViewerRegion *regionp) { gSky.mVOSkyp->setRegion(regionp); } - if (gSky.mVOGroundp) - { - gSky.mVOGroundp->setRegion(regionp); - } - + if (regionp->capabilitiesReceived()) { regionp->requestSimulatorFeatures(); -- cgit v1.3 From 4ec8844f012f27ddd0ab9aa6a3098273c7bb0ac1 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 27 Feb 2023 10:42:53 -0600 Subject: DRTVWR-559 Fix for occlusion culling going off the rails when settings change -- remove LLPipeline::resetVertexBuffers and add a sanity check to how long we wait for a query to be "available". --- indra/newview/llagent.cpp | 3 -- indra/newview/llspatialpartition.cpp | 2 + indra/newview/llviewercontrol.cpp | 34 +-------------- indra/newview/llviewerdisplay.cpp | 7 --- indra/newview/llviewermenu.cpp | 3 -- indra/newview/llviewermessage.cpp | 2 - indra/newview/llvieweroctree.cpp | 19 ++------ indra/newview/llvieweroctree.h | 1 + indra/newview/llviewershadermgr.cpp | 3 -- indra/newview/pipeline.cpp | 84 ------------------------------------ indra/newview/pipeline.h | 4 +- 11 files changed, 10 insertions(+), 152 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index af4c68e41f..6113c30a84 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3960,8 +3960,6 @@ bool LLAgent::teleportCore(bool is_local) LL_INFOS("Teleport") << "Non-local, setting teleport state to TELEPORT_START" << LL_ENDL; gAgent.setTeleportState( LLAgent::TELEPORT_START ); - //release geometry from old location - gPipeline.resetVertexBuffers(); LLSpatialPartition::sTeleportRequested = TRUE; } make_ui_sound("UISndTeleportOut"); @@ -4305,7 +4303,6 @@ void LLAgent::teleportCancel() } clearTeleportRequest(); gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); - gPipeline.resetVertexBuffers(); } void LLAgent::restoreCanceledTeleportRequest() diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 764131ab79..35e11b8991 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -3234,6 +3234,7 @@ public: renderAgentTarget(avatar); } +#if 0 if (gDebugGL) { for (U32 i = 0; i < drawable->getNumFaces(); ++i) @@ -3259,6 +3260,7 @@ public: } } } +#endif } for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i) diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index ea53012b7a..59b566efb6 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -149,14 +149,7 @@ static bool handleSetShaderChanged(const LLSD& newvalue) if (gPipeline.isInit()) { // ALM depends onto atmospheric shaders, state might have changed - bool old_state = LLPipeline::sRenderDeferred; LLPipeline::refreshCachedSettings(); - if (old_state != LLPipeline::sRenderDeferred) - { - gPipeline.releaseGLBuffers(); - gPipeline.createGLBuffers(); - gPipeline.resetVertexBuffers(); - } } // else, leave terrain detail as is @@ -206,7 +199,6 @@ bool handleRenderTransparentWaterChanged(const LLSD& newvalue) gPipeline.updateRenderTransparentWater(); gPipeline.releaseGLBuffers(); gPipeline.createGLBuffers(); - gPipeline.resetVertexBuffers(); LLViewerShaderMgr::instance()->setShaders(); } LLWorld::getInstance()->updateWaterObjects(); @@ -397,15 +389,6 @@ static bool handleWLSkyDetailChanged(const LLSD&) return true; } -static bool handleResetVertexBuffersChanged(const LLSD&) -{ - if (gPipeline.isInit()) - { - gPipeline.resetVertexBuffers(); - } - return true; -} - static bool handleRepartition(const LLSD&) { if (gPipeline.isInit()) @@ -436,7 +419,6 @@ static bool handleReflectionProbeDetailChanged(const LLSD& newvalue) LLPipeline::refreshCachedSettings(); gPipeline.releaseGLBuffers(); gPipeline.createGLBuffers(); - gPipeline.resetVertexBuffers(); LLViewerShaderMgr::instance()->setShaders(); } return true; @@ -654,7 +636,6 @@ void settings_setup_listeners() setting_setup_signal_listener(gSavedSettings, "RenderGlow", handleReleaseGLBufferChanged); setting_setup_signal_listener(gSavedSettings, "RenderGlow", handleSetShaderChanged); setting_setup_signal_listener(gSavedSettings, "RenderGlowResolutionPow", handleReleaseGLBufferChanged); - // DEPRECATED -- setting_setup_signal_listener(gSavedSettings, "WindLightUseAtmosShaders", handleSetShaderChanged); setting_setup_signal_listener(gSavedSettings, "RenderGammaFull", handleSetShaderChanged); setting_setup_signal_listener(gSavedSettings, "RenderVolumeLODFactor", handleVolumeLODChanged); setting_setup_signal_listener(gSavedSettings, "RenderAvatarLODFactor", handleAvatarLODChanged); @@ -667,17 +648,11 @@ void settings_setup_listeners() setting_setup_signal_listener(gSavedSettings, "RenderMaxPartCount", handleMaxPartCountChanged); setting_setup_signal_listener(gSavedSettings, "RenderDynamicLOD", handleRenderDynamicLODChanged); setting_setup_signal_listener(gSavedSettings, "RenderLocalLights", handleRenderLocalLightsChanged); - setting_setup_signal_listener(gSavedSettings, "RenderDebugTextureBind", handleResetVertexBuffersChanged); - setting_setup_signal_listener(gSavedSettings, "RenderAutoMaskAlphaDeferred", handleResetVertexBuffersChanged); - setting_setup_signal_listener(gSavedSettings, "RenderAutoMaskAlphaNonDeferred", handleResetVertexBuffersChanged); - // DEPRECATED - setting_setup_signal_listener(gSavedSettings, "RenderObjectBump", handleRenderBumpChanged); - setting_setup_signal_listener(gSavedSettings, "RenderMaxVBOSize", handleResetVertexBuffersChanged); - setting_setup_signal_listener(gSavedSettings, "RenderVSyncEnable", handleVSyncChanged); + setting_setup_signal_listener(gSavedSettings, "RenderVSyncEnable", handleVSyncChanged); setting_setup_signal_listener(gSavedSettings, "RenderDeferredNoise", handleReleaseGLBufferChanged); setting_setup_signal_listener(gSavedSettings, "RenderDebugPipeline", handleRenderDebugPipelineChanged); setting_setup_signal_listener(gSavedSettings, "RenderResolutionDivisor", handleRenderResolutionDivisorChanged); - // DEPRECATED - setting_setup_signal_listener(gSavedSettings, "RenderDeferred", handleRenderDeferredChanged); - setting_setup_signal_listener(gSavedSettings, "RenderReflectionProbeDetail", handleReflectionProbeDetailChanged); + setting_setup_signal_listener(gSavedSettings, "RenderReflectionProbeDetail", handleReflectionProbeDetailChanged); setting_setup_signal_listener(gSavedSettings, "RenderReflectionsEnabled", handleReflectionProbeDetailChanged); setting_setup_signal_listener(gSavedSettings, "RenderScreenSpaceReflections", handleReflectionProbeDetailChanged); setting_setup_signal_listener(gSavedSettings, "RenderShadowDetail", handleSetShaderChanged); @@ -705,11 +680,6 @@ void settings_setup_listeners() setting_setup_signal_listener(gSavedSettings, "MuteVoice", handleAudioVolumeChanged); setting_setup_signal_listener(gSavedSettings, "MuteAmbient", handleAudioVolumeChanged); setting_setup_signal_listener(gSavedSettings, "MuteUI", handleAudioVolumeChanged); - setting_setup_signal_listener(gSavedSettings, "RenderVBOEnable", handleResetVertexBuffersChanged); - setting_setup_signal_listener(gSavedSettings, "RenderUseVAO", handleResetVertexBuffersChanged); - setting_setup_signal_listener(gSavedSettings, "RenderVBOMappingDisable", handleResetVertexBuffersChanged); - setting_setup_signal_listener(gSavedSettings, "RenderUseStreamVBO", handleResetVertexBuffersChanged); - setting_setup_signal_listener(gSavedSettings, "RenderPreferStreamDraw", handleResetVertexBuffersChanged); setting_setup_signal_listener(gSavedSettings, "WLSkyDetail", handleWLSkyDetailChanged); setting_setup_signal_listener(gSavedSettings, "JoystickAxis0", handleJoystickChanged); setting_setup_signal_listener(gSavedSettings, "JoystickAxis1", handleJoystickChanged); diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 62144b2d31..59333b6cee 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -279,14 +279,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLGLState::checkStates(); - stop_glerror(); - gPipeline.disableLights(); - - //reset vertex buffers if needed - gPipeline.doResetVertexBuffers(); - - stop_glerror(); // Don't draw if the window is hidden or minimized. // In fact, must explicitly check the minimized state before drawing. diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 5a3f2f22b8..3a8206ad26 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -8540,7 +8540,6 @@ BOOL get_visibility(void* user_data) return viewp->getVisible(); } -// TomY TODO: Get rid of these? class LLViewShowHoverTips : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -8559,13 +8558,11 @@ class LLViewCheckShowHoverTips : public view_listener_t } }; -// TomY TODO: Get rid of these? class LLViewHighlightTransparent : public view_listener_t { bool handleEvent(const LLSD& userdata) { LLDrawPoolAlpha::sShowDebugAlpha = !LLDrawPoolAlpha::sShowDebugAlpha; - gPipeline.resetVertexBuffers(); return true; } }; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index e96047df14..4ecb54aa0f 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2938,8 +2938,6 @@ void process_teleport_finish(LLMessageSystem* msg, void**) // Teleport is finished; it can't be cancelled now. gViewerWindow->setProgressCancelButtonVisible(FALSE); - gPipeline.doResetVertexBuffers(true); - // Do teleport effect for where you're leaving // VEFFECT: TeleportStart LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp index 7d6c18ae67..d1d23cfb8e 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -870,6 +870,7 @@ LLOcclusionCullingGroup::LLOcclusionCullingGroup(OctreeNode* node, LLViewerOctre for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) { mOcclusionQuery[i] = 0; + mOcclusionCheckCount[i] = 0; mOcclusionIssued[i] = 0; mOcclusionState[i] = parent ? SG_STATE_INHERIT_MASK & parent->mOcclusionState[i] : 0; mVisible[i] = 0; @@ -1127,10 +1128,12 @@ void LLOcclusionCullingGroup::checkOcclusion() { LL_PROFILE_ZONE_NAMED_CATEGORY_OCTREE("co - query available"); glGetQueryObjectuiv(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_AVAILABLE, &available); + mOcclusionCheckCount[LLViewerCamera::sCurCameraID]++; } - if (available) + if (available || mOcclusionCheckCount[LLViewerCamera::sCurCameraID] > 4) { + mOcclusionCheckCount[LLViewerCamera::sCurCameraID] = 0; GLuint query_result; // Will be # samples drawn, or a boolean depending on mHasOcclusionQuery2 (both are type GLuint) { LL_PROFILE_ZONE_NAMED_CATEGORY_OCTREE("co - query result"); @@ -1140,20 +1143,6 @@ void LLOcclusionCullingGroup::checkOcclusion() sPendingQueries.erase(mOcclusionQuery[LLViewerCamera::sCurCameraID]); #endif -#if 0 // (12/2021) occasional false-negative occlusion tests produce water reflection errors, SL-16461 - // If/when water occlusion queries become 100% reliable, re-enable this optimization - - if (LLPipeline::RENDER_TYPE_WATER == mSpatialPartition->mDrawableType) - { - // Note any unoccluded water, for deciding on reflection/distortion passes - // (If occlusion is disabled, these are set within LLDrawPoolWater::render) - if (query_result > 0) - { - LLDrawPoolWater::sNeedsReflectionUpdate = TRUE; - LLDrawPoolWater::sNeedsDistortionUpdate = TRUE; - } - } -#endif if (query_result > 0) { clearOcclusionState(LLOcclusionCullingGroup::OCCLUDED, LLOcclusionCullingGroup::STATE_MODE_DIFF); diff --git a/indra/newview/llvieweroctree.h b/indra/newview/llvieweroctree.h index 7666062f99..353429d254 100644 --- a/indra/newview/llvieweroctree.h +++ b/indra/newview/llvieweroctree.h @@ -336,6 +336,7 @@ protected: LLViewerOctreePartition* mSpatialPartition; U32 mOcclusionQuery[LLViewerCamera::NUM_CAMERAS]; + U32 mOcclusionCheckCount[LLViewerCamera::NUM_CAMERAS]; public: static std::set sPendingQueries; diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 859df1277c..f4f20ee7a6 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -378,9 +378,6 @@ void LLViewerShaderMgr::setShaders() LLPipeline::sRenderGlow = gSavedSettings.getBOOL("RenderGlow"); - //hack to reset buffers that change behavior with shaders - gPipeline.resetVertexBuffers(); - if (gViewerWindow) { gViewerWindow->setCursor(UI_CURSOR_WAIT); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 9522f804d6..b5b5d9ef7f 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -681,8 +681,6 @@ void LLPipeline::destroyGL() resetDrawOrders(); - resetVertexBuffers(); - releaseGLBuffers(); if (mMeshDirtyQueryObject) @@ -6753,88 +6751,6 @@ void LLPipeline::resetVertexBuffers(LLDrawable* drawable) } } -void LLPipeline::resetVertexBuffers() -{ - mResetVertexBuffers = true; -} - -void LLPipeline::doResetVertexBuffers(bool forced) -{ - if (!mResetVertexBuffers) - { - return; - } - if(!forced && LLSpatialPartition::sTeleportRequested) - { - if(gAgent.getTeleportState() != LLAgent::TELEPORT_NONE) - { - return; //wait for teleporting to finish - } - else - { - //teleporting aborted - LLSpatialPartition::sTeleportRequested = FALSE; - mResetVertexBuffers = false; - return; - } - } - - LL_PROFILE_ZONE_SCOPED_CATEGORY_PIPELINE; - mResetVertexBuffers = false; - - mCubeVB = NULL; - mDeferredVB = NULL; - - for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); - iter != LLWorld::getInstance()->getRegionList().end(); ++iter) - { - LLViewerRegion* region = *iter; - for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++) - { - LLSpatialPartition* part = region->getSpatialPartition(i); - if (part) - { - part->resetVertexBuffers(); - } - } - } - if(LLSpatialPartition::sTeleportRequested) - { - LLSpatialPartition::sTeleportRequested = FALSE; - - LLWorld::getInstance()->clearAllVisibleObjects(); - clearRebuildDrawables(); - } - - resetDrawOrders(); - - gSky.resetVertexBuffers(); - - LLVOPartGroup::destroyGL(); - - if ( LLPathingLib::getInstance() ) - { - LLPathingLib::getInstance()->cleanupVBOManager(); - } - LLVOPartGroup::destroyGL(); - gGL.resetVertexBuffer(); - - LLVertexBuffer::unbind(); - - updateRenderBump(); - - sBakeSunlight = gSavedSettings.getBOOL("RenderBakeSunlight"); - sNoAlpha = gSavedSettings.getBOOL("RenderNoAlpha"); - LLPipeline::sTextureBindTest = gSavedSettings.getBOOL("RenderDebugTextureBind"); - - gGL.initVertexBuffer(); - - mDeferredVB = new LLVertexBuffer(DEFERRED_VB_MASK); - mDeferredVB->allocateBuffer(8, 0); - - LLVOPartGroup::restoreGL(); -} - void LLPipeline::renderObjects(U32 type, bool texture, bool batch_texture, bool rigged) { assertInitialized(); diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 29dd42e4ec..483fe08559 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -97,9 +97,7 @@ public: void destroyGL(); void restoreGL(); - void resetVertexBuffers(); - void doResetVertexBuffers(bool forced = false); - void requestResizeScreenTexture(); // set flag only, no work, safer for callbacks... + void requestResizeScreenTexture(); // set flag only, no work, safer for callbacks... void requestResizeShadowTexture(); // set flag only, no work, safer for callbacks... void resizeScreenTexture(); -- cgit v1.3 From 8d263197f0649e3b49044d6f7c12277c2361bdba Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 13 Mar 2023 11:16:23 -0500 Subject: SL-19371 Fix for occlusion culling getting stuck after teleport. --- indra/newview/llagent.cpp | 2 -- indra/newview/llspatialpartition.cpp | 11 ++--------- indra/newview/llspatialpartition.h | 2 -- indra/newview/pipeline.cpp | 2 +- 4 files changed, 3 insertions(+), 14 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 6113c30a84..a68dba98bb 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3959,8 +3959,6 @@ bool LLAgent::teleportCore(bool is_local) gTeleportDisplay = TRUE; LL_INFOS("Teleport") << "Non-local, setting teleport state to TELEPORT_START" << LL_ENDL; gAgent.setTeleportState( LLAgent::TELEPORT_START ); - - LLSpatialPartition::sTeleportRequested = TRUE; } make_ui_sound("UISndTeleportOut"); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 92fccfcfd6..fc9b3093e8 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -64,8 +64,6 @@ bool LLSpatialGroup::sNoDelete = false; static F32 sLastMaxTexPriority = 1.f; static F32 sCurMaxTexPriority = 1.f; -bool LLSpatialPartition::sTeleportRequested = false; - //static counter for frame to switch LOD on void sg_assert(BOOL expr) @@ -1295,8 +1293,6 @@ void drawBoxOutline(const LLVector4a& pos, const LLVector4a& size) class LLOctreeDirty : public OctreeTraveler { public: - LLOctreeDirty(bool no_rebuild) : mNoRebuild(no_rebuild){} - virtual void visit(const OctreeNode* state) { LLSpatialGroup* group = (LLSpatialGroup*) state->getListener(0); @@ -1309,7 +1305,7 @@ public: { continue; } - if (!mNoRebuild && drawable->getVObj().notNull() && !group->getSpatialPartition()->mRenderByGroup) + if (drawable->getVObj().notNull() && !group->getSpatialPartition()->mRenderByGroup) { gPipeline.markRebuild(drawable, LLDrawable::REBUILD_ALL, TRUE); } @@ -1321,9 +1317,6 @@ public: traverse(bridge->mOctree); } } - -private: - BOOL mNoRebuild; }; void LLSpatialPartition::restoreGL() @@ -1332,7 +1325,7 @@ void LLSpatialPartition::restoreGL() void LLSpatialPartition::resetVertexBuffers() { - LLOctreeDirty dirty(sTeleportRequested); + LLOctreeDirty dirty; dirty.traverse(mOctree); } diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 9b2cb0d44c..053ce9e60b 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -433,8 +433,6 @@ public: U32 mVertexDataMask; F32 mSlopRatio; //percentage distance must change before drawables receive LOD update (default is 0.25); bool mDepthMask; //if TRUE, objects in this partition will be written to depth during alpha rendering - - static bool sTeleportRequested; //started to issue a teleport request }; // class for creating bridges between spatial partitions diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index e6ad42c23b..18b0192346 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2424,7 +2424,7 @@ void LLPipeline::doOcclusion(LLCamera& camera) gGL.setColorMask(true, true); } - if (LLPipeline::sUseOcclusion > 1 && !LLSpatialPartition::sTeleportRequested && + if (LLPipeline::sUseOcclusion > 1 && (sCull->hasOcclusionGroups() || LLVOCachePartition::sNeedsOcclusionCheck)) { LLVertexBuffer::unbind(); -- cgit v1.3 From 3f34acaa18fbe44241ab5fc9042d3b7e9f611fe1 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Fri, 30 Jun 2023 14:01:30 +0200 Subject: SL-19816 Home location on world map for invalid locations --- indra/newview/llagent.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 8cc9be7244..a80c285a6e 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -2534,12 +2534,6 @@ void LLAgent::setStartPosition( U32 location_id ) if (!requestPostCapability("HomeLocation", body, boost::bind(&LLAgent::setStartPositionSuccess, this, _1))) LL_WARNS() << "Unable to post to HomeLocation capability." << LL_ENDL; - - const U32 HOME_INDEX = 1; - if( HOME_INDEX == location_id ) - { - setHomePosRegion( mRegionp->getHandle(), getPositionAgent() ); - } } void LLAgent::setStartPositionSuccess(const LLSD &result) -- cgit v1.3 From 374de322bf8777121bc6ad12455980261a8b4b86 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 5 Jul 2023 20:48:54 +0300 Subject: SL-19950 don't try to change fly state if it's not needed --- indra/newview/llagent.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index a80c285a6e..289a9caea4 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -481,7 +481,11 @@ void LLAgent::init() // *Note: this is where LLViewerCamera::getInstance() used to be constructed. - setFlying( gSavedSettings.getBOOL("FlyingAtExit") ); + bool is_flying = gSavedSettings.getBOOL("FlyingAtExit"); + if(is_flying) + { + setFlying(is_flying); + } *mEffectColor = LLUIColorTable::instance().getColor("EffectColor"); -- cgit v1.3 From 0b85c05f8eefc79315c5695531335ec76a7504d2 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 29 Jun 2023 23:53:22 +0300 Subject: SL-20145 New inventory feature notification Pulled in relevant parts from SL-19929 --- indra/newview/CMakeLists.txt | 2 + indra/newview/app_settings/settings.xml | 11 +++ indra/newview/llagent.cpp | 98 +++++++++++++++++++++- indra/newview/llagent.h | 15 ++-- indra/newview/llfloaternewfeaturenotification.cpp | 76 +++++++++++++++++ indra/newview/llfloaternewfeaturenotification.h | 49 +++++++++++ indra/newview/llstartup.cpp | 4 +- indra/newview/llviewerfloaterreg.cpp | 4 + .../xui/en/floater_new_feature_notification.xml | 60 +++++++++++++ 9 files changed, 309 insertions(+), 10 deletions(-) create mode 100644 indra/newview/llfloaternewfeaturenotification.cpp create mode 100644 indra/newview/llfloaternewfeaturenotification.h create mode 100644 indra/newview/skins/default/xui/en/floater_new_feature_notification.xml (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c6d82ea260..d413c12de9 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -246,6 +246,7 @@ set(viewer_SOURCE_FILES llfloatermyscripts.cpp llfloatermyenvironment.cpp llfloaternamedesc.cpp + llfloaternewfeaturenotification.cpp llfloaternotificationsconsole.cpp llfloaternotificationstabbed.cpp llfloateroutfitphotopreview.cpp @@ -895,6 +896,7 @@ set(viewer_HEADER_FILES llfloatermyscripts.h llfloatermyenvironment.h llfloaternamedesc.h + llfloaternewfeaturenotification.h llfloaternotificationsconsole.h llfloaternotificationstabbed.h llfloateroutfitphotopreview.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b92a829f36..85f6101050 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5519,6 +5519,17 @@ Value 0 + LastUIFeatureVersion + + Comment + UI Feature Version number for tracking feature notification between viewer builds + Persist + 1 + Type + LLSD + Value + + LastFindPanel Comment diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index ea176dd8de..be764287cc 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -120,6 +120,11 @@ const F64 CHAT_AGE_FAST_RATE = 3.0; const F32 MIN_FIDGET_TIME = 8.f; // seconds const F32 MAX_FIDGET_TIME = 20.f; // seconds +const S32 UI_FEATURE_VERSION = 1; +// For version 1: 1 - inventory, 2 - gltf +// Will need to change to 3 once either inventory or gltf releases and cause a conflict +const S32 UI_FEATURE_FLAGS = 2; + // The agent instance. LLAgent gAgent; @@ -372,7 +377,7 @@ LLAgent::LLAgent() : mHideGroupTitle(FALSE), mGroupID(), - mInitialized(FALSE), + mInitialized(false), mListener(), mDoubleTapRunTimer(), @@ -447,7 +452,7 @@ LLAgent::LLAgent() : mNextFidgetTime(0.f), mCurrentFidget(0), - mFirstLogin(FALSE), + mFirstLogin(false), mOutfitChosen(FALSE), mVoiceConnected(false), @@ -504,7 +509,7 @@ void LLAgent::init() mHttpPolicy = app_core_http.getPolicy(LLAppCoreHttp::AP_AGENT); - mInitialized = TRUE; + mInitialized = true; } //----------------------------------------------------------------------------- @@ -559,6 +564,93 @@ void LLAgent::onAppFocusGained() } } +void LLAgent::setFirstLogin(bool b) +{ + mFirstLogin = b; + + if (mFirstLogin) + { + // Don't notify new users about new features + if (getFeatureVersion() <= UI_FEATURE_VERSION) + { + setFeatureVersion(UI_FEATURE_VERSION, UI_FEATURE_FLAGS); + } + } +} + +void LLAgent::setFeatureVersion(S32 version, S32 flags) +{ + LLSD updated_version; + updated_version["version"] = version; + updated_version["flags"] = flags; + gSavedSettings.setLLSD("LastUIFeatureVersion", updated_version); +} + +S32 LLAgent::getFeatureVersion() +{ + S32 version; + S32 flags; + getFeatureVersionAndFlags(version, flags); + return version; +} + +void LLAgent::getFeatureVersionAndFlags(S32& version, S32& flags) +{ + version = 0; + flags = 0; + LLSD feature_version = gSavedSettings.getLLSD("LastUIFeatureVersion"); + if (feature_version.isInteger()) + { + version = feature_version.asInteger(); + flags = 1; // inventory flag + } + else if (feature_version.isMap()) + { + version = feature_version["version"]; + flags = feature_version["flags"]; + } + else if (!feature_version.isString() && !feature_version.isUndefined()) + { + // is something newer inside? + version = UI_FEATURE_VERSION; + flags = UI_FEATURE_FLAGS; + } +} + +void LLAgent::showLatestFeatureNotification(const std::string key) +{ + S32 version; + S32 flags; // a single release can have multiple new features + getFeatureVersionAndFlags(version, flags); + if (version <= UI_FEATURE_VERSION && (flags & UI_FEATURE_FLAGS) != UI_FEATURE_FLAGS) + { + S32 flag = 0; + + if (key == "inventory") + { + // Notify user about new thumbnail support + flag = 1; + } + + if (key == "gltf") + { + flag = 2; + } + + if ((flags & flag) == 0) + { + // Need to open on top even if called from onOpen, + // do on idle to make sure it's on top + LLSD floater_key(key); + doOnIdleOneTime([floater_key]() + { + LLFloaterReg::showInstance("new_feature_notification", floater_key); + }); + + setFeatureVersion(UI_FEATURE_VERSION, flags | flag); + } + } +} void LLAgent::ageChat() { diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 498bea3c07..0ce6fda131 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -117,15 +117,20 @@ private: //-------------------------------------------------------------------- public: void onAppFocusGained(); - void setFirstLogin(BOOL b) { mFirstLogin = b; } + void setFirstLogin(bool b); // Return TRUE if the database reported this login as the first for this particular user. - BOOL isFirstLogin() const { return mFirstLogin; } - BOOL isInitialized() const { return mInitialized; } + bool isFirstLogin() const { return mFirstLogin; } + bool isInitialized() const { return mInitialized; } + + void setFeatureVersion(S32 version, S32 flags); + S32 getFeatureVersion(); + void getFeatureVersionAndFlags(S32 &version, S32 &flags); + void showLatestFeatureNotification(const std::string key); public: std::string mMOTD; // Message of the day private: - BOOL mInitialized; - BOOL mFirstLogin; + bool mInitialized; + bool mFirstLogin; boost::shared_ptr mListener; //-------------------------------------------------------------------- diff --git a/indra/newview/llfloaternewfeaturenotification.cpp b/indra/newview/llfloaternewfeaturenotification.cpp new file mode 100644 index 0000000000..3a2035b9b9 --- /dev/null +++ b/indra/newview/llfloaternewfeaturenotification.cpp @@ -0,0 +1,76 @@ +/** + * @file llfloaternewfeaturenotification.cpp + * @brief LLFloaterNewFeatureNotification class implementation + * + * $LicenseInfo:firstyear=2023&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2023, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaternewfeaturenotification.h" + + +LLFloaterNewFeatureNotification::LLFloaterNewFeatureNotification(const LLSD& key) + : LLFloater(key) +{ +} + +LLFloaterNewFeatureNotification::~LLFloaterNewFeatureNotification() +{ +} + +BOOL LLFloaterNewFeatureNotification::postBuild() +{ + setCanDrag(FALSE); + getChild("close_btn")->setCommitCallback(boost::bind(&LLFloaterNewFeatureNotification::onCloseBtn, this)); + + const std::string title_txt = "title_txt"; + const std::string dsc_txt = "description_txt"; + std::string feature = "_" + getKey().asString(); + + getChild(title_txt)->setValue(getString(title_txt + feature)); + getChild(dsc_txt)->setValue(getString(dsc_txt + feature)); + + return TRUE; +} + +void LLFloaterNewFeatureNotification::onOpen(const LLSD& key) +{ + centerOnScreen(); +} + +void LLFloaterNewFeatureNotification::onCloseBtn() +{ + closeFloater(); +} + +void LLFloaterNewFeatureNotification::centerOnScreen() +{ + LLVector2 window_size = LLUI::getInstance()->getWindowSize(); + centerWithin(LLRect(0, 0, ll_round(window_size.mV[VX]), ll_round(window_size.mV[VY]))); + LLFloaterView* parent = dynamic_cast(getParent()); + if (parent) + { + parent->bringToFront(this); + } +} + diff --git a/indra/newview/llfloaternewfeaturenotification.h b/indra/newview/llfloaternewfeaturenotification.h new file mode 100644 index 0000000000..95501451dc --- /dev/null +++ b/indra/newview/llfloaternewfeaturenotification.h @@ -0,0 +1,49 @@ +/** + * @file llfloaternewfeaturenotification.h + * @brief LLFloaterNewFeatureNotification class definition + * + * $LicenseInfo:firstyear=2023&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2023, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_FLOATER_NEW_FEATURE_NOTOFICATION_H +#define LL_FLOATER_NEW_FEATURE_NOTOFICATION_H + +#include "llfloater.h" + +class LLFloaterNewFeatureNotification: + public LLFloater +{ + friend class LLFloaterReg; +public: + BOOL postBuild() override; + void onOpen(const LLSD& key) override; + +private: + LLFloaterNewFeatureNotification(const LLSD& key); + /*virtual*/ ~LLFloaterNewFeatureNotification(); + + void centerOnScreen(); + + void onCloseBtn(); +}; + +#endif diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index e84894b395..8ffab761f4 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -3617,7 +3617,7 @@ bool process_login_success_response() std::string flag = login_flags["ever_logged_in"]; if(!flag.empty()) { - gAgent.setFirstLogin((flag == "N") ? TRUE : FALSE); + gAgent.setFirstLogin(flag == "N"); } /* Flag is currently ignored by the viewer. @@ -3708,7 +3708,7 @@ bool process_login_success_response() std::string fake_initial_outfit_name = gSavedSettings.getString("FakeInitialOutfitName"); if (!fake_initial_outfit_name.empty()) { - gAgent.setFirstLogin(TRUE); + gAgent.setFirstLogin(true); sInitialOutfit = fake_initial_outfit_name; if (sInitialOutfitGender.empty()) { diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index ca87ff0092..0d78bfd753 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -98,6 +98,7 @@ #include "llfloatermyscripts.h" #include "llfloatermyenvironment.h" #include "llfloaternamedesc.h" +#include "llfloaternewfeaturenotification.h" #include "llfloaternotificationsconsole.h" #include "llfloaternotificationstabbed.h" #include "llfloaterobjectweights.h" @@ -229,6 +230,7 @@ public: "avatar_picker", "camera", "camera_presets", + "change_item_thumbnail" "classified", "add_landmark", "delete_pref_preset", @@ -247,6 +249,7 @@ public: "message_critical", // Modal!!! Login specific. If this is in use elsewhere, better to create a non modal variant "message_tos", // Modal!!! Login specific. "mute_object_by_name", + "new_feature_notification", "publish_classified", "save_pref_preset", "save_camera_preset", @@ -395,6 +398,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("moveview", "floater_moveview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("mute_object_by_name", "floater_mute_object.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("mini_map", "floater_map.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("new_feature_notification", "floater_new_feature_notification.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("notifications_console", "floater_notifications_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/skins/default/xui/en/floater_new_feature_notification.xml b/indra/newview/skins/default/xui/en/floater_new_feature_notification.xml new file mode 100644 index 0000000000..5f0eeab71c --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_new_feature_notification.xml @@ -0,0 +1,60 @@ + + + +New inventory features + + +You can now add preview images to inventory items and view a folder in its own window. +Learn more in this [https://community.secondlife.com/blogs/entry/13637-new-features-inventory-item-preview-and-single-folder-view/ blogpost] + + +New feature + + +Feature description + +