public ActionResult SystemPreferences(SystemPreferences preferences)
        {
            var path = _configuration["PlayStationClassic:SystemPreferencesPath"];

            System.IO.File.WriteAllText(path, preferences.ToString());

            return(View(preferences));
        }
Beispiel #2
0
        public override SystemPreferences GetSystemPreferences()
        {
            // Create or load the platform preferences.
            SystemPreferences preferences = new SystemPreferences();

            preferences.EffectDetail = DetailPreference.High;
            preferences.LightingDetail = DetailPreference.High;
            preferences.ShadowDetail = DetailPreference.High;
            preferences.ShadowQuality = 1.0f;
            preferences.PostProcessingDetail = DetailPreference.High;
            preferences.TextureSampling = SamplingPreference.Anisotropic;
            preferences.MaxAnisotropy = 4;

            return preferences;
        }
        public ActionResult SystemPreferences()
        {
            SystemPreferences preferences;

            try
            {
                var preferencesString = System.IO.File.ReadAllText(_configuration["PlayStationClassic:SystemPreferencesPath"]);
                preferences = new SystemPreferences(preferencesString);
            } catch
            {
                preferences = new SystemPreferences();
            }

            return(View(preferences));
        }
Beispiel #4
0
        protected Application(string name, string contentDirectory, params Language[] supportedLanguages)
        {
            // set the game title
            Name = name;

            // set the default content directory
            Content.RootDirectory = contentDirectory;

            // set the static instance
            Instance = this;

            IsFixedTimeStep   = true;
            TargetElapsedTime = TimeSpan.FromMilliseconds(1000d / 60d);

            EnableClearDevice = true;
            ClearDeviceColor  = Color.Black;

            // create our GraphicsDeviceManager instance
            GraphicsDeviceManager = new GraphicsDeviceManager(this)
            {
                SynchronizeWithVerticalRetrace = true,
#if !WINDOWS_PHONE
                PreferredBackBufferWidth  = 1280,
                PreferredBackBufferHeight = 720,
#else
                PreferredBackBufferWidth  = 800,
                PreferredBackBufferHeight = 480,
#endif
            };

            GraphicsDeviceManager.PreparingDeviceSettings += (sender, e) =>
            {
#if WINDOWS
                // improves overall performance with dynamic shadows.
                e.GraphicsDeviceInformation.
                PresentationParameters.
                RenderTargetUsage =
                    RenderTargetUsage.PlatformContents;
#else
                // improves overall performance with dynamic shadows.
                e.GraphicsDeviceInformation.
                PresentationParameters.
                RenderTargetUsage =
                    RenderTargetUsage.PreserveContents;
#endif
                // Used for advanced edge cleanup.
                e.GraphicsDeviceInformation.
                PresentationParameters.
                DepthStencilFormat =
                    DepthFormat.Depth24Stencil8;
            };

            try
            {
                // create the SunBurn required SunBurnCoreSystem instance
                SunBurnCoreSystem = new SunBurnCoreSystem(Services, Content)
                {
                    DetectOverSizedFrameBuffers = false
                };
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            // create the SunBurn SunBurnSystemPreferences instance used when creating a new SceneInterface instance: defaults to average quality
            SunBurnSystemPreferences = new SystemPreferences
            {
                EffectDetail         = DetailPreference.Medium,
                LightingDetail       = DetailPreference.Medium,
                MaxAnisotropy        = 4,
                PostProcessingDetail = DetailPreference.Medium,
                ShadowDetail         = DetailPreference.Medium,
                ShadowQuality        = 2.0f,
                TextureSampling      = SamplingPreference.Anisotropic,
            };

            // create and register InputManager instance for the game.
            new InputManager(this);

            // create and register StorageManager instance for the game.
            new StorageManager(this);
            StorageSettings.SetSupportedLanguages(supportedLanguages);

            // create our Thread pool
            Threads = new ThreadPool();
            Window.ClientSizeChanged += (sender, args) =>
            {
                Graphics.PreferredBackBufferWidth  = Window.ClientBounds.Width;
                Graphics.PreferredBackBufferHeight = Window.ClientBounds.Height;
                Graphics.ApplyChanges();
            };
        }