1
0
mirror of https://github.com/ppy/osu synced 2024-12-14 02:46:27 +00:00

Use DisplayModes rather than AvailableResolutions

This commit is contained in:
Shane Woolcock 2020-04-05 13:01:10 +09:30
parent e012af6616
commit 2fec8b7b85

View File

@ -209,15 +209,16 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
private IReadOnlyList<Size> getResolutions()
{
var resolutions = new List<Size> { new Size(9999, 9999) };
var currentDisplay = game.Window?.CurrentDisplay.Value;
if (game.Window != null)
if (currentDisplay != null)
{
resolutions.AddRange(game.Window.AvailableResolutions
.Where(r => r.Width >= 800 && r.Height >= 600)
.OrderByDescending(r => r.Width)
.ThenByDescending(r => r.Height)
.Select(res => new Size(res.Width, res.Height))
.Distinct());
resolutions.AddRange(currentDisplay.DisplayModes
.Where(m => m.Size.Width >= 800 && m.Size.Height >= 600)
.OrderByDescending(m => m.Size.Width)
.ThenByDescending(m => m.Size.Height)
.Select(m => m.Size)
.Distinct());
}
return resolutions;