Fullscreen -> WindowMode; defaults to pseudofullscreen which does hax on windows, falls back to normal fullscreen for everyone else.
This commit is contained in:
@@ -575,9 +575,8 @@ namespace OpenRA
|
||||
|
||||
Renderer.SheetSize = Settings.SheetSize;
|
||||
|
||||
bool windowed = !Game.Settings.Fullscreen;
|
||||
var resolution = GetResolution(settings);
|
||||
renderer = new Renderer(resolution, windowed);
|
||||
renderer = new Renderer(resolution, Game.Settings.WindowMode);
|
||||
resolution = renderer.Resolution;
|
||||
|
||||
controller = new Controller();
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using OpenRA.FileFormats.Graphics;
|
||||
|
||||
namespace OpenRA.GameRules
|
||||
{
|
||||
public class UserSettings
|
||||
@@ -32,7 +34,7 @@ namespace OpenRA.GameRules
|
||||
// Window settings
|
||||
public readonly int Width = 0;
|
||||
public readonly int Height = 0;
|
||||
public readonly bool Fullscreen = false;
|
||||
public readonly WindowMode WindowMode = WindowMode.PseudoFullscreen;
|
||||
public bool MusicPlayer = true;
|
||||
|
||||
// Internal game settings
|
||||
|
||||
@@ -51,9 +51,9 @@ namespace OpenRA.Graphics
|
||||
|
||||
public Size Resolution { get { return device.WindowSize; } }
|
||||
|
||||
public Renderer(Size resolution, bool windowed)
|
||||
public Renderer(Size resolution, OpenRA.FileFormats.Graphics.WindowMode windowMode)
|
||||
{
|
||||
device = CreateDevice( Assembly.LoadFile( Path.GetFullPath( "OpenRA.Gl.dll" ) ), resolution.Width, resolution.Height, windowed, false );
|
||||
device = CreateDevice( Assembly.LoadFile( Path.GetFullPath( "OpenRA.Gl.dll" ) ), resolution.Width, resolution.Height, windowMode, false );
|
||||
|
||||
SpriteShader = device.CreateShader(FileSystem.Open("shaders/world-shp.fx"));
|
||||
LineShader = device.CreateShader(FileSystem.Open("shaders/line.fx"));
|
||||
@@ -69,12 +69,12 @@ namespace OpenRA.Graphics
|
||||
TitleFont = new SpriteFont(this, "titles.ttf", 48);
|
||||
}
|
||||
|
||||
IGraphicsDevice CreateDevice( Assembly rendererDll, int width, int height, bool windowed, bool vsync )
|
||||
IGraphicsDevice CreateDevice( Assembly rendererDll, int width, int height, WindowMode window, bool vsync )
|
||||
{
|
||||
foreach( RendererAttribute r in rendererDll.GetCustomAttributes( typeof( RendererAttribute ), false ) )
|
||||
{
|
||||
return (IGraphicsDevice)r.Type.GetConstructor( new Type[] { typeof( int ), typeof( int ), typeof( bool ), typeof( bool ) } )
|
||||
.Invoke( new object[] { width, height, windowed, vsync } );
|
||||
return (IGraphicsDevice)r.Type.GetConstructor( new Type[] { typeof( int ), typeof( int ), typeof( WindowMode ), typeof( bool ) } )
|
||||
.Invoke( new object[] { width, height, window, vsync } );
|
||||
}
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user