diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index ebc09c702530540c78399b396744fd90bf95a491..8eb0514575954e85df453e5d59936017d0ef7258 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1107,8 +1107,11 @@ void LLAgentCamera::updateLookAt(const S32 mouse_x, const S32 mouse_y) F32 y_from_center = ((F32) mouse_y / (F32) gViewerWindow->getWorldViewHeightScaled() ) - 0.5f; - frameCamera.yaw( - x_from_center * gSavedSettings.getF32("YawFromMousePosition") * DEG_TO_RAD); - frameCamera.pitch( - y_from_center * gSavedSettings.getF32("PitchFromMousePosition") * DEG_TO_RAD); + static LLCachedControl<F32> yaw_from_mpos(gSavedSettings, "YawFromMousePosition"); + static LLCachedControl<F32> pitch_from_mpos(gSavedSettings, "PitchFromMousePosition"); + + frameCamera.yaw( - x_from_center * yaw_from_mpos * DEG_TO_RAD); + frameCamera.pitch( - y_from_center * pitch_from_mpos * DEG_TO_RAD); lookAtType = LOOKAT_TARGET_FREELOOK; } @@ -1734,7 +1737,8 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) } else { - local_camera_offset = mCameraZoomFraction * getCameraOffsetInitial() * gSavedSettings.getF32("CameraOffsetScale"); + static LLCachedControl<F32> sCameraOffsetScale(gSavedSettings, "CameraOffsetScale"); + local_camera_offset = mCameraZoomFraction * getCameraOffsetInitial() * sCameraOffsetScale; // are we sitting down? if (isAgentAvatarValid() && gAgentAvatarp->getParent()) @@ -1837,7 +1841,8 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) } else { - target_lag = vel * gSavedSettings.getF32("DynamicCameraStrength") / 30.f; + static LLCachedControl<F32> dynamic_cam_strength(gSavedSettings, "DynamicCameraStrength"); + target_lag = vel * dynamic_cam_strength / 30.f; } mCameraLag = lerp(mCameraLag, target_lag, lag_interp); @@ -1975,10 +1980,11 @@ void LLAgentCamera::handleScrollWheel(S32 clicks) { F32 camera_offset_initial_mag = getCameraOffsetInitial().magVec(); - F32 current_zoom_fraction = mTargetCameraDistance / (camera_offset_initial_mag * gSavedSettings.getF32("CameraOffsetScale")); + static LLCachedControl<F32> sCameraOffsetScale(gSavedSettings, "CameraOffsetScale"); + F32 current_zoom_fraction = mTargetCameraDistance / (camera_offset_initial_mag * sCameraOffsetScale); current_zoom_fraction *= 1.f - pow(ROOT_ROOT_TWO, clicks); - cameraOrbitIn(current_zoom_fraction * camera_offset_initial_mag * gSavedSettings.getF32("CameraOffsetScale")); + cameraOrbitIn(current_zoom_fraction * camera_offset_initial_mag * sCameraOffsetScale); } else { diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index a36642b7a718068c273d5b9c1807c40b1fea6cd8..93c39a0b539fd6ce46ef3fda9ddae84f3314ad28 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -342,7 +342,8 @@ void LLAvatarActions::showProfile(const LLUUID& id) { if (id.notNull()) { - if (gSavedSettings.getBool("AlchemyUseWannabeFacebook")) + static LLCachedControl<bool> wannabe_facebook(gSavedSettings, "AlchemyUseWannabeFacebook"); + if (wannabe_facebook) { LLAvatarNameCache::get(id, boost::bind(&on_avatar_name_show_profile, _1, _2)); } @@ -370,7 +371,8 @@ bool LLAvatarActions::profileVisible(const LLUUID& id) //static LLFloater* LLAvatarActions::getProfileFloater(const LLUUID& id) { - if (gSavedSettings.getBool("AlchemyUseWannabeFacebook")) + static LLCachedControl<bool> wannabe_facebook(gSavedSettings, "AlchemyUseWannabeFacebook"); + if (wannabe_facebook) { return LLFloaterReg::findTypedInstance<LLFloaterWebContent>(get_profile_floater_name(id), LLSD().with("id", id)); } diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 32c43829f51d36b9175c5123de93a125228cff5e..249bd40ec93fcc6cf7880cdd3f279079abf8220d 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -1129,7 +1129,7 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l // // Default prefs will suppress display unless the object is interactive // - bool show_all_object_tips = gSavedSettings.getBool("ShowAllObjectHoverTip"); + static LLCachedControl<bool> show_all_object_tips(gSavedSettings, "ShowAllObjectHoverTip"); LLSelectNode *nodep = LLSelectMgr::getInstance()->getHoverNode(); // only show tooltip if same inspector not already open diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 8e8e7d3edeffdca189b07c3d3001ebde9e988686..63e5eb1caab2784a259e41c2f27fc434fce96e47 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -223,7 +223,7 @@ void display_stats() LLMemory::logMemoryInfo(TRUE) ; gRecentMemoryTime.reset(); } - F32 asset_storage_log_freq = gSavedSettings.getF32("AssetStorageLogFrequency"); + static LLCachedControl<F32> asset_storage_log_freq(gSavedSettings, "AssetStorageLogFrequency"); if (asset_storage_log_freq > 0.f && gAssetStorageLogTime.getElapsedTimeF32() >= asset_storage_log_freq) { gAssetStorageLogTime.reset(); diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 710f383c305a8fd6eeee5216abee6b448e84c73a..244b18e1a9b7fa233471f5fb11c9339e277844b6 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -848,6 +848,7 @@ void LLViewerObjectList::update(LLAgent &agent) static LLCachedControl<bool> cc_velocity_interpolate(gSavedSettings, "VelocityInterpolate"); static LLCachedControl<bool> cc_ping_interpolate(gSavedSettings, "PingInterpolate"); static LLCachedControl<F32> cc_interpolation_time(gSavedSettings, "InterpolationTime"); + static LLCachedControl<F32> cc_ping_region_cross_interp(gSavedSettings, "RegionCrossingInterpolationTime"); static LLCachedControl<F32> cc_interpolation_phase_out(gSavedSettings, "InterpolationPhaseOut"); static LLCachedControl<bool> cc_animate_textures(gSavedSettings, "AnimateTextures"); @@ -857,7 +858,7 @@ void LLViewerObjectList::update(LLAgent &agent) F32 interp_time = cc_interpolation_time; F32 phase_out_time = cc_interpolation_phase_out; - F32 region_interp_time = llclamp(gSavedSettings.getF32("RegionCrossingInterpolationTime"), 0.5f, 5.f); + F32 region_interp_time = llclamp(cc_ping_region_cross_interp(), 0.5f, 5.f); if (interp_time < 0.0 || phase_out_time < 0.0 || phase_out_time > interp_time) diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp index 2e6c0c70971735bddd57564c70d5032d074a2b9d..87400d03b896c214d74d9a3ad4d456e5798ea754 100644 --- a/indra/newview/llviewertexlayer.cpp +++ b/indra/newview/llviewertexlayer.cpp @@ -335,7 +335,7 @@ BOOL LLViewerTexLayerSetBuffer::isReadyToUpdate() const // Update if we've hit a timeout. Unlike for uploads, we can make this timeout fairly small // since render unnecessarily doesn't cost much. - const U32 texture_timeout = gSavedSettings.getU32("AvatarBakedLocalTextureUpdateTimeout"); + static LLCachedControl<U32> texture_timeout(gSavedSettings, "AvatarBakedLocalTextureUpdateTimeout"); if (texture_timeout != 0) { // If we hit our timeout and have textures available at even lower resolution, then update. diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 4c0036f966520263204d31fdaf08eb771627d9b1..3f74b98f1fee9d79425f1eb1682df07f41bd10af 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2718,7 +2718,8 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) // If "Pressing letter keys starts local chat" option is selected, we are not in mouselook, // no view has keyboard focus, this is a printable character key (and no modifier key is // pressed except shift), then give focus to nearby chat (STORM-560) - if ( gSavedSettings.getS32("LetterKeysFocusChatBar") && !gAgentCamera.cameraMouselook() && + static LLCachedControl<S32> letter_focus_chat_bar(gSavedSettings, "LetterKeysFocusChatBar"); + if (letter_focus_chat_bar && !gAgentCamera.cameraMouselook() && !keyboard_focus && key < 0x80 && (mask == MASK_NONE || mask == MASK_SHIFT) ) { static LLCachedControl<U32> sChatInWindow(gSavedSettings, "NearbyChatInput", 0);