Merge branch 'master' of git://github.com/Shyotl/SingularityViewer

# Conflicts:
#	indra/llcommon/llsd.cpp
#	indra/llcommon/llsdserialize.cpp
#	indra/newview/llspeakers.cpp
#	indra/newview/llviewermessage.cpp
This commit is contained in:
Liru Færs
2020-02-25 06:16:07 -05:00
48 changed files with 305 additions and 411 deletions

View File

@@ -734,11 +734,9 @@ void AISUpdate::parseUUIDArray(const LLSD& content, const std::string& name, uui
{
if (content.has(name))
{
for(LLSD::array_const_iterator it = content[name].beginArray(),
end = content[name].endArray();
it != end; ++it)
for (auto& id : content[name].array())
{
ids.insert((*it).asUUID());
ids.insert(id.asUUID());
}
}
}

View File

@@ -225,22 +225,20 @@ LLExperienceLog::~LLExperienceLog()
void LLExperienceLog::eraseExpired()
{
const auto& inst(*this); // Fixes Linux
std::vector<std::string> expired;
std::for_each(mEvents.beginMap(), mEvents.endMap(),
[&](const auto& event_pair)
{
const std::string& date = event_pair.first;
if (inst.isExpired(date))
{
for (const auto& event_pair : mEvents.map())
{
const std::string& date = event_pair.first;
if (isExpired(date))
{
expired.push_back(date);
}
});
}
}
for (const auto& date : expired)
{
mEvents.erase(date);
}
}
}
bool LLExperienceLog::isExpired(const std::string& date) const

View File

@@ -491,18 +491,18 @@ void LLFloaterExperienceProfile::setPreferences( const LLSD& content )
const LLSD& blocked = content["blocked"];
for(LLSD::array_const_iterator it = experiences.beginArray(); it != experiences.endArray() ; ++it)
for(const auto& exp : experiences.array())
{
if (it->asUUID()==mExperienceId)
if (exp.asUUID()==mExperienceId)
{
experienceAllowed();
return;
}
}
for(LLSD::array_const_iterator it = blocked.beginArray(); it != blocked.endArray() ; ++it)
for(const auto& exp : blocked.array())
{
if (it->asUUID()==mExperienceId)
if (exp.asUUID()==mExperienceId)
{
experienceBlocked();
return;
@@ -520,19 +520,17 @@ void LLFloaterExperienceProfile::onFieldChanged()
{
return;
}
LLSD::map_const_iterator st = mExperienceDetails.beginMap();
LLSD::map_const_iterator dt = mPackage.beginMap();
mDirty = false;
while(!mDirty && st != mExperienceDetails.endMap() && dt != mPackage.endMap())
mDirty = mPackage.size() != mExperienceDetails.size();
if (!mDirty)
{
mDirty = st->first != dt->first || st->second.asString() != dt->second.asString();
++st;++dt;
}
if (!mDirty && (st != mExperienceDetails.endMap() || dt != mPackage.endMap()))
{
mDirty = true;
LLSD::map_const_iterator st = mExperienceDetails.beginMap();
LLSD::map_const_iterator dt = mPackage.beginMap();
LLSD::map_const_iterator ste = mExperienceDetails.endMap();
LLSD::map_const_iterator dte = mPackage.endMap();
for (; st != ste && dt != dte; ++st, ++dt)
if (mDirty = st->first != dt->first || st->second.asString() != dt->second.asString())
break;
}
getChild<LLButton>(BTN_SAVE)->setEnabled(mDirty);
@@ -607,16 +605,15 @@ void LLFloaterExperienceProfile::onSaveComplete( const LLSD& content )
if (content.has("removed"))
{
const LLSD& removed = content["removed"];
LLSD::map_const_iterator it = removed.beginMap();
for(/**/; it != removed.endMap(); ++it)
for(const auto& it : removed.map())
{
const std::string& field = it->first;
const std::string& field = it.first;
if (field == LLExperienceCache::EXPERIENCE_ID)
{
//this message should be removed by the experience api
continue;
}
const LLSD& data = it->second;
const LLSD& data = it.second;
std::string error_tag = data["error_tag"].asString()+ "ExperienceProfileMessage";
LLSD fields;
if (LLNotificationTemplates::instance().templateExists(error_tag))
@@ -641,21 +638,21 @@ void LLFloaterExperienceProfile::onSaveComplete( const LLSD& content )
const LLSD& experiences = content["experience_keys"];
LLSD::array_const_iterator it = experiences.beginArray();
if (it == experiences.endArray())
{
if (experiences.size() == 0)
{
LL_WARNS() << "LLFloaterExperienceProfile::onSaveComplete called with empty content" << LL_ENDL;
return;
}
return;
}
if (!it->has(LLExperienceCache::EXPERIENCE_ID) || ((*it)[LLExperienceCache::EXPERIENCE_ID].asUUID() != id))
{
const auto& exp = experiences[0];
if (!exp.has(LLExperienceCache::EXPERIENCE_ID) || (exp[LLExperienceCache::EXPERIENCE_ID].asUUID() != id))
{
LL_WARNS() << "LLFloaterExperienceProfile::onSaveComplete called with unexpected experience id" << LL_ENDL;
return;
}
return;
}
refreshExperience(*it);
LLExperienceCache::instance().insert(*it);
refreshExperience(exp);
LLExperienceCache::instance().insert(exp);
LLExperienceCache::instance().fetch(id, true);
if (mSaveCompleteAction == VIEW)
@@ -872,14 +869,12 @@ bool LLFloaterExperienceProfile::hasPermission(const LLSD& content, const std::s
return false;
const LLSD& list = content[name];
LLSD::array_const_iterator it = list.beginArray();
while (it != list.endArray())
for (const auto& it : list.array())
{
if (it->asUUID() == test)
if (it.asUUID() == test)
{
return true;
}
++it;
}
return false;
}

View File

@@ -259,9 +259,9 @@ void LLFloaterExperiences::checkAndOpen(LLPanelExperiences* panel, const LLSD& c
if (mPrepurchaseIds.size() + 1 == response_ids.size())
{
// we have a new element
for (LLSD::array_const_iterator it = response_ids.beginArray(); it != response_ids.endArray(); ++it)
for (const auto& it : response_ids.array())
{
LLUUID experience_id = it->asUUID();
LLUUID experience_id = it.asUUID();
if (std::find(mPrepurchaseIds.begin(), mPrepurchaseIds.end(), experience_id) == mPrepurchaseIds.end())
{
// new element found, open it

View File

@@ -1681,12 +1681,9 @@ struct LLEstateAccessChangeInfo
{
mDialogName = sd["dialog_name"].asString();
mOperationFlag = (U32)sd["operation"].asInteger();
LLSD::array_const_iterator end_it = sd["allowed_ids"].endArray();
for (LLSD::array_const_iterator id_it = sd["allowed_ids"].beginArray();
id_it != end_it;
++id_it)
for (auto const& id : sd["allowed_ids"].array())
{
mAgentOrGroupIDs.push_back(id_it->asUUID());
mAgentOrGroupIDs.push_back(id.asUUID());
}
}
@@ -4267,9 +4264,9 @@ void LLPanelEstateAccess::onEstateAccessReceived(const LLSD& result)
const auto order = allowed_agent_name_list->getSortOrder();
allowed_agent_name_list->clearSortOrder();
allowed_agent_name_list->deleteAllItems();
for (LLSD::array_const_iterator it = result["AllowedAgents"].beginArray(); it != result["AllowedAgents"].endArray(); ++it)
for (auto const& entry : result["AllowedAgents"].array())
{
LLUUID id = (*it)["id"].asUUID();
LLUUID id = entry["id"].asUUID();
allowed_agent_name_list->addNameItem(id);
}
allowed_agent_name_list->setSortOrder(order);
@@ -4288,23 +4285,23 @@ void LLPanelEstateAccess::onEstateAccessReceived(const LLSD& result)
const auto order = banned_agent_name_list->getSortOrder();
banned_agent_name_list->clearSortOrder();
banned_agent_name_list->deleteAllItems();
for (LLSD::array_const_iterator it = result["BannedAgents"].beginArray(); it != result["BannedAgents"].endArray(); ++it)
for (auto const& entry : result["BannedAgents"].array())
{
LLSD item;
item["id"] = (*it)["id"].asUUID();
item["id"] = entry["id"].asUUID();
LLSD& columns = item["columns"];
columns[0]["column"] = "name"; // to be populated later
auto& col = columns[1];
col["column"] = "last_login_date";
handlePseudoISO8601((*it)["last_login_date"].asString(), col, format);
handlePseudoISO8601(entry["last_login_date"].asString(), col, format);
columns[2]["column"] = "ban_date";
handlePseudoISO8601((*it)["ban_date"].asString(), columns[2], format);
handlePseudoISO8601(entry["ban_date"].asString(), columns[2], format);
columns[3]["column"] = "bannedby";
LLUUID banning_id = (*it)["banning_id"].asUUID();
LLUUID banning_id = entry["banning_id"].asUUID();
LLAvatarName av_name;
if (banning_id.isNull())
{
@@ -4332,9 +4329,9 @@ void LLPanelEstateAccess::onEstateAccessReceived(const LLSD& result)
const auto order = allowed_group_name_list->getSortOrder();
allowed_group_name_list->clearSortOrder();
allowed_group_name_list->deleteAllItems();
for (LLSD::array_const_iterator it = result["AllowedGroups"].beginArray(); it != result["AllowedGroups"].endArray(); ++it)
for (auto const& entry : result["AllowedGroups"].array())
{
LLUUID id = (*it)["id"].asUUID();
LLUUID id = entry["id"].asUUID();
allowed_group_name_list->addGroupNameItem(id);
}
allowed_group_name_list->setSortOrder(order);
@@ -4352,9 +4349,9 @@ void LLPanelEstateAccess::onEstateAccessReceived(const LLSD& result)
const auto order = estate_manager_name_list->getSortOrder();
estate_manager_name_list->clearSortOrder();
estate_manager_name_list->deleteAllItems();
for (LLSD::array_const_iterator it = result["Managers"].beginArray(); it != result["Managers"].endArray(); ++it)
for (auto const& entry : result["Managers"].array())
{
LLUUID id = (*it)["agent_id"].asUUID();
LLUUID id = entry["agent_id"].asUUID();
estate_manager_name_list->addNameItem(id);
}
estate_manager_name_list->setSortOrder(order);

View File

@@ -876,12 +876,9 @@ void BGFolderHttpHandler::httpFailure(void)
if (is_internal_http_error_that_warrants_a_retry(mStatus)) // timed out
{
for(LLSD::array_const_iterator folder_it = mRequestSD["folders"].beginArray();
folder_it != mRequestSD["folders"].endArray();
++folder_it)
for (auto const& entry : mRequestSD["folders"].array())
{
LLSD folder_sd(*folder_it);
LLUUID folder_id(folder_sd["folder_id"].asUUID());
LLUUID folder_id(entry["folder_id"].asUUID());
const BOOL recursive = getIsRecursive(folder_id);
fetcher->addRequestAtFront(folder_id, recursive, true);
}

View File

@@ -59,11 +59,8 @@ void LLMapLayerResponder::httpSuccess(void)
LLWorldMap::getInstance()->mMapLayers.clear();
LLSD::array_const_iterator iter;
for(iter = mContent["LayerData"].beginArray(); iter != mContent["LayerData"].endArray(); ++iter)
for (auto const& layer_data : mContent["LayerData"].array())
{
const LLSD& layer_data = *iter;
LLWorldMapLayer new_layer;
new_layer.LayerDefined = TRUE;

View File

@@ -301,11 +301,8 @@ public:
log_SLM_infos("Get /listings", getStatus(), body);
// Extract the info from the results
for (LLSD::array_iterator it = result["listings"].beginArray();
it != result["listings"].endArray(); ++it)
for (auto const& listing : result["listings"].array())
{
LLSD listing = *it;
int listingId = listing["id"].asInteger();
bool isListed = listing["is_listed"].asBoolean();
std::string editUrl = listing["edit_url"].asString();
@@ -367,12 +364,8 @@ public:
log_SLM_infos("Post /listings", getStatus(), body);
// Extract the info from the Json string
auto it = result["listings"].beginArray();
while (it != result["listings"].endArray())
for (auto const& listing : result["listings"].array())
{
auto listing = *it;
int listing_id = listing["id"].asInteger();
bool is_listed = listing["is_listed"].asBoolean();
std::string edit_url = listing["edit_url"].asString();
@@ -385,7 +378,6 @@ public:
LLMarketplaceData::instance().addListing(folder_id,listing_id,version_id,is_listed,edit_url,count);
update_marketplace_category(folder_id, false);
gInventory.notifyObservers();
it++;
}
}
virtual char const* getName() const { return "LLSLMCreateListingsResponder"; }
@@ -439,11 +431,8 @@ public:
log_SLM_infos("Get /listing", getStatus(), body);
// Extract the info from the results
for (LLSD::array_iterator it = result["listings"].beginArray();
it != result["listings"].endArray(); ++it)
for (auto const& listing : result["listings"].array())
{
LLSD listing = *it;
int resListingId = listing["id"].asInteger();
bool isListed = listing["is_listed"].asBoolean();
std::string editUrl = listing["edit_url"].asString();
@@ -510,11 +499,8 @@ public:
log_SLM_infos("Put /listing", getStatus(), body);
// Extract the info from the Json string
for (LLSD::array_iterator it = result["listings"].beginArray();
it != result["listings"].endArray(); ++it)
for (auto const& listing : result["listings"].array())
{
LLSD listing = *it;
int listing_id = listing["id"].asInteger();
bool is_listed = listing["is_listed"].asBoolean();
std::string edit_url = listing["edit_url"].asString();
@@ -591,11 +577,8 @@ public:
log_SLM_infos("Put /associate_inventory", getStatus(), body);
for (LLSD::array_iterator it = result["listings"].beginArray();
it != result["listings"].endArray(); ++it)
for (auto const& listing : result["listings"].array())
{
LLSD listing = *it;
int listing_id = listing["id"].asInteger();
bool is_listed = listing["is_listed"].asBoolean();
std::string edit_url = listing["edit_url"].asString();
@@ -666,11 +649,8 @@ public:
log_SLM_infos("Delete /listing", getStatus(), body);
for (LLSD::array_iterator it = result["listings"].beginArray();
it != result["listings"].endArray(); ++it)
for (auto const& listing : result["listings"].array())
{
LLSD listing = *it;
int listing_id = listing["id"].asInteger();
LLUUID folder_id = LLMarketplaceData::instance().getListingFolder(listing_id);
LLMarketplaceData::instance().deleteListing(folder_id);

View File

@@ -420,9 +420,8 @@ void LLMaterialMgr::onGetResponse(bool success, const LLSD& content, const LLUUI
llassert(response_data.isArray());
LL_DEBUGS("Materials") << "response has "<< response_data.size() << " materials" << LL_ENDL;
for (LLSD::array_const_iterator itMaterial = response_data.beginArray(); itMaterial != response_data.endArray(); ++itMaterial)
for (auto const& material_data : response_data.array())
{
const LLSD& material_data = *itMaterial;
llassert(material_data.isMap());
llassert(material_data.has(MATERIALS_CAP_OBJECT_ID_FIELD));
@@ -465,9 +464,8 @@ void LLMaterialMgr::onGetAllResponse(bool success, const LLSD& content, const LL
llassert(response_data.isArray());
LL_DEBUGS("Materials") << "response has "<< response_data.size() << " materials" << LL_ENDL;
for (LLSD::array_const_iterator itMaterial = response_data.beginArray(); itMaterial != response_data.endArray(); ++itMaterial)
for (auto const& material_data : response_data.array())
{
const LLSD& material_data = *itMaterial;
llassert(material_data.isMap());
llassert(material_data.has(MATERIALS_CAP_OBJECT_ID_FIELD));
@@ -531,11 +529,9 @@ void LLMaterialMgr::onPutResponse(bool success, const LLSD& content)
{
llassert(response_data.isArray());
LL_DEBUGS("Materials") << "response has "<< response_data.size() << " materials" << LL_ENDL;
for (LLSD::array_const_iterator faceIter = response_data.beginArray(); faceIter != response_data.endArray(); ++faceIter)
#ifdef SHOW_ASSERT
for (auto const& face_data : response_data.array())
{
# ifndef LL_RELEASE_FOR_DOWNLOAD
const LLSD& face_data = *faceIter; // conditional to avoid unused variable warning
# endif
llassert(face_data.isMap());
llassert(face_data.has(MATERIALS_CAP_OBJECT_ID_FIELD));
@@ -552,6 +548,7 @@ void LLMaterialMgr::onPutResponse(bool success, const LLSD& content)
// *TODO: do we really still need to process this?
}
#endif
}
}

View File

@@ -104,12 +104,12 @@ void LLPanelExperienceListEditor::addExperienceIds( const uuid_vec_t& experience
void LLPanelExperienceListEditor::setExperienceIds( const LLSD& experience_ids )
{
mExperienceIds.clear();
for_each(experience_ids.beginArray(), experience_ids.endArray(), [this] (const LLUUID& id)
for (const auto& id : experience_ids.array())
{
// Using insert(range) doesn't work here because the conversion from
// LLSD to LLUUID is ambiguous: have to specify asUUID() for each entry.
mExperienceIds.insert(id);
});
mExperienceIds.insert(id.asUUID());
}
onItems();
}

View File

@@ -41,6 +41,8 @@
#include "llfloaterreporter.h"
#include "llinventoryfunctions.h"
#include <boost/range/adaptor/reversed.hpp>
#define BTN_PROFILE_XP "btn_profile_xp"
#define BTN_REPORT_XP "btn_report_xp"
@@ -120,16 +122,14 @@ void LLPanelExperienceLog::refresh()
if (!events.emptyMap())
{
LLSD::map_const_iterator day = events.endMap();
do
for (const auto& day : boost::adaptors::reverse(events.map()))
{
--day;
const std::string& date = day->first;
const std::string& date = day.first;
if (LLExperienceLog::instance().isExpired(date))
{
continue;
}
const LLSD& dayArray = day->second;
const LLSD& dayArray = day.second;
U32 size = dayArray.size();
if(itemsToSkip > size)
{
@@ -161,7 +161,7 @@ void LLPanelExperienceLog::refresh()
LLSD& columns = item["columns"];
columns[0]["column"] = "time";
columns[0]["value"] = day->first+event["Time"].asString();
columns[0]["value"] = day.first+event["Time"].asString();
columns[1]["column"] = "event";
columns[1]["value"] = LLExperienceLog::getPermissionString(event, "ExperiencePermissionShort");
columns[2]["column"] = "experience_name";
@@ -172,7 +172,7 @@ void LLPanelExperienceLog::refresh()
}
++items;
}
} while (day != events.beginMap());
}
}
if (waiting)
{

View File

@@ -326,11 +326,8 @@ void LLPanelExperiencePicker::filterContent()
search_results->deleteAllItems();
LLSD item;
LLSD::array_const_iterator it = experiences.beginArray();
for ( ; it != experiences.endArray(); ++it)
for (const auto& experience : experiences.array())
{
const LLSD& experience = *it;
if (isExperienceHidden(experience))
continue;

View File

@@ -88,10 +88,9 @@ void LLPanelExperiences::setExperienceList( const LLSD& experiences )
mExperiencesList->clear();
auto& cache = LLExperienceCache::instance();
LLSD::array_const_iterator it = experiences.beginArray();
for( /**/ ; it != experiences.endArray(); ++it)
for(const auto& exp : experiences.array())
{
LLUUID public_key = it->asUUID();
LLUUID public_key = exp.asUUID();
if (public_key.notNull())
cache.get(public_key, boost::bind(addExperienceToList, _1, mExperiencesList));
}
@@ -113,10 +112,9 @@ LLPanelExperiences* LLPanelExperiences::create(const std::string& name)
void LLPanelExperiences::removeExperiences( const LLSD& ids )
{
LLSD::array_const_iterator it = ids.beginArray();
for( /**/ ; it != ids.endArray(); ++it)
for (const auto& id : ids.array())
{
removeExperience(it->asUUID());
removeExperience(id.asUUID());
}
}

View File

@@ -106,10 +106,9 @@ void LLPanelGroupExperiences::setExperienceList(const LLSD& experiences)
mExperiencesList->clear();
auto& cache = LLExperienceCache::instance();
LLSD::array_const_iterator it = experiences.beginArray();
for ( /**/ ; it != experiences.endArray(); ++it)
{
LLUUID public_key = it->asUUID();
for (const auto& exp : experiences.array())
{
LLUUID public_key = exp.asUUID();
if (public_key.notNull())
cache.get(public_key, boost::bind(addExperienceToList, _1, mExperiencesList));
}

View File

@@ -139,8 +139,8 @@ public:
virtual void performAction(LLInventoryModel* model, std::string action);
virtual BOOL isUpToDate() const { return TRUE; }
virtual bool hasChildren() const { return FALSE; }
virtual LLInventoryType::EType getInventoryType() const { return LLInventoryType::IT_NONE; }
virtual LLWearableType::EType getWearableType() const { return LLWearableType::WT_NONE; }
virtual LLInventoryType::EType getInventoryType() const { return LLInventoryType::EType::IT_NONE; }
virtual LLWearableType::EType getWearableType() const { return LLWearableType::EType::WT_NONE; }
// LLDragAndDropBridge functionality
virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const;
@@ -161,7 +161,7 @@ LLTaskInvFVBridge::LLTaskInvFVBridge(
mPanel(panel),
mFlags(flags),
mAssetType(LLAssetType::AT_NONE),
mInventoryType(LLInventoryType::IT_NONE)
mInventoryType(LLInventoryType::EType::IT_NONE)
{
const LLInventoryItem *item = findItem();
if (item)
@@ -479,12 +479,9 @@ bool remove_task_inventory_callback(const LLSD& notification, const LLSD& respon
if(option == 0 && object)
{
// yes
LLSD::array_const_iterator list_end = notification["payload"]["inventory_ids"].endArray();
for (LLSD::array_const_iterator list_it = notification["payload"]["inventory_ids"].beginArray();
list_it != list_end;
++list_it)
for (auto const& entry : notification["payload"]["inventory_ids"].array())
{
object->removeInventory(list_it->asUUID());
object->removeInventory(entry.asUUID());
}
// refresh the UI.

View File

@@ -316,13 +316,13 @@ public:
void drawObjectBox(LLColor4 col);
LLSpatialPartition* getSpatialPartition() {return (LLSpatialPartition*)mSpatialPartition;}
LLSpatialPartition* getSpatialPartition() const {return (LLSpatialPartition*)mSpatialPartition;}
//LISTENER FUNCTIONS
virtual void handleInsertion(const TreeNode* node, LLViewerOctreeEntry* face);
virtual void handleRemoval(const TreeNode* node, LLViewerOctreeEntry* face);
virtual void handleDestruction(const TreeNode* node);
virtual void handleChildAddition(const OctreeNode* parent, OctreeNode* child);
void handleInsertion(const TreeNode* node, LLViewerOctreeEntry* face) final override;
void handleRemoval(const TreeNode* node, LLViewerOctreeEntry* face) final override;
void handleDestruction(const TreeNode* node) final override;
void handleChildAddition(const OctreeNode* parent, OctreeNode* child) final override;
LL_ALIGN_16(LLVector4a mViewAngle);

View File

@@ -776,19 +776,17 @@ void LLIMSpeakerMgr::setSpeakers(const LLSD& speakers)
std::vector<speaker_entry_t> speakerentries;
if ( speakers.has("agent_info") && speakers["agent_info"].isMap() )
{
for(LLSD::map_const_iterator speaker_it = speakers["agent_info"].beginMap();
speaker_it != speakers["agent_info"].endMap();
++speaker_it)
for (const auto& speaker : speakers["agent_info"].map())
{
boost::optional<bool> moderator;
boost::optional<bool> moderator_muted;
if (speaker_it->second.isMap())
if (speaker.second.isMap())
{
moderator = speaker_it->second["is_moderator"];
moderator_muted = speaker_it->second["mutes"]["text"];
moderator = speaker.second["is_moderator"];
moderator_muted = speaker.second["mutes"]["text"];
}
speakerentries.emplace_back(
LLUUID(speaker_it->first),
LLUUID(speaker.first),
LLSpeaker::SPEAKER_AGENT,
LLSpeaker::STATUS_TEXT_ONLY,
moderator,
@@ -800,11 +798,9 @@ void LLIMSpeakerMgr::setSpeakers(const LLSD& speakers)
{
//older, more decprecated way. Need here for
//using older version of servers
for(LLSD::array_const_iterator speaker_it = speakers["agents"].beginArray();
speaker_it != speakers["agents"].endArray();
++speaker_it)
for (auto const& entry : speakers["agents"].array())
{
speakerentries.emplace_back((*speaker_it).asUUID());
speakerentries.emplace_back(entry.asUUID());
}
}
LLSpeakerMgr::setSpeakers(speakerentries);
@@ -817,18 +813,16 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update)
std::vector<speaker_entry_t> speakerentries;
if ( update.has("agent_updates") && update["agent_updates"].isMap() )
{
for(LLSD::map_const_iterator update_it = update["agent_updates"].beginMap();
update_it != update["agent_updates"].endMap();
++update_it)
for (const auto& update : update["agent_updates"].map())
{
LLUUID agent_id(update_it->first);
LLUUID agent_id(update.first);
LLPointer<LLSpeaker> speakerp = findSpeaker(agent_id);
bool new_speaker = false;
boost::optional<bool> moderator;
boost::optional<bool> moderator_muted_text;
LLSD agent_data = update_it->second;
LLSD agent_data = update.second;
if (agent_data.isMap() && agent_data.has("transition"))
{
if (agent_data["transition"].asString() == "LEAVE")
@@ -875,14 +869,12 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update)
}
else if ( update.has("updates") && update["updates"].isMap() )
{
for (LLSD::map_const_iterator update_it = update["updates"].beginMap();
update_it != update["updates"].endMap();
++update_it)
for (const auto& update : update["updates"].map())
{
LLUUID agent_id(update_it->first);
LLUUID agent_id(update.first);
LLPointer<LLSpeaker> speakerp = findSpeaker(agent_id);
std::string agent_transition = update_it->second.asString();
std::string agent_transition = update.second.asString();
if (agent_transition == "LEAVE")
{
setSpeakerNotInChannel(speakerp);

View File

@@ -255,7 +255,6 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
//----------------------------------------------------------------
llassert( !(mTexture.notNull() && mLayerSet) ); // mutually exclusive
LLTexUnit::eTextureAddressMode old_mode = LLTexUnit::TAM_WRAP;
LLViewerTexLayerSet *layerset = dynamic_cast<LLViewerTexLayerSet*>(mLayerSet);
if (mTestImageName)
{
@@ -292,19 +291,13 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
else
if ( !is_dummy && mTexture.notNull() )
{
if(mTexture->hasGLTexture())
{
old_mode = mTexture->getAddressMode();
}
gGL.getTexUnit(diffuse_channel)->bind(mTexture);
gGL.getTexUnit(diffuse_channel)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);
}
else
{
gGL.getTexUnit(diffuse_channel)->bind(LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT));
}
U32 mask = sRenderMask;
U32 start = mMesh->mFaceVertexOffset;
@@ -349,12 +342,6 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
gGL.getTexUnit(diffuse_channel)->setTextureBlendType(LLTexUnit::TB_MULT);
}
if (mTexture.notNull() && !is_dummy)
{
gGL.getTexUnit(diffuse_channel)->bind(mTexture);
gGL.getTexUnit(diffuse_channel)->setTextureAddressMode(old_mode);
}
return triangle_count;
}

View File

@@ -474,7 +474,7 @@ class LLFileUploadBulk : public view_listener_t
asset_name,
0,
LLFolderType::FT_NONE,
LLInventoryType::IT_NONE,
LLInventoryType::EType::IT_NONE,
LLFloaterPerms::getNextOwnerPerms("Uploads"),
LLFloaterPerms::getGroupPerms("Uploads"),
LLFloaterPerms::getEveryonePerms("Uploads"),
@@ -963,10 +963,10 @@ void upload_new_resource(const std::string& src_filename, std::string name,
// <edit> hack to create scripts and gestures
if(exten == "lsl" || exten == "gesture" || exten == "notecard") // added notecard Oct 15 2009
{
LLInventoryType::EType inv_type = LLInventoryType::IT_GESTURE;
if (exten == "lsl") inv_type = LLInventoryType::IT_LSL;
else if(exten == "gesture") inv_type = LLInventoryType::IT_GESTURE;
else if(exten == "notecard") inv_type = LLInventoryType::IT_NOTECARD;
LLInventoryType::EType inv_type = LLInventoryType::EType::IT_GESTURE;
if (exten == "lsl") inv_type = LLInventoryType::EType::IT_LSL;
else if(exten == "gesture") inv_type = LLInventoryType::EType::IT_GESTURE;
else if(exten == "notecard") inv_type = LLInventoryType::EType::IT_NOTECARD;
create_inventory_item( gAgent.getID(),
gAgent.getSessionID(),
gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(asset_type)),
@@ -1354,7 +1354,7 @@ void assign_defaults_and_show_upload_message(LLAssetType::EType asset_type,
const std::string& display_name,
std::string& description)
{
if (LLInventoryType::IT_NONE == inventory_type)
if (LLInventoryType::EType::IT_NONE == inventory_type)
{
inventory_type = LLInventoryType::defaultForAssetType(asset_type);
}
@@ -1412,9 +1412,9 @@ void NewResourceItemCallback::fire(const LLUUID& new_item_id)
std::string type("Uploads");
switch(new_item->getInventoryType())
{
case LLInventoryType::IT_LSL: type = "Scripts"; break;
case LLInventoryType::IT_GESTURE: type = "Gestures"; break;
case LLInventoryType::IT_NOTECARD: type = "Notecard"; break;
case LLInventoryType::EType::IT_LSL: type = "Scripts"; break;
case LLInventoryType::EType::IT_GESTURE: type = "Gestures"; break;
case LLInventoryType::EType::IT_NOTECARD: type = "Notecard"; break;
default: break;
}
LLPermissions perms = new_item->getPermissions();

View File

@@ -1312,7 +1312,7 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam
if (gSavedSettings.getBOOL("ShowInInventory") &&
objects.size() == 1 && item != NULL &&
asset_type != LLAssetType::AT_CALLINGCARD &&
item->getInventoryType() != LLInventoryType::IT_ATTACHMENT &&
item->getInventoryType() != LLInventoryType::EType::IT_ATTACHMENT &&
!from_name.empty())
{
LLPanelMainInventory::showAgentInventory(TRUE);
@@ -6570,10 +6570,9 @@ void send_lures(const LLSD& notification, const LLSD& response)
if ( (RlvActions::hasBehaviour(RLV_BHVR_SENDIM)) || (RlvActions::hasBehaviour(RLV_BHVR_SENDIMTO)) )
{
// Filter the lure message if one of the recipients of the lure can't be sent an IM to
for (LLSD::array_const_iterator it = notification["payload"]["ids"].beginArray();
it != notification["payload"]["ids"].endArray(); ++it)
for (auto const& entry : notification["payload"]["ids"].array())
{
if (!RlvActions::canSendIM(it->asUUID()))
if (!RlvActions::canSendIM(entry.asUUID()))
{
text = rlv_hidden;
break;
@@ -6594,11 +6593,9 @@ void send_lures(const LLSD& notification, const LLSD& response)
bool fRlvHideName = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES);
bool fRlvNoNearbyNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS);
// [/RLVa:KB]
for (LLSD::array_const_iterator it = notification["payload"]["ids"].beginArray();
it != notification["payload"]["ids"].endArray();
++it)
for (auto const& entry : notification["payload"]["ids"].array())
{
LLUUID target_id = it->asUUID();
LLUUID target_id = entry.asUUID();
msg->nextBlockFast(_PREHASH_TargetData);
msg->addUUIDFast(_PREHASH_TargetID, target_id);

View File

@@ -1123,11 +1123,9 @@ void LLObjectBackup::importObject_continued(AIFilePicker* filepicker)
mRezCount = 0;
updateImportNumbers();
for (LLSD::array_const_iterator prim_arr_it = mLLSD["data"].beginArray(),
prim_arr_end = mLLSD["data"].endArray();
prim_arr_it != prim_arr_end; ++prim_arr_it)
for (auto const& entry : mLLSD["data"].array())
{
LLSD llsd2 = (*prim_arr_it)["group_body"];
LLSD llsd2 = entry["group_body"];
for (LLSD::map_const_iterator prim_it = llsd2.beginMap(),
prim_end = llsd2.endMap();

View File

@@ -746,12 +746,9 @@ public:
void clear_object_list_pending_requests()
{
// TODO*: No more hard coding
for (
LLSD::array_iterator iter = mObjectIDs.beginArray();
iter != mObjectIDs.endArray();
++iter)
for (auto const& id : mObjectIDs.array())
{
gObjectList.onObjectCostFetchFailure(iter->asUUID());
gObjectList.onObjectCostFetchFailure(id.asUUID());
}
}
@@ -789,23 +786,20 @@ public:
// Success, grab the resource cost and linked set costs
// for an object if one was returned
for (
LLSD::array_iterator iter = mObjectIDs.beginArray();
iter != mObjectIDs.endArray();
++iter)
for (auto const& entry : mObjectIDs.array())
{
LLUUID object_id = iter->asUUID();
LLUUID object_id = entry.asUUID();
// Check to see if the request contains data for the object
if ( mContent.has(iter->asString()) )
if ( mContent.has(entry.asString()) )
{
F32 link_cost =
mContent[iter->asString()]["linked_set_resource_cost"].asReal();
mContent[entry.asString()]["linked_set_resource_cost"].asReal();
F32 object_cost =
mContent[iter->asString()]["resource_cost"].asReal();
mContent[entry.asString()]["resource_cost"].asReal();
F32 physics_cost = mContent[iter->asString()]["physics_cost"].asReal();
F32 link_physics_cost = mContent[iter->asString()]["linked_set_physics_cost"].asReal();
F32 physics_cost = mContent[entry.asString()]["physics_cost"].asReal();
F32 link_physics_cost = mContent[entry.asString()]["linked_set_physics_cost"].asReal();
gObjectList.updateObjectCost(object_id, object_cost, link_cost, physics_cost, link_physics_cost);
}
@@ -837,12 +831,9 @@ public:
void clear_object_list_pending_requests()
{
// TODO*: No more hard coding
for (
LLSD::array_iterator iter = mObjectIDs.beginArray();
iter != mObjectIDs.endArray();
++iter)
for (auto const& id : mObjectIDs.array())
{
gObjectList.onPhysicsFlagsFetchFailure(iter->asUUID());
gObjectList.onPhysicsFlagsFetchFailure(id.asUUID());
}
}
@@ -880,17 +871,14 @@ public:
// Success, grab the resource cost and linked set costs
// for an object if one was returned
for (
LLSD::array_iterator iter = mObjectIDs.beginArray();
iter != mObjectIDs.endArray();
++iter)
for (auto const& entry : mObjectIDs.array())
{
LLUUID object_id = iter->asUUID();
LLUUID object_id = entry.asUUID();
// Check to see if the request contains data for the object
if (mContent.has(iter->asString()))
if (mContent.has(entry.asString()))
{
const LLSD& data = mContent[iter->asString()];
const LLSD& data = mContent[entry.asString()];
S32 shape_type = data["PhysicsShapeType"].asInteger();

View File

@@ -467,6 +467,11 @@ LLViewerOctreeGroup::LLViewerOctreeGroup(OctreeNode* node) :
mBounds[1] = node->getSize();
mOctreeNode->addListener(this);
for (U32 i = 0; i < sizeof(mVisible) / sizeof(mVisible[0]); i++)
{
mVisible[i] = 0;
}
}
bool LLViewerOctreeGroup::hasElement(LLViewerOctreeEntryData* data)
@@ -632,17 +637,6 @@ void LLViewerOctreeGroup::handleDestruction(const TreeNode* node)
mOctreeNode = NULL;
}
//virtual
void LLViewerOctreeGroup::handleStateChange(const TreeNode* node)
{
//drop bounding box upon state change
if (mOctreeNode != node)
{
mOctreeNode = (OctreeNode*) node;
}
unbound();
}
//virtual
void LLViewerOctreeGroup::handleChildAddition(const OctreeNode* parent, OctreeNode* child)
{
@@ -813,7 +807,7 @@ U32 LLOcclusionCullingGroup::getNewOcclusionQueryObjectName()
return sQueryPool.allocate();
}
void LLOcclusionCullingGroup::releaseOcclusionQueryObjectName(GLuint name)
void LLOcclusionCullingGroup::releaseOcclusionQueryObjectName(U32 name)
{
sQueryPool.release(name);
}

View File

@@ -222,12 +222,11 @@ public:
void clearState(U32 state) {mState &= ~state;}
//LISTENER FUNCTIONS
virtual void handleInsertion(const TreeNode* node, LLViewerOctreeEntry* obj);
virtual void handleRemoval(const TreeNode* node, LLViewerOctreeEntry* obj);
virtual void handleDestruction(const TreeNode* node);
virtual void handleStateChange(const TreeNode* node);
virtual void handleChildAddition(const OctreeNode* parent, OctreeNode* child);
virtual void handleChildRemoval(const OctreeNode* parent, const OctreeNode* child);
void handleInsertion(const TreeNode* node, LLViewerOctreeEntry* obj) override;
void handleRemoval(const TreeNode* node, LLViewerOctreeEntry* obj) override;
void handleDestruction(const TreeNode* node) override;
void handleChildAddition(const OctreeNode* parent, OctreeNode* child) override;
void handleChildRemoval(const OctreeNode* parent, const OctreeNode* child) final override;
OctreeNode* getOctreeNode() {return mOctreeNode;}
LLViewerOctreeGroup* getParent();
@@ -308,11 +307,11 @@ public:
U32 getLastOcclusionIssuedTime();
//virtual
void handleChildAddition(const OctreeNode* parent, OctreeNode* child);
void handleChildAddition(const OctreeNode* parent, OctreeNode* child) override;
//virtual
BOOL isRecentlyVisible() const;
LLViewerOctreePartition* getSpatialPartition()const {return mSpatialPartition;}
//LLViewerOctreePartition* getSpatialPartition()const {return mSpatialPartition;}
BOOL isAnyRecentlyVisible() const;
static U32 getNewOcclusionQueryObjectName();
@@ -350,7 +349,7 @@ public:
public:
U32 mPartitionType;
U32 mDrawableType;
OctreeNode* mOctree;
OctreeRoot* mOctree;
LLViewerRegion* mRegionp; // the region this partition belongs to.
BOOL mOcclusionEnabled; // if TRUE, occlusion culling is performed
U32 mLODSeed;

View File

@@ -76,7 +76,7 @@ LLViewerTexLayerSetBuffer::LLViewerTexLayerSetBuffer(LLTexLayerSet* const owner,
S32 width, S32 height) :
// ORDER_LAST => must render these after the hints are created.
LLTexLayerSetBuffer(owner),
LLViewerDynamicTexture( width, height, 4, LLViewerDynamicTexture::ORDER_LAST, TRUE ),
LLViewerDynamicTexture( width, height, 4, LLViewerDynamicTexture::ORDER_LAST, FALSE ),
mUploadPending(FALSE), // Not used for any logic here, just to sync sending of updates
mNeedsUpload(FALSE),
mNumLowresUploads(0),

View File

@@ -2533,12 +2533,10 @@ void LLVOVolume::updateObjectMediaData(const LLSD &media_data_array, const std::
mLastFetchedMediaVersion = fetched_version;
//LL_INFOS() << "updating:" << this->getID() << " " << ll_pretty_print_sd(media_data_array) << LL_ENDL;
LLSD::array_const_iterator iter = media_data_array.beginArray();
LLSD::array_const_iterator end = media_data_array.endArray();
U8 texture_index = 0;
for (; iter != end; ++iter, ++texture_index)
for (auto const& entry : media_data_array.array())
{
syncMediaData(texture_index, *iter, false/*merge*/, false/*ignore_agent*/);
syncMediaData(texture_index++, entry, false/*merge*/, false/*ignore_agent*/);
}
}
}

View File

@@ -2273,8 +2273,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
BOOL to_texture = LLPipeline::sUseOcclusion > 1 &&
!hasRenderType(LLPipeline::RENDER_TYPE_HUD) &&
LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD &&
LLGLSLShader::sNoFixedFunction &&
sRenderGlow;
LLGLSLShader::sNoFixedFunction;
if (to_texture)
{