Fix IDE0032

This commit is contained in:
RoosterDragon
2023-02-19 11:19:28 +00:00
committed by Pavel Penev
parent e64c0a35c5
commit 98c4eaca83
52 changed files with 460 additions and 567 deletions

View File

@@ -22,10 +22,9 @@ namespace OpenRA.Platforms.Default
{
sealed class Sdl2PlatformWindow : ThreadAffine, IPlatformWindow
{
readonly IGraphicsContext context;
readonly Sdl2Input input;
public IGraphicsContext Context => context;
public IGraphicsContext Context { get; }
readonly IntPtr window;
bool disposed;
@@ -341,12 +340,12 @@ namespace OpenRA.Platforms.Default
{
var ctx = new Sdl2GraphicsContext(this);
ctx.InitializeOpenGL();
context = ctx;
Context = ctx;
}
else
context = new ThreadedGraphicsContext(new Sdl2GraphicsContext(this), batchSize);
Context = new ThreadedGraphicsContext(new Sdl2GraphicsContext(this), batchSize);
context.SetVSyncEnabled(Game.Settings.Graphics.VSync);
Context.SetVSyncEnabled(Game.Settings.Graphics.VSync);
SDL.SDL_SetModState(SDL.SDL_Keymod.KMOD_NONE);
input = new Sdl2Input();
@@ -467,7 +466,7 @@ namespace OpenRA.Platforms.Default
disposed = true;
context?.Dispose();
Context?.Dispose();
if (Window != IntPtr.Zero)
SDL.SDL_DestroyWindow(Window);

View File

@@ -566,7 +566,6 @@ namespace OpenRA.Platforms.Default
class ThreadedTexture : ITextureInternal
{
readonly ThreadedGraphicsContext device;
readonly uint id;
readonly Func<object> getScaleFilter;
readonly Action<object> setScaleFilter;
readonly Func<object> getSize;
@@ -581,7 +580,7 @@ namespace OpenRA.Platforms.Default
public ThreadedTexture(ThreadedGraphicsContext device, ITextureInternal texture)
{
this.device = device;
id = texture.ID;
ID = texture.ID;
getScaleFilter = () => texture.ScaleFilter;
setScaleFilter = value => texture.ScaleFilter = (TextureScaleFilter)value;
getSize = () => texture.Size;
@@ -594,7 +593,7 @@ namespace OpenRA.Platforms.Default
dispose = texture.Dispose;
}
public uint ID => id;
public uint ID { get; }
public TextureScaleFilter ScaleFilter
{