summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-07-27 15:17:57 +0800
committerErik Kundiman <erik@megapahit.org>2024-07-28 08:24:59 +0800
commit96a81b5ecbe3bffb582ded930752c0523df5e80a (patch)
treea87a0bd09fd980562e88150dbfea3819d28d9f12 /indra/newview/llappviewer.cpp
parent06e8f0c443c1ba7858d000c6d695b7e988e02053 (diff)
parented73208eb96b862b97fa285036edea1e792ca3c6 (diff)
Merge remote-tracking branch 'secondlife/release/2024.06-atlasaurus' into 2024.06-atlasaurus
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp188
1 files changed, 97 insertions, 91 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index f46580c6c0..c93a3f6d0d 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -197,7 +197,6 @@
#include "llworld.h"
#include "llhudeffecttrail.h"
-#include "llvectorperfoptions.h"
#include "llslurl.h"
#include "llurlregistry.h"
#include "llwatchdog.h"
@@ -288,12 +287,12 @@ static LLAppViewerListener sAppViewerListener(LLAppViewer::instance);
extern void init_apple_menu(const char* product);
#endif // LL_DARWIN
-extern BOOL gRandomizeFramerate;
-extern BOOL gPeriodicSlowFrame;
-extern BOOL gDebugGL;
+extern bool gRandomizeFramerate;
+extern bool gPeriodicSlowFrame;
+extern bool gDebugGL;
#if LL_DARWIN
-extern BOOL gHiDPISupport;
+extern bool gHiDPISupport;
#endif
////////////////////////////////////////////////////////////
@@ -302,8 +301,8 @@ extern BOOL gHiDPISupport;
F32 gSimLastTime; // Used in LLAppViewer::init and send_viewer_stats()
F32 gSimFrames;
-BOOL gShowObjectUpdates = FALSE;
-BOOL gUseQuickTime = TRUE;
+bool gShowObjectUpdates = false;
+bool gUseQuickTime = true;
eLastExecEvent gLastExecEvent = LAST_EXEC_NORMAL;
S32 gLastExecDuration = -1; // (<0 indicates unknown)
@@ -345,12 +344,12 @@ F32 gLogoutMaxTime = LOGOUT_REQUEST_TIME;
S32 gPendingMetricsUploads = 0;
-BOOL gDisconnected = FALSE;
+bool gDisconnected = false;
// used to restore texture state after a mode switch
LLFrameTimer gRestoreGLTimer;
-BOOL gRestoreGL = FALSE;
-bool gUseWireframe = FALSE;
+bool gRestoreGL = false;
+bool gUseWireframe = false;
LLMemoryInfo gSysMemory;
U64Bytes gMemoryAllocated(0); // updated in display_stats() in llviewerdisplay.cpp
@@ -362,15 +361,16 @@ LLVector3 gRelativeWindVec(0.0, 0.0, 0.0);
U32 gPacketsIn = 0;
-BOOL gPrintMessagesThisFrame = FALSE;
+bool gPrintMessagesThisFrame = false;
-BOOL gRandomizeFramerate = FALSE;
-BOOL gPeriodicSlowFrame = FALSE;
+bool gRandomizeFramerate = false;
+bool gPeriodicSlowFrame = false;
-BOOL gCrashOnStartup = FALSE;
-BOOL gLogoutInProgress = FALSE;
+bool gCrashOnStartup = false;
+bool gLLErrorActivated = false;
+bool gLogoutInProgress = false;
-BOOL gSimulateMemLeak = FALSE;
+bool gSimulateMemLeak = false;
// We don't want anyone, especially threads working on the graphics pipeline,
// to have to block due to this WorkQueue being full.
@@ -385,7 +385,7 @@ const std::string START_MARKER_FILE_NAME("SecondLife.start_marker");
const std::string ERROR_MARKER_FILE_NAME("SecondLife.error_marker");
const std::string LLERROR_MARKER_FILE_NAME("SecondLife.llerror_marker");
const std::string LOGOUT_MARKER_FILE_NAME("SecondLife.logout_marker");
-static BOOL gDoDisconnect = FALSE;
+static bool gDoDisconnect = false;
static std::string gLaunchFileOnQuit;
// Used on Win32 for other apps to identify our window (eg, win_setup)
@@ -499,7 +499,7 @@ bool create_text_segment_icon_from_url_match(LLUrlMatch* match,LLTextBase* ba
LLIconCtrl* icon;
if( match->getMenuName() == "menu_url_group.xml" // See LLUrlEntryGroup constructor
- || gAgent.isInGroup(match_id, TRUE)) //This check seems unfiting, urls are either /agent or /group
+ || gAgent.isInGroup(match_id, true)) //This check seems unfiting, urls are either /agent or /group
{
LLGroupIconCtrl::Params icon_params;
icon_params.group_id = match_id;
@@ -580,7 +580,7 @@ static void settings_to_globals()
static void settings_modify()
{
LLPipeline::sRenderTransparentWater = gSavedSettings.getBOOL("RenderTransparentWater");
- LLPipeline::sRenderDeferred = TRUE; // FALSE is deprecated
+ LLPipeline::sRenderDeferred = true; // false is deprecated
LLRenderTarget::sUseFBO = LLPipeline::sRenderDeferred;
LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor");
LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //square lod factor to get exponential range of [1,4]
@@ -663,8 +663,8 @@ LLAppViewer::LLAppViewer()
mLastAgentForceUpdate(0),
mMainloopTimeout(NULL),
mAgentRegionLastAlive(false),
- mRandomizeFramerate(LLCachedControl<bool>(gSavedSettings,"Randomize Framerate", FALSE)),
- mPeriodicSlowFrame(LLCachedControl<bool>(gSavedSettings,"Periodic Slow Frame", FALSE)),
+ mRandomizeFramerate(LLCachedControl<bool>(gSavedSettings,"Randomize Framerate", false)),
+ mPeriodicSlowFrame(LLCachedControl<bool>(gSavedSettings,"Periodic Slow Frame", false)),
mFastTimerLogThread(NULL),
mSettingsLocationList(NULL),
mIsFirstRun(false)
@@ -948,7 +948,7 @@ bool LLAppViewer::init()
//
// Initialize the window
//
- gGLActive = TRUE;
+ gGLActive = true;
initWindow();
LL_INFOS("InitInfo") << "Window is initialized." << LL_ENDL ;
@@ -1136,7 +1136,7 @@ bool LLAppViewer::init()
LLNotificationsUtil::add("CorruptedProtectedDataStore");
}
- gGLActive = FALSE;
+ gGLActive = false;
#if 0 // LL_RELEASE_FOR_DOWNLOAD && !LL_LINUX
// Skip updater if this is a non-interactive instance
@@ -1344,7 +1344,7 @@ bool LLAppViewer::frame()
}
catch (std::bad_alloc&)
{
- LLMemory::logMemoryInfo(TRUE);
+ LLMemory::logMemoryInfo(true);
LLFloaterMemLeak* mem_leak_instance = LLFloaterReg::findTypedInstance<LLFloaterMemLeak>("mem_leaking");
if (mem_leak_instance)
{
@@ -1526,7 +1526,7 @@ bool LLAppViewer::doFrame()
{
LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df Display");
pingMainloopTimeout("Main:Display");
- gGLActive = TRUE;
+ gGLActive = true;
display();
@@ -1537,7 +1537,7 @@ bool LLAppViewer::doFrame()
gPipeline.mReflectionMapManager.update();
LLFloaterSnapshot::update(); // take snapshots
LLFloaterSimpleSnapshot::update();
- gGLActive = FALSE;
+ gGLActive = false;
}
if (LLViewerStatsRecorder::instanceExists())
@@ -1701,7 +1701,7 @@ bool LLAppViewer::doFrame()
S32 LLAppViewer::updateTextureThreads(F32 max_time)
{
- S32 work_pending = 0;
+ size_t work_pending = 0;
{
LL_PROFILE_ZONE_NAMED_CATEGORY_APP("Texture Cache");
work_pending += LLAppViewer::getTextureCache()->update(max_time); // unpauses the texture cache thread
@@ -1714,7 +1714,7 @@ S32 LLAppViewer::updateTextureThreads(F32 max_time)
LL_PROFILE_ZONE_NAMED_CATEGORY_APP("Image Fetch");
work_pending += LLAppViewer::getTextureFetch()->update(max_time); // unpauses the texture fetch thread
}
- return work_pending;
+ return static_cast<S32>(work_pending);
}
void LLAppViewer::flushLFSIO()
@@ -1780,7 +1780,7 @@ bool LLAppViewer::cleanup()
//flag all elements as needing to be destroyed immediately
// to ensure shutdown order
- LLMortician::setZealous(TRUE);
+ LLMortician::setZealous(true);
// Give any remaining SLPlugin instances a chance to exit cleanly.
LLPluginProcessParent::shutdown();
@@ -1989,7 +1989,7 @@ bool LLAppViewer::cleanup()
// 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);
+ gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), true);
LLUIColorTable::instance().saveUserSettings();
@@ -2008,7 +2008,7 @@ bool LLAppViewer::cleanup()
}
else
{
- gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE);
+ gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), true);
LL_INFOS() << "Saved settings" << LL_ENDL;
if (LLViewerParcelAskPlay::instanceExists())
@@ -2018,7 +2018,7 @@ bool LLAppViewer::cleanup()
}
std::string warnings_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("Default", "Warnings"));
- gWarningSettings.saveToFile(warnings_settings_filename, TRUE);
+ gWarningSettings.saveToFile(warnings_settings_filename, true);
// Save URL history file
LLURLHistory::saveFile("url_history.xml");
@@ -2061,9 +2061,9 @@ bool LLAppViewer::cleanup()
while(1)
{
S32 pending = 0;
- pending += LLAppViewer::getTextureCache()->update(1); // unpauses the worker thread
- pending += LLAppViewer::getImageDecodeThread()->update(1); // unpauses the image thread
- pending += LLAppViewer::getTextureFetch()->update(1); // unpauses the texture fetch thread
+ pending += static_cast<S32>(LLAppViewer::getTextureCache()->update(1)); // unpauses the worker thread
+ pending += static_cast<S32>(LLAppViewer::getImageDecodeThread()->update(1)); // unpauses the image thread
+ pending += static_cast<S32>(LLAppViewer::getTextureFetch()->update(1)); // unpauses the texture fetch thread
pending += LLLFSThread::updateClass(0);
F64 idle_time = idleTimer.getElapsedTimeF64();
if(!pending)
@@ -2387,6 +2387,7 @@ void LLAppViewer::initLoggingAndGetLastDuration()
// Set the log file to SecondLife.log
LLError::logToFile(log_file);
+ LL_INFOS() << "Started logging to " << log_file << LL_ENDL;
if (!duration_log_msg.empty())
{
LL_WARNS("MarkerFile") << duration_log_msg << LL_ENDL;
@@ -2440,7 +2441,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,
&& gSavedSettings.controlExists(file.file_name_setting))
{
// try to find filename stored in file_name_setting control
- full_settings_path = gSavedSettings.getString(file.file_name_setting);
+ full_settings_path = gSavedSettings.getString(file.file_name_setting());
if (full_settings_path.empty())
{
continue;
@@ -2560,7 +2561,7 @@ bool LLAppViewer::initConfiguration()
//Load settings files list
std::string settings_file_list = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "settings_files.xml");
LLXMLNodePtr root;
- BOOL success = LLXMLNode::parseFile(settings_file_list, root, NULL);
+ bool success = LLXMLNode::parseFile(settings_file_list, root, NULL);
if (!success)
{
LL_WARNS() << "Cannot load default configuration file " << settings_file_list << LL_ENDL;
@@ -2627,7 +2628,7 @@ bool LLAppViewer::initConfiguration()
c->setValue(true, false);
}
- gSavedSettings.setBOOL("QAMode", TRUE );
+ gSavedSettings.setBOOL("QAMode", true );
gSavedSettings.setS32("WatchdogEnabled", 0);
#endif
@@ -2689,7 +2690,7 @@ bool LLAppViewer::initConfiguration()
// like determining screen DPI value and so on
mIsFirstRun = true;
- gSavedSettings.setBOOL("FirstRunThisInstall", FALSE);
+ gSavedSettings.setBOOL("FirstRunThisInstall", false);
}
if (clp.hasOption("sessionsettings"))
@@ -2793,7 +2794,7 @@ bool LLAppViewer::initConfiguration()
std::string test_name(gSavedSettings.getString("LogMetrics"));
if (! test_name.empty())
{
- LLTrace::BlockTimer::sMetricLog = TRUE;
+ LLTrace::BlockTimer::sMetricLog = true;
// '--logmetrics' is specified with a named test metric argument so the data gathering is done only on that test
// In the absence of argument, every metric would be gathered (makes for a rather slow run and hard to decipher report...)
LL_INFOS() << "'--logmetrics' argument : " << test_name << LL_ENDL;
@@ -2817,19 +2818,19 @@ bool LLAppViewer::initConfiguration()
if (gSavedSettings.getBOOL("DebugSession"))
{
- gDebugSession = TRUE;
- gDebugGL = TRUE;
+ gDebugSession = true;
+ gDebugGL = true;
ll_init_fail_log(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "test_failures.log"));
}
if (gSavedSettings.getBOOL("RenderDebugGLSession"))
{
- gDebugGLSession = TRUE;
- gDebugGL = TRUE;
+ gDebugGLSession = true;
+ gDebugGL = true;
// gDebugGL can cause excessive logging
// so it's limited to a single session
- gSavedSettings.setBOOL("RenderDebugGLSession", FALSE);
+ gSavedSettings.setBOOL("RenderDebugGLSession", false);
}
const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent");
@@ -2857,10 +2858,10 @@ bool LLAppViewer::initConfiguration()
if (gNonInteractive)
{
- tempSetControl("AllowMultipleViewers", "TRUE");
- tempSetControl("SLURLPassToOtherInstance", "FALSE");
- tempSetControl("RenderWater", "FALSE");
- tempSetControl("FlyingAtExit", "FALSE");
+ tempSetControl("AllowMultipleViewers", "true");
+ tempSetControl("SLURLPassToOtherInstance", "false");
+ tempSetControl("RenderWater", "false");
+ tempSetControl("FlyingAtExit", "false");
tempSetControl("WindowWidth", "1024");
tempSetControl("WindowHeight", "200");
LLError::setEnabledLogTypesMask(0);
@@ -3006,8 +3007,8 @@ bool LLAppViewer::initConfiguration()
LLControlVariable* enable_voice = gSavedSettings.getControl("EnableVoiceChat");
if(enable_voice)
{
- const BOOL DO_NOT_PERSIST = FALSE;
- enable_voice->setValue(LLSD(FALSE), DO_NOT_PERSIST);
+ const bool DO_NOT_PERSIST = false;
+ enable_voice->setValue(LLSD(false), DO_NOT_PERSIST);
}
}
@@ -3123,7 +3124,7 @@ bool LLAppViewer::initWindow()
gHeadlessClient = gSavedSettings.getBOOL("HeadlessClient");
// always start windowed
- BOOL ignorePixelDepth = gSavedSettings.getBOOL("IgnorePixelDepth");
+ bool ignorePixelDepth = gSavedSettings.getBOOL("IgnorePixelDepth");
LLViewerWindow::Params window_params;
window_params
@@ -3196,8 +3197,8 @@ bool LLAppViewer::initWindow()
}
// Set this flag in case we crash while initializing GL
- gSavedSettings.setBOOL("RenderInitError", TRUE);
- gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE );
+ gSavedSettings.setBOOL("RenderInitError", true);
+ gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), true );
gPipeline.init();
LL_INFOS("AppInit") << "gPipeline Initialized" << LL_ENDL;
@@ -3205,8 +3206,8 @@ bool LLAppViewer::initWindow()
stop_glerror();
gViewerWindow->initGLDefaults();
- gSavedSettings.setBOOL("RenderInitError", FALSE);
- gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE );
+ gSavedSettings.setBOOL("RenderInitError", false);
+ gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), true );
//If we have a startup crash, it's usually near GL initialization, so simulate that.
if(gCrashOnStartup)
@@ -3221,7 +3222,7 @@ bool LLAppViewer::initWindow()
if (gSavedSettings.getBOOL("FirstLoginThisInstall") && meetsRequirementsForMaximizedStart())
{
LL_INFOS("AppInit") << "This client met the requirements for a maximized initial screen." << LL_ENDL;
- gSavedSettings.setBOOL("WindowMaximized", TRUE);
+ gSavedSettings.setBOOL("WindowMaximized", true);
}
if (gSavedSettings.getBOOL("WindowMaximized"))
@@ -3388,7 +3389,7 @@ LLSD LLAppViewer::getViewerInfo() const
info["NET_BANDWITH"] = gSavedSettings.getF32("ThrottleBandwidthKBPS");
info["LOD_FACTOR"] = gSavedSettings.getF32("RenderVolumeLODFactor");
info["RENDER_QUALITY"] = (F32)gSavedSettings.getU32("RenderQualityPerformance");
- info["TEXTURE_MEMORY"] = gGLManager.mVRAM;
+ info["TEXTURE_MEMORY"] = LLSD::Integer(gGLManager.mVRAM);
#if LL_DARWIN
info["HIDPI"] = gHiDPISupport;
@@ -3529,7 +3530,7 @@ std::string LLAppViewer::getViewerInfoString(bool default_string) const
else
{
// array value: build KEY_0, KEY_1 etc. entries
- for (LLSD::Integer n(0), size(ii->second.size()); n < size; ++n)
+ for (LLSD::Integer n(0), size(static_cast<LLSD::Integer>(ii->second.size())); n < size; ++n)
{
args[STRINGIZE(ii->first << '_' << n)] = ii->second[n].asString();
}
@@ -3577,9 +3578,9 @@ std::string LLAppViewer::getViewerInfoString(bool default_string) const
void LLAppViewer::cleanupSavedSettings()
{
- gSavedSettings.setBOOL("MouseSun", FALSE);
+ gSavedSettings.setBOOL("MouseSun", false);
- gSavedSettings.setBOOL("UseEnergy", TRUE); // force toggle to turn off, since sends message to simulator
+ gSavedSettings.setBOOL("UseEnergy", true); // force toggle to turn off, since sends message to simulator
gSavedSettings.setBOOL("DebugWindowProc", gDebugWindowProc);
@@ -3594,7 +3595,7 @@ void LLAppViewer::cleanupSavedSettings()
// as we don't track it in callbacks
if(NULL != gViewerWindow)
{
- BOOL maximized = gViewerWindow->getWindow()->getMaximized();
+ bool maximized = gViewerWindow->getWindow()->getMaximized();
if (!maximized)
{
LLCoordScreen window_pos;
@@ -3772,7 +3773,7 @@ void LLAppViewer::recordMarkerVersion(LLAPRFile& marker_file)
}
// record the viewer version in the marker file
- marker_file.write(marker_version.data(), marker_version.length());
+ marker_file.write(marker_version.data(), static_cast<S32>(marker_version.length()));
}
bool LLAppViewer::markerIsSameVersion(const std::string& marker_name) const
@@ -3871,7 +3872,7 @@ void LLAppViewer::processMarkerFiles()
initLoggingAndGetLastDuration();
// Create the marker file for this execution & lock it; it will be deleted on a clean exit
apr_status_t s;
- s = mMarkerFile.open(mMarkerFileName, LL_APR_WB, TRUE);
+ s = mMarkerFile.open(mMarkerFileName, LL_APR_WB, true);
if (s == APR_SUCCESS && mMarkerFile.getFileHandle())
{
@@ -4059,7 +4060,7 @@ void LLAppViewer::requestQuit()
gAgentAvatarp->updateAvatarRezMetrics(true); // force a last packet to be sent.
}
- LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE);
+ LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, true);
effectp->setPositionGlobal(gAgent.getPositionGlobal());
effectp->setColor(LLColor4U(gAgent.getEffectColor()));
LLHUDManager::getInstance()->sendEffects();
@@ -4118,7 +4119,7 @@ static bool finish_early_exit(const LLSD& notification, const LLSD& response)
void LLAppViewer::earlyExit(const std::string& name, const LLSD& substitutions)
{
LL_WARNS() << "app_early_exit: " << name << LL_ENDL;
- gDoDisconnect = TRUE;
+ gDoDisconnect = true;
LLNotificationsUtil::add(name, substitutions, LLSD(), finish_early_exit);
}
@@ -4126,7 +4127,7 @@ void LLAppViewer::earlyExit(const std::string& name, const LLSD& substitutions)
void LLAppViewer::earlyExitNoNotify()
{
LL_WARNS() << "app_early_exit with no notification: " << LL_ENDL;
- gDoDisconnect = TRUE;
+ gDoDisconnect = true;
finish_early_exit( LLSD(), LLSD() );
}
@@ -4157,7 +4158,7 @@ void LLAppViewer::migrateCacheDirectory()
// Only do this once per fresh install of this version.
if (gSavedSettings.getBOOL("MigrateCacheDirectory"))
{
- gSavedSettings.setBOOL("MigrateCacheDirectory", FALSE);
+ gSavedSettings.setBOOL("MigrateCacheDirectory", false);
std::string old_cache_dir = gDirUtilp->add(gDirUtilp->getOSUserAppDir(), "cache");
std::string new_cache_dir = gDirUtilp->getCacheDir(true);
@@ -4240,7 +4241,7 @@ U32 LLAppViewer::getObjectCacheVersion()
bool LLAppViewer::initCache()
{
mPurgeCache = false;
- BOOL read_only = mSecondInstance ? TRUE : FALSE;
+ bool read_only = mSecondInstance;
LLAppViewer::getTextureCache()->setReadOnly(read_only) ;
LLVOCache::initParamSingleton(read_only);
@@ -4265,7 +4266,7 @@ bool LLAppViewer::initCache()
if (gSavedSettings.getS32("LocalCacheVersion") != LLAppViewer::getTextureCacheVersion())
{
texture_cache_mismatch = true;
- if(!read_only)
+ if (!read_only)
{
gSavedSettings.setS32("LocalCacheVersion", LLAppViewer::getTextureCacheVersion());
@@ -4274,7 +4275,7 @@ bool LLAppViewer::initCache()
}
}
- if(!read_only)
+ if (!read_only)
{
// Purge cache if user requested it
if (gSavedSettings.getBOOL("PurgeCacheOnStartup") ||
@@ -4449,7 +4450,7 @@ void LLAppViewer::forceDisconnect(const std::string& mesg)
}
LLSD args;
- gDoDisconnect = TRUE;
+ gDoDisconnect = true;
if (LLStartUp::getStartupState() < STATE_STARTED)
{
@@ -4472,7 +4473,7 @@ void LLAppViewer::badNetworkHandler()
// Flush all of our caches on exit in the case of disconnect due to
// invalid packets.
- mPurgeCacheOnExit = TRUE;
+ mPurgeCacheOnExit = true;
std::ostringstream message;
message <<
@@ -4500,8 +4501,8 @@ void LLAppViewer::saveFinalSnapshot()
gSavedSettings.setVector3d("FocusPosOnLogout", gAgentCamera.calcFocusPositionTargetGlobal());
gSavedSettings.setVector3d("CameraPosOnLogout", gAgentCamera.calcCameraPositionTargetGlobal());
gViewerWindow->setCursor(UI_CURSOR_WAIT);
- gAgentCamera.changeCameraToThirdPerson( FALSE ); // don't animate, need immediate switch
- gSavedSettings.setBOOL("ShowParcelOwners", FALSE);
+ gAgentCamera.changeCameraToThirdPerson( false ); // don't animate, need immediate switch
+ gSavedSettings.setBOOL("ShowParcelOwners", false);
idle();
std::string snap_filename = gDirUtilp->getLindenUserDir();
@@ -4511,12 +4512,12 @@ void LLAppViewer::saveFinalSnapshot()
gViewerWindow->saveSnapshot(snap_filename,
gViewerWindow->getWindowWidthRaw(),
gViewerWindow->getWindowHeightRaw(),
- FALSE,
+ false,
gSavedSettings.getBOOL("RenderHUDInSnapshot"),
- TRUE,
+ true,
LLSnapshotModel::SNAPSHOT_TYPE_COLOR,
LLSnapshotModel::SNAPSHOT_FORMAT_PNG);
- mSavedFinalSnapshot = TRUE;
+ mSavedFinalSnapshot = true;
if (gAgent.isInHomeRegion())
{
@@ -4704,13 +4705,13 @@ void LLAppViewer::idle()
if (LLStartUp::getStartupState() < STATE_STARTED)
{
// Skip rest if idle startup returns false (essentially, no world yet)
- gGLActive = TRUE;
+ gGLActive = true;
if (!idle_startup())
{
- gGLActive = FALSE;
+ gGLActive = false;
return;
}
- gGLActive = FALSE;
+ gGLActive = false;
}
@@ -4746,7 +4747,7 @@ void LLAppViewer::idle()
F32 agent_update_time = agent_update_timer.getElapsedTimeF32();
F32 agent_force_update_time = mLastAgentForceUpdate + agent_update_time;
bool timed_out = agent_update_time > (1.0f / (F32)AGENT_UPDATES_PER_SECOND);
- BOOL force_send =
+ bool force_send =
// if there is something to send
(gAgent.controlFlagsDirty() && timed_out)
// if something changed
@@ -5059,7 +5060,7 @@ void LLAppViewer::idle()
// forcibly quit if it has taken too long
if (mQuitRequested)
{
- gGLActive = TRUE;
+ gGLActive = true;
idleShutdown();
}
}
@@ -5117,7 +5118,7 @@ void LLAppViewer::idleShutdown()
static S32 total_uploads = 0;
// Sometimes total upload count can change during logout.
total_uploads = llmax(total_uploads, pending_uploads);
- gViewerWindow->setShowProgress(TRUE);
+ gViewerWindow->setShowProgress(true);
S32 finished_uploads = total_uploads - pending_uploads;
F32 percent = 100.f * finished_uploads / total_uploads;
gViewerWindow->setProgressPercent(percent);
@@ -5129,7 +5130,7 @@ void LLAppViewer::idleShutdown()
&& gLogoutTimer.getElapsedTimeF32() < SHUTDOWN_UPLOAD_SAVE_TIME
&& !logoutRequestSent())
{
- gViewerWindow->setShowProgress(TRUE);
+ gViewerWindow->setShowProgress(true);
gViewerWindow->setProgressPercent(100.f);
gViewerWindow->setProgressString(LLTrans::getString("LoggingOut"));
return;
@@ -5141,7 +5142,7 @@ void LLAppViewer::idleShutdown()
sendLogoutRequest();
// Wait for a LogoutReply message
- gViewerWindow->setShowProgress(TRUE);
+ gViewerWindow->setShowProgress(true);
gViewerWindow->setProgressPercent(100.f);
gViewerWindow->setProgressString(LLTrans::getString("LoggingOut"));
return;
@@ -5161,7 +5162,7 @@ void LLAppViewer::sendLogoutRequest()
if(!mLogoutRequestSent && gMessageSystem)
{
//Set internal status variables and marker files before actually starting the logout process
- gLogoutInProgress = TRUE;
+ gLogoutInProgress = true;
if (!mSecondInstance)
{
mLogoutMarkerFileName = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,LOGOUT_MARKER_FILE_NAME);
@@ -5191,7 +5192,7 @@ void LLAppViewer::sendLogoutRequest()
gLogoutTimer.reset();
gLogoutMaxTime = LOGOUT_REQUEST_TIME;
- mLogoutRequestSent = TRUE;
+ mLogoutRequestSent = true;
if(LLVoiceClient::instanceExists())
{
@@ -5216,7 +5217,7 @@ void LLAppViewer::updateNameLookupUrl(const LLViewerRegion * regionp)
if (have_capability)
{
// we have support for display names, use it
- U32 url_size = name_lookup_url.size();
+ auto url_size = name_lookup_url.size();
// capabilities require URLs with slashes before query params:
// https://<host>:<port>/cap/<uuid>/?ids=<blah>
// but the caps are granted like:
@@ -5241,6 +5242,11 @@ void LLAppViewer::updateNameLookupUrl(const LLViewerRegion * regionp)
}
}
+void LLAppViewer::postToMainCoro(const LL::WorkQueue::Work& work)
+{
+ gMainloopWork.post(work);
+}
+
void LLAppViewer::idleNameCache()
{
// Neither old nor new name cache can function before agent has a region
@@ -5363,7 +5369,7 @@ void LLAppViewer::idleNetwork()
if (gPrintMessagesThisFrame)
{
LL_INFOS() << "Decoded " << total_decoded << " msgs this frame!" << LL_ENDL;
- gPrintMessagesThisFrame = FALSE;
+ gPrintMessagesThisFrame = false;
}
}
add(LLStatViewer::NUM_NEW_OBJECTS, gObjectList.mNumNewObjects);
@@ -5462,7 +5468,7 @@ void LLAppViewer::disconnectViewer()
LLDestroyClassList::instance().fireCallbacks();
cleanup_xfer_manager();
- gDisconnected = TRUE;
+ gDisconnected = true;
// Pass the connection state to LLUrlEntryParcel not to attempt
// parcel info requests while disconnected.