summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rwxr-xr-xindra/newview/llappviewer.cpp50
1 files changed, 27 insertions, 23 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index b2c74854ff..6dc71bc94e 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -685,6 +685,8 @@ LLAppViewer::LLAppViewer()
mQuitRequested(false),
mLogoutRequestSent(false),
mYieldTime(-1),
+ mLastAgentControlFlags(0),
+ mLastAgentForceUpdate(0),
mMainloopTimeout(NULL),
mAgentRegionLastAlive(false),
mRandomizeFramerate(LLCachedControl<bool>(gSavedSettings,"Randomize Framerate", FALSE)),
@@ -3273,7 +3275,7 @@ void LLAppViewer::writeDebugInfo(bool isStatic)
: getDynamicDebugFile() );
LL_INFOS() << "Opening debug file " << *debug_filename << LL_ENDL;
- std::ofstream out_file(debug_filename->c_str());
+ llofstream out_file(debug_filename->c_str());
isStatic ? LLSDSerialize::toPrettyXML(gDebugInfo, out_file)
: LLSDSerialize::toPrettyXML(gDebugInfo["Dynamic"], out_file);
@@ -3762,7 +3764,7 @@ void LLAppViewer::handleViewerCrash()
{
std::string filename;
filename = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, "stats.log");
- std::ofstream file(filename.c_str(), std::ios_base::binary);
+ llofstream file(filename.c_str(), std::ios_base::binary);
if(file.good())
{
LL_INFOS() << "Handle viewer crash generating stats log." << LL_ENDL;
@@ -4650,7 +4652,7 @@ void LLAppViewer::loadNameCache()
std::string filename =
gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "avatar_name_cache.xml");
LL_INFOS("AvNameCache") << filename << LL_ENDL;
- std::ifstream name_cache_stream(filename.c_str());
+ llifstream name_cache_stream(filename.c_str());
if(name_cache_stream.is_open())
{
if ( ! LLAvatarNameCache::importFile(name_cache_stream))
@@ -4665,7 +4667,7 @@ void LLAppViewer::loadNameCache()
std::string name_cache;
name_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "name.cache");
- std::ifstream cache_file(name_cache.c_str());
+ llifstream cache_file(name_cache.c_str());
if(cache_file.is_open())
{
if(gCacheName->importFile(cache_file)) return;
@@ -4677,7 +4679,7 @@ void LLAppViewer::saveNameCache()
// display names cache
std::string filename =
gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "avatar_name_cache.xml");
- std::ofstream name_cache_stream(filename.c_str());
+ llofstream name_cache_stream(filename.c_str());
if(name_cache_stream.is_open())
{
LLAvatarNameCache::exportFile(name_cache_stream);
@@ -4688,7 +4690,7 @@ void LLAppViewer::saveNameCache()
{
std::string name_cache;
name_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "name.cache");
- std::ofstream cache_file(name_cache.c_str());
+ llofstream cache_file(name_cache.c_str());
if(cache_file.is_open())
{
gCacheName->exportFile(cache_file);
@@ -4820,22 +4822,24 @@ void LLAppViewer::idle()
gAgentPilot.updateTarget();
gAgent.autoPilot(&yaw);
}
-
- static LLFrameTimer agent_update_timer;
- static U32 last_control_flags;
-
- // When appropriate, update agent location to the simulator.
- F32 agent_update_time = agent_update_timer.getElapsedTimeF32();
- BOOL flags_changed = gAgent.controlFlagsDirty() || (last_control_flags != gAgent.getControlFlags());
-
- if (flags_changed || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND)))
- {
- LL_RECORD_BLOCK_TIME(FTM_AGENT_UPDATE);
- // Send avatar and camera info
- last_control_flags = gAgent.getControlFlags();
- send_agent_update(TRUE);
- agent_update_timer.reset();
- }
+
+ static LLFrameTimer agent_update_timer;
+
+ // 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)))
+ {
+ LL_RECORD_BLOCK_TIME(FTM_AGENT_UPDATE);
+ // Send avatar and camera info
+ mLastAgentControlFlags = gAgent.getControlFlags();
+ mLastAgentForceUpdate = force_update ? 0 : agent_force_update_time;
+ send_agent_update(force_update);
+ agent_update_timer.reset();
+ }
}
//////////////////////////////////////
@@ -5383,7 +5387,7 @@ void LLAppViewer::idleNetwork()
}
// Handle per-frame message system processing.
- gMessageSystem->processAcks();
+ gMessageSystem->processAcks(gSavedSettings.getF32("AckCollectTime"));
#ifdef TIME_THROTTLE_MESSAGES
if (total_time >= CheckMessagesMaxTime)