summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2013-06-28 15:26:18 -0400
committerNat Goodspeed <nat@lindenlab.com>2013-06-28 15:26:18 -0400
commitc08b60ac6fee74f613ed3f5f8702291ed1c2376f (patch)
tree9ee7649080868dbb73766e8cd89720f364fe08cb /indra/newview/llappviewer.cpp
parent4a9b688b4d46f67e1b00e04ebe972470b61e560a (diff)
CHOP-959: Streamline processing for --graphicslevel switch.
Use map-to in cmd_line.xml to inform the command-line processor that the target variable for --graphicslevel is RenderQualityPerformance. That lets us eliminate clunky llappviewer.cpp switch from '0' to 0, etc. Moreover, previous switch statement only accepted 0 - 3, whereas LLFeatureManager::setGraphicsLevel() actually accepts 0 - 6. Introduce LLFeatureManager::isValidGraphicsLevel() and use that to validate. Replace switch statement in setGraphicsLevel() mapping int constants to string literals with static vector of level names, using same data for mapping as for validating level numbers.
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rwxr-xr-xindra/newview/llappviewer.cpp43
1 files changed, 4 insertions, 39 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index f92274dbbd..5b301c03a1 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2311,13 +2311,6 @@ bool LLAppViewer::initConfiguration()
{
//Load settings files list
std::string settings_file_list = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "settings_files.xml");
- //LLControlGroup settings_control("SettingsFiles");
- //llinfos << "Loading settings file list " << settings_file_list << llendl;
- //if (0 == settings_control.loadFromFile(settings_file_list))
- //{
- // llerrs << "Cannot load default configuration file " << settings_file_list << llendl;
- //}
-
LLXMLNodePtr root;
BOOL success = LLXMLNode::parseFile(settings_file_list, root, NULL);
if (!success)
@@ -2376,9 +2369,7 @@ bool LLAppViewer::initConfiguration()
{
c->setValue(true, false);
}
-#endif
-#ifndef LL_RELEASE_FOR_DOWNLOAD
gSavedSettings.setBOOL("QAMode", TRUE );
gSavedSettings.setS32("WatchdogEnabled", 0);
#endif
@@ -2582,36 +2573,10 @@ bool LLAppViewer::initConfiguration()
if (clp.hasOption("graphicslevel"))
{
- const LLCommandLineParser::token_vector_t& value = clp.getOption("graphicslevel");
- if(value.size() != 1)
- {
- llwarns << "Usage: -graphicslevel <0-3>" << llendl;
- }
- else
- {
- std::string detail = value.front();
- mForceGraphicsDetail = TRUE;
-
- switch (detail.c_str()[0])
- {
- case '0':
- gSavedSettings.setU32("RenderQualityPerformance", 0);
- break;
- case '1':
- gSavedSettings.setU32("RenderQualityPerformance", 1);
- break;
- case '2':
- gSavedSettings.setU32("RenderQualityPerformance", 2);
- break;
- case '3':
- gSavedSettings.setU32("RenderQualityPerformance", 3);
- break;
- default:
- mForceGraphicsDetail = FALSE;
- llwarns << "Usage: -graphicslevel <0-3>" << llendl;
- break;
- }
- }
+ // User explicitly requested --graphicslevel on the command line.
+ // We expect this switch has already set RenderQualityPerformance.
+ mForceGraphicsDetail =
+ LLFeatureManager::instance().isValidGraphicsLevel(gSavedSettings.getU32("RenderQualityPerformance"));
}
if (clp.hasOption("analyzeperformance"))