diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp index 5f50e462336424cc88dfcf0473d9a09f01c3c7dc..d4d1ad3259f0cb43a0a933358acd46433ffe24e4 100644 --- a/indra/llui/llconsole.cpp +++ b/indra/llui/llconsole.cpp @@ -180,8 +180,10 @@ void LLConsole::draw() LLUIImagePtr imagep = LLUI::getUIImage("transparent"); - F32 console_opacity = llclamp(LLUI::getInstance()->mSettingGroups["config"]->getF32("ConsoleBackgroundOpacity"), 0.f, 1.f); - LLColor4 color = LLUIColorTable::instance().getColor("ConsoleBackground"); + static LLUICachedControl<F32> console_background_opacity("ConsoleBackgroundOpacity", 0.7f); + F32 console_opacity = llclamp(console_background_opacity(), 0.f, 1.f); + static const LLUIColor color_background = LLUIColorTable::instance().getColor("ConsoleBackground"); + auto color = color_background.get(); color.mV[VALPHA] *= console_opacity; F32 line_height = mFont->getLineHeight(); diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index e718fcec46038d3306bd224f167490477bd94963..894b4129ee8790e1d3cf6a03076b20b70cec1d5b 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -342,7 +342,9 @@ static LLTrace::BlockTimerStatHandle FTM_FILTER("Filter Folder View"); void LLFolderView::filter( LLFolderViewFilter& filter ) { LL_RECORD_BLOCK_TIME(FTM_FILTER); - filter.resetTime(llclamp(LLUI::getInstance()->mSettingGroups["config"]->getS32(mParentPanel.get()->getVisible() ? "FilterItemsMaxTimePerFrameVisible" : "FilterItemsMaxTimePerFrameUnvisible"), 1, 100)); + static const LLUICachedControl<S32> filter_item_max_time_visible("FilterItemsMaxTimePerFrameVisible", 10); + static const LLUICachedControl<S32> filter_item_max_time_unvisible("FilterItemsMaxTimePerFrameUnvisible", 1); + filter.resetTime(llclamp(mParentPanel.get()->getVisible() ? static_cast<S32>(filter_item_max_time_visible) : static_cast<S32>(filter_item_max_time_unvisible), 1, 100)); // Note: we filter the model, not the view getViewModelItem()->filter(filter); @@ -661,7 +663,8 @@ void LLFolderView::draw() closeAutoOpenedFolders(); } - if (mSearchTimer.getElapsedTimeF32() > LLUI::getInstance()->mSettingGroups["config"]->getF32("TypeAheadTimeout") || !mSearchString.size()) + static LLUICachedControl<F32> type_ahead_timeout("TypeAheadTimeout", 0); + if (mSearchTimer.getElapsedTimeF32() > type_ahead_timeout || mSearchString.empty()) { mSearchString.clear(); } @@ -1325,7 +1328,8 @@ BOOL LLFolderView::handleUnicodeCharHere(llwchar uni_char) } //do text search - if (mSearchTimer.getElapsedTimeF32() > LLUI::getInstance()->mSettingGroups["config"]->getF32("TypeAheadTimeout")) + static LLUICachedControl<F32> type_ahead_timeout("TypeAheadTimeout", 0.f); + if (mSearchTimer.getElapsedTimeF32() > type_ahead_timeout) { mSearchString.clear(); } diff --git a/indra/llui/llfolderviewmodel.cpp b/indra/llui/llfolderviewmodel.cpp index 3b45fb53a2183ebfa99ea982aeae816e929dbe8e..2e9091f4b237be3d182d0bb354dc1f5f8b700170 100644 --- a/indra/llui/llfolderviewmodel.cpp +++ b/indra/llui/llfolderviewmodel.cpp @@ -48,7 +48,8 @@ std::string LLFolderViewModelCommon::getStatusText() void LLFolderViewModelCommon::filter() { - getFilter().resetTime(llclamp(LLUI::getInstance()->mSettingGroups["config"]->getS32("FilterItemsMaxTimePerFrameVisible"), 1, 100)); + static LLUICachedControl<S32> filter_item_max_time_visible("FilterItemsMaxTimePerFrameVisible", 10); + getFilter().resetTime(llclamp(filter_item_max_time_visible(), 1, 100)); mFolderView->getViewModelItem()->filter(getFilter()); } diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 2a4d29c325eccf786d27e5a1a71f3d737bafe62d..c38ead89137d294e6b59e61ed58e44632ce5d286 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -1942,7 +1942,8 @@ void LLAgent::propagate(const F32 dt) //----------------------------------------------------------------------------- void LLAgent::updateAgentPosition(const F32 dt, const F32 yaw_radians, const S32 mouse_x, const S32 mouse_y) { - if (mMoveTimer.getStarted() && mMoveTimer.getElapsedTimeF32() > gSavedSettings.getF32("NotMovingHintTimeout")) + static const LLCachedControl<F32> not_moving_hint_timeout(gSavedSettings, "NotMovingHintTimeout"); + if (mMoveTimer.getStarted() && mMoveTimer.getElapsedTimeF32() > not_moving_hint_timeout) { LLFirstUse::notMoving(); } diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 613e7eb78f52ad54759cc0c78cfa6b2bbf104898..857fef731385db8f93b350d354114a76b0aa643d 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -567,10 +567,10 @@ LLVector3 LLAgentCamera::calcFocusOffset(LLViewerObject *object, LLVector3 origi BOOL LLAgentCamera::calcCameraMinDistance(F32 &obj_min_distance) { BOOL soft_limit = FALSE; // is the bounding box to be treated literally (volumes) or as an approximation (avatars) - + static const LLCachedControl<bool> sDisableCameraConstraints(gSavedSettings, "DisableCameraConstraints"); if (!mFocusObject || mFocusObject->isDead() || mFocusObject->isMesh() || - gSavedSettings.getBOOL("DisableCameraConstraints")) + sDisableCameraConstraints) { obj_min_distance = 0.f; return TRUE; @@ -1002,7 +1002,8 @@ void LLAgentCamera::cameraOrbitIn(const F32 meters) if (new_distance > max_distance) { // Unless camera is unlocked - if (!gSavedSettings.getBOOL("DisableCameraConstraints")) + static const LLCachedControl<bool> sDisableCameraConstraints(gSavedSettings, "DisableCameraConstraints"); + if (!sDisableCameraConstraints) { return; } @@ -1386,7 +1387,8 @@ void LLAgentCamera::updateCamera() { const F32 SMOOTHING_HALF_LIFE = 0.02f; - F32 smoothing = LLSmoothInterpolation::getInterpolant(gSavedSettings.getF32("CameraPositionSmoothing") * SMOOTHING_HALF_LIFE, FALSE); + static const LLCachedControl<F32> cam_pos_smoothing(gSavedSettings, "CameraPositionSmoothing"); + F32 smoothing = LLSmoothInterpolation::getInterpolant(cam_pos_smoothing * SMOOTHING_HALF_LIFE, FALSE); if (!mFocusObject) // we differentiate on avatar mode { @@ -1915,8 +1917,8 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) // camera gets pushed out later wrt mCameraFOVZoomFactor...this is "raw" value camera_position_global = focusPosGlobal + mCameraFocusOffset; } - - if (!gSavedSettings.getBOOL("DisableCameraConstraints") && !gAgent.isGodlike()) + static const LLCachedControl<bool> disable_cam_constraints(gSavedSettings, "DisableCameraConstraints"); + if (!disable_cam_constraints && !gAgent.isGodlike()) { LLViewerRegion* regionp = LLWorld::getInstance()->getRegionFromPosGlobal(camera_position_global); bool constrain = true; @@ -2123,17 +2125,8 @@ F32 LLAgentCamera::getCameraMinOffGround() { return 0.f; } - else - { - if (gSavedSettings.getBOOL("DisableCameraConstraints")) - { - return -1000.f; - } - else - { - return 0.5f; - } - } + static const LLCachedControl<bool> disable_cam_constraints(gSavedSettings, "DisableCameraConstraints"); + return disable_cam_constraints ? -1000.f : 0.5f; } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 7c0aa053136a10fc9de30bf61052e75ff59a3f23..8678bf764dec2ed92780d752002c8af3183bf641 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -494,9 +494,10 @@ void idle_afk_check() { // check idle timers F32 current_idle = gAwayTriggerTimer.getElapsedTimeF32(); + static const LLCachedControl<S32> afk_timeout_cc(gSavedSettings, "AFKTimeout"); // [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g // Enforce an idle time of 30 minutes if @allowidle=n restricted - F32 afk_timeout = (!gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE)) ? gSavedSettings.getS32("AFKTimeout") : 60 * 30; + F32 afk_timeout = (!gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE)) ? afk_timeout_cc : 60 * 30; // [/RLVa:KB] // F32 afk_timeout = gSavedSettings.getS32("AFKTimeout"); if (afk_timeout && (current_idle > afk_timeout) && ! gAgent.getAFK()) @@ -4717,7 +4718,7 @@ void LLAppViewer::idle() // Smoothly weight toward current frame gFPSClamped = (frame_rate_clamped + (4.f * gFPSClamped)) / 5.f; - F32 qas = gSavedSettings.getF32("QuitAfterSeconds"); + static const LLCachedControl<F32> qas(gSavedSettings, "QuitAfterSeconds"); if (qas > 0.f) { if (gRenderStartTime.getElapsedTimeF32() > qas) @@ -4762,7 +4763,8 @@ void LLAppViewer::idle() // Update simulator agent state // - if (gSavedSettings.getBOOL("RotateRight")) + static const LLCachedControl<bool> rotateRight(gSavedSettings, "RotateRight"); + if (rotateRight) { gAgent.moveYaw(-1.f); } @@ -5299,7 +5301,8 @@ void LLAppViewer::idleNetwork() gObjectList.mNumNewObjects = 0; S32 total_decoded = 0; - if (!gSavedSettings.getBOOL("SpeedTest")) + static const LLCachedControl<bool> speedTest(gSavedSettings, "SpeedTest"); + if (!speedTest) { LL_RECORD_BLOCK_TIME(FTM_IDLE_NETWORK); // decode @@ -5338,7 +5341,8 @@ void LLAppViewer::idleNetwork() } // Handle per-frame message system processing. - gMessageSystem->processAcks(gSavedSettings.getF32("AckCollectTime")); + static LLCachedControl<F32> sAckCollectTime(gSavedSettings, "AckCollectTime", 0.1f); + gMessageSystem->processAcks(sAckCollectTime); #ifdef TIME_THROTTLE_MESSAGES if (total_time >= CheckMessagesMaxTime) @@ -5652,7 +5656,8 @@ void LLAppViewer::setMasterSystemAudioMute(bool mute) //virtual bool LLAppViewer::getMasterSystemAudioMute() { - return gSavedSettings.getBOOL("MuteAudio"); + static const LLCachedControl<bool> mute_audio(gSavedSettings, "MuteAudio"); + return mute_audio; } //---------------------------------------------------------------------------- diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index 1ce9fe3a7ad0a27d47f5a024bf80ac98bae382a4..5f6d0b09201f151bbf3866c968ef7c35bcb39b03 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -128,7 +128,8 @@ void LLFirstUse::firstUseNotification(const std::string& control_var, bool enabl if (enable) { - if (gSavedSettings.getBOOL("EnableUIHints")) + static const LLCachedControl<bool> enable_ui_hints(gSavedSettings, "EnableUIHints"); + if (enable_ui_hints) { LL_DEBUGS("LLFirstUse") << "Trigger first use notification " << notification_name << LL_ENDL; diff --git a/indra/newview/llhudeffecttrail.cpp b/indra/newview/llhudeffecttrail.cpp index 2ba8aa422bd1b70335222ca1c12e69d299fe3029..5fbfa393360a30f9ac9608762f60989a682e42df 100644 --- a/indra/newview/llhudeffecttrail.cpp +++ b/indra/newview/llhudeffecttrail.cpp @@ -167,7 +167,7 @@ void LLHUDEffectSpiral::triggerLocal() { mKillTime = mTimer.getElapsedTimeF32() + mDuration; - BOOL show_beam = gSavedSettings.getBOOL("ShowSelectionBeam"); + static const LLCachedControl<bool> show_beam(gSavedSettings, "ShowSelectionBeam", true); LLColor4 color; color.setVec(mColor); @@ -262,12 +262,13 @@ void LLHUDEffectSpiral::setTargetObject(LLViewerObject *objp) void LLHUDEffectSpiral::render() { + static const LLCachedControl<bool> show_beam(gSavedSettings, "ShowSelectionBeam", true); F32 time = mTimer.getElapsedTimeF32(); if ((!mSourceObject.isNull() && mSourceObject->isDead()) || (!mTargetObject.isNull() && mTargetObject->isDead()) || mKillTime < time || - (!mPartSourcep.isNull() && !gSavedSettings.getBOOL("ShowSelectionBeam")) ) + (!mPartSourcep.isNull() && !show_beam) ) { markDead(); return; diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 1507f27e381b80fdb97da1d9d57822a2e690f231..9a7ad655d267e82b03655fe375453da8a5ff89c1 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -417,7 +417,8 @@ void LLHUDText::updateVisibility() LLVector3 pos_agent_center = gAgent.getPosAgentFromGlobal(mPositionGlobal) - dir_from_camera; F32 last_distance_center = (pos_agent_center - LLViewerCamera::getInstance()->getOrigin()).magVec(); - F32 max_draw_distance = gSavedSettings.getF32("PrimTextMaxDrawDistance"); + static const LLCachedControl<F32> prim_text_max_draw(gSavedSettings, "PrimTextMaxDrawDistance"); + F32 max_draw_distance = prim_text_max_draw; if(max_draw_distance < 0) { diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index d777d6a49678c3e5db0cd9150ede98e0efe3ac10..74ae3852e6b7650093dbafa6dbc71c3745eef0c6 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -322,7 +322,9 @@ void LLStatusBar::refresh() // Disable media toggle if there's no media, parcel media, and no parcel audio // (or if media is disabled) - bool button_enabled = (gSavedSettings.getBOOL("AudioStreamingMusic")||gSavedSettings.getBOOL("AudioStreamingMedia")) && + static const LLCachedControl<bool> audio_streaming_enabled(gSavedSettings, "AudioStreamingMusic"); + static const LLCachedControl<bool> media_streaming_enabled(gSavedSettings, "AudioStreamingMedia"); + bool button_enabled = (audio_streaming_enabled || media_streaming_enabled) && (media_inst->hasInWorldMedia() || media_inst->hasParcelMedia() || media_inst->hasParcelAudio()); mMediaToggle->setEnabled(button_enabled); // Note the "sense" of the toggle is opposite whether media is playing or not diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index cb20801756162acdc62b78f58a3382fee5a25d95..f2226b5cbdbc52c1cbdfc58adc41378aeaa02563 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -392,8 +392,9 @@ void init_audio() void audio_update_volume(bool force_update) { - F32 master_volume = gSavedSettings.getF32("AudioLevelMaster"); - BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio"); + static const LLCachedControl<F32> master_volume(gSavedSettings, "AudioLevelMaster"); + static const LLCachedControl<bool> mute_audio_cc(gSavedSettings, "MuteAudio"); + bool mute_audio = mute_audio_cc; LLProgressView* progress = gViewerWindow->getProgressView(); BOOL progress_view_visible = FALSE; @@ -403,9 +404,10 @@ void audio_update_volume(bool force_update) progress_view_visible = progress->getVisible(); } - if (!gViewerWindow->getActive() && gSavedSettings.getBOOL("MuteWhenMinimized")) + static const LLCachedControl<bool> mute_when_minimized(gSavedSettings, "MuteWhenMinimized"); + if (!gViewerWindow->getActive() && mute_when_minimized) { - mute_audio = TRUE; + mute_audio = true; } F32 mute_volume = mute_audio ? 0.0f : 1.0f; @@ -415,12 +417,15 @@ void audio_update_volume(bool force_update) gAudiop->setMasterGain ( master_volume ); - gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler")); + static const LLCachedControl<F32> doppler_volume(gSavedSettings, "AudioLevelDoppler"); + gAudiop->setDopplerFactor(doppler_volume); + static const LLCachedControl<F32> rolloff_volume(gSavedSettings, "AudioLevelRolloff"); + static const LLCachedControl<F32> underwater_rolloff_volume(gSavedSettings, "AudioLevelUnderwaterRolloff"); if(!LLViewerCamera::getInstance()->cameraUnderWater()) - gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff")); + gAudiop->setRolloffFactor(rolloff_volume); else - gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelUnderwaterRolloff")); + gAudiop->setRolloffFactor(underwater_rolloff_volume); gAudiop->setMuted(mute_audio || progress_view_visible); @@ -436,12 +441,15 @@ void audio_update_volume(bool force_update) } // handle secondary gains - gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_SFX, - gSavedSettings.getBOOL("MuteSounds") ? 0.f : gSavedSettings.getF32("AudioLevelSFX")); - gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_UI, - gSavedSettings.getBOOL("MuteUI") ? 0.f : gSavedSettings.getF32("AudioLevelUI")); - gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_AMBIENT, - gSavedSettings.getBOOL("MuteAmbient") ? 0.f : gSavedSettings.getF32("AudioLevelAmbient")); + static const LLCachedControl<bool> sounds_mute(gSavedSettings, "MuteSounds"); + static const LLCachedControl<bool> ui_mute(gSavedSettings, "MuteUI"); + static const LLCachedControl<bool> ambient_mute(gSavedSettings, "MuteAmbient"); + static const LLCachedControl<F32> sounds_volume(gSavedSettings, "AudioLevelSFX"); + static const LLCachedControl<F32> ui_volume(gSavedSettings, "AudioLevelUI"); + static const LLCachedControl<F32> ambient_volume(gSavedSettings, "AudioLevelAmbient"); + gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_SFX, sounds_mute ? 0.f : sounds_volume); + gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_UI, ui_mute ? 0.f : ui_volume); + gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_AMBIENT, ambient_mute ? 0.f : ambient_volume); // Streaming Music @@ -451,31 +459,32 @@ void audio_update_volume(bool force_update) LLViewerAudio::getInstance()->setForcedTeleportFade(false); } - F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); - BOOL music_muted = gSavedSettings.getBOOL("MuteMusic"); - F32 fade_volume = LLViewerAudio::getInstance()->getFadeVolume(); + static const LLCachedControl<F32> music_volume_setting(gSavedSettings, "AudioLevelMusic"); + static const LLCachedControl<bool> music_muted(gSavedSettings, "MuteMusic"); + const F32 fade_volume = LLViewerAudio::getInstance()->getFadeVolume(); - music_volume = mute_volume * master_volume * music_volume * fade_volume; + const F32 music_volume = mute_volume * master_volume * music_volume_setting * fade_volume; gAudiop->setInternetStreamGain (music_muted ? 0.f : music_volume); } // Streaming Media - F32 media_volume = gSavedSettings.getF32("AudioLevelMedia"); - BOOL media_muted = gSavedSettings.getBOOL("MuteMedia"); - media_volume = mute_volume * master_volume * media_volume; + static const LLCachedControl<F32> media_volume_setting(gSavedSettings, "AudioLevelMedia"); + static const LLCachedControl<bool> media_muted(gSavedSettings, "MuteMedia"); + const F32 media_volume = mute_volume * master_volume * media_volume_setting; LLViewerMedia::getInstance()->setVolume( media_muted ? 0.0f : media_volume ); // Voice, this is parametric singleton, it gets initialized when ready if (LLVoiceClient::instanceExists()) { - F32 voice_volume = gSavedSettings.getF32("AudioLevelVoice"); - voice_volume = mute_volume * master_volume * voice_volume; - BOOL voice_mute = gSavedSettings.getBOOL("MuteVoice"); + static const LLCachedControl<F32> voice_volume_setting(gSavedSettings, "AudioLevelVoice"); + static const LLCachedControl<bool> voice_mute(gSavedSettings, "MuteVoice"); + static const LLCachedControl<F32> mic_volume(gSavedSettings, "AudioLevelMic"); + const F32 voice_volume = mute_volume * master_volume * voice_volume_setting; LLVoiceClient *voice_inst = LLVoiceClient::getInstance(); voice_inst->setVoiceVolume(voice_mute ? 0.f : voice_volume); - voice_inst->setMicGain(voice_mute ? 0.f : gSavedSettings.getF32("AudioLevelMic")); + voice_inst->setMicGain(voice_mute ? 0.f : mic_volume); - if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized"))) + if (!gViewerWindow->getActive() && mute_when_minimized) { voice_inst->setMuteMic(true); } @@ -529,8 +538,12 @@ void audio_update_wind(bool force_update) // don't use the setter setMaxWindGain() because we don't // want to screw up the fade-in on startup by setting actual source gain // outside the fade-in. - F32 master_volume = gSavedSettings.getBOOL("MuteAudio") ? 0.f : gSavedSettings.getF32("AudioLevelMaster"); - F32 ambient_volume = gSavedSettings.getBOOL("MuteAmbient") ? 0.f : gSavedSettings.getF32("AudioLevelAmbient"); + static const LLCachedControl<bool> mute_audio(gSavedSettings, "MuteAudio"); + static const LLCachedControl<bool> mute_ambient(gSavedSettings, "MuteAmbient"); + static const LLCachedControl<F32> audio_level_master(gSavedSettings, "AudioLevelMaster"); + static const LLCachedControl<F32> audio_level_ambient(gSavedSettings, "AudioLevelAmbient"); + F32 master_volume = mute_audio ? 0.f : audio_level_master; + F32 ambient_volume = mute_ambient ? 0.f : audio_level_ambient; F32 max_wind_volume = master_volume * ambient_volume; const F32 WIND_SOUND_TRANSITION_TIME = 2.f; diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index e5482f3f668e85fca0f339cc42856f42ce556563..ab24245a32cffc872455e3c1829597287e99f576 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -342,10 +342,12 @@ void update_statistics() record(LLStatViewer::TRIANGLES_DRAWN_PER_FRAME, last_frame_recording.getSum(LLStatViewer::TRIANGLES_DRAWN)); - sample(LLStatViewer::ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable")); + sample(LLStatViewer::ENABLE_VBO, (F64)LLVertexBuffer::sEnableVBOs); sample(LLStatViewer::LIGHTING_DETAIL, (F64)gPipeline.getLightingDetail()); - sample(LLStatViewer::DRAW_DISTANCE, (F64)gSavedSettings.getF32("RenderFarClip")); - sample(LLStatViewer::CHAT_BUBBLES, gSavedSettings.getBOOL("UseChatBubbles")); + sample(LLStatViewer::DRAW_DISTANCE, (F64)LLPipeline::RenderFarClip); + + static const LLCachedControl<bool> use_chat_bubbles(gSavedSettings, "UseChatBubbles"); + sample(LLStatViewer::CHAT_BUBBLES, use_chat_bubbles); typedef LLTrace::StatType<LLTrace::TimeBlockAccumulator>::instance_tracker_t stat_type_t;