summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 1e71b5764f..0b566cbc73 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -144,7 +144,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>
@@ -1737,7 +1736,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())
@@ -2394,7 +2393,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;
@@ -2406,7 +2405,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;
@@ -2471,11 +2470,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)
{
@@ -3061,7 +3060,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
@@ -4726,16 +4725,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();
}
}