From db9616811d45e168d81c8e464fb8a9cf27e51172 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Thu, 26 Aug 2010 11:04:43 -0700 Subject: Ported gSavedSettings changes from Emerald (as well as modifying a few of ours) --- linden/indra/newview/llagent.cpp | 18 ++++++++---- linden/indra/newview/llappviewer.cpp | 8 ++++-- linden/indra/newview/lldrawpoolbump.cpp | 3 +- linden/indra/newview/lldrawpoolterrain.cpp | 5 ++-- linden/indra/newview/lldrawpooltree.cpp | 8 ++++-- linden/indra/newview/llfloateractivespeakers.cpp | 4 ++- linden/indra/newview/llfloatersnapshot.cpp | 18 ++++++++---- linden/indra/newview/llfloatertools.cpp | 4 ++- linden/indra/newview/llfolderview.cpp | 19 +++++++++---- linden/indra/newview/llgroupnotify.cpp | 10 +++++-- linden/indra/newview/llhudeffectlookat.cpp | 7 +++-- linden/indra/newview/llhudeffecttrail.cpp | 8 ++++-- linden/indra/newview/llhudtext.cpp | 11 ++++++-- linden/indra/newview/llmediaremotectrl.cpp | 13 +++++---- linden/indra/newview/llnetmap.cpp | 20 ++++++++++---- linden/indra/newview/llnotify.cpp | 14 +++++++--- linden/indra/newview/lloverlaybar.cpp | 11 +++++--- linden/indra/newview/llpanelaudiovolume.cpp | 5 ++-- linden/indra/newview/llpanelavatar.cpp | 12 +++++--- linden/indra/newview/llpaneldisplay.cpp | 11 +++++--- linden/indra/newview/llprefsadvanced.cpp | 6 ++-- linden/indra/newview/llprefschat.cpp | 3 +- linden/indra/newview/llstartup.cpp | 4 ++- linden/indra/newview/llstatgraph.cpp | 4 ++- linden/indra/newview/llstatusbar.cpp | 9 ++++-- linden/indra/newview/lltexturefetch.cpp | 4 ++- linden/indra/newview/lltoolfocus.cpp | 4 ++- linden/indra/newview/llvieweraudio.cpp | 10 +++++-- linden/indra/newview/llviewermenu.cpp | 4 ++- linden/indra/newview/llviewermessage.cpp | 3 +- linden/indra/newview/llviewerobjectlist.cpp | 4 ++- linden/indra/newview/llviewerstats.cpp | 3 +- linden/indra/newview/llviewerwindow.cpp | 25 ++++++++++++----- linden/indra/newview/llvoavatar.cpp | 35 +++++++++++++++++------- linden/indra/newview/llvoiceremotectrl.cpp | 6 ++-- linden/indra/newview/llvosky.cpp | 5 +++- linden/indra/newview/llvotree.cpp | 14 ++++++---- linden/indra/newview/llvovolume.cpp | 12 ++++++-- linden/indra/newview/llvowlsky.cpp | 4 ++- linden/indra/newview/llworld.cpp | 3 +- linden/indra/newview/pipeline.cpp | 21 +++++++++----- 41 files changed, 273 insertions(+), 119 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp index 077da53..fc12f33 100644 --- a/linden/indra/newview/llagent.cpp +++ b/linden/indra/newview/llagent.cpp @@ -537,7 +537,9 @@ void LLAgent::resetView(BOOL reset_camera, BOOL change_camera) gMenuHolder->hideMenus(); } - if (change_camera && !gSavedSettings.getBOOL("FreezeTime")) + static BOOL* sFreezeTime = rebind_llcontrol("FreezeTime", &gSavedSettings, true); + + if (change_camera && !(*sFreezeTime)) { changeCameraToDefault(); @@ -561,7 +563,7 @@ void LLAgent::resetView(BOOL reset_camera, BOOL change_camera) } - if (reset_camera && !gSavedSettings.getBOOL("FreezeTime")) + if (reset_camera && !(*sFreezeTime)) { if (!gViewerWindow->getLeftMouseDown() && cameraThirdPerson()) { @@ -1976,7 +1978,9 @@ void LLAgent::cameraOrbitIn(const F32 meters) mCameraZoomFraction = (mTargetCameraDistance - meters) / camera_offset_dist; - if (!gSavedSettings.getBOOL("FreezeTime") && mCameraZoomFraction < MIN_ZOOM_FRACTION && meters > 0.f) + static BOOL* sFreezeTime = rebind_llcontrol("FreezeTime", &gSavedSettings, true); + + if (!(*sFreezeTime) && mCameraZoomFraction < MIN_ZOOM_FRACTION && meters > 0.f) { // No need to animate, camera is already there. changeCameraToMouselook(FALSE); @@ -2901,7 +2905,8 @@ static const LLFloaterView::skip_list_t& get_skip_list() { static LLFloaterView::skip_list_t skip_list; skip_list.insert(LLFloaterMap::getInstance()); - if(gSavedSettings.getBOOL("ShowStatusBarInMouselook")) + static BOOL *sShowStatusBarInMouselook = rebind_llcontrol("ShowStatusBarInMouselook", &gSavedSettings, true); + if(*sShowStatusBarInMouselook) { skip_list.insert(LLFloaterStats::getInstance()); } @@ -6283,7 +6288,10 @@ void LLAgent::setTeleportState(ETeleportState state) { mbTeleportKeepsLookAt = false; } - if (mTeleportState > TELEPORT_NONE && gSavedSettings.getBOOL("FreezeTime")) + + static BOOL* sFreezeTime = rebind_llcontrol("FreezeTime", &gSavedSettings, true); + + if (mTeleportState > TELEPORT_NONE && (*sFreezeTime)) { LLFloaterSnapshot::hide(0); } diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index b3f3e59..817517e 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp @@ -4146,9 +4146,10 @@ void LLAppViewer::resumeMainloopTimeout(const std::string& state, F32 secs) { if(secs < 0.0f) { - secs = gSavedSettings.getF32("MainloopTimeoutDefault"); + static F32 *sMainloopTimeoutDefault = rebind_llcontrol("MainloopTimeoutDefault", &gSavedSettings, true); + secs = *sMainloopTimeoutDefault; } - + mMainloopTimeout->setTimeout(secs); mMainloopTimeout->start(state); } @@ -4173,7 +4174,8 @@ void LLAppViewer::pingMainloopTimeout(const std::string& state, F32 secs) { if(secs < 0.0f) { - secs = gSavedSettings.getF32("MainloopTimeoutDefault"); + static F32 *sMainloopTimeoutDefault = rebind_llcontrol("MainloopTimeoutDefault", &gSavedSettings, true); + secs = *sMainloopTimeoutDefault; } mMainloopTimeout->setTimeout(secs); diff --git a/linden/indra/newview/lldrawpoolbump.cpp b/linden/indra/newview/lldrawpoolbump.cpp index fb7a213..93fadca 100644 --- a/linden/indra/newview/lldrawpoolbump.cpp +++ b/linden/indra/newview/lldrawpoolbump.cpp @@ -185,7 +185,8 @@ void LLDrawPoolBump::prerender() // static S32 LLDrawPoolBump::numBumpPasses() { - if (gSavedSettings.getBOOL("RenderObjectBump")) + static BOOL* sRenderObjectBump = rebind_llcontrol("RenderObjectBump", &gSavedSettings, true); + if (*sRenderObjectBump) { if (mVertexShaderLevel > 1) { diff --git a/linden/indra/newview/lldrawpoolterrain.cpp b/linden/indra/newview/lldrawpoolterrain.cpp index cac5162..d0bf2c1 100644 --- a/linden/indra/newview/lldrawpoolterrain.cpp +++ b/linden/indra/newview/lldrawpoolterrain.cpp @@ -207,9 +207,10 @@ void LLDrawPoolTerrain::render(S32 pass) renderFull4TU(); } } - + static BOOL* sShowParcelOwners = rebind_llcontrol("ShowParcelOwners", &gSavedSettings, true); + // Special-case for land ownership feedback - if (gSavedSettings.getBOOL("ShowParcelOwners")) + if (*sShowParcelOwners) { if (mVertexShaderLevel > 1) { //use fullbright shader for highlighting diff --git a/linden/indra/newview/lldrawpooltree.cpp b/linden/indra/newview/lldrawpooltree.cpp index 46cd2d5..e4560f2 100644 --- a/linden/indra/newview/lldrawpooltree.cpp +++ b/linden/indra/newview/lldrawpooltree.cpp @@ -102,7 +102,9 @@ void LLDrawPoolTree::render(S32 pass) LLGLEnable test(GL_ALPHA_TEST); LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f); - if (gSavedSettings.getBOOL("RenderAnimateTrees")) + static BOOL* sRenderAnimateTrees = rebind_llcontrol("RenderAnimateTrees", &gSavedSettings, true); + + if (*sRenderAnimateTrees) { renderTree(); } @@ -198,7 +200,9 @@ void LLDrawPoolTree::renderForSelect() gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR); gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA); - if (gSavedSettings.getBOOL("RenderAnimateTrees")) + static BOOL* sRenderAnimateTrees = rebind_llcontrol("RenderAnimateTrees", &gSavedSettings, true); + + if (*sRenderAnimateTrees) { renderTree(TRUE); } diff --git a/linden/indra/newview/llfloateractivespeakers.cpp b/linden/indra/newview/llfloateractivespeakers.cpp index 51e7b89..f8c3166 100644 --- a/linden/indra/newview/llfloateractivespeakers.cpp +++ b/linden/indra/newview/llfloateractivespeakers.cpp @@ -511,7 +511,9 @@ void LLPanelActiveSpeakers::refreshSpeakers() } else { - name_cell->setColor(LLColor4::black); + static LLColor4* sDefaultListText = rebind_llcontrol("DefaultListText", &gColors, true); + + name_cell->setColor((*sDefaultListText)); } std::string speaker_name; diff --git a/linden/indra/newview/llfloatersnapshot.cpp b/linden/indra/newview/llfloatersnapshot.cpp index 9e8c38b..c0e972d 100644 --- a/linden/indra/newview/llfloatersnapshot.cpp +++ b/linden/indra/newview/llfloatersnapshot.cpp @@ -738,7 +738,10 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) LLVector3 new_camera_pos = LLViewerCamera::getInstance()->getOrigin(); LLQuaternion new_camera_rot = LLViewerCamera::getInstance()->getQuaternion(); - if (gSavedSettings.getBOOL("FreezeTime") && + + static BOOL* sFreezeTime = rebind_llcontrol("FreezeTime", &gSavedSettings, true); + + if ((*sFreezeTime) && (new_camera_pos != previewp->mCameraPos || dot(new_camera_rot, previewp->mCameraRot) < 0.995f)) { previewp->mCameraPos = new_camera_pos; @@ -2334,8 +2337,10 @@ LLSnapshotFloaterView::~LLSnapshotFloaterView() BOOL LLSnapshotFloaterView::handleKey(KEY key, MASK mask, BOOL called_from_parent) { + static BOOL* sFreezeTime = rebind_llcontrol("FreezeTime", &gSavedSettings, true); + // use default handler when not in freeze-frame mode - if(!gSavedSettings.getBOOL("FreezeTime")) + if(!(*sFreezeTime)) { return LLFloaterView::handleKey(key, mask, called_from_parent); } @@ -2355,8 +2360,9 @@ BOOL LLSnapshotFloaterView::handleKey(KEY key, MASK mask, BOOL called_from_paren BOOL LLSnapshotFloaterView::handleMouseDown(S32 x, S32 y, MASK mask) { + static BOOL* sFreezeTime = rebind_llcontrol("FreezeTime", &gSavedSettings, true); // use default handler when not in freeze-frame mode - if(!gSavedSettings.getBOOL("FreezeTime")) + if(!(*sFreezeTime)) { return LLFloaterView::handleMouseDown(x, y, mask); } @@ -2370,8 +2376,9 @@ BOOL LLSnapshotFloaterView::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLSnapshotFloaterView::handleMouseUp(S32 x, S32 y, MASK mask) { + static BOOL* sFreezeTime = rebind_llcontrol("FreezeTime", &gSavedSettings, true); // use default handler when not in freeze-frame mode - if(!gSavedSettings.getBOOL("FreezeTime")) + if(!(*sFreezeTime)) { return LLFloaterView::handleMouseUp(x, y, mask); } @@ -2385,8 +2392,9 @@ BOOL LLSnapshotFloaterView::handleMouseUp(S32 x, S32 y, MASK mask) BOOL LLSnapshotFloaterView::handleHover(S32 x, S32 y, MASK mask) { + static BOOL* sFreezeTime = rebind_llcontrol("FreezeTime", &gSavedSettings, true); // use default handler when not in freeze-frame mode - if(!gSavedSettings.getBOOL("FreezeTime")) + if(!(*sFreezeTime)) { return LLFloaterView::handleHover(x, y, mask); } diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp index 7a9efcb..f6f09b1 100644 --- a/linden/indra/newview/llfloatertools.cpp +++ b/linden/indra/newview/llfloatertools.cpp @@ -1056,7 +1056,9 @@ void click_apply_to_selection(void* user) void commit_select_tool(LLUICtrl *ctrl, void *data) { - S32 show_owners = gSavedSettings.getBOOL("ShowParcelOwners"); + static BOOL* sShowParcelOwners = rebind_llcontrol("ShowParcelOwners", &gSavedSettings, true); + + S32 show_owners = *sShowParcelOwners; gFloaterTools->setEditTool(data); gSavedSettings.setBOOL("ShowParcelOwners", show_owners); } diff --git a/linden/indra/newview/llfolderview.cpp b/linden/indra/newview/llfolderview.cpp index 16c0aa9..ce2b2b4 100644 --- a/linden/indra/newview/llfolderview.cpp +++ b/linden/indra/newview/llfolderview.cpp @@ -2893,7 +2893,9 @@ const std::string LLFolderView::getFilterSubString(BOOL trim) void LLFolderView::filter( LLInventoryFilter& filter ) { LLFastTimer t2(LLFastTimer::FTM_FILTER); - filter.setFilterCount(llclamp(gSavedSettings.getS32("FilterItemsPerFrame"), 1, 5000)); + static S32 *sFilterItemsPerFrame = rebind_llcontrol("FilterItemsPerFrame", &gSavedSettings, true); + + filter.setFilterCount(llclamp(*sFilterItemsPerFrame, 1, 5000)); if (getCompletedFilterGeneration() < filter.getCurrentGeneration()) { @@ -3264,8 +3266,10 @@ void LLFolderView::draw() setShowSingleSelection(FALSE); } + static F32 *sTypeAheadTimeout = rebind_llcontrol("TypeAheadTimeout", &gSavedSettings, true); + - if (mSearchTimer.getElapsedTimeF32() > gSavedSettings.getF32("TypeAheadTimeout") || !mSearchString.size()) + if (mSearchTimer.getElapsedTimeF32() > *sTypeAheadTimeout || !mSearchString.size()) { mSearchString.clear(); } @@ -3995,8 +3999,11 @@ BOOL LLFolderView::handleUnicodeCharHere(llwchar uni_char) LLMenuGL::sMenuContainer->hideMenus(); } + static F32 *sTypeAheadTimeout = rebind_llcontrol("TypeAheadTimeout", &gSavedSettings, true); + + //do text search - if (mSearchTimer.getElapsedTimeF32() > gSavedSettings.getF32("TypeAheadTimeout")) + if (mSearchTimer.getElapsedTimeF32() > *sTypeAheadTimeout) { mSearchString.clear(); } @@ -4340,10 +4347,10 @@ void LLFolderView::doIdle() { LLFastTimer t2(LLFastTimer::FTM_INVENTORY); - BOOL debug_filters = gSavedSettings.getBOOL("DebugInventoryFilters"); - if (debug_filters != getDebugFilters()) + static BOOL* debug_filters = rebind_llcontrol("DebugInventoryFilters", &gSavedSettings, true); + if (*debug_filters != getDebugFilters()) { - mDebugFilters = debug_filters; + mDebugFilters = *debug_filters; arrangeAll(); } diff --git a/linden/indra/newview/llgroupnotify.cpp b/linden/indra/newview/llgroupnotify.cpp index d906633..1b00dfb 100644 --- a/linden/indra/newview/llgroupnotify.cpp +++ b/linden/indra/newview/llgroupnotify.cpp @@ -115,7 +115,10 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject, setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); setBackgroundVisible(TRUE); setBackgroundOpaque(TRUE); - setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") ); + + static LLColor4* sGroupNotifyBoxColor = rebind_llcontrol("GroupNotifyBoxColor", &gColors, true); + + setBackgroundColor( (*sGroupNotifyBoxColor) ); LLIconCtrl* icon; LLTextEditor* text; @@ -133,7 +136,10 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject, setFontStyle(LLFontGL::DROP_SHADOW_SOFT); setBorderVisible(FALSE); setColor( gColors.getColor("GroupNotifyTextColor") ); - setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") ); + + static LLColor4* sGroupNotifyBoxColor = rebind_llcontrol("GroupNotifyBoxColor", &gColors, true); + + setBackgroundColor( (*sGroupNotifyBoxColor) ); } }; diff --git a/linden/indra/newview/llhudeffectlookat.cpp b/linden/indra/newview/llhudeffectlookat.cpp index 58d2c6a..23fc947 100644 --- a/linden/indra/newview/llhudeffectlookat.cpp +++ b/linden/indra/newview/llhudeffectlookat.cpp @@ -299,14 +299,14 @@ void LLHUDEffectLookAt::packData(LLMessageSystem *mesgsys) bool is_self = source_avatar->isSelf(); - bool is_private = gSavedSettings.getBOOL("PrivateLookAtTarget"); + static BOOL *sPrivateLookAtTarget = rebind_llcontrol("PrivateLookAtTarget", &gSavedSettings, true); if (!is_self) //imprudence TODO: find out why this happens at all and fix there { LL_DEBUGS("HUDEffect")<< "Non-self Avatar HUDEffectLookAt message for ID: " << source_avatar->getID().asString() << LL_ENDL; markDead(); return; } - else if (is_private && target_type != LOOKAT_TARGET_AUTO_LISTEN) + else if (*sPrivateLookAtTarget && target_type != LOOKAT_TARGET_AUTO_LISTEN) { //this mimicks "do nothing" target_type = LOOKAT_TARGET_AUTO_LISTEN; @@ -574,7 +574,8 @@ void LLHUDEffectLookAt::render() } gGL.end(); gGL.popMatrix(); - if( gSavedSettings.getBOOL("ShowLookAtNames") ) + static BOOL *sEmeraldShowLookAtNames = rebind_llcontrol("EmeraldShowLookAtNames", &gSavedSettings, true); + if (*sEmeraldShowLookAtNames) { const LLFontGL* fontp = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ); LLGLEnable color_mat(GL_COLOR_MATERIAL); diff --git a/linden/indra/newview/llhudeffecttrail.cpp b/linden/indra/newview/llhudeffecttrail.cpp index 08f4c78..1b0f3b3 100644 --- a/linden/indra/newview/llhudeffecttrail.cpp +++ b/linden/indra/newview/llhudeffecttrail.cpp @@ -181,7 +181,9 @@ void LLHUDEffectSpiral::triggerLocal() { mKillTime = mTimer.getElapsedTimeF32() + mDuration; - BOOL show_beam = gSavedSettings.getBOOL("ShowSelectionBeam"); + static BOOL* sShowSelectionBeam = rebind_llcontrol("ShowSelectionBeam", &gSavedSettings, true); + + BOOL show_beam = *sShowSelectionBeam; LLColor4 color; color.setVec(mColor); @@ -278,10 +280,12 @@ void LLHUDEffectSpiral::render() { F32 time = mTimer.getElapsedTimeF32(); + static BOOL* sShowSelectionBeam = rebind_llcontrol("ShowSelectionBeam", &gSavedSettings, true); + if ((!mSourceObject.isNull() && mSourceObject->isDead()) || (!mTargetObject.isNull() && mTargetObject->isDead()) || mKillTime < time || - (!mPartSourcep.isNull() && !gSavedSettings.getBOOL("ShowSelectionBeam")) ) + (!mPartSourcep.isNull() && !*sShowSelectionBeam) ) { markDead(); return; diff --git a/linden/indra/newview/llhudtext.cpp b/linden/indra/newview/llhudtext.cpp index 661a786..7d9f7f9 100644 --- a/linden/indra/newview/llhudtext.cpp +++ b/linden/indra/newview/llhudtext.cpp @@ -292,9 +292,14 @@ void LLHUDText::renderText(BOOL for_select) // *TODO: cache this image LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga"); + static LLColor4* sBackgroundChatColor = rebind_llcontrol("BackgroundChatColor", &gSavedSettings, true); + // *TODO: make this a per-text setting - LLColor4 bg_color = gSavedSettings.getColor4("BackgroundChatColor"); - bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor); + LLColor4 bg_color = *sBackgroundChatColor; + + static F32* sChatBubbleOpacity = rebind_llcontrol("ChatBubbleOpacity", &gSavedSettings, true); + + bg_color.setAlpha(*sChatBubbleOpacity * alpha_factor); const S32 border_height = 16; const S32 border_width = 16; @@ -394,7 +399,7 @@ void LLHUDText::renderText(BOOL for_select) { LLUI::pushMatrix(); { - gGL.color4f(text_color.mV[VX], text_color.mV[VY], text_color.mV[VZ], gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor); + gGL.color4f(text_color.mV[VX], text_color.mV[VY], text_color.mV[VZ], *sChatBubbleOpacity * alpha_factor); LLVector3 label_height = (mFontp->getLineHeight() * mLabelSegments.size() + (VERTICAL_PADDING / 3.f)) * y_pixel_vec; LLVector3 label_offset = height_vec - label_height; LLUI::translate(label_offset.mV[VX], label_offset.mV[VY], label_offset.mV[VZ]); diff --git a/linden/indra/newview/llmediaremotectrl.cpp b/linden/indra/newview/llmediaremotectrl.cpp index f2ec414..67cb758 100644 --- a/linden/indra/newview/llmediaremotectrl.cpp +++ b/linden/indra/newview/llmediaremotectrl.cpp @@ -151,8 +151,11 @@ void LLMediaRemoteCtrl::enableMediaButtons() bool play_music_enabled = false; bool stop_music_enabled = false; bool media_show_pause = false; - LLColor4 music_icon_color = LLUI::sColorsGroup->getColor( "IconDisabledColor" ); - LLColor4 media_icon_color = LLUI::sColorsGroup->getColor( "IconDisabledColor" ); + + static LLColor4* sIconDisabledColor = rebind_llcontrol("IconDisabledColor", &gColors, true); + + LLColor4 music_icon_color = (*sIconDisabledColor).getValue(); + LLColor4 media_icon_color = (*sIconDisabledColor).getValue(); std::string media_type = "none/none"; // Put this in xui file @@ -161,7 +164,7 @@ void LLMediaRemoteCtrl::enableMediaButtons() if (gSavedSettings.getBOOL("AudioStreamingVideo")) { - if ( parcel && parcel->getMediaURL()[0]) + if ( parcel && !parcel->getMediaURL().empty()) { // Set the tooltip // Put this text into xui file @@ -197,10 +200,10 @@ void LLMediaRemoteCtrl::enableMediaButtons() } } } + if (gSavedSettings.getBOOL("AudioStreamingMusic") && gAudiop) { - - if ( parcel && parcel->getMusicURL()[0]) + if ( parcel && !parcel->getMusicURL().empty()) { music_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" ); diff --git a/linden/indra/newview/llnetmap.cpp b/linden/indra/newview/llnetmap.cpp index 8f7dd03..8a12ff3 100644 --- a/linden/indra/newview/llnetmap.cpp +++ b/linden/indra/newview/llnetmap.cpp @@ -350,11 +350,21 @@ void LLNetMap::draw() F32 min_pick_dist = mDotRadius * MIN_PICK_SCALE; // Draw avatars - LLColor4 avatar_color = gColors.getColor( "MapAvatar" ); - LLColor4 friend_color = gColors.getColor( "MapFriend" ); - LLColor4 muted_color = gColors.getColor( "MapMuted" ); - LLColor4 selected_color = gColors.getColor( "MapSelected" ); - LLColor4 imp_dev_color = gColors.getColor( "MapImpDev" ); + static LLColor4* sMapAvatar = rebind_llcontrol("MapAvatar", &gColors, true); + LLColor4 avatar_color = (*sMapAvatar).getValue(); + + static LLColor4* sMapFriend = rebind_llcontrol("MapFriend", &gColors, true); + LLColor4 friend_color = (*sMapFriend).getValue(); + + static LLColor4* sMapMuted = rebind_llcontrol("MapMuted", &gColors, true); + LLColor4 muted_color = (*sMapMuted).getValue(); + + static LLColor4* sMapSelected = rebind_llcontrol("MapSelected", &gColors, true); + LLColor4 selected_color = (*sMapSelected).getValue(); + + static LLColor4* sMapImpDev = rebind_llcontrol("MapImpDev", &gColors, true); + LLColor4 imp_dev_color = (*sMapImpDev).getValue(); + LLColor4 glyph_color; int selected = -1; diff --git a/linden/indra/newview/llnotify.cpp b/linden/indra/newview/llnotify.cpp index ef57aaf..1a7b247 100644 --- a/linden/indra/newview/llnotify.cpp +++ b/linden/indra/newview/llnotify.cpp @@ -227,7 +227,10 @@ LLNotifyBox::LLNotifyBox(LLNotificationPtr notification, caution_box->setFontStyle(LLFontGL::BOLD); caution_box->setColor(gColors.getColor("NotifyCautionWarnColor")); - caution_box->setBackgroundColor(gColors.getColor("NotifyCautionBoxColor")); + + static LLColor4* sNotifyCautionBoxColor = rebind_llcontrol("NotifyCautionBoxColor", &gColors, true); + + caution_box->setBackgroundColor((*sNotifyCautionBoxColor)); caution_box->setBorderVisible(FALSE); caution_box->setWrappedText(notification->getMessage()); @@ -485,7 +488,10 @@ void LLNotifyBox::drawBackground() const { gGL.getTexUnit(0)->bind(imagep->getImage()); // set proper background color depending on whether notify box is a caution or not - LLColor4 color = mIsCaution? gColors.getColor("NotifyCautionBoxColor") : gColors.getColor("NotifyBoxColor"); + static LLColor4* sNotifyCautionBoxColor = rebind_llcontrol("NotifyCautionBoxColor", &gColors, true); + static LLColor4* sNotifyBoxColor = rebind_llcontrol("NotifyBoxColor", &gColors, true); + + LLColor4 color = mIsCaution? (*sNotifyCautionBoxColor) : (*sNotifyBoxColor); if(gFocusMgr.childHasKeyboardFocus( this )) { const S32 focus_width = 2; @@ -500,9 +506,9 @@ void LLNotifyBox::drawBackground() const gl_segmented_rect_2d_tex(0, getRect().getHeight(), getRect().getWidth(), 0, imagep->getTextureWidth(), imagep->getTextureHeight(), 16, mIsTip ? ROUNDED_RECT_TOP : ROUNDED_RECT_BOTTOM); if( mIsCaution ) - color = gColors.getColor("NotifyCautionBoxColor"); + color = (*sNotifyCautionBoxColor); else - color = gColors.getColor("NotifyBoxColor"); + color = (*sNotifyBoxColor); gGL.color4fv(color.mV); gl_segmented_rect_2d_tex(1, getRect().getHeight()-1, getRect().getWidth()-1, 1, imagep->getTextureWidth(), imagep->getTextureHeight(), 16, mIsTip ? ROUNDED_RECT_TOP : ROUNDED_RECT_BOTTOM); diff --git a/linden/indra/newview/lloverlaybar.cpp b/linden/indra/newview/lloverlaybar.cpp index 6191a01..14ae3ff 100644 --- a/linden/indra/newview/lloverlaybar.cpp +++ b/linden/indra/newview/lloverlaybar.cpp @@ -359,19 +359,22 @@ void LLOverlayBar::refresh() // update "remotes" childSetVisible("media_remote_container", TRUE); childSetVisible("voice_remote_container", LLVoiceClient::voiceEnabled()); - childSetVisible("windlight_remote_container", gSavedSettings.getBOOL("EnableWindlightRemote")); - childSetVisible("ao_remote_container", gSavedSettings.getBOOL("EnableAORemote")); + static BOOL *sEnableWindlightRemote = rebind_llcontrol("EnableWindlightRemote", &gSavedSettings, true); + childSetVisible("windlight_remote_container", (*sEnableWindlightRemote)); + static BOOL *sEnableAORemote = rebind_llcontrol("EnableAORemote", &gSavedSettings, true); + childSetVisible("ao_remote_container", (*sEnableAORemote)); childSetVisible("state_buttons", TRUE); } + static BOOL *sChatVisible = rebind_llcontrol("ChatVisible", &gSavedSettings, true); // always let user toggle into and out of chatbar - childSetVisible("chat_bar", gSavedSettings.getBOOL("ChatVisible")); + childSetVisible("chat_bar", *sChatVisible);//gSavedSettings.getBOOL("ChatVisible")); + if (buttons_changed) { layoutButtons(); } - } //----------------------------------------------------------------------- diff --git a/linden/indra/newview/llpanelaudiovolume.cpp b/linden/indra/newview/llpanelaudiovolume.cpp index 5045e8f..bb10f80 100644 --- a/linden/indra/newview/llpanelaudiovolume.cpp +++ b/linden/indra/newview/llpanelaudiovolume.cpp @@ -67,8 +67,9 @@ LLPanelAudioVolume::~LLPanelAudioVolume () // void LLPanelAudioVolume::draw() { - BOOL mute = gSavedSettings.getBOOL("MuteAudio"); - bool enable = mute ? false : true; + + static BOOL* sMuteAudio = rebind_llcontrol("MuteAudio", &gSavedSettings, true); + bool enable = (*sMuteAudio) ? false : true; childSetEnabled("Music Volume", enable); childSetEnabled("Media Volume", enable); childSetEnabled("Voice Volume", enable); diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp index 33f4cd6..e88a16a 100644 --- a/linden/indra/newview/llpanelavatar.cpp +++ b/linden/indra/newview/llpanelavatar.cpp @@ -1499,13 +1499,15 @@ void LLPanelAvatar::resetGroupList() row["columns"][0]["width"] = 0; if (group_data.mListInProfile) { + static LLColor4 *sScrollUnselectedColor = rebind_llcontrol("ScrollUnselectedColor", LLUI::sColorsGroup, true); row["columns"][0]["value"] = group_string; - row["columns"][0]["color"] = gColors.getColor("ScrollUnselectedColor").getValue(); + row["columns"][0]["color"] = (*sScrollUnselectedColor).getValue(); } else { + static LLColor4 *sScrollReadOnlyColor = rebind_llcontrol("ScrollReadOnlyColor", LLUI::sColorsGroup, true); row["columns"][0]["value"] = group_string + " " + getString("HiddenLabel"); - row["columns"][0]["color"] = gColors.getColor("ScrollReadOnlyColor").getValue(); + row["columns"][0]["color"] = (*sScrollReadOnlyColor).getValue(); } group_list->addElement(row); } @@ -2063,13 +2065,15 @@ void LLPanelAvatar::processAvatarGroupsReply(LLMessageSystem *msg, void**) // Set normal color if not found or if group is visible in profile if (!group_data || group_data->mListInProfile) { + static LLColor4 *sScrollUnselectedColor = rebind_llcontrol("ScrollUnselectedColor", LLUI::sColorsGroup, true); row["columns"][0]["value"] = group_string; - row["columns"][0]["color"] = gColors.getColor("ScrollUnselectedColor").getValue(); + row["columns"][0]["color"] = (*sScrollUnselectedColor).getValue(); } else { + static LLColor4 *sScrollReadOnlyColor = rebind_llcontrol("ScrollReadOnlyColor", LLUI::sColorsGroup, true); row["columns"][0]["value"] = group_string + " " + self->getString("HiddenLabel"); - row["columns"][0]["color"] = gColors.getColor("ScrollReadOnlyColor").getValue(); + row["columns"][0]["color"] = (*sScrollReadOnlyColor).getValue(); } if (group_list) { diff --git a/linden/indra/newview/llpaneldisplay.cpp b/linden/indra/newview/llpaneldisplay.cpp index b2313f6..e17ba2b 100644 --- a/linden/indra/newview/llpaneldisplay.cpp +++ b/linden/indra/newview/llpaneldisplay.cpp @@ -325,8 +325,9 @@ BOOL LLPanelDisplay::postBuild() mLightingText = getChild("LightingDetailText"); mMeshDetailText = getChild("MeshDetailText"); - childSetValue("toggle_windlight_control", gSavedSettings.getBOOL("EnableWindlightRemote")); - mWLControl = gSavedSettings.getBOOL("EnableWindlightRemote"); + static BOOL* sEnableWindlightRemote = rebind_llcontrol("EnableWindlightRemote", &gSavedSettings, true); + childSetValue("toggle_windlight_control", (*sEnableWindlightRemote)); + mWLControl = (*sEnableWindlightRemote); refresh(); @@ -387,7 +388,8 @@ void LLPanelDisplay::refresh() mCustomSettings = gSavedSettings.getBOOL("RenderCustomSettings"); // shader settings - mBumpShiny = gSavedSettings.getBOOL("RenderObjectBump"); + static BOOL* sRenderObjectBump = rebind_llcontrol("RenderObjectBump", &gSavedSettings, true); + mBumpShiny = *sRenderObjectBump; mShaderEnable = gSavedSettings.getBOOL("VertexShaderEnable"); mWindLight = gSavedSettings.getBOOL("WindLightUseAtmosShaders"); mReflections = gSavedSettings.getBOOL("RenderWaterReflections"); @@ -418,7 +420,8 @@ void LLPanelDisplay::refresh() mTerrainDetail = gSavedSettings.getS32("RenderTerrainDetail"); // windlight remote - mWLControl = gSavedSettings.getBOOL("EnableWindlightRemote"); + static BOOL* sEnableWindlightRemote = rebind_llcontrol("EnableWindlightRemote", &gSavedSettings, true); + mWLControl = (*sEnableWindlightRemote); // max avatar count mAvatarMaxVisible = gSavedSettings.getS32("RenderAvatarMaxVisible"); diff --git a/linden/indra/newview/llprefsadvanced.cpp b/linden/indra/newview/llprefsadvanced.cpp index cb0416e..aa62b34 100644 --- a/linden/indra/newview/llprefsadvanced.cpp +++ b/linden/indra/newview/llprefsadvanced.cpp @@ -83,8 +83,10 @@ BOOL LLPrefsAdvanced::postBuild() { childSetValue("disable_log_screen_check", gSavedSettings.getBOOL("DisableLoginLogoutScreens")); childSetValue("disable_tp_screen_check", gSavedSettings.getBOOL("DisableTeleportScreens")); - childSetValue("client_name_tag_check", gSavedSettings.getBOOL("ShowClientNameTag")); - childSetValue("client_name_color_check", gSavedSettings.getBOOL("ShowClientColor")); + static BOOL* sShowClientNameTag = rebind_llcontrol("ShowClientNameTag", &gSavedSettings, true); + childSetValue("client_name_tag_check", (*sShowClientNameTag)); + static BOOL* sShowClientColor = rebind_llcontrol("ShowClientColor", &gSavedSettings, true); + childSetValue("client_name_color_check", (*sShowClientColor)); childSetValue("client_name_hover_check", gSavedSettings.getBOOL("ShowClientNameHoverTip")); childSetValue("client_name_tag_broadcast_check", gSavedSettings.getBOOL("ShowMyClientTagToOthers")); childSetValue("http_texture_check", gSavedSettings.getBOOL("ImagePipelineUseHTTP")); diff --git a/linden/indra/newview/llprefschat.cpp b/linden/indra/newview/llprefschat.cpp index b4614b8..6ebc880 100644 --- a/linden/indra/newview/llprefschat.cpp +++ b/linden/indra/newview/llprefschat.cpp @@ -140,9 +140,10 @@ void LLPrefsChatImpl::refreshValues() mPlayTypingAnim = gSavedSettings.getBOOL("PlayTypingAnim"); mChatChannel = gSavedSettings.getBOOL("ChatChannelSelect"); mConsoleOpacity = gSavedSettings.getF32("ConsoleBackgroundOpacity"); - mBubbleOpacity = gSavedSettings.getF32("ChatBubbleOpacity"); mTranslateLanguage = gSavedSettings.getString("TranslateLanguage"); mTranslateChat = gSavedSettings.getBOOL("TranslateChat"); + static F32* sChatBubbleOpacity = rebind_llcontrol("ChatBubbleOpacity", &gSavedSettings, true); + mBubbleOpacity = *sChatBubbleOpacity; } void LLPrefsChatImpl::cancel() diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 4fd4daa..39d9ab6 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp @@ -1938,7 +1938,9 @@ bool idle_startup() LLFloaterActiveSpeakers::showInstance(); } - if (gSavedSettings.getBOOL("BeaconsEnabled")) + static BOOL* sBeaconsEnabled = rebind_llcontrol("BeaconsEnabled", &gSavedSettings, true); + + if (*sBeaconsEnabled) { LLFloaterBeacons::showInstance(); } diff --git a/linden/indra/newview/llstatgraph.cpp b/linden/indra/newview/llstatgraph.cpp index 26b7494..ace1731 100644 --- a/linden/indra/newview/llstatgraph.cpp +++ b/linden/indra/newview/llstatgraph.cpp @@ -109,7 +109,9 @@ void LLStatGraph::draw() // gColors.getColor("ColorDropShadow"), // (S32) gSavedSettings.getF32("DropShadowFloater") ); - color = gColors.getColor( "MenuDefaultBgColor" ); + static LLColor4* sMenuDefaultBgColor = rebind_llcontrol("MenuDefaultBgColor", &gColors, true); + color = (*sMenuDefaultBgColor).getValue(); + gGL.color4fv(color.mV); gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, TRUE); diff --git a/linden/indra/newview/llstatusbar.cpp b/linden/indra/newview/llstatusbar.cpp index 366363b..fbb99f0 100644 --- a/linden/indra/newview/llstatusbar.cpp +++ b/linden/indra/newview/llstatusbar.cpp @@ -227,12 +227,15 @@ void LLStatusBar::draw() { refresh(); + /*static LLColor4* sColorDropShadow = rebind_llcontrol("ColorDropShadow", LLUI::sColorsGroup, true); + static S32* sDropShadowFloater = rebind_llcontrol("DropShadowFloater", LLUI::sConfigGroup, true); + if (isBackgroundVisible()) { gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0, - LLUI::sColorsGroup->getColor("ColorDropShadow"), - LLUI::sConfigGroup->getS32("DropShadowFloater") ); - } + (*sColorDropShadow), + (*sDropShadowFloater) ); + }*/ LLPanel::draw(); } diff --git a/linden/indra/newview/lltexturefetch.cpp b/linden/indra/newview/lltexturefetch.cpp index 2184478..5cad14c 100644 --- a/linden/indra/newview/lltexturefetch.cpp +++ b/linden/indra/newview/lltexturefetch.cpp @@ -750,7 +750,9 @@ bool LLTextureFetchWorker::doWork(S32 param) if (mState == LOAD_FROM_NETWORK) { - bool get_url = gSavedSettings.getBOOL("ImagePipelineUseHTTP"); + static BOOL* sImagePipelineUseHTTP = rebind_llcontrol("ImagePipelineUseHTTP", &gSavedSettings, true); + + bool get_url = *sImagePipelineUseHTTP; if (!mUrl.empty()) get_url = false; // if (mHost != LLHost::invalid) get_url = false; if ( get_url && mCanUseHTTP && mUrl.empty())//get http url. diff --git a/linden/indra/newview/lltoolfocus.cpp b/linden/indra/newview/lltoolfocus.cpp index 351c02b..ae0cd1e 100644 --- a/linden/indra/newview/lltoolfocus.cpp +++ b/linden/indra/newview/lltoolfocus.cpp @@ -216,10 +216,12 @@ void LLToolCamera::pickCallback(const LLPickInfo& pick_info) gAgent.setFocusGlobal(pick_info); } + static BOOL* sFreezeTime = rebind_llcontrol("FreezeTime", &gSavedSettings, true); + if (!(pick_info.mKeyMask & MASK_ALT) && gAgent.cameraThirdPerson() && gViewerWindow->getLeftMouseDown() && - !gSavedSettings.getBOOL("FreezeTime") && + !(*sFreezeTime) && (hit_obj == gAgent.getAvatarObject() || (hit_obj && hit_obj->isAttachment() && LLVOAvatar::findAvatarFromAttachment(hit_obj)->isSelf()))) { diff --git a/linden/indra/newview/llvieweraudio.cpp b/linden/indra/newview/llvieweraudio.cpp index f043fb5..672836d 100644 --- a/linden/indra/newview/llvieweraudio.cpp +++ b/linden/indra/newview/llvieweraudio.cpp @@ -114,10 +114,14 @@ void init_audio() void audio_update_volume(bool force_update) { - F32 master_volume = gSavedSettings.getF32("AudioLevelMaster"); - bool wind_muted = gSavedSettings.getBOOL("MuteWind"); - bool mute_audio = gSavedSettings.getBOOL("MuteAudio"); + static BOOL* sMuteAudio = rebind_llcontrol("MuteAudio", &gSavedSettings, true); + static BOOL* sMuteWind = rebind_llcontrol("MuteWind", &gSavedSettings, true); + static F32 *sAudioLevelMaster = rebind_llcontrol("AudioLevelMaster", &gSavedSettings, true); + + F32 master_volume = (*sAudioLevelMaster); + bool wind_muted = (*sMuteWind); + BOOL mute_audio = (*sMuteAudio); if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized"))) { mute_audio = TRUE; diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 026f652..e109673 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -7509,7 +7509,9 @@ class LLViewEnableMouselook : public view_listener_t { // You can't go directly from customize avatar to mouselook. // TODO: write code with appropriate dialogs to handle this transition. - bool new_value = (CAMERA_MODE_CUSTOMIZE_AVATAR != gAgent.getCameraMode() && !gSavedSettings.getBOOL("FreezeTime")); + static BOOL* sFreezeTime = rebind_llcontrol("FreezeTime", &gSavedSettings, true); + + bool new_value = (CAMERA_MODE_CUSTOMIZE_AVATAR != gAgent.getCameraMode() && !(*sFreezeTime)); gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index e216c44..35fd395 100755 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -3022,7 +3022,8 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) if (!is_muted && !is_busy) { - visible_in_chat_bubble = gSavedSettings.getBOOL("UseChatBubbles"); + static BOOL* sUseChatBubbles = rebind_llcontrol("UseChatBubbles", &gSavedSettings, true); + visible_in_chat_bubble = *sUseChatBubbles; ((LLVOAvatar*)chatter)->addChat(chat); } } diff --git a/linden/indra/newview/llviewerobjectlist.cpp b/linden/indra/newview/llviewerobjectlist.cpp index bfb248b..78ce247 100644 --- a/linden/indra/newview/llviewerobjectlist.cpp +++ b/linden/indra/newview/llviewerobjectlist.cpp @@ -698,7 +698,9 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) } } - if (gSavedSettings.getBOOL("FreezeTime")) + static BOOL* sFreezeTime = rebind_llcontrol("FreezeTime", &gSavedSettings, true); + + if ((*sFreezeTime)) { for (std::vector::iterator iter = idle_list.begin(); iter != idle_list.end(); iter++) diff --git a/linden/indra/newview/llviewerstats.cpp b/linden/indra/newview/llviewerstats.cpp index 93e69ca..607f871 100644 --- a/linden/indra/newview/llviewerstats.cpp +++ b/linden/indra/newview/llviewerstats.cpp @@ -533,7 +533,8 @@ void update_statistics(U32 frame_count) LLViewerStats::getInstance()->setStat(LLViewerStats::ST_ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable")); LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gSavedSettings.getS32("RenderLightingDetail")); LLViewerStats::getInstance()->setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip")); - LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles")); + static BOOL* sUseChatBubbles = rebind_llcontrol("UseChatBubbles", &gSavedSettings, true); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)*sUseChatBubbles); #if 0 // 1.9.2 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_SHADER_OBJECTS, (F64)gSavedSettings.getS32("VertexShaderLevelObject")); LLViewerStats::getInstance()->setStat(LLViewerStats::ST_SHADER_AVATAR, (F64)gSavedSettings.getBOOL("VertexShaderLevelAvatar")); diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp index 43a0d19..3a68f0f 100644 --- a/linden/indra/newview/llviewerwindow.cpp +++ b/linden/indra/newview/llviewerwindow.cpp @@ -298,7 +298,9 @@ public: U32 ypos = 64; const U32 y_inc = 20; - if (gSavedSettings.getBOOL("DebugShowTime")) + static BOOL *sDebugShowTime = rebind_llcontrol("DebugShowTime", &gSavedSettings, true); + + if(*sDebugShowTime) { const U32 y_inc2 = 15; for (std::map::reverse_iterator iter = gDebugTimers.rbegin(); @@ -513,8 +515,10 @@ public: addText(xpos, ypos, llformat("%d %d %d %d", color[0], color[1], color[2], color[3])); ypos += y_inc; } + static BOOL* sBeaconsEnabled = rebind_llcontrol("BeaconsEnabled", &gSavedSettings, true); + // only display these messages if we are actually rendering beacons at this moment - if (LLPipeline::getRenderBeacons(NULL) && gSavedSettings.getBOOL("BeaconsEnabled")) + if (LLPipeline::getRenderBeacons(NULL) && *sBeaconsEnabled) { if (LLPipeline::getRenderParticleBeacons(NULL)) { @@ -2048,7 +2052,9 @@ void LLViewerWindow::draw() //S32 screen_x, screen_y; // HACK for timecode debugging - if (gSavedSettings.getBOOL("DisplayTimecode")) + static BOOL* sDisplayTimecode = rebind_llcontrol("DisplayTimecode", &gSavedSettings, true); + + if (*sDisplayTimecode) { // draw timecode block std::string text; @@ -2509,7 +2515,9 @@ BOOL LLViewerWindow::handlePerFrameHover() LLVector2 mouse_vel; - if (gSavedSettings.getBOOL("MouseSmooth")) + static BOOL* sMouseSmooth = rebind_llcontrol("MouseSmooth", &gSavedSettings, true); + + if (*sMouseSmooth) { static F32 fdx = 0.f; static F32 fdy = 0.f; @@ -2664,7 +2672,9 @@ BOOL LLViewerWindow::handlePerFrameHover() // Show a new tool tip (or update one that is alrady shown) BOOL tool_tip_handled = FALSE; std::string tool_tip_msg; - F32 tooltip_delay = gSavedSettings.getF32( "ToolTipDelay" ); + static F32 *sToolTipDelay = rebind_llcontrol("ToolTipDelay", &gSavedSettings, true); + + F32 tooltip_delay = (*sToolTipDelay); //HACK: hack for tool-based tooltips which need to pop up more quickly //Also for show xui names as tooltips debug mode if ((mouse_captor && !mouse_captor->isView()) || LLUI::sShowXUINames) @@ -2715,9 +2725,10 @@ BOOL LLViewerWindow::handlePerFrameHover() { mToolTip->setVisible( tooltip_vis ); } - } + } + static BOOL* sFreezeTime = rebind_llcontrol("FreezeTime", &gSavedSettings, true); - if (tool && tool != gToolNull && tool != LLToolCompInspect::getInstance() && tool != LLToolDragAndDrop::getInstance() && !gSavedSettings.getBOOL("FreezeTime")) + if (tool && tool != gToolNull && tool != LLToolCompInspect::getInstance() && tool != LLToolDragAndDrop::getInstance() && !(*sFreezeTime)) { LLMouseHandler *captor = gFocusMgr.getMouseCapture(); // With the null, inspect, or drag and drop tool, don't muck diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index 36d60dd..7664041 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp @@ -3457,13 +3457,19 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) } const F32 time_visible = mTimeVisible.getElapsedTimeF32(); - const F32 NAME_SHOW_TIME = gSavedSettings.getF32("RenderNameShowTime"); // seconds - const F32 FADE_DURATION = gSavedSettings.getF32("RenderNameFadeDuration"); // seconds + + static F32* sRenderNameShowTime = rebind_llcontrol("RenderNameShowTime", &gSavedSettings, true); + static F32* sRenderNameFadeDuration = rebind_llcontrol("RenderNameFadeDuration", &gSavedSettings, true); + + + const F32 NAME_SHOW_TIME = *sRenderNameShowTime; // seconds + const F32 FADE_DURATION = *sRenderNameFadeDuration; // seconds // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0b bool fRlvShowNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); // [/RLVa:KB] BOOL visible_avatar = isVisible() || mNeedsAnimUpdate; - BOOL visible_chat = gSavedSettings.getBOOL("UseChatBubbles") && (mChats.size() || mTyping); + static BOOL* sUseChatBubbles = rebind_llcontrol("UseChatBubbles", &gSavedSettings, true); + BOOL visible_chat = *sUseChatBubbles && (mChats.size() || mTyping); BOOL render_name = visible_chat || (visible_avatar && // [RLVa:KB] - Checked: 2009-08-11 (RLVa-1.0.1h) | Added: RLVa-1.0.0h @@ -3505,6 +3511,9 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) mRenderGroupTitles = sRenderGroupTitles; new_name = TRUE; } + + static LLColor4* sAvatarNameColor = rebind_llcontrol("AvatarNameColor", &gColors, true); + std::string client; // First Calculate Alpha // If alpha > 0, create mNameText if necessary, otherwise delete it @@ -3545,7 +3554,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) new_name = TRUE; } - LLColor4 avatar_name_color = gColors.getColor( "AvatarNameColor" ); + LLColor4 avatar_name_color = (*sAvatarNameColor); LLColor4 client_color = avatar_name_color; if(!mIsSelf) //don't know your own client ? @@ -3560,11 +3569,14 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) // Set your own name to the Imprudence color -- MC client_color = LLColor4(0.79f,0.44f,0.88f); } - if (gSavedSettings.getBOOL("ShowClientColor")) + + static BOOL* sShowClientColor = rebind_llcontrol("ShowClientColor", &gSavedSettings, true); + static BOOL* sShowClientNameTag = rebind_llcontrol("ShowClientNameTag", &gSavedSettings, true); + if (*sShowClientColor) { avatar_name_color = client_color; } - if (!gSavedSettings.getBOOL("ShowClientNameTag")) + if (!(*sShowClientNameTag)) { client.clear(); } @@ -3657,7 +3669,8 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) BOOL need_comma = FALSE; - bool show_client = client.length() != 0 && gSavedSettings.getBOOL("ShowClientNameTag"); + static BOOL* sShowClientNameTag = rebind_llcontrol("ShowClientNameTag", &gSavedSettings, true); + bool show_client = client.length() != 0 && (*sShowClientNameTag); if (is_away || is_muted || is_busy || show_client) { line += " ("; @@ -3726,7 +3739,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) std::deque::iterator chat_iter = mChats.begin(); mNameText->clearString(); - LLColor4 new_chat = gColors.getColor( "AvatarNameColor" ); + LLColor4 new_chat = (*sAvatarNameColor); LLColor4 normal_chat = lerp(new_chat, LLColor4(0.8f, 0.8f, 0.8f, 1.f), 0.7f); LLColor4 old_chat = lerp(normal_chat, LLColor4(0.6f, 0.6f, 0.6f, 1.f), 0.7f); if (mTyping && mChats.size() >= MAX_BUBBLE_CHAT_UTTERANCES) @@ -3788,7 +3801,8 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) } else { - if (gSavedSettings.getBOOL("SmallAvatarNames")) + static BOOL* sSmallAvatarNames = rebind_llcontrol("SmallAvatarNames", &gSavedSettings, true); + if (*sSmallAvatarNames) { mNameText->setFont(LLFontGL::getFontSansSerif()); } @@ -7332,7 +7346,8 @@ BOOL LLVOAvatar::updateIsFullyLoaded() BOOL LLVOAvatar::isFullyLoaded() { - if (gSavedSettings.getBOOL("RenderUnloadedAvatar")) + static BOOL* sRenderUnloadedAvatar = rebind_llcontrol("RenderUnloadedAvatar", &gSavedSettings, true); + if (*sRenderUnloadedAvatar) return TRUE; else return mFullyLoaded; diff --git a/linden/indra/newview/llvoiceremotectrl.cpp b/linden/indra/newview/llvoiceremotectrl.cpp index 1681e96..d11424b 100644 --- a/linden/indra/newview/llvoiceremotectrl.cpp +++ b/linden/indra/newview/llvoiceremotectrl.cpp @@ -114,14 +114,16 @@ void LLVoiceRemoteCtrl::draw() LLFloaterActiveSpeakers::getInstance()->onClose(false); mVoiceLastActive = voice_active; + static BOOL *sPTTCurrentlyEnabled = rebind_llcontrol("PTTCurrentlyEnabled", &gSavedSettings, true); + // propagate ptt state to button display, if (!mTalkBtn->hasMouseCapture()) { // not in push to talk mode, or push to talk is active means I'm talking - mTalkBtn->setToggleState(!gSavedSettings.getBOOL("PTTCurrentlyEnabled") || gVoiceClient->getUserPTTState()); + mTalkBtn->setToggleState(!(*sPTTCurrentlyEnabled) || gVoiceClient->getUserPTTState()); } mSpeakersBtn->setToggleState(LLFloaterActiveSpeakers::instanceVisible(LLSD())); - mTalkLockBtn->setToggleState(!gSavedSettings.getBOOL("PTTCurrentlyEnabled")); + mTalkLockBtn->setToggleState(!(*sPTTCurrentlyEnabled)); std::string talk_blip_image; if (gVoiceClient->getIsSpeaking(gAgent.getID())) diff --git a/linden/indra/newview/llvosky.cpp b/linden/indra/newview/llvosky.cpp index d15a2dc..37fd523 100644 --- a/linden/indra/newview/llvosky.cpp +++ b/linden/indra/newview/llvosky.cpp @@ -1023,7 +1023,10 @@ void LLVOSky::calcAtmospherics(void) // Since WL scales everything by 2, there should always be at least a 2:1 brightness ratio // between sunlight and point lights in windlight to normalize point lights. - F32 sun_dynamic_range = llmax(gSavedSettings.getF32("RenderSunDynamicRange"), 0.0001f); + + static F32 *sRenderSunDynamicRange = rebind_llcontrol("RenderSunDynamicRange", &gSavedSettings, true); + + F32 sun_dynamic_range = llmax((*sRenderSunDynamicRange), 0.0001f); LLWLParamManager::instance()->mSceneLightStrength = 2.0f * (1.0f + sun_dynamic_range * dp); mSunDiffuse = vary_SunlightColor; diff --git a/linden/indra/newview/llvotree.cpp b/linden/indra/newview/llvotree.cpp index 0a7cc92..6a59253 100644 --- a/linden/indra/newview/llvotree.cpp +++ b/linden/indra/newview/llvotree.cpp @@ -359,8 +359,10 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { return TRUE; } + + static BOOL* sRenderAnimateTrees = rebind_llcontrol("RenderAnimateTrees", &gSavedSettings, true); - if (gSavedSettings.getBOOL("RenderAnimateTrees")) + if (*sRenderAnimateTrees) { F32 mass_inv; @@ -403,7 +405,7 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) } } - if (!gSavedSettings.getBOOL("RenderAnimateTrees")) + if (!*sRenderAnimateTrees) { if (mReferenceBuffer.isNull()) { @@ -548,8 +550,8 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable) max_indices += sLODIndexCount[lod]; max_vertices += sLODVertexCount[lod]; } - - mReferenceBuffer = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, gSavedSettings.getBOOL("RenderAnimateTrees") ? GL_STATIC_DRAW_ARB : 0); + static BOOL* sRenderAnimateTrees = rebind_llcontrol("RenderAnimateTrees", &gSavedSettings, true); + mReferenceBuffer = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, *sRenderAnimateTrees ? GL_STATIC_DRAW_ARB : 0); mReferenceBuffer->allocateBuffer(max_vertices, max_indices, TRUE); LLStrider vertices; @@ -852,8 +854,8 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable) llassert(vertex_count == max_vertices); llassert(index_count == max_indices); } - - if (gSavedSettings.getBOOL("RenderAnimateTrees")) + static BOOL* sRenderAnimateTrees = rebind_llcontrol("RenderAnimateTrees", &gSavedSettings, true); + if (*sRenderAnimateTrees) { mDrawable->getFace(0)->mVertexBuffer = mReferenceBuffer; } diff --git a/linden/indra/newview/llvovolume.cpp b/linden/indra/newview/llvovolume.cpp index 5f7327d..bed3e13 100644 --- a/linden/indra/newview/llvovolume.cpp +++ b/linden/indra/newview/llvovolume.cpp @@ -2231,8 +2231,13 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) std::vector alpha_faces; U32 useage = group->mSpatialPartition->mBufferUsage; - U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); - U32 max_total = (gSavedSettings.getS32("RenderMaxNodeSize")*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); + + static S32* sRenderMaxVBOSize = rebind_llcontrol("RenderMaxVBOSize", &gSavedSettings, true); + static S32* sRenderMaxNodeSize = rebind_llcontrol("RenderMaxNodeSize", &gSavedSettings, true); + + + U32 max_vertices = ((*sRenderMaxVBOSize)*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); + U32 max_total = ((*sRenderMaxNodeSize)*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); max_vertices = llmin(max_vertices, (U32) 65535); U32 cur_total = 0; @@ -2505,8 +2510,9 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector& faces, BOOL distance_sort) { + static S32* sRenderMaxVBOSize = rebind_llcontrol("RenderMaxVBOSize", &gSavedSettings, true); //calculate maximum number of vertices to store in a single buffer - U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); + U32 max_vertices = ((*sRenderMaxVBOSize)*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); max_vertices = llmin(max_vertices, (U32) 65535); if (!distance_sort) diff --git a/linden/indra/newview/llvowlsky.cpp b/linden/indra/newview/llvowlsky.cpp index abd25e6..96bd62e 100644 --- a/linden/indra/newview/llvowlsky.cpp +++ b/linden/indra/newview/llvowlsky.cpp @@ -334,7 +334,9 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable) } { - const U32 max_buffer_bytes = gSavedSettings.getS32("RenderMaxVBOSize")*1024; + static S32* sRenderMaxVBOSize = rebind_llcontrol("RenderMaxVBOSize", &gSavedSettings, true); + + const U32 max_buffer_bytes = (*sRenderMaxVBOSize)*1024; const U32 data_mask = LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK; const U32 max_verts = max_buffer_bytes / LLVertexBuffer::calcStride(data_mask); diff --git a/linden/indra/newview/llworld.cpp b/linden/indra/newview/llworld.cpp index 17fad2b..ca8ce2d 100644 --- a/linden/indra/newview/llworld.cpp +++ b/linden/indra/newview/llworld.cpp @@ -667,7 +667,8 @@ void LLWorld::updateParticles() void LLWorld::updateClouds(const F32 dt) { - if (gSavedSettings.getBOOL("FreezeTime") || + static BOOL* sFreezeTime = rebind_llcontrol("FreezeTime", &gSavedSettings, true); + if ((*sFreezeTime) || !gSavedSettings.getBOOL("SkyUseClassicClouds")) { // don't move clouds in snapshot mode diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp index e024e4c..0ca94dc 100644 --- a/linden/indra/newview/pipeline.cpp +++ b/linden/indra/newview/pipeline.cpp @@ -1014,8 +1014,8 @@ U32 LLPipeline::addObject(LLViewerObject *vobj) { return 0; } - - if (gSavedSettings.getBOOL("RenderDelayCreation")) + static BOOL sRenderDelayCreation = gSavedSettings.getBOOL("RenderDelayCreation"); + if (sRenderDelayCreation) { mCreateQ.push_back(vobj); } @@ -1078,7 +1078,9 @@ void LLPipeline::createObject(LLViewerObject* vobj) markRebuild(drawablep, LLDrawable::REBUILD_ALL, TRUE); - if (drawablep->getVOVolume() && gSavedSettings.getBOOL("RenderAnimateRes")) + static BOOL sRenderAnimateRes = gSavedSettings.getBOOL("RenderAnimateRes"); + + if (drawablep->getVOVolume() && sRenderAnimateRes) { // fun animated res drawablep->updateXform(TRUE); @@ -1117,7 +1119,8 @@ void LLPipeline::resetFrameStats() //external functions for asynchronous updating void LLPipeline::updateMoveDampedAsync(LLDrawable* drawablep) { - if (gSavedSettings.getBOOL("FreezeTime")) + static BOOL* sFreezeTime = rebind_llcontrol("FreezeTime", &gSavedSettings, true); + if ((*sFreezeTime)) { return; } @@ -1147,7 +1150,8 @@ void LLPipeline::updateMoveDampedAsync(LLDrawable* drawablep) void LLPipeline::updateMoveNormalAsync(LLDrawable* drawablep) { - if (gSavedSettings.getBOOL("FreezeTime")) + static BOOL* sFreezeTime = rebind_llcontrol("FreezeTime", &gSavedSettings, true); + if ((*sFreezeTime)) { return; } @@ -1200,7 +1204,8 @@ void LLPipeline::updateMove() LLFastTimer t(LLFastTimer::FTM_UPDATE_MOVE); LLMemType mt(LLMemType::MTYPE_PIPELINE); - if (gSavedSettings.getBOOL("FreezeTime")) + static BOOL* sFreezeTime = rebind_llcontrol("FreezeTime", &gSavedSettings, true); + if ((*sFreezeTime)) { return; } @@ -2295,8 +2300,10 @@ void LLPipeline::postSort(LLCamera& camera) std::sort(sCull->beginAlphaGroups(), sCull->endAlphaGroups(), LLSpatialGroup::CompareDepthGreater()); } + static BOOL* sBeaconsEnabled = rebind_llcontrol("BeaconsEnabled", &gSavedSettings, true); + // only render if the flag is set. The flag is only set if we are in edit mode or the toggle is set in the menus - if (gSavedSettings.getBOOL("BeaconsEnabled") && !sShadowRender) + if (*sBeaconsEnabled && !sShadowRender) { if (sRenderScriptedTouchBeacons) { -- cgit v1.1