From ab5491fd3d429e55bb6cb45ab11384de1f386e83 Mon Sep 17 00:00:00 2001 From: Kitty Barnett <develop@catznip.com> Date: Mon, 28 Aug 2023 01:27:38 +0200 Subject: [PATCH] [FIXED] Post merge errors --- indra/newview/llagentcamera.cpp | 41 +++++++++++++++++++++++++-------- indra/newview/rlveffects.cpp | 10 ++------ indra/newview/rlvhandler.cpp | 10 ++++++++ indra/newview/rlvmodifiers.h | 2 +- 4 files changed, 45 insertions(+), 18 deletions(-) diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index b7e56f035ca..1ea71d2186d 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1700,8 +1700,11 @@ LLVector3d LLAgentCamera::calcThirdPersonFocusOffset() agent_rot *= ((LLViewerObject*)(gAgentAvatarp->getParent()))->getRenderRotation(); } - static LLCachedControl<LLVector3d> focus_offset_initial(gSavedSettings, "FocusOffsetRearView", LLVector3d()); - return focus_offset_initial * agent_rot; +// [RLVa:KB] - @setcam_focusoffset + return getFocusOffsetInitial() * agent_rot; +// [/RLVa:KB] +// static LLCachedControl<LLVector3d> focus_offset_initial(gSavedSettings, "FocusOffsetRearView", LLVector3d()); +// return focus_offset_initial * agent_rot; } void LLAgentCamera::setupSitCamera() @@ -1838,8 +1841,11 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) } else { - static LLCachedControl<F32> camera_offset_scale(gSavedSettings, "CameraOffsetScale"); - local_camera_offset = mCameraZoomFraction * getCameraOffsetInitial() * camera_offset_scale; +// [RLVa:KB] - @setcam_eyeoffsetscale + local_camera_offset = mCameraZoomFraction * getCameraOffsetInitial() * getCameraOffsetScale(); +// [/RLVa:KB] +// static LLCachedControl<F32> camera_offset_scale(gSavedSettings, "CameraOffsetScale"); +// local_camera_offset = mCameraZoomFraction * getCameraOffsetInitial() * camera_offset_scale; // are we sitting down? if (isAgentAvatarValid() && gAgentAvatarp->getParent()) @@ -2143,15 +2149,32 @@ LLVector3 LLAgentCamera::getCameraOffsetInitial() { // getCameraOffsetInitial and getFocusOffsetInitial can be called on update from idle before init() static LLCachedControl<LLVector3> camera_offset_initial (gSavedSettings, "CameraOffsetRearView", LLVector3()); - return camera_offset_initial; +// [RLVa:KB] - @setcam_eyeoffset + static LLCachedControl<LLVector3> camera_offset_initial_rlv (gSavedSettings, "CameraOffsetRLVaView", LLVector3()); + return (ECameraPreset::CAMERA_RLV_SETCAM_VIEW != mCameraPreset) ? camera_offset_initial : camera_offset_initial_rlv; +// [/RLVa:KB] +// return camera_offset_initial; } LLVector3d LLAgentCamera::getFocusOffsetInitial() { static LLCachedControl<LLVector3d> focus_offset_initial(gSavedSettings, "FocusOffsetRearView", LLVector3d()); - return focus_offset_initial; +// [RLVa:KB] - @setcam_focusoffset + static LLCachedControl<LLVector3d> focus_offset_initial_rlv(gSavedSettings, "FocusOffsetRLVaView", LLVector3d()); + return (ECameraPreset::CAMERA_RLV_SETCAM_VIEW != mCameraPreset) ? focus_offset_initial : focus_offset_initial_rlv; +// [/RLVa:KB] +// return focus_offset_initial; } +// [RLVa:KB] - @setcam_eyeoffsetscale +F32 LLAgentCamera::getCameraOffsetScale() const +{ + static LLCachedControl<F32> camera_offset_scale(gSavedSettings, "CameraOffsetScale"); + static LLCachedControl<F32> camera_offset_scale_rlv(gSavedSettings, "CameraOffsetScaleRLVa"); + return (ECameraPreset::CAMERA_RLV_SETCAM_VIEW != mCameraPreset) ? camera_offset_scale : camera_offset_scale_rlv; +} +// [/RLVa:KB] + F32 LLAgentCamera::getCameraMaxZoomDistance() { // Ignore "DisableCameraConstraints", we don't want to be out of draw range when we focus onto objects or avatars @@ -2570,9 +2593,9 @@ void LLAgentCamera::switchCameraPreset(ECameraPreset preset) else { // When switching to our view, copy the current values - mRlvCameraOffsetInitialControl->setDefaultValue(convert_to_llsd(getCameraOffsetInitial())); - mRlvFocusOffsetInitialControl->setDefaultValue(convert_to_llsd(getFocusOffsetInitial())); - mRlvCameraOffsetScaleControl->setDefaultValue(getCameraOffsetScale()); + gSavedSettings.setVector3("CameraOffsetRLVaView", getCameraOffsetInitial()); + gSavedSettings.setVector3d("FocusOffsetRLVaView", getFocusOffsetInitial()); + gSavedSettings.setF32("CameraOffsetScaleRLVa", getCameraOffsetScale()); } } } diff --git a/indra/newview/rlveffects.cpp b/indra/newview/rlveffects.cpp index b3ad4646468..1767bd64763 100644 --- a/indra/newview/rlveffects.cpp +++ b/indra/newview/rlveffects.cpp @@ -114,10 +114,7 @@ void RlvOverlayEffect::run(const LLVisualEffectParams*) { if (m_pImage) { - if (LLGLSLShader::sNoFixedFunction) - { - gUIProgram.bind(); - } + gUIProgram.bind(); int nWidth = gViewerWindow->getWorldViewWidthScaled(); int nHeight = gViewerWindow->getWorldViewHeightScaled(); @@ -144,10 +141,7 @@ void RlvOverlayEffect::run(const LLVisualEffectParams*) gGL.flush(); gViewerWindow->setup3DRender(); - if (LLGLSLShader::sNoFixedFunction) - { - gUIProgram.unbind(); - } + gUIProgram.unbind(); } } diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index 15e5636989a..a6cf2aa2103 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -1549,6 +1549,16 @@ bool RlvHandler::setEnabled(bool fEnable) // Reset to show assertions if the viewer version changed if (gSavedSettings.getString("LastRunVersion") != gLastRunVersion) gSavedSettings.set<bool>(RlvSettingNames::ShowAssertionFail, TRUE); + + // Set up camera debug controls + { + LLControlVariable* pCameraOffsetRLVaView = gSavedSettings.declareVec3("CameraOffsetRLVaView", LLVector3::zero, "Declared in code", LLControlVariable::PERSIST_NO); + pCameraOffsetRLVaView->setHiddenFromSettingsEditor(true); + LLControlVariable* pCameraOffsetScaleRLVa = gSavedSettings.declareF32("CameraOffsetScaleRLVa", 0.0f, "Declared in code", LLControlVariable::PERSIST_NO); + pCameraOffsetScaleRLVa->setHiddenFromSettingsEditor(true); + LLControlVariable* pFocusOffsetRLVaView = gSavedSettings.declareVec3d("FocusOffsetRLVaView", LLVector3d::zero, "Declared in code", LLControlVariable::PERSIST_NO); + pFocusOffsetRLVaView->setHiddenFromSettingsEditor(true); + } } return m_fEnabled; diff --git a/indra/newview/rlvmodifiers.h b/indra/newview/rlvmodifiers.h index 374ef585670..a17a7525a1e 100644 --- a/indra/newview/rlvmodifiers.h +++ b/indra/newview/rlvmodifiers.h @@ -121,7 +121,7 @@ class RlvCachedBehaviourModifier public: RlvCachedBehaviourModifier(ERlvBehaviourModifier eModifier) { - if ((mCachedModifierPtr = RlvBehaviourModifierCache<T>::getInstance(eModifier)) == nullptr) + if ((mCachedModifierPtr = RlvBehaviourModifierCache<T>::getInstance(eModifier).get()) == nullptr) mCachedModifierPtr = new RlvBehaviourModifierCache<T>(eModifier); } -- GitLab