fix broken detection of desktop resolution on linux

This commit is contained in:
Chris Forbes
2011-07-11 23:48:11 +12:00
committed by Paul Chote
parent 88d0c9238c
commit 6f477a2c14
4 changed files with 33 additions and 11 deletions

View File

@@ -56,7 +56,7 @@ namespace OpenRA.GameRules
{
public string Renderer = "Gl";
public WindowMode Mode = WindowMode.PseudoFullscreen;
public int2 FullscreenSize = new int2(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
public int2 FullscreenSize = new int2(0,0);
public int2 WindowedSize = new int2(1024, 768);
public readonly int2 MinResolution = new int2(800, 600);

View File

@@ -125,18 +125,11 @@ namespace OpenRA.Graphics
static Size GetResolution(WindowMode windowmode)
{
var desktopResolution = Screen.PrimaryScreen.Bounds.Size;
var customSize = (windowmode == WindowMode.Windowed)
var size = (windowmode == WindowMode.Windowed)
? Game.Settings.Graphics.WindowedSize
: Game.Settings.Graphics.FullscreenSize;
if (customSize.X > 0 && customSize.Y > 0)
{
desktopResolution.Width = customSize.X;
desktopResolution.Height = customSize.Y;
}
return desktopResolution;
return new Size(size.X, size.Y);
}
static IGraphicsDevice CreateDevice( Assembly rendererDll, int width, int height, WindowMode window, bool vsync )