diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 5cd34bed11..eb9205ff04 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -77,6 +77,9 @@ #include "llwlparammanager.h" #include "llwaterparammanager.h" #include "llpostprocess.h" +// [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a) +#include "rlvhandler.h" +// [/RLVa:KB] extern LLPointer gStartTexture; @@ -914,14 +917,10 @@ void render_hud_attachments() // clamp target zoom level to reasonable values // gAgentCamera.mHUDTargetZoom = llclamp(gAgentCamera.mHUDTargetZoom, 0.1f, 1.f); -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) - gAgentCamera.mHUDTargetZoom = llclamp(gAgentCamera.mHUDTargetZoom, 0.1f, 1.f); -/* - // TODO-RLVa: while hasLockedHUD() isn't slow this is called per frame so find a better way - gAgent.mHUDTargetZoom = llclamp(gAgent.mHUDTargetZoom, - ( (!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasLockedHUD()) ) ? 0.1f : 0.85f, 1.f); -*/ +// [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a) | Modified: RLVa-1.0.0c + gAgentCamera.mHUDTargetZoom = llclamp(gAgentCamera.mHUDTargetZoom, (!gRlvAttachmentLocks.hasLockedHUD()) ? 0.1f : 0.85f, 1.f); // [/RLVa:KB] + // smoothly interpolate current zoom level gAgentCamera.mHUDCurZoom = lerp(gAgentCamera.mHUDCurZoom, gAgentCamera.mHUDTargetZoom, LLCriticalDamp::getInterpolant(0.03f)); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 74dc3d4ac3..c78e879dd3 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1080,7 +1080,10 @@ class LLAdvancedToggleWireframe : public view_listener_t { bool handleEvent(const LLSD& userdata) { - gUseWireframe = !(gUseWireframe); +// gUseWireframe = !(gUseWireframe); +// [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a) | Added: RLVa-1.2.1a + gUseWireframe = (!gUseWireframe) && (!gRlvAttachmentLocks.hasLockedHUD()); +// [/RLVa:KB] return true; } }; @@ -7777,7 +7780,7 @@ class LLViewShowHUDAttachments : public view_listener_t { bool handleEvent(const LLSD& userdata) { -// [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.0f) | Modified: RLVa-1.0.0c +// [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.1a) | Modified: RLVa-1.0.0c if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.hasLockedHUD()) && (LLPipeline::sShowHUDAttachments) ) return true; // [/RLVa:KB] diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index cdf01ca2d5..43576c0a81 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1085,12 +1085,15 @@ const LLViewerJointAttachment *LLVOAvatarSelf::attachObject(LLViewerObject *view const LLUUID& attachment_id = viewer_object->getItemID(); LLAppearanceMgr::instance().registerAttachment(attachment_id); -// [RLVa:KB] - Checked: 2010-03-05 (RLVa-1.2.0a) | Added: RLVa-1.2.0a +// [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a) | Modified: RLVa-1.2.1a // NOTE: RLVa event handlers should be invoked *after* LLVOAvatar::attachObject() calls LLViewerJointAttachment::addObject() if (rlv_handler_t::isEnabled()) { RlvAttachmentLockWatchdog::instance().onAttach(viewer_object, attachment); gRlvHandler.onAttach(viewer_object, attachment); + + if ( (attachment->getIsHUDAttachment()) && (!gRlvAttachmentLocks.hasLockedHUD()) ) + gRlvAttachmentLocks.updateLockedHUD(); } // [/RLVa:KB] } @@ -1151,6 +1154,11 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) LLAppearanceMgr::instance().unregisterAttachment(attachment_id); } +// [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a) | Added: RLVa-1.2.1a + if ( (rlv_handler_t::isEnabled()) && (viewer_object->isHUDAttachment()) && (gRlvAttachmentLocks.hasLockedHUD()) ) + gRlvAttachmentLocks.updateLockedHUD(); +// [/RLVa:KB] + return TRUE; } return FALSE; diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index e356f78af6..40fa187c61 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -16,13 +16,13 @@ #include "llviewerprecompiledheaders.h" #include "llagentwearables.h" +#include "llappviewer.h" #include "llcallbacklist.h" #include "llviewermessage.h" #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "llworld.h" -#include "pipeline.h" #include "rlvhandler.h" #include "rlvinventory.h" @@ -412,12 +412,7 @@ void RlvHandler::onAttach(const LLViewerObject* pAttachObj, const LLViewerJointA // We need to check this object for an active "@detach=n" and actually lock it down now that it's been attached somewhere if (itObj->second.hasBehaviour(RLV_BHVR_DETACH, false)) - { - // (Copy/paste from processAddCommand) gRlvAttachmentLocks.addAttachmentLock(pAttachObj->getID(), itObj->second.m_UUID); - if (pAttachObj->isHUDAttachment()) - LLPipeline::sShowHUDAttachments = TRUE; // Prevents hiding of locked HUD attachments - } } } } @@ -525,11 +520,7 @@ bool RlvHandler::onGC() // -> if it does run it likely means that there's a @detach=n in a *child* prim that we couldn't look up in onAttach() // -> since RLV doesn't currently support @detach=n from child prims it's actually not such a big deal right now but still if ( (pObj->isAttachment()) && (itCurObj->second.hasBehaviour(RLV_BHVR_DETACH, false)) ) - { gRlvAttachmentLocks.addAttachmentLock(pObj->getID(), itCurObj->second.m_UUID); - if (pObj->isHUDAttachment()) - LLPipeline::sShowHUDAttachments = TRUE; - } } } } @@ -1290,10 +1281,6 @@ ERlvCmdRet RlvHandler::onAddRemAttach(const LLUUID& idObj, const RlvCommand& rlv } } - // Refresh HUD visibility if needed - if ( (RLV_BHVR_REMATTACH == rlvCmd.getBehaviourType()) && (gRlvAttachmentLocks.hasLockedHUD()) ) - LLPipeline::sShowHUDAttachments = TRUE; - fRefCount = rlvCmd.getOption().empty(); // Only reference count global locks return RLV_RET_SUCCESS; } @@ -1333,10 +1320,6 @@ ERlvCmdRet RlvHandler::onAddRemDetach(const LLUUID& idObj, const RlvCommand& rlv gRlvAttachmentLocks.removeAttachmentPointLock(idxAttachPt, idObj, (ERlvLockMask)(RLV_LOCK_ADD | RLV_LOCK_REMOVE)); } - // Refresh HUD visibility if needed - if ( (RLV_TYPE_ADD == rlvCmd.getParamType()) && (gRlvAttachmentLocks.hasLockedHUD()) ) - LLPipeline::sShowHUDAttachments = TRUE; - fRefCount = false; // Don't reference count @detach[: