diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index fb428ce037..92fa72a987 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -325,7 +325,12 @@ void LLFolderView::filter( LLFolderViewFilter& filter ) { // Entry point of inventory filtering (CHUI-849) LLFastTimer t2(FTM_FILTER); - filter.resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32(mParentPanel->getVisible() ? "FilterItemsMaxTimePerFrameVisible" : "FilterItemsMaxTimePerFrameUnvisible"), 1, 100)); + // Replace frequently called gSavedSettings + //filter.resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32(mParentPanel->getVisible() ? "FilterItemsMaxTimePerFrameVisible" : "FilterItemsMaxTimePerFrameUnvisible"), 1, 100)); + static LLCachedControl sFilterItemsMaxTimePerFrameVisible(*LLUI::sSettingGroups["config"], "FilterItemsMaxTimePerFrameVisible"); + static LLCachedControl sFilterItemsMaxTimePerFrameUnvisible(*LLUI::sSettingGroups["config"], "FilterItemsMaxTimePerFrameUnvisible"); + filter.resetTime(llclamp((mParentPanel->getVisible() ? sFilterItemsMaxTimePerFrameVisible() : sFilterItemsMaxTimePerFrameUnvisible()), 1, 100)); + // // Note: we filter the model, not the view getViewModelItem()->filter(filter); diff --git a/indra/llui/llfolderviewmodel.cpp b/indra/llui/llfolderviewmodel.cpp index 3363dc5316..dd9ca2e9a7 100755 --- a/indra/llui/llfolderviewmodel.cpp +++ b/indra/llui/llfolderviewmodel.cpp @@ -48,7 +48,11 @@ std::string LLFolderViewModelCommon::getStatusText() void LLFolderViewModelCommon::filter() { - getFilter().resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsMaxTimePerFrameVisible"), 1, 100)); + // Replace frequently called gSavedSettings + //getFilter().resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsMaxTimePerFrameVisible"), 1, 100)); + static LLCachedControl sFilterItemsMaxTimePerFrameVisible(*LLUI::sSettingGroups["config"], "FilterItemsMaxTimePerFrameVisible"); + getFilter().resetTime(llclamp(sFilterItemsMaxTimePerFrameVisible(), 1, 100)); + // mFolderView->getViewModelItem()->filter(getFilter()); } diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 24c763f594..9672b290e5 100755 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1920,7 +1920,11 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) camera_position_global = focusPosGlobal + mCameraFocusOffset; } - if (!gSavedSettings.getBOOL("DisableCameraConstraints") && !gAgent.isGodlike()) + // Replace frequently called gSavedSettings + //if (!gSavedSettings.getBOOL("DisableCameraConstraints") && !gAgent.isGodlike()) + static LLCachedControl sDisableCameraConstraints(gSavedSettings, "DisableCameraConstraints"); + if (!sDisableCameraConstraints && !gAgent.isGodlike()) + // { LLViewerRegion* regionp = LLWorld::getInstance()->getRegionFromPosGlobal(camera_position_global); bool constrain = true; @@ -2068,7 +2072,11 @@ F32 LLAgentCamera::getCameraMinOffGround() } else { - if (gSavedSettings.getBOOL("DisableCameraConstraints")) + // Replace frequently called gSavedSettings + //if (gSavedSettings.getBOOL("DisableCameraConstraints")) + static LLCachedControl sDisableCameraConstraints(gSavedSettings, "DisableCameraConstraints"); + if (sDisableCameraConstraints) + // { return -1000.f; } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index c76bd323ee..ae46aac713 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -6114,7 +6114,11 @@ void LLAppViewer::setMasterSystemAudioMute(bool mute) //virtual bool LLAppViewer::getMasterSystemAudioMute() { - return gSavedSettings.getBOOL("MuteAudio"); + // Replace frequently called gSavedSettings + //return gSavedSettings.getBOOL("MuteAudio"); + static LLCachedControl sMuteAudio(gSavedSettings, "MuteAudio"); + return sMuteAudio; + // } //---------------------------------------------------------------------------- diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index eef3e6686d..2916f562b0 100755 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -174,7 +174,11 @@ void LLFirstUse::firstUseNotification(const std::string& control_var, bool enabl if (enable) { - if (gSavedSettings.getBOOL("EnableUIHints")) + // Replace frequently called gSavedSettings + //if (gSavedSettings.getBOOL("EnableUIHints")) + static LLCachedControl sEnableUIHints(gSavedSettings, "EnableUIHints"); + if (sEnableUIHints) + // { LL_DEBUGS("LLFirstUse") << "Trigger first use notification " << notification_name << LL_ENDL; diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 14547f5f4d..5fcad5d1d9 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -770,7 +770,11 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) // If we're in freeze-frame mode and camera has moved, update snapshot. LLVector3 new_camera_pos = LLViewerCamera::getInstance()->getOrigin(); LLQuaternion new_camera_rot = LLViewerCamera::getInstance()->getQuaternion(); - if (gSavedSettings.getBOOL("FreezeTime") && + // Replace frequently called gSavedSettings + //if (gSavedSettings.getBOOL("FreezeTime") && + static LLCachedControl sFreezeTime(gSavedSettings, "FreezeTime"); + if (sFreezeTime && + // (new_camera_pos != previewp->mCameraPos || dot(new_camera_rot, previewp->mCameraRot) < 0.995f)) { previewp->mCameraPos = new_camera_pos; @@ -2681,7 +2685,11 @@ BOOL LLSnapshotFloaterView::handleMouseUp(S32 x, S32 y, MASK mask) BOOL LLSnapshotFloaterView::handleHover(S32 x, S32 y, MASK mask) { // use default handler when not in freeze-frame mode - if(!gSavedSettings.getBOOL("FreezeTime")) + // Replace frequently called gSavedSettings + //if(!gSavedSettings.getBOOL("FreezeTime")) + static LLCachedControl sFreezeTime(gSavedSettings, "FreezeTime"); + if(!sFreezeTime) + // { return LLFloaterView::handleHover(x, y, mask); } diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index dfae07a841..affa16f080 100755 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -198,7 +198,8 @@ void LLInventoryModelBackgroundFetch::backgroundFetch() // // if (gSavedSettings.getBOOL("UseHTTPInventory")) std::string url = region->getCapability("FetchInventory2"); - if (gSavedSettings.getBOOL("UseHTTPInventory") && !url.empty()) + static LLCachedControl sUseHTTPInventory(gSavedSettings, "UseHTTPInventory"); + if (sUseHTTPInventory && !url.empty()) // { bulkFetch(); diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index d5b87d6b0c..d877187605 100755 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -448,8 +448,14 @@ void LLAvatarTexBar::draw() text_color, LLFontGL::LEFT, LLFontGL::TOP); //, LLFontGL::BOLD, LLFontGL::DROP_SHADOW_SOFT); line_num++; } - const U32 texture_timeout = gSavedSettings.getU32("AvatarBakedTextureUploadTimeout"); - const U32 override_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel"); + // Replace frequently called gSavedSettings + //const U32 texture_timeout = gSavedSettings.getU32("AvatarBakedTextureUploadTimeout"); + //const U32 override_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel"); + static LLCachedControl sAvatarBakedTextureUploadTimeout(gSavedSettings, "AvatarBakedTextureUploadTimeout"); + static LLCachedControl sTextureDiscardLevel(gSavedSettings, "TextureDiscardLevel"); + const U32 texture_timeout = sAvatarBakedTextureUploadTimeout(); + const U32 override_tex_discard_level = sTextureDiscardLevel(); + // LLColor4 header_color(1.f, 1.f, 1.f, 0.9f); diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp index 857b0f0714..fc3aa7aaa1 100755 --- a/indra/newview/lltoolfocus.cpp +++ b/indra/newview/lltoolfocus.cpp @@ -211,10 +211,16 @@ void LLToolCamera::pickCallback(const LLPickInfo& pick_info) gAgentCamera.setFocusGlobal(pick_info); } + // Replace frequently called gSavedSettings + static LLCachedControl sFreezeTime(gSavedSettings, "FreezeTime"); + // if (!(pick_info.mKeyMask & MASK_ALT) && gAgentCamera.cameraThirdPerson() && gViewerWindow->getLeftMouseDown() && - !gSavedSettings.getBOOL("FreezeTime") && + // Replace frequently called gSavedSettings + //!gSavedSettings.getBOOL("FreezeTime") && + !sFreezeTime && + // (hit_obj == gAgentAvatarp || (hit_obj && hit_obj->isAttachment() && LLVOAvatar::findAvatarFromAttachment(hit_obj)->isSelf()))) { diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index a2f2187b8e..73e78aa2f5 100755 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -428,8 +428,14 @@ void init_audio() void audio_update_volume(bool force_update) { - F32 master_volume = gSavedSettings.getF32("AudioLevelMaster"); - BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio"); + // Replace frequently called gSavedSettings + //F32 master_volume = gSavedSettings.getF32("AudioLevelMaster"); + //BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio"); + static LLCachedControl sAudioLevelMaster(gSavedSettings, "AudioLevelMaster"); + static LLCachedControl sMuteAudio(gSavedSettings, "MuteAudio"); + F32 master_volume = sAudioLevelMaster(); + BOOL mute_audio = (BOOL)sMuteAudio; + // LLProgressView* progress = gViewerWindow->getProgressView(); BOOL progress_view_visible = FALSE; @@ -450,12 +456,25 @@ void audio_update_volume(bool force_update) { gAudiop->setMasterGain ( master_volume ); - gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler")); + // Replace frequently called gSavedSettings + //gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler")); + + //if(!LLViewerCamera::getInstance()->cameraUnderWater()) + //gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff")); + //else + // gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelUnderwaterRolloff")); + + static LLCachedControl sAudioLevelDoppler(gSavedSettings, "AudioLevelDoppler"); + static LLCachedControl sAudioLevelRolloff(gSavedSettings, "AudioLevelRolloff"); + static LLCachedControl sAudioLevelUnderwaterRolloff(gSavedSettings, "AudioLevelUnderwaterRolloff"); + + gAudiop->setDopplerFactor(sAudioLevelDoppler); if(!LLViewerCamera::getInstance()->cameraUnderWater()) - gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff")); + gAudiop->setRolloffFactor(sAudioLevelRolloff); else - gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelUnderwaterRolloff")); + gAudiop->setRolloffFactor(sAudioLevelUnderwaterRolloff); + // gAudiop->setMuted(mute_audio || progress_view_visible); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 33be84ed7d..d6ccfd7389 100755 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -791,7 +791,11 @@ void LLViewerMedia::updateMedia(void *dummy_arg) LLFastTimer t1(FTM_MEDIA_UPDATE); // Enable/disable the plugin read thread - LLPluginProcessParent::setUseReadThread(gSavedSettings.getBOOL("PluginUseReadThread")); + // Replace frequently called gSavedSettings + //LLPluginProcessParent::setUseReadThread(gSavedSettings.getBOOL("PluginUseReadThread")); + static LLCachedControl sPluginUseReadThread(gSavedSettings, "PluginUseReadThread"); + LLPluginProcessParent::setUseReadThread(sPluginUseReadThread); + // // HACK: we always try to keep a spare running webkit plugin around to improve launch times. createSpareBrowserMediaSource(); @@ -840,13 +844,29 @@ void LLViewerMedia::updateMedia(void *dummy_arg) int impl_count_interest_normal = 0; std::vector proximity_order; - - bool inworld_media_enabled = gSavedSettings.getBOOL("AudioStreamingMedia"); - bool inworld_audio_enabled = gSavedSettings.getBOOL("AudioStreamingMusic"); - U32 max_instances = gSavedSettings.getU32("PluginInstancesTotal"); - U32 max_normal = gSavedSettings.getU32("PluginInstancesNormal"); - U32 max_low = gSavedSettings.getU32("PluginInstancesLow"); - F32 max_cpu = gSavedSettings.getF32("PluginInstancesCPULimit"); + + // Replace frequently called gSavedSettings + //bool inworld_media_enabled = gSavedSettings.getBOOL("AudioStreamingMedia"); + //bool inworld_audio_enabled = gSavedSettings.getBOOL("AudioStreamingMusic"); + //U32 max_instances = gSavedSettings.getU32("PluginInstancesTotal"); + //U32 max_normal = gSavedSettings.getU32("PluginInstancesNormal"); + //U32 max_low = gSavedSettings.getU32("PluginInstancesLow"); + //F32 max_cpu = gSavedSettings.getF32("PluginInstancesCPULimit"); + + static LLCachedControl sAudioStreamingMedia(gSavedSettings, "AudioStreamingMedia"); + static LLCachedControl sAudioStreamingMusic(gSavedSettings, "AudioStreamingMusic"); + static LLCachedControl sPluginInstancesTotal(gSavedSettings, "PluginInstancesTotal"); + static LLCachedControl sPluginInstancesNormal(gSavedSettings, "PluginInstancesNormal"); + static LLCachedControl sPluginInstancesLow(gSavedSettings, "PluginInstancesLow"); + static LLCachedControl sPluginInstancesCPULimit(gSavedSettings, "PluginInstancesCPULimit"); + + bool inworld_media_enabled = sAudioStreamingMedia; + bool inworld_audio_enabled = sAudioStreamingMusic; + U32 max_instances = sPluginInstancesTotal(); + U32 max_normal = sPluginInstancesNormal(); + U32 max_low = sPluginInstancesLow(); + F32 max_cpu = sPluginInstancesCPULimit(); + // // Setting max_cpu to 0.0 disables CPU usage checking. bool check_cpu_usage = (max_cpu != 0.0f); @@ -1018,7 +1038,11 @@ void LLViewerMedia::updateMedia(void *dummy_arg) } } - if(gSavedSettings.getBOOL("MediaPerformanceManagerDebug")) + // Replace frequently called gSavedSettings + //if(gSavedSettings.getBOOL("MediaPerformanceManagerDebug")) + static LLCachedControl sMediaPerformanceManagerDebug(gSavedSettings, "MediaPerformanceManagerDebug"); + if(sMediaPerformanceManagerDebug) + // { // Give impls the same ordering as the priority list // they're already in the right order for this. diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index e2ab1a45e0..1646b5d1a8 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2049,7 +2049,11 @@ bool LLViewerFetchedTexture::updateFetch() c = mComponents; } - const U32 override_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel"); + // Replace frequently called gSavedSettings + //const U32 override_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel"); + static LLCachedControl sTextureDiscardLevel(gSavedSettings, "TextureDiscardLevel"); + const U32 override_tex_discard_level = sTextureDiscardLevel(); + // if (override_tex_discard_level != 0) { desired_discard = override_tex_discard_level; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 4711459b5c..1be75922bd 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1756,7 +1756,11 @@ BOOL LLVOAvatarSelf::isLocalTextureDataAvailable(const LLViewerTexLayerSet* laye //----------------------------------------------------------------------------- BOOL LLVOAvatarSelf::isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset) const { - const U32 desired_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel"); + // Replace frequently called gSavedSettings + //const U32 desired_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel"); + static LLCachedControl sTextureDiscardLevel(gSavedSettings, "TextureDiscardLevel"); + const U32 desired_tex_discard_level = sTextureDiscardLevel(); + // // const U32 desired_tex_discard_level = 0; // hack to not bake textures on lower discard levels. for (U32 i = 0; i < mBakedTextureDatas.size(); i++) @@ -1791,7 +1795,11 @@ BOOL LLVOAvatarSelf::isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset BOOL LLVOAvatarSelf::isAllLocalTextureDataFinal() const { - const U32 desired_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel"); + // Replace frequently called gSavedSettings + //const U32 desired_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel"); + static LLCachedControl sTextureDiscardLevel(gSavedSettings, "TextureDiscardLevel"); + const U32 desired_tex_discard_level = sTextureDiscardLevel(); + // // const U32 desired_tex_discard_level = 0; // hack to not bake textures on lower discard levels for (U32 i = 0; i < mBakedTextureDatas.size(); i++) diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 41c752ef43..725a7dcaf3 100755 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -4676,7 +4676,12 @@ void LLVivoxVoiceClient::setVoiceEnabled(bool enabled) bool LLVivoxVoiceClient::voiceEnabled() { - return gSavedSettings.getBOOL("EnableVoiceChat") && !gSavedSettings.getBOOL("CmdLineDisableVoice"); + // Replace frequently called gSavedSettings + //return gSavedSettings.getBOOL("EnableVoiceChat") && !gSavedSettings.getBOOL("CmdLineDisableVoice"); + static LLCachedControl sEnableVoiceChat(gSavedSettings, "EnableVoiceChat"); + static LLCachedControl sCmdLineDisableVoice(gSavedSettings, "CmdLineDisableVoice"); + return sEnableVoiceChat && !sCmdLineDisableVoice; + // } void LLVivoxVoiceClient::setLipSyncEnabled(BOOL enabled)