diff --git a/indra/newview/alcontrolcache.cpp b/indra/newview/alcontrolcache.cpp index eaf05a3bfdea7a93040fae5becaf2fb428798900..adfa6e435b6cdbddba41ef49cc2d5109e5c1638d 100644 --- a/indra/newview/alcontrolcache.cpp +++ b/indra/newview/alcontrolcache.cpp @@ -3,6 +3,9 @@ #include "alcontrolcache.h" #include "llviewercontrol.h" +bool ALControlCache::AutoSnapshot = false; +bool ALControlCache::AutomaticFly = true; +bool ALControlCache::DebugAvatarRezTime = false; bool ALControlCache::EditLinkedParts = false; F32 ALControlCache::GridDrawSize; F32 ALControlCache::GridOpacity; @@ -14,7 +17,10 @@ bool ALControlCache::MapShowLandForSale; bool ALControlCache::MapShowPeople; bool ALControlCache::MapShowTelehubs; bool ALControlCache::NavBarShowParcelProperties = true; +F32 ALControlCache::NearMeRange = 4096.f; U32 ALControlCache::PreferredMaturity; +bool ALControlCache::ShowAdultEvents; +bool ALControlCache::ShowMatureEvents; bool ALControlCache::SnapEnabled; S32 ALControlCache::ToastGap; @@ -46,6 +52,9 @@ S32 ALControlCache::ToastGap; void ALControlCache::initControls() { // Keep this list alphabatized. + DECLARE_CTRL_BOOL(AutoSnapshot); + DECLARE_CTRL_BOOL(AutomaticFly); + DECLARE_CTRL_BOOL(DebugAvatarRezTime); DECLARE_CTRL_BOOL(EditLinkedParts); DECLARE_CTRL_F32(GridDrawSize); DECLARE_CTRL_F32(GridOpacity); @@ -57,7 +66,10 @@ void ALControlCache::initControls() DECLARE_CTRL_BOOL(MapShowPeople); DECLARE_CTRL_BOOL(MapShowTelehubs); DECLARE_CTRL_BOOL(NavBarShowParcelProperties); + DECLARE_CTRL_F32(NearMeRange); DECLARE_CTRL_U32(PreferredMaturity); + DECLARE_CTRL_BOOL(ShowAdultEvents); + DECLARE_CTRL_BOOL(ShowMatureEvents); DECLARE_CTRL_BOOL(SnapEnabled); DECLARE_CTRL_S32(ToastGap); } diff --git a/indra/newview/alcontrolcache.h b/indra/newview/alcontrolcache.h index 596ca5b1b4ee339c7784275d0ee75f21d190f967..eb24ba7e23088f250ca11919e3181b7bdb9675c7 100644 --- a/indra/newview/alcontrolcache.h +++ b/indra/newview/alcontrolcache.h @@ -5,6 +5,9 @@ struct ALControlCache { static void initControls(); + static bool AutoSnapshot; + static bool AutomaticFly; + static bool DebugAvatarRezTime; static bool EditLinkedParts; static F32 GridDrawSize; static F32 GridOpacity; @@ -16,7 +19,10 @@ struct ALControlCache static bool MapShowPeople; static bool MapShowTelehubs; static bool NavBarShowParcelProperties; + static F32 NearMeRange; static U32 PreferredMaturity; + static bool ShowAdultEvents; + static bool ShowMatureEvents; static bool SnapEnabled; static S32 ToastGap; }; diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 147e7a291a6a0259741dd7fc35e844f78add0f07..d7937d861d535df6ebead77be95ed108dd8057f5 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -1934,7 +1934,7 @@ void LLAgent::propagate(const F32 dt) if (!in_air && gAgentCamera.getUpKey() < 0 && land_vel.magVecSquared() < MAX_VELOCITY_AUTO_LAND_SQUARED - && gSavedSettings.getBOOL("AutomaticFly")) + && ALControlCache::AutomaticFly) { // land automatically setFlying(FALSE); diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index f9f3f7921cd01a7ac0b1c349d22bea9386d82309..8fb69c60ec5c4a062d493f181c06b7d4ff3a9b49 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -312,7 +312,7 @@ void LLFloaterAvatarPicker::populateNearMe() near_me_scroller->deleteAllItems(); uuid_vec_t avatar_ids; - LLWorld::getInstance()->getAvatars(&avatar_ids, NULL, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange")); + LLWorld::getInstance()->getAvatars(&avatar_ids, NULL, gAgent.getPositionGlobal(), ALControlCache::NearMeRange); for(U32 i=0; i<avatar_ids.size(); i++) { LLUUID& av = avatar_ids[i]; diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 25e9cd50c5e52e99e5a4bc186eb8385f79dae477..6abe6450434083187dff2095ba1d457e2367880c 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1710,7 +1710,7 @@ void LLFloaterIMContainer::setNearbyDistances() // Get the positions of the nearby avatars and their ids std::vector<LLVector3d> positions; uuid_vec_t avatar_ids; - LLWorld::getInstance()->getAvatars(&avatar_ids, &positions, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange")); + LLWorld::getInstance()->getAvatars(&avatar_ids, &positions, gAgent.getPositionGlobal(), ALControlCache::NearMeRange); // Get the position of the agent const LLVector3d& me_pos = gAgent.getPositionGlobal(); // For each nearby avatar, compute and update the distance diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 5f89e868a424505fe4bb098b104c578b8381d1a0..19102fa5ab19b703f9a8f472997248c56c9e6c1e 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -415,7 +415,7 @@ void LLFloaterSnapshotBase::ImplBase::setNeedRefresh(bool need) if (!mFloater) return; // Don't display the "Refresh to save" message if we're in auto-refresh mode. - if (gSavedSettings.getBOOL("AutoSnapshot")) + if (ALControlCache::AutoSnapshot) { need = false; } @@ -429,7 +429,7 @@ void LLFloaterSnapshotBase::ImplBase::checkAutoSnapshot(LLSnapshotLivePreview* p { if (previewp) { - BOOL autosnap = gSavedSettings.getBOOL("AutoSnapshot"); + BOOL autosnap = ALControlCache::AutoSnapshot; LL_DEBUGS() << "updating " << (autosnap ? "snapshot" : "thumbnail") << LL_ENDL; previewp->updateSnapshot(autosnap, update_thumbnail, autosnap ? AUTO_SNAPSHOT_TIME_DELAY : 0.f); } diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 9975119c569f1b92b7c0dd9eefea26d9b19e34eb..325657745d5ceb03aa91fcba2fd7a51ed2e139fc 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -834,7 +834,7 @@ void LLPanelPeople::updateNearbyList() if (RlvActions::canShowNearbyAgents()) { // [/RLVa:KB] - LLWorld::getInstance()->getAvatars(&mNearbyList->getIDs(), &positions, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange")); + LLWorld::getInstance()->getAvatars(&mNearbyList->getIDs(), &positions, gAgent.getPositionGlobal(), ALControlCache::NearMeRange); // [RLVa:KB] - Checked: RLVa-2.0.3 } else @@ -1620,8 +1620,7 @@ bool LLPanelPeople::updateNearbyArrivalTime() { std::vector<LLVector3d> positions; std::vector<LLUUID> uuids; - static LLCachedControl<F32> range(gSavedSettings, "NearMeRange"); - LLWorld::getInstance()->getAvatars(&uuids, &positions, gAgent.getPositionGlobal(), range); + LLWorld::getInstance()->getAvatars(&uuids, &positions, gAgent.getPositionGlobal(), ALControlCache::NearMeRange); LLRecentPeople::instance().updateAvatarsArrivalTime(uuids); return LLApp::isExiting(); } diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index e35cb764f379d2ad174725784facd11d4430b4aa..65d1b2f3391d3cce78981f890de3f9b3e4912b74 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -671,14 +671,14 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) LLVector3 new_camera_pos = LLViewerCamera::getInstance()->getOrigin(); LLQuaternion new_camera_rot = LLViewerCamera::getInstance()->getQuaternion(); if (previewp->mForceUpdateSnapshot || - (((gSavedSettings.getBOOL("AutoSnapshot") && LLView::isAvailable(previewp->mViewContainer)) || + (((ALControlCache::AutoSnapshot && LLView::isAvailable(previewp->mViewContainer)) || (LLPipeline::FreezeTime && previewp->mAllowFullScreenPreview)) && (new_camera_pos != previewp->mCameraPos || dot(new_camera_rot, previewp->mCameraRot) < 0.995f))) { previewp->mCameraPos = new_camera_pos; previewp->mCameraRot = new_camera_rot; // request a new snapshot whenever the camera moves, with a time delay - BOOL new_snapshot = gSavedSettings.getBOOL("AutoSnapshot") || previewp->mForceUpdateSnapshot; + BOOL new_snapshot = ALControlCache::AutoSnapshot || previewp->mForceUpdateSnapshot; LL_DEBUGS() << "camera moved, updating thumbnail" << LL_ENDL; previewp->updateSnapshot( new_snapshot, // whether a new snapshot is needed or merely invalidate the existing one diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 1df0820e9263aeee713102dfcd41d0df0624b553..fe0134e9d31d53fa7e3b1c8a22b029113fc31d4a 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -1699,7 +1699,7 @@ void LLTextureCtrl::draw() } // Optionally show more detailed information. - if (gSavedSettings.getBOOL("DebugAvatarRezTime")) + if (ALControlCache::DebugAvatarRezTime) { LLFontGL* font = LLFontGL::getFontSansSerif(); std::string tdesc; diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 0d2edc0268e2be3382e1869830523b2f7574b5c4..2a122fe8d12e9a96653b7d4d327046db8268ffb4 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -409,7 +409,7 @@ class LLAvatarTexBar : public LLView void LLAvatarTexBar::draw() { - if (!gSavedSettings.getBOOL("DebugAvatarRezTime")) return; + if (!ALControlCache::DebugAvatarRezTime) return; LLVOAvatarSelf* avatarp = gAgentAvatarp; if (!avatarp) return; @@ -465,7 +465,7 @@ LLRect LLAvatarTexBar::getRequiredRect() { LLRect rect; rect.mTop = 100; - if (!gSavedSettings.getBOOL("DebugAvatarRezTime")) rect.mTop = 0; + if (!ALControlCache::DebugAvatarRezTime) rect.mTop = 0; return rect; } diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index 06e1e64300527a18a9772fdee8bbef7f879903ff..82cbcb86ac0479d35867ece6bd4e1774c015a933 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -395,7 +395,7 @@ void LLViewerJoystick::agentFly(F32 inc) if (! (gAgent.getFlying() || !gAgent.canFly() || gAgent.upGrabbed() || - !gSavedSettings.getBOOL("AutomaticFly")) ) + !ALControlCache::AutomaticFly) ) { gAgent.setFlying(true); } @@ -625,7 +625,7 @@ void LLViewerJoystick::moveAvatar(bool reset) // jump (as the up/down axis already controls flying) if on the // ground, or cease flight if already flying. // If AutomaticFly is disabled, then button1 toggles flying. - if (gSavedSettings.getBOOL("AutomaticFly")) + if (ALControlCache::AutomaticFly) { if (!gAgent.getFlying()) { diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 952c80ad40f1fc732339a2789465b38b753c4ea3..9dc521c3563abd6fe4d21709760b93edbf20e0e1 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -76,7 +76,7 @@ void agent_jump( EKeystate s ) if( time < FLY_TIME || frame_count <= FLY_FRAMES || gAgent.upGrabbed() - || !gSavedSettings.getBOOL("AutomaticFly")) + || !ALControlCache::AutomaticFly) { gAgent.moveUp(1); } diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp index cdcaff8015c9dacf8d649c66058cb7ee29b6da33..6e630577792ce166bbf51d0a096f84986706596c 100644 --- a/indra/newview/llviewertexlayer.cpp +++ b/indra/newview/llviewertexlayer.cpp @@ -237,7 +237,7 @@ void LLViewerTexLayerSetBuffer::doUpdate() layer_set->getAvatar()->updateMeshTextures(); // Print out notification that we updated this texture. - if (gSavedSettings.getBOOL("DebugAvatarRezTime")) + if (ALControlCache::DebugAvatarRezTime) { const BOOL highest_lod = layer_set->isLocalTextureDataFinal(); const std::string lod_str = highest_lod ? "HighRes" : "LowRes"; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 01777d63d5f7e34a6788fd5f8aead2f0a5ff662d..f60d318aa2775146eedabb02fa1265d02499fdc5 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -775,7 +775,7 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c << " : " << comment << LL_ENDL; - if (gSavedSettings.getBOOL("DebugAvatarRezTime")) + if (ALControlCache::DebugAvatarRezTime) { LLSD args; args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32()); diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index a4b68c6d01cbb5a970192df68d3d1027ded8059e..aa9920d9e9c7a57ad77a57234a796809b229b771 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -416,7 +416,7 @@ void LLWorldMapView::draw() gGL.end(); } **********************/ - else if (gSavedSettings.getBOOL("MapShowLandForSale") && (level <= DRAW_LANDFORSALE_THRESHOLD)) + else if (ALControlCache::MapShowLandForSale && (level <= DRAW_LANDFORSALE_THRESHOLD)) { // Draw the overlay image "Land for Sale / Land for Auction" LLViewerFetchedTexture* overlayimage = info->getLandForSaleImage(); @@ -512,12 +512,12 @@ void LLWorldMapView::draw() gGL.setSceneBlendType(LLRender::BT_ALPHA); // Draw item infos if we're not zoomed out too much and there's something to draw - if ((level <= DRAW_SIMINFO_THRESHOLD) && (gSavedSettings.getBOOL("MapShowInfohubs") || - gSavedSettings.getBOOL("MapShowTelehubs") || - gSavedSettings.getBOOL("MapShowLandForSale") || - gSavedSettings.getBOOL("MapShowEvents") || - gSavedSettings.getBOOL("ShowMatureEvents") || - gSavedSettings.getBOOL("ShowAdultEvents"))) + if ((level <= DRAW_SIMINFO_THRESHOLD) && (ALControlCache::MapShowInfohubs || + ALControlCache::MapShowTelehubs || + ALControlCache::MapShowLandForSale || + ALControlCache::MapShowEvents || + ALControlCache::ShowMatureEvents || + ALControlCache::ShowAdultEvents)) { drawItems(); } @@ -549,7 +549,7 @@ void LLWorldMapView::draw() // Draw icons for the avatars in each region. // Drawn this after the current agent avatar so one can see nearby people - if (gSavedSettings.getBOOL("MapShowPeople") && (level <= DRAW_SIMINFO_THRESHOLD)) + if (ALControlCache::MapShowPeople && (level <= DRAW_SIMINFO_THRESHOLD)) { drawAgents(); } @@ -820,8 +820,8 @@ void LLWorldMapView::drawItems() bool mature_enabled = gAgent.canAccessMature(); bool adult_enabled = gAgent.canAccessAdult(); - BOOL show_mature = mature_enabled && gSavedSettings.getBOOL("ShowMatureEvents"); - BOOL show_adult = adult_enabled && gSavedSettings.getBOOL("ShowAdultEvents"); + BOOL show_mature = mature_enabled && ALControlCache::ShowMatureEvents; + BOOL show_adult = adult_enabled && ALControlCache::ShowAdultEvents; for (handle_list_t::iterator iter = mVisibleRegions.begin(); iter != mVisibleRegions.end(); ++iter) { @@ -832,17 +832,17 @@ void LLWorldMapView::drawItems() continue; } // Infohubs - if (gSavedSettings.getBOOL("MapShowInfohubs")) + if (ALControlCache::MapShowInfohubs) { drawGenericItems(info->getInfoHub(), sInfohubImage); } // Telehubs - if (gSavedSettings.getBOOL("MapShowTelehubs")) + if (ALControlCache::MapShowTelehubs) { drawGenericItems(info->getTeleHub(), sTelehubImage); } // Land for sale - if (gSavedSettings.getBOOL("MapShowLandForSale")) + if (ALControlCache::MapShowLandForSale) { drawGenericItems(info->getLandForSale(), sForSaleImage); // for 1.23, we're showing normal land and adult land in the same UI; you don't @@ -854,7 +854,7 @@ void LLWorldMapView::drawItems() } } // PG Events - if (gSavedSettings.getBOOL("MapShowEvents")) + if (ALControlCache::MapShowEvents) { drawGenericItems(info->getPGEvent(), sEventImage); } @@ -1518,11 +1518,11 @@ void LLWorldMapView::handleClick(S32 x, S32 y, MASK mask, // If the zoom level is not too far out already, test hits if (level <= DRAW_SIMINFO_THRESHOLD) { - bool show_mature = gAgent.canAccessMature() && gSavedSettings.getBOOL("ShowMatureEvents"); - bool show_adult = gAgent.canAccessAdult() && gSavedSettings.getBOOL("ShowAdultEvents"); + bool show_mature = gAgent.canAccessMature() && ALControlCache::ShowMatureEvents; + bool show_adult = gAgent.canAccessAdult() && ALControlCache::ShowAdultEvents; // Test hits if trackable data are displayed, otherwise, we don't even bother - if (gSavedSettings.getBOOL("MapShowEvents") || show_mature || show_adult || gSavedSettings.getBOOL("MapShowLandForSale")) + if (ALControlCache::MapShowEvents || show_mature || show_adult || ALControlCache::MapShowLandForSale) { // Iterate through the visible regions for (handle_list_t::iterator iter = mVisibleRegions.begin(); iter != mVisibleRegions.end(); ++iter) @@ -1534,7 +1534,7 @@ void LLWorldMapView::handleClick(S32 x, S32 y, MASK mask, continue; } // If on screen check hits with the visible item lists - if (gSavedSettings.getBOOL("MapShowEvents")) + if (ALControlCache::MapShowEvents) { LLSimInfo::item_info_list_t::const_iterator it = siminfo->getPGEvent().begin(); while (it != siminfo->getPGEvent().end()) @@ -1582,7 +1582,7 @@ void LLWorldMapView::handleClick(S32 x, S32 y, MASK mask, ++it; } } - if (gSavedSettings.getBOOL("MapShowLandForSale")) + if (ALControlCache::MapShowLandForSale) { LLSimInfo::item_info_list_t::const_iterator it = siminfo->getLandForSale().begin(); while (it != siminfo->getLandForSale().end())