コード例 #1
0
ファイル: MainWindow.cs プロジェクト: Regenhardt/Librelancer
 public MainWindow() : base(800, 600, false)
 {
     Version     = "LancerEdit " + Platform.GetInformationalVersion <MainWindow>();
     MaterialMap = new MaterialMap();
     MaterialMap.AddRegex(new LibreLancer.Ini.StringKeyValue("^nomad.*$", "NomadMaterialNoBendy"));
     MaterialMap.AddRegex(new LibreLancer.Ini.StringKeyValue("^n-texture.*$", "NomadMaterialNoBendy"));
     FLLog.UIThread   = this;
     FLLog.AppendLine = (x, severity) =>
     {
         logText.AppendLine(x);
         if (logText.Length > 16384)
         {
             logText.Remove(0, logText.Length - 16384);
         }
         logBuffer.SetText(logText.ToString());
         if (severity == LogSeverity.Error)
         {
             errorTimer = 9;
             Bell.Play();
         }
     };
     Config      = EditorConfiguration.Load();
     logBuffer   = new TextBuffer(32768);
     recentFiles = new RecentFilesHandler(OpenFile);
 }
コード例 #2
0
        public OptionsWindow(MainWindow win)
        {
            config    = win.Config;
            rstate    = win.RenderState;
            guiHelper = win.guiHelper;
            vps       = win.Viewport;

            var texturefilters = new List <string>(defaultFilters);

            if (win.RenderState.MaxAnisotropy > 0)
            {
                anisotropyLevels = win.RenderState.GetAnisotropyLevels();
                foreach (var lvl in anisotropyLevels)
                {
                    texturefilters.Add(string.Format("Anisotropic {0}x", lvl));
                }
            }
            var msaa = new List <int> {
                0
            };
            int a = 2;

            while (a <= win.RenderState.MaxSamples)
            {
                msaa.Add(a);
                a *= 2;
            }
            msaaLevels = msaa.ToArray();
            switch (config.MSAA)
            {
            case 2:
                cMsaa = 1;
                break;

            case 4:
                cMsaa = 2;
                break;

            case 8:
                cMsaa = 3;
                break;

            case 16:
                cMsaa = 4;
                break;

            case 32:
                cMsaa = 5;
                break;
            }
            filters = texturefilters.ToArray();
            cFilter = config.TextureFilter;
            SetTexFilter();
        }