From 13e25cfe6af960787c999fd9f53a5863a57a7ca0 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Thu, 10 Oct 2013 04:29:12 -0400 Subject: [PATCH] Feature Request: Add MiniMapPrimMaxAltitudeDelta and MiniMapPrimMaxAltitudeDeltaOwn to debug settings for users to configure how much altitude difference prims can have to be shown on the minimap --- indra/newview/app_settings/settings.xml | 22 ++++++++++++++++++++++ indra/newview/llviewerobjectlist.cpp | 10 +++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 0a4e4183b..c1f005aba 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10041,6 +10041,28 @@ This should be as low as possible, but too low may break functionality Value 1 + MiniMapPrimMaxAltitudeDelta + + Comment + Max allowed altitude difference between your avatar and prims others own for them to be displayed on the minimap (0 means unlimited). + Persist + 1 + Type + U32 + Value + 256 + + MiniMapPrimMaxAltitudeDeltaOwn + + Comment + Max allowed altitude difference between your avatar and prims you own for them to be displayed on the minimap (0 means unlimited). + Persist + 1 + Type + U32 + Value + 0 + MiniMapPrimMaxRadius Comment diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index dfe5db84b..4ae625a52 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1714,8 +1714,8 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) F32 max_radius = gSavedSettings.getF32("MiniMapPrimMaxRadius"); - static const F32 MAX_ALTITUDE_ABOVE_SELF = 256.f; - F32 max_altitude = gAgent.getPositionGlobal()[VZ] + MAX_ALTITUDE_ABOVE_SELF; + const F32 agent_altitude(gAgent.getPositionGlobal()[VZ]); + static const LLCachedControl delta("MiniMapPrimMaxAltitudeDelta"); for (vobj_list_t::iterator iter = mMapObjects.begin(); iter != mMapObjects.end(); ++iter) { @@ -1743,6 +1743,10 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) LLColor4U color = above_water_color; if( objectp->permYouOwner() ) { + static const LLCachedControl delta("MiniMapPrimMaxAltitudeDeltaOwn"); + if (delta && static_cast(std::fabs(agent_altitude - pos[VZ])) > delta) + continue; + const F32 MIN_RADIUS_FOR_OWNED_OBJECTS = 2.f; if( approx_radius < MIN_RADIUS_FOR_OWNED_OBJECTS ) { @@ -1772,7 +1776,7 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) } } } - else if ( pos[VZ] > max_altitude ) + else if (delta && static_cast(std::fabs(agent_altitude - pos[VZ])) > delta) { continue; }