diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-04-25 11:06:37 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-04-25 11:06:37 +0800 |
commit | f7b2c0d7d95ca8609a948a7d11b44534d8ac5249 (patch) | |
tree | b9d80bc52d207acf50ea01b465ab26749ba40f72 /indra/newview/llappviewer.cpp | |
parent | c82295910685c54acf597277e9dac0f70eb40239 (diff) | |
parent | fc71a9c1ed96cb1cb97124e3cceabdfa11e1cc75 (diff) |
Merge tag '7.1.6-release'
source for viewer 7.1.6.8745209917
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r-- | indra/newview/llappviewer.cpp | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e1611df721..b3af92d0fe 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -143,7 +143,6 @@ // Third party library includes #include <boost/bind.hpp> -#include <boost/foreach.hpp> #include <boost/algorithm/string.hpp> #include <boost/regex.hpp> #include <boost/throw_exception.hpp> @@ -1212,7 +1211,7 @@ bool LLAppViewer::init() LLSD item(LeapCommand); LeapCommand.append(item); } - BOOST_FOREACH(const std::string& leap, llsd::inArray(LeapCommand)) + for (const auto& leap : llsd::inArray(LeapCommand)) { LL_INFOS("InitInfo") << "processing --leap \"" << leap << '"' << LL_ENDL; // We don't have any better description of this plugin than the @@ -1717,7 +1716,7 @@ bool LLAppViewer::cleanup() LLNotifications::instance().clear(); // workaround for DEV-35406 crash on shutdown - LLEventPumps::instance().reset(); + LLEventPumps::instance().reset(true); //dump scene loading monitor results if (LLSceneMonitor::instanceExists()) @@ -2374,7 +2373,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, LL_ERRS() << "Invalid settings location list" << LL_ENDL; } - BOOST_FOREACH(const SettingsGroup& group, mSettingsLocationList->groups) + for (const SettingsGroup& group : mSettingsLocationList->groups) { // skip settings groups that aren't the one we requested if (group.name() != location_key) continue; @@ -2386,7 +2385,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, return false; } - BOOST_FOREACH(const SettingsFile& file, group.files) + for (const SettingsFile& file : group.files) { LL_INFOS("Settings") << "Attempting to load settings for the group " << file.name() << " - from location " << location_key << LL_ENDL; @@ -2451,11 +2450,11 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, std::string LLAppViewer::getSettingsFilename(const std::string& location_key, const std::string& file) { - BOOST_FOREACH(const SettingsGroup& group, mSettingsLocationList->groups) + for (const SettingsGroup& group : mSettingsLocationList->groups) { if (group.name() == location_key) { - BOOST_FOREACH(const SettingsFile& settings_file, group.files) + for (const SettingsFile& settings_file : group.files) { if (settings_file.name() == file) { @@ -3041,7 +3040,7 @@ void LLAppViewer::initStrings() // Now that we've set "[sourceid]", have to go back through // default_trans_args and reinitialize all those other keys because some // of them, in turn, reference "[sourceid]". - BOOST_FOREACH(std::string key, default_trans_args) + for (const std::string& key : default_trans_args) { std::string brackets(key), nobrackets(key); // Invalid to inspect key[0] if key is empty(). But then, the entire @@ -4708,16 +4707,23 @@ void LLAppViewer::idle() // When appropriate, update agent location to the simulator. F32 agent_update_time = agent_update_timer.getElapsedTimeF32(); F32 agent_force_update_time = mLastAgentForceUpdate + agent_update_time; - BOOL force_update = gAgent.controlFlagsDirty() - || (mLastAgentControlFlags != gAgent.getControlFlags()) - || (agent_force_update_time > (1.0f / (F32) AGENT_FORCE_UPDATES_PER_SECOND)); - if (force_update || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND))) + bool timed_out = agent_update_time > (1.0f / (F32)AGENT_UPDATES_PER_SECOND); + BOOL force_send = + // if there is something to send + (gAgent.controlFlagsDirty() && timed_out) + // if something changed + || (mLastAgentControlFlags != gAgent.getControlFlags()) + // keep alive + || (agent_force_update_time > (1.0f / (F32) AGENT_FORCE_UPDATES_PER_SECOND)); + // timing out doesn't warranty that an update will be sent, + // just that it will be checked. + if (force_send || timed_out) { LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; // Send avatar and camera info mLastAgentControlFlags = gAgent.getControlFlags(); - mLastAgentForceUpdate = force_update ? 0 : agent_force_update_time; - send_agent_update(force_update); + mLastAgentForceUpdate = force_send ? 0 : agent_force_update_time; + send_agent_update(force_send); agent_update_timer.reset(); } } |