summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2020-05-06 16:06:26 -0400
committerNat Goodspeed <nat@lindenlab.com>2020-05-06 16:06:26 -0400
commitca6f09292925a7bd936338cb598efb3ddc8524bf (patch)
tree3f27e75fc8443b84e91fcac400084fd83dfed26a /indra/newview/llappviewer.cpp
parent4768d092f611576b4e4e95574e9b16192e7ced5e (diff)
parent4a7fd0117a43dca9e30c58c6417ebdf6862561f6 (diff)
DRTVWR-476: Merge branch 'master' of lindenlab/viewer into DRTVWR-476-boost-1.72
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp66
1 files changed, 45 insertions, 21 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 1bba17dc29..65bfcec8c4 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -33,6 +33,7 @@
#include "llfeaturemanager.h"
#include "lluictrlfactory.h"
#include "lltexteditor.h"
+#include "llenvironment.h"
#include "llerrorcontrol.h"
#include "lleventtimer.h"
#include "llviewertexturelist.h"
@@ -61,7 +62,9 @@
#include "llallocator.h"
#include "llcalc.h"
#include "llconversationlog.h"
+#if LL_WINDOWS
#include "lldxhardware.h"
+#endif
#include "lltexturestats.h"
#include "lltrace.h"
#include "lltracethreadrecorder.h"
@@ -172,8 +175,6 @@
#include "llviewerparcelmgr.h"
#include "llworldmapview.h"
#include "llpostprocess.h"
-#include "llwlparammanager.h"
-#include "llwaterparammanager.h"
#include "lldebugview.h"
#include "llconsole.h"
@@ -209,6 +210,7 @@
#include "llfloateroutfitsnapshot.h"
#include "llfloatersnapshot.h"
#include "llsidepanelinventory.h"
+#include "llatmosphere.h"
// includes for idle() idleShutdown()
#include "llviewercontrol.h"
@@ -777,6 +779,10 @@ bool LLAppViewer::init()
// Memory will be cleaned up in ::cleanupClass()
LLWearableType::initParamSingleton(new LLUITranslationBridge());
+ // initialize the LLSettingsType translation bridge.
+ LLTranslationBridge::ptr_t trans = std::make_shared<LLUITranslationBridge>();
+ LLSettingsType::initClass(trans);
+
// initialize SSE options
LLVector4a::initClass();
@@ -1130,13 +1136,16 @@ bool LLAppViewer::init()
try {
initializeSecHandler();
}
- catch (LLProtectedDataException ex)
+ catch (LLProtectedDataException&)
{
LLNotificationsUtil::add("CorruptedProtectedDataStore");
}
gGLActive = FALSE;
+#if LL_RELEASE_FOR_DOWNLOAD
+ if (!gSavedSettings.getBOOL("CmdLineSkipUpdater"))
+ {
LLProcess::Params updater;
updater.desc = "updater process";
// Because it's the updater, it MUST persist beyond the lifespan of the
@@ -1162,18 +1171,13 @@ bool LLAppViewer::init()
// ForceAddressSize
updater.args.add(stringize(gSavedSettings.getU32("ForceAddressSize")));
-#if LL_WINDOWS && !LL_RELEASE_FOR_DOWNLOAD && !LL_SEND_CRASH_REPORTS
- // This is neither a release package, nor crash-reporting enabled test build
- // try to run version updater, but don't bother if it fails (file might be missing)
- LLLeap *leap_p = LLLeap::create(updater, false);
- if (!leap_p)
+ // Run the updater. An exception from launching the updater should bother us.
+ LLLeap::create(updater, true);
+ }
+ else
{
- LL_WARNS("LLLeap") << "Failed to run LLLeap" << LL_ENDL;
+ LL_WARNS("InitInfo") << "Skipping updater check." << LL_ENDL;
}
-#else
- // Run the updater. An exception from launching the updater should bother us.
- LLLeap::create(updater, true);
-#endif
// Iterate over --leap command-line options. But this is a bit tricky: if
// there's only one, it won't be an array at all.
@@ -1205,6 +1209,7 @@ bool LLAppViewer::init()
<< "lleventhost no longer supported as a dynamic library"
<< LL_ENDL;
}
+#endif
LLTextUtil::TextHelpers::iconCallbackCreationFunction = create_text_segment_icon_from_url_match;
@@ -1316,6 +1321,8 @@ static LLTrace::BlockTimerStatHandle FTM_YIELD("Yield");
static LLTrace::BlockTimerStatHandle FTM_TEXTURE_CACHE("Texture Cache");
static LLTrace::BlockTimerStatHandle FTM_DECODE("Image Decode");
+static LLTrace::BlockTimerStatHandle FTM_FETCH("Image Fetch");
+
static LLTrace::BlockTimerStatHandle FTM_VFS("VFS Thread");
static LLTrace::BlockTimerStatHandle FTM_LFS("LFS Thread");
static LLTrace::BlockTimerStatHandle FTM_PAUSE_THREADS("Pause Threads");
@@ -1343,7 +1350,7 @@ bool LLAppViewer::frame()
{
LOG_UNHANDLED_EXCEPTION("");
}
- catch (std::bad_alloc)
+ catch (std::bad_alloc&)
{
LLMemory::logMemoryInfo(TRUE);
LLFloaterMemLeak* mem_leak_instance = LLFloaterReg::findTypedInstance<LLFloaterMemLeak>("mem_leaking");
@@ -1469,8 +1476,10 @@ bool LLAppViewer::doFrame()
pingMainloopTimeout("Main:Display");
gGLActive = TRUE;
+ display();
+
static U64 last_call = 0;
- if (!gTeleportDisplay)
+ if (!gTeleportDisplay || gGLManager.mIsIntel) // SL-10625...throttle early, throttle often with Intel
{
// Frame/draw throttling
U64 elapsed_time = LLTimer::getTotalTime() - last_call;
@@ -1484,8 +1493,6 @@ bool LLAppViewer::doFrame()
}
last_call = LLTimer::getTotalTime();
- display();
-
pingMainloopTimeout("Main:Snapshot");
LLFloaterSnapshot::update(); // take snapshots
LLFloaterOutfitSnapshot::update();
@@ -1632,7 +1639,7 @@ S32 LLAppViewer::updateTextureThreads(F32 max_time)
work_pending += LLAppViewer::getImageDecodeThread()->update(max_time); // unpauses the image thread
}
{
- LL_RECORD_BLOCK_TIME(FTM_DECODE);
+ LL_RECORD_BLOCK_TIME(FTM_FETCH);
work_pending += LLAppViewer::getTextureFetch()->update(max_time); // unpauses the texture fetch thread
}
return work_pending;
@@ -1655,6 +1662,8 @@ void LLAppViewer::flushVFSIO()
bool LLAppViewer::cleanup()
{
+ LLAtmosphere::cleanupClass();
+
//ditch LLVOAvatarSelf instance
gAgentAvatarp = NULL;
@@ -1697,6 +1706,11 @@ bool LLAppViewer::cleanup()
disconnectViewer();
LL_INFOS() << "Viewer disconnected" << LL_ENDL;
+
+ if (gKeyboard)
+ {
+ gKeyboard->resetKeys();
+ }
display_cleanup();
@@ -1889,6 +1903,12 @@ bool LLAppViewer::cleanup()
// Store the time of our current logoff
gSavedPerAccountSettings.setU32("LastLogoff", time_corrected());
+ if (LLEnvironment::instanceExists())
+ {
+ //Store environment settings if nessesary
+ LLEnvironment::getInstance()->saveToSettings();
+ }
+
// Must do this after all panels have been deleted because panels that have persistent rects
// save their rects on delete.
gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE);
@@ -2187,7 +2207,9 @@ void errorCallback(const std::string &error_string)
// static info file.
LLAppViewer::instance()->writeDebugInfo();
+#ifndef SHADER_CRASH_NONFATAL
LLError::crashAndLoop(error_string);
+#endif
}
void LLAppViewer::initLoggingAndGetLastDuration()
@@ -3952,7 +3974,10 @@ static LLNotificationFunctorRegistration finish_quit_reg("ConfirmQuit", finish_q
void LLAppViewer::userQuit()
{
- if (gDisconnected || gViewerWindow->getProgressView()->getVisible())
+ if (gDisconnected
+ || !gViewerWindow
+ || !gViewerWindow->getProgressView()
+ || gViewerWindow->getProgressView()->getVisible())
{
requestQuit();
}
@@ -4908,7 +4933,6 @@ void LLAppViewer::idle()
//
// Update weather effects
//
- gSky.propagateHeavenlyBodies(gFrameDTClamped); // moves sun, moon, and planets
// Update wind vector
LLVector3 wind_position_region;
@@ -5392,7 +5416,7 @@ bool LLAppViewer::onChangeFrameLimit(LLSD const & evt)
{
if (evt.asInteger() > 0)
{
- mMinMicroSecPerFrame = 1000000 / evt.asInteger();
+ mMinMicroSecPerFrame = (U64)(1000000.0f / F32(evt.asInteger()));
}
else
{