Example #1
0
 private static void CopyGraphicsVolatileConfig(ConfigGraphicsVolatileSetting from, ref ConfigGraphicsVolatileSetting to)
 {
     to.PostFXGrade    = from.PostFXGrade;
     to.UsePostFX      = from.UsePostFX;
     to.UseDistortion  = from.UseDistortion;
     to.UseDynamicBone = from.UseDynamicBone;
     to.UseFXAA        = from.UseFXAA;
     to.UseHDR         = from.UseHDR;
     to.UseReflection  = from.UseReflection;
 }
Example #2
0
        private static ConfigGraphicsSetting GetGraphicsEcoModeConfig(string platformName)
        {
            if (!_recommendSettingGroupMap.ContainsKey(platformName))
            {
                return(null);
            }
            bool flag = false;
            ConfigGraphicsRecommendSetting config = _recommendSettingGroupMap[platformName].GetConfig <ConfigGraphicsRecommendSetting>("EcoMode");

            if (config == null)
            {
                flag   = true;
                config = (ConfigGraphicsRecommendSetting)_recommendSettingGroupMap[platformName].Default;
            }
            ConfigGraphicsSetting setting2 = new ConfigGraphicsSetting {
                PostFxGradeBufferSize = config.PostFxGradeBufferSize,
                RecommendResolutionX  = config.RecommendResolutionX,
                RecommendResolutionY  = config.RecommendResolutionY,
                ResolutionPercentage  = config.ResolutionPercentage,
                ResolutionQuality     = !flag ? config.ResolutionQuality : ResolutionQualityGrade.Low,
                TargetFrameRate       = !flag ? config.TargetFrameRate : 30,
                ContrastDelta         = 0f
            };
            ConfigGraphicsVolatileSetting from = _recommendVolatileSettingGroup.GetConfig <ConfigGraphicsVolatileSetting>((!flag ? config.RecommendGrade : GraphicsRecommendGrade.Off).ToString());

            setting2.VolatileSetting = new ConfigGraphicsVolatileSetting();
            CopyGraphicsVolatileConfig(from, ref setting2.VolatileSetting);
            GraphicsRecommendGrade graphicsRecommendGrade = GetGraphicsRecommendGrade();

            setting2.VolatileSetting.UsePostFX = graphicsRecommendGrade >= GraphicsRecommendGrade.High;
            setting2.VolatileSetting.UseHDR    = graphicsRecommendGrade >= GraphicsRecommendGrade.High;
            ConfigGraphicsPersonalSetting personalGraphicsSetting = Singleton <MiHoYoGameData> .Instance.GeneralLocalData.PersonalGraphicsSetting;

            if (personalGraphicsSetting.IsUserDefinedVolatile && !personalGraphicsSetting.VolatileSetting.UsePostFX)
            {
                setting2.VolatileSetting.UsePostFX = false;
            }
            if (personalGraphicsSetting.IsUserDefinedVolatile && !personalGraphicsSetting.VolatileSetting.UseHDR)
            {
                setting2.VolatileSetting.UseHDR = false;
            }
            return(setting2);
        }
Example #3
0
        private static ConfigGraphicsSetting GetGraphicsRecommendCompleteConfig(string platformName, string deviceModel, GraphicsRecommendGrade grade)
        {
            if (!_recommendSettingGroupMap.ContainsKey(platformName))
            {
                return(null);
            }
            ConfigGraphicsRecommendSetting graphicsRecommendConfig = GetGraphicsRecommendConfig(platformName, deviceModel);
            ConfigGraphicsSetting          setting2 = new ConfigGraphicsSetting {
                PostFxGradeBufferSize = graphicsRecommendConfig.PostFxGradeBufferSize,
                RecommendResolutionX  = graphicsRecommendConfig.RecommendResolutionX,
                RecommendResolutionY  = graphicsRecommendConfig.RecommendResolutionY,
                ResolutionPercentage  = graphicsRecommendConfig.ResolutionPercentage,
                ResolutionQuality     = graphicsRecommendConfig.ResolutionQuality,
                TargetFrameRate       = graphicsRecommendConfig.TargetFrameRate,
                ContrastDelta         = 0f
            };
            ConfigGraphicsVolatileSetting config = _recommendVolatileSettingGroup.GetConfig <ConfigGraphicsVolatileSetting>(grade.ToString());

            setting2.VolatileSetting = new ConfigGraphicsVolatileSetting();
            CopyGraphicsVolatileConfig(config, ref setting2.VolatileSetting);
            return(setting2);
        }