FIRE-22130: Move RenderVolumeLODFactor reset code to prevent cheating around and load the recommended setting from feature table if available Firestorm_5.0.11

Mon, 08 Jan 2018 11:52:03 +0100

author
Ansariel
date
Mon, 08 Jan 2018 11:52:03 +0100
branch
Firestorm_5.0.11
changeset 53591
cd6eec5f38ca
parent 53590
6b42b6106786
child 53592
bb849e9bc0fc

FIRE-22130: Move RenderVolumeLODFactor reset code to prevent cheating around and load the recommended setting from feature table if available

indra/newview/llstartup.cpp file | annotate | diff | revisions
     1.1 --- a/indra/newview/llstartup.cpp	Mon Jan 08 10:38:49 2018 +0100
     1.2 +++ b/indra/newview/llstartup.cpp	Mon Jan 08 11:52:03 2018 +0100
     1.3 @@ -1072,6 +1072,36 @@
     1.4  		// *TODO: Does this need to be here?
     1.5  		LLStringOps::setupDatetimeInfo(false);
     1.6  
     1.7 +		// <FS:Beq> [FIRE-22130] for LOD Factors > 4 reset to the detected dafault 
     1.8 +		if (gSavedSettings.getF32("RenderVolumeLODFactor") > 4.f)
     1.9 +		{
    1.10 +			bool feature_table_success = false;
    1.11 +			LLFeatureManager& feature_manager = LLFeatureManager::instance();
    1.12 +			U32 level = gSavedSettings.getU32("RenderQualityPerformance");
    1.13 +			if (feature_manager.isValidGraphicsLevel(level))
    1.14 +			{
    1.15 +				std::string level_name = feature_manager.getNameForGraphicsLevel(level);
    1.16 +				LLFeatureList* feature_list = feature_manager.findMask(level_name);
    1.17 +				if (feature_list)
    1.18 +				{
    1.19 +					F32 new_val = feature_list->getRecommendedValue("RenderVolumeLODFactor");
    1.20 +					if (new_val > 0.f)
    1.21 +					{
    1.22 +						feature_table_success = true;
    1.23 +						gSavedSettings.setF32("RenderVolumeLODFactor", new_val);
    1.24 +						LL_INFOS("AppInit") << "LOD Factor too high. Resetting to recommended value for graphics level '" << level_name << "': " << new_val << LL_ENDL;
    1.25 +					}
    1.26 +				}
    1.27 +			}
    1.28 +
    1.29 +			if (!feature_table_success)
    1.30 +			{
    1.31 +				gSavedSettings.getControl("RenderVolumeLODFactor")->resetToDefault(true);
    1.32 +				LL_INFOS("AppInit") << "LOD Factor too high. Resetting to recommended value for global default: " << gSavedSettings.getF32("RenderVolumeLODFactor") << LL_ENDL;
    1.33 +			}
    1.34 +		}
    1.35 +		// </FS:Beq>
    1.36 +
    1.37  		// Go to the next startup state
    1.38  		LLStartUp::setStartupState( STATE_BROWSER_INIT );
    1.39  		return FALSE;
    1.40 @@ -3038,20 +3068,6 @@
    1.41  	//LLPanelLogin::show(	gViewerWindow->getWindowRectScaled(), login_callback, NULL );
    1.42  	FSPanelLogin::show(	gViewerWindow->getWindowRectScaled(), login_callback, NULL );
    1.43  	// </FS:Ansariel> [FS Login Panel]
    1.44 -
    1.45 -	// <FS:Beq> [FIRE-22130] for LOD Factors > 4 reset to the detected dafault 
    1.46 -	F32 old_val = gSavedSettings.getF32("RenderVolumeLODFactor");
    1.47 -	if (old_val > 4.0f)
    1.48 -	{
    1.49 -		U32 gfx_level = gSavedSettings.getU32("RenderQualityPerformance");
    1.50 -		F32 new_val = 2.0; //majority
    1.51 -		if (gfx_level == 0) new_val = 1.125; // low = 0
    1.52 -		if (gfx_level > 5) new_val = 3.0;    // ultra = 6
    1.53 -		gSavedSettings.setF32("RenderVolumeLODFactor", new_val);
    1.54 -		LL_INFOS("AppInit") << "LOD Factor reset to sane value. Was " << old_val << " now " << gSavedSettings.getF32("RenderVolumeLODFactor") << LL_ENDL;
    1.55 -	}
    1.56 -	// </FS:Beq>
    1.57 -
    1.58  }
    1.59  
    1.60  // Callback for when login screen is closed.  Option 0 = connect, option 1 = quit.

mercurial