diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h index 83418d812..17d5e483e 100644 --- a/indra/llxml/llcontrol.h +++ b/indra/llxml/llcontrol.h @@ -300,7 +300,7 @@ private: } else { - mCachedValue = (const T&)mControl->getValue(); + handleValueChange(mControl->getValue()); } // Add a listener to the controls signal... @@ -324,7 +324,15 @@ public: return *this; } - operator const T&() { return mCachedValue; } + operator const T&() const { return mCachedValue; } + /* Sometimes implicit casting doesn't work. + For instance, something like "LLCachedControl color("blah",LLColor4()); color.getValue();" + will not compile as it will look for the function getValue() in LLCachedControl, which doesn't exist. + Use 'color.get().getValue()' instead if something like this happens. + + Manually casting to (const T) would work too, but it's ugly and requires knowledge of LLCachedControl's internals + */ + const T &get() const { return mCachedValue; } LLPointer getControl() const { @@ -343,10 +351,20 @@ private: group.declareControl(name, type, init_value, comment, FALSE); } } - - bool handleValueChange(const LLSD& newvalue) + template void setValue(const LLSD& newvalue) //default behavior { mCachedValue = (const T &)newvalue; + } + template <> void setValue(const LLSD& newvalue) + { + if(mControl->isType(TYPE_COL4U)) + mCachedValue.set(LLColor4U(newvalue)); //a color4u LLSD cannot be auto-converted to color4.. so do it manually. + else + mCachedValue = (const T &)newvalue; + } + bool handleValueChange(const LLSD& newvalue) + { + setValue(newvalue); return true; } @@ -383,6 +401,11 @@ public: if(mCOAConnection.connected()) mCOAConnection.disconnect(); } + LLCachedCOAControl& operator =(const T& newvalue) + { + mCachedControl = newvalue; + return *this; + } bool handleCOAValueChange(const LLSD& newvalue) { if(mCachedControl) @@ -390,7 +413,8 @@ public: mCachedControl = new LLCachedControl(mName,mDefault,gCOASavedSettings,mComment); return true; } - operator const T&() { return *mCachedControl; } + operator const T&() const { return *mCachedControl; } + const T &get() const { return *mCachedControl; } }; //Following is actually defined in newview/llviewercontrol.cpp, but extern access is fine (Unless GCC bites me) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 54b68ed52..586cd3bd7 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -543,7 +543,7 @@ void LLAgent::resetView(BOOL reset_camera, BOOL change_camera) gMenuHolder->hideMenus(); } - static LLCachedControl freeze_time("FreezeTime",false); + static const LLCachedControl freeze_time("FreezeTime",false); if (change_camera && !freeze_time) { changeCameraToDefault(); @@ -786,7 +786,7 @@ BOOL LLAgent::canFly() if (isGodlike()) return TRUE; // - static LLCachedControl ascent_fly_always_enabled("AscentFlyAlwaysEnabled",false); + static const LLCachedControl ascent_fly_always_enabled("AscentFlyAlwaysEnabled",false); if(ascent_fly_always_enabled) return TRUE; // @@ -1973,7 +1973,7 @@ void LLAgent::cameraOrbitIn(const F32 meters) mCameraZoomFraction = (mTargetCameraDistance - meters) / camera_offset_dist; - static LLCachedControl freeze_time("FreezeTime",false); + static const LLCachedControl freeze_time("FreezeTime",false); if (!freeze_time && mCameraZoomFraction < MIN_ZOOM_FRACTION && meters > 0.f) { // No need to animate, camera is already there. @@ -6369,7 +6369,7 @@ void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global) void LLAgent::setTeleportState(ETeleportState state) { mTeleportState = state; - static LLCachedControl freeze_time("FreezeTime",false); + static const LLCachedControl freeze_time("FreezeTime",false); if (mTeleportState > TELEPORT_NONE && freeze_time) { LLFloaterSnapshot::hide(0); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index fe4f246e7..46418270c 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1020,7 +1020,7 @@ bool LLAppViewer::mainLoop() // Sleep and run background threads { LLFastTimer t2(LLFastTimer::FTM_SLEEP); - static LLCachedControl run_multiple_threads("RunMultipleThreads",false); + static const LLCachedControl run_multiple_threads("RunMultipleThreads",false); // yield some time to the os based on command line option if(mYieldTime >= 0) @@ -4077,7 +4077,7 @@ void LLAppViewer::resumeMainloopTimeout(const std::string& state, F32 secs) { if(secs < 0.0f) { - static LLCachedControl mainloop_timeout_default("ThrottleBandwidthKBPS",20); + static const LLCachedControl mainloop_timeout_default("ThrottleBandwidthKBPS",20); secs = mainloop_timeout_default; } @@ -4105,7 +4105,7 @@ void LLAppViewer::pingMainloopTimeout(const std::string& state, F32 secs) { if(secs < 0.0f) { - static LLCachedControl mainloop_timeout_default("ThrottleBandwidthKBPS",20); + static const LLCachedControl mainloop_timeout_default("ThrottleBandwidthKBPS",20); secs = mainloop_timeout_default; } diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index d03d6aa41..486e909ac 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -185,7 +185,7 @@ void LLDrawPoolBump::prerender() // static S32 LLDrawPoolBump::numBumpPasses() { - static LLCachedControl render_object_bump("RenderObjectBump",false); + static const LLCachedControl render_object_bump("RenderObjectBump",false); if (render_object_bump) { if (mVertexShaderLevel > 1) diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index fcad133f3..019d1328e 100644 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -209,7 +209,7 @@ void LLDrawPoolTerrain::render(S32 pass) } // Special-case for land ownership feedback - static LLCachedControl show_parcel_owners("ShowParcelOwners",false); + static const LLCachedControl show_parcel_owners("ShowParcelOwners",false); if (show_parcel_owners) { if (mVertexShaderLevel > 1) diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index ff0ed248c..c673821f4 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -700,22 +700,26 @@ void LLFloaterAvatarList::refreshAvatarList() //Lindens are always more Linden than your friend, make that take precedence if(LLMuteList::getInstance()->isLinden(av_name)) { - element["columns"][LIST_AVATAR_NAME]["color"] = gCOASavedSettings->getColor4("AscentLindenColor").getValue(); + static const LLCachedCOAControl ascent_linden_color("AscentLindenColor",LLColor4(0.f,0.f,1.f,1.f)); + element["columns"][LIST_AVATAR_NAME]["color"] = ascent_linden_color.get().getValue(); } //check if they are an estate owner at their current position else if(estate_owner.notNull() && av_id == estate_owner) { - element["columns"][LIST_AVATAR_NAME]["color"] = gCOASavedSettings->getColor4("AscentEstateOwnerColor").getValue(); + static const LLCachedCOAControl ascent_estate_owner_color("AscentEstateOwnerColor",LLColor4(1.f,0.6f,1.f,1.f)); + element["columns"][LIST_AVATAR_NAME]["color"] = ascent_estate_owner_color.get().getValue(); } //without these dots, SL would suck. else if(is_agent_friend(av_id)) { - element["columns"][LIST_AVATAR_NAME]["color"] = gCOASavedSettings->getColor4("AscentFriendColor").getValue(); + static const LLCachedCOAControl ascent_friend_color("AscentFriendColor",LLColor4(1.f,1.f,0.f,1.f)); + element["columns"][LIST_AVATAR_NAME]["color"] = ascent_friend_color.get().getValue(); } //big fat jerkface who is probably a jerk, display them as such. else if(LLMuteList::getInstance()->isMuted(av_id)) { - element["columns"][LIST_AVATAR_NAME]["color"] = gCOASavedSettings->getColor4("AscentMutedColor").getValue(); + static const LLCachedCOAControl ascent_muted_color("AscentMutedColor",LLColor4(0.7f,0.7f,0.7f,1.f)); + element["columns"][LIST_AVATAR_NAME]["color"] = ascent_muted_color.get().getValue(); } @@ -807,15 +811,17 @@ void LLFloaterAvatarList::refreshAvatarList() //element["columns"][LIST_METADATA]["column"] = "metadata"; //element["columns"][LIST_METADATA]["type"] = "text"; - LLColor4 avatar_name_color = gColors.getColor( "AvatarNameColor" ); + static const LLCachedControl avatar_name_color("AvatarNameColor",LLColor4(LLColor4U(251, 175, 93, 255)), gColors ); + static const LLCachedControl unselected_color("ScrollUnselectedColor",LLColor4(LLColor4U(0, 0, 0, 204)), gColors ); + LLColor4 name_color(avatar_name_color); std::string client; LLVOAvatar *avatarp = gObjectList.findAvatar(av_id); if(avatarp) { - avatarp->getClientInfo(client, avatar_name_color, TRUE); + avatarp->getClientInfo(client, name_color, TRUE); if(client == "") { - avatar_name_color = gColors.getColor( "ScrollUnselectedColor" ); + name_color = unselected_color; client = "?"; } element["columns"][LIST_CLIENT]["value"] = client.c_str(); @@ -833,9 +839,9 @@ void LLFloaterAvatarList::refreshAvatarList() element["columns"][LIST_CLIENT]["value"] = "Out Of Range"; } //Blend to make the color show up better - avatar_name_color = avatar_name_color * 0.5f + gColors.getColor( "ScrollUnselectedColor" ) * 0.5f; + name_color = name_color *.5f + unselected_color * .5f; - element["columns"][LIST_CLIENT]["color"] = avatar_name_color.getValue(); + element["columns"][LIST_CLIENT]["color"] = avatar_name_color.get().getValue(); // Add to list mAvatarList->addElement(element, ADD_BOTTOM); diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index d4e162ee4..51d23f76d 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -733,7 +733,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) LLVector3 new_camera_pos = LLViewerCamera::getInstance()->getOrigin(); LLQuaternion new_camera_rot = LLViewerCamera::getInstance()->getQuaternion(); - static LLCachedControl freeze_time("FreezeTime",false); + static const LLCachedControl freeze_time("FreezeTime",false); if (freeze_time && (new_camera_pos != previewp->mCameraPos || dot(new_camera_rot, previewp->mCameraRot) < 0.995f)) { @@ -2160,7 +2160,7 @@ LLSnapshotFloaterView::~LLSnapshotFloaterView() BOOL LLSnapshotFloaterView::handleKey(KEY key, MASK mask, BOOL called_from_parent) { // use default handler when not in freeze-frame mode - static LLCachedControl freeze_time("FreezeTime",false); + static const LLCachedControl freeze_time("FreezeTime",false); if(!freeze_time) { return LLFloaterView::handleKey(key, mask, called_from_parent); @@ -2182,7 +2182,7 @@ BOOL LLSnapshotFloaterView::handleKey(KEY key, MASK mask, BOOL called_from_paren BOOL LLSnapshotFloaterView::handleMouseDown(S32 x, S32 y, MASK mask) { // use default handler when not in freeze-frame mode - static LLCachedControl freeze_time("FreezeTime",false); + static const LLCachedControl freeze_time("FreezeTime",false); if(!freeze_time) { return LLFloaterView::handleMouseDown(x, y, mask); @@ -2198,7 +2198,7 @@ BOOL LLSnapshotFloaterView::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLSnapshotFloaterView::handleMouseUp(S32 x, S32 y, MASK mask) { // use default handler when not in freeze-frame mode - static LLCachedControl freeze_time("FreezeTime",false); + static const LLCachedControl freeze_time("FreezeTime",false); if(!freeze_time) { return LLFloaterView::handleMouseUp(x, y, mask); @@ -2214,7 +2214,7 @@ 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 - static LLCachedControl freeze_time("FreezeTime",false); + static const LLCachedControl freeze_time("FreezeTime",false); if(!freeze_time) { return LLFloaterView::handleHover(x, y, mask); diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index c121351b4..742f4c0b6 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -2939,7 +2939,7 @@ const std::string LLFolderView::getFilterSubString(BOOL trim) void LLFolderView::filter( LLInventoryFilter& filter ) { LLFastTimer t2(LLFastTimer::FTM_FILTER); - static LLCachedControl filter_items_per_frame("FilterItemsPerFrame",500); + static const LLCachedControl filter_items_per_frame("FilterItemsPerFrame",500); filter.setFilterCount(llclamp((S32)filter_items_per_frame, 1, 5000)); if (getCompletedFilterGeneration() < filter.getCurrentGeneration()) @@ -4395,7 +4395,7 @@ void LLFolderView::doIdle() { LLFastTimer t2(LLFastTimer::FTM_INVENTORY); - static LLCachedControl debug_filters("DebugInventoryFilters",false); + static const LLCachedControl debug_filters("DebugInventoryFilters",false); if (debug_filters != (bool)getDebugFilters()) { mDebugFilters = debug_filters; diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index d22b8f1b9..2a4e6ccf8 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -504,7 +504,7 @@ void LLHUDEffectLookAt::setSourceObject(LLViewerObject* objectp) //----------------------------------------------------------------------------- void LLHUDEffectLookAt::render() { - static LLCachedControl private_look_at("PrivateLookAt",false); + static const LLCachedControl private_look_at("PrivateLookAt",false); if (private_look_at && (gAgent.getAvatarObject() == ((LLVOAvatar*)(LLViewerObject*)mSourceObject))) return; if (sDebugLookAt && mSourceObject.notNull()) diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp index 88077f8cd..d7b022219 100644 --- a/indra/newview/llmenucommands.cpp +++ b/indra/newview/llmenucommands.cpp @@ -124,7 +124,7 @@ void handle_inventory(void*) void handle_chat(void*) { // give focus to chatbar if it's open but not focused - static LLCachedControl chat_visible("ChatVisible",true); + static const LLCachedControl chat_visible("ChatVisible",true); if (chat_visible && gFocusMgr.childHasKeyboardFocus(gChatBar)) { LLChatBar::stopChat(); diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 8cc5b50d3..07b51b022 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -359,11 +359,11 @@ void LLNetMap::draw() // Draw avatars // LLColor4 mapcolor = gAvatarMapColor; - LLColor4 standard_color = gColors.getColor( "MapAvatar" ); - LLColor4 friend_color = gCOASavedSettings->getColor4("AscentFriendColor"); - LLColor4 em_color = gCOASavedSettings->getColor4("AscentEstateOwnerColor"); - LLColor4 linden_color = gCOASavedSettings->getColor4("AscentLindenColor"); - LLColor4 muted_color = gCOASavedSettings->getColor4("AscentMutedColor"); + static const LLCachedControl standard_color("MapAvatar",LLColor4(0.f,1.f,0.f,1.f),gColors); + static const LLCachedCOAControl friend_color("AscentFriendColor",LLColor4(1.f,1.f,0.f,1.f)); + static const LLCachedCOAControl em_color("AscentEstateOwnerColor",LLColor4(1.f,0.6f,1.f,1.f)); + static const LLCachedCOAControl linden_color("AscentLindenColor",LLColor4(0.f,0.f,1.f,1.f)); + static const LLCachedCOAControl muted_color("AscentMutedColor",LLColor4(0.7f,0.7f,0.7f,1.f)); std::vector avatar_ids; std::vector positions; diff --git a/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp index a68924c22..8a518846a 100644 --- a/indra/newview/lloverlaybar.cpp +++ b/indra/newview/lloverlaybar.cpp @@ -371,7 +371,7 @@ void LLOverlayBar::refresh() childSetVisible("voice_remote_container", LLVoiceClient::voiceEnabled()); // always let user toggle into and out of chatbar - static LLCachedControl chat_visible("ChatVisible",true); + static const LLCachedControl chat_visible("ChatVisible",true); childSetVisible("chat_bar", chat_visible); if (buttons_changed) diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index f68bab311..0aa563eee 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1302,7 +1302,7 @@ void LLSpatialGroup::doOcclusion(LLCamera* camera) { if (mSpatialPartition->isOcclusionEnabled() && LLPipeline::sUseOcclusion > 1) { - static LLCachedControl render_water_void_culling("RenderWaterVoidCulling", TRUE); + static const LLCachedControl render_water_void_culling("RenderWaterVoidCulling", TRUE); // Don't cull hole/edge water, unless RenderWaterVoidCulling is set and we have the GL_ARB_depth_clamp extension. if ((mSpatialPartition->mDrawableType == LLPipeline::RENDER_TYPE_VOIDWATER && !(render_water_void_culling && gGLManager.mHasDepthClamp)) || diff --git a/indra/newview/llstatgraph.cpp b/indra/newview/llstatgraph.cpp index 75e4c525d..6ac0c22d9 100644 --- a/indra/newview/llstatgraph.cpp +++ b/indra/newview/llstatgraph.cpp @@ -109,7 +109,7 @@ void LLStatGraph::draw() // gColors.getColor("ColorDropShadow"), // (S32) gSavedSettings.getF32("DropShadowFloater") ); - static LLCachedControl menu_default_color("MenuDefaultBgColor",LLColor4(0,0,255),gColors); + static const LLCachedControl menu_default_color("MenuDefaultBgColor",LLColor4(0.f,0.f,0.f,1.f),gColors); color = menu_default_color; gGL.color4fv(color.mV); gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, TRUE); diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 639352d5a..1fcdab0aa 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -236,8 +236,8 @@ void LLStatusBar::draw() if (isBackgroundVisible()) { - static LLCachedControl color_drop_shadow("ColorDropShadow",LLColor4(0,0,200),LLUI::sColorsGroup); - static LLCachedControl drop_shadow_floater("DropShadowFloater",5,LLUI::sConfigGroup); + static const LLCachedControl color_drop_shadow("ColorDropShadow",LLColor4(LLColor4U(0,0,0,200)),LLUI::sColorsGroup); + static const LLCachedControl drop_shadow_floater("DropShadowFloater",5,LLUI::sConfigGroup); gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0, color_drop_shadow, drop_shadow_floater ); diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index abfec79bb..f5b3076ce 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -722,7 +722,7 @@ bool LLTextureFetchWorker::doWork(S32 param) if (mState == LOAD_FROM_NETWORK) { - static LLCachedControl image_pipeline_use_http("ImagePipelineUseHTTP",false); + static const LLCachedControl image_pipeline_use_http("ImagePipelineUseHTTP",false); bool get_url = image_pipeline_use_http; if (!mUrl.empty()) get_url = false; // if (mHost != LLHost::invalid) get_url = false; @@ -1606,7 +1606,7 @@ S32 LLTextureFetch::update(U32 max_time_ms) { S32 res; - static LLCachedControl throttle_bandwidth_kbps("ThrottleBandwidthKBPS",500); + static const LLCachedControl throttle_bandwidth_kbps("ThrottleBandwidthKBPS",500); mMaxBandwidth = throttle_bandwidth_kbps; res = LLWorkerThread::update(max_time_ms); diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp index c246cd5e4..375a84c9e 100644 --- a/indra/newview/lltoolfocus.cpp +++ b/indra/newview/lltoolfocus.cpp @@ -216,7 +216,7 @@ void LLToolCamera::pickCallback(const LLPickInfo& pick_info) gAgent.setFocusGlobal(pick_info); } - static LLCachedControl freeze_time("FreezeTime",0); + static const LLCachedControl freeze_time("FreezeTime",0); if (!(pick_info.mKeyMask & MASK_ALT) && gAgent.cameraThirdPerson() && gViewerWindow->getLeftMouseDown() && diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp index 993219723..021b6364f 100644 --- a/indra/newview/lltoolmgr.cpp +++ b/indra/newview/lltoolmgr.cpp @@ -239,7 +239,7 @@ bool LLToolMgr::inBuildMode() // when entering mouselook inEdit() immediately returns true before // cameraMouselook() actually starts returning true. Also, appearance edit // sets build mode to true, so let's exclude that. - static LLCachedControl build_btn_state("BuildBtnState",false); + static const LLCachedControl build_btn_state("BuildBtnState",false); bool b=(inEdit() && build_btn_state && !gAgent.cameraMouselook() diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 713da4e32..9f9df1b45 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -114,24 +114,24 @@ void init_audio() void audio_update_volume(bool force_update) { - static LLCachedControl master_volume("AudioLevelMaster",1.0); - static LLCachedControl audio_level_sfx("AudioLevelSFX",1.0); - static LLCachedControl audio_level_ui("AudioLevelUI",1.0); - static LLCachedControl audio_level_ambient("AudioLevelAmbient",1.0); - static LLCachedControl audio_level_music("AudioLevelMusic",1.0); - static LLCachedControl audio_level_media("AudioLevelMedia",1.0); - static LLCachedControl audio_level_voice("AudioLevelVoice",1.0); - static LLCachedControl audio_level_mic("AudioLevelMic",1.0); - static LLCachedControl _mute_audio("MuteAudio",false); - static LLCachedControl mute_sounds("MuteSounds",false); - static LLCachedControl mute_ui("MuteUI",false); - static LLCachedControl mute_ambient("MuteAmbient",false); - static LLCachedControl mute_music("MuteMusic",false); - static LLCachedControl mute_media("MuteMedia",false); - static LLCachedControl mute_voice("MuteVoice",false); - static LLCachedControl mute_when_minimized("MuteWhenMinimized",true); - static LLCachedControl audio_level_doppler("AudioLevelDoppler",1.0); - static LLCachedControl audio_level_rolloff("AudioLevelRolloff",1.0); + static const LLCachedControl master_volume("AudioLevelMaster",1.0); + static const LLCachedControl audio_level_sfx("AudioLevelSFX",1.0); + static const LLCachedControl audio_level_ui("AudioLevelUI",1.0); + static const LLCachedControl audio_level_ambient("AudioLevelAmbient",1.0); + static const LLCachedControl audio_level_music("AudioLevelMusic",1.0); + static const LLCachedControl audio_level_media("AudioLevelMedia",1.0); + static const LLCachedControl audio_level_voice("AudioLevelVoice",1.0); + static const LLCachedControl audio_level_mic("AudioLevelMic",1.0); + static const LLCachedControl _mute_audio("MuteAudio",false); + static const LLCachedControl mute_sounds("MuteSounds",false); + static const LLCachedControl mute_ui("MuteUI",false); + static const LLCachedControl mute_ambient("MuteAmbient",false); + static const LLCachedControl mute_music("MuteMusic",false); + static const LLCachedControl mute_media("MuteMedia",false); + static const LLCachedControl mute_voice("MuteVoice",false); + static const LLCachedControl mute_when_minimized("MuteWhenMinimized",true); + static const LLCachedControl audio_level_doppler("AudioLevelDoppler",1.0); + static const LLCachedControl audio_level_rolloff("AudioLevelRolloff",1.0); BOOL mute_audio = _mute_audio; if (!gViewerWindow->getActive() && mute_when_minimized) { @@ -228,7 +228,7 @@ void audio_update_wind(bool force_update) // if (force_update || (last_camera_water_height * camera_water_height) < 0.f) { - static LLCachedControl audio_level_rolloff("AudioLevelRolloff",1); + static const LLCachedControl audio_level_rolloff("AudioLevelRolloff",1); if (camera_water_height < 0.f) { gAudiop->setRolloffFactor(audio_level_rolloff * LL_ROLLOFF_MULTIPLIER_UNDER_WATER); @@ -246,10 +246,10 @@ 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. - static LLCachedControl mute_audio("MuteAudio",false); - static LLCachedControl mute_ambient("MuteAmbient",false); - static LLCachedControl audio_level_master("AudioLevelMaster",1); - static LLCachedControl audio_level_ambient("AudioLevelAmbient",1); + static const LLCachedControl mute_audio("MuteAudio",false); + static const LLCachedControl mute_ambient("MuteAmbient",false); + static const LLCachedControl audio_level_master("AudioLevelMaster",1); + static const LLCachedControl audio_level_ambient("AudioLevelAmbient",1); F32 master_volume = mute_audio ? 0.f : mute_ambient; F32 ambient_volume = mute_ambient ? 0.f : audio_level_ambient; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 924f7e056..351d4ea9b 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -665,16 +665,12 @@ void settings_setup_listeners() gSavedSettings.getControl("SkyUseClassicClouds")->getSignal()->connect(boost::bind(&handleCloudSettingsChanged, _1)); gSavedSettings.getControl("AscentStoreSettingsPerAccount")->getSignal()->connect(boost::bind(&handleAscentCOAChange,_1)); - gSavedSettings.getControl("AscentShowSelfTag")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1)); - gSavedSettings.getControl("AscentShowSelfTagColor")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1)); gSavedSettings.getControl("AscentUseTag")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1)); gCOASavedSettings->getControl("AscentUseCustomTag")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1)); gCOASavedSettings->getControl("AscentCustomTagColor")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1)); gCOASavedSettings->getControl("AscentCustomTagLabel")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1)); gCOASavedSettings->getControl("AscentReportClientUUID")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1)); gSavedSettings.getControl("AscentShowFriendsTag")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1)); - gSavedSettings.getControl("AscentShowOthersTag")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1)); - gSavedSettings.getControl("AscentShowOthersTagColor")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1)); gSavedSettings.getControl("AscentUseStatusColors")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1)); } diff --git a/indra/newview/llviewercontrol.h b/indra/newview/llviewercontrol.h index 405c49f9b..18638d779 100644 --- a/indra/newview/llviewercontrol.h +++ b/indra/newview/llviewercontrol.h @@ -54,7 +54,7 @@ extern std::map gSettings; void create_graphics_group(LLControlGroup& group); // saved at end of session -extern LLControlGroup *gCOASavedSettings; +// gSavedSettings and gCOASavedSettings moved to llcontrol.h extern LLControlGroup gSavedPerAccountSettings; // Read-only diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index f58dd23e9..82b10bda2 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2784,7 +2784,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) if (!is_muted && !is_busy) { - static LLCachedControl use_chat_bubbles("UseChatBubbles",false); + static const LLCachedControl use_chat_bubbles("UseChatBubbles",false); visible_in_chat_bubble = use_chat_bubbles; ((LLVOAvatar*)chatter)->addChat(chat); } diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index d5ad0d3bb..44fa54177 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -728,7 +728,7 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) } } - static LLCachedControl freeze_time("FreezeTime",0); + static const LLCachedControl freeze_time("FreezeTime",0); if (freeze_time) { for (std::vector::iterator iter = idle_list.begin(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index ef4bb8bc9..0d4e8b0be 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -518,7 +518,7 @@ public: ypos += y_inc; } // only display these messages if we are actually rendering beacons at this moment - static LLCachedControl beacon_always_on("BeaconAlwaysOn",false); + static const LLCachedControl 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 display_timecode("DisplayTimecode",false); + static const LLCachedControl display_timecode("DisplayTimecode",false); if (display_timecode) { // draw timecode block @@ -2763,7 +2763,7 @@ BOOL LLViewerWindow::handlePerFrameHover() LLVector2 mouse_vel; - static LLCachedControl mouse_smooth("MouseSmooth",false); + static const LLCachedControl 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 tool_tip_delay("ToolTipDelay",.7f); + static const LLCachedControl 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 drag_and_drop_tool_tip_delay("DragAndDropToolTipDelay",.1f); + static const LLCachedControl 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 freeze_time("FreezeTime",0); + static const LLCachedControl 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 chat_bar_steals_focus("ChatBarStealsFocus",true); + static const LLCachedControl 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 picks_moving("PicksPerSecondMouseMoving",5.f); - static LLCachedControl picks_stationary("PicksPerSecondMouseStationary",0.f); + static const LLCachedControl picks_moving("PicksPerSecondMouseMoving",5.f); + static const LLCachedControl 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 chat_full_width("ChatFullWidth",true); + static const LLCachedControl chat_full_width("ChatFullWidth",true); if (chat_full_width) { console_rect.mRight -= CONSOLE_PADDING_RIGHT; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index ab1a4934a..e02b1fdb5 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -763,6 +763,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mNameMute(FALSE), mRenderGroupTitles(sRenderGroupTitles), mNameAppearance(FALSE), + mRenderTag(FALSE), mLastRegionHandle(0), mRegionCrossingCount(0), mFirstTEMessageReceived( FALSE ), @@ -3468,22 +3469,24 @@ void LLVOAvatar::getClientInfo(std::string& client, LLColor4& color, BOOL useCom if (!getTE(TEX_HEAD_BODYPAINT)) return; std::string uuid_str = getTE(TEX_HEAD_BODYPAINT)->getID().asString(); //UUID of the head texture + + static const LLCachedControl avatar_name_color("AvatarNameColor",LLColor4(LLColor4U(251, 175, 93, 255)), gColors ); if (mIsSelf) { - BOOL showCustomTag = gCOASavedSettings->getBOOL("AscentUseCustomTag"); - if (!gSavedSettings.getBOOL("AscentShowSelfTagColor")) + static const LLCachedCOAControl ascent_use_custom_tag("AscentUseCustomTag", false); + static const LLCachedCOAControl ascent_custom_tag_color("AscentCustomTagColor", LLColor4(.5f,1.f,.25f,1.f)); + static const LLCachedCOAControl ascent_custom_tag_label("AscentCustomTagLabel","custom"); + static const LLCachedControl ascent_use_tag("AscentUseTag",true); + static const LLCachedCOAControl ascent_report_client_uuid("AscentReportClientUUID","8873757c-092a-98fb-1afd-ecd347566fcd"); + + if (ascent_use_custom_tag) { - color = gColors.getColor( "AvatarNameColor" ); + color = ascent_custom_tag_color; + client = ascent_custom_tag_label; return; } - else if (showCustomTag) - { - color = gCOASavedSettings->getColor4("AscentCustomTagColor"); - client = gCOASavedSettings->getString("AscentCustomTagLabel"); - return; - } - else if (gSavedSettings.getBOOL("AscentUseTag")) - uuid_str = gCOASavedSettings->getString("AscentReportClientUUID"); + else if (ascent_use_tag) + uuid_str = ascent_report_client_uuid; } if(getTEImage(TEX_HEAD_BODYPAINT)->getID() == IMG_DEFAULT_AVATAR) { @@ -3523,7 +3526,7 @@ void LLVOAvatar::getClientInfo(std::string& client, LLColor4& color, BOOL useCom && getTEImage(TEX_UPPER_BODYPAINT)->getID().asString() == "4934f1bf-3b1f-cf4f-dbdf-a72550d05bc6" && getTEImage(TEX_LOWER_BODYPAINT)->getID().asString() == "4934f1bf-3b1f-cf4f-dbdf-a72550d05bc6") { - color = gColors.getColor( "AvatarNameColor" ); + color = avatar_name_color; client = "?"; } return; @@ -3557,17 +3560,12 @@ void LLVOAvatar::getClientInfo(std::string& client, LLColor4& color, BOOL useCom } else { - color = gColors.getColor( "AvatarNameColor" ); + color = avatar_name_color; color.setAlpha(1.f); client = "?"; //llinfos << "Apparently this tag isn't registered: " << uuid_str << llendl; } - if ((mIsSelf)&&(!gSavedSettings.getBOOL("AscentShowSelfTagColor"))) - { - color = gColors.getColor( "AvatarNameColor" ); - } - if (false) //We'll remove this entirely eventually, but it's useful information if we're going to try for the new client tag idea. -HgB //if(useComment) @@ -3614,17 +3612,24 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) } const F32 time_visible = mTimeVisible.getElapsedTimeF32(); - static LLCachedControl NAME_SHOW_TIME("RenderNameShowTime",10); // seconds - static LLCachedControl FADE_DURATION("RenderNameFadeDuration",1); // seconds - static LLCachedControl use_chat_bubbles("UseChatBubbles",false); - static LLCachedControl render_name_hide_self("RenderNameHideSelf",false); - + static const LLCachedControl NAME_SHOW_TIME("RenderNameShowTime",10); // seconds + static const LLCachedControl FADE_DURATION("RenderNameFadeDuration",1); // seconds + static const LLCachedControl use_chat_bubbles("UseChatBubbles",false); + static const LLCachedControl render_name_hide_self("RenderNameHideSelf",false); + static const LLCachedControl avatar_name_color("AvatarNameColor",LLColor4(LLColor4U(251, 175, 93, 255)), gColors ); + static const LLCachedControl ascent_show_self_tag("AscentShowSelfTag",true); + static const LLCachedControl ascent_show_self_tag_color("AscentShowSelfTagColor",true); + static const LLCachedControl ascent_show_others_tag("AscentShowOthersTag",true); + static const LLCachedControl ascent_show_others_tag_color("AscentShowOthersTagColor",true); + BOOL visible_avatar = isVisible() || mNeedsAnimUpdate; BOOL visible_chat = use_chat_bubbles && (mChats.size() || mTyping); BOOL render_name = visible_chat || (visible_avatar && ((sRenderName == RENDER_NAME_ALWAYS) || (sRenderName == RENDER_NAME_FADE && time_visible < NAME_SHOW_TIME))); + + BOOL tag_changed = FALSE; // If it's your own avatar, don't draw in mouselook, and don't // draw if we're specifically hiding our own name. if (mIsSelf) @@ -3649,10 +3654,6 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) new_name = TRUE; } - - // - std::string client; - // // First Calculate Alpha // If alpha > 0, create mNameText if necessary, otherwise delete it { @@ -3692,11 +3693,10 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) new_name = TRUE; } - LLColor4 avatar_name_color = gColors.getColor( "AvatarNameColor" ); //As pointed out by Zwagoth, we really shouldn't be doing this per-frame. Skip if we already have the data. -HgB if (mClientTag == "") { - mClientColor = gColors.getColor( "AvatarNameColor" ); + mClientColor = avatar_name_color; if(isFullyLoaded()) { //Zwagoth's new client identification - HgB @@ -3722,65 +3722,73 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) llinfos << "Using Emerald-style client identifier." << llendl; //The old client identification. Used only if the new method doesn't exist, so that it isn't automatically overwritten. -HgB getClientInfo(mClientTag,mClientColor); - if(mClientTag == "") - client = "?"; //prevent console spam.. } + if(mClientTag == "") //Failed to resolve. Don't try again unless something's changed. + mClientTag = "?"; //prevent console spam.. + tag_changed = TRUE; } // Overwrite the tag/color shit yet again if we want to see // friends in a special color. -- charbl - if (LLAvatarTracker::instance().getBuddyInfo(this->getID()) != NULL) { - if (gSavedSettings.getBOOL("AscentShowFriendsTag")) + static const LLCachedControl ascent_show_friends_tag("AscentShowFriendsTag",true); + if (ascent_show_friends_tag && LLAvatarTracker::instance().getBuddyInfo(this->getID()) != NULL) { mClientTag = "Friend"; + tag_changed = TRUE; } } - if (!mIsSelf && gSavedSettings.getBOOL("AscentUseStatusColors")) + if (!mIsSelf) { - LLViewerRegion* parent_estate = LLWorld::getInstance()->getRegionFromPosGlobal(this->getPositionGlobal()); - LLUUID estate_owner = LLUUID::null; - if(parent_estate && parent_estate->isAlive()) + static const LLCachedControl ascent_use_status_colors("AscentUseStatusColors",true); + if ( ascent_use_status_colors) { - estate_owner = parent_estate->getOwner(); - } - - //Lindens are always more Linden than your friend, make that take precedence - if(LLMuteList::getInstance()->isLinden(getFullname())) - { - mClientColor = gCOASavedSettings->getColor4("AscentLindenColor").getValue(); - } - //check if they are an estate owner at their current position - else if(estate_owner.notNull() && this->getID() == estate_owner) - { - mClientColor = gCOASavedSettings->getColor4("AscentEstateOwnerColor").getValue(); - } - //without these dots, SL would suck. - else if (LLAvatarTracker::instance().getBuddyInfo(this->getID()) != NULL) - { - mClientColor = gCOASavedSettings->getColor4("AscentFriendColor"); - } - //big fat jerkface who is probably a jerk, display them as such. - else if(LLMuteList::getInstance()->isMuted(this->getID())) - { - mClientColor = gCOASavedSettings->getColor4("AscentMutedColor").getValue(); + LLViewerRegion* parent_estate = LLWorld::getInstance()->getRegionFromPosGlobal(this->getPositionGlobal()); + LLUUID estate_owner = LLUUID::null; + if(parent_estate && parent_estate->isAlive()) + { + estate_owner = parent_estate->getOwner(); + } + + //Lindens are always more Linden than your friend, make that take precedence + if(LLMuteList::getInstance()->isLinden(getFullname())) + { + static const LLCachedCOAControl ascent_linden_color("AscentLindenColor",LLColor4(0.f,0.f,1.f,1.f)); + mClientColor = ascent_linden_color; + } + //check if they are an estate owner at their current position + else if(estate_owner.notNull() && this->getID() == estate_owner) + { + static const LLCachedCOAControl ascent_estate_owner_color("AscentEstateOwnerColor",LLColor4(1.f,0.6f,1.f,1.f)); + mClientColor = ascent_estate_owner_color; + } + //without these dots, SL would suck. + else if (LLAvatarTracker::instance().getBuddyInfo(this->getID()) != NULL) + { + static const LLCachedCOAControl ascent_friend_color("AscentFriendColor",LLColor4(1.f,1.f,0.f,1.f)); + mClientColor = ascent_friend_color; + } + //big fat jerkface who is probably a jerk, display them as such. + else if(LLMuteList::getInstance()->isMuted(this->getID())) + { + static const LLCachedCOAControl ascent_muted_color("AscentMutedColor",LLColor4(0.7f,0.7f,0.7f,1.f)); + mClientColor = ascent_muted_color; + } } } } - - client = mClientTag; - if ((mIsSelf && gSavedSettings.getBOOL("AscentShowSelfTagColor")) - || (!mIsSelf && gSavedSettings.getBOOL("AscentShowOthersTagColor"))) - avatar_name_color = mClientColor; + LLColor4 final_name_color(avatar_name_color); - avatar_name_color.setAlpha(alpha); + if ( (mIsSelf && ascent_show_self_tag_color) || (!mIsSelf && ascent_show_others_tag_color) ) + final_name_color = mClientColor; + + final_name_color.setAlpha(alpha); //llinfos << "Show Self Tag is set to " << gSavedSettings.getBOOL("AscentShowSelfTagColor") << llendl; - mNameText->setColor(avatar_name_color); + mNameText->setColor(final_name_color); - LLQuaternion root_rot = mRoot.getWorldRotation(); mNameText->setUsePixelSize(TRUE); LLVector3 pixel_right_vec; @@ -3822,16 +3830,10 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) if(mNameBusy && ! is_busy) mIdleTimer.reset(); BOOL is_appearance = mSignaledAnimations.find(ANIM_AGENT_CUSTOMIZE) != mSignaledAnimations.end(); if(mNameAppearance && ! is_appearance) mIdleTimer.reset(); - BOOL is_muted; - if (mIsSelf) - { - is_muted = FALSE; - } - else - { - is_muted = LLMuteList::getInstance()->isMuted(getID()); - - } + BOOL is_muted = !mIsSelf && LLMuteList::getInstance()->isMuted(getID()); + + //Is client-tagging enabled for this av? + BOOL render_tag = (((mIsSelf && ascent_show_self_tag) || (!mIsSelf && ascent_show_others_tag))); if (mNameString.empty() || new_name || @@ -3839,13 +3841,12 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) (title && mTitle != title->getString()) || (is_away != mNameAway || is_busy != mNameBusy || is_muted != mNameMute) || is_appearance != mNameAppearance - || client.length() ) // + || tag_changed //mClientTag was just set. + || (mRenderTag != render_tag) //tag setting is dirty. Need to update mNameString. + ) { std::string line; - - - if (!sRenderGroupTitles) { // If all group titles are turned off, stack first name @@ -3868,24 +3869,14 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) line += " "; line += lastname->getString(); - - - - - - std::string additions; - BOOL need_comma = FALSE; - - if (client.length() || is_away || is_muted || is_busy) + if (render_tag || is_away || is_muted || is_busy) { - if ((client != "")&&(client != "?")) + std::string additions; + BOOL need_comma = FALSE; + if (render_tag && !mClientTag.empty() && mClientTag != "?") { - if ((mIsSelf && gSavedSettings.getBOOL("AscentShowSelfTag")) - || (!mIsSelf && gSavedSettings.getBOOL("AscentShowOthersTag"))) - { - additions += client; - need_comma = TRUE; - } + additions += mClientTag; + need_comma = TRUE; } if (is_away) { @@ -3923,7 +3914,9 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) line += "\n"; line += "(Editing Appearance)"; } - if(!mIsSelf && mIdleTimer.getElapsedTimeF32() > 120 && gSavedSettings.getBOOL("AscentShowIdleTime")) + + static const LLCachedControl ascent_show_idle_time("AscentShowIdleTime",true); + if(!mIsSelf && ascent_show_idle_time && mIdleTimer.getElapsedTimeF32() > 120 ) { line += "\n"; line += getIdleTime(); @@ -3933,6 +3926,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) mNameBusy = is_busy; mNameMute = is_muted; mNameAppearance = is_appearance; + mRenderTag = render_tag; mTitle = title ? title->getString() : ""; LLStringFn::replace_ascii_controlchars(mTitle,LL_UNKNOWN_CHAR); mNameString = utf8str_to_wstring(line); @@ -3956,7 +3950,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(avatar_name_color); 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) @@ -4018,7 +4012,8 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) } else { - if (gSavedSettings.getBOOL("SmallAvatarNames")) + static const LLCachedControl small_avatar_names("SmallAvatarNames",false); + if (small_avatar_names) { mNameText->setFont(LLFontGL::getFontSansSerif()); } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 08077c7cd..f4863c60c 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -719,6 +719,7 @@ private: BOOL mNameBusy; BOOL mNameMute; BOOL mNameAppearance; + BOOL mRenderTag; BOOL mVisibleChat; BOOL mRenderGroupTitles; diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 77f3fc4a0..8fa0831f8 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -5867,8 +5867,8 @@ void LLVoiceClient::setVoiceEnabled(bool enabled) bool LLVoiceClient::voiceEnabled() { - static LLCachedControl enable_voice_chat("EnableVoiceChat",false); - static LLCachedControl cmd_line_disable_voice("CmdLineDisableVoice",false); + static const LLCachedControl enable_voice_chat("EnableVoiceChat",false); + static const LLCachedControl cmd_line_disable_voice("CmdLineDisableVoice",false); return enable_voice_chat && !cmd_line_disable_voice; } diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 14edd3b09..0b109df1b 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -1023,7 +1023,7 @@ 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. - static LLCachedControl render_sun_dynamic_range("RenderSunDynamicRange", 1); + static const LLCachedControl render_sun_dynamic_range("RenderSunDynamicRange", 1); F32 sun_dynamic_range = llmax((float)render_sun_dynamic_range, 0.0001f); LLWLParamManager::instance()->mSceneLightStrength = 2.0f * (1.0f + sun_dynamic_range * dp); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 8a2e6cf1b..9b304a341 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2220,8 +2220,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) std::vector alpha_faces; U32 useage = group->mSpatialPartition->mBufferUsage; - static LLCachedControl render_max_vbo_size("RenderMaxVBOSize", 512); - static LLCachedControl render_max_node_size("RenderMaxNodeSize",8192); + static const LLCachedControl render_max_vbo_size("RenderMaxVBOSize", 512); + static const LLCachedControl render_max_node_size("RenderMaxNodeSize",8192); U32 max_vertices = (render_max_vbo_size*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); U32 max_total = (render_max_node_size*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); max_vertices = llmin(max_vertices, (U32) 65535); @@ -2503,7 +2503,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector& faces, BOOL distance_sort) { //calculate maximum number of vertices to store in a single buffer - static LLCachedControl render_max_vbo_size("RenderMaxVBOSize", 512); + static const LLCachedControl render_max_vbo_size("RenderMaxVBOSize", 512); U32 max_vertices = (render_max_vbo_size*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); max_vertices = llmin(max_vertices, (U32) 65535); diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index cb83cb43b..b9b4a2ca8 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -655,8 +655,8 @@ void LLWorld::updateParticles() void LLWorld::updateClouds(const F32 dt) { - static LLCachedControl freeze_time("FreezeTime",false); - static LLCachedControl sky_use_classic_clouds("SkyUseClassicClouds",false); + static const LLCachedControl freeze_time("FreezeTime",false); + static const LLCachedControl sky_use_classic_clouds("SkyUseClassicClouds",false); if (freeze_time || !sky_use_classic_clouds) { diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 9504cb2a0..a2cb74388 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1020,7 +1020,7 @@ U32 LLPipeline::addObject(LLViewerObject *vobj) return 0; } - static LLCachedControl render_delay_creation("RenderDelayCreation",false); + static const LLCachedControl render_delay_creation("RenderDelayCreation",false); if (render_delay_creation) { mCreateQ.push_back(vobj); @@ -1084,7 +1084,7 @@ void LLPipeline::createObject(LLViewerObject* vobj) markRebuild(drawablep, LLDrawable::REBUILD_ALL, TRUE); - static LLCachedControl render_animate_res("RenderAnimateRes",false); + static const LLCachedControl render_animate_res("RenderAnimateRes",false); if (drawablep->getVOVolume() && render_animate_res) { // fun animated res @@ -1124,7 +1124,7 @@ void LLPipeline::resetFrameStats() //external functions for asynchronous updating void LLPipeline::updateMoveDampedAsync(LLDrawable* drawablep) { - static LLCachedControl freeze_time("FreezeTime",false); + static const LLCachedControl freeze_time("FreezeTime",false); if (freeze_time) { return; @@ -1155,7 +1155,7 @@ void LLPipeline::updateMoveDampedAsync(LLDrawable* drawablep) void LLPipeline::updateMoveNormalAsync(LLDrawable* drawablep) { - static LLCachedControl freeze_time("FreezeTime",false); + static const LLCachedControl freeze_time("FreezeTime",false); if (freeze_time) { return; @@ -1209,7 +1209,7 @@ void LLPipeline::updateMove() LLFastTimer t(LLFastTimer::FTM_UPDATE_MOVE); LLMemType mt(LLMemType::MTYPE_PIPELINE); - static LLCachedControl freeze_time("FreezeTime",false); + static const LLCachedControl freeze_time("FreezeTime",false); if (freeze_time) { return; @@ -2301,7 +2301,7 @@ void LLPipeline::postSort(LLCamera& camera) } // 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 - static LLCachedControl beacon_always_on("BeaconAlwaysOn",false); + static const LLCachedControl beacon_always_on("BeaconAlwaysOn",false); if (beacon_always_on && !sShadowRender) { if (sRenderScriptedTouchBeacons) @@ -5424,14 +5424,14 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index) } shader.uniform4fv("shadow_clip", 1, mSunClipPlanes.mV); - static LLCachedControl render_deferred_sun_wash("RenderDeferredSunWash",.5f); - static LLCachedControl render_shadow_noise("RenderShadowNoise",-.0001f); - static LLCachedControl render_shadow_blur_size("RenderShadowBlurSize",.7f); - static LLCachedControl render_ssao_scale("RenderSSAOScale",500); - static LLCachedControl render_ssao_max_scale("RenderSSAOMaxScale",60); - static LLCachedControl render_ssao_factor("RenderSSAOFactor",.3f); - static LLCachedControl render_ssao_effect("RenderSSAOEffect",LLVector3(.4f,1,0)); - static LLCachedControl render_deferred_alpha_soft("RenderDeferredAlphaSoften",.75f); + static const LLCachedControl render_deferred_sun_wash("RenderDeferredSunWash",.5f); + static const LLCachedControl render_shadow_noise("RenderShadowNoise",-.0001f); + static const LLCachedControl render_shadow_blur_size("RenderShadowBlurSize",.7f); + static const LLCachedControl render_ssao_scale("RenderSSAOScale",500); + static const LLCachedControl render_ssao_max_scale("RenderSSAOMaxScale",60); + static const LLCachedControl render_ssao_factor("RenderSSAOFactor",.3f); + static const LLCachedControl render_ssao_effect("RenderSSAOEffect",LLVector3(.4f,1,0)); + static const LLCachedControl render_deferred_alpha_soft("RenderDeferredAlphaSoften",.75f); shader.uniform1f("sun_wash", render_deferred_sun_wash); shader.uniform1f("shadow_noise", render_shadow_noise);