Move hardware cursor control to hidden DisableHardwareCursors setting.

This commit is contained in:
Paul Chote
2020-01-19 00:18:53 +00:00
committed by Matthias Mailänder
parent 370f7a44fa
commit f730b55255
5 changed files with 9 additions and 27 deletions

View File

@@ -40,8 +40,7 @@ namespace OpenRA.Graphics
public CursorManager(CursorProvider cursorProvider) public CursorManager(CursorProvider cursorProvider)
{ {
// Cursor settings are applied on game start hardwareCursorsDisabled = Game.Settings.Graphics.DisableHardwareCursors;
hardwareCursorsDisabled = !Game.Settings.Graphics.HardwareCursors;
graphicSettings = Game.Settings.Graphics; graphicSettings = Game.Settings.Graphics;
sheetBuilder = new SheetBuilder(SheetType.BGRA); sheetBuilder = new SheetBuilder(SheetType.BGRA);

View File

@@ -154,8 +154,6 @@ namespace OpenRA
[Desc("Screen resolution in windowed mode.")] [Desc("Screen resolution in windowed mode.")]
public int2 WindowedSize = new int2(1024, 768); public int2 WindowedSize = new int2(1024, 768);
public bool HardwareCursors = true;
public bool CursorDouble = false; public bool CursorDouble = false;
public WorldViewport ViewportDistance = WorldViewport.Medium; public WorldViewport ViewportDistance = WorldViewport.Medium;
@@ -174,6 +172,9 @@ namespace OpenRA
[Desc("Disable the OpenGL debug message callback feature.")] [Desc("Disable the OpenGL debug message callback feature.")]
public bool DisableGLDebugMessageCallback = false; public bool DisableGLDebugMessageCallback = false;
[Desc("Disable operating-system provided cursor rendering.")]
public bool DisableHardwareCursors = false;
[Desc("Use OpenGL ES if both ES and regular OpenGL are available.")] [Desc("Use OpenGL ES if both ES and regular OpenGL are available.")]
public bool PreferGLES = false; public bool PreferGLES = false;

View File

@@ -26,7 +26,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
static readonly WindowMode OriginalGraphicsMode; static readonly WindowMode OriginalGraphicsMode;
static readonly int2 OriginalGraphicsWindowedSize; static readonly int2 OriginalGraphicsWindowedSize;
static readonly int2 OriginalGraphicsFullscreenSize; static readonly int2 OriginalGraphicsFullscreenSize;
static readonly bool OriginalGraphicsHardwareCursors;
static readonly bool OriginalServerDiscoverNatDevices; static readonly bool OriginalServerDiscoverNatDevices;
readonly Dictionary<PanelType, Action> leavePanelActions = new Dictionary<PanelType, Action>(); readonly Dictionary<PanelType, Action> leavePanelActions = new Dictionary<PanelType, Action>();
@@ -53,7 +52,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
OriginalGraphicsMode = original.Graphics.Mode; OriginalGraphicsMode = original.Graphics.Mode;
OriginalGraphicsWindowedSize = original.Graphics.WindowedSize; OriginalGraphicsWindowedSize = original.Graphics.WindowedSize;
OriginalGraphicsFullscreenSize = original.Graphics.FullscreenSize; OriginalGraphicsFullscreenSize = original.Graphics.FullscreenSize;
OriginalGraphicsHardwareCursors = original.Graphics.HardwareCursors;
OriginalServerDiscoverNatDevices = original.Server.DiscoverNatDevices; OriginalServerDiscoverNatDevices = original.Server.DiscoverNatDevices;
} }
@@ -84,8 +82,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
current.Graphics.Mode != OriginalGraphicsMode || current.Graphics.Mode != OriginalGraphicsMode ||
current.Graphics.WindowedSize != OriginalGraphicsWindowedSize || current.Graphics.WindowedSize != OriginalGraphicsWindowedSize ||
current.Graphics.FullscreenSize != OriginalGraphicsFullscreenSize || current.Graphics.FullscreenSize != OriginalGraphicsFullscreenSize ||
current.Server.DiscoverNatDevices != OriginalServerDiscoverNatDevices || current.Server.DiscoverNatDevices != OriginalServerDiscoverNatDevices)
current.Graphics.HardwareCursors != OriginalGraphicsHardwareCursors)
{ {
Action restart = () => Action restart = () =>
{ {
@@ -211,7 +208,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var ds = Game.Settings.Graphics; var ds = Game.Settings.Graphics;
var gs = Game.Settings.Game; var gs = Game.Settings.Game;
BindCheckboxPref(panel, "HARDWARECURSORS_CHECKBOX", ds, "HardwareCursors");
BindCheckboxPref(panel, "CURSORDOUBLE_CHECKBOX", ds, "CursorDouble"); BindCheckboxPref(panel, "CURSORDOUBLE_CHECKBOX", ds, "CursorDouble");
BindCheckboxPref(panel, "VSYNC_CHECKBOX", ds, "VSync"); BindCheckboxPref(panel, "VSYNC_CHECKBOX", ds, "VSync");
BindCheckboxPref(panel, "FRAME_LIMIT_CHECKBOX", ds, "CapFramerate"); BindCheckboxPref(panel, "FRAME_LIMIT_CHECKBOX", ds, "CapFramerate");

View File

@@ -124,20 +124,13 @@ Container@SETTINGS_PANEL:
Height: 25 Height: 25
MaxLength: 5 MaxLength: 5
Type: Integer Type: Integer
Checkbox@HARDWARECURSORS_CHECKBOX:
X: 80
Y: 75
Width: 200
Height: 20
Font: Regular
Text: Use Hardware Cursors
Label@VIDEO_DESC: Label@VIDEO_DESC:
Y: 97 Y: 67
Width: PARENT_RIGHT Width: PARENT_RIGHT
Height: 25 Height: 25
Font: Tiny Font: Tiny
Align: Center Align: Center
Text: Mode, resolution, and cursor changes will be applied after the game is restarted Text: Mode and resolution changes will be applied after the game is restarted
Checkbox@VSYNC_CHECKBOX: Checkbox@VSYNC_CHECKBOX:
X: 80 X: 80
Y: 125 Y: 125

View File

@@ -138,20 +138,13 @@ Background@SETTINGS_PANEL:
Height: 25 Height: 25
MaxLength: 5 MaxLength: 5
Type: Integer Type: Integer
Checkbox@HARDWARECURSORS_CHECKBOX:
X: 80
Y: 75
Width: 200
Height: 20
Font: Regular
Text: Use Hardware Cursors
Label@VIDEO_DESC: Label@VIDEO_DESC:
Y: 97 Y: 67
Width: PARENT_RIGHT Width: PARENT_RIGHT
Height: 25 Height: 25
Font: Tiny Font: Tiny
Align: Center Align: Center
Text: Mode, resolution, and cursor changes will be applied after the game is restarted Text: Mode and resolutiom changes will be applied after the game is restarted
Checkbox@VSYNC_CHECKBOX: Checkbox@VSYNC_CHECKBOX:
X: 80 X: 80
Y: 125 Y: 125