-LLCached[COA]Control can now be static const. Use for readonly access.

-const'd all readonly LLCached[COA]Controls to prevent altering by mistake.
-added get() accessor to LLCached[COA]Controls to return cached type explicitly without manual casts.
-added missing operators to LLCachedCOAControl
-Converted a few more settings to LLCached[COA]Control
-Fixed LLColor4U -> LLSD -> LLColor4 problems in LLCachedControl

Ascent functionality fixes:
-Tag coloring pulled out of getClientInfo(Redundant. idleUpdateNameTag already handled it)
--Tag and color substituted at render-time. Simple boolean logic. Neglible perf penalty.
-Fixed llinfos spam if AscentShowSelfTagColor = false
-Client tag updated less superfluously
This commit is contained in:
unknown
2010-10-12 00:44:16 -05:00
parent 25190a6d8a
commit 3b0bfc40bc
31 changed files with 230 additions and 208 deletions

View File

@@ -518,7 +518,7 @@ public:
ypos += y_inc;
}
// only display these messages if we are actually rendering beacons at this moment
static LLCachedControl<bool> beacon_always_on("BeaconAlwaysOn",false);
static const LLCachedControl<bool> beacon_always_on("BeaconAlwaysOn",false);
if (LLPipeline::getRenderBeacons(NULL) && beacon_always_on)
{
if (LLPipeline::getRenderParticleBeacons(NULL))
@@ -2285,7 +2285,7 @@ void LLViewerWindow::draw()
//S32 screen_x, screen_y;
// HACK for timecode debugging
static LLCachedControl<bool> display_timecode("DisplayTimecode",false);
static const LLCachedControl<bool> display_timecode("DisplayTimecode",false);
if (display_timecode)
{
// draw timecode block
@@ -2763,7 +2763,7 @@ BOOL LLViewerWindow::handlePerFrameHover()
LLVector2 mouse_vel;
static LLCachedControl<bool> mouse_smooth("MouseSmooth",false);
static const LLCachedControl<bool> mouse_smooth("MouseSmooth",false);
if (mouse_smooth)
{
static F32 fdx = 0.f;
@@ -2919,13 +2919,13 @@ 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;
static LLCachedControl<F32> tool_tip_delay("ToolTipDelay",.7f);
static const LLCachedControl<F32> tool_tip_delay("ToolTipDelay",.7f);
F32 tooltip_delay = tool_tip_delay;
//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)
{
static LLCachedControl<F32> drag_and_drop_tool_tip_delay("DragAndDropToolTipDelay",.1f);
static const LLCachedControl<F32> drag_and_drop_tool_tip_delay("DragAndDropToolTipDelay",.1f);
tooltip_delay = drag_and_drop_tool_tip_delay;
}
if( handled &&
@@ -2974,7 +2974,7 @@ BOOL LLViewerWindow::handlePerFrameHover()
}
}
static LLCachedControl<bool> freeze_time("FreezeTime",0);
static const LLCachedControl<bool> freeze_time("FreezeTime",0);
if (tool && tool != gToolNull && tool != LLToolCompInspect::getInstance() && tool != LLToolDragAndDrop::getInstance() && !freeze_time)
{
LLMouseHandler *captor = gFocusMgr.getMouseCapture();
@@ -3116,7 +3116,7 @@ BOOL LLViewerWindow::handlePerFrameHover()
gFloaterView->syncFloaterTabOrder();
}
static LLCachedControl<bool> chat_bar_steals_focus("ChatBarStealsFocus",true);
static const LLCachedControl<bool> chat_bar_steals_focus("ChatBarStealsFocus",true);
if (chat_bar_steals_focus
&& gChatBar
&& gFocusMgr.getKeyboardFocus() == NULL
@@ -3156,8 +3156,8 @@ BOOL LLViewerWindow::handlePerFrameHover()
if ((previous_x != x) || (previous_y != y))
mouse_moved_since_pick = TRUE;
static LLCachedControl<F32> picks_moving("PicksPerSecondMouseMoving",5.f);
static LLCachedControl<F32> picks_stationary("PicksPerSecondMouseStationary",0.f);
static const LLCachedControl<F32> picks_moving("PicksPerSecondMouseMoving",5.f);
static const LLCachedControl<F32> picks_stationary("PicksPerSecondMouseStationary",0.f);
if( !getCursorHidden()
// When in-world media is in focus, pick every frame so that browser mouse-overs, dragging scrollbars, etc. work properly.
&& (LLViewerMediaFocus::getInstance()->getFocus()
@@ -5090,7 +5090,7 @@ LLRect LLViewerWindow::getChatConsoleRect()
console_rect.mLeft += CONSOLE_PADDING_LEFT;
static LLCachedControl<bool> chat_full_width("ChatFullWidth",true);
static const LLCachedControl<bool> chat_full_width("ChatFullWidth",true);
if (chat_full_width)
{
console_rect.mRight -= CONSOLE_PADDING_RIGHT;