From eaccee37f2875c4d2378cf0ce562f382b88487d7 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 15 Apr 2023 02:23:38 +0300 Subject: SL-19549 Add option to show ban lines on collision --- indra/newview/llviewerparcelmgr.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewerparcelmgr.cpp') diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 97dc916bfe..bb68278555 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -72,7 +72,11 @@ #include "llenvironment.h" -const F32 PARCEL_COLLISION_DRAW_SECS = 1.f; +const F32 PARCEL_BAN_LINES_DRAW_SECS_ON_COLLISION = 10.f; +const F32 PARCEL_COLLISION_DRAW_SECS_ON_PROXIMITY = 1.f; +const S32 PARCEL_BAN_LINES_HIDE = 0; +const S32 PARCEL_BAN_LINES_ON_COLLISION = 1; +const S32 PARCEL_BAN_LINES_ON_PROXIMITY = 2; // Globals @@ -892,13 +896,18 @@ void LLViewerParcelMgr::render() void LLViewerParcelMgr::renderParcelCollision() { + static LLCachedControl ban_lines_mode(gSavedSettings , "ShowBanLines" , PARCEL_BAN_LINES_DRAW_SECS_ON_COLLISION); + // check for expiration - if (mCollisionTimer.getElapsedTimeF32() > PARCEL_COLLISION_DRAW_SECS) + F32 expiration = (ban_lines_mode == PARCEL_BAN_LINES_ON_PROXIMITY) + ? PARCEL_COLLISION_DRAW_SECS_ON_PROXIMITY + : PARCEL_BAN_LINES_DRAW_SECS_ON_COLLISION; + if (mCollisionTimer.getElapsedTimeF32() > expiration) { - mRenderCollision = FALSE; + mRenderCollision = false; } - if (mRenderCollision && gSavedSettings.getBOOL("ShowBanLines")) + if (mRenderCollision && ban_lines_mode != PARCEL_BAN_LINES_HIDE) { LLViewerRegion* regionp = gAgent.getRegion(); if (regionp) @@ -1842,8 +1851,11 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) { // We're about to collide with this parcel - parcel_mgr.mRenderCollision = TRUE; - parcel_mgr.mCollisionTimer.reset(); + static LLCachedControl ban_lines_mode(gSavedSettings , "ShowBanLines" , PARCEL_BAN_LINES_DRAW_SECS_ON_COLLISION); + if (ban_lines_mode == PARCEL_BAN_LINES_ON_PROXIMITY) + { + parcel_mgr.resetCollisionTimer(); + } // Differentiate this parcel if we are banned from it. if (sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) -- cgit v1.2.3 From 1f94ac9b89ddc86160e92a361bda42347b975f67 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 17 Apr 2023 15:31:22 +0300 Subject: SL-19549 Add option to show ban lines on collision #2 --- indra/newview/llviewerparcelmgr.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview/llviewerparcelmgr.cpp') diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index bb68278555..15accd0547 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -74,14 +74,14 @@ const F32 PARCEL_BAN_LINES_DRAW_SECS_ON_COLLISION = 10.f; const F32 PARCEL_COLLISION_DRAW_SECS_ON_PROXIMITY = 1.f; -const S32 PARCEL_BAN_LINES_HIDE = 0; -const S32 PARCEL_BAN_LINES_ON_COLLISION = 1; -const S32 PARCEL_BAN_LINES_ON_PROXIMITY = 2; // Globals U8* LLViewerParcelMgr::sPackedOverlay = NULL; +S32 LLViewerParcelMgr::PARCEL_BAN_LINES_HIDE = 0; +S32 LLViewerParcelMgr::PARCEL_BAN_LINES_ON_COLLISION = 1; +S32 LLViewerParcelMgr::PARCEL_BAN_LINES_ON_PROXIMITY = 2; LLUUID gCurrentMovieID = LLUUID::null; @@ -896,7 +896,7 @@ void LLViewerParcelMgr::render() void LLViewerParcelMgr::renderParcelCollision() { - static LLCachedControl ban_lines_mode(gSavedSettings , "ShowBanLines" , PARCEL_BAN_LINES_DRAW_SECS_ON_COLLISION); + static LLCachedControl ban_lines_mode(gSavedSettings , "ShowBanLines" , PARCEL_BAN_LINES_ON_COLLISION); // check for expiration F32 expiration = (ban_lines_mode == PARCEL_BAN_LINES_ON_PROXIMITY) @@ -1851,7 +1851,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) { // We're about to collide with this parcel - static LLCachedControl ban_lines_mode(gSavedSettings , "ShowBanLines" , PARCEL_BAN_LINES_DRAW_SECS_ON_COLLISION); + static LLCachedControl ban_lines_mode(gSavedSettings , "ShowBanLines" , PARCEL_BAN_LINES_ON_COLLISION); if (ban_lines_mode == PARCEL_BAN_LINES_ON_PROXIMITY) { parcel_mgr.resetCollisionTimer(); -- cgit v1.2.3